@zazz-ui/core 0.13.1 → 0.14.1

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 (88) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +5 -9
  3. package/dist/sri.json +35 -31
  4. package/dist/zazz.css +1 -1
  5. package/dist/zazz.js +1 -1
  6. package/editor/zazz.css-data.json +173 -3
  7. package/editor/zazz.html-data.json +138 -0
  8. package/editor/zazz.language-data.json +313 -125
  9. package/editor/zazz.lint-data.json +1501 -1383
  10. package/package.json +1 -5
  11. package/src/base/_defaults.css +1 -1
  12. package/src/base/_reset.css +16 -2
  13. package/src/base/_variables.css +43 -31
  14. package/src/base/carousel-scroll.d.ts +161 -0
  15. package/src/base/carousel-scroll.d.ts.map +1 -0
  16. package/src/base/carousel-scroll.js +1035 -0
  17. package/src/base/carousel-scroll.ts +1227 -0
  18. package/src/base/carousel.d.ts +34 -0
  19. package/src/base/carousel.d.ts.map +1 -0
  20. package/src/base/carousel.js +279 -0
  21. package/src/base/carousel.ts +292 -0
  22. package/src/base/dialog-lifecycle.js +1 -1
  23. package/src/base/dialog-lifecycle.ts +1 -1
  24. package/src/base/gesture.d.ts +201 -0
  25. package/src/base/gesture.d.ts.map +1 -0
  26. package/src/base/gesture.js +317 -0
  27. package/src/base/gesture.ts +494 -0
  28. package/src/base/kit-styling.d.ts.map +1 -1
  29. package/src/base/kit-styling.js +182 -162
  30. package/src/base/kit-styling.ts +182 -162
  31. package/src/base/navigation.d.ts +12 -1
  32. package/src/base/navigation.d.ts.map +1 -1
  33. package/src/base/navigation.js +65 -1
  34. package/src/base/navigation.ts +66 -1
  35. package/src/base/utils.d.ts +1 -1
  36. package/src/base/utils.js +2 -2
  37. package/src/base/utils.ts +2 -2
  38. package/src/globals.d.ts +7 -30
  39. package/src/head.d.ts.map +1 -1
  40. package/src/head.js +1 -25
  41. package/src/head.ts +1 -25
  42. package/src/index.css +1 -0
  43. package/src/index.d.ts +6 -5
  44. package/src/index.d.ts.map +1 -1
  45. package/src/index.js +6 -5
  46. package/src/index.ts +6 -5
  47. package/src/manifest.d.ts +1 -1
  48. package/src/manifest.d.ts.map +1 -1
  49. package/src/manifest.js +25 -13
  50. package/src/manifest.ts +26 -14
  51. package/src/primitives/button/button.css +1 -1
  52. package/src/primitives/carousel/carousel.css +103 -20
  53. package/src/primitives/carousel/carousel.d.ts +4 -32
  54. package/src/primitives/carousel/carousel.d.ts.map +1 -1
  55. package/src/primitives/carousel/carousel.js +39 -14
  56. package/src/primitives/carousel/carousel.ts +21 -25
  57. package/src/primitives/dialog/dialog.css +14 -8
  58. package/src/primitives/drawer/drawer-indent.html +27 -0
  59. package/src/primitives/drawer/drawer-nested.html +72 -0
  60. package/src/primitives/drawer/drawer-responsive-dialog.html +44 -0
  61. package/src/primitives/drawer/drawer-snap.html +26 -0
  62. package/src/primitives/drawer/drawer.css +528 -0
  63. package/src/primitives/drawer/drawer.d.ts +24 -0
  64. package/src/primitives/drawer/drawer.d.ts.map +1 -0
  65. package/src/primitives/drawer/drawer.html +42 -0
  66. package/src/primitives/drawer/drawer.js +765 -0
  67. package/src/primitives/drawer/drawer.ts +823 -0
  68. package/src/primitives/fields/fields.css +4 -2
  69. package/src/primitives/input/input.css +1 -1
  70. package/src/primitives/input-group/input-group.css +5 -5
  71. package/src/primitives/lightbox/lightbox.css +2 -2
  72. package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
  73. package/src/primitives/lightbox/lightbox.js +9 -8
  74. package/src/primitives/lightbox/lightbox.ts +9 -8
  75. package/src/primitives/password-group/password-group.css +5 -5
  76. package/src/primitives/radio/radio.css +15 -10
  77. package/src/primitives/slider/slider.css +2 -2
  78. package/src/primitives/switch/switch.css +6 -6
  79. package/src/primitives/tabs/tabs.css +10 -10
  80. package/src/primitives/toaster/toaster.css +29 -1
  81. package/src/primitives/toaster/toaster.d.ts.map +1 -1
  82. package/src/primitives/toaster/toaster.js +117 -9
  83. package/src/primitives/toaster/toaster.ts +136 -9
  84. package/src/primitives/tooltip/tooltip.css +93 -10
  85. package/src/base/embla.d.ts +0 -90
  86. package/src/base/embla.d.ts.map +0 -1
  87. package/src/base/embla.js +0 -878
  88. package/src/base/embla.ts +0 -1066
