@zazz-ui/core 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/AUTHORING.md +29 -14
  2. package/CHANGELOG.md +156 -0
  3. package/README.md +6 -5
  4. package/dist/{csp-LRx1fynI.js → csp-C1f62vyT.js} +1 -1
  5. package/dist/sri.json +70 -65
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +74 -2
  9. package/editor/zazz.html-data.json +119 -79
  10. package/editor/zazz.language-data.json +401 -313
  11. package/editor/zazz.lint-data.json +1752 -1731
  12. package/package.json +2 -1
  13. package/src/base/_defaults.css +11 -11
  14. package/src/base/_reset.css +2 -10
  15. package/src/base/_typography.css +17 -568
  16. package/src/base/_utilities-box.css +17 -17
  17. package/src/base/_utilities-pseudo.css +2 -2
  18. package/src/base/_variables.css +142 -97
  19. package/src/base/carousel-scroll.d.ts +1 -1
  20. package/src/base/carousel-scroll.js +6 -6
  21. package/src/base/carousel-scroll.ts +6 -6
  22. package/src/base/carousel.d.ts.map +1 -1
  23. package/src/base/carousel.js +6 -2
  24. package/src/base/carousel.ts +6 -2
  25. package/src/base/csp.js +2 -2
  26. package/src/base/csp.ts +2 -2
  27. package/src/base/kit-styling.d.ts.map +1 -1
  28. package/src/base/kit-styling.js +186 -183
  29. package/src/base/kit-styling.ts +186 -183
  30. package/src/base/navigation.d.ts +2 -2
  31. package/src/base/navigation.d.ts.map +1 -1
  32. package/src/base/navigation.js +25 -21
  33. package/src/base/navigation.ts +27 -21
  34. package/src/base/utilities.d.ts +1 -1
  35. package/src/base/utilities.d.ts.map +1 -1
  36. package/src/base/utilities.js +20 -4
  37. package/src/base/utilities.ts +21 -5
  38. package/src/base/zazz-element.d.ts +1 -1
  39. package/src/base/zazz-element.js +1 -1
  40. package/src/base/zazz-element.ts +1 -1
  41. package/src/{base → behaviors}/gesture.d.ts +4 -3
  42. package/src/behaviors/gesture.d.ts.map +1 -0
  43. package/src/{base → behaviors}/gesture.js +1 -1
  44. package/src/{base → behaviors}/gesture.ts +5 -4
  45. package/src/{base → behaviors}/hotkeys.d.ts +2 -1
  46. package/src/behaviors/hotkeys.d.ts.map +1 -0
  47. package/src/{base → behaviors}/hotkeys.ts +2 -1
  48. package/src/behaviors/list-navigation.d.ts +64 -0
  49. package/src/behaviors/list-navigation.d.ts.map +1 -0
  50. package/src/behaviors/list-navigation.js +66 -0
  51. package/src/behaviors/list-navigation.ts +107 -0
  52. package/src/{base → behaviors}/typeahead.d.ts +3 -1
  53. package/src/behaviors/typeahead.d.ts.map +1 -0
  54. package/src/{base → behaviors}/typeahead.js +12 -17
  55. package/src/{base → behaviors}/typeahead.ts +12 -17
  56. package/src/css-properties.json +704 -0
  57. package/src/index.css +7 -0
  58. package/src/manifest.d.ts +20 -9
  59. package/src/manifest.d.ts.map +1 -1
  60. package/src/manifest.js +125 -37
  61. package/src/manifest.ts +132 -38
  62. package/src/primitives/accordion/accordion.json +49 -0
  63. package/src/primitives/alert-dialog/alert-dialog.json +35 -0
  64. package/src/primitives/autocomplete/autocomplete.d.ts +2 -2
  65. package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
  66. package/src/primitives/autocomplete/autocomplete.js +2 -2
  67. package/src/primitives/autocomplete/autocomplete.json +65 -0
  68. package/src/primitives/autocomplete/autocomplete.ts +2 -2
  69. package/src/primitives/avatar/avatar.css +108 -0
  70. package/src/primitives/avatar/avatar.html +20 -74
  71. package/src/primitives/avatar/avatar.json +48 -0
  72. package/src/primitives/badge/badge.css +45 -10
  73. package/src/primitives/badge/badge.html +4 -0
  74. package/src/primitives/badge/badge.json +83 -0
  75. package/src/primitives/breadcrumbs/breadcrumbs.json +20 -0
  76. package/src/primitives/button/button.css +50 -66
  77. package/src/primitives/button/button.html +4 -0
  78. package/src/primitives/button/button.json +85 -0
  79. package/src/primitives/button-group/button-group.css +4 -15
  80. package/src/primitives/button-group/button-group.json +40 -0
  81. package/src/primitives/callout/callout.css +1 -1
  82. package/src/primitives/callout/callout.html +12 -12
  83. package/src/primitives/callout/callout.json +54 -0
  84. package/src/primitives/card/card-article.html +13 -37
  85. package/src/primitives/card/card-horizontal.html +11 -14
  86. package/src/primitives/card/card-login.html +4 -4
  87. package/src/primitives/card/card-product.html +3 -3
  88. package/src/primitives/card/card-subgrid.html +4 -4
  89. package/src/primitives/card/card.css +1 -1
  90. package/src/primitives/card/card.html +8 -8
  91. package/src/primitives/card/card.json +73 -0
  92. package/src/primitives/carousel/carousel.css +1 -1
  93. package/src/primitives/carousel/carousel.json +89 -0
  94. package/src/primitives/checkbox/checkbox.css +1 -2
  95. package/src/primitives/checkbox/checkbox.json +51 -0
  96. package/src/primitives/combobox/combobox.css +3 -2
  97. package/src/primitives/combobox/combobox.d.ts +2 -2
  98. package/src/primitives/combobox/combobox.d.ts.map +1 -1
  99. package/src/primitives/combobox/combobox.js +2 -2
  100. package/src/primitives/combobox/combobox.json +113 -0
  101. package/src/primitives/combobox/combobox.ts +2 -2
  102. package/src/primitives/command/command-actions.html +1 -1
  103. package/src/primitives/command/command.d.ts +4 -3
  104. package/src/primitives/command/command.d.ts.map +1 -1
  105. package/src/primitives/command/command.js +7 -6
  106. package/src/primitives/command/command.json +86 -0
  107. package/src/primitives/command/command.ts +7 -6
  108. package/src/primitives/debug/audit-core.d.ts +19 -12
  109. package/src/primitives/debug/audit-core.d.ts.map +1 -1
  110. package/src/primitives/debug/audit-core.js +78 -16
  111. package/src/primitives/debug/audit-core.ts +94 -22
  112. package/src/primitives/debug/debug.d.ts +6 -4
  113. package/src/primitives/debug/debug.d.ts.map +1 -1
  114. package/src/primitives/debug/debug.js +50 -21
  115. package/src/primitives/debug/debug.json +29 -0
  116. package/src/primitives/debug/debug.ts +57 -35
  117. package/src/primitives/dialog/dialog.css +1 -4
  118. package/src/primitives/dialog/dialog.json +78 -0
  119. package/src/primitives/drawer/drawer.css +4 -2
  120. package/src/primitives/drawer/drawer.d.ts.map +1 -1
  121. package/src/primitives/drawer/drawer.js +76 -4
  122. package/src/primitives/drawer/drawer.json +98 -0
  123. package/src/primitives/drawer/drawer.ts +78 -5
  124. package/src/primitives/fields/fields.css +11 -4
  125. package/src/primitives/fields/fields.json +92 -0
  126. package/src/primitives/font/font.css +188 -0
  127. package/src/primitives/font/font.html +14 -0
  128. package/src/primitives/font/font.json +39 -0
  129. package/src/primitives/group/group.json +25 -0
  130. package/src/primitives/input/input.css +1 -2
  131. package/src/primitives/input/input.json +56 -0
  132. package/src/primitives/input-group/input-group-password-group.html +1 -1
  133. package/src/primitives/input-group/input-group.css +32 -3
  134. package/src/primitives/input-group/input-group.html +5 -8
  135. package/src/primitives/input-group/input-group.json +69 -0
  136. package/src/primitives/kbd/kbd.css +1 -1
  137. package/src/primitives/kbd/kbd.json +52 -0
  138. package/src/primitives/layout/layout.json +45 -0
  139. package/src/primitives/lightbox/lightbox.css +4 -3
  140. package/src/primitives/lightbox/lightbox.html +2 -2
  141. package/src/primitives/lightbox/lightbox.js +1 -1
  142. package/src/primitives/lightbox/lightbox.json +87 -0
  143. package/src/primitives/lightbox/lightbox.ts +1 -1
  144. package/src/primitives/link/link.css +28 -0
  145. package/src/primitives/link/link.html +5 -0
  146. package/src/primitives/link/link.json +23 -0
  147. package/src/primitives/menu/menu.d.ts +3 -0
  148. package/src/primitives/menu/menu.d.ts.map +1 -1
  149. package/src/primitives/menu/menu.js +10 -25
  150. package/src/primitives/menu/menu.json +51 -0
  151. package/src/primitives/menu/menu.ts +10 -27
  152. package/src/primitives/menubar/menubar.json +23 -0
  153. package/src/primitives/meter/meter.css +24 -3
  154. package/src/primitives/meter/meter.json +41 -0
  155. package/src/primitives/mobile-menu/mobile-menu.html +1 -1
  156. package/src/primitives/mobile-menu/mobile-menu.json +64 -0
  157. package/src/primitives/navigation-menu/navigation-menu-featured.html +58 -58
  158. package/src/primitives/navigation-menu/navigation-menu-megamenu.html +6 -113
  159. package/src/primitives/navigation-menu/navigation-menu.css +11 -5
  160. package/src/primitives/navigation-menu/navigation-menu.html +1 -1
  161. package/src/primitives/navigation-menu/navigation-menu.json +82 -0
  162. package/src/primitives/otp/otp.css +1 -1
  163. package/src/primitives/otp/otp.d.ts +3 -3
  164. package/src/primitives/otp/otp.js +5 -5
  165. package/src/primitives/otp/otp.json +75 -0
  166. package/src/primitives/otp/otp.ts +5 -5
  167. package/src/primitives/password-group/password-group.css +32 -2
  168. package/src/primitives/password-group/password-group.html +1 -1
  169. package/src/primitives/password-group/password-group.json +74 -0
  170. package/src/primitives/popover/popover.css +1 -1
  171. package/src/primitives/popover/popover.json +64 -0
  172. package/src/primitives/progress/progress.css +25 -3
  173. package/src/primitives/progress/progress.json +41 -0
  174. package/src/primitives/prose/prose.css +341 -0
  175. package/src/primitives/prose/prose.html +11 -11
  176. package/src/primitives/prose/prose.json +47 -0
  177. package/src/primitives/radio/radio.css +1 -1
  178. package/src/primitives/radio/radio.json +48 -0
  179. package/src/primitives/reveal/reveal.json +72 -0
  180. package/src/primitives/scroll-fade/scroll-fade.css +0 -3
  181. package/src/primitives/scroll-fade/scroll-fade.json +34 -0
  182. package/src/primitives/select/select.css +2 -2
  183. package/src/primitives/select/select.json +119 -0
  184. package/src/primitives/separator/separator.json +34 -0
  185. package/src/primitives/slider/slider.css +87 -13
  186. package/src/primitives/slider/slider.json +49 -0
  187. package/src/primitives/style-guard/style-guard.js +1 -1
  188. package/src/primitives/style-guard/style-guard.json +22 -0
  189. package/src/primitives/style-guard/style-guard.ts +2 -2
  190. package/src/primitives/switch/switch.css +107 -18
  191. package/src/primitives/switch/switch.json +71 -0
  192. package/src/primitives/table/table.json +74 -0
  193. package/src/primitives/tabs/tabs.css +24 -12
  194. package/src/primitives/tabs/tabs.d.ts +4 -2
  195. package/src/primitives/tabs/tabs.d.ts.map +1 -1
  196. package/src/primitives/tabs/tabs.js +14 -24
  197. package/src/primitives/tabs/tabs.json +94 -0
  198. package/src/primitives/tabs/tabs.ts +14 -26
  199. package/src/primitives/textarea/textarea.css +1 -1
  200. package/src/primitives/textarea/textarea.json +48 -0
  201. package/src/primitives/toaster/toaster.d.ts.map +1 -1
  202. package/src/primitives/toaster/toaster.js +4 -4
  203. package/src/primitives/toaster/toaster.json +101 -0
  204. package/src/primitives/toaster/toaster.ts +5 -5
  205. package/src/primitives/toggle/toggle.css +2 -52
  206. package/src/primitives/toggle/toggle.json +84 -0
  207. package/src/primitives/toggle-group/toggle-group.css +1 -1
  208. package/src/primitives/toggle-group/toggle-group.json +41 -0
  209. package/src/primitives/toolbar/toolbar.json +26 -0
  210. package/src/primitives/tooltip/tooltip.css +1 -1
  211. package/src/primitives/tooltip/tooltip.json +85 -0
  212. package/src/primitives/utilities/aspect-ratio.html +3 -3
  213. package/src/primitives/utilities/basis.html +5 -5
  214. package/src/primitives/utilities/col-span.html +5 -5
  215. package/src/primitives/utilities/compose.html +3 -3
  216. package/src/primitives/utilities/flex-align.html +3 -3
  217. package/src/primitives/utilities/flex-direction.html +8 -8
  218. package/src/primitives/utilities/flex-grow.html +3 -3
  219. package/src/primitives/utilities/flex-reverse.html +8 -8
  220. package/src/primitives/utilities/gallery.html +19 -19
  221. package/src/primitives/utilities/gap.html +12 -12
  222. package/src/primitives/utilities/grid-cols.html +6 -6
  223. package/src/primitives/utilities/grid-responsive.html +9 -9
  224. package/src/primitives/utilities/inline-flex.html +2 -2
  225. package/src/primitives/utilities/margin-auto.html +1 -1
  226. package/src/primitives/utilities/object-fit.html +3 -3
  227. package/src/primitives/utilities/order.html +3 -3
  228. package/src/primitives/utilities/overflow.html +14 -14
  229. package/src/primitives/utilities/padding-compose.html +3 -3
  230. package/src/primitives/utilities/padding.html +4 -4
  231. package/src/primitives/utilities/position.html +1 -1
  232. package/src/primitives/utilities/responsive-flex.html +4 -4
  233. package/src/primitives/utilities/responsive-grid.html +9 -9
  234. package/src/primitives/utilities/size.html +5 -5
  235. package/src/primitives/utilities/subgrid-col.html +7 -7
  236. package/src/primitives/utilities/subgrid-row.html +9 -9
  237. package/src/primitives/utilities/subgrid.html +9 -9
  238. package/src/primitives/utilities/utilities.json +48 -0
  239. package/src/primitives/utilities/width.html +5 -5
  240. package/src/base/gesture.d.ts.map +0 -1
  241. package/src/base/hotkeys.d.ts.map +0 -1
  242. package/src/base/typeahead.d.ts.map +0 -1
  243. /package/src/{base → behaviors}/command-score.d.ts +0 -0
  244. /package/src/{base → behaviors}/command-score.d.ts.map +0 -0
  245. /package/src/{base → behaviors}/command-score.js +0 -0
  246. /package/src/{base → behaviors}/command-score.ts +0 -0
  247. /package/src/{base → behaviors}/hotkeys.js +0 -0
