@zazz-ui/core 0.4.1 → 0.5.1
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 +345 -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 +61 -31
- 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 +76 -26
- 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
|
@@ -2,135 +2,122 @@
|
|
|
2
2
|
* fields.css: Shared form field family (Tier 3 owner for --ui-field-*)
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
|
|
6
6
|
* @uses :user-invalid: validation after commit (not while typing)
|
|
7
7
|
* @uses :has(:user-invalid): label/hint/error crossfade
|
|
8
8
|
* @uses @starting-style + visibility allow-discrete: hint <-> error swap
|
|
9
|
-
* @uses color-mix(): destructive field tint on invalid
|
|
10
9
|
* @tokens --ui-field-*, --ui-field-group-* (Tier 3 owner; @layer variables)
|
|
11
10
|
* @consumedby input.css, textarea.css, select.css, input-group.css,
|
|
12
|
-
* password-group.css, otp.css, radio.css
|
|
11
|
+
* password-group.css, otp.css, radio.css, checkbox.css,
|
|
13
12
|
* autocomplete.css, combobox.css, command.css,
|
|
14
|
-
* button.css (metrics:
|
|
15
|
-
* toggle.css (via button.css), tabs.css,
|
|
13
|
+
* button.css (metrics: h/rounded/px/text/leading/icon/ring/border width+style),
|
|
14
|
+
* toggle.css (via button.css), tabs.css, badge.css (border/ring)
|
|
15
|
+
*
|
|
16
|
+
* Identities: data-ui="field" (label + control + description wrapper),
|
|
17
|
+
* data-ui="field-group" (fieldset; data-ui="radio-group" shares its rules).
|
|
18
|
+
* Slots: data-field-slot="label | description | hint | error".
|
|
19
|
+
* Each control owns its own disabled and :user-invalid rules and remaps the
|
|
20
|
+
* --ui-field-* family on itself when invalid.
|
|
16
21
|
*/
|
|
17
22
|
|
|
18
23
|
@layer variables {
|
|
19
24
|
:root {
|
|
20
|
-
--ui-field-
|
|
21
|
-
--ui-field-
|
|
22
|
-
--ui-field-
|
|
25
|
+
--ui-field-bg: var(--color-input);
|
|
26
|
+
--ui-field-bg--hover: var(--color-input);
|
|
27
|
+
--ui-field-bg--focus-within: var(--color-background);
|
|
23
28
|
|
|
24
|
-
--ui-field-
|
|
29
|
+
--ui-field-text: var(--color-input-foreground);
|
|
25
30
|
|
|
26
31
|
--ui-field-border-width: 1px;
|
|
27
32
|
--ui-field-border-style: solid;
|
|
28
|
-
--ui-field-border-color: var(--border);
|
|
29
|
-
--ui-field-border-color--hover:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
--ui-field-
|
|
33
|
+
--ui-field-border-color: var(--color-border);
|
|
34
|
+
--ui-field-border-color--hover: color-mix(
|
|
35
|
+
in oklch,
|
|
36
|
+
var(--color-border) 90%,
|
|
37
|
+
var(--color-primary) 10%
|
|
38
|
+
);
|
|
39
|
+
--ui-field-border-color--focus-within: var(--color-primary);
|
|
40
|
+
|
|
41
|
+
--ui-field-label-text: inherit;
|
|
42
|
+
--ui-field-ring-color: var(--color-ring);
|
|
43
|
+
--ui-field-rounded: var(--radius-md);
|
|
35
44
|
--ui-field-inset-child-radius: var(--radius-sm);
|
|
36
|
-
--ui-field-
|
|
45
|
+
--ui-field-h: calc(var(--spacing) * 8);
|
|
37
46
|
--ui-field-font-size: var(--font-size-sm);
|
|
38
|
-
--ui-field-
|
|
39
|
-
--ui-field-
|
|
40
|
-
--ui-field-addon-padding: var(--
|
|
41
|
-
--ui-field-gap: var(--
|
|
42
|
-
--ui-field-option-gap:
|
|
43
|
-
--ui-field-icon-size: var(--
|
|
44
|
-
|
|
47
|
+
--ui-field-leading: 1;
|
|
48
|
+
--ui-field-px: calc(var(--spacing) * 2.5);
|
|
49
|
+
--ui-field-addon-padding: var(--spacing);
|
|
50
|
+
--ui-field-gap: calc(var(--spacing) * 2);
|
|
51
|
+
--ui-field-option-gap: 1px;
|
|
52
|
+
--ui-field-icon-size: calc(var(--spacing) * 4);
|
|
53
|
+
|
|
54
|
+
/* wrapper layout */
|
|
45
55
|
--ui-field-display: grid;
|
|
46
|
-
--ui-field-template-
|
|
47
|
-
--ui-field-
|
|
48
|
-
--ui-field-
|
|
56
|
+
--ui-field-template-cols: 1fr;
|
|
57
|
+
--ui-field-self: flex-start;
|
|
58
|
+
--ui-field-w: 100%;
|
|
49
59
|
|
|
50
60
|
/* Reveal transitions/animations */
|
|
51
|
-
--ui-field-hint-translate--start: 0 calc(var(--
|
|
61
|
+
--ui-field-hint-translate--start: 0 calc(var(--spacing) * -1);
|
|
52
62
|
--ui-field-hint-translate--end: 0 0;
|
|
53
63
|
|
|
54
64
|
--ui-field-group-display: grid;
|
|
55
65
|
--ui-field-group-border: 1px solid transparent;
|
|
56
|
-
--ui-field-group-
|
|
57
|
-
--ui-field-group-
|
|
58
|
-
--ui-field-group-
|
|
59
|
-
--ui-field-group-gap: var(--
|
|
60
|
-
--ui-field-group-
|
|
66
|
+
--ui-field-group-bg: transparent;
|
|
67
|
+
--ui-field-group-p: 0;
|
|
68
|
+
--ui-field-group-m: 0;
|
|
69
|
+
--ui-field-group-gap: var(--space-xs);
|
|
70
|
+
--ui-field-group-rounded: var(--radius-lg);
|
|
61
71
|
}
|
|
62
72
|
}
|
|
63
73
|
|
|
64
|
-
@layer
|
|
74
|
+
@layer ui.components {
|
|
65
75
|
/* ===========================================================================
|
|
66
76
|
FORM: global form behaviour shared across every control
|
|
67
77
|
- This file holds only the cross-control glue: the shared field-level tokens,
|
|
68
|
-
the
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.ui-input -> input.css
|
|
72
|
-
.ui-textarea -> textarea.css
|
|
73
|
-
.ui-select -> select.css
|
|
74
|
-
.ui-input-group -> input-group.css
|
|
75
|
-
checkbox -> _reset.css (input[type="checkbox"])
|
|
76
|
-
switch -> _reset.css (input[role="switch"])
|
|
77
|
-
.ui-radio -> radio.css
|
|
78
|
+
the field layout wrapper, the field-group / radio-group fieldsets, and the
|
|
79
|
+
validation messaging. Each control lives in its own file and owns its own
|
|
80
|
+
disabled and :user-invalid rules.
|
|
78
81
|
=========================================================================== */
|
|
79
82
|
|
|
80
83
|
/* ---------------------------------------------------------------------------
|
|
81
84
|
SHARED FIELD TOKENS: Tier-3 shared family, owned here.
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
- Sibling control files only remap these --ui-field-* tokens; this is the owner.
|
|
86
|
-
--------------------------------------------------------------------------- */
|
|
87
|
-
|
|
88
|
-
/* ---------------------------------------------------------------------------
|
|
89
|
-
SHARED DISABLED STATE
|
|
85
|
+
- input / textarea / select / input-group all share the same surface treatment
|
|
86
|
+
so a text input, a dropdown, and a message box read as one family. Each
|
|
87
|
+
control aliases these into its own hooks so a single override retunes the set.
|
|
90
88
|
--------------------------------------------------------------------------- */
|
|
91
89
|
|
|
92
|
-
.ui-input:disabled,
|
|
93
|
-
.ui-textarea:disabled,
|
|
94
|
-
.ui-select:disabled,
|
|
95
|
-
.ui-input-file:disabled,
|
|
96
|
-
.ui-input-color:disabled,
|
|
97
|
-
.ui-input-group:disabled,
|
|
98
|
-
.ui-password-group:disabled,
|
|
99
|
-
input[type="checkbox"]:disabled,
|
|
100
|
-
.ui-radio:disabled,
|
|
101
|
-
.ui-input-group:has(:disabled) {
|
|
102
|
-
opacity: 0.5;
|
|
103
|
-
cursor: not-allowed;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
90
|
/* ---------------------------------------------------------------------------
|
|
107
|
-
FIELD WRAPPER:
|
|
91
|
+
FIELD WRAPPER: data-ui="field" (label + control + hint/error)
|
|
108
92
|
- Optional layout helper. Validation messaging uses :user-invalid so errors
|
|
109
93
|
surface only after the user commits a value (blur/submit), never while typing.
|
|
110
94
|
--------------------------------------------------------------------------- */
|
|
111
95
|
|
|
112
|
-
|
|
96
|
+
:where([data-ui~="field"]) {
|
|
113
97
|
/* --ui-field-gap differs from the control family default (step-2) */
|
|
114
|
-
--ui-field-gap: var(--
|
|
115
|
-
|
|
116
|
-
display: var(--ui-field-display);
|
|
117
|
-
grid-template-columns: var(--ui-field-template-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
98
|
+
--ui-field-gap: var(--spacing);
|
|
99
|
+
|
|
100
|
+
display: var(--_display-resolved, var(--ui-field-display));
|
|
101
|
+
grid-template-columns: var(--_template-cols-resolved, var(--ui-field-template-cols));
|
|
102
|
+
--_gap-len: var(--_gap-resolved, var(--ui-field-gap));
|
|
103
|
+
--_gap-num: var(--_gap-resolved, var(--ui-field-gap));
|
|
104
|
+
gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
105
|
+
align-self: var(--_self-resolved, var(--ui-field-self));
|
|
106
|
+
--_w-len: var(--_w-resolved, var(--ui-field-w));
|
|
107
|
+
--_w-num: var(--_w-resolved, var(--ui-field-w));
|
|
108
|
+
inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
|
|
121
109
|
}
|
|
122
110
|
|
|
123
|
-
|
|
111
|
+
:where([data-ui~="field"]) > :not([data-field-slot~="label"], [data-field-slot~="description"]) {
|
|
124
112
|
grid-row: 2;
|
|
125
113
|
grid-column: 1;
|
|
126
114
|
}
|
|
127
115
|
|
|
128
|
-
|
|
129
|
-
[data-slot~="field-label"] {
|
|
116
|
+
:where([data-ui~="field"]) [data-field-slot~="label"] {
|
|
130
117
|
grid-row: 1;
|
|
131
118
|
grid-column: 1;
|
|
132
119
|
align-self: start;
|
|
133
|
-
color: var(--ui-field-label-
|
|
120
|
+
color: var(--ui-field-label-text);
|
|
134
121
|
font-size: var(--font-size-sm);
|
|
135
122
|
font-weight: var(--font-weight-strong);
|
|
136
123
|
text-align: start;
|
|
@@ -138,12 +125,12 @@
|
|
|
138
125
|
}
|
|
139
126
|
|
|
140
127
|
/* ---------------------------------------------------------------------------
|
|
141
|
-
FIELD DESCRIPTION:
|
|
128
|
+
FIELD DESCRIPTION: data-field-slot="description" (wrapper for hint + error)
|
|
142
129
|
- Occupies a stable grid slot so hint/error swaps never cause layout shift.
|
|
143
130
|
The wrapper keeps a fixed block-size while the children crossfade inside it.
|
|
144
131
|
--------------------------------------------------------------------------- */
|
|
145
132
|
|
|
146
|
-
[data-
|
|
133
|
+
:where([data-ui~="field"]) [data-field-slot~="description"] {
|
|
147
134
|
grid-row: 3;
|
|
148
135
|
grid-column: 1;
|
|
149
136
|
display: grid;
|
|
@@ -152,8 +139,7 @@
|
|
|
152
139
|
}
|
|
153
140
|
|
|
154
141
|
/* Hint and error stack in the same grid area: only one is visible at a time */
|
|
155
|
-
[data-
|
|
156
|
-
[data-slot~="field-error"] {
|
|
142
|
+
:where([data-ui~="field"]) :is([data-field-slot~="hint"], [data-field-slot~="error"]) {
|
|
157
143
|
grid-area: msg;
|
|
158
144
|
display: inline-flex;
|
|
159
145
|
transition:
|
|
@@ -163,22 +149,22 @@
|
|
|
163
149
|
allow-discrete;
|
|
164
150
|
}
|
|
165
151
|
|
|
166
|
-
[data-
|
|
167
|
-
color: var(--muted-foreground);
|
|
152
|
+
:where([data-ui~="field"]) [data-field-slot~="hint"] {
|
|
153
|
+
color: var(--color-muted-foreground);
|
|
168
154
|
opacity: 1;
|
|
169
155
|
translate: var(--ui-field-hint-translate--end);
|
|
170
156
|
visibility: visible;
|
|
171
157
|
}
|
|
172
158
|
|
|
173
|
-
[data-
|
|
174
|
-
color: var(--destructive);
|
|
159
|
+
:where([data-ui~="field"]) [data-field-slot~="error"] {
|
|
160
|
+
color: var(--color-destructive);
|
|
175
161
|
opacity: 0;
|
|
176
162
|
translate: var(--ui-field-hint-translate--start);
|
|
177
163
|
visibility: hidden;
|
|
178
164
|
}
|
|
179
165
|
|
|
180
166
|
/* After interaction: invalid controls turn destructive, reveal the error */
|
|
181
|
-
:where(
|
|
167
|
+
:where([data-ui~="field"]:has(:user-invalid)) [data-field-slot~="hint"] {
|
|
182
168
|
opacity: 0;
|
|
183
169
|
translate: var(--ui-field-hint-translate--start);
|
|
184
170
|
visibility: hidden;
|
|
@@ -190,7 +176,7 @@
|
|
|
190
176
|
}
|
|
191
177
|
}
|
|
192
178
|
|
|
193
|
-
:where(
|
|
179
|
+
:where([data-ui~="field"]:has(:user-invalid)) [data-field-slot~="error"] {
|
|
194
180
|
opacity: 1;
|
|
195
181
|
translate: var(--ui-field-hint-translate--end);
|
|
196
182
|
visibility: visible;
|
|
@@ -202,81 +188,69 @@
|
|
|
202
188
|
}
|
|
203
189
|
}
|
|
204
190
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
.ui-select:user-invalid,
|
|
208
|
-
.ui-input-file:user-invalid,
|
|
209
|
-
.ui-input-group:has(:user-invalid),
|
|
210
|
-
.ui-password-group:has(:user-invalid) {
|
|
211
|
-
--ui-field-background: color-mix(in oklch, var(--destructive) 5%, var(--input));
|
|
212
|
-
--ui-field-background--hover: color-mix(in oklch, var(--destructive) 10%, var(--input));
|
|
213
|
-
--ui-field-border-color: var(--destructive);
|
|
214
|
-
--ui-field-border-color--hover: var(--destructive);
|
|
215
|
-
--ui-field-border-color--focus: var(--destructive);
|
|
216
|
-
--ui-field-ring-color: var(--destructive);
|
|
217
|
-
|
|
218
|
-
border-color: var(--destructive);
|
|
191
|
+
:where([data-ui~="field"]:has(:user-invalid)) [data-field-slot~="label"] {
|
|
192
|
+
--ui-field-label-text: var(--color-destructive);
|
|
219
193
|
}
|
|
220
194
|
|
|
221
|
-
:where(
|
|
222
|
-
--
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
:where(.ui-field:has(:user-invalid)) ::placeholder {
|
|
226
|
-
--placeholder-color: var(--destructive);
|
|
195
|
+
:where([data-ui~="field"]:has(:user-invalid)) ::placeholder {
|
|
196
|
+
--placeholder-color: var(--color-destructive);
|
|
227
197
|
}
|
|
228
198
|
|
|
229
199
|
/* ---------------------------------------------------------------------------
|
|
230
|
-
FIELD GROUP:
|
|
200
|
+
FIELD GROUP: data-ui="field-group" (data-ui="radio-group" shares the rules)
|
|
231
201
|
- Semantic <fieldset> wrapper for a labelled set of related controls (a radio
|
|
232
202
|
group, a set of checkboxes/switches). Resets browser chrome and stacks
|
|
233
203
|
children; the <legend> names the whole set.
|
|
234
204
|
- Use a fieldset/legend ONLY when the legend labels a genuine group. A single
|
|
235
205
|
control (or several independently-labelled fields) should carry its own
|
|
236
|
-
|
|
206
|
+
data-field-slot="label" instead, never lean on the legend as a stand-in label.
|
|
237
207
|
--------------------------------------------------------------------------- */
|
|
238
208
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
209
|
+
:where([data-ui~="field-group"], [data-ui~="radio-group"]) {
|
|
210
|
+
display: var(--_display-resolved, var(--ui-field-group-display));
|
|
211
|
+
background-color: var(--_bg-resolved, var(--ui-field-group-bg));
|
|
212
|
+
--_gap-len: var(--_gap-resolved, var(--ui-field-group-gap));
|
|
213
|
+
--_gap-num: var(--_gap-resolved, var(--ui-field-group-gap));
|
|
214
|
+
gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
244
215
|
border: var(--ui-field-group-border);
|
|
245
|
-
border-radius: var(--ui-field-group-
|
|
246
|
-
|
|
247
|
-
|
|
216
|
+
border-radius: var(--_rounded-resolved, var(--ui-field-group-rounded));
|
|
217
|
+
--_p-len: var(--_p-resolved, var(--ui-field-group-p));
|
|
218
|
+
--_p-num: var(--_p-resolved, var(--ui-field-group-p));
|
|
219
|
+
padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
|
|
220
|
+
--_m-len: var(--_m-resolved, var(--ui-field-group-m));
|
|
221
|
+
--_m-num: var(--_m-resolved, var(--ui-field-group-m));
|
|
222
|
+
margin: calc(var(--_m-len) + var(--_m-num) * var(--spacing));
|
|
248
223
|
}
|
|
249
224
|
|
|
250
|
-
|
|
251
|
-
.ui-field-group > legend,
|
|
252
|
-
.ui-radio-group > legend {
|
|
225
|
+
:where([data-ui~="field-group"], [data-ui~="radio-group"]) > legend {
|
|
253
226
|
padding: 0;
|
|
254
|
-
margin-block: 0 var(--
|
|
255
|
-
color: var(--ui-field-label-
|
|
227
|
+
margin-block: 0 calc(var(--spacing) * 1.5);
|
|
228
|
+
color: var(--ui-field-label-text, inherit);
|
|
256
229
|
font-size: var(--font-size-sm);
|
|
257
230
|
font-weight: var(--font-weight-strong);
|
|
258
231
|
}
|
|
259
232
|
|
|
260
233
|
/* ===========================================================================
|
|
261
|
-
FIELD
|
|
234
|
+
FIELD ORIENTATION: data-field-orientation="horizontal"
|
|
262
235
|
=========================================================================== */
|
|
263
236
|
|
|
264
237
|
/* Inline layout for checkbox/radio/switch: control beside its label */
|
|
265
|
-
|
|
238
|
+
:where([data-ui~="field"][data-field-orientation="horizontal"]) {
|
|
266
239
|
--ui-field-horizontal-display: flex;
|
|
267
240
|
--ui-field-horizontal-flex-direction: row;
|
|
268
241
|
--ui-field-horizontal-align-items: center;
|
|
269
242
|
--ui-field-horizontal-justify-content: flex-start;
|
|
270
|
-
--ui-field-horizontal-gap: var(--
|
|
271
|
-
|
|
272
|
-
display: var(--ui-field-horizontal-display);
|
|
273
|
-
flex-direction: var(--ui-field-horizontal-flex-direction);
|
|
274
|
-
align-items: var(--ui-field-horizontal-align-items);
|
|
275
|
-
justify-content: var(--ui-field-horizontal-justify-content);
|
|
276
|
-
|
|
243
|
+
--ui-field-horizontal-gap: var(--space-xs);
|
|
244
|
+
|
|
245
|
+
display: var(--_display-resolved, var(--ui-field-horizontal-display));
|
|
246
|
+
flex-direction: var(--_flex-direction-resolved, var(--ui-field-horizontal-flex-direction));
|
|
247
|
+
align-items: var(--_items-resolved, var(--ui-field-horizontal-align-items));
|
|
248
|
+
justify-content: var(--_justify-resolved, var(--ui-field-horizontal-justify-content));
|
|
249
|
+
--_gap-len: var(--_gap-resolved, var(--ui-field-horizontal-gap));
|
|
250
|
+
--_gap-num: var(--_gap-resolved, var(--ui-field-horizontal-gap));
|
|
277
251
|
}
|
|
278
252
|
|
|
279
|
-
|
|
253
|
+
:where([data-ui~="field"][data-field-orientation="horizontal"]) [data-field-slot~="label"] {
|
|
280
254
|
align-self: center;
|
|
281
255
|
}
|
|
282
256
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<form
|
|
2
|
+
style="
|
|
3
|
+
--display: flex-col;
|
|
4
|
+
--gap: 6;
|
|
5
|
+
--w: 100%;
|
|
6
|
+
--max-w: 96;
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div data-ui="field">
|
|
10
|
+
<label data-field-slot="label" for="fields-example-email">Email</label>
|
|
11
|
+
<input
|
|
12
|
+
data-ui="input"
|
|
13
|
+
id="fields-example-email"
|
|
14
|
+
name="fields-example-email"
|
|
15
|
+
type="email"
|
|
16
|
+
required
|
|
17
|
+
placeholder="you@example.com"
|
|
18
|
+
autocomplete="email"
|
|
19
|
+
aria-describedby="fields-example-email-hint"
|
|
20
|
+
/>
|
|
21
|
+
<div data-field-slot="description">
|
|
22
|
+
<span data-field-slot="hint" id="fields-example-email-hint"
|
|
23
|
+
>We only use it to sign you in.</span
|
|
24
|
+
>
|
|
25
|
+
<span data-field-slot="error" role="alert">Enter a valid email address.</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<fieldset data-ui="field-group">
|
|
29
|
+
<legend>Notifications</legend>
|
|
30
|
+
<label data-ui="field" data-field-orientation="horizontal">
|
|
31
|
+
<input type="checkbox" name="fields-example-notify" value="mentions" checked />
|
|
32
|
+
<span data-field-slot="label">Mentions</span>
|
|
33
|
+
</label>
|
|
34
|
+
<label data-ui="field" data-field-orientation="horizontal">
|
|
35
|
+
<input type="checkbox" name="fields-example-notify" value="digest" />
|
|
36
|
+
<span data-field-slot="label">Weekly digest</span>
|
|
37
|
+
</label>
|
|
38
|
+
</fieldset>
|
|
39
|
+
</form>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<label
|
|
2
|
-
<input
|
|
3
|
-
<span data-
|
|
1
|
+
<label data-ui="input-group">
|
|
2
|
+
<input data-ui="input" type="text" placeholder="Placeholder" />
|
|
3
|
+
<span data-input-group-slot="addon">
|
|
4
4
|
<svg
|
|
5
5
|
xmlns="http://www.w3.org/2000/svg"
|
|
6
6
|
viewBox="0 0 24 24"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<label
|
|
2
|
-
<input
|
|
3
|
-
<span data-
|
|
1
|
+
<label data-ui="input-group">
|
|
2
|
+
<input data-ui="input" type="search" placeholder="Search…" aria-label="Search" />
|
|
3
|
+
<span data-input-group-slot="addon" data-input-group-align="inline-end">
|
|
4
4
|
<svg
|
|
5
5
|
xmlns="http://www.w3.org/2000/svg"
|
|
6
6
|
viewBox="0 0 24 24"
|
|
@@ -1,93 +1,111 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* input.css — Text input (
|
|
2
|
+
* input.css — Text input ([data-ui~="input"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-ring), fields.css, _reset.css
|
|
6
6
|
* @uses ::-webkit-calendar-picker-indicator — date/time picker chrome (WebKit)
|
|
7
7
|
* @uses mask — calendar icon (not background-image, for color: currentColor)
|
|
8
|
-
* @tokens --ui-input-* (@layer variables
|
|
8
|
+
* @tokens --ui-input-* (@layer variables; surface colors and height read the
|
|
9
|
+
* --ui-field-* family directly)
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
@layer variables {
|
|
12
13
|
:root {
|
|
13
|
-
--ui-input-
|
|
14
|
-
--ui-input-min-
|
|
15
|
-
--ui-input-
|
|
16
|
-
--ui-input-
|
|
14
|
+
--ui-input-w: 100%;
|
|
15
|
+
--ui-input-min-w: 16ch;
|
|
16
|
+
--ui-input-pl: var(--ui-field-px);
|
|
17
|
+
--ui-input-pr: var(--ui-field-px);
|
|
17
18
|
--ui-input-font-size: var(--ui-field-font-size);
|
|
18
|
-
--ui-input-
|
|
19
|
+
--ui-input-leading: var(--ui-field-leading);
|
|
19
20
|
--ui-input-border-width: var(--ui-field-border-width);
|
|
20
21
|
--ui-input-border-style: var(--ui-field-border-style);
|
|
21
22
|
--ui-input-border-color: var(--ui-field-border-color);
|
|
22
|
-
--ui-input-
|
|
23
|
+
--ui-input-rounded: var(--ui-field-rounded);
|
|
23
24
|
|
|
24
25
|
--ui-input-calendar-picker-color: currentColor;
|
|
25
|
-
--ui-input-calendar-picker-icon-size: var(--
|
|
26
|
-
--ui-input-calendar-picker-size: var(--
|
|
26
|
+
--ui-input-calendar-picker-icon-size: calc(var(--spacing) * 4);
|
|
27
|
+
--ui-input-calendar-picker-size: calc(var(--spacing) * 6);
|
|
27
28
|
--ui-input-calendar-picker-radius: var(--ui-field-inset-child-radius);
|
|
28
29
|
--ui-input-calendar-picker-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'/%3E%3Crect x='40' y='40' width='176' height='176' rx='8' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='176' y1='24' x2='176' y2='56' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='80' y1='24' x2='80' y2='56' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='40' y1='88' x2='216' y2='88' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
@layer
|
|
33
|
+
@layer ui.components {
|
|
33
34
|
/* ===========================================================================
|
|
34
|
-
TEXT INPUTS —
|
|
35
|
-
- One
|
|
35
|
+
TEXT INPUTS — data-ui="input"
|
|
36
|
+
- One identity for every text-like type (text, search, email, number, date, …);
|
|
36
37
|
the type only changes the picker/keyboard, not the box.
|
|
37
|
-
- Shares the --ui-field-* tokens defined in fields.css so it aligns with
|
|
38
|
-
|
|
38
|
+
- Shares the --ui-field-* tokens defined in fields.css so it aligns with the select,
|
|
39
|
+
the textarea, and [data-ui~="button"].
|
|
39
40
|
=========================================================================== */
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
:where([data-ui~="input"]) {
|
|
43
|
+
/* dual-mode metrics go through the registered typed pair */
|
|
44
|
+
--_w-len: var(--_w-resolved, var(--ui-input-w));
|
|
45
|
+
--_w-num: var(--_w-resolved, var(--ui-input-w));
|
|
46
|
+
inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
|
|
47
|
+
--_min-w-len: var(--_min-w-resolved, var(--ui-input-min-w));
|
|
48
|
+
--_min-w-num: var(--_min-w-resolved, var(--ui-input-min-w));
|
|
49
|
+
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
50
|
+
--_h-len: var(--_h-resolved, var(--ui-field-h));
|
|
51
|
+
--_h-num: var(--_h-resolved, var(--ui-field-h));
|
|
52
|
+
block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
|
|
53
|
+
--_pl-len: var(--_pl-resolved, var(--ui-input-pl));
|
|
54
|
+
--_pl-num: var(--_pl-resolved, var(--ui-input-pl));
|
|
55
|
+
padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
|
|
56
|
+
--_pr-len: var(--_pr-resolved, var(--ui-input-pr));
|
|
57
|
+
--_pr-num: var(--_pr-resolved, var(--ui-input-pr));
|
|
58
|
+
padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
|
|
59
|
+
|
|
60
|
+
font-size: var(--_font-size-resolved, var(--ui-input-font-size));
|
|
61
|
+
line-height: var(--_leading-resolved, var(--ui-input-leading));
|
|
62
|
+
color: var(--_text-resolved, var(--ui-field-text));
|
|
63
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg));
|
|
64
|
+
|
|
65
|
+
border-width: var(--_border-width-resolved, var(--ui-input-border-width));
|
|
66
|
+
border-style: var(--_border-style-resolved, var(--ui-input-border-style));
|
|
67
|
+
border-color: var(--_border-color-resolved, var(--ui-input-border-color));
|
|
68
|
+
border-radius: var(--_rounded-resolved, var(--ui-input-rounded));
|
|
69
|
+
|
|
70
|
+
/* The ring is published to --_focus-ring so a --shadow utility keeps
|
|
71
|
+
it; the transparent outline twin keeps focus visible in forced-colors */
|
|
58
72
|
--_ring-offset-width: 0px;
|
|
59
73
|
--_ring-width: 0px;
|
|
60
|
-
--_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
61
|
-
|
|
62
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
|
|
63
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
74
|
+
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
75
|
+
--_focus-ring:
|
|
76
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
77
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
78
|
+
var(--_ring-fill, var(--ring-shadow-color));
|
|
79
|
+
box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
64
80
|
outline: var(--outline-width) var(--outline-style) transparent;
|
|
65
81
|
outline-offset: var(--outline-offset);
|
|
66
82
|
|
|
67
83
|
transition: var(--default-transition);
|
|
68
84
|
}
|
|
69
85
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
@media (hover: hover) {
|
|
87
|
+
:where([data-ui~="input"]):hover {
|
|
88
|
+
border-color: var(--_border-color-resolved, var(--ui-field-border-color--hover));
|
|
89
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg--hover));
|
|
90
|
+
}
|
|
73
91
|
}
|
|
74
92
|
|
|
75
|
-
|
|
76
|
-
background-color: var(--ui-field-
|
|
77
|
-
border-color: var(--ui-field-border-color--focus);
|
|
93
|
+
:where([data-ui~="input"]):focus-within {
|
|
94
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg--focus-within));
|
|
95
|
+
border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
|
|
78
96
|
--_ring-offset-width: var(--ring-offset-width);
|
|
79
97
|
--_ring-width: var(--ring-width);
|
|
80
98
|
outline-color: transparent;
|
|
81
99
|
}
|
|
82
100
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
--ui-input-
|
|
101
|
+
:where([data-ui~="input"])[type="date"],
|
|
102
|
+
:where([data-ui~="input"])[type="time"],
|
|
103
|
+
:where([data-ui~="input"])[type="datetime-local"] {
|
|
104
|
+
--ui-input-pr: calc(var(--spacing) * 1.5);
|
|
87
105
|
}
|
|
88
106
|
|
|
89
107
|
/* Native date/time controls keep their picker indicator tinted to the text */
|
|
90
|
-
|
|
108
|
+
:where([data-ui~="input"])::-webkit-calendar-picker-indicator {
|
|
91
109
|
cursor: pointer;
|
|
92
110
|
-webkit-appearance: none;
|
|
93
111
|
|
|
@@ -110,7 +128,27 @@
|
|
|
110
128
|
background-position: center;
|
|
111
129
|
}
|
|
112
130
|
|
|
113
|
-
|
|
131
|
+
:where([data-ui~="input"])::-webkit-calendar-picker-indicator:is(:hover) {
|
|
132
|
+
opacity: 0.5;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Disabled and committed-invalid states; an invalid control remaps the
|
|
137
|
+
--ui-field-* family on itself. */
|
|
138
|
+
@layer ui.components {
|
|
139
|
+
:where([data-ui~="input"]):disabled {
|
|
114
140
|
opacity: 0.5;
|
|
141
|
+
cursor: not-allowed;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where([data-ui~="input"]):user-invalid {
|
|
145
|
+
--ui-field-bg: color-mix(in oklch, var(--color-destructive) 5%, var(--color-input));
|
|
146
|
+
--ui-field-bg--hover: color-mix(in oklch, var(--color-destructive) 10%, var(--color-input));
|
|
147
|
+
--ui-field-border-color: var(--color-destructive);
|
|
148
|
+
--ui-field-border-color--hover: var(--color-destructive);
|
|
149
|
+
--ui-field-border-color--focus-within: var(--color-destructive);
|
|
150
|
+
--ui-field-ring-color: var(--color-destructive);
|
|
151
|
+
|
|
152
|
+
border-color: var(--color-destructive);
|
|
115
153
|
}
|
|
116
154
|
}
|