@@ -18,6 +18,14 @@ import { refreshAll } from "./zazz-element.ts";
18
18
  * element keeps its scroll offsets, and its links take `aria-current` from the
19
19
  * destination's copy, so a kept header still marks the current page.
20
20
  *
21
+ * The destination's stylesheets come along: a `<link rel="stylesheet">` or
22
+ * `<style>` in its `<head>` that this document lacks is added (a link by its
23
+ * URL, a style by its text), and the swap waits for new links to load, up to
24
+ * three seconds, so the page never shows unstyled. A framework's per-page CSS
25
+ * (Astro's scoped component styles) therefore applies after a swap as it does
26
+ * after a full load. Nothing is removed: a stylesheet a later page doesn't list
27
+ * stays, so keep page-specific CSS scoped to that page's markup.
28
+ *
21
29
  * An element whose content depends on the page (a section sidebar, a table of
22
30
  * contents) should not persist; `data-ui-persist-scroll="<id>"` renders it from
23
31
  * the destination and carries only its scroll offset. The window itself
@@ -144,6 +152,59 @@ function swapBody(next: HTMLElement): HTMLElement {
144
152
  return body;
145
153
  }
146
154
 
155
+ /** How long a swap waits for a new stylesheet before showing the page anyway. */
156
+ const STYLESHEET_WAIT = 3000;
157
+
158
+ /**
159
+ * @description Adds the stylesheets in `doc`'s `<head>` that this document
160
+ * doesn't have: a `<link rel="stylesheet">` by its URL (resolved against `url`),
161
+ * a `<style>` by its text. Resolves once every added link has loaded or failed,
162
+ * or after {@link STYLESHEET_WAIT}.
163
+ *
164
+ * @param doc - The destination's parsed document.
165
+ * @param url - The destination's URL, for resolving relative `href`s.
166
+ * @private
167
+ */
168
+ async function adoptStyles(doc: Document, url: string): Promise<void> {
169
+ const head = document.head;
170
+ const hrefs = new Set<string>();
171
+ for (const link of head.querySelectorAll<HTMLLinkElement>('link[rel~="stylesheet"][href]')) {
172
+ hrefs.add(link.href);
173
+ }
174
+ const texts = new Set<string>();
175
+ for (const style of head.querySelectorAll("style")) texts.add(style.textContent ?? "");
176
+
177
+ const loads: Promise<void>[] = [];
178
+ for (const el of doc.head.querySelectorAll('link[rel~="stylesheet"][href], style')) {
179
+ if (el.localName === "style") {
180
+ const text = el.textContent ?? "";
181
+ if (texts.has(text)) continue;
182
+ texts.add(text);
183
+ head.append(document.importNode(el, true));
184
+ continue;
185
+ }
186
+ const href = new URL(el.getAttribute("href") ?? "", url).href;
187
+ if (hrefs.has(href)) continue;
188
+ hrefs.add(href);
189
+ const link = document.importNode(el, true) as HTMLLinkElement;
190
+ link.href = href;
191
+ loads.push(
192
+ new Promise((done) => {
193
+ link.addEventListener("load", () => done(), { once: true });
194
+ link.addEventListener("error", () => done(), { once: true });
195
+ }),
196
+ );
197
+ head.append(link);
198
+ }
199
+ if (loads.length === 0) return;
200
+ let timer = 0;
201
+ await Promise.race([
202
+ Promise.all(loads),
203
+ new Promise<void>((done) => (timer = window.setTimeout(done, STYLESHEET_WAIT))),
204
+ ]);
205
+ window.clearTimeout(timer);
206
+ }
207
+
147
208
  /**
148
209
  * @description Moves focus to the new page's primary heading so screen readers
149
210
  * announce the navigation.
@@ -256,6 +317,10 @@ if ("navigation" in window) {
256
317
  return;
257
318
  }
258
319
 
320
+ // The destination's own stylesheets load before it is shown.
321
+ await adoptStyles(doc, e.destination.url);
322
+ if (e.signal.aborted) return;
323
+
259
324
  let body = document.body;
260
325
  const update = () => {
261
326
  body = swapBody(doc.body);
@@ -295,4 +360,4 @@ if ("navigation" in window) {
295
360
  console.warn("Navigation API not supported: data-ui-navigation falls back to full page loads.");
296
361
  }
297
362
 
298
- export { swapBody };
363
+ export { adoptStyles, swapBody };
@@ -7,7 +7,7 @@
7
7
  * idiom need this exact parser to match kit behaviour.
8
8
  *
9
9
  * Callers that need a typed result should wrap it at their own boundary (see
10
- * `readCarouselOptions` in embla.ts).
10
+ * the carousel options in carousel-scroll.ts).
11
11
  */
12
12
  /**
13
13
  * @description Converts string values to their appropriate JavaScript types.
package/src/base/utils.js CHANGED
@@ -8,7 +8,7 @@
8
8
  * idiom need this exact parser to match kit behaviour.
9
9
  *
10
10
  * Callers that need a typed result should wrap it at their own boundary (see
11
- * `readCarouselOptions` in embla.ts).
11
+ * the carousel options in carousel-scroll.ts).
12
12
  */
13
13
  // --- Data type conversion ---
14
14
  /**
@@ -77,7 +77,7 @@ const Utils = {
77
77
  parseDataAttributes,
78
78
  };
79
79
  // Attach to window for the documented public API (`window.Utils`), and export
80
- // for module consumers (embla.js imports it via the index.js entry).
80
+ // for module consumers (carousel-scroll.js imports it).
81
81
  if (typeof window !== "undefined") {
82
82
  window.Utils = Utils;
83
83
  }
package/src/base/utils.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  * idiom need this exact parser to match kit behaviour.
10
10
  *
11
11
  * Callers that need a typed result should wrap it at their own boundary (see
12
- * `readCarouselOptions` in embla.ts).
12
+ * the carousel options in carousel-scroll.ts).
13
13
  */
14
14
 
15
15
  // --- Data type conversion ---
@@ -86,7 +86,7 @@ const Utils = {
86
86
  };
87
87
 
88
88
  // Attach to window for the documented public API (`window.Utils`), and export
89
- // for module consumers (embla.js imports it via the index.js entry).
89
+ // for module consumers (carousel-scroll.js imports it).
90
90
  if (typeof window !== "undefined") {
91
91
  window.Utils = Utils;
92
92
  }
package/src/globals.d.ts CHANGED
@@ -4,28 +4,16 @@
4
4
  * checkJs can validate files that reference them across module boundaries.
5
5
  */
6
6
 
7
- // Scripts import Embla types directly from "embla-carousel" (so emitted .d.ts
8
- // files stay self-contained for consumers); this alias exists only for the
9
- // ambient interface merges below, which cannot use top-level imports.
10
- type EmblaCarouselType = import("embla-carousel").EmblaCarouselType;
11
-
12
7
  interface UtilsNamespace {
13
8
  parseValue(value: string): boolean | number | unknown[] | string;
14
9
  parseDataAttributes(node: Element, prefix: string): Record<string, unknown>;
15
10
  }
16
11
 
17
12
  interface Element {
18
- /** @internal Set by embla.js on carousel root elements. */
19
- _emblaApi?: EmblaCarouselType;
20
- /** @internal Set by embla.js when a thumb carousel is linked. */
21
- _emblaApiThumb?: EmblaCarouselType;
22
- /** @internal Set by embla.js; aborts all per-carousel listeners on teardown. */
23
- _emblaController?: AbortController;
24
- }
25
-
26
- interface InitEmblaKeyboardNavFn {
27
- (): void;
28
- _bound?: boolean;
13
+ /** @internal Set by carousel-scroll.js on carousel roots and thumb strips: the carousel API. */
14
+ _carousel?: import("./base/carousel-scroll.ts").CarouselApi;
15
+ /** @internal Set by carousel.js; aborting it tears the carousel down. */
16
+ _carouselController?: AbortController;
29
17
  }
30
18
 
31
19
  /** @see https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API */
@@ -129,20 +117,9 @@ interface Window {
129
117
  Reveal: RevealConstructor;
130
118
  /** Set by toaster.js — the imperative toast API. */
131
119
  Toaster: ToasterNamespace;
132
- EmblaInit: {
120
+ /** Set by carousel.js — carousel initialization. */
121
+ Carousel: {
133
122
  init: (scope?: Document | Element) => void;
134
- initRoot: (emblaNode: Element) => void;
135
- addDotBtnsAndClickHandlers: (
136
- emblaApi: EmblaCarouselType,
137
- dotsNode: Element,
138
- ) => (() => void) | undefined;
139
- addThumbClickHandlers: (
140
- emblaApiMain: EmblaCarouselType,
141
- emblaApiThumb: EmblaCarouselType,
142
- ) => void;
143
- addTogglethumbsActive: (
144
- emblaApiMain: EmblaCarouselType,
145
- emblaApiThumb: EmblaCarouselType,
146
- ) => void;
123
+ initRoot: (root: Element) => void;
147
124
  };
148
125
  }
package/src/head.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"head.d.ts","sourceRoot":"","sources":["head.ts"],"names":[],"mappings":"AA6BA,wDAAwD;AACxD,UAAU,aAAa;IACrB,0EAA0E;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAwCD;;;;;;GAMG;AACH,iBA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,CAC3B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,WAAW,GACpB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAa1D;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,CAG1F"}
package/src/head.js CHANGED
@@ -78,30 +78,6 @@ const ESM_DEPENDENCIES = [
78
78
  file: "dist/index.js",
79
79
  integrity: "sha384-0OqM7OXGT6Oz1z98u/geiFn/FUyz4iWexkXHCvbIGXRRDXl6bp6IKc0j78AQ6DEK",
80
80
  },
81
- {
82
- name: "embla-carousel",
83
- version: "9.0.0-rc04",
84
- file: "esm/embla-carousel.esm.js",
85
- integrity: "sha384-Qcz5VJ/iRhG3zPRMT8li6rYNSsXcCeSQ6URxPlQh7joEd/nNxRRkCZxlJoTZr3Ch",
86
- },
87
- {
88
- name: "embla-carousel-autoplay",
89
- version: "9.0.0-rc04",
90
- file: "esm/embla-carousel-autoplay.esm.js",
91
- integrity: "sha384-dsPLKoLTpj/hIVD1I1zYA1kDCI32uRH4seU3ly+s7Lm9MdWVsj1OmE8HELhZ/Fm4",
92
- },
93
- {
94
- name: "embla-carousel-auto-scroll",
95
- version: "9.0.0-rc04",
96
- file: "esm/embla-carousel-auto-scroll.esm.js",
97
- integrity: "sha384-bOWyJNYHSsncAhdIgavN6TjY6Bb/NRLV9fAon5xy9HquiFZbNYTjq2JZ5bq5nyb5",
98
- },
99
- {
100
- name: "embla-carousel-class-names",
101
- version: "9.0.0-rc04",
102
- file: "esm/embla-carousel-class-names.esm.js",
103
- integrity: "sha384-y8wWJW7HPdqr5guB+ZdF/o9FIRGg2KtH9TdoAttP7jjEU9bQlAzY0Fc5FiIMYQN1",
104
- },
105
81
  ];
