@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,614 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview The kit's distribution manifest: machine-readable facts about
4
+ * every primitive — its files, its dependencies on other primitives and base
5
+ * scripts, its bare npm imports, and its example fragments.
6
+ * @description This is the single data source for anything that assembles a
7
+ * subset of the kit: the `zazz-ui` CLI (`add` resolves the dependency closure
8
+ * from `PRIMITIVES`), the docs site (install blocks and previews), and the
9
+ * head builder's granular CDN mode. Presentation metadata for the docs
10
+ * previews (iframe heights, placement) is docs-site state and lives in the
11
+ * docs app (`apps/docs/lib/preview-manifest.ts`), not in the published kit.
12
+ *
13
+ * Paths are tarball-relative to the package `src/` root. Script fields list
14
+ * the emitted `.js` files (the published, browser-runnable form); consumers
15
+ * that want `.ts` sources or `.d.ts` types swap the extension. `manifest.test.ts`
16
+ * guards this file against drift: every primitive directory must have an
17
+ * entry, every listed file must exist, and every bare specifier must be
18
+ * pinned in `head.ts`'s import map.
19
+ */
20
+ // --- Manifest version ---
21
+ /**
22
+ * Compatibility version of this manifest's shape. Consumers (the CLI) declare
23
+ * the range they understand and fail gracefully on a newer value. Bumping it
24
+ * is by definition a breaking kit change (ADR-0010).
25
+ */
26
+ export const MANIFEST_VERSION = 1;
27
+ /** Bare specifiers pulled in by `base/signals.ts` (core runtime). */
28
+ const SIGNALS_BARE = ["signal-polyfill"];
29
+ /** Bare specifiers pulled in by `base/embla.ts`. */
30
+ const EMBLA_BARE = [
31
+ "embla-carousel",
32
+ "embla-carousel-autoplay",
33
+ "embla-carousel-auto-scroll",
34
+ "embla-carousel-class-names",
35
+ ];
36
+ /** The typeahead engine stack shared by autocomplete, combobox, and command. */
37
+ const TYPEAHEAD_BASE = ["base/command-score.js", "base/hotkeys.js", "base/typeahead.js"];
38
+ /**
39
+ * Every primitive in the kit, keyed by directory name under `src/primitives/`.
40
+ * `primitives` dependencies mirror each stylesheet's `@requires` header (the
41
+ * authoritative record of cross-primitive contracts); markup-only primitives
42
+ * list the primitives their canonical example composes.
43
+ */
44
+ export const PRIMITIVES = {
45
+ accordion: {
46
+ css: ["primitives/accordion/accordion.css"],
47
+ js: [],
48
+ base: [],
49
+ primitives: [],
50
+ bare: [],
51
+ examples: ["primitives/accordion/accordion.html"],
52
+ },
53
+ "alert-dialog": {
54
+ css: ["primitives/alert-dialog/alert-dialog.css"],
55
+ js: [],
56
+ base: [],
57
+ primitives: ["dialog"],
58
+ bare: [],
59
+ examples: ["primitives/alert-dialog/alert-dialog.html"],
60
+ },
61
+ autocomplete: {
62
+ css: ["primitives/autocomplete/autocomplete.css"],
63
+ js: ["primitives/autocomplete/autocomplete.js"],
64
+ base: TYPEAHEAD_BASE,
65
+ primitives: ["popover", "button", "fields", "select", "input"],
66
+ bare: SIGNALS_BARE,
67
+ examples: [
68
+ "primitives/autocomplete/autocomplete.html",
69
+ "primitives/autocomplete/autocomplete-groups.html",
70
+ ],
71
+ },
72
+ avatar: {
73
+ css: [],
74
+ js: [],
75
+ base: [],
76
+ primitives: [],
77
+ bare: [],
78
+ examples: ["primitives/avatar/avatar.html"],
79
+ },
80
+ badge: {
81
+ css: ["primitives/badge/badge.css"],
82
+ js: [],
83
+ base: [],
84
+ primitives: [],
85
+ bare: [],
86
+ examples: ["primitives/badge/badge.html", "primitives/badge/badge-icon.html"],
87
+ },
88
+ breadcrumbs: {
89
+ css: [],
90
+ js: [],
91
+ base: [],
92
+ primitives: ["button"],
93
+ bare: [],
94
+ examples: ["primitives/breadcrumbs/breadcrumbs.html"],
95
+ },
96
+ button: {
97
+ css: ["primitives/button/button.css"],
98
+ js: [],
99
+ base: [],
100
+ primitives: ["kbd"],
101
+ bare: [],
102
+ examples: [
103
+ "primitives/button/button.html",
104
+ "primitives/button/button-icon.html",
105
+ "primitives/button/button-icon-only.html",
106
+ ],
107
+ },
108
+ "button-group": {
109
+ css: ["primitives/button-group/button-group.css"],
110
+ js: [],
111
+ base: [],
112
+ primitives: ["button"],
113
+ bare: [],
114
+ examples: [
115
+ "primitives/button-group/button-group.html",
116
+ "primitives/button-group/button-group-vertical.html",
117
+ ],
118
+ },
119
+ card: {
120
+ css: [],
121
+ js: [],
122
+ base: [],
123
+ primitives: [],
124
+ bare: [],
125
+ examples: ["primitives/card/card.html", "primitives/card/card-subgrid.html"],
126
+ },
127
+ carousel: {
128
+ css: ["primitives/carousel/carousel.css"],
129
+ js: ["primitives/carousel/carousel.js"],
130
+ base: ["base/embla.js"],
131
+ primitives: [],
132
+ bare: EMBLA_BARE,
133
+ examples: ["primitives/carousel/carousel.html"],
134
+ },
135
+ checkbox: {
136
+ css: ["primitives/checkbox/checkbox.css"],
137
+ js: ["primitives/checkbox/checkbox.js"],
138
+ base: [],
139
+ primitives: [],
140
+ bare: SIGNALS_BARE,
141
+ examples: ["primitives/checkbox/checkbox.html", "primitives/checkbox/checkbox-tasklist.html"],
142
+ },
143
+ combobox: {
144
+ css: ["primitives/combobox/combobox.css"],
145
+ js: ["primitives/combobox/combobox.js"],
146
+ base: TYPEAHEAD_BASE,
147
+ primitives: ["popover", "button", "fields", "badge", "select"],
148
+ bare: SIGNALS_BARE,
149
+ examples: [
150
+ "primitives/combobox/combobox.html",
151
+ "primitives/combobox/combobox-multiselect.html",
152
+ ],
153
+ },
154
+ command: {
155
+ css: ["primitives/command/command.css"],
156
+ js: ["primitives/command/command.js", "primitives/command/command-actions.js"],
157
+ base: TYPEAHEAD_BASE,
158
+ primitives: ["popover", "button", "fields", "dialog", "menu", "select", "kbd"],
159
+ bare: SIGNALS_BARE,
160
+ examples: [
161
+ "primitives/command/command.html",
162
+ "primitives/command/command-dialog.html",
163
+ "primitives/command/command-actions.html",
164
+ ],
165
+ },
166
+ dialog: {
167
+ css: ["primitives/dialog/dialog.css"],
168
+ js: [],
169
+ base: [],
170
+ primitives: [],
171
+ bare: [],
172
+ examples: ["primitives/dialog/dialog.html", "primitives/dialog/dialog-with-form.html"],
173
+ },
174
+ fields: {
175
+ css: ["primitives/fields/fields.css"],
176
+ js: [],
177
+ base: [],
178
+ primitives: [],
179
+ bare: [],
180
+ examples: [],
181
+ },
182
+ input: {
183
+ css: ["primitives/input/input.css"],
184
+ js: [],
185
+ base: [],
186
+ primitives: ["fields"],
187
+ bare: [],
188
+ examples: [
189
+ "primitives/input/input.html",
190
+ "primitives/input/input-icon-leading.html",
191
+ "primitives/input/input-icon-trailing.html",
192
+ ],
193
+ },
194
+ "input-group": {
195
+ css: ["primitives/input-group/input-group.css"],
196
+ js: [],
197
+ base: [],
198
+ primitives: ["fields", "input", "textarea", "button"],
199
+ bare: [],
200
+ examples: [
201
+ "primitives/input-group/input-group.html",
202
+ "primitives/input-group/input-group-password-group.html",
203
+ ],
204
+ },
205
+ kbd: {
206
+ css: ["primitives/kbd/kbd.css"],
207
+ js: [],
208
+ base: [],
209
+ primitives: [],
210
+ bare: [],
211
+ examples: ["primitives/kbd/kbd.html", "primitives/kbd/kbd-group.html"],
212
+ },
213
+ lightbox: {
214
+ css: ["primitives/lightbox/lightbox.css"],
215
+ js: ["primitives/lightbox/lightbox.js"],
216
+ base: ["base/embla.js"],
217
+ primitives: ["dialog", "carousel", "button"],
218
+ bare: EMBLA_BARE,
219
+ examples: ["primitives/lightbox/lightbox.html"],
220
+ },
221
+ menu: {
222
+ css: ["primitives/menu/menu.css"],
223
+ js: ["primitives/menu/menu.js"],
224
+ base: [],
225
+ primitives: ["popover", "button"],
226
+ bare: [],
227
+ examples: ["primitives/menu/menu.html", "primitives/menu/menu-interest.html"],
228
+ },
229
+ menubar: {
230
+ css: [],
231
+ js: [],
232
+ base: [],
233
+ primitives: ["menu", "button", "separator"],
234
+ bare: [],
235
+ examples: ["primitives/menubar/menubar.html", "primitives/menubar/menubar-help-search.html"],
236
+ },
237
+ meter: {
238
+ css: ["primitives/meter/meter.css"],
239
+ js: [],
240
+ base: [],
241
+ primitives: ["progress"],
242
+ bare: [],
243
+ examples: ["primitives/meter/meter.html"],
244
+ },
245
+ "mobile-menu": {
246
+ css: ["primitives/mobile-menu/mobile-menu.css"],
247
+ js: [],
248
+ base: [],
249
+ primitives: ["dialog", "accordion"],
250
+ bare: [],
251
+ examples: ["primitives/mobile-menu/mobile-menu.html"],
252
+ },
253
+ "navigation-menu": {
254
+ css: ["primitives/navigation-menu/navigation-menu.css"],
255
+ js: [],
256
+ base: [],
257
+ primitives: ["popover", "button"],
258
+ bare: [],
259
+ examples: [
260
+ "primitives/navigation-menu/navigation-menu.html",
261
+ "primitives/navigation-menu/navigation-menu-simple.html",
262
+ "primitives/navigation-menu/navigation-menu-interest.html",
263
+ "primitives/navigation-menu/navigation-menu-featured.html",
264
+ "primitives/navigation-menu/navigation-menu-icon-grid.html",
265
+ "primitives/navigation-menu/navigation-menu-megamenu.html",
266
+ ],
267
+ },
268
+ otp: {
269
+ css: ["primitives/otp/otp.css"],
270
+ js: ["primitives/otp/otp.js"],
271
+ base: [],
272
+ primitives: ["fields", "input"],
273
+ bare: SIGNALS_BARE,
274
+ examples: ["primitives/otp/otp.html"],
275
+ },
276
+ "password-group": {
277
+ css: ["primitives/password-group/password-group.css"],
278
+ js: ["primitives/password-group/password-group.js"],
279
+ base: [],
280
+ primitives: ["fields", "input", "button"],
281
+ bare: SIGNALS_BARE,
282
+ examples: ["primitives/password-group/password-group.html"],
283
+ },
284
+ popover: {
285
+ css: ["primitives/popover/popover.css"],
286
+ js: [],
287
+ base: [],
288
+ primitives: [],
289
+ bare: [],
290
+ examples: [],
291
+ },
292
+ progress: {
293
+ css: ["primitives/progress/progress.css"],
294
+ js: [],
295
+ base: [],
296
+ primitives: [],
297
+ bare: [],
298
+ examples: [
299
+ "primitives/progress/progress.html",
300
+ "primitives/progress/progress-indeterminate.html",
301
+ ],
302
+ },
303
+ prose: {
304
+ css: [],
305
+ js: [],
306
+ base: [],
307
+ primitives: [],
308
+ bare: [],
309
+ examples: ["primitives/prose/prose.html"],
310
+ },
311
+ radio: {
312
+ css: ["primitives/radio/radio.css"],
313
+ js: [],
314
+ base: [],
315
+ primitives: ["fields"],
316
+ bare: [],
317
+ examples: ["primitives/radio/radio.html"],
318
+ },
319
+ reveal: {
320
+ css: ["primitives/reveal/reveal.css"],
321
+ js: [],
322
+ base: ["base/reveal.js"],
323
+ primitives: [],
324
+ bare: [],
325
+ examples: [],
326
+ },
327
+ select: {
328
+ css: ["primitives/select/select.css"],
329
+ js: ["primitives/select/multiselect.js"],
330
+ base: [],
331
+ primitives: ["fields", "popover", "button"],
332
+ bare: SIGNALS_BARE,
333
+ examples: [
334
+ "primitives/select/select.html",
335
+ "primitives/select/select-align.html",
336
+ "primitives/select/select-sides.html",
337
+ "primitives/select/select-multiple.html",
338
+ ],
339
+ },
340
+ separator: {
341
+ css: ["primitives/separator/separator.css"],
342
+ js: [],
343
+ base: [],
344
+ primitives: [],
345
+ bare: [],
346
+ examples: ["primitives/separator/separator.html"],
347
+ },
348
+ slider: {
349
+ css: ["primitives/slider/slider.css"],
350
+ js: [],
351
+ base: [],
352
+ primitives: [],
353
+ bare: [],
354
+ examples: ["primitives/slider/slider.html"],
355
+ },
356
+ switch: {
357
+ css: ["primitives/switch/switch.css"],
358
+ js: [],
359
+ base: [],
360
+ primitives: [],
361
+ bare: [],
362
+ examples: ["primitives/switch/switch.html"],
363
+ },
364
+ table: {
365
+ css: ["primitives/table/table.css"],
366
+ js: [],
367
+ base: [],
368
+ primitives: [],
369
+ bare: [],
370
+ examples: [
371
+ "primitives/table/table.html",
372
+ "primitives/table/table-grid.html",
373
+ "primitives/table/table-alternating.html",
374
+ "primitives/table/table-size-sm.html",
375
+ ],
376
+ },
377
+ tabs: {
378
+ css: ["primitives/tabs/tabs.css"],
379
+ js: ["primitives/tabs/tabs.js"],
380
+ base: [],
381
+ primitives: [],
382
+ bare: [],
383
+ examples: ["primitives/tabs/tabs.html"],
384
+ },
385
+ textarea: {
386
+ css: ["primitives/textarea/textarea.css"],
387
+ js: [],
388
+ base: [],
389
+ primitives: ["fields"],
390
+ bare: [],
391
+ examples: ["primitives/textarea/textarea.html"],
392
+ },
393
+ toaster: {
394
+ css: ["primitives/toaster/toaster.css"],
395
+ js: ["primitives/toaster/toaster.js"],
396
+ base: [],
397
+ primitives: ["popover", "button"],
398
+ bare: SIGNALS_BARE,
399
+ examples: ["primitives/toaster/toaster.html"],
400
+ },
401
+ toggle: {
402
+ css: ["primitives/toggle/toggle.css"],
403
+ js: [],
404
+ base: [],
405
+ primitives: ["button"],
406
+ bare: [],
407
+ examples: ["primitives/toggle/toggle.html"],
408
+ },
409
+ "toggle-group": {
410
+ css: ["primitives/toggle-group/toggle-group.css"],
411
+ js: [],
412
+ base: [],
413
+ primitives: ["toggle"],
414
+ bare: [],
415
+ examples: [
416
+ "primitives/toggle-group/toggle-group.html",
417
+ "primitives/toggle-group/toggle-group-multiple.html",
418
+ "primitives/toggle-group/toggle-group-vertical.html",
419
+ ],
420
+ },
421
+ toolbar: {
422
+ css: [],
423
+ js: [],
424
+ base: [],
425
+ primitives: [
426
+ "button",
427
+ "button-group",
428
+ "input",
429
+ "select",
430
+ "separator",
431
+ "toggle",
432
+ "toggle-group",
433
+ ],
434
+ bare: [],
435
+ examples: ["primitives/toolbar/toolbar.html"],
436
+ },
437
+ tooltip: {
438
+ css: ["primitives/tooltip/tooltip.css"],
439
+ js: [],
440
+ base: [],
441
+ primitives: ["popover", "kbd"],
442
+ bare: [],
443
+ examples: [
444
+ "primitives/tooltip/tooltip.html",
445
+ "primitives/tooltip/tooltip-with-kbd.html",
446
+ "primitives/tooltip/tooltip-sides.html",
447
+ "primitives/tooltip/tooltip-disabled.html",
448
+ ],
449
+ },
450
+ utilities: {
451
+ css: [],
452
+ js: [],
453
+ base: [],
454
+ primitives: [],
455
+ bare: [],
456
+ examples: [
457
+ "primitives/utilities/aspect-ratio.html",
458
+ "primitives/utilities/basis.html",
459
+ "primitives/utilities/col-span.html",
460
+ "primitives/utilities/compose.html",
461
+ "primitives/utilities/flex-align.html",
462
+ "primitives/utilities/flex-direction.html",
463
+ "primitives/utilities/flex-grow.html",
464
+ "primitives/utilities/gap.html",
465
+ "primitives/utilities/grid-cols.html",
466
+ "primitives/utilities/grid-pile.html",
467
+ "primitives/utilities/grid-responsive.html",
468
+ "primitives/utilities/margin-auto.html",
469
+ "primitives/utilities/object-fit.html",
470
+ "primitives/utilities/order.html",
471
+ "primitives/utilities/overflow.html",
472
+ "primitives/utilities/padding-compose.html",
473
+ "primitives/utilities/padding.html",
474
+ "primitives/utilities/position.html",
475
+ "primitives/utilities/responsive-flex.html",
476
+ "primitives/utilities/responsive-grid.html",
477
+ "primitives/utilities/size.html",
478
+ "primitives/utilities/width.html",
479
+ ],
480
+ },
481
+ };
482
+ // --- Canonical cascade order ---
483
+ /**
484
+ * Primitive names in the exact `@import` order of `src/index.css`. Anything
485
+ * assembling a stylesheet subset (the CLI's `add`, the granular CDN head)
486
+ * must emit primitive css in this order so component scopes cascade the way
487
+ * the kit was designed and tested. Markup-only primitives (no css) do not
488
+ * appear. `manifest.test.ts` asserts this list matches `index.css` exactly.
489
+ */
490
+ export const CSS_CASCADE_ORDER = [
491
+ "separator",
492
+ "badge",
493
+ "kbd",
494
+ "button",
495
+ "button-group",
496
+ "toggle",
497
+ "toggle-group",
498
+ "accordion",
499
+ "table",
500
+ "progress",
501
+ "meter",
502
+ "popover",
503
+ "tooltip",
504
+ "dialog",
505
+ "alert-dialog",
506
+ "menu",
507
+ "navigation-menu",
508
+ "mobile-menu",
509
+ "fields",
510
+ "input",
511
+ "textarea",
512
+ "select",
513
+ "autocomplete",
514
+ "combobox",
515
+ "command",
516
+ "checkbox",
517
+ "slider",
518
+ "switch",
519
+ "input-group",
520
+ "password-group",
521
+ "otp",
522
+ "radio",
523
+ "tabs",
524
+ "carousel",
525
+ "lightbox",
526
+ "toaster",
527
+ "reveal",
528
+ ];
529
+ // --- Dependency resolution ---
530
+ /**
531
+ * @description Resolves a set of primitive names to its full dependency
532
+ * closure — every primitive the requested ones require, transitively. This is
533
+ * the resolution the CLI's `add` and the granular CDN head share.
534
+ *
535
+ * @param names - Primitive names to resolve (keys of `PRIMITIVES`).
536
+ * @returns The closure in canonical cascade order (markup-only members, which
537
+ * have no cascade position, sort last in name order).
538
+ * @throws {Error} On an unknown primitive name.
539
+ * @example
540
+ * resolveClosure(["combobox"]);
541
+ * // ["kbd", "button", "popover", "fields", "input", "select", "badge", "combobox"]
542
+ */
543
+ export function resolveClosure(names) {
544
+ const closure = new Set();
545
+ const visit = (name) => {
546
+ const entry = PRIMITIVES[name];
547
+ if (!entry)
548
+ throw new Error(`unknown primitive "${name}"`);
549
+ if (closure.has(name))
550
+ return;
551
+ closure.add(name);
552
+ for (const dep of entry.primitives)
553
+ visit(dep);
554
+ };
555
+ for (const name of names)
556
+ visit(name);
557
+ const position = new Map(CSS_CASCADE_ORDER.map((name, index) => [name, index]));
558
+ return [...closure].sort((a, b) => {
559
+ const pa = position.get(a);
560
+ const pb = position.get(b);
561
+ if (pa !== undefined && pb !== undefined)
562
+ return pa - pb;
563
+ if (pa !== undefined)
564
+ return -1;
565
+ if (pb !== undefined)
566
+ return 1;
567
+ return a.localeCompare(b);
568
+ });
569
+ }
570
+ /**
571
+ * Emitted script files (relative to the package `src/` root) that implement each
572
+ * web-component script id. This is the single mapping from script ids to files
573
+ * on disk: consumers (like the docs "JS" tab) resolve these against the
574
+ * package's `src/` directory. Entries list dependencies first (`lightbox` needs
575
+ * `carousel.js` loaded before `lightbox.js`). Script ids are example-level and
576
+ * finer-grained than `PRIMITIVES` (e.g. `command-actions`); every file listed
577
+ * here must also be reachable from a `PRIMITIVES` entry (`manifest.test.ts`).
578
+ */
579
+ export const WEB_COMPONENT_SCRIPT_FILES = {
580
+ autocomplete: [
581
+ "base/command-score.js",
582
+ "base/hotkeys.js",
583
+ "base/typeahead.js",
584
+ "primitives/autocomplete/autocomplete.js",
585
+ ],
586
+ combobox: [
587
+ "base/command-score.js",
588
+ "base/hotkeys.js",
589
+ "base/typeahead.js",
590
+ "primitives/combobox/combobox.js",
591
+ ],
592
+ command: [
593
+ "base/command-score.js",
594
+ "base/hotkeys.js",
595
+ "base/typeahead.js",
596
+ "primitives/command/command.js",
597
+ ],
598
+ "command-actions": [
599
+ "base/command-score.js",
600
+ "base/hotkeys.js",
601
+ "base/typeahead.js",
602
+ "primitives/command/command.js",
603
+ "primitives/command/command-actions.js",
604
+ ],
605
+ carousel: ["primitives/carousel/carousel.js"],
606
+ checkbox: ["primitives/checkbox/checkbox.js"],
607
+ lightbox: ["primitives/carousel/carousel.js", "primitives/lightbox/lightbox.js"],
608
+ menu: ["primitives/menu/menu.js"],
609
+ multiselect: ["primitives/select/multiselect.js"],
610
+ otp: ["primitives/otp/otp.js"],
611
+ password: ["primitives/password-group/password-group.js"],
612
+ tabs: ["primitives/tabs/tabs.js"],
613
+ toaster: ["primitives/toaster/toaster.js"],
614
+ };