@nmnmcc/standard 0.4.0 → 0.5.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/README.md +45 -68
- package/dist/Extend.js +1 -1
- package/dist/{Standard-BPpzr5SM.js → Standard-BC6CfFOv.js} +116 -159
- package/dist/Standard.js +1 -1
- package/dist/Ui-DSgtM8Tf.js +591 -0
- package/dist/Ui.d.ts +4 -4
- package/dist/Ui.js +1 -1
- package/dist/index.js +2 -2
- package/dist/standard/page/page.d.ts +4 -6
- package/dist/standard/page/page.d.ts.map +1 -1
- package/dist/standard/tokens/tokens.d.ts +20 -103
- package/dist/standard/tokens/tokens.d.ts.map +1 -1
- package/dist/standard.css +1 -1
- package/dist/ui/flap/flap.d.ts +10 -10
- package/dist/ui/flap/flap.d.ts.map +1 -1
- package/dist/ui/modal/modal.d.ts +4 -1
- package/dist/ui/modal/modal.d.ts.map +1 -1
- package/dist/ui/navigator/navigator.d.ts +58 -59
- package/dist/ui/navigator/navigator.d.ts.map +1 -1
- package/dist/ui/notice/notice.d.ts +6 -1
- package/dist/ui/notice/notice.d.ts.map +1 -1
- package/dist/ui/sheet/sheet.d.ts +9 -9
- package/dist/ui/toasts/toasts.d.ts +8 -7
- package/dist/ui/toasts/toasts.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/standard/page/page.module.css +85 -47
- package/src/standard/page/page.module.d.css.ts +4 -2
- package/src/standard/page/page.ts +83 -1
- package/src/standard/tokens/tokens.ts +20 -268
- package/src/ui/dialog/dialog.module.css +24 -11
- package/src/ui/flap/flap.module.css +108 -52
- package/src/ui/flap/flap.module.d.css.ts +6 -1
- package/src/ui/flap/flap.ts +140 -13
- package/src/ui/modal/modal.module.css +73 -22
- package/src/ui/modal/modal.module.d.css.ts +1 -0
- package/src/ui/modal/modal.ts +21 -15
- package/src/ui/navigator/navigator.module.css +334 -176
- package/src/ui/navigator/navigator.module.d.css.ts +2 -10
- package/src/ui/navigator/navigator.ts +111 -106
- package/src/ui/notice/notice.ts +7 -2
- package/src/ui/popover/popover.ts +3 -3
- package/src/ui/sheet/sheet.module.css +51 -58
- package/src/ui/sheet/sheet.ts +9 -9
- package/src/ui/toasts/toasts.module.css +70 -11
- package/src/ui/toasts/toasts.module.d.css.ts +1 -0
- package/src/ui/toasts/toasts.ts +148 -4
- package/dist/Ui-B9xQqqNT.js +0 -468
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-BMBA7GOT.js";
|
|
2
2
|
import { Html as t } from "effect/ui/html";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Effect as n, Queue as r, Schema as i, Stream as a } from "effect";
|
|
4
|
+
import { Component as o, Mount as s } from "effect/ui";
|
|
5
|
+
var c = {
|
|
5
6
|
"accent-red": "s-accent-red",
|
|
6
7
|
"accent-orange": "s-accent-orange",
|
|
7
8
|
"accent-yellow": "s-accent-yellow",
|
|
@@ -38,7 +39,7 @@ var r = {
|
|
|
38
39
|
"align-end": "s-align-end",
|
|
39
40
|
"align-baseline": "s-align-baseline",
|
|
40
41
|
"align-stretch": "s-align-stretch"
|
|
41
|
-
},
|
|
42
|
+
}, l = Symbol("@nmnmcc/standard/Node"), u = (e) => ({ [l]: e }), d = (e) => e[l], f = (e) => e.map((e) => typeof e == "object" && e ? e[l] : e), p = (e, n) => t.component(e).make({ view: (e, t) => d(n(e, t)) }), m = {
|
|
42
43
|
icon: "s-icon",
|
|
43
44
|
leads: "s-leads",
|
|
44
45
|
"icon-menu": "s-icon-menu",
|
|
@@ -147,13 +148,13 @@ var r = {
|
|
|
147
148
|
"icon-rss-feed": "s-icon-rss-feed",
|
|
148
149
|
"icon-inventory-2": "s-icon-inventory-2",
|
|
149
150
|
"icon-edit-note": "s-icon-edit-note"
|
|
150
|
-
},
|
|
151
|
+
}, h = i.Literals(/* @__PURE__ */ "menu.close.search.add.remove.check.edit.delete.more-horiz.settings.tune.filter-list.sort.refresh.download.upload.share.content-copy.link.open-in-new.info.warning.error.check-circle.help.home.person.group.mail.calendar-today.schedule.location-on.call.description.folder.image.attach-file.star.favorite.bookmark.lock.visibility.visibility-off.notifications.send.print.save.language.palette.code.menu-book.grid-view.dashboard.widgets.title.layers.touch-app.animation.map.explore.flag.bolt.keyboard.verified.account-balance.credit-card.payments.savings.swap-horiz.receipt-long.account-balance-wallet.logout.shield.ac-unit.bar-chart.contactless.shopping-cart.restaurant.directions-bus.storefront.work.key.public.pause.play-arrow.block.history.arrow-back.local-cafe.bakery-dining.lunch-dining.icecream.local-bar.redeem.qr-code-2.takeout-dining.table-restaurant.eco.shopping-bag.loyalty.article.chat.sell.rss-feed.inventory-2.edit-note".split(".")), g = (e, t, n, r = !1) => e.span.class(m.icon, m[`icon-${t}`], r && m.leads).attr("role", n === void 0 ? void 0 : "img").attr("aria-label", n).attr("aria-hidden", n === void 0 ? "true" : void 0), _ = (e, t) => t === void 0 ? [] : [g(e, t, void 0, !0), " "], ee = (e) => ({ icon: (t, n) => u(g(e, t, n, n === void 0)) }), v = {
|
|
151
152
|
button: "s-button",
|
|
152
153
|
"kind-secondary": "s-kind-secondary"
|
|
153
|
-
},
|
|
154
|
-
let r = e.button.class(
|
|
155
|
-
return
|
|
156
|
-
} }),
|
|
154
|
+
}, te = (e) => e === "secondary" ? `${v.button} ${v["kind-secondary"]}` : v.button, y = (e) => ({ button: (t, n) => {
|
|
155
|
+
let r = e.button.class(v.button, t.kind === "secondary" && v["kind-secondary"]).attr("type", t.type ?? "button").disabled(t.disabled === !0);
|
|
156
|
+
return u((t.onClick === void 0 ? r : r.on("click", t.onClick)).children(_(e, t.icon), n));
|
|
157
|
+
} }), b = {
|
|
157
158
|
field: "s-field",
|
|
158
159
|
must: "s-must",
|
|
159
160
|
count: "s-count",
|
|
@@ -163,33 +164,33 @@ var r = {
|
|
|
163
164
|
affix: "s-affix",
|
|
164
165
|
act: "s-act",
|
|
165
166
|
select: "s-select"
|
|
166
|
-
},
|
|
167
|
+
}, x = (e, t) => {
|
|
167
168
|
let n = e.id(`s-field-${t.name}`), r = t.error === void 0 || t.error === null || t.error === "" ? void 0 : t.error, i = [t.hint === void 0 ? [] : [`${n}-hint`], r === void 0 ? [] : [`${n}-error`]].flat().join(" "), a = t.value?.length ?? 0;
|
|
168
169
|
return {
|
|
169
170
|
id: n,
|
|
170
171
|
invalid: r === void 0 ? void 0 : "true",
|
|
171
172
|
described: i === "" ? void 0 : i,
|
|
172
173
|
required: t.required === !0 ? "true" : void 0,
|
|
173
|
-
head: [e.label.attr("for", n).children(t.label, t.required === !0 && e.span.class(
|
|
174
|
-
foot: [t.hint !== void 0 && e.p.class(
|
|
174
|
+
head: [e.label.attr("for", n).children(t.label, t.required === !0 && e.span.class(b.must).attr("aria-hidden", "true").children(" *")), t.maxLength !== void 0 && e.span.class(b.count, a >= t.maxLength && b.full).attr("aria-hidden", "true").children(`${a} / ${t.maxLength}`)],
|
|
175
|
+
foot: [t.hint !== void 0 && e.p.class(b.hint).attr("id", `${n}-hint`).children(t.hint), r !== void 0 && e.p.attr("id", `${n}-error`).attr("role", "alert").children(r)]
|
|
175
176
|
};
|
|
176
|
-
},
|
|
177
|
-
let t = (t, n, r) => n !== void 0 && e.label.class(
|
|
177
|
+
}, S = (e) => {
|
|
178
|
+
let t = (t, n, r) => n !== void 0 && e.label.class(b.affix).attr("for", t).children(r ? g(e, n) : n), n = (t, n) => t !== void 0 && e.button.class(b.act).attr("type", "button").attr("aria-label", t.label).disabled(n === !0).on("click", t.onPress).children(g(e, t.icon));
|
|
178
179
|
return {
|
|
179
180
|
field: (r) => {
|
|
180
|
-
let { described: i, foot:
|
|
181
|
-
return
|
|
181
|
+
let { described: i, foot: a, head: o, id: s, invalid: c, required: l } = x(e, r), d = e.input.attr("id", s).attr("name", r.name).attr("type", r.type ?? "text").attr("placeholder", r.placeholder).attr("inputmode", r.inputMode).attr("autocomplete", r.autoComplete).attr("autofocus", r.autoFocus === !0 ? "" : void 0).attr("maxlength", r.maxLength === void 0 ? void 0 : String(r.maxLength)).attr("min", r.min === void 0 ? void 0 : String(r.min)).attr("max", r.max === void 0 ? void 0 : String(r.max)).attr("step", r.step === void 0 ? void 0 : String(r.step)).attr("readonly", r.readOnly === !0 ? "" : void 0).attr("aria-required", l).attr("aria-invalid", c).attr("aria-describedby", i).attr("list", r.suggestions === void 0 ? void 0 : `${s}-list`).disabled(r.disabled === !0).value(r.value).on("input", ({ value: e }) => r.onInput(e));
|
|
182
|
+
return u(e.div.class(b.field).children(o, e.div.class(b.box).children(t(s, r.icon, !0), t(s, r.prefix, !1), r.onBlur === void 0 ? d : d.on("blur", r.onBlur), t(s, r.suffix, !1), n(r.action, r.disabled)), r.suggestions !== void 0 && e.datalist.attr("id", `${s}-list`).children(r.suggestions.map((t) => e.option.attr("value", t))), a));
|
|
182
183
|
},
|
|
183
184
|
textarea: (t) => {
|
|
184
|
-
let { described: n, foot: r, head: i, id:
|
|
185
|
-
return
|
|
185
|
+
let { described: n, foot: r, head: i, id: a, invalid: o, required: s } = x(e, t), c = e.textarea.attr("id", a).attr("name", t.name).attr("rows", String(t.rows ?? 3)).attr("placeholder", t.placeholder).attr("maxlength", t.maxLength === void 0 ? void 0 : String(t.maxLength)).attr("readonly", t.readOnly === !0 ? "" : void 0).attr("aria-required", s).attr("aria-invalid", o).attr("aria-describedby", n).disabled(t.disabled === !0).value(t.value).on("input", ({ value: e }) => t.onInput(e));
|
|
186
|
+
return u(e.div.class(b.field).children(i, e.div.class(b.box).children(t.onBlur === void 0 ? c : c.on("blur", t.onBlur)), r));
|
|
186
187
|
},
|
|
187
188
|
select: (n) => {
|
|
188
|
-
let { described: r, foot: i, head:
|
|
189
|
-
return
|
|
189
|
+
let { described: r, foot: i, head: a, id: o, invalid: s, required: c } = x(e, n), l = n.options.some((e) => e.value === n.value);
|
|
190
|
+
return u(e.div.class(b.field).children(a, e.div.class(b.box, b.select).children(t(o, n.icon, !0), e.select.attr("id", o).attr("name", n.name).attr("aria-required", c).attr("aria-invalid", s).attr("aria-describedby", r).disabled(n.disabled === !0).on("change", ({ value: e }) => n.onChange(e)).children(n.placeholder !== void 0 && e.option.attr("value", "").attr("hidden", "").selected(!l).disabled(!0).children(n.placeholder), n.options.map((t) => e.option.attr("value", t.value).selected(t.value === n.value).disabled(t.disabled === !0).children(t.label)))), i));
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
|
-
},
|
|
193
|
+
}, C = (e, t) => e === void 0 ? void 0 : t(e), w = (e) => c[`tone-${e}`], T = (e) => c[`accent-${e}`], E = c.selectable, D = (e) => c[`gap-${e}`], O = (e) => c[`pad-${e}`], k = (e) => c[`align-${e}`], A = {
|
|
193
194
|
section: "s-section",
|
|
194
195
|
"span-1": "s-span-1",
|
|
195
196
|
"span-2": "s-span-2",
|
|
@@ -227,7 +228,7 @@ var r = {
|
|
|
227
228
|
sticky: "s-sticky",
|
|
228
229
|
"only-wide": "s-only-wide",
|
|
229
230
|
"only-narrow": "s-only-narrow"
|
|
230
|
-
},
|
|
231
|
+
}, j = (e) => ({ form: (t, ...n) => u(e.form.class(A.stack, C(t.gap, D)).attr("novalidate", "").on("submit", t.onSubmit).children(f(n))) }), M = {
|
|
231
232
|
image: "s-image",
|
|
232
233
|
"ratio-1x1": "s-ratio-1x1",
|
|
233
234
|
"ratio-4x3": "s-ratio-4x3",
|
|
@@ -243,39 +244,69 @@ var r = {
|
|
|
243
244
|
"16/9": "16x9",
|
|
244
245
|
"3/4": "3x4",
|
|
245
246
|
"2/3": "2x3"
|
|
246
|
-
},
|
|
247
|
-
let n = e.img.class(
|
|
248
|
-
return
|
|
249
|
-
} }),
|
|
250
|
-
section: (t, ...n) =>
|
|
251
|
-
grid: (t, ...n) =>
|
|
252
|
-
col: (t, ...n) =>
|
|
253
|
-
stack: (t, ...n) =>
|
|
254
|
-
row: (t, ...n) =>
|
|
255
|
-
rule: (t = {}) =>
|
|
256
|
-
}),
|
|
247
|
+
}, re = (e) => ({ image: (t) => {
|
|
248
|
+
let n = e.img.class(M.image, C(t.ratio, (e) => M[`ratio-${ne[e]}`])).attr("src", t.src).attr("alt", t.alt).attr("loading", "lazy");
|
|
249
|
+
return u(t.caption === void 0 ? n : e.figure.class(M.figure).children(n, e.figcaption.children(t.caption)));
|
|
250
|
+
} }), ie = (e) => ({
|
|
251
|
+
section: (t, ...n) => u(e[t.as ?? "section"].class(A.section, C(t.accent, T), C(t.tone, w), C(t.pad, O), C(t.gap, D), t.select === !0 && E).attr("aria-label", t.label).children(f(n))),
|
|
252
|
+
grid: (t, ...n) => u(e.div.class(A.grid, C(t.gap, D), C(t.align, k)).children(f(n))),
|
|
253
|
+
col: (t, ...n) => u(e.div.class(A.col, A[`span-${t.span}`], C(t.start, (e) => `${A.placed} ${A[`start-${e}`]}`), C(t.only, (e) => A[`only-${e}`]), t.sticky === !0 && A.sticky, t.fill === !0 && A.fill, C(t.gap, D), C(t.align, k)).children(f(n))),
|
|
254
|
+
stack: (t, ...n) => u(e[t.as ?? "div"].class(A.stack, t.select === !0 && E, C(t.gap, D), C(t.only, (e) => A[`only-${e}`])).attr("aria-label", t.label).children(f(n))),
|
|
255
|
+
row: (t, ...n) => u(e.div.class(A.row, C(t.gap, D), C(t.align, k)).children(f(n))),
|
|
256
|
+
rule: (t = {}) => u(e.hr.class(A.rule, t.weight === "bold" && A["weight-bold"], t.accent === !0 && A["rule-accent"]))
|
|
257
|
+
}), N = {
|
|
257
258
|
list: "s-list",
|
|
258
259
|
"marker-number": "s-marker-number",
|
|
259
260
|
"marker-none": "s-marker-none",
|
|
260
261
|
ruled: "s-ruled",
|
|
261
262
|
facts: "s-facts",
|
|
262
263
|
beside: "s-beside"
|
|
263
|
-
},
|
|
264
|
-
list: (t, ...n) =>
|
|
265
|
-
facts: (t, ...n) =>
|
|
266
|
-
}),
|
|
264
|
+
}, P = (e) => ({
|
|
265
|
+
list: (t, ...n) => u(e[t.marker === "number" ? "ol" : "ul"].class(N.list, t.marker === "number" && N["marker-number"], t.marker === "none" && N["marker-none"], t.ruled === !0 && N.ruled).children(f(n).flatMap((t) => t === !1 || t == null ? [] : [e.li.children(t)]))),
|
|
266
|
+
facts: (t, ...n) => u(e.dl.class(N.facts, t.beside === !0 && N.beside).children(n.flatMap((t) => t === !1 || t == null ? [] : [e.div.children(e.dt.children(t.name), e.dd.children(f([t.value])))])))
|
|
267
|
+
}), F = {
|
|
267
268
|
page: "s-page",
|
|
268
269
|
"scheme-dark": "s-scheme-dark",
|
|
269
270
|
"scheme-light": "s-scheme-light",
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
"turn-in": "s-turn-in",
|
|
272
|
+
"turn-away": "s-turn-away",
|
|
273
|
+
"turn-out": "s-turn-out",
|
|
274
|
+
"turn-back": "s-turn-back"
|
|
275
|
+
}, I = 10, ae = s.make("SlowWithShift", { args: {} }, () => a.callback((e) => n.acquireRelease(n.sync(() => {
|
|
276
|
+
let t = /* @__PURE__ */ new Set(), n, i = () => {
|
|
277
|
+
for (let e of document.getAnimations()) t.has(e) || (t.add(e), e.updatePlaybackRate(e.playbackRate / I));
|
|
278
|
+
n = requestAnimationFrame(i);
|
|
279
|
+
}, a = () => {
|
|
280
|
+
if (n !== void 0) {
|
|
281
|
+
cancelAnimationFrame(n), n = void 0;
|
|
282
|
+
for (let e of t) e.updatePlaybackRate(e.playbackRate * I);
|
|
283
|
+
t.clear(), r.offerUnsafe(e, void 0);
|
|
284
|
+
}
|
|
285
|
+
}, o = (e) => {
|
|
286
|
+
e.key === "Shift" && n === void 0 && i();
|
|
287
|
+
}, s = (e) => {
|
|
288
|
+
e.key === "Shift" && a();
|
|
289
|
+
}, c = (e) => {
|
|
290
|
+
if (!e.shiftKey || e.ctrlKey || e.metaKey || e.altKey || e.button !== 0) return;
|
|
291
|
+
let t = e.target instanceof Element ? e.target.closest("a[href]") : null;
|
|
292
|
+
t instanceof HTMLAnchorElement && (t.origin !== location.origin || t.hasAttribute("download") || (t.target === "" || t.target === "_self") && (e.preventDefault(), e.stopImmediatePropagation(), t.click()));
|
|
293
|
+
};
|
|
294
|
+
return window.addEventListener("click", c, { capture: !0 }), window.addEventListener("keydown", o, {
|
|
295
|
+
capture: !0,
|
|
296
|
+
passive: !0
|
|
297
|
+
}), window.addEventListener("keyup", s, {
|
|
298
|
+
capture: !0,
|
|
299
|
+
passive: !0
|
|
300
|
+
}), window.addEventListener("blur", a, { passive: !0 }), () => {
|
|
301
|
+
a(), window.removeEventListener("click", c, { capture: !0 }), window.removeEventListener("keydown", o, { capture: !0 }), window.removeEventListener("keyup", s, { capture: !0 }), window.removeEventListener("blur", a);
|
|
302
|
+
};
|
|
303
|
+
}), (e) => n.sync(e))).pipe(a.runDrain, n.as(o.noop))), oe = (e) => ({ page: (t, ...n) => u(e.div.class(F.page, C(t.accent, T), t.scheme === "light" && F["scheme-light"], t.scheme === "dark" && F["scheme-dark"]).onMount(ae({})).children(f(n))) }), L = {
|
|
273
304
|
table: "s-table",
|
|
274
305
|
numeric: "s-numeric"
|
|
275
|
-
},
|
|
276
|
-
let n = (e) => t.columns[e]?.numeric === !0 &&
|
|
277
|
-
return
|
|
278
|
-
} }),
|
|
306
|
+
}, se = (e) => ({ table: (t) => {
|
|
307
|
+
let n = (e) => t.columns[e]?.numeric === !0 && L.numeric;
|
|
308
|
+
return u(e.table.class(L.table).children(e.thead.children(e.tr.children(t.columns.map((t, r) => e.th.attr("scope", "col").class(n(r)).children(t.title)))), e.tbody.children(t.rows.map((t) => e.tr.children(t.map((t, r) => e.td.class(n(r)).children(t)))))));
|
|
309
|
+
} }), R = {
|
|
279
310
|
text: "s-text",
|
|
280
311
|
"role-display": "s-role-display",
|
|
281
312
|
"role-title": "s-role-title",
|
|
@@ -291,7 +322,7 @@ var r = {
|
|
|
291
322
|
listing: "s-listing",
|
|
292
323
|
quote: "s-quote",
|
|
293
324
|
link: "s-link"
|
|
294
|
-
},
|
|
325
|
+
}, ce = {
|
|
295
326
|
display: "h1",
|
|
296
327
|
title: "h2",
|
|
297
328
|
heading: "h3",
|
|
@@ -299,15 +330,15 @@ var r = {
|
|
|
299
330
|
body: "p",
|
|
300
331
|
caption: "p",
|
|
301
332
|
label: "p"
|
|
302
|
-
},
|
|
303
|
-
text: (t, ...n) =>
|
|
304
|
-
em: (t, ...n) =>
|
|
305
|
-
code: (t) =>
|
|
306
|
-
listing: (t, n) =>
|
|
307
|
-
quote: (t, ...n) =>
|
|
308
|
-
link: (t, ...n) =>
|
|
309
|
-
br:
|
|
310
|
-
}),
|
|
333
|
+
}, le = (e) => ({
|
|
334
|
+
text: (t, ...n) => u(e[ce[t]].class(R.text, R[`role-${t}`]).children(f(n))),
|
|
335
|
+
em: (t, ...n) => u(e[t === "strong" ? "strong" : "span"].class(R[`em-${t}`]).children(f(n))),
|
|
336
|
+
code: (t) => u(e.code.class(R.code).children(t)),
|
|
337
|
+
listing: (t, n) => u(e.pre.class(R.listing, t.select === !0 && E).attr("aria-label", t.label).attr("tabindex", "0").children(e.code.children(n))),
|
|
338
|
+
quote: (t, ...n) => u(e.figure.class(R.quote).children(e.blockquote.children(e.p.children(f(n))), (t.by !== void 0 || t.from !== void 0) && e.figcaption.children(t.by, t.by !== void 0 && t.from !== void 0 && ", ", t.from !== void 0 && e.cite.children(t.from)))),
|
|
339
|
+
link: (t, ...n) => u(e.a.class(R.link).attr("href", t.href).attr("target", t.external === !0 ? "_blank" : void 0).attr("rel", t.external === !0 ? "external noopener noreferrer" : void 0).attr("aria-current", t.current === !0 ? "page" : void 0).children(f(n), t.external === !0 && ["\xA0", g(e, "open-in-new")])),
|
|
340
|
+
br: u(e.br)
|
|
341
|
+
}), z = i.Literals([
|
|
311
342
|
1,
|
|
312
343
|
2,
|
|
313
344
|
3,
|
|
@@ -320,7 +351,7 @@ var r = {
|
|
|
320
351
|
10,
|
|
321
352
|
11,
|
|
322
353
|
12
|
|
323
|
-
]),
|
|
354
|
+
]), B = i.Literals([
|
|
324
355
|
0,
|
|
325
356
|
1,
|
|
326
357
|
2,
|
|
@@ -331,7 +362,7 @@ var r = {
|
|
|
331
362
|
12,
|
|
332
363
|
16,
|
|
333
364
|
24
|
|
334
|
-
]),
|
|
365
|
+
]), V = i.Literals([
|
|
335
366
|
"red",
|
|
336
367
|
"orange",
|
|
337
368
|
"yellow",
|
|
@@ -340,15 +371,15 @@ var r = {
|
|
|
340
371
|
"blue",
|
|
341
372
|
"purple",
|
|
342
373
|
"grey"
|
|
343
|
-
]),
|
|
374
|
+
]), H = i.Literals([
|
|
344
375
|
"auto",
|
|
345
376
|
"light",
|
|
346
377
|
"dark"
|
|
347
|
-
]),
|
|
378
|
+
]), U = i.Literals([
|
|
348
379
|
"paper",
|
|
349
380
|
"ink",
|
|
350
381
|
"accent"
|
|
351
|
-
]),
|
|
382
|
+
]), W = i.Literals([
|
|
352
383
|
"display",
|
|
353
384
|
"title",
|
|
354
385
|
"heading",
|
|
@@ -356,96 +387,23 @@ var r = {
|
|
|
356
387
|
"body",
|
|
357
388
|
"caption",
|
|
358
389
|
"label"
|
|
359
|
-
]),
|
|
390
|
+
]), G = i.Literals([
|
|
360
391
|
"strong",
|
|
361
392
|
"muted",
|
|
362
393
|
"accent"
|
|
363
|
-
]),
|
|
394
|
+
]), K = i.Literals([
|
|
364
395
|
"start",
|
|
365
396
|
"end",
|
|
366
397
|
"baseline",
|
|
367
398
|
"stretch"
|
|
368
|
-
]),
|
|
399
|
+
]), q = i.Literals([
|
|
369
400
|
"1/1",
|
|
370
401
|
"4/3",
|
|
371
402
|
"3/2",
|
|
372
403
|
"16/9",
|
|
373
404
|
"3/4",
|
|
374
405
|
"2/3"
|
|
375
|
-
]),
|
|
376
|
-
"forward",
|
|
377
|
-
"back",
|
|
378
|
-
"down",
|
|
379
|
-
"up"
|
|
380
|
-
]), G = (e) => e.split("/").filter((e) => e !== ""), K = (e) => e > 0 ? 1 : e < 0 ? -1 : 0, se = new Intl.Collator("en", { numeric: !0 }), q = (e, t) => K(typeof e == "number" && typeof t == "number" ? t - e : se.compare(String(t), String(e))), J = (e, t, n) => {
|
|
381
|
-
let r = Object.keys(e.routes).map((t, n) => ({
|
|
382
|
-
tag: t,
|
|
383
|
-
order: n,
|
|
384
|
-
path: G(e.routes[t].path)
|
|
385
|
-
})), i = r.find((e) => e.tag === t._tag), a = r.find((e) => e.tag === n._tag);
|
|
386
|
-
if (i === void 0 || a === void 0) return [];
|
|
387
|
-
let o = (t, n) => e.routes[t]?.params[n.slice(1)]?.literals, s = (e, t) => e.params?.[t === "*" ? "*" : t.slice(1)], c = (e) => e !== void 0 && (e.startsWith(":") || e === "*"), l = (e, t, n) => {
|
|
388
|
-
let i = /* @__PURE__ */ new Map(), a = 0;
|
|
389
|
-
for (let n of r) {
|
|
390
|
-
if (!n.path.slice(0, e).every((e, n) => e === t.path[n]) || n.path.length < e) continue;
|
|
391
|
-
let r = n.path[e] ?? "";
|
|
392
|
-
i.has(r) || (i.set(r, a), a += c(r) ? o(n.tag, r)?.length ?? 1 : 1);
|
|
393
|
-
}
|
|
394
|
-
let l = t.path[e] ?? "", u = c(l) ? o(t.tag, l) : void 0;
|
|
395
|
-
return (i.get(l) ?? 0) + (u === void 0 ? 0 : Math.max(0, u.indexOf(s(n, l))));
|
|
396
|
-
}, u = (e) => e.filter((t, n) => n >= 2 && !(n > 2 && c(t) && c(e[n - 1]))).length, d = (e) => {
|
|
397
|
-
let r = K(l(e, a, n) - l(e, i, t)), u = i.path[e];
|
|
398
|
-
return r !== 0 || !c(u) || u !== a.path[e] || !f(e) || o(i.tag, u) !== void 0 ? r : q(s(t, u), s(n, u));
|
|
399
|
-
}, f = (e) => i.path.length >= e && a.path.length >= e && i.path.slice(0, e).every((e, t) => e === a.path[t]), p = d(0) || K(u(a.path) - u(i.path)), m = () => {
|
|
400
|
-
let e = d(1);
|
|
401
|
-
if (e !== 0 || !f(2)) return e;
|
|
402
|
-
for (let e = 2; e < Math.min(i.path.length, a.path.length); e++) {
|
|
403
|
-
let t = d(e);
|
|
404
|
-
if (t !== 0 || !f(e + 1)) return t;
|
|
405
|
-
}
|
|
406
|
-
return 0;
|
|
407
|
-
}, h = p > 0 ? ["forward"] : p < 0 ? ["back"] : [], g = m();
|
|
408
|
-
return [...h, ...g > 0 ? ["down"] : g < 0 ? ["up"] : []];
|
|
409
|
-
}, Y = (e, t) => {
|
|
410
|
-
let n = [], r = (e, t) => {
|
|
411
|
-
let i = typeof e == "object" && "at" in e ? e.at : e;
|
|
412
|
-
n.push(typeof i == "string" ? {
|
|
413
|
-
tag: i,
|
|
414
|
-
params: void 0,
|
|
415
|
-
at: t
|
|
416
|
-
} : {
|
|
417
|
-
tag: i._tag,
|
|
418
|
-
params: i.params ?? {},
|
|
419
|
-
at: t
|
|
420
|
-
}), typeof e == "object" && "under" in e && e.under.forEach((e, n) => r(e, [...t, n]));
|
|
421
|
-
};
|
|
422
|
-
t.forEach((e, t) => e.forEach((e, n) => r(e, [t, n])));
|
|
423
|
-
let i = Object.keys(e.routes).filter((t) => t !== e.catchAll && !n.some((e) => e.tag === t));
|
|
424
|
-
if (i.length > 0) throw Error(`Standard.canvas: no place for ${i.join(", ")}`);
|
|
425
|
-
let a = (e, t) => Object.keys(e).every((n) => e[n] === t.params?.[n]), o = (e) => n.find((t) => t.tag === e._tag && t.params !== void 0 && a(t.params, e)) ?? n.find((t) => t.tag === e._tag && t.params === void 0), s = (t, n) => {
|
|
426
|
-
for (let r of G(e.routes[t._tag]?.path ?? "/")) {
|
|
427
|
-
let i = r === "*" ? "*" : r.startsWith(":") ? r.slice(1) : void 0;
|
|
428
|
-
if (i === void 0) continue;
|
|
429
|
-
let a = e.routes[t._tag]?.params[i]?.literals, o = a === void 0 ? q(t.params?.[i], n.params?.[i]) : K(a.indexOf(n.params?.[i]) - a.indexOf(t.params?.[i]));
|
|
430
|
-
if (o !== 0) return o;
|
|
431
|
-
}
|
|
432
|
-
return 0;
|
|
433
|
-
};
|
|
434
|
-
return { travel: (e, t) => {
|
|
435
|
-
let n = o(e), r = o(t);
|
|
436
|
-
if (n === void 0 || r === void 0) return [];
|
|
437
|
-
let i = K(r.at[0] - n.at[0]) || K(r.at.length - n.at.length), a = (() => {
|
|
438
|
-
let a = K(r.at[1] - n.at[1]);
|
|
439
|
-
if (a !== 0 || i !== 0 && r.at[0] !== n.at[0]) return a;
|
|
440
|
-
for (let e = 2; e < Math.min(n.at.length, r.at.length); e++) {
|
|
441
|
-
let t = K(r.at[e] - n.at[e]);
|
|
442
|
-
if (t !== 0) return t;
|
|
443
|
-
}
|
|
444
|
-
return n === r ? s(e, t) : 0;
|
|
445
|
-
})();
|
|
446
|
-
return [...i > 0 ? ["forward"] : i < 0 ? ["back"] : [], ...a > 0 ? ["down"] : a < 0 ? ["up"] : []];
|
|
447
|
-
} };
|
|
448
|
-
}, X = n.Literals(["wide", "narrow"]), Z = n.Literals([
|
|
406
|
+
]), J = i.Literals(["in", "out"]), Y = (e, t) => t > e ? ["in"] : t < e ? ["out"] : [], X = i.Literals(["wide", "narrow"]), Z = i.Literals([
|
|
449
407
|
"section",
|
|
450
408
|
"header",
|
|
451
409
|
"main",
|
|
@@ -453,36 +411,35 @@ var r = {
|
|
|
453
411
|
"nav",
|
|
454
412
|
"article",
|
|
455
413
|
"aside"
|
|
456
|
-
]),
|
|
457
|
-
Align: () =>
|
|
458
|
-
Colour: () =>
|
|
459
|
-
Emphasis: () =>
|
|
460
|
-
Icon: () =>
|
|
414
|
+
]), ue = /* @__PURE__ */ e({
|
|
415
|
+
Align: () => K,
|
|
416
|
+
Colour: () => V,
|
|
417
|
+
Emphasis: () => G,
|
|
418
|
+
Icon: () => h,
|
|
461
419
|
Landmark: () => Z,
|
|
462
420
|
Only: () => X,
|
|
463
|
-
Ratio: () =>
|
|
464
|
-
Role: () =>
|
|
465
|
-
Scheme: () =>
|
|
466
|
-
Space: () =>
|
|
467
|
-
Span: () =>
|
|
468
|
-
Tone: () =>
|
|
469
|
-
Travel: () =>
|
|
421
|
+
Ratio: () => q,
|
|
422
|
+
Role: () => W,
|
|
423
|
+
Scheme: () => H,
|
|
424
|
+
Space: () => B,
|
|
425
|
+
Span: () => z,
|
|
426
|
+
Tone: () => U,
|
|
427
|
+
Travel: () => J,
|
|
470
428
|
builders: () => Q,
|
|
471
|
-
canvas: () => Y,
|
|
472
429
|
component: () => $,
|
|
473
|
-
|
|
430
|
+
turn: () => Y
|
|
474
431
|
}), Q = (e) => ({
|
|
475
432
|
props: e.props,
|
|
476
|
-
...re(e),
|
|
477
|
-
...k(e),
|
|
478
433
|
...oe(e),
|
|
479
|
-
...p(e),
|
|
480
|
-
...j(e),
|
|
481
|
-
...O(e),
|
|
482
434
|
...ie(e),
|
|
483
|
-
...
|
|
435
|
+
...le(e),
|
|
484
436
|
...ee(e),
|
|
485
|
-
...
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
437
|
+
...P(e),
|
|
438
|
+
...re(e),
|
|
439
|
+
...se(e),
|
|
440
|
+
...y(e),
|
|
441
|
+
...S(e),
|
|
442
|
+
...j(e),
|
|
443
|
+
child: (t) => u(t(e))
|
|
444
|
+
}), $ = (e, t) => p(e, (e, n) => t(Q(e), n));
|
|
445
|
+
export { h as C, d as D, p as E, f as O, te as S, _ as T, T as _, V as a, w as b, X as c, H as d, B as f, Y as g, J as h, K as i, u as k, q as l, U as m, Q as n, G as o, z as p, $ as r, Z as s, ue as t, W as u, D as v, g as w, y as x, O as y };
|
package/dist/Standard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as Align, a as Colour, o as Emphasis,
|
|
1
|
+
export { i as Align, a as Colour, o as Emphasis, C as Icon, s as Landmark, c as Only, l as Ratio, u as Role, d as Scheme, f as Space, p as Span, m as Tone, h as Travel, n as builders, r as component, g as turn } from "./Standard-BC6CfFOv.js";
|