@peripheries/core 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.css +1 -1
- package/index.js +2484 -464
- package/package.json +1 -1
- package/types/core/Accordion/Accordion.d.ts +17 -0
- package/types/core/Card/Card.d.ts +13 -0
- package/types/core/Columns/Columns.d.ts +14 -0
- package/types/core/Disclosure/Disclosure.d.ts +11 -0
- package/types/core/Grid/Grid.d.ts +11 -0
- package/types/core/Repeat/Repeat.d.ts +14 -0
- package/types/core/actions/Button/Button.d.ts +21 -0
- package/types/core/actions/Chip/Chip.d.ts +15 -0
- package/types/core/actions/IconButton/IconButton.d.ts +14 -0
- package/types/core/actions/Link/Link.d.ts +11 -0
- package/types/core/actions/SegmentedControl/SegmentedControl.d.ts +19 -0
- package/types/core/actions/_shared/press.d.ts +18 -0
- package/types/core/display/DataTable/DataTable.d.ts +3 -0
- package/types/core/document/Contents/Contents.d.ts +1 -1
- package/types/core/events/EventCard/EventCard.d.ts +11 -0
- package/types/core/events/EventDetail/EventDetail.d.ts +29 -0
- package/types/core/events/EventLogForm/EventLogForm.d.ts +24 -0
- package/types/core/events/EventRespond/EventRespond.d.ts +13 -0
- package/types/core/events/EventSchedule/EventSchedule.d.ts +15 -0
- package/types/core/events/EventTimeline/EventTimeline.d.ts +21 -0
- package/types/core/events/_shared/event.d.ts +51 -0
- package/types/core/feedback/Badge/Badge.d.ts +10 -0
- package/types/core/feedback/EmptyState/EmptyState.d.ts +9 -0
- package/types/core/feedback/Notice/Notice.d.ts +12 -0
- package/types/core/feedback/Progress/Progress.d.ts +12 -0
- package/types/core/feedback/Skeleton/Skeleton.d.ts +10 -0
- package/types/core/feedback/Spinner/Spinner.d.ts +8 -0
- package/types/core/feedback/Tooltip/Tooltip.d.ts +10 -0
- package/types/core/forms/Checkbox/Checkbox.d.ts +8 -0
- package/types/core/forms/CheckboxGroup/CheckboxGroup.d.ts +11 -0
- package/types/core/forms/DateRange/DateRange.d.ts +15 -0
- package/types/core/forms/FileField/FileField.d.ts +28 -0
- package/types/core/forms/FormField/FormField.d.ts +15 -0
- package/types/core/forms/RadioGroup/RadioGroup.d.ts +9 -0
- package/types/core/forms/SearchField/SearchField.d.ts +10 -0
- package/types/core/forms/Select/Select.d.ts +10 -0
- package/types/core/forms/Slider/Slider.d.ts +11 -0
- package/types/core/forms/Switch/Switch.d.ts +7 -0
- package/types/core/forms/TextArea/TextArea.d.ts +13 -0
- package/types/core/forms/TextField/TextField.d.ts +21 -0
- package/types/core/forms/_shared/field.d.ts +32 -0
- package/types/core/page/ListRow/ListRow.d.ts +13 -0
- package/types/core/page/PageFrame/PageFrame.d.ts +9 -0
- package/types/core/page/PageHead/PageHead.d.ts +10 -0
- package/types/core/page/RuleSection/RuleSection.d.ts +11 -0
- package/types/core/page/UnderlinedAction/UnderlinedAction.d.ts +10 -0
- package/types/core/text/Avatar/Avatar.d.ts +12 -0
- package/types/core/text/Code/Code.d.ts +9 -0
- package/types/core/text/Heading/Heading.d.ts +11 -0
- package/types/core/text/Text/Text.d.ts +17 -0
- package/types/index.core.d.ts +47 -0
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Children as r, createContext as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useReducer as f, useRef as p, useState as m } from "react";
|
|
3
3
|
//#region src/core/_shared/props.ts
|
|
4
|
-
var
|
|
4
|
+
var h = /* @__PURE__ */ new Set([
|
|
5
5
|
"baseProps",
|
|
6
6
|
"data",
|
|
7
7
|
"status",
|
|
@@ -14,13 +14,13 @@ var p = /* @__PURE__ */ new Set([
|
|
|
14
14
|
"size",
|
|
15
15
|
"store"
|
|
16
16
|
]);
|
|
17
|
-
function
|
|
17
|
+
function g(e) {
|
|
18
18
|
let t = {};
|
|
19
|
-
for (let n in e)
|
|
19
|
+
for (let n in e) h.has(n) || (t[n] = e[n]);
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var _ = (...e) => e.filter(Boolean).join(" ") || void 0, v = (e) => e === void 0 ? void 0 : typeof e == "number" ? `${e}px` : e;
|
|
23
|
+
function y(e, t) {
|
|
24
24
|
let n = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
25
25
|
return Object.keys(n).length || t ? {
|
|
26
26
|
...n,
|
|
@@ -29,41 +29,41 @@ function _(e, t) {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/core/Box/Box.tsx
|
|
32
|
-
function
|
|
32
|
+
function b({ as: e, className: n, children: r, ...i }) {
|
|
33
33
|
return /* @__PURE__ */ t(e ?? "div", {
|
|
34
|
-
className:
|
|
35
|
-
...
|
|
34
|
+
className: _("core-box", n),
|
|
35
|
+
...g(i),
|
|
36
36
|
children: r
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/core/Center/Center.tsx
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */ t(
|
|
41
|
+
function x({ minHeight: e, className: n, style: r, children: i, ...a }) {
|
|
42
|
+
return /* @__PURE__ */ t(b, {
|
|
43
43
|
...a,
|
|
44
|
-
className:
|
|
45
|
-
style:
|
|
44
|
+
className: _("core-center", n),
|
|
45
|
+
style: y({ "--core-center-min-height": v(e) }, r),
|
|
46
46
|
children: i
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/core/Container/Container.tsx
|
|
51
|
-
function
|
|
52
|
-
return /* @__PURE__ */ t(
|
|
51
|
+
function S({ name: e, className: n, style: r, children: i, ...a }) {
|
|
52
|
+
return /* @__PURE__ */ t(b, {
|
|
53
53
|
...a,
|
|
54
|
-
className:
|
|
55
|
-
style:
|
|
54
|
+
className: _("core-container", n),
|
|
55
|
+
style: y({ "--core-container-name": e }, r),
|
|
56
56
|
children: i
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/core/Divider/Divider.tsx
|
|
61
|
-
function
|
|
61
|
+
function C({ orientation: e = "horizontal", weight: n = "subtle", spacing: r, className: i, style: a, ref: o, ...s }) {
|
|
62
62
|
let c = {
|
|
63
|
-
className:
|
|
63
|
+
className: _("core-divider", i),
|
|
64
64
|
"data-weight": n,
|
|
65
65
|
"data-orientation": e,
|
|
66
|
-
style:
|
|
66
|
+
style: y({ "--core-divider-spacing": v(r) }, a)
|
|
67
67
|
};
|
|
68
68
|
return e === "vertical" ? /* @__PURE__ */ t("span", {
|
|
69
69
|
role: "separator",
|
|
@@ -71,13 +71,13 @@ function x({ orientation: e = "horizontal", weight: n = "subtle", spacing: r, cl
|
|
|
71
71
|
...c
|
|
72
72
|
}) : /* @__PURE__ */ t("hr", {
|
|
73
73
|
ref: o,
|
|
74
|
-
...
|
|
74
|
+
...g(s),
|
|
75
75
|
...c
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/core/Hide/Hide.tsx
|
|
80
|
-
function
|
|
80
|
+
function w({ when: e, children: n, as: r = "span" }) {
|
|
81
81
|
return /* @__PURE__ */ t(r, {
|
|
82
82
|
className: "core-hide",
|
|
83
83
|
"data-when": e,
|
|
@@ -85,62 +85,1532 @@ function S({ when: e, children: n, as: r = "span" }) {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
|
-
//#region src/core/Inline/Inline.tsx
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */ t(
|
|
91
|
-
...l,
|
|
92
|
-
className:
|
|
93
|
-
"data-align": n,
|
|
94
|
-
"data-justify": r,
|
|
95
|
-
"data-wrap": i ? "true" : "false",
|
|
96
|
-
"data-stack-when": a,
|
|
97
|
-
style:
|
|
98
|
-
children: c
|
|
88
|
+
//#region src/core/Inline/Inline.tsx
|
|
89
|
+
function T({ gap: e, align: n = "center", justify: r = "start", wrap: i = !0, stackWhen: a, className: o, style: s, children: c, ...l }) {
|
|
90
|
+
return /* @__PURE__ */ t(b, {
|
|
91
|
+
...l,
|
|
92
|
+
className: _("core-inline", o),
|
|
93
|
+
"data-align": n,
|
|
94
|
+
"data-justify": r,
|
|
95
|
+
"data-wrap": i ? "true" : "false",
|
|
96
|
+
"data-stack-when": a,
|
|
97
|
+
style: y({ "--core-inline-gap": v(e) }, s),
|
|
98
|
+
children: c
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/core/Show/Show.tsx
|
|
103
|
+
function E({ when: e, children: n, as: r = "span" }) {
|
|
104
|
+
return /* @__PURE__ */ t(r, {
|
|
105
|
+
className: "core-show",
|
|
106
|
+
"data-when": e,
|
|
107
|
+
children: n
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/core/Spacer/Spacer.tsx
|
|
112
|
+
function D({ size: e, className: n, style: r }) {
|
|
113
|
+
return /* @__PURE__ */ t("span", {
|
|
114
|
+
"aria-hidden": !0,
|
|
115
|
+
className: _("core-spacer", n),
|
|
116
|
+
style: y({ "--core-spacer-size": v(e) }, r)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/core/Stack/Stack.tsx
|
|
121
|
+
function O({ gap: e, align: n = "stretch", justify: r = "start", className: i, style: a, children: o, ...s }) {
|
|
122
|
+
return /* @__PURE__ */ t(b, {
|
|
123
|
+
...s,
|
|
124
|
+
className: _("core-stack", i),
|
|
125
|
+
"data-align": n,
|
|
126
|
+
"data-justify": r,
|
|
127
|
+
style: y({ "--core-stack-gap": v(e) }, a),
|
|
128
|
+
children: o
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/core/actions/_shared/press.ts
|
|
133
|
+
var k = (e) => e.startsWith("/") && !e.startsWith("//") && !e.includes("\\"), A = (e) => /^#[A-Za-z][\w:.-]*$/.test(e);
|
|
134
|
+
function j({ href: e, action: t, input: n, actions: r, navigate: i, onClick: a }) {
|
|
135
|
+
let [o, s] = m(!1), c = r && t ? r[t] : void 0;
|
|
136
|
+
return {
|
|
137
|
+
busy: o,
|
|
138
|
+
onClick: (t) => {
|
|
139
|
+
if (a) return a(t);
|
|
140
|
+
if (c) {
|
|
141
|
+
t.preventDefault(), s(!0), c(n).finally(() => s(!1));
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
e && i && k(e) && t.button === 0 && !t.metaKey && !t.ctrlKey && !t.shiftKey && !t.altKey && (t.preventDefault(), i(e));
|
|
145
|
+
},
|
|
146
|
+
external: !!e && !k(e) && !A(e)
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/core/page/ListRow/ListRow.tsx
|
|
151
|
+
function M({ title: e, meta: r, leading: i, value: a, trailing: o, href: s, navigate: c, onClick: l, as: u = "div", className: d, ...f }) {
|
|
152
|
+
let p = j({
|
|
153
|
+
href: s,
|
|
154
|
+
navigate: c,
|
|
155
|
+
onClick: l
|
|
156
|
+
}), m = u, h = s ? /* @__PURE__ */ t("a", {
|
|
157
|
+
className: "core-list-row__title core-list-row__link",
|
|
158
|
+
href: s,
|
|
159
|
+
onClick: p.onClick,
|
|
160
|
+
...p.external ? {
|
|
161
|
+
target: "_blank",
|
|
162
|
+
rel: "noopener noreferrer"
|
|
163
|
+
} : {},
|
|
164
|
+
children: e
|
|
165
|
+
}) : /* @__PURE__ */ t("span", {
|
|
166
|
+
className: "core-list-row__title",
|
|
167
|
+
children: e
|
|
168
|
+
});
|
|
169
|
+
return /* @__PURE__ */ n(m, {
|
|
170
|
+
...g(f),
|
|
171
|
+
className: _("core-list-row", d),
|
|
172
|
+
children: [
|
|
173
|
+
i != null && /* @__PURE__ */ t("div", {
|
|
174
|
+
className: "core-list-row__leading",
|
|
175
|
+
children: i
|
|
176
|
+
}),
|
|
177
|
+
/* @__PURE__ */ n("div", {
|
|
178
|
+
className: "core-list-row__main",
|
|
179
|
+
children: [h, r != null && /* @__PURE__ */ t("span", {
|
|
180
|
+
className: "core-list-row__meta",
|
|
181
|
+
children: r
|
|
182
|
+
})]
|
|
183
|
+
}),
|
|
184
|
+
a != null && /* @__PURE__ */ t("div", {
|
|
185
|
+
className: "core-list-row__value",
|
|
186
|
+
children: a
|
|
187
|
+
}),
|
|
188
|
+
o != null && /* @__PURE__ */ t("div", {
|
|
189
|
+
className: "core-list-row__trailing",
|
|
190
|
+
children: o
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/core/page/PageFrame/PageFrame.tsx
|
|
197
|
+
function N({ header: e, children: r, measure: i = "page", className: a, ...o }) {
|
|
198
|
+
return /* @__PURE__ */ t("div", {
|
|
199
|
+
...g(o),
|
|
200
|
+
className: _("core-page-frame", a),
|
|
201
|
+
"data-measure": i,
|
|
202
|
+
children: /* @__PURE__ */ n("div", {
|
|
203
|
+
className: "core-page-frame__column",
|
|
204
|
+
children: [e != null && /* @__PURE__ */ t("header", {
|
|
205
|
+
className: "core-page-frame__header",
|
|
206
|
+
children: e
|
|
207
|
+
}), r]
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region src/core/_shared/warn-once.ts
|
|
213
|
+
var P = /* @__PURE__ */ new Set();
|
|
214
|
+
function F(e, t) {
|
|
215
|
+
P.has(e) || (P.add(e), typeof console < "u" && console.warn(t));
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/core/display/_shared/tone.ts
|
|
219
|
+
var I = [
|
|
220
|
+
"neutral",
|
|
221
|
+
"strong",
|
|
222
|
+
"accent",
|
|
223
|
+
"info",
|
|
224
|
+
"success",
|
|
225
|
+
"warning",
|
|
226
|
+
"danger"
|
|
227
|
+
], L = () => typeof process > "u" || !1;
|
|
228
|
+
function R(e, t = "neutral") {
|
|
229
|
+
return typeof e == "string" && I.includes(e) ? e : (typeof e == "string" && e && L() && F(`unknown-tone:${e}`, `[core] "${e}" is not a tone (${I.join(", ")}); using "${t}".`), t);
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/core/display/Eyebrow/Eyebrow.tsx
|
|
233
|
+
var z = [
|
|
234
|
+
"subtle",
|
|
235
|
+
"on-dark",
|
|
236
|
+
"inherit"
|
|
237
|
+
];
|
|
238
|
+
function B(e, t) {
|
|
239
|
+
return typeof e == "string" && (z.includes(e) || I.includes(e)) ? e : t;
|
|
240
|
+
}
|
|
241
|
+
function ee(e) {
|
|
242
|
+
return {
|
|
243
|
+
"data-tone": e,
|
|
244
|
+
toned: !z.includes(e)
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function V({ children: e, as: n = "span", tone: r, tabular: i = !1, className: a, style: o }) {
|
|
248
|
+
let { toned: s, ...c } = ee(B(r, "subtle"));
|
|
249
|
+
return /* @__PURE__ */ t(n, {
|
|
250
|
+
className: _("core-eyebrow", s && "core-toned", a),
|
|
251
|
+
...c,
|
|
252
|
+
"data-tabular": i ? "true" : void 0,
|
|
253
|
+
style: o,
|
|
254
|
+
children: e
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/core/page/PageHead/PageHead.tsx
|
|
259
|
+
function te({ title: e, eyebrow: r, intro: i, actions: a, className: o, ...s }) {
|
|
260
|
+
return /* @__PURE__ */ n("header", {
|
|
261
|
+
...g(s),
|
|
262
|
+
className: _("core-page-head", o),
|
|
263
|
+
children: [
|
|
264
|
+
r && /* @__PURE__ */ t(V, {
|
|
265
|
+
as: "p",
|
|
266
|
+
children: r
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ n("div", {
|
|
269
|
+
className: "core-page-head__row",
|
|
270
|
+
children: [/* @__PURE__ */ t("h1", {
|
|
271
|
+
className: "core-page-head__title",
|
|
272
|
+
children: e
|
|
273
|
+
}), a != null && /* @__PURE__ */ t("div", {
|
|
274
|
+
className: "core-page-head__actions",
|
|
275
|
+
children: a
|
|
276
|
+
})]
|
|
277
|
+
}),
|
|
278
|
+
i != null && /* @__PURE__ */ t("p", {
|
|
279
|
+
className: "core-page-head__intro",
|
|
280
|
+
children: i
|
|
281
|
+
})
|
|
282
|
+
]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region src/core/page/RuleSection/RuleSection.tsx
|
|
287
|
+
function ne({ label: e, actions: r, children: i, rail: a = !1, anchor: o, className: s, ...c }) {
|
|
288
|
+
return /* @__PURE__ */ t("section", {
|
|
289
|
+
...g(c),
|
|
290
|
+
id: o,
|
|
291
|
+
"aria-label": e,
|
|
292
|
+
className: _("core-rule-section", s),
|
|
293
|
+
"data-rail": a || void 0,
|
|
294
|
+
children: /* @__PURE__ */ n("div", {
|
|
295
|
+
className: "core-rule-section__grid",
|
|
296
|
+
children: [/* @__PURE__ */ n("div", {
|
|
297
|
+
className: "core-rule-section__head",
|
|
298
|
+
children: [e && /* @__PURE__ */ t(V, {
|
|
299
|
+
as: "p",
|
|
300
|
+
children: e
|
|
301
|
+
}), r != null && /* @__PURE__ */ t("div", {
|
|
302
|
+
className: "core-rule-section__actions",
|
|
303
|
+
children: r
|
|
304
|
+
})]
|
|
305
|
+
}), /* @__PURE__ */ t("div", {
|
|
306
|
+
className: "core-rule-section__body",
|
|
307
|
+
children: i
|
|
308
|
+
})]
|
|
309
|
+
})
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/core/page/UnderlinedAction/UnderlinedAction.tsx
|
|
314
|
+
function re({ label: r, children: i, arrow: a = !0, className: o, href: s, action: c, input: l, actions: u, navigate: d, onClick: f, ...p }) {
|
|
315
|
+
let m = j({
|
|
316
|
+
href: s,
|
|
317
|
+
action: c,
|
|
318
|
+
input: l,
|
|
319
|
+
actions: u,
|
|
320
|
+
navigate: d,
|
|
321
|
+
onClick: f
|
|
322
|
+
}), h = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
323
|
+
className: "core-underlined-action__label",
|
|
324
|
+
children: i ?? r
|
|
325
|
+
}), a && /* @__PURE__ */ t("svg", {
|
|
326
|
+
className: "core-underlined-action__arrow",
|
|
327
|
+
viewBox: "0 0 24 24",
|
|
328
|
+
fill: "none",
|
|
329
|
+
stroke: "currentColor",
|
|
330
|
+
strokeWidth: "1.6",
|
|
331
|
+
strokeLinecap: "round",
|
|
332
|
+
strokeLinejoin: "round",
|
|
333
|
+
"aria-hidden": "true",
|
|
334
|
+
focusable: "false",
|
|
335
|
+
children: /* @__PURE__ */ t("path", { d: "M5 12h14M13 6l6 6-6 6" })
|
|
336
|
+
})] }), v = {
|
|
337
|
+
...g(p),
|
|
338
|
+
className: _("core-underlined-action", o)
|
|
339
|
+
};
|
|
340
|
+
return s ? /* @__PURE__ */ t("a", {
|
|
341
|
+
...v,
|
|
342
|
+
href: s,
|
|
343
|
+
onClick: m.onClick,
|
|
344
|
+
...m.external ? {
|
|
345
|
+
target: "_blank",
|
|
346
|
+
rel: "noopener noreferrer"
|
|
347
|
+
} : {},
|
|
348
|
+
children: h
|
|
349
|
+
}) : /* @__PURE__ */ t("button", {
|
|
350
|
+
...v,
|
|
351
|
+
type: "button",
|
|
352
|
+
onClick: m.onClick,
|
|
353
|
+
disabled: m.busy,
|
|
354
|
+
children: h
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region src/core/text/Avatar/Avatar.tsx
|
|
359
|
+
var ie = (e = "") => e.trim().split(/\s+/).filter(Boolean).map((e) => e[0].toUpperCase()).filter((e, t, n) => t === 0 || t === n.length - 1).join("").slice(0, 2);
|
|
360
|
+
function ae({ name: e, initials: n, src: r, alt: i, size: a = "md", className: o, ...s }) {
|
|
361
|
+
let [c, l] = m(!1), u = i ?? e ?? "";
|
|
362
|
+
return /* @__PURE__ */ t("span", {
|
|
363
|
+
...g(s),
|
|
364
|
+
className: _("core-avatar", o),
|
|
365
|
+
"data-size": a,
|
|
366
|
+
role: "img",
|
|
367
|
+
"aria-label": u || void 0,
|
|
368
|
+
children: r && !c ? /* @__PURE__ */ t("img", {
|
|
369
|
+
src: r,
|
|
370
|
+
alt: "",
|
|
371
|
+
onError: () => l(!0)
|
|
372
|
+
}) : /* @__PURE__ */ t("span", {
|
|
373
|
+
"aria-hidden": "true",
|
|
374
|
+
children: n ?? ie(e)
|
|
375
|
+
})
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
//#endregion
|
|
379
|
+
//#region src/core/text/Code/Code.tsx
|
|
380
|
+
function oe({ code: e, children: n, block: r = !1, className: i, ...a }) {
|
|
381
|
+
let o = n ?? e;
|
|
382
|
+
return r ? /* @__PURE__ */ t("pre", {
|
|
383
|
+
...g(a),
|
|
384
|
+
className: _("core-code", i),
|
|
385
|
+
"data-block": "",
|
|
386
|
+
children: /* @__PURE__ */ t("code", { children: o })
|
|
387
|
+
}) : /* @__PURE__ */ t("code", {
|
|
388
|
+
...g(a),
|
|
389
|
+
className: _("core-code", i),
|
|
390
|
+
children: o
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
//#region src/core/text/Heading/Heading.tsx
|
|
395
|
+
var se = {
|
|
396
|
+
1: "lg",
|
|
397
|
+
2: "md",
|
|
398
|
+
3: "sm",
|
|
399
|
+
4: "xs",
|
|
400
|
+
5: "xs",
|
|
401
|
+
6: "xs"
|
|
402
|
+
};
|
|
403
|
+
function ce({ text: e, children: n, level: r = 2, size: i, anchor: a, className: o, ...s }) {
|
|
404
|
+
let c = Math.min(6, Math.max(1, Math.round(r))), l = `h${c}`;
|
|
405
|
+
return /* @__PURE__ */ t(l, {
|
|
406
|
+
...g(s),
|
|
407
|
+
id: a,
|
|
408
|
+
className: _("core-heading", o),
|
|
409
|
+
"data-size": i ?? se[c],
|
|
410
|
+
children: n ?? e
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
//#endregion
|
|
414
|
+
//#region src/core/text/Text/Text.tsx
|
|
415
|
+
var le = {
|
|
416
|
+
xs: "eyebrow",
|
|
417
|
+
sm: "body-sm",
|
|
418
|
+
md: "body",
|
|
419
|
+
lg: "title-sm",
|
|
420
|
+
xl: "title-md"
|
|
421
|
+
};
|
|
422
|
+
function ue({ text: e, children: n, as: r = "span", size: i = "md", weight: a = "normal", tone: o = "default", align: s = "start", truncate: c = !1, lines: l, className: u, ...d }) {
|
|
423
|
+
let f = r, p = l && l > 0 ? Math.min(6, Math.round(l)) : void 0;
|
|
424
|
+
return /* @__PURE__ */ t(f, {
|
|
425
|
+
...g(d),
|
|
426
|
+
className: _("core-text", u),
|
|
427
|
+
"data-role": le[i] ?? "body",
|
|
428
|
+
"data-weight": a,
|
|
429
|
+
"data-tone": o,
|
|
430
|
+
"data-align": s,
|
|
431
|
+
"data-truncate": c || void 0,
|
|
432
|
+
"data-lines": p,
|
|
433
|
+
children: n ?? e
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/core/forms/FormField/FormField.tsx
|
|
438
|
+
function H({ label: e, hint: r, error: i, required: a, htmlFor: o, hintId: s, errorId: c, as: u = "div", children: d, className: f, style: p }) {
|
|
439
|
+
let m = l().replace(/:/g, ""), h = s ?? (r ? `${o ?? m}-hint` : void 0), g = c ?? (i ? `${o ?? m}-error` : void 0), v = u, y = u === "fieldset" ? "legend" : "label";
|
|
440
|
+
return /* @__PURE__ */ n(v, {
|
|
441
|
+
className: _("core-field", f),
|
|
442
|
+
style: p,
|
|
443
|
+
"data-invalid": i ? "" : void 0,
|
|
444
|
+
children: [
|
|
445
|
+
e && /* @__PURE__ */ n(y, {
|
|
446
|
+
className: "core-field__label",
|
|
447
|
+
...y === "label" && o ? { htmlFor: o } : {},
|
|
448
|
+
children: [e, a && /* @__PURE__ */ n("span", {
|
|
449
|
+
className: "core-field__required",
|
|
450
|
+
"aria-hidden": "true",
|
|
451
|
+
children: [" ", "*"]
|
|
452
|
+
})]
|
|
453
|
+
}),
|
|
454
|
+
r && /* @__PURE__ */ t("p", {
|
|
455
|
+
className: "core-field__hint",
|
|
456
|
+
id: h,
|
|
457
|
+
children: r
|
|
458
|
+
}),
|
|
459
|
+
d,
|
|
460
|
+
i && /* @__PURE__ */ t("p", {
|
|
461
|
+
className: "core-field__error",
|
|
462
|
+
id: g,
|
|
463
|
+
children: i
|
|
464
|
+
})
|
|
465
|
+
]
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region src/core/forms/_shared/field.tsx
|
|
470
|
+
function U(e, t, n) {
|
|
471
|
+
let r = l(), i = e ?? `f${r.replace(/:/g, "")}`, a = t ? `${i}-hint` : void 0, o = n ? `${i}-error` : void 0;
|
|
472
|
+
return {
|
|
473
|
+
control: i,
|
|
474
|
+
hintId: a,
|
|
475
|
+
errorId: o,
|
|
476
|
+
aria: {
|
|
477
|
+
"aria-describedby": [a, o].filter(Boolean).join(" ") || void 0,
|
|
478
|
+
"aria-invalid": n ? !0 : void 0
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
function W(e, t) {
|
|
483
|
+
return (n) => {
|
|
484
|
+
e?.(n), t?.(n);
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
488
|
+
//#region src/core/forms/Checkbox/Checkbox.tsx
|
|
489
|
+
function de({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, children: l, hint: u, error: d, required: f, disabled: p, readOnly: h, className: g, style: v, ref: y }) {
|
|
490
|
+
let b = U(o, u, d), [x, S] = m(r ?? !1), C = e ?? x, w = W(i, a);
|
|
491
|
+
return /* @__PURE__ */ t(H, {
|
|
492
|
+
className: _("core-checkbox", g),
|
|
493
|
+
style: v,
|
|
494
|
+
hint: u,
|
|
495
|
+
error: d,
|
|
496
|
+
hintId: b.hintId,
|
|
497
|
+
errorId: b.errorId,
|
|
498
|
+
children: /* @__PURE__ */ n("label", {
|
|
499
|
+
className: "core-choices__option",
|
|
500
|
+
"data-disabled": p ? "" : void 0,
|
|
501
|
+
children: [/* @__PURE__ */ t("input", {
|
|
502
|
+
ref: y,
|
|
503
|
+
id: b.control,
|
|
504
|
+
type: "checkbox",
|
|
505
|
+
name: s,
|
|
506
|
+
checked: C,
|
|
507
|
+
required: f,
|
|
508
|
+
"aria-required": f || void 0,
|
|
509
|
+
disabled: p,
|
|
510
|
+
"aria-readonly": h || void 0,
|
|
511
|
+
onChange: (t) => {
|
|
512
|
+
h || (e === void 0 && S(t.target.checked), w(t.target.checked));
|
|
513
|
+
},
|
|
514
|
+
...b.aria
|
|
515
|
+
}), /* @__PURE__ */ n("span", { children: [l ?? c, f && /* @__PURE__ */ t("span", {
|
|
516
|
+
className: "core-field__required",
|
|
517
|
+
"aria-hidden": "true",
|
|
518
|
+
children: " *"
|
|
519
|
+
})] })]
|
|
520
|
+
})
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/core/forms/CheckboxGroup/CheckboxGroup.tsx
|
|
525
|
+
function fe({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, orientation: g = "vertical", min: v, max: y, className: b, style: x, ref: S }) {
|
|
526
|
+
let C = [v === void 0 ? "" : `at least ${v}`, y === void 0 ? "" : `at most ${y}`].filter(Boolean).join(", "), w = [u, C ? `Choose ${C}.` : ""].filter(Boolean).join(" ") || void 0, T = U(s, w, d), [E, D] = m(i ?? []), O = r ?? E, k = W(a, o), A = y !== void 0 && O.length >= y;
|
|
527
|
+
return /* @__PURE__ */ t(H, {
|
|
528
|
+
as: "fieldset",
|
|
529
|
+
className: _("core-choices", b),
|
|
530
|
+
style: x,
|
|
531
|
+
label: l,
|
|
532
|
+
hint: w,
|
|
533
|
+
error: d,
|
|
534
|
+
required: f,
|
|
535
|
+
hintId: T.hintId,
|
|
536
|
+
errorId: T.errorId,
|
|
537
|
+
children: /* @__PURE__ */ t("div", {
|
|
538
|
+
className: "core-choices__list",
|
|
539
|
+
"data-orientation": g,
|
|
540
|
+
role: "group",
|
|
541
|
+
...T.aria,
|
|
542
|
+
children: e.map((i, a) => {
|
|
543
|
+
let o = O.includes(i.value);
|
|
544
|
+
return /* @__PURE__ */ n("label", {
|
|
545
|
+
className: "core-choices__option",
|
|
546
|
+
"data-disabled": i.disabled || p ? "" : void 0,
|
|
547
|
+
children: [/* @__PURE__ */ t("input", {
|
|
548
|
+
ref: a === 0 ? S : void 0,
|
|
549
|
+
id: a === 0 ? T.control : void 0,
|
|
550
|
+
type: "checkbox",
|
|
551
|
+
name: c,
|
|
552
|
+
value: i.value,
|
|
553
|
+
checked: o,
|
|
554
|
+
disabled: i.disabled || p || !o && A || h && !o,
|
|
555
|
+
"aria-readonly": h || void 0,
|
|
556
|
+
onChange: () => {
|
|
557
|
+
if (h) return;
|
|
558
|
+
let t = e.map((e) => e.value).filter((e) => e === i.value ? !o : O.includes(e));
|
|
559
|
+
r === void 0 && D(t), k(t);
|
|
560
|
+
}
|
|
561
|
+
}), /* @__PURE__ */ t("span", { children: i.label })]
|
|
562
|
+
}, i.value);
|
|
563
|
+
})
|
|
564
|
+
})
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
//#endregion
|
|
568
|
+
//#region src/core/forms/DateRange/DateRange.tsx
|
|
569
|
+
function pe({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, required: d, disabled: f, readOnly: p, min: h, max: g, fromLabel: v = "From", toLabel: y = "To", className: b, style: x, ref: S }) {
|
|
570
|
+
let C = U(o, l, u), [w, T] = m(r ?? {
|
|
571
|
+
from: null,
|
|
572
|
+
to: null
|
|
573
|
+
}), E = e ?? w, D = W(i, a), O = (t, n) => {
|
|
574
|
+
if (p) return;
|
|
575
|
+
let r = {
|
|
576
|
+
...E,
|
|
577
|
+
[t]: n === "" ? null : n
|
|
578
|
+
};
|
|
579
|
+
e === void 0 && T(r), D(r);
|
|
580
|
+
}, k = {
|
|
581
|
+
disabled: f,
|
|
582
|
+
readOnly: p,
|
|
583
|
+
required: d,
|
|
584
|
+
"aria-required": d || void 0,
|
|
585
|
+
className: "core-input",
|
|
586
|
+
...C.aria
|
|
587
|
+
};
|
|
588
|
+
return /* @__PURE__ */ t(H, {
|
|
589
|
+
as: "fieldset",
|
|
590
|
+
className: _("core-date-range", b),
|
|
591
|
+
style: x,
|
|
592
|
+
label: c,
|
|
593
|
+
hint: l,
|
|
594
|
+
error: u,
|
|
595
|
+
required: d,
|
|
596
|
+
hintId: C.hintId,
|
|
597
|
+
errorId: C.errorId,
|
|
598
|
+
children: /* @__PURE__ */ n("div", {
|
|
599
|
+
className: "core-date-range__row",
|
|
600
|
+
children: [/* @__PURE__ */ n("label", {
|
|
601
|
+
className: "core-date-range__part",
|
|
602
|
+
children: [/* @__PURE__ */ t("span", {
|
|
603
|
+
className: "core-date-range__label",
|
|
604
|
+
children: v
|
|
605
|
+
}), /* @__PURE__ */ t("input", {
|
|
606
|
+
ref: S,
|
|
607
|
+
id: C.control,
|
|
608
|
+
type: "date",
|
|
609
|
+
name: s ? `${s}.from` : void 0,
|
|
610
|
+
value: E.from ?? "",
|
|
611
|
+
min: h,
|
|
612
|
+
max: E.to ?? g,
|
|
613
|
+
onChange: (e) => O("from", e.target.value),
|
|
614
|
+
...k
|
|
615
|
+
})]
|
|
616
|
+
}), /* @__PURE__ */ n("label", {
|
|
617
|
+
className: "core-date-range__part",
|
|
618
|
+
children: [/* @__PURE__ */ t("span", {
|
|
619
|
+
className: "core-date-range__label",
|
|
620
|
+
children: y
|
|
621
|
+
}), /* @__PURE__ */ t("input", {
|
|
622
|
+
type: "date",
|
|
623
|
+
name: s ? `${s}.to` : void 0,
|
|
624
|
+
value: E.to ?? "",
|
|
625
|
+
min: E.from ?? h,
|
|
626
|
+
max: g,
|
|
627
|
+
onChange: (e) => O("to", e.target.value),
|
|
628
|
+
...k
|
|
629
|
+
})]
|
|
630
|
+
})]
|
|
631
|
+
})
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/core/forms/FileField/FileField.tsx
|
|
636
|
+
function me(e) {
|
|
637
|
+
return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(+(e < 10240))} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
638
|
+
}
|
|
639
|
+
function he({ value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: h, readOnly: g, upload: v, accept: y, hash: b = !1, className: x, style: S, ref: C }) {
|
|
640
|
+
let w = U(s, u, d), [T, E] = m(i ?? null), D = r === void 0 ? T : r, O = W(a, o), [k, A] = m({
|
|
641
|
+
busy: !1,
|
|
642
|
+
dragging: !1
|
|
643
|
+
}), j = p(null), M = (e) => {
|
|
644
|
+
r === void 0 && E(e), O(e);
|
|
645
|
+
}, N = async (e) => {
|
|
646
|
+
if (e && v && !g && !h) {
|
|
647
|
+
A({
|
|
648
|
+
busy: !0,
|
|
649
|
+
dragging: !1
|
|
650
|
+
});
|
|
651
|
+
try {
|
|
652
|
+
let t = await v(e, { hash: b });
|
|
653
|
+
"error" in t ? A({
|
|
654
|
+
busy: !1,
|
|
655
|
+
failed: t.error,
|
|
656
|
+
dragging: !1
|
|
657
|
+
}) : (A({
|
|
658
|
+
busy: !1,
|
|
659
|
+
dragging: !1
|
|
660
|
+
}), M(t));
|
|
661
|
+
} catch {
|
|
662
|
+
A({
|
|
663
|
+
busy: !1,
|
|
664
|
+
failed: "That file couldn’t be stored. Try again.",
|
|
665
|
+
dragging: !1
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}, P = (e) => {
|
|
670
|
+
e.preventDefault(), N(e.dataTransfer.files?.[0]);
|
|
671
|
+
}, F = d ?? k.failed;
|
|
672
|
+
return /* @__PURE__ */ t(H, {
|
|
673
|
+
className: _("core-file-field", x),
|
|
674
|
+
style: S,
|
|
675
|
+
label: l,
|
|
676
|
+
hint: u,
|
|
677
|
+
error: F,
|
|
678
|
+
required: f,
|
|
679
|
+
htmlFor: w.control,
|
|
680
|
+
hintId: w.hintId,
|
|
681
|
+
errorId: F ? `${w.control}-error` : void 0,
|
|
682
|
+
children: /* @__PURE__ */ n("div", {
|
|
683
|
+
className: "core-file-field__box",
|
|
684
|
+
"data-dragging": k.dragging ? "" : void 0,
|
|
685
|
+
"data-busy": k.busy ? "" : void 0,
|
|
686
|
+
onDragOver: (e) => {
|
|
687
|
+
g || h || !v || (e.preventDefault(), k.dragging || A((e) => ({
|
|
688
|
+
...e,
|
|
689
|
+
dragging: !0
|
|
690
|
+
})));
|
|
691
|
+
},
|
|
692
|
+
onDragLeave: () => A((e) => ({
|
|
693
|
+
...e,
|
|
694
|
+
dragging: !1
|
|
695
|
+
})),
|
|
696
|
+
onDrop: P,
|
|
697
|
+
children: [D ? /* @__PURE__ */ n("div", {
|
|
698
|
+
className: "core-file-field__file",
|
|
699
|
+
children: [
|
|
700
|
+
/* @__PURE__ */ t("span", {
|
|
701
|
+
className: "core-file-field__name",
|
|
702
|
+
children: D.file.name
|
|
703
|
+
}),
|
|
704
|
+
/* @__PURE__ */ t("span", {
|
|
705
|
+
className: "core-file-field__size",
|
|
706
|
+
children: me(D.file.size)
|
|
707
|
+
}),
|
|
708
|
+
!g && !h && /* @__PURE__ */ t("button", {
|
|
709
|
+
type: "button",
|
|
710
|
+
className: "core-file-field__button",
|
|
711
|
+
onClick: () => M(null),
|
|
712
|
+
"aria-label": `Remove ${D.file.name}`,
|
|
713
|
+
children: "Remove"
|
|
714
|
+
})
|
|
715
|
+
]
|
|
716
|
+
}) : k.busy ? /* @__PURE__ */ t("span", {
|
|
717
|
+
className: "core-file-field__status",
|
|
718
|
+
role: "status",
|
|
719
|
+
children: "Uploading…"
|
|
720
|
+
}) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
|
|
721
|
+
ref: C,
|
|
722
|
+
id: w.control,
|
|
723
|
+
type: "button",
|
|
724
|
+
className: "core-file-field__button",
|
|
725
|
+
disabled: h || g || !v,
|
|
726
|
+
"aria-required": f || void 0,
|
|
727
|
+
"aria-describedby": [w.hintId, F ? `${w.control}-error` : void 0].filter(Boolean).join(" ") || void 0,
|
|
728
|
+
"aria-invalid": F ? !0 : void 0,
|
|
729
|
+
onClick: () => j.current?.click(),
|
|
730
|
+
children: "Choose file"
|
|
731
|
+
}), /* @__PURE__ */ t("span", {
|
|
732
|
+
className: "core-file-field__drop",
|
|
733
|
+
children: "or drop it here"
|
|
734
|
+
})] }), /* @__PURE__ */ t("input", {
|
|
735
|
+
ref: j,
|
|
736
|
+
type: "file",
|
|
737
|
+
name: c,
|
|
738
|
+
accept: y,
|
|
739
|
+
hidden: !0,
|
|
740
|
+
tabIndex: -1,
|
|
741
|
+
onChange: (e) => void N(e.target.files?.[0])
|
|
742
|
+
})]
|
|
743
|
+
})
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
//#endregion
|
|
747
|
+
//#region src/core/forms/RadioGroup/RadioGroup.tsx
|
|
748
|
+
function ge({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, orientation: g = "vertical", className: v, style: y, ref: b }) {
|
|
749
|
+
let x = U(s, u, d), [S, C] = m(i ?? null), w = r === void 0 ? S : r, T = W(a, o), E = c ?? x.control;
|
|
750
|
+
return /* @__PURE__ */ t(H, {
|
|
751
|
+
as: "fieldset",
|
|
752
|
+
className: _("core-choices", v),
|
|
753
|
+
style: y,
|
|
754
|
+
label: l,
|
|
755
|
+
hint: u,
|
|
756
|
+
error: d,
|
|
757
|
+
required: f,
|
|
758
|
+
hintId: x.hintId,
|
|
759
|
+
errorId: x.errorId,
|
|
760
|
+
children: /* @__PURE__ */ t("div", {
|
|
761
|
+
className: "core-choices__list",
|
|
762
|
+
"data-orientation": g,
|
|
763
|
+
role: "radiogroup",
|
|
764
|
+
"aria-required": f || void 0,
|
|
765
|
+
...x.aria,
|
|
766
|
+
children: e.map((e, i) => /* @__PURE__ */ n("label", {
|
|
767
|
+
className: "core-choices__option",
|
|
768
|
+
"data-disabled": e.disabled || p ? "" : void 0,
|
|
769
|
+
children: [/* @__PURE__ */ t("input", {
|
|
770
|
+
ref: i === 0 ? b : void 0,
|
|
771
|
+
id: i === 0 ? x.control : void 0,
|
|
772
|
+
type: "radio",
|
|
773
|
+
name: E,
|
|
774
|
+
value: e.value,
|
|
775
|
+
checked: w === e.value,
|
|
776
|
+
disabled: e.disabled || p || h && w !== e.value,
|
|
777
|
+
onChange: () => {
|
|
778
|
+
h || (r === void 0 && C(e.value), T(e.value));
|
|
779
|
+
}
|
|
780
|
+
}), /* @__PURE__ */ t("span", { children: e.label })]
|
|
781
|
+
}, e.value))
|
|
782
|
+
})
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
//#endregion
|
|
786
|
+
//#region src/core/forms/TextField/TextField.tsx
|
|
787
|
+
var _e = (e) => {
|
|
788
|
+
if (e.trim() === "") return null;
|
|
789
|
+
let t = Number(e);
|
|
790
|
+
return Number.isFinite(t) ? t : null;
|
|
791
|
+
};
|
|
792
|
+
function ve({ type: e = "text", value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: l, label: u, hint: d, error: f, required: p, disabled: h, readOnly: g, placeholder: v, inputMode: y, autoComplete: b, min: x, max: S, step: C, prefix: w, suffix: T, onEnter: E, onKeyDown: D, onBlur: O, className: k, style: A, ref: j }) {
|
|
793
|
+
let M = U(s, d, f), [N, P] = m(i), F = r === void 0 ? N : r, I = W(a, o), L = (e) => e == null ? "" : String(e), [R, z] = m(L(F));
|
|
794
|
+
c(() => {
|
|
795
|
+
e === "number" && _e(R) !== (F ?? null) && z(L(F));
|
|
796
|
+
}, [F]);
|
|
797
|
+
let B = /* @__PURE__ */ t("input", {
|
|
798
|
+
ref: j,
|
|
799
|
+
id: M.control,
|
|
800
|
+
name: l,
|
|
801
|
+
type: e === "number" ? "text" : e,
|
|
802
|
+
className: "core-input core-text-field__input",
|
|
803
|
+
value: e === "number" ? R : L(F),
|
|
804
|
+
onChange: (t) => {
|
|
805
|
+
let n = t.target.value, i = e === "number" ? _e(n) : n;
|
|
806
|
+
e === "number" && z(n), r === void 0 && P(i), I(i);
|
|
807
|
+
},
|
|
808
|
+
onKeyDown: (e) => {
|
|
809
|
+
D?.(e), !e.defaultPrevented && E && e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229 && E(e);
|
|
810
|
+
},
|
|
811
|
+
onBlur: O,
|
|
812
|
+
placeholder: v,
|
|
813
|
+
inputMode: y ?? (e === "number" ? "decimal" : void 0),
|
|
814
|
+
autoComplete: b,
|
|
815
|
+
min: e === "number" ? void 0 : x,
|
|
816
|
+
max: e === "number" ? void 0 : S,
|
|
817
|
+
step: e === "number" ? void 0 : C,
|
|
818
|
+
required: p,
|
|
819
|
+
"aria-required": p || void 0,
|
|
820
|
+
disabled: h,
|
|
821
|
+
readOnly: g,
|
|
822
|
+
...M.aria
|
|
823
|
+
}), ee = w || T ? /* @__PURE__ */ n("div", {
|
|
824
|
+
className: "core-text-field__affixed",
|
|
825
|
+
children: [
|
|
826
|
+
w && /* @__PURE__ */ t("span", {
|
|
827
|
+
className: "core-text-field__affix",
|
|
828
|
+
"aria-hidden": "true",
|
|
829
|
+
children: w
|
|
830
|
+
}),
|
|
831
|
+
B,
|
|
832
|
+
T && /* @__PURE__ */ t("span", {
|
|
833
|
+
className: "core-text-field__affix",
|
|
834
|
+
"aria-hidden": "true",
|
|
835
|
+
children: T
|
|
836
|
+
})
|
|
837
|
+
]
|
|
838
|
+
}) : B;
|
|
839
|
+
return /* @__PURE__ */ t(H, {
|
|
840
|
+
className: _("core-text-field", k),
|
|
841
|
+
style: A,
|
|
842
|
+
label: u,
|
|
843
|
+
hint: d,
|
|
844
|
+
error: f,
|
|
845
|
+
required: p,
|
|
846
|
+
htmlFor: M.control,
|
|
847
|
+
hintId: M.hintId,
|
|
848
|
+
errorId: M.errorId,
|
|
849
|
+
children: ee
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
//#endregion
|
|
853
|
+
//#region src/core/forms/SearchField/SearchField.tsx
|
|
854
|
+
function ye({ value: e, defaultValue: r, onChange: i, setValue: a, label: o = "Search", onSearch: s, size: c = "md", className: l, ...u }) {
|
|
855
|
+
let [d, f] = m(r ?? ""), p = e ?? d, h = (t) => {
|
|
856
|
+
e === void 0 && f(t), i?.(t), a?.(t);
|
|
857
|
+
};
|
|
858
|
+
return /* @__PURE__ */ n("div", {
|
|
859
|
+
className: _("core-search-field", l),
|
|
860
|
+
"data-filled": p ? "" : void 0,
|
|
861
|
+
"data-size": c,
|
|
862
|
+
children: [
|
|
863
|
+
/* @__PURE__ */ t(ve, {
|
|
864
|
+
...u,
|
|
865
|
+
label: o,
|
|
866
|
+
value: p,
|
|
867
|
+
onChange: (e) => h(typeof e == "string" ? e : ""),
|
|
868
|
+
onEnter: () => s?.(p),
|
|
869
|
+
inputMode: "search",
|
|
870
|
+
className: "core-search-field__field"
|
|
871
|
+
}),
|
|
872
|
+
/* @__PURE__ */ n("svg", {
|
|
873
|
+
className: "core-search-field__icon",
|
|
874
|
+
viewBox: "0 0 24 24",
|
|
875
|
+
fill: "none",
|
|
876
|
+
stroke: "currentColor",
|
|
877
|
+
strokeWidth: "1.6",
|
|
878
|
+
strokeLinecap: "round",
|
|
879
|
+
"aria-hidden": "true",
|
|
880
|
+
focusable: "false",
|
|
881
|
+
children: [/* @__PURE__ */ t("circle", {
|
|
882
|
+
cx: "11",
|
|
883
|
+
cy: "11",
|
|
884
|
+
r: "6.5"
|
|
885
|
+
}), /* @__PURE__ */ t("path", { d: "M16 16l4 4" })]
|
|
886
|
+
}),
|
|
887
|
+
p && !u.disabled && !u.readOnly && /* @__PURE__ */ t("button", {
|
|
888
|
+
type: "button",
|
|
889
|
+
className: "core-search-field__clear",
|
|
890
|
+
"aria-label": "Clear search",
|
|
891
|
+
onClick: () => h(""),
|
|
892
|
+
children: /* @__PURE__ */ t("svg", {
|
|
893
|
+
viewBox: "0 0 24 24",
|
|
894
|
+
fill: "none",
|
|
895
|
+
stroke: "currentColor",
|
|
896
|
+
strokeWidth: "1.6",
|
|
897
|
+
strokeLinecap: "round",
|
|
898
|
+
"aria-hidden": "true",
|
|
899
|
+
focusable: "false",
|
|
900
|
+
children: /* @__PURE__ */ t("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
901
|
+
})
|
|
902
|
+
})
|
|
903
|
+
]
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
//#endregion
|
|
907
|
+
//#region src/core/forms/Select/Select.tsx
|
|
908
|
+
function be({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, placeholder: g = "Choose…", className: v, style: y, ref: b }) {
|
|
909
|
+
let x = U(s, u, d), [S, C] = m(i ?? null), w = r === void 0 ? S : r, T = W(a, o);
|
|
910
|
+
return /* @__PURE__ */ t(H, {
|
|
911
|
+
className: _("core-select", v),
|
|
912
|
+
style: y,
|
|
913
|
+
label: l,
|
|
914
|
+
hint: u,
|
|
915
|
+
error: d,
|
|
916
|
+
required: f,
|
|
917
|
+
htmlFor: x.control,
|
|
918
|
+
hintId: x.hintId,
|
|
919
|
+
errorId: x.errorId,
|
|
920
|
+
children: /* @__PURE__ */ n("select", {
|
|
921
|
+
ref: b,
|
|
922
|
+
id: x.control,
|
|
923
|
+
name: c,
|
|
924
|
+
className: "core-input core-select__input",
|
|
925
|
+
value: w ?? "",
|
|
926
|
+
onChange: (e) => {
|
|
927
|
+
let t = e.target.value === "" ? null : e.target.value;
|
|
928
|
+
r === void 0 && C(t), T(t);
|
|
929
|
+
},
|
|
930
|
+
required: f,
|
|
931
|
+
"aria-required": f || void 0,
|
|
932
|
+
disabled: p || h,
|
|
933
|
+
"aria-readonly": h || void 0,
|
|
934
|
+
...x.aria,
|
|
935
|
+
children: [/* @__PURE__ */ t("option", {
|
|
936
|
+
value: "",
|
|
937
|
+
children: g
|
|
938
|
+
}), e.map((e) => /* @__PURE__ */ t("option", {
|
|
939
|
+
value: e.value,
|
|
940
|
+
disabled: e.disabled,
|
|
941
|
+
children: e.label
|
|
942
|
+
}, e.value))]
|
|
943
|
+
})
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
//#endregion
|
|
947
|
+
//#region src/core/forms/Slider/Slider.tsx
|
|
948
|
+
function xe({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, required: d, disabled: f, readOnly: p, min: h = 0, max: g = 100, step: v = 1, format: y = String, className: b, style: x, ref: S }) {
|
|
949
|
+
let C = U(o, l, u), [w, T] = m(r ?? h), E = e ?? w, D = W(i, a);
|
|
950
|
+
return /* @__PURE__ */ t(H, {
|
|
951
|
+
className: _("core-slider", b),
|
|
952
|
+
style: x,
|
|
953
|
+
label: c,
|
|
954
|
+
hint: l,
|
|
955
|
+
error: u,
|
|
956
|
+
required: d,
|
|
957
|
+
htmlFor: C.control,
|
|
958
|
+
hintId: C.hintId,
|
|
959
|
+
errorId: C.errorId,
|
|
960
|
+
children: /* @__PURE__ */ n("div", {
|
|
961
|
+
className: "core-slider__row",
|
|
962
|
+
children: [/* @__PURE__ */ t("input", {
|
|
963
|
+
ref: S,
|
|
964
|
+
id: C.control,
|
|
965
|
+
name: s,
|
|
966
|
+
type: "range",
|
|
967
|
+
className: "core-slider__input",
|
|
968
|
+
min: h,
|
|
969
|
+
max: g,
|
|
970
|
+
step: v,
|
|
971
|
+
value: E,
|
|
972
|
+
disabled: f,
|
|
973
|
+
"aria-readonly": p || void 0,
|
|
974
|
+
"aria-valuetext": y(E),
|
|
975
|
+
onChange: (t) => {
|
|
976
|
+
if (p) return;
|
|
977
|
+
let n = Number(t.target.value);
|
|
978
|
+
e === void 0 && T(n), D(n);
|
|
979
|
+
},
|
|
980
|
+
...C.aria
|
|
981
|
+
}), /* @__PURE__ */ t("output", {
|
|
982
|
+
className: "core-slider__value",
|
|
983
|
+
htmlFor: C.control,
|
|
984
|
+
children: y(E)
|
|
985
|
+
})]
|
|
986
|
+
})
|
|
987
|
+
});
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/core/forms/Switch/Switch.tsx
|
|
991
|
+
function Se({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, disabled: d, readOnly: f, className: p, style: h, ref: g }) {
|
|
992
|
+
let v = U(o, l, u), [y, b] = m(r ?? !1), x = e ?? y, S = W(i, a);
|
|
993
|
+
return /* @__PURE__ */ n("div", {
|
|
994
|
+
className: _("core-switch", p),
|
|
995
|
+
style: h,
|
|
996
|
+
children: [
|
|
997
|
+
/* @__PURE__ */ n("button", {
|
|
998
|
+
ref: g,
|
|
999
|
+
id: v.control,
|
|
1000
|
+
name: s,
|
|
1001
|
+
type: "button",
|
|
1002
|
+
role: "switch",
|
|
1003
|
+
"aria-checked": x,
|
|
1004
|
+
"aria-readonly": f || void 0,
|
|
1005
|
+
disabled: d,
|
|
1006
|
+
className: "core-switch__control",
|
|
1007
|
+
onClick: () => {
|
|
1008
|
+
f || (e === void 0 && b(!x), S(!x));
|
|
1009
|
+
},
|
|
1010
|
+
...v.aria,
|
|
1011
|
+
children: [/* @__PURE__ */ t("span", {
|
|
1012
|
+
className: "core-switch__track",
|
|
1013
|
+
"aria-hidden": "true",
|
|
1014
|
+
children: /* @__PURE__ */ t("span", { className: "core-switch__thumb" })
|
|
1015
|
+
}), /* @__PURE__ */ t("span", {
|
|
1016
|
+
className: "core-switch__label",
|
|
1017
|
+
children: c
|
|
1018
|
+
})]
|
|
1019
|
+
}),
|
|
1020
|
+
l && /* @__PURE__ */ t("p", {
|
|
1021
|
+
className: "core-field__hint",
|
|
1022
|
+
id: v.hintId,
|
|
1023
|
+
children: l
|
|
1024
|
+
}),
|
|
1025
|
+
u && /* @__PURE__ */ t("p", {
|
|
1026
|
+
className: "core-field__error",
|
|
1027
|
+
id: v.errorId,
|
|
1028
|
+
children: u
|
|
1029
|
+
})
|
|
1030
|
+
]
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
//#endregion
|
|
1034
|
+
//#region src/core/forms/TextArea/TextArea.tsx
|
|
1035
|
+
function Ce({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: d, required: f, disabled: h, readOnly: g, placeholder: v, rows: y = 3, autoGrow: b = !0, maxLength: x, onKeyDown: S, onBlur: C, className: w, style: T, ref: E }) {
|
|
1036
|
+
let D = U(o, l, d), [O, k] = m(r ?? ""), A = e ?? O, j = W(i, a), M = p(null);
|
|
1037
|
+
return u(() => {
|
|
1038
|
+
let e = M.current;
|
|
1039
|
+
b && e && (e.style.height = "auto", e.style.height = `${e.scrollHeight + 2}px`);
|
|
1040
|
+
}, [A, b]), /* @__PURE__ */ n(H, {
|
|
1041
|
+
className: _("core-text-area", w),
|
|
1042
|
+
style: T,
|
|
1043
|
+
label: c,
|
|
1044
|
+
hint: l,
|
|
1045
|
+
error: d,
|
|
1046
|
+
required: f,
|
|
1047
|
+
htmlFor: D.control,
|
|
1048
|
+
hintId: D.hintId,
|
|
1049
|
+
errorId: D.errorId,
|
|
1050
|
+
children: [/* @__PURE__ */ t("textarea", {
|
|
1051
|
+
ref: (e) => {
|
|
1052
|
+
M.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
|
|
1053
|
+
},
|
|
1054
|
+
id: D.control,
|
|
1055
|
+
name: s,
|
|
1056
|
+
className: "core-input core-text-area__input",
|
|
1057
|
+
rows: y,
|
|
1058
|
+
value: A,
|
|
1059
|
+
onChange: (t) => {
|
|
1060
|
+
e === void 0 && k(t.target.value), j(t.target.value);
|
|
1061
|
+
},
|
|
1062
|
+
onKeyDown: S,
|
|
1063
|
+
onBlur: C,
|
|
1064
|
+
placeholder: v,
|
|
1065
|
+
maxLength: x,
|
|
1066
|
+
required: f,
|
|
1067
|
+
"aria-required": f || void 0,
|
|
1068
|
+
disabled: h,
|
|
1069
|
+
readOnly: g,
|
|
1070
|
+
...D.aria
|
|
1071
|
+
}), x !== void 0 && /* @__PURE__ */ n("span", {
|
|
1072
|
+
className: "core-field__hint",
|
|
1073
|
+
"aria-live": "polite",
|
|
1074
|
+
children: [
|
|
1075
|
+
A.length,
|
|
1076
|
+
" / ",
|
|
1077
|
+
x
|
|
1078
|
+
]
|
|
1079
|
+
})]
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
//#region src/core/feedback/Badge/Badge.tsx
|
|
1084
|
+
function we({ label: e, children: n, tone: r, variant: i = "soft", className: a, ...o }) {
|
|
1085
|
+
return /* @__PURE__ */ t("span", {
|
|
1086
|
+
...g(o),
|
|
1087
|
+
className: _("core-badge", "core-toned", a),
|
|
1088
|
+
"data-tone": R(r),
|
|
1089
|
+
"data-variant": i,
|
|
1090
|
+
children: n ?? e
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region src/core/feedback/EmptyState/EmptyState.tsx
|
|
1095
|
+
function Te({ message: e, title: r, action: i, className: a, ...o }) {
|
|
1096
|
+
return /* @__PURE__ */ n("div", {
|
|
1097
|
+
...g(o),
|
|
1098
|
+
className: _("core-empty-state", a),
|
|
1099
|
+
role: "status",
|
|
1100
|
+
children: [
|
|
1101
|
+
r && /* @__PURE__ */ t("p", {
|
|
1102
|
+
className: "core-empty-state__title",
|
|
1103
|
+
children: r
|
|
1104
|
+
}),
|
|
1105
|
+
/* @__PURE__ */ t("p", {
|
|
1106
|
+
className: "core-empty-state__message",
|
|
1107
|
+
children: e
|
|
1108
|
+
}),
|
|
1109
|
+
i != null && /* @__PURE__ */ t("div", {
|
|
1110
|
+
className: "core-empty-state__action",
|
|
1111
|
+
children: i
|
|
1112
|
+
})
|
|
1113
|
+
]
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
//#endregion
|
|
1117
|
+
//#region src/core/feedback/Notice/Notice.tsx
|
|
1118
|
+
var Ee = {
|
|
1119
|
+
info: "M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",
|
|
1120
|
+
success: "M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",
|
|
1121
|
+
warning: "M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
|
|
1122
|
+
danger: "M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"
|
|
1123
|
+
};
|
|
1124
|
+
function De({ title: e, message: r, children: i, tone: a, action: o, onDismiss: s, className: c, ...l }) {
|
|
1125
|
+
let u = R(a, "info"), d = u === "warning" || u === "danger";
|
|
1126
|
+
return /* @__PURE__ */ n("div", {
|
|
1127
|
+
...g(l),
|
|
1128
|
+
role: d ? "alert" : "status",
|
|
1129
|
+
className: _("core-notice", "core-toned", c),
|
|
1130
|
+
"data-tone": u,
|
|
1131
|
+
children: [
|
|
1132
|
+
/* @__PURE__ */ t("svg", {
|
|
1133
|
+
className: "core-notice__icon",
|
|
1134
|
+
viewBox: "0 0 24 24",
|
|
1135
|
+
fill: "none",
|
|
1136
|
+
stroke: "currentColor",
|
|
1137
|
+
strokeWidth: "1.6",
|
|
1138
|
+
strokeLinecap: "round",
|
|
1139
|
+
strokeLinejoin: "round",
|
|
1140
|
+
"aria-hidden": "true",
|
|
1141
|
+
focusable: "false",
|
|
1142
|
+
children: /* @__PURE__ */ t("path", { d: Ee[u] ?? Ee.info })
|
|
1143
|
+
}),
|
|
1144
|
+
/* @__PURE__ */ n("div", {
|
|
1145
|
+
className: "core-notice__body",
|
|
1146
|
+
children: [e && /* @__PURE__ */ t("p", {
|
|
1147
|
+
className: "core-notice__title",
|
|
1148
|
+
children: e
|
|
1149
|
+
}), /* @__PURE__ */ t("div", {
|
|
1150
|
+
className: "core-notice__message",
|
|
1151
|
+
children: i ?? r
|
|
1152
|
+
})]
|
|
1153
|
+
}),
|
|
1154
|
+
o && /* @__PURE__ */ t("div", {
|
|
1155
|
+
className: "core-notice__action",
|
|
1156
|
+
children: o
|
|
1157
|
+
}),
|
|
1158
|
+
s && /* @__PURE__ */ t("button", {
|
|
1159
|
+
type: "button",
|
|
1160
|
+
className: "core-notice__dismiss",
|
|
1161
|
+
"aria-label": "Dismiss",
|
|
1162
|
+
onClick: s,
|
|
1163
|
+
children: /* @__PURE__ */ t("svg", {
|
|
1164
|
+
viewBox: "0 0 24 24",
|
|
1165
|
+
fill: "none",
|
|
1166
|
+
stroke: "currentColor",
|
|
1167
|
+
strokeWidth: "1.6",
|
|
1168
|
+
strokeLinecap: "round",
|
|
1169
|
+
"aria-hidden": "true",
|
|
1170
|
+
focusable: "false",
|
|
1171
|
+
children: /* @__PURE__ */ t("path", { d: "M6 6l12 12M18 6L6 18" })
|
|
1172
|
+
})
|
|
1173
|
+
})
|
|
1174
|
+
]
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
//#endregion
|
|
1178
|
+
//#region src/core/feedback/Progress/Progress.tsx
|
|
1179
|
+
function Oe({ value: e, max: r = 100, label: i, showValue: a = !1, tone: o, size: s = "md", className: c, style: l, ...u }) {
|
|
1180
|
+
let d = typeof e == "number" && Number.isFinite(e) && r > 0, f = d ? Math.max(0, Math.min(100, e / r * 100)) : 0;
|
|
1181
|
+
return /* @__PURE__ */ n("div", {
|
|
1182
|
+
...g(u),
|
|
1183
|
+
className: _("core-progress", "core-toned", c),
|
|
1184
|
+
"data-tone": R(o, "accent"),
|
|
1185
|
+
"data-size": s,
|
|
1186
|
+
style: l,
|
|
1187
|
+
children: [(i || a && d) && /* @__PURE__ */ n("div", {
|
|
1188
|
+
className: "core-progress__head",
|
|
1189
|
+
children: [i && /* @__PURE__ */ t("span", {
|
|
1190
|
+
className: "core-progress__label",
|
|
1191
|
+
children: i
|
|
1192
|
+
}), a && d && /* @__PURE__ */ n("span", {
|
|
1193
|
+
className: "core-progress__value",
|
|
1194
|
+
children: [Math.round(f), "%"]
|
|
1195
|
+
})]
|
|
1196
|
+
}), /* @__PURE__ */ t("div", {
|
|
1197
|
+
className: "core-progress__track",
|
|
1198
|
+
role: "progressbar",
|
|
1199
|
+
"aria-label": i,
|
|
1200
|
+
"aria-valuemin": 0,
|
|
1201
|
+
"aria-valuemax": d ? r : void 0,
|
|
1202
|
+
"aria-valuenow": d ? e : void 0,
|
|
1203
|
+
"data-indeterminate": d ? void 0 : "",
|
|
1204
|
+
style: y({ "--core-progress-fill": `${f}%` }),
|
|
1205
|
+
children: /* @__PURE__ */ t("div", { className: "core-progress__fill" })
|
|
1206
|
+
})]
|
|
1207
|
+
});
|
|
1208
|
+
}
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region src/core/feedback/Skeleton/Skeleton.tsx
|
|
1211
|
+
function ke({ shape: e = "text", lines: n = 3, width: r, height: i, className: a, style: o, ...s }) {
|
|
1212
|
+
let c = y({
|
|
1213
|
+
"--core-skeleton-w": v(r),
|
|
1214
|
+
"--core-skeleton-h": v(i)
|
|
1215
|
+
}, o);
|
|
1216
|
+
if (e !== "text") return /* @__PURE__ */ t("span", {
|
|
1217
|
+
...g(s),
|
|
1218
|
+
"aria-hidden": "true",
|
|
1219
|
+
className: _("core-skeleton", a),
|
|
1220
|
+
"data-shape": e,
|
|
1221
|
+
style: c
|
|
1222
|
+
});
|
|
1223
|
+
let l = Math.max(1, Math.min(12, Math.round(n)));
|
|
1224
|
+
return /* @__PURE__ */ t("span", {
|
|
1225
|
+
...g(s),
|
|
1226
|
+
"aria-hidden": "true",
|
|
1227
|
+
className: _("core-skeleton-lines", a),
|
|
1228
|
+
style: c,
|
|
1229
|
+
children: Array.from({ length: l }, (e, n) => /* @__PURE__ */ t("span", {
|
|
1230
|
+
className: "core-skeleton",
|
|
1231
|
+
"data-shape": "line",
|
|
1232
|
+
"data-last": n === l - 1 && l > 1 ? "" : void 0
|
|
1233
|
+
}, n))
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
//#endregion
|
|
1237
|
+
//#region src/core/feedback/Spinner/Spinner.tsx
|
|
1238
|
+
function Ae({ label: e = "Loading", size: n = "md", className: r, ...i }) {
|
|
1239
|
+
return /* @__PURE__ */ t("span", {
|
|
1240
|
+
...g(i),
|
|
1241
|
+
role: "status",
|
|
1242
|
+
"aria-label": e,
|
|
1243
|
+
className: _("core-spinner", r),
|
|
1244
|
+
"data-size": n
|
|
99
1245
|
});
|
|
100
1246
|
}
|
|
101
1247
|
//#endregion
|
|
102
|
-
//#region src/core/
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1248
|
+
//#region src/core/feedback/Tooltip/Tooltip.tsx
|
|
1249
|
+
function je({ content: e, text: r, children: i, side: a = "top", className: o, ...s }) {
|
|
1250
|
+
let [u, d] = m(!1), f = l();
|
|
1251
|
+
return c(() => {
|
|
1252
|
+
if (!u) return;
|
|
1253
|
+
let e = (e) => {
|
|
1254
|
+
e.key === "Escape" && d(!1);
|
|
1255
|
+
};
|
|
1256
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
1257
|
+
}, [u]), /* @__PURE__ */ n("span", {
|
|
1258
|
+
...g(s),
|
|
1259
|
+
className: _("core-tooltip", o),
|
|
1260
|
+
"aria-describedby": f,
|
|
1261
|
+
onMouseEnter: () => d(!0),
|
|
1262
|
+
onMouseLeave: () => d(!1),
|
|
1263
|
+
onFocus: () => d(!0),
|
|
1264
|
+
onBlur: () => d(!1),
|
|
1265
|
+
children: [i, /* @__PURE__ */ t("span", {
|
|
1266
|
+
id: f,
|
|
1267
|
+
role: "tooltip",
|
|
1268
|
+
className: "core-tooltip__bubble",
|
|
1269
|
+
"data-side": a,
|
|
1270
|
+
"data-open": u ? "" : void 0,
|
|
1271
|
+
children: e ?? r
|
|
1272
|
+
})]
|
|
108
1273
|
});
|
|
109
1274
|
}
|
|
110
1275
|
//#endregion
|
|
111
|
-
//#region src/core/
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
1276
|
+
//#region src/core/actions/Button/Button.tsx
|
|
1277
|
+
function Me({ children: r, label: i, variant: a = "primary", size: o = "md", tone: s = "neutral", iconLeft: c, iconRight: l, loading: u = !1, disabled: d = !1, type: f = "button", fullWidth: p = !1, className: m, href: h, action: v, input: y, actions: b, navigate: x, onClick: S, ...C }) {
|
|
1278
|
+
let w = j({
|
|
1279
|
+
href: h,
|
|
1280
|
+
action: v,
|
|
1281
|
+
input: y,
|
|
1282
|
+
actions: b,
|
|
1283
|
+
navigate: x,
|
|
1284
|
+
onClick: S
|
|
1285
|
+
}), T = u || w.busy, E = {
|
|
1286
|
+
...g(C),
|
|
1287
|
+
className: _("core-button", m),
|
|
1288
|
+
"data-variant": a,
|
|
1289
|
+
"data-size": o,
|
|
1290
|
+
"data-tone": s,
|
|
1291
|
+
"data-full": p || void 0,
|
|
1292
|
+
"data-busy": T || void 0
|
|
1293
|
+
}, D = /* @__PURE__ */ n(e, { children: [
|
|
1294
|
+
T ? /* @__PURE__ */ t("span", {
|
|
1295
|
+
className: "core-button__spinner",
|
|
1296
|
+
"aria-hidden": "true"
|
|
1297
|
+
}) : c,
|
|
1298
|
+
/* @__PURE__ */ t("span", {
|
|
1299
|
+
className: "core-button__label",
|
|
1300
|
+
children: r ?? i
|
|
1301
|
+
}),
|
|
1302
|
+
l
|
|
1303
|
+
] });
|
|
1304
|
+
return h && !d ? /* @__PURE__ */ t("a", {
|
|
1305
|
+
...E,
|
|
1306
|
+
href: h,
|
|
1307
|
+
onClick: w.onClick,
|
|
1308
|
+
"aria-busy": T || void 0,
|
|
1309
|
+
...w.external ? {
|
|
1310
|
+
target: "_blank",
|
|
1311
|
+
rel: "noopener noreferrer"
|
|
1312
|
+
} : {},
|
|
1313
|
+
children: D
|
|
1314
|
+
}) : /* @__PURE__ */ t("button", {
|
|
1315
|
+
...E,
|
|
1316
|
+
type: f,
|
|
1317
|
+
disabled: d || T,
|
|
1318
|
+
"aria-busy": T || void 0,
|
|
1319
|
+
onClick: w.onClick,
|
|
1320
|
+
children: D
|
|
117
1321
|
});
|
|
118
1322
|
}
|
|
119
1323
|
//#endregion
|
|
120
|
-
//#region src/core/
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
1324
|
+
//#region src/core/actions/Chip/Chip.tsx
|
|
1325
|
+
function Ne({ children: e, label: r, variant: i = "prompt", size: a = "md", selected: o, onToggle: s, iconLeft: c, disabled: l = !1, className: u, href: d, action: f, input: p, actions: m, navigate: h, onClick: v, ...y }) {
|
|
1326
|
+
let b = o !== void 0 || s !== void 0, x = j({
|
|
1327
|
+
href: d,
|
|
1328
|
+
action: f,
|
|
1329
|
+
input: p,
|
|
1330
|
+
actions: m,
|
|
1331
|
+
navigate: h,
|
|
1332
|
+
onClick: v ?? (s ? () => s(!o) : void 0)
|
|
1333
|
+
});
|
|
1334
|
+
return /* @__PURE__ */ n("button", {
|
|
1335
|
+
...g(y),
|
|
1336
|
+
type: "button",
|
|
1337
|
+
className: _("core-chip", u),
|
|
1338
|
+
"data-variant": i,
|
|
1339
|
+
"data-size": a,
|
|
1340
|
+
"aria-pressed": b ? !!o : void 0,
|
|
1341
|
+
disabled: l || x.busy,
|
|
1342
|
+
onClick: x.onClick,
|
|
1343
|
+
children: [c, /* @__PURE__ */ t("span", {
|
|
1344
|
+
className: "core-chip__label",
|
|
1345
|
+
children: e ?? r
|
|
1346
|
+
})]
|
|
129
1347
|
});
|
|
130
1348
|
}
|
|
131
1349
|
//#endregion
|
|
132
|
-
//#region src/core/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1350
|
+
//#region src/core/actions/IconButton/IconButton.tsx
|
|
1351
|
+
function Pe({ icon: e, children: n, label: r, size: i = "md", variant: a = "ghost", pressed: o, disabled: s = !1, className: c, href: l, action: u, input: d, actions: f, navigate: p, onClick: m, ...h }) {
|
|
1352
|
+
let v = j({
|
|
1353
|
+
href: l,
|
|
1354
|
+
action: u,
|
|
1355
|
+
input: d,
|
|
1356
|
+
actions: f,
|
|
1357
|
+
navigate: p,
|
|
1358
|
+
onClick: m
|
|
1359
|
+
}), y = {
|
|
1360
|
+
...g(h),
|
|
1361
|
+
className: _("core-icon-button", c),
|
|
1362
|
+
"data-size": i,
|
|
1363
|
+
"data-variant": a,
|
|
1364
|
+
"aria-label": r,
|
|
1365
|
+
title: r
|
|
1366
|
+
}, b = /* @__PURE__ */ t("span", {
|
|
1367
|
+
className: "core-icon-button__glyph",
|
|
1368
|
+
"aria-hidden": "true",
|
|
1369
|
+
children: e ?? n
|
|
1370
|
+
});
|
|
1371
|
+
return l && !s ? /* @__PURE__ */ t("a", {
|
|
1372
|
+
...y,
|
|
1373
|
+
href: l,
|
|
1374
|
+
onClick: v.onClick,
|
|
1375
|
+
...v.external ? {
|
|
1376
|
+
target: "_blank",
|
|
1377
|
+
rel: "noopener noreferrer"
|
|
1378
|
+
} : {},
|
|
1379
|
+
children: b
|
|
1380
|
+
}) : /* @__PURE__ */ t("button", {
|
|
1381
|
+
...y,
|
|
1382
|
+
type: "button",
|
|
1383
|
+
"aria-pressed": o,
|
|
1384
|
+
disabled: s || v.busy,
|
|
1385
|
+
onClick: v.onClick,
|
|
1386
|
+
children: b
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
//#endregion
|
|
1390
|
+
//#region src/core/actions/Link/Link.tsx
|
|
1391
|
+
function Fe({ href: r, children: i, label: a, variant: o = "default", className: s, navigate: c, onClick: l, ...u }) {
|
|
1392
|
+
let d = j({
|
|
1393
|
+
href: r,
|
|
1394
|
+
navigate: c,
|
|
1395
|
+
onClick: l
|
|
1396
|
+
});
|
|
1397
|
+
return k(r) || A(r) || /^(https?:|mailto:)/i.test(r) ? /* @__PURE__ */ n("a", {
|
|
1398
|
+
...g(u),
|
|
1399
|
+
className: _("core-link", s),
|
|
1400
|
+
"data-variant": o,
|
|
1401
|
+
href: r,
|
|
1402
|
+
onClick: d.onClick,
|
|
1403
|
+
...d.external ? {
|
|
1404
|
+
target: "_blank",
|
|
1405
|
+
rel: "noopener noreferrer"
|
|
1406
|
+
} : {},
|
|
1407
|
+
children: [i ?? a, d.external && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("svg", {
|
|
1408
|
+
className: "core-link__away",
|
|
1409
|
+
viewBox: "0 0 24 24",
|
|
1410
|
+
fill: "none",
|
|
1411
|
+
stroke: "currentColor",
|
|
1412
|
+
strokeWidth: "1.6",
|
|
1413
|
+
strokeLinecap: "round",
|
|
1414
|
+
strokeLinejoin: "round",
|
|
1415
|
+
"aria-hidden": "true",
|
|
1416
|
+
focusable: "false",
|
|
1417
|
+
children: /* @__PURE__ */ t("path", { d: "M7 17L17 7M8 7h9v9" })
|
|
1418
|
+
}), /* @__PURE__ */ t("span", {
|
|
1419
|
+
className: "core-link__note",
|
|
1420
|
+
children: " (opens in a new tab)"
|
|
1421
|
+
})] })]
|
|
1422
|
+
}) : /* @__PURE__ */ t("span", {
|
|
1423
|
+
className: _("core-link", s),
|
|
1424
|
+
children: i ?? a
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
//#endregion
|
|
1428
|
+
//#region src/core/actions/SegmentedControl/SegmentedControl.tsx
|
|
1429
|
+
function Ie({ options: e, value: n, defaultValue: r, onChange: i, label: a, fullWidth: o = !1, size: s = "md", className: c, setValue: u, ...d }) {
|
|
1430
|
+
let [f, h] = m(r ?? e[0]?.value), v = n ?? f, y = l(), b = p([]), x = (e) => {
|
|
1431
|
+
n === void 0 && h(e), i?.(e), u?.(e);
|
|
1432
|
+
}, S = e.map((e, t) => e.disabled ? -1 : t).filter((e) => e >= 0), C = (t, n) => {
|
|
1433
|
+
let r = t.key === "ArrowRight" || t.key === "ArrowDown" ? 1 : t.key === "ArrowLeft" || t.key === "ArrowUp" ? -1 : 0;
|
|
1434
|
+
if (!r || !S.length) return;
|
|
1435
|
+
t.preventDefault();
|
|
1436
|
+
let i = S.indexOf(n), a = S[(i + r + S.length) % S.length];
|
|
1437
|
+
b.current[a]?.focus(), x(e[a].value);
|
|
1438
|
+
};
|
|
1439
|
+
return /* @__PURE__ */ t("div", {
|
|
1440
|
+
...g(d),
|
|
1441
|
+
role: "radiogroup",
|
|
1442
|
+
"aria-label": a,
|
|
1443
|
+
className: _("core-segmented", c),
|
|
1444
|
+
"data-full": o || void 0,
|
|
1445
|
+
"data-size": s,
|
|
1446
|
+
children: e.map((e, n) => {
|
|
1447
|
+
let r = e.value === v;
|
|
1448
|
+
return /* @__PURE__ */ t("button", {
|
|
1449
|
+
ref: (e) => {
|
|
1450
|
+
b.current[n] = e;
|
|
1451
|
+
},
|
|
1452
|
+
type: "button",
|
|
1453
|
+
role: "radio",
|
|
1454
|
+
name: y,
|
|
1455
|
+
"aria-checked": r,
|
|
1456
|
+
tabIndex: r || v === void 0 && n === S[0] ? 0 : -1,
|
|
1457
|
+
disabled: e.disabled,
|
|
1458
|
+
className: "core-segmented__option",
|
|
1459
|
+
onClick: () => x(e.value),
|
|
1460
|
+
onKeyDown: (e) => C(e, n),
|
|
1461
|
+
children: e.label
|
|
1462
|
+
}, e.value);
|
|
1463
|
+
})
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/core/Accordion/Accordion.tsx
|
|
1468
|
+
function Le({ items: e = [], children: r, numbered: i = !1, single: a = !1, rules: o = "subtle", className: s, ...c }) {
|
|
1469
|
+
let u = l(), d = i ? "ol" : "ul";
|
|
1470
|
+
return /* @__PURE__ */ n("div", {
|
|
1471
|
+
...g(c),
|
|
1472
|
+
className: _("core-accordion", s),
|
|
1473
|
+
"data-rules": o,
|
|
1474
|
+
children: [e.length > 0 && /* @__PURE__ */ t(d, {
|
|
1475
|
+
className: "core-accordion__list",
|
|
1476
|
+
"data-numbered": i || void 0,
|
|
1477
|
+
children: e.map((e, r) => /* @__PURE__ */ t("li", {
|
|
1478
|
+
className: "core-accordion__item",
|
|
1479
|
+
children: /* @__PURE__ */ n("details", {
|
|
1480
|
+
className: "core-disclosure",
|
|
1481
|
+
name: a ? u : void 0,
|
|
1482
|
+
open: e.open || void 0,
|
|
1483
|
+
children: [/* @__PURE__ */ n("summary", {
|
|
1484
|
+
className: "core-disclosure__summary",
|
|
1485
|
+
children: [i && /* @__PURE__ */ t("span", {
|
|
1486
|
+
className: "core-accordion__number",
|
|
1487
|
+
children: r + 1
|
|
1488
|
+
}), e.question]
|
|
1489
|
+
}), /* @__PURE__ */ t("div", {
|
|
1490
|
+
className: "core-disclosure__content",
|
|
1491
|
+
children: e.answer
|
|
1492
|
+
})]
|
|
1493
|
+
})
|
|
1494
|
+
}, e.id ?? r))
|
|
1495
|
+
}), r]
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/core/Card/Card.tsx
|
|
1500
|
+
function Re({ media: e, header: r, body: i, footer: a, children: o, tone: s = "plain", className: c, ...l }) {
|
|
1501
|
+
return /* @__PURE__ */ n("article", {
|
|
1502
|
+
...g(l),
|
|
1503
|
+
className: _("core-card", c),
|
|
1504
|
+
"data-tone": s,
|
|
1505
|
+
children: [
|
|
1506
|
+
e != null && /* @__PURE__ */ t("div", {
|
|
1507
|
+
className: "core-card__media",
|
|
1508
|
+
children: e
|
|
1509
|
+
}),
|
|
1510
|
+
r != null && /* @__PURE__ */ t("header", {
|
|
1511
|
+
className: "core-card__header",
|
|
1512
|
+
children: r
|
|
1513
|
+
}),
|
|
1514
|
+
(i != null || o != null) && /* @__PURE__ */ n("div", {
|
|
1515
|
+
className: "core-card__body",
|
|
1516
|
+
children: [i, o]
|
|
1517
|
+
}),
|
|
1518
|
+
a != null && /* @__PURE__ */ t("footer", {
|
|
1519
|
+
className: "core-card__footer",
|
|
1520
|
+
children: a
|
|
1521
|
+
})
|
|
1522
|
+
]
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
//#endregion
|
|
1526
|
+
//#region src/core/Columns/Columns.tsx
|
|
1527
|
+
var ze = {
|
|
1528
|
+
"1:1": "1fr 1fr",
|
|
1529
|
+
"2:1": "2fr 1fr",
|
|
1530
|
+
"1:2": "1fr 2fr",
|
|
1531
|
+
"3:1": "3fr 1fr",
|
|
1532
|
+
"1:3": "1fr 3fr"
|
|
1533
|
+
};
|
|
1534
|
+
function Be({ start: e, end: r, children: i, ratio: a = "1:1", gap: o, stackBelow: s = "compact", className: c, ...l }) {
|
|
1535
|
+
return /* @__PURE__ */ n("div", {
|
|
1536
|
+
...g(l),
|
|
1537
|
+
className: _("core-columns", c),
|
|
1538
|
+
"data-stack": s,
|
|
1539
|
+
children: [/* @__PURE__ */ n("div", {
|
|
1540
|
+
className: "core-columns__grid",
|
|
1541
|
+
style: y({
|
|
1542
|
+
"--core-columns-template": ze[a] ?? ze["1:1"],
|
|
1543
|
+
"--core-columns-gap": v(o)
|
|
1544
|
+
}),
|
|
1545
|
+
children: [/* @__PURE__ */ t("div", {
|
|
1546
|
+
className: "core-columns__start",
|
|
1547
|
+
children: e
|
|
1548
|
+
}), /* @__PURE__ */ t("div", {
|
|
1549
|
+
className: "core-columns__end",
|
|
1550
|
+
children: r
|
|
1551
|
+
})]
|
|
1552
|
+
}), i]
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
var Ve = Be;
|
|
1556
|
+
//#endregion
|
|
1557
|
+
//#region src/core/Disclosure/Disclosure.tsx
|
|
1558
|
+
function He({ summary: e, content: r, children: i, open: a = !1, onToggle: o, className: s, ...c }) {
|
|
1559
|
+
return /* @__PURE__ */ n("details", {
|
|
1560
|
+
...g(c),
|
|
1561
|
+
className: _("core-disclosure", s),
|
|
1562
|
+
open: a || void 0,
|
|
1563
|
+
onToggle: o ? (e) => o(e.currentTarget.open) : void 0,
|
|
1564
|
+
children: [/* @__PURE__ */ t("summary", {
|
|
1565
|
+
className: "core-disclosure__summary",
|
|
1566
|
+
children: e
|
|
1567
|
+
}), /* @__PURE__ */ n("div", {
|
|
1568
|
+
className: "core-disclosure__content",
|
|
1569
|
+
children: [r, i]
|
|
1570
|
+
})]
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
//#endregion
|
|
1574
|
+
//#region src/core/Grid/Grid.tsx
|
|
1575
|
+
function Ue({ items: e, children: n, min: i, columns: a, gap: o, className: s, style: c, ...l }) {
|
|
1576
|
+
let u = [...r.toArray(e), ...r.toArray(n)];
|
|
1577
|
+
return /* @__PURE__ */ t("div", {
|
|
1578
|
+
...g(l),
|
|
1579
|
+
className: _("core-grid", s),
|
|
1580
|
+
"data-capped": a && a > 0 ? "" : void 0,
|
|
1581
|
+
style: y({
|
|
1582
|
+
"--core-grid-min": v(i),
|
|
1583
|
+
"--core-grid-gap": v(o),
|
|
1584
|
+
"--core-grid-cols": a && a > 0 ? String(Math.round(a)) : void 0
|
|
1585
|
+
}, c),
|
|
1586
|
+
children: u
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
//#endregion
|
|
1590
|
+
//#region src/core/Repeat/Repeat.tsx
|
|
1591
|
+
function We({ item: e, each: n, as: i, layout: a = "stack", gap: o, min: s, empty: c, className: l, style: u, ...d }) {
|
|
1592
|
+
let f = r.toArray(e);
|
|
1593
|
+
return f.length ? /* @__PURE__ */ t("div", {
|
|
1594
|
+
...g(d),
|
|
1595
|
+
className: _("core-repeat", l),
|
|
1596
|
+
"data-layout": a,
|
|
1597
|
+
style: y({
|
|
1598
|
+
"--core-repeat-gap": v(o),
|
|
1599
|
+
"--core-repeat-min": v(s)
|
|
1600
|
+
}, u),
|
|
1601
|
+
children: f
|
|
1602
|
+
}) : c ? /* @__PURE__ */ t("p", {
|
|
1603
|
+
className: "core-repeat__empty",
|
|
1604
|
+
children: c
|
|
1605
|
+
}) : null;
|
|
136
1606
|
}
|
|
137
1607
|
//#endregion
|
|
138
1608
|
//#region src/core/document/profiles/profile.ts
|
|
139
|
-
var
|
|
1609
|
+
var Ge = [
|
|
140
1610
|
"page-x-of-y",
|
|
141
1611
|
"page-number",
|
|
142
1612
|
"page-count"
|
|
143
|
-
],
|
|
1613
|
+
], Ke = {
|
|
144
1614
|
display: {
|
|
145
1615
|
size: 46,
|
|
146
1616
|
lineHeight: .98,
|
|
@@ -196,7 +1666,7 @@ var O = [
|
|
|
196
1666
|
tracking: "0.14em",
|
|
197
1667
|
uppercase: !0
|
|
198
1668
|
}
|
|
199
|
-
},
|
|
1669
|
+
}, qe = {
|
|
200
1670
|
full: "var(--color-text)",
|
|
201
1671
|
muted: "var(--color-text-muted)",
|
|
202
1672
|
subtle: "var(--color-text-subtle)",
|
|
@@ -204,7 +1674,7 @@ var O = [
|
|
|
204
1674
|
accent: "var(--color-accent)",
|
|
205
1675
|
accentText: "var(--color-link)",
|
|
206
1676
|
sunken: "var(--color-surface-sunken)"
|
|
207
|
-
},
|
|
1677
|
+
}, Je = [
|
|
208
1678
|
"cover",
|
|
209
1679
|
"what-this-is",
|
|
210
1680
|
"told-us",
|
|
@@ -213,7 +1683,7 @@ var O = [
|
|
|
213
1683
|
"talk-it-through",
|
|
214
1684
|
"notes",
|
|
215
1685
|
"footer"
|
|
216
|
-
],
|
|
1686
|
+
], Ye = [
|
|
217
1687
|
{
|
|
218
1688
|
id: "workbook",
|
|
219
1689
|
label: "Workbook",
|
|
@@ -230,14 +1700,14 @@ var O = [
|
|
|
230
1700
|
measure: "6.85in",
|
|
231
1701
|
bodyMeasureCh: 64,
|
|
232
1702
|
rail: { placement: "strip" },
|
|
233
|
-
ink:
|
|
1703
|
+
ink: qe,
|
|
234
1704
|
rules: {
|
|
235
1705
|
head: "2px",
|
|
236
1706
|
structural: "1px",
|
|
237
1707
|
row: "1px",
|
|
238
1708
|
hairline: "1px"
|
|
239
1709
|
},
|
|
240
|
-
type:
|
|
1710
|
+
type: Ke,
|
|
241
1711
|
floorPx: 11,
|
|
242
1712
|
depth: {
|
|
243
1713
|
max: 1,
|
|
@@ -251,7 +1721,7 @@ var O = [
|
|
|
251
1721
|
right: "page-x-of-y"
|
|
252
1722
|
} },
|
|
253
1723
|
sections: {
|
|
254
|
-
known:
|
|
1724
|
+
known: Je,
|
|
255
1725
|
required: ["next-steps", "talk-it-through"]
|
|
256
1726
|
}
|
|
257
1727
|
},
|
|
@@ -262,7 +1732,7 @@ var O = [
|
|
|
262
1732
|
regions: { "page-footer": { right: "page-x-of-y" } },
|
|
263
1733
|
requiredBindings: [],
|
|
264
1734
|
sections: {
|
|
265
|
-
known:
|
|
1735
|
+
known: Je,
|
|
266
1736
|
required: ["next-steps", "talk-it-through"]
|
|
267
1737
|
}
|
|
268
1738
|
},
|
|
@@ -302,9 +1772,9 @@ var O = [
|
|
|
302
1772
|
hairline: "0.25pt"
|
|
303
1773
|
},
|
|
304
1774
|
type: {
|
|
305
|
-
...
|
|
1775
|
+
...Ke,
|
|
306
1776
|
eyebrow: {
|
|
307
|
-
...
|
|
1777
|
+
...Ke.eyebrow,
|
|
308
1778
|
tracking: "0.08em"
|
|
309
1779
|
}
|
|
310
1780
|
},
|
|
@@ -325,19 +1795,19 @@ var O = [
|
|
|
325
1795
|
requiredBindings: ["execution-state"],
|
|
326
1796
|
sections: { required: [] }
|
|
327
1797
|
}
|
|
328
|
-
],
|
|
329
|
-
function
|
|
330
|
-
|
|
1798
|
+
], G = /* @__PURE__ */ new Map();
|
|
1799
|
+
function Xe(e) {
|
|
1800
|
+
G.set(e.id, e);
|
|
331
1801
|
}
|
|
332
|
-
for (let e of
|
|
333
|
-
function
|
|
334
|
-
return [...
|
|
1802
|
+
for (let e of Ye) Xe(e);
|
|
1803
|
+
function Ze() {
|
|
1804
|
+
return [...G.keys()].sort();
|
|
335
1805
|
}
|
|
336
|
-
function
|
|
337
|
-
let t =
|
|
338
|
-
if (!t) throw Error(`[document-profile] unknown profile "${e}". Registered: ${
|
|
1806
|
+
function Qe(e) {
|
|
1807
|
+
let t = G.get(e);
|
|
1808
|
+
if (!t) throw Error(`[document-profile] unknown profile "${e}". Registered: ${Ze().join(", ")}`);
|
|
339
1809
|
if (!t.extends) return t;
|
|
340
|
-
let n =
|
|
1810
|
+
let n = G.get(t.extends);
|
|
341
1811
|
if (!n) throw Error(`[document-profile] "${e}" extends unknown profile "${t.extends}"`);
|
|
342
1812
|
if (n.extends) throw Error(`[document-profile] "${e}" extends "${n.id}", which extends "${n.extends}": inheritance is one level deep.`);
|
|
343
1813
|
return {
|
|
@@ -347,29 +1817,29 @@ function P(e) {
|
|
|
347
1817
|
extends: t.extends
|
|
348
1818
|
};
|
|
349
1819
|
}
|
|
350
|
-
function
|
|
1820
|
+
function $e() {
|
|
351
1821
|
let e = {};
|
|
352
|
-
for (let t of
|
|
353
|
-
e[t] =
|
|
1822
|
+
for (let t of Ze()) try {
|
|
1823
|
+
e[t] = Qe(t);
|
|
354
1824
|
} catch (e) {
|
|
355
1825
|
console.warn(`[document-profile] skipping "${t}": ${e instanceof Error ? e.message : String(e)}`);
|
|
356
1826
|
}
|
|
357
1827
|
return e;
|
|
358
1828
|
}
|
|
359
|
-
var
|
|
360
|
-
function
|
|
1829
|
+
var et = Object.freeze($e()), tt = "workbook";
|
|
1830
|
+
function nt(e, t) {
|
|
361
1831
|
try {
|
|
362
|
-
return
|
|
1832
|
+
return Qe(e);
|
|
363
1833
|
} catch {
|
|
364
|
-
return
|
|
1834
|
+
return F(`unknown-profile:${e}`, `[document-profile] unknown profile "${e}" (first seen in ${t}): rendering with fallback values.`), null;
|
|
365
1835
|
}
|
|
366
1836
|
}
|
|
367
|
-
function
|
|
368
|
-
return e === void 0 ? (
|
|
1837
|
+
function K(e, t) {
|
|
1838
|
+
return e === void 0 ? (F("no-profile", `[document-profile] no profileId supplied (first seen in ${t}): falling back to "${tt}". If this document is an instrument, its numbering and depth are being dropped.`), nt(tt, t)) : nt(e, t);
|
|
369
1839
|
}
|
|
370
1840
|
//#endregion
|
|
371
1841
|
//#region src/core/document/profiles/tokens.ts
|
|
372
|
-
var
|
|
1842
|
+
var rt = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), it = [
|
|
373
1843
|
"full",
|
|
374
1844
|
"muted",
|
|
375
1845
|
"subtle",
|
|
@@ -377,12 +1847,12 @@ var oe = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), se = [
|
|
|
377
1847
|
"accent",
|
|
378
1848
|
"accentText",
|
|
379
1849
|
"sunken"
|
|
380
|
-
],
|
|
1850
|
+
], at = [
|
|
381
1851
|
"structural",
|
|
382
1852
|
"hairline",
|
|
383
1853
|
"head",
|
|
384
1854
|
"row"
|
|
385
|
-
],
|
|
1855
|
+
], ot = [
|
|
386
1856
|
"display",
|
|
387
1857
|
"heading",
|
|
388
1858
|
"subhead",
|
|
@@ -392,8 +1862,8 @@ var oe = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), se = [
|
|
|
392
1862
|
"label",
|
|
393
1863
|
"note",
|
|
394
1864
|
"eyebrow"
|
|
395
|
-
],
|
|
396
|
-
function
|
|
1865
|
+
], st = 3, q = "initial";
|
|
1866
|
+
function ct(e) {
|
|
397
1867
|
let t = {
|
|
398
1868
|
"--doc-sheet-width": e.sheet.width,
|
|
399
1869
|
"--doc-sheet-height": e.sheet.height,
|
|
@@ -403,27 +1873,27 @@ function de(e) {
|
|
|
403
1873
|
"--doc-margin-left": e.margins.left,
|
|
404
1874
|
"--doc-measure": e.measure,
|
|
405
1875
|
"--doc-body-measure": e.bodyMeasureCh ? `${e.bodyMeasureCh}ch` : "none",
|
|
406
|
-
"--doc-rail-axis": e.rail.axis ??
|
|
407
|
-
"--doc-rail-width": e.rail.width ??
|
|
408
|
-
"--doc-rail-gutter": e.rail.gutter ??
|
|
1876
|
+
"--doc-rail-axis": e.rail.axis ?? q,
|
|
1877
|
+
"--doc-rail-width": e.rail.width ?? q,
|
|
1878
|
+
"--doc-rail-gutter": e.rail.gutter ?? q,
|
|
409
1879
|
"--doc-floor": `${e.floorPx}px`
|
|
410
1880
|
};
|
|
411
|
-
for (let n of
|
|
412
|
-
for (let n of
|
|
413
|
-
for (let n of
|
|
414
|
-
let r = e.type[n], i = `--doc-type-${
|
|
1881
|
+
for (let n of it) t[`--doc-ink-${rt(n)}`] = e.ink[n];
|
|
1882
|
+
for (let n of at) t[`--doc-rule-${n}`] = e.rules[n] ?? q;
|
|
1883
|
+
for (let n of ot) {
|
|
1884
|
+
let r = e.type[n], i = `--doc-type-${rt(n)}`;
|
|
415
1885
|
t[`${i}-size`] = `${r.size}px`, t[`${i}-leading`] = String(r.lineHeight), t[`${i}-weight`] = String(r.weight), t[`${i}-tracking`] = r.tracking, t[`${i}-case`] = r.uppercase ? "uppercase" : "none";
|
|
416
1886
|
}
|
|
417
|
-
for (let n = 1; n <=
|
|
1887
|
+
for (let n = 1; n <= st; n++) t[`--doc-indent-${n}`] = e.depth.indent[n - 1] ?? q;
|
|
418
1888
|
return t;
|
|
419
1889
|
}
|
|
420
|
-
var
|
|
421
|
-
function
|
|
422
|
-
return e.map((e) =>
|
|
1890
|
+
var lt = (e, t) => `${e} {\n${Object.entries(t).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`;
|
|
1891
|
+
function ut(e, t) {
|
|
1892
|
+
return e.map((e) => lt(e.id === t ? `:root,\n[data-profile='${e.id}']` : `[data-profile='${e.id}']`, ct(e))).join("\n\n");
|
|
423
1893
|
}
|
|
424
1894
|
//#endregion
|
|
425
1895
|
//#region src/core/document/_shared/blocks.ts
|
|
426
|
-
var
|
|
1896
|
+
var dt = [
|
|
427
1897
|
"prose",
|
|
428
1898
|
"clause",
|
|
429
1899
|
"definitions",
|
|
@@ -431,10 +1901,10 @@ var me = [
|
|
|
431
1901
|
"notice",
|
|
432
1902
|
"figure",
|
|
433
1903
|
"execution"
|
|
434
|
-
],
|
|
435
|
-
RegExp(`^${
|
|
436
|
-
function
|
|
437
|
-
let n = e.trim(), r =
|
|
1904
|
+
], ft = /\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g, J = "[a-z0-9][a-z0-9_-]*", pt = RegExp(`^(?:(${J}):)?(${J}(?:\\.${J})*)(?:#(${J}))?$`);
|
|
1905
|
+
RegExp(`^${J}$`);
|
|
1906
|
+
function mt(e, t) {
|
|
1907
|
+
let n = e.trim(), r = pt.exec(n);
|
|
438
1908
|
return r ? {
|
|
439
1909
|
key: n,
|
|
440
1910
|
...r[1] ? { doc: r[1] } : {},
|
|
@@ -443,14 +1913,14 @@ function _e(e, t) {
|
|
|
443
1913
|
...t ? { form: t } : {}
|
|
444
1914
|
} : null;
|
|
445
1915
|
}
|
|
446
|
-
function
|
|
1916
|
+
function ht(e) {
|
|
447
1917
|
let t = e.lastIndexOf(".");
|
|
448
1918
|
return t < 0 ? e : e.slice(t + 1);
|
|
449
1919
|
}
|
|
450
|
-
function
|
|
1920
|
+
function gt(e) {
|
|
451
1921
|
let t = [], n = 0;
|
|
452
|
-
for (let r of e.matchAll(new RegExp(
|
|
453
|
-
let i =
|
|
1922
|
+
for (let r of e.matchAll(new RegExp(ft.source, "g"))) {
|
|
1923
|
+
let i = mt(r[1], r[2]);
|
|
454
1924
|
i && (r.index > n && t.push({
|
|
455
1925
|
kind: "text",
|
|
456
1926
|
text: e.slice(n, r.index)
|
|
@@ -464,29 +1934,29 @@ function ye(e) {
|
|
|
464
1934
|
text: e.slice(n)
|
|
465
1935
|
}), t;
|
|
466
1936
|
}
|
|
467
|
-
function
|
|
1937
|
+
function _t(e) {
|
|
468
1938
|
return e.includes("{{ref:");
|
|
469
1939
|
}
|
|
470
1940
|
//#endregion
|
|
471
1941
|
//#region src/core/document/_shared/profile.ts
|
|
472
|
-
var
|
|
1942
|
+
var Y = (e) => e ? { "data-profile": e } : {}, vt = (e) => e?.fills === !1 ? { "data-fills": "none" } : {}, yt = {
|
|
473
1943
|
note: "ⓘ",
|
|
474
1944
|
tip: "💡",
|
|
475
1945
|
warning: "⚠️",
|
|
476
1946
|
important: "❗"
|
|
477
1947
|
};
|
|
478
|
-
function
|
|
479
|
-
let l = o ??
|
|
1948
|
+
function bt({ children: e, tone: r = "note", title: i, profileId: a, profile: o, className: s, style: c }) {
|
|
1949
|
+
let l = o ?? K(a, "Aside"), u = l?.fills === !1;
|
|
480
1950
|
return /* @__PURE__ */ n("aside", {
|
|
481
|
-
className:
|
|
1951
|
+
className: _("core-aside", s),
|
|
482
1952
|
"data-tone": r,
|
|
483
|
-
...
|
|
484
|
-
...
|
|
1953
|
+
...Y(o?.id ?? a),
|
|
1954
|
+
...vt(l),
|
|
485
1955
|
style: c,
|
|
486
1956
|
children: [u ? null : /* @__PURE__ */ t("span", {
|
|
487
1957
|
className: "core-aside__icon",
|
|
488
1958
|
"aria-hidden": !0,
|
|
489
|
-
children:
|
|
1959
|
+
children: yt[r]
|
|
490
1960
|
}), /* @__PURE__ */ n("div", {
|
|
491
1961
|
className: "core-aside__body",
|
|
492
1962
|
children: [i && /* @__PURE__ */ t("div", {
|
|
@@ -501,20 +1971,20 @@ function Ce({ children: e, tone: r = "note", title: i, profileId: a, profile: o,
|
|
|
501
1971
|
}
|
|
502
1972
|
//#endregion
|
|
503
1973
|
//#region src/core/document/Prose/Prose.tsx
|
|
504
|
-
function
|
|
505
|
-
return r ||
|
|
506
|
-
className:
|
|
1974
|
+
function xt({ children: e, profileId: n, profile: r, full: i = !1, className: a, style: o }) {
|
|
1975
|
+
return r || K(n, "Prose"), /* @__PURE__ */ t("div", {
|
|
1976
|
+
className: _("core-prose", a),
|
|
507
1977
|
"data-full": i ? "" : void 0,
|
|
508
|
-
...
|
|
1978
|
+
...Y(r?.id ?? n),
|
|
509
1979
|
style: o,
|
|
510
1980
|
children: e
|
|
511
1981
|
});
|
|
512
1982
|
}
|
|
513
1983
|
//#endregion
|
|
514
1984
|
//#region src/core/document/Quote/Quote.tsx
|
|
515
|
-
function
|
|
1985
|
+
function St({ children: e, citation: r, className: i, style: a }) {
|
|
516
1986
|
return /* @__PURE__ */ n("figure", {
|
|
517
|
-
className:
|
|
1987
|
+
className: _("core-quote", i),
|
|
518
1988
|
style: a,
|
|
519
1989
|
children: [/* @__PURE__ */ t("blockquote", {
|
|
520
1990
|
className: "core-quote__body",
|
|
@@ -527,15 +1997,15 @@ function Te({ children: e, citation: r, className: i, style: a }) {
|
|
|
527
1997
|
}
|
|
528
1998
|
//#endregion
|
|
529
1999
|
//#region src/core/document/Definition/Definition.tsx
|
|
530
|
-
function
|
|
531
|
-
o ||
|
|
2000
|
+
function Ct({ term: e, description: r, pairs: i, profileId: a, profile: o, className: s, style: c }) {
|
|
2001
|
+
o || K(a, "Definition");
|
|
532
2002
|
let l = i ?? (e === void 0 ? [] : [{
|
|
533
2003
|
term: e,
|
|
534
2004
|
description: r
|
|
535
2005
|
}]);
|
|
536
2006
|
return /* @__PURE__ */ t("dl", {
|
|
537
|
-
className:
|
|
538
|
-
...
|
|
2007
|
+
className: _("core-definition", s),
|
|
2008
|
+
...Y(o?.id ?? a),
|
|
539
2009
|
style: c,
|
|
540
2010
|
children: l.map((e, r) => /* @__PURE__ */ n("div", {
|
|
541
2011
|
className: "core-definition__item",
|
|
@@ -551,35 +2021,35 @@ function Ee({ term: e, description: r, pairs: i, profileId: a, profile: o, class
|
|
|
551
2021
|
}
|
|
552
2022
|
//#endregion
|
|
553
2023
|
//#region src/core/document/Math/Math.tsx
|
|
554
|
-
var
|
|
555
|
-
function
|
|
2024
|
+
var wt = "katex";
|
|
2025
|
+
function Tt(e) {
|
|
556
2026
|
if (typeof document > "u") return !1;
|
|
557
2027
|
for (let t of document.querySelectorAll("script[type=\"importmap\"]")) try {
|
|
558
2028
|
if (JSON.parse(t.textContent ?? "").imports?.[e]) return !0;
|
|
559
2029
|
} catch {}
|
|
560
2030
|
return !1;
|
|
561
2031
|
}
|
|
562
|
-
var
|
|
2032
|
+
var Et = (e) => import(
|
|
563
2033
|
/* @vite-ignore */
|
|
564
2034
|
e
|
|
565
|
-
),
|
|
566
|
-
function
|
|
567
|
-
return
|
|
2035
|
+
), Dt;
|
|
2036
|
+
function Ot() {
|
|
2037
|
+
return Dt ??= Tt(wt) ? Et(wt).then((e) => {
|
|
568
2038
|
let t = e, n = t.default ?? t;
|
|
569
2039
|
return typeof n.render == "function" ? n : null;
|
|
570
|
-
}, () => null) : Promise.resolve(null),
|
|
2040
|
+
}, () => null) : Promise.resolve(null), Dt;
|
|
571
2041
|
}
|
|
572
|
-
function
|
|
573
|
-
let i =
|
|
574
|
-
return
|
|
2042
|
+
function kt({ children: e = "", mode: n = "inline", className: r }) {
|
|
2043
|
+
let i = p(null), [a, o] = m(null), [s, l] = m(null), u = `${n}:${e}`;
|
|
2044
|
+
return c(() => {
|
|
575
2045
|
let e = !0;
|
|
576
|
-
return
|
|
2046
|
+
return Ot().then((t) => {
|
|
577
2047
|
e && t && o(() => t);
|
|
578
2048
|
}), () => {
|
|
579
2049
|
e = !1;
|
|
580
2050
|
};
|
|
581
|
-
}, []),
|
|
582
|
-
if (a && i.current &&
|
|
2051
|
+
}, []), c(() => {
|
|
2052
|
+
if (a && i.current && s !== u) try {
|
|
583
2053
|
a.render(e, i.current, {
|
|
584
2054
|
displayMode: n === "block",
|
|
585
2055
|
throwOnError: !1
|
|
@@ -592,34 +2062,34 @@ function Ae({ children: e = "", mode: n = "inline", className: r }) {
|
|
|
592
2062
|
e,
|
|
593
2063
|
n,
|
|
594
2064
|
u,
|
|
595
|
-
|
|
596
|
-
]), !a ||
|
|
597
|
-
className:
|
|
2065
|
+
s
|
|
2066
|
+
]), !a || s === u ? /* @__PURE__ */ t("span", {
|
|
2067
|
+
className: _("core-math", r),
|
|
598
2068
|
"data-mode": n,
|
|
599
2069
|
"data-fallback": "",
|
|
600
2070
|
title: "KaTeX not available — showing TeX source",
|
|
601
2071
|
children: e
|
|
602
2072
|
}) : /* @__PURE__ */ t("span", {
|
|
603
2073
|
ref: i,
|
|
604
|
-
className:
|
|
2074
|
+
className: _("core-math", r),
|
|
605
2075
|
"data-mode": n
|
|
606
2076
|
});
|
|
607
2077
|
}
|
|
608
2078
|
//#endregion
|
|
609
2079
|
//#region src/core/document/_shared/footnote-context.tsx
|
|
610
|
-
function
|
|
2080
|
+
function At(e, t) {
|
|
611
2081
|
switch (t.type) {
|
|
612
2082
|
case "register": return e.footnotes.some((e) => e.id === t.entry.id) ? e : { footnotes: [...e.footnotes, t.entry] };
|
|
613
2083
|
case "unregister": return { footnotes: e.footnotes.filter((e) => e.id !== t.id) };
|
|
614
2084
|
default: return e;
|
|
615
2085
|
}
|
|
616
2086
|
}
|
|
617
|
-
var
|
|
618
|
-
function
|
|
619
|
-
return
|
|
2087
|
+
var jt = i(null);
|
|
2088
|
+
function Mt() {
|
|
2089
|
+
return s(jt);
|
|
620
2090
|
}
|
|
621
|
-
function
|
|
622
|
-
let [n, r] =
|
|
2091
|
+
function Nt({ children: e }) {
|
|
2092
|
+
let [n, r] = f(At, { footnotes: [] }), i = p(0), a = o((e) => {
|
|
623
2093
|
i.current += 1;
|
|
624
2094
|
let t = i.current;
|
|
625
2095
|
return r({
|
|
@@ -629,28 +2099,28 @@ function Ne({ children: e }) {
|
|
|
629
2099
|
number: t
|
|
630
2100
|
}
|
|
631
2101
|
}), t;
|
|
632
|
-
}, []), s =
|
|
2102
|
+
}, []), s = o((e) => r({
|
|
633
2103
|
type: "unregister",
|
|
634
2104
|
id: e
|
|
635
|
-
}), []), c =
|
|
2105
|
+
}), []), c = d(() => ({
|
|
636
2106
|
state: n,
|
|
637
|
-
registerFootnote:
|
|
2107
|
+
registerFootnote: a,
|
|
638
2108
|
unregisterFootnote: s
|
|
639
2109
|
}), [
|
|
640
2110
|
n,
|
|
641
|
-
|
|
2111
|
+
a,
|
|
642
2112
|
s
|
|
643
2113
|
]);
|
|
644
|
-
return /* @__PURE__ */ t(
|
|
2114
|
+
return /* @__PURE__ */ t(jt.Provider, {
|
|
645
2115
|
value: c,
|
|
646
2116
|
children: e
|
|
647
2117
|
});
|
|
648
2118
|
}
|
|
649
2119
|
//#endregion
|
|
650
2120
|
//#region src/core/document/Footnote/Footnote.tsx
|
|
651
|
-
function
|
|
652
|
-
let r =
|
|
653
|
-
return
|
|
2121
|
+
function Pt({ children: e }) {
|
|
2122
|
+
let r = l(), i = Mt(), [a, o] = m(null);
|
|
2123
|
+
return c(() => {
|
|
654
2124
|
if (!i) return;
|
|
655
2125
|
let t = i.registerFootnote({
|
|
656
2126
|
id: r,
|
|
@@ -682,10 +2152,10 @@ function Pe({ children: e }) {
|
|
|
682
2152
|
}
|
|
683
2153
|
//#endregion
|
|
684
2154
|
//#region src/core/document/Figure/Figure.tsx
|
|
685
|
-
function
|
|
686
|
-
return a ||
|
|
687
|
-
className:
|
|
688
|
-
...
|
|
2155
|
+
function Ft({ children: e, caption: r, profileId: i, profile: a, className: o, style: s }) {
|
|
2156
|
+
return a || K(i, "Figure"), /* @__PURE__ */ n("figure", {
|
|
2157
|
+
className: _("core-figure", o),
|
|
2158
|
+
...Y(a?.id ?? i),
|
|
689
2159
|
style: s,
|
|
690
2160
|
children: [/* @__PURE__ */ t("div", {
|
|
691
2161
|
className: "core-figure__body",
|
|
@@ -698,26 +2168,26 @@ function U({ children: e, caption: r, profileId: i, profile: a, className: o, st
|
|
|
698
2168
|
}
|
|
699
2169
|
//#endregion
|
|
700
2170
|
//#region src/core/document/PageBreak/PageBreak.tsx
|
|
701
|
-
function
|
|
2171
|
+
function It({ className: e }) {
|
|
702
2172
|
return /* @__PURE__ */ t("div", {
|
|
703
|
-
className:
|
|
2173
|
+
className: _("core-page-break", e),
|
|
704
2174
|
"aria-hidden": !0
|
|
705
2175
|
});
|
|
706
2176
|
}
|
|
707
2177
|
//#endregion
|
|
708
2178
|
//#region src/core/document/DocumentLabel/DocumentLabel.tsx
|
|
709
|
-
function
|
|
710
|
-
return i ||
|
|
711
|
-
className:
|
|
2179
|
+
function Lt({ children: e, as: n = "div", profileId: r, profile: i, tone: a = "subtle", className: o, style: s }) {
|
|
2180
|
+
return i || K(r, "DocumentLabel"), /* @__PURE__ */ t(n, {
|
|
2181
|
+
className: _("core-document-label", o),
|
|
712
2182
|
"data-tone": a,
|
|
713
|
-
...
|
|
2183
|
+
...Y(i?.id ?? r),
|
|
714
2184
|
style: s,
|
|
715
2185
|
children: e
|
|
716
2186
|
});
|
|
717
2187
|
}
|
|
718
2188
|
//#endregion
|
|
719
2189
|
//#region src/core/document/_shared/ordinal-format.ts
|
|
720
|
-
var
|
|
2190
|
+
var Rt = [
|
|
721
2191
|
"one",
|
|
722
2192
|
"two",
|
|
723
2193
|
"three",
|
|
@@ -729,15 +2199,15 @@ var Le = [
|
|
|
729
2199
|
"nine",
|
|
730
2200
|
"ten"
|
|
731
2201
|
];
|
|
732
|
-
function
|
|
2202
|
+
function zt(e) {
|
|
733
2203
|
if (e.length !== 1) return null;
|
|
734
|
-
let t = e[0], n =
|
|
2204
|
+
let t = e[0], n = Rt[t - 1];
|
|
735
2205
|
return n ? `Article ${n}` : `Article ${t}`;
|
|
736
2206
|
}
|
|
737
|
-
function
|
|
2207
|
+
function Bt(e) {
|
|
738
2208
|
return e.length === 0 ? null : e.length === 1 ? `Article ${e[0]}` : e.join(".");
|
|
739
2209
|
}
|
|
740
|
-
function
|
|
2210
|
+
function Vt(e, t, n) {
|
|
741
2211
|
let r = n === "ladder" && e !== void 0 && e.length > 0, i = [];
|
|
742
2212
|
return t.map(({ level: t, marker: n }) => {
|
|
743
2213
|
let a = Math.min(Number.isInteger(t) && t >= 1 ? t : 1, i.length + 1);
|
|
@@ -746,25 +2216,25 @@ function Be(e, t, n) {
|
|
|
746
2216
|
}
|
|
747
2217
|
//#endregion
|
|
748
2218
|
//#region src/core/document/_shared/section-anchors.ts
|
|
749
|
-
function
|
|
2219
|
+
function Ht(e, t) {
|
|
750
2220
|
return e?.[t] ?? t;
|
|
751
2221
|
}
|
|
752
2222
|
//#endregion
|
|
753
2223
|
//#region src/core/document/Reference/Reference.tsx
|
|
754
|
-
function
|
|
755
|
-
let d = c ??
|
|
2224
|
+
function Ut({ target: e, form: n, sectionReferences: r, sectionNumbers: i, sectionTitles: a, sectionAnchors: o, profileId: s, profile: c, className: l, style: u }) {
|
|
2225
|
+
let d = c ?? K(s, "Reference"), f = mt(e), p = r?.[e], m = p?.openable === !1, h = f !== null && f.doc === void 0, g = f ? ht(f.unit) : e, v = p?.number ?? (h && f.element === void 0 ? i?.[g] : void 0), y = p?.title ?? (h && f.element === void 0 ? a?.[g] : void 0), b = null;
|
|
756
2226
|
if (f?.element !== void 0) {
|
|
757
2227
|
let e = p?.element;
|
|
758
|
-
b = e ?
|
|
759
|
-
} else v && (b =
|
|
2228
|
+
b = e ? Vt(p.number, e.shape, d?.depth.numbering)[e.index] ?? null : null;
|
|
2229
|
+
} else v && (b = Bt(v));
|
|
760
2230
|
let x = n === "full" || f?.doc !== void 0 && n !== "title", S;
|
|
761
2231
|
S = m ? null : n === "title" ? y ?? b : x && b && y && f?.element === void 0 ? `${b} (${y})` : b ?? y ?? null;
|
|
762
|
-
let C = S !== null, w = C ? p ? p.href : `#${
|
|
763
|
-
className:
|
|
2232
|
+
let C = S !== null, w = C ? p ? p.href : `#${Ht(o, g)}` : void 0, T = {
|
|
2233
|
+
className: _("core-reference", l),
|
|
764
2234
|
"data-target": e,
|
|
765
2235
|
"data-unresolved": C || m ? void 0 : "",
|
|
766
2236
|
"data-closed": m ? "" : void 0,
|
|
767
|
-
...
|
|
2237
|
+
...Y(c?.id ?? s),
|
|
768
2238
|
style: u
|
|
769
2239
|
};
|
|
770
2240
|
return w ? /* @__PURE__ */ t("a", {
|
|
@@ -778,10 +2248,10 @@ function He({ target: e, form: n, sectionReferences: r, sectionNumbers: i, secti
|
|
|
778
2248
|
}
|
|
779
2249
|
//#endregion
|
|
780
2250
|
//#region src/core/document/DocumentTable/DocumentTable.tsx
|
|
781
|
-
function
|
|
782
|
-
return o ||
|
|
783
|
-
className:
|
|
784
|
-
...
|
|
2251
|
+
function Wt({ columns: e, rows: r, caption: i, profileId: a, profile: o, className: s, style: c }) {
|
|
2252
|
+
return o || K(a, "DocumentTable"), e.length === 0 ? null : /* @__PURE__ */ n("div", {
|
|
2253
|
+
className: _("core-document-table", s),
|
|
2254
|
+
...Y(o?.id ?? a),
|
|
785
2255
|
style: c,
|
|
786
2256
|
children: [i === void 0 ? null : /* @__PURE__ */ t("div", {
|
|
787
2257
|
className: "core-document-table__caption",
|
|
@@ -803,13 +2273,13 @@ function Ue({ columns: e, rows: r, caption: i, profileId: a, profile: o, classNa
|
|
|
803
2273
|
}
|
|
804
2274
|
//#endregion
|
|
805
2275
|
//#region src/core/document/RowList/RowList.tsx
|
|
806
|
-
function
|
|
807
|
-
return i ||
|
|
808
|
-
className:
|
|
809
|
-
...
|
|
810
|
-
style:
|
|
811
|
-
"--core-row-list-marker-width":
|
|
812
|
-
"--core-row-list-secondary-width":
|
|
2276
|
+
function Gt({ items: e, profileId: r, profile: i, markerWidth: a = 44, secondaryWidth: o = 190, missingLabel: s = "Not answered yet", className: c, style: l }) {
|
|
2277
|
+
return i || K(r, "RowList"), e.length === 0 ? null : /* @__PURE__ */ t("div", {
|
|
2278
|
+
className: _("core-row-list", c),
|
|
2279
|
+
...Y(i?.id ?? r),
|
|
2280
|
+
style: y({
|
|
2281
|
+
"--core-row-list-marker-width": v(a),
|
|
2282
|
+
"--core-row-list-secondary-width": v(o)
|
|
813
2283
|
}, l),
|
|
814
2284
|
children: e.map((e, r) => /* @__PURE__ */ n("div", {
|
|
815
2285
|
className: "core-row-list__row",
|
|
@@ -833,8 +2303,8 @@ function W({ items: e, profileId: r, profile: i, markerWidth: a = 44, secondaryW
|
|
|
833
2303
|
}
|
|
834
2304
|
//#endregion
|
|
835
2305
|
//#region src/core/document/AnswerRows/AnswerRows.tsx
|
|
836
|
-
var
|
|
837
|
-
function
|
|
2306
|
+
var Kt = 190;
|
|
2307
|
+
function qt({ items: e, profileId: n, profile: r, missingLabel: i = "Not answered yet", answerWidth: a = 190, className: o, style: s }) {
|
|
838
2308
|
let c = e.map((e) => {
|
|
839
2309
|
let t = typeof e.answer == "string" && e.answer.trim().length > 0;
|
|
840
2310
|
return {
|
|
@@ -845,10 +2315,10 @@ function Ge({ items: e, profileId: n, profile: r, missingLabel: i = "Not answere
|
|
|
845
2315
|
};
|
|
846
2316
|
});
|
|
847
2317
|
return /* @__PURE__ */ t("div", {
|
|
848
|
-
className:
|
|
849
|
-
...
|
|
2318
|
+
className: _("core-answer-rows", o),
|
|
2319
|
+
...Y(r?.id ?? n),
|
|
850
2320
|
style: s,
|
|
851
|
-
children: /* @__PURE__ */ t(
|
|
2321
|
+
children: /* @__PURE__ */ t(Gt, {
|
|
852
2322
|
items: c,
|
|
853
2323
|
profileId: n,
|
|
854
2324
|
profile: r,
|
|
@@ -859,21 +2329,21 @@ function Ge({ items: e, profileId: n, profile: r, missingLabel: i = "Not answere
|
|
|
859
2329
|
}
|
|
860
2330
|
//#endregion
|
|
861
2331
|
//#region src/core/_shared/formatters.ts
|
|
862
|
-
function
|
|
2332
|
+
function X(e) {
|
|
863
2333
|
if (e == null) return "";
|
|
864
2334
|
if (typeof e == "string") return e;
|
|
865
|
-
let t = e.precision ?? (e.format === "number" ?
|
|
2335
|
+
let t = e.precision ?? (e.format === "number" ? Jt(e.value) : void 0), n = Yt(e.format, e.value, {
|
|
866
2336
|
precision: t,
|
|
867
2337
|
signed: e.signed
|
|
868
2338
|
});
|
|
869
2339
|
return e.unit && n !== "—" ? `${n}\u00a0${e.unit}` : n;
|
|
870
2340
|
}
|
|
871
|
-
function
|
|
2341
|
+
function Jt(e) {
|
|
872
2342
|
if (typeof e != "number" || !Number.isFinite(e)) return 0;
|
|
873
2343
|
let t = String(Number(e.toFixed(3))), n = t.indexOf(".");
|
|
874
2344
|
return n === -1 || t.includes("e") ? 0 : t.length - n - 1;
|
|
875
2345
|
}
|
|
876
|
-
function
|
|
2346
|
+
function Yt(e, t, n = {}) {
|
|
877
2347
|
if (!Number.isFinite(t)) return "—";
|
|
878
2348
|
let r = n.signed === !0, i = t < 0, a = Math.abs(t), o = i ? "-" : r ? "+" : "";
|
|
879
2349
|
switch (e) {
|
|
@@ -939,35 +2409,35 @@ function qe(e, t, n = {}) {
|
|
|
939
2409
|
}
|
|
940
2410
|
//#endregion
|
|
941
2411
|
//#region src/core/document/ComparisonBars/ComparisonBars.tsx
|
|
942
|
-
var
|
|
943
|
-
function
|
|
944
|
-
let u = s ??
|
|
2412
|
+
var Xt = 40;
|
|
2413
|
+
function Zt({ bars: e, target: r, targetLabel: i, max: a, profileId: o, profile: s, className: c, style: l }) {
|
|
2414
|
+
let u = s ?? K(o, "ComparisonBars");
|
|
945
2415
|
if (e.length === 0) return null;
|
|
946
2416
|
let d = e.map((e) => e.value), f = a ?? Math.max(...d, r ?? 0);
|
|
947
|
-
if (!Number.isFinite(f) || f <= 0) return
|
|
2417
|
+
if (!Number.isFinite(f) || f <= 0) return F("ComparisonBars:no-scale", "[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."), null;
|
|
948
2418
|
let p = r !== void 0 && r > 0 && r <= f ? r / f * 100 : void 0;
|
|
949
2419
|
return /* @__PURE__ */ n("figure", {
|
|
950
|
-
className:
|
|
951
|
-
...
|
|
952
|
-
...
|
|
2420
|
+
className: _("core-comparison-bars", c),
|
|
2421
|
+
...Y(s?.id ?? o),
|
|
2422
|
+
...vt(u),
|
|
953
2423
|
style: l,
|
|
954
2424
|
children: [e.map((e) => {
|
|
955
2425
|
let r = Math.max(0, Math.min(100, e.value / f * 100));
|
|
956
2426
|
return /* @__PURE__ */ n("div", {
|
|
957
2427
|
className: "core-comparison-bars__bar",
|
|
958
|
-
style:
|
|
2428
|
+
style: y({ "--core-comparison-bars-value": `${r}%` }),
|
|
959
2429
|
children: [/* @__PURE__ */ t("div", {
|
|
960
2430
|
className: "core-comparison-bars__label",
|
|
961
2431
|
children: e.label
|
|
962
2432
|
}), /* @__PURE__ */ n("div", {
|
|
963
2433
|
className: "core-comparison-bars__track",
|
|
964
|
-
style:
|
|
2434
|
+
style: y({ "--core-comparison-bars-target": p === void 0 ? void 0 : `${p}%` }),
|
|
965
2435
|
children: [
|
|
966
2436
|
/* @__PURE__ */ t("div", { className: "core-comparison-bars__fill" }),
|
|
967
2437
|
/* @__PURE__ */ t("span", {
|
|
968
2438
|
className: "core-comparison-bars__value",
|
|
969
|
-
"data-placement": r >
|
|
970
|
-
children:
|
|
2439
|
+
"data-placement": r > Xt ? "inside" : "outside",
|
|
2440
|
+
children: X(e.display)
|
|
971
2441
|
}),
|
|
972
2442
|
p !== void 0 && /* @__PURE__ */ t("div", {
|
|
973
2443
|
className: "core-comparison-bars__target",
|
|
@@ -984,11 +2454,11 @@ function Ye({ bars: e, target: r, targetLabel: i, max: a, profileId: o, profile:
|
|
|
984
2454
|
}
|
|
985
2455
|
//#endregion
|
|
986
2456
|
//#region src/core/document/NextSteps/NextSteps.tsx
|
|
987
|
-
var
|
|
988
|
-
function
|
|
989
|
-
return i ||
|
|
990
|
-
className:
|
|
991
|
-
...
|
|
2457
|
+
var Qt = 3, $t = 5;
|
|
2458
|
+
function en({ items: e, profileId: r, profile: i, checkboxes: a = !0, className: o, style: s }) {
|
|
2459
|
+
return i || K(r, "NextSteps"), e.length === 0 ? null : ((e.length < Qt || e.length > $t) && F(`NextSteps:count:${e.length}`, `[NextSteps] ${e.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`), /* @__PURE__ */ t("ol", {
|
|
2460
|
+
className: _("core-next-steps", o),
|
|
2461
|
+
...Y(i?.id ?? r),
|
|
992
2462
|
style: s,
|
|
993
2463
|
children: e.map((e, r) => /* @__PURE__ */ n("li", {
|
|
994
2464
|
className: "core-next-steps__step",
|
|
@@ -1011,11 +2481,11 @@ function Qe({ items: e, profileId: r, profile: i, checkboxes: a = !0, className:
|
|
|
1011
2481
|
}
|
|
1012
2482
|
//#endregion
|
|
1013
2483
|
//#region src/core/document/Notes/Notes.tsx
|
|
1014
|
-
var
|
|
1015
|
-
function
|
|
1016
|
-
return a ||
|
|
1017
|
-
className:
|
|
1018
|
-
...
|
|
2484
|
+
var tn = 38;
|
|
2485
|
+
function nn({ title: e = "Notes", lines: r = 4, profileId: i, profile: a, className: o, style: s }) {
|
|
2486
|
+
return a || K(i, "Notes"), r < 1 ? null : /* @__PURE__ */ n("section", {
|
|
2487
|
+
className: _("core-notes", o),
|
|
2488
|
+
...Y(a?.id ?? i),
|
|
1019
2489
|
style: s,
|
|
1020
2490
|
children: [/* @__PURE__ */ t("div", {
|
|
1021
2491
|
className: "core-notes__title",
|
|
@@ -1029,11 +2499,11 @@ function et({ title: e = "Notes", lines: r = 4, profileId: i, profile: a, classN
|
|
|
1029
2499
|
}
|
|
1030
2500
|
//#endregion
|
|
1031
2501
|
//#region src/core/document/SkippedSection/SkippedSection.tsx
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1034
|
-
return a ||
|
|
1035
|
-
className:
|
|
1036
|
-
...
|
|
2502
|
+
var rn = "You left this section open, so it is not covered here.";
|
|
2503
|
+
function an({ wouldTell: e, openingLine: r = rn, profileId: i, profile: a, className: o, style: s }) {
|
|
2504
|
+
return a || K(i, "SkippedSection"), /* @__PURE__ */ n("div", {
|
|
2505
|
+
className: _("core-skipped-section", o),
|
|
2506
|
+
...Y(a?.id ?? i),
|
|
1037
2507
|
style: s,
|
|
1038
2508
|
children: [
|
|
1039
2509
|
/* @__PURE__ */ t("span", {
|
|
@@ -1050,13 +2520,13 @@ function nt({ wouldTell: e, openingLine: r = tt, profileId: i, profile: a, class
|
|
|
1050
2520
|
}
|
|
1051
2521
|
//#endregion
|
|
1052
2522
|
//#region src/core/document/TalkItThrough/TalkItThrough.tsx
|
|
1053
|
-
var
|
|
1054
|
-
function
|
|
1055
|
-
if (o ||
|
|
2523
|
+
var on = "Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";
|
|
2524
|
+
function sn({ advisor: e, title: r = "Talk it through", invitation: i = on, profileId: a, profile: o, className: s, style: c }) {
|
|
2525
|
+
if (o || K(a, "TalkItThrough"), !e?.name?.trim()) return F("TalkItThrough:no-advisor", "[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."), null;
|
|
1056
2526
|
let l = [e.phone, e.email].filter((e) => typeof e == "string" && e.trim().length > 0);
|
|
1057
|
-
return l.length === 0 &&
|
|
1058
|
-
className:
|
|
1059
|
-
...
|
|
2527
|
+
return l.length === 0 && F("TalkItThrough:no-contact", `[TalkItThrough] "${e.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`), /* @__PURE__ */ n("section", {
|
|
2528
|
+
className: _("core-talk-it-through", s),
|
|
2529
|
+
...Y(o?.id ?? a),
|
|
1060
2530
|
style: c,
|
|
1061
2531
|
children: [
|
|
1062
2532
|
/* @__PURE__ */ t("h3", {
|
|
@@ -1089,14 +2559,14 @@ function it({ advisor: e, title: r = "Talk it through", invitation: i = rt, prof
|
|
|
1089
2559
|
}
|
|
1090
2560
|
//#endregion
|
|
1091
2561
|
//#region src/core/document/WriteInField/WriteInField.tsx
|
|
1092
|
-
var
|
|
1093
|
-
function
|
|
1094
|
-
o ||
|
|
2562
|
+
var cn = 38;
|
|
2563
|
+
function ln({ question: e, answer: r, lines: i = 1, profileId: a, profile: o, className: s, style: c }) {
|
|
2564
|
+
o || K(a, "WriteInField");
|
|
1095
2565
|
let l = typeof r == "string" && r.trim().length > 0, u = Math.max(1, i);
|
|
1096
2566
|
return /* @__PURE__ */ n("div", {
|
|
1097
|
-
className:
|
|
2567
|
+
className: _("core-write-in-field", s),
|
|
1098
2568
|
"data-answered": l ? "" : void 0,
|
|
1099
|
-
...
|
|
2569
|
+
...Y(o?.id ?? a),
|
|
1100
2570
|
style: c,
|
|
1101
2571
|
children: [e && /* @__PURE__ */ t("div", {
|
|
1102
2572
|
className: "core-write-in-field__question",
|
|
@@ -1112,11 +2582,11 @@ function ot({ question: e, answer: r, lines: i = 1, profileId: a, profile: o, cl
|
|
|
1112
2582
|
}
|
|
1113
2583
|
//#endregion
|
|
1114
2584
|
//#region src/core/document/Masthead/Masthead.tsx
|
|
1115
|
-
function
|
|
1116
|
-
return o ||
|
|
1117
|
-
className:
|
|
2585
|
+
function un({ mark: e, identity: r, codes: i, profileId: a, profile: o, className: s, style: c }) {
|
|
2586
|
+
return o || K(a, "Masthead"), e === void 0 && r === void 0 && i === void 0 ? null : /* @__PURE__ */ n("header", {
|
|
2587
|
+
className: _("core-masthead", s),
|
|
1118
2588
|
"data-page-region": "page-header",
|
|
1119
|
-
...
|
|
2589
|
+
...Y(o?.id ?? a),
|
|
1120
2590
|
style: c,
|
|
1121
2591
|
children: [
|
|
1122
2592
|
e !== void 0 && /* @__PURE__ */ t("div", {
|
|
@@ -1139,13 +2609,13 @@ function st({ mark: e, identity: r, codes: i, profileId: a, profile: o, classNam
|
|
|
1139
2609
|
}
|
|
1140
2610
|
//#endregion
|
|
1141
2611
|
//#region src/core/document/MetaRail/MetaRail.tsx
|
|
1142
|
-
var
|
|
1143
|
-
function
|
|
1144
|
-
let s = (i ??
|
|
1145
|
-
return s === "none" || e.length === 0 ? null : (s !== "column" && e.length >
|
|
1146
|
-
className:
|
|
2612
|
+
var dn = 4;
|
|
2613
|
+
function fn({ fields: e, profileId: r, profile: i, className: a, style: o }) {
|
|
2614
|
+
let s = (i ?? K(r, "MetaRail"))?.rail.placement ?? "strip";
|
|
2615
|
+
return s === "none" || e.length === 0 ? null : (s !== "column" && e.length > dn && typeof console < "u" && console.warn(`[MetaRail] ${e.length} fields in a strip; the spec allows ${dn}. Rendering all of them — check the layout.`), /* @__PURE__ */ t("div", {
|
|
2616
|
+
className: _("core-meta-rail", a),
|
|
1147
2617
|
"data-placement": s,
|
|
1148
|
-
...
|
|
2618
|
+
...Y(i?.id ?? r),
|
|
1149
2619
|
style: o,
|
|
1150
2620
|
children: e.map((e) => /* @__PURE__ */ n("div", {
|
|
1151
2621
|
className: "core-meta-rail__field",
|
|
@@ -1161,38 +2631,38 @@ function lt({ fields: e, profileId: r, profile: i, className: a, style: o }) {
|
|
|
1161
2631
|
}
|
|
1162
2632
|
//#endregion
|
|
1163
2633
|
//#region src/core/document/RunningFooter/RunningFooter.tsx
|
|
1164
|
-
var
|
|
2634
|
+
var pn = {
|
|
1165
2635
|
left: "bottom-left",
|
|
1166
2636
|
centre: "bottom-center",
|
|
1167
2637
|
right: "bottom-right"
|
|
1168
2638
|
};
|
|
1169
|
-
function
|
|
1170
|
-
a ||
|
|
2639
|
+
function mn({ left: e, centre: n, right: r, profileId: i, profile: a, className: o, style: s }) {
|
|
2640
|
+
a || K(i, "RunningFooter");
|
|
1171
2641
|
let c = [
|
|
1172
2642
|
["left", e],
|
|
1173
2643
|
["centre", n],
|
|
1174
2644
|
["right", r]
|
|
1175
2645
|
].filter(([, e]) => e != null);
|
|
1176
2646
|
return c.length === 0 ? null : /* @__PURE__ */ t("footer", {
|
|
1177
|
-
className:
|
|
2647
|
+
className: _("core-running-footer", o),
|
|
1178
2648
|
"data-page-region": "page-footer",
|
|
1179
|
-
...
|
|
2649
|
+
...Y(a?.id ?? i),
|
|
1180
2650
|
style: s,
|
|
1181
2651
|
children: c.map(([e, n]) => /* @__PURE__ */ t("span", {
|
|
1182
2652
|
className: "core-running-footer__slot",
|
|
1183
2653
|
"data-region-slot": e,
|
|
1184
|
-
"data-margin-box":
|
|
2654
|
+
"data-margin-box": pn[e],
|
|
1185
2655
|
children: n
|
|
1186
2656
|
}, e))
|
|
1187
2657
|
});
|
|
1188
2658
|
}
|
|
1189
2659
|
//#endregion
|
|
1190
2660
|
//#region src/core/document/DocumentShell/DocumentShell.tsx
|
|
1191
|
-
function
|
|
1192
|
-
let l = o ??
|
|
1193
|
-
return /* @__PURE__ */ t(
|
|
1194
|
-
className:
|
|
1195
|
-
...
|
|
2661
|
+
function hn({ children: r, rail: i, profileId: a, profile: o, className: s, style: c }) {
|
|
2662
|
+
let l = o ?? K(a, "DocumentShell"), u = l?.rail.placement === "column" && i !== void 0;
|
|
2663
|
+
return /* @__PURE__ */ t(Nt, { children: /* @__PURE__ */ n("div", {
|
|
2664
|
+
className: _("core-document-shell", s),
|
|
2665
|
+
...Y(l?.id ?? a),
|
|
1196
2666
|
"data-has-rail": u ? "" : void 0,
|
|
1197
2667
|
style: c,
|
|
1198
2668
|
children: [/* @__PURE__ */ t("div", {
|
|
@@ -1209,30 +2679,30 @@ function ft({ children: r, rail: i, profileId: a, profile: o, className: s, styl
|
|
|
1209
2679
|
}
|
|
1210
2680
|
//#endregion
|
|
1211
2681
|
//#region src/core/document/Contents/Contents.tsx
|
|
1212
|
-
function
|
|
2682
|
+
function gn(e, t) {
|
|
1213
2683
|
return !e || e.length === 0 ? null : t === 0 ? String(e[0]).padStart(2, "0") : e.join(".");
|
|
1214
2684
|
}
|
|
1215
|
-
function
|
|
1216
|
-
let l = o ??
|
|
1217
|
-
if (
|
|
1218
|
-
let
|
|
2685
|
+
function _n({ entries: e, depth: r, title: i, profileId: a, profile: o, className: s, style: c }) {
|
|
2686
|
+
let l = o ?? K(a, "Contents"), u = l?.depth.max ?? Infinity, d = e ?? [], f = r === void 0 ? d : d.filter((e) => e.level < r);
|
|
2687
|
+
if (f.length === 0) return null;
|
|
2688
|
+
let p = l?.depth.numbering ?? "none", m = f.some((e) => e.page !== void 0);
|
|
1219
2689
|
return /* @__PURE__ */ n("nav", {
|
|
1220
2690
|
"aria-label": "Table of contents",
|
|
1221
|
-
className:
|
|
1222
|
-
...
|
|
2691
|
+
className: _("core-contents", s),
|
|
2692
|
+
...Y(o?.id ?? a),
|
|
1223
2693
|
style: c,
|
|
1224
2694
|
children: [i && /* @__PURE__ */ t("div", {
|
|
1225
2695
|
className: "core-contents__title",
|
|
1226
2696
|
children: i
|
|
1227
2697
|
}), /* @__PURE__ */ t("ol", {
|
|
1228
2698
|
className: "core-contents__list",
|
|
1229
|
-
children:
|
|
1230
|
-
let r =
|
|
2699
|
+
children: f.map((e) => {
|
|
2700
|
+
let r = p === "none" ? null : gn(e.ordinal, e.level);
|
|
1231
2701
|
return /* @__PURE__ */ n("li", {
|
|
1232
2702
|
className: "core-contents__entry",
|
|
1233
2703
|
"data-level": e.level,
|
|
1234
2704
|
"data-overdeep": e.level >= u ? "" : void 0,
|
|
1235
|
-
style:
|
|
2705
|
+
style: y({ "--core-contents-level": String(e.level) }),
|
|
1236
2706
|
children: [
|
|
1237
2707
|
r && /* @__PURE__ */ t("span", {
|
|
1238
2708
|
className: "core-contents__ordinal",
|
|
@@ -1243,7 +2713,7 @@ function mt({ entries: e, depth: r, title: i, profileId: a, profile: o, classNam
|
|
|
1243
2713
|
className: "core-contents__link",
|
|
1244
2714
|
children: e.title
|
|
1245
2715
|
}),
|
|
1246
|
-
|
|
2716
|
+
m && /* @__PURE__ */ t("span", {
|
|
1247
2717
|
className: "core-contents__page",
|
|
1248
2718
|
children: e.page ?? ""
|
|
1249
2719
|
})
|
|
@@ -1255,7 +2725,7 @@ function mt({ entries: e, depth: r, title: i, profileId: a, profile: o, classNam
|
|
|
1255
2725
|
}
|
|
1256
2726
|
//#endregion
|
|
1257
2727
|
//#region src/core/document/ExecutionBlock/ExecutionBlock.tsx
|
|
1258
|
-
function
|
|
2728
|
+
function vn({ s: e, dated: r }) {
|
|
1259
2729
|
return /* @__PURE__ */ n("div", {
|
|
1260
2730
|
className: "core-execution-block__signature",
|
|
1261
2731
|
children: [/* @__PURE__ */ n("div", {
|
|
@@ -1292,12 +2762,12 @@ function ht({ s: e, dated: r }) {
|
|
|
1292
2762
|
})]
|
|
1293
2763
|
});
|
|
1294
2764
|
}
|
|
1295
|
-
function
|
|
1296
|
-
c ||
|
|
2765
|
+
function yn({ attestation: e, label: r, signatories: i, columns: a = 1, note: o, profileId: s, profile: c, className: l, style: u }) {
|
|
2766
|
+
c || K(s, "ExecutionBlock");
|
|
1297
2767
|
let d = Array.isArray(i) ? i : [];
|
|
1298
2768
|
return /* @__PURE__ */ n("section", {
|
|
1299
|
-
className:
|
|
1300
|
-
...
|
|
2769
|
+
className: _("core-execution-block", l),
|
|
2770
|
+
...Y(c?.id ?? s),
|
|
1301
2771
|
style: u,
|
|
1302
2772
|
children: [
|
|
1303
2773
|
r ? /* @__PURE__ */ t("div", {
|
|
@@ -1311,7 +2781,7 @@ function gt({ attestation: e, label: r, signatories: i, columns: a = 1, note: o,
|
|
|
1311
2781
|
/* @__PURE__ */ t("div", {
|
|
1312
2782
|
className: "core-execution-block__signatories",
|
|
1313
2783
|
"data-columns": a,
|
|
1314
|
-
children: d.map((e, n) => /* @__PURE__ */ t(
|
|
2784
|
+
children: d.map((e, n) => /* @__PURE__ */ t(vn, {
|
|
1315
2785
|
s: e,
|
|
1316
2786
|
dated: e.dated === !0
|
|
1317
2787
|
}, n))
|
|
@@ -1325,7 +2795,7 @@ function gt({ attestation: e, label: r, signatories: i, columns: a = 1, note: o,
|
|
|
1325
2795
|
}
|
|
1326
2796
|
//#endregion
|
|
1327
2797
|
//#region src/core/document/DocumentBlocks/DocumentBlocks.tsx
|
|
1328
|
-
function
|
|
2798
|
+
function bn({ kind: e }) {
|
|
1329
2799
|
return /* @__PURE__ */ n("div", {
|
|
1330
2800
|
className: "core-document-blocks__unrenderable",
|
|
1331
2801
|
"data-unrenderable-block": e,
|
|
@@ -1338,10 +2808,10 @@ function _t({ kind: e }) {
|
|
|
1338
2808
|
]
|
|
1339
2809
|
});
|
|
1340
2810
|
}
|
|
1341
|
-
function
|
|
1342
|
-
let u =
|
|
2811
|
+
function xn({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sectionTitles: a, sectionReferences: o, sectionOrdinal: s, className: c, style: l }) {
|
|
2812
|
+
let u = K(n, "DocumentBlocks");
|
|
1343
2813
|
if (e.length === 0) return null;
|
|
1344
|
-
let d =
|
|
2814
|
+
let d = Vt(s, e.flatMap((e) => e.kind === "clause" ? e.items : []), u?.depth.numbering), f = 0, p = (e, s) => _t(e) ? gt(e).map((e, c) => e.kind === "text" ? e.text : /* @__PURE__ */ t(Ut, {
|
|
1345
2815
|
target: e.key,
|
|
1346
2816
|
form: e.form,
|
|
1347
2817
|
sectionReferences: o,
|
|
@@ -1351,19 +2821,19 @@ function vt({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sec
|
|
|
1351
2821
|
profileId: n
|
|
1352
2822
|
}, `${s}-ref-${c}`)) : e, m = e.some((e) => e.kind === "execution");
|
|
1353
2823
|
return /* @__PURE__ */ t("div", {
|
|
1354
|
-
className:
|
|
2824
|
+
className: _("core-document-blocks", c),
|
|
1355
2825
|
"data-pinned": m ? "execution" : void 0,
|
|
1356
|
-
...
|
|
2826
|
+
...Y(n),
|
|
1357
2827
|
style: l,
|
|
1358
2828
|
children: e.map((e, r) => {
|
|
1359
2829
|
let i = `${e.kind}-${r}`;
|
|
1360
2830
|
switch (e.kind) {
|
|
1361
|
-
case "prose": return /* @__PURE__ */ t(
|
|
2831
|
+
case "prose": return /* @__PURE__ */ t(xt, {
|
|
1362
2832
|
profileId: n,
|
|
1363
2833
|
full: e.full,
|
|
1364
2834
|
children: p(e.text, i)
|
|
1365
2835
|
}, i);
|
|
1366
|
-
case "clause": return /* @__PURE__ */ t(
|
|
2836
|
+
case "clause": return /* @__PURE__ */ t(Gt, {
|
|
1367
2837
|
profileId: n,
|
|
1368
2838
|
items: e.items.map((e, t) => ({
|
|
1369
2839
|
marker: d[f++],
|
|
@@ -1372,31 +2842,31 @@ function vt({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sec
|
|
|
1372
2842
|
missing: e.missing
|
|
1373
2843
|
}))
|
|
1374
2844
|
}, i);
|
|
1375
|
-
case "definitions": return /* @__PURE__ */ t(
|
|
2845
|
+
case "definitions": return /* @__PURE__ */ t(Ct, {
|
|
1376
2846
|
profileId: n,
|
|
1377
2847
|
pairs: e.pairs.map((e, t) => ({
|
|
1378
2848
|
term: e.term,
|
|
1379
2849
|
description: p(e.description, `${i}-${t}`)
|
|
1380
2850
|
}))
|
|
1381
2851
|
}, i);
|
|
1382
|
-
case "table": return /* @__PURE__ */ t(
|
|
2852
|
+
case "table": return /* @__PURE__ */ t(Wt, {
|
|
1383
2853
|
profileId: n,
|
|
1384
2854
|
caption: e.caption ? p(e.caption, `${i}-cap`) : void 0,
|
|
1385
2855
|
columns: e.columns,
|
|
1386
2856
|
rows: e.rows.map((e, t) => e.map((e, n) => p(e, `${i}-${t}-${n}`)))
|
|
1387
2857
|
}, i);
|
|
1388
|
-
case "notice": return /* @__PURE__ */ t(
|
|
2858
|
+
case "notice": return /* @__PURE__ */ t(bt, {
|
|
1389
2859
|
profileId: n,
|
|
1390
2860
|
tone: e.tone,
|
|
1391
2861
|
title: e.title,
|
|
1392
2862
|
children: p(e.text, i)
|
|
1393
2863
|
}, i);
|
|
1394
|
-
case "figure": return /* @__PURE__ */ t(
|
|
2864
|
+
case "figure": return /* @__PURE__ */ t(Ft, {
|
|
1395
2865
|
profileId: n,
|
|
1396
2866
|
caption: p(e.caption, i),
|
|
1397
2867
|
children: e.placeholder ?? null
|
|
1398
2868
|
}, i);
|
|
1399
|
-
case "execution": return /* @__PURE__ */ t(
|
|
2869
|
+
case "execution": return /* @__PURE__ */ t(yn, {
|
|
1400
2870
|
profileId: n,
|
|
1401
2871
|
label: e.label,
|
|
1402
2872
|
attestation: e.attestation,
|
|
@@ -1404,41 +2874,41 @@ function vt({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sec
|
|
|
1404
2874
|
columns: e.columns,
|
|
1405
2875
|
note: e.note
|
|
1406
2876
|
}, i);
|
|
1407
|
-
default: return /* @__PURE__ */ t(
|
|
2877
|
+
default: return /* @__PURE__ */ t(bn, { kind: String(e.kind) }, i);
|
|
1408
2878
|
}
|
|
1409
2879
|
})
|
|
1410
2880
|
});
|
|
1411
2881
|
}
|
|
1412
2882
|
//#endregion
|
|
1413
2883
|
//#region src/core/document/DocumentSection/DocumentSection.tsx
|
|
1414
|
-
var
|
|
2884
|
+
var Sn = [
|
|
1415
2885
|
"h2",
|
|
1416
2886
|
"h3",
|
|
1417
2887
|
"h4",
|
|
1418
2888
|
"h5",
|
|
1419
2889
|
"h6"
|
|
1420
2890
|
];
|
|
1421
|
-
function
|
|
1422
|
-
let x =
|
|
2891
|
+
function Cn({ sectionId: e, title: r, level: i = 0, ordinal: a, sectionNumbers: o, sectionAnchors: s, sectionTitles: c, sectionReferences: l, sectionLevels: u, continued: d = !1, continuedCount: f, children: p, blocks: m, profileId: h, profile: g, className: v, style: b }) {
|
|
2892
|
+
let x = g ?? K(h, "DocumentSection"), S = o?.[e], C = u?.[e], w = S ?? a, T = C === void 0 ? i : Math.max(0, C - 1), E = T >= (x?.depth.max ?? Infinity), D = Math.min(T, (x?.depth.indent.length ?? 1) - 1) + 1, O = x?.depth.numbering === "ladder" && w !== void 0 && w.length > 0, k = O ? zt(w) : null, A = Sn[Math.min(T, Sn.length - 1)], j = Ht(s, e), M = `${j}-doc-heading`;
|
|
1423
2893
|
return /* @__PURE__ */ n("section", {
|
|
1424
|
-
id:
|
|
1425
|
-
className:
|
|
2894
|
+
id: j,
|
|
2895
|
+
className: _("core-document-section", v),
|
|
1426
2896
|
"data-level": T,
|
|
1427
2897
|
"data-ordinal-source": w ? S ? "derived" : "baked" : void 0,
|
|
1428
|
-
"data-overdeep":
|
|
1429
|
-
"aria-labelledby":
|
|
1430
|
-
...
|
|
1431
|
-
style:
|
|
2898
|
+
"data-overdeep": E ? "" : void 0,
|
|
2899
|
+
"aria-labelledby": M,
|
|
2900
|
+
...Y(g?.id ?? h),
|
|
2901
|
+
style: y({ "--core-document-section-indent": `var(--doc-indent-${D}, 0)` }, b),
|
|
1432
2902
|
children: [
|
|
1433
|
-
|
|
2903
|
+
k && /* @__PURE__ */ t("div", {
|
|
1434
2904
|
className: "core-document-section__article",
|
|
1435
|
-
children:
|
|
2905
|
+
children: k
|
|
1436
2906
|
}),
|
|
1437
|
-
/* @__PURE__ */ n(
|
|
1438
|
-
id:
|
|
2907
|
+
/* @__PURE__ */ n(A, {
|
|
2908
|
+
id: M,
|
|
1439
2909
|
className: "core-document-section__heading",
|
|
1440
2910
|
children: [
|
|
1441
|
-
|
|
2911
|
+
O && !k && /* @__PURE__ */ t("span", {
|
|
1442
2912
|
className: "core-document-section__ordinal",
|
|
1443
2913
|
children: w.join(".")
|
|
1444
2914
|
}),
|
|
@@ -1455,20 +2925,20 @@ function bt({ sectionId: e, title: r, level: i = 0, ordinal: a, sectionNumbers:
|
|
|
1455
2925
|
}),
|
|
1456
2926
|
/* @__PURE__ */ t("div", {
|
|
1457
2927
|
className: "core-document-section__body",
|
|
1458
|
-
children: p ?? (m ? /* @__PURE__ */ t(
|
|
2928
|
+
children: p ?? (m ? /* @__PURE__ */ t(xn, {
|
|
1459
2929
|
blocks: m,
|
|
1460
|
-
profileId:
|
|
2930
|
+
profileId: h,
|
|
1461
2931
|
sectionNumbers: o,
|
|
1462
2932
|
sectionAnchors: s,
|
|
1463
2933
|
sectionTitles: c,
|
|
1464
2934
|
sectionReferences: l,
|
|
1465
|
-
sectionOrdinal:
|
|
2935
|
+
sectionOrdinal: O ? w : void 0
|
|
1466
2936
|
}) : null)
|
|
1467
2937
|
})
|
|
1468
2938
|
]
|
|
1469
2939
|
});
|
|
1470
2940
|
}
|
|
1471
|
-
var
|
|
2941
|
+
var wn = {
|
|
1472
2942
|
prose: {
|
|
1473
2943
|
type: "object",
|
|
1474
2944
|
required: ["kind", "text"],
|
|
@@ -1667,65 +3137,25 @@ var xt = {
|
|
|
1667
3137
|
note: { type: "string" }
|
|
1668
3138
|
}
|
|
1669
3139
|
}
|
|
1670
|
-
},
|
|
1671
|
-
"neutral",
|
|
1672
|
-
"strong",
|
|
1673
|
-
"accent",
|
|
1674
|
-
"info",
|
|
1675
|
-
"success",
|
|
1676
|
-
"warning",
|
|
1677
|
-
"danger"
|
|
1678
|
-
];
|
|
1679
|
-
function q(e, t = "neutral") {
|
|
1680
|
-
return typeof e == "string" && K.includes(e) ? e : t;
|
|
1681
|
-
}
|
|
1682
|
-
//#endregion
|
|
1683
|
-
//#region src/core/display/Eyebrow/Eyebrow.tsx
|
|
1684
|
-
var J = [
|
|
1685
|
-
"subtle",
|
|
1686
|
-
"on-dark",
|
|
1687
|
-
"inherit"
|
|
1688
|
-
];
|
|
1689
|
-
function Y(e, t) {
|
|
1690
|
-
return typeof e == "string" && (J.includes(e) || K.includes(e)) ? e : t;
|
|
1691
|
-
}
|
|
1692
|
-
function St(e) {
|
|
1693
|
-
return {
|
|
1694
|
-
"data-tone": e,
|
|
1695
|
-
toned: !J.includes(e)
|
|
1696
|
-
};
|
|
1697
|
-
}
|
|
1698
|
-
function X({ children: e, as: n = "span", tone: r, tabular: i = !1, className: a, style: o }) {
|
|
1699
|
-
let { toned: s, ...c } = St(Y(r, "subtle"));
|
|
1700
|
-
return /* @__PURE__ */ t(n, {
|
|
1701
|
-
className: h("core-eyebrow", s && "core-toned", a),
|
|
1702
|
-
...c,
|
|
1703
|
-
"data-tabular": i ? "true" : void 0,
|
|
1704
|
-
style: o,
|
|
1705
|
-
children: e
|
|
1706
|
-
});
|
|
1707
|
-
}
|
|
1708
|
-
//#endregion
|
|
1709
|
-
//#region src/core/display/Stat/Stat.tsx
|
|
1710
|
-
var Ct = [
|
|
3140
|
+
}, Tn = [
|
|
1711
3141
|
"md",
|
|
1712
3142
|
"lg",
|
|
1713
3143
|
"xl"
|
|
1714
|
-
],
|
|
1715
|
-
function
|
|
1716
|
-
let t =
|
|
1717
|
-
return t > 0 ?
|
|
3144
|
+
], En = 5;
|
|
3145
|
+
function Dn(e) {
|
|
3146
|
+
let t = Tn.indexOf(e);
|
|
3147
|
+
return t > 0 ? Tn[t - 1] : e;
|
|
1718
3148
|
}
|
|
1719
|
-
var
|
|
1720
|
-
function
|
|
3149
|
+
var On = (e) => typeof e == "object" && !!e && "format" in e && "value" in e;
|
|
3150
|
+
function kn(e) {
|
|
1721
3151
|
let t = Number(e);
|
|
1722
3152
|
return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
|
|
1723
3153
|
}
|
|
1724
|
-
function
|
|
1725
|
-
let d =
|
|
3154
|
+
function An({ value: e, label: r, size: i = "lg", tone: a, progress: o, progressLabel: s, autoStepDown: c = !0, className: l, style: u }) {
|
|
3155
|
+
let d = On(e) ? X(e) : e, f = typeof d == "string" || typeof d == "number" ? String(d).length : 0, p = c && f > En ? Dn(i) : i, m = B(a, "strong"), { toned: h, ...g } = ee(m), v = o == null ? null : kn(o);
|
|
1726
3156
|
return /* @__PURE__ */ n("div", {
|
|
1727
|
-
className:
|
|
1728
|
-
...
|
|
3157
|
+
className: _("core-stat", h && "core-toned", l),
|
|
3158
|
+
...g,
|
|
1729
3159
|
"data-size": p,
|
|
1730
3160
|
style: u,
|
|
1731
3161
|
children: [
|
|
@@ -1733,28 +3163,28 @@ function Ot({ value: e, label: r, size: i = "lg", tone: a, progress: o, progress
|
|
|
1733
3163
|
className: "core-stat__value",
|
|
1734
3164
|
children: d
|
|
1735
3165
|
}),
|
|
1736
|
-
r != null && /* @__PURE__ */ t(
|
|
3166
|
+
r != null && /* @__PURE__ */ t(V, {
|
|
1737
3167
|
className: "core-stat__label",
|
|
1738
3168
|
tone: m === "on-dark" || m === "inherit" ? m : "subtle",
|
|
1739
3169
|
children: r
|
|
1740
3170
|
}),
|
|
1741
|
-
|
|
3171
|
+
v !== null && /* @__PURE__ */ t("div", {
|
|
1742
3172
|
className: "core-stat__progress",
|
|
1743
3173
|
role: "progressbar",
|
|
1744
3174
|
"aria-label": s ?? (typeof r == "string" ? r : "Progress"),
|
|
1745
3175
|
"aria-valuemin": 0,
|
|
1746
3176
|
"aria-valuemax": 100,
|
|
1747
|
-
"aria-valuenow":
|
|
1748
|
-
style:
|
|
3177
|
+
"aria-valuenow": v,
|
|
3178
|
+
style: y({ "--core-stat-progress": `${v}%` }),
|
|
1749
3179
|
children: /* @__PURE__ */ t("div", { className: "core-stat__progress-fill" })
|
|
1750
3180
|
})
|
|
1751
3181
|
]
|
|
1752
3182
|
});
|
|
1753
3183
|
}
|
|
1754
|
-
function
|
|
3184
|
+
function jn({ children: e, minColumnWidth: n = 200, maxColumns: r = 4, gap: i = 32, className: a, style: o }) {
|
|
1755
3185
|
return /* @__PURE__ */ t("div", {
|
|
1756
|
-
className:
|
|
1757
|
-
style:
|
|
3186
|
+
className: _("core-stat-group", a),
|
|
3187
|
+
style: y({
|
|
1758
3188
|
"--core-stat-group-min": `${n}px`,
|
|
1759
3189
|
"--core-stat-group-max": String(Math.max(1, r)),
|
|
1760
3190
|
"--core-stat-group-gap": `${i}px`
|
|
@@ -1764,48 +3194,48 @@ function kt({ children: e, minColumnWidth: n = 200, maxColumns: r = 4, gap: i =
|
|
|
1764
3194
|
}
|
|
1765
3195
|
//#endregion
|
|
1766
3196
|
//#region src/core/display/_shared/Reveal.tsx
|
|
1767
|
-
var
|
|
3197
|
+
var Mn = {
|
|
1768
3198
|
up: [0, 28],
|
|
1769
3199
|
left: [-40, 0],
|
|
1770
3200
|
right: [40, 0],
|
|
1771
3201
|
none: [0, 0]
|
|
1772
3202
|
};
|
|
1773
|
-
function
|
|
1774
|
-
let u =
|
|
1775
|
-
|
|
3203
|
+
function Nn({ direction: e = "up", delay: n = 0, duration: r = .5, threshold: i = .15, once: a = !0, className: o, style: s, children: l }) {
|
|
3204
|
+
let u = p(null), [d, f] = m(!1);
|
|
3205
|
+
c(() => {
|
|
1776
3206
|
let e = u.current;
|
|
1777
3207
|
if (!e) return;
|
|
1778
3208
|
if (typeof IntersectionObserver > "u") {
|
|
1779
|
-
|
|
3209
|
+
f(!0);
|
|
1780
3210
|
return;
|
|
1781
3211
|
}
|
|
1782
3212
|
let t = new IntersectionObserver((e) => {
|
|
1783
3213
|
let n = e[e.length - 1];
|
|
1784
|
-
n && (n.isIntersecting ? (
|
|
3214
|
+
n && (n.isIntersecting ? (f(!0), a && t.disconnect()) : a || f(!1));
|
|
1785
3215
|
}, { threshold: Math.min(1, Math.max(0, i)) });
|
|
1786
3216
|
return t.observe(e), () => t.disconnect();
|
|
1787
3217
|
}, [a, i]);
|
|
1788
|
-
let [
|
|
3218
|
+
let [h, g] = Mn[e];
|
|
1789
3219
|
return /* @__PURE__ */ t("div", {
|
|
1790
3220
|
ref: u,
|
|
1791
|
-
className:
|
|
1792
|
-
"data-revealed":
|
|
1793
|
-
style:
|
|
1794
|
-
"--core-reveal-x": `${
|
|
1795
|
-
"--core-reveal-y": `${
|
|
3221
|
+
className: _("core-reveal", o),
|
|
3222
|
+
"data-revealed": d ? "true" : "false",
|
|
3223
|
+
style: y({
|
|
3224
|
+
"--core-reveal-x": `${h}px`,
|
|
3225
|
+
"--core-reveal-y": `${g}px`,
|
|
1796
3226
|
"--core-reveal-duration": `${r}s`,
|
|
1797
3227
|
"--core-reveal-delay": `${n}s`
|
|
1798
|
-
},
|
|
3228
|
+
}, s),
|
|
1799
3229
|
children: l
|
|
1800
3230
|
});
|
|
1801
3231
|
}
|
|
1802
3232
|
//#endregion
|
|
1803
3233
|
//#region src/core/display/SectionHeader/SectionHeader.tsx
|
|
1804
|
-
function
|
|
1805
|
-
return /* @__PURE__ */ t(
|
|
3234
|
+
function Pn({ eyebrow: e, title: r, description: i, trailing: a, revealDelay: o = 0, className: s, style: c }) {
|
|
3235
|
+
return /* @__PURE__ */ t(Nn, {
|
|
1806
3236
|
direction: "up",
|
|
1807
3237
|
delay: o,
|
|
1808
|
-
className:
|
|
3238
|
+
className: _("core-section-header", s),
|
|
1809
3239
|
style: c,
|
|
1810
3240
|
children: /* @__PURE__ */ n("div", {
|
|
1811
3241
|
className: "core-section-header__inner",
|
|
@@ -1813,7 +3243,7 @@ function jt({ eyebrow: e, title: r, description: i, trailing: a, revealDelay: o
|
|
|
1813
3243
|
children: [/* @__PURE__ */ n("div", {
|
|
1814
3244
|
className: "core-section-header__text",
|
|
1815
3245
|
children: [
|
|
1816
|
-
e ? /* @__PURE__ */ t(
|
|
3246
|
+
e ? /* @__PURE__ */ t(V, {
|
|
1817
3247
|
className: "core-section-header__eyebrow",
|
|
1818
3248
|
children: e
|
|
1819
3249
|
}) : null,
|
|
@@ -1835,10 +3265,10 @@ function jt({ eyebrow: e, title: r, description: i, trailing: a, revealDelay: o
|
|
|
1835
3265
|
}
|
|
1836
3266
|
//#endregion
|
|
1837
3267
|
//#region src/core/display/HighlightBox/HighlightBox.tsx
|
|
1838
|
-
function
|
|
1839
|
-
let l =
|
|
3268
|
+
function Fn({ tone: e, label: r, headline: i, children: a, trailing: o, className: s, style: c }) {
|
|
3269
|
+
let l = R(e, "accent"), u = o != null && o !== "";
|
|
1840
3270
|
return /* @__PURE__ */ n("div", {
|
|
1841
|
-
className:
|
|
3271
|
+
className: _("core-highlight-box", "core-toned", s),
|
|
1842
3272
|
"data-tone": l,
|
|
1843
3273
|
style: c,
|
|
1844
3274
|
children: [/* @__PURE__ */ n("div", {
|
|
@@ -1865,9 +3295,9 @@ function Mt({ tone: e, label: r, headline: i, children: a, trailing: o, classNam
|
|
|
1865
3295
|
}
|
|
1866
3296
|
//#endregion
|
|
1867
3297
|
//#region src/core/display/DisclaimerBlock/DisclaimerBlock.tsx
|
|
1868
|
-
function
|
|
3298
|
+
function In({ label: r, children: i, className: a, style: o }) {
|
|
1869
3299
|
return /* @__PURE__ */ n("div", {
|
|
1870
|
-
className:
|
|
3300
|
+
className: _("core-disclaimer-block", a),
|
|
1871
3301
|
style: o,
|
|
1872
3302
|
children: [r ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", {
|
|
1873
3303
|
className: "core-disclaimer-block__label",
|
|
@@ -1877,16 +3307,16 @@ function Nt({ label: r, children: i, className: a, style: o }) {
|
|
|
1877
3307
|
}
|
|
1878
3308
|
//#endregion
|
|
1879
3309
|
//#region src/core/display/StatStrip/StatStrip.tsx
|
|
1880
|
-
function
|
|
3310
|
+
function Ln(e) {
|
|
1881
3311
|
let t = Number(e);
|
|
1882
3312
|
return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
|
|
1883
3313
|
}
|
|
1884
|
-
function
|
|
1885
|
-
let l =
|
|
3314
|
+
function Rn({ label: e, value: r, fillPercent: i, subtitle: a, tone: o, className: s, style: c }) {
|
|
3315
|
+
let l = Ln(i);
|
|
1886
3316
|
return /* @__PURE__ */ n("div", {
|
|
1887
|
-
className:
|
|
1888
|
-
"data-tone":
|
|
1889
|
-
style:
|
|
3317
|
+
className: _("core-stat-strip", "core-toned", s),
|
|
3318
|
+
"data-tone": R(o, "info"),
|
|
3319
|
+
style: y({ "--core-stat-strip-fill": `${l}%` }, c),
|
|
1890
3320
|
children: [
|
|
1891
3321
|
/* @__PURE__ */ n("div", {
|
|
1892
3322
|
className: "core-stat-strip__row",
|
|
@@ -1895,7 +3325,7 @@ function Ft({ label: e, value: r, fillPercent: i, subtitle: a, tone: o, classNam
|
|
|
1895
3325
|
children: e
|
|
1896
3326
|
}), /* @__PURE__ */ t("span", {
|
|
1897
3327
|
className: "core-stat-strip__value",
|
|
1898
|
-
children:
|
|
3328
|
+
children: X(r)
|
|
1899
3329
|
})]
|
|
1900
3330
|
}),
|
|
1901
3331
|
/* @__PURE__ */ t("div", {
|
|
@@ -1904,37 +3334,37 @@ function Ft({ label: e, value: r, fillPercent: i, subtitle: a, tone: o, classNam
|
|
|
1904
3334
|
}),
|
|
1905
3335
|
a ? /* @__PURE__ */ t("div", {
|
|
1906
3336
|
className: "core-stat-strip__subtitle",
|
|
1907
|
-
children:
|
|
3337
|
+
children: X(a)
|
|
1908
3338
|
}) : null
|
|
1909
3339
|
]
|
|
1910
3340
|
});
|
|
1911
3341
|
}
|
|
1912
3342
|
//#endregion
|
|
1913
3343
|
//#region src/core/display/_shared/ValueBadge.tsx
|
|
1914
|
-
function
|
|
3344
|
+
function zn({ text: e, tone: n, className: r }) {
|
|
1915
3345
|
return /* @__PURE__ */ t("span", {
|
|
1916
|
-
className:
|
|
1917
|
-
"data-tone":
|
|
1918
|
-
children:
|
|
3346
|
+
className: _("core-value-badge", "core-toned", r),
|
|
3347
|
+
"data-tone": R(n),
|
|
3348
|
+
children: X(e)
|
|
1919
3349
|
});
|
|
1920
3350
|
}
|
|
1921
3351
|
//#endregion
|
|
1922
3352
|
//#region src/core/display/OptionCard/OptionCard.tsx
|
|
1923
|
-
var
|
|
3353
|
+
var Bn = 8, Vn = {
|
|
1924
3354
|
good: "success",
|
|
1925
3355
|
warn: "warning",
|
|
1926
3356
|
critical: "danger"
|
|
1927
3357
|
};
|
|
1928
|
-
function
|
|
1929
|
-
let r = { series: String(n %
|
|
3358
|
+
function Hn(e, t, n) {
|
|
3359
|
+
let r = { series: String(n % Bn + 1) }, i = e ?? t;
|
|
1930
3360
|
if (typeof i != "string" || i === "") return r;
|
|
1931
3361
|
if (i === "muted") return { series: "muted" };
|
|
1932
3362
|
let a = /^series-([1-9]\d*)$/.exec(i);
|
|
1933
|
-
if (a) return { series: String((Number(a[1]) - 1) %
|
|
1934
|
-
let o =
|
|
1935
|
-
return o ? { tone: o } :
|
|
3363
|
+
if (a) return { series: String((Number(a[1]) - 1) % Bn + 1) };
|
|
3364
|
+
let o = Vn[i];
|
|
3365
|
+
return o ? { tone: o } : I.includes(i) ? { tone: i } : (F("OptionCard:colour", `[OptionCard] bar fill "${i}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`), r);
|
|
1936
3366
|
}
|
|
1937
|
-
function
|
|
3367
|
+
function Un(e) {
|
|
1938
3368
|
return typeof e == "number" && Number.isFinite(e) ? {
|
|
1939
3369
|
text: String(e).padStart(2, "0"),
|
|
1940
3370
|
kind: "numeral"
|
|
@@ -1946,10 +3376,10 @@ function zt(e) {
|
|
|
1946
3376
|
kind: "label"
|
|
1947
3377
|
};
|
|
1948
3378
|
}
|
|
1949
|
-
function
|
|
1950
|
-
let { number: r, title: i, description: a, badgeText: o, badgeTone: s, bars: c, tone: l, isSelected: u = !1, className: d, style: f } = e, p = Array.isArray(c) ? c : [], m =
|
|
3379
|
+
function Wn(e) {
|
|
3380
|
+
let { number: r, title: i, description: a, badgeText: o, badgeTone: s, bars: c, tone: l, isSelected: u = !1, className: d, style: f } = e, p = Array.isArray(c) ? c : [], m = Un(r);
|
|
1951
3381
|
return /* @__PURE__ */ n("div", {
|
|
1952
|
-
className:
|
|
3382
|
+
className: _("core-option-card", d),
|
|
1953
3383
|
"data-selected": u ? "true" : void 0,
|
|
1954
3384
|
"data-described": a ? "true" : void 0,
|
|
1955
3385
|
style: f,
|
|
@@ -1960,9 +3390,9 @@ function Bt(e) {
|
|
|
1960
3390
|
className: "core-option-card__number",
|
|
1961
3391
|
"data-kind": m.kind,
|
|
1962
3392
|
children: m.text
|
|
1963
|
-
}) : /* @__PURE__ */ t("span", {}), o != null && o !== "" ? /* @__PURE__ */ t(
|
|
3393
|
+
}) : /* @__PURE__ */ t("span", {}), o != null && o !== "" ? /* @__PURE__ */ t(zn, {
|
|
1964
3394
|
text: o,
|
|
1965
|
-
tone:
|
|
3395
|
+
tone: R(s)
|
|
1966
3396
|
}) : null]
|
|
1967
3397
|
}),
|
|
1968
3398
|
i ? /* @__PURE__ */ t("div", {
|
|
@@ -1974,7 +3404,7 @@ function Bt(e) {
|
|
|
1974
3404
|
children: a
|
|
1975
3405
|
}) : null,
|
|
1976
3406
|
p.map((e, r) => {
|
|
1977
|
-
let i =
|
|
3407
|
+
let i = Hn(e.tone, l, r), a = Math.min(100, Math.max(0, Number(e.fillPercent) || 0)), o = e.valueTone === void 0 || e.valueTone === "default" ? void 0 : R(e.valueTone);
|
|
1978
3408
|
return /* @__PURE__ */ n("div", {
|
|
1979
3409
|
className: "core-option-card__bar",
|
|
1980
3410
|
children: [/* @__PURE__ */ n("div", {
|
|
@@ -1983,17 +3413,17 @@ function Bt(e) {
|
|
|
1983
3413
|
className: "core-option-card__bar-label",
|
|
1984
3414
|
children: e.label
|
|
1985
3415
|
}), /* @__PURE__ */ t("span", {
|
|
1986
|
-
className:
|
|
3416
|
+
className: _("core-option-card__bar-value", o && "core-toned"),
|
|
1987
3417
|
"data-tone": o,
|
|
1988
|
-
children:
|
|
3418
|
+
children: X(e.value)
|
|
1989
3419
|
})]
|
|
1990
3420
|
}), /* @__PURE__ */ t("div", {
|
|
1991
3421
|
className: "core-option-card__track",
|
|
1992
3422
|
children: /* @__PURE__ */ t("div", {
|
|
1993
|
-
className:
|
|
3423
|
+
className: _("core-option-card__fill", "tone" in i && "core-toned"),
|
|
1994
3424
|
"data-tone": "tone" in i ? i.tone : void 0,
|
|
1995
3425
|
"data-series": "series" in i ? i.series : void 0,
|
|
1996
|
-
style:
|
|
3426
|
+
style: y({ "--core-option-card-fill": `${a}%` })
|
|
1997
3427
|
})
|
|
1998
3428
|
})]
|
|
1999
3429
|
}, r);
|
|
@@ -2003,11 +3433,11 @@ function Bt(e) {
|
|
|
2003
3433
|
}
|
|
2004
3434
|
//#endregion
|
|
2005
3435
|
//#region src/core/display/ProfileCard/ProfileCard.tsx
|
|
2006
|
-
function
|
|
3436
|
+
function Gn(e) {
|
|
2007
3437
|
let { title: r, subtitle: i, rows: a, className: o, style: s } = e, c = e.tone ?? "info", l = c === "none", u = Array.isArray(a) ? a : [];
|
|
2008
3438
|
return /* @__PURE__ */ n("div", {
|
|
2009
|
-
className:
|
|
2010
|
-
"data-tone": l ? void 0 :
|
|
3439
|
+
className: _("core-profile-card", !l && "core-toned", o),
|
|
3440
|
+
"data-tone": l ? void 0 : R(c, "info"),
|
|
2011
3441
|
"data-marker": l ? "none" : void 0,
|
|
2012
3442
|
style: s,
|
|
2013
3443
|
children: [/* @__PURE__ */ n("div", {
|
|
@@ -2028,10 +3458,10 @@ function Vt(e) {
|
|
|
2028
3458
|
className: "core-profile-card__end",
|
|
2029
3459
|
children: [/* @__PURE__ */ t("span", {
|
|
2030
3460
|
className: "core-profile-card__value",
|
|
2031
|
-
children:
|
|
2032
|
-
}), e.badge ? /* @__PURE__ */ t(
|
|
3461
|
+
children: X(e.value)
|
|
3462
|
+
}), e.badge ? /* @__PURE__ */ t(zn, {
|
|
2033
3463
|
text: e.badge.text,
|
|
2034
|
-
tone:
|
|
3464
|
+
tone: R(e.badge.tone)
|
|
2035
3465
|
}) : null]
|
|
2036
3466
|
})]
|
|
2037
3467
|
}, r))]
|
|
@@ -2039,39 +3469,39 @@ function Vt(e) {
|
|
|
2039
3469
|
}
|
|
2040
3470
|
//#endregion
|
|
2041
3471
|
//#region src/core/display/KpiCardGrid/KpiCardGrid.tsx
|
|
2042
|
-
function
|
|
3472
|
+
function Kn(e) {
|
|
2043
3473
|
if (typeof e == "string") {
|
|
2044
3474
|
let t = e.trim();
|
|
2045
3475
|
return t.startsWith("+") ? "up" : t.startsWith("-") || t.startsWith("−") ? "down" : "flat";
|
|
2046
3476
|
}
|
|
2047
3477
|
return e && typeof e == "object" && typeof e.value == "number" ? e.value > 0 ? "up" : e.value < 0 ? "down" : "flat" : "flat";
|
|
2048
3478
|
}
|
|
2049
|
-
var
|
|
3479
|
+
var qn = {
|
|
2050
3480
|
up: "▲",
|
|
2051
3481
|
down: "▼",
|
|
2052
3482
|
flat: "—"
|
|
2053
|
-
},
|
|
3483
|
+
}, Jn = {
|
|
2054
3484
|
up: "success",
|
|
2055
3485
|
down: "danger",
|
|
2056
3486
|
flat: void 0
|
|
2057
|
-
},
|
|
2058
|
-
function
|
|
3487
|
+
}, Z = (e) => e != null && e !== "";
|
|
3488
|
+
function Yn(e) {
|
|
2059
3489
|
let { columns: r = 4, gap: i = "tight", minColumnWidth: a, className: o, style: s } = e, c = Array.isArray(e.cards) ? e.cards : [], l = Math.max(1, Math.min(6, Math.round(Number(r)) || 4));
|
|
2060
3490
|
return /* @__PURE__ */ t("div", {
|
|
2061
|
-
className:
|
|
3491
|
+
className: _("core-kpi-card-grid", o),
|
|
2062
3492
|
"data-gap": i === "normal" ? "normal" : "tight",
|
|
2063
|
-
style:
|
|
3493
|
+
style: y({
|
|
2064
3494
|
"--core-kpi-card-grid-columns": String(l),
|
|
2065
3495
|
"--core-kpi-card-grid-min": typeof a == "number" && a > 0 ? `${a}px` : void 0
|
|
2066
3496
|
}, s),
|
|
2067
3497
|
children: c.map((e, r) => {
|
|
2068
|
-
let { subtitle: i, badge: a } = e, o =
|
|
2069
|
-
return /* @__PURE__ */ t(
|
|
3498
|
+
let { subtitle: i, badge: a } = e, o = Z(e.tone) ? R(e.tone) : void 0, s = Z(e.delta) ? Kn(e.delta) : void 0, c = s ? Jn[s] : void 0;
|
|
3499
|
+
return /* @__PURE__ */ t(Nn, {
|
|
2070
3500
|
direction: "up",
|
|
2071
3501
|
delay: r * .06,
|
|
2072
3502
|
className: "core-kpi-card-grid__item",
|
|
2073
3503
|
children: /* @__PURE__ */ n("div", {
|
|
2074
|
-
className:
|
|
3504
|
+
className: _("core-kpi-card-grid__card", o && "core-toned"),
|
|
2075
3505
|
"data-tone": o,
|
|
2076
3506
|
children: [
|
|
2077
3507
|
/* @__PURE__ */ n("div", {
|
|
@@ -2079,31 +3509,31 @@ function Gt(e) {
|
|
|
2079
3509
|
children: [/* @__PURE__ */ t("div", {
|
|
2080
3510
|
className: "core-kpi-card-grid__label",
|
|
2081
3511
|
children: e.label
|
|
2082
|
-
}), a &&
|
|
3512
|
+
}), a && Z(a.text) ? /* @__PURE__ */ t(zn, {
|
|
2083
3513
|
text: a.text,
|
|
2084
|
-
tone:
|
|
3514
|
+
tone: R(a.tone)
|
|
2085
3515
|
}) : null]
|
|
2086
3516
|
}),
|
|
2087
3517
|
/* @__PURE__ */ t("div", {
|
|
2088
3518
|
className: "core-kpi-card-grid__value",
|
|
2089
|
-
children:
|
|
3519
|
+
children: X(e.value)
|
|
2090
3520
|
}),
|
|
2091
3521
|
s ? /* @__PURE__ */ n("div", {
|
|
2092
|
-
className:
|
|
3522
|
+
className: _("core-kpi-card-grid__delta", c && "core-toned"),
|
|
2093
3523
|
"data-tone": c,
|
|
2094
3524
|
"data-direction": s,
|
|
2095
3525
|
children: [
|
|
2096
3526
|
/* @__PURE__ */ t("span", {
|
|
2097
3527
|
"aria-hidden": "true",
|
|
2098
|
-
children:
|
|
3528
|
+
children: qn[s]
|
|
2099
3529
|
}),
|
|
2100
3530
|
" ",
|
|
2101
|
-
|
|
3531
|
+
X(e.delta)
|
|
2102
3532
|
]
|
|
2103
3533
|
}) : null,
|
|
2104
|
-
|
|
3534
|
+
Z(i) ? /* @__PURE__ */ t("div", {
|
|
2105
3535
|
className: "core-kpi-card-grid__subtitle",
|
|
2106
|
-
children:
|
|
3536
|
+
children: X(i)
|
|
2107
3537
|
}) : null
|
|
2108
3538
|
]
|
|
2109
3539
|
})
|
|
@@ -2113,27 +3543,47 @@ function Gt(e) {
|
|
|
2113
3543
|
}
|
|
2114
3544
|
//#endregion
|
|
2115
3545
|
//#region src/core/display/DataTable/DataTable.tsx
|
|
2116
|
-
function
|
|
2117
|
-
if (typeof e == "string" && e !== "" && e !== "default") return
|
|
3546
|
+
function Xn(e) {
|
|
3547
|
+
if (typeof e == "string" && e !== "" && e !== "default") return R(e);
|
|
2118
3548
|
}
|
|
2119
|
-
var
|
|
2120
|
-
function
|
|
2121
|
-
return
|
|
3549
|
+
var Zn = (e) => !!(e && typeof e == "object" && "value" in e && "format" in e), Qn = (e) => !!(e && typeof e == "object" && !Array.isArray(e) && !a(e) && "value" in e && !("format" in e));
|
|
3550
|
+
function $n(e) {
|
|
3551
|
+
return Qn(e) ? e : { value: e };
|
|
2122
3552
|
}
|
|
2123
|
-
|
|
2124
|
-
|
|
3553
|
+
var er = /^\d{4}-\d{2}-\d{2}$/, tr = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;
|
|
3554
|
+
function nr(e, t) {
|
|
3555
|
+
if (!tr.test(e)) return e;
|
|
3556
|
+
let n = er.test(e), r = new Date(n ? `${e}T00:00:00Z` : e.replace(" ", "T"));
|
|
3557
|
+
return Number.isNaN(r.getTime()) ? e : r.toLocaleString("en-CA", {
|
|
3558
|
+
year: "numeric",
|
|
3559
|
+
month: "short",
|
|
3560
|
+
day: "numeric",
|
|
3561
|
+
...t === "datetime" && !n ? {
|
|
3562
|
+
hour: "numeric",
|
|
3563
|
+
minute: "2-digit"
|
|
3564
|
+
} : {},
|
|
3565
|
+
...n ? { timeZone: "UTC" } : {}
|
|
3566
|
+
});
|
|
3567
|
+
}
|
|
3568
|
+
function rr(e) {
|
|
3569
|
+
if (!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e)) return e;
|
|
3570
|
+
let t = e.replace(/[_-]+/g, " ");
|
|
3571
|
+
return t[0].toUpperCase() + t.slice(1);
|
|
2125
3572
|
}
|
|
2126
|
-
function
|
|
2127
|
-
|
|
2128
|
-
|
|
3573
|
+
function ir(e, t) {
|
|
3574
|
+
return typeof e == "string" && t === "raw" ? e : typeof e == "string" && t ? nr(e, t) : typeof e == "string" && !t ? X(rr(e)) : typeof e == "string" || Zn(e) ? X(e) : typeof e == "number" ? String(e) : a(e) ? e : null;
|
|
3575
|
+
}
|
|
3576
|
+
function ar({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s }) {
|
|
3577
|
+
let c = `${l()}-title`, u = Array.isArray(i) ? i : [], d = Array.isArray(a) ? a : [], f = (e) => u[e]?.align ?? (e === 0 ? "left" : "right");
|
|
3578
|
+
return /* @__PURE__ */ t(Nn, {
|
|
2129
3579
|
direction: "up",
|
|
2130
3580
|
children: /* @__PURE__ */ n("div", {
|
|
2131
|
-
className:
|
|
3581
|
+
className: _("core-data-table", o),
|
|
2132
3582
|
style: s,
|
|
2133
3583
|
children: [e || r ? /* @__PURE__ */ n("div", {
|
|
2134
3584
|
className: "core-data-table__head",
|
|
2135
3585
|
children: [e ? /* @__PURE__ */ t("div", {
|
|
2136
|
-
id:
|
|
3586
|
+
id: c,
|
|
2137
3587
|
className: "core-data-table__title",
|
|
2138
3588
|
children: e
|
|
2139
3589
|
}) : null, r ? /* @__PURE__ */ t("div", {
|
|
@@ -2144,7 +3594,7 @@ function Zt({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s
|
|
|
2144
3594
|
className: "core-data-table__scroll",
|
|
2145
3595
|
role: "region",
|
|
2146
3596
|
"aria-label": e ? void 0 : "Data table, scrollable",
|
|
2147
|
-
"aria-labelledby": e ?
|
|
3597
|
+
"aria-labelledby": e ? c : void 0,
|
|
2148
3598
|
tabIndex: 0,
|
|
2149
3599
|
children: /* @__PURE__ */ n("table", {
|
|
2150
3600
|
className: "core-data-table__table",
|
|
@@ -2152,7 +3602,7 @@ function Zt({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s
|
|
|
2152
3602
|
scope: "col",
|
|
2153
3603
|
className: "core-data-table__col",
|
|
2154
3604
|
"data-align": f(r),
|
|
2155
|
-
style:
|
|
3605
|
+
style: y({ "--core-data-table-min": typeof e.minWidth == "number" && e.minWidth > 0 ? `${e.minWidth}px` : void 0 }),
|
|
2156
3606
|
children: [e.header, e.sublabel ? /* @__PURE__ */ t("span", {
|
|
2157
3607
|
className: "core-data-table__sublabel",
|
|
2158
3608
|
children: e.sublabel
|
|
@@ -2164,18 +3614,18 @@ function Zt({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s
|
|
|
2164
3614
|
"data-highlighted": r ? "true" : void 0,
|
|
2165
3615
|
"data-total": i ? "true" : void 0,
|
|
2166
3616
|
children: o.map((e, n) => {
|
|
2167
|
-
let r =
|
|
2168
|
-
className:
|
|
3617
|
+
let r = $n(e), i = Xn(r.tone), a = {
|
|
3618
|
+
className: _("core-data-table__cell", i && "core-toned"),
|
|
2169
3619
|
"data-align": f(n),
|
|
2170
3620
|
"data-tone": i
|
|
2171
3621
|
};
|
|
2172
3622
|
return n === 0 ? /* @__PURE__ */ t("th", {
|
|
2173
3623
|
scope: "row",
|
|
2174
3624
|
...a,
|
|
2175
|
-
children:
|
|
3625
|
+
children: ir(r.value, u[n]?.format)
|
|
2176
3626
|
}, n) : /* @__PURE__ */ t("td", {
|
|
2177
3627
|
...a,
|
|
2178
|
-
children:
|
|
3628
|
+
children: ir(r.value, u[n]?.format)
|
|
2179
3629
|
}, n);
|
|
2180
3630
|
})
|
|
2181
3631
|
}, n);
|
|
@@ -2186,6 +3636,576 @@ function Zt({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s
|
|
|
2186
3636
|
});
|
|
2187
3637
|
}
|
|
2188
3638
|
//#endregion
|
|
2189
|
-
|
|
3639
|
+
//#region src/core/events/_shared/event.ts
|
|
3640
|
+
function or(e, t, n) {
|
|
3641
|
+
return e.cardComponent && typeof t == "function" ? t(e.cardComponent, {
|
|
3642
|
+
...n,
|
|
3643
|
+
event: e
|
|
3644
|
+
}) ?? null : null;
|
|
3645
|
+
}
|
|
3646
|
+
var sr = [
|
|
3647
|
+
"accepted",
|
|
3648
|
+
"tentative",
|
|
3649
|
+
"declined"
|
|
3650
|
+
], cr = (e, t) => new Intl.DateTimeFormat(e, {
|
|
3651
|
+
weekday: "short",
|
|
3652
|
+
month: "short",
|
|
3653
|
+
day: "numeric",
|
|
3654
|
+
timeZone: t
|
|
3655
|
+
}), lr = (e, t) => new Intl.DateTimeFormat(e, {
|
|
3656
|
+
hour: "numeric",
|
|
3657
|
+
minute: "2-digit",
|
|
3658
|
+
timeZone: t
|
|
3659
|
+
});
|
|
3660
|
+
function ur(e, t, n) {
|
|
3661
|
+
if (e.startOn) {
|
|
3662
|
+
let n = /* @__PURE__ */ new Date(`${e.startOn}T00:00:00Z`), r = cr(t, "UTC").format(n);
|
|
3663
|
+
if (!e.endOn) return `${r} (all day)`;
|
|
3664
|
+
let i = /* @__PURE__ */ new Date((/* @__PURE__ */ new Date(`${e.endOn}T00:00:00Z`)).getTime() - 864e5);
|
|
3665
|
+
return i.getTime() <= n.getTime() ? `${r} (all day)` : `${r} – ${cr(t, "UTC").format(i)}`;
|
|
3666
|
+
}
|
|
3667
|
+
if (!e.startsAt) return "";
|
|
3668
|
+
let r = new Date(e.startsAt);
|
|
3669
|
+
if (Number.isNaN(r.getTime())) return "";
|
|
3670
|
+
let i = cr(t, n).format(r), a = lr(t, n).format(r);
|
|
3671
|
+
if (!e.endsAt) return `${i} · ${a}`;
|
|
3672
|
+
let o = new Date(e.endsAt);
|
|
3673
|
+
return Number.isNaN(o.getTime()) || o.getTime() === r.getTime() ? `${i} · ${a}` : `${i} · ${a} – ${lr(t, n).format(o)}`;
|
|
3674
|
+
}
|
|
3675
|
+
var dr = () => Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
3676
|
+
function fr(e) {
|
|
3677
|
+
if (!e) return;
|
|
3678
|
+
let t = new Date(e);
|
|
3679
|
+
return Number.isNaN(t.getTime()) ? void 0 : t.toISOString();
|
|
3680
|
+
}
|
|
3681
|
+
function pr() {
|
|
3682
|
+
let e = /* @__PURE__ */ new Date();
|
|
3683
|
+
return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 16);
|
|
3684
|
+
}
|
|
3685
|
+
function mr(e) {
|
|
3686
|
+
return e.success ? "" : e.code === "DENIED" ? "You can't do that here." : e.code === "CONFLICT" ? "Someone changed this first. Reload and try again." : e.code === "INVALID" ? e.errors || "Some details are missing or not valid." : e.errors || "Something went wrong. Try again.";
|
|
3687
|
+
}
|
|
3688
|
+
function hr(e, t) {
|
|
3689
|
+
let n = typeof e == "string" ? new Date(e) : e;
|
|
3690
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
3691
|
+
timeZone: t,
|
|
3692
|
+
year: "numeric",
|
|
3693
|
+
month: "2-digit",
|
|
3694
|
+
day: "2-digit"
|
|
3695
|
+
}).format(n);
|
|
3696
|
+
}
|
|
3697
|
+
function Q(e, t) {
|
|
3698
|
+
let n = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
|
|
3699
|
+
return n.setUTCDate(n.getUTCDate() + t), n.toISOString().slice(0, 10);
|
|
3700
|
+
}
|
|
3701
|
+
function gr(e) {
|
|
3702
|
+
return Q(e, -(((/* @__PURE__ */ new Date(`${e}T00:00:00Z`)).getUTCDay() + 6) % 7));
|
|
3703
|
+
}
|
|
3704
|
+
function _r(e, t) {
|
|
3705
|
+
if (e.startOn) {
|
|
3706
|
+
let t = e.endOn && e.endOn > e.startOn ? e.endOn : Q(e.startOn, 1), n = [];
|
|
3707
|
+
for (let r = e.startOn; r < t && n.length < 62; r = Q(r, 1)) n.push(r);
|
|
3708
|
+
return n;
|
|
3709
|
+
}
|
|
3710
|
+
return e.startsAt ? [hr(e.startsAt, t)] : [];
|
|
3711
|
+
}
|
|
3712
|
+
var $ = (e, t) => e && t ? e.split("{id}").join(encodeURIComponent(t)) : void 0;
|
|
3713
|
+
//#endregion
|
|
3714
|
+
//#region src/core/events/EventCard/EventCard.tsx
|
|
3715
|
+
function vr(r) {
|
|
3716
|
+
let { event: i, href: a, locale: o, timeZone: s, className: c, style: l } = r, u = i && typeof i == "object" ? i : { name: "" }, d = ur(u, o, s), f = u.status && u.status !== "confirmed" ? u.status : void 0, p = /* @__PURE__ */ n(e, { children: [
|
|
3717
|
+
/* @__PURE__ */ n("div", {
|
|
3718
|
+
className: "core-event-card__top",
|
|
3719
|
+
children: [u.typeName ? /* @__PURE__ */ t("span", {
|
|
3720
|
+
className: "core-event-card__type",
|
|
3721
|
+
children: u.typeName
|
|
3722
|
+
}) : null, f ? /* @__PURE__ */ t("span", {
|
|
3723
|
+
className: "core-event-card__status",
|
|
3724
|
+
"data-status": f,
|
|
3725
|
+
children: f
|
|
3726
|
+
}) : null]
|
|
3727
|
+
}),
|
|
3728
|
+
/* @__PURE__ */ t("div", {
|
|
3729
|
+
className: "core-event-card__name",
|
|
3730
|
+
children: u.name
|
|
3731
|
+
}),
|
|
3732
|
+
d ? /* @__PURE__ */ t("div", {
|
|
3733
|
+
className: "core-event-card__when",
|
|
3734
|
+
children: d
|
|
3735
|
+
}) : null,
|
|
3736
|
+
u.location ? /* @__PURE__ */ t("div", {
|
|
3737
|
+
className: "core-event-card__where",
|
|
3738
|
+
children: u.location
|
|
3739
|
+
}) : null
|
|
3740
|
+
] });
|
|
3741
|
+
return /* @__PURE__ */ t("div", {
|
|
3742
|
+
className: _("core-event-card", c),
|
|
3743
|
+
"data-kind": u.kind,
|
|
3744
|
+
"data-status": u.status,
|
|
3745
|
+
style: l,
|
|
3746
|
+
children: a ? /* @__PURE__ */ t("a", {
|
|
3747
|
+
className: "core-event-card__link",
|
|
3748
|
+
href: a,
|
|
3749
|
+
children: p
|
|
3750
|
+
}) : p
|
|
3751
|
+
});
|
|
3752
|
+
}
|
|
3753
|
+
//#endregion
|
|
3754
|
+
//#region src/core/events/EventRespond/EventRespond.tsx
|
|
3755
|
+
var yr = {
|
|
3756
|
+
accepted: "Accept",
|
|
3757
|
+
tentative: "Maybe",
|
|
3758
|
+
declined: "Decline"
|
|
3759
|
+
};
|
|
3760
|
+
function br(e) {
|
|
3761
|
+
let { actions: r, className: i, style: a } = e, [o, s] = m(e.response), [c, l] = m(!1), [u, d] = m(""), f = r?.respond, p = async (e) => {
|
|
3762
|
+
if (!f || c) return;
|
|
3763
|
+
l(!0), d("");
|
|
3764
|
+
let t = await f({ response: e });
|
|
3765
|
+
l(!1), t.success ? s(e) : d(mr(t));
|
|
3766
|
+
};
|
|
3767
|
+
return /* @__PURE__ */ n("div", {
|
|
3768
|
+
className: _("core-event-respond", i),
|
|
3769
|
+
style: a,
|
|
3770
|
+
children: [/* @__PURE__ */ t("div", {
|
|
3771
|
+
className: "core-event-respond__choices",
|
|
3772
|
+
role: "group",
|
|
3773
|
+
"aria-label": "Your response",
|
|
3774
|
+
children: sr.map((e) => /* @__PURE__ */ t("button", {
|
|
3775
|
+
type: "button",
|
|
3776
|
+
className: "core-event-respond__choice",
|
|
3777
|
+
"aria-pressed": o === e,
|
|
3778
|
+
disabled: !f || c,
|
|
3779
|
+
onClick: () => void p(e),
|
|
3780
|
+
children: yr[e]
|
|
3781
|
+
}, e))
|
|
3782
|
+
}), u ? /* @__PURE__ */ t("p", {
|
|
3783
|
+
className: "core-event-respond__message",
|
|
3784
|
+
role: "alert",
|
|
3785
|
+
children: u
|
|
3786
|
+
}) : null]
|
|
3787
|
+
});
|
|
3788
|
+
}
|
|
3789
|
+
//#endregion
|
|
3790
|
+
//#region src/core/events/EventDetail/EventDetail.tsx
|
|
3791
|
+
function xr(e) {
|
|
3792
|
+
let { event: r, actions: i, viewerResponse: a, locale: o, timeZone: s, className: c, style: l } = e, u = r && typeof r == "object" ? r : { name: "" }, d = Array.isArray(e.notes) ? e.notes : [], f = Array.isArray(e.participants) ? e.participants : [], p = ur(u, o, s);
|
|
3793
|
+
return /* @__PURE__ */ n("article", {
|
|
3794
|
+
className: _("core-event-detail", c),
|
|
3795
|
+
"data-status": u.status,
|
|
3796
|
+
style: l,
|
|
3797
|
+
children: [
|
|
3798
|
+
/* @__PURE__ */ n("header", {
|
|
3799
|
+
className: "core-event-detail__head",
|
|
3800
|
+
children: [
|
|
3801
|
+
u.typeName ? /* @__PURE__ */ t("div", {
|
|
3802
|
+
className: "core-event-detail__type",
|
|
3803
|
+
children: u.typeName
|
|
3804
|
+
}) : null,
|
|
3805
|
+
/* @__PURE__ */ t("h2", {
|
|
3806
|
+
className: "core-event-detail__name",
|
|
3807
|
+
children: u.name
|
|
3808
|
+
}),
|
|
3809
|
+
p ? /* @__PURE__ */ t("div", {
|
|
3810
|
+
className: "core-event-detail__meta",
|
|
3811
|
+
children: p
|
|
3812
|
+
}) : null,
|
|
3813
|
+
u.location ? /* @__PURE__ */ t("div", {
|
|
3814
|
+
className: "core-event-detail__meta",
|
|
3815
|
+
children: u.location
|
|
3816
|
+
}) : null,
|
|
3817
|
+
u.status && u.status !== "confirmed" ? /* @__PURE__ */ t("div", {
|
|
3818
|
+
className: "core-event-detail__status",
|
|
3819
|
+
children: u.status
|
|
3820
|
+
}) : null
|
|
3821
|
+
]
|
|
3822
|
+
}),
|
|
3823
|
+
a === void 0 ? null : /* @__PURE__ */ t(br, {
|
|
3824
|
+
response: a,
|
|
3825
|
+
actions: i,
|
|
3826
|
+
className: "core-event-detail__respond"
|
|
3827
|
+
}),
|
|
3828
|
+
f.length ? /* @__PURE__ */ n("section", {
|
|
3829
|
+
className: "core-event-detail__section",
|
|
3830
|
+
"aria-label": "Participants",
|
|
3831
|
+
children: [/* @__PURE__ */ t("h3", {
|
|
3832
|
+
className: "core-event-detail__heading",
|
|
3833
|
+
children: "Participants"
|
|
3834
|
+
}), /* @__PURE__ */ t("ul", {
|
|
3835
|
+
className: "core-event-detail__list",
|
|
3836
|
+
children: f.map((e, r) => /* @__PURE__ */ n("li", {
|
|
3837
|
+
className: "core-event-detail__person",
|
|
3838
|
+
children: [/* @__PURE__ */ t("span", { children: e.name }), /* @__PURE__ */ t("span", {
|
|
3839
|
+
className: "core-event-detail__muted",
|
|
3840
|
+
children: [e.role, e.response && e.response !== "needs_action" ? e.response : void 0].filter(Boolean).join(" · ")
|
|
3841
|
+
})]
|
|
3842
|
+
}, r))
|
|
3843
|
+
})]
|
|
3844
|
+
}) : null,
|
|
3845
|
+
d.length ? /* @__PURE__ */ n("section", {
|
|
3846
|
+
className: "core-event-detail__section",
|
|
3847
|
+
"aria-label": "Notes",
|
|
3848
|
+
children: [/* @__PURE__ */ t("h3", {
|
|
3849
|
+
className: "core-event-detail__heading",
|
|
3850
|
+
children: "Notes"
|
|
3851
|
+
}), d.map((e, r) => /* @__PURE__ */ n("div", {
|
|
3852
|
+
className: "core-event-detail__note",
|
|
3853
|
+
"data-audience": e.audience,
|
|
3854
|
+
children: [
|
|
3855
|
+
e.audience === "staff" ? /* @__PURE__ */ t("div", {
|
|
3856
|
+
className: "core-event-detail__badge",
|
|
3857
|
+
children: "Staff only"
|
|
3858
|
+
}) : null,
|
|
3859
|
+
/* @__PURE__ */ t("p", {
|
|
3860
|
+
className: "core-event-detail__body",
|
|
3861
|
+
children: e.body
|
|
3862
|
+
}),
|
|
3863
|
+
e.author || e.createdAt ? /* @__PURE__ */ t("div", {
|
|
3864
|
+
className: "core-event-detail__muted",
|
|
3865
|
+
children: [e.author, e.createdAt ? new Date(e.createdAt).toLocaleString(o, { timeZone: s }) : void 0].filter(Boolean).join(" · ")
|
|
3866
|
+
}) : null
|
|
3867
|
+
]
|
|
3868
|
+
}, r))]
|
|
3869
|
+
}) : null
|
|
3870
|
+
]
|
|
3871
|
+
});
|
|
3872
|
+
}
|
|
3873
|
+
//#endregion
|
|
3874
|
+
//#region src/core/events/EventLogForm/EventLogForm.tsx
|
|
3875
|
+
var Sr = (e) => {
|
|
3876
|
+
let t = e?.dataSchema?.properties ?? {}, n = new Set(e?.dataSchema?.required ?? []);
|
|
3877
|
+
return Object.entries(t).map(([e, t]) => [
|
|
3878
|
+
e,
|
|
3879
|
+
t,
|
|
3880
|
+
n.has(e)
|
|
3881
|
+
]);
|
|
3882
|
+
};
|
|
3883
|
+
function Cr(e) {
|
|
3884
|
+
let { orgId: r, projectId: i, actions: a, onDone: o, canWriteStaffNotes: s, className: c, style: u } = e, f = Array.isArray(e.types) ? e.types : [], p = l(), [h, g] = m(e.defaultTypeId ?? f[0]?.id ?? ""), v = f.find((e) => e.id === h), y = v?.kind === "scheduled", [b, x] = m(""), [S, C] = m(pr()), [w, T] = m(""), [E, D] = m(""), [O, k] = m({}), [A, j] = m(""), [M, N] = m(!!s), [P, F] = m(!1), [I, L] = m(""), R = d(() => Sr(v), [v]);
|
|
3885
|
+
if (!f.length) return /* @__PURE__ */ t("p", {
|
|
3886
|
+
className: _("core-event-log", "core-event-log__empty", c),
|
|
3887
|
+
style: u,
|
|
3888
|
+
children: "There's nothing you can log here."
|
|
3889
|
+
});
|
|
3890
|
+
let z = async (t) => {
|
|
3891
|
+
if (t.preventDefault(), !a?.logEvent || P || !v) return;
|
|
3892
|
+
F(!0), L("");
|
|
3893
|
+
let n = fr(S), c = {
|
|
3894
|
+
event_type_id: v.id,
|
|
3895
|
+
org_id: r,
|
|
3896
|
+
name: b.trim() || v.name,
|
|
3897
|
+
starts_at: n,
|
|
3898
|
+
tzid: dr(),
|
|
3899
|
+
data: O,
|
|
3900
|
+
subjects: e.subjects ? [...e.subjects] : []
|
|
3901
|
+
};
|
|
3902
|
+
i && (c.project_id = i), y && w && (c.ends_at = fr(w)), E.trim() && (c.location = E.trim());
|
|
3903
|
+
let l = A.trim() ? [{
|
|
3904
|
+
body: A.trim(),
|
|
3905
|
+
audience: s && M ? "staff" : "shared"
|
|
3906
|
+
}] : void 0, u = await a.logEvent(l ? {
|
|
3907
|
+
event: c,
|
|
3908
|
+
notes: l
|
|
3909
|
+
} : { event: c });
|
|
3910
|
+
F(!1), u.success ? (x(""), j(""), k({}), o?.(u)) : L(mr(u));
|
|
3911
|
+
}, B = (e, t) => k((n) => ({
|
|
3912
|
+
...n,
|
|
3913
|
+
[e]: t
|
|
3914
|
+
}));
|
|
3915
|
+
return /* @__PURE__ */ n("form", {
|
|
3916
|
+
className: _("core-event-log", c),
|
|
3917
|
+
style: u,
|
|
3918
|
+
onSubmit: (e) => void z(e),
|
|
3919
|
+
children: [
|
|
3920
|
+
/* @__PURE__ */ n("label", {
|
|
3921
|
+
className: "core-event-log__field",
|
|
3922
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3923
|
+
className: "core-event-log__label",
|
|
3924
|
+
children: "Type"
|
|
3925
|
+
}), /* @__PURE__ */ t("select", {
|
|
3926
|
+
value: h,
|
|
3927
|
+
onChange: (e) => {
|
|
3928
|
+
g(e.target.value), k({});
|
|
3929
|
+
},
|
|
3930
|
+
children: f.map((e) => /* @__PURE__ */ t("option", {
|
|
3931
|
+
value: e.id,
|
|
3932
|
+
children: e.name
|
|
3933
|
+
}, e.id))
|
|
3934
|
+
})]
|
|
3935
|
+
}),
|
|
3936
|
+
/* @__PURE__ */ n("label", {
|
|
3937
|
+
className: "core-event-log__field",
|
|
3938
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3939
|
+
className: "core-event-log__label",
|
|
3940
|
+
children: "Title"
|
|
3941
|
+
}), /* @__PURE__ */ t("input", {
|
|
3942
|
+
value: b,
|
|
3943
|
+
onChange: (e) => x(e.target.value),
|
|
3944
|
+
placeholder: v?.name
|
|
3945
|
+
})]
|
|
3946
|
+
}),
|
|
3947
|
+
/* @__PURE__ */ n("div", {
|
|
3948
|
+
className: "core-event-log__row",
|
|
3949
|
+
children: [/* @__PURE__ */ n("label", {
|
|
3950
|
+
className: "core-event-log__field",
|
|
3951
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3952
|
+
className: "core-event-log__label",
|
|
3953
|
+
children: y ? "Starts" : "When"
|
|
3954
|
+
}), /* @__PURE__ */ t("input", {
|
|
3955
|
+
type: "datetime-local",
|
|
3956
|
+
required: !0,
|
|
3957
|
+
value: S,
|
|
3958
|
+
onChange: (e) => C(e.target.value)
|
|
3959
|
+
})]
|
|
3960
|
+
}), y ? /* @__PURE__ */ n("label", {
|
|
3961
|
+
className: "core-event-log__field",
|
|
3962
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3963
|
+
className: "core-event-log__label",
|
|
3964
|
+
children: "Ends"
|
|
3965
|
+
}), /* @__PURE__ */ t("input", {
|
|
3966
|
+
type: "datetime-local",
|
|
3967
|
+
value: w,
|
|
3968
|
+
min: S,
|
|
3969
|
+
onChange: (e) => T(e.target.value)
|
|
3970
|
+
})]
|
|
3971
|
+
}) : null]
|
|
3972
|
+
}),
|
|
3973
|
+
/* @__PURE__ */ n("label", {
|
|
3974
|
+
className: "core-event-log__field",
|
|
3975
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3976
|
+
className: "core-event-log__label",
|
|
3977
|
+
children: "Where"
|
|
3978
|
+
}), /* @__PURE__ */ t("input", {
|
|
3979
|
+
value: E,
|
|
3980
|
+
onChange: (e) => D(e.target.value)
|
|
3981
|
+
})]
|
|
3982
|
+
}),
|
|
3983
|
+
R.map(([e, r, i]) => {
|
|
3984
|
+
let a = r.title ?? e;
|
|
3985
|
+
if (r.enum) return /* @__PURE__ */ n("label", {
|
|
3986
|
+
className: "core-event-log__field",
|
|
3987
|
+
children: [/* @__PURE__ */ t("span", {
|
|
3988
|
+
className: "core-event-log__label",
|
|
3989
|
+
children: a
|
|
3990
|
+
}), /* @__PURE__ */ n("select", {
|
|
3991
|
+
required: i,
|
|
3992
|
+
value: String(O[e] ?? ""),
|
|
3993
|
+
onChange: (t) => B(e, t.target.value || void 0),
|
|
3994
|
+
children: [/* @__PURE__ */ t("option", {
|
|
3995
|
+
value: "",
|
|
3996
|
+
children: "—"
|
|
3997
|
+
}), r.enum.map((e) => /* @__PURE__ */ t("option", {
|
|
3998
|
+
value: e,
|
|
3999
|
+
children: e
|
|
4000
|
+
}, e))]
|
|
4001
|
+
})]
|
|
4002
|
+
}, e);
|
|
4003
|
+
if (r.type === "boolean") return /* @__PURE__ */ n("label", {
|
|
4004
|
+
className: "core-event-log__check",
|
|
4005
|
+
children: [/* @__PURE__ */ t("input", {
|
|
4006
|
+
type: "checkbox",
|
|
4007
|
+
checked: !!O[e],
|
|
4008
|
+
onChange: (t) => B(e, t.target.checked)
|
|
4009
|
+
}), /* @__PURE__ */ t("span", { children: a })]
|
|
4010
|
+
}, e);
|
|
4011
|
+
let o = r.type === "number" || r.type === "integer";
|
|
4012
|
+
return /* @__PURE__ */ n("label", {
|
|
4013
|
+
className: "core-event-log__field",
|
|
4014
|
+
children: [/* @__PURE__ */ t("span", {
|
|
4015
|
+
className: "core-event-log__label",
|
|
4016
|
+
children: a
|
|
4017
|
+
}), /* @__PURE__ */ t("input", {
|
|
4018
|
+
type: o ? "number" : "text",
|
|
4019
|
+
step: r.type === "integer" ? 1 : "any",
|
|
4020
|
+
required: i,
|
|
4021
|
+
value: O[e] === void 0 ? "" : String(O[e]),
|
|
4022
|
+
onChange: (t) => B(e, t.target.value === "" ? void 0 : o ? Number(t.target.value) : t.target.value)
|
|
4023
|
+
})]
|
|
4024
|
+
}, e);
|
|
4025
|
+
}),
|
|
4026
|
+
/* @__PURE__ */ n("label", {
|
|
4027
|
+
className: "core-event-log__field",
|
|
4028
|
+
children: [/* @__PURE__ */ t("span", {
|
|
4029
|
+
className: "core-event-log__label",
|
|
4030
|
+
children: "Note"
|
|
4031
|
+
}), /* @__PURE__ */ t("textarea", {
|
|
4032
|
+
rows: 3,
|
|
4033
|
+
value: A,
|
|
4034
|
+
onChange: (e) => j(e.target.value)
|
|
4035
|
+
})]
|
|
4036
|
+
}),
|
|
4037
|
+
s && A.trim() ? /* @__PURE__ */ n("label", {
|
|
4038
|
+
className: "core-event-log__check",
|
|
4039
|
+
children: [/* @__PURE__ */ t("input", {
|
|
4040
|
+
type: "checkbox",
|
|
4041
|
+
checked: M,
|
|
4042
|
+
onChange: (e) => N(e.target.checked)
|
|
4043
|
+
}), /* @__PURE__ */ t("span", { children: "Staff only: the client won't see this note" })]
|
|
4044
|
+
}) : null,
|
|
4045
|
+
I ? /* @__PURE__ */ t("p", {
|
|
4046
|
+
id: `${p}-error`,
|
|
4047
|
+
className: "core-event-log__message",
|
|
4048
|
+
role: "alert",
|
|
4049
|
+
children: I
|
|
4050
|
+
}) : null,
|
|
4051
|
+
/* @__PURE__ */ t("div", {
|
|
4052
|
+
className: "core-event-log__actions",
|
|
4053
|
+
children: /* @__PURE__ */ t("button", {
|
|
4054
|
+
type: "submit",
|
|
4055
|
+
className: "core-event-log__submit",
|
|
4056
|
+
disabled: P || !a?.logEvent,
|
|
4057
|
+
children: P ? "Saving…" : y ? "Schedule" : "Log"
|
|
4058
|
+
})
|
|
4059
|
+
})
|
|
4060
|
+
]
|
|
4061
|
+
});
|
|
4062
|
+
}
|
|
4063
|
+
//#endregion
|
|
4064
|
+
//#region src/core/events/EventSchedule/EventSchedule.tsx
|
|
4065
|
+
var wr = (e, t) => new Intl.DateTimeFormat(t, {
|
|
4066
|
+
weekday: "short",
|
|
4067
|
+
month: "short",
|
|
4068
|
+
day: "numeric",
|
|
4069
|
+
timeZone: "UTC"
|
|
4070
|
+
}).format(/* @__PURE__ */ new Date(`${e}T00:00:00Z`));
|
|
4071
|
+
function Tr(e) {
|
|
4072
|
+
let { view: r = "week", weekParam: i = "week", eventHref: a = "?panel=event:{id}", locale: o, timeZone: s, renderComponent: c, className: l, style: u } = e, d = Array.isArray(e.occurrences) ? e.occurrences : [], f = hr(/* @__PURE__ */ new Date(), s), p = gr(/^\d{4}-\d{2}-\d{2}$/.test(e.weekOf ?? "") ? e.weekOf : f), m = Array.from({ length: 7 }, (e, t) => Q(p, t)), h = new Map(m.map((e) => [e, []]));
|
|
4073
|
+
for (let e of d) for (let t of _r(e, s)) h.get(t)?.push(e);
|
|
4074
|
+
for (let e of h.values()) e.sort((e, t) => +!e.startOn - !t.startOn || (e.startsAt ?? "").localeCompare(t.startsAt ?? ""));
|
|
4075
|
+
let g = r === "agenda" ? m.filter((e) => h.get(e).length) : m;
|
|
4076
|
+
return /* @__PURE__ */ n("section", {
|
|
4077
|
+
className: _("core-event-schedule", l),
|
|
4078
|
+
"data-view": r,
|
|
4079
|
+
style: u,
|
|
4080
|
+
"aria-label": "Schedule",
|
|
4081
|
+
children: [
|
|
4082
|
+
/* @__PURE__ */ n("div", {
|
|
4083
|
+
className: "core-event-schedule__nav",
|
|
4084
|
+
children: [
|
|
4085
|
+
/* @__PURE__ */ t("a", {
|
|
4086
|
+
className: "core-event-schedule__step",
|
|
4087
|
+
href: `?${i}=${Q(p, -7)}`,
|
|
4088
|
+
"aria-label": "Previous week",
|
|
4089
|
+
children: "‹"
|
|
4090
|
+
}),
|
|
4091
|
+
/* @__PURE__ */ t("span", {
|
|
4092
|
+
className: "core-event-schedule__range",
|
|
4093
|
+
children: `${wr(m[0], o)} – ${wr(m[6], o)}`
|
|
4094
|
+
}),
|
|
4095
|
+
/* @__PURE__ */ t("a", {
|
|
4096
|
+
className: "core-event-schedule__step",
|
|
4097
|
+
href: `?${i}=${Q(p, 7)}`,
|
|
4098
|
+
"aria-label": "Next week",
|
|
4099
|
+
children: "›"
|
|
4100
|
+
})
|
|
4101
|
+
]
|
|
4102
|
+
}),
|
|
4103
|
+
g.length === 0 ? /* @__PURE__ */ t("p", {
|
|
4104
|
+
className: "core-event-schedule__empty",
|
|
4105
|
+
children: "Nothing scheduled this week."
|
|
4106
|
+
}) : null,
|
|
4107
|
+
/* @__PURE__ */ t("ol", {
|
|
4108
|
+
className: "core-event-schedule__days",
|
|
4109
|
+
children: g.map((e) => {
|
|
4110
|
+
let r = h.get(e);
|
|
4111
|
+
return /* @__PURE__ */ n("li", {
|
|
4112
|
+
className: "core-event-schedule__day",
|
|
4113
|
+
"data-today": e === f || void 0,
|
|
4114
|
+
children: [/* @__PURE__ */ t("h3", {
|
|
4115
|
+
className: "core-event-schedule__date",
|
|
4116
|
+
children: wr(e, o)
|
|
4117
|
+
}), r.length ? /* @__PURE__ */ t("ul", {
|
|
4118
|
+
className: "core-event-schedule__events",
|
|
4119
|
+
children: r.map((e, n) => /* @__PURE__ */ t("li", { children: or(e, c, {
|
|
4120
|
+
href: $(a, e.id),
|
|
4121
|
+
locale: o,
|
|
4122
|
+
timeZone: s
|
|
4123
|
+
}) ?? /* @__PURE__ */ t(vr, {
|
|
4124
|
+
event: e,
|
|
4125
|
+
href: $(a, e.id),
|
|
4126
|
+
locale: o,
|
|
4127
|
+
timeZone: s
|
|
4128
|
+
}) }, `${e.id ?? n}-${e.startsAt ?? e.startOn ?? n}`))
|
|
4129
|
+
}) : /* @__PURE__ */ t("p", {
|
|
4130
|
+
className: "core-event-schedule__none",
|
|
4131
|
+
children: "—"
|
|
4132
|
+
})]
|
|
4133
|
+
}, e);
|
|
4134
|
+
})
|
|
4135
|
+
})
|
|
4136
|
+
]
|
|
4137
|
+
});
|
|
4138
|
+
}
|
|
4139
|
+
//#endregion
|
|
4140
|
+
//#region src/core/events/EventTimeline/EventTimeline.tsx
|
|
4141
|
+
var Er = (e, t) => new Intl.DateTimeFormat(t, {
|
|
4142
|
+
weekday: "long",
|
|
4143
|
+
month: "long",
|
|
4144
|
+
day: "numeric",
|
|
4145
|
+
year: "numeric",
|
|
4146
|
+
timeZone: "UTC"
|
|
4147
|
+
}).format(/* @__PURE__ */ new Date(`${e}T00:00:00Z`));
|
|
4148
|
+
function Dr(e) {
|
|
4149
|
+
let { eventHref: r = "?panel=event:{id}", emptyText: i = "No activity yet.", locale: a, timeZone: o, renderComponent: s, className: c, style: l } = e, u = [...(Array.isArray(e.items) ? e.items : []).filter((e) => e && !Number.isNaN(new Date(e.at).getTime()))].sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime()), d = [];
|
|
4150
|
+
for (let e of u) {
|
|
4151
|
+
let t = hr(e.at, o), n = d[d.length - 1];
|
|
4152
|
+
n && n[0] === t ? n[1].push(e) : d.push([t, [e]]);
|
|
4153
|
+
}
|
|
4154
|
+
let f = new Intl.DateTimeFormat(a, {
|
|
4155
|
+
hour: "numeric",
|
|
4156
|
+
minute: "2-digit",
|
|
4157
|
+
timeZone: o
|
|
4158
|
+
});
|
|
4159
|
+
return /* @__PURE__ */ n("section", {
|
|
4160
|
+
className: _("core-event-timeline", c),
|
|
4161
|
+
style: l,
|
|
4162
|
+
"aria-label": "Activity",
|
|
4163
|
+
children: [d.length === 0 ? /* @__PURE__ */ t("p", {
|
|
4164
|
+
className: "core-event-timeline__empty",
|
|
4165
|
+
children: i
|
|
4166
|
+
}) : null, d.map(([e, i]) => /* @__PURE__ */ n("section", {
|
|
4167
|
+
className: "core-event-timeline__day",
|
|
4168
|
+
children: [/* @__PURE__ */ t("h3", {
|
|
4169
|
+
className: "core-event-timeline__date",
|
|
4170
|
+
children: Er(e, a)
|
|
4171
|
+
}), /* @__PURE__ */ t("ol", {
|
|
4172
|
+
className: "core-event-timeline__items",
|
|
4173
|
+
children: i.map((e, i) => /* @__PURE__ */ n("li", {
|
|
4174
|
+
className: "core-event-timeline__item",
|
|
4175
|
+
"data-op": e.op || void 0,
|
|
4176
|
+
children: [/* @__PURE__ */ n("div", {
|
|
4177
|
+
className: "core-event-timeline__line",
|
|
4178
|
+
children: [
|
|
4179
|
+
/* @__PURE__ */ t("time", {
|
|
4180
|
+
className: "core-event-timeline__time",
|
|
4181
|
+
dateTime: e.at,
|
|
4182
|
+
children: f.format(new Date(e.at))
|
|
4183
|
+
}),
|
|
4184
|
+
e.summary ? /* @__PURE__ */ t("span", {
|
|
4185
|
+
className: "core-event-timeline__summary",
|
|
4186
|
+
children: e.summary
|
|
4187
|
+
}) : null,
|
|
4188
|
+
e.actor ? /* @__PURE__ */ t("span", {
|
|
4189
|
+
className: "core-event-timeline__actor",
|
|
4190
|
+
children: e.actor
|
|
4191
|
+
}) : null
|
|
4192
|
+
]
|
|
4193
|
+
}), e.event ? or(e.event, s, {
|
|
4194
|
+
href: $(r, e.event.id),
|
|
4195
|
+
locale: a,
|
|
4196
|
+
timeZone: o
|
|
4197
|
+
}) ?? /* @__PURE__ */ t(vr, {
|
|
4198
|
+
event: e.event,
|
|
4199
|
+
href: $(r, e.event.id),
|
|
4200
|
+
locale: a,
|
|
4201
|
+
timeZone: o
|
|
4202
|
+
}) : null]
|
|
4203
|
+
}, e.id ?? `${e.at}-${i}`))
|
|
4204
|
+
})]
|
|
4205
|
+
}, e))]
|
|
4206
|
+
});
|
|
4207
|
+
}
|
|
4208
|
+
//#endregion
|
|
4209
|
+
export { Kt as ANSWER_COLUMN_PX, Le as Accordion, qt as AnswerRows, bt as Aside, ae as Avatar, dt as BLOCK_KINDS, wn as BLOCK_SCHEMAS, we as Badge, b as Box, Me as Button, Re as Card, x as Center, de as Checkbox, fe as CheckboxGroup, Ne as Chip, oe as Code, Be as Columns, Zt as ComparisonBars, S as Container, _n as Contents, tt as DEFAULT_PROFILE_ID, ar as DataTable, pe as DateRange, Ct as Definition, In as DisclaimerBlock, He as Disclosure, C as Divider, xn as DocumentBlocks, Lt as DocumentLabel, Cn as DocumentSection, hn as DocumentShell, Wt as DocumentTable, Te as EmptyState, vr as EventCard, xr as EventDetail, Cr as EventLogForm, br as EventRespond, Tr as EventSchedule, Dr as EventTimeline, yn as ExecutionBlock, V as Eyebrow, Ft as Figure, he as FileField, Pt as Footnote, H as FormField, Ue as Grid, ce as Heading, w as Hide, Fn as HighlightBox, Pe as IconButton, T as Inline, Yn as KpiCardGrid, Fe as Link, M as ListRow, un as Masthead, kt as Math, fn as MetaRail, en as NextSteps, nn as Notes, De as Notice, Wn as OptionCard, Ge as PAGINATOR_BINDINGS, It as PageBreak, N as PageFrame, te as PageHead, Gn as ProfileCard, Oe as Progress, xt as Prose, St as Quote, ge as RadioGroup, Ut as Reference, We as Repeat, Gt as RowList, ne as RuleSection, mn as RunningFooter, ye as SearchField, Pn as SectionHeader, Ie as SegmentedControl, be as Select, E as Show, ke as Skeleton, an as SkippedSection, xe as Slider, D as Spacer, Ae as Spinner, Ve as Split, O as Stack, An as Stat, jn as StatGroup, Rn as StatStrip, Se as Switch, I as TONES, sn as TalkItThrough, ue as Text, Ce as TextArea, ve as TextField, je as Tooltip, re as UnderlinedAction, cn as WRITE_HEIGHT_PX, tn as WRITE_LINE_HEIGHT_PX, ln as WriteInField, _ as cx, et as documentProfiles, ur as eventWhen, me as fileSize, Yt as formatValue, ie as initialsOf, B as inkToneOf, v as length, ut as profileCss, Ze as profileIds, ct as profileTokens, Xe as registerProfile, X as renderFormatted, Qe as resolveProfile, $e as resolvedProfiles, _e as toNumber, R as toneOf, or as typeCard, y as vars };
|
|
2190
4210
|
|
|
2191
4211
|
//# sourceMappingURL=index.js.map
|