Skip to content

Commit 6695428

Browse files
committed
[Toolkit] Pin tales-from-a-dev/twig-tailwind-extra to ^1.0.0
2 parents c756147 + 9f433f9 commit 6695428

File tree

60 files changed

+438
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+438
-160
lines changed

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"rules": {
2222
"suspicious": {
2323
"noExplicitAny": "off",
24-
"noEmptyBlockStatements": "off"
24+
"noEmptyBlockStatements": "off",
25+
"noPrototypeBuiltins": "off"
2526
},
2627
"complexity": {
2728
"noStaticOnlyClass": "off",

src/Toolkit/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"spatie/phpunit-snapshot-assertions": "^4.2.17|^5.2.3",
5252
"phpunit/phpunit": "^9.6.22",
5353
"symfony/ux-icons": "^2.18",
54-
"tales-from-a-dev/twig-tailwind-extra": "^0.4.0"
54+
"tales-from-a-dev/twig-tailwind-extra": "^1.0.0"
5555
},
5656
"bin": [
5757
"bin/ux-toolkit-kit-create",

src/Toolkit/kits/shadcn/alert-dialog/EXAMPLES.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,3 @@
2222
</twig:AlertDialog:Content>
2323
</twig:AlertDialog>
2424
```
25-
26-
## Opened by default
27-
28-
```twig {"preview":true,"height":"500px"}
29-
<twig:AlertDialog id="delete_account" open>
30-
<twig:AlertDialog:Trigger>
31-
<twig:Button {{ ...trigger_attrs }}>Open</twig:Button>
32-
</twig:AlertDialog:Trigger>
33-
<twig:AlertDialog:Content>
34-
<twig:AlertDialog:Header>
35-
<twig:AlertDialog:Title>Are you absolutely sure?</twig:AlertDialog:Title>
36-
<twig:AlertDialog:Description>
37-
This action cannot be undone. This will permanently delete your account
38-
and remove your data from our servers.
39-
</twig:AlertDialog:Description>
40-
</twig:AlertDialog:Header>
41-
<twig:AlertDialog:Footer>
42-
<twig:AlertDialog:Cancel>Cancel</twig:AlertDialog:Cancel>
43-
<twig:AlertDialog:Action>Continue</twig:AlertDialog:Action>
44-
</twig:AlertDialog:Footer>
45-
</twig:AlertDialog:Content>
46-
</twig:AlertDialog>
47-
```
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
11
import { Controller } from '@hotwired/stimulus';
2-
import { enter, leave } from 'el-transition';
32

43
export default class extends Controller {
54

6-
static targets = ['trigger', 'overlay', 'dialog', 'content'];
5+
static targets = ['trigger', 'dialog'];
76

87
async open() {
98
this.dialogTarget.showModal();
109

11-
await Promise.all([enter(this.overlayTarget), enter(this.contentTarget)]);
12-
1310
if (this.hasTriggerTarget) {
14-
this.triggerTarget.setAttribute('aria-expanded', 'true');
11+
if (this.dialogTarget.getAnimations().length > 0) {
12+
this.dialogTarget.addEventListener('transitionend', () => {
13+
this.triggerTarget.setAttribute('aria-expanded', 'true');
14+
})
15+
} else {
16+
this.triggerTarget.setAttribute('aria-expanded', 'true');
17+
}
1518
}
1619
}
1720

1821
async close() {
19-
await Promise.all([leave(this.overlayTarget), leave(this.contentTarget)]);
20-
2122
this.dialogTarget.close();
2223

2324
if (this.hasTriggerTarget) {
24-
this.triggerTarget.setAttribute('aria-expanded', 'false');
25+
if (this.dialogTarget.getAnimations().length > 0) {
26+
this.dialogTarget.addEventListener('transitionend', () => {
27+
this.triggerTarget.setAttribute('aria-expanded', 'false');
28+
})
29+
} else {
30+
this.triggerTarget.setAttribute('aria-expanded', 'false');
31+
}
2532
}
2633
}
2734
}

src/Toolkit/kits/shadcn/alert-dialog/manifest.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
},
1010
"dependencies": {
1111
"recipe": ["button"],
12-
"composer": ["twig/extra-bundle", "twig/html-extra:^3.12.0", "tales-from-a-dev/twig-tailwind-extra"],
13-
"npm": ["el-transition"],
14-
"importmap": ["el-transition"]
12+
"composer": ["twig/extra-bundle", "twig/html-extra:^3.12.0", "tales-from-a-dev/twig-tailwind-extra:^1.0.0"]
1513
}
1614
}

src/Toolkit/kits/shadcn/alert-dialog/templates/components/AlertDialog.html.twig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{# @prop open boolean Open (or not) the AlertDialog at initial rendering, default to `false` #}
1+
{# @prop id string Unique suffix identifier for generating AlertDialog internal IDs #}
22
{# @block content The default block #}
3-
{%- props open = false, id -%}
3+
{%- props id -%}
44

5-
{%- set _alert_dialog_open = open %}
65
{%- set _alert_dialog_id = 'alert-dialog-' ~ id -%}
76
{%- set _alert_dialog_title_id = _alert_dialog_id ~ '-title' -%}
87
{%- set _alert_dialog_description_id = _alert_dialog_id ~ '-description' -%}
Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,10 @@
11
{# @block content The default block #}
22
<dialog
33
id="{{ _alert_dialog_id }}"
4-
{{ _alert_dialog_open ? 'open' }}
5-
class="{{ 'fixed inset-0 size-auto max-h-none max-w-none overflow-y-auto bg-transparent backdrop:bg-transparent ' ~ attributes.render('class')|tailwind_merge }}"
4+
class="{{ 'bg-background fixed top-[50%] left-[50%] z-50 max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] scale-95 gap-4 rounded-lg border p-6 opacity-0 shadow-lg transition-all transition-discrete duration-200 backdrop:transition-discrete backdrop:duration-150 open:grid open:scale-100 open:opacity-100 open:backdrop:bg-black/50 sm:max-w-lg starting:open:scale-95 starting:open:opacity-0 ' ~ attributes.render('class')|tailwind_merge }}"
65
data-alert-dialog-target="dialog"
76
data-action="keydown.esc->alert-dialog#close:prevent"
87
{{ attributes.without('id') }}
98
>
10-
<div
11-
data-alert-dialog-target="overlay"
12-
data-transition-enter="transition ease-out duration-100"
13-
data-transition-enter-start="transform opacity-0"
14-
data-transition-enter-end="transform opacity-100"
15-
data-transition-leave="transition ease-in duration-75"
16-
data-transition-leave-start="transform opacity-100"
17-
data-transition-leave-end="transform opacity-0"
18-
class="{{ _alert_dialog_open ? '' : 'hidden' }} fixed inset-0 z-50 bg-black/50"
19-
></div>
20-
21-
<section
22-
tabindex="0"
23-
class="flex min-h-full items-end justify-center p-4 text-center focus:outline-none sm:items-center sm:p-0"
24-
>
25-
<div
26-
data-transition-enter="transition ease-out duration-200"
27-
data-transition-enter-start="transform opacity-0 scale-95"
28-
data-transition-enter-end="transform opacity-100 scale-100"
29-
data-transition-leave="transition ease-in duration-75"
30-
data-transition-leave-start="transform opacity-100 scale-100"
31-
data-transition-leave-end="transform opacity-0 scale-95"
32-
class="{{ _alert_dialog_open ? '' : 'hidden' }} bg-background fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg sm:max-w-lg"
33-
data-alert-dialog-target="content"
34-
>
35-
{%- block content %}{% endblock -%}
36-
</div>
37-
</section>
9+
{%- block content %}{% endblock -%}
3810
</dialog>

src/Toolkit/kits/shadcn/alert-dialog/templates/components/AlertDialog/Trigger.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
'data-action': 'click->alert-dialog#open',
44
'data-alert-dialog-target': 'trigger',
55
'aria-haspopup': 'dialog',
6-
'aria-expanded': _alert_dialog_open ? 'true' : 'false',
6+
'aria-expanded': 'false',
77
} -%}
88
{%- block content %}{% endblock -%}

src/Toolkit/kits/shadcn/alert/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"templates/": "templates/"
88
},
99
"dependencies": {
10-
"composer": ["twig/extra-bundle", "twig/html-extra:^3.12.0", "tales-from-a-dev/twig-tailwind-extra"]
10+
"composer": ["twig/extra-bundle", "twig/html-extra:^3.12.0", "tales-from-a-dev/twig-tailwind-extra:^1.0.0"]
1111
}
1212
}

src/Toolkit/kits/shadcn/avatar/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"templates/": "templates/"
88
},
99
"dependencies": {
10-
"composer": ["tales-from-a-dev/twig-tailwind-extra"]
10+
"composer": ["tales-from-a-dev/twig-tailwind-extra:^1.0.0"]
1111
}
1212
}

0 commit comments

Comments
 (0)