106
82
  /**
107
83
  * Feature polyfills loaded ahead of the kit module. Exactly one entry:
@@ -143,7 +119,7 @@ function fontsBlock(display) {
143
119
  }
144
120
  /**
145
121
  * @description Renders the import map that resolves the kit's bare specifiers
146
- * (`signal-polyfill`, `embla-carousel`, …) to pinned jsDelivr URLs, with an
122
+ * (`signal-polyfill`) to pinned jsDelivr URLs, with an
147
123
  * `integrity` section covering every mapped file.
148
124
  *
149
125
  * @returns The import-map script tag.
package/src/head.ts CHANGED
@@ -104,30 +104,6 @@ const ESM_DEPENDENCIES: readonly CdnDependency[] = [
104
104
  file: "dist/index.js",
105
105
  integrity: "sha384-0OqM7OXGT6Oz1z98u/geiFn/FUyz4iWexkXHCvbIGXRRDXl6bp6IKc0j78AQ6DEK",
106
106
  },
107
- {
108
- name: "embla-carousel",
109
- version: "9.0.0-rc04",
110
- file: "esm/embla-carousel.esm.js",
111
- integrity: "sha384-Qcz5VJ/iRhG3zPRMT8li6rYNSsXcCeSQ6URxPlQh7joEd/nNxRRkCZxlJoTZr3Ch",
112
- },
113
- {
114
- name: "embla-carousel-autoplay",
115
- version: "9.0.0-rc04",
116
- file: "esm/embla-carousel-autoplay.esm.js",
117
- integrity: "sha384-dsPLKoLTpj/hIVD1I1zYA1kDCI32uRH4seU3ly+s7Lm9MdWVsj1OmE8HELhZ/Fm4",
118
- },
119
- {
120
- name: "embla-carousel-auto-scroll",
121
- version: "9.0.0-rc04",
122
- file: "esm/embla-carousel-auto-scroll.esm.js",
123
- integrity: "sha384-bOWyJNYHSsncAhdIgavN6TjY6Bb/NRLV9fAon5xy9HquiFZbNYTjq2JZ5bq5nyb5",
124
- },
125
- {
126
- name: "embla-carousel-class-names",
127
- version: "9.0.0-rc04",
128
- file: "esm/embla-carousel-class-names.esm.js",
129
- integrity: "sha384-y8wWJW7HPdqr5guB+ZdF/o9FIRGg2KtH9TdoAttP7jjEU9bQlAzY0Fc5FiIMYQN1",
130
- },
131
107
  ];
132
108
 
133
109
  /**
@@ -173,7 +149,7 @@ function fontsBlock(display: "swap" | "optional"): string {
173
149
 
174
150
  /**
175
151
  * @description Renders the import map that resolves the kit's bare specifiers
176
- * (`signal-polyfill`, `embla-carousel`, …) to pinned jsDelivr URLs, with an
152
+ * (`signal-polyfill`) to pinned jsDelivr URLs, with an
177
153
  * `integrity` section covering every mapped file.
178
154
  *
179
155
  * @returns The import-map script tag.
package/src/index.css CHANGED
@@ -53,6 +53,7 @@
53
53
  @import "./primitives/tooltip/tooltip.css";
54
54
  @import "./primitives/dialog/dialog.css";
55
55
  @import "./primitives/alert-dialog/alert-dialog.css";
56
+ @import "./primitives/drawer/drawer.css";
56
57
  @import "./primitives/menu/menu.css";
57
58
  @import "./primitives/navigation-menu/navigation-menu.css";
58
59
  @import "./primitives/mobile-menu/mobile-menu.css";
package/src/index.d.ts CHANGED
@@ -3,28 +3,29 @@
3
3
  * @description Imports all Zazz behavior modules so a page needs only one
4
4
  * `<script type="module" src=".../index.js">` instead of ten separate tags.
5
5
  * Each module runs for its side effects: global/utility setup, scroll-reveal
6
- * and carousel auto-initialization, SPA navigation, and the custom-element
6
+ * and carousel auto-initialization, drawer dragging, SPA navigation, and the custom-element
7
7
  * registrations (`<ui-autocomplete>`, `<ui-carousel>`, `<ui-combobox>`,
8
8
  * `<ui-command>`, `<ui-lightbox>`, `<ui-menu>`, `<ui-password>`, `<ui-tabs>`,
9
- * `<ui-toaster>`).
9
+ * `<ui-toaster>`), plus the `<ui-drawer-indent>` wrapper the drawer script finds by selector.
10
10
  *
11
11
  * Internal dependencies are resolved by the module graph — utils loads
12
- * before embla, embla before carousel, carousel before lightbox — so the
12
+ * before carousel, carousel before lightbox — so the
13
13
  * import order below is for readability, not correctness.
14
14
  *
15
- * External dependencies (signal-polyfill, the Embla packages) are imported by
15
+ * The one external dependency (signal-polyfill) is imported by
16
16
  * bare specifier and resolved by the page's import map — generated by
17
17
  * `head.ts` with pinned, SRI-checked jsDelivr URLs. No extra script tags.
18
18
  */
