@zazz-ui/core 0.2.0 → 0.4.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 (49) hide show
  1. package/CHANGELOG.md +55 -2
  2. package/README.md +4 -2
  3. package/dist/sri.json +25 -25
  4. package/dist/zazz.css +1 -1
  5. package/dist/zazz.js +1 -1
  6. package/examples/about.html +5 -12
  7. package/examples/components.html +4 -16
  8. package/examples/forms.html +3 -10
  9. package/examples/index.html +3 -10
  10. package/examples/layout.html +3 -10
  11. package/examples/products.html +3 -10
  12. package/examples/responsive.html +3 -10
  13. package/package.json +1 -1
  14. package/src/base/_layers.css +14 -4
  15. package/src/base/_layout.css +5 -2
  16. package/src/base/_typography.css +24 -6
  17. package/src/base/_utilities.css +509 -391
  18. package/src/base/_variables.css +22 -81
  19. package/src/base/_view-transitions.css +1 -1
  20. package/src/base/typeahead.js +1 -1
  21. package/src/base/typeahead.ts +1 -1
  22. package/src/head.d.ts +11 -4
  23. package/src/head.d.ts.map +1 -1
  24. package/src/head.js +23 -24
  25. package/src/head.ts +23 -24
  26. package/src/index.css +10 -4
  27. package/src/manifest.d.ts +1 -1
  28. package/src/manifest.js +6 -6
  29. package/src/primitives/autocomplete/autocomplete.css +1 -1
  30. package/src/primitives/badge/badge.css +10 -9
  31. package/src/primitives/button/button.css +12 -12
  32. package/src/primitives/carousel/carousel.html +1 -1
  33. package/src/primitives/combobox/combobox.css +1 -1
  34. package/src/primitives/command/command.css +1 -1
  35. package/src/primitives/command/command.js +1 -1
  36. package/src/primitives/command/command.ts +1 -1
  37. package/src/primitives/menu/menu.js +1 -1
  38. package/src/primitives/menu/menu.ts +1 -1
  39. package/src/primitives/navigation-menu/navigation-menu.css +4 -15
  40. package/src/primitives/popover/popover.css +5 -3
  41. package/src/primitives/select/select.css +1 -1
  42. package/src/primitives/toaster/toaster.css +1 -1
  43. package/src/primitives/toaster/toaster.js +2 -2
  44. package/src/primitives/toaster/toaster.ts +2 -2
  45. package/src/primitives/tooltip/tooltip-disabled.html +1 -6
  46. package/src/primitives/tooltip/tooltip-sides.html +3 -22
  47. package/src/primitives/tooltip/tooltip-with-kbd.html +1 -6
  48. package/src/primitives/tooltip/tooltip.css +1 -1
  49. package/src/primitives/tooltip/tooltip.html +1 -6
@@ -2,8 +2,9 @@
2
2
  * _variables.css — Global design tokens (Tier 1).
3
3
  *
4
4
  * @layer variables
5
- * @requires layers.css, _properties.css
6
- * @uses light-dark() — theme roles follow color-scheme / .dark overrides
5
+ * @requires layers.css
6
+ * @uses light-dark() — theme roles re-resolve per color-scheme (system,
7
+ * .dark/.light, [data-theme]); tokens stay unregistered on purpose
7
8
  * @uses oklch(from …) — shade/tint scales and shadow alphas
8
9
  * @uses color-mix() — focus ring (--ring)
9
10
  * @uses interpolate-size: allow-keywords — discrete block-size animations (details, etc.)
@@ -13,14 +14,6 @@
13
14
  * whole system; see CONVENTIONS.md.
14
15
  */
15
16
 
16
- /* Inverted menu */
17
-
18
- @property --use-inverted-popovers {
19
- syntax: "*";
20
- inherits: false;
21
- initial-value: false;
22
- }
23
-
24
17
  /* Animations */
25
18
 
26
19
  @property --default-transition-duration {
@@ -76,10 +69,11 @@
76
69
  initial-value: false;
77
70
  }
78
71
 
