@zazz-ui/core 0.5.4 → 0.6.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.
Files changed (123) hide show
  1. package/AUTHORING.md +16 -13
  2. package/CHANGELOG.md +50 -0
  3. package/README.md +3 -3
  4. package/dist/sri.json +73 -73
  5. package/dist/zazz.css +1 -1
  6. package/dist/zazz.js +1 -1
  7. package/editor/zazz.css-data.json +3604 -116
  8. package/editor/zazz.html-data.json +18 -12
  9. package/editor/zazz.language-data.json +103 -54
  10. package/editor/zazz.lint-data.json +2 -0
  11. package/package.json +1 -1
  12. package/src/base/_properties-2xl.css +16 -0
  13. package/src/base/_properties-active.css +12 -0
  14. package/src/base/_properties-checked.css +12 -0
  15. package/src/base/_properties-current.css +12 -0
  16. package/src/base/_properties-disabled.css +12 -0
  17. package/src/base/_properties-focus-visible.css +12 -0
  18. package/src/base/_properties-focus-within.css +12 -0
  19. package/src/base/_properties-hover.css +12 -0
  20. package/src/base/_properties-lg.css +16 -0
  21. package/src/base/_properties-md.css +16 -0
  22. package/src/base/_properties-open.css +12 -0
  23. package/src/base/_properties-sm.css +16 -0
  24. package/src/base/_properties-starting.css +6 -0
  25. package/src/base/_properties-stuck.css +6 -0
  26. package/src/base/_properties-xl.css +16 -0
  27. package/src/base/_properties.css +22 -1
  28. package/src/base/_reset.css +8 -2
  29. package/src/base/_switches.css +3 -0
  30. package/src/base/_typography.css +0 -1
  31. package/src/base/_utilities-color.css +5 -5
  32. package/src/base/_utilities-effects.css +45 -6
  33. package/src/base/_utilities-flow.css +5 -5
  34. package/src/base/_utilities-grid.css +10 -10
  35. package/src/base/_utilities-margin.css +35 -35
  36. package/src/base/_utilities-pseudo.css +16 -0
  37. package/src/base/_utilities-sizing.css +20 -20
  38. package/src/base/_utilities-tier-2xl.css +9 -1
  39. package/src/base/_utilities-tier-active.css +6 -0
  40. package/src/base/_utilities-tier-checked.css +6 -0
  41. package/src/base/_utilities-tier-current.css +6 -0
  42. package/src/base/_utilities-tier-disabled.css +6 -0
  43. package/src/base/_utilities-tier-focus-visible.css +6 -0
  44. package/src/base/_utilities-tier-focus-within.css +6 -0
  45. package/src/base/_utilities-tier-hover.css +6 -0
  46. package/src/base/_utilities-tier-lg.css +9 -1
  47. package/src/base/_utilities-tier-md.css +9 -1
  48. package/src/base/_utilities-tier-open.css +6 -0
  49. package/src/base/_utilities-tier-sm.css +9 -1
  50. package/src/base/_utilities-tier-starting.css +3 -0
  51. package/src/base/_utilities-tier-stuck.css +3 -0
  52. package/src/base/_utilities-tier-xl.css +9 -1
  53. package/src/base/_utilities-typography.css +5 -5
  54. package/src/base/_variables.css +116 -55
  55. package/src/base/dialog-lifecycle.d.ts +18 -1
  56. package/src/base/dialog-lifecycle.d.ts.map +1 -1
  57. package/src/base/dialog-lifecycle.js +72 -1
  58. package/src/base/dialog-lifecycle.ts +79 -1
  59. package/src/base/navigation.d.ts.map +1 -1
  60. package/src/base/navigation.js +15 -5
  61. package/src/base/navigation.ts +15 -5
  62. package/src/base/utilities.d.ts +19 -13
  63. package/src/base/utilities.d.ts.map +1 -1
  64. package/src/base/utilities.js +72 -21
  65. package/src/base/utilities.ts +84 -24
  66. package/src/head.d.ts +4 -1
  67. package/src/head.d.ts.map +1 -1
  68. package/src/head.js +9 -5
  69. package/src/head.ts +9 -5
  70. package/src/primitives/accordion/accordion.css +23 -12
  71. package/src/primitives/accordion/accordion.html +3 -3
  72. package/src/primitives/badge/badge.css +16 -9
  73. package/src/primitives/button/button.css +18 -11
  74. package/src/primitives/checkbox/checkbox-tasklist.html +6 -1
  75. package/src/primitives/checkbox/checkbox.css +16 -9
  76. package/src/primitives/checkbox/checkbox.html +1 -1
  77. package/src/primitives/checkbox/checkbox.js +1 -1
  78. package/src/primitives/checkbox/checkbox.ts +1 -1
  79. package/src/primitives/combobox/combobox.css +15 -8
  80. package/src/primitives/command/command-actions.d.ts.map +1 -1
  81. package/src/primitives/command/command-actions.html +1 -0
  82. package/src/primitives/command/command-actions.js +9 -4
  83. package/src/primitives/command/command-actions.ts +9 -4
  84. package/src/primitives/command/command-dialog.html +36 -0
  85. package/src/primitives/command/command.css +12 -1
  86. package/src/primitives/command/command.html +1 -0
  87. package/src/primitives/debug/audit-core.d.ts +3 -1
  88. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  89. package/src/primitives/debug/audit-core.js +19 -1
  90. package/src/primitives/debug/audit-core.ts +25 -1
  91. package/src/primitives/debug/debug.d.ts.map +1 -1
  92. package/src/primitives/debug/debug.js +1 -0
  93. package/src/primitives/debug/debug.ts +1 -0
  94. package/src/primitives/dialog/dialog.css +2 -2
  95. package/src/primitives/fields/fields.css +15 -2
  96. package/src/primitives/input/input-icon-leading.html +1 -1
  97. package/src/primitives/input/input-icon-trailing.html +1 -1
  98. package/src/primitives/input/input.css +16 -9
  99. package/src/primitives/input-group/input-group.css +15 -8
  100. package/src/primitives/lightbox/lightbox.html +1 -2
  101. package/src/primitives/mobile-menu/mobile-menu.html +50 -10
  102. package/src/primitives/navigation-menu/navigation-menu-featured.html +5 -1
  103. package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +5 -1
  104. package/src/primitives/navigation-menu/navigation-menu-interest.html +10 -2
  105. package/src/primitives/navigation-menu/navigation-menu-megamenu.html +5 -1
  106. package/src/primitives/navigation-menu/navigation-menu-simple.html +6 -1
  107. package/src/primitives/navigation-menu/navigation-menu.css +6 -3
  108. package/src/primitives/navigation-menu/navigation-menu.html +15 -3
  109. package/src/primitives/password-group/password-group.css +14 -7
  110. package/src/primitives/password-group/password-group.js +1 -1
  111. package/src/primitives/password-group/password-group.ts +1 -1
  112. package/src/primitives/radio/radio.css +15 -8
  113. package/src/primitives/select/multiselect.d.ts.map +1 -1
  114. package/src/primitives/select/multiselect.js +3 -1
  115. package/src/primitives/select/multiselect.ts +3 -1
  116. package/src/primitives/select/select.css +14 -7
  117. package/src/primitives/slider/slider.html +1 -0
  118. package/src/primitives/switch/switch.css +15 -8
  119. package/src/primitives/tabs/tabs.css +21 -9
  120. package/src/primitives/textarea/textarea.css +16 -9
  121. package/src/primitives/toggle/toggle.css +16 -9
  122. package/src/primitives/toggle/toggle.html +6 -6
  123. package/src/primitives/toolbar/toolbar.html +2 -1
