@zazz-ui/core 0.4.0 → 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 +341 -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 +45 -43
- 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 +147 -126
- 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 +89 -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 +299 -191
- 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,17 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* kbd.css: Kbd (native <kbd>) + Kbd group (ui-kbd-group |
|
|
2
|
+
* kbd.css: Kbd (native <kbd>) + Kbd group (ui-kbd-group | [data-ui~="kbd-group"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, reset, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
|
|
6
6
|
* @uses text-box: vertical trim (patchy browser support)
|
|
7
7
|
* @tokens --ui-kbd-*, --ui-kbd-group-* (@layer variables)
|
|
8
|
-
* @consumedby button.css, tooltip.css
|
|
8
|
+
* @consumedby button.css, tooltip.css (reassign --ui-kbd-* in scope), command.css (selects the group)
|
|
9
9
|
*
|
|
10
|
-
* The key itself styles the bare native <kbd> (no
|
|
10
|
+
* The key itself styles the bare native <kbd> (no identity needed) so its rules
|
|
11
11
|
* live in @layer reset (browser-policy exception, like the switch redraw) and
|
|
12
12
|
* lose to component scopes. Hooks are declared on :root, not on the element,
|
|
13
13
|
* so an ancestor scope (a button, a tooltip) can reassign a --ui-kbd-* token
|
|
14
|
-
* and inheritance carries it down to the key.
|
|
14
|
+
* and inheritance carries it down to the key. Each utility-backed declaration
|
|
15
|
+
* reads var(--_<utility>-resolved, var(--ui-kbd-<utility>)): no variants, no privates.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
18
|
@layer variables {
|
|
@@ -19,24 +20,24 @@
|
|
|
19
20
|
/* type */
|
|
20
21
|
--ui-kbd-font-family: var(--font-family-mono);
|
|
21
22
|
--ui-kbd-font-size: var(--font-size-xs);
|
|
22
|
-
--ui-kbd-
|
|
23
|
+
--ui-kbd-leading: 1;
|
|
23
24
|
|
|
24
25
|
/* surface */
|
|
25
|
-
--ui-kbd-
|
|
26
|
-
--ui-kbd-
|
|
26
|
+
--ui-kbd-bg: var(--color-muted);
|
|
27
|
+
--ui-kbd-text: var(--color-muted-foreground);
|
|
27
28
|
--ui-kbd-border: 1px solid transparent;
|
|
28
|
-
--ui-kbd-
|
|
29
|
+
--ui-kbd-rounded: var(--radius-xs);
|
|
29
30
|
|
|
30
|
-
/* metrics */
|
|
31
|
-
--ui-kbd-
|
|
32
|
-
--ui-kbd-
|
|
33
|
-
--ui-kbd-min-
|
|
34
|
-
--ui-kbd-min-
|
|
35
|
-
--ui-kbd-icon-size: var(--
|
|
36
|
-
--ui-kbd-gap: var(--
|
|
31
|
+
/* metrics (dual-mode: a scale number or a length) */
|
|
32
|
+
--ui-kbd-px: var(--spacing);
|
|
33
|
+
--ui-kbd-py: 0;
|
|
34
|
+
--ui-kbd-min-w: calc(var(--spacing) * 5);
|
|
35
|
+
--ui-kbd-min-h: calc(var(--spacing) * 5);
|
|
36
|
+
--ui-kbd-icon-size: calc(var(--spacing) * 3.5);
|
|
37
|
+
--ui-kbd-gap: var(--spacing);
|
|
37
38
|
|
|
38
39
|
/* group: the one gap between adjacent keys, everywhere */
|
|
39
|
-
--ui-kbd-group-gap: var(--
|
|
40
|
+
--ui-kbd-group-gap: var(--spacing);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -49,19 +50,29 @@
|
|
|
49
50
|
display: inline-flex;
|
|
50
51
|
align-items: center;
|
|
51
52
|
justify-content: center;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
--_gap-len: var(--_gap-resolved, var(--ui-kbd-gap));
|
|
54
|
+
--_gap-num: var(--_gap-resolved, var(--ui-kbd-gap));
|
|
55
|
+
gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
56
|
+
font-family: var(--_font-family-resolved, var(--ui-kbd-font-family));
|
|
57
|
+
font-size: var(--_font-size-resolved, var(--ui-kbd-font-size));
|
|
58
|
+
line-height: var(--_leading-resolved, var(--ui-kbd-leading));
|
|
59
|
+
background-color: var(--_bg-resolved, var(--ui-kbd-bg));
|
|
60
|
+
color: var(--_text-resolved, var(--ui-kbd-text));
|
|
61
|
+
--_px-len: var(--_px-resolved, var(--ui-kbd-px));
|
|
62
|
+
--_px-num: var(--_px-resolved, var(--ui-kbd-px));
|
|
63
|
+
padding-inline: calc(var(--_px-len) + var(--_px-num) * var(--spacing));
|
|
64
|
+
--_py-len: var(--_py-resolved, var(--ui-kbd-py));
|
|
65
|
+
--_py-num: var(--_py-resolved, var(--ui-kbd-py));
|
|
66
|
+
padding-block: calc(var(--_py-len) + var(--_py-num) * var(--spacing));
|
|
60
67
|
border: var(--ui-kbd-border);
|
|
61
|
-
border-radius: var(--ui-kbd-
|
|
68
|
+
border-radius: var(--_rounded-resolved, var(--ui-kbd-rounded));
|
|
62
69
|
overflow: hidden;
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
--_min-w-len: var(--_min-w-resolved, var(--ui-kbd-min-w));
|
|
71
|
+
--_min-w-num: var(--_min-w-resolved, var(--ui-kbd-min-w));
|
|
72
|
+
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
73
|
+
--_min-h-len: var(--_min-h-resolved, var(--ui-kbd-min-h));
|
|
74
|
+
--_min-h-num: var(--_min-h-resolved, var(--ui-kbd-min-h));
|
|
75
|
+
min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
65
76
|
inline-size: fit-content;
|
|
66
77
|
text-box: trim-both ex alphabetic;
|
|
67
78
|
}
|
|
@@ -72,16 +83,18 @@
|
|
|
72
83
|
}
|
|
73
84
|
}
|
|
74
85
|
|
|
75
|
-
@layer
|
|
86
|
+
@layer ui.components {
|
|
76
87
|
/* ===========================================================================
|
|
77
88
|
KBD GROUP — a run of keys forming one shortcut ("⌘ K")
|
|
78
89
|
- Wrap adjacent <kbd> siblings so their spacing is the shared
|
|
79
90
|
--ui-kbd-group-gap token instead of whatever gap the host happens to have.
|
|
80
91
|
=========================================================================== */
|
|
81
92
|
|
|
82
|
-
:where(ui-kbd-group,
|
|
93
|
+
:where(ui-kbd-group, [data-ui~="kbd-group"]) {
|
|
83
94
|
display: inline-flex;
|
|
84
95
|
align-items: center;
|
|
85
|
-
|
|
96
|
+
--_gap-len: var(--_gap-resolved, var(--ui-kbd-group-gap));
|
|
97
|
+
--_gap-num: var(--_gap-resolved, var(--ui-kbd-group-gap));
|
|
98
|
+
gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
86
99
|
}
|
|
87
100
|
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* layout.css — Layout (ui-layout | [data-ui~="layout"]): the band grid
|
|
3
|
+
*
|
|
4
|
+
* @layer variables, components
|
|
5
|
+
* @requires _layers.css, _variables.css (--gutters), _breakpoints.css (--layout-*),
|
|
6
|
+
* _properties.css (--_band-resolved)
|
|
7
|
+
* @uses named grid lines + implicit named areas: `--band: layout-md` on a
|
|
8
|
+
* child resolves through `layout-md-start / layout-md-end`
|
|
9
|
+
* @uses grid-template-columns: subgrid — a layout that is a direct child keeps the parent's
|
|
10
|
+
* line names
|
|
11
|
+
* @tokens --ui-layout-* (@layer variables); band widths read --layout-* (_breakpoints.css)
|
|
12
|
+
* @uses container-type: inline-size on each child (not nested layouts, subgrids,
|
|
13
|
+
* or content-sized children), so breakpoint tiers inside a band follow it
|
|
14
|
+
* @presets data-layout-size="sm | md | lg | xl | 2xl | full | bleed"
|
|
15
|
+
* (the default band for this layout's children; xl when absent)
|
|
16
|
+
*
|
|
17
|
+
* The layout element itself is the grid; nothing styles a parent. Each side band
|
|
18
|
+
* is a clamp() that stays at 0 until the inner content has reached its breakpoint
|
|
19
|
+
* width, then grows up to its fixed step, so a band caps and centers while there
|
|
20
|
+
* is room and fluidly fills (minus gutters) once there is not. Band widths equal
|
|
21
|
+
* the breakpoint widths; `layout-full` is the layout minus the gutters;
|
|
22
|
+
* `layout-bleed` runs edge to edge. Children are placed by the chain
|
|
23
|
+
* `var(--_band-resolved, var(--ui-layout-band))`: a `--band` utility (or tier) on the
|
|
24
|
+
* child, else the layout's default band. The `--band` no-base rule excludes layout
|
|
25
|
+
* children (utilities.ts), so a tier-only `--band--lg` keeps the band below lg.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
@layer variables {
|
|
29
|
+
:root {
|
|
30
|
+
--ui-layout-gutters: var(--gutters);
|
|
31
|
+
/* inline space left for the bands once the two gutters are removed */
|
|
32
|
+
--ui-layout-available: calc(100% - var(--ui-layout-gutters) * 2);
|
|
33
|
+
/* the default band for children; data-layout-size changes it per layout */
|
|
34
|
+
--ui-layout-band: layout-xl;
|
|
35
|
+
/* each child's container type: inline-size so tiers inside a band follow it;
|
|
36
|
+
set normal on a layout to opt its children out */
|
|
37
|
+
--ui-layout-child-container: inline-size;
|
|
38
|
+
--ui-layout-template-columns: [layout-bleed-start] var(--ui-layout-gutters) [layout-full-start]
|
|
39
|
+
minmax(0, 1fr) [layout-2xl-start]
|
|
40
|
+
clamp(
|
|
41
|
+
0rem,
|
|
42
|
+
calc((var(--ui-layout-available) - var(--layout-xl)) / 2),
|
|
43
|
+
calc((var(--layout-2xl) - var(--layout-xl)) / 2)
|
|
44
|
+
)
|
|
45
|
+
[layout-xl-start]
|
|
46
|
+
clamp(
|
|
47
|
+
0rem,
|
|
48
|
+
calc((var(--ui-layout-available) - var(--layout-lg)) / 2),
|
|
49
|
+
calc((var(--layout-xl) - var(--layout-lg)) / 2)
|
|
50
|
+
)
|
|
51
|
+
[layout-lg-start]
|
|
52
|
+
clamp(
|
|
53
|
+
0rem,
|
|
54
|
+
calc((var(--ui-layout-available) - var(--layout-md)) / 2),
|
|
55
|
+
calc((var(--layout-lg) - var(--layout-md)) / 2)
|
|
56
|
+
)
|
|
57
|
+
[layout-md-start]
|
|
58
|
+
clamp(
|
|
59
|
+
0rem,
|
|
60
|
+
calc((var(--ui-layout-available) - var(--layout-sm)) / 2),
|
|
61
|
+
calc((var(--layout-md) - var(--layout-sm)) / 2)
|
|
62
|
+
)
|
|
63
|
+
[layout-sm-start] clamp(0rem, var(--ui-layout-available), var(--layout-sm)) [layout-sm-end]
|
|
64
|
+
clamp(
|
|
65
|
+
0rem,
|
|
66
|
+
calc((var(--ui-layout-available) - var(--layout-sm)) / 2),
|
|
67
|
+
calc((var(--layout-md) - var(--layout-sm)) / 2)
|
|
68
|
+
)
|
|
69
|
+
[layout-md-end]
|
|
70
|
+
clamp(
|
|
71
|
+
0rem,
|
|
72
|
+
calc((var(--ui-layout-available) - var(--layout-md)) / 2),
|
|
73
|
+
calc((var(--layout-lg) - var(--layout-md)) / 2)
|
|
74
|
+
)
|
|
75
|
+
[layout-lg-end]
|
|
76
|
+
clamp(
|
|
77
|
+
0rem,
|
|
78
|
+
calc((var(--ui-layout-available) - var(--layout-lg)) / 2),
|
|
79
|
+
calc((var(--layout-xl) - var(--layout-lg)) / 2)
|
|
80
|
+
)
|
|
81
|
+
[layout-xl-end]
|
|
82
|
+
clamp(
|
|
83
|
+
0rem,
|
|
84
|
+
calc((var(--ui-layout-available) - var(--layout-xl)) / 2),
|
|
85
|
+
calc((var(--layout-2xl) - var(--layout-xl)) / 2)
|
|
86
|
+
)
|
|
87
|
+
[layout-2xl-end] minmax(0, 1fr) [layout-full-end] var(--ui-layout-gutters) [layout-bleed-end];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@layer ui.components {
|
|
92
|
+
:where(ui-layout, [data-ui~="layout"]) {
|
|
93
|
+
display: grid;
|
|
94
|
+
grid-template-columns: var(--ui-layout-template-columns);
|
|
95
|
+
/* the bands are positioned exactly by the template: no column gap */
|
|
96
|
+
column-gap: 0;
|
|
97
|
+
/* children sit at the block start and stretch across their band */
|
|
98
|
+
place-items: start stretch;
|
|
99
|
+
/* a container context would break a nested subgrid */
|
|
100
|
+
container-type: normal;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
:where(ui-layout, [data-ui~="layout"]) > * {
|
|
104
|
+
grid-column: var(--_band-resolved, var(--ui-layout-band));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Each child is an inline-size query container, so breakpoint tiers inside
|
|
108
|
+
a band follow the band's width, not the full-width section around it.
|
|
109
|
+
Containment would stop a subgrid (a nested layout, or a child aligning to
|
|
110
|
+
the bands) and collapse a child sized by its content, so those stay out. */
|
|
111
|
+
:where(ui-layout, [data-ui~="layout"])
|
|
112
|
+
> :where(
|
|
113
|
+
:not(
|
|
114
|
+
ui-layout,
|
|
115
|
+
[data-ui~="layout"],
|
|
116
|
+
[style*="subgrid"],
|
|
117
|
+
[style*="fit-content"],
|
|
118
|
+
[style*="min-content"],
|
|
119
|
+
[style*="max-content"]
|
|
120
|
+
)
|
|
121
|
+
) {
|
|
122
|
+
container-type: var(--ui-layout-child-container);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* A layout placed directly in a band is a subgrid and keeps the parent's line
|
|
126
|
+
names; one deeper inside (in a card, a section) has no parent grid to share,
|
|
127
|
+
so it stays its own band grid */
|
|
128
|
+
:where(ui-layout, [data-ui~="layout"]) > :where(ui-layout, [data-ui~="layout"]) {
|
|
129
|
+
grid-template-columns: subgrid;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where(ui-layout[data-layout-size="sm"], [data-ui~="layout"][data-layout-size="sm"]) {
|
|
133
|
+
--ui-layout-band: layout-sm;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:where(ui-layout[data-layout-size="md"], [data-ui~="layout"][data-layout-size="md"]) {
|
|
137
|
+
--ui-layout-band: layout-md;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:where(ui-layout[data-layout-size="lg"], [data-ui~="layout"][data-layout-size="lg"]) {
|
|
141
|
+
--ui-layout-band: layout-lg;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where(ui-layout[data-layout-size="xl"], [data-ui~="layout"][data-layout-size="xl"]) {
|
|
145
|
+
--ui-layout-band: layout-xl;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:where(ui-layout[data-layout-size="2xl"], [data-ui~="layout"][data-layout-size="2xl"]) {
|
|
149
|
+
--ui-layout-band: layout-2xl;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:where(ui-layout[data-layout-size="full"], [data-ui~="layout"][data-layout-size="full"]) {
|
|
153
|
+
--ui-layout-band: layout-full;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:where(ui-layout[data-layout-size="bleed"], [data-ui~="layout"][data-layout-size="bleed"]) {
|
|
157
|
+
--ui-layout-band: layout-bleed;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<ui-layout style="--gap: 4">
|
|
2
|
+
<div data-ui="card" style="--p: 4">Default band (xl)</div>
|
|
3
|
+
<div
|
|
4
|
+
data-ui="card"
|
|
5
|
+
style="
|
|
6
|
+
--band: layout-md;
|
|
7
|
+
--p: 4;
|
|
8
|
+
"
|
|
9
|
+
>
|
|
10
|
+
--band: layout-md
|
|
11
|
+
</div>
|
|
12
|
+
<div
|
|
13
|
+
data-ui="card"
|
|
14
|
+
style="
|
|
15
|
+
--band: layout-bleed;
|
|
16
|
+
--p: 4;
|
|
17
|
+
--rounded: 0;
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
--band: layout-bleed
|
|
21
|
+
</div>
|
|
22
|
+
<div
|
|
23
|
+
data-ui="card"
|
|
24
|
+
style="
|
|
25
|
+
--band: layout-sm;
|
|
26
|
+
--band--lg: layout-xl;
|
|
27
|
+
--p: 4;
|
|
28
|
+
"
|
|
29
|
+
>
|
|
30
|
+
--band: layout-sm, --band--lg: layout-xl
|
|
31
|
+
</div>
|
|
32
|
+
<ui-layout data-layout-size="md" style="--band: layout-bleed">
|
|
33
|
+
<div data-ui="card" style="--p: 4">nested layout, data-layout-size="md"</div>
|
|
34
|
+
</ui-layout>
|
|
35
|
+
</ui-layout>
|