79
- /* Token values — @property registrations live in _properties.css (style() queries). */
72
+ /* Token values — the few typed @property registrations (style() queries) live above. */
80
73
  @layer variables {
81
74
  :root {
82
- /* Enable light/dark mode - make sure to redeclare dark mode tokens on .dark at the bottom of the file */
75
+ /* Enable light/dark mode — theme scopes at the bottom of the file pin
76
+ * color-scheme; light-dark() tokens re-resolve there automatically. */
83
77
  color-scheme: light dark;
84
78
 
85
79
  /* Enable discrete value animations, e.g. block-size: auto; */
@@ -98,11 +92,11 @@
98
92
  --card-foreground: light-dark(var(--neutral-900), var(--white));
99
93
  --popover: light-dark(var(--white), var(--neutral-950));
100
94
  --popover-foreground: light-dark(var(--neutral-900), var(--white));
101
- --input: light-dark(var(--neutral-50), var(--tint-50));
95
+ --input: light-dark(var(--neutral-50), var(--tint-100));
102
96
  --input-foreground: light-dark(var(--neutral-900), var(--white));
103
97
 
104
98
  /* overlay */
105
- --muted: light-dark(var(--shade-50), var(--tint-50));
99
+ --muted: light-dark(var(--shade-50), var(--tint-100));
106
100
  --muted-foreground: light-dark(var(--shade-600), var(--tint-600));
107
101
  --faded: light-dark(var(--tint-400), var(--shade-100));
108
102
  --faded-foreground: light-dark(var(--tint-600), var(--shade-600));
@@ -566,7 +560,7 @@
566
560
  * resolves it identically, no matter which container it reads from (the
567
561
  * .container element is intentionally container-type: normal).
568
562
  * Mobile-first: --is-breakpoint-X becomes true once width reaches X.
569
- * Registered as typed @property (false default) in _properties.css.
563
+ * Registered as typed @property (false default) at the top of this file.
570
564
  * Literal rem required — var() is invalid in a container-query prelude.
571
565
  * ========================================================================== */
572
566
  @container (width >=40rem) {
@@ -607,76 +601,23 @@
607
601
  }
608
602
 
609
603
  /*
610
- * Manual dark mode — re-declare dark theme tokens so light-dark() resolves
611
- * with color-scheme: dark. Tokens defined only on :root inherit as computed
612
- * light values; setting color-scheme on descendants alone does not flip them.
604
+ * Theme scopes — theme role tokens are intentionally unregistered, so their
605
+ * light-dark() expressions stay live in the token stream and re-resolve
606
+ * against each element's inherited color-scheme. Pinning color-scheme is all
607
+ * a scope needs; nesting works (.light inside .dark re-lightens its subtree).
608
+ * Built-in inherited color properties (color, accent-color, …) resolve at
609
+ * the ancestor, so re-assert them at each scope boundary.
613
610
  */
614
611
 
615
- @container style(--use-inverted-popovers: true) {
616
- :where([popover]:not([data-use-inverted-menu="false"])) {
617
- color-scheme: dark;
618
-
619
- --background: var(--neutral-900);
620
- --foreground: var(--white);
621
- --border: var(--tint-200);
622
- --border-foreground: var(--shade-500);
623
- --card: var(--neutral-950);
624
- --card-foreground: var(--white);
625
- --input: var(--tint-50);
626
- --input-foreground: var(--white);
627
- --popover: var(--shade-950);
628
- --popover-foreground: var(--white);
629
- --muted: var(--tint-50);
630
- --muted-foreground: var(--tint-600);
631
- --faded: var(--shade-100);
632
- --faded-foreground: var(--shade-600);
633
- --primary: var(--primary-500);
634
- --primary-foreground: var(--white);
635
- --secondary: var(--secondary-500);
636
- --secondary-foreground: var(--white);
637
- --tertiary: var(--tertiary-400);
638
- --tertiary-foreground: var(--white);
639
- --info: oklch(0.5 0.1193 242.75);
640
- --info-foreground: var(--white);
641
- --success: oklch(0.5081 0.1049 165.61);
642
- --success-foreground: var(--white);
643
- --warning: oklch(0.5553 0.1455 49);
644
- --warning-foreground: var(--white);
645
- --destructive: oklch(0.5054 0.1905 27.52);
646
- --destructive-foreground: var(--white);
647
- }
648
- }
649
-
612
+ [data-theme="dark"],
650
613
  .dark {
651
614
  color-scheme: dark;
615
+ color: var(--foreground);
616
+ }
652
617
 
653
- --background: var(--neutral-900);
654
- --foreground: var(--white);
655
- --border: var(--tint-200);
656
- --border-foreground: var(--shade-500);
657
- --card: var(--neutral-950);
658
- --card-foreground: var(--white);
659
- --input: var(--tint-50);
660
- --input-foreground: var(--white);
661
- --popover: var(--shade-950);
662
- --popover-foreground: var(--white);
663
- --muted: var(--tint-50);
664
- --muted-foreground: var(--tint-600);
665
- --faded: var(--shade-100);
666
- --faded-foreground: var(--shade-600);
667
- --primary: var(--primary-500);
668
- --primary-foreground: var(--white);
669
- --secondary: var(--secondary-500);
670
- --secondary-foreground: var(--white);
671
- --tertiary: var(--tertiary-400);
672
- --tertiary-foreground: var(--white);
673
- --info: oklch(0.5 0.1193 242.75);
674
- --info-foreground: var(--white);
675
- --success: oklch(0.5081 0.1049 165.61);
676
- --success-foreground: var(--white);
677
- --warning: oklch(0.5553 0.1455 49);
678
- --warning-foreground: var(--white);
679
- --destructive: oklch(0.5054 0.1905 27.52);
680
- --destructive-foreground: var(--white);
618
+ [data-theme="light"],
619
+ .light {
620
+ color-scheme: light;
621
+ color: var(--foreground);
681
622
  }
682
623
  }
@@ -79,7 +79,7 @@
79
79
 
80
80
  @keyframes global-view-transition--old {
81
81
  to {
82
- opacity: var(--view-transition-opacity--new);
82
+ opacity: var(--view-transition-opacity--old);
83
83
  transform: scale(var(--view-transition-scale--old))
84
84
  translate3d(var(--view-transition-translate--old));
85
85
  }
@@ -361,7 +361,7 @@ class TypeaheadElement extends ZazzElement {
361
361
  * @private
362
362
  */
363
363
  #panelOpen() {
364
- return this.panel?.matches(":popover-open, .\\:popover-open") ?? false;
364
+ return this.panel?.matches(":popover-open") ?? false;
365
365
  }
366
366
  /**
367
367
  * @description Keyboard contract on the search input: arrows/Home/End move
@@ -448,7 +448,7 @@ abstract class TypeaheadElement extends ZazzElement {
448
448
  * @private
449
449
  */
450
450
  #panelOpen(): boolean {
451
- return this.panel?.matches(":popover-open, .\\:popover-open") ?? false;
451
+ return this.panel?.matches(":popover-open") ?? false;
452
452
  }
453
453
 
454
454
  /**
package/src/head.d.ts CHANGED
@@ -28,10 +28,17 @@ declare function cdnUrl(dep: CdnDependency): string;
28
28
  */
29
29
  declare const ESM_DEPENDENCIES: readonly CdnDependency[];
30
30
  /**
31
- * Feature polyfills loaded as script tags ahead of the kit module: the Popover
32
- * API (menus, tooltips, the toaster region) and Invoker Commands
33
- * (`command`/`commandfor`). Native in current engines (2026); the polyfills
34
- * keep older browsers consistent.
31
+ * Feature polyfills loaded ahead of the kit module. Exactly one entry:
32
+ * **Interest Invokers** (`interestfor`), which drives tooltip triggers and the
33
+ * optional hover/focus open on menu, menubar, and navigation-menu. Chromium
34
+ * 142+ ships it; Firefox and Safari do not, so this is the kit's one API below
35
+ * the browser-support floor that a polyfill can cover (ADR-0011).
36
+ *
37
+ * Deliberately *not* polyfilled any more (all native across the support
38
+ * window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
39
+ * and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
40
+ * Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
41
+ * here — the components gate it behind `@supports` instead.
35
42
  */
36
43
  declare const POLYFILLS: readonly CdnDependency[];
37
44
  /** CDN mode for `buildHead` — kit files served from jsDelivr (ticket 06). */
package/src/head.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"head.d.ts","sourceRoot":"","sources":["head.ts"],"names":[],"mappings":"AA8BA,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;AA2CD;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,EAAE,SAAS,aAAa,EA+B7C,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,SAAS,EAAE,SAAS,aAAa,EAatC,CAAC;AAkFF,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;IAC1C,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,CAoC3D;AAqGD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"head.d.ts","sourceRoot":"","sources":["head.ts"],"names":[],"mappings":"AA8BA,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;AA2CD;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,EAAE,SAAS,aAAa,EA+B7C,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,SAAS,EAAE,SAAS,aAAa,EAOtC,CAAC;AAiFF,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,+BAA+B;AAC/B,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;IAC1C,kFAAkF;IAClF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,CAoC3D;AAoGD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,CAAC"}
package/src/head.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * @fileoverview Canonical `<head>` contract for Zazz pages.
4
4
  * @description The single owner of everything a Zazz page loads before its own
5
5
  * content: meta tags, the Geist fonts block, the one `index.css` stylesheet
6
- * link, the feature polyfills, the third-party **import map**, the `index.js`
6
+ * link, the feature polyfill, the third-party **import map**, the `index.js`
7
7
  * module tag, and the theme-persistence script. The docs preview iframe, the
8
8
  * kit's example pages (via `scripts/generate-heads.mjs`), and the docs page
9
9
  * that teaches head structure all render from this module: there is no other
@@ -16,7 +16,7 @@
16
16
  * static package files only (never dynamically generated `/+esm` bundles,
17
17
  * as jsDelivr regenerates those when its bundler toolchain updates, which would
18
18
  * silently invalidate SRI hashes), `sha384` integrity on every URL. ES modules
19
- * resolve through the import map; classic polyfills load as plain script tags.
19
+ * resolve through the import map; the polyfill loads as its own module tag.
20
20
  *
21
21
  * @example
22
22
  * import { buildHead } from "@zazz-ui/core/head";
@@ -108,23 +108,24 @@ const ESM_DEPENDENCIES = [
108
108
  },
109
109
  ];
