@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,114 @@
1
+ /**
2
+ * input.css — Text input (.ui-input)
3
+ *
4
+ * @layer variables, components
5
+ * @requires layers.css, _variables.css, fields.css, _reset.css
6
+ * @uses ::-webkit-calendar-picker-indicator — date/time picker chrome (WebKit)
7
+ * @uses mask — calendar icon (not background-image, for color: currentColor)
8
+ * @tokens --ui-input-* (@layer variables)
9
+ */
10
+
11
+ @layer variables {
12
+ :root {
13
+ --ui-input-inline-size: 100%;
14
+ --ui-input-min-inline-size: 16ch;
15
+ --ui-input-padding-inline-start: var(--ui-field-padding);
16
+ --ui-input-padding-inline-end: var(--ui-field-padding);
17
+ --ui-input-font-size: var(--ui-field-font-size);
18
+ --ui-input-line-height: var(--ui-field-line-height);
19
+ --ui-input-border: 1px solid var(--ui-field-border);
20
+ --ui-input-border-radius: var(--ui-field-radius);
21
+
22
+ --ui-input-calendar-picker-color: currentColor;
23
+ --ui-input-calendar-picker-icon-size: var(--step-4);
24
+ --ui-input-calendar-picker-size: var(--step-6);
25
+ --ui-input-calendar-picker-radius: var(--radius-sm);
26
+ --ui-input-calendar-picker-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'/%3E%3Crect x='40' y='40' width='176' height='176' rx='8' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='176' y1='24' x2='176' y2='56' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='80' y1='24' x2='80' y2='56' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='40' y1='88' x2='216' y2='88' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
27
+ }
28
+ }
29
+
30
+ @layer zazz.components {
31
+ /* ===========================================================================
32
+ TEXT INPUTS — .ui-input
33
+ - One class for every text-like type (text, search, email, number, date, …);
34
+ the type only changes the picker/keyboard, not the box.
35
+ - Shares the --ui-field-* tokens defined in fields.css so it aligns with .ui-select,
36
+ .ui-textarea, and .ui-button.
37
+ =========================================================================== */
38
+
39
+ .ui-input {
40
+ inline-size: var(--ui-input-inline-size);
41
+ min-inline-size: var(--ui-input-min-inline-size);
42
+ block-size: var(--ui-field-height);
43
+ padding-inline-start: var(--ui-input-padding-inline-start);
44
+ padding-inline-end: var(--ui-input-padding-inline-end);
45
+
46
+ font-size: var(--ui-input-font-size);
47
+ line-height: var(--ui-input-line-height);
48
+ color: var(--ui-field-foreground);
49
+ background-color: var(--ui-field-background);
50
+
51
+ border: var(--ui-input-border);
52
+ border-radius: var(--ui-input-border-radius);
53
+
54
+ /* ring renders as box-shadow; transparent outline twin keeps focus visible
55
+ in forced-colors / high-contrast modes */
56
+ --_ring-offset-width: 0px;
57
+ --_ring-width: 0px;
58
+ --_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
59
+ box-shadow:
60
+ 0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
61
+ 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width)) var(--_ring, var(--ring));
62
+ outline: var(--outline-width) var(--outline-style) transparent;
63
+ outline-offset: var(--outline-offset);
64
+
65
+ transition: var(--default-transition);
66
+ }
67
+
68
+ .ui-input:hover {
69
+ border-color: var(--ui-field-border--hover);
70
+ background-color: var(--ui-field-background--hover);
71
+ }
72
+
73
+ .ui-input:focus-within {
74
+ background-color: var(--ui-field-background--focus);
75
+ border-color: var(--ui-field-border--focus);
76
+ --_ring-offset-width: var(--ring-offset-width);
77
+ --_ring-width: var(--ring-width);
78
+ outline-color: transparent;
79
+ }
80
+
81
+ .ui-input[type="date"],
82
+ .ui-input[type="time"],
83
+ .ui-input[type="datetime-local"] {
84
+ --ui-input-padding-inline-end: var(--step-1_5);
85
+ }
86
+
87
+ /* Native date/time controls keep their picker indicator tinted to the text */
88
+ .ui-input::-webkit-calendar-picker-indicator {
89
+ cursor: pointer;
90
+ -webkit-appearance: none;
91
+
92
+ margin: 0;
93
+ padding: 0;
94
+ inline-size: var(--ui-input-calendar-picker-size);
95
+ block-size: var(--ui-input-calendar-picker-size);
96
+ border-radius: var(--ui-input-calendar-picker-radius);
97
+
98
+ transition:
99
+ opacity var(--default-transition-duration) var(--default-transition-timing-function),
100
+ display var(--default-transition-duration) var(--default-transition-timing-function)
101
+ allow-discrete;
102
+
103
+ mask: var(--ui-input-calendar-picker-mask) no-repeat center /
104
+ var(--ui-input-calendar-picker-icon-size);
105
+ background-size: var(--ui-input-calendar-picker-icon-size);
106
+ background-color: var(--ui-input-calendar-picker-color);
107
+ background-repeat: no-repeat;
108
+ background-position: center;
109
+ }
110
+
111
+ .ui-input::-webkit-calendar-picker-indicator:is(:hover) {
112
+ opacity: 0.5;
113
+ }
114
+ }
@@ -0,0 +1,61 @@
1
+ <div class="ui-field">
2
+ <label data-slot="field-label" for="f-name">Name</label>
3
+ <input
4
+ class="ui-input"
5
+ id="f-name"
6
+ name="name"
7
+ type="text"
8
+ inputmode="text"
9
+ placeholder="Ada Lovelace"
10
+ autocomplete="name"
11
+ autocapitalize="words"
12
+ enterkeyhint="next"
13
+ />
14
+ </div>
15
+ <div class="ui-field">
16
+ <label data-slot="field-label" for="f-email">Email</label>
17
+ <input
18
+ class="ui-input"
19
+ id="f-email"
20
+ name="email"
21
+ type="email"
22
+ inputmode="email"
23
+ required
24
+ placeholder="you@example.com"
25
+ autocomplete="email"
26
+ autocapitalize="off"
27
+ spellcheck="false"
28
+ enterkeyhint="next"
29
+ aria-describedby="f-email-hint"
30
+ />
31
+ <div data-slot="field-description">
32
+ <span data-slot="field-hint" id="f-email-hint"
33
+ >We'll never sell or share your email address.</span
34
+ >
35
+ <span data-slot="field-error" role="alert">Please enter a valid email address.</span>
36
+ </div>
37
+ </div>
38
+ <div class="ui-field">
39
+ <label data-slot="field-label" for="f-phone">Phone</label>
40
+ <input
41
+ class="ui-input"
42
+ id="f-phone"
43
+ name="phone"
44
+ type="tel"
45
+ inputmode="tel"
46
+ placeholder="+1 (555) 012-3456"
47
+ autocomplete="tel"
48
+ enterkeyhint="next"
49
+ />
50
+ </div>
51
+ <div class="ui-field">
52
+ <label data-slot="field-label" for="f-date">Datetime</label>
53
+ <input
54
+ class="ui-input"
55
+ id="f-date"
56
+ name="date"
57
+ type="datetime-local"
58
+ inputmode="none"
59
+ autocomplete="off"
60
+ />
61
+ </div>
@@ -0,0 +1,108 @@
1
+ <div class="ui-field">
2
+ <label data-slot="field-label" for="f-login-password">Password</label>
3
+ <ui-password>
4
+ <label class="ui-password-group">
5
+ <input
6
+ class="ui-input"
7
+ id="f-login-password"
8
+ name="password"
9
+ type="password"
10
+ autocomplete="new-password"
11
+ minlength="8"
12
+ required
13
+ placeholder="••••••••"
14
+ aria-describedby="f-login-password-hint f-login-password-warning"
15
+ />
16
+ <span data-slot="password-group-addon" data-align="inline-end">
17
+ <button
18
+ class="ui-button"
19
+ data-slot="password-group-toggle"
20
+ id="f-login-password-toggle"
21
+ data-variant="ghost"
22
+ data-size="icon-sm"
23
+ type="button"
24
+ aria-pressed="false"
25
+ aria-label="Show password"
26
+ aria-describedby="f-login-password-warning"
27
+ >
28
+ <svg
29
+ data-slot="password-group-icon password-group-icon-show"
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ viewBox="0 0 256 256"
32
+ aria-hidden="true"
33
+ >
34
+ <rect width="256" height="256" fill="none" />
35
+ <path
36
+ d="M128,56C48,56,16,128,16,128s32,72,112,72,112-72,112-72S208,56,128,56Z"
37
+ fill="none"
38
+ stroke="currentColor"
39
+ stroke-linecap="round"
40
+ stroke-linejoin="round"
41
+ stroke-width="16"
42
+ />
43
+ <circle
44
+ cx="128"
45
+ cy="128"
46
+ r="40"
47
+ fill="none"
48
+ stroke="currentColor"
49
+ stroke-linecap="round"
50
+ stroke-linejoin="round"
51
+ stroke-width="16"
52
+ />
53
+ </svg>
54
+ <svg
55
+ data-slot="password-group-icon password-group-icon-hide"
56
+ xmlns="http://www.w3.org/2000/svg"
57
+ viewBox="0 0 256 256"
58
+ aria-hidden="true"
59
+ >
60
+ <rect width="256" height="256" fill="none" />
61
+ <line
62
+ x1="48"
63
+ y1="40"
64
+ x2="208"
65
+ y2="216"
66
+ fill="none"
67
+ stroke="currentColor"
68
+ stroke-linecap="round"
69
+ stroke-linejoin="round"
70
+ stroke-width="16"
71
+ />
72
+ <path
73
+ d="M154.9,157.6A40,40,0,0,1,101,98.4"
74
+ fill="none"
75
+ stroke="currentColor"
76
+ stroke-linecap="round"
77
+ stroke-linejoin="round"
78
+ stroke-width="16"
79
+ />
80
+ <path
81
+ d="M73.8,69.7C33.6,90.6,16,128,16,128s32,72,112,72a118.1,118.1,0,0,0,54.1-12.8"
82
+ fill="none"
83
+ stroke="currentColor"
84
+ stroke-linecap="round"
85
+ stroke-linejoin="round"
86
+ stroke-width="16"
87
+ />
88
+ <path
89
+ d="M208.6,169.1C229.8,149.1,240,128,240,128S208,56,128,56a126,126,0,0,0-20.5,1.6"
90
+ fill="none"
91
+ stroke="currentColor"
92
+ stroke-linecap="round"
93
+ stroke-linejoin="round"
94
+ stroke-width="16"
95
+ />
96
+ </svg>
97
+ </button>
98
+ </span>
99
+ </label>
100
+ </ui-password>
101
+ <div data-slot="field-description">
102
+ <span data-slot="field-hint" id="f-login-password-hint">Use eight or more characters.</span>
103
+ <span data-slot="field-error" role="alert">Password must be at least 8 characters.</span>
104
+ </div>
105
+ <span class="sr-only" id="f-login-password-warning"
106
+ >Warning: showing the password makes it visible to anyone near your screen.</span
107
+ >
108
+ </div>
@@ -0,0 +1,215 @@
1
+ /**
2
+ * input-group.css — Input group (.ui-input-group)
3
+ *
4
+ * @layer variables, components
5
+ * @requires layers.css, _variables.css, fields.css, input.css,
6
+ * textarea.css, button.css
7
+ * @uses :focus-within — lifts shell ring/border as one field
8
+ * @uses :has() — restore padding when addons absent; invalid text color
9
+ * @uses data-align on [data-slot~="input-group-addon"] — inline-start/end, block-start/end
10
+ * @tokens --ui-input-group-* (@layer variables)
11
+ */
12
+
13
+ @layer variables {
14
+ :root {
15
+ --ui-input-group-display: flex;
16
+ --ui-input-group-wrap: wrap;
17
+ --ui-input-group-align: center;
18
+ --ui-input-group-gap: var(--step-1);
19
+ --ui-input-group-inline-size: 100%;
20
+ --ui-input-group-min-block-size: var(--ui-field-height);
21
+ --ui-input-group-padding: 0;
22
+ --ui-input-group-cursor: text;
23
+ --ui-input-group-text-color: var(--muted-foreground);
24
+ --ui-input-group-text-weight: var(--font-weight-strong);
25
+ --ui-input-group-text-size: var(--font-size-sm);
26
+ --ui-input-group-textarea-min-block-size: 3lh;
27
+ --ui-input-group-textarea-padding-inline: var(--step-2);
28
+ --ui-input-group-textarea-padding-block: var(--step-1_5);
29
+
30
+ --ui-input-group-shadow: 0 0 transparent;
31
+ }
32
+ }
33
+
34
+ @layer zazz.components {
35
+ /* ===========================================================================
36
+ INPUT GROUP — .ui-input-group (shadcn-style composition)
37
+ - A single bordered shell that fuses a text control with addons (icons, text,
38
+ kbd) and buttons. The nested control goes borderless/transparent so the group
39
+ reads as one field; :focus-within lifts the whole shell.
40
+ - Addons are placed AFTER the control in the markup (for predictable tab/focus
41
+ order) and positioned with data-align:
42
+ inline-start (default) · inline-end · block-start · block-end
43
+ block-* span the full width on their own row — that's how a textarea grows a
44
+ toolbar above or below it.
45
+ - Composition: .ui-input-group > [.ui-input | .ui-textarea] + [data-slot~="input-group-addon"]
46
+ where an addon may hold [data-slot~="input-group-text"], an <svg>, <kbd>, or .ui-button.
47
+ - The shell is a <label> for click-to-focus, but it is NOT the field's label.
48
+ Wrap it in a .ui-field with a real [data-slot~="field-label"][for] (and optional [data-slot~="field-hint"]
49
+ / [data-slot~="field-error"]) so the control is named by visible text, never by a legend.
50
+ - Shares the --ui-field-* tokens (height, radius, surface) defined in fields.css.
51
+ =========================================================================== */
52
+
53
+ .ui-input-group {
54
+ display: var(--ui-input-group-display);
55
+ flex-wrap: var(--ui-input-group-wrap);
56
+ align-items: var(--ui-input-group-align);
57
+ gap: var(--ui-input-group-gap);
58
+ inline-size: var(--ui-input-group-inline-size);
59
+ min-block-size: var(--ui-input-group-min-block-size);
60
+ padding: var(--ui-input-group-padding);
61
+
62
+ /* The shell is a <label>: clicking a non-interactive addon focuses the
63
+ nested control, so the whole field reads as one clickable target. */
64
+ cursor: var(--ui-input-group-cursor);
65
+
66
+ color: var(--ui-field-foreground);
67
+ background-color: var(--ui-field-background);
68
+ border: 1px solid var(--ui-field-border);
69
+ border-radius: var(--ui-field-radius);
70
+
71
+ --_ring-offset-width: 0px;
72
+ --_ring-width: 0px;
73
+ --_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
74
+ box-shadow:
75
+ 0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
76
+ 0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width)) var(--_ring, var(--ring)),
77
+ var(--ui-input-group-shadow);
78
+
79
+ outline: var(--outline-width) var(--outline-style) transparent;
80
+ outline-offset: var(--outline-offset);
81
+
82
+ transition: var(--default-transition);
83
+ }
84
+
85
+ .ui-input-group:hover {
86
+ background-color: var(--ui-field-background--hover);
87
+ border-color: var(--ui-field-border--hover);
88
+ }
89
+
90
+ .ui-input-group:focus-within {
91
+ background-color: var(--ui-field-background--focus);
92
+ border-color: var(--ui-field-border--focus);
93
+ --_ring-offset-width: var(--ring-offset-width);
94
+ --_ring-width: var(--ring-width);
95
+ outline-color: transparent;
96
+ }
97
+
98
+ /* Nested control sheds its own chrome and fills the row */
99
+ .ui-input-group .ui-input,
100
+ .ui-input-group .ui-textarea {
101
+ flex: 1;
102
+ min-inline-size: 0;
103
+ background-color: transparent;
104
+ border: none;
105
+ border-radius: 0;
106
+ outline: none;
107
+ box-shadow: none;
108
+ }
109
+
110
+ .ui-input-group .ui-input {
111
+ flex: 1;
112
+ padding-inline: 0;
113
+
114
+ &:is(:hover, :active, :focus) {
115
+ background-color: transparent;
116
+ }
117
+ }
118
+
119
+ /* Restore the control's own inline padding on whichever edge has no addon, so
120
+ text never sits flush against the shell. An addon already supplies the
121
+ spacing on its side; block-* addons take their own row and don't count here.
122
+ (Default/no-data-align addons are inline-start.) */
123
+ .ui-input-group:not(
124
+ :has(
125
+ [data-slot~="input-group-addon"]:not([data-align]),
126
+ [data-slot~="input-group-addon"][data-align="inline-start"]
127
+ )
128
+ )
129
+ .ui-input {
130
+ padding-inline-start: var(--ui-field-padding);
131
+ }
132
+
133
+ .ui-input-group:not(:has([data-slot~="input-group-addon"][data-align="inline-end"])) .ui-input {
134
+ padding-inline-end: var(--ui-field-padding);
135
+ }
136
+
137
+ /* A textarea claims the full width; addons stack above/below via block-* */
138
+ .ui-input-group .ui-textarea {
139
+ flex-basis: 100%;
140
+ min-block-size: var(--ui-input-group-textarea-min-block-size);
141
+ padding-inline: var(--ui-input-group-textarea-padding-inline);
142
+ padding-block: var(--ui-input-group-textarea-padding-block);
143
+ resize: none;
144
+ }
145
+
146
+ /* Addon — groups icons, text, kbd, or buttons together */
147
+ [data-slot~="input-group-addon"] {
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
+ flex-shrink: 0;
152
+ gap: var(--step-1);
153
+ color: var(--muted-foreground);
154
+ white-space: nowrap;
155
+ block-size: var(--ui-field-height);
156
+ min-inline-size: var(--ui-field-height);
157
+ padding-inline: var(--ui-field-addon-padding);
158
+ }
159
+
160
+ [data-slot~="input-group-addon"] > svg {
161
+ inline-size: var(--ui-field-icon-size);
162
+ block-size: var(--ui-field-icon-size);
163
+ }
164
+
165
+ /* Alignment — inline-start is the default (addon visually leads the control) */
166
+ [data-slot~="input-group-addon"]:not([data-align]),
167
+ [data-slot~="input-group-addon"][data-align="inline-start"] {
168
+ order: -1;
169
+ }
170
+
171
+ [data-slot~="input-group-addon"][data-align="inline-end"] {
172
+ order: 1;
173
+ }
174
+
175
+ [data-slot~="input-group-addon"][data-align="block-start"] {
176
+ order: -2;
177
+ flex-basis: 100%;
178
+ padding-block: var(--ui-field-addon-padding);
179
+ align-items: flex-start;
180
+ }
181
+
182
+ [data-slot~="input-group-addon"][data-align="block-end"] {
183
+ order: 2;
184
+ flex-basis: 100%;
185
+ padding-block: var(--ui-field-addon-padding);
186
+ align-items: flex-end;
187
+ }
188
+
189
+ /* Text addon — units, protocols, @handles ("https://", "USD", "@user") */
190
+ [data-slot~="input-group-text"] {
191
+ display: inline-flex;
192
+ align-items: center;
193
+ gap: var(--gap-xs);
194
+ padding-inline: var(--ui-field-addon-padding);
195
+ font-size: var(--ui-input-group-text-size);
196
+ font-weight: var(--ui-input-group-text-weight);
197
+ color: var(--ui-input-group-text-color);
198
+ min-inline-size: max-content;
199
+ }
200
+
201
+ [data-slot~="input-group-text"] > svg {
202
+ inline-size: var(--ui-field-icon-size);
203
+ block-size: var(--ui-field-icon-size);
204
+ }
205
+
206
+ /* Buttons embedded in a group shrink to nest cleanly inside the shell */
207
+ .ui-input-group .ui-button {
208
+ flex-shrink: 0;
209
+ border-radius: var(--ui-field-button-radius);
210
+ }
211
+
212
+ :where(.ui-field:has(:user-invalid)) [data-slot~="input-group-text"] {
213
+ --ui-input-group-text-color: var(--destructive);
214
+ }
215
+ }
@@ -0,0 +1,132 @@
1
+ <div class="ui-field">
2
+ <label data-slot="field-label" for="f-search">Search</label>
3
+ <label class="ui-input-group">
4
+ <input
5
+ class="ui-input"
6
+ id="f-search"
7
+ type="search"
8
+ name="q"
9
+ inputmode="search"
10
+ placeholder="Search…"
11
+ autocomplete="off"
12
+ spellcheck="false"
13
+ enterkeyhint="search"
14
+ aria-describedby="f-search-hint"
15
+ />
16
+ <span data-slot="input-group-addon">
17
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
18
+ <rect width="256" height="256" fill="none" />
19
+ <circle
20
+ cx="112"
21
+ cy="112"
22
+ r="80"
23
+ fill="none"
24
+ stroke="currentColor"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ stroke-width="16"
28
+ />
29
+ <line
30
+ x1="168.57"
31
+ y1="168.57"
32
+ x2="224"
33
+ y2="224"
34
+ fill="none"
35
+ stroke="currentColor"
36
+ stroke-linecap="round"
37
+ stroke-linejoin="round"
38
+ stroke-width="16"
39
+ />
40
+ </svg>
41
+ </span>
42
+ <span data-slot="input-group-addon" data-align="inline-end">
43
+ <button
44
+ class="ui-button"
45
+ data-variant="ghost"
46
+ data-size="icon-sm"
47
+ type="submit"
48
+ aria-label="Submit search"
49
+ >
50
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
51
+ <rect width="256" height="256" fill="none" />
52
+ <line
53
+ x1="40"
54
+ y1="128"
55
+ x2="216"
56
+ y2="128"
57
+ fill="none"
58
+ stroke="currentColor"
59
+ stroke-linecap="round"
60
+ stroke-linejoin="round"
61
+ stroke-width="16"
62
+ />
63
+ <polyline
64
+ points="144 56 216 128 144 200"
65
+ fill="none"
66
+ stroke="currentColor"
67
+ stroke-linecap="round"
68
+ stroke-linejoin="round"
69
+ stroke-width="16"
70
+ />
71
+ </svg>
72
+ </button>
73
+ </span>
74
+ </label>
75
+ <div data-slot="field-description">
76
+ <span data-slot="field-hint" id="f-search-hint">Search across every page in the docs.</span>
77
+ </div>
78
+ </div>
79
+
80
+ <div class="ui-field">
81
+ <label data-slot="field-label" for="f-url">Website</label>
82
+ <label class="ui-input-group">
83
+ <input
84
+ class="ui-input"
85
+ id="f-url"
86
+ type="url"
87
+ name="url"
88
+ inputmode="url"
89
+ required
90
+ placeholder="https://zazz.sh"
91
+ autocomplete="url"
92
+ autocapitalize="off"
93
+ spellcheck="false"
94
+ enterkeyhint="go"
95
+ aria-describedby="f-url-hint"
96
+ />
97
+ <span data-slot="input-group-addon">
98
+ <span data-slot="input-group-text">https://</span>
99
+ </span>
100
+ <span data-slot="input-group-addon" data-align="inline-end">
101
+ <button class="ui-button" data-variant="primary" data-size="sm" type="submit">Apply</button>
102
+ </span>
103
+ </label>
104
+ <div data-slot="field-description">
105
+ <span data-slot="field-hint" id="f-url-hint">Where people can find you online.</span>
106
+ <span data-slot="field-error" role="alert">Enter a valid URL, e.g. https://zazz.sh.</span>
107
+ </div>
108
+ </div>
109
+
110
+ <div class="ui-field">
111
+ <label data-slot="field-label" for="f-prompt">Prompt</label>
112
+ <label class="ui-input-group">
113
+ <textarea
114
+ id="f-prompt"
115
+ class="ui-textarea"
116
+ name="prompt"
117
+ inputmode="text"
118
+ placeholder="Ask anything…"
119
+ aria-describedby="f-prompt-hint"
120
+ ></textarea>
121
+ <span data-slot="input-group-addon" data-align="block-end">
122
+ <button class="ui-button bg-background ml-auto" data-size="sm" type="submit">
123
+ <span>Send</span> <kbd>↵</kbd>
124
+ </button>
125
+ </span>
126
+ </label>
127
+ <div data-slot="field-description">
128
+ <span data-slot="field-hint" id="f-prompt-hint"
129
+ >Enter to send · Shift + Enter for a new line.</span
130
+ >
131
+ </div>
132
+ </div>
@@ -0,0 +1,18 @@
1
+ <div class="flex items-center gap-md">
2
+ <ui-kbd-group>
3
+ <kbd>⌘</kbd>
4
+ <kbd>K</kbd>
5
+ </ui-kbd-group>
6
+ <ui-kbd-group>
7
+ <kbd>⌘</kbd>
8
+ <kbd>⇧</kbd>
9
+ <kbd>P</kbd>
10
+ </ui-kbd-group>
11
+ <span>
12
+ <ui-kbd-group>
13
+ <kbd>↑</kbd>
14
+ <kbd>↓</kbd>
15
+ </ui-kbd-group>
16
+ <span class="text-muted-foreground text-sm"> to navigate </span>
17
+ </span>
18
+ </div>