@@ -1,8 +1,9 @@
1
1
  /**
2
- * accordion.css: Accordion (ui-accordion | [data-ui~="accordion"] on <details>/<summary>)
2
+ * accordion.css: Accordion (ui-accordion | [data-ui~="accordion"] on <details>/<summary>;
3
+ * slot data-accordion-slot="marker" on the summary icon that rotates open)
3
4
  *
4
5
  * @layer variables, reset, components
5
- * @requires _layers.css, _variables.css, _properties.css (--_focus-ring)
6
+ * @requires _layers.css, _variables.css, _properties.css (--_focus-shadow)
6
7
  * @uses ::details-content: native open/close block-size transition (reset layer)
7
8
  * @uses interpolate-size: allow-keywords (from _variables.css; required for
8
9
  * block-size: 0 -> auto transitions)
@@ -64,31 +65,38 @@
64
65
  align-items: center;
65
66
  justify-content: space-between;
66
67
 
67
- /* The ring is published to --_focus-ring so a --shadow utility on the
68
+ /* The ring is published to --_focus-shadow so a --shadow utility on the
68
69
  summary keeps it; the ring widths grow from 0 so the ring eases in. */
69
70
  --_ring-offset-width: 0px;
70
71
  --_ring-width: 0px;
71
- --_focus-ring:
72
- 0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
73
- 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
72
+ --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
73
+ --_focus-shadow:
74
+ 0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
75
+ 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
76
+ var(--_ring-fill, var(--ring-shadow-color)),
77
+ inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
78
+ inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
74
79
  var(--_ring-fill, var(--ring-shadow-color));