110
110
  /**
111
- * Feature polyfills loaded as script tags ahead of the kit module: the Popover
112
- * API (menus, tooltips, the toaster region) and Invoker Commands
113
- * (`command`/`commandfor`). Native in current engines (2026); the polyfills
114
- * keep older browsers consistent.
111
+ * Feature polyfills loaded ahead of the kit module. Exactly one entry:
112
+ * **Interest Invokers** (`interestfor`), which drives tooltip triggers and the
113
+ * optional hover/focus open on menu, menubar, and navigation-menu. Chromium
114
+ * 142+ ships it; Firefox and Safari do not, so this is the kit's one API below
115
+ * the browser-support floor that a polyfill can cover (ADR-0011).
116
+ *
117
+ * Deliberately *not* polyfilled any more (all native across the support
118
+ * window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
119
+ * and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
120
+ * Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
121
+ * here — the components gate it behind `@supports` instead.
115
122
  */
116
123
  const POLYFILLS = [
117
- {
118
- name: "@oddbird/popover-polyfill",
119
- version: "0.7.2",
120
- file: "dist/popover.min.js",
121
- integrity: "sha384-pOVHoXRgxuaWHCRM4KSyfyfRTmdxgjVo1Ux78ZKJ+GjUz4zIzXiTa8XXuDF1R1Sd",
122
- },
123
124
  {
124
125
  name: "invokers",
125
126
  version: "2.2.2",
126
- file: "dist/esm/production/compatible.js",
127
- integrity: "sha384-7vRXDaS2mcW7LheGSA/rxBwIQNEqmWj0OLEOta/+mvw+9Uf5w1vplA5qg8kLQ99u",
127
+ file: "dist/esm/production/interest.js",
128
+ integrity: "sha384-hR2BVNtsS7fIIMwOm+f7MY0JZfuByGhQQfevCBB6evFATKzBsTw0JzH/RxD94z2T",
128
129
  },
129
130
  ];
