@zazz-ui/core 0.4.1 → 0.5.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 (331) hide show
  1. package/AUTHORING.md +158 -0
  2. package/CHANGELOG.md +331 -0
  3. package/README.md +55 -23
  4. package/dist/scroll-state-C8mA5gq6.js +1 -0
  5. package/dist/sri.json +124 -72
  6. package/dist/zazz.css +1 -1
  7. package/dist/zazz.js +1 -1
  8. package/editor/zazz.css-data.json +116794 -0
  9. package/editor/zazz.html-data.json +1683 -0
  10. package/editor/zazz.language-data.json +5001 -0
  11. package/editor/zazz.lint-data.json +152 -0
  12. package/package.json +12 -5
  13. package/src/base/_breakpoints.css +12 -0
  14. package/src/base/_layers.css +8 -9
  15. package/src/base/_properties-2xl.css +171 -0
  16. package/src/base/_properties-active.css +107 -0
  17. package/src/base/_properties-checked.css +107 -0
  18. package/src/base/_properties-current.css +107 -0
  19. package/src/base/_properties-disabled.css +107 -0
  20. package/src/base/_properties-focus-visible.css +107 -0
  21. package/src/base/_properties-focus-within.css +107 -0
  22. package/src/base/_properties-hover.css +107 -0
  23. package/src/base/_properties-lg.css +171 -0
  24. package/src/base/_properties-md.css +171 -0
  25. package/src/base/_properties-open.css +107 -0
  26. package/src/base/_properties-sm.css +171 -0
  27. package/src/base/_properties-starting.css +55 -0
  28. package/src/base/_properties-stuck.css +55 -0
  29. package/src/base/_properties-xl.css +171 -0
  30. package/src/base/_properties.css +555 -0
  31. package/src/base/_reset.css +67 -75
  32. package/src/base/_switches.css +145 -0
  33. package/src/base/_typography.css +437 -370
  34. package/src/base/_utilities-box.css +142 -0
  35. package/src/base/_utilities-color.css +290 -0
  36. package/src/base/_utilities-effects.css +235 -0
  37. package/src/base/_utilities-flow.css +312 -0
  38. package/src/base/_utilities-grid.css +143 -0
  39. package/src/base/_utilities-margin.css +376 -0
  40. package/src/base/_utilities-pseudo.css +426 -0
  41. package/src/base/_utilities-sizing.css +259 -0
  42. package/src/base/_utilities-spacing.css +190 -0
  43. package/src/base/_utilities-tier-2xl.css +93 -0
  44. package/src/base/_utilities-tier-active.css +61 -0
  45. package/src/base/_utilities-tier-checked.css +61 -0
  46. package/src/base/_utilities-tier-current.css +61 -0
  47. package/src/base/_utilities-tier-disabled.css +61 -0
  48. package/src/base/_utilities-tier-focus-visible.css +61 -0
  49. package/src/base/_utilities-tier-focus-within.css +61 -0
  50. package/src/base/_utilities-tier-hover.css +63 -0
  51. package/src/base/_utilities-tier-lg.css +93 -0
  52. package/src/base/_utilities-tier-md.css +93 -0
  53. package/src/base/_utilities-tier-open.css +61 -0
  54. package/src/base/_utilities-tier-sm.css +93 -0
  55. package/src/base/_utilities-tier-starting.css +35 -0
  56. package/src/base/_utilities-tier-stuck.css +114 -0
  57. package/src/base/_utilities-tier-xl.css +93 -0
  58. package/src/base/_utilities-typography.css +141 -0
  59. package/src/base/_variables.css +323 -372
  60. package/src/base/_view-transitions.css +10 -12
  61. package/src/base/command-score.d.ts.map +1 -1
  62. package/src/base/command-score.js +1 -2
  63. package/src/base/command-score.ts +1 -2
  64. package/src/base/dialog-lifecycle.js +1 -1
  65. package/src/base/dialog-lifecycle.ts +1 -1
  66. package/src/base/embla.d.ts +6 -7
  67. package/src/base/embla.d.ts.map +1 -1
  68. package/src/base/embla.js +89 -55
  69. package/src/base/embla.ts +89 -55
  70. package/src/base/hotkeys.d.ts +0 -5
  71. package/src/base/hotkeys.d.ts.map +1 -1
  72. package/src/base/hotkeys.ts +0 -5
  73. package/src/base/navigation.d.ts +12 -1
  74. package/src/base/navigation.d.ts.map +1 -1
  75. package/src/base/navigation.js +229 -86
  76. package/src/base/navigation.ts +224 -92
  77. package/src/base/reveal.js +14 -14
  78. package/src/base/reveal.ts +14 -14
  79. package/src/base/scroll-state.d.ts +21 -0
  80. package/src/base/scroll-state.d.ts.map +1 -0
  81. package/src/base/scroll-state.js +177 -0
  82. package/src/base/scroll-state.ts +188 -0
  83. package/src/base/signals.d.ts +1 -2
  84. package/src/base/signals.d.ts.map +1 -1
  85. package/src/base/signals.js +4 -6
  86. package/src/base/signals.ts +4 -6
  87. package/src/base/style-format.d.ts +33 -0
  88. package/src/base/style-format.d.ts.map +1 -0
  89. package/src/base/style-format.js +160 -0
  90. package/src/base/style-format.ts +180 -0
  91. package/src/base/typeahead.d.ts +19 -4
  92. package/src/base/typeahead.d.ts.map +1 -1
  93. package/src/base/typeahead.js +68 -21
  94. package/src/base/typeahead.ts +73 -23
  95. package/src/base/utilities.d.ts +188 -0
  96. package/src/base/utilities.d.ts.map +1 -0
  97. package/src/base/utilities.js +750 -0
  98. package/src/base/utilities.ts +865 -0
  99. package/src/base/utils.d.ts +3 -7
  100. package/src/base/utils.d.ts.map +1 -1
  101. package/src/base/utils.js +4 -8
  102. package/src/base/utils.ts +4 -8
  103. package/src/base/zazz-element.d.ts +14 -8
  104. package/src/base/zazz-element.d.ts.map +1 -1
  105. package/src/base/zazz-element.js +14 -8
  106. package/src/base/zazz-element.ts +15 -8
  107. package/src/globals.d.ts +1 -1
  108. package/src/head.d.ts +50 -4
  109. package/src/head.d.ts.map +1 -1
  110. package/src/head.js +119 -38
  111. package/src/head.ts +172 -41
  112. package/src/index.css +57 -14
  113. package/src/index.js +5 -0
  114. package/src/index.ts +6 -0
  115. package/src/manifest.d.ts +36 -5
  116. package/src/manifest.d.ts.map +1 -1
  117. package/src/manifest.js +150 -6
  118. package/src/manifest.ts +167 -9
  119. package/src/primitives/accordion/accordion.css +18 -17
  120. package/src/primitives/accordion/accordion.html +42 -9
  121. package/src/primitives/alert-dialog/alert-dialog.css +13 -13
  122. package/src/primitives/alert-dialog/alert-dialog.html +26 -12
  123. package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
  124. package/src/primitives/autocomplete/autocomplete.css +43 -39
  125. package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
  126. package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
  127. package/src/primitives/autocomplete/autocomplete.html +38 -26
  128. package/src/primitives/autocomplete/autocomplete.js +6 -5
  129. package/src/primitives/autocomplete/autocomplete.ts +6 -5
  130. package/src/primitives/avatar/avatar.html +110 -15
  131. package/src/primitives/badge/badge-icon.html +22 -8
  132. package/src/primitives/badge/badge.css +401 -128
  133. package/src/primitives/badge/badge.html +12 -6
  134. package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
  135. package/src/primitives/button/button-icon-only.html +17 -11
  136. package/src/primitives/button/button-icon.html +9 -3
  137. package/src/primitives/button/button.css +408 -164
  138. package/src/primitives/button/button.html +14 -7
  139. package/src/primitives/button-group/button-group-vertical.html +5 -5
  140. package/src/primitives/button-group/button-group.css +53 -25
  141. package/src/primitives/button-group/button-group.html +18 -12
  142. package/src/primitives/callout/callout.css +114 -0
  143. package/src/primitives/callout/callout.html +188 -0
  144. package/src/primitives/card/card-subgrid.html +249 -34
  145. package/src/primitives/card/card.css +125 -0
  146. package/src/primitives/card/card.html +141 -20
  147. package/src/primitives/carousel/carousel.css +30 -20
  148. package/src/primitives/carousel/carousel.d.ts +7 -10
  149. package/src/primitives/carousel/carousel.d.ts.map +1 -1
  150. package/src/primitives/carousel/carousel.html +420 -84
  151. package/src/primitives/carousel/carousel.js +1 -1
  152. package/src/primitives/carousel/carousel.ts +8 -11
  153. package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
  154. package/src/primitives/checkbox/checkbox.css +98 -40
  155. package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
  156. package/src/primitives/checkbox/checkbox.html +13 -8
  157. package/src/primitives/checkbox/checkbox.js +7 -9
  158. package/src/primitives/checkbox/checkbox.ts +7 -15
  159. package/src/primitives/combobox/combobox-multiselect.html +53 -33
  160. package/src/primitives/combobox/combobox.css +145 -122
  161. package/src/primitives/combobox/combobox.d.ts +12 -11
  162. package/src/primitives/combobox/combobox.d.ts.map +1 -1
  163. package/src/primitives/combobox/combobox.html +48 -28
  164. package/src/primitives/combobox/combobox.js +46 -51
  165. package/src/primitives/combobox/combobox.ts +48 -55
  166. package/src/primitives/command/command-actions.d.ts +2 -3
  167. package/src/primitives/command/command-actions.d.ts.map +1 -1
  168. package/src/primitives/command/command-actions.html +48 -33
  169. package/src/primitives/command/command-actions.js +12 -10
  170. package/src/primitives/command/command-actions.ts +12 -13
  171. package/src/primitives/command/command-dialog.html +49 -25
  172. package/src/primitives/command/command.css +52 -42
  173. package/src/primitives/command/command.d.ts +10 -7
  174. package/src/primitives/command/command.d.ts.map +1 -1
  175. package/src/primitives/command/command.html +95 -46
  176. package/src/primitives/command/command.js +30 -13
  177. package/src/primitives/command/command.ts +30 -12
  178. package/src/primitives/debug/audit-core.d.ts +64 -0
  179. package/src/primitives/debug/audit-core.d.ts.map +1 -0
  180. package/src/primitives/debug/audit-core.js +356 -0
  181. package/src/primitives/debug/audit-core.ts +535 -0
  182. package/src/primitives/debug/debug.d.ts +50 -0
  183. package/src/primitives/debug/debug.d.ts.map +1 -0
  184. package/src/primitives/debug/debug.js +168 -0
  185. package/src/primitives/debug/debug.ts +211 -0
  186. package/src/primitives/dialog/dialog-with-form.html +67 -45
  187. package/src/primitives/dialog/dialog.css +87 -61
  188. package/src/primitives/dialog/dialog.html +25 -17
  189. package/src/primitives/fields/fields.css +108 -134
  190. package/src/primitives/fields/fields.html +39 -0
  191. package/src/primitives/input/input-icon-leading.html +3 -3
  192. package/src/primitives/input/input-icon-trailing.html +3 -3
  193. package/src/primitives/input/input.css +87 -49
  194. package/src/primitives/input/input.html +15 -15
  195. package/src/primitives/input-group/input-group-password-group.html +15 -15
  196. package/src/primitives/input-group/input-group.css +118 -75
  197. package/src/primitives/input-group/input-group.html +42 -30
  198. package/src/primitives/kbd/kbd-group.html +15 -2
  199. package/src/primitives/kbd/kbd.css +44 -31
  200. package/src/primitives/kbd/kbd.html +7 -1
  201. package/src/primitives/layout/layout.css +159 -0
  202. package/src/primitives/layout/layout.html +35 -0
  203. package/src/primitives/lightbox/lightbox.css +178 -105
  204. package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
  205. package/src/primitives/lightbox/lightbox.html +138 -166
  206. package/src/primitives/lightbox/lightbox.js +10 -13
  207. package/src/primitives/lightbox/lightbox.ts +12 -13
  208. package/src/primitives/menu/menu-interest.html +60 -18
  209. package/src/primitives/menu/menu.css +22 -17
  210. package/src/primitives/menu/menu.d.ts +5 -5
  211. package/src/primitives/menu/menu.html +195 -40
  212. package/src/primitives/menu/menu.js +8 -8
  213. package/src/primitives/menu/menu.ts +8 -8
  214. package/src/primitives/menubar/menubar-help-search.html +78 -32
  215. package/src/primitives/menubar/menubar.html +166 -38
  216. package/src/primitives/meter/meter.css +41 -38
  217. package/src/primitives/meter/meter.html +44 -9
  218. package/src/primitives/mobile-menu/mobile-menu.css +47 -40
  219. package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
  220. package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
  221. package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
  222. package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
  223. package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
  224. package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
  225. package/src/primitives/navigation-menu/navigation-menu.css +104 -106
  226. package/src/primitives/navigation-menu/navigation-menu.html +554 -158
  227. package/src/primitives/otp/otp.css +43 -44
  228. package/src/primitives/otp/otp.d.ts +4 -5
  229. package/src/primitives/otp/otp.d.ts.map +1 -1
  230. package/src/primitives/otp/otp.html +7 -6
  231. package/src/primitives/otp/otp.js +13 -18
  232. package/src/primitives/otp/otp.ts +12 -19
  233. package/src/primitives/password-group/password-group.css +132 -107
  234. package/src/primitives/password-group/password-group.d.ts.map +1 -1
  235. package/src/primitives/password-group/password-group.html +23 -16
  236. package/src/primitives/password-group/password-group.js +11 -12
  237. package/src/primitives/password-group/password-group.ts +11 -12
  238. package/src/primitives/popover/popover.css +88 -95
  239. package/src/primitives/popover/popover.html +18 -0
  240. package/src/primitives/progress/progress-indeterminate.html +1 -1
  241. package/src/primitives/progress/progress.css +34 -35
  242. package/src/primitives/progress/progress.html +18 -4
  243. package/src/primitives/prose/prose.html +19 -12
  244. package/src/primitives/radio/radio.css +83 -46
  245. package/src/primitives/radio/radio.html +16 -11
  246. package/src/primitives/reveal/reveal.css +37 -46
  247. package/src/primitives/reveal/reveal.html +15 -0
  248. package/src/primitives/scroll-fade/scroll-fade.css +115 -0
  249. package/src/primitives/scroll-fade/scroll-fade.html +69 -0
  250. package/src/primitives/select/multiselect.d.ts +8 -10
  251. package/src/primitives/select/multiselect.d.ts.map +1 -1
  252. package/src/primitives/select/multiselect.js +23 -27
  253. package/src/primitives/select/multiselect.ts +23 -29
  254. package/src/primitives/select/select-align.html +79 -16
  255. package/src/primitives/select/select-multiple.html +8 -4
  256. package/src/primitives/select/select-sides.html +104 -21
  257. package/src/primitives/select/select.css +297 -186
  258. package/src/primitives/select/select.html +24 -5
  259. package/src/primitives/separator/separator.css +15 -18
  260. package/src/primitives/separator/separator.html +37 -10
  261. package/src/primitives/slider/slider.css +48 -38
  262. package/src/primitives/slider/slider.html +9 -1
  263. package/src/primitives/style-guard/style-guard.d.ts +19 -0
  264. package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
  265. package/src/primitives/style-guard/style-guard.js +125 -0
  266. package/src/primitives/style-guard/style-guard.ts +153 -0
  267. package/src/primitives/switch/switch.css +42 -33
  268. package/src/primitives/switch/switch.html +11 -6
  269. package/src/primitives/table/table-alternating.html +1 -1
  270. package/src/primitives/table/table-grid.html +5 -5
  271. package/src/primitives/table/table-size-sm.html +1 -1
  272. package/src/primitives/table/table.css +64 -61
  273. package/src/primitives/table/table.html +7 -7
  274. package/src/primitives/tabs/tabs.css +167 -166
  275. package/src/primitives/tabs/tabs.d.ts +10 -11
  276. package/src/primitives/tabs/tabs.d.ts.map +1 -1
  277. package/src/primitives/tabs/tabs.html +192 -36
  278. package/src/primitives/tabs/tabs.js +14 -15
  279. package/src/primitives/tabs/tabs.ts +14 -15
  280. package/src/primitives/textarea/textarea.css +69 -44
  281. package/src/primitives/textarea/textarea.html +3 -3
  282. package/src/primitives/toaster/toaster.css +90 -92
  283. package/src/primitives/toaster/toaster.d.ts +0 -6
  284. package/src/primitives/toaster/toaster.d.ts.map +1 -1
  285. package/src/primitives/toaster/toaster.html +22 -18
  286. package/src/primitives/toaster/toaster.js +64 -72
  287. package/src/primitives/toaster/toaster.ts +71 -87
  288. package/src/primitives/toggle/toggle.css +368 -153
  289. package/src/primitives/toggle/toggle.html +27 -9
  290. package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
  291. package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
  292. package/src/primitives/toggle-group/toggle-group.css +71 -23
  293. package/src/primitives/toggle-group/toggle-group.html +3 -3
  294. package/src/primitives/toolbar/toolbar.html +35 -13
  295. package/src/primitives/tooltip/tooltip-disabled.html +3 -3
  296. package/src/primitives/tooltip/tooltip-sides.html +36 -14
  297. package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
  298. package/src/primitives/tooltip/tooltip.css +111 -80
  299. package/src/primitives/tooltip/tooltip.html +3 -3
  300. package/src/primitives/utilities/aspect-ratio.html +51 -7
  301. package/src/primitives/utilities/basis.html +64 -11
  302. package/src/primitives/utilities/col-span.html +65 -9
  303. package/src/primitives/utilities/compose.html +48 -10
  304. package/src/primitives/utilities/flex-align.html +89 -19
  305. package/src/primitives/utilities/flex-direction.html +111 -13
  306. package/src/primitives/utilities/flex-grow.html +41 -7
  307. package/src/primitives/utilities/gap.html +158 -19
  308. package/src/primitives/utilities/grid-cols.html +75 -7
  309. package/src/primitives/utilities/grid-responsive.html +111 -12
  310. package/src/primitives/utilities/margin-auto.html +38 -7
  311. package/src/primitives/utilities/object-fit.html +75 -13
  312. package/src/primitives/utilities/order.html +40 -4
  313. package/src/primitives/utilities/overflow.html +74 -20
  314. package/src/primitives/utilities/padding-compose.html +67 -10
  315. package/src/primitives/utilities/padding.html +84 -13
  316. package/src/primitives/utilities/pile.html +29 -0
  317. package/src/primitives/utilities/position.html +65 -8
  318. package/src/primitives/utilities/responsive-flex.html +54 -7
  319. package/src/primitives/utilities/responsive-grid.html +115 -12
  320. package/src/primitives/utilities/size.html +120 -16
  321. package/src/primitives/utilities/width.html +123 -16
  322. package/examples/about.html +0 -583
  323. package/examples/components.html +0 -1028
  324. package/examples/forms.html +0 -504
  325. package/examples/index.html +0 -261
  326. package/examples/layout.html +0 -313
  327. package/examples/products.html +0 -839
  328. package/examples/responsive.html +0 -332
  329. package/src/base/_layout.css +0 -571
  330. package/src/base/_utilities.css +0 -6758
  331. package/src/primitives/utilities/grid-pile.html +0 -5