19
19
  import "./base/utils.ts";
20
20
  import "./base/reveal.ts";
21
21
  import "./base/dialog-lifecycle.ts";
22
- import "./base/embla.ts";
22
+ import "./base/carousel.ts";
23
23
  import "./primitives/autocomplete/autocomplete.ts";
24
24
  import "./primitives/checkbox/checkbox.ts";
25
25
  import "./primitives/combobox/combobox.ts";
26
26
  import "./primitives/command/command.ts";
27
27
  import "./primitives/carousel/carousel.ts";
28
+ import "./primitives/drawer/drawer.ts";
28
29
  import "./primitives/lightbox/lightbox.ts";
29
30
  import "./primitives/menu/menu.ts";
30
31
  import "./primitives/otp/otp.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,iBAAiB,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,4BAA4B,CAAC;AACpC,OAAO,iBAAiB,CAAC;AACzB,OAAO,2CAA2C,CAAC;AACnD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,2BAA2B,CAAC;AACnC,OAAO,yBAAyB,CAAC;AACjC,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,2BAA2B,CAAC;AACnC,OAAO,iCAAiC,CAAC;AACzC,OAAO,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,iBAAiB,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,4BAA4B,CAAC;AACpC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,2CAA2C,CAAC;AACnD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mCAAmC,CAAC;AAC3C,OAAO,iCAAiC,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,+BAA+B,CAAC;AACvC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,2BAA2B,CAAC;AACnC,OAAO,yBAAyB,CAAC;AACjC,OAAO,+CAA+C,CAAC;AACvD,OAAO,oCAAoC,CAAC;AAC5C,OAAO,2BAA2B,CAAC;AACnC,OAAO,iCAAiC,CAAC;AACzC,OAAO,sBAAsB,CAAC"}
