Skip to content

Commit 1ef3d21

Browse files
committed
Changelog for v4
1 parent 516c52a commit 1ef3d21

9 files changed

+63
-17
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Unreleased
22

3+
# 4.0.0
4+
5+
* [Breaking] Complete refactor to take advantage of new Stimulus features, completely rewrite transitions, and more! 🎉
6+
* [Breaking] The main export is now cjs format and the module export is esm. We've dropped other formats as part of the move to esbuild.
7+
* [Breaking] Use `data-action"controller#method:prevent` to call `preventDefault` where needed. Components will no longer prevent default automatically.
8+
* Transitions now follow the TailwindCSS enter/leave pattern. This is based on the el-transition library.
9+
```html
10+
<div class="hidden whatever default styles"
11+
data-transition-enter="transition duration-300"
12+
data-transition-enter-from="opacity-0"
13+
data-transition-enter-to="opacity-100"
14+
data-transition-leave="transition duration-300"
15+
data-transition-leave-from="opacity-100"
16+
data-transition-leave-to="opacity-0"
17+
>
18+
Content fades opacity over 300ms
19+
</div>
20+
```
21+
These should be applied to the element that will transition. For example, apply these attributes to the menu element of a Dropdown.
22+
* Alert transition classes have been moved to the transition API.
23+
* Autosave now uses `requestSubmit` for submitting the form.
24+
* Autosave now has configurable submitDuration, statusDuration, submittingText, successText, and errorText.
25+
* ColorPreview now uses styleValue instead of `data-style` to define which CSS style it applies to (color, backgroundColor, etc).
26+
* Dropdown transition classes have been moved to the transition API.
27+
* Modal transition classes have been moved to the transition API.
28+
* Modals now use a backgroundTarget to customize the background. `backdropColorValue` has been removed since this should be specified on your backdrop instead.
29+
* Modals now use the `open` value to trigger the opening and closing of the modal.
30+
* Popover transition classes have been moved to the transition API.
31+
* Popovers now use `show` and `hide` instead of `mouseOver` and `mouseOut`.
32+
* Slideovers transition classes have been moved to the transition API.
33+
* Tabs now use activeTab and inactiveTab Stimulus classes
34+
* Tabs also store the selected index in the indexValue
35+
* Tabs can be set to update the URL anchor when a tab is selected using `updateAnchorValue`
36+
* Toggles now support the transition API.
37+
338
# 3.0.1
439

540
* Fix undefined scroll position - @PhilippMeissner

dist/tailwindcss-stimulus-components.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

dist/tailwindcss-stimulus-components.cjs.map

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

dist/tailwindcss-stimulus-components.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/tailwindcss-stimulus-components.module.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<script type="module">
2222
import { Application } from "@hotwired/stimulus";
23-
import { Alert, ColorPreview, Dropdown, Modal, Popover, Slideover, Tabs, Toggle } from "tailwindcss-stimulus-components";
23+
import { Alert, ColorPreview, Dialog, Dropdown, Modal, Popover, Slideover, Tabs, Toggle } from "tailwindcss-stimulus-components";
2424

2525
(() => {
2626
const application = Application.start();
@@ -167,10 +167,10 @@ <h2 class="text-2xl text-gray-800 font-semibold mb-4">Popovers</h2>
167167
<span class="underline">Hover me</span>
168168
<div class="hidden absolute left-0 bottom-7 w-max bg-white border border-gray-200 shadow rounded p-2"
169169
data-popover-target="content"
170-
data-transition-enter="transition-opacity ease-in-out duration-100"
170+
data-transition-enter="transition-opacity ease-in-out duration-300"
171171
data-transition-enter-from="opacity-0"
172172
data-transition-enter-to="opacity-100"
173-
data-transition-leave="transition-opacity ease-in-out duration-100"
173+
data-transition-leave="transition-opacity ease-in-out duration-300"
174174
data-transition-leave-from="opacity-100"
175175
data-transition-leave-to="opacity-0"
176176
>

src/alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import { enter, leave } from "./transition"
3030
export default class extends Controller {
3131
static values = {
3232
dismissAfter: Number,
33+
showDelay: { type: Number, default: 0 },
3334
removeDelay: { type: Number, default: 1100 }
3435
}
35-
static classes = ["show", "hide"]
3636

3737
connect() {
3838
setTimeout(() => {

0 commit comments

Comments
 (0)