@@ -19,7 +19,7 @@
19
19
  * past its resting place meets resistance.
20
20
  *
21
21
  * A drag starts anywhere on the drawer except on form fields, selected text,
22
- * and anything inside `[data-ui-no-drag]`. Inside scrolling content it starts
22
+ * and anything inside `[data-draggable="false"]`. Inside scrolling content it starts
23
23
  * only once that content is scrolled to the top and the pointer moves down,
24
24
  * so the body scrolls first and the drawer follows; the handle
25
25
  * (`data-drawer-slot="handle"`) always drags. There is no custom element and
@@ -30,7 +30,7 @@
30
30
  * height, a `px` or `rem` length is a visible height. It opens at the first.
31
31
  * Letting go settles on the nearest; a flick moves one stop in its direction,
32
32
  * a very fast one goes all the way (or one stop, with
33
- * `data-drawer-snap-sequential`), and from the lowest stop a flick or enough
33
+ * `data-drawer-snap-behavior="sequential"`), and from the lowest stop a flick or enough
34
34
  * travel downward closes the drawer. Below the largest stop the drawer takes
35
35
  * every vertical drag and its content does not scroll. A click on the handle
36
36
  * steps to the next stop; make the handle a `<button>` to give the keyboard
@@ -44,6 +44,13 @@
44
44
  * edge (its surface runs on underneath), the focused field scrolls into what