75
- box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
80
+ box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
76
81
 
77
82
  /* transparent twin of the ring for forced-colors / high-contrast modes */
78
- outline: var(--outline-width) var(--outline-style) transparent;
79
- outline-offset: var(--outline-offset);
83
+ outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
84
+ outline-offset: calc(
85
+ var(--outline-offset) - var(--_focus-in) *
86
+ (2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
87
+ );
80
88
 
81
89
  transition: var(--default-transition);
82
90
  }
83
91
 
84
92
  :where(ui-accordion, [data-ui~="accordion"]) > details > summary:focus-visible {
85
93
  --_ring-offset-width: var(--ring-offset-width);
86
- --_ring-width: var(--ring-width);
94
+ --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
87
95
 
88
96
  outline-color: transparent;
89
97
  }
90
98
 
91
- :where(ui-accordion, [data-ui~="accordion"]) summary > svg {
99
+ :where(ui-accordion, [data-ui~="accordion"]) summary > [data-accordion-slot="marker"] {
92
100
  display: flex;
93
101
  align-items: center;
94
102
  justify-content: center;
@@ -99,7 +107,10 @@
99
107
  var(--default-transition-timing-function);
100
108
  }
101
109
 
102
- :where(ui-accordion, [data-ui~="accordion"]) > details[open] > summary > svg {
110
+ :where(ui-accordion, [data-ui~="accordion"])
111
+ > details[open]
112
+ > summary
113
+ > [data-accordion-slot="marker"] {
103
114
  transform: var(--ui-accordion-icon-transform--open);
104
115
  }
105
116
  }
@@ -13,7 +13,7 @@
13
13
  "
14
14
  >
15
15
  What is an accordion?
16
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
16
+ <svg data-accordion-slot="marker" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
17
17
  <rect width="256" height="256" fill="none" />
18
18
  <polyline
19
19
  points="208 96 128 176 48 96"
@@ -47,7 +47,7 @@
47
47
  "
48
48
  >
49
49
  How does it work?
50
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
50
+ <svg data-accordion-slot="marker" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
51
51
  <rect width="256" height="256" fill="none" />
52
52
  <polyline
53
53
  points="208 96 128 176 48 96"
@@ -80,7 +80,7 @@
80
80
  "
81
81
  >
82
82
  Why use it?
83
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
83
+ <svg data-accordion-slot="marker" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
84
84
  <rect width="256" height="256" fill="none" />
85
85
  <polyline
86
86
  points="208 96 128 176 48 96"
@@ -2,7 +2,7 @@
2
2
  * badge.css: Badge ([data-ui~="badge"])
3
3
  *
4
4
  * @layer variables, components
5
- * @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-ring), fields.css (--ui-field-* border/ring)
5
+ * @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* border/ring)
6
6
  * @uses color-mix(), oklch(from …): variant hover/active tints
7
7
  * @uses text-box: vertical trim (patchy browser support)
8
8
  * @tokens --ui-badge-* (@layer variables; hooks are named after the utilities they back)
@@ -211,31 +211,38 @@
211
211
  background-clip: padding-box;
212
212
  white-space-collapse: collapse;
213
213
 
214
- /* The ring is published to --_focus-ring so the utilities layer's
214
+ /* The ring is published to --_focus-shadow so the utilities layer's
215
215
  box-shadow emission keeps it above a --shadow or --ring utility; the ring
216
216
  widths grow from 0 on :focus-visible so the ring eases in. */
217
217
  --_ring-offset-width: 0px;
218
218
  --_ring-width: 0px;
219
+ --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
219
220
  --_ring-fill: color-mix(
220
221
  in oklch,
221
222
  var(--_ring-color-resolved, var(--_badge-ring-color, var(--ui-badge-ring-color)))
222
223
  var(--ring-opacity),
223
224
  transparent
224
225
  );
225
- --_focus-ring:
226
- 0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
227
- 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
226
+ --_focus-shadow:
227
+ 0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
228
+ 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
229
+ var(--_ring-fill, var(--ring-shadow-color)),
230
+ inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
231
+ inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
228
232
  var(--_ring-fill, var(--ring-shadow-color));
229
233
  box-shadow:
230
- var(--_focus-ring, 0 0 #0000),
234
+ var(--_focus-shadow, 0 0 #0000),
231
235
  var(--_shadow-resolved, var(--_badge-shadow, var(--ui-badge-shadow)));
232
236
 
233
237
  cursor: default;
234
238
  text-decoration: none;
235
239
 
236
240
  /* transparent twin of the ring for forced-colors / high-contrast modes */
237
- outline: var(--outline-width) var(--outline-style) transparent;
238
- outline-offset: var(--outline-offset);
241
+ outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
242
+ outline-offset: calc(
243
+ var(--outline-offset) - var(--_focus-in) *
244
+ (2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
245
+ );
239
246
 
240
247
  transition: var(--default-transition);
241
248
 
@@ -277,7 +284,7 @@
277
284
  [aria-disabled="true"]
278
285
  ) {
279
286
  --_ring-offset-width: var(--ring-offset-width);
280
- --_ring-width: var(--ring-width);
287
+ --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
281
288
 
282
289
  outline-color: transparent;
283
290
  }
@@ -2,7 +2,7 @@
2
2
  * button.css — Button ([data-ui~="button"])
3
3
  *
4
4
  * @layer variables, components
5
- * @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-ring), fields.css (--ui-field-* metrics), kbd.css (--ui-kbd-*)
5
+ * @requires _layers.css, _variables.css, _reset.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* metrics), kbd.css (--ui-kbd-*)
6
6
  * @uses color-mix(), oklch(from …) — variant hover/active tints
7
7
  * @uses text-box — vertical trim (patchy browser support)
8
8
  * @tokens --ui-button-* (@layer variables; hooks are named after the utilities they back; metrics default to the --ui-field-* family)
@@ -24,9 +24,9 @@
24
24
  --ui-button-ring-color: var(--ui-field-ring-color);
25
25
 
26
26
  --ui-button-font-family: var(--font-family-body);
27
- --ui-button-font-size: var(--ui-field-font-size);
27
+ --ui-button-font-size: var(--font-size-sm);
28
28
  --ui-button-font-weight: var(--font-weight-strong);
29
- --ui-button-leading: var(--ui-field-leading);
29
+ --ui-button-leading: var(--leading-sm);
30
30
 
31
31
  --ui-button-bg: var(--color-background);
32
32
  --ui-button-bg--hover: oklch(from var(--color-background) calc(l - 0.025) c h);
@@ -217,31 +217,38 @@
217
217
  background-clip: padding-box;
218
218
  white-space-collapse: collapse;
219
219
 
220
- /* The ring is published to --_focus-ring so the utilities layer's
220
+ /* The ring is published to --_focus-shadow so the utilities layer's
221
221
  box-shadow emission keeps it above a --shadow or --ring utility; the ring
222
222
  widths grow from 0 on :focus-visible so the ring eases in. */
223
223
  --_ring-offset-width: 0px;
224
224
  --_ring-width: 0px;
225
+ --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
225
226
  --_ring-fill: color-mix(
226
227
  in oklch,
227
228
  var(--_ring-color-resolved, var(--_button-ring-color, var(--ui-button-ring-color)))
228
229
  var(--ring-opacity),
229
230
  transparent
230
231
  );
231
- --_focus-ring:
232
- 0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
233
- 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
232
+ --_focus-shadow:
233
+ 0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
234
+ 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
235
+ var(--_ring-fill, var(--ring-shadow-color)),
236
+ inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
237
+ inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
234
238
  var(--_ring-fill, var(--ring-shadow-color));
235
239
  box-shadow:
236
- var(--_focus-ring, 0 0 #0000),
240
+ var(--_focus-shadow, 0 0 #0000),
237
241
  var(--_shadow-resolved, var(--_button-shadow, var(--ui-button-shadow)));
238
242
 
239
243
  cursor: default;
240
244
  text-decoration: none;
241
245
 
242
246
  /* transparent twin of the ring for forced-colors / high-contrast modes */
243
- outline: var(--outline-width) var(--outline-style) transparent;
244
- outline-offset: var(--outline-offset);
247
+ outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
248
+ outline-offset: calc(
249
+ var(--outline-offset) - var(--_focus-in) *
250
+ (2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
251
+ );
245
252
 
246
253
  transition: var(--default-transition);
247
254
 
@@ -280,7 +287,7 @@
280
287
 
281
288
  :where([data-ui~="button"]):focus-visible:not(:disabled, [aria-disabled="true"]) {
282
289
  --_ring-offset-width: var(--ring-offset-width);
283
- --_ring-width: var(--ring-width);
290
+ --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
284
291
 
285
292
  outline-color: transparent;
286
293
  }
@@ -5,7 +5,12 @@
5
5
  <thead>
6
6
  <tr>
7
7
  <th>
8
- <input type="checkbox" data-checkbox-controls="tasks" aria-label="Select all tasks" />
8
+ <input
9
+ type="checkbox"
10
+ name="tasks-all"
11
+ data-checkbox-controls="tasks"
12
+ aria-label="Select all tasks"
13
+ />
9
14
  </th>
10
15
  <th>Task</th>
11
16
  <th>Assignee</th>
@@ -2,7 +2,7 @@
2
2
  * checkbox.css — Checkbox (input[type="checkbox"]:not([role="switch"]))
3
3
  *
4
4
  * @layer variables, reset
5
- * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-ring), fields.css (--ui-field-* background/border)
5
+ * @requires _layers.css, _variables.css, _properties.css (--_*-resolved, --_focus-shadow), fields.css (--ui-field-* background/border)
6
6
  * @uses appearance: none — redraws the native control from theme tokens
7
7
  * @uses checked/indeterminate fill with --primary and layer a glyph (never color alone)
8
8
  * @tokens --ui-checkbox-* (@layer variables; named after the utilities they back;
@@ -57,17 +57,24 @@
57
57
 
58
58
  cursor: pointer;
59
59
 
60
- /* The ring is published to --_focus-ring so a --shadow utility keeps
60
+ /* The ring is published to --_focus-shadow so a --shadow utility keeps
61
61
  it; the transparent outline twin keeps focus visible in forced-colors */
62
62
  --_ring-offset-width: 0px;
63
63
  --_ring-width: 0px;
64
- --_focus-ring:
65
- 0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
66
- 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
64
+ --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
65
+ --_focus-shadow:
66
+ 0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
67
+ 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
68
+ var(--_ring-fill, var(--ring-shadow-color)),
69
+ inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
70
+ inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
67
71
  var(--_ring-fill, var(--ring-shadow-color));
68
- box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
69
- outline: var(--outline-width) var(--outline-style) transparent;
70
- outline-offset: var(--outline-offset);
72
+ box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
73
+ outline: abs(var(--_focus-ring-w, var(--outline-width))) var(--outline-style) transparent;
74
+ outline-offset: calc(
75
+ var(--outline-offset) - var(--_focus-in) *
76
+ (2 * var(--outline-offset) + abs(var(--_focus-ring-w, var(--outline-width))))
77
+ );
71
78
 
72
79
  transition-property: border-color, background-color, color, opacity, box-shadow;
73
80
  transition-duration: var(--default-transition-duration);
@@ -82,7 +89,7 @@
82
89
 
83
90
  :where(input[type="checkbox"]:not([role="switch"]):focus-visible) {
84
91
  --_ring-offset-width: var(--ring-offset-width);
85
- --_ring-width: var(--ring-width);
92
+ --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
86
93
  outline-color: transparent;
87
94
  }
88
95
 
@@ -7,7 +7,7 @@
7
7
  "
8
8
  >
9
9
  <label data-ui="field" data-field-orientation="horizontal">
10
- <input type="checkbox" data-checkbox-controls="preferences" />
10
+ <input type="checkbox" name="preferences-all" data-checkbox-controls="preferences" />
11
11
  <span data-field-slot="label">Select all</span>
12
12
  </label>
13
13
  <label data-ui="field" data-field-orientation="horizontal">
@@ -20,7 +20,7 @@
20
20
  *
21
21
  * @example
22
22
  * <table data-ui="table">
23
- * <thead><tr><th><input type="checkbox" data-checkbox-controls="tasks" /></th>...</tr></thead>
23
+ * <thead><tr><th><input type="checkbox" name="tasks-all" data-checkbox-controls="tasks" /></th>...</tr></thead>
24
24
  * <tbody><tr><td><input type="checkbox" name="tasks" /></td>...</tr></tbody>
25
25
  * </table>
26
26
  */
@@ -21,7 +21,7 @@
21
21
  *
22
22
  * @example
23
23
  * <table data-ui="table">
24
- * <thead><tr><th><input type="checkbox" data-checkbox-controls="tasks" /></th>...</tr></thead>
24
+ * <thead><tr><th><input type="checkbox" name="tasks-all" data-checkbox-controls="tasks" /></th>...</tr></thead>
25
25
  * <tbody><tr><td><input type="checkbox" name="tasks" /></td>...</tr></tbody>
26
26
  * </table>
27
27
  */
@@ -124,15 +124,22 @@
124
124
  visible in forced-colors mode */
125
125
  --_ring-offset-width: 0px;
126
126
  --_ring-width: 0px;
127
+ --_focus-in: max(0, -1 * sign(var(--_focus-ring-w, 1px)));
127
128
  --_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
128
- /* The ring is published to --_focus-ring so a --shadow utility keeps it */
129
- --_focus-ring:
130
- 0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
131
- 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
129
+ /* The ring is published to --_focus-shadow so a --shadow utility keeps it */
130
+ --_focus-shadow:
131
+ 0 0 0 calc(var(--_ring-offset-width) * (1 - var(--_focus-in))) var(--ring-offset-shadow-color),
132
+ 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * (1 - var(--_focus-in)))
133
+ var(--_ring-fill, var(--ring-shadow-color)),
134
+ inset 0 0 0 calc(var(--_ring-offset-width) * var(--_focus-in)) var(--ring-offset-shadow-color),
135
+ inset 0 0 0 calc((var(--_ring-offset-width) + var(--_ring-width)) * var(--_focus-in))
132
136
  var(--_ring-fill, var(--ring-shadow-color));
133
- box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
134
- outline: var(--outline-width) var(--outline-style) transparent;
135
- outline-offset: var(--outline-offset);
137
+ box-shadow: var(--_focus-shadow, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
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
 
137
144
  transition: var(--default-transition);
138
145
  }
@@ -147,7 +154,7 @@
147
154
  border-color: var(--ui-field-border-color--focus-within);
148
155
  background-color: var(--ui-field-bg--focus-within);
149
156
  --_ring-offset-width: var(--ring-offset-width);
150
- --_ring-width: var(--ring-width);
157
+ --_ring-width: abs(var(--_focus-ring-w, var(--ring-width)));
151
158
  outline-color: transparent;
152
159
  }
153
160
 
@@ -1 +1 @@
1
- {"version":3,"file":"command-actions.d.ts","sourceRoot":"","sources":["command-actions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,iBAAS,kBAAkB,IAAI,IAAI,CA4BlC;AAED;;;GAGG;AACH,iBAAS,wBAAwB,IAAI,IAAI,CAKxC;AAWD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"command-actions.d.ts","sourceRoot":"","sources":["command-actions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,iBAAS,kBAAkB,IAAI,IAAI,CAiClC;AAED;;;GAGG;AACH,iBAAS,wBAAwB,IAAI,IAAI,CAKxC;AAWD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,CAAC"}
@@ -33,6 +33,7 @@
33
33
  <header data-command-slot="header">
34
34
  <input
35
35
  data-command-slot="input"
36
+ name="action"
36
37
  type="text"
37
38
  placeholder="Type a command..."
38
39
  role="combobox"
@@ -35,12 +35,17 @@ function initCommandActions() {
35
35
  const command = event.command;
36
36
  switch (command) {
37
37
  case "--theme-toggle": {
38
- // data-ui-theme pins the scheme; unset follows the system
38
+ // A theme-dark / theme-light switch pins the scheme; neither follows the system
39
39
  const root = document.documentElement;
40
- const dark = root.dataset.uiTheme
41
- ? root.dataset.uiTheme === "dark"
40
+ const tokens = (root.dataset.ui ?? "").split(/\s+/).filter(Boolean);
41
+ const pinned = tokens.find((t) => t === "theme-dark" || t === "theme-light");
42
+ const dark = pinned
43
+ ? pinned === "theme-dark"
42
44
  : matchMedia("(prefers-color-scheme: dark)").matches;
43
- root.dataset.uiTheme = dark ? "light" : "dark";
45
+ root.dataset.ui = [
46
+ ...tokens.filter((t) => !t.startsWith("theme-")),
47
+ dark ? "theme-light" : "theme-dark",
48
+ ].join(" ");
44
49
  break;
45
50
  }
46
51
  case "--copy-link":
@@ -38,12 +38,17 @@ function initCommandActions(): void {
38
38
  const command = (event as CommandEvent).command;
39
39
  switch (command) {
40
40
  case "--theme-toggle": {
41
- // data-ui-theme pins the scheme; unset follows the system
41
+ // A theme-dark / theme-light switch pins the scheme; neither follows the system
42
42
  const root = document.documentElement;
43
- const dark = root.dataset.uiTheme
44
- ? root.dataset.uiTheme === "dark"
43
+ const tokens = (root.dataset.ui ?? "").split(/\s+/).filter(Boolean);
44
+ const pinned = tokens.find((t) => t === "theme-dark" || t === "theme-light");
45
+ const dark = pinned
46
+ ? pinned === "theme-dark"
45
47
  : matchMedia("(prefers-color-scheme: dark)").matches;
46
- root.dataset.uiTheme = dark ? "light" : "dark";
48
+ root.dataset.ui = [
49
+ ...tokens.filter((t) => !t.startsWith("theme-")),
50
+ dark ? "theme-light" : "theme-dark",
51
+ ].join(" ");
47
52
  break;
48
53
  }
49
54
  case "--copy-link":
@@ -24,6 +24,7 @@
24
24
  <header data-command-slot="header">
25
25
  <input
26
26
  data-command-slot="input"
27
+ name="search"
27
28
  type="text"
28
29
  placeholder="Type a command or search..."
29
30
  role="combobox"
@@ -32,6 +33,41 @@
32
33
  autocomplete="off"
33
34
  aria-label="Search commands"
34
35
  />
36
+ <button
37
+ data-ui="button"
38
+ data-button-variant="ghost"
39
+ data-button-size="icon"
40
+ type="button"
41
+ command="close"
42
+ commandfor="command-example-dialog-1"
43
+ aria-label="Close"
44
+ >
45
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
46
+ <rect width="256" height="256" fill="none" />
47
+ <line
48
+ x1="200"
49
+ y1="56"
50
+ x2="56"
51
+ y2="200"
52
+ fill="none"
53
+ stroke="currentColor"
54
+ stroke-linecap="round"
55
+ stroke-linejoin="round"
56
+ stroke-width="16"
57
+ />
58
+ <line
59
+ x1="200"
60
+ y1="200"
61
+ x2="56"
62
+ y2="56"
63
+ fill="none"
64
+ stroke="currentColor"
65
+ stroke-linecap="round"
66
+ stroke-linejoin="round"
67
+ stroke-width="16"
68
+ />
69
+ </svg>
70
+ </button>
35
71
  </header>
36
72
  <div role="listbox" data-command-slot="list" aria-label="Commands">
37
73
  <div role="group" data-command-slot="group" aria-labelledby="command-example-dialog-1-nav">
@@ -66,9 +66,11 @@
66
66
  padding: 0;
67
67
  }
68
68
 
69
- /* Dialog form: the palette owns its interior, edge to edge */
69
+ /* Dialog form: the palette owns its interior, edge to edge. A palette is
70
+ asked for, so it skips the dialog's backdrop-first delay and opens at once. */
70
71
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where(dialog) {
71
72
  --ui-dialog-w: min(var(--layout-sm), 100% - var(--gutters) * 2);
73
+ --ui-dialog-transition-delay--end: 0ms;
72
74
  padding: 0;
73
75
  }
74
76
 
@@ -79,6 +81,15 @@
79
81
  border-block-end: var(--ui-command-input-border);
80
82
  }
81
83
 
84
+ /* A close button beside the input: the dialog form's way out on touch, where
85
+ there is no Esc and the backdrop may be a sliver */
86
+ :where(ui-command, [data-ui~="command"])
87
+ [data-command-slot~="header"]
88
+ > :where([data-ui~="button"]) {
89
+ flex: none;
90
+ margin-inline-end: var(--spacing);
91
+ }
92
+
82
93
  :where(ui-command, [data-ui~="command"]) [data-command-slot~="input"] {
83
94
  flex: 1;
84
95
  min-inline-size: 0;
@@ -33,6 +33,7 @@
33
33
  <header data-command-slot="header">
34
34
  <input
35
35
  data-command-slot="input"
36
+ name="command"
36
37
  type="text"
37
38
  placeholder="Type a command or search..."
38
39
  role="combobox"
@@ -1,5 +1,5 @@
1
1
  /** A stable name per finding, so a linter can switch each one off. */
2
- export type RuleId = "unknown-utility" | "pseudo-form" | "group-needs-state" | "border-value" | "not-integer" | "tier-unsupported" | "tier-without-base" | "dual-value" | "keyword-number" | "raw-shadows-utility" | "flattens-state" | "gradient-incomplete" | "font-weight-name" | "scroll-state" | "whitespace-before-colon" | "attribute-outside-identity" | "persist";
2
+ export type RuleId = "unknown-utility" | "pseudo-form" | "group-needs-state" | "border-value" | "not-integer" | "tier-unsupported" | "tier-without-base" | "dual-value" | "keyword-number" | "raw-shadows-utility" | "flattens-state" | "gradient-incomplete" | "font-weight-name" | "scroll-state" | "whitespace-before-colon" | "attribute-outside-identity" | "field-id-or-name" | "persist";
3
3
  export declare const RULE_IDS: readonly RuleId[];
4
4
  /** `[start, end)` offsets into the `style` attribute's value. */
5
5
  export type Span = [number, number];
@@ -19,6 +19,8 @@ export interface Finding {
19
19
  }
20
20
  /** The parts of an element the audit reads. */
21
21
  export interface AuditNode {
22
+ /** The tag name, any case. */
23
+ tagName: string;
22
24
  getAttribute(name: string): string | null;
23
25
  getAttributeNames(): string[];
24
26
  /** True when this node or an ancestor carries the identity `name` (see {@link carriesIdentity}). */
@@ -1 +1 @@
1
- {"version":3,"file":"audit-core.d.ts","sourceRoot":"","sources":["audit-core.ts"],"names":[],"mappings":"AAyBA,sEAAsE;AACtE,MAAM,MAAM,MAAM,GACd,iBAAiB,GACjB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,mBAAmB,GACnB,YAAY,GACZ,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,cAAc,GACd,yBAAyB,GACzB,4BAA4B,GAC5B,SAAS,CAAC;AAEd,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAkBrC,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,+CAA+C;AAC/C,MAAM,WAAW,SAAS;IACxB,YA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before-colon",
27
27
  "attribute-outside-identity",
28
+ "field-id-or-name",
28
29
  "persist",
29
30
  ];
30
31
  const UTILITY_BY_NAME = new Map([...UTILITIES, ...PSEUDO_ONLY].map((utility) => [utility.name, utility]));
31
32
  const PSEUDO_ONLY_NAMES = new Set(PSEUDO_ONLY.map((utility) => utility.name));
33
+ /** Form fields Chrome's autofill identifies by `id` or `name`. */
34
+ const FIELD_TAGS = new Set(["input", "select", "textarea"]);
35
+ /** `<input>` types that are buttons, not fields. */
36
+ const BUTTON_TYPES = new Set(["button", "submit", "reset", "image"]);
32
37
  const NUMBER = /^-?(\d+\.?\d*|\.\d+)$/;
33
38
  const DIMENSION = /^-?(\d+\.?\d*|\.\d+)(px|r?em|%|v[wh]|v[ib]|[sld]v[wh]|ch|ex|cap|ic|lh|rlh|cq[iwhb]|cqmin|cqmax|pt|cm|mm|in)$/;
34
39
  const FUNCTION = /^(calc|clamp|min|max|var|env|round|mod|rem|abs|sign)\(/;
@@ -205,7 +210,9 @@ export function auditNode(node, context) {
205
210
  // a border shorthand is the base a border longhand's tier overrides
206
211
  const borderBase = /^border-(?:width|color|style)$/.test(baseName) &&
207
212
  BORDER_SHORTHANDS.some((name) => bases.has(name));
208
- if (utility.noBase === undefined && !bases.has(baseName) && !borderBase) {
213
+ // a utility that only feeds a composite (ring, shadow) has a literal at its chain's end
214
+ const feedsComposite = utility.emit === "none" || utility.emit === "px";
215
+ if (utility.noBase === undefined && !bases.has(baseName) && !borderBase && !feedsComposite) {
209
216
  warn("tier-without-base", `\`${name}\` has no base \`--${baseName}\`; the tier only overrides a base.`);
210
217
  }
211
218
  continue;
@@ -308,6 +315,17 @@ export function auditNode(node, context) {
308
315
  });
309
316
  }
310
317
  }
318
+ // Chrome's Issues panel flags a form field with neither id nor name
319
+ const tag = node.tagName.toLowerCase();
320
+ if (FIELD_TAGS.has(tag) &&
321
+ !(tag === "input" && BUTTON_TYPES.has((node.getAttribute("type") ?? "").toLowerCase())) &&
322
+ !node.getAttribute("id")?.trim() &&
323
+ !node.getAttribute("name")?.trim()) {
324
+ found.push({
325
+ rule: "field-id-or-name",
326
+ message: `\`<${tag}>\` has neither \`id\` nor \`name\`: give it a \`name\` (the key it submits under, and what autofill reads).`,
327
+ });
328
+ }
311
329
  return found;
312
330
  }
313
331
  /**