package/src/index.js CHANGED
@@ -3,28 +3,29 @@
3
3
  * @description Imports all Zazz behavior modules so a page needs only one
4
4
  * `<script type="module" src=".../index.js">` instead of ten separate tags.
5
5
  * Each module runs for its side effects: global/utility setup, scroll-reveal
6
- * and carousel auto-initialization, SPA navigation, and the custom-element
6
+ * and carousel auto-initialization, drawer dragging, SPA navigation, and the custom-element
7
7
  * registrations (`<ui-autocomplete>`, `<ui-carousel>`, `<ui-combobox>`,
8
8
  * `<ui-command>`, `<ui-lightbox>`, `<ui-menu>`, `<ui-password>`, `<ui-tabs>`,
9
- * `<ui-toaster>`).
9
+ * `<ui-toaster>`), plus the `<ui-drawer-indent>` wrapper the drawer script finds by selector.
10
10
  *
11
11
  * Internal dependencies are resolved by the module graph — utils loads
12
- * before embla, embla before carousel, carousel before lightbox — so the
12
+ * before carousel, carousel before lightbox — so the
13
13
  * import order below is for readability, not correctness.
14
14
  *
15
- * External dependencies (signal-polyfill, the Embla packages) are imported by
15
+ * The one external dependency (signal-polyfill) is imported by
16
16
  * bare specifier and resolved by the page's import map — generated by
17
17
  * `head.ts` with pinned, SRI-checked jsDelivr URLs. No extra script tags.
18
18
  */
19
19
  import "./base/utils.js";
20
20
  import "./base/reveal.js";
21
21
  import "./base/dialog-lifecycle.js";
22
- import "./base/embla.js";
22
+ import "./base/carousel.js";
23
23
  import "./primitives/autocomplete/autocomplete.js";