45
45
  * is still visible, and the page behind stays where it was. Nothing to author.
46
46
  *
47
+ * On a touch screen a drawer does not raise the keyboard or a picker by
48
+ * opening: a dialog focuses its first control, and a text field focused while
49
+ * the drawer is still below the screen makes iOS push the page up to show it.
50
+ * A drawer that holds a text field, a select, or a date, time, or color input
51
+ * takes focus itself. Put `autofocus` on a field to focus it anyway; on iOS
52
+ * the page may then move as the drawer opens.
53
+ *
47
54
  * **Stacked drawers.** A drawer opened over another scales the one behind back
48
55
  * and lifts it, and that one follows as the front drawer is dragged. Nothing
49
56
  * to author: the script counts the open drawers.
@@ -72,8 +79,8 @@ import {
72
79
  pickSnap,
73
80
  rubberBand,
74
81
  trackDrag,
75
- } from "../../base/gesture.ts";
76
- import type { DragState } from "../../base/gesture.ts";
82
+ } from "../../behaviors/gesture.ts";
83
+ import type { DragState } from "../../behaviors/gesture.ts";
77
84
  import { registerRefresh } from "../../base/zazz-element.ts";
78
85
 
79
86
  // --- Tuning ---
@@ -512,6 +519,61 @@ function trackKeyboard(
512
519
  update();
513
520
  }
