@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
package/dist/Ui-B9xQqqNT.js
DELETED
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-BMBA7GOT.js";
|
|
2
|
-
import { A as t, C as n, D as r, E as i, O as a, S as o, T as s, k as c, n as l, v as u, x as d, y as f } from "./Standard-BPpzr5SM.js";
|
|
3
|
-
import { Effect as p, Queue as m, Schema as h, Stream as g } from "effect";
|
|
4
|
-
import { Component as _, Mount as v } from "effect/ui";
|
|
5
|
-
var ee = {
|
|
6
|
-
arrow: "s-ui-arrow",
|
|
7
|
-
"dir-up": "s-ui-dir-up",
|
|
8
|
-
"dir-up-right": "s-ui-dir-up-right",
|
|
9
|
-
"dir-right": "s-ui-dir-right",
|
|
10
|
-
"dir-down-right": "s-ui-dir-down-right",
|
|
11
|
-
"dir-down": "s-ui-dir-down",
|
|
12
|
-
"dir-down-left": "s-ui-dir-down-left",
|
|
13
|
-
"dir-left": "s-ui-dir-left",
|
|
14
|
-
"dir-up-left": "s-ui-dir-up-left"
|
|
15
|
-
}, y = h.Literals([
|
|
16
|
-
"up",
|
|
17
|
-
"up-right",
|
|
18
|
-
"right",
|
|
19
|
-
"down-right",
|
|
20
|
-
"down",
|
|
21
|
-
"down-left",
|
|
22
|
-
"left",
|
|
23
|
-
"up-left"
|
|
24
|
-
]), b = (e, t, n) => e.span.class(ee.arrow, ee[`dir-${t}`]).attr("role", n === void 0 ? void 0 : "img").attr("aria-label", n).attr("aria-hidden", n === void 0 ? "true" : void 0), te = (e) => ({ arrow: (n, r) => t(b(e, n, r)) }), ne = { avatar: "s-ui-avatar" }, re = (e) => ({ avatar: (n) => t(e.span.class(ne.avatar).attr("role", "img").attr("aria-label", n.name).children(n.src === void 0 ? n.name.split(/\s+/).slice(0, 2).map((e) => e.slice(0, 1)).join("") : e.img.attr("src", n.src).attr("alt", ""))) }), x = {
|
|
25
|
-
control: "s-ui-control",
|
|
26
|
-
native: "s-ui-native",
|
|
27
|
-
legend: "s-ui-legend",
|
|
28
|
-
field: "s-ui-field",
|
|
29
|
-
lined: "s-ui-lined",
|
|
30
|
-
actions: "s-ui-actions",
|
|
31
|
-
action: "s-ui-action",
|
|
32
|
-
"action-primary": "s-ui-action-primary"
|
|
33
|
-
}, S = {
|
|
34
|
-
board: "s-ui-board",
|
|
35
|
-
numeric: "s-ui-numeric",
|
|
36
|
-
"board-row": "s-ui-board-row",
|
|
37
|
-
"board-dense": "s-ui-board-dense",
|
|
38
|
-
"board-wide": "s-ui-board-wide",
|
|
39
|
-
"board-narrow": "s-ui-board-narrow"
|
|
40
|
-
}, ie = (e) => ({ board: (n) => {
|
|
41
|
-
let r = (e) => [
|
|
42
|
-
n.columns[e]?.numeric === !0 && S.numeric,
|
|
43
|
-
n.columns[e]?.only === "wide" && S["board-wide"],
|
|
44
|
-
n.columns[e]?.only === "narrow" && S["board-narrow"]
|
|
45
|
-
];
|
|
46
|
-
return t(e.div.class(S.board, n.dense === !0 && S["board-dense"], n.tone !== void 0 && d(n.tone)).children(e.table.attr("aria-label", n.label).children(e.thead.children(e.tr.children(n.columns.map((t, n) => e.th.attr("scope", "col").class(x.legend, ...r(n)).children(t.title)))), e.tbody.children(n.rows.map(({ cells: t, onSelect: n }) => {
|
|
47
|
-
let i = e.tr.children(t.map((t, i) => e.td.class(...r(i)).children(n !== void 0 && i === 0 ? e.button.attr("type", "button").children(c([t])) : c([t]))));
|
|
48
|
-
return n === void 0 ? i : i.class(x.control, S["board-row"]).on("click", n);
|
|
49
|
-
})))));
|
|
50
|
-
} }), ae = { bullet: "s-ui-bullet" }, C = (e) => e === void 0 ? void 0 : `${u(e)} ${x.lined}`, w = (e, t, n) => {
|
|
51
|
-
let r = e.id(`s-ui-${n.name}`);
|
|
52
|
-
return e.div.class(t.group).attr("role", "radiogroup").children(n.items.map((a) => e.label.class(x.control, t.item).children(e.input.class(x.native).attr("type", "radio").attr("name", r).attr("value", a.value).checked(a.value === n.value).disabled(a.disabled === !0).on("change", () => n.onChange(a.value)), e.span.children(i(e, a.icon), a.label))));
|
|
53
|
-
}, T = (e, t, n) => e.div.class(x.actions, t).children(n.map((t) => {
|
|
54
|
-
let n = e.button.class(x.control, x.action, t.primary === !0 && x["action-primary"]).attr("type", t.onPress === void 0 ? "submit" : "button").disabled(t.disabled === !0);
|
|
55
|
-
return (t.onPress === void 0 ? n : n.on("click", t.onPress)).children(i(e, t.icon), t.label);
|
|
56
|
-
})), oe = (e) => ({ bullet: (n, r) => t(e.span.class(ae.bullet, C(n.colour)).children(r)) }), E = {
|
|
57
|
-
card: "s-ui-card",
|
|
58
|
-
"card-actions": "s-ui-card-actions"
|
|
59
|
-
}, se = (e) => ({ card: (n, ...r) => t(e.div.class(E.card, n.tone === void 0 ? void 0 : d(n.tone), n.gap === void 0 ? void 0 : f(n.gap), C(n.colour)).children(c(r), (n.actions ?? []).length > 0 && T(e, E["card-actions"], n.actions ?? []))) }), ce = { carousel: "s-ui-carousel" }, le = (e) => ({ carousel: (n, ...r) => t(e.ul.class(ce.carousel).attr("aria-label", n.label).attr("tabindex", "0").children(c(r).flatMap((t) => t === !1 || t == null ? [] : [e.li.children(t)]))) }), D = {
|
|
60
|
-
check: "s-ui-check",
|
|
61
|
-
box: "s-ui-box",
|
|
62
|
-
"check-field": "s-ui-check-field",
|
|
63
|
-
"check-error": "s-ui-check-error"
|
|
64
|
-
}, ue = (e) => ({ check: (n) => {
|
|
65
|
-
let r = n.error === void 0 || n.error === null || n.error === "" ? void 0 : n.error, i = e.id(`s-ui-check-${n.name}-error`), a = e.label.class(x.control, D.check).children(e.input.class(x.native).attr("type", "checkbox").attr("name", n.name).attr("aria-invalid", r === void 0 ? void 0 : "true").attr("aria-describedby", r === void 0 ? void 0 : i).checked(n.checked).disabled(n.disabled === !0).on("change", n.onChange(!n.checked)), e.span.class(D.box).attr("aria-hidden", "true"), e.span.children(n.label));
|
|
66
|
-
return t(r === void 0 ? a : e.div.class(D["check-field"]).children(a, e.p.class(D["check-error"]).attr("id", i).attr("role", "alert").children(r)));
|
|
67
|
-
} }), O = {
|
|
68
|
-
choice: "s-ui-choice",
|
|
69
|
-
segment: "s-ui-segment"
|
|
70
|
-
}, de = (e) => ({ choice: (n) => {
|
|
71
|
-
let r = e.id(`s-ui-${n.name}-label`);
|
|
72
|
-
return t(e.div.class(x.field).children(e.p.class(x.legend).attr("id", r).children(n.label), w(e, {
|
|
73
|
-
group: O.choice,
|
|
74
|
-
item: O.segment
|
|
75
|
-
}, n).attr("aria-labelledby", r)));
|
|
76
|
-
} }), k = {
|
|
77
|
-
modal: "s-ui-modal",
|
|
78
|
-
"modal-head": "s-ui-modal-head",
|
|
79
|
-
"modal-body": "s-ui-modal-body",
|
|
80
|
-
"modal-title": "s-ui-modal-title"
|
|
81
|
-
}, A = (e, t, n, r, i, s) => {
|
|
82
|
-
let l = e.id(`s-ui-${t}-title`);
|
|
83
|
-
return e.dialog.class(k.modal, ...n).attr("role", r.alert === !0 ? "alertdialog" : void 0).attr("aria-labelledby", l).attr("closedby", r.alert === !0 ? "closerequest" : "any").modal(r.open).on("cancel", r.close.onPress).children(e.div.class(k["modal-head"]).children(e.h2.class(k["modal-title"]).attr("id", l).children(r.title), a(o(e).button({
|
|
84
|
-
kind: "secondary",
|
|
85
|
-
icon: "close",
|
|
86
|
-
onClick: r.close.onPress
|
|
87
|
-
}, r.close.label))), e.div.class(k["modal-body"]).children(c(i)), s);
|
|
88
|
-
}, j = {
|
|
89
|
-
dialog: "s-ui-dialog",
|
|
90
|
-
"dialog-actions": "s-ui-dialog-actions"
|
|
91
|
-
}, fe = (e) => ({ dialog: (n, ...r) => {
|
|
92
|
-
let i = n.actions ?? [];
|
|
93
|
-
return t(A(e, "dialog", [j.dialog], n, r, i.length > 0 && T(e, j["dialog-actions"], i)));
|
|
94
|
-
} }), M = {
|
|
95
|
-
disclosure: "s-ui-disclosure",
|
|
96
|
-
summary: "s-ui-summary",
|
|
97
|
-
"disclosure-body": "s-ui-disclosure-body"
|
|
98
|
-
}, pe = (e) => ({ disclosure: (n, ...r) => t(e.details.class(M.disclosure).attr("name", n.name).attr("open", n.open === !0 ? "" : void 0).children(e.summary.class(x.control, M.summary).children(e.span.children(n.title), b(e, "down")), e.div.class(M["disclosure-body"]).children(c(r)))) }), N = {
|
|
99
|
-
flap: "s-ui-flap",
|
|
100
|
-
"flap-cell": "s-ui-flap-cell",
|
|
101
|
-
"flap-reel": "s-ui-flap-reel",
|
|
102
|
-
"g-0": "s-ui-g-0",
|
|
103
|
-
"g-1": "s-ui-g-1",
|
|
104
|
-
"g-2": "s-ui-g-2",
|
|
105
|
-
"g-3": "s-ui-g-3",
|
|
106
|
-
"g-4": "s-ui-g-4",
|
|
107
|
-
"g-5": "s-ui-g-5",
|
|
108
|
-
"g-6": "s-ui-g-6",
|
|
109
|
-
"g-7": "s-ui-g-7",
|
|
110
|
-
"g-8": "s-ui-g-8",
|
|
111
|
-
"g-9": "s-ui-g-9",
|
|
112
|
-
"g-10": "s-ui-g-10",
|
|
113
|
-
"g-11": "s-ui-g-11",
|
|
114
|
-
"g-12": "s-ui-g-12",
|
|
115
|
-
"g-13": "s-ui-g-13",
|
|
116
|
-
"g-14": "s-ui-g-14",
|
|
117
|
-
"g-15": "s-ui-g-15",
|
|
118
|
-
"g-16": "s-ui-g-16",
|
|
119
|
-
"g-17": "s-ui-g-17",
|
|
120
|
-
"g-18": "s-ui-g-18",
|
|
121
|
-
"g-19": "s-ui-g-19",
|
|
122
|
-
"g-20": "s-ui-g-20",
|
|
123
|
-
"g-21": "s-ui-g-21",
|
|
124
|
-
"g-22": "s-ui-g-22",
|
|
125
|
-
"g-23": "s-ui-g-23",
|
|
126
|
-
"g-24": "s-ui-g-24",
|
|
127
|
-
"g-25": "s-ui-g-25",
|
|
128
|
-
"g-26": "s-ui-g-26",
|
|
129
|
-
"g-27": "s-ui-g-27",
|
|
130
|
-
"g-28": "s-ui-g-28",
|
|
131
|
-
"g-29": "s-ui-g-29",
|
|
132
|
-
"g-30": "s-ui-g-30",
|
|
133
|
-
"g-31": "s-ui-g-31",
|
|
134
|
-
"g-32": "s-ui-g-32",
|
|
135
|
-
"g-33": "s-ui-g-33",
|
|
136
|
-
"g-34": "s-ui-g-34",
|
|
137
|
-
"g-35": "s-ui-g-35",
|
|
138
|
-
"g-36": "s-ui-g-36",
|
|
139
|
-
"g-37": "s-ui-g-37",
|
|
140
|
-
"g-38": "s-ui-g-38",
|
|
141
|
-
"g-39": "s-ui-g-39",
|
|
142
|
-
"g-40": "s-ui-g-40"
|
|
143
|
-
}, P = [
|
|
144
|
-
["\xA0", N["g-0"]],
|
|
145
|
-
["0", N["g-1"]],
|
|
146
|
-
["1", N["g-2"]],
|
|
147
|
-
["2", N["g-3"]],
|
|
148
|
-
["3", N["g-4"]],
|
|
149
|
-
["4", N["g-5"]],
|
|
150
|
-
["5", N["g-6"]],
|
|
151
|
-
["6", N["g-7"]],
|
|
152
|
-
["7", N["g-8"]],
|
|
153
|
-
["8", N["g-9"]],
|
|
154
|
-
["9", N["g-10"]],
|
|
155
|
-
["A", N["g-11"]],
|
|
156
|
-
["B", N["g-12"]],
|
|
157
|
-
["C", N["g-13"]],
|
|
158
|
-
["D", N["g-14"]],
|
|
159
|
-
["E", N["g-15"]],
|
|
160
|
-
["F", N["g-16"]],
|
|
161
|
-
["G", N["g-17"]],
|
|
162
|
-
["H", N["g-18"]],
|
|
163
|
-
["I", N["g-19"]],
|
|
164
|
-
["J", N["g-20"]],
|
|
165
|
-
["K", N["g-21"]],
|
|
166
|
-
["L", N["g-22"]],
|
|
167
|
-
["M", N["g-23"]],
|
|
168
|
-
["N", N["g-24"]],
|
|
169
|
-
["O", N["g-25"]],
|
|
170
|
-
["P", N["g-26"]],
|
|
171
|
-
["Q", N["g-27"]],
|
|
172
|
-
["R", N["g-28"]],
|
|
173
|
-
["S", N["g-29"]],
|
|
174
|
-
["T", N["g-30"]],
|
|
175
|
-
["U", N["g-31"]],
|
|
176
|
-
["V", N["g-32"]],
|
|
177
|
-
["W", N["g-33"]],
|
|
178
|
-
["X", N["g-34"]],
|
|
179
|
-
["Y", N["g-35"]],
|
|
180
|
-
["Z", N["g-36"]],
|
|
181
|
-
["/", N["g-37"]],
|
|
182
|
-
[":", N["g-38"]],
|
|
183
|
-
["-", N["g-39"]],
|
|
184
|
-
[".", N["g-40"]]
|
|
185
|
-
], me = (e) => ({ flap: (n) => t(e.span.class(N.flap).attr("role", "img").attr("aria-label", n).children([...n.toUpperCase().replaceAll(" ", "\xA0")].map((t) => e.span.class(N["flap-cell"], P.find(([e]) => e === t)?.[1] ?? P[0][1]).attr("aria-hidden", "true").children(e.span.class(N["flap-reel"]).children(P.map(([t]) => e.span.children(t))))))) }), F = {
|
|
186
|
-
item: "s-ui-item",
|
|
187
|
-
"item-body": "s-ui-item-body",
|
|
188
|
-
"item-actions": "s-ui-item-actions"
|
|
189
|
-
}, he = (e) => ({ item: (n, ...r) => {
|
|
190
|
-
let i = n.actions ?? [];
|
|
191
|
-
return t(e.div.class(F.item).children(e.div.class(F["item-body"]).children(c(r)), i.length > 0 && T(e, F["item-actions"], i)));
|
|
192
|
-
} }), ge = { key: "s-ui-key" }, _e = (e) => ({ key: (n) => t(e.kbd.class(ge.key).children(n)) }), ve = { "menu-item": "s-ui-menu-item" }, I = {
|
|
193
|
-
"popover-root": "s-ui-popover-root",
|
|
194
|
-
trigger: "s-ui-trigger",
|
|
195
|
-
popover: "s-ui-popover",
|
|
196
|
-
"popover-body": "s-ui-popover-body"
|
|
197
|
-
}, ye = (...e) => g.callback((t) => p.acquireRelease(p.sync(() => {
|
|
198
|
-
let n = new ResizeObserver(() => m.offerUnsafe(t, void 0));
|
|
199
|
-
return e.forEach((e) => n.observe(e)), n;
|
|
200
|
-
}), (e) => p.sync(() => e.disconnect()))), be = (e) => g.callback((t) => p.acquireRelease(p.sync(() => {
|
|
201
|
-
let n = new MutationObserver(() => m.offerUnsafe(t, void 0));
|
|
202
|
-
return n.observe(e, {
|
|
203
|
-
attributes: !0,
|
|
204
|
-
attributeFilter: ["class"],
|
|
205
|
-
subtree: !0
|
|
206
|
-
}), n;
|
|
207
|
-
}), (e) => p.sync(() => e.disconnect()))), xe = (e, t) => {
|
|
208
|
-
if (t.offsetHeight > 0) return t.offsetHeight;
|
|
209
|
-
e.setAttribute("data-measuring", "");
|
|
210
|
-
let n = t.offsetHeight;
|
|
211
|
-
return e.removeAttribute("data-measuring"), n;
|
|
212
|
-
}, Se = v.make("FacePopover", { args: {} }, (e) => g.mergeAll([
|
|
213
|
-
g.succeed(void 0),
|
|
214
|
-
ye(document.documentElement, document.body, e),
|
|
215
|
-
g.fromEffect(p.promise(() => document.fonts.ready)),
|
|
216
|
-
g.fromEventListener(window, "load", { once: !0 }),
|
|
217
|
-
g.fromEventListener(window, "scroll", {
|
|
218
|
-
capture: !0,
|
|
219
|
-
passive: !0
|
|
220
|
-
}),
|
|
221
|
-
g.fromEventListener(window, "resize", { passive: !0 }),
|
|
222
|
-
be(document.body),
|
|
223
|
-
g.fromEventListener(window, "transitionend", {
|
|
224
|
-
capture: !0,
|
|
225
|
-
passive: !0
|
|
226
|
-
}),
|
|
227
|
-
g.fromEventListener(window, "transitioncancel", {
|
|
228
|
-
capture: !0,
|
|
229
|
-
passive: !0
|
|
230
|
-
}),
|
|
231
|
-
g.fromEventListener(window, "animationend", {
|
|
232
|
-
capture: !0,
|
|
233
|
-
passive: !0
|
|
234
|
-
}),
|
|
235
|
-
g.fromEventListener(e, "pointerenter", {
|
|
236
|
-
capture: !0,
|
|
237
|
-
passive: !0
|
|
238
|
-
}),
|
|
239
|
-
g.fromEventListener(e, "focusin", { passive: !0 }),
|
|
240
|
-
g.fromEventListener(e, "toggle", { capture: !0 })
|
|
241
|
-
], { concurrency: "unbounded" }).pipe(g.runForEach(() => p.sync(() => {
|
|
242
|
-
let t = e.querySelector("button"), n = e.querySelector("[popover]");
|
|
243
|
-
if (t === null || n === null) return;
|
|
244
|
-
let r = t.getBoundingClientRect(), i = window.innerHeight - r.bottom, a = xe(e, n) + 8;
|
|
245
|
-
e.setAttribute("data-face", i < a && r.top > i ? "up" : "down");
|
|
246
|
-
})), p.as(_.noop))), L = (e, t, r) => {
|
|
247
|
-
let i = e.id(`s-ui-popover-${t.name}`);
|
|
248
|
-
return {
|
|
249
|
-
id: i,
|
|
250
|
-
content: e.div.class(I["popover-root"]).onMount(Se({})).children(e.button.class(n("secondary"), I.trigger).attr("type", "button").attr("popovertarget", i).attr("aria-haspopup", t.role).children(t.label, b(e, "down")), e.div.class(I.popover).attr("id", i).attr("popover", "auto").attr("role", t.role).children(r))
|
|
251
|
-
};
|
|
252
|
-
}, Ce = (e) => ({ popover: (n, ...r) => t(L(e, n, e.div.class(I["popover-body"]).children(c(r))).content) }), we = (e) => ({ menu: (n) => {
|
|
253
|
-
let r = e.id(`s-ui-popover-${n.name}`);
|
|
254
|
-
return t(L(e, {
|
|
255
|
-
name: n.name,
|
|
256
|
-
label: n.label,
|
|
257
|
-
role: "menu"
|
|
258
|
-
}, n.items.map((t) => e.button.class(x.control, ve["menu-item"]).attr("type", "button").attr("role", "menuitem").attr("popovertarget", r).attr("popovertargetaction", "hide").disabled(t.disabled === !0).on("click", t.onPress).children(i(e, t.icon), t.label))).content);
|
|
259
|
-
} }), R = {
|
|
260
|
-
shell: "s-ui-shell",
|
|
261
|
-
"nav-top": "s-ui-nav-top",
|
|
262
|
-
"shell-body": "s-ui-shell-body",
|
|
263
|
-
"nav-list": "s-ui-nav-list",
|
|
264
|
-
"nav-cell": "s-ui-nav-cell",
|
|
265
|
-
"nav-mark": "s-ui-nav-mark",
|
|
266
|
-
navigator: "s-ui-navigator",
|
|
267
|
-
"nav-sign": "s-ui-nav-sign",
|
|
268
|
-
"nav-back": "s-ui-nav-back",
|
|
269
|
-
"nav-bar": "s-ui-nav-bar",
|
|
270
|
-
"nav-tabs": "s-ui-nav-tabs",
|
|
271
|
-
"nav-name": "s-ui-nav-name",
|
|
272
|
-
"nav-fold": "s-ui-nav-fold",
|
|
273
|
-
"nav-way": "s-ui-nav-way",
|
|
274
|
-
"turn-45": "s-ui-turn-45",
|
|
275
|
-
"turn-90": "s-ui-turn-90",
|
|
276
|
-
"turn-135": "s-ui-turn-135",
|
|
277
|
-
"turn-180": "s-ui-turn-180",
|
|
278
|
-
"turn--45": "s-ui-turn--45",
|
|
279
|
-
"turn--90": "s-ui-turn--90",
|
|
280
|
-
"turn--135": "s-ui-turn--135",
|
|
281
|
-
"nav-rule": "s-ui-nav-rule",
|
|
282
|
-
"nav-pane": "s-ui-nav-pane",
|
|
283
|
-
"state-open": "s-ui-state-open",
|
|
284
|
-
"is-before": "s-ui-is-before",
|
|
285
|
-
"is-after": "s-ui-is-after",
|
|
286
|
-
"nav-places": "s-ui-nav-places",
|
|
287
|
-
"nav-rows": "s-ui-nav-rows",
|
|
288
|
-
"nav-place": "s-ui-nav-place",
|
|
289
|
-
"nav-lit": "s-ui-nav-lit",
|
|
290
|
-
"nav-here": "s-ui-nav-here",
|
|
291
|
-
"place-side": "s-ui-place-side",
|
|
292
|
-
"mode-sheet": "s-ui-mode-sheet",
|
|
293
|
-
"place-top": "s-ui-place-top",
|
|
294
|
-
"nav-brand": "s-ui-nav-brand"
|
|
295
|
-
}, z = h.Literals([
|
|
296
|
-
"side",
|
|
297
|
-
"top",
|
|
298
|
-
"bottom"
|
|
299
|
-
]), B = h.Literals([
|
|
300
|
-
"docked",
|
|
301
|
-
"sheet",
|
|
302
|
-
"menu"
|
|
303
|
-
]), Te = v.make("ShowCurrentPlace", { args: { at: h.String } }, (e, t, n) => g.runForEach(n, () => p.sync(() => {
|
|
304
|
-
let t = e.querySelector("[aria-current=\"page\"]"), n = t?.closest(`.${R["nav-list"]}`);
|
|
305
|
-
if (t === null || n == null) return;
|
|
306
|
-
let r = n.getBoundingClientRect(), i = t.getBoundingClientRect();
|
|
307
|
-
(i.top < r.top || i.bottom > r.bottom) && (n.scrollTop += i.top - r.top - (r.height - i.height) / 2), (i.left < r.left || i.right > r.right) && (n.scrollLeft += i.left - r.left - (r.width - i.width) / 2);
|
|
308
|
-
})).pipe(p.as(_.noop))), Ee = (e) => {
|
|
309
|
-
let t = e.includes("up"), n = e.includes("down");
|
|
310
|
-
return e.includes("back") ? t ? 45 : n ? -45 : 0 : e.includes("forward") ? t ? 135 : n ? -135 : 180 : t ? 90 : n ? -90 : 0;
|
|
311
|
-
}, De = v.make("PointTheWay", { args: { turn: h.Number } }, (e, t, n) => g.runForEach(n, ({ turn: t }) => p.sync(() => {
|
|
312
|
-
let n = Number.parseFloat(e.style.rotate);
|
|
313
|
-
e.style.rotate = `${Number.isNaN(n) ? t : n + ((t - n) % 360 + 540) % 360 - 180}deg`;
|
|
314
|
-
})).pipe(p.as(_.noop))), Oe = (e) => ({ navigator: (n, ...r) => {
|
|
315
|
-
let a = e.id("s-ui-navigator"), o = n.open === !0, { back: l, brand: u } = n, f = Ee(l?.travel ?? []), p = () => l !== void 0 && e.button.class(x.control, R["nav-back"]).attr("type", "button").attr("aria-label", l.label).disabled(l.disabled === !0).on("click", l.onPress).children(s(e, "arrow-back").class(R["nav-way"], f !== 0 && R[`turn-${f}`]).onMount(De({ turn: f }))), m = (t) => [e.span.class(R["nav-mark"], C(t.colour)).attr("aria-hidden", "true").children(t.src === void 0 ? t.icon !== void 0 && s(e, t.icon) : e.img.attr("src", t.src).attr("alt", "")), e.span.class(R["nav-name"]).children(t.name)], h = n.place ?? "side", g = h === "side" ? n.mode ?? "docked" : h === "top" ? "menu" : "sheet", _ = (t) => n.groups.map((r, i) => e.button.class(x.control, R["nav-cell"], C(r.colour)).attr("type", "button").attr("aria-controls", a).attr("aria-pressed", i === n.shown ? "true" : "false").on("click", o && i === n.shown ? n.toggle.onToggle(!1, t) : n.onShow(i, t)).on("pointerenter", ({ pointerType: e }) => t === "menu" && o && i !== n.shown && e === "mouse" ? n.onShow(i, t) : void 0).children(s(e, r.icon), e.span.class(R["nav-name"]).children(r.label)));
|
|
316
|
-
return t(e.div.class(R.shell, h !== "bottom" && R[`place-${h}`], g !== "docked" && R["mode-sheet"], o && R["state-open"]).children(e.nav.class(R.navigator, n.tone !== void 0 && d(n.tone)).attr("aria-label", n.label).onMount(Te({ at: `${n.groups.flatMap((e) => e.links).find((e) => e.current === !0)?.href ?? ""} ${o} ${n.shown}` })).children(e.div.class(R["nav-bar"]).children(p(), e.button.class(x.control, R["nav-fold"], u !== void 0 && R["nav-brand"]).attr("type", "button").attr("aria-label", n.toggle.label).attr("aria-controls", a).attr("aria-expanded", o ? "true" : "false").on("click", n.toggle.onToggle(!o, g)).children(u === void 0 ? s(e, "menu") : m(u)), u !== void 0 && e.div.class(R["nav-rule"]).attr("aria-hidden", "true"), _(g)), e.div.class(R["nav-tabs"]).children(_("sheet")), e.div.class(R["nav-pane"]).attr("id", a).children(n.groups.map((t, r) => {
|
|
317
|
-
let a = (t) => t.icon === void 0 ? t.label : e.span.children(i(e, t.icon), t.label), o = t.links.findIndex((e) => e.current === !0);
|
|
318
|
-
return e.div.class(R["nav-list"], r < n.shown && R["is-before"], r > n.shown && R["is-after"], C(t.colour)).children(e.div.class(R["nav-rows"]).children(e.ul.class(R["nav-places"]).attr("aria-label", t.label).children(t.links.map((t) => e.li.children(e.a.class(x.control, R["nav-place"]).attr("href", t.href).attr("aria-current", t.current === !0 ? "page" : void 0).children(a(t))))), o >= 0 && e.div.class(R["nav-here"]).attr("aria-hidden", "true").attr("data-at", String(o)).children(t.links.map((t) => e.div.class(R["nav-lit"]).children(a(t))))));
|
|
319
|
-
}))), (l !== void 0 || u !== void 0) && e.div.class(R["nav-top"], n.tone !== void 0 && d(n.tone)).children(p(), u !== void 0 && e.div.class(R["nav-sign"]).children(m(u))), e.div.class(R["shell-body"]).children(c(r))));
|
|
320
|
-
} }), V = {
|
|
321
|
-
notice: "s-ui-notice",
|
|
322
|
-
"level-caution": "s-ui-level-caution",
|
|
323
|
-
"notice-body": "s-ui-notice-body",
|
|
324
|
-
"notice-dismiss": "s-ui-notice-dismiss",
|
|
325
|
-
"notice-actions": "s-ui-notice-actions",
|
|
326
|
-
"notice-title": "s-ui-notice-title"
|
|
327
|
-
}, H = h.Literals(["info", "caution"]), ke = (e) => ({ notice: (n, ...r) => t(e.div.class(V.notice, n.level === "caution" && V["level-caution"]).attr("role", n.level === "caution" ? "alert" : "status").children(e.div.class(V["notice-body"]).children(e.p.class(V["notice-title"]).children(i(e, n.icon ?? (n.level === "caution" ? "warning" : "info")), n.title), c(r)), n.dismiss !== void 0 && T(e, V["notice-dismiss"], [{
|
|
328
|
-
icon: "close",
|
|
329
|
-
...n.dismiss
|
|
330
|
-
}]), (n.actions ?? []).length > 0 && T(e, V["notice-actions"], n.actions ?? []))) }), U = {
|
|
331
|
-
options: "s-ui-options",
|
|
332
|
-
option: "s-ui-option"
|
|
333
|
-
}, Ae = (e) => ({ options: (n) => {
|
|
334
|
-
let r = e.id(`s-ui-${n.name}-label`);
|
|
335
|
-
return t(e.div.class(x.field).children(e.p.class(x.legend).attr("id", r).children(n.label), w(e, {
|
|
336
|
-
group: U.options,
|
|
337
|
-
item: U.option
|
|
338
|
-
}, n).attr("aria-labelledby", r)));
|
|
339
|
-
} }), W = {
|
|
340
|
-
pager: "s-ui-pager",
|
|
341
|
-
"pager-link": "s-ui-pager-link",
|
|
342
|
-
"pager-next": "s-ui-pager-next",
|
|
343
|
-
"pager-title": "s-ui-pager-title"
|
|
344
|
-
}, je = (e) => ({ pager: (n) => {
|
|
345
|
-
let r = n.axis === "vertical", i = (t, n, r) => e.a.class(x.control, W["pager-link"], t === "next" && W["pager-next"]).attr("href", r.href).attr("rel", t).children(e.span.class(x.legend).children(r.label), e.span.class(W["pager-title"]).children(b(e, n), " ", r.title));
|
|
346
|
-
return t(e.nav.class(W.pager).attr("aria-label", n.label).children(n.previous !== void 0 && i("prev", r ? "up" : "left", n.previous), n.next !== void 0 && i("next", r ? "down" : "right", n.next)));
|
|
347
|
-
} }), G = {
|
|
348
|
-
pagination: "s-ui-pagination",
|
|
349
|
-
"page-item": "s-ui-page-item",
|
|
350
|
-
gap: "s-ui-gap"
|
|
351
|
-
}, Me = (e) => ({ pagination: (n) => {
|
|
352
|
-
let { count: r, page: i } = n, a = Array.from({ length: r }, (e, t) => t + 1).filter((e) => e === 1 || e === r || Math.abs(e - i) <= 1), o = (t, a, o) => e.button.class(x.control, G["page-item"]).attr("type", "button").attr("aria-label", o).attr("aria-current", o === void 0 && t === i ? "page" : void 0).disabled(t < 1 || t > r).on("click", n.onChange(t)).children(a);
|
|
353
|
-
return t(e.nav.attr("aria-label", n.label).children(e.ol.class(G.pagination).children(e.li.children(o(i - 1, b(e, "left"), n.previous)), a.flatMap((t, n) => [...n > 0 && t - (a[n - 1] ?? t) > 1 ? [e.li.class(G.gap).attr("aria-hidden", "true").children("…")] : [], e.li.children(o(t, String(t)))]), e.li.children(o(i + 1, b(e, "right"), n.next)))));
|
|
354
|
-
} }), Ne = {
|
|
355
|
-
progress: "s-ui-progress",
|
|
356
|
-
"progress-run": "s-ui-progress-run"
|
|
357
|
-
}, Pe = (e) => ({ progress: (n) => t(e.progress.class(Ne.progress, C(n.colour)).attr("aria-label", n.label).attr("max", "1").attr("value", n.value === void 0 ? void 0 : String(Math.min(1, Math.max(0, n.value))))) }), K = {
|
|
358
|
-
route: "s-ui-route",
|
|
359
|
-
stop: "s-ui-stop",
|
|
360
|
-
"state-passed": "s-ui-state-passed",
|
|
361
|
-
"state-current": "s-ui-state-current",
|
|
362
|
-
"stop-body": "s-ui-stop-body",
|
|
363
|
-
"stop-note": "s-ui-stop-note",
|
|
364
|
-
"axis-horizontal": "s-ui-axis-horizontal"
|
|
365
|
-
}, Fe = (e) => ({ route: (n) => {
|
|
366
|
-
let { at: r, onSelect: i } = n;
|
|
367
|
-
return t(e.ol.class(K.route, C(n.colour), n.axis === "horizontal" && K["axis-horizontal"]).attr("aria-label", n.label).children(n.stops.map((t, n) => {
|
|
368
|
-
let a = [e.span.children(t.name), t.note !== void 0 && e.span.class(K["stop-note"]).children(t.note)];
|
|
369
|
-
return e.li.class(K.stop, r !== void 0 && n < r && K["state-passed"], n === r && K["state-current"]).attr("aria-current", n === r ? "step" : void 0).children(i === void 0 ? e.div.class(K["stop-body"]).children(a) : e.button.class(x.control, K["stop-body"]).attr("type", "button").on("click", i(n)).children(a));
|
|
370
|
-
})));
|
|
371
|
-
} }), q = {
|
|
372
|
-
sheet: "s-ui-sheet",
|
|
373
|
-
"sheet-actions": "s-ui-sheet-actions",
|
|
374
|
-
"side-start": "s-ui-side-start"
|
|
375
|
-
}, Ie = (e) => ({ sheet: (n, ...r) => t(A(e, "sheet", [q.sheet, n.side === "start" && q["side-start"]], n, r, (n.actions ?? []).length > 0 && T(e, q["sheet-actions"], n.actions ?? []))) }), Le = {
|
|
376
|
-
skeleton: "s-ui-skeleton",
|
|
377
|
-
"skeleton-run": "s-ui-skeleton-run"
|
|
378
|
-
}, Re = (e) => ({ skeleton: (n) => t(e.div.class(Le.skeleton).attr("role", "status").attr("aria-label", n.label).children(Array.from({ length: n.lines ?? 3 }, () => e.span))) }), J = {
|
|
379
|
-
slider: "s-ui-slider",
|
|
380
|
-
"slider-head": "s-ui-slider-head"
|
|
381
|
-
}, ze = (e) => ({ slider: (n) => {
|
|
382
|
-
let r = e.id(`s-ui-${n.name}`);
|
|
383
|
-
return t(e.div.class(x.field).children(e.div.class(J["slider-head"]).children(e.label.class(x.legend).attr("for", r).children(n.label), e.span.children(n.shown ?? String(n.value))), e.input.class(J.slider).attr("id", r).attr("name", n.name).attr("type", "range").attr("min", String(n.min)).attr("max", String(n.max)).attr("step", String(n.step ?? 1)).disabled(n.disabled === !0).value(String(n.value)).on("input", ({ value: e }) => n.onInput(Number(e)))));
|
|
384
|
-
} }), Y = {
|
|
385
|
-
stepper: "s-ui-stepper",
|
|
386
|
-
step: "s-ui-step",
|
|
387
|
-
"stepper-value": "s-ui-stepper-value"
|
|
388
|
-
}, Be = (e) => ({ stepper: (n) => {
|
|
389
|
-
let r = n.step ?? 1, i = n.min ?? 0, a = n.max ?? 1e400, o = (t, r, o) => e.button.class(x.control, Y.step).attr("type", "button").attr("aria-label", o).disabled(n.disabled === !0 || t < i || t > a).on("click", n.onChange(t)).children(s(e, r));
|
|
390
|
-
return t(e.div.class(Y.stepper).attr("role", "group").attr("aria-label", n.label).children(o(n.value - r, "remove", n.less), e.output.class(Y["stepper-value"]).attr("aria-live", "polite").children(n.shown ?? String(n.value)), o(n.value + r, "add", n.more)));
|
|
391
|
-
} }), X = {
|
|
392
|
-
tabs: "s-ui-tabs",
|
|
393
|
-
tab: "s-ui-tab"
|
|
394
|
-
}, Ve = (e) => ({ tabs: (n) => t(w(e, {
|
|
395
|
-
group: X.tabs,
|
|
396
|
-
item: X.tab
|
|
397
|
-
}, n).attr("aria-label", n.label)) }), He = { tag: "s-ui-tag" }, Ue = (e) => ({ tag: (n, r) => t(e.span.class(He.tag, C(n.colour)).children(i(e, n.icon), r)) }), Z = {
|
|
398
|
-
tile: "s-ui-tile",
|
|
399
|
-
"tile-set": "s-ui-tile-set",
|
|
400
|
-
"tile-image": "s-ui-tile-image",
|
|
401
|
-
"tile-icon": "s-ui-tile-icon",
|
|
402
|
-
"tile-value": "s-ui-tile-value",
|
|
403
|
-
"tile-long": "s-ui-tile-long",
|
|
404
|
-
"tile-label": "s-ui-tile-label",
|
|
405
|
-
"tile-note": "s-ui-tile-note",
|
|
406
|
-
"tile-actions": "s-ui-tile-actions"
|
|
407
|
-
}, We = (e) => ({ tile: (n) => {
|
|
408
|
-
let r = n.actions ?? [], i = [n.tone !== void 0 && d(n.tone), C(n.colour)], a = [
|
|
409
|
-
x.control,
|
|
410
|
-
Z.tile,
|
|
411
|
-
...r.length === 0 ? i : []
|
|
412
|
-
], o = [
|
|
413
|
-
n.image !== void 0 && e.img.class(Z["tile-image"]).attr("src", n.image.src).attr("alt", n.image.alt).attr("loading", "lazy"),
|
|
414
|
-
n.icon !== void 0 && e.span.class(Z["tile-icon"]).children(s(e, n.icon)),
|
|
415
|
-
n.value !== void 0 && e.span.class(Z["tile-value"], n.value.length > 8 && Z["tile-long"]).children(n.value),
|
|
416
|
-
e.span.class(Z["tile-label"]).children(n.label),
|
|
417
|
-
n.note !== void 0 && e.span.class(Z["tile-note"]).children(n.note)
|
|
418
|
-
], c = e.button.class(...a).attr("type", "button").disabled(n.disabled === !0), l = n.href !== void 0 && n.disabled !== !0 ? e.a.class(...a).attr("href", n.href).children(o) : (n.onPress === void 0 ? c : c.on("click", n.onPress)).children(o);
|
|
419
|
-
return r.length === 0 ? t(l) : t(e.div.class(Z["tile-set"], ...i).children(l, T(e, Z["tile-actions"], r)));
|
|
420
|
-
} }), Q = {
|
|
421
|
-
toasts: "s-ui-toasts",
|
|
422
|
-
"toasts-list": "s-ui-toasts-list"
|
|
423
|
-
}, Ge = (e) => ({ toasts: (n, ...r) => t(e.div.class(Q.toasts).attr("role", "region").attr("aria-label", n.label).children(e.div.class(Q["toasts-list"]).children(c(r)))) }), Ke = {
|
|
424
|
-
toggle: "s-ui-toggle",
|
|
425
|
-
track: "s-ui-track"
|
|
426
|
-
}, qe = (e) => ({ toggle: (n) => t(e.button.class(x.control, Ke.toggle).attr("type", "button").attr("role", "switch").attr("aria-checked", n.on ? "true" : "false").disabled(n.disabled === !0).on("click", n.onChange(!n.on)).children(e.span.class(Ke.track).attr("aria-hidden", "true"), e.span.children(n.label))) }), Je = { trail: "s-ui-trail" }, Ye = (e) => ({ trail: (n) => t(e.nav.attr("aria-label", n.label).children(e.ol.class(Je.trail).children(n.steps.map((t) => e.li.children(e.a.attr("href", t.href).children(t.label))), e.li.children(e.span.attr("aria-current", "page").children(n.here))))) }), Xe = /* @__PURE__ */ e({
|
|
427
|
-
Direction: () => y,
|
|
428
|
-
Hold: () => B,
|
|
429
|
-
Level: () => H,
|
|
430
|
-
Place: () => z,
|
|
431
|
-
builders: () => $,
|
|
432
|
-
component: () => Ze
|
|
433
|
-
}), $ = (e) => ({
|
|
434
|
-
...l(e),
|
|
435
|
-
...oe(e),
|
|
436
|
-
...te(e),
|
|
437
|
-
...me(e),
|
|
438
|
-
...Ue(e),
|
|
439
|
-
...re(e),
|
|
440
|
-
..._e(e),
|
|
441
|
-
...We(e),
|
|
442
|
-
...Ve(e),
|
|
443
|
-
...de(e),
|
|
444
|
-
...Ae(e),
|
|
445
|
-
...qe(e),
|
|
446
|
-
...ue(e),
|
|
447
|
-
...ze(e),
|
|
448
|
-
...Be(e),
|
|
449
|
-
...we(e),
|
|
450
|
-
...se(e),
|
|
451
|
-
...he(e),
|
|
452
|
-
...ie(e),
|
|
453
|
-
...Fe(e),
|
|
454
|
-
...Pe(e),
|
|
455
|
-
...Re(e),
|
|
456
|
-
...le(e),
|
|
457
|
-
...pe(e),
|
|
458
|
-
...Ce(e),
|
|
459
|
-
...Ie(e),
|
|
460
|
-
...fe(e),
|
|
461
|
-
...ke(e),
|
|
462
|
-
...Ge(e),
|
|
463
|
-
...Oe(e),
|
|
464
|
-
...Ye(e),
|
|
465
|
-
...je(e),
|
|
466
|
-
...Me(e)
|
|
467
|
-
}), Ze = (e, t) => r(e, (e, n) => t($(e), n));
|
|
468
|
-
export { B as a, H as i, $ as n, z as o, Ze as r, y as s, Xe as t };
|