24
24
  import "./primitives/checkbox/checkbox.js";
25
25
  import "./primitives/combobox/combobox.js";
26
26
  import "./primitives/command/command.js";
27
27
  import "./primitives/carousel/carousel.js";
28
+ import "./primitives/drawer/drawer.js";
28
29
  import "./primitives/lightbox/lightbox.js";
29
30
  import "./primitives/menu/menu.js";
30
31
  import "./primitives/otp/otp.js";
package/src/index.ts CHANGED
@@ -3,16 +3,16 @@
3
3
  * @description Imports all Zazz behavior modules so a page needs only one
4
4
  * `<script type="module" src=".../index.js">` instead of ten separate tags.
5
5
  * Each module runs for its side effects: global/utility setup, scroll-reveal
6
- * and carousel auto-initialization, SPA navigation, and the custom-element
6
+ * and carousel auto-initialization, drawer dragging, SPA navigation, and the custom-element
7
7
  * registrations (`<ui-autocomplete>`, `<ui-carousel>`, `<ui-combobox>`,
8
8
  * `<ui-command>`, `<ui-lightbox>`, `<ui-menu>`, `<ui-password>`, `<ui-tabs>`,
9
- * `<ui-toaster>`).
9
+ * `<ui-toaster>`), plus the `<ui-drawer-indent>` wrapper the drawer script finds by selector.
10
10
  *
11
11
  * Internal dependencies are resolved by the module graph — utils loads
12
- * before embla, embla before carousel, carousel before lightbox — so the
12
+ * before carousel, carousel before lightbox — so the
13
13
  * import order below is for readability, not correctness.
14
14
  *
15
- * External dependencies (signal-polyfill, the Embla packages) are imported by
15
+ * The one external dependency (signal-polyfill) is imported by
16
16
  * bare specifier and resolved by the page's import map — generated by
17
17
  * `head.ts` with pinned, SRI-checked jsDelivr URLs. No extra script tags.
18
18
  */
@@ -20,12 +20,13 @@
20
20
  import "./base/utils.ts";
21
21
  import "./base/reveal.ts";
22
22
  import "./base/dialog-lifecycle.ts";
23
- import "./base/embla.ts";
23
+ import "./base/carousel.ts";
24
24
  import "./primitives/autocomplete/autocomplete.ts";
25
25
  import "./primitives/checkbox/checkbox.ts";
26
26
  import "./primitives/combobox/combobox.ts";
27
27
  import "./primitives/command/command.ts";
28
28
  import "./primitives/carousel/carousel.ts";
29
+ import "./primitives/drawer/drawer.ts";
29
30
  import "./primitives/lightbox/lightbox.ts";
30
31
  import "./primitives/menu/menu.ts";
31
32
  import "./primitives/otp/otp.ts";
package/src/manifest.d.ts CHANGED
@@ -127,7 +127,7 @@ export declare const CSS_CASCADE_ORDER: string[];
127
127
  * // ["fields", "badge", "kbd", "button", "popover", "select", "combobox"]
128
128
  */
129
129
  export declare function resolveClosure(names: string[]): string[];
130
- export type ExampleScript = "autocomplete" | "combobox" | "command" | "command-actions" | "embla" | "reveal" | "carousel" | "checkbox" | "lightbox" | "menu" | "multiselect" | "otp" | "password" | "tabs" | "toaster";
130
+ export type ExampleScript = "autocomplete" | "combobox" | "command" | "command-actions" | "drawer" | "reveal" | "carousel" | "checkbox" | "lightbox" | "menu" | "multiselect" | "otp" | "password" | "tabs" | "toaster";
131
131
  /**
132
132
  * Emitted script files (relative to the package `src/` root) that implement each
133
133
  * web-component script id. This is the single mapping from script ids to files
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["manifest.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,yEAAyE;AACzE,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,qDAAqD;IACrD,EAAE,EAAE,MAAM,EAAE,CAAC;IACb;;;;OAIG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,0EAA0E;IAC1E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,uDAAuD;IACvD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAgBD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAsgBrD,CAAC;AAIF;;;;;;GAMG;AACH;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,EAQhC,CAAC;AAEF,iFAAiF;AACjF,eAAO,M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AAO,MAAM,cAAc,EAAE,eAAe,EAE3C,CAAC;AAEF,yHAAyH;AACzH,eAAO,MAAM,SAAS,EAAE,MAAM,EAErB,CAAC;AAEV,eAAO,MAAM,iBAAiB,EAAE,MAAM,EA4CrC,CAAC;AAIF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAoBxD;AAID,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,UAAU,GACV,MAAM,GACN,aAAa,GACb,KAAK,GACL,UAAU,GACV,MAAM,GACN,SAAS,CAAC;AAEd;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC,CAoC/E,CAAC"}
package/src/manifest.js CHANGED
@@ -26,13 +26,8 @@
26
26
  export const MANIFEST_VERSION = 2;
27
27
  /** Bare specifiers pulled in by `base/signals.ts` (core runtime). */
