@zazz-ui/core 0.1.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 (260) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +61 -0
  4. package/dist/sri.json +75 -0
  5. package/dist/zazz.css +1 -0
  6. package/dist/zazz.js +1 -0
  7. package/examples/about.html +590 -0
  8. package/examples/components.html +1040 -0
  9. package/examples/forms.html +511 -0
  10. package/examples/index.html +268 -0
  11. package/examples/layout.html +320 -0
  12. package/examples/products.html +846 -0
  13. package/examples/responsive.html +339 -0
  14. package/package.json +85 -0
  15. package/src/base/_layers.css +12 -0
  16. package/src/base/_layout.css +568 -0
  17. package/src/base/_reset.css +515 -0
  18. package/src/base/_typography.css +495 -0
  19. package/src/base/_utilities.css +6628 -0
  20. package/src/base/_variables.css +682 -0
  21. package/src/base/_view-transitions.css +103 -0
  22. package/src/base/command-score.d.ts +12 -0
  23. package/src/base/command-score.d.ts.map +1 -0
  24. package/src/base/command-score.js +151 -0
  25. package/src/base/command-score.ts +192 -0
  26. package/src/base/dialog-lifecycle.d.ts +11 -0
  27. package/src/base/dialog-lifecycle.d.ts.map +1 -0
  28. package/src/base/dialog-lifecycle.js +65 -0
  29. package/src/base/dialog-lifecycle.ts +80 -0
  30. package/src/base/embla.d.ts +90 -0
  31. package/src/base/embla.d.ts.map +1 -0
  32. package/src/base/embla.js +643 -0
  33. package/src/base/embla.ts +791 -0
  34. package/src/base/hotkeys.d.ts +82 -0
  35. package/src/base/hotkeys.d.ts.map +1 -0
  36. package/src/base/hotkeys.js +141 -0
  37. package/src/base/hotkeys.ts +195 -0
  38. package/src/base/navigation.d.ts +2 -0
  39. package/src/base/navigation.d.ts.map +1 -0
  40. package/src/base/navigation.js +136 -0
  41. package/src/base/navigation.ts +151 -0
  42. package/src/base/reveal.d.ts +80 -0
  43. package/src/base/reveal.d.ts.map +1 -0
  44. package/src/base/reveal.js +305 -0
  45. package/src/base/reveal.ts +379 -0
  46. package/src/base/signals.d.ts +89 -0
  47. package/src/base/signals.d.ts.map +1 -0
  48. package/src/base/signals.js +134 -0
  49. package/src/base/signals.ts +164 -0
  50. package/src/base/typeahead.d.ts +105 -0
  51. package/src/base/typeahead.d.ts.map +1 -0
  52. package/src/base/typeahead.js +411 -0
  53. package/src/base/typeahead.ts +500 -0
  54. package/src/base/utils.d.ts +56 -0
  55. package/src/base/utils.d.ts.map +1 -0
  56. package/src/base/utils.js +88 -0
  57. package/src/base/utils.ts +98 -0
  58. package/src/base/zazz-element.d.ts +44 -0
  59. package/src/base/zazz-element.d.ts.map +1 -0
  60. package/src/base/zazz-element.js +59 -0
  61. package/src/base/zazz-element.ts +73 -0
  62. package/src/globals.d.ts +148 -0
  63. package/src/head.d.ts +95 -0
  64. package/src/head.d.ts.map +1 -0
  65. package/src/head.js +311 -0
  66. package/src/head.ts +433 -0
  67. package/src/index.css +71 -0
  68. package/src/index.d.ts +36 -0
  69. package/src/index.d.ts.map +1 -0
  70. package/src/index.js +35 -0
  71. package/src/index.ts +36 -0
  72. package/src/manifest.d.ts +90 -0
  73. package/src/manifest.d.ts.map +1 -0
  74. package/src/manifest.js +614 -0
  75. package/src/manifest.ts +667 -0
  76. package/src/primitives/accordion/accordion.css +104 -0
  77. package/src/primitives/accordion/accordion.html +69 -0
  78. package/src/primitives/alert-dialog/alert-dialog.css +38 -0
  79. package/src/primitives/alert-dialog/alert-dialog.html +53 -0
  80. package/src/primitives/autocomplete/autocomplete-groups.html +77 -0
  81. package/src/primitives/autocomplete/autocomplete.css +114 -0
  82. package/src/primitives/autocomplete/autocomplete.d.ts +30 -0
  83. package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -0
  84. package/src/primitives/autocomplete/autocomplete.html +66 -0
  85. package/src/primitives/autocomplete/autocomplete.js +41 -0
  86. package/src/primitives/autocomplete/autocomplete.ts +46 -0
  87. package/src/primitives/avatar/avatar.html +44 -0
  88. package/src/primitives/badge/badge-icon.html +36 -0
  89. package/src/primitives/badge/badge.css +251 -0
  90. package/src/primitives/badge/badge.html +7 -0
  91. package/src/primitives/breadcrumbs/breadcrumbs.html +9 -0
  92. package/src/primitives/button/button-icon-only.html +84 -0
  93. package/src/primitives/button/button-icon.html +82 -0
  94. package/src/primitives/button/button.css +319 -0
  95. package/src/primitives/button/button.html +8 -0
  96. package/src/primitives/button-group/button-group-vertical.html +6 -0
  97. package/src/primitives/button-group/button-group.css +94 -0
  98. package/src/primitives/button-group/button-group.html +64 -0
  99. package/src/primitives/card/card-subgrid.html +118 -0
  100. package/src/primitives/card/card.html +53 -0
  101. package/src/primitives/carousel/carousel.css +61 -0
  102. package/src/primitives/carousel/carousel.d.ts +16 -0
  103. package/src/primitives/carousel/carousel.d.ts.map +1 -0
  104. package/src/primitives/carousel/carousel.html +315 -0
  105. package/src/primitives/carousel/carousel.js +73 -0
  106. package/src/primitives/carousel/carousel.ts +84 -0
  107. package/src/primitives/checkbox/checkbox-tasklist.html +71 -0
  108. package/src/primitives/checkbox/checkbox.css +82 -0
  109. package/src/primitives/checkbox/checkbox.d.ts +21 -0
  110. package/src/primitives/checkbox/checkbox.d.ts.map +1 -0
  111. package/src/primitives/checkbox/checkbox.html +17 -0
  112. package/src/primitives/checkbox/checkbox.js +190 -0
  113. package/src/primitives/checkbox/checkbox.ts +219 -0
  114. package/src/primitives/combobox/combobox-multiselect.html +91 -0
  115. package/src/primitives/combobox/combobox.css +307 -0
  116. package/src/primitives/combobox/combobox.d.ts +100 -0
  117. package/src/primitives/combobox/combobox.d.ts.map +1 -0
  118. package/src/primitives/combobox/combobox.html +73 -0
  119. package/src/primitives/combobox/combobox.js +503 -0
  120. package/src/primitives/combobox/combobox.ts +559 -0
  121. package/src/primitives/command/command-actions.d.ts +31 -0
  122. package/src/primitives/command/command-actions.d.ts.map +1 -0
  123. package/src/primitives/command/command-actions.html +89 -0
  124. package/src/primitives/command/command-actions.js +70 -0
  125. package/src/primitives/command/command-actions.ts +77 -0
  126. package/src/primitives/command/command-dialog.html +77 -0
  127. package/src/primitives/command/command.css +151 -0
  128. package/src/primitives/command/command.d.ts +52 -0
  129. package/src/primitives/command/command.d.ts.map +1 -0
  130. package/src/primitives/command/command.html +119 -0
  131. package/src/primitives/command/command.js +146 -0
  132. package/src/primitives/command/command.ts +157 -0
  133. package/src/primitives/dialog/dialog-with-form.html +200 -0
  134. package/src/primitives/dialog/dialog.css +229 -0
  135. package/src/primitives/dialog/dialog.html +90 -0
  136. package/src/primitives/fields/fields.css +278 -0
  137. package/src/primitives/input/input-icon-leading.html +19 -0
  138. package/src/primitives/input/input-icon-trailing.html +18 -0
  139. package/src/primitives/input/input.css +114 -0
  140. package/src/primitives/input/input.html +61 -0
  141. package/src/primitives/input-group/input-group-password-group.html +108 -0
  142. package/src/primitives/input-group/input-group.css +215 -0
  143. package/src/primitives/input-group/input-group.html +132 -0
  144. package/src/primitives/kbd/kbd-group.html +18 -0
  145. package/src/primitives/kbd/kbd.css +87 -0
  146. package/src/primitives/kbd/kbd.html +7 -0
  147. package/src/primitives/lightbox/lightbox.css +459 -0
  148. package/src/primitives/lightbox/lightbox.d.ts +7 -0
  149. package/src/primitives/lightbox/lightbox.d.ts.map +1 -0
  150. package/src/primitives/lightbox/lightbox.html +665 -0
  151. package/src/primitives/lightbox/lightbox.js +96 -0
  152. package/src/primitives/lightbox/lightbox.ts +113 -0
  153. package/src/primitives/menu/menu-interest.html +52 -0
  154. package/src/primitives/menu/menu.css +55 -0
  155. package/src/primitives/menu/menu.d.ts +38 -0
  156. package/src/primitives/menu/menu.d.ts.map +1 -0
  157. package/src/primitives/menu/menu.html +70 -0
  158. package/src/primitives/menu/menu.js +117 -0
  159. package/src/primitives/menu/menu.ts +131 -0
  160. package/src/primitives/menubar/menubar-help-search.html +103 -0
  161. package/src/primitives/menubar/menubar.html +166 -0
  162. package/src/primitives/meter/meter.css +178 -0
  163. package/src/primitives/meter/meter.html +38 -0
  164. package/src/primitives/mobile-menu/mobile-menu.css +145 -0
  165. package/src/primitives/mobile-menu/mobile-menu.html +614 -0
  166. package/src/primitives/navigation-menu/navigation-menu-featured.html +76 -0
  167. package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +158 -0
  168. package/src/primitives/navigation-menu/navigation-menu-interest.html +103 -0
  169. package/src/primitives/navigation-menu/navigation-menu-megamenu.html +141 -0
  170. package/src/primitives/navigation-menu/navigation-menu-simple.html +96 -0
  171. package/src/primitives/navigation-menu/navigation-menu.css +295 -0
  172. package/src/primitives/navigation-menu/navigation-menu.html +576 -0
  173. package/src/primitives/otp/otp.css +126 -0
  174. package/src/primitives/otp/otp.d.ts +89 -0
  175. package/src/primitives/otp/otp.d.ts.map +1 -0
  176. package/src/primitives/otp/otp.html +22 -0
  177. package/src/primitives/otp/otp.js +226 -0
  178. package/src/primitives/otp/otp.ts +279 -0
  179. package/src/primitives/password-group/password-group.css +238 -0
  180. package/src/primitives/password-group/password-group.d.ts +25 -0
  181. package/src/primitives/password-group/password-group.d.ts.map +1 -0
  182. package/src/primitives/password-group/password-group.html +109 -0
  183. package/src/primitives/password-group/password-group.js +76 -0
  184. package/src/primitives/password-group/password-group.ts +95 -0
  185. package/src/primitives/popover/popover.css +233 -0
  186. package/src/primitives/progress/progress-indeterminate.html +1 -0
  187. package/src/primitives/progress/progress.css +105 -0
  188. package/src/primitives/progress/progress.html +7 -0
  189. package/src/primitives/prose/prose.html +65 -0
  190. package/src/primitives/radio/radio.css +84 -0
  191. package/src/primitives/radio/radio.html +17 -0
  192. package/src/primitives/reveal/reveal.css +167 -0
  193. package/src/primitives/select/multiselect.d.ts +43 -0
  194. package/src/primitives/select/multiselect.d.ts.map +1 -0
  195. package/src/primitives/select/multiselect.js +147 -0
  196. package/src/primitives/select/multiselect.ts +188 -0
  197. package/src/primitives/select/select-align.html +49 -0
  198. package/src/primitives/select/select-multiple.html +12 -0
  199. package/src/primitives/select/select-sides.html +65 -0
  200. package/src/primitives/select/select.css +481 -0
  201. package/src/primitives/select/select.html +16 -0
  202. package/src/primitives/separator/separator.css +49 -0
  203. package/src/primitives/separator/separator.html +16 -0
  204. package/src/primitives/slider/slider.css +122 -0
  205. package/src/primitives/slider/slider.html +1 -0
  206. package/src/primitives/switch/switch.css +126 -0
  207. package/src/primitives/switch/switch.html +13 -0
  208. package/src/primitives/table/table-alternating.html +36 -0
  209. package/src/primitives/table/table-grid.html +30 -0
  210. package/src/primitives/table/table-size-sm.html +26 -0
  211. package/src/primitives/table/table.css +158 -0
  212. package/src/primitives/table/table.html +45 -0
  213. package/src/primitives/tabs/tabs.css +328 -0
  214. package/src/primitives/tabs/tabs.d.ts +35 -0
  215. package/src/primitives/tabs/tabs.d.ts.map +1 -0
  216. package/src/primitives/tabs/tabs.html +75 -0
  217. package/src/primitives/tabs/tabs.js +84 -0
  218. package/src/primitives/tabs/tabs.ts +93 -0
  219. package/src/primitives/textarea/textarea.css +78 -0
  220. package/src/primitives/textarea/textarea.html +10 -0
  221. package/src/primitives/toaster/toaster.css +309 -0
  222. package/src/primitives/toaster/toaster.d.ts +138 -0
  223. package/src/primitives/toaster/toaster.d.ts.map +1 -0
  224. package/src/primitives/toaster/toaster.html +77 -0
  225. package/src/primitives/toaster/toaster.js +736 -0
  226. package/src/primitives/toaster/toaster.ts +823 -0
  227. package/src/primitives/toggle/toggle.css +295 -0
  228. package/src/primitives/toggle/toggle.html +68 -0
  229. package/src/primitives/toggle-group/toggle-group-multiple.html +14 -0
  230. package/src/primitives/toggle-group/toggle-group-vertical.html +14 -0
  231. package/src/primitives/toggle-group/toggle-group.css +73 -0
  232. package/src/primitives/toggle-group/toggle-group.html +53 -0
  233. package/src/primitives/toolbar/toolbar.html +45 -0
  234. package/src/primitives/tooltip/tooltip-disabled.html +19 -0
  235. package/src/primitives/tooltip/tooltip-sides.html +57 -0
  236. package/src/primitives/tooltip/tooltip-with-kbd.html +31 -0
  237. package/src/primitives/tooltip/tooltip.css +235 -0
  238. package/src/primitives/tooltip/tooltip.html +12 -0
  239. package/src/primitives/utilities/aspect-ratio.html +17 -0
  240. package/src/primitives/utilities/basis.html +27 -0
  241. package/src/primitives/utilities/col-span.html +23 -0
  242. package/src/primitives/utilities/compose.html +19 -0
  243. package/src/primitives/utilities/flex-align.html +26 -0
  244. package/src/primitives/utilities/flex-direction.html +36 -0
  245. package/src/primitives/utilities/flex-grow.html +17 -0
  246. package/src/primitives/utilities/gap.html +62 -0
  247. package/src/primitives/utilities/grid-cols.html +20 -0
  248. package/src/primitives/utilities/grid-pile.html +5 -0
  249. package/src/primitives/utilities/grid-responsive.html +31 -0
  250. package/src/primitives/utilities/margin-auto.html +13 -0
  251. package/src/primitives/utilities/object-fit.html +41 -0
  252. package/src/primitives/utilities/order.html +17 -0
  253. package/src/primitives/utilities/overflow.html +26 -0
  254. package/src/primitives/utilities/padding-compose.html +23 -0
  255. package/src/primitives/utilities/padding.html +30 -0
  256. package/src/primitives/utilities/position.html +13 -0
  257. package/src/primitives/utilities/responsive-flex.html +22 -0
  258. package/src/primitives/utilities/responsive-grid.html +31 -0
  259. package/src/primitives/utilities/size.html +22 -0
  260. package/src/primitives/utilities/width.html +22 -0
