@zazz-ui/core 0.15.1 → 0.16.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 +29 -14
- package/CHANGELOG.md +156 -0
- package/README.md +6 -5
- package/dist/{csp-LRx1fynI.js → csp-C1f62vyT.js} +1 -1
- package/dist/sri.json +70 -65
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +74 -2
- package/editor/zazz.html-data.json +119 -79
- package/editor/zazz.language-data.json +401 -313
- package/editor/zazz.lint-data.json +1752 -1731
- package/package.json +2 -1
- package/src/base/_defaults.css +11 -11
- package/src/base/_reset.css +2 -10
- package/src/base/_typography.css +17 -568
- package/src/base/_utilities-box.css +17 -17
- package/src/base/_utilities-pseudo.css +2 -2
- package/src/base/_variables.css +142 -97
- package/src/base/carousel-scroll.d.ts +1 -1
- package/src/base/carousel-scroll.js +6 -6
- package/src/base/carousel-scroll.ts +6 -6
- package/src/base/carousel.d.ts.map +1 -1
- package/src/base/carousel.js +6 -2
- package/src/base/carousel.ts +6 -2
- package/src/base/csp.js +2 -2
- package/src/base/csp.ts +2 -2
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +186 -183
- package/src/base/kit-styling.ts +186 -183
- package/src/base/navigation.d.ts +2 -2
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +25 -21
- package/src/base/navigation.ts +27 -21
- package/src/base/utilities.d.ts +1 -1
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +20 -4
- package/src/base/utilities.ts +21 -5
- package/src/base/zazz-element.d.ts +1 -1
- package/src/base/zazz-element.js +1 -1
- package/src/base/zazz-element.ts +1 -1
- package/src/{base → behaviors}/gesture.d.ts +4 -3
- package/src/behaviors/gesture.d.ts.map +1 -0
- package/src/{base → behaviors}/gesture.js +1 -1
- package/src/{base → behaviors}/gesture.ts +5 -4
- package/src/{base → behaviors}/hotkeys.d.ts +2 -1
- package/src/behaviors/hotkeys.d.ts.map +1 -0
- package/src/{base → behaviors}/hotkeys.ts +2 -1
- package/src/behaviors/list-navigation.d.ts +64 -0
- package/src/behaviors/list-navigation.d.ts.map +1 -0
- package/src/behaviors/list-navigation.js +66 -0
- package/src/behaviors/list-navigation.ts +107 -0
- package/src/{base → behaviors}/typeahead.d.ts +3 -1
- package/src/behaviors/typeahead.d.ts.map +1 -0
- package/src/{base → behaviors}/typeahead.js +12 -17
- package/src/{base → behaviors}/typeahead.ts +12 -17
- package/src/css-properties.json +704 -0
- package/src/index.css +7 -0
- package/src/manifest.d.ts +20 -9
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +125 -37
- package/src/manifest.ts +132 -38
- package/src/primitives/accordion/accordion.json +49 -0
- package/src/primitives/alert-dialog/alert-dialog.json +35 -0
- package/src/primitives/autocomplete/autocomplete.d.ts +2 -2
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.js +2 -2
- package/src/primitives/autocomplete/autocomplete.json +65 -0
- package/src/primitives/autocomplete/autocomplete.ts +2 -2
- package/src/primitives/avatar/avatar.css +108 -0
- package/src/primitives/avatar/avatar.html +20 -74
- package/src/primitives/avatar/avatar.json +48 -0
- package/src/primitives/badge/badge.css +45 -10
- package/src/primitives/badge/badge.html +4 -0
- package/src/primitives/badge/badge.json +83 -0
- package/src/primitives/breadcrumbs/breadcrumbs.json +20 -0
- package/src/primitives/button/button.css +50 -66
- package/src/primitives/button/button.html +4 -0
- package/src/primitives/button/button.json +85 -0
- package/src/primitives/button-group/button-group.css +4 -15
- package/src/primitives/button-group/button-group.json +40 -0
- package/src/primitives/callout/callout.css +1 -1
- package/src/primitives/callout/callout.html +12 -12
- package/src/primitives/callout/callout.json +54 -0
- package/src/primitives/card/card-article.html +13 -37
- package/src/primitives/card/card-horizontal.html +11 -14
- package/src/primitives/card/card-login.html +4 -4
- package/src/primitives/card/card-product.html +3 -3
- package/src/primitives/card/card-subgrid.html +4 -4
- package/src/primitives/card/card.css +1 -1
- package/src/primitives/card/card.html +8 -8
- package/src/primitives/card/card.json +73 -0
- package/src/primitives/carousel/carousel.css +1 -1
- package/src/primitives/carousel/carousel.json +89 -0
- package/src/primitives/checkbox/checkbox.css +1 -2
- package/src/primitives/checkbox/checkbox.json +51 -0
- package/src/primitives/combobox/combobox.css +3 -2
- package/src/primitives/combobox/combobox.d.ts +2 -2
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.js +2 -2
- package/src/primitives/combobox/combobox.json +113 -0
- package/src/primitives/combobox/combobox.ts +2 -2
- package/src/primitives/command/command-actions.html +1 -1
- package/src/primitives/command/command.d.ts +4 -3
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.js +7 -6
- package/src/primitives/command/command.json +86 -0
- package/src/primitives/command/command.ts +7 -6
- package/src/primitives/debug/audit-core.d.ts +19 -12
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +78 -16
- package/src/primitives/debug/audit-core.ts +94 -22
- package/src/primitives/debug/debug.d.ts +6 -4
- package/src/primitives/debug/debug.d.ts.map +1 -1
- package/src/primitives/debug/debug.js +50 -21
- package/src/primitives/debug/debug.json +29 -0
- package/src/primitives/debug/debug.ts +57 -35
- package/src/primitives/dialog/dialog.css +1 -4
- package/src/primitives/dialog/dialog.json +78 -0
- package/src/primitives/drawer/drawer.css +4 -2
- package/src/primitives/drawer/drawer.d.ts.map +1 -1
- package/src/primitives/drawer/drawer.js +76 -4
- package/src/primitives/drawer/drawer.json +98 -0
- package/src/primitives/drawer/drawer.ts +78 -5
- package/src/primitives/fields/fields.css +11 -4
- package/src/primitives/fields/fields.json +92 -0
- package/src/primitives/font/font.css +188 -0
- package/src/primitives/font/font.html +14 -0
- package/src/primitives/font/font.json +39 -0
- package/src/primitives/group/group.json +25 -0
- package/src/primitives/input/input.css +1 -2
- package/src/primitives/input/input.json +56 -0
- package/src/primitives/input-group/input-group-password-group.html +1 -1
- package/src/primitives/input-group/input-group.css +32 -3
- package/src/primitives/input-group/input-group.html +5 -8
- package/src/primitives/input-group/input-group.json +69 -0
- package/src/primitives/kbd/kbd.css +1 -1
- package/src/primitives/kbd/kbd.json +52 -0
- package/src/primitives/layout/layout.json +45 -0
- package/src/primitives/lightbox/lightbox.css +4 -3
- package/src/primitives/lightbox/lightbox.html +2 -2
- package/src/primitives/lightbox/lightbox.js +1 -1
- package/src/primitives/lightbox/lightbox.json +87 -0
- package/src/primitives/lightbox/lightbox.ts +1 -1
- package/src/primitives/link/link.css +28 -0
- package/src/primitives/link/link.html +5 -0
- package/src/primitives/link/link.json +23 -0
- package/src/primitives/menu/menu.d.ts +3 -0
- package/src/primitives/menu/menu.d.ts.map +1 -1
- package/src/primitives/menu/menu.js +10 -25
- package/src/primitives/menu/menu.json +51 -0
- package/src/primitives/menu/menu.ts +10 -27
- package/src/primitives/menubar/menubar.json +23 -0
- package/src/primitives/meter/meter.css +24 -3
- package/src/primitives/meter/meter.json +41 -0
- package/src/primitives/mobile-menu/mobile-menu.html +1 -1
- package/src/primitives/mobile-menu/mobile-menu.json +64 -0
- package/src/primitives/navigation-menu/navigation-menu-featured.html +58 -58
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +6 -113
- package/src/primitives/navigation-menu/navigation-menu.css +11 -5
- package/src/primitives/navigation-menu/navigation-menu.html +1 -1
- package/src/primitives/navigation-menu/navigation-menu.json +82 -0
- package/src/primitives/otp/otp.css +1 -1
- package/src/primitives/otp/otp.d.ts +3 -3
- package/src/primitives/otp/otp.js +5 -5
- package/src/primitives/otp/otp.json +75 -0
- package/src/primitives/otp/otp.ts +5 -5
- package/src/primitives/password-group/password-group.css +32 -2
- package/src/primitives/password-group/password-group.html +1 -1
- package/src/primitives/password-group/password-group.json +74 -0
- package/src/primitives/popover/popover.css +1 -1
- package/src/primitives/popover/popover.json +64 -0
- package/src/primitives/progress/progress.css +25 -3
- package/src/primitives/progress/progress.json +41 -0
- package/src/primitives/prose/prose.css +341 -0
- package/src/primitives/prose/prose.html +11 -11
- package/src/primitives/prose/prose.json +47 -0
- package/src/primitives/radio/radio.css +1 -1
- package/src/primitives/radio/radio.json +48 -0
- package/src/primitives/reveal/reveal.json +72 -0
- package/src/primitives/scroll-fade/scroll-fade.css +0 -3
- package/src/primitives/scroll-fade/scroll-fade.json +34 -0
- package/src/primitives/select/select.css +2 -2
- package/src/primitives/select/select.json +119 -0
- package/src/primitives/separator/separator.json +34 -0
- package/src/primitives/slider/slider.css +87 -13
- package/src/primitives/slider/slider.json +49 -0
- package/src/primitives/style-guard/style-guard.js +1 -1
- package/src/primitives/style-guard/style-guard.json +22 -0
- package/src/primitives/style-guard/style-guard.ts +2 -2
- package/src/primitives/switch/switch.css +107 -18
- package/src/primitives/switch/switch.json +71 -0
- package/src/primitives/table/table.json +74 -0
- package/src/primitives/tabs/tabs.css +24 -12
- package/src/primitives/tabs/tabs.d.ts +4 -2
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.js +14 -24
- package/src/primitives/tabs/tabs.json +94 -0
- package/src/primitives/tabs/tabs.ts +14 -26
- package/src/primitives/textarea/textarea.css +1 -1
- package/src/primitives/textarea/textarea.json +48 -0
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.js +4 -4
- package/src/primitives/toaster/toaster.json +101 -0
- package/src/primitives/toaster/toaster.ts +5 -5
- package/src/primitives/toggle/toggle.css +2 -52
- package/src/primitives/toggle/toggle.json +84 -0
- package/src/primitives/toggle-group/toggle-group.css +1 -1
- package/src/primitives/toggle-group/toggle-group.json +41 -0
- package/src/primitives/toolbar/toolbar.json +26 -0
- package/src/primitives/tooltip/tooltip.css +1 -1
- package/src/primitives/tooltip/tooltip.json +85 -0
- package/src/primitives/utilities/aspect-ratio.html +3 -3
- package/src/primitives/utilities/basis.html +5 -5
- package/src/primitives/utilities/col-span.html +5 -5
- package/src/primitives/utilities/compose.html +3 -3
- package/src/primitives/utilities/flex-align.html +3 -3
- package/src/primitives/utilities/flex-direction.html +8 -8
- package/src/primitives/utilities/flex-grow.html +3 -3
- package/src/primitives/utilities/flex-reverse.html +8 -8
- package/src/primitives/utilities/gallery.html +19 -19
- package/src/primitives/utilities/gap.html +12 -12
- package/src/primitives/utilities/grid-cols.html +6 -6
- package/src/primitives/utilities/grid-responsive.html +9 -9
- package/src/primitives/utilities/inline-flex.html +2 -2
- package/src/primitives/utilities/margin-auto.html +1 -1
- package/src/primitives/utilities/object-fit.html +3 -3
- package/src/primitives/utilities/order.html +3 -3
- package/src/primitives/utilities/overflow.html +14 -14
- package/src/primitives/utilities/padding-compose.html +3 -3
- package/src/primitives/utilities/padding.html +4 -4
- package/src/primitives/utilities/position.html +1 -1
- package/src/primitives/utilities/responsive-flex.html +4 -4
- package/src/primitives/utilities/responsive-grid.html +9 -9
- package/src/primitives/utilities/size.html +5 -5
- package/src/primitives/utilities/subgrid-col.html +7 -7
- package/src/primitives/utilities/subgrid-row.html +9 -9
- package/src/primitives/utilities/subgrid.html +9 -9
- package/src/primitives/utilities/utilities.json +48 -0
- package/src/primitives/utilities/width.html +5 -5
- package/src/base/gesture.d.ts.map +0 -1
- package/src/base/hotkeys.d.ts.map +0 -1
- package/src/base/typeahead.d.ts.map +0 -1
- /package/src/{base → behaviors}/command-score.d.ts +0 -0
- /package/src/{base → behaviors}/command-score.d.ts.map +0 -0
- /package/src/{base → behaviors}/command-score.js +0 -0
- /package/src/{base → behaviors}/command-score.ts +0 -0
- /package/src/{base → behaviors}/hotkeys.js +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "switch",
|
|
3
|
+
"summary": "switch.css — Switch (input[type=\"checkbox\"][role=\"switch\"])",
|
|
4
|
+
"identities": [],
|
|
5
|
+
"tags": [],
|
|
6
|
+
"hooks": {
|
|
7
|
+
"Box Model & Sizing": {
|
|
8
|
+
"--ui-switch-h-coefficient": "1",
|
|
9
|
+
"--ui-switch-thumb-h": "calc( var(--ui-switch-track-h) - 2 * var(--ui-switch-track-p) - 2 * var(--ui-switch-thumb-border-width) )",
|
|
10
|
+
"--ui-switch-thumb-w": "calc( (var(--ui-switch-track-w) / 2) - var(--ui-switch-track-p) - var(--ui-switch-thumb-border-width) )",
|
|
11
|
+
"--ui-switch-track-h": "calc( var(--ui-switch-track-w) / 2 + var(--ui-switch-track-p) + var(--ui-switch-track-border-width) )",
|
|
12
|
+
"--ui-switch-track-p": "max(calc(var(--spacing) * 0.5), calc(var(--spacing-control-min) * 0.125))",
|
|
13
|
+
"--ui-switch-track-w": "max(calc(var(--spacing) * 7), calc(var(--spacing-control-min) * 1.75))",
|
|
14
|
+
"--ui-switch-w-coefficient": "1"
|
|
15
|
+
},
|
|
16
|
+
"Color & Backgrounds": {
|
|
17
|
+
"--ui-switch-thumb-bg": "var(--color-card)",
|
|
18
|
+
"--ui-switch-thumb-bg--checked": "var(--color-primary-foreground)",
|
|
19
|
+
"--ui-switch-track-bg": "var(--color-input)",
|
|
20
|
+
"--ui-switch-track-bg--checked": "var(--color-primary)",
|
|
21
|
+
"--ui-switch-track-bg--checked-hover": "var(--color-primary)",
|
|
22
|
+
"--ui-switch-track-bg--hover": "oklch(from var(--color-muted) l c h / calc(alpha * 1.5))"
|
|
23
|
+
},
|
|
24
|
+
"Borders & Outlines": {
|
|
25
|
+
"--ui-switch-corner-shape": "var(--ui-field-corner-shape)",
|
|
26
|
+
"--ui-switch-radius": "var(--radius-full)",
|
|
27
|
+
"--ui-switch-thumb-border-color": "var(--ui-field-border-color)",
|
|
28
|
+
"--ui-switch-thumb-border-color--checked": "transparent",
|
|
29
|
+
"--ui-switch-thumb-border-color--checked-hover": "transparent",
|
|
30
|
+
"--ui-switch-thumb-border-color--hover": "var(--ui-field-border-color--hover)",
|
|
31
|
+
"--ui-switch-thumb-border-style": "var(--ui-field-border-style)",
|
|
32
|
+
"--ui-switch-thumb-border-width": "var(--ui-field-border-width)",
|
|
33
|
+
"--ui-switch-thumb-corner-shape": "var(--ui-switch-corner-shape)",
|
|
34
|
+
"--ui-switch-thumb-radius": "var(--ui-switch-radius)",
|
|
35
|
+
"--ui-switch-track-border-color": "var(--ui-field-border-color)",
|
|
36
|
+
"--ui-switch-track-border-color--checked": "var(--ui-field-border-color--hover)",
|
|
37
|
+
"--ui-switch-track-border-color--checked-hover": "var(--ui-field-border-color)",
|
|
38
|
+
"--ui-switch-track-border-color--hover": "var(--ui-field-border-color--hover)",
|
|
39
|
+
"--ui-switch-track-border-style": "var(--ui-field-border-style)",
|
|
40
|
+
"--ui-switch-track-border-width": "var(--ui-field-border-width)",
|
|
41
|
+
"--ui-switch-track-corner-shape": "var(--ui-switch-corner-shape)",
|
|
42
|
+
"--ui-switch-track-radius": "var(--ui-switch-radius)"
|
|
43
|
+
},
|
|
44
|
+
"Visual Effects": {
|
|
45
|
+
"--ui-switch-thumb-shadow": "var(--shadow-xs)"
|
|
46
|
+
},
|
|
47
|
+
"Transforms & Animation": {
|
|
48
|
+
"--ui-switch-thumb-scale": "1",
|
|
49
|
+
"--ui-switch-thumb-translate": "var(--ui-switch-track-p), -50%"
|
|
50
|
+
},
|
|
51
|
+
"Interaction & UI": {
|
|
52
|
+
"--ui-switch-cursor": "pointer"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"attributes": {},
|
|
56
|
+
"slots": {},
|
|
57
|
+
"states": {},
|
|
58
|
+
"requires": [
|
|
59
|
+
"fields"
|
|
60
|
+
],
|
|
61
|
+
"files": {
|
|
62
|
+
"css": [
|
|
63
|
+
"primitives/switch/switch.css"
|
|
64
|
+
],
|
|
65
|
+
"js": [],
|
|
66
|
+
"base": [],
|
|
67
|
+
"examples": [
|
|
68
|
+
"primitives/switch/switch.html"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "table",
|
|
3
|
+
"summary": "table.css — Table ([data-ui~=\"table\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"table"
|
|
6
|
+
],
|
|
7
|
+
"tags": [],
|
|
8
|
+
"hooks": {
|
|
9
|
+
"Box Model & Sizing": {
|
|
10
|
+
"--ui-table-caption-px": "var(--space-xs)",
|
|
11
|
+
"--ui-table-caption-py": "var(--space-xs)",
|
|
12
|
+
"--ui-table-cell-px": "calc(var(--spacing) * 2)",
|
|
13
|
+
"--ui-table-cell-py": "calc(var(--spacing) * 2)",
|
|
14
|
+
"--ui-table-head-h": "calc(var(--spacing) * 10)"
|
|
15
|
+
},
|
|
16
|
+
"Typography": {
|
|
17
|
+
"--ui-table-font-family": "var(--font-family-body)",
|
|
18
|
+
"--ui-table-font-size": "var(--font-size-sm)",
|
|
19
|
+
"--ui-table-foot-font-weight": "var(--font-weight-strong)",
|
|
20
|
+
"--ui-table-head-font-weight": "var(--font-weight-strong)"
|
|
21
|
+
},
|
|
22
|
+
"Color & Backgrounds": {
|
|
23
|
+
"--ui-table-alternating-bg": "var(--color-muted)",
|
|
24
|
+
"--ui-table-bg": "transparent",
|
|
25
|
+
"--ui-table-caption-text": "var(--color-muted-foreground)",
|
|
26
|
+
"--ui-table-foot-bg": "oklch(from var(--color-muted) l c h / calc(alpha / 2))",
|
|
27
|
+
"--ui-table-head-text": "var(--color-foreground)",
|
|
28
|
+
"--ui-table-row-bg--hover": "oklch(from var(--color-muted) l c h / calc(alpha / 2))",
|
|
29
|
+
"--ui-table-row-bg--selected": "var(--color-muted)",
|
|
30
|
+
"--ui-table-text": "var(--color-foreground)"
|
|
31
|
+
},
|
|
32
|
+
"Borders & Outlines": {
|
|
33
|
+
"--ui-table-border": "1px solid var(--color-border)",
|
|
34
|
+
"--ui-table-column-border": "none",
|
|
35
|
+
"--ui-table-head-border": "var(--ui-table-border)",
|
|
36
|
+
"--ui-table-row-border": "var(--ui-table-border)"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"attributes": {
|
|
40
|
+
"data-table-caption": [
|
|
41
|
+
"top"
|
|
42
|
+
],
|
|
43
|
+
"data-table-layout": [
|
|
44
|
+
"fixed"
|
|
45
|
+
],
|
|
46
|
+
"data-table-size": [
|
|
47
|
+
"sm"
|
|
48
|
+
],
|
|
49
|
+
"data-table-variant": [
|
|
50
|
+
"alternating",
|
|
51
|
+
"grid"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"slots": {},
|
|
55
|
+
"states": {
|
|
56
|
+
"data-table-state": [
|
|
57
|
+
"selected"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"requires": [],
|
|
61
|
+
"files": {
|
|
62
|
+
"css": [
|
|
63
|
+
"primitives/table/table.css"
|
|
64
|
+
],
|
|
65
|
+
"js": [],
|
|
66
|
+
"base": [],
|
|
67
|
+
"examples": [
|
|
68
|
+
"primitives/table/table.html",
|
|
69
|
+
"primitives/table/table-grid.html",
|
|
70
|
+
"primitives/table/table-alternating.html",
|
|
71
|
+
"primitives/table/table-size-sm.html"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -43,10 +43,17 @@
|
|
|
43
43
|
--ui-tabs-track-border-color: var(--ui-field-border-color);
|
|
44
44
|
|
|
45
45
|
--ui-tabs-indicator-bg: var(--color-muted);
|
|
46
|
-
|
|
46
|
+
/* concentric with the track: its radius less the track border, the track padding
|
|
47
|
+
(where the label sits), and the indicator's inset within the label */
|
|
48
|
+
--ui-tabs-indicator-radius: max(
|
|
49
|
+
0px,
|
|
50
|
+
var(--ui-tabs-track-radius) - var(--ui-tabs-track-border-width) - var(--ui-tabs-track-p) -
|
|
51
|
+
var(--ui-tabs-indicator-inset)
|
|
52
|
+
);
|
|
47
53
|
--ui-tabs-indicator-corner-shape: var(--ui-field-corner-shape);
|
|
48
54
|
--ui-tabs-indicator-shadow: none;
|
|
49
|
-
|
|
55
|
+
/* 0: the pill covers the checked label, one track padding in from the border */
|
|
56
|
+
--ui-tabs-indicator-inset: 0px;
|
|
50
57
|
--ui-tabs-indicator-border-width: var(--ui-field-border-width);
|
|
51
58
|
--ui-tabs-indicator-border-style: var(--ui-field-border-style);
|
|
52
59
|
--ui-tabs-indicator-border-color: transparent;
|
|
@@ -69,6 +76,12 @@
|
|
|
69
76
|
without text-box trim the full line plus this still fits the default height */
|
|
70
77
|
--ui-tabs-label-py: calc(var(--ui-field-py) / 2);
|
|
71
78
|
--ui-tabs-label-min-h: calc(var(--spacing) * 7);
|
|
79
|
+
/* the label sits one track padding in, so its corners (focus ring, the checked
|
|
80
|
+
fill without anchor positioning) are concentric one level up from the pill's */
|
|
81
|
+
--ui-tabs-label-radius: max(
|
|
82
|
+
0px,
|
|
83
|
+
var(--ui-tabs-track-radius) - var(--ui-tabs-track-border-width) - var(--ui-tabs-track-p)
|
|
84
|
+
);
|
|
72
85
|
--ui-tabs-label-ring-color: var(--ui-field-ring-color);
|
|
73
86
|
|
|
74
87
|
/* data-tabs-variant="underline" */
|
|
@@ -97,7 +110,7 @@
|
|
|
97
110
|
--_radius-len: var(--_radius-resolved, var(--ui-tabs-track-radius));
|
|
98
111
|
--_radius-num: var(--_radius-resolved, var(--ui-tabs-track-radius));
|
|
99
112
|
border-radius: calc(
|
|
100
|
-
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-
|
|
113
|
+
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
|
|
101
114
|
);
|
|
102
115
|
corner-shape: var(--_corner-shape-resolved, var(--ui-tabs-track-corner-shape));
|
|
103
116
|
background-color: var(--ui-tabs-track-bg);
|
|
@@ -159,7 +172,7 @@
|
|
|
159
172
|
user-select: none;
|
|
160
173
|
text-box: trim-both ex alphabetic;
|
|
161
174
|
|
|
162
|
-
border-radius: var(--ui-tabs-
|
|
175
|
+
border-radius: var(--ui-tabs-label-radius);
|
|
163
176
|
corner-shape: var(--ui-tabs-indicator-corner-shape);
|
|
164
177
|
|
|
165
178
|
/* ring renders as box-shadow so it composes with the indicator shadow in
|
|
@@ -229,11 +242,12 @@
|
|
|
229
242
|
@supports (anchor-name: --active-tab) {
|
|
230
243
|
:where(ui-tabs, [data-ui~="tabs"]) [data-tabs-slot~="indicator"] {
|
|
231
244
|
position-anchor: --active-tab;
|
|
232
|
-
/*
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
245
|
+
/* start / end are anchor()'s logical side keywords: each resolves on the axis
|
|
246
|
+
of the inset property it sits in */
|
|
247
|
+
inset-block-start: calc(anchor(--active-tab start) + var(--ui-tabs-indicator-inset));
|
|
248
|
+
inset-inline-start: calc(anchor(--active-tab start) + var(--ui-tabs-indicator-inset));
|
|
249
|
+
inset-inline-end: calc(anchor(--active-tab end) + var(--ui-tabs-indicator-inset));
|
|
250
|
+
inset-block-end: calc(anchor(--active-tab end) + var(--ui-tabs-indicator-inset));
|
|
237
251
|
}
|
|
238
252
|
|
|
239
253
|
:where(ui-tabs, [data-ui~="tabs"])
|
|
@@ -253,8 +267,6 @@
|
|
|
253
267
|
[data-tabs-slot~="list"]
|
|
254
268
|
input[type="radio"]:checked
|
|
255
269
|
+ [data-tabs-slot~="label"] {
|
|
256
|
-
border-radius: var(--ui-tabs-indicator-radius);
|
|
257
|
-
corner-shape: var(--ui-tabs-indicator-corner-shape);
|
|
258
270
|
background-color: var(--ui-tabs-indicator-bg);
|
|
259
271
|
box-shadow:
|
|
260
272
|
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in)))
|
|
@@ -414,7 +426,7 @@
|
|
|
414
426
|
:where(ui-tabs, [data-ui~="tabs"])[data-tabs-variant="underline"]
|
|
415
427
|
> [data-tabs-slot~="list"]
|
|
416
428
|
> [data-tabs-slot~="indicator"] {
|
|
417
|
-
/* the line sits on the label's own edge
|
|
429
|
+
/* the line sits on the label's own edge, even where a theme insets the pill */
|
|
418
430
|
--ui-tabs-indicator-inset: 0px;
|
|
419
431
|
border: 0;
|
|
420
432
|
border-block-end: var(--ui-tabs-underline-width) solid var(--ui-tabs-underline-color);
|
|
@@ -4,14 +4,16 @@
|
|
|
4
4
|
* tabs pattern with orientation-aware arrow-key navigation.
|
|
5
5
|
*
|
|
6
6
|
* Keyboard behavior on the focused tab radio:
|
|
7
|
-
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs
|
|
7
|
+
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs, following
|
|
8
|
+
* the writing direction (in RTL, ArrowLeft is the next tab).
|
|
8
9
|
* - Vertical (`data-tabs-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
9
10
|
* - Home / End jump to the first / last enabled tab.
|
|
10
11
|
* - Navigation wraps around and skips disabled tabs.
|
|
11
12
|
*
|
|
12
13
|
* Native radio-group arrow keys already provide a baseline without
|
|
13
14
|
* JavaScript; this element makes the keys match the tabs' visual
|
|
14
|
-
* orientation and adds Home/End + wrap-around.
|
|
15
|
+
* orientation and adds Home/End + wrap-around. The key handling is the shared
|
|
16
|
+
* list navigation behavior (`behaviors/list-navigation.ts`).
|
|
15
17
|
*
|
|
16
18
|
* @example
|
|
17
19
|
* <ui-tabs>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAG5E,cAAM,MAAO,SAAQ,WAAW;;IAC9B,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAEzC;CAqCF;AAID,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
* tabs pattern with orientation-aware arrow-key navigation.
|
|
6
6
|
*
|
|
7
7
|
* Keyboard behavior on the focused tab radio:
|
|
8
|
-
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs
|
|
8
|
+
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs, following
|
|
9
|
+
* the writing direction (in RTL, ArrowLeft is the next tab).
|
|
9
10
|
* - Vertical (`data-tabs-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
10
11
|
* - Home / End jump to the first / last enabled tab.
|
|
11
12
|
* - Navigation wraps around and skips disabled tabs.
|
|
12
13
|
*
|
|
13
14
|
* Native radio-group arrow keys already provide a baseline without
|
|
14
15
|
* JavaScript; this element makes the keys match the tabs' visual
|
|
15
|
-
* orientation and adds Home/End + wrap-around.
|
|
16
|
+
* orientation and adds Home/End + wrap-around. The key handling is the shared
|
|
17
|
+
* list navigation behavior (`behaviors/list-navigation.ts`).
|
|
16
18
|
*
|
|
17
19
|
* @example
|
|
18
20
|
* <ui-tabs>
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
* </ui-tabs>
|
|
28
30
|
*/
|
|
29
31
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
|
|
32
|
+
import { isDisabledItem, listStep, stepIndex } from "../../behaviors/list-navigation.js";
|
|
30
33
|
class UiTabs extends ZazzElement {
|
|
31
34
|
setup(signal) {
|
|
32
35
|
this.addEventListener("keydown", (event) => this.#onKeydown(event), { signal });
|
|
@@ -44,36 +47,23 @@ class UiTabs extends ZazzElement {
|
|
|
44
47
|
// ignore radios of a nested ui-tabs
|
|
45
48
|
if (!list || list.closest('ui-tabs, [data-ui~="tabs"]') !== this)
|
|
46
49
|
return;
|
|
50
|
+
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
51
|
+
const step = listStep(event.key, {
|
|
52
|
+
orientation: vertical ? "vertical" : "horizontal",
|
|
53
|
+
rtl: getComputedStyle(list).direction === "rtl",
|
|
54
|
+
});
|
|
55
|
+
if (!step)
|
|
56
|
+
return;
|
|
47
57
|
const tabs = Array.from(list.querySelectorAll('input[type="radio"]'))
|
|
48
58
|
.filter((node) => node instanceof HTMLInputElement)
|
|
49
|
-
.filter((tab) => !tab
|
|
59
|
+
.filter((tab) => !isDisabledItem(tab));
|
|
50
60
|
if (tabs.length < 2)
|
|
51
61
|
return;
|
|
52
|
-
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
53
|
-
const prevKey = vertical ? "ArrowUp" : "ArrowLeft";
|
|
54
|
-
const nextKey = vertical ? "ArrowDown" : "ArrowRight";
|
|
55
62
|
const index = tabs.indexOf(target);
|
|
56
63
|
if (index === -1)
|
|
57
64
|
return;
|
|
58
|
-
let nextIndex;
|
|
59
|
-
switch (event.key) {
|
|
60
|
-
case prevKey:
|
|
61
|
-
nextIndex = (index - 1 + tabs.length) % tabs.length;
|
|
62
|
-
break;
|
|
63
|
-
case nextKey:
|
|
64
|
-
nextIndex = (index + 1) % tabs.length;
|
|
65
|
-
break;
|
|
66
|
-
case "Home":
|
|
67
|
-
nextIndex = 0;
|
|
68
|
-
break;
|
|
69
|
-
case "End":
|
|
70
|
-
nextIndex = tabs.length - 1;
|
|
71
|
-
break;
|
|
72
|
-
default:
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
65
|
event.preventDefault();
|
|
76
|
-
const tab = tabs[
|
|
66
|
+
const tab = tabs[stepIndex(index, step, tabs.length)];
|
|
77
67
|
tab.checked = true;
|
|
78
68
|
tab.focus();
|
|
79
69
|
tab.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tabs",
|
|
3
|
+
"summary": "tabs.css — Tabs (ui-tabs | [data-ui~=\"tabs\"]) — CSS-only radio tab panels",
|
|
4
|
+
"identities": [
|
|
5
|
+
"tabs"
|
|
6
|
+
],
|
|
7
|
+
"tags": [
|
|
8
|
+
"ui-tabs"
|
|
9
|
+
],
|
|
10
|
+
"hooks": {
|
|
11
|
+
"Layout & Positioning": {
|
|
12
|
+
"--ui-tabs-gap": "var(--ui-field-option-gap)",
|
|
13
|
+
"--ui-tabs-indicator-inset": "0px",
|
|
14
|
+
"--ui-tabs-track-gap": "var(--ui-field-gap)"
|
|
15
|
+
},
|
|
16
|
+
"Box Model & Sizing": {
|
|
17
|
+
"--ui-tabs-label-min-h": "calc(var(--spacing) * 7)",
|
|
18
|
+
"--ui-tabs-label-px": "var(--ui-field-px)",
|
|
19
|
+
"--ui-tabs-label-py": "calc(var(--ui-field-py) / 2)",
|
|
20
|
+
"--ui-tabs-track-p": "var(--ui-field-inset-p)"
|
|
21
|
+
},
|
|
22
|
+
"Typography": {
|
|
23
|
+
"--ui-tabs-label-font-family": "var(--font-family-body)",
|
|
24
|
+
"--ui-tabs-label-font-size": "var(--font-size-sm)",
|
|
25
|
+
"--ui-tabs-label-font-weight": "var(--font-weight-strong)",
|
|
26
|
+
"--ui-tabs-label-leading": "var(--leading-sm)"
|
|
27
|
+
},
|
|
28
|
+
"Color & Backgrounds": {
|
|
29
|
+
"--ui-tabs-indicator-bg": "var(--color-muted)",
|
|
30
|
+
"--ui-tabs-label-bg": "transparent",
|
|
31
|
+
"--ui-tabs-label-bg--active": "transparent",
|
|
32
|
+
"--ui-tabs-label-bg--hover": "transparent",
|
|
33
|
+
"--ui-tabs-label-text": "var(--color-muted-foreground)",
|
|
34
|
+
"--ui-tabs-label-text--active": "var(--color-foreground)",
|
|
35
|
+
"--ui-tabs-label-text--hover": "var(--color-foreground)",
|
|
36
|
+
"--ui-tabs-track-bg": "var(--ui-field-bg)",
|
|
37
|
+
"--ui-tabs-underline-color": "var(--color-foreground)"
|
|
38
|
+
},
|
|
39
|
+
"Borders & Outlines": {
|
|
40
|
+
"--ui-tabs-indicator-border-color": "transparent",
|
|
41
|
+
"--ui-tabs-indicator-border-style": "var(--ui-field-border-style)",
|
|
42
|
+
"--ui-tabs-indicator-border-width": "var(--ui-field-border-width)",
|
|
43
|
+
"--ui-tabs-indicator-corner-shape": "var(--ui-field-corner-shape)",
|
|
44
|
+
"--ui-tabs-indicator-radius": "max( 0px, var(--ui-tabs-track-radius) - var(--ui-tabs-track-border-width) - var(--ui-tabs-track-p) - var(--ui-tabs-indicator-inset) )",
|
|
45
|
+
"--ui-tabs-label-radius": "max( 0px, var(--ui-tabs-track-radius) - var(--ui-tabs-track-border-width) - var(--ui-tabs-track-p) )",
|
|
46
|
+
"--ui-tabs-track-border-color": "var(--ui-field-border-color)",
|
|
47
|
+
"--ui-tabs-track-border-style": "var(--ui-field-border-style)",
|
|
48
|
+
"--ui-tabs-track-border-width": "var(--ui-field-border-width)",
|
|
49
|
+
"--ui-tabs-track-corner-shape": "var(--ui-field-corner-shape)",
|
|
50
|
+
"--ui-tabs-track-radius": "var(--ui-field-radius)",
|
|
51
|
+
"--ui-tabs-underline-width": "2px"
|
|
52
|
+
},
|
|
53
|
+
"Visual Effects": {
|
|
54
|
+
"--ui-tabs-indicator-shadow": "none",
|
|
55
|
+
"--ui-tabs-label-ring-color": "var(--ui-field-ring-color)"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"attributes": {
|
|
59
|
+
"data-tabs-orientation": [
|
|
60
|
+
"vertical"
|
|
61
|
+
],
|
|
62
|
+
"data-tabs-variant": [
|
|
63
|
+
"underline"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"slots": {
|
|
67
|
+
"data-tabs-slot": [
|
|
68
|
+
"indicator",
|
|
69
|
+
"label",
|
|
70
|
+
"label-text",
|
|
71
|
+
"list",
|
|
72
|
+
"panel"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"states": {},
|
|
76
|
+
"requires": [
|
|
77
|
+
"fields"
|
|
78
|
+
],
|
|
79
|
+
"files": {
|
|
80
|
+
"css": [
|
|
81
|
+
"primitives/tabs/tabs.css"
|
|
82
|
+
],
|
|
83
|
+
"js": [
|
|
84
|
+
"primitives/tabs/tabs.js"
|
|
85
|
+
],
|
|
86
|
+
"base": [
|
|
87
|
+
"behaviors/list-navigation.js"
|
|
88
|
+
],
|
|
89
|
+
"examples": [
|
|
90
|
+
"primitives/tabs/tabs.html",
|
|
91
|
+
"primitives/tabs/tabs-underline.html"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -6,14 +6,16 @@
|
|
|
6
6
|
* tabs pattern with orientation-aware arrow-key navigation.
|
|
7
7
|
*
|
|
8
8
|
* Keyboard behavior on the focused tab radio:
|
|
9
|
-
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs
|
|
9
|
+
* - Horizontal (default): ArrowLeft / ArrowRight move between tabs, following
|
|
10
|
+
* the writing direction (in RTL, ArrowLeft is the next tab).
|
|
10
11
|
* - Vertical (`data-tabs-orientation="vertical"`): ArrowUp / ArrowDown move between tabs.
|
|
11
12
|
* - Home / End jump to the first / last enabled tab.
|
|
12
13
|
* - Navigation wraps around and skips disabled tabs.
|
|
13
14
|
*
|
|
14
15
|
* Native radio-group arrow keys already provide a baseline without
|
|
15
16
|
* JavaScript; this element makes the keys match the tabs' visual
|
|
16
|
-
* orientation and adds Home/End + wrap-around.
|
|
17
|
+
* orientation and adds Home/End + wrap-around. The key handling is the shared
|
|
18
|
+
* list navigation behavior (`behaviors/list-navigation.ts`).
|
|
17
19
|
*
|
|
18
20
|
* @example
|
|
19
21
|
* <ui-tabs>
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
*/
|
|
30
32
|
|
|
31
33
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.ts";
|
|
34
|
+
import { isDisabledItem, listStep, stepIndex } from "../../behaviors/list-navigation.ts";
|
|
32
35
|
|
|
33
36
|
class UiTabs extends ZazzElement {
|
|
34
37
|
protected setup(signal: AbortSignal): void {
|
|
@@ -48,39 +51,24 @@ class UiTabs extends ZazzElement {
|
|
|
48
51
|
// ignore radios of a nested ui-tabs
|
|
49
52
|
if (!list || list.closest('ui-tabs, [data-ui~="tabs"]') !== this) return;
|
|
50
53
|
|
|
54
|
+
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
55
|
+
const step = listStep(event.key, {
|
|
56
|
+
orientation: vertical ? "vertical" : "horizontal",
|
|
57
|
+
rtl: getComputedStyle(list).direction === "rtl",
|
|
58
|
+
});
|
|
59
|
+
if (!step) return;
|
|
60
|
+
|
|
51
61
|
const tabs = Array.from(list.querySelectorAll('input[type="radio"]'))
|
|
52
62
|
.filter((node): node is HTMLInputElement => node instanceof HTMLInputElement)
|
|
53
|
-
.filter((tab) => !tab
|
|
63
|
+
.filter((tab) => !isDisabledItem(tab));
|
|
54
64
|
if (tabs.length < 2) return;
|
|
55
65
|
|
|
56
|
-
const vertical = this.getAttribute("data-tabs-orientation") === "vertical";
|
|
57
|
-
const prevKey = vertical ? "ArrowUp" : "ArrowLeft";
|
|
58
|
-
const nextKey = vertical ? "ArrowDown" : "ArrowRight";
|
|
59
|
-
|
|
60
66
|
const index = tabs.indexOf(target);
|
|
61
67
|
if (index === -1) return;
|
|
62
68
|
|
|
63
|
-
let nextIndex: number;
|
|
64
|
-
switch (event.key) {
|
|
65
|
-
case prevKey:
|
|
66
|
-
nextIndex = (index - 1 + tabs.length) % tabs.length;
|
|
67
|
-
break;
|
|
68
|
-
case nextKey:
|
|
69
|
-
nextIndex = (index + 1) % tabs.length;
|
|
70
|
-
break;
|
|
71
|
-
case "Home":
|
|
72
|
-
nextIndex = 0;
|
|
73
|
-
break;
|
|
74
|
-
case "End":
|
|
75
|
-
nextIndex = tabs.length - 1;
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
69
|
event.preventDefault();
|
|
82
70
|
|
|
83
|
-
const tab = tabs[
|
|
71
|
+
const tab = tabs[stepIndex(index, step, tabs.length)];
|
|
84
72
|
tab.checked = true;
|
|
85
73
|
tab.focus();
|
|
86
74
|
tab.dispatchEvent(new Event("change", { bubbles: true }));
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
--_radius-len: var(--_radius-resolved, var(--ui-textarea-radius));
|
|
67
67
|
--_radius-num: var(--_radius-resolved, var(--ui-textarea-radius));
|
|
68
68
|
border-radius: calc(
|
|
69
|
-
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-
|
|
69
|
+
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
|
|
70
70
|
);
|
|
71
71
|
corner-shape: var(--_corner-shape-resolved, var(--ui-textarea-corner-shape));
|
|
72
72
|
resize: var(--ui-textarea-resize);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "textarea",
|
|
3
|
+
"summary": "textarea.css — Textarea ([data-ui~=\"textarea\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"textarea"
|
|
6
|
+
],
|
|
7
|
+
"tags": [],
|
|
8
|
+
"hooks": {
|
|
9
|
+
"Box Model & Sizing": {
|
|
10
|
+
"--ui-textarea-max-h": "12lh",
|
|
11
|
+
"--ui-textarea-min-h": "5lh",
|
|
12
|
+
"--ui-textarea-min-w": "0",
|
|
13
|
+
"--ui-textarea-px": "var(--ui-field-px)",
|
|
14
|
+
"--ui-textarea-py": "var(--ui-field-py)",
|
|
15
|
+
"--ui-textarea-w": "100%"
|
|
16
|
+
},
|
|
17
|
+
"Typography": {
|
|
18
|
+
"--ui-textarea-font-size": "var(--ui-field-font-size)",
|
|
19
|
+
"--ui-textarea-leading": "var(--leading-sm)"
|
|
20
|
+
},
|
|
21
|
+
"Borders & Outlines": {
|
|
22
|
+
"--ui-textarea-border-color": "var(--ui-field-border-color)",
|
|
23
|
+
"--ui-textarea-border-style": "var(--ui-field-border-style)",
|
|
24
|
+
"--ui-textarea-border-width": "var(--ui-field-border-width)",
|
|
25
|
+
"--ui-textarea-corner-shape": "var(--ui-field-corner-shape)",
|
|
26
|
+
"--ui-textarea-radius": "var(--ui-field-radius)"
|
|
27
|
+
},
|
|
28
|
+
"Interaction & UI": {
|
|
29
|
+
"--ui-textarea-resize": "vertical"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"attributes": {},
|
|
33
|
+
"slots": {},
|
|
34
|
+
"states": {},
|
|
35
|
+
"requires": [
|
|
36
|
+
"fields"
|
|
37
|
+
],
|
|
38
|
+
"files": {
|
|
39
|
+
"css": [
|
|
40
|
+
"primitives/textarea/textarea.css"
|
|
41
|
+
],
|
|
42
|
+
"js": [],
|
|
43
|
+
"base": [],
|
|
44
|
+
"examples": [
|
|
45
|
+
"primitives/textarea/textarea.html"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["toaster.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toaster.d.ts","sourceRoot":"","sources":["toaster.ts"],"names":[],"mappings":"AAiDA,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAsC5E,UAAU,WAAW;IACnB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,2EAA2E;IAC3E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAED,UAAU,YAAY;IACpB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;IACzD,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,wDAAwD;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAmBD,0EAA0E;AAC1E,UAAU,gBAAgB;IACxB,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;CAClB;AAqBD;;;;;;;;GAQG;AACH,iBAAS,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG;IAC9C,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAkBA;AA0BD,cAAM,SAAU,SAAQ,WAAW;;IAkCjC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CA0FzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAKzB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,GAAE,YAAiB,GAAG,MAAM,CAe3C;IAED;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAiCzB;IAED;;OAEG;IACH,UAAU,IAAI,IAAI,CAKjB;CAoYF;AAqCD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,OAAO;IACX;;;;;OAKG;IACH,KAAK,WAAW,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI;IAMrD;;;;;;OAMG;IACH,OAAO,UAAU,MAAM,YAAY,YAAY,GAAG,MAAM,GAAG,IAAI;IAI/D;;;;;;OAMG;IACH,IAAI,UAAU,MAAM,YAAY,YAAY,GAAG,MAAM,GAAG,IAAI;IAI5D;;;;;;OAMG;IACH,OAAO,UAAU,MAAM,YAAY,YAAY,GAAG,MAAM,GAAG,IAAI;IAI/D;;;;;;OAMG;IACH,KAAK,UAAU,MAAM,YAAY,YAAY,GAAG,MAAM,GAAG,IAAI;IAI7D;;;;OAIG;IACH,OAAO,MAAM,MAAM,GAAG,IAAI;CAK3B,CAAC;AAQF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -76,7 +76,8 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
76
76
|
* sideways toward the nearest inline edge (either way when centered). A swipe
|
|
77
77
|
* past 45px dismisses, and so does a quick flick; anything less springs back,
|
|
78
78
|
* and the other directions resist. In the collapsed stack only the front toast
|
|
79
|
-
* swipes.
|
|
79
|
+
* swipes. `data-draggable="false"` on the region turns swiping off for its
|
|
80
|
+
* toasts.
|
|
80
81
|
*
|
|
81
82
|
* Region attributes:
|
|
82
83
|
* - `data-toaster-position`: `top-start | top-center | top-end | bottom-start |
|
|
@@ -86,7 +87,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
86
87
|
* <ui-toaster id="toaster" popover="manual"></ui-toaster>
|
|
87
88
|
* <button commandfor="toaster" command="--toast" data-toaster-title="Saved">Save</button>
|
|
88
89
|
*/
|
|
89
|
-
import { currentTranslate, flickDuration, maxTransitionMs, rubberBand, shouldDismiss, trackDrag, } from "../../
|
|
90
|
+
import { currentTranslate, flickDuration, maxTransitionMs, rubberBand, shouldDismiss, trackDrag, } from "../../behaviors/gesture.js";
|
|
90
91
|
import { computed, effect, state } from "../../base/signals.js";
|
|
91
92
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
|
|
92
93
|
// compiled `using` reads Symbol.dispose, which engines without native Explicit
|
|
@@ -436,7 +437,6 @@ class UiToaster extends ZazzElement {
|
|
|
436
437
|
button.type = "button";
|
|
437
438
|
button.dataset.ui = "button";
|
|
438
439
|
button.setAttribute("data-toaster-slot", "action");
|
|
439
|
-
button.dataset.buttonSize = "sm";
|
|
440
440
|
button.textContent = action.label;
|
|
441
441
|
button.addEventListener("click", (event) => {
|
|
442
442
|
action.onClick?.(event);
|
|
@@ -451,7 +451,7 @@ class UiToaster extends ZazzElement {
|
|
|
451
451
|
close.dataset.ui = "button";
|
|
452
452
|
close.setAttribute("data-toaster-slot", "close");
|
|
453
453
|
close.dataset.buttonVariant = "ghost";
|
|
454
|
-
close.dataset.buttonSize = "icon
|
|
454
|
+
close.dataset.buttonSize = "icon";
|
|
455
455
|
close.setAttribute("aria-label", "Close notification");
|
|
456
456
|
close.innerHTML = ICONS.close;
|
|
457
457
|
close.addEventListener("click", () => this.dismiss(id));
|