28
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
- ];
29
+ /** The carousel stack: the gesture layer, the scroll-snap engine, and the page wiring. */
30
+ const CAROUSEL_BASE = ["base/gesture.js", "base/carousel-scroll.js", "base/carousel.js"];
36
31
  /** The typeahead engine stack shared by autocomplete, combobox, and command. */
37
32
  const TYPEAHEAD_BASE = ["base/command-score.js", "base/hotkeys.js", "base/typeahead.js"];
38
33
  /**
@@ -147,9 +142,9 @@ export const PRIMITIVES = {
147
142
  tags: ["ui-carousel"],
148
143
  css: ["primitives/carousel/carousel.css"],
149
144
  js: ["primitives/carousel/carousel.js"],
150
- base: ["base/embla.js"],
145
+ base: CAROUSEL_BASE,
151
146
  primitives: [],
152
- bare: EMBLA_BARE,
147
+ bare: [],
153
148
  examples: ["primitives/carousel/carousel.html"],
154
149
  },
155
150
  checkbox: {
@@ -201,6 +196,21 @@ export const PRIMITIVES = {
201
196
  bare: [],
202
197
  examples: ["primitives/dialog/dialog.html", "primitives/dialog/dialog-with-form.html"],
203
198
  },
199
+ drawer: {
200
+ css: ["primitives/drawer/drawer.css"],
201
+ js: ["primitives/drawer/drawer.js"],
202
+ base: ["base/gesture.js"],
203
+ primitives: ["dialog", "button"],
204
+ bare: [],
205
+ tags: ["ui-drawer-indent"],
206
+ examples: [
207
+ "primitives/drawer/drawer.html",
208
+ "primitives/drawer/drawer-responsive-dialog.html",
209
+ "primitives/drawer/drawer-snap.html",
210
+ "primitives/drawer/drawer-nested.html",
211
+ "primitives/drawer/drawer-indent.html",
212
+ ],
213
+ },
204
214
  fields: {
205
215
  css: ["primitives/fields/fields.css"],
206
216
  js: [],
@@ -263,9 +273,9 @@ export const PRIMITIVES = {
263
273
  tags: ["ui-lightbox"],
264
274
  css: ["primitives/lightbox/lightbox.css"],
265
275
  js: ["primitives/lightbox/lightbox.js"],
266
- base: ["base/embla.js"],
276
+ base: CAROUSEL_BASE,
267
277
  primitives: ["dialog", "carousel", "button"],
268
- bare: EMBLA_BARE,
278
+ bare: [],
269
279
  examples: ["primitives/lightbox/lightbox.html"],
270
280
  },
271
281
  menu: {
@@ -465,7 +475,7 @@ export const PRIMITIVES = {
465
475
  tags: ["ui-toaster"],
466
476
  css: ["primitives/toaster/toaster.css"],
467
477
  js: ["primitives/toaster/toaster.js"],
468
- base: [],
478
+ base: ["base/gesture.js"],
469
479
  primitives: ["popover", "button"],
470
480
  bare: SIGNALS_BARE,
471
481
  examples: ["primitives/toaster/toaster.html"],
@@ -684,6 +694,7 @@ export const CSS_CASCADE_ORDER = [
684
694
  "tooltip",
685
695
  "dialog",
686
696
  "alert-dialog",
697
+ "drawer",
687
698
  "menu",
688
699
  "navigation-menu",
689
700
  "mobile-menu",
@@ -784,11 +795,12 @@ export const WEB_COMPONENT_SCRIPT_FILES = {
784
795
  ],
785
796
  carousel: ["primitives/carousel/carousel.js"],
786
797
  checkbox: ["primitives/checkbox/checkbox.js"],
798
+ drawer: ["base/gesture.js", "primitives/drawer/drawer.js"],
787
799
  lightbox: ["primitives/carousel/carousel.js", "primitives/lightbox/lightbox.js"],
788
800
  menu: ["primitives/menu/menu.js"],
789
801
  multiselect: ["primitives/select/multiselect.js"],
790
802
  otp: ["primitives/otp/otp.js"],
791
803
  password: ["primitives/password-group/password-group.js"],
792
804
  tabs: ["primitives/tabs/tabs.js"],
793
- toaster: ["primitives/toaster/toaster.js"],
805
+ toaster: ["base/gesture.js", "primitives/toaster/toaster.js"],
794
806
  };
package/src/manifest.ts CHANGED
@@ -60,13 +60,8 @@ export interface PrimitiveEntry {
60
60
  /** Bare specifiers pulled in by `base/signals.ts` (core runtime). */
61
61
  const SIGNALS_BARE = ["signal-polyfill"];
62
62
 
63
- /** Bare specifiers pulled in by `base/embla.ts`. */
64
- const EMBLA_BARE = [
65
- "embla-carousel",
66
- "embla-carousel-autoplay",
67
- "embla-carousel-auto-scroll",
68
- "embla-carousel-class-names",
69
- ];
63
+ /** The carousel stack: the gesture layer, the scroll-snap engine, and the page wiring. */
64
+ const CAROUSEL_BASE = ["base/gesture.js", "base/carousel-scroll.js", "base/carousel.js"];
70
65
 