@@ -1,8 +1,15 @@
1
- <div class="flex items-center gap-sm">
2
- <button class="ui-button" type="button">Default</button>
3
- <button class="ui-button" data-variant="primary" type="button">Primary</button>
4
- <button class="ui-button" data-variant="muted" type="button">Muted</button>
5
- <button class="ui-button" data-variant="ghost" type="button">Ghost</button>
6
- <button class="ui-button" data-variant="destructive" type="button">Destructive</button>
7
- <button class="ui-button" data-variant="link" type="button">Link</button>
1
+ <div
2
+ style="
3
+ --display: flex;
4
+ --items: center;
5
+ --gap: 4;
6
+ "
7
+ >
8
+ <button data-ui="button" type="button">Default</button>
9
+ <button data-ui="button" data-button-variant="primary" type="button">Primary</button>
10
+ <button data-ui="button" data-button-variant="muted" type="button">Muted</button>
11
+ <button data-ui="button" data-button-variant="ghost" type="button">Ghost</button>
12
+ <button data-ui="button" data-button-variant="outline" type="button">Outline</button>
13
+ <button data-ui="button" data-button-variant="destructive" type="button">Destructive</button>
14
+ <button data-ui="button" data-button-variant="link" type="button">Link</button>
8
15
  </div>
@@ -1,6 +1,6 @@
1
- <ui-button-group data-orientation="vertical" role="group" aria-label="View options">
2
- <button class="ui-button" type="button">List</button>
3
- <button class="ui-button" type="button">Board</button>
4
- <button class="ui-button" type="button">Calendar</button>
5
- <button class="ui-button" type="button">Timeline</button>
1
+ <ui-button-group data-button-group-orientation="vertical" role="group" aria-label="View options">
2
+ <button data-ui="button" type="button">List</button>
3
+ <button data-ui="button" type="button">Board</button>
4
+ <button data-ui="button" type="button">Calendar</button>
5
+ <button data-ui="button" type="button">Timeline</button>
6
6
  </ui-button-group>
