@zazz-ui/core 0.5.4 → 0.6.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.
- package/AUTHORING.md +16 -13
- package/CHANGELOG.md +44 -0
- package/README.md +3 -3
- package/dist/sri.json +73 -73
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +3604 -116
- package/editor/zazz.html-data.json +18 -12
- package/editor/zazz.language-data.json +103 -54
- package/editor/zazz.lint-data.json +2 -0
- package/package.json +1 -1
- package/src/base/_properties-2xl.css +16 -0
- package/src/base/_properties-active.css +12 -0
- package/src/base/_properties-checked.css +12 -0
- package/src/base/_properties-current.css +12 -0
- package/src/base/_properties-disabled.css +12 -0
- package/src/base/_properties-focus-visible.css +12 -0
- package/src/base/_properties-focus-within.css +12 -0
- package/src/base/_properties-hover.css +12 -0
- package/src/base/_properties-lg.css +16 -0
- package/src/base/_properties-md.css +16 -0
- package/src/base/_properties-open.css +12 -0
- package/src/base/_properties-sm.css +16 -0
- package/src/base/_properties-starting.css +6 -0
- package/src/base/_properties-stuck.css +6 -0
- package/src/base/_properties-xl.css +16 -0
- package/src/base/_properties.css +22 -1
- package/src/base/_reset.css +8 -2
- package/src/base/_switches.css +3 -0
- package/src/base/_typography.css +0 -1
- package/src/base/_utilities-color.css +5 -5
- package/src/base/_utilities-effects.css +45 -6
- package/src/base/_utilities-flow.css +5 -5
- package/src/base/_utilities-grid.css +10 -10
- package/src/base/_utilities-margin.css +35 -35
- package/src/base/_utilities-pseudo.css +16 -0
- package/src/base/_utilities-sizing.css +20 -20
- package/src/base/_utilities-tier-2xl.css +9 -1
- package/src/base/_utilities-tier-active.css +6 -0
- package/src/base/_utilities-tier-checked.css +6 -0
- package/src/base/_utilities-tier-current.css +6 -0
- package/src/base/_utilities-tier-disabled.css +6 -0
- package/src/base/_utilities-tier-focus-visible.css +6 -0
- package/src/base/_utilities-tier-focus-within.css +6 -0
- package/src/base/_utilities-tier-hover.css +6 -0
- package/src/base/_utilities-tier-lg.css +9 -1
- package/src/base/_utilities-tier-md.css +9 -1
- package/src/base/_utilities-tier-open.css +6 -0
- package/src/base/_utilities-tier-sm.css +9 -1
- package/src/base/_utilities-tier-starting.css +3 -0
- package/src/base/_utilities-tier-stuck.css +3 -0
- package/src/base/_utilities-tier-xl.css +9 -1
- package/src/base/_utilities-typography.css +5 -5
- package/src/base/_variables.css +116 -55
- package/src/base/dialog-lifecycle.d.ts +18 -1
- package/src/base/dialog-lifecycle.d.ts.map +1 -1
- package/src/base/dialog-lifecycle.js +72 -1
- package/src/base/dialog-lifecycle.ts +79 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +15 -5
- package/src/base/navigation.ts +15 -5
- package/src/base/utilities.d.ts +19 -13
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +72 -21
- package/src/base/utilities.ts +84 -24
- package/src/head.d.ts +4 -1
- package/src/head.d.ts.map +1 -1
- package/src/head.js +9 -5
- package/src/head.ts +9 -5
- package/src/primitives/accordion/accordion.css +23 -12
- package/src/primitives/accordion/accordion.html +3 -3
- package/src/primitives/badge/badge.css +16 -9
- package/src/primitives/button/button.css +18 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -1
- package/src/primitives/checkbox/checkbox.css +16 -9
- package/src/primitives/checkbox/checkbox.html +1 -1
- package/src/primitives/checkbox/checkbox.js +1 -1
- package/src/primitives/checkbox/checkbox.ts +1 -1
- package/src/primitives/combobox/combobox.css +15 -8
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +1 -0
- package/src/primitives/command/command-actions.js +9 -4
- package/src/primitives/command/command-actions.ts +9 -4
- package/src/primitives/command/command-dialog.html +36 -0
- package/src/primitives/command/command.css +12 -1
- package/src/primitives/command/command.html +1 -0
- package/src/primitives/debug/audit-core.d.ts +3 -1
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +19 -1
- package/src/primitives/debug/audit-core.ts +25 -1
- package/src/primitives/debug/debug.d.ts.map +1 -1
- package/src/primitives/debug/debug.js +1 -0
- package/src/primitives/debug/debug.ts +1 -0
- package/src/primitives/dialog/dialog.css +2 -2
- package/src/primitives/fields/fields.css +15 -2
- package/src/primitives/input/input-icon-leading.html +1 -1
- package/src/primitives/input/input-icon-trailing.html +1 -1
- package/src/primitives/input/input.css +16 -9
- package/src/primitives/input-group/input-group.css +15 -8
- package/src/primitives/lightbox/lightbox.html +1 -2
- package/src/primitives/mobile-menu/mobile-menu.html +50 -10
- package/src/primitives/navigation-menu/navigation-menu-featured.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-interest.html +10 -2
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +5 -1
- package/src/primitives/navigation-menu/navigation-menu-simple.html +6 -1
- package/src/primitives/navigation-menu/navigation-menu.css +6 -3
- package/src/primitives/navigation-menu/navigation-menu.html +15 -3
- package/src/primitives/password-group/password-group.css +14 -7
- package/src/primitives/password-group/password-group.js +1 -1
- package/src/primitives/password-group/password-group.ts +1 -1
- package/src/primitives/radio/radio.css +15 -8
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +3 -1
- package/src/primitives/select/multiselect.ts +3 -1
- package/src/primitives/select/select.css +14 -7
- package/src/primitives/slider/slider.html +1 -0
- package/src/primitives/switch/switch.css +15 -8
- package/src/primitives/tabs/tabs.css +21 -9
- package/src/primitives/textarea/textarea.css +16 -9
- package/src/primitives/toggle/toggle.css +16 -9
- package/src/primitives/toggle/toggle.html +6 -6
- package/src/primitives/toolbar/toolbar.html +2 -1
|
@@ -19,6 +19,15 @@
|
|
|
19
19
|
* choreography (ancestor and document level).
|
|
20
20
|
*
|
|
21
21
|
* No `detail` payload: the dialog is the event target.
|
|
22
|
+
*
|
|
23
|
+
* It also fills in light dismiss where the browser lacks it. `closedby="any"`
|
|
24
|
+
* (Chrome 134, Firefox 141) lets a tap on the backdrop close a modal dialog;
|
|
25
|
+
* Safari 26 knows `closedby` but only its `none` and `closerequest` values, so
|
|
26
|
+
* `any` falls back to `closerequest` and the backdrop does nothing there. Where
|
|
27
|
+
* `any` is not supported, a backdrop tap on a `closedby="any"` dialog closes it
|
|
28
|
+
* here, with native semantics: the press and the release both land on the
|
|
29
|
+
* backdrop, and the dialog gets a `cancel` through `requestClose()` where that
|
|
30
|
+
* exists.
|
|
22
31
|
*/
|
|
23
32
|
|
|
24
33
|
/** Dispatches a bubbling lifecycle event on a dialog. */
|
|
@@ -26,6 +35,73 @@ function emit(dialog: HTMLDialogElement, type: "zazz:dialog-open" | "zazz:dialog
|
|
|
26
35
|
dialog.dispatchEvent(new Event(type, { bubbles: true }));
|
|
27
36
|
}
|
|
28
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @description True when the browser dismisses `closedby="any"` dialogs itself.
|
|
40
|
+
* The property alone is not proof: Safari 26 has `closedBy` with `none` and
|
|
41
|
+
* `closerequest` but not `any`, so `any` must round-trip through the reflected
|
|
42
|
+
* property, which keeps only the keywords the engine knows.
|
|
43
|
+
*/
|
|
44
|
+
function hasNativeLightDismiss(): boolean {
|
|
45
|
+
if (typeof HTMLDialogElement === "undefined" || !("closedBy" in HTMLDialogElement.prototype)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const probe = document.createElement("dialog");
|
|
49
|
+
probe.setAttribute("closedby", "any");
|
|
50
|
+
return probe.closedBy === "any";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @description The open `closedby="any"` dialog whose backdrop `event` hit, or
|
|
55
|
+
* null. A backdrop hit targets the dialog element itself at a point outside
|
|
56
|
+
* its box; a hit inside the box targets a descendant, or the dialog's own
|
|
57
|
+
* padding, which must not dismiss.
|
|
58
|
+
*
|
|
59
|
+
* @param event - A pointer or mouse event, read for its target and position.
|
|
60
|
+
* @private
|
|
61
|
+
*/
|
|
62
|
+
function backdropHit(event: Event): HTMLDialogElement | null {
|
|
63
|
+
const dialog = event.target;
|
|
64
|
+
if (!(dialog instanceof HTMLDialogElement) || !dialog.open) return null;
|
|
65
|
+
if (dialog.getAttribute("closedby") !== "any") return null;
|
|
66
|
+
const { clientX: x, clientY: y } = event as MouseEvent;
|
|
67
|
+
const box = dialog.getBoundingClientRect();
|
|
68
|
+
const outside = x < box.left || x > box.right || y < box.top || y > box.bottom;
|
|
69
|
+
return outside ? dialog : null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description Binds the backdrop-tap fallback for browsers without
|
|
74
|
+
* `closedby="any"`. The press and the release must both land on the backdrop,
|
|
75
|
+
* as in the native algorithm, so a drag from inside the dialog out to the
|
|
76
|
+
* backdrop does not dismiss. Pointer events, not `click`: iOS Safari does not
|
|
77
|
+
* deliver a delegated `click` from a non-interactive element such as a dialog's
|
|
78
|
+
* backdrop, but it does deliver `pointerup`.
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
*/
|
|
82
|
+
function bindLightDismissFallback(): void {
|
|
83
|
+
let pressed: HTMLDialogElement | null = null;
|
|
84
|
+
document.addEventListener(
|
|
85
|
+
"pointerdown",
|
|
86
|
+
(event) => {
|
|
87
|
+
pressed = backdropHit(event);
|
|
88
|
+
},
|
|
89
|
+
true,
|
|
90
|
+
);
|
|
91
|
+
document.addEventListener(
|
|
92
|
+
"pointerup",
|
|
93
|
+
(event) => {
|
|
94
|
+
const dialog = backdropHit(event);
|
|
95
|
+
if (dialog && dialog === pressed) {
|
|
96
|
+
if (typeof dialog.requestClose === "function") dialog.requestClose();
|
|
97
|
+
else dialog.close();
|
|
98
|
+
}
|
|
99
|
+
pressed = null;
|
|
100
|
+
},
|
|
101
|
+
true,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
29
105
|
interface InitDialogLifecycleFn {
|
|
30
106
|
(): void;
|
|
31
107
|
_bound?: boolean;
|
|
@@ -65,6 +141,8 @@ const initDialogLifecycle: InitDialogLifecycleFn = function () {
|
|
|
65
141
|
},
|
|
66
142
|
true,
|
|
67
143
|
);
|
|
144
|
+
|
|
145
|
+
if (!hasNativeLightDismiss()) bindLightDismissFallback();
|
|
68
146
|
};
|
|
69
147
|
|
|
70
148
|
// Auto-initialize when DOM is ready (only in browser environment)
|
|
@@ -77,4 +155,4 @@ if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
|
77
155
|
}
|
|
78
156
|
|
|
79
157
|
// Exported for tests and manual bootstrapping; the events are the public API.
|
|
80
|
-
export { initDialogLifecycle };
|
|
158
|
+
export { backdropHit, hasNativeLightDismiss, initDialogLifecycle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["navigation.ts"],"names":[],"mappings":"AAsFA;;;;;;;;;GASG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAgDhD;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["navigation.ts"],"names":[],"mappings":"AAsFA;;;;;;;;;GASG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAgDhD;AAqJD,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/src/base/navigation.js
CHANGED
|
@@ -188,16 +188,23 @@ function holdInstantScroll() {
|
|
|
188
188
|
function isSameOrigin(url) {
|
|
189
189
|
return new URL(url, location.href).origin === location.origin;
|
|
190
190
|
}
|
|
191
|
+
/** A path ending in a file extension other than `.html` (`/llms.txt`, `/a.md`, `/b.pdf`) is not a page. */
|
|
192
|
+
function isPagePath(url) {
|
|
193
|
+
const ext = /\.([a-z0-9]+)$/i.exec(new URL(url, location.href).pathname)?.[1];
|
|
194
|
+
return !ext || /^x?html?$/i.test(ext);
|
|
195
|
+
}
|
|
191
196
|
if ("navigation" in window) {
|
|
192
197
|
/**
|
|
193
198
|
* URL handed back to the browser for a full load. The `navigate` listener
|
|
194
|
-
* skips it once, so `location.
|
|
195
|
-
* re-enter the interception and loop.
|
|
199
|
+
* skips it once, so `location.replace()` from inside the handler does not
|
|
200
|
+
* re-enter the interception and loop. Replace, not assign: the intercepted
|
|
201
|
+
* navigation already committed an entry for this URL, and a second one would
|
|
202
|
+
* leave Back pointing at a page that no longer exists.
|
|
196
203
|
*/
|
|
197
204
|
let bypassUrl = null;
|
|
198
205
|
function fullLoad(url) {
|
|
199
206
|
bypassUrl = url;
|
|
200
|
-
location.
|
|
207
|
+
location.replace(url);
|
|
201
208
|
}
|
|
202
209
|
window.navigation.addEventListener("navigate", (e) => {
|
|
203
210
|
if (bypassUrl !== null && e.destination.url === bypassUrl) {
|
|
@@ -211,7 +218,8 @@ if ("navigation" in window) {
|
|
|
211
218
|
e.hashChange ||
|
|
212
219
|
e.downloadRequest !== null ||
|
|
213
220
|
e.formData !== null ||
|
|
214
|
-
!isSameOrigin(e.destination.url)
|
|
221
|
+
!isSameOrigin(e.destination.url) ||
|
|
222
|
+
!isPagePath(e.destination.url)) {
|
|
215
223
|
return;
|
|
216
224
|
}
|
|
217
225
|
e.intercept({
|
|
@@ -221,13 +229,15 @@ if ("navigation" in window) {
|
|
|
221
229
|
const res = await fetch(e.destination.url, { signal: e.signal });
|
|
222
230
|
if (!res.ok)
|
|
223
231
|
throw new Error(res.statusText);
|
|
232
|
+
if (!res.headers.get("content-type")?.includes("html"))
|
|
233
|
+
throw new Error("not a page");
|
|
224
234
|
doc = new DOMParser().parseFromString(await res.text(), "text/html");
|
|
225
235
|
}
|
|
226
236
|
catch {
|
|
227
237
|
// A newer navigation aborted this one; it must not swap in late.
|
|
228
238
|
if (e.signal.aborted)
|
|
229
239
|
return;
|
|
230
|
-
fullLoad(e.destination.url); // network or HTTP failure
|
|
240
|
+
fullLoad(e.destination.url); // network or HTTP failure, or not HTML
|
|
231
241
|
return;
|
|
232
242
|
}
|
|
233
243
|
if (e.signal.aborted)
|
package/src/base/navigation.ts
CHANGED
|
@@ -189,17 +189,25 @@ function isSameOrigin(url: string): boolean {
|
|
|
189
189
|
return new URL(url, location.href).origin === location.origin;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
/** A path ending in a file extension other than `.html` (`/llms.txt`, `/a.md`, `/b.pdf`) is not a page. */
|
|
193
|
+
function isPagePath(url: string): boolean {
|
|
194
|
+
const ext = /\.([a-z0-9]+)$/i.exec(new URL(url, location.href).pathname)?.[1];
|
|
195
|
+
return !ext || /^x?html?$/i.test(ext);
|
|
196
|
+
}
|
|
197
|
+
|
|
192
198
|
if ("navigation" in window) {
|
|
193
199
|
/**
|
|
194
200
|
* URL handed back to the browser for a full load. The `navigate` listener
|
|
195
|
-
* skips it once, so `location.
|
|
196
|
-
* re-enter the interception and loop.
|
|
201
|
+
* skips it once, so `location.replace()` from inside the handler does not
|
|
202
|
+
* re-enter the interception and loop. Replace, not assign: the intercepted
|
|
203
|
+
* navigation already committed an entry for this URL, and a second one would
|
|
204
|
+
* leave Back pointing at a page that no longer exists.
|
|
197
205
|
*/
|
|
198
206
|
let bypassUrl: string | null = null;
|
|
199
207
|
|
|
200
208
|
function fullLoad(url: string): void {
|
|
201
209
|
bypassUrl = url;
|
|
202
|
-
location.
|
|
210
|
+
location.replace(url);
|
|
203
211
|
}
|
|
204
212
|
|
|
205
213
|
window.navigation.addEventListener("navigate", (e) => {
|
|
@@ -216,7 +224,8 @@ if ("navigation" in window) {
|
|
|
216
224
|
e.hashChange ||
|
|
217
225
|
e.downloadRequest !== null ||
|
|
218
226
|
e.formData !== null ||
|
|
219
|
-
!isSameOrigin(e.destination.url)
|
|
227
|
+
!isSameOrigin(e.destination.url) ||
|
|
228
|
+
!isPagePath(e.destination.url)
|
|
220
229
|
) {
|
|
221
230
|
return;
|
|
222
231
|
}
|
|
@@ -227,11 +236,12 @@ if ("navigation" in window) {
|
|
|
227
236
|
try {
|
|
228
237
|
const res = await fetch(e.destination.url, { signal: e.signal });
|
|
229
238
|
if (!res.ok) throw new Error(res.statusText);
|
|
239
|
+
if (!res.headers.get("content-type")?.includes("html")) throw new Error("not a page");
|
|
230
240
|
doc = new DOMParser().parseFromString(await res.text(), "text/html");
|
|
231
241
|
} catch {
|
|
232
242
|
// A newer navigation aborted this one; it must not swap in late.
|
|
233
243
|
if (e.signal.aborted) return;
|
|
234
|
-
fullLoad(e.destination.url); // network or HTTP failure
|
|
244
|
+
fullLoad(e.destination.url); // network or HTTP failure, or not HTML
|
|
235
245
|
return;
|
|
236
246
|
}
|
|
237
247
|
if (e.signal.aborted) return;
|
package/src/base/utilities.d.ts
CHANGED
|
@@ -7,18 +7,14 @@
|
|
|
7
7
|
export declare const BREAKPOINTS: readonly ["sm", "md", "lg", "xl", "2xl"];
|
|
8
8
|
export type Breakpoint = (typeof BREAKPOINTS)[number];
|
|
9
9
|
/**
|
|
10
|
-
* Breakpoint thresholds
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Breakpoint thresholds and layout widths, in rem: Tailwind's scale. A tier
|
|
11
|
+
* applies when the nearest inline-size container is at least this wide, and
|
|
12
|
+
* `--layout-<breakpoint>` is the same width, so `@md` means "an md band fits".
|
|
13
|
+
* rem resolves against the root in every container, so siblings in different
|
|
14
|
+
* fonts flip together; it still follows the reader's font size and zoom.
|
|
15
|
+
* 640 / 768 / 1024 / 1280 / 1536px at 16px.
|
|
15
16
|
*/
|
|
16
|
-
export declare const
|
|
17
|
-
/**
|
|
18
|
-
* Layout band and component widths (`--layout-*`), in rem for predictable
|
|
19
|
-
* geometry: Tailwind's scale. Decoupled from the query thresholds above.
|
|
20
|
-
*/
|
|
21
|
-
export declare const LAYOUT_REM: Record<Breakpoint, number>;
|
|
17
|
+
export declare const BREAKPOINT_REM: Record<Breakpoint, number>;
|
|
22
18
|
/** Interaction states, highest precedence first. */
|
|
23
19
|
export declare const STATES: readonly ["starting", "disabled", "active", "focus-visible", "focus-within", "hover", "checked", "current", "open", "stuck"];
|
|
24
20
|
export type State = (typeof STATES)[number];
|
|
@@ -81,9 +77,19 @@ export interface Utility {
|
|
|
81
77
|
* `line-clamp` adds the -webkit-box companions; `bg` is a relative oklch
|
|
82
78
|
* with `--bg-alpha`; `none` feeds a composite (`box-shadow`) and emits nothing itself;
|
|
83
79
|
* `border` is a border shorthand: it sorts a color, number, or length into
|
|
84
|
-
* width and color channels, and the side rules emit them.
|
|
80
|
+
* width and color channels, and the side rules emit them. `px` feeds a
|
|
81
|
+
* composite too, as one signed length `--_<name>-w`: a number is that many
|
|
82
|
+
* pixels, a length passes through, and the sign carries meaning (a negative
|
|
83
|
+
* ring is inset).
|
|
84
|
+
*/
|
|
85
|
+
emit?: "plain" | "repeat" | "span" | "grid-fit" | "line-clamp" | "bg" | "none" | "border" | "px";
|
|
86
|
+
/**
|
|
87
|
+
* What the precedence chain ends in when neither the base nor an active tier
|
|
88
|
+
* sets the utility: a `px` utility that stands in for a token (`--focus-ring`
|
|
89
|
+
* falls back to `--ring-width`, so `--focus-ring--md: -2` alone keeps the
|
|
90
|
+
* default ring below md).
|
|
85
91
|
*/
|
|
86
|
-
|
|
92
|
+
chainEnd?: string;
|
|
87
93
|
/** Overrides the family's tier kind (`none` for a utility that is base-only). */
|
|
88
94
|
tiers?: Tiers;
|
|
89
95
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["utilities.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,qDAAqD;AACrD,eAAO,MAAM,WAAW,YAAI,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AACpE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["utilities.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,qDAA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M,sBAAsB,YAAI,SAAS,CAAU,CAAC;AAE3D,qFAAqF;AACrF,eAAO,MAAM,SAAS,EAAE,SAAS,OAAO,EA6jBvC,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,WAAW,EAAE,SAAS,OAAO,EAEzC,CAAC;AAEF,eAAO,MAAM,YAAY,YAAI,QAAQ,EAAE,OAAO,CAAU,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAM3D;AAED,qDAAqD;AACrD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,CAAC;CACd;AAID,sGAAsG;AACtG,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAyBzD"}
|
package/src/base/utilities.js
CHANGED
|
@@ -7,24 +7,14 @@
|
|
|
7
7
|
/** Breakpoints, ascending: Tailwind's five names. */
|
|
8
8
|
export const BREAKPOINTS = ["sm", "md", "lg", "xl", "2xl"];
|
|
9
9
|
/**
|
|
10
|
-
* Breakpoint thresholds
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* Breakpoint thresholds and layout widths, in rem: Tailwind's scale. A tier
|
|
11
|
+
* applies when the nearest inline-size container is at least this wide, and
|
|
12
|
+
* `--layout-<breakpoint>` is the same width, so `@md` means "an md band fits".
|
|
13
|
+
* rem resolves against the root in every container, so siblings in different
|
|
14
|
+
* fonts flip together; it still follows the reader's font size and zoom.
|
|
15
|
+
* 640 / 768 / 1024 / 1280 / 1536px at 16px.
|
|
15
16
|
*/
|
|
16
|
-
export const
|
|
17
|
-
sm: 40,
|
|
18
|
-
md: 65,
|
|
19
|
-
lg: 90,
|
|
20
|
-
xl: 120,
|
|
21
|
-
"2xl": 150,
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Layout band and component widths (`--layout-*`), in rem for predictable
|
|
25
|
-
* geometry: Tailwind's scale. Decoupled from the query thresholds above.
|
|
26
|
-
*/
|
|
27
|
-
export const LAYOUT_REM = {
|
|
17
|
+
export const BREAKPOINT_REM = {
|
|
28
18
|
sm: 40,
|
|
29
19
|
md: 48,
|
|
30
20
|
lg: 64,
|
|
@@ -635,10 +625,53 @@ export const UTILITIES = [
|
|
|
635
625
|
// the shadow color for an element and its subtree: _variables.css re-declares the
|
|
636
626
|
// --shadow-* tokens wherever this is set, so keyword, var(), and primitive shadows follow
|
|
637
627
|
{ name: "shadow-hue", properties: [], mode: "raw", family: "box", emit: "none" },
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
{
|
|
641
|
-
|
|
628
|
+
// the shadow's cast direction: the --shadow-* tokens rotate their offsets by it
|
|
629
|
+
// (0deg casts down, clockwise), re-declared where it is set (_variables.css)
|
|
630
|
+
{
|
|
631
|
+
name: "shadow-angle",
|
|
632
|
+
properties: [],
|
|
633
|
+
mode: "raw",
|
|
634
|
+
family: "effects",
|
|
635
|
+
emit: "none",
|
|
636
|
+
tiers: "both",
|
|
637
|
+
},
|
|
638
|
+
// ring widths are signed: a number is pixels, and a negative ring is inset
|
|
639
|
+
{ name: "ring", properties: [], mode: "raw", family: "effects", emit: "px", tiers: "both" },
|
|
640
|
+
{
|
|
641
|
+
name: "ring-color",
|
|
642
|
+
properties: [],
|
|
643
|
+
mode: "raw",
|
|
644
|
+
family: "effects",
|
|
645
|
+
emit: "none",
|
|
646
|
+
tiers: "both",
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
name: "ring-offset",
|
|
650
|
+
properties: [],
|
|
651
|
+
mode: "raw",
|
|
652
|
+
family: "effects",
|
|
653
|
+
emit: "px",
|
|
654
|
+
tiers: "both",
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "ring-offset-color",
|
|
658
|
+
properties: [],
|
|
659
|
+
mode: "raw",
|
|
660
|
+
family: "effects",
|
|
661
|
+
emit: "none",
|
|
662
|
+
tiers: "both",
|
|
663
|
+
},
|
|
664
|
+
// a primitive's focus ring (and the reset's focus outline): signed like --ring,
|
|
665
|
+
// the --ring-width token when unset
|
|
666
|
+
{
|
|
667
|
+
name: "focus-ring",
|
|
668
|
+
properties: [],
|
|
669
|
+
mode: "raw",
|
|
670
|
+
family: "effects",
|
|
671
|
+
emit: "px",
|
|
672
|
+
tiers: "breakpoints",
|
|
673
|
+
chainEnd: "var(--ring-width)",
|
|
674
|
+
},
|
|
642
675
|
{
|
|
643
676
|
name: "scale",
|
|
644
677
|
pseudo: true,
|
|
@@ -664,6 +697,24 @@ export const UTILITIES = [
|
|
|
664
697
|
noBase: "none",
|
|
665
698
|
},
|
|
666
699
|
{ name: "transition", pseudo: true, properties: ["transition"], mode: "raw", family: "effects" },
|
|
700
|
+
// longhands after the shorthand, so they win over --transition and over a
|
|
701
|
+
// primitive's transition: retime one element without restating its property list
|
|
702
|
+
{
|
|
703
|
+
name: "transition-duration",
|
|
704
|
+
pseudo: true,
|
|
705
|
+
properties: ["transition-duration"],
|
|
706
|
+
mode: "raw",
|
|
707
|
+
family: "effects",
|
|
708
|
+
tiers: "both",
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
name: "transition-delay",
|
|
712
|
+
pseudo: true,
|
|
713
|
+
properties: ["transition-delay"],
|
|
714
|
+
mode: "raw",
|
|
715
|
+
family: "effects",
|
|
716
|
+
tiers: "both",
|
|
717
|
+
},
|
|
667
718
|
// box: no tiers
|
|
668
719
|
{
|
|
669
720
|
name: "rounded",
|
package/src/base/utilities.ts
CHANGED
|
@@ -11,25 +11,14 @@ export const BREAKPOINTS = ["sm", "md", "lg", "xl", "2xl"] as const;
|
|
|
11
11
|
export type Breakpoint = (typeof BREAKPOINTS)[number];
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Breakpoint thresholds
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Breakpoint thresholds and layout widths, in rem: Tailwind's scale. A tier
|
|
15
|
+
* applies when the nearest inline-size container is at least this wide, and
|
|
16
|
+
* `--layout-<breakpoint>` is the same width, so `@md` means "an md band fits".
|
|
17
|
+
* rem resolves against the root in every container, so siblings in different
|
|
18
|
+
* fonts flip together; it still follows the reader's font size and zoom.
|
|
19
|
+
* 640 / 768 / 1024 / 1280 / 1536px at 16px.
|
|
19
20
|
*/
|
|
20
|
-
export const
|
|
21
|
-
sm: 40,
|
|
22
|
-
md: 65,
|
|
23
|
-
lg: 90,
|
|
24
|
-
xl: 120,
|
|
25
|
-
"2xl": 150,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Layout band and component widths (`--layout-*`), in rem for predictable
|
|
30
|
-
* geometry: Tailwind's scale. Decoupled from the query thresholds above.
|
|
31
|
-
*/
|
|
32
|
-
export const LAYOUT_REM: Record<Breakpoint, number> = {
|
|
21
|
+
export const BREAKPOINT_REM: Record<Breakpoint, number> = {
|
|
33
22
|
sm: 40,
|
|
34
23
|
md: 48,
|
|
35
24
|
lg: 64,
|
|
@@ -160,9 +149,19 @@ export interface Utility {
|
|
|
160
149
|
* `line-clamp` adds the -webkit-box companions; `bg` is a relative oklch
|
|
161
150
|
* with `--bg-alpha`; `none` feeds a composite (`box-shadow`) and emits nothing itself;
|
|
162
151
|
* `border` is a border shorthand: it sorts a color, number, or length into
|
|
163
|
-
* width and color channels, and the side rules emit them.
|
|
152
|
+
* width and color channels, and the side rules emit them. `px` feeds a
|
|
153
|
+
* composite too, as one signed length `--_<name>-w`: a number is that many
|
|
154
|
+
* pixels, a length passes through, and the sign carries meaning (a negative
|
|
155
|
+
* ring is inset).
|
|
156
|
+
*/
|
|
157
|
+
emit?: "plain" | "repeat" | "span" | "grid-fit" | "line-clamp" | "bg" | "none" | "border" | "px";
|
|
158
|
+
/**
|
|
159
|
+
* What the precedence chain ends in when neither the base nor an active tier
|
|
160
|
+
* sets the utility: a `px` utility that stands in for a token (`--focus-ring`
|
|
161
|
+
* falls back to `--ring-width`, so `--focus-ring--md: -2` alone keeps the
|
|
162
|
+
* default ring below md).
|
|
164
163
|
*/
|
|
165
|
-
|
|
164
|
+
chainEnd?: string;
|
|
166
165
|
/** Overrides the family's tier kind (`none` for a utility that is base-only). */
|
|
167
166
|
tiers?: Tiers;
|
|
168
167
|
/**
|
|
@@ -739,10 +738,53 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
739
738
|
// the shadow color for an element and its subtree: _variables.css re-declares the
|
|
740
739
|
// --shadow-* tokens wherever this is set, so keyword, var(), and primitive shadows follow
|
|
741
740
|
{ name: "shadow-hue", properties: [], mode: "raw", family: "box", emit: "none" },
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
{
|
|
745
|
-
|
|
741
|
+
// the shadow's cast direction: the --shadow-* tokens rotate their offsets by it
|
|
742
|
+
// (0deg casts down, clockwise), re-declared where it is set (_variables.css)
|
|
743
|
+
{
|
|
744
|
+
name: "shadow-angle",
|
|
745
|
+
properties: [],
|
|
746
|
+
mode: "raw",
|
|
747
|
+
family: "effects",
|
|
748
|
+
emit: "none",
|
|
749
|
+
tiers: "both",
|
|
750
|
+
},
|
|
751
|
+
// ring widths are signed: a number is pixels, and a negative ring is inset
|
|
752
|
+
{ name: "ring", properties: [], mode: "raw", family: "effects", emit: "px", tiers: "both" },
|
|
753
|
+
{
|
|
754
|
+
name: "ring-color",
|
|
755
|
+
properties: [],
|
|
756
|
+
mode: "raw",
|
|
757
|
+
family: "effects",
|
|
758
|
+
emit: "none",
|
|
759
|
+
tiers: "both",
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
name: "ring-offset",
|
|
763
|
+
properties: [],
|
|
764
|
+
mode: "raw",
|
|
765
|
+
family: "effects",
|
|
766
|
+
emit: "px",
|
|
767
|
+
tiers: "both",
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
name: "ring-offset-color",
|
|
771
|
+
properties: [],
|
|
772
|
+
mode: "raw",
|
|
773
|
+
family: "effects",
|
|
774
|
+
emit: "none",
|
|
775
|
+
tiers: "both",
|
|
776
|
+
},
|
|
777
|
+
// a primitive's focus ring (and the reset's focus outline): signed like --ring,
|
|
778
|
+
// the --ring-width token when unset
|
|
779
|
+
{
|
|
780
|
+
name: "focus-ring",
|
|
781
|
+
properties: [],
|
|
782
|
+
mode: "raw",
|
|
783
|
+
family: "effects",
|
|
784
|
+
emit: "px",
|
|
785
|
+
tiers: "breakpoints",
|
|
786
|
+
chainEnd: "var(--ring-width)",
|
|
787
|
+
},
|
|
746
788
|
{
|
|
747
789
|
name: "scale",
|
|
748
790
|
pseudo: true,
|
|
@@ -768,6 +810,24 @@ export const UTILITIES: readonly Utility[] = [
|
|
|
768
810
|
noBase: "none",
|
|
769
811
|
},
|
|
770
812
|
{ name: "transition", pseudo: true, properties: ["transition"], mode: "raw", family: "effects" },
|
|
813
|
+
// longhands after the shorthand, so they win over --transition and over a
|
|
814
|
+
// primitive's transition: retime one element without restating its property list
|
|
815
|
+
{
|
|
816
|
+
name: "transition-duration",
|
|
817
|
+
pseudo: true,
|
|
818
|
+
properties: ["transition-duration"],
|
|
819
|
+
mode: "raw",
|
|
820
|
+
family: "effects",
|
|
821
|
+
tiers: "both",
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: "transition-delay",
|
|
825
|
+
pseudo: true,
|
|
826
|
+
properties: ["transition-delay"],
|
|
827
|
+
mode: "raw",
|
|
828
|
+
family: "effects",
|
|
829
|
+
tiers: "both",
|
|
830
|
+
},
|
|
771
831
|
// box: no tiers
|
|
772
832
|
{
|
|
773
833
|
name: "rounded",
|
package/src/head.d.ts
CHANGED
|
@@ -37,7 +37,10 @@ declare const ESM_DEPENDENCIES: readonly CdnDependency[];
|
|
|
37
37
|
* Not polyfilled (native across the support window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
|
|
38
38
|
* and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
|
|
39
39
|
* Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
|
|
40
|
-
* here — the components gate it behind `@supports` instead.
|
|
40
|
+
* here — the components gate it behind `@supports` instead. Dialog light
|
|
41
|
+
* dismiss (`closedby="any"`: Chrome 134, Firefox 141; Safari 26 has only `none`
|
|
42
|
+
* and `closerequest`) is filled in by `base/dialog-lifecycle.ts` where `any`
|
|
43
|
+
* is not supported.
|
|
41
44
|
*/
|
|
42
45
|
declare const POLYFILLS: readonly CdnDependency[];
|
|
43
46
|
/** CDN mode for `buildHead` — kit files served from jsDelivr. */
|
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;AAqCD;;;;;;GAMG;AACH,iBAAS,MAAM,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAE1C;AAED;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,EAAE,SAAS,aAAa,EA+B7C,CAAC;AAEF
|
|
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;;;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AAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;IACrB,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;CAChB;AAKD,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,OAAO,GAAE,WAAgB,GAAG,MAAM,CAI5D;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAgBjE;AAcD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,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
|
@@ -110,7 +110,10 @@ const ESM_DEPENDENCIES = [
|
|
|
110
110
|
* Not polyfilled (native across the support window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
|
|
111
111
|
* and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
|
|
112
112
|
* Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
|
|
113
|
-
* here — the components gate it behind `@supports` instead.
|
|
113
|
+
* here — the components gate it behind `@supports` instead. Dialog light
|
|
114
|
+
* dismiss (`closedby="any"`: Chrome 134, Firefox 141; Safari 26 has only `none`
|
|
115
|
+
* and `closerequest`) is filled in by `base/dialog-lifecycle.ts` where `any`
|
|
116
|
+
* is not supported.
|
|
114
117
|
*/
|
|
115
118
|
const POLYFILLS = [
|
|
116
119
|
{
|
|
@@ -172,7 +175,7 @@ function polyfillsBlock() {
|
|
|
172
175
|
}
|
|
173
176
|
/**
|
|
174
177
|
* The theme-persistence script. Runs inline (no `defer`) while the parser is
|
|
175
|
-
* still in `<head>`, so `
|
|
178
|
+
* still in `<head>`, so the `theme-*` switch lands on `<html>` before first paint. The
|
|
176
179
|
* try/catch covers contexts where storage access throws (sandboxed iframes,
|
|
177
180
|
* blocked site data).
|
|
178
181
|
*/
|
|
@@ -180,11 +183,12 @@ const THEME_SCRIPT = `<!-- Theme: apply the persisted (or preferred) scheme befo
|
|
|
180
183
|
<script>
|
|
181
184
|
(() => {
|
|
182
185
|
try {
|
|
183
|
-
// A stored choice pins the scheme with
|
|
184
|
-
//
|
|
186
|
+
// A stored choice pins the scheme with the theme-dark / theme-light
|
|
187
|
+
// switch; with no choice the page follows the system scheme.
|
|
185
188
|
const storedTheme = localStorage.getItem("theme");
|
|
186
189
|
if (storedTheme === "dark" || storedTheme === "light") {
|
|
187
|
-
document.documentElement
|
|
190
|
+
const root = document.documentElement;
|
|
191
|
+
root.dataset.ui = ((root.dataset.ui || "") + " theme-" + storedTheme).trim();
|
|
188
192
|
}
|
|
189
193
|
} catch {
|
|
190
194
|
/* no storage access: follow the system scheme */
|
package/src/head.ts
CHANGED
|
@@ -137,7 +137,10 @@ const ESM_DEPENDENCIES: readonly CdnDependency[] = [
|
|
|
137
137
|
* Not polyfilled (native across the support window): the **Popover API** (Chrome 114, Firefox 125, Safari 17, iOS 18.3)
|
|
138
138
|
* and **Invoker Commands** `command`/`commandfor` (Chrome 135, Firefox 144,
|
|
139
139
|
* Safari 26.2). CSS anchor positioning is below the floor but has no polyfill
|
|
140
|
-
* here — the components gate it behind `@supports` instead.
|
|
140
|
+
* here — the components gate it behind `@supports` instead. Dialog light
|
|
141
|
+
* dismiss (`closedby="any"`: Chrome 134, Firefox 141; Safari 26 has only `none`
|
|
142
|
+
* and `closerequest`) is filled in by `base/dialog-lifecycle.ts` where `any`
|
|
143
|
+
* is not supported.
|
|
141
144
|
*/
|
|
142
145
|
const POLYFILLS: readonly CdnDependency[] = [
|
|
143
146
|
{
|
|
@@ -204,7 +207,7 @@ function polyfillsBlock(): string {
|
|
|
204
207
|
|
|
205
208
|
/**
|
|
206
209
|
* The theme-persistence script. Runs inline (no `defer`) while the parser is
|
|
207
|
-
* still in `<head>`, so `
|
|
210
|
+
* still in `<head>`, so the `theme-*` switch lands on `<html>` before first paint. The
|
|
208
211
|
* try/catch covers contexts where storage access throws (sandboxed iframes,
|
|
209
212
|
* blocked site data).
|
|
210
213
|
*/
|
|
@@ -212,11 +215,12 @@ const THEME_SCRIPT = `<!-- Theme: apply the persisted (or preferred) scheme befo
|
|
|
212
215
|
<script>
|
|
213
216
|
(() => {
|
|
214
217
|
try {
|
|
215
|
-
// A stored choice pins the scheme with
|
|
216
|
-
//
|
|
218
|
+
// A stored choice pins the scheme with the theme-dark / theme-light
|
|
219
|
+
// switch; with no choice the page follows the system scheme.
|
|
217
220
|
const storedTheme = localStorage.getItem("theme");
|
|
218
221
|
if (storedTheme === "dark" || storedTheme === "light") {
|
|
219
|
-
document.documentElement
|
|
222
|
+
const root = document.documentElement;
|
|
223
|
+
root.dataset.ui = ((root.dataset.ui || "") + " theme-" + storedTheme).trim();
|
|
220
224
|
}
|
|
221
225
|
} catch {
|
|
222
226
|
/* no storage access: follow the system scheme */
|