@zazz-ui/core 0.5.3 → 0.6.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 +17 -14
- package/CHANGELOG.md +51 -0
- package/README.md +3 -3
- package/dist/sri.json +74 -74
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +3604 -116
- package/editor/zazz.html-data.json +18 -12
- package/editor/zazz.language-data.json +103 -54
- package/editor/zazz.lint-data.json +2 -0
- package/package.json +1 -1
- package/src/base/_properties-2xl.css +16 -0
- package/src/base/_properties-active.css +12 -0
- package/src/base/_properties-checked.css +12 -0
- package/src/base/_properties-current.css +12 -0
- package/src/base/_properties-disabled.css +12 -0
- package/src/base/_properties-focus-visible.css +12 -0
- package/src/base/_properties-focus-within.css +12 -0
- package/src/base/_properties-hover.css +12 -0
- package/src/base/_properties-lg.css +16 -0
- package/src/base/_properties-md.css +16 -0
- package/src/base/_properties-open.css +12 -0
- package/src/base/_properties-sm.css +16 -0
- package/src/base/_properties-starting.css +6 -0
- package/src/base/_properties-stuck.css +6 -0
- package/src/base/_properties-xl.css +16 -0
- package/src/base/_properties.css +22 -1
- package/src/base/_reset.css +8 -2
- package/src/base/_switches.css +3 -0
- package/src/base/_typography.css +3 -4
- package/src/base/_utilities-color.css +5 -5
- package/src/base/_utilities-effects.css +45 -6
- package/src/base/_utilities-flow.css +5 -5
- package/src/base/_utilities-grid.css +10 -10
- package/src/base/_utilities-margin.css +35 -35
- package/src/base/_utilities-pseudo.css +16 -0
- package/src/base/_utilities-sizing.css +20 -20
- package/src/base/_utilities-tier-2xl.css +9 -1
- package/src/base/_utilities-tier-active.css +6 -0
- package/src/base/_utilities-tier-checked.css +6 -0
- package/src/base/_utilities-tier-current.css +6 -0
- package/src/base/_utilities-tier-disabled.css +6 -0
- package/src/base/_utilities-tier-focus-visible.css +6 -0
- package/src/base/_utilities-tier-focus-within.css +6 -0
- package/src/base/_utilities-tier-hover.css +6 -0
- package/src/base/_utilities-tier-lg.css +9 -1
- package/src/base/_utilities-tier-md.css +9 -1
- package/src/base/_utilities-tier-open.css +6 -0
- package/src/base/_utilities-tier-sm.css +9 -1
- package/src/base/_utilities-tier-starting.css +3 -0
- package/src/base/_utilities-tier-stuck.css +3 -0
- package/src/base/_utilities-tier-xl.css +9 -1
- package/src/base/_utilities-typography.css +5 -5
- package/src/base/_variables.css +116 -55
- package/src/base/_view-transitions.css +7 -9
- package/src/base/dialog-lifecycle.d.ts +18 -1
- package/src/base/dialog-lifecycle.d.ts.map +1 -1
- package/src/base/dialog-lifecycle.js +72 -1
- package/src/base/dialog-lifecycle.ts +79 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +19 -8
- package/src/base/navigation.ts +19 -8
- package/src/base/utilities.d.ts +19 -13
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +72 -21
- package/src/base/utilities.ts +84 -24
- package/src/head.d.ts +4 -1
- package/src/head.d.ts.map +1 -1
- package/src/head.js +9 -5
- package/src/head.ts +9 -5
- package/src/primitives/accordion/accordion.css +23 -12
- package/src/primitives/accordion/accordion.html +3 -3
- package/src/primitives/badge/badge.css +16 -9
- package/src/primitives/button/button.css +18 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -1
- package/src/primitives/checkbox/checkbox.css +16 -9
- package/src/primitives/checkbox/checkbox.html +1 -1
- package/src/primitives/checkbox/checkbox.js +1 -1
- package/src/primitives/checkbox/checkbox.ts +1 -1
- package/src/primitives/combobox/combobox.css +15 -8
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +1 -0
- package/src/primitives/command/command-actions.js +9 -4
- package/src/primitives/command/command-actions.ts +9 -4
- package/src/primitives/command/command-dialog.html +36 -0
- package/src/primitives/command/command.css +12 -1
- package/src/primitives/command/command.html +1 -0
- package/src/primitives/debug/audit-core.d.ts +3 -1
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +19 -1
- package/src/primitives/debug/audit-core.ts +25 -1
- package/src/primitives/debug/debug.d.ts.map +1 -1
- package/src/primitives/debug/debug.js +1 -0
- package/src/primitives/debug/debug.ts +1 -0
- package/src/primitives/dialog/dialog.css +2 -2
- package/src/primitives/fields/fields.css +15 -2
- package/src/primitives/input/input-icon-leading.html +1 -1
- package/src/primitives/input/input-icon-trailing.html +1 -1
- package/src/primitives/input/input.css +16 -9
- package/src/primitives/input-group/input-group.css +15 -8
- package/src/primitives/lightbox/lightbox.html +1 -2
- package/src/primitives/mobile-menu/mobile-menu.html +50 -10
- package/src/primitives/navigation-menu/navigation-menu-featured.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-interest.html +10 -2
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-simple.html +6 -1
- package/src/primitives/navigation-menu/navigation-menu.css +6 -3
- package/src/primitives/navigation-menu/navigation-menu.html +15 -3
- package/src/primitives/password-group/password-group.css +14 -7
- package/src/primitives/password-group/password-group.js +1 -1
- package/src/primitives/password-group/password-group.ts +1 -1
- package/src/primitives/radio/radio.css +15 -8
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +3 -1
- package/src/primitives/select/multiselect.ts +3 -1
- package/src/primitives/select/select.css +14 -7
- package/src/primitives/slider/slider.html +1 -0
- package/src/primitives/switch/switch.css +15 -8
- package/src/primitives/tabs/tabs.css +21 -9
- package/src/primitives/textarea/textarea.css +16 -9
- package/src/primitives/toggle/toggle.css +16 -9
- package/src/primitives/toggle/toggle.html +6 -6
- package/src/primitives/toolbar/toolbar.html +2 -1
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
interestfor="nav-interest-1"
|
|
14
14
|
>
|
|
15
15
|
Platform
|
|
16
|
-
<svg
|
|
16
|
+
<svg
|
|
17
|
+
data-navigation-menu-slot="marker"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
viewBox="0 0 256 256"
|
|
20
|
+
>
|
|
17
21
|
<rect width="256" height="256" fill="none" />
|
|
18
22
|
<polyline
|
|
19
23
|
points="208 96 128 176 48 96"
|
|
@@ -115,7 +119,11 @@
|
|
|
115
119
|
interestfor="nav-interest-2"
|
|
116
120
|
>
|
|
117
121
|
Resources
|
|
118
|
-
<svg
|
|
122
|
+
<svg
|
|
123
|
+
data-navigation-menu-slot="marker"
|
|
124
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
125
|
+
viewBox="0 0 256 256"
|
|
126
|
+
>
|
|
119
127
|
<rect width="256" height="256" fill="none" />
|
|
120
128
|
<polyline
|
|
121
129
|
points="208 96 128 176 48 96"
|
|
@@ -12,7 +12,11 @@
|
|
|
12
12
|
popovertarget="nav-megamenu-1"
|
|
13
13
|
>
|
|
14
14
|
Shop
|
|
15
|
-
<svg
|
|
15
|
+
<svg
|
|
16
|
+
data-navigation-menu-slot="marker"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
viewBox="0 0 256 256"
|
|
19
|
+
>
|
|
16
20
|
<rect width="256" height="256" fill="none" />
|
|
17
21
|
<polyline
|
|
18
22
|
points="208 96 128 176 48 96"
|
|
@@ -22,7 +22,11 @@
|
|
|
22
22
|
popovertarget="nav-simple-1"
|
|
23
23
|
>
|
|
24
24
|
Products
|
|
25
|
-
<svg
|
|
25
|
+
<svg
|
|
26
|
+
data-navigation-menu-slot="marker"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
viewBox="0 0 256 256"
|
|
29
|
+
>
|
|
26
30
|
<rect width="256" height="256" fill="none" />
|
|
27
31
|
<polyline
|
|
28
32
|
points="208 96 128 176 48 96"
|
|
@@ -136,6 +140,7 @@
|
|
|
136
140
|
<input
|
|
137
141
|
data-ui="input"
|
|
138
142
|
type="search"
|
|
143
|
+
name="q"
|
|
139
144
|
aria-label="Search the site"
|
|
140
145
|
placeholder="Search…"
|
|
141
146
|
style="--min-w: 40ch"
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* @uses [popover] + nested popovers: megamenu panels and flyout submenus
|
|
7
7
|
* @uses anchor-name, anchor-scope, position-anchor, anchor-size(): panel
|
|
8
8
|
* sizing and positioning (Chromium 125+ for anchor-size)
|
|
9
|
-
* @uses :has(:popover-open):
|
|
9
|
+
* @uses :has(:popover-open): rotates the trigger's data-navigation-menu-slot="marker"
|
|
10
|
+
* chevron without JS
|
|
10
11
|
* @uses @starting-style: slide-down viewport reveal
|
|
11
12
|
* @tokens --ui-navigation-menu-* (@layer variables)
|
|
12
13
|
* @presets on the popover slot: data-navigation-menu-variant="submenu",
|
|
@@ -62,7 +63,9 @@
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/* Chevron points down by default, flips up while its popover is open (no JS) */
|
|
65
|
-
:where([data-ui~="navigation-menu"])
|
|
66
|
+
:where([data-ui~="navigation-menu"])
|
|
67
|
+
[data-navigation-menu-slot~="trigger"]
|
|
68
|
+
> [data-navigation-menu-slot~="marker"] {
|
|
66
69
|
inline-size: var(--space-sm);
|
|
67
70
|
block-size: var(--space-sm);
|
|
68
71
|
transition: var(--ui-navigation-menu-icon-transition);
|
|
@@ -71,7 +74,7 @@
|
|
|
71
74
|
:where([data-ui~="navigation-menu"])
|
|
72
75
|
[data-navigation-menu-slot~="item"]:has([data-navigation-menu-slot~="popover"]:popover-open)
|
|
73
76
|
[data-navigation-menu-slot~="trigger"]
|
|
74
|
-
>
|
|
77
|
+
> [data-navigation-menu-slot~="marker"] {
|
|
75
78
|
transform: var(--ui-navigation-menu-icon-transform);
|
|
76
79
|
}
|
|
77
80
|
|
|
@@ -11,7 +11,11 @@
|
|
|
11
11
|
popovertarget="nav-panel-1"
|
|
12
12
|
>
|
|
13
13
|
Platform
|
|
14
|
-
<svg
|
|
14
|
+
<svg
|
|
15
|
+
data-navigation-menu-slot="marker"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
viewBox="0 0 256 256"
|
|
18
|
+
>
|
|
15
19
|
<rect width="256" height="256" fill="none" />
|
|
16
20
|
<polyline
|
|
17
21
|
points="208 96 128 176 48 96"
|
|
@@ -197,7 +201,11 @@
|
|
|
197
201
|
popovertarget="nav-panel-2"
|
|
198
202
|
>
|
|
199
203
|
Resources
|
|
200
|
-
<svg
|
|
204
|
+
<svg
|
|
205
|
+
data-navigation-menu-slot="marker"
|
|
206
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
207
|
+
viewBox="0 0 256 256"
|
|
208
|
+
>
|
|
201
209
|
<rect width="256" height="256" fill="none" />
|
|
202
210
|
<polyline
|
|
203
211
|
points="208 96 128 176 48 96"
|
|
@@ -300,7 +308,11 @@
|
|
|
300
308
|
popovertarget="nav-panel-3"
|
|
301
309
|
>
|
|
302
310
|
Products
|
|
303
|
-
<svg
|
|
311
|
+
<svg
|
|
312
|
+
data-navigation-menu-slot="marker"
|
|
313
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
314
|
+
viewBox="0 0 256 256"
|
|
315
|
+
>
|
|
304
316
|
<rect width="256" height="256" fill="none" />
|
|
305
317
|
<polyline
|
|
306
318
|
points="208 96 128 176 48 96"
|
|
@@ -74,14 +74,21 @@
|
|
|
74
74
|
forced-colors mode */
|
|
75
75
|
--_ring-offset-width: 0px;
|
|
76
76
|
--_ring-width: 0px;
|
|
77
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
77
78
|
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
78
|
-
--_focus-
|
|
79
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
80
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
79
|
+
--_focus-shadow:
|
|
80
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
81
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
82
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
83
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
84
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
81
85
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
82
|
-
box-shadow: var(--_focus-
|
|
83
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
84
|
-
outline-offset:
|
|
86
|
+
box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
87
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
88
|
+
outline-offset: calc(
|
|
89
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
90
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
91
|
+
);
|
|
85
92
|
|
|
86
93
|
transition: var(--default-transition);
|
|
87
94
|
}
|
|
@@ -97,7 +104,7 @@
|
|
|
97
104
|
background-color: var(--_bg-resolved, var(--ui-field-bg--focus-within));
|
|
98
105
|
border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
|
|
99
106
|
--_ring-offset-width: var(--ring-offset-width);
|
|
100
|
-
--_ring-width: var(--ring-width);
|
|
107
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
101
108
|
outline-color: transparent;
|
|
102
109
|
}
|
|
103
110
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* @example
|
|
26
26
|
* <ui-password>
|
|
27
27
|
* <label data-ui="password-group">
|
|
28
|
-
* <input data-ui="input" type="password" autocomplete="current-password" />
|
|
28
|
+
* <input data-ui="input" type="password" name="password" autocomplete="current-password" />
|
|
29
29
|
* <span data-password-group-slot="addon" data-password-group-align="inline-end">
|
|
30
30
|
* <button data-ui="button" data-password-group-slot="toggle" type="button"
|
|
31
31
|
* aria-pressed="false" aria-label="Show password">…</button>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* @example
|
|
27
27
|
* <ui-password>
|
|
28
28
|
* <label data-ui="password-group">
|
|
29
|
-
* <input data-ui="input" type="password" autocomplete="current-password" />
|
|
29
|
+
* <input data-ui="input" type="password" name="password" autocomplete="current-password" />
|
|
30
30
|
* <span data-password-group-slot="addon" data-password-group-align="inline-end">
|
|
31
31
|
* <button data-ui="button" data-password-group-slot="toggle" type="button"
|
|
32
32
|
* aria-pressed="false" aria-label="Show password">…</button>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* radio.css — Radio ([data-ui~="radio"] on input[type="radio"]; groups wear [data-ui~="radio-group"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (field-group layout, --ui-field-* surface/border)
|
|
6
6
|
* @uses appearance: none — custom circle + masked ::before dot when :checked
|
|
7
7
|
* @tokens --ui-radio-* (@layer variables)
|
|
8
8
|
*/
|
|
@@ -58,13 +58,20 @@
|
|
|
58
58
|
/* the transparent outline keeps focus visible in forced-colors */
|
|
59
59
|
--_ring-offset-width: 0px;
|
|
60
60
|
--_ring-width: 0px;
|
|
61
|
-
--_focus-ring
|
|
62
|
-
|
|
63
|
-
0 0 0 calc(var(--_ring-offset-width)
|
|
61
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
62
|
+
--_focus-shadow:
|
|
63
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
64
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
65
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
66
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
67
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
64
68
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
65
|
-
box-shadow: var(--_focus-
|
|
66
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
67
|
-
outline-offset:
|
|
69
|
+
box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
70
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
71
|
+
outline-offset: calc(
|
|
72
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
73
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
74
|
+
);
|
|
68
75
|
|
|
69
76
|
transition-property: border-color, background-color, color, opacity, box-shadow;
|
|
70
77
|
transition-duration: var(--default-transition-duration);
|
|
@@ -79,7 +86,7 @@
|
|
|
79
86
|
|
|
80
87
|
:where([data-ui~="radio"]):focus-visible {
|
|
81
88
|
--_ring-offset-width: var(--ring-offset-width);
|
|
82
|
-
--_ring-width: var(--ring-width);
|
|
89
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
83
90
|
outline-color: transparent;
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiselect.d.ts","sourceRoot":"","sources":["multiselect.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAG5E;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAC1B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAIR;AAID,cAAM,aAAc,SAAQ,WAAW;;IAIrC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CA0DzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAKzB;
|
|
1
|
+
{"version":3,"file":"multiselect.d.ts","sourceRoot":"","sources":["multiselect.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAG5E;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAC1B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAIR;AAID,cAAM,aAAc,SAAQ,WAAW;;IAIrC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CA0DzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAKzB;CA4DF;AAID,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -123,11 +123,13 @@ class UiMultiselect extends ZazzElement {
|
|
|
123
123
|
if (align)
|
|
124
124
|
panel.setAttribute("data-popover-align", align);
|
|
125
125
|
const checkboxes = [];
|
|
126
|
-
for (const option of Array.from(select.options)) {
|
|
126
|
+
for (const [index, option] of Array.from(select.options).entries()) {
|
|
127
127
|
const row = document.createElement("label");
|
|
128
128
|
row.setAttribute("data-multiselect-slot", "option");
|
|
129
129
|
const checkbox = document.createElement("input");
|
|
130
130
|
checkbox.type = "checkbox";
|
|
131
|
+
// an id, not a name: the select submits, and Chrome flags a field with neither
|
|
132
|
+
checkbox.id = `${panelId}-${index}`;
|
|
131
133
|
checkbox.checked = option.selected;
|
|
132
134
|
checkbox.disabled = option.disabled;
|
|
133
135
|
row.append(checkbox, document.createTextNode(option.label));
|
|
@@ -159,11 +159,13 @@ class UiMultiselect extends ZazzElement {
|
|
|
159
159
|
if (align) panel.setAttribute("data-popover-align", align);
|
|
160
160
|
|
|
161
161
|
const checkboxes: HTMLInputElement[] = [];
|
|
162
|
-
for (const option of Array.from(select.options)) {
|
|
162
|
+
for (const [index, option] of Array.from(select.options).entries()) {
|
|
163
163
|
const row = document.createElement("label");
|
|
164
164
|
row.setAttribute("data-multiselect-slot", "option");
|
|
165
165
|
const checkbox = document.createElement("input");
|
|
166
166
|
checkbox.type = "checkbox";
|
|
167
|
+
// an id, not a name: the select submits, and Chrome flags a field with neither
|
|
168
|
+
checkbox.id = `${panelId}-${index}`;
|
|
167
169
|
checkbox.checked = option.selected;
|
|
168
170
|
checkbox.disabled = option.disabled;
|
|
169
171
|
row.append(checkbox, document.createTextNode(option.label));
|
|
@@ -178,14 +178,21 @@
|
|
|
178
178
|
/* the transparent outline keeps focus visible in forced-colors */
|
|
179
179
|
--_ring-offset-width: 0px;
|
|
180
180
|
--_ring-width: 0px;
|
|
181
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
181
182
|
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
182
|
-
--_focus-
|
|
183
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
184
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
183
|
+
--_focus-shadow:
|
|
184
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
185
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
186
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
187
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
188
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
185
189
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
186
|
-
box-shadow: var(--_focus-
|
|
187
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
188
|
-
outline-offset:
|
|
190
|
+
box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
191
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
192
|
+
outline-offset: calc(
|
|
193
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
194
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
195
|
+
);
|
|
189
196
|
|
|
190
197
|
transition: var(--default-transition);
|
|
191
198
|
}
|
|
@@ -200,7 +207,7 @@
|
|
|
200
207
|
:where([data-ui~="select"]):is(:focus-visible, :open) {
|
|
201
208
|
border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
|
|
202
209
|
--_ring-offset-width: var(--ring-offset-width);
|
|
203
|
-
--_ring-width: var(--ring-width);
|
|
210
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
204
211
|
outline-color: transparent;
|
|
205
212
|
}
|
|
206
213
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* switch.css — Switch (input[type="checkbox"][role="switch"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, reset
|
|
5
|
-
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow)
|
|
6
6
|
* @uses appearance: none on input[role="switch"]
|
|
7
7
|
* @uses label:has(> input[role="switch"])::after — thumb drawn on label (no JS)
|
|
8
8
|
* @uses oklch(from …) — checked/hover track tints
|
|
@@ -100,13 +100,20 @@
|
|
|
100
100
|
/* the transparent outline keeps focus visible in forced-colors */
|
|
101
101
|
--_ring-offset-width: 0px;
|
|
102
102
|
--_ring-width: 0px;
|
|
103
|
-
--_focus-ring
|
|
104
|
-
|
|
105
|
-
0 0 0 calc(var(--_ring-offset-width)
|
|
103
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
104
|
+
--_focus-shadow:
|
|
105
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
106
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
107
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
108
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
109
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
106
110
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
107
|
-
box-shadow: var(--_focus-
|
|
108
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
109
|
-
outline-offset:
|
|
111
|
+
box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
112
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
113
|
+
outline-offset: calc(
|
|
114
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
115
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
116
|
+
);
|
|
110
117
|
|
|
111
118
|
transition: var(--default-transition);
|
|
112
119
|
}
|
|
@@ -129,7 +136,7 @@
|
|
|
129
136
|
|
|
130
137
|
:where(input[role="switch"]:focus-visible) {
|
|
131
138
|
--_ring-offset-width: var(--ring-offset-width);
|
|
132
|
-
--_ring-width: var(--ring-width);
|
|
139
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
133
140
|
outline-color: transparent;
|
|
134
141
|
}
|
|
135
142
|
}
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
--ui-tabs-indicator-inset: var(--ui-tabs-track-padding);
|
|
28
28
|
|
|
29
29
|
--ui-tabs-label-font-family: var(--font-family-body);
|
|
30
|
-
--ui-tabs-label-font-size: var(--
|
|
30
|
+
--ui-tabs-label-font-size: var(--font-size-sm);
|
|
31
31
|
--ui-tabs-label-font-weight: var(--font-weight-strong);
|
|
32
|
-
--ui-tabs-label-leading: var(--
|
|
32
|
+
--ui-tabs-label-leading: var(--leading-sm);
|
|
33
33
|
|
|
34
34
|
--ui-tabs-label-bg: transparent;
|
|
35
35
|
--ui-tabs-label-bg--hover: transparent;
|
|
@@ -120,19 +120,26 @@
|
|
|
120
120
|
ring grows in smoothly on focus */
|
|
121
121
|
--_ring-offset-width: 0px;
|
|
122
122
|
--_ring-width: 0px;
|
|
123
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
123
124
|
--_ring-fill: color-mix(
|
|
124
125
|
in oklch,
|
|
125
126
|
var(--ui-tabs-label-ring-color) var(--ring-opacity),
|
|
126
127
|
transparent
|
|
127
128
|
);
|
|
128
129
|
box-shadow:
|
|
129
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
130
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
130
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
131
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
132
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
133
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
134
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
131
135
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
132
136
|
|
|
133
137
|
/* transparent twin of the ring for forced-colors / high-contrast modes */
|
|
134
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
135
|
-
outline-offset:
|
|
138
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
139
|
+
outline-offset: calc(
|
|
140
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
141
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
142
|
+
);
|
|
136
143
|
transition: var(--default-transition);
|
|
137
144
|
}
|
|
138
145
|
|
|
@@ -161,7 +168,7 @@
|
|
|
161
168
|
input[type="radio"]:focus-visible
|
|
162
169
|
+ [data-tabs-slot~="label"] {
|
|
163
170
|
--_ring-offset-width: var(--ring-offset-width);
|
|
164
|
-
--_ring-width: var(--ring-width);
|
|
171
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
165
172
|
|
|
166
173
|
outline-color: transparent;
|
|
167
174
|
}
|
|
@@ -202,8 +209,13 @@
|
|
|
202
209
|
border-radius: var(--ui-tabs-indicator-rounded);
|
|
203
210
|
background-color: var(--ui-tabs-indicator-bg);
|
|
204
211
|
box-shadow:
|
|
205
|
-
0 0 0 var(--_ring-offset-width) var(--
|
|
206
|
-
|
|
212
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in)))
|
|
213
|
+
var(--ring-offset-shadow-color),
|
|
214
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
215
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
216
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in))
|
|
217
|
+
var(--ring-offset-shadow-color),
|
|
218
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
207
219
|
var(--_ring-fill, var(--ring-shadow-color)),
|
|
208
220
|
var(--ui-tabs-indicator-shadow);
|
|
209
221
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* textarea.css — Textarea ([data-ui~="textarea"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css
|
|
6
6
|
* @uses field-sizing: content — auto-grow with text (modern browsers;
|
|
7
7
|
* falls back to fixed min/max block-size where unsupported)
|
|
8
8
|
* @tokens --ui-textarea-* (@layer variables;
|
|
@@ -54,18 +54,25 @@
|
|
|
54
54
|
border-radius: var(--_rounded-resolved, var(--ui-textarea-rounded));
|
|
55
55
|
resize: var(--ui-textarea-resize);
|
|
56
56
|
|
|
57
|
-
/* The ring is published to --_focus-
|
|
57
|
+
/* The ring is published to --_focus-shadow so a --shadow utility keeps
|
|
58
58
|
it; the transparent outline twin keeps focus visible in forced-colors */
|
|
59
59
|
--_ring-offset-width: 0px;
|
|
60
60
|
--_ring-width: 0px;
|
|
61
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
61
62
|
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
62
|
-
--_focus-
|
|
63
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
64
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
63
|
+
--_focus-shadow:
|
|
64
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
65
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
66
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
67
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
68
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
65
69
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
66
|
-
box-shadow: var(--_focus-
|
|
67
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
68
|
-
outline-offset:
|
|
70
|
+
box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
71
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
72
|
+
outline-offset: calc(
|
|
73
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
74
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
75
|
+
);
|
|
69
76
|
|
|
70
77
|
transition: var(--default-transition);
|
|
71
78
|
}
|
|
@@ -81,7 +88,7 @@
|
|
|
81
88
|
background-color: var(--_bg-resolved, var(--ui-field-bg--focus-within));
|
|
82
89
|
border-color: var(--_border-color-resolved, var(--ui-field-border-color--focus-within));
|
|
83
90
|
--_ring-offset-width: var(--ring-offset-width);
|
|
84
|
-
--_ring-width: var(--ring-width);
|
|
91
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
85
92
|
outline-color: transparent;
|
|
86
93
|
}
|
|
87
94
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* look through the `--ui-toggle-*--checked` hooks.
|
|
10
10
|
*
|
|
11
11
|
* @layer variables, components
|
|
12
|
-
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-
|
|
12
|
+
* @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), button.css
|
|
13
13
|
* @uses :has(): drive label state from the nested input (checked/focus/disabled)
|
|
14
14
|
* @uses oklch(from …): variant hover/active tints (inherited from --ui-button-*)
|
|
15
15
|
* @uses text-box: vertical trim (patchy browser support)
|
|
@@ -241,30 +241,37 @@
|
|
|
241
241
|
color: var(--_text-resolved, var(--_toggle-text, var(--ui-toggle-text)));
|
|
242
242
|
background-color: var(--_bg-resolved, var(--_toggle-bg, var(--ui-toggle-bg)));
|
|
243
243
|
|
|
244
|
-
/* published to --_focus-
|
|
244
|
+
/* published to --_focus-shadow so a --shadow or --ring utility keeps it; the
|
|
245
245
|
widths grow from 0 on :focus-visible so the ring eases in */
|
|
246
246
|
--_ring-offset-width: 0px;
|
|
247
247
|
--_ring-width: 0px;
|
|
248
|
+
--_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
|
|
248
249
|
--_ring-fill: color-mix(
|
|
249
250
|
in oklch,
|
|
250
251
|
var(--_ring-color-resolved, var(--_toggle-ring-color, var(--ui-toggle-ring-color)))
|
|
251
252
|
var(--ring-opacity),
|
|
252
253
|
transparent
|
|
253
254
|
);
|
|
254
|
-
--_focus-
|
|
255
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
256
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
255
|
+
--_focus-shadow:
|
|
256
|
+
0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
|
|
257
|
+
0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
|
|
258
|
+
var(--_ring-fill, var(--ring-shadow-color)),
|
|
259
|
+
inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
|
|
260
|
+
inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
|
|
257
261
|
var(--_ring-fill, var(--ring-shadow-color));
|
|
258
262
|
box-shadow:
|
|
259
|
-
var(--_focus-
|
|
263
|
+
var(--_focus-shadow, 0 0 #0000),
|
|
260
264
|
var(--_shadow-resolved, var(--_toggle-shadow, var(--ui-toggle-shadow)));
|
|
261
265
|
|
|
262
266
|
cursor: pointer;
|
|
263
267
|
text-decoration: none;
|
|
264
268
|
|
|
265
269
|
/* transparent twin of the ring for forced-colors / high-contrast modes */
|
|
266
|
-
outline: var(--outline-width) var(--outline-style) transparent;
|
|
267
|
-
outline-offset:
|
|
270
|
+
outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
|
|
271
|
+
outline-offset: calc(
|
|
272
|
+
var(--outline-offset) - var(--_focus-in) *
|
|
273
|
+
(2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
|
|
274
|
+
);
|
|
268
275
|
|
|
269
276
|
transition: var(--default-transition);
|
|
270
277
|
|
|
@@ -348,7 +355,7 @@
|
|
|
348
355
|
|
|
349
356
|
:where([data-ui~="toggle"]):has(> input:focus-visible) {
|
|
350
357
|
--_ring-offset-width: var(--ring-offset-width);
|
|
351
|
-
--_ring-width: var(--ring-width);
|
|
358
|
+
--_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
|
|
352
359
|
|
|
353
360
|
outline-color: transparent;
|
|
354
361
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"
|
|
14
14
|
>
|
|
15
15
|
<label data-ui="toggle" data-toggle-size="icon">
|
|
16
|
-
<input type="checkbox" aria-label="Bold" />
|
|
16
|
+
<input type="checkbox" name="bold" aria-label="Bold" />
|
|
17
17
|
<svg
|
|
18
18
|
xmlns="http://www.w3.org/2000/svg"
|
|
19
19
|
viewBox="0 0 24 24"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</svg>
|
|
30
30
|
</label>
|
|
31
31
|
<label data-ui="toggle" data-toggle-size="icon">
|
|
32
|
-
<input type="checkbox" aria-label="Italic" checked />
|
|
32
|
+
<input type="checkbox" name="italic" aria-label="Italic" checked />
|
|
33
33
|
<svg
|
|
34
34
|
xmlns="http://www.w3.org/2000/svg"
|
|
35
35
|
viewBox="0 0 24 24"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</svg>
|
|
47
47
|
</label>
|
|
48
48
|
<label data-ui="toggle" data-toggle-size="icon" data-toggle-variant="ghost">
|
|
49
|
-
<input type="checkbox" aria-label="Underline" />
|
|
49
|
+
<input type="checkbox" name="underline" aria-label="Underline" />
|
|
50
50
|
<svg
|
|
51
51
|
xmlns="http://www.w3.org/2000/svg"
|
|
52
52
|
viewBox="0 0 24 24"
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"
|
|
72
72
|
>
|
|
73
73
|
<label data-ui="toggle">
|
|
74
|
-
<input type="checkbox" />
|
|
74
|
+
<input type="checkbox" name="bold" />
|
|
75
75
|
<span>Bold</span>
|
|
76
76
|
</label>
|
|
77
77
|
<label data-ui="toggle">
|
|
78
|
-
<input type="checkbox" checked />
|
|
78
|
+
<input type="checkbox" name="italic" checked />
|
|
79
79
|
<span>Italic</span>
|
|
80
80
|
</label>
|
|
81
81
|
<label data-ui="toggle" data-toggle-variant="ghost">
|
|
82
|
-
<input type="checkbox" disabled />
|
|
82
|
+
<input type="checkbox" name="disabled" disabled />
|
|
83
83
|
<span>Disabled</span>
|
|
84
84
|
</label>
|
|
85
85
|
</div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
style="--mx: 2"
|
|
46
46
|
/>
|
|
47
47
|
|
|
48
|
-
<select data-ui="select" aria-label="Paragraph style" style="--w: auto">
|
|
48
|
+
<select data-ui="select" name="paragraph-style" aria-label="Paragraph style" style="--w: auto">
|
|
49
49
|
<button>
|
|
50
50
|
<selectedcontent></selectedcontent>
|
|
51
51
|
</button>
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
<input
|
|
58
58
|
data-ui="input"
|
|
59
59
|
type="search"
|
|
60
|
+
name="find"
|
|
60
61
|
aria-label="Find in document"
|
|
61
62
|
placeholder="Find"
|
|
62
63
|
style="
|