@nmnmcc/standard 0.4.1 → 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.
Files changed (47) hide show
  1. package/README.md +45 -68
  2. package/dist/Extend.js +1 -1
  3. package/dist/{Standard-BPpzr5SM.js → Standard-BC6CfFOv.js} +116 -159
  4. package/dist/Standard.js +1 -1
  5. package/dist/Ui-DSgtM8Tf.js +591 -0
  6. package/dist/Ui.d.ts +4 -4
  7. package/dist/Ui.js +1 -1
  8. package/dist/index.js +2 -2
  9. package/dist/standard/page/page.d.ts +4 -6
  10. package/dist/standard/page/page.d.ts.map +1 -1
  11. package/dist/standard/tokens/tokens.d.ts +20 -103
  12. package/dist/standard/tokens/tokens.d.ts.map +1 -1
  13. package/dist/standard.css +1 -1
  14. package/dist/ui/flap/flap.d.ts +10 -10
  15. package/dist/ui/flap/flap.d.ts.map +1 -1
  16. package/dist/ui/modal/modal.d.ts +4 -1
  17. package/dist/ui/modal/modal.d.ts.map +1 -1
  18. package/dist/ui/navigator/navigator.d.ts +58 -59
  19. package/dist/ui/navigator/navigator.d.ts.map +1 -1
  20. package/dist/ui/notice/notice.d.ts +6 -1
  21. package/dist/ui/notice/notice.d.ts.map +1 -1
  22. package/dist/ui/sheet/sheet.d.ts +9 -9
  23. package/dist/ui/toasts/toasts.d.ts +8 -7
  24. package/dist/ui/toasts/toasts.d.ts.map +1 -1
  25. package/package.json +1 -1
  26. package/src/standard/page/page.module.css +85 -47
  27. package/src/standard/page/page.module.d.css.ts +4 -2
  28. package/src/standard/page/page.ts +83 -1
  29. package/src/standard/tokens/tokens.ts +20 -268
  30. package/src/ui/dialog/dialog.module.css +24 -11
  31. package/src/ui/flap/flap.module.css +108 -52
  32. package/src/ui/flap/flap.module.d.css.ts +6 -1
  33. package/src/ui/flap/flap.ts +140 -13
  34. package/src/ui/modal/modal.module.css +73 -22
  35. package/src/ui/modal/modal.module.d.css.ts +1 -0
  36. package/src/ui/modal/modal.ts +21 -15
  37. package/src/ui/navigator/navigator.module.css +334 -176
  38. package/src/ui/navigator/navigator.module.d.css.ts +2 -10
  39. package/src/ui/navigator/navigator.ts +111 -106
  40. package/src/ui/notice/notice.ts +7 -2
  41. package/src/ui/popover/popover.ts +3 -3
  42. package/src/ui/sheet/sheet.module.css +51 -58
  43. package/src/ui/sheet/sheet.ts +9 -9
  44. package/src/ui/toasts/toasts.module.css +70 -11
  45. package/src/ui/toasts/toasts.module.d.css.ts +1 -0
  46. package/src/ui/toasts/toasts.ts +148 -4
  47. 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 { Schema as n } from "effect";