514
521
 
522
+ /**
523
+ * @description Input types that open a picker when focused on a touch screen.
524
+ * @private
525
+ */
526
+ const PICKER = /^(?:color|date|datetime-local|month|time|week)$/;
527
+
528
+ /**
529
+ * @description Whether focus on an element brings up the software keyboard or
530
+ * a picker on a touch screen.
531
+ *
532
+ * @param element - The element.
533
+ * @returns Whether it is a text field, a select, or a picker input.
534
+ * @private
535
+ */
536
+ function summonsInput(element: Element): boolean {
537
+ if (element instanceof HTMLSelectElement) return true;
538
+ if (element instanceof HTMLInputElement && PICKER.test(element.type)) return true;
539
+ return typesText(element);
540
+ }
541
+
542
+ /**
543
+ * @description Keeps a drawer that is about to open from focusing a field on
544
+ * a touch screen. `showModal()` focuses the dialog's first focusable control
545
+ * while the drawer is still below the screen; when that is a text field, iOS
546
+ * raises the keyboard and scrolls the page up to reveal it, so the page jumps
547
+ * before the drawer has risen. A drawer that holds a field has its children
548
+ * made inert while the dialog runs its focusing steps, so focus goes to the
549
+ * dialog, in every engine and without scrolling its content. They are
550
+ * released when focus lands, or on the next task if it never does. A drawer
551
+ * with a usable `autofocus` inside is left alone. Fields an author's own
552
+ * `beforetoggle` listener adds afterwards are not seen.
553
+ *
554
+ * @param dialog - The drawer about to open.
555
+ * @private
556
+ */
557
+ function holdFocus(dialog: HTMLDialogElement): void {
558
+ if (window.matchMedia("(hover: hover)").matches || !inDrawerMode(dialog)) return;
559
+ if (dialog.autofocus || dialog.querySelector("[autofocus]:not(:disabled)")) return;
560
+ const fields = dialog.querySelectorAll("input, textarea, select, [contenteditable]");
561
+ if (![...fields].some((field) => summonsInput(field) && !field.closest("[inert]"))) return;
562
+ const held = [...dialog.children].filter(
563
+ (child): child is HTMLElement => child instanceof HTMLElement && !child.inert,
564
+ );
565
+ for (const child of held) child.inert = true;
566
+ const release = () => {
567
+ window.clearTimeout(timer);
568
+ dialog.removeEventListener("focus", release, true);
569
+ for (const child of held) child.inert = false;
570
+ };
571
+ // focus landing on the drawer ends it; the timer covers an open that was
572
+ // canceled, or a page without focus, where no focus event fires
573
+ dialog.addEventListener("focus", release, true);
574
+ const timer = window.setTimeout(release);
575
+ }
576
+
515
577
  // --- Binding ---
516
578
 
517
579
  /** What an open drawer exposes to the rest of the module. */
@@ -768,7 +830,7 @@ function bindDrawer(dialog: HTMLDialogElement): void {
768
830
  closeRatio: CLOSE_RATIO,
769
831
  flick: FLICK_VELOCITY,
770
832
  fling: FLING_VELOCITY,
771
- sequential: dialog.hasAttribute("data-drawer-snap-sequential"),
833
+ sequential: dialog.getAttribute("data-drawer-snap-behavior") === "sequential",
772
834
  });
773
835
  // transitions back on: the inline translate now eases to wherever it is set
774
836
  setDragging(dialog, false);
