@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,61 @@
1
+ /**
2
+ * carousel.css — Embla carousel (ui-carousel | .ui-carousel + data-slot="carousel-*" hooks)
3
+ *
4
+ * @layer variables, components
5
+ * @requires layers.css, _variables.css
6
+ * @uses data-carousel attributes — layout hooks only; behaviour from zazz/scripts/embla.js
7
+ * @uses container-type on viewport — basis-* / @sm:basis-* utils query [data-slot~="carousel-viewport"] width
8
+ * @tokens --ui-carousel-* (@layer variables)
9
+ * @consumedby lightbox.css
10
+ */
11
+
12
+ @layer variables {
13
+ :root {
14
+ --ui-carousel-slide-basis: calc(100% - var(--_gap, 0px));
15
+ --ui-carousel-slide-min-width: 0;
16
+ --ui-carousel-touch-action: pan-y pinch-zoom;
17
+ --ui-carousel-cursor--grabbing: grabbing;
18
+ }
19
+ }
20
+
21
+ /* ===========================================================================
22
+ EMBLA CAROUSEL STYLES
23
+ - Documentation: https://www.embla-carousel.com/
24
+ =========================================================================== */
25
+ @layer zazz.components {
26
+ /* <ui-carousel> is a custom element (inline by default) — give it block
27
+ flow like a div; the class form inherits div flow already. */
28
+ ui-carousel {
29
+ display: block;
30
+ }
31
+
32
+ :is(body:has([data-slot~="carousel-viewport"].is-dragging) *) {
33
+ cursor: var(--ui-carousel-cursor--grabbing);
34
+ }
35
+
36
+ :where(ui-carousel, .ui-carousel) {
37
+ position: relative;
38
+ isolation: isolate;
39
+ }
40
+
41
+ [data-slot~="carousel-viewport"] {
42
+ overflow: clip;
43
+ max-block-size: 100%;
44
+ max-inline-size: 100%;
45
+ }
46
+
47
+ [data-slot~="carousel-container"] {
48
+ display: flex;
49
+ gap: var(--_gap, 0);
50
+ touch-action: var(--ui-carousel-touch-action);
51
+ }
52
+
53
+ [data-slot~="carousel-slide"] {
54
+ flex: 0 0 var(--ui-carousel-slide-basis);
55
+ min-width: var(--ui-carousel-slide-min-width);
56
+ }
57
+
58
+ [data-slot~="carousel-thumbs"] [data-slot~="carousel-slide"] {
59
+ flex: 0 0 auto;
60
+ }
61
+ }
@@ -0,0 +1,16 @@
1
+ import { ZazzElement } from "../../base/zazz-element.ts";
2
+ declare class UiCarouselElement extends ZazzElement {
3
+ protected setup(signal: AbortSignal): void;
4
+ protected teardown(): void;
5
+ /**
6
+ * @description Initializes the carousel. Idempotent — already-initialized
7
+ * roots and roots inside closed dialogs are skipped by `initRoot`.
8
+ */
9
+ init(): void;
10
+ /**
11
+ * @returns The Embla API, or null before initialization.
12
+ */
13
+ get api(): EmblaCarouselType | null;
14
+ }
15
+ export { UiCarouselElement };
16
+ //# sourceMappingURL=carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["carousel.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAE5E,cAAM,iBAAkB,SAAQ,WAAW;IACzC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAUzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAazB;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,CAEX;IAED;;OAEG;IACH,IAAI,GAAG,IAAI,iBAAiB,GAAG,IAAI,CAElC;CACF;AAID,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,315 @@
1
+ <ui-carousel data-carousel-plugins="class-names">
2
+ <div class="flex items-end justify-between gap-md flex-wrap pb-lg">
3
+ <h2 class="text-h5 font-heading">Featured Articles</h2>
4
+ <div class="flex @md:hidden gap-xs">
5
+ <button
6
+ type="button"
7
+ class="ui-button"
8
+ data-size="icon"
9
+ data-variant="muted"
10
+ data-slot="carousel-prev"
11
+ >
12
+ <svg
13
+ class="size-sm"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ viewBox="0 0 256 256"
16
+ aria-hidden="true"
17
+ >
18
+ <rect width="256" height="256" fill="none" />
19
+ <polyline
20
+ points="160 208 80 128 160 48"
21
+ fill="none"
22
+ stroke="currentColor"
23
+ stroke-linecap="round"
24
+ stroke-linejoin="round"
25
+ stroke-width="14"
26
+ />
27
+ </svg>
28
+ </button>
29
+ <button
30
+ type="button"
31
+ class="ui-button"
32
+ data-size="icon"
33
+ data-variant="muted"
34
+ data-slot="carousel-next"
35
+ >
36
+ <svg
37
+ class="size-sm"
38
+ xmlns="http://www.w3.org/2000/svg"
39
+ viewBox="0 0 256 256"
40
+ aria-hidden="true"
41
+ >
42
+ <rect width="256" height="256" fill="none" />
43
+ <polyline
44
+ points="96 48 176 128 96 208"
45
+ fill="none"
46
+ stroke="currentColor"
47
+ stroke-linecap="round"
48
+ stroke-linejoin="round"
49
+ stroke-width="14"
50
+ />
51
+ </svg>
52
+ </button>
53
+ </div>
54
+ </div>
55
+
56
+ <div data-slot="carousel-viewport" class="overflow-visible">
57
+ <div data-slot="carousel-container" class="-ml-md">
58
+ <!-- Card START -->
59
+ <a
60
+ data-slot="carousel-slide"
61
+ class="basis-full @xs:basis-1/2 @sm:basis-1/3 @md:basis-1/4 cursor-pointer"
62
+ href="#"
63
+ >
64
+ <div class="pl-md">
65
+ <div class="grid gap-sm bg-card text-card-foreground rounded-md shadow-sm overflow-clip">
66
+ <figure class="aspect-landscape rounded-t-md overflow-clip">
67
+ <img
68
+ class="size-full object-cover hover:scale-102 hover:opacity-75 transition"
69
+ width="300"
70
+ height="200"
71
+ loading="lazy"
72
+ src="https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=300&h=200&q=60"
73
+ alt="Zebras grazing at dawn on the savanna"
74
+ />
75
+ </figure>
76
+ <div class="grid gap-sm px-sm pb-sm">
77
+ <header class="grid gap-xs">
78
+ <div class="flex items-center gap-xs">
79
+ <span class="ui-badge" data-variant="muted">Field notes</span>
80
+ </div>
81
+ <hgroup class="grid gap-xs">
82
+ <h3 class="text-lg font-heading line-clamp-1">How quickly zebras jump</h3>
83
+ <p class="text-sm text-muted-foreground line-clamp-2">
84
+ Striped coats and sudden bursts of speed help herds evade predators when the
85
+ grasslands go quiet at dusk.
86
+ </p>
87
+ </hgroup>
88
+ </header>
89
+ <footer class="grid justify-end gap-sm pb-xs pt-sm border-t">
90
+ <div class="ui-button" data-variant="link">
91
+ Read article
92
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
93
+ <rect width="256" height="256" fill="none" />
94
+ <line
95
+ x1="40"
96
+ y1="128"
97
+ x2="216"
98
+ y2="128"
99
+ fill="none"
100
+ stroke="currentColor"
101
+ stroke-linecap="round"
102
+ stroke-linejoin="round"
103
+ stroke-width="16"
104
+ />
105
+ <polyline
106
+ points="144 56 216 128 144 200"
107
+ fill="none"
108
+ stroke="currentColor"
109
+ stroke-linecap="round"
110
+ stroke-linejoin="round"
111
+ stroke-width="16"
112
+ />
113
+ </svg>
114
+ </div>
115
+ </footer>
116
+ </div>
117
+ </div>
118
+ </div>
119
+ </a>
120
+ <!-- Card END -->
121
+
122
+ <!-- Card START -->
123
+ <a
124
+ data-slot="carousel-slide"
125
+ class="basis-full @xs:basis-1/2 @sm:basis-1/3 @md:basis-1/4 cursor-pointer"
126
+ href="#"
127
+ >
128
+ <div class="pl-md">
129
+ <div class="grid gap-sm bg-card text-card-foreground rounded-md shadow-sm overflow-clip">
130
+ <figure class="aspect-landscape rounded-t-md overflow-clip">
131
+ <img
132
+ class="size-full object-cover hover:scale-102 hover:opacity-75 transition"
133
+ width="300"
134
+ height="200"
135
+ loading="lazy"
136
+ src="https://images.unsplash.com/photo-1564760055775-d63b17a55c44?auto=format&fit=crop&w=300&h=200&q=60"
137
+ alt="A lion resting in tall golden grass"
138
+ />
139
+ </figure>
140
+ <div class="grid gap-sm px-sm pb-sm">
141
+ <header class="grid gap-xs">
142
+ <div class="flex items-center gap-xs">
143
+ <span class="ui-badge" data-variant="muted">Wildlife</span>
144
+ </div>
145
+ <hgroup class="grid gap-xs">
146
+ <h3 class="text-lg font-heading line-clamp-1">Lions at golden hour</h3>
147
+ <p class="text-sm text-muted-foreground line-clamp-2">
148
+ Warm light and long shadows make dawn patrols the best time to photograph big
149
+ cats on the open plain.
150
+ </p>
151
+ </hgroup>
152
+ </header>
153
+ <footer class="grid justify-end gap-sm pb-xs pt-sm border-t">
154
+ <div class="ui-button" data-variant="link">
155
+ View gallery
156
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
157
+ <rect width="256" height="256" fill="none" />
158
+ <line
159
+ x1="40"
160
+ y1="128"
161
+ x2="216"
162
+ y2="128"
163
+ fill="none"
164
+ stroke="currentColor"
165
+ stroke-linecap="round"
166
+ stroke-linejoin="round"
167
+ stroke-width="16"
168
+ />
169
+ <polyline
170
+ points="144 56 216 128 144 200"
171
+ fill="none"
172
+ stroke="currentColor"
173
+ stroke-linecap="round"
174
+ stroke-linejoin="round"
175
+ stroke-width="16"
176
+ />
177
+ </svg>
178
+ </div>
179
+ </footer>
180
+ </div>
181
+ </div>
182
+ </div>
183
+ </a>
184
+ <!-- Card END -->
185
+
186
+ <!-- Card START -->
187
+ <a
188
+ data-slot="carousel-slide"
189
+ class="basis-full @xs:basis-1/2 @sm:basis-1/3 @md:basis-1/4 cursor-pointer"
190
+ href="#"
191
+ >
192
+ <div class="pl-md">
193
+ <div class="grid gap-sm bg-card text-card-foreground rounded-md shadow-sm overflow-clip">
194
+ <figure class="aspect-landscape rounded-t-md overflow-clip">
195
+ <img
196
+ class="size-full object-cover hover:scale-102 hover:opacity-75 transition"
197
+ width="300"
198
+ height="200"
199
+ loading="lazy"
200
+ src="https://images.unsplash.com/photo-1511735111819-9a3f7709049c?auto=format&fit=crop&w=300&h=200&q=60"
201
+ alt="Elephants crossing a dusty riverbed"
202
+ />
203
+ </figure>
204
+ <div class="grid gap-sm px-sm pb-sm">
205
+ <header class="grid gap-xs">
206
+ <div class="flex items-center gap-xs">
207
+ <span class="ui-badge" data-variant="muted">Research</span>
208
+ </div>
209
+ <hgroup class="grid gap-xs">
210
+ <h3 class="text-lg font-heading line-clamp-1">Migration patterns decoded</h3>
211
+ <p class="text-sm text-muted-foreground line-clamp-2">
212
+ Satellite collars reveal ancient routes herds still follow each dry season
213
+ across the floodplain.
214
+ </p>
215
+ </hgroup>
216
+ </header>
217
+ <footer class="grid justify-end gap-sm pb-xs pt-sm border-t">
218
+ <div class="ui-button" data-variant="link">
219
+ See the data
220
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
221
+ <rect width="256" height="256" fill="none" />
222
+ <line
223
+ x1="40"
224
+ y1="128"
225
+ x2="216"
226
+ y2="128"
227
+ fill="none"
228
+ stroke="currentColor"
229
+ stroke-linecap="round"
230
+ stroke-linejoin="round"
231
+ stroke-width="16"
232
+ />
233
+ <polyline
234
+ points="144 56 216 128 144 200"
235
+ fill="none"
236
+ stroke="currentColor"
237
+ stroke-linecap="round"
238
+ stroke-linejoin="round"
239
+ stroke-width="16"
240
+ />
241
+ </svg>
242
+ </div>
243
+ </footer>
244
+ </div>
245
+ </div>
246
+ </div>
247
+ </a>
248
+ <!-- Card END -->
249
+
250
+ <!-- Card START -->
251
+ <a
252
+ data-slot="carousel-slide"
253
+ class="basis-full @xs:basis-1/2 @sm:basis-1/3 @md:basis-1/4 cursor-pointer"
254
+ href="#"
255
+ >
256
+ <div class="pl-md">
257
+ <div class="grid gap-sm bg-card text-card-foreground rounded-md shadow-sm overflow-clip">
258
+ <figure class="aspect-landscape rounded-t-md overflow-clip">
259
+ <img
260
+ class="size-full object-cover hover:scale-102 hover:opacity-75 transition"
261
+ width="300"
262
+ height="200"
263
+ loading="lazy"
264
+ src="https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?auto=format&fit=crop&w=300&h=200&q=60"
265
+ alt="Misty highland valley at sunrise"
266
+ />
267
+ </figure>
268
+ <div class="grid gap-sm px-sm pb-sm">
269
+ <header class="grid gap-xs">
270
+ <div class="flex items-center gap-xs">
271
+ <span class="ui-badge" data-variant="muted">Conservation</span>
272
+ </div>
273
+ <hgroup class="grid gap-xs">
274
+ <h3 class="text-lg font-heading line-clamp-1">Rewilding the highlands</h3>
275
+ <p class="text-sm text-muted-foreground line-clamp-2">
276
+ Community nurseries are planting native grasses and bringing endemic songbirds
277
+ back to the ridgeline.
278
+ </p>
279
+ </hgroup>
280
+ </header>
281
+ <footer class="grid justify-end gap-sm pb-xs pt-sm border-t">
282
+ <div class="ui-button" data-variant="link">
283
+ Get started
284
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
285
+ <rect width="256" height="256" fill="none" />
286
+ <line
287
+ x1="40"
288
+ y1="128"
289
+ x2="216"
290
+ y2="128"
291
+ fill="none"
292
+ stroke="currentColor"
293
+ stroke-linecap="round"
294
+ stroke-linejoin="round"
295
+ stroke-width="16"
296
+ />
297
+ <polyline
298
+ points="144 56 216 128 144 200"
299
+ fill="none"
300
+ stroke="currentColor"
301
+ stroke-linecap="round"
302
+ stroke-linejoin="round"
303
+ stroke-width="16"
304
+ />
305
+ </svg>
306
+ </div>
307
+ </footer>
308
+ </div>
309
+ </div>
310
+ </div>
311
+ </a>
312
+ <!-- Card END -->
313
+ </div>
314
+ </div>
315
+ </ui-carousel>
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview `<ui-carousel>` — HTML web component for carousels.
4
+ * @description Light-DOM custom element that wraps standard carousel markup
5
+ * and owns the Embla lifecycle: it initializes on connect (via
6
+ * `EmblaInit.initRoot`) and destroys its instances on disconnect, so
7
+ * dynamically inserted or SPA-swapped carousels need no manual wiring.
8
+ *
9
+ * The element *is* the carousel root — CSS and `embla.js` target
10
+ * `:is(ui-carousel, .ui-carousel)` directly, and `data-carousel-*`
11
+ * configuration attributes are read off the element (see embla.js for the
12
+ * full attribute reference). No shadow DOM; children are regular markup.
13
+ *
14
+ * Carousels inside a closed `<dialog>` defer initialization until the dialog
15
+ * first opens (a closed dialog is `display: none`, so Embla cannot measure
16
+ * the viewport).
17
+ *
18
+ * Load order: the module graph resolves it — `index.js` imports embla.js
19
+ * (which imports the Embla packages via the page's import map) before this file.
20
+ *
21
+ * @example
22
+ * <ui-carousel data-carousel-loop="true">
23
+ * <div data-slot="carousel-viewport">
24
+ * <div data-slot="carousel-container">
25
+ * <div data-slot="carousel-slide">Slide 1</div>
26
+ * <div data-slot="carousel-slide">Slide 2</div>
27
+ * </div>
28
+ * </div>
29
+ * <button type="button" data-slot="carousel-prev">Prev</button>
30
+ * <button type="button" data-slot="carousel-next">Next</button>
31
+ * </ui-carousel>
32
+ */
33
+ import { EmblaInit } from "../../base/embla.js";
34
+ import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
35
+ class UiCarouselElement extends ZazzElement {
36
+ setup(signal) {
37
+ const dialog = this.closest("dialog");
38
+ if (dialog && !dialog.open) {
39
+ // Closed dialogs are display:none — Embla can't measure the viewport.
40
+ // Initialize on the dialog's open instead (zazz:dialog-open, ADR-0003).
41
+ dialog.addEventListener("zazz:dialog-open", () => this.init(), { signal });
42
+ return;
43
+ }
44
+ this.init();
45
+ }
46
+ teardown() {
47
+ // Abort first so the per-carousel DOM listeners (prev/next, dots, thumbs,
48
+ // drag-click suppression) are removed before the Embla instances are torn down.
49
+ this._emblaController?.abort();
50
+ delete this._emblaController;
51
+ this._emblaApi?.destroy();
52
+ this._emblaApiThumb?.destroy();
53
+ delete this._emblaApi;
54
+ delete this._emblaApiThumb;
55
+ // Allow re-initialization if the element is re-inserted.
56
+ this.removeAttribute("data-carousel-init");
57
+ }
58
+ /**
59
+ * @description Initializes the carousel. Idempotent — already-initialized
60
+ * roots and roots inside closed dialogs are skipped by `initRoot`.
61
+ */
62
+ init() {
63
+ EmblaInit.initRoot(this);
64
+ }
65
+ /**
66
+ * @returns The Embla API, or null before initialization.
67
+ */
68
+ get api() {
69
+ return this._emblaApi ?? null;
70
+ }
71
+ }
72
+ defineZazzElement("ui-carousel", UiCarouselElement);
73
+ export { UiCarouselElement };
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @fileoverview `<ui-carousel>` — HTML web component for carousels.
5
+ * @description Light-DOM custom element that wraps standard carousel markup
6
+ * and owns the Embla lifecycle: it initializes on connect (via
7
+ * `EmblaInit.initRoot`) and destroys its instances on disconnect, so
8
+ * dynamically inserted or SPA-swapped carousels need no manual wiring.
9
+ *
10
+ * The element *is* the carousel root — CSS and `embla.js` target
11
+ * `:is(ui-carousel, .ui-carousel)` directly, and `data-carousel-*`
12
+ * configuration attributes are read off the element (see embla.js for the
13
+ * full attribute reference). No shadow DOM; children are regular markup.
14
+ *
15
+ * Carousels inside a closed `<dialog>` defer initialization until the dialog
16
+ * first opens (a closed dialog is `display: none`, so Embla cannot measure
17
+ * the viewport).
18
+ *
19
+ * Load order: the module graph resolves it — `index.js` imports embla.js
20
+ * (which imports the Embla packages via the page's import map) before this file.
21
+ *
22
+ * @example
23
+ * <ui-carousel data-carousel-loop="true">
24
+ * <div data-slot="carousel-viewport">
25
+ * <div data-slot="carousel-container">
26
+ * <div data-slot="carousel-slide">Slide 1</div>
27
+ * <div data-slot="carousel-slide">Slide 2</div>
28
+ * </div>
29
+ * </div>
30
+ * <button type="button" data-slot="carousel-prev">Prev</button>
31
+ * <button type="button" data-slot="carousel-next">Next</button>
32
+ * </ui-carousel>
33
+ */
34
+
35
+ import { EmblaInit } from "../../base/embla.ts";
36
+ import { ZazzElement, defineZazzElement } from "../../base/zazz-element.ts";
37
+
38
+ class UiCarouselElement extends ZazzElement {
39
+ protected setup(signal: AbortSignal): void {
40
+ const dialog = this.closest("dialog");
41
+ if (dialog && !dialog.open) {
42
+ // Closed dialogs are display:none — Embla can't measure the viewport.
43
+ // Initialize on the dialog's open instead (zazz:dialog-open, ADR-0003).
44
+ dialog.addEventListener("zazz:dialog-open", () => this.init(), { signal });
45
+ return;
46
+ }
47
+
48
+ this.init();
49
+ }
50
+
51
+ protected teardown(): void {
52
+ // Abort first so the per-carousel DOM listeners (prev/next, dots, thumbs,
53
+ // drag-click suppression) are removed before the Embla instances are torn down.
54
+ this._emblaController?.abort();
55
+ delete this._emblaController;
56
+
57
+ this._emblaApi?.destroy();
58
+ this._emblaApiThumb?.destroy();
59
+ delete this._emblaApi;
60
+ delete this._emblaApiThumb;
61
+
62
+ // Allow re-initialization if the element is re-inserted.
63
+ this.removeAttribute("data-carousel-init");
64
+ }
65
+
66
+ /**
67
+ * @description Initializes the carousel. Idempotent — already-initialized
68
+ * roots and roots inside closed dialogs are skipped by `initRoot`.
69
+ */
70
+ init(): void {
71
+ EmblaInit.initRoot(this);
72
+ }
73
+
74
+ /**
75
+ * @returns The Embla API, or null before initialization.
76
+ */
77
+ get api(): EmblaCarouselType | null {
78
+ return this._emblaApi ?? null;
79
+ }
80
+ }
81
+
82
+ defineZazzElement("ui-carousel", UiCarouselElement);
83
+
84
+ export { UiCarouselElement };
@@ -0,0 +1,71 @@
1
+ <table class="ui-table">
2
+ <caption>
3
+ Sprint tasks with managed selection.
4
+ </caption>
5
+ <thead>
6
+ <tr>
7
+ <th>
8
+ <input type="checkbox" data-checkbox-controls="tasks" aria-label="Select all tasks" />
9
+ </th>
10
+ <th>Task</th>
11
+ <th>Assignee</th>
12
+ <th class="text-right">Due</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr>
17
+ <td>
18
+ <input
19
+ type="checkbox"
20
+ name="tasks"
21
+ value="ZAZZ-101"
22
+ aria-label="Select Audit focus rings"
23
+ checked
24
+ />
25
+ </td>
26
+ <td>Audit focus rings</td>
27
+ <td>Robin</td>
28
+ <td class="text-right">Aug 28</td>
29
+ </tr>
30
+ <tr>
31
+ <td>
32
+ <input
33
+ type="checkbox"
34
+ name="tasks"
35
+ value="ZAZZ-102"
36
+ aria-label="Select Document table variants"
37
+ />
38
+ </td>
39
+ <td>Document table variants</td>
40
+ <td>Sasha</td>
41
+ <td class="text-right">Aug 29</td>
42
+ </tr>
43
+ <tr>
44
+ <td>
45
+ <input
46
+ type="checkbox"
47
+ name="tasks"
48
+ value="ZAZZ-103"
49
+ aria-label="Select Ship checkbox groups"
50
+ checked
51
+ />
52
+ </td>
53
+ <td>Ship checkbox groups</td>
54
+ <td>Quinn</td>
55
+ <td class="text-right">Sep 01</td>
56
+ </tr>
57
+ <tr>
58
+ <td>
59
+ <input
60
+ type="checkbox"
61
+ name="tasks"
62
+ value="ZAZZ-104"
63
+ aria-label="Select Retire legacy tokens"
64
+ />
65
+ </td>
66
+ <td>Retire legacy tokens</td>
67
+ <td>Robin</td>
68
+ <td class="text-right">Sep 03</td>
69
+ </tr>
70
+ </tbody>
71
+ </table>