@apliteni/apliteni-ui 0.147.0 → 0.149.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/guidelines/account-and-settings.md +3 -5
- package/guidelines/dense-tables.md +2 -2
- package/package.json +1 -2
- package/react/README.md +2 -2
- package/react/dist/index.css +121 -0
- package/react/dist/index.d.ts +31 -4
- package/react/dist/index.js +1064 -930
- package/src/styles/table.css +33 -110
package/react/dist/index.js
CHANGED
|
@@ -1108,10 +1108,376 @@ function Feedback({
|
|
|
1108
1108
|
] }), document.body);
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
|
-
// src/
|
|
1112
|
-
import { useId as
|
|
1111
|
+
// src/AccountWindow.tsx
|
|
1112
|
+
import { useEffect as useEffect7, useId as useId7, useRef as useRef9, useState as useState6 } from "react";
|
|
1113
1113
|
import { createPortal as createPortal3 } from "react-dom";
|
|
1114
|
-
import {
|
|
1114
|
+
import { revealFocusedNav as revealFocusedNav2 } from "@apliteni/apliteni-ui";
|
|
1115
|
+
|
|
1116
|
+
// src/NavTabs.tsx
|
|
1117
|
+
import { Fragment as Fragment6, forwardRef as forwardRef6, useEffect as useEffect4, useRef as useRef7, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
1118
|
+
import { safeUrl as safeUrl2, observeNavFit, revealCurrentNav, revealFocusedNav } from "@apliteni/apliteni-ui";
|
|
1119
|
+
import { Fragment as Fragment7, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1120
|
+
var NavTabs = forwardRef6(function NavTabs2({
|
|
1121
|
+
items,
|
|
1122
|
+
active,
|
|
1123
|
+
variant = "underline",
|
|
1124
|
+
renderLink,
|
|
1125
|
+
className,
|
|
1126
|
+
onFocus,
|
|
1127
|
+
"aria-label": ariaLabel = "Tabs",
|
|
1128
|
+
...rest
|
|
1129
|
+
}, ref) {
|
|
1130
|
+
const navRef = useRef7(null);
|
|
1131
|
+
useImperativeHandle2(ref, () => navRef.current, []);
|
|
1132
|
+
const signature = items.map((item) => item.id).join("\0");
|
|
1133
|
+
useEffect4(() => observeNavFit(navRef.current), []);
|
|
1134
|
+
useEffect4(() => {
|
|
1135
|
+
if (navRef.current) revealCurrentNav(navRef.current);
|
|
1136
|
+
}, [active, signature]);
|
|
1137
|
+
return /* @__PURE__ */ jsx16(
|
|
1138
|
+
"nav",
|
|
1139
|
+
{
|
|
1140
|
+
...rest,
|
|
1141
|
+
ref: navRef,
|
|
1142
|
+
className: ["ui-nav", "ui-nav--tabs", `is-${variant}`, className].filter(Boolean).join(" "),
|
|
1143
|
+
"aria-label": ariaLabel,
|
|
1144
|
+
onFocus: (event) => {
|
|
1145
|
+
if (navRef.current) revealFocusedNav(navRef.current, event.target);
|
|
1146
|
+
onFocus?.(event);
|
|
1147
|
+
},
|
|
1148
|
+
children: items.map((item) => {
|
|
1149
|
+
const badge = item.badge != null && typeof item.badge === "object" ? item.badge : { text: item.badge, tone: void 0 };
|
|
1150
|
+
const inner = /* @__PURE__ */ jsxs12(Fragment7, { children: [
|
|
1151
|
+
/* @__PURE__ */ jsx16("span", { className: "ui-nav__tab-label", children: item.label }),
|
|
1152
|
+
badge.text != null && badge.text !== "" && /* @__PURE__ */ jsx16("span", { className: `ui-nav__badge is-${badge.tone || "neutral"}`, children: badge.text })
|
|
1153
|
+
] });
|
|
1154
|
+
if (item.disabled) return /* @__PURE__ */ jsx16("span", { className: "ui-nav__tab is-disabled", "aria-disabled": "true", children: inner }, item.id);
|
|
1155
|
+
const current = item.id === active;
|
|
1156
|
+
const linkProps = {
|
|
1157
|
+
className: ["ui-nav__tab", current && "is-active"].filter(Boolean).join(" "),
|
|
1158
|
+
href: safeUrl2(item.href || `#${item.id}`),
|
|
1159
|
+
target: item.target,
|
|
1160
|
+
"aria-current": current ? "page" : void 0,
|
|
1161
|
+
children: inner
|
|
1162
|
+
};
|
|
1163
|
+
return /* @__PURE__ */ jsx16(Fragment6, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx16("a", { ...linkProps }) }, item.id);
|
|
1164
|
+
})
|
|
1165
|
+
}
|
|
1166
|
+
);
|
|
1167
|
+
});
|
|
1168
|
+
|
|
1169
|
+
// src/SidebarNav.tsx
|
|
1170
|
+
import { forwardRef as forwardRef7, useEffect as useEffect5, useId as useId5, useState as useState5 } from "react";
|
|
1171
|
+
import { ENTRANCE_FALLBACK_MS } from "@apliteni/apliteni-ui/motion";
|
|
1172
|
+
import { Fragment as Fragment8, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1173
|
+
var badgeText = (badge) => typeof badge === "object" ? badge.text : badge;
|
|
1174
|
+
function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
|
|
1175
|
+
const uid = useId5();
|
|
1176
|
+
const group = !sub && !!item.items?.length;
|
|
1177
|
+
const childActive = group && item.items.some((child) => child.id === active);
|
|
1178
|
+
const [expanded, setExpanded] = useState5();
|
|
1179
|
+
const open = expanded ?? item.defaultOpen ?? childActive;
|
|
1180
|
+
const [entering, setEntering] = useState5(false);
|
|
1181
|
+
useEffect5(() => {
|
|
1182
|
+
if (!entering) return;
|
|
1183
|
+
const timer = setTimeout(() => setEntering(false), ENTRANCE_FALLBACK_MS);
|
|
1184
|
+
return () => clearTimeout(timer);
|
|
1185
|
+
}, [entering]);
|
|
1186
|
+
const count = badgeText(item.badge);
|
|
1187
|
+
const name = `${item.label}${count == null || count === "" ? "" : ` ${count}`}`;
|
|
1188
|
+
const isActive = !group && item.id === active;
|
|
1189
|
+
const className = [
|
|
1190
|
+
"ui-nav__item",
|
|
1191
|
+
sub && "ui-nav__item--sub",
|
|
1192
|
+
group && "ui-nav__toggle",
|
|
1193
|
+
isActive && "is-active",
|
|
1194
|
+
childActive && "is-current",
|
|
1195
|
+
item.disabled && "is-disabled",
|
|
1196
|
+
item.danger && "is-danger"
|
|
1197
|
+
].filter(Boolean).join(" ");
|
|
1198
|
+
const children = /* @__PURE__ */ jsxs13(Fragment8, { children: [
|
|
1199
|
+
(item.leading ?? item.icon) && /* @__PURE__ */ jsx17("span", { className: "ui-nav__ic", children: item.leading ?? /* @__PURE__ */ jsx17(Icon, { name: item.icon }) }),
|
|
1200
|
+
/* @__PURE__ */ jsx17("span", { className: "ui-nav__label", children: item.label }),
|
|
1201
|
+
count != null && count !== "" && /* @__PURE__ */ jsx17("span", { className: `ui-nav__badge is-${typeof item.badge === "object" ? item.badge.tone ?? "neutral" : "neutral"}`, children: count }),
|
|
1202
|
+
group && /* @__PURE__ */ jsx17("span", { className: "ui-nav__caret", "aria-hidden": "true" })
|
|
1203
|
+
] });
|
|
1204
|
+
const common = { className, "aria-label": name, title: collapsed ? name : void 0, children };
|
|
1205
|
+
if (group) return /* @__PURE__ */ jsxs13("li", { className: `ui-nav__group${open ? " is-open" : ""}`, children: [
|
|
1206
|
+
/* @__PURE__ */ jsx17(
|
|
1207
|
+
"button",
|
|
1208
|
+
{
|
|
1209
|
+
...common,
|
|
1210
|
+
type: "button",
|
|
1211
|
+
disabled: item.disabled,
|
|
1212
|
+
"aria-expanded": open,
|
|
1213
|
+
"aria-controls": uid,
|
|
1214
|
+
onClick: () => {
|
|
1215
|
+
setExpanded(!open);
|
|
1216
|
+
setEntering(!open);
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
),
|
|
1220
|
+
/* @__PURE__ */ jsx17("ul", { id: uid, className: `ui-nav__sub${entering ? " is-entering" : ""}`, hidden: !open, onAnimationEnd: () => setEntering(false), children: item.items.map((child) => /* @__PURE__ */ jsx17(Row, { item: child, active, activeIs, collapsed, renderLink, sub: true }, child.id)) })
|
|
1221
|
+
] });
|
|
1222
|
+
if (item.disabled) return /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17("span", { ...common, role: "link", "aria-disabled": "true" }) });
|
|
1223
|
+
const props = {
|
|
1224
|
+
...common,
|
|
1225
|
+
href: item.href ?? `#${item.id}`,
|
|
1226
|
+
target: item.target,
|
|
1227
|
+
"aria-current": isActive ? activeIs === "section" ? "true" : "page" : void 0
|
|
1228
|
+
};
|
|
1229
|
+
return /* @__PURE__ */ jsx17("li", { children: renderLink ? renderLink(item, props) : /* @__PURE__ */ jsx17("a", { ...props }) });
|
|
1230
|
+
}
|
|
1231
|
+
function Section({ section, ...props }) {
|
|
1232
|
+
const uid = useId5();
|
|
1233
|
+
return /* @__PURE__ */ jsxs13("div", { className: "ui-nav__section", children: [
|
|
1234
|
+
section.label && /* @__PURE__ */ jsx17("div", { className: "ui-nav__cap", id: uid, "aria-hidden": props.collapsed || void 0, children: section.label }),
|
|
1235
|
+
/* @__PURE__ */ jsx17("ul", { className: "ui-nav__list", "aria-labelledby": section.label ? uid : void 0, children: section.items.map((item) => /* @__PURE__ */ jsx17(Row, { item, ...props }, item.id)) })
|
|
1236
|
+
] });
|
|
1237
|
+
}
|
|
1238
|
+
var SidebarNav = forwardRef7(function SidebarNav2({
|
|
1239
|
+
items = [],
|
|
1240
|
+
sections,
|
|
1241
|
+
active,
|
|
1242
|
+
activeIs = "page",
|
|
1243
|
+
collapsed = false,
|
|
1244
|
+
footer,
|
|
1245
|
+
renderLink,
|
|
1246
|
+
className,
|
|
1247
|
+
"aria-label": label = "Sidebar",
|
|
1248
|
+
...rest
|
|
1249
|
+
}, ref) {
|
|
1250
|
+
return /* @__PURE__ */ jsxs13("nav", { ...rest, ref, "aria-label": label, className: ["ui-nav", "ui-nav--side", collapsed && "is-collapsed", className].filter(Boolean).join(" "), children: [
|
|
1251
|
+
(sections?.length ? sections : [{ items }]).map((section, index) => /* @__PURE__ */ jsx17(
|
|
1252
|
+
Section,
|
|
1253
|
+
{
|
|
1254
|
+
section,
|
|
1255
|
+
active,
|
|
1256
|
+
activeIs,
|
|
1257
|
+
collapsed,
|
|
1258
|
+
renderLink
|
|
1259
|
+
},
|
|
1260
|
+
index
|
|
1261
|
+
)),
|
|
1262
|
+
footer && /* @__PURE__ */ jsx17("div", { className: "ui-nav__foot", children: footer })
|
|
1263
|
+
] });
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
// src/Tabs.tsx
|
|
1267
|
+
import { useEffect as useEffect6, useId as useId6, useRef as useRef8 } from "react";
|
|
1268
|
+
import { playEntrance } from "@apliteni/apliteni-ui/motion";
|
|
1269
|
+
import { Fragment as Fragment9, jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1270
|
+
function tabKeyIndex(key, i, count) {
|
|
1271
|
+
switch (key) {
|
|
1272
|
+
case "ArrowRight":
|
|
1273
|
+
return (i + 1) % count;
|
|
1274
|
+
case "ArrowLeft":
|
|
1275
|
+
return (i - 1 + count) % count;
|
|
1276
|
+
case "Home":
|
|
1277
|
+
return 0;
|
|
1278
|
+
case "End":
|
|
1279
|
+
return count - 1;
|
|
1280
|
+
default:
|
|
1281
|
+
return void 0;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
function Tabs({ items, value, onChange, label }) {
|
|
1285
|
+
const id = useId6();
|
|
1286
|
+
const previous = useRef8(value);
|
|
1287
|
+
const activePanel = useRef8(null);
|
|
1288
|
+
const buttons = useRef8([]);
|
|
1289
|
+
useEffect6(() => {
|
|
1290
|
+
if (previous.current !== value) playEntrance(activePanel.current);
|
|
1291
|
+
previous.current = value;
|
|
1292
|
+
}, [value]);
|
|
1293
|
+
return /* @__PURE__ */ jsxs14("div", { className: "ui-tabs", children: [
|
|
1294
|
+
/* @__PURE__ */ jsx18("div", { className: "ui-tabs__list", role: "tablist", "aria-label": label, children: items.map((item, i) => /* @__PURE__ */ jsxs14(
|
|
1295
|
+
"button",
|
|
1296
|
+
{
|
|
1297
|
+
type: "button",
|
|
1298
|
+
role: "tab",
|
|
1299
|
+
ref: (el) => {
|
|
1300
|
+
buttons.current[i] = el;
|
|
1301
|
+
},
|
|
1302
|
+
className: `ui-tabs__tab${item.value === value ? " is-active" : ""}`,
|
|
1303
|
+
id: `${id}-tab-${i}`,
|
|
1304
|
+
"aria-controls": `${id}-panel-${i}`,
|
|
1305
|
+
"aria-selected": item.value === value,
|
|
1306
|
+
tabIndex: item.value === value ? 0 : -1,
|
|
1307
|
+
onClick: () => onChange(item.value),
|
|
1308
|
+
onKeyDown: (event) => {
|
|
1309
|
+
const next = tabKeyIndex(event.key, i, items.length);
|
|
1310
|
+
if (next === void 0) return;
|
|
1311
|
+
event.preventDefault();
|
|
1312
|
+
buttons.current[next]?.focus();
|
|
1313
|
+
onChange(items[next].value);
|
|
1314
|
+
},
|
|
1315
|
+
children: [
|
|
1316
|
+
item.label,
|
|
1317
|
+
item.count != null && /* @__PURE__ */ jsxs14(Fragment9, { children: [
|
|
1318
|
+
" ",
|
|
1319
|
+
item.count
|
|
1320
|
+
] })
|
|
1321
|
+
]
|
|
1322
|
+
},
|
|
1323
|
+
item.value
|
|
1324
|
+
)) }),
|
|
1325
|
+
/* @__PURE__ */ jsx18("div", { className: "ui-tabs__panels", children: items.map((item, i) => /* @__PURE__ */ jsx18(
|
|
1326
|
+
"div",
|
|
1327
|
+
{
|
|
1328
|
+
className: "ui-tabs__panel",
|
|
1329
|
+
role: "tabpanel",
|
|
1330
|
+
ref: item.value === value ? activePanel : void 0,
|
|
1331
|
+
id: `${id}-panel-${i}`,
|
|
1332
|
+
"aria-labelledby": `${id}-tab-${i}`,
|
|
1333
|
+
tabIndex: 0,
|
|
1334
|
+
hidden: item.value !== value,
|
|
1335
|
+
children: item.value === value ? item.panel : null
|
|
1336
|
+
},
|
|
1337
|
+
item.value
|
|
1338
|
+
)) })
|
|
1339
|
+
] });
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// src/AccountWindow.tsx
|
|
1343
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1344
|
+
function AccountWindow({
|
|
1345
|
+
open,
|
|
1346
|
+
onClose,
|
|
1347
|
+
reader,
|
|
1348
|
+
sections,
|
|
1349
|
+
section,
|
|
1350
|
+
defaultSection: defaultSection2,
|
|
1351
|
+
onSectionChange,
|
|
1352
|
+
label = "Account"
|
|
1353
|
+
}) {
|
|
1354
|
+
const titleId = useId7();
|
|
1355
|
+
const root = useRef9(null);
|
|
1356
|
+
const panel = useRef9(null);
|
|
1357
|
+
const body = useRef9(null);
|
|
1358
|
+
const tabs = useRef9(null);
|
|
1359
|
+
const [own, setOwn] = useState6(defaultSection2 ?? sections[0]?.id);
|
|
1360
|
+
const { mounted, shown } = usePresence(open, root, panel);
|
|
1361
|
+
const scope = useDialog(shown, { root, panel, body }, onClose);
|
|
1362
|
+
const currentId = section ?? own;
|
|
1363
|
+
useEffect7(() => {
|
|
1364
|
+
const nav = tabs.current;
|
|
1365
|
+
if (nav) revealFocusedNav2(nav, nav.querySelector('[aria-selected="true"]'));
|
|
1366
|
+
}, [mounted, currentId]);
|
|
1367
|
+
if (!mounted) return null;
|
|
1368
|
+
const current = sections.find((s) => s.id === currentId) ?? sections[0];
|
|
1369
|
+
const select = (id) => {
|
|
1370
|
+
if (section === void 0) setOwn(id);
|
|
1371
|
+
onSectionChange?.(id);
|
|
1372
|
+
};
|
|
1373
|
+
const asButton = (id, { href: _href, target: _target, ...props }) => /* @__PURE__ */ jsx19(
|
|
1374
|
+
"button",
|
|
1375
|
+
{
|
|
1376
|
+
...props,
|
|
1377
|
+
type: "button",
|
|
1378
|
+
"aria-current": id === current?.id ? "true" : void 0,
|
|
1379
|
+
onClick: () => select(id)
|
|
1380
|
+
}
|
|
1381
|
+
);
|
|
1382
|
+
const tabId = (i) => `${titleId}-tab-${i}`;
|
|
1383
|
+
const asTab = (i, { href: _href, target: _target, "aria-current": _current, ...props }) => {
|
|
1384
|
+
const selected = sections[i].id === current?.id;
|
|
1385
|
+
return /* @__PURE__ */ jsx19(
|
|
1386
|
+
"button",
|
|
1387
|
+
{
|
|
1388
|
+
...props,
|
|
1389
|
+
type: "button",
|
|
1390
|
+
role: "tab",
|
|
1391
|
+
id: tabId(i),
|
|
1392
|
+
"aria-selected": selected,
|
|
1393
|
+
"aria-controls": `${titleId}-panel`,
|
|
1394
|
+
tabIndex: selected ? 0 : -1,
|
|
1395
|
+
onClick: () => select(sections[i].id),
|
|
1396
|
+
onKeyDown: (event) => {
|
|
1397
|
+
const next = tabKeyIndex(event.key, i, sections.length);
|
|
1398
|
+
if (next === void 0) return;
|
|
1399
|
+
event.preventDefault();
|
|
1400
|
+
document.getElementById(tabId(next))?.focus();
|
|
1401
|
+
select(sections[next].id);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
);
|
|
1405
|
+
};
|
|
1406
|
+
const close = /* @__PURE__ */ jsx19(Button, { variant: "ghost", size: "sm", iconOnly: true, icon: "x", "aria-label": "Close", onClick: onClose });
|
|
1407
|
+
const items = sections.map(({ id, label: label2, icon: icon9 }) => ({ id, label: label2, icon: icon9 }));
|
|
1408
|
+
return createPortal3(
|
|
1409
|
+
/* @__PURE__ */ jsx19(DialogScope.Provider, { value: scope, children: /* @__PURE__ */ jsx19("div", { className: shown ? "rx-scrim is-open" : "rx-scrim", ref: root, onMouseDown: dismissOnScrim(onClose), children: /* @__PURE__ */ jsxs15(
|
|
1410
|
+
"div",
|
|
1411
|
+
{
|
|
1412
|
+
className: "rx-modal rx-account",
|
|
1413
|
+
role: "dialog",
|
|
1414
|
+
"aria-modal": "true",
|
|
1415
|
+
"aria-label": label,
|
|
1416
|
+
tabIndex: -1,
|
|
1417
|
+
ref: panel,
|
|
1418
|
+
children: [
|
|
1419
|
+
/* @__PURE__ */ jsxs15("div", { className: "rx-account__rail", children: [
|
|
1420
|
+
/* @__PURE__ */ jsxs15("div", { className: "rx-account__who", children: [
|
|
1421
|
+
/* @__PURE__ */ jsx19("span", { className: "rx-account__av", children: /* @__PURE__ */ jsx19(Avatar, { personKey: reader.personKey, name: reader.name, src: reader.avatarSrc, size: 32 }) }),
|
|
1422
|
+
/* @__PURE__ */ jsxs15("span", { className: "ui-app__who", children: [
|
|
1423
|
+
/* @__PURE__ */ jsx19("b", { children: reader.name }),
|
|
1424
|
+
/* @__PURE__ */ jsx19("span", { children: reader.email })
|
|
1425
|
+
] }),
|
|
1426
|
+
close
|
|
1427
|
+
] }),
|
|
1428
|
+
/* @__PURE__ */ jsx19(
|
|
1429
|
+
SidebarNav,
|
|
1430
|
+
{
|
|
1431
|
+
className: "rx-account__side",
|
|
1432
|
+
"aria-label": label,
|
|
1433
|
+
items,
|
|
1434
|
+
active: current?.id,
|
|
1435
|
+
activeIs: "section",
|
|
1436
|
+
renderLink: (item, props) => asButton(item.id, props)
|
|
1437
|
+
}
|
|
1438
|
+
),
|
|
1439
|
+
/* @__PURE__ */ jsx19(
|
|
1440
|
+
NavTabs,
|
|
1441
|
+
{
|
|
1442
|
+
className: "rx-account__tabs",
|
|
1443
|
+
role: "tablist",
|
|
1444
|
+
"aria-label": label,
|
|
1445
|
+
items,
|
|
1446
|
+
active: current?.id,
|
|
1447
|
+
ref: tabs,
|
|
1448
|
+
renderLink: (item, props) => asTab(sections.findIndex((s) => s.id === item.id), props)
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
] }),
|
|
1452
|
+
/* @__PURE__ */ jsxs15("div", { className: "rx-account__pane", children: [
|
|
1453
|
+
/* @__PURE__ */ jsxs15("div", { className: "rx-modal__head rx-account__head", children: [
|
|
1454
|
+
/* @__PURE__ */ jsx19("h2", { className: "rx-account__title", id: titleId, children: current?.label }),
|
|
1455
|
+
close
|
|
1456
|
+
] }),
|
|
1457
|
+
/* @__PURE__ */ jsx19(
|
|
1458
|
+
"div",
|
|
1459
|
+
{
|
|
1460
|
+
className: "rx-modal__body rx-account__body",
|
|
1461
|
+
ref: body,
|
|
1462
|
+
id: `${titleId}-panel`,
|
|
1463
|
+
role: "tabpanel",
|
|
1464
|
+
"aria-labelledby": tabId(sections.findIndex((s) => s.id === current?.id)),
|
|
1465
|
+
children: current?.content
|
|
1466
|
+
},
|
|
1467
|
+
current?.id
|
|
1468
|
+
)
|
|
1469
|
+
] })
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
) }) }),
|
|
1473
|
+
document.body
|
|
1474
|
+
);
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
// src/Drawer.tsx
|
|
1478
|
+
import { useId as useId8, useRef as useRef10 } from "react";
|
|
1479
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
1480
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1115
1481
|
function Drawer({
|
|
1116
1482
|
open,
|
|
1117
1483
|
title,
|
|
@@ -1124,18 +1490,18 @@ function Drawer({
|
|
|
1124
1490
|
closeLabel = "Close",
|
|
1125
1491
|
initialFocusRef
|
|
1126
1492
|
}) {
|
|
1127
|
-
const root =
|
|
1128
|
-
const panel =
|
|
1129
|
-
const body =
|
|
1130
|
-
const titleId =
|
|
1493
|
+
const root = useRef10(null);
|
|
1494
|
+
const panel = useRef10(null);
|
|
1495
|
+
const body = useRef10(null);
|
|
1496
|
+
const titleId = useId8();
|
|
1131
1497
|
const { mounted, shown } = usePresence(open, root, panel);
|
|
1132
1498
|
const scope = useDialog(shown, { root, panel, body, initialFocus: initialFocusRef }, onClose);
|
|
1133
1499
|
if (!mounted) return null;
|
|
1134
1500
|
const cls = ["ui-drawer", `ui-drawer--${side}`, `ui-drawer--${size}`, shown && "is-open"].filter(Boolean).join(" ");
|
|
1135
|
-
return
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1501
|
+
return createPortal4(
|
|
1502
|
+
/* @__PURE__ */ jsx20(DialogScope.Provider, { value: scope, children: /* @__PURE__ */ jsxs16("div", { className: cls, ref: root, children: [
|
|
1503
|
+
/* @__PURE__ */ jsx20("div", { className: "ui-drawer__scrim", onMouseDown: dismissOnScrim(onClose) }),
|
|
1504
|
+
/* @__PURE__ */ jsxs16(
|
|
1139
1505
|
"aside",
|
|
1140
1506
|
{
|
|
1141
1507
|
className: "ui-drawer__panel",
|
|
@@ -1145,13 +1511,13 @@ function Drawer({
|
|
|
1145
1511
|
tabIndex: -1,
|
|
1146
1512
|
ref: panel,
|
|
1147
1513
|
children: [
|
|
1148
|
-
/* @__PURE__ */
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
headerActions && /* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1514
|
+
/* @__PURE__ */ jsxs16("header", { className: "ui-drawer__header", children: [
|
|
1515
|
+
/* @__PURE__ */ jsx20("h2", { className: "ui-drawer__title", id: titleId, children: title }),
|
|
1516
|
+
headerActions && /* @__PURE__ */ jsx20("div", { className: "ui-drawer__actions", children: headerActions }),
|
|
1517
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: "ui-drawer__close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx20(Icon, { name: "x" }) })
|
|
1152
1518
|
] }),
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
footer && /* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ jsx20("div", { className: "ui-drawer__body", ref: body, children }),
|
|
1520
|
+
footer && /* @__PURE__ */ jsx20("footer", { className: "ui-drawer__footer", children: footer })
|
|
1155
1521
|
]
|
|
1156
1522
|
}
|
|
1157
1523
|
)
|
|
@@ -1161,12 +1527,12 @@ function Drawer({
|
|
|
1161
1527
|
}
|
|
1162
1528
|
|
|
1163
1529
|
// src/CommandPalette.tsx
|
|
1164
|
-
import { useCallback as useCallback2, useEffect as
|
|
1165
|
-
import { createPortal as
|
|
1530
|
+
import { useCallback as useCallback2, useEffect as useEffect8, useId as useId9, useMemo, useRef as useRef11, useState as useState7 } from "react";
|
|
1531
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
1166
1532
|
import { rankGroups, icon as icon3 } from "@apliteni/apliteni-ui";
|
|
1167
|
-
import { jsx as
|
|
1533
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1168
1534
|
var cx2 = (...a) => a.filter(Boolean).join(" ");
|
|
1169
|
-
var Glyph = ({ name, className }) => /* @__PURE__ */
|
|
1535
|
+
var Glyph = ({ name, className }) => /* @__PURE__ */ jsx21("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon3(name) } });
|
|
1170
1536
|
var keysOf = (shortcut) => shortcut == null ? [] : Array.isArray(shortcut) ? shortcut : [shortcut];
|
|
1171
1537
|
function CommandPalette({
|
|
1172
1538
|
open,
|
|
@@ -1181,13 +1547,13 @@ function CommandPalette({
|
|
|
1181
1547
|
rank = true,
|
|
1182
1548
|
onQueryChange
|
|
1183
1549
|
}) {
|
|
1184
|
-
const uid =
|
|
1185
|
-
const root =
|
|
1186
|
-
const panel =
|
|
1187
|
-
const search =
|
|
1188
|
-
const [query, setQuery] =
|
|
1189
|
-
const [at, setAt] =
|
|
1190
|
-
|
|
1550
|
+
const uid = useId9().replace(/:/g, "");
|
|
1551
|
+
const root = useRef11(null);
|
|
1552
|
+
const panel = useRef11(null);
|
|
1553
|
+
const search = useRef11(null);
|
|
1554
|
+
const [query, setQuery] = useState7("");
|
|
1555
|
+
const [at, setAt] = useState7(0);
|
|
1556
|
+
useEffect8(() => {
|
|
1191
1557
|
if (open) {
|
|
1192
1558
|
setQuery("");
|
|
1193
1559
|
setAt(0);
|
|
@@ -1199,7 +1565,7 @@ function CommandPalette({
|
|
|
1199
1565
|
);
|
|
1200
1566
|
const rows = useMemo(() => shown.flatMap((g) => g.items).filter((it) => !isDisabled(it)), [shown]);
|
|
1201
1567
|
const active = rows[Math.min(at, rows.length - 1)];
|
|
1202
|
-
|
|
1568
|
+
useEffect8(() => {
|
|
1203
1569
|
setAt(0);
|
|
1204
1570
|
}, [query]);
|
|
1205
1571
|
const scope = useDialog(open, { root, panel, body: search }, onClose);
|
|
@@ -1230,10 +1596,10 @@ function CommandPalette({
|
|
|
1230
1596
|
if (!open) return null;
|
|
1231
1597
|
const listId = `${uid}-list`;
|
|
1232
1598
|
let n = 0;
|
|
1233
|
-
return
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1599
|
+
return createPortal5(
|
|
1600
|
+
/* @__PURE__ */ jsx21(DialogScope.Provider, { value: scope, children: /* @__PURE__ */ jsxs17("div", { className: cx2("ui-cmdk", density === "roomy" && "ui-cmdk--roomy", "is-open"), ref: root, children: [
|
|
1601
|
+
/* @__PURE__ */ jsx21("div", { className: "ui-cmdk__scrim", onMouseDown: dismissOnScrim(onClose) }),
|
|
1602
|
+
/* @__PURE__ */ jsxs17(
|
|
1237
1603
|
"div",
|
|
1238
1604
|
{
|
|
1239
1605
|
className: "ui-cmdk__panel",
|
|
@@ -1244,9 +1610,9 @@ function CommandPalette({
|
|
|
1244
1610
|
ref: panel,
|
|
1245
1611
|
onKeyDown,
|
|
1246
1612
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ jsxs17("div", { className: "ui-cmdk__search", ref: search, children: [
|
|
1614
|
+
/* @__PURE__ */ jsx21(Glyph, { name: "search", className: "ui-cmdk__search-ic" }),
|
|
1615
|
+
/* @__PURE__ */ jsx21(
|
|
1250
1616
|
"input",
|
|
1251
1617
|
{
|
|
1252
1618
|
className: "ui-cmdk__input",
|
|
@@ -1268,19 +1634,19 @@ function CommandPalette({
|
|
|
1268
1634
|
}
|
|
1269
1635
|
)
|
|
1270
1636
|
] }),
|
|
1271
|
-
/* @__PURE__ */
|
|
1637
|
+
/* @__PURE__ */ jsx21("div", { className: "ui-cmdk__list", id: listId, role: "listbox", "aria-label": `${label} results`, children: shown.map((group, gi) => /* @__PURE__ */ jsxs17(
|
|
1272
1638
|
"div",
|
|
1273
1639
|
{
|
|
1274
1640
|
className: "ui-cmdk__group",
|
|
1275
1641
|
role: "group",
|
|
1276
1642
|
"aria-labelledby": group.label ? `${uid}-g${gi}` : void 0,
|
|
1277
1643
|
children: [
|
|
1278
|
-
group.label && /* @__PURE__ */
|
|
1644
|
+
group.label && /* @__PURE__ */ jsx21("div", { className: "ui-cmdk__group-head", id: `${uid}-g${gi}`, children: group.label }),
|
|
1279
1645
|
group.items.map((item) => {
|
|
1280
1646
|
const disabled = isDisabled(item);
|
|
1281
1647
|
const id = `${uid}-o${n++}`;
|
|
1282
1648
|
const on = item === active;
|
|
1283
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ jsxs17(
|
|
1284
1650
|
"div",
|
|
1285
1651
|
{
|
|
1286
1652
|
id,
|
|
@@ -1300,13 +1666,13 @@ function CommandPalette({
|
|
|
1300
1666
|
},
|
|
1301
1667
|
onClick: (e) => run(item, e.metaKey || e.ctrlKey),
|
|
1302
1668
|
children: [
|
|
1303
|
-
item.icon && /* @__PURE__ */
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
item.description && /* @__PURE__ */
|
|
1669
|
+
item.icon && /* @__PURE__ */ jsx21(Glyph, { name: item.icon, className: "ui-cmdk__ic" }),
|
|
1670
|
+
/* @__PURE__ */ jsxs17("span", { className: "ui-cmdk__main", children: [
|
|
1671
|
+
/* @__PURE__ */ jsx21("span", { className: "ui-cmdk__label", children: item.label }),
|
|
1672
|
+
item.description && /* @__PURE__ */ jsx21("span", { className: "ui-cmdk__desc", children: item.description })
|
|
1307
1673
|
] }),
|
|
1308
|
-
item.badge && /* @__PURE__ */
|
|
1309
|
-
keysOf(item.shortcut).length > 0 && /* @__PURE__ */
|
|
1674
|
+
item.badge && /* @__PURE__ */ jsx21("span", { className: "ui-cmdk__badge", children: item.badge }),
|
|
1675
|
+
keysOf(item.shortcut).length > 0 && /* @__PURE__ */ jsx21("span", { className: "ui-cmdk__keys", "aria-hidden": "true", children: keysOf(item.shortcut).map((k) => /* @__PURE__ */ jsx21("kbd", { className: "ui-cmdk__key", children: k }, k)) })
|
|
1310
1676
|
]
|
|
1311
1677
|
},
|
|
1312
1678
|
item.id
|
|
@@ -1316,20 +1682,20 @@ function CommandPalette({
|
|
|
1316
1682
|
},
|
|
1317
1683
|
group.label ?? `g${gi}`
|
|
1318
1684
|
)) }),
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
hint && /* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1685
|
+
/* @__PURE__ */ jsx21("p", { className: "ui-cmdk__empty", hidden: countOf(shown) > 0, children: empty }),
|
|
1686
|
+
/* @__PURE__ */ jsx21("p", { className: "ui-sr", role: "status", "aria-live": "polite", children: countOf(shown) === 0 ? "No results" : `${countOf(shown)} result${countOf(shown) === 1 ? "" : "s"}` }),
|
|
1687
|
+
hint && /* @__PURE__ */ jsxs17("div", { className: "ui-cmdk__foot", "aria-hidden": "true", children: [
|
|
1688
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
1689
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ui-cmdk__key", children: "\u2191" }),
|
|
1690
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ui-cmdk__key", children: "\u2193" }),
|
|
1325
1691
|
" move"
|
|
1326
1692
|
] }),
|
|
1327
|
-
/* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ui-cmdk__key", children: "\u21B5" }),
|
|
1329
1695
|
" run"
|
|
1330
1696
|
] }),
|
|
1331
|
-
/* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
1698
|
+
/* @__PURE__ */ jsx21("kbd", { className: "ui-cmdk__key", children: "esc" }),
|
|
1333
1699
|
" close"
|
|
1334
1700
|
] })
|
|
1335
1701
|
] })
|
|
@@ -1354,13 +1720,13 @@ function rowId(uid, groups, item) {
|
|
|
1354
1720
|
}
|
|
1355
1721
|
|
|
1356
1722
|
// src/DataTable.tsx
|
|
1357
|
-
import { Fragment as
|
|
1723
|
+
import { Fragment as Fragment10, useCallback as useCallback3, useEffect as useEffect10, useMemo as useMemo2, useRef as useRef13, useState as useState9 } from "react";
|
|
1358
1724
|
import { DEFAULT_PAGE_SIZE as DEFAULT_PAGE_SIZE2 } from "@apliteni/apliteni-ui";
|
|
1359
1725
|
|
|
1360
1726
|
// src/Pagination.tsx
|
|
1361
|
-
import { useEffect as
|
|
1727
|
+
import { useEffect as useEffect9, useId as useId10, useRef as useRef12, useState as useState8 } from "react";
|
|
1362
1728
|
import { DEFAULT_PAGE_SIZE } from "@apliteni/apliteni-ui";
|
|
1363
|
-
import { jsx as
|
|
1729
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1364
1730
|
var GHOST_SM = "ui-btn ui-btn--ghost ui-btn--sm";
|
|
1365
1731
|
var VARIANTS = ["steps", "numbered", "jump"];
|
|
1366
1732
|
var cx3 = (...a) => a.filter(Boolean).join(" ");
|
|
@@ -1402,11 +1768,11 @@ function Pagination({
|
|
|
1402
1768
|
onPageChange,
|
|
1403
1769
|
onPageSizeChange
|
|
1404
1770
|
}) {
|
|
1405
|
-
const auto =
|
|
1406
|
-
const [draft, setDraft] =
|
|
1407
|
-
const [drafting, setDrafting] =
|
|
1408
|
-
const nav =
|
|
1409
|
-
const pressed =
|
|
1771
|
+
const auto = useId10();
|
|
1772
|
+
const [draft, setDraft] = useState8("");
|
|
1773
|
+
const [drafting, setDrafting] = useState8(false);
|
|
1774
|
+
const nav = useRef12(null);
|
|
1775
|
+
const pressed = useRef12(null);
|
|
1410
1776
|
const uid = id ?? auto;
|
|
1411
1777
|
const kind = VARIANTS.includes(variant) ? variant : "steps";
|
|
1412
1778
|
const size = sizeOf(pageSize, DEFAULT_PAGE_SIZE);
|
|
@@ -1415,7 +1781,7 @@ function Pagination({
|
|
|
1415
1781
|
const rows = counted ? Math.max(0, asRows) : null;
|
|
1416
1782
|
const last = counted ? Math.max(1, Math.ceil(rows / size)) : null;
|
|
1417
1783
|
const at = counted ? Math.min(Math.max(1, int(page, 1)), last) : Math.min(Math.max(1, int(page, 1)), CAP - 1);
|
|
1418
|
-
const [draftFor, setDraftFor] =
|
|
1784
|
+
const [draftFor, setDraftFor] = useState8(at);
|
|
1419
1785
|
if (draftFor !== at) {
|
|
1420
1786
|
setDraftFor(at);
|
|
1421
1787
|
setDraft("");
|
|
@@ -1423,7 +1789,7 @@ function Pagination({
|
|
|
1423
1789
|
}
|
|
1424
1790
|
const offered = (Array.isArray(pageSizes) ? pageSizes : []).slice(0, 12).map((s) => int(s, 0)).filter((s) => s > 0);
|
|
1425
1791
|
const sizes = offered.length ? [.../* @__PURE__ */ new Set([...offered, size])].sort((a, b) => a - b) : [];
|
|
1426
|
-
|
|
1792
|
+
useEffect9(() => {
|
|
1427
1793
|
const was = pressed.current;
|
|
1428
1794
|
if (!was || loading) return;
|
|
1429
1795
|
pressed.current = null;
|
|
@@ -1452,7 +1818,7 @@ function Pagination({
|
|
|
1452
1818
|
const step = (label_, target, disabled) => (
|
|
1453
1819
|
// A control at an end is disabled and stays where it is: removing it slides
|
|
1454
1820
|
// the next control under a pointer already travelling toward it.
|
|
1455
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ jsx22(
|
|
1456
1822
|
"button",
|
|
1457
1823
|
{
|
|
1458
1824
|
type: "button",
|
|
@@ -1491,14 +1857,14 @@ function Pagination({
|
|
|
1491
1857
|
if (single) {
|
|
1492
1858
|
steps = null;
|
|
1493
1859
|
} else if (!counted) {
|
|
1494
|
-
steps = /* @__PURE__ */
|
|
1860
|
+
steps = /* @__PURE__ */ jsxs18("div", { className: "ui-pager__steps", children: [
|
|
1495
1861
|
step("Prev", Math.max(1, at - 1), atStart),
|
|
1496
1862
|
step("Next", at + 1, !hasMore)
|
|
1497
1863
|
] });
|
|
1498
1864
|
} else {
|
|
1499
1865
|
let middle = null;
|
|
1500
1866
|
if (kind === "numbered") {
|
|
1501
|
-
middle = slotsFor(at, last).map((n, i) => n == null ? /* @__PURE__ */
|
|
1867
|
+
middle = slotsFor(at, last).map((n, i) => n == null ? /* @__PURE__ */ jsx22("span", { className: "ui-pager__gap", "aria-hidden": "true", children: "\u2026" }, `gap${i}`) : /* @__PURE__ */ jsx22(
|
|
1502
1868
|
"button",
|
|
1503
1869
|
{
|
|
1504
1870
|
type: "button",
|
|
@@ -1513,9 +1879,9 @@ function Pagination({
|
|
|
1513
1879
|
n
|
|
1514
1880
|
));
|
|
1515
1881
|
} else if (kind === "jump") {
|
|
1516
|
-
middle = /* @__PURE__ */
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1882
|
+
middle = /* @__PURE__ */ jsxs18("span", { className: "ui-pager__jump", children: [
|
|
1883
|
+
/* @__PURE__ */ jsx22("label", { htmlFor: `${uid}-jump`, children: "Page" }),
|
|
1884
|
+
/* @__PURE__ */ jsx22(
|
|
1519
1885
|
"input",
|
|
1520
1886
|
{
|
|
1521
1887
|
className: "ui-input ui-pager__jump-input",
|
|
@@ -1538,13 +1904,13 @@ function Pagination({
|
|
|
1538
1904
|
}
|
|
1539
1905
|
}
|
|
1540
1906
|
),
|
|
1541
|
-
/* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ jsxs18("span", { className: "ui-pager__jump-of", children: [
|
|
1542
1908
|
"of ",
|
|
1543
1909
|
fmt(last)
|
|
1544
1910
|
] })
|
|
1545
1911
|
] });
|
|
1546
1912
|
}
|
|
1547
|
-
steps = /* @__PURE__ */
|
|
1913
|
+
steps = /* @__PURE__ */ jsxs18("div", { className: "ui-pager__steps", children: [
|
|
1548
1914
|
ends ? step("First", 1, atStart) : null,
|
|
1549
1915
|
step("Prev", Math.max(1, at - 1), atStart),
|
|
1550
1916
|
middle,
|
|
@@ -1552,7 +1918,7 @@ function Pagination({
|
|
|
1552
1918
|
ends ? step("Last", last, atEnd) : null
|
|
1553
1919
|
] });
|
|
1554
1920
|
}
|
|
1555
|
-
return /* @__PURE__ */
|
|
1921
|
+
return /* @__PURE__ */ jsxs18(
|
|
1556
1922
|
"nav",
|
|
1557
1923
|
{
|
|
1558
1924
|
ref: nav,
|
|
@@ -1560,10 +1926,10 @@ function Pagination({
|
|
|
1560
1926
|
"aria-label": label,
|
|
1561
1927
|
"aria-busy": loading ? true : void 0,
|
|
1562
1928
|
children: [
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
sizes.length ? /* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx22("p", { className: "ui-pager__status", "aria-live": "polite", "aria-atomic": "true", children: status }),
|
|
1930
|
+
sizes.length ? /* @__PURE__ */ jsxs18("div", { className: "ui-pager__size", children: [
|
|
1931
|
+
/* @__PURE__ */ jsx22("label", { className: "ui-pager__size-label", htmlFor: `${uid}-size`, children: "Rows" }),
|
|
1932
|
+
/* @__PURE__ */ jsx22(
|
|
1567
1933
|
"select",
|
|
1568
1934
|
{
|
|
1569
1935
|
className: "ui-select ui-pager__size-select",
|
|
@@ -1571,7 +1937,7 @@ function Pagination({
|
|
|
1571
1937
|
disabled: loading,
|
|
1572
1938
|
value: size,
|
|
1573
1939
|
onChange: (e) => onPageSizeChange?.(Number(e.target.value)),
|
|
1574
|
-
children: sizes.map((s) => /* @__PURE__ */
|
|
1940
|
+
children: sizes.map((s) => /* @__PURE__ */ jsx22("option", { value: s, children: fmt(s) }, s))
|
|
1575
1941
|
}
|
|
1576
1942
|
)
|
|
1577
1943
|
] }) : null,
|
|
@@ -1582,7 +1948,7 @@ function Pagination({
|
|
|
1582
1948
|
}
|
|
1583
1949
|
|
|
1584
1950
|
// src/DataTable.tsx
|
|
1585
|
-
import { Fragment as
|
|
1951
|
+
import { Fragment as Fragment11, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1586
1952
|
var CELL_CLASS = { title: "ui-table__title", code: "ui-table__code", long: "ui-table__long", strong: "ui-table__num--strong", act: "ui-table__act" };
|
|
1587
1953
|
var NO_SORT = { key: void 0, dir: -1 };
|
|
1588
1954
|
function sortTableRows(rows, sort) {
|
|
@@ -1595,7 +1961,6 @@ function DataTable({
|
|
|
1595
1961
|
rows,
|
|
1596
1962
|
zebra = false,
|
|
1597
1963
|
hover = true,
|
|
1598
|
-
stack: stack2 = false,
|
|
1599
1964
|
rowState,
|
|
1600
1965
|
footer,
|
|
1601
1966
|
caption,
|
|
@@ -1625,14 +1990,14 @@ function DataTable({
|
|
|
1625
1990
|
hasMore = false
|
|
1626
1991
|
}) {
|
|
1627
1992
|
const scrollable = stickyHeader || pinnedIdentity;
|
|
1628
|
-
const table =
|
|
1629
|
-
const [pagerHost, setPagerHost] =
|
|
1993
|
+
const table = useRef13(null);
|
|
1994
|
+
const [pagerHost, setPagerHost] = useState9(null);
|
|
1630
1995
|
const holdPagerBox = useCallback3(
|
|
1631
1996
|
(box) => setPagerHost(box?.parentElement ?? null),
|
|
1632
1997
|
[]
|
|
1633
1998
|
);
|
|
1634
|
-
const [strip2, setStrip] =
|
|
1635
|
-
|
|
1999
|
+
const [strip2, setStrip] = useState9();
|
|
2000
|
+
useEffect10(() => {
|
|
1636
2001
|
const el = table.current;
|
|
1637
2002
|
const host = pagerHost;
|
|
1638
2003
|
if (!el || !host || typeof ResizeObserver === "undefined") {
|
|
@@ -1652,16 +2017,16 @@ function DataTable({
|
|
|
1652
2017
|
measure();
|
|
1653
2018
|
return () => observer.disconnect();
|
|
1654
2019
|
}, [pagerHost, columns, rows]);
|
|
1655
|
-
const [localSort, setLocalSort] =
|
|
2020
|
+
const [localSort, setLocalSort] = useState9(
|
|
1656
2021
|
{ key: columns.find((c) => c.sortable)?.key, dir: -1 }
|
|
1657
2022
|
);
|
|
1658
2023
|
const owned = controlledPage === void 0;
|
|
1659
2024
|
const sort = controlledSort ?? (owned ? localSort : NO_SORT);
|
|
1660
2025
|
const sortIsKnown = owned || controlledSort !== void 0;
|
|
1661
|
-
const [localPage, setLocalPage] =
|
|
1662
|
-
const [localSize, setLocalSize] =
|
|
2026
|
+
const [localPage, setLocalPage] = useState9(1);
|
|
2027
|
+
const [localSize, setLocalSize] = useState9(DEFAULT_PAGE_SIZE2);
|
|
1663
2028
|
const size = sizeOf(pageSize, owned ? localSize : rows.length || DEFAULT_PAGE_SIZE2);
|
|
1664
|
-
const [pagedSort, setPagedSort] =
|
|
2029
|
+
const [pagedSort, setPagedSort] = useState9(sort);
|
|
1665
2030
|
if (pagedSort.key !== sort.key || pagedSort.dir !== sort.dir) {
|
|
1666
2031
|
setPagedSort(sort);
|
|
1667
2032
|
setLocalPage(1);
|
|
@@ -1684,7 +2049,7 @@ function DataTable({
|
|
|
1684
2049
|
onSortChange?.(next);
|
|
1685
2050
|
toFirstPage();
|
|
1686
2051
|
};
|
|
1687
|
-
const caret = (k) => /* @__PURE__ */
|
|
2052
|
+
const caret = (k) => /* @__PURE__ */ jsx23(
|
|
1688
2053
|
"svg",
|
|
1689
2054
|
{
|
|
1690
2055
|
className: "rx-caret",
|
|
@@ -1696,27 +2061,26 @@ function DataTable({
|
|
|
1696
2061
|
strokeLinejoin: "round",
|
|
1697
2062
|
"aria-hidden": "true",
|
|
1698
2063
|
focusable: "false",
|
|
1699
|
-
children: sort.key === k ? /* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
/* @__PURE__ */
|
|
2064
|
+
children: sort.key === k ? /* @__PURE__ */ jsx23("path", { d: "m8 10 4 4 4-4" }) : /* @__PURE__ */ jsxs19(Fragment11, { children: [
|
|
2065
|
+
/* @__PURE__ */ jsx23("path", { d: "m8 9 4-4 4 4" }),
|
|
2066
|
+
/* @__PURE__ */ jsx23("path", { d: "m8 15 4 4 4-4" })
|
|
1702
2067
|
] })
|
|
1703
2068
|
}
|
|
1704
2069
|
);
|
|
1705
|
-
const Wrap = scrollable ? "div" :
|
|
2070
|
+
const Wrap = scrollable ? "div" : Fragment10;
|
|
1706
2071
|
const pageAllOn = selectable && slice.length > 0 && slice.every((r) => selected.has(r.name));
|
|
1707
2072
|
const pageSomeOn = selectable && !pageAllOn && slice.some((r) => selected.has(r.name));
|
|
1708
|
-
return /* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */
|
|
2073
|
+
return /* @__PURE__ */ jsxs19(Fragment11, { children: [
|
|
2074
|
+
/* @__PURE__ */ jsx23(Wrap, { ...scrollable ? { className: "ui-table-scroll", role: "region", "aria-label": scrollLabel, tabIndex: 0 } : {}, children: /* @__PURE__ */ jsxs19(
|
|
1710
2075
|
"table",
|
|
1711
2076
|
{
|
|
1712
2077
|
ref: table,
|
|
1713
|
-
className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra",
|
|
2078
|
+
className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra", (density === "dense" || !density && dense) && "ui-table--dense", density === "compact" && "ui-table--compact", stickyHeader && "ui-table--sticky", pinnedIdentity && "ui-table--pinned"].filter(Boolean).join(" "),
|
|
1714
2079
|
"aria-busy": loading || void 0,
|
|
1715
|
-
role: stack2 ? "table" : void 0,
|
|
1716
2080
|
children: [
|
|
1717
|
-
caption ? /* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
selectable ? /* @__PURE__ */
|
|
2081
|
+
caption ? /* @__PURE__ */ jsx23("caption", { className: "ui-sr", children: caption }) : null,
|
|
2082
|
+
/* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
|
|
2083
|
+
selectable ? /* @__PURE__ */ jsx23("th", { scope: "col", className: "ui-table__selection", children: /* @__PURE__ */ jsx23(
|
|
1720
2084
|
"input",
|
|
1721
2085
|
{
|
|
1722
2086
|
type: "checkbox",
|
|
@@ -1732,19 +2096,18 @@ function DataTable({
|
|
|
1732
2096
|
// The sort control is a real <button> inside the header cell. It used to be
|
|
1733
2097
|
// role="button" ON the <th>, which threw away the columnheader role and put
|
|
1734
2098
|
// aria-sort on a role that forbids it.
|
|
1735
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx23(
|
|
1736
2100
|
"th",
|
|
1737
2101
|
{
|
|
1738
2102
|
scope: "col",
|
|
1739
|
-
role: stack2 ? "columnheader" : void 0,
|
|
1740
2103
|
className: [pinnedIdentity && columnIndex === 0 && "ui-table__identity", c.num && "ui-table__num", c.sortable && "rx-sortable"].filter(Boolean).join(" "),
|
|
1741
2104
|
"aria-sort": sort.key === c.key ? sort.dir === 1 ? "ascending" : "descending" : c.sortable && sortIsKnown ? "none" : void 0,
|
|
1742
2105
|
children: c.sortable ? (
|
|
1743
2106
|
// The label is its own box so it can truncate: in a pinned
|
|
1744
2107
|
// identity column on a phone the header is capped, and a bare
|
|
1745
2108
|
// text node would push the caret out of the cell instead.
|
|
1746
|
-
/* @__PURE__ */
|
|
1747
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ jsxs19("button", { type: "button", className: "rx-sort", onClick: () => onSort(c.key), children: [
|
|
2110
|
+
/* @__PURE__ */ jsx23("span", { className: "rx-sort__label", children: c.label }),
|
|
1748
2111
|
caret(c.key)
|
|
1749
2112
|
] })
|
|
1750
2113
|
) : c.label
|
|
@@ -1753,15 +2116,14 @@ function DataTable({
|
|
|
1753
2116
|
)
|
|
1754
2117
|
))
|
|
1755
2118
|
] }) }),
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
!slice.length && /* @__PURE__ */
|
|
1758
|
-
slice.map((r) => /* @__PURE__ */
|
|
2119
|
+
/* @__PURE__ */ jsxs19("tbody", { children: [
|
|
2120
|
+
!slice.length && /* @__PURE__ */ jsx23("tr", { children: /* @__PURE__ */ jsx23("td", { colSpan: columns.length + (selectable ? 1 : 0), children: loading ? "Loading rows\u2026" : empty }) }),
|
|
2121
|
+
slice.map((r) => /* @__PURE__ */ jsxs19(
|
|
1759
2122
|
"tr",
|
|
1760
2123
|
{
|
|
1761
|
-
role: stack2 ? "row" : void 0,
|
|
1762
2124
|
className: rowState?.(r) ? `is-${rowState(r)}` : void 0,
|
|
1763
2125
|
children: [
|
|
1764
|
-
selectable ? /* @__PURE__ */
|
|
2126
|
+
selectable ? /* @__PURE__ */ jsx23("td", { className: "ui-table__selection", children: /* @__PURE__ */ jsx23(
|
|
1765
2127
|
"input",
|
|
1766
2128
|
{
|
|
1767
2129
|
type: "checkbox",
|
|
@@ -1772,12 +2134,10 @@ function DataTable({
|
|
|
1772
2134
|
) }) : null,
|
|
1773
2135
|
columns.map((c, columnIndex) => {
|
|
1774
2136
|
const Cell = c.rowHeader ? "th" : "td";
|
|
1775
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ jsx23(
|
|
1776
2138
|
Cell,
|
|
1777
2139
|
{
|
|
1778
2140
|
scope: c.rowHeader ? "row" : void 0,
|
|
1779
|
-
role: stack2 ? c.rowHeader ? "rowheader" : "cell" : void 0,
|
|
1780
|
-
"data-label": stack2 && c.num && typeof c.label === "string" ? c.label : void 0,
|
|
1781
2141
|
className: [c.num && "ui-table__num", c.cell && CELL_CLASS[c.cell], pinnedIdentity && columnIndex === 0 && "ui-table__identity", c.linked && "ui-table__linked"].filter(Boolean).join(" ") || void 0,
|
|
1782
2142
|
children: c.render ? c.render(r) : String(r[c.key])
|
|
1783
2143
|
},
|
|
@@ -1789,7 +2149,7 @@ function DataTable({
|
|
|
1789
2149
|
r.name
|
|
1790
2150
|
))
|
|
1791
2151
|
] }),
|
|
1792
|
-
footer ? /* @__PURE__ */
|
|
2152
|
+
footer ? /* @__PURE__ */ jsx23("tfoot", { children: footer }) : null
|
|
1793
2153
|
]
|
|
1794
2154
|
}
|
|
1795
2155
|
) }),
|
|
@@ -1798,13 +2158,13 @@ function DataTable({
|
|
|
1798
2158
|
// The two are siblings, and no selector sizes one to the other, so the width is
|
|
1799
2159
|
// measured: a cap rather than a width, so a pager wider than the table wraps
|
|
1800
2160
|
// inside it and a table wider than the room still leaves the strip in the room.
|
|
1801
|
-
/* @__PURE__ */
|
|
2161
|
+
/* @__PURE__ */ jsx23(
|
|
1802
2162
|
"div",
|
|
1803
2163
|
{
|
|
1804
2164
|
className: "rx-table-pager",
|
|
1805
2165
|
ref: holdPagerBox,
|
|
1806
2166
|
style: strip2 ? { maxWidth: strip2.width, marginInlineStart: strip2.inset || void 0 } : void 0,
|
|
1807
|
-
children: /* @__PURE__ */
|
|
2167
|
+
children: /* @__PURE__ */ jsx23(
|
|
1808
2168
|
Pagination,
|
|
1809
2169
|
{
|
|
1810
2170
|
page,
|
|
@@ -1832,7 +2192,7 @@ function DataTable({
|
|
|
1832
2192
|
import { PAGE_SIZES as KIT_PAGE_SIZES, DEFAULT_PAGE_SIZE as KIT_DEFAULT_PAGE_SIZE } from "@apliteni/apliteni-ui";
|
|
1833
2193
|
|
|
1834
2194
|
// src/Loading.tsx
|
|
1835
|
-
import { jsx as
|
|
2195
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1836
2196
|
var cx4 = (...a) => a.filter(Boolean).join(" ");
|
|
1837
2197
|
function Skeleton({ lines = 3, width, height, radius, className }) {
|
|
1838
2198
|
const widths = Array.isArray(lines) ? lines : null;
|
|
@@ -1842,19 +2202,19 @@ function Skeleton({ lines = 3, width, height, radius, className }) {
|
|
|
1842
2202
|
if (!w && !height && !radius) return void 0;
|
|
1843
2203
|
return { ...w && { width: w }, ...height && { height }, ...radius && { borderRadius: radius } };
|
|
1844
2204
|
};
|
|
1845
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ jsx24("div", { className: cx4("ui-skel", className), "aria-hidden": "true", children: Array.from({ length: n }, (_, i) => /* @__PURE__ */ jsx24("span", { className: "ui-skel__bar m-skeleton", style: styleFor(i) }, i)) });
|
|
1846
2206
|
}
|
|
1847
2207
|
function SkeletonTable({ rows = 5, cols = 4, head = true }) {
|
|
1848
|
-
const cells = Array.from({ length: Math.max(1, cols) }, (_, i) => /* @__PURE__ */
|
|
1849
|
-
return /* @__PURE__ */
|
|
2208
|
+
const cells = Array.from({ length: Math.max(1, cols) }, (_, i) => /* @__PURE__ */ jsx24("span", { className: "ui-skel__bar m-skeleton" }, i));
|
|
2209
|
+
return /* @__PURE__ */ jsxs20(
|
|
1850
2210
|
"div",
|
|
1851
2211
|
{
|
|
1852
2212
|
className: "ui-skel ui-skel--table",
|
|
1853
2213
|
style: { "--skel-cols": Math.max(1, cols) },
|
|
1854
2214
|
"aria-hidden": "true",
|
|
1855
2215
|
children: [
|
|
1856
|
-
head && /* @__PURE__ */
|
|
1857
|
-
Array.from({ length: Math.max(1, rows) }, (_, i) => /* @__PURE__ */
|
|
2216
|
+
head && /* @__PURE__ */ jsx24("div", { className: "ui-skel__row ui-skel__row--head", children: cells }),
|
|
2217
|
+
Array.from({ length: Math.max(1, rows) }, (_, i) => /* @__PURE__ */ jsx24("div", { className: "ui-skel__row", children: cells }, i))
|
|
1858
2218
|
]
|
|
1859
2219
|
}
|
|
1860
2220
|
);
|
|
@@ -1867,7 +2227,7 @@ function BusyRegion({
|
|
|
1867
2227
|
className,
|
|
1868
2228
|
children
|
|
1869
2229
|
}) {
|
|
1870
|
-
return /* @__PURE__ */
|
|
2230
|
+
return /* @__PURE__ */ jsxs20(
|
|
1871
2231
|
"div",
|
|
1872
2232
|
{
|
|
1873
2233
|
className: cx4("ui-busy", className),
|
|
@@ -1875,8 +2235,8 @@ function BusyRegion({
|
|
|
1875
2235
|
"aria-live": "polite",
|
|
1876
2236
|
"aria-busy": busy,
|
|
1877
2237
|
children: [
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsx24("span", { className: "ui-sr", children: busy ? label : message }),
|
|
2239
|
+
/* @__PURE__ */ jsx24("div", { className: "ui-busy__body", children: busy ? placeholder ?? /* @__PURE__ */ jsx24(Skeleton, { lines: 3 }) : children })
|
|
1880
2240
|
]
|
|
1881
2241
|
}
|
|
1882
2242
|
);
|
|
@@ -1889,28 +2249,28 @@ function Denied({
|
|
|
1889
2249
|
className,
|
|
1890
2250
|
children
|
|
1891
2251
|
}) {
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
sub && /* @__PURE__ */
|
|
1896
|
-
need && /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ jsxs20("div", { className: cx4("ui-denied", className), children: [
|
|
2253
|
+
/* @__PURE__ */ jsx24("div", { className: "ui-denied__seal", children: /* @__PURE__ */ jsx24(Icon, { name: icon9 }) }),
|
|
2254
|
+
/* @__PURE__ */ jsx24("div", { className: "ui-denied__title", children: title }),
|
|
2255
|
+
sub && /* @__PURE__ */ jsx24("div", { className: "ui-denied__sub", children: sub }),
|
|
2256
|
+
need && /* @__PURE__ */ jsxs20("div", { className: "ui-denied__need", children: [
|
|
1897
2257
|
"Needs ",
|
|
1898
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ jsx24("code", { className: "ui-code", children: need })
|
|
1899
2259
|
] }),
|
|
1900
|
-
children && /* @__PURE__ */
|
|
2260
|
+
children && /* @__PURE__ */ jsx24("div", { className: "ui-denied__actions", children })
|
|
1901
2261
|
] });
|
|
1902
2262
|
}
|
|
1903
2263
|
|
|
1904
2264
|
// src/DatePicker.tsx
|
|
1905
2265
|
import {
|
|
1906
2266
|
useCallback as useCallback4,
|
|
1907
|
-
useEffect as
|
|
2267
|
+
useEffect as useEffect11,
|
|
1908
2268
|
useMemo as useMemo3,
|
|
1909
|
-
useRef as
|
|
1910
|
-
useState as
|
|
2269
|
+
useRef as useRef14,
|
|
2270
|
+
useState as useState10
|
|
1911
2271
|
} from "react";
|
|
1912
2272
|
import { dropdownViewportFit } from "@apliteni/apliteni-ui";
|
|
1913
|
-
import { jsx as
|
|
2273
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1914
2274
|
var cx5 = (...a) => a.filter(Boolean).join(" ");
|
|
1915
2275
|
var pad = (n) => String(n).padStart(2, "0");
|
|
1916
2276
|
var DAY_MS = 864e5;
|
|
@@ -1919,8 +2279,8 @@ var MONTH_RE = /^(\d{4})-(\d{2})$/;
|
|
|
1919
2279
|
var DAY_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
1920
2280
|
var PHONE_MAX = 560;
|
|
1921
2281
|
function usePhone() {
|
|
1922
|
-
const [phone, setPhone] =
|
|
1923
|
-
|
|
2282
|
+
const [phone, setPhone] = useState10(false);
|
|
2283
|
+
useEffect11(() => {
|
|
1924
2284
|
const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX}px)`);
|
|
1925
2285
|
if (!query) return;
|
|
1926
2286
|
const read = () => setPhone(query.matches);
|
|
@@ -2015,15 +2375,15 @@ function DatePicker({
|
|
|
2015
2375
|
const picksRange = mode === "range" || mode === "day-range";
|
|
2016
2376
|
const phone = usePhone();
|
|
2017
2377
|
const asSheet = sheet ?? phone;
|
|
2018
|
-
const root =
|
|
2019
|
-
const trigger =
|
|
2020
|
-
const grid =
|
|
2021
|
-
const panel =
|
|
2022
|
-
const [selfOpen, setSelfOpen] =
|
|
2378
|
+
const root = useRef14(null);
|
|
2379
|
+
const trigger = useRef14(null);
|
|
2380
|
+
const grid = useRef14(null);
|
|
2381
|
+
const panel = useRef14(null);
|
|
2382
|
+
const [selfOpen, setSelfOpen] = useState10(defaultOpen);
|
|
2023
2383
|
const open = openProp ?? selfOpen;
|
|
2024
|
-
const [selfValue, setSelfValue] =
|
|
2384
|
+
const [selfValue, setSelfValue] = useState10(defaultValue);
|
|
2025
2385
|
const picked = value !== void 0 ? value : selfValue;
|
|
2026
|
-
const [selfRange, setSelfRange] =
|
|
2386
|
+
const [selfRange, setSelfRange] = useState10(defaultRange ?? { start: null, end: null });
|
|
2027
2387
|
const span = range !== void 0 ? range : selfRange;
|
|
2028
2388
|
const names = useMemo3(() => ({
|
|
2029
2389
|
month: new Intl.DateTimeFormat(locale, { month: "long", timeZone: "UTC" }),
|
|
@@ -2054,17 +2414,17 @@ function DatePicker({
|
|
|
2054
2414
|
return grain === "month" ? monthOf(now) : now;
|
|
2055
2415
|
}, [today, grain]);
|
|
2056
2416
|
const anchor = toIndex(picked, grain) ?? toIndex(picksRange ? span.start ?? span.end : null, grain) ?? todayIndex;
|
|
2057
|
-
const [cursor, setCursor] =
|
|
2058
|
-
const land =
|
|
2417
|
+
const [cursor, setCursor] = useState10(() => clamp(anchor, lo, hi));
|
|
2418
|
+
const land = useRef14(false);
|
|
2059
2419
|
const setOpen = useCallback4((next) => {
|
|
2060
2420
|
if (openProp === void 0) setSelfOpen(next);
|
|
2061
2421
|
onOpenChange?.(next);
|
|
2062
2422
|
}, [openProp, onOpenChange]);
|
|
2063
|
-
const close =
|
|
2423
|
+
const close = useRef14(setOpen);
|
|
2064
2424
|
useIsoLayoutEffect(() => {
|
|
2065
2425
|
close.current = setOpen;
|
|
2066
2426
|
});
|
|
2067
|
-
|
|
2427
|
+
useEffect11(() => {
|
|
2068
2428
|
if (open) setCursor(clamp(anchor, lo, hi));
|
|
2069
2429
|
}, [open]);
|
|
2070
2430
|
useIsoLayoutEffect(() => {
|
|
@@ -2088,7 +2448,7 @@ function DatePicker({
|
|
|
2088
2448
|
view.removeEventListener("resize", fit);
|
|
2089
2449
|
};
|
|
2090
2450
|
}, [open, asSheet]);
|
|
2091
|
-
|
|
2451
|
+
useEffect11(() => {
|
|
2092
2452
|
if (!open || asSheet) return;
|
|
2093
2453
|
const doc = root.current?.ownerDocument ?? document;
|
|
2094
2454
|
const onClick = (e) => {
|
|
@@ -2250,10 +2610,10 @@ function DatePicker({
|
|
|
2250
2610
|
}
|
|
2251
2611
|
const noneBefore = lo != null && first <= lo;
|
|
2252
2612
|
const noneAfter = hi != null && last >= hi;
|
|
2253
|
-
const calendar = /* @__PURE__ */
|
|
2254
|
-
picksRange && presets?.length ? /* @__PURE__ */
|
|
2613
|
+
const calendar = /* @__PURE__ */ jsxs21("div", { className: cx5("ui-datepicker__body", asSheet && "is-sheet"), children: [
|
|
2614
|
+
picksRange && presets?.length ? /* @__PURE__ */ jsx25("div", { className: "ui-datepicker__presets", role: "group", "aria-label": "Period shortcuts", children: presets.map((preset) => {
|
|
2255
2615
|
const within = allowed(preset);
|
|
2256
|
-
return /* @__PURE__ */
|
|
2616
|
+
return /* @__PURE__ */ jsx25(
|
|
2257
2617
|
"button",
|
|
2258
2618
|
{
|
|
2259
2619
|
type: "button",
|
|
@@ -2265,9 +2625,9 @@ function DatePicker({
|
|
|
2265
2625
|
preset.label
|
|
2266
2626
|
);
|
|
2267
2627
|
}) }) : null,
|
|
2268
|
-
/* @__PURE__ */
|
|
2269
|
-
/* @__PURE__ */
|
|
2270
|
-
/* @__PURE__ */
|
|
2628
|
+
/* @__PURE__ */ jsxs21("div", { className: "ui-datepicker__calendar", children: [
|
|
2629
|
+
/* @__PURE__ */ jsxs21("div", { className: "ui-datepicker__head", children: [
|
|
2630
|
+
/* @__PURE__ */ jsx25(
|
|
2271
2631
|
"button",
|
|
2272
2632
|
{
|
|
2273
2633
|
type: "button",
|
|
@@ -2275,11 +2635,11 @@ function DatePicker({
|
|
|
2275
2635
|
"aria-label": stepBack,
|
|
2276
2636
|
disabled: noneBefore,
|
|
2277
2637
|
onClick: () => stepPage(-1),
|
|
2278
|
-
children: /* @__PURE__ */
|
|
2638
|
+
children: /* @__PURE__ */ jsx25(Icon, { name: "chevronLeft" })
|
|
2279
2639
|
}
|
|
2280
2640
|
),
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx25("span", { className: "ui-datepicker__caption", "aria-live": "polite", children: caption }),
|
|
2642
|
+
/* @__PURE__ */ jsx25(
|
|
2283
2643
|
"button",
|
|
2284
2644
|
{
|
|
2285
2645
|
type: "button",
|
|
@@ -2287,11 +2647,11 @@ function DatePicker({
|
|
|
2287
2647
|
"aria-label": stepOn,
|
|
2288
2648
|
disabled: noneAfter,
|
|
2289
2649
|
onClick: () => stepPage(1),
|
|
2290
|
-
children: /* @__PURE__ */
|
|
2650
|
+
children: /* @__PURE__ */ jsx25(Icon, { name: "chevronRight" })
|
|
2291
2651
|
}
|
|
2292
2652
|
)
|
|
2293
2653
|
] }),
|
|
2294
|
-
/* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ jsxs21(
|
|
2295
2655
|
"div",
|
|
2296
2656
|
{
|
|
2297
2657
|
className: cx5("ui-datepicker__grid", grain === "day" && "is-days"),
|
|
@@ -2300,7 +2660,7 @@ function DatePicker({
|
|
|
2300
2660
|
ref: grid,
|
|
2301
2661
|
onKeyDown: onGridKeyDown,
|
|
2302
2662
|
children: [
|
|
2303
|
-
weekdays.length > 0 && /* @__PURE__ */
|
|
2663
|
+
weekdays.length > 0 && /* @__PURE__ */ jsx25("div", { className: "ui-datepicker__row", role: "row", children: weekdays.map((weekday) => /* @__PURE__ */ jsx25(
|
|
2304
2664
|
"span",
|
|
2305
2665
|
{
|
|
2306
2666
|
className: "ui-datepicker__weekday",
|
|
@@ -2310,13 +2670,13 @@ function DatePicker({
|
|
|
2310
2670
|
},
|
|
2311
2671
|
weekday.long
|
|
2312
2672
|
)) }),
|
|
2313
|
-
rows.map((cellsInRow, r) => /* @__PURE__ */
|
|
2673
|
+
rows.map((cellsInRow, r) => /* @__PURE__ */ jsx25("div", { className: "ui-datepicker__row", role: "row", children: cellsInRow.map((cell, c) => cell ? /* @__PURE__ */ jsx25(
|
|
2314
2674
|
"span",
|
|
2315
2675
|
{
|
|
2316
2676
|
className: "ui-datepicker__cell",
|
|
2317
2677
|
role: "gridcell",
|
|
2318
2678
|
"aria-selected": isPicked(cell.index),
|
|
2319
|
-
children: /* @__PURE__ */
|
|
2679
|
+
children: /* @__PURE__ */ jsx25(
|
|
2320
2680
|
"button",
|
|
2321
2681
|
{
|
|
2322
2682
|
type: "button",
|
|
@@ -2335,12 +2695,12 @@ function DatePicker({
|
|
|
2335
2695
|
"aria-label": state(cell),
|
|
2336
2696
|
onClick: () => pick(cell),
|
|
2337
2697
|
onFocus: () => setCursor(cell.index),
|
|
2338
|
-
children: /* @__PURE__ */
|
|
2698
|
+
children: /* @__PURE__ */ jsx25("span", { className: "ui-datepicker__num", children: cell.label })
|
|
2339
2699
|
}
|
|
2340
2700
|
)
|
|
2341
2701
|
},
|
|
2342
2702
|
cell.period
|
|
2343
|
-
) : /* @__PURE__ */
|
|
2703
|
+
) : /* @__PURE__ */ jsx25("span", { className: "ui-datepicker__cell is-empty", role: "gridcell" }, `e${r}-${c}`)) }, `r${r}`))
|
|
2344
2704
|
]
|
|
2345
2705
|
}
|
|
2346
2706
|
)
|
|
@@ -2350,8 +2710,8 @@ function DatePicker({
|
|
|
2350
2710
|
// `open` on the root whichever form the panel takes, so the trigger's
|
|
2351
2711
|
// chevron flips for the sheet as it does for the popover. The panel rules
|
|
2352
2712
|
// it also switches on have no panel to find while the sheet is up.
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2713
|
+
/* @__PURE__ */ jsxs21("div", { className: cx5("ui-dropdown", "ui-datepicker", open && "open"), ref: root, children: [
|
|
2714
|
+
/* @__PURE__ */ jsxs21(
|
|
2355
2715
|
"button",
|
|
2356
2716
|
{
|
|
2357
2717
|
type: "button",
|
|
@@ -2367,8 +2727,8 @@ function DatePicker({
|
|
|
2367
2727
|
setOpen(!open);
|
|
2368
2728
|
},
|
|
2369
2729
|
children: [
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx25("span", { className: "ui-dropdown__value", children: shown ?? empty }),
|
|
2731
|
+
/* @__PURE__ */ jsx25("span", { className: "ui-dropdown__chevron", "aria-hidden": "true" })
|
|
2372
2732
|
]
|
|
2373
2733
|
}
|
|
2374
2734
|
),
|
|
@@ -2379,8 +2739,8 @@ function DatePicker({
|
|
|
2379
2739
|
// without taking the sheet's affordances left a phone reader with no
|
|
2380
2740
|
// visible way out and a Tab that walked into the live page behind it.
|
|
2381
2741
|
// why: guidelines/drawer.md
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
) : /* @__PURE__ */
|
|
2742
|
+
/* @__PURE__ */ jsx25(Drawer, { open, side: "bottom", size: "md", title: name, onClose: () => setOpen(false), children: calendar })
|
|
2743
|
+
) : /* @__PURE__ */ jsx25(
|
|
2384
2744
|
"div",
|
|
2385
2745
|
{
|
|
2386
2746
|
className: cx5("ui-dropdown__panel", "ui-datepicker__panel", align === "end" && "is-end"),
|
|
@@ -2398,13 +2758,13 @@ function DatePicker({
|
|
|
2398
2758
|
|
|
2399
2759
|
// src/Dropdown.tsx
|
|
2400
2760
|
import {
|
|
2401
|
-
Fragment as
|
|
2761
|
+
Fragment as Fragment12,
|
|
2402
2762
|
useCallback as useCallback5,
|
|
2403
2763
|
useContext as useContext2,
|
|
2404
|
-
useEffect as
|
|
2405
|
-
useId as
|
|
2406
|
-
useRef as
|
|
2407
|
-
useState as
|
|
2764
|
+
useEffect as useEffect12,
|
|
2765
|
+
useId as useId11,
|
|
2766
|
+
useRef as useRef15,
|
|
2767
|
+
useState as useState11
|
|
2408
2768
|
} from "react";
|
|
2409
2769
|
import {
|
|
2410
2770
|
icon as icon4,
|
|
@@ -2426,7 +2786,7 @@ import { createContext as createContext2 } from "react";
|
|
|
2426
2786
|
var FieldContext = createContext2(null);
|
|
2427
2787
|
|
|
2428
2788
|
// src/Dropdown.tsx
|
|
2429
|
-
import { Fragment as
|
|
2789
|
+
import { Fragment as Fragment13, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2430
2790
|
var EXIT_SLACK_MS2 = 50;
|
|
2431
2791
|
var SETTLE_MS = 450;
|
|
2432
2792
|
var inPanel = (node) => {
|
|
@@ -2435,7 +2795,7 @@ var inPanel = (node) => {
|
|
|
2435
2795
|
};
|
|
2436
2796
|
var cx6 = (...a) => a.filter(Boolean).join(" ");
|
|
2437
2797
|
var isRow = (it) => Boolean(it) && it !== "---" && !it.separator;
|
|
2438
|
-
var Glyph2 = ({ name, className, hidden }) => /* @__PURE__ */
|
|
2798
|
+
var Glyph2 = ({ name, className, hidden }) => /* @__PURE__ */ jsx26(
|
|
2439
2799
|
"span",
|
|
2440
2800
|
{
|
|
2441
2801
|
className,
|
|
@@ -2448,7 +2808,7 @@ function RowBadge({ badge }) {
|
|
|
2448
2808
|
const given = typeof badge === "string" ? "" : badge.tone || "";
|
|
2449
2809
|
let tone2 = given || (/^live$/i.test(String(text2)) ? "live" : "neutral");
|
|
2450
2810
|
if (!given && tone2 === "neutral" && /^(?:off|unset|disabled|archive|archived)$/i.test(text2)) tone2 = "state";
|
|
2451
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ jsx26("span", { className: `ui-dropdown__badge is-${tone2}`, children: text2 });
|
|
2452
2812
|
}
|
|
2453
2813
|
var keyOf = (it) => it.value != null ? `v:${it.value}` : `l:${it.label}`;
|
|
2454
2814
|
var itemsIn = (panel) => Array.from(panel?.querySelectorAll("[data-dd-item]") ?? []).filter((el) => el.getAttribute("aria-disabled") !== "true" && !el.hidden);
|
|
@@ -2493,19 +2853,19 @@ function Dropdown({
|
|
|
2493
2853
|
onSelect,
|
|
2494
2854
|
row
|
|
2495
2855
|
}) {
|
|
2496
|
-
const [selfOpen, setSelfOpen] =
|
|
2856
|
+
const [selfOpen, setSelfOpen] = useState11(defaultOpen);
|
|
2497
2857
|
const open = openProp ?? selfOpen;
|
|
2498
|
-
const [pick, setPick] =
|
|
2499
|
-
const [query, setQuery] =
|
|
2500
|
-
const [activeKey, setActiveKey] =
|
|
2501
|
-
const root =
|
|
2502
|
-
const panel =
|
|
2503
|
-
const trigger =
|
|
2504
|
-
const field =
|
|
2505
|
-
const landOn =
|
|
2506
|
-
const revealed =
|
|
2507
|
-
const at =
|
|
2508
|
-
const auto =
|
|
2858
|
+
const [pick, setPick] = useState11(null);
|
|
2859
|
+
const [query, setQuery] = useState11(() => search && search !== true ? search.query || "" : "");
|
|
2860
|
+
const [activeKey, setActiveKey] = useState11(null);
|
|
2861
|
+
const root = useRef15(null);
|
|
2862
|
+
const panel = useRef15(null);
|
|
2863
|
+
const trigger = useRef15(null);
|
|
2864
|
+
const field = useRef15(null);
|
|
2865
|
+
const landOn = useRef15(null);
|
|
2866
|
+
const revealed = useRef15(false);
|
|
2867
|
+
const at = useRef15("");
|
|
2868
|
+
const auto = useId11().replace(/:/g, "");
|
|
2509
2869
|
const uid = id ?? auto;
|
|
2510
2870
|
const inField = useContext2(FieldContext);
|
|
2511
2871
|
const fieldName = inField && id === inField.id && !(ariaLabel && triggerContent != null) ? { id: `${uid}-trigger`, labelId: inField.labelId, labelledBy: `${inField.labelId} ${uid}-trigger` } : null;
|
|
@@ -2513,7 +2873,7 @@ function Dropdown({
|
|
|
2513
2873
|
if (openProp === void 0) setSelfOpen(next);
|
|
2514
2874
|
onOpenChange?.(next);
|
|
2515
2875
|
}, [openProp, onOpenChange]);
|
|
2516
|
-
const close =
|
|
2876
|
+
const close = useRef15(setOpen);
|
|
2517
2877
|
useIsoLayoutEffect(() => {
|
|
2518
2878
|
close.current = setOpen;
|
|
2519
2879
|
});
|
|
@@ -2566,7 +2926,7 @@ function Dropdown({
|
|
|
2566
2926
|
stop.forEach((off) => off());
|
|
2567
2927
|
};
|
|
2568
2928
|
}, [open]);
|
|
2569
|
-
const opened =
|
|
2929
|
+
const opened = useRef15(false);
|
|
2570
2930
|
useIsoLayoutEffect(() => {
|
|
2571
2931
|
const el = panel.current;
|
|
2572
2932
|
if (open) {
|
|
@@ -2613,7 +2973,7 @@ function Dropdown({
|
|
|
2613
2973
|
const given = rows.find((it) => it.selected);
|
|
2614
2974
|
const givenKey = given ? keyOf(given) : null;
|
|
2615
2975
|
const pickedKey = selectedValue === void 0 && pick && pick.against === givenKey ? pick.key : null;
|
|
2616
|
-
|
|
2976
|
+
useEffect12(() => {
|
|
2617
2977
|
if (pick && pick.against !== givenKey) setPick(null);
|
|
2618
2978
|
}, [givenKey, pick]);
|
|
2619
2979
|
const picked = pickedKey != null ? rows.find((it) => keyOf(it) === pickedKey) : void 0;
|
|
@@ -2630,7 +2990,7 @@ function Dropdown({
|
|
|
2630
2990
|
const rowIds = /* @__PURE__ */ new Map();
|
|
2631
2991
|
rows.forEach((it, i) => rowIds.set(it, `${uid}-opt-${i}`));
|
|
2632
2992
|
const listId = `${uid}-list`;
|
|
2633
|
-
|
|
2993
|
+
useEffect12(() => {
|
|
2634
2994
|
if (!open) return;
|
|
2635
2995
|
const mine = () => close.current(false);
|
|
2636
2996
|
for (const other of [...openNow]) other();
|
|
@@ -2639,7 +2999,7 @@ function Dropdown({
|
|
|
2639
2999
|
openNow.delete(mine);
|
|
2640
3000
|
};
|
|
2641
3001
|
}, [open]);
|
|
2642
|
-
|
|
3002
|
+
useEffect12(() => {
|
|
2643
3003
|
if (!open) return;
|
|
2644
3004
|
const doc = root.current?.ownerDocument ?? document;
|
|
2645
3005
|
const onClick = (e) => {
|
|
@@ -2869,7 +3229,7 @@ function Dropdown({
|
|
|
2869
3229
|
};
|
|
2870
3230
|
function renderRow(entry, key) {
|
|
2871
3231
|
if (!isRow(entry)) {
|
|
2872
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx26("div", { className: "ui-dropdown__sep", role: "separator", hidden: filtering || void 0 }, key);
|
|
2873
3233
|
}
|
|
2874
3234
|
const disabled2 = !!entry.disabled;
|
|
2875
3235
|
const selected = selectedOf(entry);
|
|
@@ -2891,23 +3251,23 @@ function Dropdown({
|
|
|
2891
3251
|
...asLink ? { href: entry.href, ...entry.target ? { target: entry.target } : null } : null,
|
|
2892
3252
|
...sx ? { id: rowIds.get(entry), hidden: hiddenBy(entry) || void 0 } : null,
|
|
2893
3253
|
onClick: (e) => choose(entry, e),
|
|
2894
|
-
children: /* @__PURE__ */
|
|
2895
|
-
entry.avatar ? /* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
entry.description && /* @__PURE__ */
|
|
3254
|
+
children: /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
3255
|
+
entry.avatar ? /* @__PURE__ */ jsx26(Avatar, { personKey: entry.avatar.key, name: entry.avatar.name, src: entry.avatar.src, empty: entry.avatar.empty }) : entry.icon && /* @__PURE__ */ jsx26(Glyph2, { name: entry.icon, className: "ui-dropdown__ic" }),
|
|
3256
|
+
/* @__PURE__ */ jsxs22("span", { className: "ui-dropdown__main", children: [
|
|
3257
|
+
/* @__PURE__ */ jsx26("span", { className: "ui-dropdown__label", children: entry.label }),
|
|
3258
|
+
entry.description && /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__desc", children: entry.description })
|
|
2899
3259
|
] }),
|
|
2900
|
-
entry.badge ? /* @__PURE__ */
|
|
2901
|
-
asOption && /* @__PURE__ */
|
|
3260
|
+
entry.badge ? /* @__PURE__ */ jsx26(RowBadge, { badge: entry.badge }) : null,
|
|
3261
|
+
asOption && /* @__PURE__ */ jsx26(Glyph2, { name: "check", className: "ui-dropdown__tick", hidden: true })
|
|
2902
3262
|
] })
|
|
2903
3263
|
};
|
|
2904
|
-
if (row) return /* @__PURE__ */
|
|
3264
|
+
if (row) return /* @__PURE__ */ jsx26(Fragment12, { children: row(entry, props) }, key);
|
|
2905
3265
|
const Tag = asLink ? "a" : "div";
|
|
2906
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsx26(Tag, { ...props }, key);
|
|
2907
3267
|
}
|
|
2908
3268
|
const body = sections?.length ? sections.map((section, si) => {
|
|
2909
3269
|
const gone = filtering && !(section.items || []).some((it) => isRow(it) && !hiddenBy(it));
|
|
2910
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ jsxs22(
|
|
2911
3271
|
"div",
|
|
2912
3272
|
{
|
|
2913
3273
|
className: "ui-dropdown__section",
|
|
@@ -2915,7 +3275,7 @@ function Dropdown({
|
|
|
2915
3275
|
"aria-label": section.label || void 0,
|
|
2916
3276
|
hidden: gone || void 0,
|
|
2917
3277
|
children: [
|
|
2918
|
-
section.label && /* @__PURE__ */
|
|
3278
|
+
section.label && /* @__PURE__ */ jsx26("div", { className: "ui-dropdown__group", role: "presentation", children: section.label }),
|
|
2919
3279
|
(section.items || []).map((entry, i) => renderRow(entry, `s${si}-${i}`))
|
|
2920
3280
|
]
|
|
2921
3281
|
},
|
|
@@ -2923,12 +3283,12 @@ function Dropdown({
|
|
|
2923
3283
|
);
|
|
2924
3284
|
}) : (items || []).map((entry, i) => renderRow(entry, `i${i}`));
|
|
2925
3285
|
const cap = scroll && scroll !== true ? { "--ui-dropdown-cap": typeof scroll === "number" ? `${scroll}px` : scroll } : void 0;
|
|
2926
|
-
const none = sx && filtering && !visible.length ? /* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3286
|
+
const none = sx && filtering && !visible.length ? /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
3287
|
+
/* @__PURE__ */ jsx26("span", { className: "ui-dropdown__none-title", children: sx.empty.replace("{q}", () => query.trim()) }),
|
|
3288
|
+
/* @__PURE__ */ jsx26("span", { className: "ui-dropdown__none-hint", children: sx.hint })
|
|
2929
3289
|
] }) : null;
|
|
2930
|
-
return /* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
3290
|
+
return /* @__PURE__ */ jsxs22("div", { className: cx6("ui-dropdown", open && "open"), id, ref: root, onKeyDown, children: [
|
|
3291
|
+
/* @__PURE__ */ jsxs22(
|
|
2932
3292
|
"button",
|
|
2933
3293
|
{
|
|
2934
3294
|
type: "button",
|
|
@@ -2948,16 +3308,16 @@ function Dropdown({
|
|
|
2948
3308
|
setOpen(!open);
|
|
2949
3309
|
},
|
|
2950
3310
|
children: [
|
|
2951
|
-
triggerContent != null ? typeof triggerContent === "string" ? /* @__PURE__ */
|
|
2952
|
-
marked2 && (chosen?.avatar ? /* @__PURE__ */
|
|
2953
|
-
label && /* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
3311
|
+
triggerContent != null ? typeof triggerContent === "string" ? /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__text", children: triggerContent }) : triggerContent : /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
3312
|
+
marked2 && (chosen?.avatar ? /* @__PURE__ */ jsx26(Avatar, { personKey: chosen.avatar.key, name: chosen.avatar.name, src: chosen.avatar.src, empty: chosen.avatar.empty }) : /* @__PURE__ */ jsx26(Avatar, { empty: true })),
|
|
3313
|
+
label && /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__pre", children: label }),
|
|
3314
|
+
/* @__PURE__ */ jsx26("span", { className: cx6("ui-dropdown__value", marked2 && !chosen && "is-placeholder"), children: shown != null ? shown : placeholder })
|
|
2955
3315
|
] }),
|
|
2956
|
-
chevron && /* @__PURE__ */
|
|
3316
|
+
chevron && /* @__PURE__ */ jsx26("span", { className: "ui-dropdown__chevron", "aria-hidden": "true" })
|
|
2957
3317
|
]
|
|
2958
3318
|
}
|
|
2959
3319
|
),
|
|
2960
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsxs22(
|
|
2961
3321
|
"div",
|
|
2962
3322
|
{
|
|
2963
3323
|
className: cx6(
|
|
@@ -2978,10 +3338,10 @@ function Dropdown({
|
|
|
2978
3338
|
onMouseMove,
|
|
2979
3339
|
children: [
|
|
2980
3340
|
header,
|
|
2981
|
-
sx ? /* @__PURE__ */
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
/* @__PURE__ */
|
|
2984
|
-
/* @__PURE__ */
|
|
3341
|
+
sx ? /* @__PURE__ */ jsxs22(Fragment13, { children: [
|
|
3342
|
+
/* @__PURE__ */ jsxs22("div", { className: "ui-dropdown__search", children: [
|
|
3343
|
+
/* @__PURE__ */ jsx26(Glyph2, { name: "search", className: "ui-dropdown__search-ic", hidden: true }),
|
|
3344
|
+
/* @__PURE__ */ jsx26(
|
|
2985
3345
|
"input",
|
|
2986
3346
|
{
|
|
2987
3347
|
className: "ui-dropdown__search-input",
|
|
@@ -3005,8 +3365,8 @@ function Dropdown({
|
|
|
3005
3365
|
}
|
|
3006
3366
|
)
|
|
3007
3367
|
] }),
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
/* @__PURE__ */
|
|
3368
|
+
/* @__PURE__ */ jsx26("div", { className: "ui-dropdown__list", role: "listbox", id: listId, "aria-label": name, style: cap, children: body }),
|
|
3369
|
+
/* @__PURE__ */ jsx26(
|
|
3010
3370
|
"div",
|
|
3011
3371
|
{
|
|
3012
3372
|
className: "ui-dropdown__none",
|
|
@@ -3031,7 +3391,7 @@ function strip(o) {
|
|
|
3031
3391
|
}
|
|
3032
3392
|
|
|
3033
3393
|
// src/BackLink.tsx
|
|
3034
|
-
import { jsx as
|
|
3394
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3035
3395
|
var BARE = "Back";
|
|
3036
3396
|
var SCRIPTED = /^javascript:/i;
|
|
3037
3397
|
var LEADING = /^[\u0000-\u0020]+/;
|
|
@@ -3050,7 +3410,7 @@ function BackLink({
|
|
|
3050
3410
|
const name = text(label).replace(SAID, "");
|
|
3051
3411
|
const bare = !name || name.toLowerCase() === BARE.toLowerCase();
|
|
3052
3412
|
const Tag = as ?? "a";
|
|
3053
|
-
return /* @__PURE__ */
|
|
3413
|
+
return /* @__PURE__ */ jsxs23(
|
|
3054
3414
|
Tag,
|
|
3055
3415
|
{
|
|
3056
3416
|
className: ["ui-back", className].filter(Boolean).join(" "),
|
|
@@ -3058,8 +3418,8 @@ function BackLink({
|
|
|
3058
3418
|
"aria-label": bare ? void 0 : `${BARE} to ${name}`,
|
|
3059
3419
|
...rest,
|
|
3060
3420
|
children: [
|
|
3061
|
-
/* @__PURE__ */
|
|
3062
|
-
/* @__PURE__ */
|
|
3421
|
+
/* @__PURE__ */ jsx27(Icon, { name: "chevronLeft" }),
|
|
3422
|
+
/* @__PURE__ */ jsx27("span", { className: "ui-back__label", children: bare ? BARE : name })
|
|
3063
3423
|
]
|
|
3064
3424
|
}
|
|
3065
3425
|
);
|
|
@@ -3067,41 +3427,41 @@ function BackLink({
|
|
|
3067
3427
|
|
|
3068
3428
|
// src/TableValues.tsx
|
|
3069
3429
|
import { formatNumericValue, formatDeltaValue } from "@apliteni/apliteni-ui";
|
|
3070
|
-
import { jsx as
|
|
3430
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3071
3431
|
function NumericValue(props) {
|
|
3072
3432
|
const value = formatNumericValue(props);
|
|
3073
|
-
return /* @__PURE__ */
|
|
3433
|
+
return /* @__PURE__ */ jsx28("span", { children: /* @__PURE__ */ jsxs24("span", { className: "ui-value", "aria-label": value.missing, children: [
|
|
3074
3434
|
value.text,
|
|
3075
|
-
value.unit && /* @__PURE__ */
|
|
3435
|
+
value.unit && /* @__PURE__ */ jsx28("span", { className: "ui-value__unit", children: value.unit })
|
|
3076
3436
|
] }) });
|
|
3077
3437
|
}
|
|
3078
3438
|
function DeltaValue(props) {
|
|
3079
3439
|
const value = formatDeltaValue(props);
|
|
3080
|
-
return /* @__PURE__ */
|
|
3440
|
+
return /* @__PURE__ */ jsx28("span", { children: /* @__PURE__ */ jsx28("span", { className: value.className, "aria-describedby": value.basisId || void 0, children: value.text }) });
|
|
3081
3441
|
}
|
|
3082
3442
|
function RowIdentity({ symbol, name, logo, href }) {
|
|
3083
3443
|
const Tag = href ? "a" : "span";
|
|
3084
|
-
return /* @__PURE__ */
|
|
3085
|
-
/* @__PURE__ */
|
|
3086
|
-
/* @__PURE__ */
|
|
3087
|
-
logo && /* @__PURE__ */
|
|
3444
|
+
return /* @__PURE__ */ jsxs24(Tag, { className: "ui-identity", href, children: [
|
|
3445
|
+
/* @__PURE__ */ jsxs24("span", { className: "ui-identity__logo", "aria-hidden": "true", children: [
|
|
3446
|
+
/* @__PURE__ */ jsx28("span", { children: symbol.slice(0, 1) }),
|
|
3447
|
+
logo && /* @__PURE__ */ jsx28("img", { src: logo, alt: "", onLoad: (e) => {
|
|
3088
3448
|
e.currentTarget.hidden = false;
|
|
3089
3449
|
}, onError: (e) => {
|
|
3090
3450
|
e.currentTarget.hidden = true;
|
|
3091
3451
|
} })
|
|
3092
3452
|
] }),
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3453
|
+
/* @__PURE__ */ jsx28("span", { className: "ui-identity__symbol", children: symbol }),
|
|
3454
|
+
/* @__PURE__ */ jsx28("span", { className: "ui-identity__name", children: name })
|
|
3095
3455
|
] });
|
|
3096
3456
|
}
|
|
3097
3457
|
|
|
3098
3458
|
// src/Segmented.tsx
|
|
3099
3459
|
import { segmentedNextIndex } from "@apliteni/apliteni-ui";
|
|
3100
|
-
import { jsx as
|
|
3460
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3101
3461
|
function Segmented({ options, value, onChange, label, appearance = "pill", size, block = false, disabled = false }) {
|
|
3102
3462
|
const enabled = options.filter((o) => !o.disabled);
|
|
3103
3463
|
const tabValue = enabled.some((o) => o.value === value) ? value : enabled[0]?.value;
|
|
3104
|
-
return /* @__PURE__ */
|
|
3464
|
+
return /* @__PURE__ */ jsx29("div", { className: `ui-seg${size === "sm" ? " ui-seg--sm" : ""}${block ? " ui-seg--block" : ""}${appearance === "underline" ? " ui-seg--underline" : ""}`, role: "toolbar", "aria-label": label, children: options.map((option) => /* @__PURE__ */ jsxs25(
|
|
3105
3465
|
"button",
|
|
3106
3466
|
{
|
|
3107
3467
|
type: "button",
|
|
@@ -3121,7 +3481,7 @@ function Segmented({ options, value, onChange, label, appearance = "pill", size,
|
|
|
3121
3481
|
onChange(enabled[next].value);
|
|
3122
3482
|
},
|
|
3123
3483
|
children: [
|
|
3124
|
-
option.icon && /* @__PURE__ */
|
|
3484
|
+
option.icon && /* @__PURE__ */ jsx29(Icon, { name: option.icon }),
|
|
3125
3485
|
!(option.icon && option.iconOnly) && option.label
|
|
3126
3486
|
]
|
|
3127
3487
|
},
|
|
@@ -3130,17 +3490,17 @@ function Segmented({ options, value, onChange, label, appearance = "pill", size,
|
|
|
3130
3490
|
}
|
|
3131
3491
|
|
|
3132
3492
|
// src/FilterBar.tsx
|
|
3133
|
-
import { useRef as
|
|
3493
|
+
import { useRef as useRef16, useState as useState12 } from "react";
|
|
3134
3494
|
import { filterChipText, filterChipName, filterChipUnset, filterChipItems, focusNextStop } from "@apliteni/apliteni-ui";
|
|
3135
|
-
import { Fragment as
|
|
3495
|
+
import { Fragment as Fragment14, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3136
3496
|
var SEARCH_AT = 10;
|
|
3137
3497
|
var isRow2 = (entry) => entry !== "---" && !entry.separator;
|
|
3138
3498
|
function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clearVariant = "ghost", add, addLabel = "Filter", disabled = false, busy = false, onRemove, onClear, onChange, onAdd }) {
|
|
3139
|
-
const bar =
|
|
3140
|
-
const focused =
|
|
3141
|
-
const landing =
|
|
3142
|
-
const [opened, setOpened] =
|
|
3143
|
-
const [adding, setAdding] =
|
|
3499
|
+
const bar = useRef16(null);
|
|
3500
|
+
const focused = useRef16(null);
|
|
3501
|
+
const landing = useRef16(null);
|
|
3502
|
+
const [opened, setOpened] = useState12({});
|
|
3503
|
+
const [adding, setAdding] = useState12(false);
|
|
3144
3504
|
const blocked = disabled || busy;
|
|
3145
3505
|
const offer = (add || []).filter((entry) => !filters.some((filter) => filter.id === entry.id));
|
|
3146
3506
|
const source = /* @__PURE__ */ new Map();
|
|
@@ -3182,7 +3542,7 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3182
3542
|
if (target) target.focus();
|
|
3183
3543
|
else focusNextStop(bar.current);
|
|
3184
3544
|
});
|
|
3185
|
-
return /* @__PURE__ */
|
|
3545
|
+
return /* @__PURE__ */ jsx30("div", { children: /* @__PURE__ */ jsxs26(
|
|
3186
3546
|
"fieldset",
|
|
3187
3547
|
{
|
|
3188
3548
|
ref: bar,
|
|
@@ -3195,8 +3555,8 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3195
3555
|
if (event.relatedTarget && !event.currentTarget.contains(event.relatedTarget)) focused.current = null;
|
|
3196
3556
|
},
|
|
3197
3557
|
children: [
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
filters.map((filter, index) => /* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ jsx30("legend", { className: "ui-filter-bar__legend", children: label }),
|
|
3559
|
+
filters.map((filter, index) => /* @__PURE__ */ jsxs26(
|
|
3200
3560
|
"fieldset",
|
|
3201
3561
|
{
|
|
3202
3562
|
className: "ui-filter-bar__chip",
|
|
@@ -3206,14 +3566,14 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3206
3566
|
focused.current = { id: filter.id, index, remove: Boolean(event.target.closest("[data-filter-remove]")) };
|
|
3207
3567
|
},
|
|
3208
3568
|
children: [
|
|
3209
|
-
/* @__PURE__ */
|
|
3210
|
-
/* @__PURE__ */
|
|
3569
|
+
/* @__PURE__ */ jsx30("legend", { className: "ui-filter-bar__legend", children: filter.label }),
|
|
3570
|
+
/* @__PURE__ */ jsx30(
|
|
3211
3571
|
Dropdown,
|
|
3212
3572
|
{
|
|
3213
3573
|
items: filterChipItems(filter),
|
|
3214
3574
|
variant: "select",
|
|
3215
3575
|
ariaLabel: filterChipName(filter),
|
|
3216
|
-
triggerContent: /* @__PURE__ */
|
|
3576
|
+
triggerContent: /* @__PURE__ */ jsx30("span", { className: filterChipUnset(filter) ? "ui-dropdown__value is-placeholder" : "ui-dropdown__value", children: filterChipText(filter) }),
|
|
3217
3577
|
open: !blocked && !filter.disabled && (opened[filter.id] && opened[filter.id].against === filter.open ? opened[filter.id].open : !!filter.open),
|
|
3218
3578
|
onOpenChange: (open) => setOpened((previous) => ({ ...previous, [filter.id]: { open, against: filter.open } })),
|
|
3219
3579
|
onSelect: (value) => {
|
|
@@ -3221,7 +3581,7 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3221
3581
|
}
|
|
3222
3582
|
}
|
|
3223
3583
|
),
|
|
3224
|
-
!filterChipUnset(filter) && /* @__PURE__ */
|
|
3584
|
+
!filterChipUnset(filter) && /* @__PURE__ */ jsx30(
|
|
3225
3585
|
"button",
|
|
3226
3586
|
{
|
|
3227
3587
|
type: "button",
|
|
@@ -3238,16 +3598,16 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3238
3598
|
},
|
|
3239
3599
|
filter.id
|
|
3240
3600
|
)),
|
|
3241
|
-
offering && /* @__PURE__ */
|
|
3601
|
+
offering && /* @__PURE__ */ jsx30("div", { "data-filter-add": "", onFocus: () => {
|
|
3242
3602
|
focused.current = null;
|
|
3243
|
-
}, children: /* @__PURE__ */
|
|
3603
|
+
}, children: /* @__PURE__ */ jsx30(
|
|
3244
3604
|
Dropdown,
|
|
3245
3605
|
{
|
|
3246
3606
|
variant: "menu",
|
|
3247
3607
|
sections,
|
|
3248
3608
|
ariaLabel: addLabel,
|
|
3249
|
-
triggerContent: /* @__PURE__ */
|
|
3250
|
-
/* @__PURE__ */
|
|
3609
|
+
triggerContent: /* @__PURE__ */ jsxs26(Fragment14, { children: [
|
|
3610
|
+
/* @__PURE__ */ jsx30(Icon, { name: "plus" }),
|
|
3251
3611
|
addLabel
|
|
3252
3612
|
] }),
|
|
3253
3613
|
search: options >= SEARCH_AT && { label: `Search ${label.toLowerCase()}` },
|
|
@@ -3261,9 +3621,9 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3261
3621
|
}
|
|
3262
3622
|
}
|
|
3263
3623
|
) }),
|
|
3264
|
-
filters.some((filter) => !filterChipUnset(filter)) && /* @__PURE__ */
|
|
3624
|
+
filters.some((filter) => !filterChipUnset(filter)) && /* @__PURE__ */ jsx30("span", { "data-filter-clear": "", onFocus: () => {
|
|
3265
3625
|
focused.current = { id: null, index: 0 };
|
|
3266
|
-
}, children: /* @__PURE__ */
|
|
3626
|
+
}, children: /* @__PURE__ */ jsx30(Button, { size: "sm", variant: clearVariant, onClick: () => {
|
|
3267
3627
|
if (!blocked) onClear();
|
|
3268
3628
|
}, children: clearLabel }) })
|
|
3269
3629
|
]
|
|
@@ -3272,37 +3632,37 @@ function FilterBar({ filters, label = "Filters", clearLabel = "Clear all", clear
|
|
|
3272
3632
|
}
|
|
3273
3633
|
|
|
3274
3634
|
// src/KeyValueList.tsx
|
|
3275
|
-
import { jsx as
|
|
3635
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3276
3636
|
function detail({ value, redacted }) {
|
|
3277
|
-
if (redacted) return /* @__PURE__ */
|
|
3278
|
-
/* @__PURE__ */
|
|
3637
|
+
if (redacted) return /* @__PURE__ */ jsxs27("span", { className: "ui-kv__hidden", children: [
|
|
3638
|
+
/* @__PURE__ */ jsx31(Icon, { name: "eyeOff" }),
|
|
3279
3639
|
"Hidden"
|
|
3280
3640
|
] });
|
|
3281
3641
|
if (value == null) return "\u2014";
|
|
3282
3642
|
return typeof value === "boolean" ? String(value) : value;
|
|
3283
3643
|
}
|
|
3284
3644
|
function KeyValueList({ rows, columns = 1, className, ...rest }) {
|
|
3285
|
-
return /* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3287
|
-
/* @__PURE__ */
|
|
3645
|
+
return /* @__PURE__ */ jsx31("dl", { ...rest, className: ["ui-kv", columns === 2 && "ui-kv--two-columns", className].filter(Boolean).join(" "), children: rows.map((row, index) => /* @__PURE__ */ jsxs27("div", { className: "ui-drawer__row", children: [
|
|
3646
|
+
/* @__PURE__ */ jsx31("dt", { children: row.label }),
|
|
3647
|
+
/* @__PURE__ */ jsx31("dd", { children: detail(row) })
|
|
3288
3648
|
] }, index)) });
|
|
3289
3649
|
}
|
|
3290
3650
|
function DrawerSection({ title, headingLevel = 3, className, children, ...rest }) {
|
|
3291
3651
|
const Heading = `h${headingLevel}`;
|
|
3292
|
-
return /* @__PURE__ */
|
|
3293
|
-
title != null && /* @__PURE__ */
|
|
3652
|
+
return /* @__PURE__ */ jsxs27("section", { ...rest, className: ["ui-drawer__section", className].filter(Boolean).join(" "), children: [
|
|
3653
|
+
title != null && /* @__PURE__ */ jsx31(Heading, { className: "ui-drawer__section-title", children: title }),
|
|
3294
3654
|
children
|
|
3295
3655
|
] });
|
|
3296
3656
|
}
|
|
3297
3657
|
|
|
3298
3658
|
// src/Snippet.tsx
|
|
3299
|
-
import { useEffect as
|
|
3300
|
-
import { Fragment as
|
|
3659
|
+
import { useEffect as useEffect13, useRef as useRef17, useState as useState13 } from "react";
|
|
3660
|
+
import { Fragment as Fragment15, jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3301
3661
|
function Snippet({ label = "shell", code = "", children, copy = true, reveal = false, copyLabel = "Copy code" }) {
|
|
3302
|
-
const [status, setStatus] =
|
|
3303
|
-
const request =
|
|
3304
|
-
const timer =
|
|
3305
|
-
|
|
3662
|
+
const [status, setStatus] = useState13("idle");
|
|
3663
|
+
const request = useRef17(0);
|
|
3664
|
+
const timer = useRef17(void 0);
|
|
3665
|
+
useEffect13(() => {
|
|
3306
3666
|
setStatus("idle");
|
|
3307
3667
|
return () => {
|
|
3308
3668
|
request.current++;
|
|
@@ -3322,11 +3682,11 @@ function Snippet({ label = "shell", code = "", children, copy = true, reveal = f
|
|
|
3322
3682
|
if (current === request.current) setStatus("failed");
|
|
3323
3683
|
}
|
|
3324
3684
|
}
|
|
3325
|
-
return /* @__PURE__ */
|
|
3326
|
-
/* @__PURE__ */
|
|
3327
|
-
/* @__PURE__ */
|
|
3328
|
-
copy && /* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3685
|
+
return /* @__PURE__ */ jsxs28("div", { className: reveal ? "ui-snippet ui-snippet--reveal" : "ui-snippet", children: [
|
|
3686
|
+
/* @__PURE__ */ jsxs28("div", { className: "ui-snippet__bar", children: [
|
|
3687
|
+
/* @__PURE__ */ jsx32("span", { children: label }),
|
|
3688
|
+
copy && /* @__PURE__ */ jsxs28(Fragment15, { children: [
|
|
3689
|
+
/* @__PURE__ */ jsx32(
|
|
3330
3690
|
"button",
|
|
3331
3691
|
{
|
|
3332
3692
|
type: "button",
|
|
@@ -3334,102 +3694,25 @@ function Snippet({ label = "shell", code = "", children, copy = true, reveal = f
|
|
|
3334
3694
|
"aria-label": copyLabel,
|
|
3335
3695
|
title: copyLabel,
|
|
3336
3696
|
onClick: handleCopy,
|
|
3337
|
-
children: /* @__PURE__ */
|
|
3697
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: status === "idle" ? "copy" : "check" })
|
|
3338
3698
|
}
|
|
3339
3699
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3700
|
+
/* @__PURE__ */ jsx32("span", { className: "ui-sr ui-snippet__status", role: "status", "aria-live": "polite", children: status === "copied" ? "Copied" : status === "failed" ? "Copy failed" : "" })
|
|
3341
3701
|
] })
|
|
3342
3702
|
] }),
|
|
3343
|
-
/* @__PURE__ */
|
|
3344
|
-
] });
|
|
3345
|
-
}
|
|
3346
|
-
|
|
3347
|
-
// src/Tabs.tsx
|
|
3348
|
-
import { useEffect as useEffect10, useId as useId9, useRef as useRef15 } from "react";
|
|
3349
|
-
import { playEntrance } from "@apliteni/apliteni-ui/motion";
|
|
3350
|
-
import { Fragment as Fragment12, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3351
|
-
function Tabs({ items, value, onChange, label }) {
|
|
3352
|
-
const id = useId9();
|
|
3353
|
-
const previous = useRef15(value);
|
|
3354
|
-
const activePanel = useRef15(null);
|
|
3355
|
-
const buttons = useRef15([]);
|
|
3356
|
-
useEffect10(() => {
|
|
3357
|
-
if (previous.current !== value) playEntrance(activePanel.current);
|
|
3358
|
-
previous.current = value;
|
|
3359
|
-
}, [value]);
|
|
3360
|
-
return /* @__PURE__ */ jsxs25("div", { className: "ui-tabs", children: [
|
|
3361
|
-
/* @__PURE__ */ jsx29("div", { className: "ui-tabs__list", role: "tablist", "aria-label": label, children: items.map((item, i) => /* @__PURE__ */ jsxs25(
|
|
3362
|
-
"button",
|
|
3363
|
-
{
|
|
3364
|
-
type: "button",
|
|
3365
|
-
role: "tab",
|
|
3366
|
-
ref: (el) => {
|
|
3367
|
-
buttons.current[i] = el;
|
|
3368
|
-
},
|
|
3369
|
-
className: `ui-tabs__tab${item.value === value ? " is-active" : ""}`,
|
|
3370
|
-
id: `${id}-tab-${i}`,
|
|
3371
|
-
"aria-controls": `${id}-panel-${i}`,
|
|
3372
|
-
"aria-selected": item.value === value,
|
|
3373
|
-
tabIndex: item.value === value ? 0 : -1,
|
|
3374
|
-
onClick: () => onChange(item.value),
|
|
3375
|
-
onKeyDown: (event) => {
|
|
3376
|
-
let next;
|
|
3377
|
-
switch (event.key) {
|
|
3378
|
-
case "ArrowRight":
|
|
3379
|
-
next = (i + 1) % items.length;
|
|
3380
|
-
break;
|
|
3381
|
-
case "ArrowLeft":
|
|
3382
|
-
next = (i - 1 + items.length) % items.length;
|
|
3383
|
-
break;
|
|
3384
|
-
case "Home":
|
|
3385
|
-
next = 0;
|
|
3386
|
-
break;
|
|
3387
|
-
case "End":
|
|
3388
|
-
next = items.length - 1;
|
|
3389
|
-
break;
|
|
3390
|
-
default:
|
|
3391
|
-
return;
|
|
3392
|
-
}
|
|
3393
|
-
event.preventDefault();
|
|
3394
|
-
buttons.current[next]?.focus();
|
|
3395
|
-
onChange(items[next].value);
|
|
3396
|
-
},
|
|
3397
|
-
children: [
|
|
3398
|
-
item.label,
|
|
3399
|
-
item.count != null && /* @__PURE__ */ jsxs25(Fragment12, { children: [
|
|
3400
|
-
" ",
|
|
3401
|
-
item.count
|
|
3402
|
-
] })
|
|
3403
|
-
]
|
|
3404
|
-
},
|
|
3405
|
-
item.value
|
|
3406
|
-
)) }),
|
|
3407
|
-
/* @__PURE__ */ jsx29("div", { className: "ui-tabs__panels", children: items.map((item, i) => /* @__PURE__ */ jsx29(
|
|
3408
|
-
"div",
|
|
3409
|
-
{
|
|
3410
|
-
className: "ui-tabs__panel",
|
|
3411
|
-
role: "tabpanel",
|
|
3412
|
-
ref: item.value === value ? activePanel : void 0,
|
|
3413
|
-
id: `${id}-panel-${i}`,
|
|
3414
|
-
"aria-labelledby": `${id}-tab-${i}`,
|
|
3415
|
-
tabIndex: 0,
|
|
3416
|
-
hidden: item.value !== value,
|
|
3417
|
-
children: item.value === value ? item.panel : null
|
|
3418
|
-
},
|
|
3419
|
-
item.value
|
|
3420
|
-
)) })
|
|
3703
|
+
/* @__PURE__ */ jsx32("pre", { children: children ?? code })
|
|
3421
3704
|
] });
|
|
3422
3705
|
}
|
|
3423
3706
|
|
|
3424
3707
|
// src/Timeline.tsx
|
|
3425
|
-
import { useEffect as
|
|
3708
|
+
import { useEffect as useEffect14, useRef as useRef18 } from "react";
|
|
3426
3709
|
import { playEntrance as playEntrance2, prefersReducedMotion } from "@apliteni/apliteni-ui/motion";
|
|
3427
|
-
import { jsx as
|
|
3710
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3428
3711
|
var kindIcons = { person: "user", rule: "bolt", reversal: "refresh" };
|
|
3429
3712
|
function Timeline({ events, className, ...rest }) {
|
|
3430
|
-
const previousIds =
|
|
3431
|
-
const rows =
|
|
3432
|
-
|
|
3713
|
+
const previousIds = useRef18(new Set(events.map((event) => event.id)));
|
|
3714
|
+
const rows = useRef18(/* @__PURE__ */ new Map());
|
|
3715
|
+
useEffect14(() => {
|
|
3433
3716
|
if (previousIds.current.size > 0 && !prefersReducedMotion()) {
|
|
3434
3717
|
for (const event of events) {
|
|
3435
3718
|
if (previousIds.current.has(event.id)) continue;
|
|
@@ -3441,7 +3724,7 @@ function Timeline({ events, className, ...rest }) {
|
|
|
3441
3724
|
}
|
|
3442
3725
|
previousIds.current = new Set(events.map((event) => event.id));
|
|
3443
3726
|
}, [events]);
|
|
3444
|
-
return /* @__PURE__ */
|
|
3727
|
+
return /* @__PURE__ */ jsx33("ol", { ...rest, role: "list", className: ["ui-timeline", events.some((event) => event.kind) && "ui-timeline--kinds", className].filter(Boolean).join(" "), children: events.map((event, index) => /* @__PURE__ */ jsxs29(
|
|
3445
3728
|
"li",
|
|
3446
3729
|
{
|
|
3447
3730
|
className: "ui-timeline__event",
|
|
@@ -3450,20 +3733,20 @@ function Timeline({ events, className, ...rest }) {
|
|
|
3450
3733
|
else rows.current.delete(event.id);
|
|
3451
3734
|
},
|
|
3452
3735
|
children: [
|
|
3453
|
-
/* @__PURE__ */
|
|
3736
|
+
/* @__PURE__ */ jsx33("span", { "aria-hidden": "true", className: [
|
|
3454
3737
|
"ui-timeline__marker",
|
|
3455
3738
|
event.kind && "ui-timeline__marker--kind",
|
|
3456
3739
|
event.kind === "reversal" && "ui-timeline__marker--reversal"
|
|
3457
|
-
].filter(Boolean).join(" "), children: event.kind && /* @__PURE__ */
|
|
3458
|
-
/* @__PURE__ */
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
index === events.length - 1 && event.relativeTimestamp && /* @__PURE__ */
|
|
3740
|
+
].filter(Boolean).join(" "), children: event.kind && /* @__PURE__ */ jsx33(Icon, { name: kindIcons[event.kind] }) }),
|
|
3741
|
+
/* @__PURE__ */ jsxs29("div", { className: "ui-timeline__head", children: [
|
|
3742
|
+
/* @__PURE__ */ jsx33("span", { className: "ui-timeline__actor", children: event.actor }),
|
|
3743
|
+
/* @__PURE__ */ jsx33("time", { dateTime: event.dateTime, children: event.timestamp }),
|
|
3744
|
+
index === events.length - 1 && event.relativeTimestamp && /* @__PURE__ */ jsx33("span", { className: "ui-timeline__relative", children: event.relativeTimestamp })
|
|
3462
3745
|
] }),
|
|
3463
|
-
/* @__PURE__ */
|
|
3464
|
-
(event.meta != null || event.undo) && /* @__PURE__ */
|
|
3465
|
-
event.meta != null && /* @__PURE__ */
|
|
3466
|
-
event.undo && /* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ jsx33("p", { className: "ui-timeline__description", children: event.description }),
|
|
3747
|
+
(event.meta != null || event.undo) && /* @__PURE__ */ jsxs29("div", { className: "ui-timeline__meta", children: [
|
|
3748
|
+
event.meta != null && /* @__PURE__ */ jsx33("span", { children: event.meta }),
|
|
3749
|
+
event.undo && /* @__PURE__ */ jsx33(Button, { variant: "ghost", size: "xs", className: "ui-btn ui-btn--ghost ui-btn--xs ui-timeline__undo", "aria-label": event.undo.label, onClick: event.undo.onUndo, children: "Undo" })
|
|
3467
3750
|
] })
|
|
3468
3751
|
]
|
|
3469
3752
|
},
|
|
@@ -3472,20 +3755,20 @@ function Timeline({ events, className, ...rest }) {
|
|
|
3472
3755
|
}
|
|
3473
3756
|
|
|
3474
3757
|
// src/Field.tsx
|
|
3475
|
-
import { forwardRef as
|
|
3758
|
+
import { forwardRef as forwardRef8, useEffect as useEffect15, useId as useId12, useRef as useRef19, useState as useState14 } from "react";
|
|
3476
3759
|
import { esc, icon as icon5 } from "@apliteni/apliteni-ui";
|
|
3477
|
-
import { jsx as
|
|
3760
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3478
3761
|
function messages(id, hint, error) {
|
|
3479
3762
|
return [error && `${id}-error`, hint && `${id}-hint`].filter(Boolean).join(" ") || void 0;
|
|
3480
3763
|
}
|
|
3481
3764
|
function Frame({ id, labelId, label, hint, error, required, children }) {
|
|
3482
|
-
return /* @__PURE__ */
|
|
3483
|
-
/* @__PURE__ */
|
|
3765
|
+
return /* @__PURE__ */ jsxs30("div", { className: "ui-field", children: [
|
|
3766
|
+
/* @__PURE__ */ jsxs30("label", { className: "ui-field__label", id: labelId, htmlFor: id, children: [
|
|
3484
3767
|
label,
|
|
3485
|
-
required && /* @__PURE__ */
|
|
3768
|
+
required && /* @__PURE__ */ jsx34("span", { className: "ui-field__req", "aria-hidden": "true", children: "*" })
|
|
3486
3769
|
] }),
|
|
3487
3770
|
children,
|
|
3488
|
-
error && /* @__PURE__ */
|
|
3771
|
+
error && /* @__PURE__ */ jsx34(
|
|
3489
3772
|
"div",
|
|
3490
3773
|
{
|
|
3491
3774
|
id: `${id}-error`,
|
|
@@ -3494,23 +3777,23 @@ function Frame({ id, labelId, label, hint, error, required, children }) {
|
|
|
3494
3777
|
dangerouslySetInnerHTML: { __html: icon5("alert") + esc(error) }
|
|
3495
3778
|
}
|
|
3496
3779
|
),
|
|
3497
|
-
hint && /* @__PURE__ */
|
|
3780
|
+
hint && /* @__PURE__ */ jsx34("div", { id: `${id}-hint`, className: "ui-field__hint", children: hint })
|
|
3498
3781
|
] });
|
|
3499
3782
|
}
|
|
3500
3783
|
function wiring(id, hint, error) {
|
|
3501
3784
|
return { id, "aria-describedby": messages(id, hint, error), "aria-invalid": error ? true : void 0 };
|
|
3502
3785
|
}
|
|
3503
3786
|
function Field({ id: suppliedId, label, hint, error, required, children }) {
|
|
3504
|
-
const generatedId =
|
|
3787
|
+
const generatedId = useId12();
|
|
3505
3788
|
const id = suppliedId ?? generatedId;
|
|
3506
3789
|
const labelId = `${id}-label`;
|
|
3507
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId }, children: children({ ...wiring(id, hint, error), required }) }) });
|
|
3508
3791
|
}
|
|
3509
|
-
var TextField =
|
|
3510
|
-
const id =
|
|
3792
|
+
var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph, className = "", ...props }, ref) {
|
|
3793
|
+
const id = useId12();
|
|
3511
3794
|
const hasUnit = type === "number" && !!unit;
|
|
3512
3795
|
const describedBy = [messages(id, hint, error), hasUnit ? `${id}-unit` : ""].filter(Boolean).join(" ") || void 0;
|
|
3513
|
-
const control = /* @__PURE__ */
|
|
3796
|
+
const control = /* @__PURE__ */ jsx34(
|
|
3514
3797
|
"input",
|
|
3515
3798
|
{
|
|
3516
3799
|
ref,
|
|
@@ -3523,19 +3806,19 @@ var TextField = forwardRef6(function TextField2({ label, hint, error, required,
|
|
|
3523
3806
|
className: `ui-input${error ? " is-invalid" : ""} ${className}`
|
|
3524
3807
|
}
|
|
3525
3808
|
);
|
|
3526
|
-
const unitSpan = hasUnit ? /* @__PURE__ */
|
|
3527
|
-
return /* @__PURE__ */
|
|
3528
|
-
/* @__PURE__ */
|
|
3809
|
+
const unitSpan = hasUnit ? /* @__PURE__ */ jsx34("span", { id: `${id}-unit`, className: "ui-field-number__unit", children: unit }) : null;
|
|
3810
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: glyph ? /* @__PURE__ */ jsxs30("div", { className: `ui-input-group${hasUnit ? " ui-field-number" : ""}`, children: [
|
|
3811
|
+
/* @__PURE__ */ jsx34("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon5(glyph) } }),
|
|
3529
3812
|
control,
|
|
3530
3813
|
unitSpan
|
|
3531
|
-
] }) : hasUnit ? /* @__PURE__ */
|
|
3814
|
+
] }) : hasUnit ? /* @__PURE__ */ jsxs30("div", { className: "ui-field-number", children: [
|
|
3532
3815
|
control,
|
|
3533
3816
|
unitSpan
|
|
3534
3817
|
] }) : control });
|
|
3535
3818
|
});
|
|
3536
3819
|
function TextArea({ label, hint, error, required, className = "", ...props }) {
|
|
3537
|
-
const id =
|
|
3538
|
-
return /* @__PURE__ */
|
|
3820
|
+
const id = useId12();
|
|
3821
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
|
|
3539
3822
|
"textarea",
|
|
3540
3823
|
{
|
|
3541
3824
|
rows: 4,
|
|
@@ -3547,8 +3830,8 @@ function TextArea({ label, hint, error, required, className = "", ...props }) {
|
|
|
3547
3830
|
) });
|
|
3548
3831
|
}
|
|
3549
3832
|
function SelectField({ label, hint, error, required, className = "", children, ...props }) {
|
|
3550
|
-
const id =
|
|
3551
|
-
return /* @__PURE__ */
|
|
3833
|
+
const id = useId12();
|
|
3834
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsx34(
|
|
3552
3835
|
"select",
|
|
3553
3836
|
{
|
|
3554
3837
|
...props,
|
|
@@ -3560,11 +3843,11 @@ function SelectField({ label, hint, error, required, className = "", children, .
|
|
|
3560
3843
|
) });
|
|
3561
3844
|
}
|
|
3562
3845
|
function FileField({ label, hint, error, required, disabled, onFileChange, className = "", ...props }) {
|
|
3563
|
-
const id =
|
|
3564
|
-
const input =
|
|
3565
|
-
const [file, setFile] =
|
|
3566
|
-
const [dragging, setDragging] =
|
|
3567
|
-
|
|
3846
|
+
const id = useId12();
|
|
3847
|
+
const input = useRef19(null);
|
|
3848
|
+
const [file, setFile] = useState14(null);
|
|
3849
|
+
const [dragging, setDragging] = useState14(false);
|
|
3850
|
+
useEffect15(() => {
|
|
3568
3851
|
const form = input.current?.form;
|
|
3569
3852
|
const reset = () => {
|
|
3570
3853
|
setFile(null);
|
|
@@ -3577,7 +3860,7 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
|
|
|
3577
3860
|
setFile(next);
|
|
3578
3861
|
onFileChange?.(next);
|
|
3579
3862
|
};
|
|
3580
|
-
return /* @__PURE__ */
|
|
3863
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: /* @__PURE__ */ jsxs30(
|
|
3581
3864
|
"div",
|
|
3582
3865
|
{
|
|
3583
3866
|
className: `ui-file${dragging && !disabled ? " is-dragging" : ""}${file ? " has-file" : ""}${error ? " is-invalid" : ""}${disabled ? " is-disabled" : ""}`,
|
|
@@ -3598,12 +3881,12 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
|
|
|
3598
3881
|
update(transfer.files[0]);
|
|
3599
3882
|
},
|
|
3600
3883
|
children: [
|
|
3601
|
-
/* @__PURE__ */
|
|
3602
|
-
/* @__PURE__ */
|
|
3603
|
-
/* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3606
|
-
/* @__PURE__ */
|
|
3884
|
+
/* @__PURE__ */ jsx34("span", { className: "ui-file__glyph", children: /* @__PURE__ */ jsx34(Icon, { name: "upload" }) }),
|
|
3885
|
+
/* @__PURE__ */ jsx34("div", { "aria-live": "polite", children: file ? file.name : "Drop a file here" }),
|
|
3886
|
+
/* @__PURE__ */ jsx34("div", { children: "or choose one from your device" }),
|
|
3887
|
+
/* @__PURE__ */ jsxs30("span", { className: "ui-file__choose", children: [
|
|
3888
|
+
/* @__PURE__ */ jsx34("span", { className: "ui-btn ui-btn--secondary ui-btn--sm", "aria-hidden": "true", "aria-disabled": disabled || void 0, children: file ? "Replace file" : "Choose file" }),
|
|
3889
|
+
/* @__PURE__ */ jsx34(
|
|
3607
3890
|
"input",
|
|
3608
3891
|
{
|
|
3609
3892
|
...props,
|
|
@@ -3623,11 +3906,11 @@ function FileField({ label, hint, error, required, disabled, onFileChange, class
|
|
|
3623
3906
|
}
|
|
3624
3907
|
|
|
3625
3908
|
// src/FileDrop.tsx
|
|
3626
|
-
import { useRef as
|
|
3909
|
+
import { useRef as useRef20, useState as useState15 } from "react";
|
|
3627
3910
|
|
|
3628
3911
|
// src/EmptyState.tsx
|
|
3629
3912
|
import { icon as kitIcon3, illo } from "@apliteni/apliteni-ui";
|
|
3630
|
-
import { jsx as
|
|
3913
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3631
3914
|
var cases = {
|
|
3632
3915
|
"first-run": { title: "Nothing needs you yet", sub: "New items will appear here when they need your attention.", icon: "check" },
|
|
3633
3916
|
"no-matches": { title: "No results in this view", sub: "Try another search or clear your filters.", icon: "search" },
|
|
@@ -3639,16 +3922,16 @@ function EmptyState({ variant = "first-run", title, sub, icon: icon9, art, actio
|
|
|
3639
3922
|
const heading = title ?? preset.title;
|
|
3640
3923
|
const guidance = sub ?? preset.sub;
|
|
3641
3924
|
const glyph = icon9 ?? preset.icon;
|
|
3642
|
-
return /* @__PURE__ */
|
|
3643
|
-
art ? typeof art === "string" ? /* @__PURE__ */
|
|
3644
|
-
heading && /* @__PURE__ */
|
|
3645
|
-
guidance && /* @__PURE__ */
|
|
3646
|
-
actions && /* @__PURE__ */
|
|
3925
|
+
return /* @__PURE__ */ jsxs31("div", { className: "ui-empty", children: [
|
|
3926
|
+
art ? typeof art === "string" ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph) } }) : null,
|
|
3927
|
+
heading && /* @__PURE__ */ jsx35("div", { className: "ui-empty__title", children: heading }),
|
|
3928
|
+
guidance && /* @__PURE__ */ jsx35("div", { className: "ui-empty__sub", children: guidance }),
|
|
3929
|
+
actions && /* @__PURE__ */ jsx35("div", { className: "ui-empty__actions", children: actions })
|
|
3647
3930
|
] });
|
|
3648
3931
|
}
|
|
3649
3932
|
|
|
3650
3933
|
// src/FileDrop.tsx
|
|
3651
|
-
import { Fragment as
|
|
3934
|
+
import { Fragment as Fragment16, jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3652
3935
|
var MARKS = {
|
|
3653
3936
|
uploading: "clock",
|
|
3654
3937
|
done: "circleCheck",
|
|
@@ -3684,8 +3967,8 @@ function FileDrop({
|
|
|
3684
3967
|
children,
|
|
3685
3968
|
className
|
|
3686
3969
|
}) {
|
|
3687
|
-
const input =
|
|
3688
|
-
const [over, setOver] =
|
|
3970
|
+
const input = useRef20(null);
|
|
3971
|
+
const [over, setOver] = useState15(false);
|
|
3689
3972
|
const status = file?.status ?? "uploading";
|
|
3690
3973
|
const word = status === "error" ? file?.error ?? WORDS.error : file?.state ?? WORDS[status];
|
|
3691
3974
|
const [stem, ext] = splitName(file?.name ?? "");
|
|
@@ -3701,7 +3984,7 @@ function FileDrop({
|
|
|
3701
3984
|
const pick = () => {
|
|
3702
3985
|
if (!disabled) input.current?.click();
|
|
3703
3986
|
};
|
|
3704
|
-
const picker = /* @__PURE__ */
|
|
3987
|
+
const picker = /* @__PURE__ */ jsx36(
|
|
3705
3988
|
"input",
|
|
3706
3989
|
{
|
|
3707
3990
|
ref: input,
|
|
@@ -3734,20 +4017,20 @@ function FileDrop({
|
|
|
3734
4017
|
take(Array.from(event.dataTransfer.files));
|
|
3735
4018
|
}
|
|
3736
4019
|
};
|
|
3737
|
-
if (title !== void 0) return /* @__PURE__ */
|
|
4020
|
+
if (title !== void 0) return /* @__PURE__ */ jsxs32(
|
|
3738
4021
|
"div",
|
|
3739
4022
|
{
|
|
3740
4023
|
className: cx7("ui-drop", "ui-drop--area", showTarget && "is-dragging", disabled && "is-disabled", className),
|
|
3741
4024
|
onClick: pick,
|
|
3742
4025
|
...drag,
|
|
3743
4026
|
children: [
|
|
3744
|
-
/* @__PURE__ */
|
|
4027
|
+
/* @__PURE__ */ jsx36(
|
|
3745
4028
|
EmptyState,
|
|
3746
4029
|
{
|
|
3747
4030
|
icon: "upload",
|
|
3748
4031
|
title,
|
|
3749
4032
|
sub: note ?? "",
|
|
3750
|
-
actions: /* @__PURE__ */
|
|
4033
|
+
actions: /* @__PURE__ */ jsx36(
|
|
3751
4034
|
Button,
|
|
3752
4035
|
{
|
|
3753
4036
|
variant: "primary",
|
|
@@ -3767,18 +4050,18 @@ function FileDrop({
|
|
|
3767
4050
|
]
|
|
3768
4051
|
}
|
|
3769
4052
|
);
|
|
3770
|
-
return /* @__PURE__ */
|
|
4053
|
+
return /* @__PURE__ */ jsxs32("div", { className: cx7("ui-drop", disabled && "is-disabled", className), ...drag, children: [
|
|
3771
4054
|
children,
|
|
3772
|
-
/* @__PURE__ */
|
|
3773
|
-
file ? /* @__PURE__ */
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
/* @__PURE__ */
|
|
3776
|
-
/* @__PURE__ */
|
|
3777
|
-
/* @__PURE__ */
|
|
4055
|
+
/* @__PURE__ */ jsxs32("div", { className: "ui-drop__row", children: [
|
|
4056
|
+
file ? /* @__PURE__ */ jsxs32("div", { className: cx7("ui-drop__file", status === "error" && "ui-drop__file--failed"), children: [
|
|
4057
|
+
/* @__PURE__ */ jsxs32("div", { className: "ui-drop__line", children: [
|
|
4058
|
+
/* @__PURE__ */ jsxs32("span", { className: "ui-drop__name", title: file.name, children: [
|
|
4059
|
+
/* @__PURE__ */ jsx36("span", { className: "ui-drop__stem", children: stem }),
|
|
4060
|
+
/* @__PURE__ */ jsx36("span", { className: "ui-drop__ext", children: ext })
|
|
3778
4061
|
] }),
|
|
3779
|
-
(onRemove || status === "error" && onRetry) && /* @__PURE__ */
|
|
3780
|
-
status === "error" && onRetry && /* @__PURE__ */
|
|
3781
|
-
onRemove && /* @__PURE__ */
|
|
4062
|
+
(onRemove || status === "error" && onRetry) && /* @__PURE__ */ jsxs32("span", { className: "ui-drop__actions", children: [
|
|
4063
|
+
status === "error" && onRetry && /* @__PURE__ */ jsx36(Button, { size: "sm", icon: "refresh", onClick: onRetry, disabled, children: retryLabel }),
|
|
4064
|
+
onRemove && /* @__PURE__ */ jsx36(
|
|
3782
4065
|
Button,
|
|
3783
4066
|
{
|
|
3784
4067
|
variant: "ghost",
|
|
@@ -3790,21 +4073,21 @@ function FileDrop({
|
|
|
3790
4073
|
)
|
|
3791
4074
|
] })
|
|
3792
4075
|
] }),
|
|
3793
|
-
(showSize || showWord) && /* @__PURE__ */
|
|
4076
|
+
(showSize || showWord) && /* @__PURE__ */ jsxs32(
|
|
3794
4077
|
"div",
|
|
3795
4078
|
{
|
|
3796
4079
|
className: cx7("ui-drop__facts", status === "error" && "ui-drop__error"),
|
|
3797
4080
|
role: status === "error" ? "alert" : void 0,
|
|
3798
4081
|
children: [
|
|
3799
|
-
showSize && /* @__PURE__ */
|
|
3800
|
-
showWord && /* @__PURE__ */
|
|
3801
|
-
/* @__PURE__ */
|
|
3802
|
-
/* @__PURE__ */
|
|
4082
|
+
showSize && /* @__PURE__ */ jsx36("span", { className: "ui-drop__size", children: file.size }),
|
|
4083
|
+
showWord && /* @__PURE__ */ jsxs32("span", { className: "ui-drop__state", children: [
|
|
4084
|
+
/* @__PURE__ */ jsx36(Icon, { name: MARKS[status] }),
|
|
4085
|
+
/* @__PURE__ */ jsx36("span", { className: "ui-drop__word", title: word, children: word })
|
|
3803
4086
|
] })
|
|
3804
4087
|
]
|
|
3805
4088
|
}
|
|
3806
4089
|
),
|
|
3807
|
-
hasBar && /* @__PURE__ */
|
|
4090
|
+
hasBar && /* @__PURE__ */ jsx36(
|
|
3808
4091
|
"span",
|
|
3809
4092
|
{
|
|
3810
4093
|
className: "ui-drop__bar",
|
|
@@ -3813,11 +4096,11 @@ function FileDrop({
|
|
|
3813
4096
|
"aria-valuenow": file.progress,
|
|
3814
4097
|
"aria-valuemin": 0,
|
|
3815
4098
|
"aria-valuemax": 100,
|
|
3816
|
-
children: /* @__PURE__ */
|
|
4099
|
+
children: /* @__PURE__ */ jsx36("span", { style: { width: `${file.progress}%` } })
|
|
3817
4100
|
}
|
|
3818
4101
|
)
|
|
3819
|
-
] }) : /* @__PURE__ */
|
|
3820
|
-
/* @__PURE__ */
|
|
4102
|
+
] }) : /* @__PURE__ */ jsxs32(Fragment16, { children: [
|
|
4103
|
+
/* @__PURE__ */ jsx36(
|
|
3821
4104
|
Button,
|
|
3822
4105
|
{
|
|
3823
4106
|
size: "sm",
|
|
@@ -3827,22 +4110,22 @@ function FileDrop({
|
|
|
3827
4110
|
children: label
|
|
3828
4111
|
}
|
|
3829
4112
|
),
|
|
3830
|
-
note && /* @__PURE__ */
|
|
4113
|
+
note && /* @__PURE__ */ jsx36("p", { className: "ui-drop__note", children: note })
|
|
3831
4114
|
] }),
|
|
3832
4115
|
picker
|
|
3833
4116
|
] }),
|
|
3834
|
-
showTarget && /* @__PURE__ */
|
|
4117
|
+
showTarget && /* @__PURE__ */ jsx36("div", { className: "ui-drop__target", "aria-hidden": "true", children: dropLabel })
|
|
3835
4118
|
] });
|
|
3836
4119
|
}
|
|
3837
4120
|
|
|
3838
4121
|
// src/SearchField.tsx
|
|
3839
|
-
import { forwardRef as
|
|
4122
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
3840
4123
|
import { icon as icon6 } from "@apliteni/apliteni-ui";
|
|
3841
|
-
import { jsx as
|
|
3842
|
-
var SearchField =
|
|
3843
|
-
return /* @__PURE__ */
|
|
3844
|
-
/* @__PURE__ */
|
|
3845
|
-
/* @__PURE__ */
|
|
4124
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4125
|
+
var SearchField = forwardRef9(function SearchField2({ ariaLabel, className, ...props }, ref) {
|
|
4126
|
+
return /* @__PURE__ */ jsxs33("div", { className: "ui-input-group", children: [
|
|
4127
|
+
/* @__PURE__ */ jsx37("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon6("search") } }),
|
|
4128
|
+
/* @__PURE__ */ jsx37(
|
|
3846
4129
|
"input",
|
|
3847
4130
|
{
|
|
3848
4131
|
ref,
|
|
@@ -3856,8 +4139,8 @@ var SearchField = forwardRef7(function SearchField2({ ariaLabel, className, ...p
|
|
|
3856
4139
|
});
|
|
3857
4140
|
|
|
3858
4141
|
// src/Toast.tsx
|
|
3859
|
-
import { createContext as createContext3, useCallback as useCallback6, useContext as useContext3, useEffect as
|
|
3860
|
-
import { createPortal as
|
|
4142
|
+
import { createContext as createContext3, useCallback as useCallback6, useContext as useContext3, useEffect as useEffect16, useLayoutEffect as useLayoutEffect4, useRef as useRef21, useState as useState16 } from "react";
|
|
4143
|
+
import { createPortal as createPortal6 } from "react-dom";
|
|
3861
4144
|
|
|
3862
4145
|
// src/lib/toast-stack.ts
|
|
3863
4146
|
var TOAST_PEEK = 8;
|
|
@@ -3966,7 +4249,7 @@ function watchToastPile(stack2) {
|
|
|
3966
4249
|
}
|
|
3967
4250
|
|
|
3968
4251
|
// src/Toast.tsx
|
|
3969
|
-
import { jsx as
|
|
4252
|
+
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
3970
4253
|
var Context = createContext3(null);
|
|
3971
4254
|
var PileHoldContext = createContext3(false);
|
|
3972
4255
|
var glyphs = { success: "circleCheck", danger: "circleX", warn: "circleAlert", info: "info", neutral: "bolt" };
|
|
@@ -3976,24 +4259,24 @@ function useToast() {
|
|
|
3976
4259
|
return push;
|
|
3977
4260
|
}
|
|
3978
4261
|
function Notice({ notice, remove }) {
|
|
3979
|
-
const root =
|
|
3980
|
-
const [leaving2, setLeaving] =
|
|
3981
|
-
const dismissed =
|
|
3982
|
-
const [hovered, setHovered] =
|
|
3983
|
-
const [focused, setFocused] =
|
|
4262
|
+
const root = useRef21(null);
|
|
4263
|
+
const [leaving2, setLeaving] = useState16(false);
|
|
4264
|
+
const dismissed = useRef21(false);
|
|
4265
|
+
const [hovered, setHovered] = useState16(false);
|
|
4266
|
+
const [focused, setFocused] = useState16(false);
|
|
3984
4267
|
const pileHeld = useContext3(PileHoldContext);
|
|
3985
4268
|
const paused = hovered || focused || pileHeld;
|
|
3986
4269
|
const tone2 = notice.tone ?? "success";
|
|
3987
4270
|
const timed = !notice.action && notice.timer !== false && notice.timer !== 0;
|
|
3988
4271
|
const duration = typeof notice.timer === "number" ? notice.timer * 1e3 : 5e3;
|
|
3989
|
-
const remaining =
|
|
4272
|
+
const remaining = useRef21(duration);
|
|
3990
4273
|
const dismiss = useCallback6(() => {
|
|
3991
4274
|
if (dismissed.current) return;
|
|
3992
4275
|
dismissed.current = true;
|
|
3993
4276
|
if (typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches) remove();
|
|
3994
4277
|
else setLeaving(true);
|
|
3995
4278
|
}, [remove]);
|
|
3996
|
-
|
|
4279
|
+
useEffect16(() => {
|
|
3997
4280
|
if (leaving2) {
|
|
3998
4281
|
const element = root.current;
|
|
3999
4282
|
const finish = (event) => {
|
|
@@ -4007,7 +4290,7 @@ function Notice({ notice, remove }) {
|
|
|
4007
4290
|
};
|
|
4008
4291
|
}
|
|
4009
4292
|
}, [leaving2, remove]);
|
|
4010
|
-
|
|
4293
|
+
useEffect16(() => {
|
|
4011
4294
|
if (leaving2 || !timed || paused) return;
|
|
4012
4295
|
const started = Date.now();
|
|
4013
4296
|
const timer = setTimeout(dismiss, remaining.current);
|
|
@@ -4016,7 +4299,7 @@ function Notice({ notice, remove }) {
|
|
|
4016
4299
|
remaining.current = Math.max(0, remaining.current - (Date.now() - started));
|
|
4017
4300
|
};
|
|
4018
4301
|
}, [dismiss, leaving2, paused, timed]);
|
|
4019
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ jsxs34(
|
|
4020
4303
|
"div",
|
|
4021
4304
|
{
|
|
4022
4305
|
ref: root,
|
|
@@ -4030,12 +4313,12 @@ function Notice({ notice, remove }) {
|
|
|
4030
4313
|
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
|
|
4031
4314
|
},
|
|
4032
4315
|
children: [
|
|
4033
|
-
/* @__PURE__ */
|
|
4034
|
-
/* @__PURE__ */
|
|
4035
|
-
/* @__PURE__ */
|
|
4036
|
-
!notice.compact && notice.text && /* @__PURE__ */
|
|
4316
|
+
/* @__PURE__ */ jsx38("span", { className: "ui-toast__icon", children: /* @__PURE__ */ jsx38(Icon, { name: glyphs[tone2] }) }),
|
|
4317
|
+
/* @__PURE__ */ jsxs34("div", { className: "ui-toast__body", children: [
|
|
4318
|
+
/* @__PURE__ */ jsx38("div", { className: "ui-toast__title", children: notice.title }),
|
|
4319
|
+
!notice.compact && notice.text && /* @__PURE__ */ jsx38("div", { className: "ui-toast__text", children: notice.text })
|
|
4037
4320
|
] }),
|
|
4038
|
-
notice.action && /* @__PURE__ */
|
|
4321
|
+
notice.action && /* @__PURE__ */ jsx38(
|
|
4039
4322
|
"button",
|
|
4040
4323
|
{
|
|
4041
4324
|
type: "button",
|
|
@@ -4050,8 +4333,8 @@ function Notice({ notice, remove }) {
|
|
|
4050
4333
|
children: notice.action.label
|
|
4051
4334
|
}
|
|
4052
4335
|
),
|
|
4053
|
-
notice.dismissible !== false && /* @__PURE__ */
|
|
4054
|
-
timed && /* @__PURE__ */
|
|
4336
|
+
notice.dismissible !== false && /* @__PURE__ */ jsx38("button", { type: "button", className: "ui-toast__close", "aria-label": "Dismiss", disabled: leaving2, onClick: dismiss, children: /* @__PURE__ */ jsx38(Icon, { name: "x" }) }),
|
|
4337
|
+
timed && /* @__PURE__ */ jsx38(
|
|
4055
4338
|
"span",
|
|
4056
4339
|
{
|
|
4057
4340
|
className: "ui-toast__timer is-running",
|
|
@@ -4095,11 +4378,11 @@ function usePile(stack2, piled, count) {
|
|
|
4095
4378
|
}, [stack2, piled, count]);
|
|
4096
4379
|
}
|
|
4097
4380
|
function Toast({ children, collapse = false }) {
|
|
4098
|
-
const [entries, setEntries] =
|
|
4099
|
-
const [pileHovered, setPileHovered] =
|
|
4100
|
-
const [pileFocused, setPileFocused] =
|
|
4101
|
-
const nextId =
|
|
4102
|
-
const stack2 =
|
|
4381
|
+
const [entries, setEntries] = useState16([]);
|
|
4382
|
+
const [pileHovered, setPileHovered] = useState16(false);
|
|
4383
|
+
const [pileFocused, setPileFocused] = useState16(false);
|
|
4384
|
+
const nextId = useRef21(0);
|
|
4385
|
+
const stack2 = useRef21(null);
|
|
4103
4386
|
const push = useCallback6((notice) => {
|
|
4104
4387
|
const id = nextId.current++;
|
|
4105
4388
|
const remove = () => setEntries((current) => current.filter((entry) => entry.id !== id));
|
|
@@ -4112,10 +4395,10 @@ function Toast({ children, collapse = false }) {
|
|
|
4112
4395
|
const leavePileFocus = (event) => {
|
|
4113
4396
|
if (!event.currentTarget.contains(event.relatedTarget)) setPileFocused(false);
|
|
4114
4397
|
};
|
|
4115
|
-
return /* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ jsxs34(Context.Provider, { value: push, children: [
|
|
4116
4399
|
children,
|
|
4117
|
-
typeof document !== "undefined" &&
|
|
4118
|
-
/* @__PURE__ */
|
|
4400
|
+
typeof document !== "undefined" && createPortal6(
|
|
4401
|
+
/* @__PURE__ */ jsx38(
|
|
4119
4402
|
"div",
|
|
4120
4403
|
{
|
|
4121
4404
|
className: `ui-toast-stack rx-toast-stack${piled ? " ui-toast-stack--collapsed" : ""}`,
|
|
@@ -4127,7 +4410,7 @@ function Toast({ children, collapse = false }) {
|
|
|
4127
4410
|
onMouseLeave: () => setPileHovered(false),
|
|
4128
4411
|
onFocus: () => setPileFocused(true),
|
|
4129
4412
|
onBlur: leavePileFocus,
|
|
4130
|
-
children: /* @__PURE__ */
|
|
4413
|
+
children: /* @__PURE__ */ jsx38(PileHoldContext.Provider, { value: pileHeld, children: entries.map((entry) => /* @__PURE__ */ jsx38(Notice, { notice: entry.notice, remove: entry.remove }, entry.id)) })
|
|
4131
4414
|
}
|
|
4132
4415
|
),
|
|
4133
4416
|
document.body
|
|
@@ -4136,7 +4419,7 @@ function Toast({ children, collapse = false }) {
|
|
|
4136
4419
|
}
|
|
4137
4420
|
|
|
4138
4421
|
// src/AppShell.tsx
|
|
4139
|
-
import { useEffect as
|
|
4422
|
+
import { useEffect as useEffect17, useId as useId13, useMemo as useMemo4, useRef as useRef22, useState as useState17 } from "react";
|
|
4140
4423
|
import { prism, themeIcon as themeIcon2 } from "@apliteni/apliteni-ui";
|
|
4141
4424
|
|
|
4142
4425
|
// src/lib/palette-hotkey.ts
|
|
@@ -4165,129 +4448,32 @@ function storeRailCollapsed(collapsed) {
|
|
|
4165
4448
|
}
|
|
4166
4449
|
}
|
|
4167
4450
|
|
|
4168
|
-
// src/SidebarNav.tsx
|
|
4169
|
-
import { forwardRef as forwardRef8, useEffect as useEffect14, useId as useId11, useState as useState15 } from "react";
|
|
4170
|
-
import { ENTRANCE_FALLBACK_MS } from "@apliteni/apliteni-ui/motion";
|
|
4171
|
-
import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4172
|
-
var badgeText = (badge) => typeof badge === "object" ? badge.text : badge;
|
|
4173
|
-
function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
|
|
4174
|
-
const uid = useId11();
|
|
4175
|
-
const group = !sub && !!item.items?.length;
|
|
4176
|
-
const childActive = group && item.items.some((child) => child.id === active);
|
|
4177
|
-
const [expanded, setExpanded] = useState15();
|
|
4178
|
-
const open = expanded ?? item.defaultOpen ?? childActive;
|
|
4179
|
-
const [entering, setEntering] = useState15(false);
|
|
4180
|
-
useEffect14(() => {
|
|
4181
|
-
if (!entering) return;
|
|
4182
|
-
const timer = setTimeout(() => setEntering(false), ENTRANCE_FALLBACK_MS);
|
|
4183
|
-
return () => clearTimeout(timer);
|
|
4184
|
-
}, [entering]);
|
|
4185
|
-
const count = badgeText(item.badge);
|
|
4186
|
-
const name = `${item.label}${count == null || count === "" ? "" : ` ${count}`}`;
|
|
4187
|
-
const isActive = !group && item.id === active;
|
|
4188
|
-
const className = [
|
|
4189
|
-
"ui-nav__item",
|
|
4190
|
-
sub && "ui-nav__item--sub",
|
|
4191
|
-
group && "ui-nav__toggle",
|
|
4192
|
-
isActive && "is-active",
|
|
4193
|
-
childActive && "is-current",
|
|
4194
|
-
item.disabled && "is-disabled",
|
|
4195
|
-
item.danger && "is-danger"
|
|
4196
|
-
].filter(Boolean).join(" ");
|
|
4197
|
-
const children = /* @__PURE__ */ jsxs32(Fragment14, { children: [
|
|
4198
|
-
(item.leading ?? item.icon) && /* @__PURE__ */ jsx36("span", { className: "ui-nav__ic", children: item.leading ?? /* @__PURE__ */ jsx36(Icon, { name: item.icon }) }),
|
|
4199
|
-
/* @__PURE__ */ jsx36("span", { className: "ui-nav__label", children: item.label }),
|
|
4200
|
-
count != null && count !== "" && /* @__PURE__ */ jsx36("span", { className: `ui-nav__badge is-${typeof item.badge === "object" ? item.badge.tone ?? "neutral" : "neutral"}`, children: count }),
|
|
4201
|
-
group && /* @__PURE__ */ jsx36("span", { className: "ui-nav__caret", "aria-hidden": "true" })
|
|
4202
|
-
] });
|
|
4203
|
-
const common = { className, "aria-label": name, title: collapsed ? name : void 0, children };
|
|
4204
|
-
if (group) return /* @__PURE__ */ jsxs32("li", { className: `ui-nav__group${open ? " is-open" : ""}`, children: [
|
|
4205
|
-
/* @__PURE__ */ jsx36(
|
|
4206
|
-
"button",
|
|
4207
|
-
{
|
|
4208
|
-
...common,
|
|
4209
|
-
type: "button",
|
|
4210
|
-
disabled: item.disabled,
|
|
4211
|
-
"aria-expanded": open,
|
|
4212
|
-
"aria-controls": uid,
|
|
4213
|
-
onClick: () => {
|
|
4214
|
-
setExpanded(!open);
|
|
4215
|
-
setEntering(!open);
|
|
4216
|
-
}
|
|
4217
|
-
}
|
|
4218
|
-
),
|
|
4219
|
-
/* @__PURE__ */ jsx36("ul", { id: uid, className: `ui-nav__sub${entering ? " is-entering" : ""}`, hidden: !open, onAnimationEnd: () => setEntering(false), children: item.items.map((child) => /* @__PURE__ */ jsx36(Row, { item: child, active, activeIs, collapsed, renderLink, sub: true }, child.id)) })
|
|
4220
|
-
] });
|
|
4221
|
-
if (item.disabled) return /* @__PURE__ */ jsx36("li", { children: /* @__PURE__ */ jsx36("span", { ...common, role: "link", "aria-disabled": "true" }) });
|
|
4222
|
-
const props = {
|
|
4223
|
-
...common,
|
|
4224
|
-
href: item.href ?? `#${item.id}`,
|
|
4225
|
-
target: item.target,
|
|
4226
|
-
"aria-current": isActive ? activeIs === "section" ? "true" : "page" : void 0
|
|
4227
|
-
};
|
|
4228
|
-
return /* @__PURE__ */ jsx36("li", { children: renderLink ? renderLink(item, props) : /* @__PURE__ */ jsx36("a", { ...props }) });
|
|
4229
|
-
}
|
|
4230
|
-
function Section({ section, ...props }) {
|
|
4231
|
-
const uid = useId11();
|
|
4232
|
-
return /* @__PURE__ */ jsxs32("div", { className: "ui-nav__section", children: [
|
|
4233
|
-
section.label && /* @__PURE__ */ jsx36("div", { className: "ui-nav__cap", id: uid, "aria-hidden": props.collapsed || void 0, children: section.label }),
|
|
4234
|
-
/* @__PURE__ */ jsx36("ul", { className: "ui-nav__list", "aria-labelledby": section.label ? uid : void 0, children: section.items.map((item) => /* @__PURE__ */ jsx36(Row, { item, ...props }, item.id)) })
|
|
4235
|
-
] });
|
|
4236
|
-
}
|
|
4237
|
-
var SidebarNav = forwardRef8(function SidebarNav2({
|
|
4238
|
-
items = [],
|
|
4239
|
-
sections,
|
|
4240
|
-
active,
|
|
4241
|
-
activeIs = "page",
|
|
4242
|
-
collapsed = false,
|
|
4243
|
-
footer,
|
|
4244
|
-
renderLink,
|
|
4245
|
-
className,
|
|
4246
|
-
"aria-label": label = "Sidebar",
|
|
4247
|
-
...rest
|
|
4248
|
-
}, ref) {
|
|
4249
|
-
return /* @__PURE__ */ jsxs32("nav", { ...rest, ref, "aria-label": label, className: ["ui-nav", "ui-nav--side", collapsed && "is-collapsed", className].filter(Boolean).join(" "), children: [
|
|
4250
|
-
(sections?.length ? sections : [{ items }]).map((section, index) => /* @__PURE__ */ jsx36(
|
|
4251
|
-
Section,
|
|
4252
|
-
{
|
|
4253
|
-
section,
|
|
4254
|
-
active,
|
|
4255
|
-
activeIs,
|
|
4256
|
-
collapsed,
|
|
4257
|
-
renderLink
|
|
4258
|
-
},
|
|
4259
|
-
index
|
|
4260
|
-
)),
|
|
4261
|
-
footer && /* @__PURE__ */ jsx36("div", { className: "ui-nav__foot", children: footer })
|
|
4262
|
-
] });
|
|
4263
|
-
});
|
|
4264
|
-
|
|
4265
4451
|
// src/Breadcrumbs.tsx
|
|
4266
|
-
import { forwardRef as
|
|
4267
|
-
import { icon as icon7, safeUrl as
|
|
4268
|
-
import { Fragment as
|
|
4269
|
-
var Breadcrumbs =
|
|
4452
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
4453
|
+
import { icon as icon7, safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
|
|
4454
|
+
import { Fragment as Fragment17, jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4455
|
+
var Breadcrumbs = forwardRef10(function Breadcrumbs2({
|
|
4270
4456
|
items,
|
|
4271
4457
|
renderLink,
|
|
4272
4458
|
className,
|
|
4273
4459
|
"aria-label": ariaLabel = "Breadcrumb",
|
|
4274
4460
|
...rest
|
|
4275
4461
|
}, ref) {
|
|
4276
|
-
return /* @__PURE__ */
|
|
4462
|
+
return /* @__PURE__ */ jsx39(
|
|
4277
4463
|
"nav",
|
|
4278
4464
|
{
|
|
4279
4465
|
...rest,
|
|
4280
4466
|
ref,
|
|
4281
4467
|
className: ["ui-nav", "ui-nav--crumbs", className].filter(Boolean).join(" "),
|
|
4282
4468
|
"aria-label": ariaLabel,
|
|
4283
|
-
children: /* @__PURE__ */
|
|
4469
|
+
children: /* @__PURE__ */ jsx39("ol", { className: "ui-nav__crumbs", children: items.map((item, index) => {
|
|
4284
4470
|
const current = index === items.length - 1;
|
|
4285
|
-
const inner = /* @__PURE__ */
|
|
4286
|
-
item.icon && /* @__PURE__ */
|
|
4287
|
-
/* @__PURE__ */
|
|
4471
|
+
const inner = /* @__PURE__ */ jsxs35(Fragment17, { children: [
|
|
4472
|
+
item.icon && /* @__PURE__ */ jsx39("span", { className: "ui-nav__ic", dangerouslySetInnerHTML: { __html: icon7(item.icon) } }),
|
|
4473
|
+
/* @__PURE__ */ jsx39("span", { className: "ui-nav__crumb-label", children: item.label })
|
|
4288
4474
|
] });
|
|
4289
|
-
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href:
|
|
4290
|
-
return /* @__PURE__ */
|
|
4475
|
+
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href: safeUrl3(item.href), target: item.target, children: inner } : null;
|
|
4476
|
+
return /* @__PURE__ */ jsx39("li", { className: "ui-nav__crumb-item", children: linkProps ? renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx39("a", { ...linkProps }) : /* @__PURE__ */ jsx39(
|
|
4291
4477
|
"span",
|
|
4292
4478
|
{
|
|
4293
4479
|
className: ["ui-nav__crumb", current && "is-current"].filter(Boolean).join(" "),
|
|
@@ -4303,7 +4489,7 @@ var Breadcrumbs = forwardRef9(function Breadcrumbs2({
|
|
|
4303
4489
|
// src/ThemeToggle.tsx
|
|
4304
4490
|
import { useSyncExternalStore } from "react";
|
|
4305
4491
|
import { themeIcon } from "@apliteni/apliteni-ui";
|
|
4306
|
-
import { jsx as
|
|
4492
|
+
import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4307
4493
|
var STORAGE_KEY = "apliteni-strategy-theme";
|
|
4308
4494
|
var CHOICE_EVENT = "apliteni-theme-choice";
|
|
4309
4495
|
var THEME_INIT_SCRIPT = `(()=>{let t;try{t=localStorage.getItem('apliteni-strategy-theme')}catch{}document.documentElement.setAttribute('data-theme',t==='dark'||t==='light'?t:window.matchMedia?.('(prefers-color-scheme: light)').matches?'light':'dark')})()`;
|
|
@@ -4365,10 +4551,10 @@ function useThemeChoice() {
|
|
|
4365
4551
|
}
|
|
4366
4552
|
function ThemeToggle({ labelled = false }) {
|
|
4367
4553
|
const { theme, label, name, toggle } = useThemeChoice();
|
|
4368
|
-
const button = /* @__PURE__ */
|
|
4369
|
-
return labelled ? /* @__PURE__ */
|
|
4554
|
+
const button = /* @__PURE__ */ jsx40("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx40("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
|
|
4555
|
+
return labelled ? /* @__PURE__ */ jsxs36("span", { className: "ui-theme-toggle", children: [
|
|
4370
4556
|
button,
|
|
4371
|
-
/* @__PURE__ */
|
|
4557
|
+
/* @__PURE__ */ jsxs36("span", { children: [
|
|
4372
4558
|
label,
|
|
4373
4559
|
" theme"
|
|
4374
4560
|
] })
|
|
@@ -4376,7 +4562,7 @@ function ThemeToggle({ labelled = false }) {
|
|
|
4376
4562
|
}
|
|
4377
4563
|
|
|
4378
4564
|
// src/AppShell.tsx
|
|
4379
|
-
import { Fragment as
|
|
4565
|
+
import { Fragment as Fragment18, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4380
4566
|
var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
|
|
4381
4567
|
function AppShell({
|
|
4382
4568
|
sections,
|
|
@@ -4401,26 +4587,26 @@ function AppShell({
|
|
|
4401
4587
|
palette,
|
|
4402
4588
|
renderLink
|
|
4403
4589
|
}) {
|
|
4404
|
-
const uid =
|
|
4590
|
+
const uid = useId13();
|
|
4405
4591
|
const theme = useThemeChoice();
|
|
4406
|
-
const [collapsed, setCollapsed] =
|
|
4407
|
-
const [search, setSearch] =
|
|
4408
|
-
const [menu, setMenu] =
|
|
4409
|
-
const menuButton =
|
|
4410
|
-
const menuBody =
|
|
4592
|
+
const [collapsed, setCollapsed] = useState17(defaultCollapsed);
|
|
4593
|
+
const [search, setSearch] = useState17(false);
|
|
4594
|
+
const [menu, setMenu] = useState17(false);
|
|
4595
|
+
const menuButton = useRef22(null);
|
|
4596
|
+
const menuBody = useRef22(null);
|
|
4411
4597
|
const firstRow = useMemo4(() => ({ get current() {
|
|
4412
4598
|
return menuBody.current?.querySelector(".ui-nav__item") ?? null;
|
|
4413
4599
|
} }), []);
|
|
4414
4600
|
const current = path(pathname);
|
|
4415
4601
|
const active = sections.filter((section) => current === path(section.href) || path(section.href) !== "/" && current.startsWith(`${path(section.href)}/`)).sort((a, b) => path(b.href).length - path(a.href).length)[0];
|
|
4416
|
-
|
|
4602
|
+
useEffect17(() => {
|
|
4417
4603
|
setCollapsed(railCollapsed() ?? defaultCollapsed);
|
|
4418
4604
|
}, [defaultCollapsed]);
|
|
4419
|
-
|
|
4605
|
+
useEffect17(() => {
|
|
4420
4606
|
setMenu(false);
|
|
4421
4607
|
setSearch(false);
|
|
4422
4608
|
}, [pathname]);
|
|
4423
|
-
|
|
4609
|
+
useEffect17(() => {
|
|
4424
4610
|
if (!menu) return;
|
|
4425
4611
|
const grown = () => {
|
|
4426
4612
|
const button = menuButton.current;
|
|
@@ -4429,7 +4615,7 @@ function AppShell({
|
|
|
4429
4615
|
window.addEventListener("resize", grown);
|
|
4430
4616
|
return () => window.removeEventListener("resize", grown);
|
|
4431
4617
|
}, [menu]);
|
|
4432
|
-
|
|
4618
|
+
useEffect17(() => {
|
|
4433
4619
|
if (layout === "rail") return;
|
|
4434
4620
|
const hotkey = (event) => {
|
|
4435
4621
|
if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "k") return;
|
|
@@ -4446,7 +4632,7 @@ function AppShell({
|
|
|
4446
4632
|
setCollapsed(next);
|
|
4447
4633
|
storeRailCollapsed(next);
|
|
4448
4634
|
};
|
|
4449
|
-
const sidebar = (label) => /* @__PURE__ */
|
|
4635
|
+
const sidebar = (label) => /* @__PURE__ */ jsx41(
|
|
4450
4636
|
SidebarNav,
|
|
4451
4637
|
{
|
|
4452
4638
|
"aria-label": label,
|
|
@@ -4458,17 +4644,17 @@ function AppShell({
|
|
|
4458
4644
|
const linkProps = { ...props, onClick: (event) => {
|
|
4459
4645
|
if (!event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey) setMenu(false);
|
|
4460
4646
|
} };
|
|
4461
|
-
return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */
|
|
4647
|
+
return renderLink ? renderLink(section, linkProps) : /* @__PURE__ */ jsx41("a", { ...linkProps });
|
|
4462
4648
|
}
|
|
4463
4649
|
}
|
|
4464
4650
|
);
|
|
4465
4651
|
const foldLabel = collapsed ? "Expand sidebar" : "Collapse sidebar";
|
|
4466
4652
|
const navigable = sections.length > 1 || Boolean(back);
|
|
4467
|
-
const lockup = /* @__PURE__ */
|
|
4468
|
-
brand ?? /* @__PURE__ */
|
|
4469
|
-
/* @__PURE__ */
|
|
4653
|
+
const lockup = /* @__PURE__ */ jsxs37("a", { className: "ui-app__brand", href: brandHref, "aria-label": word, children: [
|
|
4654
|
+
brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
|
|
4655
|
+
/* @__PURE__ */ jsx41("span", { children: word })
|
|
4470
4656
|
] });
|
|
4471
|
-
const accountBlock = (withTheme = false) => /* @__PURE__ */
|
|
4657
|
+
const accountBlock = (withTheme = false) => /* @__PURE__ */ jsx41("div", { className: "ui-app__user", children: /* @__PURE__ */ jsx41(
|
|
4472
4658
|
Dropdown,
|
|
4473
4659
|
{
|
|
4474
4660
|
variant: "menu",
|
|
@@ -4478,35 +4664,35 @@ function AppShell({
|
|
|
4478
4664
|
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4479
4665
|
triggerClass: "ui-app__user-trigger",
|
|
4480
4666
|
panelClass: "ui-app__user-panel",
|
|
4481
|
-
triggerContent: /* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4667
|
+
triggerContent: /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
4668
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
|
|
4669
|
+
/* @__PURE__ */ jsxs37("span", { className: "ui-app__who", children: [
|
|
4670
|
+
/* @__PURE__ */ jsx41("b", { children: account.name }),
|
|
4671
|
+
/* @__PURE__ */ jsx41("span", { children: account.email })
|
|
4486
4672
|
] })
|
|
4487
4673
|
] }),
|
|
4488
4674
|
items: [...withTheme ? [{ label: `${theme.label} theme`, value: "theme" }] : [], { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
|
|
4489
|
-
row: (item, props) => item.value === "theme" ? /* @__PURE__ */
|
|
4675
|
+
row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs37(
|
|
4490
4676
|
"div",
|
|
4491
4677
|
{
|
|
4492
4678
|
...props,
|
|
4493
4679
|
"aria-label": `${item.label}. Switch to ${theme.next}.`,
|
|
4494
4680
|
onClick: theme.toggle,
|
|
4495
4681
|
children: [
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */
|
|
4682
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-dropdown__ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon2(theme.theme) } }),
|
|
4683
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__label", children: item.label }) })
|
|
4498
4684
|
]
|
|
4499
4685
|
}
|
|
4500
|
-
) : /* @__PURE__ */
|
|
4686
|
+
) : /* @__PURE__ */ jsx41("div", { ...props }),
|
|
4501
4687
|
onSelect: (value) => {
|
|
4502
4688
|
if (value === "sign-out") onSignOut();
|
|
4503
4689
|
}
|
|
4504
4690
|
}
|
|
4505
4691
|
) });
|
|
4506
|
-
const headSlot = layout === "topbar" && headControl && /* @__PURE__ */
|
|
4507
|
-
const foldControl = /* @__PURE__ */
|
|
4692
|
+
const headSlot = layout === "topbar" && headControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__head-control", children: headControl });
|
|
4693
|
+
const foldControl = /* @__PURE__ */ jsxs37("div", { className: "ui-app__fold-row", children: [
|
|
4508
4694
|
headSlot,
|
|
4509
|
-
/* @__PURE__ */
|
|
4695
|
+
/* @__PURE__ */ jsxs37(
|
|
4510
4696
|
"button",
|
|
4511
4697
|
{
|
|
4512
4698
|
type: "button",
|
|
@@ -4515,34 +4701,34 @@ function AppShell({
|
|
|
4515
4701
|
"aria-label": foldLabel,
|
|
4516
4702
|
onClick: fold,
|
|
4517
4703
|
children: [
|
|
4518
|
-
/* @__PURE__ */
|
|
4519
|
-
/* @__PURE__ */
|
|
4520
|
-
/* @__PURE__ */
|
|
4521
|
-
/* @__PURE__ */
|
|
4704
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-nav__ic", children: /* @__PURE__ */ jsxs37("svg", { className: "ui-icon", viewBox: "0 0 24 24", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4705
|
+
/* @__PURE__ */ jsx41("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
4706
|
+
/* @__PURE__ */ jsx41("path", { className: "ui-app__fold-seam", d: "M9 3v18" }),
|
|
4707
|
+
/* @__PURE__ */ jsx41("path", { className: "ui-app__fold-arrow", d: "m16 15-3-3 3-3" })
|
|
4522
4708
|
] }) }),
|
|
4523
|
-
/* @__PURE__ */
|
|
4709
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-nav__label", children: foldLabel })
|
|
4524
4710
|
]
|
|
4525
4711
|
}
|
|
4526
4712
|
)
|
|
4527
4713
|
] });
|
|
4528
|
-
const page = /* @__PURE__ */
|
|
4529
|
-
back ? /* @__PURE__ */
|
|
4530
|
-
/* @__PURE__ */
|
|
4531
|
-
lede && /* @__PURE__ */
|
|
4532
|
-
actions && /* @__PURE__ */
|
|
4533
|
-
/* @__PURE__ */
|
|
4714
|
+
const page = /* @__PURE__ */ jsxs37("main", { className: `ui-app__main${width === "wide" ? " ui-app__main--wide" : ""}`, children: [
|
|
4715
|
+
back ? /* @__PURE__ */ jsx41(BackLink, { ...back }) : crumbs?.length ? /* @__PURE__ */ jsx41(Breadcrumbs, { items: crumbs }) : null,
|
|
4716
|
+
/* @__PURE__ */ jsx41("h1", { children: title }),
|
|
4717
|
+
lede && /* @__PURE__ */ jsx41("p", { className: "ui-app__sub", children: lede }),
|
|
4718
|
+
actions && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__actions", children: actions }),
|
|
4719
|
+
/* @__PURE__ */ jsx41("div", { className: "ui-app__body", children })
|
|
4534
4720
|
] });
|
|
4535
|
-
if (layout === "rail") return /* @__PURE__ */
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
/* @__PURE__ */
|
|
4721
|
+
if (layout === "rail") return /* @__PURE__ */ jsxs37("div", { className: `ui-app ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
|
|
4722
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
|
|
4723
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-app__head", children: [
|
|
4538
4724
|
lockup,
|
|
4539
4725
|
foldControl
|
|
4540
4726
|
] }),
|
|
4541
4727
|
sidebar("Sections"),
|
|
4542
4728
|
accountBlock()
|
|
4543
4729
|
] }),
|
|
4544
|
-
/* @__PURE__ */
|
|
4545
|
-
/* @__PURE__ */
|
|
4730
|
+
/* @__PURE__ */ jsxs37("header", { className: "ui-app__bar ui-app__bar--phone", children: [
|
|
4731
|
+
/* @__PURE__ */ jsx41(
|
|
4546
4732
|
Button,
|
|
4547
4733
|
{
|
|
4548
4734
|
ref: menuButton,
|
|
@@ -4556,10 +4742,10 @@ function AppShell({
|
|
|
4556
4742
|
onClick: () => setMenu(true)
|
|
4557
4743
|
}
|
|
4558
4744
|
),
|
|
4559
|
-
/* @__PURE__ */
|
|
4745
|
+
/* @__PURE__ */ jsx41("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) })
|
|
4560
4746
|
] }),
|
|
4561
4747
|
page,
|
|
4562
|
-
/* @__PURE__ */
|
|
4748
|
+
/* @__PURE__ */ jsx41(
|
|
4563
4749
|
Drawer,
|
|
4564
4750
|
{
|
|
4565
4751
|
open: menu,
|
|
@@ -4567,15 +4753,15 @@ function AppShell({
|
|
|
4567
4753
|
title: word,
|
|
4568
4754
|
side: "left",
|
|
4569
4755
|
size: "sm",
|
|
4570
|
-
footer: /* @__PURE__ */
|
|
4571
|
-
children: /* @__PURE__ */
|
|
4756
|
+
footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock() }),
|
|
4757
|
+
children: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: sidebar("Menu sections") })
|
|
4572
4758
|
}
|
|
4573
4759
|
)
|
|
4574
4760
|
] });
|
|
4575
|
-
const control = bandControl && /* @__PURE__ */
|
|
4576
|
-
return /* @__PURE__ */
|
|
4577
|
-
navigable && /* @__PURE__ */
|
|
4578
|
-
/* @__PURE__ */
|
|
4761
|
+
const control = bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", inert: collapsed, children: bandControl });
|
|
4762
|
+
return /* @__PURE__ */ jsxs37("div", { className: `ui-app ui-app--topbar ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
|
|
4763
|
+
navigable && /* @__PURE__ */ jsxs37("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
|
|
4764
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-app__head", children: [
|
|
4579
4765
|
lockup,
|
|
4580
4766
|
foldControl
|
|
4581
4767
|
] }),
|
|
@@ -4583,19 +4769,19 @@ function AppShell({
|
|
|
4583
4769
|
sidebar("Sections"),
|
|
4584
4770
|
accountBlock(true)
|
|
4585
4771
|
] }),
|
|
4586
|
-
/* @__PURE__ */
|
|
4587
|
-
/* @__PURE__ */
|
|
4588
|
-
navigable ? /* @__PURE__ */
|
|
4589
|
-
/* @__PURE__ */
|
|
4590
|
-
/* @__PURE__ */
|
|
4772
|
+
/* @__PURE__ */ jsxs37("div", { className: "ui-app__well", children: [
|
|
4773
|
+
/* @__PURE__ */ jsxs37("header", { className: "ui-app__bar", children: [
|
|
4774
|
+
navigable ? /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
4775
|
+
/* @__PURE__ */ jsx41("a", { className: "ui-app__brand ui-app__brand--band", href: brandHref, "aria-label": word, children: brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(`${uid}-band`, 24) } }) }),
|
|
4776
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-react-app__title", "aria-hidden": "true", children: title })
|
|
4591
4777
|
] }) : lockup,
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
/* @__PURE__ */
|
|
4594
|
-
/* @__PURE__ */
|
|
4595
|
-
/* @__PURE__ */
|
|
4778
|
+
/* @__PURE__ */ jsxs37("button", { type: "button", className: "ui-app__search", "aria-haspopup": "dialog", onClick: () => setSearch(true), children: [
|
|
4779
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-app__search-ic", children: /* @__PURE__ */ jsx41(Icon, { name: "search" }) }),
|
|
4780
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-app__search-txt", children: searchLabel }),
|
|
4781
|
+
/* @__PURE__ */ jsx41("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
|
|
4596
4782
|
] }),
|
|
4597
|
-
/* @__PURE__ */
|
|
4598
|
-
navigable ? /* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-app__bar-gap" }),
|
|
4784
|
+
navigable ? /* @__PURE__ */ jsx41(
|
|
4599
4785
|
Button,
|
|
4600
4786
|
{
|
|
4601
4787
|
ref: menuButton,
|
|
@@ -4608,11 +4794,11 @@ function AppShell({
|
|
|
4608
4794
|
"aria-expanded": menu,
|
|
4609
4795
|
onClick: () => setMenu(true)
|
|
4610
4796
|
}
|
|
4611
|
-
) : /* @__PURE__ */
|
|
4612
|
-
bandControl && /* @__PURE__ */
|
|
4613
|
-
headControl && /* @__PURE__ */
|
|
4614
|
-
/* @__PURE__ */
|
|
4615
|
-
/* @__PURE__ */
|
|
4797
|
+
) : /* @__PURE__ */ jsxs37(Fragment18, { children: [
|
|
4798
|
+
bandControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: bandControl }),
|
|
4799
|
+
headControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: headControl }),
|
|
4800
|
+
/* @__PURE__ */ jsx41(ThemeToggle, {}),
|
|
4801
|
+
/* @__PURE__ */ jsx41("div", { className: "ui-app__user ui-app__user--bar", children: /* @__PURE__ */ jsx41(
|
|
4616
4802
|
Dropdown,
|
|
4617
4803
|
{
|
|
4618
4804
|
variant: "menu",
|
|
@@ -4621,10 +4807,10 @@ function AppShell({
|
|
|
4621
4807
|
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4622
4808
|
triggerClass: "ui-app__user-trigger",
|
|
4623
4809
|
panelClass: "ui-app__user-panel",
|
|
4624
|
-
triggerContent: /* @__PURE__ */
|
|
4625
|
-
header: /* @__PURE__ */
|
|
4626
|
-
/* @__PURE__ */
|
|
4627
|
-
/* @__PURE__ */
|
|
4810
|
+
triggerContent: /* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
|
|
4811
|
+
header: /* @__PURE__ */ jsxs37("div", { className: "ui-dropdown__head", children: [
|
|
4812
|
+
/* @__PURE__ */ jsx41("b", { children: account.name }),
|
|
4813
|
+
/* @__PURE__ */ jsx41("span", { children: account.email })
|
|
4628
4814
|
] }),
|
|
4629
4815
|
items: [{ label: "Sign out", icon: "logout", danger: true }],
|
|
4630
4816
|
onSelect: onSignOut
|
|
@@ -4634,7 +4820,7 @@ function AppShell({
|
|
|
4634
4820
|
] }),
|
|
4635
4821
|
page
|
|
4636
4822
|
] }),
|
|
4637
|
-
navigable && /* @__PURE__ */
|
|
4823
|
+
navigable && /* @__PURE__ */ jsx41(
|
|
4638
4824
|
Drawer,
|
|
4639
4825
|
{
|
|
4640
4826
|
open: menu,
|
|
@@ -4644,31 +4830,31 @@ function AppShell({
|
|
|
4644
4830
|
size: "sm",
|
|
4645
4831
|
initialFocusRef: firstRow,
|
|
4646
4832
|
headerActions: headSlot,
|
|
4647
|
-
footer: /* @__PURE__ */
|
|
4648
|
-
children: /* @__PURE__ */
|
|
4649
|
-
bandControl && /* @__PURE__ */
|
|
4833
|
+
footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock(true) }),
|
|
4834
|
+
children: /* @__PURE__ */ jsxs37("div", { className: "ui-react-app__menu", ref: menuBody, children: [
|
|
4835
|
+
bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", children: bandControl }),
|
|
4650
4836
|
sidebar("Menu sections")
|
|
4651
4837
|
] })
|
|
4652
4838
|
}
|
|
4653
4839
|
),
|
|
4654
|
-
/* @__PURE__ */
|
|
4840
|
+
/* @__PURE__ */ jsx41(CommandPalette, { ...palette ?? { groups: [{ items: sections.map((section) => ({ id: section.href, ...section })) }] }, open: search, onClose: () => setSearch(false) })
|
|
4655
4841
|
] });
|
|
4656
4842
|
}
|
|
4657
4843
|
|
|
4658
4844
|
// src/AuthShell.tsx
|
|
4659
|
-
import { forwardRef as
|
|
4660
|
-
import { jsx as
|
|
4661
|
-
var AuthShell =
|
|
4662
|
-
return /* @__PURE__ */
|
|
4663
|
-
/* @__PURE__ */
|
|
4845
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
4846
|
+
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4847
|
+
var AuthShell = forwardRef11(function AuthShell2({ brand, children, className, ...rest }, ref) {
|
|
4848
|
+
return /* @__PURE__ */ jsx42("div", { ...rest, ref, className: ["ui-auth", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs38("div", { className: "ui-auth__card", children: [
|
|
4849
|
+
/* @__PURE__ */ jsx42("div", { className: "ui-auth__brand", children: brand }),
|
|
4664
4850
|
children
|
|
4665
4851
|
] }) });
|
|
4666
4852
|
});
|
|
4667
4853
|
|
|
4668
4854
|
// src/Footer.tsx
|
|
4669
|
-
import { useId as
|
|
4670
|
-
import { prism as prism2, safeUrl as
|
|
4671
|
-
import { jsx as
|
|
4855
|
+
import { useId as useId14 } from "react";
|
|
4856
|
+
import { prism as prism2, safeUrl as safeUrl4 } from "@apliteni/apliteni-ui";
|
|
4857
|
+
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4672
4858
|
var SOCIAL_GLYPHS = {
|
|
4673
4859
|
github: '<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.64 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.37.2 2.39.1 2.64.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
|
|
4674
4860
|
x: '<path d="M4 3h4.5l4 5.5L17.5 3H21l-6.5 8.5L21 21h-4.5l-4.3-5.9L7 21H3.5l6.8-8.9z"/>',
|
|
@@ -4677,10 +4863,10 @@ var SOCIAL_GLYPHS = {
|
|
|
4677
4863
|
};
|
|
4678
4864
|
var escapeText = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4679
4865
|
function Legal({ legal, legalLinks, switcher }) {
|
|
4680
|
-
return /* @__PURE__ */
|
|
4681
|
-
/* @__PURE__ */
|
|
4682
|
-
legalLinks && legalLinks.length > 0 && /* @__PURE__ */
|
|
4683
|
-
switcher ? /* @__PURE__ */
|
|
4866
|
+
return /* @__PURE__ */ jsxs39("div", { className: "ui-footer__bar", children: [
|
|
4867
|
+
/* @__PURE__ */ jsx43("span", { className: "ui-footer__legal", children: legal }),
|
|
4868
|
+
legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx43("a", { href: safeUrl4(to ?? "#"), children: label }, label)) }),
|
|
4869
|
+
switcher ? /* @__PURE__ */ jsx43("div", { className: "ui-footer__switcher", children: switcher }) : null
|
|
4684
4870
|
] });
|
|
4685
4871
|
}
|
|
4686
4872
|
function Footer({
|
|
@@ -4698,37 +4884,37 @@ function Footer({
|
|
|
4698
4884
|
className,
|
|
4699
4885
|
...rest
|
|
4700
4886
|
}) {
|
|
4701
|
-
const uid =
|
|
4887
|
+
const uid = useId14();
|
|
4702
4888
|
const cls = ["ui-footer", `ui-footer--${variant}`, className].filter(Boolean).join(" ");
|
|
4703
|
-
const bar = /* @__PURE__ */
|
|
4889
|
+
const bar = /* @__PURE__ */ jsx43(Legal, { legal, legalLinks, switcher });
|
|
4704
4890
|
if (variant !== "full") {
|
|
4705
|
-
return /* @__PURE__ */
|
|
4891
|
+
return /* @__PURE__ */ jsx43("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsx43("div", { className: "ui-footer__in", children: bar }) });
|
|
4706
4892
|
}
|
|
4707
4893
|
const mark = prism2(uid.replace(/:/g, ""), 22);
|
|
4708
|
-
const lockup = brand ?? /* @__PURE__ */
|
|
4894
|
+
const lockup = brand ?? /* @__PURE__ */ jsx43(
|
|
4709
4895
|
"a",
|
|
4710
4896
|
{
|
|
4711
4897
|
className: "brand",
|
|
4712
|
-
href:
|
|
4898
|
+
href: safeUrl4(brandHref),
|
|
4713
4899
|
"aria-label": `Apliteni ${word}`,
|
|
4714
4900
|
dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
|
|
4715
4901
|
}
|
|
4716
4902
|
);
|
|
4717
|
-
return /* @__PURE__ */
|
|
4718
|
-
/* @__PURE__ */
|
|
4719
|
-
brand !== false && /* @__PURE__ */
|
|
4903
|
+
return /* @__PURE__ */ jsx43("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsxs39("div", { className: "ui-footer__in", children: [
|
|
4904
|
+
/* @__PURE__ */ jsxs39("div", { className: "ui-footer__top", children: [
|
|
4905
|
+
brand !== false && /* @__PURE__ */ jsxs39("div", { className: "ui-footer__brand", children: [
|
|
4720
4906
|
lockup,
|
|
4721
|
-
tagline && /* @__PURE__ */
|
|
4722
|
-
social.length > 0 && /* @__PURE__ */
|
|
4907
|
+
tagline && /* @__PURE__ */ jsx43("p", { className: "ui-footer__tagline", children: tagline }),
|
|
4908
|
+
social.length > 0 && /* @__PURE__ */ jsx43("div", { className: "ui-footer__socials", children: social.map(({ label, href: to, icon: icon9 = "github" }) => {
|
|
4723
4909
|
const markup = SOCIAL_GLYPHS[icon9];
|
|
4724
4910
|
const fill = icon9 === "mail" ? "none" : "currentColor";
|
|
4725
4911
|
const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
|
|
4726
|
-
return /* @__PURE__ */
|
|
4912
|
+
return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href: safeUrl4(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx43("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
|
|
4727
4913
|
}) })
|
|
4728
4914
|
] }),
|
|
4729
|
-
(links || columns.length > 0) && /* @__PURE__ */
|
|
4730
|
-
title && /* @__PURE__ */
|
|
4731
|
-
/* @__PURE__ */
|
|
4915
|
+
(links || columns.length > 0) && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs39("div", { className: "ui-footer__col", children: [
|
|
4916
|
+
title && /* @__PURE__ */ jsx43("h2", { className: "ui-footer__col-title", children: title }),
|
|
4917
|
+
/* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href: safeUrl4(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
|
|
4732
4918
|
] }, title ?? i)) })
|
|
4733
4919
|
] }),
|
|
4734
4920
|
bar
|
|
@@ -4736,11 +4922,11 @@ function Footer({
|
|
|
4736
4922
|
}
|
|
4737
4923
|
|
|
4738
4924
|
// src/Success.tsx
|
|
4739
|
-
import { forwardRef as
|
|
4740
|
-
import { jsx as
|
|
4741
|
-
var SuccessCheck =
|
|
4925
|
+
import { forwardRef as forwardRef12, useEffect as useEffect18, useRef as useRef23, useState as useState18 } from "react";
|
|
4926
|
+
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4927
|
+
var SuccessCheck = forwardRef12(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
|
|
4742
4928
|
const circled = variant === "circled";
|
|
4743
|
-
return /* @__PURE__ */
|
|
4929
|
+
return /* @__PURE__ */ jsxs40(
|
|
4744
4930
|
"svg",
|
|
4745
4931
|
{
|
|
4746
4932
|
...rest,
|
|
@@ -4752,18 +4938,18 @@ var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", class
|
|
|
4752
4938
|
"aria-hidden": "true",
|
|
4753
4939
|
focusable: "false",
|
|
4754
4940
|
children: [
|
|
4755
|
-
circled && /* @__PURE__ */
|
|
4756
|
-
/* @__PURE__ */
|
|
4941
|
+
circled && /* @__PURE__ */ jsx44("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4942
|
+
/* @__PURE__ */ jsx44("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
|
|
4757
4943
|
]
|
|
4758
4944
|
}
|
|
4759
4945
|
);
|
|
4760
4946
|
});
|
|
4761
|
-
var SuccessPanel =
|
|
4947
|
+
var SuccessPanel = forwardRef12(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
|
|
4762
4948
|
const circled = check === "circled";
|
|
4763
|
-
return /* @__PURE__ */
|
|
4764
|
-
/* @__PURE__ */
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
sub && /* @__PURE__ */
|
|
4949
|
+
return /* @__PURE__ */ jsxs40("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
|
|
4950
|
+
/* @__PURE__ */ jsx44("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx44(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
|
|
4951
|
+
/* @__PURE__ */ jsx44("div", { className: "ui-success__title", children: title }),
|
|
4952
|
+
sub && /* @__PURE__ */ jsx44("div", { className: "ui-success__sub", children: sub })
|
|
4767
4953
|
] });
|
|
4768
4954
|
});
|
|
4769
4955
|
var pieces = [
|
|
@@ -4783,12 +4969,12 @@ var pieces = [
|
|
|
4783
4969
|
[80, 0.36, -20, "c", 1.05]
|
|
4784
4970
|
];
|
|
4785
4971
|
function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
4786
|
-
const [remaining, setRemaining] =
|
|
4787
|
-
const callback =
|
|
4788
|
-
|
|
4972
|
+
const [remaining, setRemaining] = useState18(seconds);
|
|
4973
|
+
const callback = useRef23(onDone);
|
|
4974
|
+
useEffect18(() => {
|
|
4789
4975
|
callback.current = onDone;
|
|
4790
4976
|
}, [onDone]);
|
|
4791
|
-
|
|
4977
|
+
useEffect18(() => {
|
|
4792
4978
|
let count = seconds;
|
|
4793
4979
|
const timer = setInterval(() => {
|
|
4794
4980
|
count -= 1;
|
|
@@ -4800,17 +4986,17 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
|
4800
4986
|
}, 1e3);
|
|
4801
4987
|
return () => clearInterval(timer);
|
|
4802
4988
|
}, [seconds]);
|
|
4803
|
-
return /* @__PURE__ */
|
|
4804
|
-
/* @__PURE__ */
|
|
4805
|
-
/* @__PURE__ */
|
|
4989
|
+
return /* @__PURE__ */ jsxs40("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
|
|
4990
|
+
/* @__PURE__ */ jsx44("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
|
|
4991
|
+
/* @__PURE__ */ jsxs40("span", { className: "ui-sx__count-text", children: [
|
|
4806
4992
|
label,
|
|
4807
4993
|
" in ",
|
|
4808
|
-
/* @__PURE__ */
|
|
4994
|
+
/* @__PURE__ */ jsx44("b", { "data-sx-num": "", children: remaining }),
|
|
4809
4995
|
"s"
|
|
4810
4996
|
] })
|
|
4811
4997
|
] });
|
|
4812
4998
|
}
|
|
4813
|
-
var Success =
|
|
4999
|
+
var Success = forwardRef12(function Success2({
|
|
4814
5000
|
layout = "hero",
|
|
4815
5001
|
level,
|
|
4816
5002
|
check = "line",
|
|
@@ -4832,7 +5018,7 @@ var Success = forwardRef11(function Success2({
|
|
|
4832
5018
|
const seconds = countdown?.seconds;
|
|
4833
5019
|
const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
|
|
4834
5020
|
const mark = check === "circled" ? "circled" : "line";
|
|
4835
|
-
return /* @__PURE__ */
|
|
5021
|
+
return /* @__PURE__ */ jsxs40(
|
|
4836
5022
|
"div",
|
|
4837
5023
|
{
|
|
4838
5024
|
role: "status",
|
|
@@ -4841,16 +5027,16 @@ var Success = forwardRef11(function Success2({
|
|
|
4841
5027
|
ref,
|
|
4842
5028
|
className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
|
|
4843
5029
|
children: [
|
|
4844
|
-
confetti && /* @__PURE__ */
|
|
4845
|
-
([x, d, r, t, s], index) => /* @__PURE__ */
|
|
5030
|
+
confetti && /* @__PURE__ */ jsx44("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
|
|
5031
|
+
([x, d, r, t, s], index) => /* @__PURE__ */ jsx44("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
|
|
4846
5032
|
) }),
|
|
4847
|
-
/* @__PURE__ */
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
/* @__PURE__ */
|
|
4850
|
-
/* @__PURE__ */
|
|
4851
|
-
body && /* @__PURE__ */
|
|
4852
|
-
hasActions && /* @__PURE__ */
|
|
4853
|
-
countdown && /* @__PURE__ */
|
|
5033
|
+
/* @__PURE__ */ jsxs40("div", { className: "ui-sx__inner", children: [
|
|
5034
|
+
/* @__PURE__ */ jsx44("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx44(SuccessCheck, { variant: mark }) }),
|
|
5035
|
+
/* @__PURE__ */ jsxs40("div", { className: "ui-sx__content", children: [
|
|
5036
|
+
/* @__PURE__ */ jsx44(Heading, { className: "ui-sx__title", children: title }),
|
|
5037
|
+
body && /* @__PURE__ */ jsx44("p", { className: "ui-sx__body", children: body }),
|
|
5038
|
+
hasActions && /* @__PURE__ */ jsx44("div", { className: "ui-sx__actions", children: actions }),
|
|
5039
|
+
countdown && /* @__PURE__ */ jsx44(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
|
|
4854
5040
|
] })
|
|
4855
5041
|
] })
|
|
4856
5042
|
]
|
|
@@ -4861,17 +5047,17 @@ var Success = forwardRef11(function Success2({
|
|
|
4861
5047
|
// src/Chart.tsx
|
|
4862
5048
|
import {
|
|
4863
5049
|
useCallback as useCallback7,
|
|
4864
|
-
useEffect as
|
|
4865
|
-
useId as
|
|
5050
|
+
useEffect as useEffect19,
|
|
5051
|
+
useId as useId15,
|
|
4866
5052
|
useLayoutEffect as useLayoutEffect5,
|
|
4867
5053
|
useMemo as useMemo5,
|
|
4868
|
-
useRef as
|
|
4869
|
-
useState as
|
|
5054
|
+
useRef as useRef24,
|
|
5055
|
+
useState as useState19
|
|
4870
5056
|
} from "react";
|
|
4871
5057
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
4872
5058
|
|
|
4873
5059
|
// src/chart-looks.tsx
|
|
4874
|
-
import { Fragment as
|
|
5060
|
+
import { Fragment as Fragment19, jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4875
5061
|
var LOOK_DEFAULT = {
|
|
4876
5062
|
line: "thin",
|
|
4877
5063
|
area: "stacked",
|
|
@@ -5052,7 +5238,7 @@ function linesDrawing(g, open) {
|
|
|
5052
5238
|
const up = layer.to.map((v, i) => `${i ? "L" : "M"}${px(centre(i))} ${px(y(Number.isFinite(v) ? v : layer.from[i]))}`);
|
|
5053
5239
|
const down = layer.from.map((v, i) => `L${px(centre(i))} ${px(y(v))}`).reverse();
|
|
5054
5240
|
const ramp = ramps[k];
|
|
5055
|
-
return /* @__PURE__ */
|
|
5241
|
+
return /* @__PURE__ */ jsx45(
|
|
5056
5242
|
"path",
|
|
5057
5243
|
{
|
|
5058
5244
|
className: cx8(look.share ? "ui-chart__segment" : "ui-chart__area", tone(layer.tone)),
|
|
@@ -5062,7 +5248,7 @@ function linesDrawing(g, open) {
|
|
|
5062
5248
|
`fill-${layer.id}`
|
|
5063
5249
|
);
|
|
5064
5250
|
});
|
|
5065
|
-
const edges = !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */
|
|
5251
|
+
const edges = !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */ jsx45(
|
|
5066
5252
|
"line",
|
|
5067
5253
|
{
|
|
5068
5254
|
className: cx8(
|
|
@@ -5084,7 +5270,7 @@ function linesDrawing(g, open) {
|
|
|
5084
5270
|
const shown = i === open || points || lonely && !look.share;
|
|
5085
5271
|
if (!shown || look.share && i !== open) return null;
|
|
5086
5272
|
if (look.share && layer !== look.layers[look.layers.length - 1]) return null;
|
|
5087
|
-
return /* @__PURE__ */
|
|
5273
|
+
return /* @__PURE__ */ jsx45(
|
|
5088
5274
|
"circle",
|
|
5089
5275
|
{
|
|
5090
5276
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5112,8 +5298,8 @@ function linesDrawing(g, open) {
|
|
|
5112
5298
|
base = at2 + Math.max(drop, fall + gap + ascent);
|
|
5113
5299
|
}
|
|
5114
5300
|
}
|
|
5115
|
-
return /* @__PURE__ */
|
|
5116
|
-
/* @__PURE__ */
|
|
5301
|
+
return /* @__PURE__ */ jsxs41("g", { children: [
|
|
5302
|
+
/* @__PURE__ */ jsx45(
|
|
5117
5303
|
"circle",
|
|
5118
5304
|
{
|
|
5119
5305
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5122,7 +5308,7 @@ function linesDrawing(g, open) {
|
|
|
5122
5308
|
r: "4"
|
|
5123
5309
|
}
|
|
5124
5310
|
),
|
|
5125
|
-
/* @__PURE__ */
|
|
5311
|
+
/* @__PURE__ */ jsx45(
|
|
5126
5312
|
"text",
|
|
5127
5313
|
{
|
|
5128
5314
|
className: "ui-chart__text ui-chart__text--strong",
|
|
@@ -5134,8 +5320,8 @@ function linesDrawing(g, open) {
|
|
|
5134
5320
|
)
|
|
5135
5321
|
] }, `end-${layer.id}`);
|
|
5136
5322
|
});
|
|
5137
|
-
return /* @__PURE__ */
|
|
5138
|
-
ramps.some(Boolean) && /* @__PURE__ */
|
|
5323
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
5324
|
+
ramps.some(Boolean) && /* @__PURE__ */ jsx45("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs41(
|
|
5139
5325
|
"linearGradient",
|
|
5140
5326
|
{
|
|
5141
5327
|
id: ramp.id,
|
|
@@ -5146,14 +5332,14 @@ function linesDrawing(g, open) {
|
|
|
5146
5332
|
y1: px(y(ramp.lo)),
|
|
5147
5333
|
y2: px(y(ramp.hi)),
|
|
5148
5334
|
children: [
|
|
5149
|
-
/* @__PURE__ */
|
|
5150
|
-
/* @__PURE__ */
|
|
5335
|
+
/* @__PURE__ */ jsx45("stop", { className: "ui-chart__fade-base", offset: "0" }),
|
|
5336
|
+
/* @__PURE__ */ jsx45("stop", { className: "ui-chart__fade-end", offset: "1" })
|
|
5151
5337
|
]
|
|
5152
5338
|
},
|
|
5153
5339
|
ramp.id
|
|
5154
5340
|
)) }),
|
|
5155
5341
|
fills,
|
|
5156
|
-
open !== null && /* @__PURE__ */
|
|
5342
|
+
open !== null && /* @__PURE__ */ jsx45(
|
|
5157
5343
|
"line",
|
|
5158
5344
|
{
|
|
5159
5345
|
className: "ui-chart__cross",
|
|
@@ -5178,7 +5364,7 @@ function columnsDrawing(g) {
|
|
|
5178
5364
|
const y1 = y(layer.to[i]);
|
|
5179
5365
|
const x = centre(i) - w / 2;
|
|
5180
5366
|
const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, 4) : square(x, y1, w, y0 - y1);
|
|
5181
|
-
return /* @__PURE__ */
|
|
5367
|
+
return /* @__PURE__ */ jsx45(
|
|
5182
5368
|
"path",
|
|
5183
5369
|
{
|
|
5184
5370
|
className: cx8("ui-chart__segment", tone(layer.tone), label.estimated && "is-estimated"),
|
|
@@ -5193,10 +5379,10 @@ function rowsDrawing(g, pick) {
|
|
|
5193
5379
|
const { look, labels, format, formatAxis, scale } = g;
|
|
5194
5380
|
const rows = rowsOf(g);
|
|
5195
5381
|
const bottom = rows.row * labels.length;
|
|
5196
|
-
return /* @__PURE__ */
|
|
5197
|
-
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */
|
|
5198
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
5199
|
-
/* @__PURE__ */
|
|
5382
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
5383
|
+
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx45("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
|
|
5384
|
+
scale.ticks.map((tick) => /* @__PURE__ */ jsxs41("g", { children: [
|
|
5385
|
+
/* @__PURE__ */ jsx45(
|
|
5200
5386
|
"line",
|
|
5201
5387
|
{
|
|
5202
5388
|
className: tick === 0 ? "ui-chart__zero" : "ui-chart__grid",
|
|
@@ -5206,7 +5392,7 @@ function rowsDrawing(g, pick) {
|
|
|
5206
5392
|
y2: px(bottom)
|
|
5207
5393
|
}
|
|
5208
5394
|
),
|
|
5209
|
-
/* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx45(
|
|
5210
5396
|
"text",
|
|
5211
5397
|
{
|
|
5212
5398
|
className: "ui-chart__caption",
|
|
@@ -5221,8 +5407,8 @@ function rowsDrawing(g, pick) {
|
|
|
5221
5407
|
labels.map((label, i) => {
|
|
5222
5408
|
const top = rows.top(i);
|
|
5223
5409
|
const filled = look.layers.filter((l) => l.to[i] > l.from[i]);
|
|
5224
|
-
return /* @__PURE__ */
|
|
5225
|
-
/* @__PURE__ */
|
|
5410
|
+
return /* @__PURE__ */ jsxs41("g", { children: [
|
|
5411
|
+
/* @__PURE__ */ jsx45(
|
|
5226
5412
|
"text",
|
|
5227
5413
|
{
|
|
5228
5414
|
className: "ui-chart__caption",
|
|
@@ -5237,7 +5423,7 @@ function rowsDrawing(g, pick) {
|
|
|
5237
5423
|
const x0 = rows.x(layer.from[i]);
|
|
5238
5424
|
const x1 = rows.x(layer.to[i]);
|
|
5239
5425
|
const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, 4) : square(x0, top, x1 - x0, ROW_BAR);
|
|
5240
|
-
return /* @__PURE__ */
|
|
5426
|
+
return /* @__PURE__ */ jsx45(
|
|
5241
5427
|
"path",
|
|
5242
5428
|
{
|
|
5243
5429
|
d,
|
|
@@ -5246,7 +5432,7 @@ function rowsDrawing(g, pick) {
|
|
|
5246
5432
|
`seg-${layer.id}`
|
|
5247
5433
|
);
|
|
5248
5434
|
}),
|
|
5249
|
-
/* @__PURE__ */
|
|
5435
|
+
/* @__PURE__ */ jsx45(
|
|
5250
5436
|
"text",
|
|
5251
5437
|
{
|
|
5252
5438
|
className: "ui-chart__text",
|
|
@@ -5264,8 +5450,8 @@ function ringDrawing(g) {
|
|
|
5264
5450
|
const { look, format } = g;
|
|
5265
5451
|
const ring = ringOf(g);
|
|
5266
5452
|
const total = look.totals[0];
|
|
5267
|
-
return /* @__PURE__ */
|
|
5268
|
-
look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */
|
|
5453
|
+
return /* @__PURE__ */ jsxs41(Fragment19, { children: [
|
|
5454
|
+
look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx45(
|
|
5269
5455
|
"path",
|
|
5270
5456
|
{
|
|
5271
5457
|
className: cx8("ui-chart__segment", tone(slice.tone)),
|
|
@@ -5273,42 +5459,42 @@ function ringDrawing(g) {
|
|
|
5273
5459
|
},
|
|
5274
5460
|
`slice-${slice.id}`
|
|
5275
5461
|
)),
|
|
5276
|
-
look.look === "thin" && /* @__PURE__ */
|
|
5277
|
-
/* @__PURE__ */
|
|
5278
|
-
/* @__PURE__ */
|
|
5462
|
+
look.look === "thin" && /* @__PURE__ */ jsxs41("g", { "aria-hidden": "true", children: [
|
|
5463
|
+
/* @__PURE__ */ jsx45("text", { className: "ui-chart__total", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 2), children: format(total) }),
|
|
5464
|
+
/* @__PURE__ */ jsx45("text", { className: "ui-chart__caption", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 22), children: look.totalLabel })
|
|
5279
5465
|
] }),
|
|
5280
5466
|
look.look === "labels" && look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => {
|
|
5281
5467
|
const mid = angle((slice.from[0] + slice.to[0]) / 2);
|
|
5282
5468
|
const x = ring.x + (ring.r + 14) * Math.cos(mid);
|
|
5283
5469
|
const y = ring.y + (ring.r + 14) * Math.sin(mid);
|
|
5284
5470
|
const anchor = Math.cos(mid) >= 0 ? "start" : "end";
|
|
5285
|
-
return /* @__PURE__ */
|
|
5286
|
-
/* @__PURE__ */
|
|
5287
|
-
/* @__PURE__ */
|
|
5471
|
+
return /* @__PURE__ */ jsxs41("g", { "aria-hidden": "true", children: [
|
|
5472
|
+
/* @__PURE__ */ jsx45("text", { className: "ui-chart__text ui-chart__text--strong", textAnchor: anchor, x: px(x), y: px(y - 2), children: slice.name }),
|
|
5473
|
+
/* @__PURE__ */ jsx45("text", { className: "ui-chart__text", textAnchor: anchor, x: px(x), y: px(y + 13), children: `${format(slice.values[0])} ${pct(slice.to[0] - slice.from[0])}` })
|
|
5288
5474
|
] }, `label-${slice.id}`);
|
|
5289
5475
|
})
|
|
5290
5476
|
] });
|
|
5291
5477
|
}
|
|
5292
5478
|
function Shares({ look, format, swatch }) {
|
|
5293
5479
|
const total = look.totals[0];
|
|
5294
|
-
return /* @__PURE__ */
|
|
5295
|
-
look.layers.map((slice) => /* @__PURE__ */
|
|
5480
|
+
return /* @__PURE__ */ jsxs41("ul", { className: "ui-chart__shares", "aria-hidden": "true", children: [
|
|
5481
|
+
look.layers.map((slice) => /* @__PURE__ */ jsxs41("li", { className: tone(slice.tone), children: [
|
|
5296
5482
|
swatch,
|
|
5297
|
-
/* @__PURE__ */
|
|
5298
|
-
/* @__PURE__ */
|
|
5299
|
-
/* @__PURE__ */
|
|
5483
|
+
/* @__PURE__ */ jsx45("span", { children: slice.name }),
|
|
5484
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-chart__shares-value", children: format(slice.values[0]) }),
|
|
5485
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-chart__shares-pct", children: total > 0 ? pct(slice.to[0] - slice.from[0]) : MISSING })
|
|
5300
5486
|
] }, slice.id)),
|
|
5301
|
-
/* @__PURE__ */
|
|
5302
|
-
/* @__PURE__ */
|
|
5303
|
-
/* @__PURE__ */
|
|
5304
|
-
/* @__PURE__ */
|
|
5305
|
-
/* @__PURE__ */
|
|
5487
|
+
/* @__PURE__ */ jsxs41("li", { className: "ui-chart__shares-total", children: [
|
|
5488
|
+
/* @__PURE__ */ jsx45("span", {}),
|
|
5489
|
+
/* @__PURE__ */ jsx45("span", { children: look.totalLabel }),
|
|
5490
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-chart__shares-value", children: format(total) }),
|
|
5491
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-chart__shares-pct", children: "100%" })
|
|
5306
5492
|
] })
|
|
5307
5493
|
] });
|
|
5308
5494
|
}
|
|
5309
5495
|
|
|
5310
5496
|
// src/Chart.tsx
|
|
5311
|
-
import { Fragment as
|
|
5497
|
+
import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5312
5498
|
var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
|
|
5313
5499
|
var PAD = 2;
|
|
5314
5500
|
var ZERO_INSET = 1.5;
|
|
@@ -5350,8 +5536,8 @@ function barPath(m) {
|
|
|
5350
5536
|
return `M${px2(x)} ${px2(roundBottom ? bottom - r : bottom)}V${px2(roundTop ? top + r : top)}` + (roundTop ? `${arc2(r, -r, 1)}h${px2(w - r * 2)}${arc2(r, r, 1)}` : `h${px2(w)}`) + `V${px2(roundBottom ? bottom - r : bottom)}` + (roundBottom ? `${arc2(-r, r, 1)}h${px2(-(w - r * 2))}${arc2(-r, -r, 1)}` : `h${px2(-w)}`) + "z";
|
|
5351
5537
|
}
|
|
5352
5538
|
function useTapFloor() {
|
|
5353
|
-
const [floor, setFloor] =
|
|
5354
|
-
|
|
5539
|
+
const [floor, setFloor] = useState19(TARGET);
|
|
5540
|
+
useEffect19(() => {
|
|
5355
5541
|
const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX2}px) and (pointer: coarse)`);
|
|
5356
5542
|
if (!query) return;
|
|
5357
5543
|
const read = () => setFloor(query.matches ? TAP_FLOOR : TARGET);
|
|
@@ -5559,9 +5745,9 @@ function donutFrame(look, slices, totalLabel, format) {
|
|
|
5559
5745
|
}
|
|
5560
5746
|
function KeyMark({ shape }) {
|
|
5561
5747
|
if (shape === "line") {
|
|
5562
|
-
return /* @__PURE__ */
|
|
5748
|
+
return /* @__PURE__ */ jsx46("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx46("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) });
|
|
5563
5749
|
}
|
|
5564
|
-
return /* @__PURE__ */
|
|
5750
|
+
return /* @__PURE__ */ jsx46("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: shape === "fill" ? /* @__PURE__ */ jsx46("rect", { className: "ui-chart__key-swatch", x: "1", y: "1", width: "10", height: "10", rx: "2.5" }) : /* @__PURE__ */ jsx46(
|
|
5565
5751
|
"path",
|
|
5566
5752
|
{
|
|
5567
5753
|
className: "ui-chart__key-swatch",
|
|
@@ -5586,25 +5772,25 @@ function Chart(props) {
|
|
|
5586
5772
|
const spark = variant === "spark";
|
|
5587
5773
|
const plotHeight = height ?? HEIGHT[variant];
|
|
5588
5774
|
const showTable = table ?? !spark;
|
|
5589
|
-
const [view, setView] =
|
|
5775
|
+
const [view, setView] = useState19("chart");
|
|
5590
5776
|
const asTable = showTable && view === "table";
|
|
5591
|
-
const uid =
|
|
5592
|
-
const frameEl =
|
|
5593
|
-
const scroller =
|
|
5594
|
-
const plot =
|
|
5595
|
-
const tipEl =
|
|
5596
|
-
const svgEl =
|
|
5597
|
-
const ignoreMouseUntil =
|
|
5598
|
-
const touchMoved =
|
|
5599
|
-
const dismissed =
|
|
5600
|
-
const opening =
|
|
5601
|
-
const pointerFocus =
|
|
5777
|
+
const uid = useId15().replace(/[^\w-]/g, "");
|
|
5778
|
+
const frameEl = useRef24(null);
|
|
5779
|
+
const scroller = useRef24(null);
|
|
5780
|
+
const plot = useRef24(null);
|
|
5781
|
+
const tipEl = useRef24(null);
|
|
5782
|
+
const svgEl = useRef24(null);
|
|
5783
|
+
const ignoreMouseUntil = useRef24(0);
|
|
5784
|
+
const touchMoved = useRef24(false);
|
|
5785
|
+
const dismissed = useRef24(null);
|
|
5786
|
+
const opening = useRef24(false);
|
|
5787
|
+
const pointerFocus = useRef24(false);
|
|
5602
5788
|
const floor = useTapFloor();
|
|
5603
|
-
const [width, setWidth] =
|
|
5604
|
-
const [openId, setOpenId] =
|
|
5605
|
-
const [rawCursor, setCursor] =
|
|
5606
|
-
const [said, setSaid] =
|
|
5607
|
-
const [ownPick, setOwnPick] =
|
|
5789
|
+
const [width, setWidth] = useState19(0);
|
|
5790
|
+
const [openId, setOpenId] = useState19(null);
|
|
5791
|
+
const [rawCursor, setCursor] = useState19(0);
|
|
5792
|
+
const [said, setSaid] = useState19("");
|
|
5793
|
+
const [ownPick, setOwnPick] = useState19(null);
|
|
5608
5794
|
const pick = selected === void 0 ? ownPick : selected;
|
|
5609
5795
|
const steps = props.variant === "bridge" ? props.steps : void 0;
|
|
5610
5796
|
const bridgeTones = props.variant === "bridge" ? props.tones : void 0;
|
|
@@ -5737,7 +5923,7 @@ function Chart(props) {
|
|
|
5737
5923
|
const fades = useMemo5(() => new Map(marks.filter((m) => m.kind === "bar").map((m) => fadeOf(uid, m, variant === "bridge")).filter((f) => f !== null).map((f) => [f.id, f])), [marks, uid, variant]);
|
|
5738
5924
|
const lead = useCallback7((column) => marks.find((m) => m.column === column), [marks]);
|
|
5739
5925
|
const open = openId ? byId.get(openId) : void 0;
|
|
5740
|
-
|
|
5926
|
+
useEffect19(() => {
|
|
5741
5927
|
const el = plot.current;
|
|
5742
5928
|
if (!el) return;
|
|
5743
5929
|
const read = () => setWidth(el.clientWidth);
|
|
@@ -5757,7 +5943,7 @@ function Chart(props) {
|
|
|
5757
5943
|
const anchor = [...svgEl.current.querySelectorAll("[data-anchor]")].find((el) => el.getAttribute("data-anchor") === openId);
|
|
5758
5944
|
if (anchor) placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
5759
5945
|
}, [openId, plotWidth, plotHeight]);
|
|
5760
|
-
|
|
5946
|
+
useEffect19(() => {
|
|
5761
5947
|
if (!openId) return;
|
|
5762
5948
|
const doc = frameEl.current?.ownerDocument;
|
|
5763
5949
|
const view2 = doc?.defaultView;
|
|
@@ -5833,18 +6019,18 @@ function Chart(props) {
|
|
|
5833
6019
|
const estimatedTone = marks.find((m) => m.estimated && m.kind === "bar")?.tone ?? keys[0]?.tone ?? "neutral";
|
|
5834
6020
|
const hitBand = (band) => band === "up" ? { y: PAD, h: Math.max(zero - PAD, TARGET) } : band === "down" ? { y: zero, h: Math.max(plotHeight - PAD - zero, TARGET) } : { y: PAD, h: Math.max(plotHeight - PAD * 2, TARGET) };
|
|
5835
6021
|
const legendFirst = !(look?.variant === "donut" && look.look !== "labels");
|
|
5836
|
-
const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */
|
|
5837
|
-
keys.map((key) => /* @__PURE__ */
|
|
5838
|
-
/* @__PURE__ */
|
|
6022
|
+
const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */ jsxs42("ul", { className: "ui-chart__legend", children: [
|
|
6023
|
+
keys.map((key) => /* @__PURE__ */ jsxs42("li", { className: cx9("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
|
|
6024
|
+
/* @__PURE__ */ jsx46(KeyMark, { shape: key.shape }),
|
|
5839
6025
|
key.name
|
|
5840
6026
|
] }, key.id)),
|
|
5841
|
-
estimated.length > 0 && /* @__PURE__ */
|
|
5842
|
-
/* @__PURE__ */
|
|
6027
|
+
estimated.length > 0 && /* @__PURE__ */ jsxs42("li", { className: cx9("ui-chart__key", `ui-chart__tone--${estimatedTone}`), children: [
|
|
6028
|
+
/* @__PURE__ */ jsx46("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx46("rect", { className: "ui-chart__key-estimated", x: "1.5", y: "1.5", width: "9", height: "9", rx: "2.5" }) }),
|
|
5843
6029
|
"Estimated"
|
|
5844
6030
|
] })
|
|
5845
6031
|
] });
|
|
5846
6032
|
const noun = look?.layout === "ring" ? "slices" : look?.layout === "rows" ? "rows" : "columns";
|
|
5847
|
-
return /* @__PURE__ */
|
|
6033
|
+
return /* @__PURE__ */ jsxs42(
|
|
5848
6034
|
"div",
|
|
5849
6035
|
{
|
|
5850
6036
|
className: cx9(
|
|
@@ -5861,9 +6047,9 @@ function Chart(props) {
|
|
|
5861
6047
|
"--ui-chart-pad": `${PAD}px`
|
|
5862
6048
|
},
|
|
5863
6049
|
children: [
|
|
5864
|
-
(showTable || legendFirst && legend) && /* @__PURE__ */
|
|
6050
|
+
(showTable || legendFirst && legend) && /* @__PURE__ */ jsxs42("div", { className: "ui-chart__head", children: [
|
|
5865
6051
|
legendFirst && legend,
|
|
5866
|
-
showTable && /* @__PURE__ */
|
|
6052
|
+
showTable && /* @__PURE__ */ jsx46(
|
|
5867
6053
|
Segmented,
|
|
5868
6054
|
{
|
|
5869
6055
|
size: "sm",
|
|
@@ -5877,7 +6063,7 @@ function Chart(props) {
|
|
|
5877
6063
|
}
|
|
5878
6064
|
)
|
|
5879
6065
|
] }),
|
|
5880
|
-
/* @__PURE__ */
|
|
6066
|
+
/* @__PURE__ */ jsxs42(
|
|
5881
6067
|
"div",
|
|
5882
6068
|
{
|
|
5883
6069
|
ref: frameEl,
|
|
@@ -5902,16 +6088,16 @@ function Chart(props) {
|
|
|
5902
6088
|
setSaid("");
|
|
5903
6089
|
},
|
|
5904
6090
|
children: [
|
|
5905
|
-
!spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */
|
|
5906
|
-
/* @__PURE__ */
|
|
6091
|
+
!spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */ jsx46("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx46("span", { className: "ui-chart__tick", children: axisFormat(tick) }, tick)) }),
|
|
6092
|
+
/* @__PURE__ */ jsx46("div", { ref: scroller, className: "ui-chart__scroll", tabIndex: -1, onScroll: () => {
|
|
5907
6093
|
const anchor = [...svgEl.current?.querySelectorAll("[data-anchor]") ?? []].find((el) => el.getAttribute("data-anchor") === openId);
|
|
5908
6094
|
if (!anchor || !scroller.current || !frameEl.current || !tipEl.current) return;
|
|
5909
6095
|
const mark = anchor.getBoundingClientRect();
|
|
5910
6096
|
const view2 = scroller.current.getBoundingClientRect();
|
|
5911
6097
|
if (mark.right <= view2.left || mark.left >= view2.right) setOpenId(null);
|
|
5912
6098
|
else placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
5913
|
-
}, children: /* @__PURE__ */
|
|
5914
|
-
/* @__PURE__ */
|
|
6099
|
+
}, children: /* @__PURE__ */ jsxs42("div", { ref: plot, className: "ui-chart__plot", children: [
|
|
6100
|
+
/* @__PURE__ */ jsxs42(
|
|
5915
6101
|
"svg",
|
|
5916
6102
|
{
|
|
5917
6103
|
ref: svgEl,
|
|
@@ -5972,7 +6158,7 @@ function Chart(props) {
|
|
|
5972
6158
|
announce(mark.column, selectable ? mark.column : pick);
|
|
5973
6159
|
},
|
|
5974
6160
|
children: [
|
|
5975
|
-
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */
|
|
6161
|
+
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx46(
|
|
5976
6162
|
"rect",
|
|
5977
6163
|
{
|
|
5978
6164
|
className: "ui-chart__band",
|
|
@@ -5985,7 +6171,7 @@ function Chart(props) {
|
|
|
5985
6171
|
frame.links && frame.bars.slice(0, -1).map((bar, i) => {
|
|
5986
6172
|
const from = byId.get(bar.id);
|
|
5987
6173
|
const to = byId.get(frame.bars[i + 1].id);
|
|
5988
|
-
return from && to ? /* @__PURE__ */
|
|
6174
|
+
return from && to ? /* @__PURE__ */ jsx46(
|
|
5989
6175
|
"line",
|
|
5990
6176
|
{
|
|
5991
6177
|
className: "ui-chart__carry",
|
|
@@ -5997,7 +6183,7 @@ function Chart(props) {
|
|
|
5997
6183
|
`carry-${bar.id}`
|
|
5998
6184
|
) : null;
|
|
5999
6185
|
}),
|
|
6000
|
-
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */
|
|
6186
|
+
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx46(
|
|
6001
6187
|
"line",
|
|
6002
6188
|
{
|
|
6003
6189
|
className: "ui-chart__grid",
|
|
@@ -6008,7 +6194,7 @@ function Chart(props) {
|
|
|
6008
6194
|
},
|
|
6009
6195
|
`grid-${tick}`
|
|
6010
6196
|
)),
|
|
6011
|
-
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */
|
|
6197
|
+
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */ jsx46(
|
|
6012
6198
|
"line",
|
|
6013
6199
|
{
|
|
6014
6200
|
className: "ui-chart__zero",
|
|
@@ -6018,7 +6204,7 @@ function Chart(props) {
|
|
|
6018
6204
|
y2: px2(y(0))
|
|
6019
6205
|
}
|
|
6020
6206
|
),
|
|
6021
|
-
fades.size > 0 && /* @__PURE__ */
|
|
6207
|
+
fades.size > 0 && /* @__PURE__ */ jsx46("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs42(
|
|
6022
6208
|
"linearGradient",
|
|
6023
6209
|
{
|
|
6024
6210
|
id: fade.id,
|
|
@@ -6028,15 +6214,15 @@ function Chart(props) {
|
|
|
6028
6214
|
y1: fade.up ? "1" : "0",
|
|
6029
6215
|
y2: fade.up ? "0" : "1",
|
|
6030
6216
|
children: [
|
|
6031
|
-
/* @__PURE__ */
|
|
6032
|
-
/* @__PURE__ */
|
|
6217
|
+
/* @__PURE__ */ jsx46("stop", { className: "ui-chart__fade-base", offset: "0" }),
|
|
6218
|
+
/* @__PURE__ */ jsx46("stop", { className: "ui-chart__fade-end", offset: "1" })
|
|
6033
6219
|
]
|
|
6034
6220
|
},
|
|
6035
6221
|
fade.id
|
|
6036
6222
|
)) }),
|
|
6037
6223
|
marks.filter((m) => m.kind === "bar").map((mark) => {
|
|
6038
6224
|
const fade = fadeOf(uid, mark, variant === "bridge");
|
|
6039
|
-
return /* @__PURE__ */
|
|
6225
|
+
return /* @__PURE__ */ jsx46(
|
|
6040
6226
|
"path",
|
|
6041
6227
|
{
|
|
6042
6228
|
className: cx9(
|
|
@@ -6051,7 +6237,7 @@ function Chart(props) {
|
|
|
6051
6237
|
);
|
|
6052
6238
|
}),
|
|
6053
6239
|
["casing", "stroke"].map((layer) => lines.flatMap(
|
|
6054
|
-
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */
|
|
6240
|
+
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx46(
|
|
6055
6241
|
"line",
|
|
6056
6242
|
{
|
|
6057
6243
|
className: layer === "casing" ? "ui-chart__line-casing" : cx9(
|
|
@@ -6067,7 +6253,7 @@ function Chart(props) {
|
|
|
6067
6253
|
`${line.id}-${layer}-${i}`
|
|
6068
6254
|
) : null)
|
|
6069
6255
|
)),
|
|
6070
|
-
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */
|
|
6256
|
+
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx46(
|
|
6071
6257
|
"circle",
|
|
6072
6258
|
{
|
|
6073
6259
|
className: cx9("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
|
|
@@ -6078,8 +6264,8 @@ function Chart(props) {
|
|
|
6078
6264
|
`isolated-${line.id}-${i}`
|
|
6079
6265
|
) : null)),
|
|
6080
6266
|
geometry && lookDrawing(geometry, open?.column ?? null, pick),
|
|
6081
|
-
marks.map((mark) => /* @__PURE__ */
|
|
6082
|
-
mark.hitPath ? /* @__PURE__ */
|
|
6267
|
+
marks.map((mark) => /* @__PURE__ */ jsxs42("g", { "data-mark": mark.id, children: [
|
|
6268
|
+
mark.hitPath ? /* @__PURE__ */ jsx46("path", { className: "ui-chart__hit", d: mark.hitPath }) : mark.kind === "bar" ? /* @__PURE__ */ jsx46(
|
|
6083
6269
|
"rect",
|
|
6084
6270
|
{
|
|
6085
6271
|
className: "ui-chart__hit",
|
|
@@ -6088,7 +6274,7 @@ function Chart(props) {
|
|
|
6088
6274
|
y: px2(hitBand(mark.band).y),
|
|
6089
6275
|
height: px2(hitBand(mark.band).h)
|
|
6090
6276
|
}
|
|
6091
|
-
) : /* @__PURE__ */
|
|
6277
|
+
) : /* @__PURE__ */ jsx46(
|
|
6092
6278
|
"rect",
|
|
6093
6279
|
{
|
|
6094
6280
|
className: "ui-chart__hit",
|
|
@@ -6098,7 +6284,7 @@ function Chart(props) {
|
|
|
6098
6284
|
height: px2(mark.hit?.h ?? TARGET)
|
|
6099
6285
|
}
|
|
6100
6286
|
),
|
|
6101
|
-
/* @__PURE__ */
|
|
6287
|
+
/* @__PURE__ */ jsx46(
|
|
6102
6288
|
"rect",
|
|
6103
6289
|
{
|
|
6104
6290
|
"data-anchor": mark.id,
|
|
@@ -6113,8 +6299,8 @@ function Chart(props) {
|
|
|
6113
6299
|
]
|
|
6114
6300
|
}
|
|
6115
6301
|
),
|
|
6116
|
-
look?.variant === "donut" && look.look === "table" && /* @__PURE__ */
|
|
6117
|
-
!spark && columnsLayout && /* @__PURE__ */
|
|
6302
|
+
look?.variant === "donut" && look.look === "table" && /* @__PURE__ */ jsx46(Shares, { look, format, swatch: /* @__PURE__ */ jsx46(KeyMark, { shape: "fill" }) }),
|
|
6303
|
+
!spark && columnsLayout && /* @__PURE__ */ jsx46("div", { className: "ui-chart__periods", "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx46(
|
|
6118
6304
|
"span",
|
|
6119
6305
|
{
|
|
6120
6306
|
className: cx9("ui-chart__period", pick === i && "is-selected"),
|
|
@@ -6123,46 +6309,46 @@ function Chart(props) {
|
|
|
6123
6309
|
`${column.label}-${i}`
|
|
6124
6310
|
)) })
|
|
6125
6311
|
] }) }),
|
|
6126
|
-
/* @__PURE__ */
|
|
6127
|
-
/* @__PURE__ */
|
|
6128
|
-
open.rows ? /* @__PURE__ */
|
|
6129
|
-
open.rows.map((row) => /* @__PURE__ */
|
|
6130
|
-
/* @__PURE__ */
|
|
6131
|
-
/* @__PURE__ */
|
|
6312
|
+
/* @__PURE__ */ jsx46("span", { ref: tipEl, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
6313
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
|
|
6314
|
+
open.rows ? /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
6315
|
+
open.rows.map((row) => /* @__PURE__ */ jsxs42("span", { className: "ui-tip__value ui-chart__row", children: [
|
|
6316
|
+
/* @__PURE__ */ jsxs42("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
|
|
6317
|
+
/* @__PURE__ */ jsx46(KeyMark, { shape: row.shape }),
|
|
6132
6318
|
row.name
|
|
6133
6319
|
] }),
|
|
6134
|
-
/* @__PURE__ */
|
|
6320
|
+
/* @__PURE__ */ jsx46("span", { children: row.text })
|
|
6135
6321
|
] }, row.name)),
|
|
6136
|
-
open.total && /* @__PURE__ */
|
|
6137
|
-
/* @__PURE__ */
|
|
6138
|
-
/* @__PURE__ */
|
|
6322
|
+
open.total && /* @__PURE__ */ jsxs42("span", { className: "ui-tip__value ui-chart__row", children: [
|
|
6323
|
+
/* @__PURE__ */ jsx46("span", { children: totalLabel }),
|
|
6324
|
+
/* @__PURE__ */ jsx46("span", { children: open.total })
|
|
6139
6325
|
] })
|
|
6140
|
-
] }) : /* @__PURE__ */
|
|
6141
|
-
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */
|
|
6326
|
+
] }) : /* @__PURE__ */ jsx46("span", { className: "ui-tip__value", children: format(open.value) }),
|
|
6327
|
+
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx46("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
|
|
6142
6328
|
] }) })
|
|
6143
6329
|
]
|
|
6144
6330
|
}
|
|
6145
6331
|
),
|
|
6146
6332
|
!legendFirst && legend,
|
|
6147
|
-
/* @__PURE__ */
|
|
6148
|
-
asTable && /* @__PURE__ */
|
|
6333
|
+
/* @__PURE__ */ jsx46("div", { className: "ui-sr", role: "status", children: said }),
|
|
6334
|
+
asTable && /* @__PURE__ */ jsx46("div", { className: "ui-chart__data", children: /* @__PURE__ */ jsx46(
|
|
6149
6335
|
"div",
|
|
6150
6336
|
{
|
|
6151
6337
|
className: "ui-table-scroll",
|
|
6152
6338
|
role: "region",
|
|
6153
6339
|
tabIndex: 0,
|
|
6154
6340
|
"aria-label": `${title}, as a table. Scroll for more columns.`,
|
|
6155
|
-
children: /* @__PURE__ */
|
|
6156
|
-
/* @__PURE__ */
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
/* @__PURE__ */
|
|
6341
|
+
children: /* @__PURE__ */ jsxs42("table", { className: "ui-table", "aria-label": title, children: [
|
|
6342
|
+
/* @__PURE__ */ jsx46("thead", { children: /* @__PURE__ */ jsx46("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx46("th", { scope: "col", className: cx9(i > 0 && "ui-table__num"), children: head }, head)) }) }),
|
|
6343
|
+
/* @__PURE__ */ jsx46("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs42("tr", { "aria-current": pick === i ? true : void 0, children: [
|
|
6344
|
+
/* @__PURE__ */ jsxs42("th", { scope: "row", children: [
|
|
6159
6345
|
row.column.label,
|
|
6160
|
-
row.column.estimated && /* @__PURE__ */
|
|
6346
|
+
row.column.estimated && /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
6161
6347
|
" ",
|
|
6162
|
-
/* @__PURE__ */
|
|
6348
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
6163
6349
|
] })
|
|
6164
6350
|
] }),
|
|
6165
|
-
row.cells.map((cell, j) => /* @__PURE__ */
|
|
6351
|
+
row.cells.map((cell, j) => /* @__PURE__ */ jsx46("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
|
|
6166
6352
|
] }, `${row.column.label}-${i}`)) })
|
|
6167
6353
|
] })
|
|
6168
6354
|
}
|
|
@@ -6173,10 +6359,10 @@ function Chart(props) {
|
|
|
6173
6359
|
}
|
|
6174
6360
|
|
|
6175
6361
|
// src/AccentPicker.tsx
|
|
6176
|
-
import { forwardRef as
|
|
6362
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
6177
6363
|
import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
|
|
6178
|
-
import { jsx as
|
|
6179
|
-
var AccentPicker =
|
|
6364
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
6365
|
+
var AccentPicker = forwardRef13(function AccentPicker2({
|
|
6180
6366
|
value,
|
|
6181
6367
|
onChange,
|
|
6182
6368
|
options = ACCENTS,
|
|
@@ -6184,7 +6370,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6184
6370
|
"aria-label": label = "Accent",
|
|
6185
6371
|
...rest
|
|
6186
6372
|
}, ref) {
|
|
6187
|
-
return /* @__PURE__ */
|
|
6373
|
+
return /* @__PURE__ */ jsx47(
|
|
6188
6374
|
"div",
|
|
6189
6375
|
{
|
|
6190
6376
|
...rest,
|
|
@@ -6195,7 +6381,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6195
6381
|
"aria-label": label,
|
|
6196
6382
|
children: options.map((accent) => {
|
|
6197
6383
|
const title = accent.charAt(0).toUpperCase() + accent.slice(1);
|
|
6198
|
-
return /* @__PURE__ */
|
|
6384
|
+
return /* @__PURE__ */ jsx47(
|
|
6199
6385
|
"button",
|
|
6200
6386
|
{
|
|
6201
6387
|
type: "button",
|
|
@@ -6214,9 +6400,9 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6214
6400
|
});
|
|
6215
6401
|
|
|
6216
6402
|
// src/TopBar.tsx
|
|
6217
|
-
import { Fragment as
|
|
6218
|
-
import { prism as prism3, safeUrl as
|
|
6219
|
-
import { Fragment as
|
|
6403
|
+
import { Fragment as Fragment21 } from "react";
|
|
6404
|
+
import { prism as prism3, safeUrl as safeUrl5, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
6405
|
+
import { Fragment as Fragment22, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6220
6406
|
function TopBar({
|
|
6221
6407
|
brand,
|
|
6222
6408
|
word = "Strategy",
|
|
@@ -6228,35 +6414,35 @@ function TopBar({
|
|
|
6228
6414
|
className,
|
|
6229
6415
|
...rest
|
|
6230
6416
|
}) {
|
|
6231
|
-
return /* @__PURE__ */
|
|
6232
|
-
brand ?? /* @__PURE__ */
|
|
6233
|
-
/* @__PURE__ */
|
|
6234
|
-
/* @__PURE__ */
|
|
6417
|
+
return /* @__PURE__ */ jsx48("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs43("div", { className: "topbar__in", children: [
|
|
6418
|
+
brand ?? /* @__PURE__ */ jsxs43("a", { className: "brand", href: safeUrl5(brandHref), "aria-label": `Apliteni ${word}`, children: [
|
|
6419
|
+
/* @__PURE__ */ jsx48("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
|
|
6420
|
+
/* @__PURE__ */ jsx48("span", { children: word })
|
|
6235
6421
|
] }),
|
|
6236
6422
|
view,
|
|
6237
|
-
/* @__PURE__ */
|
|
6423
|
+
/* @__PURE__ */ jsx48("span", { className: "spacer" }),
|
|
6238
6424
|
version,
|
|
6239
6425
|
theme,
|
|
6240
6426
|
account
|
|
6241
6427
|
] }) });
|
|
6242
6428
|
}
|
|
6243
6429
|
function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
6244
|
-
return /* @__PURE__ */
|
|
6430
|
+
return /* @__PURE__ */ jsx48("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
|
|
6245
6431
|
const current = item.id === active;
|
|
6246
6432
|
const linkProps = {
|
|
6247
6433
|
className: current ? "cur" : void 0,
|
|
6248
|
-
href:
|
|
6434
|
+
href: safeUrl5(item.href || `#${item.id}`),
|
|
6249
6435
|
target: item.target,
|
|
6250
6436
|
"aria-current": current ? "page" : void 0,
|
|
6251
6437
|
children: item.label
|
|
6252
6438
|
};
|
|
6253
|
-
return /* @__PURE__ */
|
|
6439
|
+
return /* @__PURE__ */ jsx48(Fragment21, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx48("a", { ...linkProps }) }, item.id);
|
|
6254
6440
|
}) });
|
|
6255
6441
|
}
|
|
6256
6442
|
var BADGE = { live: "Live", archive: "Archive" };
|
|
6257
6443
|
function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
|
|
6258
6444
|
const current = versions.find((v) => v.value === value);
|
|
6259
|
-
return /* @__PURE__ */
|
|
6445
|
+
return /* @__PURE__ */ jsx48("div", { className: "vsw", children: /* @__PURE__ */ jsx48(
|
|
6260
6446
|
Dropdown,
|
|
6261
6447
|
{
|
|
6262
6448
|
variant: "select",
|
|
@@ -6267,9 +6453,9 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
6267
6453
|
chevron: false,
|
|
6268
6454
|
defaultOpen,
|
|
6269
6455
|
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
6270
|
-
triggerContent: /* @__PURE__ */
|
|
6271
|
-
/* @__PURE__ */
|
|
6272
|
-
/* @__PURE__ */
|
|
6456
|
+
triggerContent: /* @__PURE__ */ jsxs43(Fragment22, { children: [
|
|
6457
|
+
/* @__PURE__ */ jsx48("span", { className: "cur", children: current?.label }),
|
|
6458
|
+
/* @__PURE__ */ jsx48("span", { className: "car", "aria-hidden": "true" })
|
|
6273
6459
|
] }),
|
|
6274
6460
|
items: versions.map((v) => ({
|
|
6275
6461
|
label: v.label,
|
|
@@ -6277,10 +6463,10 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
6277
6463
|
badge: BADGE[v.badge ?? "archive"],
|
|
6278
6464
|
selected: v.value === value
|
|
6279
6465
|
})),
|
|
6280
|
-
row: (item, props) => /* @__PURE__ */
|
|
6281
|
-
/* @__PURE__ */
|
|
6282
|
-
/* @__PURE__ */
|
|
6283
|
-
/* @__PURE__ */
|
|
6466
|
+
row: (item, props) => /* @__PURE__ */ jsxs43("div", { ...props, className: `${props.className} vopt`, children: [
|
|
6467
|
+
/* @__PURE__ */ jsx48("span", { className: "vname", children: item.label }),
|
|
6468
|
+
/* @__PURE__ */ jsx48("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
|
|
6469
|
+
/* @__PURE__ */ jsx48("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8("check") } })
|
|
6284
6470
|
] }),
|
|
6285
6471
|
onSelect: (picked) => {
|
|
6286
6472
|
if (picked != null) onChange?.(String(picked));
|
|
@@ -6309,7 +6495,7 @@ function AccountMenu({
|
|
|
6309
6495
|
defaultOpen
|
|
6310
6496
|
}) {
|
|
6311
6497
|
const mark = initialsOf(name, email);
|
|
6312
|
-
return /* @__PURE__ */
|
|
6498
|
+
return /* @__PURE__ */ jsx48("div", { className: "acct on", children: /* @__PURE__ */ jsx48(
|
|
6313
6499
|
Dropdown,
|
|
6314
6500
|
{
|
|
6315
6501
|
variant: "menu",
|
|
@@ -6320,22 +6506,22 @@ function AccountMenu({
|
|
|
6320
6506
|
defaultOpen,
|
|
6321
6507
|
ariaLabel: "Account",
|
|
6322
6508
|
triggerContent: mark,
|
|
6323
|
-
header: /* @__PURE__ */
|
|
6324
|
-
/* @__PURE__ */
|
|
6325
|
-
/* @__PURE__ */
|
|
6326
|
-
/* @__PURE__ */
|
|
6327
|
-
/* @__PURE__ */
|
|
6509
|
+
header: /* @__PURE__ */ jsxs43("div", { className: "ahead", children: [
|
|
6510
|
+
/* @__PURE__ */ jsx48("span", { className: "avatar", children: mark }),
|
|
6511
|
+
/* @__PURE__ */ jsxs43("span", { className: "aw", children: [
|
|
6512
|
+
/* @__PURE__ */ jsx48("span", { className: "anm", children: name }),
|
|
6513
|
+
/* @__PURE__ */ jsx48("span", { className: "aem", title: email, children: email })
|
|
6328
6514
|
] })
|
|
6329
6515
|
] }),
|
|
6330
6516
|
items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
|
|
6331
|
-
row: (item, props) => /* @__PURE__ */
|
|
6517
|
+
row: (item, props) => /* @__PURE__ */ jsxs43(
|
|
6332
6518
|
"a",
|
|
6333
6519
|
{
|
|
6334
6520
|
...props,
|
|
6335
|
-
href: item.disabled ? void 0 : item.href ?
|
|
6521
|
+
href: item.disabled ? void 0 : item.href ? safeUrl5(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl5(item.value === "sign-out" ? "#logout" : `#${item.value}`),
|
|
6336
6522
|
className: [props.className.replace(/\bui-dropdown__item\b/, "").trim(), !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
6337
6523
|
children: [
|
|
6338
|
-
item.icon && /* @__PURE__ */
|
|
6524
|
+
item.icon && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
6339
6525
|
item.label
|
|
6340
6526
|
]
|
|
6341
6527
|
}
|
|
@@ -6348,65 +6534,13 @@ function AccountMenu({
|
|
|
6348
6534
|
) });
|
|
6349
6535
|
}
|
|
6350
6536
|
|
|
6351
|
-
// src/NavTabs.tsx
|
|
6352
|
-
import { Fragment as Fragment21, forwardRef as forwardRef13, useEffect as useEffect18, useRef as useRef23, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
6353
|
-
import { safeUrl as safeUrl5, observeNavFit, revealCurrentNav, revealFocusedNav } from "@apliteni/apliteni-ui";
|
|
6354
|
-
import { Fragment as Fragment22, jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6355
|
-
var NavTabs = forwardRef13(function NavTabs2({
|
|
6356
|
-
items,
|
|
6357
|
-
active,
|
|
6358
|
-
variant = "underline",
|
|
6359
|
-
renderLink,
|
|
6360
|
-
className,
|
|
6361
|
-
onFocus,
|
|
6362
|
-
"aria-label": ariaLabel = "Tabs",
|
|
6363
|
-
...rest
|
|
6364
|
-
}, ref) {
|
|
6365
|
-
const navRef = useRef23(null);
|
|
6366
|
-
useImperativeHandle2(ref, () => navRef.current, []);
|
|
6367
|
-
const signature = items.map((item) => item.id).join("\0");
|
|
6368
|
-
useEffect18(() => observeNavFit(navRef.current), []);
|
|
6369
|
-
useEffect18(() => {
|
|
6370
|
-
if (navRef.current) revealCurrentNav(navRef.current);
|
|
6371
|
-
}, [active, signature]);
|
|
6372
|
-
return /* @__PURE__ */ jsx47(
|
|
6373
|
-
"nav",
|
|
6374
|
-
{
|
|
6375
|
-
...rest,
|
|
6376
|
-
ref: navRef,
|
|
6377
|
-
className: ["ui-nav", "ui-nav--tabs", `is-${variant}`, className].filter(Boolean).join(" "),
|
|
6378
|
-
"aria-label": ariaLabel,
|
|
6379
|
-
onFocus: (event) => {
|
|
6380
|
-
if (navRef.current) revealFocusedNav(navRef.current, event.target);
|
|
6381
|
-
onFocus?.(event);
|
|
6382
|
-
},
|
|
6383
|
-
children: items.map((item) => {
|
|
6384
|
-
const badge = item.badge != null && typeof item.badge === "object" ? item.badge : { text: item.badge, tone: void 0 };
|
|
6385
|
-
const inner = /* @__PURE__ */ jsxs42(Fragment22, { children: [
|
|
6386
|
-
/* @__PURE__ */ jsx47("span", { className: "ui-nav__tab-label", children: item.label }),
|
|
6387
|
-
badge.text != null && badge.text !== "" && /* @__PURE__ */ jsx47("span", { className: `ui-nav__badge is-${badge.tone || "neutral"}`, children: badge.text })
|
|
6388
|
-
] });
|
|
6389
|
-
if (item.disabled) return /* @__PURE__ */ jsx47("span", { className: "ui-nav__tab is-disabled", "aria-disabled": "true", children: inner }, item.id);
|
|
6390
|
-
const current = item.id === active;
|
|
6391
|
-
const linkProps = {
|
|
6392
|
-
className: ["ui-nav__tab", current && "is-active"].filter(Boolean).join(" "),
|
|
6393
|
-
href: safeUrl5(item.href || `#${item.id}`),
|
|
6394
|
-
target: item.target,
|
|
6395
|
-
"aria-current": current ? "page" : void 0,
|
|
6396
|
-
children: inner
|
|
6397
|
-
};
|
|
6398
|
-
return /* @__PURE__ */ jsx47(Fragment21, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx47("a", { ...linkProps }) }, item.id);
|
|
6399
|
-
})
|
|
6400
|
-
}
|
|
6401
|
-
);
|
|
6402
|
-
});
|
|
6403
|
-
|
|
6404
6537
|
// src/index.ts
|
|
6405
6538
|
var PAGE_SIZES = KIT_PAGE_SIZES;
|
|
6406
6539
|
var DEFAULT_PAGE_SIZE3 = KIT_DEFAULT_PAGE_SIZE;
|
|
6407
6540
|
export {
|
|
6408
6541
|
AccentPicker,
|
|
6409
6542
|
AccountMenu,
|
|
6543
|
+
AccountWindow,
|
|
6410
6544
|
AppShell,
|
|
6411
6545
|
AuthShell,
|
|
6412
6546
|
Avatar,
|