130
131
  // --- Head fragments ---
@@ -165,18 +166,17 @@ ${json}
165
166
  </script>`;
166
167
  }
167
168
  /**
168
- * @description Renders the polyfill script tags. The popover polyfill is a
169
- * classic script; the invokers compatibility build is a module. Both are
170
- * deferred, so they execute in document order ahead of `index.js`.
169
+ * @description Renders the polyfill script tag. The invokers interest build is
170
+ * an ES module, so it is deferred by default and executes in document order —
171
+ * ahead of the `index.js` module tag that follows it.
171
172
  *
172
173
  * @returns The polyfill markup.
173
174
  * @private
174
175
  */
175
176
  function polyfillsBlock() {
176
- const [popover, invokers] = POLYFILLS;
177
- return `<!-- Polyfills: Popover API + Invoker Commands (command/commandfor) -->
178
- <script src="${cdnUrl(popover)}" integrity="${popover.integrity}" crossorigin="anonymous" defer></script>
179
- <script type="module" src="${cdnUrl(invokers)}" integrity="${invokers.integrity}" crossorigin="anonymous" defer></script>`;
177
+ const [interest] = POLYFILLS;
178
+ return `<!-- Polyfill: Interest Invokers (interestfor) — native in Chromium only -->
179
+ <script type="module" src="${cdnUrl(interest)}" integrity="${interest.integrity}" crossorigin="anonymous"></script>`;
180
180
  }
181
181
  /**
182
182
  * The theme-persistence script. Runs inline (no `defer`) while the parser is
@@ -282,9 +282,8 @@ function cdnBlocks(cdn, scripts) {
282
282
  // Side-effect modules need their own tag (nothing imports them); the rest
283
283
  // of each primitive's chain loads through native relative imports. The
284
284
  // core dialog-lifecycle module always leads: dialogs, menus, and popovers
285
- // assume its lifecycle events. Polyfills stay in even for css-only
286
- // closures — tooltip/dialog/menu styles ride on the Popover API and
287
- // Invoker Commands.
285
+ // assume its lifecycle events. The polyfill stays in even for css-only
286
+ // closures — tooltip is styles-only but its trigger is `interestfor`.
288
287
  const scriptFiles = [
289
288
  ...new Set([
290
289
  "base/dialog-lifecycle.js",
package/src/head.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @fileoverview Canonical `<head>` contract for Zazz pages.
5
5
  * @description The single owner of everything a Zazz page loads before its own
6
6
  * content: meta tags, the Geist fonts block, the one `index.css` stylesheet
7
- * link, the feature polyfills, the third-party **import map**, the `index.js`
7
+ * link, the feature polyfill, the third-party **import map**, the `index.js`
8
8
  * module tag, and the theme-persistence script. The docs preview iframe, the
9
9
  * kit's example pages (via `scripts/generate-heads.mjs`), and the docs page
10
10
  * that teaches head structure all render from this module: there is no other
@@ -17,7 +17,7 @@
17
17
  * static package files only (never dynamically generated `/+esm` bundles,
18
18
  * as jsDelivr regenerates those when its bundler toolchain updates, which would
19
19
  * silently invalidate SRI hashes), `sha384` integrity on every URL. ES modules
20
- * resolve through the import map; classic polyfills load as plain script tags.
20
+ * resolve through the import map; the polyfill loads as its own module tag.
21
21
  *
22
22
  * @example
23
23
  * import { buildHead } from "@zazz-ui/core/head";
@@ -135,23 +135,24 @@ const ESM_DEPENDENCIES: readonly CdnDependency[] = [
135
135
  ];
136
136
 
137
137
  /**
138
- * Feature polyfills loaded as script tags ahead of the kit module: the Popover
139
- * API (menus, tooltips, the toaster region) and Invoker Commands
140
- * (`command`/`commandfor`). Native in current engines (2026); the polyfills
141
- * keep older browsers consistent.
138
+ * Feature polyfills loaded ahead of the kit module. Exactly one entry:
139
+ * **Interest Invokers** (`interestfor`), which drives tooltip triggers and the
140
+ * optional hover/focus open on menu, menubar, and navigation-menu. Chromium
141
+ * 142+ ships it; Firefox and Safari do not, so this is the kit's one API below
142
+ * the browser-support floor that a polyfill can cover (ADR-0011).
143
+ *
144
+ * Deliberately *not* polyfilled any more (all native across the support
145
+ * window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
146
+ * and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
147
+ * Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
148
+ * here — the components gate it behind `@supports` instead.
142
149
  */
143
150
  const POLYFILLS: readonly CdnDependency[] = [
144
- {
145
- name: "@oddbird/popover-polyfill",
146
- version: "0.7.2",
147
- file: "dist/popover.min.js",
148
- integrity: "sha384-pOVHoXRgxuaWHCRM4KSyfyfRTmdxgjVo1Ux78ZKJ+GjUz4zIzXiTa8XXuDF1R1Sd",
149
- },
150
151
  {
151
152
  name: "invokers",
152
153
  version: "2.2.2",
153
- file: "dist/esm/production/compatible.js",
154
- integrity: "sha384-7vRXDaS2mcW7LheGSA/rxBwIQNEqmWj0OLEOta/+mvw+9Uf5w1vplA5qg8kLQ99u",
154
+ file: "dist/esm/production/interest.js",
155
+ integrity: "sha384-hR2BVNtsS7fIIMwOm+f7MY0JZfuByGhQQfevCBB6evFATKzBsTw0JzH/RxD94z2T",
155
156
  },
156
157
  ];
157
158
 
@@ -196,18 +197,17 @@ ${json}
196
197
  }
197
198
 
198
199
  /**
199
- * @description Renders the polyfill script tags. The popover polyfill is a
200
- * classic script; the invokers compatibility build is a module. Both are
201
- * deferred, so they execute in document order ahead of `index.js`.
200
+ * @description Renders the polyfill script tag. The invokers interest build is
201
+ * an ES module, so it is deferred by default and executes in document order —
202
+ * ahead of the `index.js` module tag that follows it.
202
203
  *
203
204
  * @returns The polyfill markup.
204
205
  * @private
205
206
  */
206
207
  function polyfillsBlock(): string {
207
- const [popover, invokers] = POLYFILLS;
208
- return `<!-- Polyfills: Popover API + Invoker Commands (command/commandfor) -->
209
- <script src="${cdnUrl(popover)}" integrity="${popover.integrity}" crossorigin="anonymous" defer></script>
210
- <script type="module" src="${cdnUrl(invokers)}" integrity="${invokers.integrity}" crossorigin="anonymous" defer></script>`;
208
+ const [interest] = POLYFILLS;
209
+ return `<!-- Polyfill: Interest Invokers (interestfor) — native in Chromium only -->
210
+ <script type="module" src="${cdnUrl(interest)}" integrity="${interest.integrity}" crossorigin="anonymous"></script>`;
211
211
  }
212
212
 
213
213
  /**
@@ -394,9 +394,8 @@ function cdnBlocks(cdn: CdnHeadOptions, scripts: boolean): string[] {
394
394
  // Side-effect modules need their own tag (nothing imports them); the rest
395
395
  // of each primitive's chain loads through native relative imports. The
396
396
  // core dialog-lifecycle module always leads: dialogs, menus, and popovers
397
- // assume its lifecycle events. Polyfills stay in even for css-only
398
- // closures — tooltip/dialog/menu styles ride on the Popover API and
399
- // Invoker Commands.
397
+ // assume its lifecycle events. The polyfill stays in even for css-only
398
+ // closures — tooltip is styles-only but its trigger is `interestfor`.
400
399
  const scriptFiles = [
401
400
  ...new Set([
402
401
  "base/dialog-lifecycle.js",
package/src/index.css CHANGED
@@ -21,8 +21,13 @@
21
21
  @import "./base/_typography.css";
22
22
  @import "./base/_view-transitions.css";
23
23
 
24
- /* Legacy layer — import legacy stylesheets here, into the legacy layer */
25
- /* @import "./your-legacy.css" layer(legacy); */
24
+ /* Vendors layer — third-party CSS that does not build on Zazz */
25
+ /* @import "./some-library.css" layer(vendors); */
26
+
27
+ /* Legacy layer — import whole legacy stylesheets into legacy.imports.
28
+ Never bare layer(legacy): un-sublayered rules would beat the migration
29
+ shims in legacy.migrations. */
30
+ /* @import "./your-legacy.css" layer(legacy.imports); */
26
31
 
27
32
  /* Zazz primitives - UI omponents. */
28
33
  @import "./primitives/separator/separator.css";
@@ -69,5 +74,6 @@
69
74
  @import "./base/_utilities.css";
70
75
  @import "./base/_layout.css";
71
76
 
72
- /* Migrations layer - for legacy css overrides */
73
- /* @import "./migrations.css"; */
77
+ /* Migration shims — translate legacy classes while markup is rewritten.
78
+ Beats all other legacy sublayers; Zazz still wins on migrated markup. */
79
+ /* @import "./migrations.css" layer(legacy.migrations); */
package/src/manifest.d.ts CHANGED
@@ -73,7 +73,7 @@ export declare const CSS_CASCADE_ORDER: string[];
73
73
  * @throws {Error} On an unknown primitive name.
74
74
  * @example
75
75
  * resolveClosure(["combobox"]);
76
- * // ["kbd", "button", "popover", "fields", "input", "select", "badge", "combobox"]
76
+ * // ["fields", "badge", "kbd", "button", "popover", "select", "combobox"]
77
77
  */
78
78
  export declare function resolveClosure(names: string[]): string[];
79
79
  export type ExampleScript = "autocomplete" | "combobox" | "command" | "command-actions" | "embla" | "reveal" | "carousel" | "checkbox" | "lightbox" | "menu" | "multiselect" | "otp" | "password" | "tabs" | "toaster";
package/src/manifest.js CHANGED
@@ -81,7 +81,7 @@ export const PRIMITIVES = {
81
81
  css: ["primitives/badge/badge.css"],
82
82
  js: [],
83
83
  base: [],
84
- primitives: [],
84
+ primitives: ["fields"],
85
85
  bare: [],
86
86
  examples: ["primitives/badge/badge.html", "primitives/badge/badge-icon.html"],
87
87
  },
@@ -97,7 +97,7 @@ export const PRIMITIVES = {
97
97
  css: ["primitives/button/button.css"],
98
98
  js: [],
99
99
  base: [],
100
- primitives: ["kbd"],
100
+ primitives: ["kbd", "fields"],
101
101
  bare: [],
102
102
  examples: [
103
103
  "primitives/button/button.html",
@@ -136,7 +136,7 @@ export const PRIMITIVES = {
136
136
  css: ["primitives/checkbox/checkbox.css"],
137
137
  js: ["primitives/checkbox/checkbox.js"],
138
138
  base: [],
139
- primitives: [],
139
+ primitives: ["fields"],
140
140
  bare: SIGNALS_BARE,
141
141
  examples: ["primitives/checkbox/checkbox.html", "primitives/checkbox/checkbox-tasklist.html"],
142
142
  },
@@ -378,7 +378,7 @@ export const PRIMITIVES = {
378
378
  css: ["primitives/tabs/tabs.css"],
379
379
  js: ["primitives/tabs/tabs.js"],
380
380
  base: [],
381
- primitives: [],
381
+ primitives: ["fields"],
382
382
  bare: [],
383
383
  examples: ["primitives/tabs/tabs.html"],
384
384
  },
@@ -489,6 +489,7 @@ export const PRIMITIVES = {
489
489
  */
490
490
  export const CSS_CASCADE_ORDER = [
491
491
  "separator",
492
+ "fields",
492
493
  "badge",
493
494
  "kbd",
494
495
  "button",
@@ -506,7 +507,6 @@ export const CSS_CASCADE_ORDER = [
506
507
  "menu",
507
508
  "navigation-menu",
508
509
  "mobile-menu",
509
- "fields",
510
510
  "input",
511
511
  "textarea",
512
512
  "select",
@@ -538,7 +538,7 @@ export const CSS_CASCADE_ORDER = [
538
538
  * @throws {Error} On an unknown primitive name.
539
539
  * @example
540
540
  * resolveClosure(["combobox"]);
541
- * // ["kbd", "button", "popover", "fields", "input", "select", "badge", "combobox"]
541
+ * // ["fields", "badge", "kbd", "button", "popover", "select", "combobox"]
542
542
  */
543
543
  export function resolveClosure(names) {
544
544
  const closure = new Set();
@@ -49,7 +49,7 @@
49
49
  }
50
50
 
51
51
  /* Only display is gated — see popover.css: closed popovers stay display: none */
52
- [data-slot~="autocomplete-panel"]:where(:popover-open, .\:popover-open) {
52
+ [data-slot~="autocomplete-panel"]:popover-open {
53
53
  display: flex;
54
54
  }
55
55
 
@@ -74,6 +74,7 @@
74
74
 
75
75
  color: var(--ui-badge-foreground);
76
76
  background-color: var(--ui-badge-background);
77
+ background-clip: padding-box;
77
78
 
78
79
  /* ring renders as box-shadow so it composes with --ui-badge-shadow; the
79
80
  ring widths animate from 0 so the ring grows in smoothly on focus */
@@ -172,9 +173,9 @@
172
173
  --ui-badge-foreground--hover: var(--primary-foreground);
173
174
  --ui-badge-foreground--active: var(--primary-foreground);
174
175
 
175
- --ui-badge-border-color: transparent;
176
- --ui-badge-border-color--hover: transparent;
177
- --ui-badge-border-color--active: transparent;
176
+ --ui-badge-border-color: var(--ui-badge-background);
177
+ --ui-badge-border-color--hover: var(--ui-badge-background--hover);
178
+ --ui-badge-border-color--active: var(--ui-badge-background--active);
178
179
  }
179
180
 
180
181
  .ui-badge[data-variant="muted"] {
@@ -186,9 +187,9 @@
186
187
  --ui-badge-foreground--hover: var(--foreground);
187
188
  --ui-badge-foreground--active: var(--foreground);
188
189
 
189
- --ui-badge-border-color: transparent;
190
- --ui-badge-border-color--hover: transparent;
191
- --ui-badge-border-color--active: transparent;
190
+ --ui-badge-border-color: var(--ui-badge-background);
191
+ --ui-badge-border-color--hover: var(--ui-badge-background--hover);
192
+ --ui-badge-border-color--active: var(--ui-badge-background--active);
192
193
  }
193
194
 
194
195
  .ui-badge[data-variant="ghost"] {
@@ -200,9 +201,9 @@
200
201
  --ui-badge-foreground--hover: var(--foreground);
201
202
  --ui-badge-foreground--active: var(--foreground);
202
203
 
203
- --ui-badge-border-color: transparent;
204
- --ui-badge-border-color--hover: transparent;
205
- --ui-badge-border-color--active: transparent;
204
+ --ui-badge-border-color: var(--ui-badge-background);
205
+ --ui-badge-border-color--hover: var(--ui-badge-background--hover);
206
+ --ui-badge-border-color--active: var(--ui-badge-background--active);
206
207
  }
207
208
 
208
209
  .ui-badge[data-variant="link"] {
@@ -172,9 +172,9 @@
172
172
  --ui-button-foreground--hover: var(--primary-foreground);
173
173
  --ui-button-foreground--active: var(--primary-foreground);
174
174
 
175
- --ui-button-border-color: transparent;
176
- --ui-button-border-color--hover: transparent;
177
- --ui-button-border-color--active: transparent;
175
+ --ui-button-border-color: var(--ui-button-background);
176
+ --ui-button-border-color--hover: var(--ui-button-background--hover);
177
+ --ui-button-border-color--active: var(--ui-button-background--active);
178
178
 
179
179
  --ui-button-shadow: 0 0 transparent;
180
180
  }
@@ -188,9 +188,9 @@
188
188
  --ui-button-foreground--hover: var(--foreground);
189
189
  --ui-button-foreground--active: var(--foreground);
190
190
 
191
- --ui-button-border-color: transparent;
192
- --ui-button-border-color--hover: transparent;
193
- --ui-button-border-color--active: transparent;
191
+ --ui-button-border-color: var(--ui-button-background);
192
+ --ui-button-border-color--hover: var(--ui-button-background--hover);
193
+ --ui-button-border-color--active: var(--ui-button-background--active);
194
194
 
195
195
  --ui-button-shadow: 0 0 transparent;
196
196
  }
@@ -204,9 +204,9 @@
204
204
  --ui-button-foreground--hover: var(--foreground);
205
205
  --ui-button-foreground--active: var(--foreground);
206
206
 
207
- --ui-button-border-color: transparent;
208
- --ui-button-border-color--hover: transparent;
209
- --ui-button-border-color--active: transparent;
207
+ --ui-button-border-color: var(--ui-button-background);
208
+ --ui-button-border-color--hover: var(--ui-button-background--hover);
209
+ --ui-button-border-color--active: var(--ui-button-background--active);
210
210
 
211
211
  --ui-button-shadow: 0 0 transparent;
212
212
  }
@@ -222,9 +222,9 @@
222
222
  --ui-button-foreground--hover: var(--destructive-foreground);
223
223
  --ui-button-foreground--active: var(--destructive-foreground);
224
224
 
225
- --ui-button-border-color: var(--destructive);
226
- --ui-button-border-color--hover: var(--destructive);
227
- --ui-button-border-color--active: var(--destructive);
225
+ --ui-button-border-color: var(--ui-button-background);
226
+ --ui-button-border-color--hover: var(--ui-button-background--hover);
227
+ --ui-button-border-color--active: var(--ui-button-background--active);
228
228
 
229
229
  --ui-button-shadow: 0 0 transparent;
230
230
  }
@@ -1,6 +1,6 @@
1
1
  <ui-carousel data-carousel-plugins="class-names">
2
2
  <div class="flex items-end justify-between gap-md flex-wrap pb-lg">
3
- <h2 class="text-h5 font-heading">Featured Articles</h2>
3
+ <h2 class="text-h5">Featured Articles</h2>
4
4
  <div class="flex @md:hidden gap-xs">
5
5
  <button
6
6
  type="button"
@@ -179,7 +179,7 @@
179
179
  }
180
180
 
181
181
  /* Only display is gated; see popover.css: closed popovers stay display: none */
182
- [data-slot~="combobox-panel"]:where(:popover-open, .\:popover-open) {
182
+ [data-slot~="combobox-panel"]:popover-open {
183
183
  display: flex;
184
184
  }
185
185
 
@@ -53,7 +53,7 @@
53
53
 
54
54
  /* Only display is gated; unconditional it would defeat the UA's
55
55
  display: none on closed popovers and dialogs */
56
- [data-slot~="command-panel"]:where(:popover-open, .\:popover-open, [open]) {
56
+ [data-slot~="command-panel"]:where(:popover-open, [open]) {
57
57
  display: flex;
58
58
  }
59
59
 
@@ -137,7 +137,7 @@ class UiCommand extends TypeaheadElement {
137
137
  if (panel.open)
138
138
  panel.close();
139
139
  }
140
- else if (panel.matches(":popover-open, .\\:popover-open")) {
140
+ else if (panel.matches(":popover-open")) {
141
141
  panel.hidePopover();
142
142
  }
143
143
  }