@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,229 @@
1
+ /**
2
+ * dialog.css — Dialog (.ui-dialog on native <dialog>)
3
+ *
4
+ * @layer variables, reset, components
5
+ * @requires layers.css, _variables.css
6
+ * @uses <dialog>, ::backdrop — native modal + backdrop
7
+ * @uses @starting-style + allow-discrete — open/close opacity, transform, overlay
8
+ * @uses anchor-name, container-type — layout hooks for sized variants
9
+ * @tokens --ui-dialog-* (@layer variables; sizing tokens in a second variables block)
10
+ * @consumedby alert-dialog.css, mobile-menu.css
11
+ */
12
+
13
+ @layer variables {
14
+ :root {
15
+ --ui-dialog-display: grid;
16
+ --ui-dialog-backdrop-color: var(--shade-900);
17
+ --ui-dialog-transition-duration: var(--default-transition-duration);
18
+ --ui-dialog-transition-timing-function: var(--default-transition-timing-function);
19
+ --ui-dialog-backdrop-transition-duration: calc(var(--ui-dialog-transition-duration) - 100ms);
20
+ --ui-dialog-backdrop-transition-timing-function: ease;
21
+ --ui-dialog-backdrop-blur: blur(5px);
22
+ --ui-dialog-shadow: var(--shadow-lg);
23
+ --ui-dialog-border: 1px solid var(--border);
24
+ --ui-dialog-width: min(var(--breakpoint-md), 100% - var(--gutters) * 2);
25
+
26
+ /* Reveal transitions/animations */
27
+ --ui-dialog-opacity--start: 0;
28
+ --ui-dialog-opacity--end: 1;
29
+ --ui-dialog-scale--start: 0.98;
30
+ --ui-dialog-scale--end: 1;
31
+ --ui-dialog-translate--start: 0, 0, 0;
32
+ --ui-dialog-translate--end: 0, 0, 0;
33
+ --ui-dialog-transition-delay--start: 0ms;
34
+ --ui-dialog-transition-delay--end: 150ms;
35
+ }
36
+ }
37
+
38
+ /* Sizing tokens — second variables block (overrides --ui-dialog-width above). */
39
+ @layer variables {
40
+ :root {
41
+ --ui-dialog-width: min(50ch, 100% - var(--gap-md) * 2);
42
+ --ui-dialog-height: fit-content;
43
+ --ui-dialog-background: var(--card);
44
+ --ui-dialog-foreground: var(--card-foreground);
45
+ --ui-dialog-radius: var(--radius-lg);
46
+ }
47
+ }
48
+
49
+ @layer reset {
50
+ /* ===========================================================================
51
+ DIALOG — native <dialog> open/close animation, sizing, backdrop fade
52
+ - In the reset layer so the .ui-dialog component styling below wins.
53
+ =========================================================================== */
54
+
55
+ /* Prevent body scroll when a dialog inside the preview is open */
56
+
57
+ /* Dialog animations with spring easing */
58
+ :where(dialog) {
59
+ margin: auto;
60
+ max-inline-size: calc(100% - var(--gap-md));
61
+ max-block-size: calc(100% - var(--gap-md));
62
+ border: var(--ui-dialog-border);
63
+ contain: layout style;
64
+ opacity: var(--ui-dialog-opacity--start);
65
+ box-shadow: var(--ui-dialog-shadow);
66
+ overscroll-behavior: contain;
67
+ overflow: auto;
68
+ transform: translate3d(var(--ui-dialog-translate--start)) scale(var(--ui-dialog-scale--start));
69
+ transition:
70
+ opacity var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
71
+ transform var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
72
+ padding var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
73
+ block-size var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
74
+ inline-size var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
75
+ overlay var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function)
76
+ allow-discrete,
77
+ display var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function)
78
+ allow-discrete;
79
+ transition-delay: var(--ui-dialog-transition-delay--start);
80
+ }
81
+
82
+ :where(dialog[open]) {
83
+ transform: translate3d(var(--ui-dialog-translate--end)) scale(var(--ui-dialog-scale--end));
84
+ opacity: var(--ui-dialog-opacity--end);
85
+ transition-delay: var(--ui-dialog-transition-delay--end);
86
+
87
+ @starting-style {
88
+ transition-delay: var(--ui-dialog-transition-delay--start);
89
+ transform: translate3d(var(--ui-dialog-translate--start)) scale(var(--ui-dialog-scale--start));
90
+ opacity: var(--ui-dialog-opacity--start);
91
+ }
92
+ }
93
+
94
+ /* Dialog backdrop with smooth fade transition */
95
+ :where(dialog)::backdrop {
96
+ position: fixed;
97
+ width: 100%;
98
+ height: 100%;
99
+ top: 0;
100
+ left: 0;
101
+ z-index: 1000;
102
+ opacity: 0;
103
+ overscroll-behavior: contain;
104
+ overflow: auto;
105
+ background-color: var(--ui-dialog-backdrop-color);
106
+ backdrop-filter: var(--ui-dialog-backdrop-blur);
107
+ transition: opacity var(--ui-dialog-backdrop-transition-duration)
108
+ var(--ui-dialog-backdrop-transition-timing-function);
109
+ }
110
+
111
+ :where(dialog[open])::backdrop {
112
+ opacity: 1;
113
+
114
+ @starting-style {
115
+ opacity: 0;
116
+ }
117
+ }
118
+ }
119
+
120
+ @layer zazz.components {
121
+ .ui-dialog {
122
+ /* Overrides reset-layer --ui-dialog-shadow (reset > variables) */
123
+ --ui-dialog-shadow: var(--shadow-md);
124
+
125
+ inline-size: var(--ui-dialog-width);
126
+ block-size: var(--ui-dialog-height);
127
+ background-color: var(--ui-dialog-background);
128
+ color: var(--ui-dialog-foreground);
129
+ box-shadow: var(--ui-dialog-shadow);
130
+ border-radius: var(--ui-dialog-radius);
131
+
132
+ anchor-name: --ui-dialog-root;
133
+ container-type: inline-size;
134
+ container-name: dialog;
135
+ font-size: var(--font-size-md);
136
+ isolation: isolate;
137
+ }
138
+
139
+ .ui-dialog[open] {
140
+ grid-template-rows: minmax(0, 1fr);
141
+ min-block-size: 0;
142
+ }
143
+
144
+ [data-slot~="dialog-close"] {
145
+ position: absolute;
146
+ top: var(--gap-xs);
147
+ right: var(--gap-xs);
148
+ z-index: 50;
149
+ }
150
+
151
+ [data-slot~="dialog-close"] > svg {
152
+ inline-size: var(--step-4);
153
+ block-size: var(--step-4);
154
+ pointer-events: none;
155
+ justify-content: center;
156
+ align-items: center;
157
+ display: flex;
158
+ padding: 0;
159
+ }
160
+
161
+ [data-slot~="dialog-content"] {
162
+ display: grid;
163
+ align-self: center;
164
+ grid-template-rows: auto minmax(0, 1fr) auto;
165
+ position: relative;
166
+ min-block-size: 0;
167
+ overflow: clip;
168
+ }
169
+
170
+ [data-slot~="dialog-header"] {
171
+ display: flex;
172
+ flex-direction: column;
173
+ padding-inline: var(--gap-sm);
174
+ padding-block-start: var(--gap-sm);
175
+ }
176
+
177
+ /* Sticky top edge */
178
+ [data-slot~="dialog-header"]::after {
179
+ content: "";
180
+ display: block;
181
+ position: absolute;
182
+ top: 100%;
183
+ inline-size: 100%;
184
+ block-size: var(--gap-md);
185
+ background: linear-gradient(to top, transparent, var(--ui-dialog-background));
186
+ }
187
+
188
+ [data-slot~="dialog-body"] {
189
+ display: grid;
190
+ padding-inline: var(--gap-sm);
191
+ padding-block: var(--gap-md);
192
+ min-block-size: 0;
193
+ min-block-size: var(--gap-xl);
194
+ overflow-x: clip;
195
+ overflow-y: auto;
196
+ scrollbar-gutter: stable both-edges;
197
+ }
198
+
199
+ [data-slot~="dialog-footer"] {
200
+ block-size: fit-content;
201
+ position: sticky;
202
+ bottom: 0;
203
+ display: flex;
204
+ justify-content: flex-end;
205
+ align-self: end;
206
+ flex-shrink: 0;
207
+ gap: var(--gap-xs);
208
+ padding: var(--gap-sm);
209
+ border-top: 1px solid var(--border);
210
+ background-color: var(--ui-dialog-background);
211
+ }
212
+
213
+ .ui-dialog[data-size="article"] {
214
+ --ui-dialog-width: var(--article-md);
215
+ }
216
+
217
+ .ui-dialog[data-size="container"] {
218
+ --ui-dialog-width: var(--breakpoint-md);
219
+ }
220
+
221
+ .ui-dialog[data-size="screen"] {
222
+ --ui-dialog-width: 100vi;
223
+ --ui-dialog-height: 100svh;
224
+ --ui-dialog-radius: 0;
225
+ --ui-dialog-shadow: none;
226
+ max-inline-size: 100vi;
227
+ max-block-size: 100svh;
228
+ }
229
+ }
@@ -0,0 +1,90 @@
1
+ <button class="ui-button" type="button" command="show-modal" commandfor="dialog-example-1">
2
+ Dialog
3
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
4
+ <rect width="256" height="256" fill="none" />
5
+ <line
6
+ x1="64"
7
+ y1="192"
8
+ x2="192"
9
+ y2="64"
10
+ fill="none"
11
+ stroke="currentColor"
12
+ stroke-linecap="round"
13
+ stroke-linejoin="round"
14
+ stroke-width="16"
15
+ />
16
+ <polyline
17
+ points="88 64 192 64 192 168"
18
+ fill="none"
19
+ stroke="currentColor"
20
+ stroke-linecap="round"
21
+ stroke-linejoin="round"
22
+ stroke-width="16"
23
+ />
24
+ </svg>
25
+ </button>
26
+ <dialog id="dialog-example-1" class="ui-dialog" closedby="any">
27
+ <div data-slot="dialog-content">
28
+ <header data-slot="dialog-header">
29
+ <h2 class="text-lg font-heading font-strong">Dialog title</h2>
30
+ <p class="text-muted-foreground">
31
+ This dialog was opened using an
32
+ <a
33
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Invoker_Commands_API"
34
+ target="_blank"
35
+ class="text-link"
36
+ >invoker command</a
37
+ >.
38
+ </p>
39
+ </header>
40
+ <div data-slot="dialog-body">
41
+ <p>Set the size of the dialog with the <code>data-size</code> attribute.</p>
42
+ </div>
43
+ <footer data-slot="dialog-footer">
44
+ <button class="ui-button" type="button" commandfor="dialog-example-1" command="close">
45
+ Cancel
46
+ </button>
47
+ <button
48
+ class="ui-button"
49
+ data-variant="primary"
50
+ commandfor="dialog-example-1"
51
+ command="close"
52
+ >
53
+ Accept
54
+ </button>
55
+ </footer>
56
+ </div>
57
+ <button
58
+ class="ui-button"
59
+ data-slot="dialog-close"
60
+ data-size="icon"
61
+ data-variant="ghost"
62
+ type="button"
63
+ commandfor="dialog-example-1"
64
+ command="close"
65
+ >
66
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
67
+ <rect width="256" height="256" fill="none" />
68
+ <line
69
+ x1="200"
70
+ y1="56"
71
+ x2="56"
72
+ y2="200"
73
+ stroke="currentColor"
74
+ stroke-linecap="round"
75
+ stroke-linejoin="round"
76
+ stroke-width="16"
77
+ />
78
+ <line
79
+ x1="200"
80
+ y1="200"
81
+ x2="56"
82
+ y2="56"
83
+ stroke="currentColor"
84
+ stroke-linecap="round"
85
+ stroke-linejoin="round"
86
+ stroke-width="16"
87
+ />
88
+ </svg>
89
+ </button>
90
+ </dialog>
@@ -0,0 +1,278 @@
1
+ /**
2
+ * fields.css: Shared form field family (Tier 3 owner for --ui-field-*)
3
+ *
4
+ * @layer variables, components
5
+ * @requires layers.css, _variables.css
6
+ * @uses :user-invalid: validation after commit (not while typing)
7
+ * @uses :has(:user-invalid): label/hint/error crossfade
8
+ * @uses @starting-style + visibility allow-discrete: hint <-> error swap
9
+ * @uses color-mix(): destructive field tint on invalid
10
+ * @tokens --ui-field-*, --ui-field-group-* (Tier 3 owner; @layer variables)
11
+ * @consumedby input.css, textarea.css, select.css, input-group.css,
12
+ * password-group.css, otp.css, radio.css (.ui-radio-group),
13
+ * autocomplete.css, combobox.css, command.css
14
+ */
15
+
16
+ @layer variables {
17
+ :root {
18
+ --ui-field-background: var(--input);
19
+ --ui-field-background--hover: var(--input);
20
+ --ui-field-background--focus: var(--background);
21
+
22
+ --ui-field-foreground: var(--input-foreground);
23
+
24
+ --ui-field-border: var(--border);
25
+ --ui-field-border--hover: var(--primary);
26
+ --ui-field-border--focus: var(--primary);
27
+
28
+ --ui-field-label-color: inherit;
29
+ --ui-field-ring-color: var(--ring-color);
30
+ --ui-field-radius: var(--radius-md);
31
+ --ui-field-button-radius: var(--radius-sm);
32
+ --ui-field-height: var(--step-8);
33
+ --ui-field-font-size: var(--font-size-sm);
34
+ --ui-field-line-height: 1;
35
+ --ui-field-padding: var(--step-2_5);
36
+ --ui-field-addon-padding: var(--step-1);
37
+ --ui-field-gap: var(--step-2);
38
+ --ui-field-option-gap: var(--step-px);
39
+ --ui-field-icon-size: var(--step-4);
40
+
41
+ --ui-field-display: grid;
42
+ --ui-field-template-columns: 1fr;
43
+ --ui-field-align-self: flex-start;
44
+ --ui-field-inline-size: 100%;
45
+
46
+ /* Reveal transitions/animations */
47
+ --ui-field-hint-translate--start: 0 calc(var(--step-1) * -1);
48
+ --ui-field-hint-translate--end: 0 0;
49
+
50
+ --ui-field-group-display: grid;
51
+ --ui-field-group-border: 1px solid transparent;
52
+ --ui-field-group-background: transparent;
53
+ --ui-field-group-padding: 0;
54
+ --ui-field-group-margin: 0;
55
+ --ui-field-group-gap: var(--gap-xs);
56
+ --ui-field-group-radius: var(--radius-lg);
57
+ }
58
+ }
59
+
60
+ @layer zazz.components {
61
+ /* ===========================================================================
62
+ FORM: global form behaviour shared across every control
63
+ - This file holds only the cross-control glue: the shared field-level tokens,
64
+ the disabled state, the .ui-field layout wrapper, .ui-field-group / .ui-radio-group
65
+ fieldsets, and validation messaging.
66
+ Each control lives in its own file:
67
+ .ui-input -> input.css
68
+ .ui-textarea -> textarea.css
69
+ .ui-select -> select.css
70
+ .ui-input-group -> input-group.css
71
+ checkbox -> _reset.css (input[type="checkbox"])
72
+ switch -> _reset.css (input[role="switch"])
73
+ .ui-radio -> radio.css
74
+ =========================================================================== */
75
+
76
+ /* ---------------------------------------------------------------------------
77
+ SHARED FIELD TOKENS: Tier-3 shared family, owned here.
78
+ - .ui-input / .ui-textarea / .ui-select / .ui-input-group all share the same surface
79
+ treatment so a text input, a dropdown, and a message box read as one family.
80
+ Each control aliases these locals so a single override retunes the whole set.
81
+ - Sibling control files only remap these --ui-field-* tokens; this is the owner.
82
+ --------------------------------------------------------------------------- */
83
+
84
+ /* ---------------------------------------------------------------------------
85
+ SHARED DISABLED STATE
86
+ --------------------------------------------------------------------------- */
87
+
88
+ .ui-input:disabled,
89
+ .ui-textarea:disabled,
90
+ .ui-select:disabled,
91
+ .ui-input-file:disabled,
92
+ .ui-input-color:disabled,
93
+ .ui-input-group:disabled,
94
+ .ui-password-group:disabled,
95
+ input[type="checkbox"]:disabled,
96
+ .ui-radio:disabled,
97
+ .ui-input-group:has(:disabled) {
98
+ opacity: 0.5;
99
+ cursor: not-allowed;
100
+ }
101
+
102
+ /* ---------------------------------------------------------------------------
103
+ FIELD WRAPPER: .ui-field (label + control + hint/error)
104
+ - Optional layout helper. Validation messaging uses :user-invalid so errors
105
+ surface only after the user commits a value (blur/submit), never while typing.
106
+ --------------------------------------------------------------------------- */
107
+
108
+ .ui-field {
109
+ /* --ui-field-gap differs from the control family default (step-2) */
110
+ --ui-field-gap: var(--step-1);
111
+
112
+ display: var(--ui-field-display);
113
+ grid-template-columns: var(--ui-field-template-columns);
114
+ gap: var(--ui-field-gap);
115
+ align-self: var(--ui-field-align-self);
116
+ inline-size: var(--ui-field-inline-size);
117
+ }
118
+
119
+ .ui-field > :not([data-slot~="field-label"]):not([data-slot~="field-description"]) {
120
+ grid-row: 2;
121
+ grid-column: 1;
122
+ }
123
+
124
+ /* Label sits top-left above the control by default */
125
+ [data-slot~="field-label"] {
126
+ grid-row: 1;
127
+ grid-column: 1;
128
+ align-self: start;
129
+ color: var(--ui-field-label-color);
130
+ font-size: var(--font-size-sm);
131
+ font-weight: var(--font-weight-strong);
132
+ text-align: start;
133
+ min-inline-size: max-content;
134
+ }
135
+
136
+ /* ---------------------------------------------------------------------------
137
+ FIELD DESCRIPTION: [data-slot~="field-description"] (wrapper for hint + error)
138
+ - Occupies a stable grid slot so hint/error swaps never cause layout shift.
139
+ The wrapper keeps a fixed block-size while the children crossfade inside it.
140
+ --------------------------------------------------------------------------- */
141
+
142
+ [data-slot~="field-description"] {
143
+ grid-row: 3;
144
+ grid-column: 1;
145
+ display: grid;
146
+ grid-template-areas: "msg";
147
+ font-size: var(--font-size-xs);
148
+ }
149
+
150
+ /* Hint and error stack in the same grid area: only one is visible at a time */
151
+ [data-slot~="field-hint"],
152
+ [data-slot~="field-error"] {
153
+ grid-area: msg;
154
+ display: inline-flex;
155
+ transition:
156
+ opacity var(--default-transition-duration) var(--default-transition-timing-function),
157
+ translate var(--default-transition-duration) var(--default-transition-timing-function),
158
+ visibility var(--default-transition-duration) var(--default-transition-timing-function)
159
+ allow-discrete;
160
+ }
161
+
162
+ [data-slot~="field-hint"] {
163
+ color: var(--muted-foreground);
164
+ opacity: 1;
165
+ translate: var(--ui-field-hint-translate--end);
166
+ visibility: visible;
167
+ }
168
+
169
+ [data-slot~="field-error"] {
170
+ color: var(--destructive);
171
+ opacity: 0;
172
+ translate: var(--ui-field-hint-translate--start);
173
+ visibility: hidden;
174
+ }
175
+
176
+ /* After interaction: invalid controls turn destructive, reveal the error */
177
+ :where(.ui-field:has(:user-invalid)) [data-slot~="field-hint"] {
178
+ opacity: 0;
179
+ translate: var(--ui-field-hint-translate--start);
180
+ visibility: hidden;
181
+
182
+ @starting-style {
183
+ opacity: 1;
184
+ translate: var(--ui-field-hint-translate--end);
185
+ visibility: visible;
186
+ }
187
+ }
188
+
189
+ :where(.ui-field:has(:user-invalid)) [data-slot~="field-error"] {
190
+ opacity: 1;
191
+ translate: var(--ui-field-hint-translate--end);
192
+ visibility: visible;
193
+
194
+ @starting-style {
195
+ opacity: 0;
196
+ translate: var(--ui-field-hint-translate--start);
197
+ visibility: hidden;
198
+ }
199
+ }
200
+
201
+ .ui-input:user-invalid,
202
+ .ui-textarea:user-invalid,
203
+ .ui-select:user-invalid,
204
+ .ui-input-file:user-invalid,
205
+ .ui-input-group:has(:user-invalid),
206
+ .ui-password-group:has(:user-invalid) {
207
+ --ui-field-background: color-mix(in oklch, var(--destructive) 5%, var(--input));
208
+ --ui-field-background--hover: color-mix(in oklch, var(--destructive) 10%, var(--input));
209
+ --ui-field-border: var(--destructive);
210
+ --ui-field-border--hover: var(--destructive);
211
+ --ui-field-border--focus: var(--destructive);
212
+ --ui-field-ring-color: var(--destructive);
213
+
214
+ border-color: var(--destructive);
215
+ }
216
+
217
+ :where(.ui-field:has(:user-invalid)) [data-slot~="field-label"] {
218
+ --ui-field-label-color: var(--destructive);
219
+ }
220
+
221
+ :where(.ui-field:has(:user-invalid)) ::placeholder {
222
+ --placeholder-color: var(--destructive);
223
+ }
224
+
225
+ /* ---------------------------------------------------------------------------
226
+ FIELD GROUP: .ui-field-group (+ .ui-radio-group in radio.css)
227
+ - Semantic <fieldset> wrapper for a labelled set of related controls (a radio
228
+ group, a set of checkboxes/switches). Resets browser chrome and stacks
229
+ children; the <legend> names the whole set.
230
+ - Use a fieldset/legend ONLY when the legend labels a genuine group. A single
231
+ control (or several independently-labelled fields) should carry its own
232
+ [data-slot~="field-label"] instead, never lean on the legend as a stand-in label.
233
+ --------------------------------------------------------------------------- */
234
+
235
+ .ui-field-group,
236
+ .ui-radio-group {
237
+ display: var(--ui-field-group-display);
238
+ background-color: var(--ui-field-group-background);
239
+ gap: var(--ui-field-group-gap);
240
+ border: var(--ui-field-group-border);
241
+ border-radius: var(--ui-field-group-radius);
242
+ padding: var(--ui-field-group-padding);
243
+ margin: var(--ui-field-group-margin);
244
+ }
245
+
246
+ /* Legend reads as the group label: same weight and size as a [data-slot~="field-label"] */
247
+ .ui-field-group > legend,
248
+ .ui-radio-group > legend {
249
+ padding: 0;
250
+ margin-block: 0 var(--step-1_5);
251
+ color: var(--ui-field-label-color, inherit);
252
+ font-size: var(--font-size-sm);
253
+ font-weight: var(--font-weight-strong);
254
+ }
255
+
256
+ /* ===========================================================================
257
+ FIELD DIRECTION VARIANTS
258
+ =========================================================================== */
259
+
260
+ /* Inline layout for checkbox/radio/switch: control beside its label */
261
+ .ui-field[data-orientation="horizontal"] {
262
+ --ui-field-horizontal-display: flex;
263
+ --ui-field-horizontal-flex-direction: row;
264
+ --ui-field-horizontal-align-items: center;
265
+ --ui-field-horizontal-justify-content: flex-start;
266
+ --ui-field-horizontal-gap: var(--gap-xs);
267
+
268
+ display: var(--ui-field-horizontal-display);
269
+ flex-direction: var(--ui-field-horizontal-flex-direction);
270
+ align-items: var(--ui-field-horizontal-align-items);
271
+ justify-content: var(--ui-field-horizontal-justify-content);
272
+ gap: var(--ui-field-horizontal-gap);
273
+ }
274
+
275
+ .ui-field[data-orientation="horizontal"] [data-slot~="field-label"] {
276
+ align-self: center;
277
+ }
278
+ }
@@ -0,0 +1,19 @@
1
+ <label class="ui-input-group">
2
+ <input class="ui-input" type="text" placeholder="Placeholder" />
3
+ <span data-slot="input-group-addon">
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ aria-hidden="true"
13
+ >
14
+ <line x1="4" y1="6" x2="20" y2="6" />
15
+ <line x1="4" y1="12" x2="20" y2="12" />
16
+ <line x1="4" y1="18" x2="20" y2="18" />
17
+ </svg>
18
+ </span>
19
+ </label>
@@ -0,0 +1,18 @@
1
+ <label class="ui-input-group">
2
+ <input class="ui-input" type="search" placeholder="Search…" aria-label="Search" />
3
+ <span data-slot="input-group-addon" data-align="inline-end">
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ aria-hidden="true"
13
+ >
14
+ <circle cx="11" cy="11" r="8" />
15
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
16
+ </svg>
17
+ </span>
18
+ </label>