@@ -819,6 +881,17 @@ const initDrawers: InitDrawersFn = function () {
819
881
  if (initDrawers._bound) return;
820
882
  initDrawers._bound = true;
821
883
 
884
+ // beforetoggle does not bubble: caught on its way down, before the dialog focuses anything
885
+ document.addEventListener(
886
+ "beforetoggle",
887
+ (event) => {
888
+ if ((event as ToggleEvent).newState !== "open") return;
889
+ if (event.target instanceof HTMLDialogElement && event.target.matches(DRAWER)) {
890
+ holdFocus(event.target);
891
+ }
892
+ },
893
+ true,
894
+ );
822
895
  document.addEventListener("zazz:dialog-open", (event) => {
823
896
  if (event.target instanceof HTMLDialogElement && event.target.matches(DRAWER)) {
824
897
  bindDrawer(event.target);
@@ -48,10 +48,17 @@
48
48
  --ui-field-ring-color: var(--color-ring);
49
49
  --ui-field-radius: var(--radius-md);
50
50
  --ui-field-corner-shape: var(--radius-corner-shape);
51
- --ui-field-inset-radius: calc(
52
- var(--ui-field-radius) - var(--ui-field-inset-p) - var(--ui-field-border-width)
53
- );
54
51
  --ui-field-inset-p: calc(var(--spacing) * 0.85);
52
+ /* Concentric corners: a nested part's radius is the parent's radius less the
53
+ distance between their outer edges (the parent's border plus the gap from its
54
+ padding edge to the part). The part's own border and background-clip never
55
+ enter: border-radius is drawn at the border-box edge, and the browser takes
56
+ the inner curves from it. This value assumes the part sits exactly
57
+ --ui-field-inset-p inside the border. */
58
+ --ui-field-inset-radius: max(
59
+ 0px,
60
+ var(--ui-field-radius) - var(--ui-field-border-width) - var(--ui-field-inset-p)
61
+ );
55
62
  --ui-field-h: calc(var(--spacing) * 8);
56
63
  --ui-field-font-size: var(--font-size-sm);
57
64
  --ui-field-leading: 1;
@@ -238,7 +245,7 @@
238
245
  --_radius-len: var(--_radius-resolved, var(--ui-field-group-radius));
239
246
  --_radius-num: var(--_radius-resolved, var(--ui-field-group-radius));
240
247
  border-radius: calc(
241
- var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
248
+ var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
242
249
  );
243
250
  corner-shape: var(--_corner-shape-resolved, var(--ui-field-group-corner-shape));
244
251
  --_p-len: var(--_p-resolved, var(--ui-field-group-p));
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "fields",
3
+ "summary": "fields.css: Shared form field family (Tier 3 owner for --ui-field-*)",
4
+ "identities": [
5
+ "field",
6
+ "field-group"
7
+ ],
8
+ "tags": [],
9
+ "hooks": {
10
+ "Layout & Positioning": {
11
+ "--ui-field-display": "grid",
12
+ "--ui-field-gap": "calc(var(--spacing) * 2)",
13
+ "--ui-field-group-display": "grid",
14
+ "--ui-field-group-gap": "var(--space-xs)",
15
+ "--ui-field-horizontal-display": "flex",
16
+ "--ui-field-horizontal-flex-direction": "row",
17
+ "--ui-field-horizontal-gap": "var(--space-xs)",
18
+ "--ui-field-horizontal-items": "center",
19
+ "--ui-field-horizontal-justify": "flex-start",
20
+ "--ui-field-option-gap": "1px",
21
+ "--ui-field-self": "flex-start",
22
+ "--ui-field-template-cols": "1fr"
23
+ },
24
+ "Box Model & Sizing": {
25
+ "--ui-field-group-m": "0",
26
+ "--ui-field-group-p": "0",
27
+ "--ui-field-h": "calc(var(--spacing) * 8)",
28
+ "--ui-field-icon-size": "calc(var(--spacing) * 4)",
29
+ "--ui-field-inset-p": "calc(var(--spacing) * 0.85)",
30
+ "--ui-field-px": "calc(var(--spacing) * 2.5)",
31
+ "--ui-field-py": "calc(var(--spacing) * 1.75)",
32
+ "--ui-field-w": "100%"
33
+ },
34
+ "Typography": {
35
+ "--ui-field-font-size": "var(--font-size-sm)",
36
+ "--ui-field-leading": "1"
37
+ },
38
+ "Color & Backgrounds": {
39
+ "--ui-field-bg": "var(--color-input)",
40
+ "--ui-field-bg--focus-within": "var(--color-background)",
41
+ "--ui-field-bg--hover": "var(--color-input)",
42
+ "--ui-field-group-bg": "transparent",
43
+ "--ui-field-label-text": "inherit",
44
+ "--ui-field-text": "var(--color-input-foreground)"
45
+ },
46
+ "Borders & Outlines": {
47
+ "--ui-field-border-color": "var(--color-border)",
48
+ "--ui-field-border-color--focus-within": "var(--color-primary)",
49
+ "--ui-field-border-color--hover": "color-mix( in oklch, var(--color-border) 90%, var(--color-foreground) 10% )",
50
+ "--ui-field-border-style": "solid",
51
+ "--ui-field-border-width": "1px",
52
+ "--ui-field-corner-shape": "var(--radius-corner-shape)",
53
+ "--ui-field-group-border": "1px solid transparent",
54
+ "--ui-field-group-corner-shape": "var(--ui-field-corner-shape)",
55
+ "--ui-field-group-radius": "var(--radius-lg)",
56
+ "--ui-field-inset-radius": "max( 0px, var(--ui-field-radius) - var(--ui-field-border-width) - var(--ui-field-inset-p) )",
57
+ "--ui-field-radius": "var(--radius-md)"
58
+ },
59
+ "Visual Effects": {
60
+ "--ui-field-ring-color": "var(--color-ring)"
61
+ },
62
+ "Transforms & Animation": {
63
+ "--ui-field-hint-translate--end": "0 0",
64
+ "--ui-field-hint-translate--start": "0 calc(var(--spacing) * -1)"
65
+ }
66
+ },
67
+ "attributes": {
68
+ "data-field-orientation": [
69
+ "horizontal"
70
+ ]
71
+ },
72
+ "slots": {
73
+ "data-field-slot": [
74
+ "description",
75
+ "error",
76
+ "hint",
77
+ "label"
78
+ ]
79
+ },
80
+ "states": {},
81
+ "requires": [],
82
+ "files": {
83
+ "css": [
84
+ "primitives/fields/fields.css"
85
+ ],
86
+ "js": [],
87
+ "base": [],
88
+ "examples": [
89
+ "primitives/fields/fields.html"
90
+ ]
91
+ }
92
+ }
@@ -0,0 +1,188 @@
1
+ /**
2
+ * font.css: Typography roles ([data-font])
3
+ *
4
+ * @layer components
5
+ * @requires _layers.css, _variables.css, _typography.css (the native headings
6
+ * these roles restyle); loads after every primitive that sets a font
7
+ * @uses data-font="display | h1–h6 | 2xl–2xs | eyebrow": one role per element;
8
+ * each sets the size, leading, and tracking of its step in the type scale
9
+ * @uses font-optical-sizing: heading optical size
10
+ * @uses text-wrap: pretty (h4–h6), @supports gated (Firefox lacks it; wrap fallback)
11
+ * @uses Type tokens: consumes --font-size-*, --leading-*, --tracking-*,
12
+ * --font-family-*, --font-weight-*, and the per-group OpenType controls
13
+ * (--font-<feature>-heading | -body) from _variables.css
14
+ * @uses Bare attribute selectors, no :where(): a role is an explicit choice, so it
15
+ * carries one attribute of specificity. That beats a primitive's zero-specificity
16
+ * root and prose's scoped rules, and ties a slot rule, which it follows in
17
+ * load order. Utilities sit in a later layer and still win.
18
+ */
19
+
20
+ @layer ui.components {
21
+ /* ===========================================================================
22
+ FONT ROLES: a step of the type scale on any element
23
+ - Heading roles (display, h1–h6) match the native headings in _typography.css
24
+ and also set the heading family and weight.
25
+ - Body roles (2xl–2xs) leave family and weight alone, so <h3 data-font="lg">
26
+ is a smaller heading, not body text. The eyebrow sets its own weight.
27
+ - A utility (--font-size, --font-weight, …) overrides one property of a role.
28
+ =========================================================================== */
29
+
30
+ [data-font="display"],
31
+ [data-font="h1"],
32
+ [data-font="h2"],
33
+ [data-font="h3"],
34
+ [data-font="h4"],
35
+ [data-font="h5"],
36
+ [data-font="h6"] {
37
+ font-family: var(--font-family-heading);
38
+ font-weight: var(--font-weight-heading);
39
+ font-feature-settings: var(--font-feature-heading);
40
+ font-kerning: var(--font-kerning-heading);
41
+ font-language-override: var(--font-language-heading);
42
+ font-optical-sizing: var(--font-optical-sizing-heading, auto);
43
+ font-size-adjust: var(--font-size-adjust-heading);
44
+ font-variant-alternates: var(--font-alternates-heading);
45
+ font-variant-caps: var(--font-caps-heading);
46
+ font-variant-east-asian: var(--font-east-asian-heading);
47
+ font-variant-emoji: var(--font-emoji-heading);
48
+ font-variant-ligatures: var(--font-ligatures-heading);
49
+ font-variant-numeric: var(--font-numeric-heading);
50
+ font-variant-position: var(--font-position-heading);
51
+ font-variation-settings: var(--font-settings-heading);
52
+ }
53
+
54
+ [data-font="display"],
55
+ [data-font="h1"],
56
+ [data-font="h2"],
57
+ [data-font="h3"] {
58
+ text-wrap: var(--text-wrap-heading, balance);
59
+ }
60
+
61
+ [data-font="h4"],
62
+ [data-font="h5"],
63
+ [data-font="h6"] {
64
+ text-wrap: var(--text-wrap-heading, wrap);
65
+ /* pretty can't be a var() fallback: a var() value is only checked at
66
+ computed-value time, so Firefox (no pretty) would reset text-wrap.
67
+ Drop the gate once web-features text-wrap-pretty is Baseline widely
68
+ available (not yet Baseline as of 2026-11). */
69
+ @supports (text-wrap: pretty) {
70
+ text-wrap: var(--text-wrap-heading, pretty);
71
+ }
72
+ }
73
+
74
+ [data-font="2xl"],
75
+ [data-font="xl"],
76
+ [data-font="lg"],
77
+ [data-font="md"],
78
+ [data-font="sm"],
79
+ [data-font="xs"],
80
+ [data-font="2xs"],
81
+ [data-font="eyebrow"] {
82
+ font-feature-settings: var(--font-feature-body);
83
+ font-kerning: var(--font-kerning-body);
84
+ font-language-override: var(--font-language-body);
85
+ font-optical-sizing: var(--font-optical-sizing-body, auto);
86
+ font-size-adjust: var(--font-size-adjust-body);
87
+ font-variant-alternates: var(--font-alternates-body);
88
+ font-variant-caps: var(--font-caps-body);
89
+ font-variant-east-asian: var(--font-east-asian-body);
90
+ font-variant-emoji: var(--font-emoji-body);
91
+ font-variant-ligatures: var(--font-ligatures-body);
92
+ font-variant-numeric: var(--font-numeric-body);
93
+ font-variant-position: var(--font-position-body);
94
+ font-variation-settings: var(--font-settings-body);
95
+ }
96
+
97
+ [data-font="display"] {
98
+ font-size: var(--font-size-display);
99
+ line-height: var(--leading-display);
100
+ letter-spacing: var(--tracking-display);
101
+ }
102
+
103
+ [data-font="h1"] {
104
+ font-size: var(--font-size-h1);
105
+ line-height: var(--leading-h1);
106
+ letter-spacing: var(--tracking-h1);
107
+ }
108
+
109
+ [data-font="h2"] {
110
+ font-size: var(--font-size-h2);
111
+ line-height: var(--leading-h2);
112
+ letter-spacing: var(--tracking-h2);
113
+ }
114
+
115
+ [data-font="h3"] {
116
+ font-size: var(--font-size-h3);
117
+ line-height: var(--leading-h3);
118
+ letter-spacing: var(--tracking-h3);
119
+ }
120
+
121
+ [data-font="h4"] {
122
+ font-size: var(--font-size-h4);
123
+ line-height: var(--leading-h4);
124
+ letter-spacing: var(--tracking-h4);
125
+ }
126
+
127
+ [data-font="h5"] {
128
+ font-size: var(--font-size-h5);
129
+ line-height: var(--leading-h5);
130
+ letter-spacing: var(--tracking-h5);
131
+ }
132
+
133
+ [data-font="h6"] {
134
+ font-size: var(--font-size-h6);
135
+ line-height: var(--leading-h6);
136
+ letter-spacing: var(--tracking-h6);
137
+ }
138
+
139
+ [data-font="2xl"] {
140
+ font-size: var(--font-size-2xl);
141
+ line-height: var(--leading-2xl);
142
+ letter-spacing: var(--tracking-2xl);
143
+ }
144
+
145
+ [data-font="xl"] {
146
+ font-size: var(--font-size-xl);
147
+ line-height: var(--leading-xl);
148
+ letter-spacing: var(--tracking-xl);
149
+ }
150
+
151
+ [data-font="lg"] {
152
+ font-size: var(--font-size-lg);
153
+ line-height: var(--leading-lg);
154
+ letter-spacing: var(--tracking-lg);
155
+ }
156
+
157
+ [data-font="md"] {
158
+ font-size: var(--font-size-md);
159
+ line-height: var(--leading-md);
160
+ letter-spacing: var(--tracking-md);
161
+ }
162
+
163
+ [data-font="sm"] {
164
+ font-size: var(--font-size-sm);
165
+ line-height: var(--leading-sm);
166
+ letter-spacing: var(--tracking-sm);
167
+ }
168
+
169
+ [data-font="xs"] {
170
+ font-size: var(--font-size-xs);
171
+ line-height: var(--leading-xs);
172
+ letter-spacing: var(--tracking-xs);
173
+ }
174
+
175
+ [data-font="2xs"] {
176
+ font-size: var(--font-size-2xs);
177
+ line-height: var(--leading-2xs);
178
+ letter-spacing: var(--tracking-2xs);
179
+ }
180
+
181
+ [data-font="eyebrow"] {
182
+ font-size: var(--font-size-eyebrow);
183
+ line-height: var(--leading-eyebrow);
184
+ font-weight: var(--font-weight-eyebrow);
185
+ letter-spacing: var(--tracking-eyebrow);
186
+ text-transform: uppercase;
187
+ }
188
+ }
@@ -0,0 +1,14 @@
1
+ <div
2
+ style="
3
+ --display: flex-col;
4
+ --gap: 4;
5
+ --max-w: 96;
6
+ "
7
+ >
8
+ <span data-font="eyebrow" style="--text: var(--color-muted-foreground)">Release notes</span>
9
+ <p data-font="h3">Type roles on any element</p>
10
+ <p data-font="lg">A role sets the size, leading, and tracking of one step in the type scale.</p>
11
+ <p data-font="sm" style="--text: var(--color-muted-foreground)">
12
+ Heading roles also set the heading family and weight; body roles leave them alone.
13
+ </p>
14
+ </div>
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "font",
3
+ "summary": "font.css: Typography roles ([data-font])",
4
+ "identities": [],
5
+ "tags": [],
6
+ "hooks": {},
7
+ "attributes": {
8
+ "data-font": [
9
+ "2xl",
10
+ "2xs",
11
+ "display",
12
+ "eyebrow",
13
+ "h1",
14
+ "h2",
15
+ "h3",
16
+ "h4",
17
+ "h5",
18
+ "h6",
19
+ "lg",
20
+ "md",
21
+ "sm",
22
+ "xl",
23
+ "xs"
24
+ ]
25
+ },
26
+ "slots": {},
27
+ "states": {},
28
+ "requires": [],
29
+ "files": {
30
+ "css": [
31
+ "primitives/font/font.css"
32
+ ],
33
+ "js": [],
34
+ "base": [],
35
+ "examples": [
36
+ "primitives/font/font.html"
37
+ ]
38
+ }
39
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "group",
3
+ "summary": "group.css: Group (ui-group | [data-ui~=\"group\"]), the ancestor whose state its descendants' `--group-*` utilities follow (`--group-bg--hover`)",
4
+ "identities": [
5
+ "group"
6
+ ],
7
+ "tags": [
8
+ "ui-group"
9
+ ],
10
+ "hooks": {},
11
+ "attributes": {},
12
+ "slots": {},
13
+ "states": {},
14
+ "requires": [],
15
+ "files": {
16
+ "css": [
17
+ "primitives/group/group.css"
18
+ ],
19
+ "js": [],
20
+ "base": [],
21
+ "examples": [
22
+ "primitives/group/group.html"
23
+ ]
24
+ }
25
+ }
@@ -98,7 +98,7 @@
98
98
  --_radius-len: var(--_radius-resolved, var(--ui-input-radius));
99
99
  --_radius-num: var(--_radius-resolved, var(--ui-input-radius));
100
100
  border-radius: calc(
101
- var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
101
+ var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
102
102
  );
103
103
  corner-shape: var(--_corner-shape-resolved, var(--ui-input-corner-shape));
104
104
 
@@ -170,7 +170,6 @@
170
170
  /* Native date/time controls keep their picker indicator tinted to the text */
171
171
  :where([data-ui~="input"])::-webkit-calendar-picker-indicator {
172
172
  cursor: pointer;
173
- -webkit-appearance: none;
174
173
 
175
174
  margin: 0;
176
175
  padding: 0;
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "input",
3
+ "summary": "input.css — Text input ([data-ui~=\"input\"])",
4
+ "identities": [
5
+ "input"
6
+ ],
7
+ "tags": [],
8
+ "hooks": {
9
+ "Box Model & Sizing": {
10
+ "--ui-input-calendar-picker-icon-size": "calc(var(--spacing) * 4)",
11
+ "--ui-input-calendar-picker-size": "calc(var(--spacing) * 6)",
12
+ "--ui-input-min-w": "16ch",
13
+ "--ui-input-pl": "var(--ui-field-px)",
14
+ "--ui-input-pr": "var(--ui-field-px)",
15
+ "--ui-input-py": "var(--ui-field-py)",
16
+ "--ui-input-w": "100%"
17
+ },
18
+ "Typography": {
19
+ "--ui-input-font-size": "var(--ui-field-font-size)",
20
+ "--ui-input-leading": "var(--ui-field-leading)"
21
+ },
22
+ "Color & Backgrounds": {
23
+ "--ui-input-calendar-picker-color": "currentColor"
24
+ },
25
+ "Borders & Outlines": {
26
+ "--ui-input-border-color": "var(--ui-field-border-color)",
27
+ "--ui-input-border-style": "var(--ui-field-border-style)",
28
+ "--ui-input-border-width": "var(--ui-field-border-width)",
29
+ "--ui-input-calendar-picker-corner-shape": "var(--ui-field-corner-shape)",
30
+ "--ui-input-calendar-picker-radius": "var(--ui-field-inset-radius)",
31
+ "--ui-input-corner-shape": "var(--ui-field-corner-shape)",
32
+ "--ui-input-radius": "var(--ui-field-radius)"
33
+ },
34
+ "Visual Effects": {
35
+ "--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\")"
36
+ }
37
+ },
38
+ "attributes": {},
39
+ "slots": {},
40
+ "states": {},
41
+ "requires": [
42
+ "fields"
43
+ ],
44
+ "files": {
45
+ "css": [
46
+ "primitives/input/input.css"
47
+ ],
48
+ "js": [],
49
+ "base": [],
50
+ "examples": [
51
+ "primitives/input/input.html",
52
+ "primitives/input/input-icon-leading.html",
53
+ "primitives/input/input-icon-trailing.html"
54
+ ]
55
+ }
56
+ }
@@ -19,7 +19,7 @@
19
19
  data-password-group-slot="toggle"
20
20
  id="f-login-password-toggle"
21
21
  data-button-variant="ghost"
22
- data-button-size="icon-sm"
22
+ data-button-size="icon"
23
23
  type="button"
24
24
  aria-pressed="false"
25
25
  aria-label="Show password"
@@ -7,6 +7,9 @@
7
7
  * @uses :focus-within — lifts shell ring/border as one field
8
8
  * @uses --_touch-min (touch screens) — the shell and its addons grow to the touch floor,
9
9
  * and the input's inline sides gain half of what the height grew
10
+ * @uses --ui-button-* / --ui-toggle-* hooks — a button or toggle in an addon takes its
11
+ * size from the shell (no size preset; "icon" stays square); on a touch screen
12
+ * it keeps its box and an ::after hit area takes the floor
10
13
  * @uses :has() — restore padding when addons absent; invalid text color
11
14
  * @uses data-input-group-align on the addon slot — inline-start/end, block-start/end
12
15
  * @uses corner-shape — superellipse corners; unsupported browsers keep plain
@@ -90,7 +93,7 @@
90
93
  --_radius-len: var(--_radius-resolved, var(--ui-field-radius));
91
94
  --_radius-num: var(--_radius-resolved, var(--ui-field-radius));
92
95
  border-radius: calc(
93
- var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-multiplier)
96
+ var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
94
97
  );
95
98
  corner-shape: var(--_corner-shape-resolved, var(--ui-field-corner-shape));
96
99
 
@@ -247,11 +250,37 @@
247
250
  block-size: var(--ui-field-icon-size);
248
251
  }