@@ -1,54 +1,68 @@
1
1
  /**
2
- * button-group.css: Button group (ui-button-group | .ui-button-group)
2
+ * button-group.css: Button group (ui-button-group | [data-ui~="button-group"])
3
3
  *
4
- * @layer components
5
- * @requires layers.css, _variables.css, button.css
4
+ * @layer variables, components
5
+ * @requires _layers.css, _variables.css, _properties.css (--_*-resolved), button.css
6
6
  * @uses :not(): first/last edge selection for shared-border collapse
7
7
  * @uses logical border-radius longhands: RTL-safe corner rounding per orientation
8
8
  * @uses flex-item z-index: raise the active control so its border/ring isn't clipped
9
- * @see https://ui.shadcn.com/docs/components/base/button-group
9
+ * @tokens --ui-button-group-* (@layer variables; named after the utilities they back)
10
10
  */
11
11
 
12
12
  @layer variables {
13
13
  :root {
14
- --ui-button-group-radius: var(--ui-button-radius);
15
- --ui-button-group-background: var(--card);
14
+ --ui-button-group-rounded: var(--ui-button-rounded);
15
+ --ui-button-group-bg: var(--color-card);
16
16
  }
17
17
  }
18
18
 
19
- @layer zazz.components {
19
+ @property --_button-group-rounded {
20
+ syntax: "*";
21
+ inherits: false;
22
+ }
23
+
24
+ @property --_button-group-bg {
25
+ syntax: "*";
26
+ inherits: false;
27
+ }
28
+
29
+ @layer ui.components {
20
30
  /* ===========================================================================
21
31
  BUTTON GROUP
22
32
 
23
- Joins adjacent controls (.ui-button, and any child it wraps) into a single
24
- segmented unit. Children keep their own --ui-button-radius, so the outer corners
25
- follow the buttons' size variant automatically; only the *inner* corners are
33
+ Joins adjacent controls (buttons, and any child it wraps) into a single
34
+ segmented unit. Children keep their own --ui-button-rounded, so the outer corners
35
+ follow the buttons' size preset automatically; only the *inner* corners are
26
36
  squared off and the doubled border is collapsed with a -1px overlap.
27
37
  =========================================================================== */
28
38
 
29
- :where(ui-button-group, .ui-button-group) {
39
+ :where(ui-button-group, [data-ui~="button-group"]) {
30
40
  display: flex;
31
41
  inline-size: fit-content;
32
42
  /* stretch so mixed-height children share one edge */
33
43
  align-items: stretch;
34
- border-radius: var(--ui-button-group-radius);
35
- overflow: clip;
36
- background-color: var(--ui-button-group-background);
44
+ border-radius: var(
45
+ --_rounded-resolved,
46
+ var(--_button-group-rounded, var(--ui-button-group-rounded))
47
+ );
48
+ background-color: var(--_bg-resolved, var(--_button-group-bg, var(--ui-button-group-bg)));
37
49
  position: relative;
38
50
  isolation: isolate;
39
51
  }
40
52
 
41
53
  /* flex items honour z-index without positioning, but relative keeps the
42
54
  stacking context robust across child types (inputs, selects, …) */
43
- :where(ui-button-group, .ui-button-group) > * {
55
+ :where(ui-button-group, [data-ui~="button-group"]) > * {
44
56
  position: relative;
45
57
  }
46
58
 
47
59
  /* the focused/hovered/pressed control floats above its neighbours so its
48
60
  border and box-shadow ring paint over the overlapped edge */
49
- :where(ui-button-group, .ui-button-group) > *:hover:not(:disabled, [aria-disabled="true"]),
50
- :where(ui-button-group, .ui-button-group) > *:focus-visible,
51
- :where(ui-button-group, .ui-button-group) > *:active:not(:disabled, [aria-disabled="true"]) {
61
+ :where(ui-button-group, [data-ui~="button-group"])
62
+ > *:hover:not(:disabled, [aria-disabled="true"]),
63
+ :where(ui-button-group, [data-ui~="button-group"]) > *:focus-visible,
64
+ :where(ui-button-group, [data-ui~="button-group"])
65
+ > *:active:not(:disabled, [aria-disabled="true"]) {
52
66
  z-index: 1;
53
67
  }
54
68
 
@@ -56,16 +70,19 @@
56
70
  BUTTON GROUP: HORIZONTAL (default)
57
71
  =========================================================================== */
58
72
 
59
- :where(ui-button-group, .ui-button-group):not([data-orientation="vertical"]) {
73
+ :where(ui-button-group, [data-ui~="button-group"]):not(
74
+ [data-button-group-orientation="vertical"]
75
+ ) {
60
76
  flex-direction: row;
61
77
  }
62
78
 
63
- :where(ui-button-group, .ui-button-group):not([data-orientation="vertical"]) > :not(:last-child) {
79
+ :where(ui-button-group, [data-ui~="button-group"]):not([data-button-group-orientation="vertical"])
80
+ > :not(:last-child) {
64
81
  border-start-end-radius: 0;
65
82
  border-end-end-radius: 0;
66
83
  }
67
84
 
68
- :where(ui-button-group, .ui-button-group):not([data-orientation="vertical"])
85
+ :where(ui-button-group, [data-ui~="button-group"]):not([data-button-group-orientation="vertical"])
69
86
  > :not(:first-child) {
70
87
  /* pull onto the previous control's border so the seam is one line, not two */
71
88
  margin-inline-start: -1px;
@@ -74,19 +91,30 @@
74
91
  }
75
92
 
76
93
  /* ===========================================================================
77
- BUTTON GROUP: VERTICAL
94
+ BUTTON GROUP: VERTICAL — data-button-group-orientation="vertical"
78
95
  =========================================================================== */
79
96
 
80
- :where(ui-button-group, .ui-button-group)[data-orientation="vertical"] {
97
+ :where(
98
+ ui-button-group[data-button-group-orientation="vertical"],
99
+ [data-ui~="button-group"][data-button-group-orientation="vertical"]
100
+ ) {
81
101
  flex-direction: column;
82
102
  }
83
103
 
84
- :where(ui-button-group, .ui-button-group)[data-orientation="vertical"] > :not(:last-child) {
104
+ :where(
105
+ ui-button-group[data-button-group-orientation="vertical"],
106
+ [data-ui~="button-group"][data-button-group-orientation="vertical"]
107
+ )
108
+ > :not(:last-child) {
85
109
  border-end-start-radius: 0;
86
110
  border-end-end-radius: 0;
87
111
  }
88
112
 
89
- :where(ui-button-group, .ui-button-group)[data-orientation="vertical"] > :not(:first-child) {
113
+ :where(
114
+ ui-button-group[data-button-group-orientation="vertical"],
115
+ [data-ui~="button-group"][data-button-group-orientation="vertical"]
116
+ )
117
+ > :not(:first-child) {
90
118
  margin-block-start: -1px;
91
119
  border-start-start-radius: 0;
92
120
  border-start-end-radius: 0;
@@ -1,20 +1,26 @@
1
- <div class="flex flex-col items-start gap-md">
1
+ <div
2
+ style="
3
+ --display: flex-col;
4
+ --items: start;
5
+ --gap: 6;
6
+ "
7
+ >
2
8
  <ui-button-group role="group" aria-label="Text alignment">
3
- <button class="ui-button" type="button">Left</button>
4
- <button class="ui-button" type="button">Center</button>
5
- <button class="ui-button" type="button">Right</button>
9
+ <button data-ui="button" type="button">Left</button>
10
+ <button data-ui="button" type="button">Center</button>
11
+ <button data-ui="button" type="button">Right</button>
6
12
  </ui-button-group>
7
13
 
8
14
  <ui-button-group role="group" aria-label="Pagination">
9
- <button class="ui-button" data-variant="muted" type="button">Previous</button>
10
- <button class="ui-button" data-variant="muted" type="button">1</button>
11
- <button class="ui-button" data-variant="muted" type="button">2</button>
12
- <button class="ui-button" data-variant="muted" type="button">3</button>
13
- <button class="ui-button" data-variant="muted" type="button">Next</button>
15
+ <button data-ui="button" data-button-variant="muted" type="button">Previous</button>
16
+ <button data-ui="button" data-button-variant="muted" type="button">1</button>
17
+ <button data-ui="button" data-button-variant="muted" type="button">2</button>
18
+ <button data-ui="button" data-button-variant="muted" type="button">3</button>
19
+ <button data-ui="button" data-button-variant="muted" type="button">Next</button>
14
20
  </ui-button-group>
15
21
 
16
22
  <ui-button-group role="group" aria-label="Formatting">
17
- <button class="ui-button" data-size="icon" type="button" aria-label="Bold">
23
+ <button data-ui="button" data-button-size="icon" type="button" aria-label="Bold">
18
24
  <svg
19
25
  xmlns="http://www.w3.org/2000/svg"
20
26
  viewBox="0 0 24 24"
@@ -29,7 +35,7 @@
29
35
  <path d="M6 12h9a4 4 0 0 1 0 8H6z" />
30
36
  </svg>
31
37
  </button>
32
- <button class="ui-button" data-size="icon" type="button" aria-label="Italic">
38
+ <button data-ui="button" data-button-size="icon" type="button" aria-label="Italic">
33
39
  <svg
34
40
  xmlns="http://www.w3.org/2000/svg"
35
41
  viewBox="0 0 24 24"
@@ -45,7 +51,7 @@
45
51
  <line x1="15" y1="4" x2="9" y2="20" />
46
52
  </svg>
47
53
  </button>
48
- <button class="ui-button" data-size="icon" type="button" aria-label="Underline">
54
+ <button data-ui="button" data-button-size="icon" type="button" aria-label="Underline">
49
55
  <svg
50
56
  xmlns="http://www.w3.org/2000/svg"
51
57
  viewBox="0 0 24 24"
@@ -0,0 +1,114 @@
1
+ /**
2
+ * callout.css — Callout ([data-ui~="callout"])
3
+ *
4
+ * @layer variables, components
5
+ * @requires _layers.css, _variables.css, _properties.css (--_*-resolved)
6
+ * @uses oklch(from …): status tints
7
+ * @tokens --ui-callout-* (@layer variables; named after the utilities they back)
8
+ * @see badge.css (status tint and border formulas; the test keeps them in sync)
9
+ * @presets data-callout-variant="muted" | "info" | "success" | "warning" | "destructive"
10
+ *
11
+ * A callout is an aside or alert: a padded grid with a gap, a border, and a
12
+ * radius. The default matches an outline card and muted a muted card. Info,
13
+ * success, and warning take the matching badge's tint and border, with the
14
+ * role mixed toward --color-foreground for text; destructive is the badge's
15
+ * solid fill.
16
+ * Every variant keeps the 1px border (muted makes it transparent), so every
17
+ * variant is the same size.
18
+ * Its parts are plain elements laid out with utilities. Use <aside> for a
19
+ * side note, or a <div> with role="status" or role="alert" for a message
20
+ * that follows something the user did.
21
+ * Every utility-backed declaration reads one chain, highest first:
22
+ * var(--_<utility>-resolved, var(--_callout-<utility>, var(--ui-callout-<utility>)))
23
+ */
24
+
25
+ @layer variables {
26
+ :root {
27
+ --ui-callout-bg: var(--color-card);
28
+ --ui-callout-text: var(--color-card-foreground);
29
+ --ui-callout-rounded: var(--radius-md);
30
+ --ui-callout-shadow: none;
31
+
32
+ --ui-callout-border-width: 1px;
33
+ --ui-callout-border-style: solid;
34
+ --ui-callout-border-color: var(--color-border);
35
+
36
+ /* dual-mode: a scale number or a length */
37
+ --ui-callout-gap: var(--space-xs);
38
+ --ui-callout-p: var(--space-sm);
39
+ }
40
+ }
41
+
42
+ /* Variant privates: non-inheriting so a variant never cascades into a nested callout. */
43
+ @property --_callout-bg {
44
+ syntax: "*";
45
+ inherits: false;
46
+ }
47
+
48
+ @property --_callout-text {
49
+ syntax: "*";
50
+ inherits: false;
51
+ }
52
+
53
+ @property --_callout-border-color {
54
+ syntax: "*";
55
+ inherits: false;
56
+ }
57
+
58
+ @layer ui.components {
59
+ :where([data-ui~="callout"]) {
60
+ display: grid;
61
+ --_gap-len: var(--_gap-resolved, var(--ui-callout-gap));
62
+ --_gap-num: var(--_gap-resolved, var(--ui-callout-gap));
63
+ gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
64
+ --_p-len: var(--_p-resolved, var(--ui-callout-p));
65
+ --_p-num: var(--_p-resolved, var(--ui-callout-p));
66
+ padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
67
+ color: var(--_text-resolved, var(--_callout-text, var(--ui-callout-text)));
68
+ background-color: var(--_bg-resolved, var(--_callout-bg, var(--ui-callout-bg)));
69
+ border-width: var(--_border-width-resolved, var(--ui-callout-border-width));
70
+ border-style: var(--_border-style-resolved, var(--ui-callout-border-style));
71
+ border-color: var(
72
+ --_border-color-resolved,
73
+ var(--_callout-border-color, var(--ui-callout-border-color))
74
+ );
75
+ border-radius: var(--_rounded-resolved, var(--ui-callout-rounded));
76
+ box-shadow: var(--_shadow-resolved, var(--ui-callout-shadow));
77
+ }
78
+
79
+ /* ===========================================================================
80
+ CALLOUT VARIANTS — data-callout-variant writes the privates
81
+ =========================================================================== */
82
+
83
+ :where([data-ui~="callout"][data-callout-variant="muted"]) {
84
+ --_callout-bg: var(--color-muted);
85
+ --_callout-text: var(--color-foreground);
86
+ --_callout-border-color: transparent;
87
+ }
88
+
89
+ /* status variants: the badge's tint and border for the same role */
90
+
91
+ :where([data-ui~="callout"][data-callout-variant="info"]) {
92
+ --_callout-bg: oklch(from var(--color-info) l c h / 0.15);
93
+ --_callout-text: color-mix(in xyz, var(--color-info), var(--color-foreground));
94
+ --_callout-border-color: oklch(from var(--color-info) l c h / 0.2);
95
+ }
96
+
97
+ :where([data-ui~="callout"][data-callout-variant="success"]) {
98
+ --_callout-bg: oklch(from var(--color-success) l c h / 0.15);
99
+ --_callout-text: color-mix(in xyz, var(--color-success), var(--color-foreground));
100
+ --_callout-border-color: oklch(from var(--color-success) l c h / 0.2);
101
+ }
102
+
103
+ :where([data-ui~="callout"][data-callout-variant="warning"]) {
104
+ --_callout-bg: oklch(from var(--color-warning) l c h / 0.15);
105
+ --_callout-text: color-mix(in xyz, var(--color-warning), var(--color-foreground));
106
+ --_callout-border-color: oklch(from var(--color-warning) l c h / 0.2);
107
+ }
108
+
109
+ :where([data-ui~="callout"][data-callout-variant="destructive"]) {
110
+ --_callout-bg: var(--color-destructive);
111
+ --_callout-text: var(--color-destructive-foreground);
112
+ --_callout-border-color: var(--_callout-bg);
113
+ }
114
+ }
@@ -0,0 +1,188 @@
1
+ <div
2
+ style="
3
+ --display: grid;
4
+ --gap: 4;
5
+ "
6
+ >
7
+ <aside data-ui="callout" aria-labelledby="callout-note">
8
+ <p
9
+ id="callout-note"
10
+ data-ui="text-sm"
11
+ style="
12
+ --display: flex;
13
+ --items: center;
14
+ --gap: 2;
15
+ --font-weight: strong;
16
+ "
17
+ >
18
+ <svg
19
+ style="
20
+ --shrink: 0;
21
+ --size: 4;
22
+ "
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ viewBox="0 0 20 20"
25
+ fill="currentColor"
26
+ aria-hidden="true"
27
+ >
28
+ <path
29
+ fill-rule="evenodd"
30
+ d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z"
31
+ clip-rule="evenodd"
32
+ />
33
+ </svg>
34
+ Note
35
+ </p>
36
+ <p data-ui="text-sm">Callouts set supporting information apart from the text around it.</p>
37
+ </aside>
38
+ <div data-ui="callout" data-callout-variant="muted">
39
+ <p
40
+ data-ui="text-sm"
41
+ style="
42
+ --display: flex;
43
+ --items: center;
44
+ --gap: 2;
45
+ --font-weight: strong;
46
+ "
47
+ >
48
+ <svg
49
+ style="
50
+ --shrink: 0;
51
+ --size: 4;
52
+ "
53
+ xmlns="http://www.w3.org/2000/svg"
54
+ viewBox="0 0 20 20"
55
+ fill="currentColor"
56
+ aria-hidden="true"
57
+ >
58
+ <path
59
+ fill-rule="evenodd"
60
+ d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z"
61
+ clip-rule="evenodd"
62
+ />
63
+ </svg>
64
+ Aside
65
+ </p>
66
+ <p data-ui="text-sm">A quieter surface for tips and context that readers can skip.</p>
67
+ </div>
68
+ <div data-ui="callout" data-callout-variant="info">
69
+ <p
70
+ data-ui="text-sm"
71
+ style="
72
+ --display: flex;
73
+ --items: center;
74
+ --gap: 2;
75
+ --font-weight: strong;
76
+ "
77
+ >
78
+ <svg
79
+ style="
80
+ --shrink: 0;
81
+ --size: 4;
82
+ "
83
+ xmlns="http://www.w3.org/2000/svg"
84
+ viewBox="0 0 20 20"
85
+ fill="currentColor"
86
+ aria-hidden="true"
87
+ >
88
+ <path
89
+ fill-rule="evenodd"
90
+ d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z"
91
+ clip-rule="evenodd"
92
+ />
93
+ </svg>
94
+ Scheduled maintenance
95
+ </p>
96
+ <p data-ui="text-sm">The dashboard is read-only on Saturday from 2 to 4 a.m. UTC.</p>
97
+ </div>
98
+ <div data-ui="callout" data-callout-variant="success">
99
+ <p
100
+ data-ui="text-sm"
101
+ style="
102
+ --display: flex;
103
+ --items: center;
104
+ --gap: 2;
105
+ --font-weight: strong;
106
+ "
107
+ >
108
+ <svg
109
+ style="
110
+ --shrink: 0;
111
+ --size: 4;
112
+ "
113
+ xmlns="http://www.w3.org/2000/svg"
114
+ viewBox="0 0 20 20"
115
+ fill="currentColor"
116
+ aria-hidden="true"
117
+ >
118
+ <path
119
+ fill-rule="evenodd"
120
+ d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
121
+ clip-rule="evenodd"
122
+ />
123
+ </svg>
124
+ Payment received
125
+ </p>
126
+ <p data-ui="text-sm">Your invoice is paid, and a receipt is on its way to your inbox.</p>
127
+ </div>
128
+ <div data-ui="callout" data-callout-variant="warning">
129
+ <p
130
+ data-ui="text-sm"
131
+ style="
132
+ --display: flex;
133
+ --items: center;
134
+ --gap: 2;
135
+ --font-weight: strong;
136
+ "
137
+ >
138
+ <svg
139
+ style="
140
+ --shrink: 0;
141
+ --size: 4;
142
+ "
143
+ xmlns="http://www.w3.org/2000/svg"
144
+ viewBox="0 0 24 24"
145
+ fill="currentColor"
146
+ aria-hidden="true"
147
+ >
148
+ <path
149
+ fill-rule="evenodd"
150
+ d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z"
151
+ clip-rule="evenodd"
152
+ />
153
+ </svg>
154
+ Your trial ends in 3 days
155
+ </p>
156
+ <p data-ui="text-sm">Add a payment method to keep your projects running.</p>
157
+ </div>
158
+ <div data-ui="callout" data-callout-variant="destructive">
159
+ <p
160
+ data-ui="text-sm"
161
+ style="
162
+ --display: flex;
163
+ --items: center;
164
+ --gap: 2;
165
+ --font-weight: strong;
166
+ "
167
+ >
168
+ <svg
169
+ style="
170
+ --shrink: 0;
171
+ --size: 4;
172
+ "
173
+ xmlns="http://www.w3.org/2000/svg"
174
+ viewBox="0 0 20 20"
175
+ fill="currentColor"
176
+ aria-hidden="true"
177
+ >
178
+ <path
179
+ fill-rule="evenodd"
180
+ d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z"
181
+ clip-rule="evenodd"
182
+ />
183
+ </svg>
184
+ Deleting a workspace can't be undone
185
+ </p>
186
+ <p data-ui="text-sm">Its projects, files, and members are removed for good.</p>
187
+ </div>
188
+ </div>