@@ -0,0 +1,65 @@
1
+ <div class="grid grid-cols-2 gap-sm place-items-center">
2
+ <div class="ui-field">
3
+ <label data-slot="field-label" for="f-side-top">Top</label>
4
+ <select class="ui-select" id="f-side-top" name="side-top" data-side="top">
5
+ <button>
6
+ <selectedcontent></selectedcontent>
7
+ </button>
8
+ <optgroup class="grid gap-px" label="Sort by">
9
+ <legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
10
+ <option value="recent" selected>Most recent</option>
11
+ <option value="popular">Most popular</option>
12
+ <option value="price-asc">Price: low to high</option>
13
+ <option value="price-desc">Price: high to low</option>
14
+ </optgroup>
15
+ </select>
16
+ </div>
17
+
18
+ <div class="ui-field">
19
+ <label data-slot="field-label" for="f-side-bottom">Bottom</label>
20
+ <select class="ui-select" id="f-side-bottom" name="side-bottom" data-side="bottom">
21
+ <button>
22
+ <selectedcontent></selectedcontent>
23
+ </button>
24
+ <optgroup class="grid gap-px" label="Sort by">
25
+ <legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
26
+ <option value="recent" selected>Most recent</option>
27
+ <option value="popular">Most popular</option>
28
+ <option value="price-asc">Price: low to high</option>
29
+ <option value="price-desc">Price: high to low</option>
30
+ </optgroup>
31
+ </select>
32
+ </div>
33
+
34
+ <div class="ui-field">
35
+ <label data-slot="field-label" for="f-side-left">Left</label>
36
+ <select class="ui-select" id="f-side-left" name="side-left" data-side="left">
37
+ <button>
38
+ <selectedcontent></selectedcontent>
39
+ </button>
40
+ <optgroup class="grid gap-px" label="Sort by">
41
+ <legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
42
+ <option value="recent" selected>Most recent</option>
43
+ <option value="popular">Most popular</option>
44
+ <option value="price-asc">Price: low to high</option>
45
+ <option value="price-desc">Price: high to low</option>
46
+ </optgroup>
47
+ </select>
48
+ </div>
49
+
50
+ <div class="ui-field">
51
+ <label data-slot="field-label" for="f-side-right">Right</label>
52
+ <select class="ui-select" id="f-side-right" name="side-right" data-side="right">
53
+ <button>
54
+ <selectedcontent></selectedcontent>
55
+ </button>
56
+ <optgroup class="grid gap-px" label="Sort by">
57
+ <legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
58
+ <option value="recent" selected>Most recent</option>
59
+ <option value="popular">Most popular</option>
60
+ <option value="price-asc">Price: low to high</option>
61
+ <option value="price-desc">Price: high to low</option>
62
+ </optgroup>
63
+ </select>
64
+ </div>
65
+ </div>
@@ -0,0 +1,481 @@
1
+ /**
2
+ * select.css: Select (.ui-select on customizable <select>)
3
+ *
4
+ * @layer variables, reset, components
5
+ * @requires layers.css, _variables.css, fields.css, _reset.css, popover.css (--ui-popover-*), button.css (--ui-button-*)
6
+ * @uses appearance: base-select: customizable select (Chromium 135+ / Safari 17+)
7
+ * @uses ::picker(select), ::picker-icon, selectedcontent, option::checkmark
8
+ * @uses @starting-style + allow-discrete: picker open animation
9
+ * @uses anchor-size(width): match picker width to trigger (@supports gated)
10
+ * @uses position-area, position-try-fallbacks: placement tokens come from
11
+ * popover.css's shared matrix (@supports gated)
12
+ * @uses backdrop-filter: picker surface blur (shared with [popover])
13
+ * @uses Degrades to native OS dropdown where base-select is unsupported
14
+ * @uses ui-multiselect (multiselect.ts): JS-projected dropdown for
15
+ * <select multiple>; base-select has no stable multi-select yet, so
16
+ * this is a recorded exception like base-select itself. Degrades to
17
+ * the native multi listbox without JS; retire the enhancement when
18
+ * base-select-for-multiple ships stable.
19
+ * @tokens --ui-select-* (@layer variables); picker panel reuses --ui-popover-* (owned in popover.css)
20
+ * @consumedby autocomplete.css, combobox.css, command.css (--ui-option-*, --ui-select-picker-icon-*)
21
+ */
22
+
23
+ @layer variables {
24
+ :root {
25
+ /* Box treatment: alias the shared --ui-field-* family (owned in fields.css) so
26
+ a select, a text input, and a textarea read as one family. Retune a
27
+ --ui-field-* token and every control follows; remap a --ui-select-* token to
28
+ diverge just the select. */
29
+ --ui-select-inline-size: 100%;
30
+ --ui-select-min-inline-size: 16ch;
31
+ --ui-select-padding-inline-start: var(--ui-field-padding);
32
+ /* Trailing space differs from .ui-input: room for the picker icon */
33
+ --ui-select-padding-inline-end: var(--step-2);
34
+ --ui-select-font-size: var(--ui-field-font-size);
35
+ --ui-select-line-height: var(--ui-field-line-height);
36
+ --ui-select-border: 1px solid var(--ui-field-border);
37
+ --ui-select-border-radius: var(--ui-field-radius);
38
+ --ui-select-option-gap: var(--ui-field-option-gap);
39
+
40
+ /* Picker icon (trigger chevron)
41
+ ** @see https://www.svgbackgrounds.com/tools/svg-to-css/
42
+ ** Set to Legacy / URL Wrapper to update icon */
43
+ --ui-select-picker-icon-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%3Cpolyline points='80 176 128 224 176 176' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cpolyline points='80 80 128 32 176 80' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
44
+ --ui-select-picker-icon-size: var(--ui-field-icon-size);
45
+ --ui-select-picker-icon-color: currentColor;
46
+
47
+ /* Option (menu item): a ghost button rendered as a native <option>. Alias
48
+ the --ui-button-* family (owned in button.css) so a select's options and a
49
+ menu's ghost items read as one; retune a --ui-button-* token and both
50
+ follow. The ghost look is base button minus the surface fill + border, so
51
+ only --ui-option-background/--ui-option-border diverge. Radius bridges to the
52
+ shared --ui-menu-button-radius. */
53
+ --ui-option-font-family: var(--ui-button-font-family);
54
+ --ui-option-font-size: var(--ui-button-font-size);
55
+ --ui-option-font-weight: var(--ui-button-font-weight);
56
+ --ui-option-line-height: var(--ui-button-line-height);
57
+ --ui-option-gap: var(--ui-button-gap);
58
+ --ui-option-padding: var(--ui-button-padding);
59
+ --ui-option-height: var(--ui-button-height);
60
+ --ui-option-icon-size: var(--ui-button-icon-size);
61
+ --ui-option-radius: var(--ui-menu-button-radius);
62
+ --ui-option-shadow: none;
63
+
64
+ --ui-option-background: transparent;
65
+ --ui-option-background--hover: var(--ui-button-background--hover);
66
+ --ui-option-background--active: var(--ui-button-background--active);
67
+ --ui-option-foreground: var(--ui-button-foreground);
68
+ --ui-option-foreground--hover: var(--ui-button-foreground--hover);
69
+ --ui-option-foreground--active: var(--ui-button-foreground--active);
70
+ --ui-option-border: 1px solid transparent;
71
+ --ui-option-border--hover: 1px solid transparent;
72
+ --ui-option-border--active: 1px solid transparent;
73
+
74
+ /* Option checkmark
75
+ ** @see https://www.svgbackgrounds.com/tools/svg-to-css/
76
+ ** Set to Legacy / URL Wrapper to update icon */
77
+ --ui-option-checkmark-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%3Cpolyline points='40 144 96 200 224 72' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
78
+ --ui-option-checkmark-size: var(--ui-field-icon-size);
79
+ --ui-option-checkmark-color: currentColor;
80
+ }
81
+ }
82
+
83
+ @layer reset {
84
+ /* ===========================================================================
85
+ SELECT: native <select> internals (::picker, <option>, ::picker-icon)
86
+ - In the reset layer so component overrides win; the plain appearance reset
87
+ stays in _reset.css.
88
+ - Both the select and ::picker(select) need appearance: base-select before
89
+ picker pseudo styles apply (MDN customizable select).
90
+ =========================================================================== */
91
+
92
+ :where(.ui-select),
93
+ :where(.ui-select)::picker(select) {
94
+ appearance: base-select;
95
+ }
96
+
97
+ :where(.ui-select)::picker(select) {
98
+ transform-origin: var(--ui-popover-origin);
99
+ opacity: var(--ui-popover-opacity--start);
100
+ backdrop-filter: var(--ui-popover-backdrop-filter);
101
+ transform: scale(var(--ui-popover-scale--start)) translate3d(var(--ui-popover-translate--start));
102
+
103
+ transition:
104
+ opacity var(--default-transition-duration) var(--default-transition-timing-function),
105
+ transform var(--default-transition-duration) var(--default-transition-timing-function),
106
+ padding var(--default-transition-duration) var(--default-transition-timing-function),
107
+ block-size var(--default-transition-duration) var(--default-transition-timing-function),
108
+ inline-size var(--default-transition-duration) var(--default-transition-timing-function),
109
+ overlay var(--default-transition-duration) var(--default-transition-timing-function)
110
+ allow-discrete,
111
+ display var(--default-transition-duration) var(--default-transition-timing-function)
112
+ allow-discrete;
113
+ }
114
+
115
+ :where(.ui-select:open)::picker(select) {
116
+ opacity: var(--ui-popover-opacity--end);
117
+ transform: scale(var(--ui-popover-scale--end)) translate3d(var(--ui-popover-translate--end));
118
+ display: flex;
119
+ }
120
+
121
+ @starting-style {
122
+ :where(.ui-select:open)::picker(select) {
123
+ opacity: var(--ui-popover-opacity--start);
124
+ transform: scale(var(--ui-popover-scale--start))
125
+ translate3d(var(--ui-popover-translate--start));
126
+ }
127
+ }
128
+
129
+ :where(option)::checkmark {
130
+ content: "";
131
+ inline-size: var(--ui-option-checkmark-size);
132
+ block-size: var(--ui-option-checkmark-size);
133
+ background-color: var(--ui-option-checkmark-color);
134
+ mask: var(--ui-option-checkmark-mask) center / contain no-repeat;
135
+ }
136
+
137
+ :where(.ui-select)::picker-icon {
138
+ content: "";
139
+ inline-size: var(--ui-select-picker-icon-size);
140
+ block-size: var(--ui-select-picker-icon-size);
141
+ background-color: var(--ui-select-picker-icon-color);
142
+ mask: var(--ui-select-picker-icon-mask) center / contain no-repeat;
143
+ }
144
+ }
145
+
146
+ @layer zazz.components {
147
+ /* ===========================================================================
148
+ SELECT: .ui-select (customizable <select>, no JS)
149
+ - appearance: base-select themes the trigger, picker, options, and arrow while
150
+ the browser keeps keyboard nav, top-layer rendering, and form integration.
151
+ - Needs a <button><selectedcontent></selectedcontent></button> child. Degrades
152
+ to the native OS dropdown where unsupported (the _reset.css chevron covers it).
153
+ - Shares the --ui-field-* tokens defined in fields.css.
154
+ =========================================================================== */
155
+
156
+ .ui-select {
157
+ display: flex;
158
+ align-items: center;
159
+ justify-content: space-between;
160
+ gap: var(--ui-select-option-gap);
161
+
162
+ inline-size: var(--ui-select-inline-size);
163
+ min-inline-size: var(--ui-select-min-inline-size);
164
+ block-size: var(--ui-field-height);
165
+ padding-inline: var(--ui-select-padding-inline-start) var(--ui-select-padding-inline-end);
166
+
167
+ font-size: var(--ui-select-font-size);
168
+ line-height: var(--ui-select-line-height);
169
+ text-align: start;
170
+ color: var(--ui-field-foreground);
171
+ background-color: var(--ui-field-background);
172
+ background-image: none;
173
+
174
+ border: var(--ui-select-border);
175
+ border-radius: var(--ui-select-border-radius);
176
+ cursor: pointer;
177
+
178
+ /* ring renders as box-shadow; transparent outline twin keeps focus visible
179
+ in forced-colors / high-contrast modes */
180
+ --_ring-offset-width: 0px;
181
+ --_ring-width: 0px;
182
+ --_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
183
+ box-shadow:
184
+ 0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
185
+ 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width)) var(--_ring, var(--ring));
186
+ outline: var(--outline-width) var(--outline-style) transparent;
187
+ outline-offset: var(--outline-offset);
188
+
189
+ transition: var(--default-transition);
190
+ }
191
+
192
+ .ui-select:hover {
193
+ border-color: var(--ui-field-border--hover);
194
+ }
195
+
196
+ .ui-select:focus-visible,
197
+ .ui-select:open {
198
+ border-color: var(--ui-field-border--focus);
199
+ --_ring-offset-width: var(--ring-offset-width);
200
+ --_ring-width: var(--ring-width);
201
+ outline-color: transparent;
202
+ }
203
+
204
+ /* Trigger button child holds the (optional) leading icon + mirrored value */
205
+ .ui-select > button {
206
+ block-size: 100%;
207
+ display: flex;
208
+ flex: 1;
209
+ align-items: center;
210
+ gap: var(--ui-field-gap);
211
+ min-inline-size: 0;
212
+ overflow: hidden;
213
+ }
214
+
215
+ .ui-select selectedcontent {
216
+ display: flex;
217
+ align-items: center;
218
+ block-size: 100%;
219
+ overflow: hidden;
220
+ text-overflow: ellipsis;
221
+ white-space: nowrap;
222
+ }
223
+
224
+ /* Trigger icons (leading glyph + mirrored value) size to the field icon */
225
+ .ui-select > button > svg,
226
+ .ui-select selectedcontent > svg {
227
+ flex-shrink: 0;
228
+ inline-size: var(--ui-field-icon-size);
229
+ block-size: var(--ui-field-icon-size);
230
+ color: var(--muted-foreground);
231
+ }
232
+
233
+ .ui-select:open {
234
+ background-color: var(--ui-field-background--focus);
235
+ }
236
+
237
+ .ui-select:open::picker-icon {
238
+ transform: rotate(-180deg);
239
+ }
240
+
241
+ /* Dropdown panel: the shared [popover] surface (--ui-popover-* family), anchored
242
+ to the trigger. anchor-size() matches the panel to the trigger width; it is anchor-related,
243
+ so it is gated. The fallback (max-content) only matters in the narrow case
244
+ of a browser that supports customizable <select> (::picker) but not
245
+ anchor-size, where the panel sizes to its content instead of stretching. */
246
+ .ui-select::picker(select) {
247
+ flex-direction: column;
248
+ gap: var(--step-px);
249
+ inline-size: max-content;
250
+ max-inline-size: var(--ui-popover-max-inline-size);
251
+ padding: var(--ui-popover-padding);
252
+ margin-block: var(--ui-popover-margin-block);
253
+ overflow: clip;
254
+
255
+ background-color: var(--popover);
256
+ color: var(--popover-foreground);
257
+ border: 1px solid var(--ui-popover-border);
258
+ border-radius: var(--ui-popover-radius);
259
+ box-shadow: var(--ui-popover-shadow);
260
+ }
261
+
262
+ @supports (inline-size: anchor-size(width)) {
263
+ .ui-select::picker(select) {
264
+ min-inline-size: anchor-size(width);
265
+ }
266
+ }
267
+
268
+ /* ===========================================================================
269
+ PICKER PLACEMENT: the shared matrix in popover.css owns data-side x data-align
270
+ (it includes .ui-select, and custom properties set on the select inherit into
271
+ ::picker(select)). Only the application of those tokens lives here, because
272
+ position-area is gated on anchor support.
273
+ =========================================================================== */
274
+
275
+ /* The picker is implicitly anchored to the select, so position-area needs no
276
+ anchor-name; but it is still anchor positioning, gated like popover.css so
277
+ browsers without it (Firefox/Safari) keep the UA picker placement instead of
278
+ a mispositioned box. */
279
+ @supports (anchor-name: --zazz) {
280
+ .ui-select::picker(select) {
281
+ position-area: var(--ui-popover-position-area);
282
+ position-try-fallbacks: var(--ui-popover-position-try-fallbacks);
283
+ margin-inline: var(--ui-popover-margin-inline);
284
+ }
285
+ }
286
+
287
+ /* Options render as ghost buttons: the --ui-option-* family (set in @layer
288
+ variables) aliases the --ui-button-* ghost values, so a select's menu items and
289
+ a menu's ghost items read identically. Like .ui-button, sizing rides on
290
+ min-block-size + padding-inline (no block padding) so every row is uniform. */
291
+ .ui-select option {
292
+ display: flex;
293
+ align-items: center;
294
+ gap: var(--ui-option-gap);
295
+ min-block-size: var(--ui-option-height);
296
+ padding-inline: var(--ui-option-padding);
297
+
298
+ font-family: var(--ui-option-font-family);
299
+ font-size: var(--ui-option-font-size);
300
+ font-weight: var(--ui-option-font-weight);
301
+ line-height: var(--ui-option-line-height);
302
+
303
+ color: var(--ui-option-foreground);
304
+ background-color: var(--ui-option-background);
305
+ border: var(--ui-option-border);
306
+ border-radius: var(--ui-option-radius);
307
+ box-shadow: var(--ui-option-shadow);
308
+ cursor: pointer;
309
+
310
+ transition: var(--default-transition);
311
+ }
312
+
313
+ .ui-select option:hover {
314
+ color: var(--ui-option-foreground--hover);
315
+ background-color: var(--ui-option-background--hover);
316
+ border: var(--ui-option-border--hover);
317
+ }
318
+
319
+ .ui-select option:checked {
320
+ color: var(--ui-option-foreground--active);
321
+ background-color: var(--ui-option-background--active);
322
+ border: var(--ui-option-border--active);
323
+ }
324
+
325
+ .ui-select option:disabled {
326
+ --ui-option-foreground: var(--muted-foreground);
327
+ cursor: default;
328
+ opacity: 0.5;
329
+ }
330
+
331
+ .ui-select option > svg {
332
+ flex-shrink: 0;
333
+ inline-size: var(--ui-option-icon-size);
334
+ block-size: var(--ui-option-icon-size);
335
+ color: var(--muted-foreground);
336
+ }
337
+
338
+ .ui-select option::checkmark {
339
+ order: 1;
340
+ margin-inline-start: auto;
341
+ color: currentcolor;
342
+ }
343
+
344
+ /* ===========================================================================
345
+ MULTISELECT: ui-multiselect (JS-projected dropdown over <select multiple>)
346
+ - The script hides the real select and stamps a .ui-select-classed trigger +
347
+ a popover of checkbox rows (see multiselect.ts). Rows are ghost options
348
+ (--ui-option-*) with the shared checkmark, so single- and multi-select
349
+ pickers read identically.
350
+ - Without JS the native multi listbox renders; it gets minimal field-family
351
+ dress below rather than the single-select trigger treatment.
352
+ =========================================================================== */
353
+
354
+ :where(ui-multiselect) {
355
+ anchor-scope: --ui-multiselect-trigger;
356
+ display: block;
357
+ inline-size: var(--ui-select-inline-size);
358
+ min-inline-size: var(--ui-select-min-inline-size);
359
+ }
360
+
361
+ /* Enhanced: the real select stays in the DOM as the form value carrier */
362
+ select[multiple][data-multiselect-enhanced] {
363
+ display: none;
364
+ }
365
+
366
+ /* No-JS baseline: the native listbox wears the field surface, sized by rows */
367
+ ui-multiselect select[multiple].ui-select:not([data-multiselect-enhanced]) {
368
+ display: block;
369
+ block-size: auto;
370
+ padding-block: var(--step-1);
371
+ }
372
+
373
+ [data-slot~="multiselect-trigger"] {
374
+ anchor-name: --ui-multiselect-trigger;
375
+ }
376
+
377
+ [data-slot~="multiselect-label"] {
378
+ overflow: hidden;
379
+ text-overflow: ellipsis;
380
+ white-space: nowrap;
381
+ }
382
+
383
+ /* Chevron: the ::picker-icon treatment, rebuilt for a plain button */
384
+ [data-slot~="multiselect-icon"] {
385
+ flex-shrink: 0;
386
+ inline-size: var(--ui-select-picker-icon-size);
387
+ block-size: var(--ui-select-picker-icon-size);
388
+ background-color: var(--ui-select-picker-icon-color);
389
+ mask: var(--ui-select-picker-icon-mask) center / contain no-repeat;
390
+ transition: var(--default-transition);
391
+ }
392
+
393
+ [data-slot~="multiselect-trigger"][aria-expanded="true"] [data-slot~="multiselect-icon"] {
394
+ transform: rotate(-180deg);
395
+ }
396
+
397
+ [data-slot~="multiselect-panel"] {
398
+ position-anchor: --ui-multiselect-trigger;
399
+ /* Layout stays ungated so the close fade keeps it; only display is gated */
400
+ flex-direction: column;
401
+ gap: var(--step-px);
402
+ box-shadow: var(--ui-menu-shadow);
403
+ }
404
+
405
+ /* Only display is gated; see popover.css: closed popovers stay display: none */
406
+ [data-slot~="multiselect-panel"]:where(:popover-open, .\:popover-open) {
407
+ display: flex;
408
+ }
409
+
410
+ @supports (inline-size: anchor-size(width)) {
411
+ [data-slot~="multiselect-panel"] {
412
+ min-inline-size: anchor-size(width);
413
+ }
414
+ }
415
+
416
+ /* Rows are ghost options; the checkbox is real but visually replaced by the
417
+ shared checkmark glyph */
418
+ [data-slot~="multiselect-option"] {
419
+ display: flex;
420
+ align-items: center;
421
+ gap: var(--ui-option-gap);
422
+ min-block-size: var(--ui-option-height);
423
+ padding-inline: var(--ui-option-padding);
424
+
425
+ font-family: var(--ui-option-font-family);
426
+ font-size: var(--ui-option-font-size);
427
+ font-weight: var(--ui-option-font-weight);
428
+ line-height: var(--ui-option-line-height);
429
+
430
+ color: var(--ui-option-foreground);
431
+ background-color: var(--ui-option-background);
432
+ border: var(--ui-option-border);
433
+ border-radius: var(--ui-option-radius);
434
+ cursor: pointer;
435
+
436
+ transition: var(--default-transition);
437
+ }
438
+
439
+ [data-slot~="multiselect-option"]:hover {
440
+ color: var(--ui-option-foreground--hover);
441
+ background-color: var(--ui-option-background--hover);
442
+ }
443
+
444
+ [data-slot~="multiselect-option"]:has(:checked) {
445
+ color: var(--ui-option-foreground--active);
446
+ background-color: var(--ui-option-background--active);
447
+ }
448
+
449
+ [data-slot~="multiselect-option"]:has(:disabled) {
450
+ color: var(--muted-foreground);
451
+ cursor: default;
452
+ opacity: 0.5;
453
+ }
454
+
455
+ /* The checkbox stays focusable and announced but invisible; keyboard focus
456
+ surfaces on the row via :focus-within */
457
+ [data-slot~="multiselect-option"] input[type="checkbox"] {
458
+ position: absolute;
459
+ inline-size: 1px;
460
+ block-size: 1px;
461
+ overflow: clip;
462
+ clip-path: inset(50%);
463
+ white-space: nowrap;
464
+ }
465
+
466
+ [data-slot~="multiselect-option"]:focus-within {
467
+ background-color: var(--ui-option-background--hover);
468
+ outline: var(--outline-width) var(--outline-style) var(--ring);
469
+ outline-offset: calc(var(--outline-offset) * -1);
470
+ }
471
+
472
+ [data-slot~="multiselect-option"]:has(:checked)::after {
473
+ content: "";
474
+ order: 1;
475
+ margin-inline-start: auto;
476
+ inline-size: var(--ui-option-checkmark-size);
477
+ block-size: var(--ui-option-checkmark-size);
478
+ background-color: var(--ui-option-checkmark-color);
479
+ mask: var(--ui-option-checkmark-mask) center / contain no-repeat;
480
+ }
481
+ }
@@ -0,0 +1,16 @@
1
+ <div class="ui-field">
2
+ <label data-slot="field-label" for="f-sort">Sort by</label>
3
+ <select class="ui-select" id="f-sort" name="sort">
4
+ <button>
5
+ <selectedcontent></selectedcontent>
6
+ </button>
7
+ <!-- Keep label in optgroup as a fallback -->
8
+ <optgroup class="grid gap-px" label="Sort by">
9
+ <legend class="text-eyebrow text-muted-foreground p-xs">Sort by</legend>
10
+ <option value="recent" selected>Most recent</option>
11
+ <option value="popular">Most popular</option>
12
+ <option value="price-asc">Price: low to high</option>
13
+ <option value="price-desc">Price: high to low</option>
14
+ </optgroup>
15
+ </select>
16
+ </div>
@@ -0,0 +1,49 @@
1
+ /**
2
+ * separator.css: Separator (.ui-separator on native <hr>)
3
+ *
4
+ * @layer variables, components
5
+ * @requires layers.css, _variables.css, _reset.css
6
+ * @uses <hr>: the platform's separator (implicit role="separator");
7
+ * no div reconstruction needed
8
+ * @uses data-orientation="vertical": flips to a stretching column rule
9
+ * for flex/grid rows; pair with aria-orientation="vertical" when
10
+ * the separator is meaningful, or role="presentation" when purely
11
+ * decorative
12
+ * @tokens --ui-separator-* (@layer variables)
13
+ */
14
+
15
+ @layer variables {
16
+ :root {
17
+ --ui-separator-color: var(--border);
18
+ --ui-separator-thickness: var(--step-px);
19
+ }
20
+ }
21
+
22
+ @layer zazz.components {
23
+ /* ===========================================================================
24
+ SEPARATOR: a themed <hr>, horizontal or vertical
25
+ - The bare-hr baseline lives in _reset.css; this class adds the token hooks
26
+ and the vertical form. Spacing is composition (my-xs / mx-xs utilities),
27
+ like every other recipe.
28
+ - Meaningful separators keep hr's implicit separator role (add
29
+ aria-orientation="vertical" for the vertical form: AT assumes
30
+ horizontal); decorative ones take role="presentation".
31
+ =========================================================================== */
32
+
33
+ .ui-separator {
34
+ border: none;
35
+ background-color: var(--ui-separator-color);
36
+ block-size: var(--ui-separator-thickness);
37
+ inline-size: auto;
38
+ flex-shrink: 0;
39
+ }
40
+
41
+ .ui-separator[data-orientation="vertical"] {
42
+ inline-size: var(--ui-separator-thickness);
43
+ block-size: auto;
44
+ /* Stretches to the row height as a flex/grid item; the fallback keeps it
45
+ visible in plain flow, where auto block-size would collapse to zero */
46
+ align-self: stretch;
47
+ min-block-size: 1lh;
48
+ }
49
+ }
@@ -0,0 +1,16 @@
1
+ <div class="flex flex-col gap-sm max-w-xl">
2
+ <div>
3
+ <p class="text-sm font-strong">Zazz Design Framework</p>
4
+ <p class="text-sm text-muted-foreground">Web-native primitives.</p>
5
+ </div>
6
+
7
+ <hr class="ui-separator" />
8
+
9
+ <div class="flex flex-row items-center gap-xs text-sm">
10
+ <a href="#" class="ui-button" data-variant="link">Docs</a>
11
+ <hr class="ui-separator" data-orientation="vertical" aria-orientation="vertical" />
12
+ <a href="#" class="ui-button" data-variant="link">Components</a>
13
+ <hr class="ui-separator" data-orientation="vertical" aria-orientation="vertical" />
14
+ <a href="#" class="ui-button" data-variant="link">Themes</a>
15
+ </div>
16
+ </div>