249
252
 
250
- /* Buttons embedded in a group shrink to nest cleanly inside the shell */
251
- :where([data-ui~="input-group"]) [data-ui~="button"] {
253
+ /* A button or toggle in an addon takes its size from the shell: it sits
254
+ --ui-field-inset-p inside the border (an addon is --ui-field-h tall), so it never
255
+ makes the group taller and needs no size preset; an icon-only one keeps "icon"
256
+ and comes out square. The hooks go on the control itself, so a popover or dialog
257
+ opened from the addon (a menu's items) keeps its own sizes. */
258
+ :where([data-ui~="input-group"] [data-input-group-slot~="addon"])
259
+ :is([data-ui~="button"], [data-ui~="toggle"]):not(:where([popover], dialog) *) {
260
+ --ui-button-min-h: calc(var(--ui-field-h) - 2 * var(--ui-field-inset-p));
261
+ --ui-button-py: 0px;
262
+ --ui-button-px: calc(var(--spacing) * 2);
263
+ --ui-button-font-size: var(--font-size-xs);
264
+ --ui-button-icon-size: calc(var(--spacing) * 3.5);
265
+ --ui-toggle-min-h: var(--ui-button-min-h);
266
+ --ui-toggle-py: var(--ui-button-py);
267
+ --ui-toggle-px: var(--ui-button-px);
268
+ --ui-toggle-font-size: var(--ui-button-font-size);
269
+ --ui-toggle-icon-size: var(--ui-button-icon-size);
270
+
252
271
  flex-shrink: 0;
253
272
  border-radius: var(--ui-field-inset-radius);
254
273
  corner-shape: var(--ui-field-corner-shape);
274
+ /* the box stays inside the shell on a touch screen; ::after takes the floor */
275
+ --_touch-floor: 0px;
276
+ position: relative;
277
+ }
278
+
279
+ :where([data-ui~="input-group"] [data-input-group-slot~="addon"])
280
+ :is([data-ui~="button"], [data-ui~="toggle"]):not(:where([popover], dialog) *)::after {
281
+ content: "";
282
+ position: absolute;
283
+ inset: min(0px, calc((100% - var(--_touch-min)) / 2));
255
284
  }
256
285
 
257
286
  :where([data-ui~="field"]:has(:user-invalid))