@zazz-ui/core 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTHORING.md +158 -0
- package/CHANGELOG.md +331 -0
- package/README.md +55 -23
- package/dist/scroll-state-C8mA5gq6.js +1 -0
- package/dist/sri.json +124 -72
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +116794 -0
- package/editor/zazz.html-data.json +1683 -0
- package/editor/zazz.language-data.json +5001 -0
- package/editor/zazz.lint-data.json +152 -0
- package/package.json +12 -5
- package/src/base/_breakpoints.css +12 -0
- package/src/base/_layers.css +8 -9
- package/src/base/_properties-2xl.css +171 -0
- package/src/base/_properties-active.css +107 -0
- package/src/base/_properties-checked.css +107 -0
- package/src/base/_properties-current.css +107 -0
- package/src/base/_properties-disabled.css +107 -0
- package/src/base/_properties-focus-visible.css +107 -0
- package/src/base/_properties-focus-within.css +107 -0
- package/src/base/_properties-hover.css +107 -0
- package/src/base/_properties-lg.css +171 -0
- package/src/base/_properties-md.css +171 -0
- package/src/base/_properties-open.css +107 -0
- package/src/base/_properties-sm.css +171 -0
- package/src/base/_properties-starting.css +55 -0
- package/src/base/_properties-stuck.css +55 -0
- package/src/base/_properties-xl.css +171 -0
- package/src/base/_properties.css +555 -0
- package/src/base/_reset.css +67 -75
- package/src/base/_switches.css +145 -0
- package/src/base/_typography.css +437 -370
- package/src/base/_utilities-box.css +142 -0
- package/src/base/_utilities-color.css +290 -0
- package/src/base/_utilities-effects.css +235 -0
- package/src/base/_utilities-flow.css +312 -0
- package/src/base/_utilities-grid.css +143 -0
- package/src/base/_utilities-margin.css +376 -0
- package/src/base/_utilities-pseudo.css +426 -0
- package/src/base/_utilities-sizing.css +259 -0
- package/src/base/_utilities-spacing.css +190 -0
- package/src/base/_utilities-tier-2xl.css +93 -0
- package/src/base/_utilities-tier-active.css +61 -0
- package/src/base/_utilities-tier-checked.css +61 -0
- package/src/base/_utilities-tier-current.css +61 -0
- package/src/base/_utilities-tier-disabled.css +61 -0
- package/src/base/_utilities-tier-focus-visible.css +61 -0
- package/src/base/_utilities-tier-focus-within.css +61 -0
- package/src/base/_utilities-tier-hover.css +63 -0
- package/src/base/_utilities-tier-lg.css +93 -0
- package/src/base/_utilities-tier-md.css +93 -0
- package/src/base/_utilities-tier-open.css +61 -0
- package/src/base/_utilities-tier-sm.css +93 -0
- package/src/base/_utilities-tier-starting.css +35 -0
- package/src/base/_utilities-tier-stuck.css +114 -0
- package/src/base/_utilities-tier-xl.css +93 -0
- package/src/base/_utilities-typography.css +141 -0
- package/src/base/_variables.css +323 -372
- package/src/base/_view-transitions.css +10 -12
- package/src/base/command-score.d.ts.map +1 -1
- package/src/base/command-score.js +1 -2
- package/src/base/command-score.ts +1 -2
- package/src/base/dialog-lifecycle.js +1 -1
- package/src/base/dialog-lifecycle.ts +1 -1
- package/src/base/embla.d.ts +6 -7
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +89 -55
- package/src/base/embla.ts +89 -55
- package/src/base/hotkeys.d.ts +0 -5
- package/src/base/hotkeys.d.ts.map +1 -1
- package/src/base/hotkeys.ts +0 -5
- package/src/base/navigation.d.ts +12 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +229 -86
- package/src/base/navigation.ts +224 -92
- package/src/base/reveal.js +14 -14
- package/src/base/reveal.ts +14 -14
- package/src/base/scroll-state.d.ts +21 -0
- package/src/base/scroll-state.d.ts.map +1 -0
- package/src/base/scroll-state.js +177 -0
- package/src/base/scroll-state.ts +188 -0
- package/src/base/signals.d.ts +1 -2
- package/src/base/signals.d.ts.map +1 -1
- package/src/base/signals.js +4 -6
- package/src/base/signals.ts +4 -6
- package/src/base/style-format.d.ts +33 -0
- package/src/base/style-format.d.ts.map +1 -0
- package/src/base/style-format.js +160 -0
- package/src/base/style-format.ts +180 -0
- package/src/base/typeahead.d.ts +19 -4
- package/src/base/typeahead.d.ts.map +1 -1
- package/src/base/typeahead.js +68 -21
- package/src/base/typeahead.ts +73 -23
- package/src/base/utilities.d.ts +188 -0
- package/src/base/utilities.d.ts.map +1 -0
- package/src/base/utilities.js +750 -0
- package/src/base/utilities.ts +865 -0
- package/src/base/utils.d.ts +3 -7
- package/src/base/utils.d.ts.map +1 -1
- package/src/base/utils.js +4 -8
- package/src/base/utils.ts +4 -8
- package/src/base/zazz-element.d.ts +14 -8
- package/src/base/zazz-element.d.ts.map +1 -1
- package/src/base/zazz-element.js +14 -8
- package/src/base/zazz-element.ts +15 -8
- package/src/globals.d.ts +1 -1
- package/src/head.d.ts +50 -4
- package/src/head.d.ts.map +1 -1
- package/src/head.js +119 -38
- package/src/head.ts +172 -41
- package/src/index.css +57 -14
- package/src/index.js +5 -0
- package/src/index.ts +6 -0
- package/src/manifest.d.ts +36 -5
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +150 -6
- package/src/manifest.ts +167 -9
- package/src/primitives/accordion/accordion.css +18 -17
- package/src/primitives/accordion/accordion.html +42 -9
- package/src/primitives/alert-dialog/alert-dialog.css +13 -13
- package/src/primitives/alert-dialog/alert-dialog.html +26 -12
- package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
- package/src/primitives/autocomplete/autocomplete.css +43 -39
- package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.html +38 -26
- package/src/primitives/autocomplete/autocomplete.js +6 -5
- package/src/primitives/autocomplete/autocomplete.ts +6 -5
- package/src/primitives/avatar/avatar.html +110 -15
- package/src/primitives/badge/badge-icon.html +22 -8
- package/src/primitives/badge/badge.css +401 -128
- package/src/primitives/badge/badge.html +12 -6
- package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
- package/src/primitives/button/button-icon-only.html +17 -11
- package/src/primitives/button/button-icon.html +9 -3
- package/src/primitives/button/button.css +408 -164
- package/src/primitives/button/button.html +14 -7
- package/src/primitives/button-group/button-group-vertical.html +5 -5
- package/src/primitives/button-group/button-group.css +53 -25
- package/src/primitives/button-group/button-group.html +18 -12
- package/src/primitives/callout/callout.css +114 -0
- package/src/primitives/callout/callout.html +188 -0
- package/src/primitives/card/card-subgrid.html +249 -34
- package/src/primitives/card/card.css +125 -0
- package/src/primitives/card/card.html +141 -20
- package/src/primitives/carousel/carousel.css +30 -20
- package/src/primitives/carousel/carousel.d.ts +7 -10
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.html +420 -84
- package/src/primitives/carousel/carousel.js +1 -1
- package/src/primitives/carousel/carousel.ts +8 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
- package/src/primitives/checkbox/checkbox.css +98 -40
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/src/primitives/checkbox/checkbox.html +13 -8
- package/src/primitives/checkbox/checkbox.js +7 -9
- package/src/primitives/checkbox/checkbox.ts +7 -15
- package/src/primitives/combobox/combobox-multiselect.html +53 -33
- package/src/primitives/combobox/combobox.css +145 -122
- package/src/primitives/combobox/combobox.d.ts +12 -11
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.html +48 -28
- package/src/primitives/combobox/combobox.js +46 -51
- package/src/primitives/combobox/combobox.ts +48 -55
- package/src/primitives/command/command-actions.d.ts +2 -3
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +48 -33
- package/src/primitives/command/command-actions.js +12 -10
- package/src/primitives/command/command-actions.ts +12 -13
- package/src/primitives/command/command-dialog.html +49 -25
- package/src/primitives/command/command.css +52 -42
- package/src/primitives/command/command.d.ts +10 -7
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.html +95 -46
- package/src/primitives/command/command.js +30 -13
- package/src/primitives/command/command.ts +30 -12
- package/src/primitives/debug/audit-core.d.ts +64 -0
- package/src/primitives/debug/audit-core.d.ts.map +1 -0
- package/src/primitives/debug/audit-core.js +356 -0
- package/src/primitives/debug/audit-core.ts +535 -0
- package/src/primitives/debug/debug.d.ts +50 -0
- package/src/primitives/debug/debug.d.ts.map +1 -0
- package/src/primitives/debug/debug.js +168 -0
- package/src/primitives/debug/debug.ts +211 -0
- package/src/primitives/dialog/dialog-with-form.html +67 -45
- package/src/primitives/dialog/dialog.css +87 -61
- package/src/primitives/dialog/dialog.html +25 -17
- package/src/primitives/fields/fields.css +108 -134
- package/src/primitives/fields/fields.html +39 -0
- package/src/primitives/input/input-icon-leading.html +3 -3
- package/src/primitives/input/input-icon-trailing.html +3 -3
- package/src/primitives/input/input.css +87 -49
- package/src/primitives/input/input.html +15 -15
- package/src/primitives/input-group/input-group-password-group.html +15 -15
- package/src/primitives/input-group/input-group.css +118 -75
- package/src/primitives/input-group/input-group.html +42 -30
- package/src/primitives/kbd/kbd-group.html +15 -2
- package/src/primitives/kbd/kbd.css +44 -31
- package/src/primitives/kbd/kbd.html +7 -1
- package/src/primitives/layout/layout.css +159 -0
- package/src/primitives/layout/layout.html +35 -0
- package/src/primitives/lightbox/lightbox.css +178 -105
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
- package/src/primitives/lightbox/lightbox.html +138 -166
- package/src/primitives/lightbox/lightbox.js +10 -13
- package/src/primitives/lightbox/lightbox.ts +12 -13
- package/src/primitives/menu/menu-interest.html +60 -18
- package/src/primitives/menu/menu.css +22 -17
- package/src/primitives/menu/menu.d.ts +5 -5
- package/src/primitives/menu/menu.html +195 -40
- package/src/primitives/menu/menu.js +8 -8
- package/src/primitives/menu/menu.ts +8 -8
- package/src/primitives/menubar/menubar-help-search.html +78 -32
- package/src/primitives/menubar/menubar.html +166 -38
- package/src/primitives/meter/meter.css +41 -38
- package/src/primitives/meter/meter.html +44 -9
- package/src/primitives/mobile-menu/mobile-menu.css +47 -40
- package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
- package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
- package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
- package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
- package/src/primitives/navigation-menu/navigation-menu.css +104 -106
- package/src/primitives/navigation-menu/navigation-menu.html +554 -158
- package/src/primitives/otp/otp.css +43 -44
- package/src/primitives/otp/otp.d.ts +4 -5
- package/src/primitives/otp/otp.d.ts.map +1 -1
- package/src/primitives/otp/otp.html +7 -6
- package/src/primitives/otp/otp.js +13 -18
- package/src/primitives/otp/otp.ts +12 -19
- package/src/primitives/password-group/password-group.css +132 -107
- package/src/primitives/password-group/password-group.d.ts.map +1 -1
- package/src/primitives/password-group/password-group.html +23 -16
- package/src/primitives/password-group/password-group.js +11 -12
- package/src/primitives/password-group/password-group.ts +11 -12
- package/src/primitives/popover/popover.css +88 -95
- package/src/primitives/popover/popover.html +18 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -1
- package/src/primitives/progress/progress.css +34 -35
- package/src/primitives/progress/progress.html +18 -4
- package/src/primitives/prose/prose.html +19 -12
- package/src/primitives/radio/radio.css +83 -46
- package/src/primitives/radio/radio.html +16 -11
- package/src/primitives/reveal/reveal.css +37 -46
- package/src/primitives/reveal/reveal.html +15 -0
- package/src/primitives/scroll-fade/scroll-fade.css +115 -0
- package/src/primitives/scroll-fade/scroll-fade.html +69 -0
- package/src/primitives/select/multiselect.d.ts +8 -10
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +23 -27
- package/src/primitives/select/multiselect.ts +23 -29
- package/src/primitives/select/select-align.html +79 -16
- package/src/primitives/select/select-multiple.html +8 -4
- package/src/primitives/select/select-sides.html +104 -21
- package/src/primitives/select/select.css +297 -186
- package/src/primitives/select/select.html +24 -5
- package/src/primitives/separator/separator.css +15 -18
- package/src/primitives/separator/separator.html +37 -10
- package/src/primitives/slider/slider.css +48 -38
- package/src/primitives/slider/slider.html +9 -1
- package/src/primitives/style-guard/style-guard.d.ts +19 -0
- package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
- package/src/primitives/style-guard/style-guard.js +125 -0
- package/src/primitives/style-guard/style-guard.ts +153 -0
- package/src/primitives/switch/switch.css +42 -33
- package/src/primitives/switch/switch.html +11 -6
- package/src/primitives/table/table-alternating.html +1 -1
- package/src/primitives/table/table-grid.html +5 -5
- package/src/primitives/table/table-size-sm.html +1 -1
- package/src/primitives/table/table.css +64 -61
- package/src/primitives/table/table.html +7 -7
- package/src/primitives/tabs/tabs.css +167 -166
- package/src/primitives/tabs/tabs.d.ts +10 -11
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.html +192 -36
- package/src/primitives/tabs/tabs.js +14 -15
- package/src/primitives/tabs/tabs.ts +14 -15
- package/src/primitives/textarea/textarea.css +69 -44
- package/src/primitives/textarea/textarea.html +3 -3
- package/src/primitives/toaster/toaster.css +90 -92
- package/src/primitives/toaster/toaster.d.ts +0 -6
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.html +22 -18
- package/src/primitives/toaster/toaster.js +64 -72
- package/src/primitives/toaster/toaster.ts +71 -87
- package/src/primitives/toggle/toggle.css +368 -153
- package/src/primitives/toggle/toggle.html +27 -9
- package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
- package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
- package/src/primitives/toggle-group/toggle-group.css +71 -23
- package/src/primitives/toggle-group/toggle-group.html +3 -3
- package/src/primitives/toolbar/toolbar.html +35 -13
- package/src/primitives/tooltip/tooltip-disabled.html +3 -3
- package/src/primitives/tooltip/tooltip-sides.html +36 -14
- package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
- package/src/primitives/tooltip/tooltip.css +111 -80
- package/src/primitives/tooltip/tooltip.html +3 -3
- package/src/primitives/utilities/aspect-ratio.html +51 -7
- package/src/primitives/utilities/basis.html +64 -11
- package/src/primitives/utilities/col-span.html +65 -9
- package/src/primitives/utilities/compose.html +48 -10
- package/src/primitives/utilities/flex-align.html +89 -19
- package/src/primitives/utilities/flex-direction.html +111 -13
- package/src/primitives/utilities/flex-grow.html +41 -7
- package/src/primitives/utilities/gap.html +158 -19
- package/src/primitives/utilities/grid-cols.html +75 -7
- package/src/primitives/utilities/grid-responsive.html +111 -12
- package/src/primitives/utilities/margin-auto.html +38 -7
- package/src/primitives/utilities/object-fit.html +75 -13
- package/src/primitives/utilities/order.html +40 -4
- package/src/primitives/utilities/overflow.html +74 -20
- package/src/primitives/utilities/padding-compose.html +67 -10
- package/src/primitives/utilities/padding.html +84 -13
- package/src/primitives/utilities/pile.html +29 -0
- package/src/primitives/utilities/position.html +65 -8
- package/src/primitives/utilities/responsive-flex.html +54 -7
- package/src/primitives/utilities/responsive-grid.html +115 -12
- package/src/primitives/utilities/size.html +120 -16
- package/src/primitives/utilities/width.html +123 -16
- package/examples/about.html +0 -583
- package/examples/components.html +0 -1028
- package/examples/forms.html +0 -504
- package/examples/index.html +0 -261
- package/examples/layout.html +0 -313
- package/examples/products.html +0 -839
- package/examples/responsive.html +0 -332
- package/src/base/_layout.css +0 -571
- package/src/base/_utilities.css +0 -6758
- package/src/primitives/utilities/grid-pile.html +0 -5
|
@@ -1,75 +1,231 @@
|
|
|
1
1
|
<!-- Tabs horizontal START -->
|
|
2
|
-
<ui-tabs
|
|
3
|
-
<div data-slot="
|
|
4
|
-
<div data-slot="
|
|
2
|
+
<ui-tabs style="--w: 100%">
|
|
3
|
+
<div data-tabs-slot="list" role="tablist">
|
|
4
|
+
<div data-tabs-slot="indicator" aria-hidden="true"></div>
|
|
5
5
|
|
|
6
6
|
<input type="radio" role="tab" name="tabs-group-1" id="tab-1" checked />
|
|
7
|
-
<label for="tab-1" data-slot="
|
|
8
|
-
<span data-slot="
|
|
7
|
+
<label for="tab-1" data-tabs-slot="label">
|
|
8
|
+
<span data-tabs-slot="label-text">Account</span>
|
|
9
9
|
</label>
|
|
10
10
|
|
|
11
11
|
<input type="radio" role="tab" name="tabs-group-1" id="tab-2" />
|
|
12
|
-
<label for="tab-2" data-slot="
|
|
13
|
-
<span data-slot="
|
|
12
|
+
<label for="tab-2" data-tabs-slot="label">
|
|
13
|
+
<span data-tabs-slot="label-text">Billing</span>
|
|
14
14
|
</label>
|
|
15
15
|
|
|
16
16
|
<input type="radio" role="tab" name="tabs-group-1" id="tab-3" />
|
|
17
|
-
<label for="tab-3" data-slot="
|
|
18
|
-
<span data-slot="
|
|
17
|
+
<label for="tab-3" data-tabs-slot="label">
|
|
18
|
+
<span data-tabs-slot="label-text">Notifications</span>
|
|
19
19
|
</label>
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
|
-
<div
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
<div
|
|
23
|
+
data-tabs-slot="panel"
|
|
24
|
+
role="tabpanel"
|
|
25
|
+
style="
|
|
26
|
+
--p: 6;
|
|
27
|
+
--w: 100%;
|
|
28
|
+
--border-color: var(--color-border);
|
|
29
|
+
--border-width: 1px;
|
|
30
|
+
--rounded: var(--radius-md);
|
|
31
|
+
"
|
|
32
|
+
>
|
|
33
|
+
<h2
|
|
34
|
+
style="
|
|
35
|
+
--font-size: var(--font-size-lg);
|
|
36
|
+
--font-weight: strong;
|
|
37
|
+
--leading: var(--leading-lg);
|
|
38
|
+
--tracking: var(--tracking-lg);
|
|
39
|
+
"
|
|
40
|
+
>
|
|
41
|
+
Account
|
|
42
|
+
</h2>
|
|
43
|
+
<p
|
|
44
|
+
style="
|
|
45
|
+
--mt: 2;
|
|
46
|
+
--text: var(--color-muted-foreground);
|
|
47
|
+
"
|
|
48
|
+
>
|
|
49
|
+
Manage your profile, email, and password.
|
|
50
|
+
</p>
|
|
25
51
|
</div>
|
|
26
52
|
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
|
|
53
|
+
<div
|
|
54
|
+
data-tabs-slot="panel"
|
|
55
|
+
role="tabpanel"
|
|
56
|
+
style="
|
|
57
|
+
--p: 6;
|
|
58
|
+
--w: 100%;
|
|
59
|
+
--border-color: var(--color-border);
|
|
60
|
+
--border-width: 1px;
|
|
61
|
+
--rounded: var(--radius-md);
|
|
62
|
+
"
|
|
63
|
+
>
|
|
64
|
+
<h2
|
|
65
|
+
style="
|
|
66
|
+
--font-size: var(--font-size-lg);
|
|
67
|
+
--font-weight: strong;
|
|
68
|
+
--leading: var(--leading-lg);
|
|
69
|
+
--tracking: var(--tracking-lg);
|
|
70
|
+
"
|
|
71
|
+
>
|
|
72
|
+
Billing
|
|
73
|
+
</h2>
|
|
74
|
+
<p
|
|
75
|
+
style="
|
|
76
|
+
--mt: 2;
|
|
77
|
+
--text: var(--color-muted-foreground);
|
|
78
|
+
"
|
|
79
|
+
>
|
|
80
|
+
Review invoices and update your payment method.
|
|
81
|
+
</p>
|
|
30
82
|
</div>
|
|
31
83
|
|
|
32
|
-
<div
|
|
33
|
-
|
|
34
|
-
|
|
84
|
+
<div
|
|
85
|
+
data-tabs-slot="panel"
|
|
86
|
+
role="tabpanel"
|
|
87
|
+
style="
|
|
88
|
+
--p: 6;
|
|
89
|
+
--w: 100%;
|
|
90
|
+
--border-color: var(--color-border);
|
|
91
|
+
--border-width: 1px;
|
|
92
|
+
--rounded: var(--radius-md);
|
|
93
|
+
"
|
|
94
|
+
>
|
|
95
|
+
<h2
|
|
96
|
+
style="
|
|
97
|
+
--font-size: var(--font-size-lg);
|
|
98
|
+
--font-weight: strong;
|
|
99
|
+
--leading: var(--leading-lg);
|
|
100
|
+
--tracking: var(--tracking-lg);
|
|
101
|
+
"
|
|
102
|
+
>
|
|
103
|
+
Notifications
|
|
104
|
+
</h2>
|
|
105
|
+
<p
|
|
106
|
+
style="
|
|
107
|
+
--mt: 2;
|
|
108
|
+
--text: var(--color-muted-foreground);
|
|
109
|
+
"
|
|
110
|
+
>
|
|
111
|
+
Choose what we email you about and how often.
|
|
112
|
+
</p>
|
|
35
113
|
</div>
|
|
36
114
|
</ui-tabs>
|
|
37
115
|
<!-- Tabs horizontal END -->
|
|
38
116
|
|
|
39
117
|
<!-- Tabs vertical START -->
|
|
40
|
-
<ui-tabs
|
|
41
|
-
<div data-slot="
|
|
42
|
-
<div data-slot="
|
|
118
|
+
<ui-tabs data-tabs-orientation="vertical" style="--w: 100%">
|
|
119
|
+
<div data-tabs-slot="list" role="tablist">
|
|
120
|
+
<div data-tabs-slot="indicator" aria-hidden="true"></div>
|
|
43
121
|
|
|
44
122
|
<input type="radio" role="tab" name="tabs-group-2" id="tab-vertical-1" checked />
|
|
45
|
-
<label for="tab-vertical-1" data-slot="
|
|
46
|
-
<span data-slot="
|
|
123
|
+
<label for="tab-vertical-1" data-tabs-slot="label">
|
|
124
|
+
<span data-tabs-slot="label-text">Account</span>
|
|
47
125
|
</label>
|
|
48
126
|
|
|
49
127
|
<input type="radio" role="tab" name="tabs-group-2" id="tab-vertical-2" />
|
|
50
|
-
<label for="tab-vertical-2" data-slot="
|
|
51
|
-
<span data-slot="
|
|
128
|
+
<label for="tab-vertical-2" data-tabs-slot="label">
|
|
129
|
+
<span data-tabs-slot="label-text">Billing</span>
|
|
52
130
|
</label>
|
|
53
131
|
|
|
54
132
|
<input type="radio" role="tab" name="tabs-group-2" id="tab-vertical-3" />
|
|
55
|
-
<label for="tab-vertical-3" data-slot="
|
|
56
|
-
<span data-slot="
|
|
133
|
+
<label for="tab-vertical-3" data-tabs-slot="label">
|
|
134
|
+
<span data-tabs-slot="label-text">Notifications</span>
|
|
57
135
|
</label>
|
|
58
136
|
</div>
|
|
59
137
|
|
|
60
|
-
<div
|
|
61
|
-
|
|
62
|
-
|
|
138
|
+
<div
|
|
139
|
+
data-tabs-slot="panel"
|
|
140
|
+
role="tabpanel"
|
|
141
|
+
style="
|
|
142
|
+
--p: 6;
|
|
143
|
+
--w: 100%;
|
|
144
|
+
--border-color: var(--color-border);
|
|
145
|
+
--border-width: 1px;
|
|
146
|
+
--rounded: var(--radius-md);
|
|
147
|
+
"
|
|
148
|
+
>
|
|
149
|
+
<h2
|
|
150
|
+
style="
|
|
151
|
+
--font-size: var(--font-size-lg);
|
|
152
|
+
--font-weight: strong;
|
|
153
|
+
--leading: var(--leading-lg);
|
|
154
|
+
--tracking: var(--tracking-lg);
|
|
155
|
+
"
|
|
156
|
+
>
|
|
157
|
+
Account
|
|
158
|
+
</h2>
|
|
159
|
+
<p
|
|
160
|
+
style="
|
|
161
|
+
--mt: 2;
|
|
162
|
+
--text: var(--color-muted-foreground);
|
|
163
|
+
"
|
|
164
|
+
>
|
|
165
|
+
Manage your profile, email, and password.
|
|
166
|
+
</p>
|
|
63
167
|
</div>
|
|
64
168
|
|
|
65
|
-
<div
|
|
66
|
-
|
|
67
|
-
|
|
169
|
+
<div
|
|
170
|
+
data-tabs-slot="panel"
|
|
171
|
+
role="tabpanel"
|
|
172
|
+
style="
|
|
173
|
+
--p: 6;
|
|
174
|
+
--w: 100%;
|
|
175
|
+
--border-color: var(--color-border);
|
|
176
|
+
--border-width: 1px;
|
|
177
|
+
--rounded: var(--radius-md);
|
|
178
|
+
"
|
|
179
|
+
>
|
|
180
|
+
<h2
|
|
181
|
+
style="
|
|
182
|
+
--font-size: var(--font-size-lg);
|
|
183
|
+
--font-weight: strong;
|
|
184
|
+
--leading: var(--leading-lg);
|
|
185
|
+
--tracking: var(--tracking-lg);
|
|
186
|
+
"
|
|
187
|
+
>
|
|
188
|
+
Billing
|
|
189
|
+
</h2>
|
|
190
|
+
<p
|
|
191
|
+
style="
|
|
192
|
+
--mt: 2;
|
|
193
|
+
--text: var(--color-muted-foreground);
|
|
194
|
+
"
|
|
195
|
+
>
|
|
196
|
+
Review invoices and update your payment method.
|
|
197
|
+
</p>
|
|
68
198
|
</div>
|
|
69
199
|
|
|
70
|
-
<div
|
|
71
|
-
|
|
72
|
-
|
|
200
|
+
<div
|
|
201
|
+
data-tabs-slot="panel"
|
|
202
|
+
role="tabpanel"
|
|
203
|
+
style="
|
|
204
|
+
--p: 6;
|
|
205
|
+
--w: 100%;
|
|
206
|
+
--border-color: var(--color-border);
|
|
207
|
+
--border-width: 1px;
|
|
208
|
+
--rounded: var(--radius-md);
|
|
209
|
+
"
|
|
210
|
+
>
|
|
211
|
+
<h2
|
|
212
|
+
style="
|
|
213
|
+
--font-size: var(--font-size-lg);
|
|
214
|
+
--font-weight: strong;
|
|
215
|
+
--leading: var(--leading-lg);
|
|
216
|
+
--tracking: var(--tracking-lg);
|
|
217
|
+
"
|
|
218
|
+
>
|
|
219
|
+
Notifications
|
|
220
|
+
</h2>
|
|
221
|
+
<p
|
|
222
|
+
style="
|
|
223
|
+
--mt: 2;
|
|
224
|
+
--text: var(--color-muted-foreground);
|
|
225
|
+
"
|
|
226
|
+
>
|
|
227
|
+
Choose what we email you about and how often.
|
|
228
|
+
</p>
|
|
73
229
|
</div>
|
|
74
230
|
</ui-tabs>
|
|
75
231
|
<!-- Tabs vertical END -->
|
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview `<ui-tabs>`: HTML web component for keyboard-enhanced tabs.
|
|
4
4
|
* @description Light-DOM custom element that augments the CSS-only radio
|
|
5
|
-
* tabs pattern with orientation-aware arrow-key navigation.
|
|
6
|
-
* replaces the `.tabs` wrapper `<div>` and carries the same class, so all
|
|
7
|
-
* existing CSS (panel visibility via `:has()`, the anchor-positioned
|
|
8
|
-
* indicator) applies unchanged.
|
|
5
|
+
* tabs pattern with orientation-aware arrow-key navigation.
|
|
9
6
|
*
|
|
10
7
|
* Keyboard behavior on the focused tab radio:
|
|
11
8
|
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs.
|
|
12
|
-
* - Vertical (`data-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
9
|
+
* - Vertical (`data-tabs-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
13
10
|
* - Home / End jump to the first / last enabled tab.
|
|
14
11
|
* - Navigation wraps around and skips disabled tabs.
|
|
15
12
|
*
|
|
@@ -18,13 +15,15 @@
|
|
|
18
15
|
* orientation and adds Home/End + wrap-around.
|
|
19
16
|
*
|
|
20
17
|
* @example
|
|
21
|
-
* <ui-tabs
|
|
22
|
-
* <div data-slot="
|
|
23
|
-
* <
|
|
24
|
-
* <label
|
|
18
|
+
* <ui-tabs>
|
|
19
|
+
* <div data-tabs-slot="list" role="tablist">
|
|
20
|
+
* <input type="radio" role="tab" name="tg" id="tg-1" checked />
|
|
21
|
+
* <label for="tg-1" data-tabs-slot="label">One</label>
|
|
22
|
+
* <input type="radio" role="tab" name="tg" id="tg-2" />
|
|
23
|
+
* <label for="tg-2" data-tabs-slot="label">Two</label>
|
|
25
24
|
* </div>
|
|
26
|
-
* <div data-slot="
|
|
27
|
-
* <div data-slot="
|
|
25
|
+
* <div data-tabs-slot="panel">…</div>
|
|
26
|
+
* <div data-tabs-slot="panel">…</div>
|
|
28
27
|
* </ui-tabs>
|
|
29
28
|
*/
|
|
30
29
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
|
|
@@ -41,16 +40,16 @@ class UiTabs extends ZazzElement {
|
|
|
41
40
|
const target = event.target;
|
|
42
41
|
if (!(target instanceof HTMLInputElement) || target.type !== "radio")
|
|
43
42
|
return;
|
|
44
|
-
const list = target.closest('[role="tablist"], [data-slot~="
|
|
45
|
-
//
|
|
46
|
-
if (!list || list.closest(
|
|
43
|
+
const list = target.closest('[role="tablist"], [data-tabs-slot~="list"]');
|
|
44
|
+
// ignore radios of a nested ui-tabs
|
|
45
|
+
if (!list || list.closest('ui-tabs, [data-ui~="tabs"]') !== this)
|
|
47
46
|
return;
|
|
48
47
|
const tabs = Array.from(list.querySelectorAll('input[type="radio"]'))
|
|
49
48
|
.filter((node) => node instanceof HTMLInputElement)
|
|
50
49
|
.filter((tab) => !tab.disabled);
|
|
51
50
|
if (tabs.length < 2)
|
|
52
51
|
return;
|
|
53
|
-
const vertical = this.getAttribute("data-orientation") === "vertical";
|
|
52
|
+
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
54
53
|
const prevKey = vertical ? "ArrowUp" : "ArrowLeft";
|
|
55
54
|
const nextKey = vertical ? "ArrowDown" : "ArrowRight";
|
|
56
55
|
const index = tabs.indexOf(target);
|
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview `<ui-tabs>`: HTML web component for keyboard-enhanced tabs.
|
|
5
5
|
* @description Light-DOM custom element that augments the CSS-only radio
|
|
6
|
-
* tabs pattern with orientation-aware arrow-key navigation.
|
|
7
|
-
* replaces the `.tabs` wrapper `<div>` and carries the same class, so all
|
|
8
|
-
* existing CSS (panel visibility via `:has()`, the anchor-positioned
|
|
9
|
-
* indicator) applies unchanged.
|
|
6
|
+
* tabs pattern with orientation-aware arrow-key navigation.
|
|
10
7
|
*
|
|
11
8
|
* Keyboard behavior on the focused tab radio:
|
|
12
9
|
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs.
|
|
13
|
-
* - Vertical (`data-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
10
|
+
* - Vertical (`data-tabs-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
14
11
|
* - Home / End jump to the first / last enabled tab.
|
|
15
12
|
* - Navigation wraps around and skips disabled tabs.
|
|
16
13
|
*
|
|
@@ -19,13 +16,15 @@
|
|
|
19
16
|
* orientation and adds Home/End + wrap-around.
|
|
20
17
|
*
|
|
21
18
|
* @example
|
|
22
|
-
* <ui-tabs
|
|
23
|
-
* <div data-slot="
|
|
24
|
-
* <
|
|
25
|
-
* <label
|
|
19
|
+
* <ui-tabs>
|
|
20
|
+
* <div data-tabs-slot="list" role="tablist">
|
|
21
|
+
* <input type="radio" role="tab" name="tg" id="tg-1" checked />
|
|
22
|
+
* <label for="tg-1" data-tabs-slot="label">One</label>
|
|
23
|
+
* <input type="radio" role="tab" name="tg" id="tg-2" />
|
|
24
|
+
* <label for="tg-2" data-tabs-slot="label">Two</label>
|
|
26
25
|
* </div>
|
|
27
|
-
* <div data-slot="
|
|
28
|
-
* <div data-slot="
|
|
26
|
+
* <div data-tabs-slot="panel">…</div>
|
|
27
|
+
* <div data-tabs-slot="panel">…</div>
|
|
29
28
|
* </ui-tabs>
|
|
30
29
|
*/
|
|
31
30
|
|
|
@@ -45,16 +44,16 @@ class UiTabs extends ZazzElement {
|
|
|
45
44
|
const target = event.target;
|
|
46
45
|
if (!(target instanceof HTMLInputElement) || target.type !== "radio") return;
|
|
47
46
|
|
|
48
|
-
const list = target.closest('[role="tablist"], [data-slot~="
|
|
49
|
-
//
|
|
50
|
-
if (!list || list.closest(
|
|
47
|
+
const list = target.closest('[role="tablist"], [data-tabs-slot~="list"]');
|
|
48
|
+
// ignore radios of a nested ui-tabs
|
|
49
|
+
if (!list || list.closest('ui-tabs, [data-ui~="tabs"]') !== this) return;
|
|
51
50
|
|
|
52
51
|
const tabs = Array.from(list.querySelectorAll('input[type="radio"]'))
|
|
53
52
|
.filter((node): node is HTMLInputElement => node instanceof HTMLInputElement)
|
|
54
53
|
.filter((tab) => !tab.disabled);
|
|
55
54
|
if (tabs.length < 2) return;
|
|
56
55
|
|
|
57
|
-
const vertical = this.getAttribute("data-orientation") === "vertical";
|
|
56
|
+
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
58
57
|
const prevKey = vertical ? "ArrowUp" : "ArrowLeft";
|
|
59
58
|
const nextKey = vertical ? "ArrowDown" : "ArrowRight";
|
|
60
59
|
|
|
@@ -1,81 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* textarea.css — Textarea (
|
|
2
|
+
* textarea.css — Textarea ([data-ui~="textarea"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-ring), fields.css
|
|
6
6
|
* @uses field-sizing: content — auto-grow with text (modern browsers;
|
|
7
7
|
* falls back to fixed min/max block-size where unsupported)
|
|
8
|
-
* @tokens --ui-textarea-* (@layer variables
|
|
8
|
+
* @tokens --ui-textarea-* (@layer variables;
|
|
9
|
+
* --ui-textarea-min-h / -max-h default to lh units and are read raw;
|
|
10
|
+
* surface colors read the --ui-field-* family directly)
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
@layer variables {
|
|
12
14
|
:root {
|
|
13
|
-
--ui-textarea-
|
|
14
|
-
--ui-textarea-min-
|
|
15
|
-
--ui-textarea-min-
|
|
16
|
-
--ui-textarea-max-
|
|
17
|
-
--ui-textarea-
|
|
15
|
+
--ui-textarea-w: 100%;
|
|
16
|
+
--ui-textarea-min-w: 0;
|
|
17
|
+
--ui-textarea-min-h: 5lh;
|
|
18
|
+
--ui-textarea-max-h: 12lh;
|
|
19
|
+
--ui-textarea-p: var(--ui-field-px);
|
|
18
20
|
--ui-textarea-font-size: var(--ui-field-font-size);
|
|
19
|
-
--ui-textarea-
|
|
21
|
+
--ui-textarea-leading: var(--leading-sm);
|
|
20
22
|
--ui-textarea-border-width: var(--ui-field-border-width);
|
|
21
23
|
--ui-textarea-border-style: var(--ui-field-border-style);
|
|
22
24
|
--ui-textarea-border-color: var(--ui-field-border-color);
|
|
23
|
-
--ui-textarea-
|
|
25
|
+
--ui-textarea-rounded: var(--ui-field-rounded);
|
|
24
26
|
--ui-textarea-resize: vertical;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
@layer
|
|
29
|
-
|
|
30
|
-
TEXTAREA — .ui-textarea (auto-sizing)
|
|
31
|
-
- field-sizing: content grows the box with the text; height clamps between
|
|
32
|
-
min/max block-size, then scrolls.
|
|
33
|
-
- Shares the --ui-field-* tokens defined in fields.css so it matches .ui-input /
|
|
34
|
-
.ui-select / .ui-button.
|
|
35
|
-
=========================================================================== */
|
|
36
|
-
|
|
37
|
-
.ui-textarea {
|
|
30
|
+
@layer ui.components {
|
|
31
|
+
:where([data-ui~="textarea"]) {
|
|
38
32
|
field-sizing: content;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
/* dual-mode metrics go through the registered typed pair */
|
|
34
|
+
--_w-len: var(--_w-resolved, var(--ui-textarea-w));
|
|
35
|
+
--_w-num: var(--_w-resolved, var(--ui-textarea-w));
|
|
36
|
+
inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
|
|
37
|
+
--_min-w-len: var(--_min-w-resolved, var(--ui-textarea-min-w));
|
|
38
|
+
--_min-w-num: var(--_min-w-resolved, var(--ui-textarea-min-w));
|
|
39
|
+
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
40
|
+
min-block-size: var(--_min-h-resolved, var(--ui-textarea-min-h));
|
|
41
|
+
max-block-size: var(--_max-h-resolved, var(--ui-textarea-max-h));
|
|
42
|
+
--_p-len: var(--_p-resolved, var(--ui-textarea-p));
|
|
43
|
+
--_p-num: var(--_p-resolved, var(--ui-textarea-p));
|
|
44
|
+
padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
|
|
44
45
|
|
|
45
|
-
font-size: var(--ui-textarea-font-size);
|
|
46
|
-
line-height: var(--ui-textarea-
|
|
47
|
-
color: var(--ui-field-
|
|
48
|
-
background-color: var(--ui-field-
|
|
46
|
+
font-size: var(--_font-size-resolved, var(--ui-textarea-font-size));
|
|
47
|
+
line-height: var(--_leading-resolved, var(--ui-textarea-leading));
|
|
48
|
+
color: var(--_text-resolved, var(--ui-field-text));
|
|
49
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg));
|
|
49
50
|
|
|
50
|
-
border: var(--
|
|
51
|
-
|
|
52
|
-
border-
|
|
51
|
+
border-width: var(--_border-width-resolved, var(--ui-textarea-border-width));
|
|
52
|
+
border-style: var(--_border-style-resolved, var(--ui-textarea-border-style));
|
|
53
|
+
border-color: var(--_border-color-resolved, var(--ui-textarea-border-color));
|
|
54
|
+
border-radius: var(--_rounded-resolved, var(--ui-textarea-rounded));
|
|
53
55
|
resize: var(--ui-textarea-resize);
|
|
54
56
|
|
|
55
|
-
/* ring
|
|
56
|
-
in forced-colors
|
|
57
|
+
/* The ring is published to --_focus-ring so a --shadow utility keeps
|
|
58
|
+
it; the transparent outline twin keeps focus visible in forced-colors */
|
|
57
59
|
--_ring-offset-width: 0px;
|
|
58
60
|
--_ring-width: 0px;
|
|
59
|
-
--_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
60
|
-
|
|
61
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
|
|
62
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
61
|
+
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
62
|
+
--_focus-ring:
|
|
63
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
64
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
65
|
+
var(--_ring-fill, var(--ring-shadow-color));
|
|
66
|
+
box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
63
67
|
outline: var(--outline-width) var(--outline-style) transparent;
|
|
64
68
|
outline-offset: var(--outline-offset);
|
|
65
69
|
|
|
66
70
|
transition: var(--default-transition);
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
@media (hover: hover) {
|
|
74
|
+
:where([data-ui~="textarea"]):hover {
|
|
75
|
+
border-color: var(--_border-color-resolved, var(--ui-field-border-color--hover));
|
|
76
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg--hover));
|
|
77
|
+
}
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
background-color: var(--ui-field-
|
|
76
|
-
border-color: var(--ui-field-border-color--focus);
|
|
80
|
+
:where([data-ui~="textarea"]):focus-visible {
|
|
81
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg--focus-within));
|
|
82
|
+
border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
|
|
77
83
|
--_ring-offset-width: var(--ring-offset-width);
|
|
78
84
|
--_ring-width: var(--ring-width);
|
|
79
85
|
outline-color: transparent;
|
|
80
86
|
}
|
|
81
87
|
}
|
|
88
|
+
|
|
89
|
+
/* an invalid control remaps the --ui-field-* family on itself */
|
|
90
|
+
@layer ui.components {
|
|
91
|
+
:where([data-ui~="textarea"]):disabled {
|
|
92
|
+
opacity: 0.5;
|
|
93
|
+
cursor: not-allowed;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:where([data-ui~="textarea"]):user-invalid {
|
|
97
|
+
--ui-field-bg: color-mix(in oklch, var(--color-destructive) 5%, var(--color-input));
|
|
98
|
+
--ui-field-bg--hover: color-mix(in oklch, var(--color-destructive) 10%, var(--color-input));
|
|
99
|
+
--ui-field-border-color: var(--color-destructive);
|
|
100
|
+
--ui-field-border-color--hover: var(--color-destructive);
|
|
101
|
+
--ui-field-border-color--focus-within: var(--color-destructive);
|
|
102
|
+
--ui-field-ring-color: var(--color-destructive);
|
|
103
|
+
|
|
104
|
+
border-color: var(--color-destructive);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<label data-slot="
|
|
1
|
+
<div data-ui="field">
|
|
2
|
+
<label data-field-slot="label" for="f-message">Message</label>
|
|
3
3
|
<textarea
|
|
4
|
-
|
|
4
|
+
data-ui="textarea"
|
|
5
5
|
id="f-message"
|
|
6
6
|
name="message"
|
|
7
7
|
inputmode="text"
|