4
- var r = {
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
- }, i = Symbol("@nmnmcc/standard/Node"), a = (e) => ({ [i]: e }), o = (e) => e[i], s = (e) => e.map((e) => typeof e == "object" && e ? e[i] : e), c = (e, n) => t.component(e).make({ view: (e, t) => o(n(e, t)) }), l = {
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
- }, u = n.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(".")), d = (e, t, n, r = !1) => e.span.class(l.icon, l[`icon-${t}`], r && l.leads).attr("role", n === void 0 ? void 0 : "img").attr("aria-label", n).attr("aria-hidden", n === void 0 ? "true" : void 0), f = (e, t) => t === void 0 ? [] : [d(e, t, void 0, !0), " "], p = (e) => ({ icon: (t, n) => a(d(e, t, n, n === void 0)) }), m = {
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
- }, h = (e) => e === "secondary" ? `${m.button} ${m["kind-secondary"]}` : m.button, g = (e) => ({ button: (t, n) => {
154
- let r = e.button.class(m.button, t.kind === "secondary" && m["kind-secondary"]).attr("type", t.type ?? "button").disabled(t.disabled === !0);
155
- return a((t.onClick === void 0 ? r : r.on("click", t.onClick)).children(f(e, t.icon), n));
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
- }, v = (e, t) => {
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(_.must).attr("aria-hidden", "true").children(" *")), t.maxLength !== void 0 && e.span.class(_.count, a >= t.maxLength && _.full).attr("aria-hidden", "true").children(`${a} / ${t.maxLength}`)],
174
- foot: [t.hint !== void 0 && e.p.class(_.hint).attr("id", `${n}-hint`).children(t.hint), r !== void 0 && e.p.attr("id", `${n}-error`).attr("role", "alert").children(r)]
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
- }, ee = (e) => {
177
- let t = (t, n, r) => n !== void 0 && e.label.class(_.affix).attr("for", t).children(r ? d(e, n) : n), n = (t, n) => t !== void 0 && e.button.class(_.act).attr("type", "button").attr("aria-label", t.label).disabled(n === !0).on("click", t.onPress).children(d(e, t.icon));
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: o, head: s, id: c, invalid: l, required: u } = v(e, r), d = e.input.attr("id", c).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", u).attr("aria-invalid", l).attr("aria-describedby", i).attr("list", r.suggestions === void 0 ? void 0 : `${c}-list`).disabled(r.disabled === !0).value(r.value).on("input", ({ value: e }) => r.onInput(e));
181
- return a(e.div.class(_.field).children(s, e.div.class(_.box).children(t(c, r.icon, !0), t(c, r.prefix, !1), r.onBlur === void 0 ? d : d.on("blur", r.onBlur), t(c, r.suffix, !1), n(r.action, r.disabled)), r.suggestions !== void 0 && e.datalist.attr("id", `${c}-list`).children(r.suggestions.map((t) => e.option.attr("value", t))), o));
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: o, invalid: s, required: c } = v(e, t), l = e.textarea.attr("id", o).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", c).attr("aria-invalid", s).attr("aria-describedby", n).disabled(t.disabled === !0).value(t.value).on("input", ({ value: e }) => t.onInput(e));
185
- return a(e.div.class(_.field).children(i, e.div.class(_.box).children(t.onBlur === void 0 ? l : l.on("blur", t.onBlur)), r));
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: o, id: s, invalid: c, required: l } = v(e, n), u = n.options.some((e) => e.value === n.value);
189
- return a(e.div.class(_.field).children(o, e.div.class(_.box, _.select).children(t(s, n.icon, !0), e.select.attr("id", s).attr("name", n.name).attr("aria-required", l).attr("aria-invalid", c).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(!u).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));
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
- }, y = (e, t) => e === void 0 ? void 0 : t(e), b = (e) => r[`tone-${e}`], x = (e) => r[`accent-${e}`], S = r.selectable, C = (e) => r[`gap-${e}`], w = (e) => r[`pad-${e}`], T = (e) => r[`align-${e}`], E = {
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
- }, te = (e) => ({ form: (t, ...n) => a(e.form.class(E.stack, y(t.gap, C)).attr("novalidate", "").on("submit", t.onSubmit).children(s(n))) }), D = {
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
- }, O = (e) => ({ image: (t) => {
247
- let n = e.img.class(D.image, y(t.ratio, (e) => D[`ratio-${ne[e]}`])).attr("src", t.src).attr("alt", t.alt).attr("loading", "lazy");
248
- return a(t.caption === void 0 ? n : e.figure.class(D.figure).children(n, e.figcaption.children(t.caption)));
249
- } }), k = (e) => ({
250
- section: (t, ...n) => a(e[t.as ?? "section"].class(E.section, y(t.accent, x), y(t.tone, b), y(t.pad, w), y(t.gap, C), t.select === !0 && S).attr("aria-label", t.label).children(s(n))),
251
- grid: (t, ...n) => a(e.div.class(E.grid, y(t.gap, C), y(t.align, T)).children(s(n))),
252
- col: (t, ...n) => a(e.div.class(E.col, E[`span-${t.span}`], y(t.start, (e) => `${E.placed} ${E[`start-${e}`]}`), y(t.only, (e) => E[`only-${e}`]), t.sticky === !0 && E.sticky, t.fill === !0 && E.fill, y(t.gap, C), y(t.align, T)).children(s(n))),
253
- stack: (t, ...n) => a(e[t.as ?? "div"].class(E.stack, t.select === !0 && S, y(t.gap, C), y(t.only, (e) => E[`only-${e}`])).attr("aria-label", t.label).children(s(n))),
254
- row: (t, ...n) => a(e.div.class(E.row, y(t.gap, C), y(t.align, T)).children(s(n))),
255
- rule: (t = {}) => a(e.hr.class(E.rule, t.weight === "bold" && E["weight-bold"], t.accent === !0 && E["rule-accent"]))
256
- }), A = {
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
- }, j = (e) => ({
264
- list: (t, ...n) => a(e[t.marker === "number" ? "ol" : "ul"].class(A.list, t.marker === "number" && A["marker-number"], t.marker === "none" && A["marker-none"], t.ruled === !0 && A.ruled).children(s(n).flatMap((t) => t === !1 || t == null ? [] : [e.li.children(t)]))),
265
- facts: (t, ...n) => a(e.dl.class(A.facts, t.beside === !0 && A.beside).children(n.flatMap((t) => t === !1 || t == null ? [] : [e.div.children(e.dt.children(t.name), e.dd.children(s([t.value])))])))
266
- }), M = {
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
- leave: "s-leave",
271
- enter: "s-enter"
272
- }, re = (e) => ({ page: (t, ...n) => a(e.div.class(M.page, y(t.accent, x), t.scheme === "light" && M["scheme-light"], t.scheme === "dark" && M["scheme-dark"]).children(s(n))) }), N = {
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
- }, ie = (e) => ({ table: (t) => {
276
- let n = (e) => t.columns[e]?.numeric === !0 && N.numeric;
277
- return a(e.table.class(N.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)))))));
278
- } }), P = {
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
- }, ae = {
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
- }, oe = (e) => ({
303
- text: (t, ...n) => a(e[ae[t]].class(P.text, P[`role-${t}`]).children(s(n))),
304
- em: (t, ...n) => a(e[t === "strong" ? "strong" : "span"].class(P[`em-${t}`]).children(s(n))),
305
- code: (t) => a(e.code.class(P.code).children(t)),
306
- listing: (t, n) => a(e.pre.class(P.listing, t.select === !0 && S).attr("aria-label", t.label).attr("tabindex", "0").children(e.code.children(n))),
307
- quote: (t, ...n) => a(e.figure.class(P.quote).children(e.blockquote.children(e.p.children(s(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)))),
308
- link: (t, ...n) => a(e.a.class(P.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(s(n), t.external === !0 && ["\xA0", d(e, "open-in-new")])),
309
- br: a(e.br)
310
- }), F = n.Literals([
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
- ]), I = n.Literals([
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
- ]), L = n.Literals([
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
- ]), R = n.Literals([
374
+ ]), H = i.Literals([
344
375
  "auto",
345
376
  "light",
346
377
  "dark"
347
- ]), z = n.Literals([
378
+ ]), U = i.Literals([
348
379
  "paper",
349
380
  "ink",
350
381
  "accent"
351
- ]), B = n.Literals([
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
- ]), V = n.Literals([
390
+ ]), G = i.Literals([
360
391
  "strong",
361
392
  "muted",
362
393
  "accent"
363
- ]), H = n.Literals([
394
+ ]), K = i.Literals([
364
395
  "start",
365
396
  "end",
366
397
  "baseline",
367
398
  "stretch"
368
- ]), U = n.Literals([
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
- ]), W = n.Literals([
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
- ]), ce = /* @__PURE__ */ e({
457
- Align: () => H,
458
- Colour: () => L,
459
- Emphasis: () => V,
460
- Icon: () => u,
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: () => U,
464
- Role: () => B,
465
- Scheme: () => R,
466
- Space: () => I,
467
- Span: () => F,
468
- Tone: () => z,
469
- Travel: () => W,
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
- travel: () => J
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
- ...g(e),
435
+ ...le(e),
484
436
  ...ee(e),
485
- ...te(e),
486
- child: (t) => a(t(e))
487
- }), $ = (e, t) => c(e, (e, n) => t(Q(e), n));
488
- export { a as A, h as C, c as D, f as E, o as O, g as S, d as T, J as _, L as a, w as b, X as c, R as d, I as f, Y as g, W as h, H as i, s as k, U as l, z as m, Q as n, V as o, F as p, $ as r, Z as s, ce as t, B as u, x as v, u as w, b as x, C as y };
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, w 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, g as canvas, r as component, _ as travel } from "./Standard-BPpzr5SM.js";
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";