71
66
  /** The typeahead engine stack shared by autocomplete, combobox, and command. */
72
67
  const TYPEAHEAD_BASE = ["base/command-score.js", "base/hotkeys.js", "base/typeahead.js"];
@@ -183,9 +178,9 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
183
178
  tags: ["ui-carousel"],
184
179
  css: ["primitives/carousel/carousel.css"],
185
180
  js: ["primitives/carousel/carousel.js"],
186
- base: ["base/embla.js"],
181
+ base: CAROUSEL_BASE,
187
182
  primitives: [],
188
- bare: EMBLA_BARE,
183
+ bare: [],
189
184
  examples: ["primitives/carousel/carousel.html"],
190
185
  },
191
186
  checkbox: {
@@ -237,6 +232,21 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
237
232
  bare: [],
238
233
  examples: ["primitives/dialog/dialog.html", "primitives/dialog/dialog-with-form.html"],
239
234
  },
235
+ drawer: {
236
+ css: ["primitives/drawer/drawer.css"],
237
+ js: ["primitives/drawer/drawer.js"],
238
+ base: ["base/gesture.js"],
239
+ primitives: ["dialog", "button"],
240
+ bare: [],
241
+ tags: ["ui-drawer-indent"],
242
+ examples: [
243
+ "primitives/drawer/drawer.html",
244
+ "primitives/drawer/drawer-responsive-dialog.html",
245
+ "primitives/drawer/drawer-snap.html",
246
+ "primitives/drawer/drawer-nested.html",
247
+ "primitives/drawer/drawer-indent.html",
248
+ ],
249
+ },
240
250
  fields: {
241
251
  css: ["primitives/fields/fields.css"],
242
252
  js: [],
@@ -299,9 +309,9 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
299
309
  tags: ["ui-lightbox"],
300
310
  css: ["primitives/lightbox/lightbox.css"],
301
311
  js: ["primitives/lightbox/lightbox.js"],
302
- base: ["base/embla.js"],
312
+ base: CAROUSEL_BASE,
303
313
  primitives: ["dialog", "carousel", "button"],
304
- bare: EMBLA_BARE,
314
+ bare: [],
305
315
  examples: ["primitives/lightbox/lightbox.html"],
306
316
  },
307
317
  menu: {
@@ -501,7 +511,7 @@ export const PRIMITIVES: Record<string, PrimitiveEntry> = {
501
511
  tags: ["ui-toaster"],
502
512
  css: ["primitives/toaster/toaster.css"],
503
513
  js: ["primitives/toaster/toaster.js"],
504
- base: [],
514
+ base: ["base/gesture.js"],
505
515
  primitives: ["popover", "button"],
506
516
  bare: SIGNALS_BARE,
507
517
  examples: ["primitives/toaster/toaster.html"],
@@ -750,6 +760,7 @@ export const CSS_CASCADE_ORDER: string[] = [
750
760
  "tooltip",
751
761
  "dialog",
752
762
  "alert-dialog",
763
+ "drawer",
753
764
  "menu",
754
765
  "navigation-menu",
755
766
  "mobile-menu",
@@ -817,7 +828,7 @@ export type ExampleScript =
817
828
  | "combobox"
818
829
  | "command"
819
830
  | "command-actions"
820
- | "embla"
831
+ | "drawer"
821
832
  | "reveal"
822
833
  | "carousel"
823
834
  | "checkbox"
@@ -866,11 +877,12 @@ export const WEB_COMPONENT_SCRIPT_FILES: Partial<Record<ExampleScript, string[]>
866
877
  ],
867
878
  carousel: ["primitives/carousel/carousel.js"],
868
879
  checkbox: ["primitives/checkbox/checkbox.js"],
880
+ drawer: ["base/gesture.js", "primitives/drawer/drawer.js"],
869
881
  lightbox: ["primitives/carousel/carousel.js", "primitives/lightbox/lightbox.js"],
870
882
  menu: ["primitives/menu/menu.js"],
871
883
  multiselect: ["primitives/select/multiselect.js"],
872
884
  otp: ["primitives/otp/otp.js"],
873
885
  password: ["primitives/password-group/password-group.js"],
874
886
  tabs: ["primitives/tabs/tabs.js"],
875
- toaster: ["primitives/toaster/toaster.js"],
887
+ toaster: ["base/gesture.js", "primitives/toaster/toaster.js"],
876
888
  };
@@ -59,7 +59,7 @@
59
59
  --ui-button-min-h: var(--ui-field-h);
60
60
  --ui-button-radius: var(--ui-field-radius);
61
61
  --ui-button-corner-shape: var(--ui-field-corner-shape);
62
- --ui-button-background-clip: padding-box;
62
+ --ui-button-background-clip: border-box;
63
63
 
64
64
  --ui-button-icon-size: var(--ui-field-icon-size);
65
65