@apliteni/apliteni-ui 0.179.2 → 0.181.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/docs/components.md +56 -15
- package/guidelines/INDEX.md +1 -1
- package/guidelines/account-and-settings.md +13 -13
- package/guidelines/the-page.md +12 -0
- package/package.json +1 -1
- package/react/README.md +14 -0
- package/react/dist/index.css +117 -0
- package/react/dist/index.d.ts +55 -12
- package/react/dist/index.js +268 -172
- package/src/styles/card.css +10 -1
- package/src/styles/layout.css +6 -2
- package/src/styles/nav.css +14 -1
- package/src/styles/table.css +17 -0
- package/src/tokens/tokens.css +3 -0
package/react/dist/index.js
CHANGED
|
@@ -1385,6 +1385,7 @@ var NavTabs = forwardRef6(function NavTabs2({
|
|
|
1385
1385
|
// src/SidebarNav.tsx
|
|
1386
1386
|
import { forwardRef as forwardRef7, useEffect as useEffect6, useId as useId6, useState as useState6 } from "react";
|
|
1387
1387
|
import { ENTRANCE_FALLBACK_MS } from "@apliteni/apliteni-ui/motion";
|
|
1388
|
+
import { safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
|
|
1388
1389
|
import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1389
1390
|
var badgeText = (badge) => typeof badge === "object" ? badge.text : badge;
|
|
1390
1391
|
function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
|
|
@@ -1392,7 +1393,13 @@ function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
|
|
|
1392
1393
|
const group = !sub && !!item.items?.length;
|
|
1393
1394
|
const childActive = group && item.items.some((child) => child.id === active);
|
|
1394
1395
|
const [expanded, setExpanded] = useState6();
|
|
1395
|
-
const
|
|
1396
|
+
const here = childActive ? active : void 0;
|
|
1397
|
+
const [held, setHeld] = useState6(here);
|
|
1398
|
+
if (held !== here) {
|
|
1399
|
+
setHeld(here);
|
|
1400
|
+
if (here !== void 0) setExpanded(void 0);
|
|
1401
|
+
}
|
|
1402
|
+
const open = expanded ?? (childActive || !!item.defaultOpen);
|
|
1396
1403
|
const [entering, setEntering] = useState6(false);
|
|
1397
1404
|
useEffect6(() => {
|
|
1398
1405
|
if (!entering) return;
|
|
@@ -1438,12 +1445,19 @@ function Row({ item, active, activeIs, collapsed, renderLink, sub }) {
|
|
|
1438
1445
|
if (item.disabled) return /* @__PURE__ */ jsx17("li", { children: /* @__PURE__ */ jsx17("span", { ...common, role: "link", "aria-disabled": "true" }) });
|
|
1439
1446
|
const props = {
|
|
1440
1447
|
...common,
|
|
1441
|
-
href: item.href ?? `#${item.id}
|
|
1448
|
+
href: safeUrl3(item.href ?? `#${item.id}`),
|
|
1442
1449
|
target: item.target,
|
|
1443
1450
|
"aria-current": isActive ? activeIs === "section" ? "true" : "page" : void 0
|
|
1444
1451
|
};
|
|
1445
1452
|
return /* @__PURE__ */ jsx17("li", { children: renderLink ? renderLink(item, props) : /* @__PURE__ */ jsx17("a", { ...props }) });
|
|
1446
1453
|
}
|
|
1454
|
+
var development = () => {
|
|
1455
|
+
try {
|
|
1456
|
+
return process.env.NODE_ENV !== "production";
|
|
1457
|
+
} catch {
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
};
|
|
1447
1461
|
function Section({ section, ...props }) {
|
|
1448
1462
|
const uid = useId6();
|
|
1449
1463
|
return /* @__PURE__ */ jsxs13("div", { className: "ui-nav__section", children: [
|
|
@@ -1463,6 +1477,10 @@ var SidebarNav = forwardRef7(function SidebarNav2({
|
|
|
1463
1477
|
"aria-label": label = "Sidebar",
|
|
1464
1478
|
...rest
|
|
1465
1479
|
}, ref) {
|
|
1480
|
+
const mixed = !!sections?.some((section) => section.label) && sections.some((section) => section.items.some((item) => item.items?.length));
|
|
1481
|
+
useEffect6(() => {
|
|
1482
|
+
if (mixed && development()) console.warn("SidebarNav: a sidebar takes group labels or sub-items, never both. Drop the labels or the sub-items.");
|
|
1483
|
+
}, [mixed]);
|
|
1466
1484
|
return /* @__PURE__ */ jsxs13("nav", { ...rest, ref, "aria-label": label, className: ["ui-nav", "ui-nav--side", collapsed && "is-collapsed", className].filter(Boolean).join(" "), children: [
|
|
1467
1485
|
(sections?.length ? sections : [{ items }]).map((section, index) => /* @__PURE__ */ jsx17(
|
|
1468
1486
|
Section,
|
|
@@ -1745,7 +1763,7 @@ function Drawer({
|
|
|
1745
1763
|
// src/CommandPalette.tsx
|
|
1746
1764
|
import { useCallback as useCallback3, useEffect as useEffect9, useId as useId10, useMemo as useMemo2, useRef as useRef11, useState as useState8 } from "react";
|
|
1747
1765
|
import { createPortal as createPortal5 } from "react-dom";
|
|
1748
|
-
import { rankGroups, icon as icon3 } from "@apliteni/apliteni-ui";
|
|
1766
|
+
import { rankGroups, icon as icon3, safeUrl as safeUrl4 } from "@apliteni/apliteni-ui";
|
|
1749
1767
|
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1750
1768
|
var cx2 = (...a) => a.filter(Boolean).join(" ");
|
|
1751
1769
|
var Glyph = ({ name, className }) => /* @__PURE__ */ jsx21("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon3(name) } });
|
|
@@ -1795,9 +1813,11 @@ function CommandPalette({
|
|
|
1795
1813
|
}
|
|
1796
1814
|
onClose();
|
|
1797
1815
|
if (!item.href) return;
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1816
|
+
const href = safeUrl4(item.href, "");
|
|
1817
|
+
if (!href) return;
|
|
1818
|
+
if (newTab) window.open(href, "_blank", "noopener");
|
|
1819
|
+
else if (onNavigate) onNavigate(href);
|
|
1820
|
+
else window.location.href = href;
|
|
1801
1821
|
}, [onClose, onSelect, onNavigate]);
|
|
1802
1822
|
const onKeyDown = (e) => {
|
|
1803
1823
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
@@ -2237,6 +2257,28 @@ function DataTable({
|
|
|
2237
2257
|
measure();
|
|
2238
2258
|
return () => observer.disconnect();
|
|
2239
2259
|
}, [pagerHost, columns, rows]);
|
|
2260
|
+
const frame = useRef13(null);
|
|
2261
|
+
const [overflows, setOverflows] = useState10(true);
|
|
2262
|
+
useEffect11(() => {
|
|
2263
|
+
const box = frame.current;
|
|
2264
|
+
const el = table.current;
|
|
2265
|
+
if (!box || !el || typeof ResizeObserver === "undefined") return;
|
|
2266
|
+
const read = () => setOverflows(
|
|
2267
|
+
box.scrollWidth > box.clientWidth || box.scrollHeight > box.clientHeight
|
|
2268
|
+
);
|
|
2269
|
+
const observer = new ResizeObserver(read);
|
|
2270
|
+
observer.observe(box);
|
|
2271
|
+
observer.observe(el);
|
|
2272
|
+
read();
|
|
2273
|
+
return () => observer.disconnect();
|
|
2274
|
+
}, [scrollable]);
|
|
2275
|
+
const pressed = useRef13(false);
|
|
2276
|
+
const reveal = (e) => {
|
|
2277
|
+
if (!pressed.current) e.target.scrollIntoView?.({ block: "nearest", inline: "nearest" });
|
|
2278
|
+
};
|
|
2279
|
+
const press = (down) => () => {
|
|
2280
|
+
pressed.current = down;
|
|
2281
|
+
};
|
|
2240
2282
|
const [localSort, setLocalSort] = useState10(
|
|
2241
2283
|
{ key: columns.find((c) => c.sortable)?.key, dir: -1 }
|
|
2242
2284
|
);
|
|
@@ -2291,7 +2333,7 @@ function DataTable({
|
|
|
2291
2333
|
const pageAllOn = selectable && slice.length > 0 && slice.every((r) => selected.has(r.name));
|
|
2292
2334
|
const pageSomeOn = selectable && !pageAllOn && slice.some((r) => selected.has(r.name));
|
|
2293
2335
|
return /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
2294
|
-
/* @__PURE__ */ jsx23(Wrap, { ...scrollable ? { className: "ui-table-scroll", role: "region", "aria-label": scrollLabel, tabIndex: 0 } : {}, children: /* @__PURE__ */ jsxs19(
|
|
2336
|
+
/* @__PURE__ */ jsx23(Wrap, { ...scrollable ? { ref: frame, className: "ui-table-scroll", role: "region", "aria-label": scrollLabel, tabIndex: overflows ? 0 : void 0, onFocus: reveal, onPointerDown: press(true), onPointerUp: press(false), onPointerCancel: press(false) } : {}, children: /* @__PURE__ */ jsxs19(
|
|
2295
2337
|
"table",
|
|
2296
2338
|
{
|
|
2297
2339
|
ref: table,
|
|
@@ -3181,6 +3223,7 @@ function Dropdown({
|
|
|
3181
3223
|
const uid = id ?? auto;
|
|
3182
3224
|
const inField = useContext3(FieldContext);
|
|
3183
3225
|
const fieldName = inField && id === inField.id && !(ariaLabel && triggerContent != null) ? { id: `${uid}-trigger`, labelId: inField.labelId, labelledBy: `${inField.labelId} ${uid}-trigger` } : null;
|
|
3226
|
+
const byContent = !fieldName && !ariaLabel && triggerContent != null ? `${uid}-trigger` : void 0;
|
|
3184
3227
|
const setOpen = useCallback6((next) => {
|
|
3185
3228
|
if (openProp === void 0) setSelfOpen(next);
|
|
3186
3229
|
onOpenChange?.(next);
|
|
@@ -3610,7 +3653,7 @@ function Dropdown({
|
|
|
3610
3653
|
disabled: disabled || void 0,
|
|
3611
3654
|
"aria-haspopup": sx ? "dialog" : listRole,
|
|
3612
3655
|
"aria-expanded": open,
|
|
3613
|
-
id: fieldName?.id,
|
|
3656
|
+
id: fieldName?.id ?? byContent,
|
|
3614
3657
|
"aria-label": ariaLabel && triggerContent != null ? ariaLabel : void 0,
|
|
3615
3658
|
title,
|
|
3616
3659
|
"aria-labelledby": fieldName?.labelledBy,
|
|
@@ -3645,7 +3688,7 @@ function Dropdown({
|
|
|
3645
3688
|
"data-dropdown-panel": "",
|
|
3646
3689
|
role: sx ? "dialog" : listRole,
|
|
3647
3690
|
"aria-label": sx ? name : ariaLabel,
|
|
3648
|
-
"aria-labelledby": !sx && !ariaLabel ? fieldName?.labelId : void 0,
|
|
3691
|
+
"aria-labelledby": !sx && !ariaLabel ? fieldName?.labelId ?? byContent : void 0,
|
|
3649
3692
|
style: sx ? void 0 : cap,
|
|
3650
3693
|
ref: panel,
|
|
3651
3694
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -4962,7 +5005,6 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
|
|
|
4962
5005
|
align: "start",
|
|
4963
5006
|
chevron: true,
|
|
4964
5007
|
open,
|
|
4965
|
-
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4966
5008
|
triggerClass: "ui-app__user-trigger",
|
|
4967
5009
|
panelClass: `ui-app__user-panel${sub && inPlace ? " is-sub" : ""}`,
|
|
4968
5010
|
onOpenChange: (next) => {
|
|
@@ -4970,8 +5012,9 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
|
|
|
4970
5012
|
if (!next) setSub(false);
|
|
4971
5013
|
},
|
|
4972
5014
|
triggerContent: /* @__PURE__ */ jsxs36(Fragment18, { children: [
|
|
5015
|
+
/* @__PURE__ */ jsx40("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
|
|
4973
5016
|
/* @__PURE__ */ jsx40("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx40(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
|
|
4974
|
-
/* @__PURE__ */ jsxs36("span", { className: "ui-app__who", children: [
|
|
5017
|
+
/* @__PURE__ */ jsxs36("span", { className: "ui-app__who", "aria-hidden": "true", children: [
|
|
4975
5018
|
/* @__PURE__ */ jsx40("b", { children: account.name }),
|
|
4976
5019
|
/* @__PURE__ */ jsx40("span", { children: account.email })
|
|
4977
5020
|
] })
|
|
@@ -5020,6 +5063,7 @@ import { Fragment as Fragment19, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-
|
|
|
5020
5063
|
var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
|
|
5021
5064
|
function AppShell({
|
|
5022
5065
|
sections,
|
|
5066
|
+
groups,
|
|
5023
5067
|
pathname,
|
|
5024
5068
|
title,
|
|
5025
5069
|
children,
|
|
@@ -5053,8 +5097,10 @@ function AppShell({
|
|
|
5053
5097
|
const firstRow = useMemo5(() => ({ get current() {
|
|
5054
5098
|
return menuBody.current?.querySelector(".ui-nav__item") ?? null;
|
|
5055
5099
|
} }), []);
|
|
5100
|
+
const rows = groups ? groups.flatMap((group) => group.sections) : sections;
|
|
5101
|
+
const links = rows.flatMap((row2) => row2.items?.length ? row2.items : [row2]);
|
|
5056
5102
|
const current = path(pathname);
|
|
5057
|
-
const active =
|
|
5103
|
+
const active = links.filter((link) => current === path(link.href) || path(link.href) !== "/" && current.startsWith(`${path(link.href)}/`)).sort((a, b) => path(b.href).length - path(a.href).length)[0];
|
|
5058
5104
|
useEffect19(() => {
|
|
5059
5105
|
setCollapsed(railCollapsed() ?? defaultCollapsed);
|
|
5060
5106
|
}, [defaultCollapsed]);
|
|
@@ -5088,15 +5134,17 @@ function AppShell({
|
|
|
5088
5134
|
setCollapsed(next);
|
|
5089
5135
|
storeRailCollapsed(next);
|
|
5090
5136
|
};
|
|
5137
|
+
const row = ({ href, label, icon: icon9, count }) => ({ id: href, href, label, icon: icon9, badge: layout === "rail" ? void 0 : count });
|
|
5138
|
+
const nav = groups ? groups.map((group) => ({ label: group.label, items: group.sections.map(row) })) : [{ items: sections.map((section) => ({ ...row(section), items: section.items?.map(row) })) }];
|
|
5091
5139
|
const sidebar = (label) => /* @__PURE__ */ jsx41(
|
|
5092
5140
|
SidebarNav,
|
|
5093
5141
|
{
|
|
5094
5142
|
"aria-label": label,
|
|
5095
|
-
|
|
5143
|
+
sections: nav,
|
|
5096
5144
|
active: active?.href,
|
|
5097
5145
|
activeIs: back ? "section" : "page",
|
|
5098
5146
|
renderLink: (item, props) => {
|
|
5099
|
-
const section =
|
|
5147
|
+
const section = links.find((link) => link.href === item.id);
|
|
5100
5148
|
const linkProps = { ...props, onClick: (event) => {
|
|
5101
5149
|
if (!event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey) setMenu(false);
|
|
5102
5150
|
} };
|
|
@@ -5105,7 +5153,7 @@ function AppShell({
|
|
|
5105
5153
|
}
|
|
5106
5154
|
);
|
|
5107
5155
|
const foldLabel = collapsed ? "Expand sidebar" : "Collapse sidebar";
|
|
5108
|
-
const navigable =
|
|
5156
|
+
const navigable = links.length > 1 || Boolean(back);
|
|
5109
5157
|
const lockup = /* @__PURE__ */ jsxs37("a", { className: "ui-app__brand", href: brandHref, "aria-label": word, children: [
|
|
5110
5158
|
brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
|
|
5111
5159
|
/* @__PURE__ */ jsx41("span", { children: word })
|
|
@@ -5244,11 +5292,13 @@ function AppShell({
|
|
|
5244
5292
|
variant: "menu",
|
|
5245
5293
|
align: "end",
|
|
5246
5294
|
chevron: false,
|
|
5247
|
-
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
5248
5295
|
title: `Signed in as ${account.name}, ${account.email}`,
|
|
5249
5296
|
triggerClass: "ui-app__user-trigger",
|
|
5250
5297
|
panelClass: "ui-app__user-panel",
|
|
5251
|
-
triggerContent: /* @__PURE__ */
|
|
5298
|
+
triggerContent: /* @__PURE__ */ jsxs37(Fragment19, { children: [
|
|
5299
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
|
|
5300
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) })
|
|
5301
|
+
] }),
|
|
5252
5302
|
header: /* @__PURE__ */ jsxs37("div", { className: "ui-dropdown__head", children: [
|
|
5253
5303
|
/* @__PURE__ */ jsx41("b", { children: account.name }),
|
|
5254
5304
|
/* @__PURE__ */ jsx41("span", { children: account.email })
|
|
@@ -5278,7 +5328,7 @@ function AppShell({
|
|
|
5278
5328
|
] })
|
|
5279
5329
|
}
|
|
5280
5330
|
),
|
|
5281
|
-
/* @__PURE__ */ jsx41(CommandPalette, { ...palette ?? { groups:
|
|
5331
|
+
/* @__PURE__ */ jsx41(CommandPalette, { ...palette ?? { groups: groups ? groups.map((group) => ({ label: group.label, items: group.sections.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 })) })) : [{ items: sections.flatMap((section) => section.items?.length ? section.items.map(({ href, label, icon: icon9 }) => ({ id: href, href, label, icon: icon9 ?? section.icon, description: section.label })) : [{ id: section.href, href: section.href, label: section.label, icon: section.icon }]) }] }, onNavigate: palette?.onNavigate ?? onNavigate, open: search, onClose: () => setSearch(false) })
|
|
5282
5332
|
] });
|
|
5283
5333
|
}
|
|
5284
5334
|
|
|
@@ -5294,7 +5344,7 @@ var AuthShell = forwardRef10(function AuthShell2({ brand, children, className, .
|
|
|
5294
5344
|
|
|
5295
5345
|
// src/Footer.tsx
|
|
5296
5346
|
import { useId as useId15 } from "react";
|
|
5297
|
-
import { prism as prism2, safeUrl as
|
|
5347
|
+
import { prism as prism2, safeUrl as safeUrl5 } from "@apliteni/apliteni-ui";
|
|
5298
5348
|
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5299
5349
|
var SOCIAL_GLYPHS = {
|
|
5300
5350
|
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"/>',
|
|
@@ -5306,7 +5356,7 @@ var escapeText = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/
|
|
|
5306
5356
|
function Legal({ legal, legalLinks, switcher }) {
|
|
5307
5357
|
return /* @__PURE__ */ jsxs39("div", { className: "ui-footer__bar", children: [
|
|
5308
5358
|
/* @__PURE__ */ jsx43("span", { className: "ui-footer__legal", children: legal }),
|
|
5309
|
-
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:
|
|
5359
|
+
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: safeUrl5(to ?? "#"), children: label }, label)) }),
|
|
5310
5360
|
switcher ? /* @__PURE__ */ jsx43("div", { className: "ui-footer__switcher", children: switcher }) : null
|
|
5311
5361
|
] });
|
|
5312
5362
|
}
|
|
@@ -5336,7 +5386,7 @@ function Footer({
|
|
|
5336
5386
|
"a",
|
|
5337
5387
|
{
|
|
5338
5388
|
className: "brand",
|
|
5339
|
-
href:
|
|
5389
|
+
href: safeUrl5(brandHref),
|
|
5340
5390
|
"aria-label": `Apliteni ${word}`,
|
|
5341
5391
|
dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
|
|
5342
5392
|
}
|
|
@@ -5350,24 +5400,69 @@ function Footer({
|
|
|
5350
5400
|
const markup = SOCIAL_GLYPHS[icon9];
|
|
5351
5401
|
const fill = icon9 === "mail" ? "none" : "currentColor";
|
|
5352
5402
|
const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
|
|
5353
|
-
return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href:
|
|
5403
|
+
return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href: safeUrl5(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx43("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
|
|
5354
5404
|
}) })
|
|
5355
5405
|
] }),
|
|
5356
5406
|
(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: [
|
|
5357
5407
|
title && /* @__PURE__ */ jsx43("h2", { className: "ui-footer__col-title", children: title }),
|
|
5358
|
-
/* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href:
|
|
5408
|
+
/* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href: safeUrl5(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
|
|
5359
5409
|
] }, title ?? i)) })
|
|
5360
5410
|
] }),
|
|
5361
5411
|
bar
|
|
5362
5412
|
] }) });
|
|
5363
5413
|
}
|
|
5364
5414
|
|
|
5415
|
+
// src/ThemeChoice.tsx
|
|
5416
|
+
import { useId as useId16 } from "react";
|
|
5417
|
+
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5418
|
+
var OPTIONS = [
|
|
5419
|
+
{ value: "auto", name: "System" },
|
|
5420
|
+
{ value: "light", name: "Light" },
|
|
5421
|
+
{ value: "dark", name: "Dark" }
|
|
5422
|
+
];
|
|
5423
|
+
var Scene = ({ theme }) => /* @__PURE__ */ jsxs40("span", { className: `ui-theme-choice__scene ui-theme-choice__scene--${theme}`, children: [
|
|
5424
|
+
/* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__rail", children: [
|
|
5425
|
+
/* @__PURE__ */ jsx44("span", {}),
|
|
5426
|
+
/* @__PURE__ */ jsx44("span", {}),
|
|
5427
|
+
/* @__PURE__ */ jsx44("span", {})
|
|
5428
|
+
] }),
|
|
5429
|
+
/* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__main", children: [
|
|
5430
|
+
/* @__PURE__ */ jsx44("span", { className: "ui-theme-choice__title" }),
|
|
5431
|
+
/* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__card", children: [
|
|
5432
|
+
/* @__PURE__ */ jsx44("span", {}),
|
|
5433
|
+
/* @__PURE__ */ jsx44("span", {})
|
|
5434
|
+
] })
|
|
5435
|
+
] })
|
|
5436
|
+
] });
|
|
5437
|
+
function ThemeChoice({ label = "Theme" }) {
|
|
5438
|
+
const { theme, set } = useThemeChoice();
|
|
5439
|
+
const name = useId16();
|
|
5440
|
+
return /* @__PURE__ */ jsx44("div", { className: "ui-theme-choice", role: "radiogroup", "aria-label": label, children: OPTIONS.map(({ value, name: text2 }) => /* @__PURE__ */ jsxs40("label", { className: "ui-theme-choice__option", children: [
|
|
5441
|
+
/* @__PURE__ */ jsx44(
|
|
5442
|
+
"input",
|
|
5443
|
+
{
|
|
5444
|
+
type: "radio",
|
|
5445
|
+
className: "ui-theme-choice__input ui-sr",
|
|
5446
|
+
name,
|
|
5447
|
+
value,
|
|
5448
|
+
checked: theme === value,
|
|
5449
|
+
onChange: () => set(value)
|
|
5450
|
+
}
|
|
5451
|
+
),
|
|
5452
|
+
/* @__PURE__ */ jsxs40("span", { className: "ui-theme-choice__pic", "aria-hidden": "true", children: [
|
|
5453
|
+
value === "dark" ? /* @__PURE__ */ jsx44(Scene, { theme: "dark" }) : /* @__PURE__ */ jsx44(Scene, { theme: "light" }),
|
|
5454
|
+
value === "auto" && /* @__PURE__ */ jsx44(Scene, { theme: "dark" })
|
|
5455
|
+
] }),
|
|
5456
|
+
/* @__PURE__ */ jsx44("span", { className: "ui-theme-choice__name", children: text2 })
|
|
5457
|
+
] }, value)) });
|
|
5458
|
+
}
|
|
5459
|
+
|
|
5365
5460
|
// src/Success.tsx
|
|
5366
5461
|
import { forwardRef as forwardRef11, useEffect as useEffect20, useRef as useRef24, useState as useState20 } from "react";
|
|
5367
|
-
import { jsx as
|
|
5462
|
+
import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5368
5463
|
var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
|
|
5369
5464
|
const circled = variant === "circled";
|
|
5370
|
-
return /* @__PURE__ */
|
|
5465
|
+
return /* @__PURE__ */ jsxs41(
|
|
5371
5466
|
"svg",
|
|
5372
5467
|
{
|
|
5373
5468
|
...rest,
|
|
@@ -5379,18 +5474,18 @@ var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", class
|
|
|
5379
5474
|
"aria-hidden": "true",
|
|
5380
5475
|
focusable: "false",
|
|
5381
5476
|
children: [
|
|
5382
|
-
circled && /* @__PURE__ */
|
|
5383
|
-
/* @__PURE__ */
|
|
5477
|
+
circled && /* @__PURE__ */ jsx45("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
5478
|
+
/* @__PURE__ */ jsx45("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
|
|
5384
5479
|
]
|
|
5385
5480
|
}
|
|
5386
5481
|
);
|
|
5387
5482
|
});
|
|
5388
5483
|
var SuccessPanel = forwardRef11(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
|
|
5389
5484
|
const circled = check === "circled";
|
|
5390
|
-
return /* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
sub && /* @__PURE__ */
|
|
5485
|
+
return /* @__PURE__ */ jsxs41("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
|
|
5486
|
+
/* @__PURE__ */ jsx45("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx45(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
|
|
5487
|
+
/* @__PURE__ */ jsx45("div", { className: "ui-success__title", children: title }),
|
|
5488
|
+
sub && /* @__PURE__ */ jsx45("div", { className: "ui-success__sub", children: sub })
|
|
5394
5489
|
] });
|
|
5395
5490
|
});
|
|
5396
5491
|
var pieces = [
|
|
@@ -5427,12 +5522,12 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
|
5427
5522
|
}, 1e3);
|
|
5428
5523
|
return () => clearInterval(timer);
|
|
5429
5524
|
}, [seconds]);
|
|
5430
|
-
return /* @__PURE__ */
|
|
5431
|
-
/* @__PURE__ */
|
|
5432
|
-
/* @__PURE__ */
|
|
5525
|
+
return /* @__PURE__ */ jsxs41("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
|
|
5526
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
|
|
5527
|
+
/* @__PURE__ */ jsxs41("span", { className: "ui-sx__count-text", children: [
|
|
5433
5528
|
label,
|
|
5434
5529
|
" in ",
|
|
5435
|
-
/* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ jsx45("b", { "data-sx-num": "", children: remaining }),
|
|
5436
5531
|
"s"
|
|
5437
5532
|
] })
|
|
5438
5533
|
] });
|
|
@@ -5459,7 +5554,7 @@ var Success = forwardRef11(function Success2({
|
|
|
5459
5554
|
const seconds = countdown?.seconds;
|
|
5460
5555
|
const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
|
|
5461
5556
|
const mark = check === "circled" ? "circled" : "line";
|
|
5462
|
-
return /* @__PURE__ */
|
|
5557
|
+
return /* @__PURE__ */ jsxs41(
|
|
5463
5558
|
"div",
|
|
5464
5559
|
{
|
|
5465
5560
|
role: "status",
|
|
@@ -5468,16 +5563,16 @@ var Success = forwardRef11(function Success2({
|
|
|
5468
5563
|
ref,
|
|
5469
5564
|
className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
|
|
5470
5565
|
children: [
|
|
5471
|
-
confetti && /* @__PURE__ */
|
|
5472
|
-
([x, d, r, t, s], index) => /* @__PURE__ */
|
|
5566
|
+
confetti && /* @__PURE__ */ jsx45("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
|
|
5567
|
+
([x, d, r, t, s], index) => /* @__PURE__ */ jsx45("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
|
|
5473
5568
|
) }),
|
|
5474
|
-
/* @__PURE__ */
|
|
5475
|
-
/* @__PURE__ */
|
|
5476
|
-
/* @__PURE__ */
|
|
5477
|
-
/* @__PURE__ */
|
|
5478
|
-
body && /* @__PURE__ */
|
|
5479
|
-
hasActions && /* @__PURE__ */
|
|
5480
|
-
countdown && /* @__PURE__ */
|
|
5569
|
+
/* @__PURE__ */ jsxs41("div", { className: "ui-sx__inner", children: [
|
|
5570
|
+
/* @__PURE__ */ jsx45("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx45(SuccessCheck, { variant: mark }) }),
|
|
5571
|
+
/* @__PURE__ */ jsxs41("div", { className: "ui-sx__content", children: [
|
|
5572
|
+
/* @__PURE__ */ jsx45(Heading, { className: "ui-sx__title", children: title }),
|
|
5573
|
+
body && /* @__PURE__ */ jsx45("p", { className: "ui-sx__body", children: body }),
|
|
5574
|
+
hasActions && /* @__PURE__ */ jsx45("div", { className: "ui-sx__actions", children: actions }),
|
|
5575
|
+
countdown && /* @__PURE__ */ jsx45(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
|
|
5481
5576
|
] })
|
|
5482
5577
|
] })
|
|
5483
5578
|
]
|
|
@@ -5490,7 +5585,7 @@ import {
|
|
|
5490
5585
|
useCallback as useCallback8,
|
|
5491
5586
|
useContext as useContext5,
|
|
5492
5587
|
useEffect as useEffect21,
|
|
5493
|
-
useId as
|
|
5588
|
+
useId as useId17,
|
|
5494
5589
|
useLayoutEffect as useLayoutEffect5,
|
|
5495
5590
|
useMemo as useMemo6,
|
|
5496
5591
|
useRef as useRef25,
|
|
@@ -5500,7 +5595,7 @@ import { createPortal as createPortal8 } from "react-dom";
|
|
|
5500
5595
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
5501
5596
|
|
|
5502
5597
|
// src/chart-looks.tsx
|
|
5503
|
-
import { Fragment as Fragment20, jsx as
|
|
5598
|
+
import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5504
5599
|
var LOOK_DEFAULT = {
|
|
5505
5600
|
line: "thin",
|
|
5506
5601
|
area: "stacked",
|
|
@@ -5722,7 +5817,7 @@ function linesDrawing(g, open) {
|
|
|
5722
5817
|
const [a, b] = [run[0], run[run.length - 1]];
|
|
5723
5818
|
return `M${px(centre(a))} ${px(y(layer.from[a]))}L${px(centre(a))} ${px(y(at(layer, a)))}${run.slice(0, -1).map((i) => bend(k, i)).join("")}L${px(centre(b))} ${px(y(layer.from[b]))}Z`;
|
|
5724
5819
|
}).join("");
|
|
5725
|
-
return d && /* @__PURE__ */
|
|
5820
|
+
return d && /* @__PURE__ */ jsx46(
|
|
5726
5821
|
"path",
|
|
5727
5822
|
{
|
|
5728
5823
|
className: cx8("ui-chart__area", tone(layer.tone)),
|
|
@@ -5732,7 +5827,7 @@ function linesDrawing(g, open) {
|
|
|
5732
5827
|
`fill-${layer.id}`
|
|
5733
5828
|
);
|
|
5734
5829
|
}
|
|
5735
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ jsx46(
|
|
5736
5831
|
"path",
|
|
5737
5832
|
{
|
|
5738
5833
|
className: cx8(look.share ? "ui-chart__segment" : "ui-chart__area", tone(layer.tone)),
|
|
@@ -5742,7 +5837,7 @@ function linesDrawing(g, open) {
|
|
|
5742
5837
|
`fill-${layer.id}`
|
|
5743
5838
|
);
|
|
5744
5839
|
});
|
|
5745
|
-
const edges = curves ? look.layers.flatMap((layer, k) => layer.to.slice(1).map((_, i) => finite(layer, i) && finite(layer, i + 1) ? /* @__PURE__ */
|
|
5840
|
+
const edges = curves ? look.layers.flatMap((layer, k) => layer.to.slice(1).map((_, i) => finite(layer, i) && finite(layer, i + 1) ? /* @__PURE__ */ jsx46(
|
|
5746
5841
|
"path",
|
|
5747
5842
|
{
|
|
5748
5843
|
className: cx8(
|
|
@@ -5753,7 +5848,7 @@ function linesDrawing(g, open) {
|
|
|
5753
5848
|
d: `M${px(centre(i))} ${px(y(at(layer, i)))}${bend(k, i)}`
|
|
5754
5849
|
},
|
|
5755
5850
|
`edge-${layer.id}-${i}`
|
|
5756
|
-
) : null)) : !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */
|
|
5851
|
+
) : null)) : !look.share && look.layers.flatMap((layer) => layer.to.slice(1).map((_, k) => finite(layer, k) && finite(layer, k + 1) ? /* @__PURE__ */ jsx46(
|
|
5757
5852
|
"line",
|
|
5758
5853
|
{
|
|
5759
5854
|
className: cx8(
|
|
@@ -5775,7 +5870,7 @@ function linesDrawing(g, open) {
|
|
|
5775
5870
|
const shown = i === open || points || lonely && !look.share;
|
|
5776
5871
|
if (!shown || look.share && i !== open) return null;
|
|
5777
5872
|
if (look.share && layer !== look.layers[look.layers.length - 1]) return null;
|
|
5778
|
-
return /* @__PURE__ */
|
|
5873
|
+
return /* @__PURE__ */ jsx46(
|
|
5779
5874
|
"circle",
|
|
5780
5875
|
{
|
|
5781
5876
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5803,8 +5898,8 @@ function linesDrawing(g, open) {
|
|
|
5803
5898
|
base = at2 + Math.max(drop, fall + gap + ascent);
|
|
5804
5899
|
}
|
|
5805
5900
|
}
|
|
5806
|
-
return /* @__PURE__ */
|
|
5807
|
-
/* @__PURE__ */
|
|
5901
|
+
return /* @__PURE__ */ jsxs42("g", { children: [
|
|
5902
|
+
/* @__PURE__ */ jsx46(
|
|
5808
5903
|
"circle",
|
|
5809
5904
|
{
|
|
5810
5905
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5813,7 +5908,7 @@ function linesDrawing(g, open) {
|
|
|
5813
5908
|
r: "4"
|
|
5814
5909
|
}
|
|
5815
5910
|
),
|
|
5816
|
-
/* @__PURE__ */
|
|
5911
|
+
/* @__PURE__ */ jsx46(
|
|
5817
5912
|
"text",
|
|
5818
5913
|
{
|
|
5819
5914
|
className: "ui-chart__text ui-chart__text--strong",
|
|
@@ -5825,8 +5920,8 @@ function linesDrawing(g, open) {
|
|
|
5825
5920
|
)
|
|
5826
5921
|
] }, `end-${layer.id}`);
|
|
5827
5922
|
});
|
|
5828
|
-
return /* @__PURE__ */
|
|
5829
|
-
ramps.some(Boolean) && /* @__PURE__ */
|
|
5923
|
+
return /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
5924
|
+
ramps.some(Boolean) && /* @__PURE__ */ jsx46("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs42(
|
|
5830
5925
|
"linearGradient",
|
|
5831
5926
|
{
|
|
5832
5927
|
id: ramp.id,
|
|
@@ -5837,14 +5932,14 @@ function linesDrawing(g, open) {
|
|
|
5837
5932
|
y1: px(y(ramp.lo)),
|
|
5838
5933
|
y2: px(y(ramp.hi)),
|
|
5839
5934
|
children: [
|
|
5840
|
-
/* @__PURE__ */
|
|
5841
|
-
/* @__PURE__ */
|
|
5935
|
+
/* @__PURE__ */ jsx46("stop", { className: curves ? "ui-chart__wash-floor" : "ui-chart__fade-base", offset: "0" }),
|
|
5936
|
+
/* @__PURE__ */ jsx46("stop", { className: curves ? "ui-chart__wash-top" : "ui-chart__fade-end", offset: "1" })
|
|
5842
5937
|
]
|
|
5843
5938
|
},
|
|
5844
5939
|
ramp.id
|
|
5845
5940
|
)) }),
|
|
5846
5941
|
fills,
|
|
5847
|
-
open !== null && /* @__PURE__ */
|
|
5942
|
+
open !== null && /* @__PURE__ */ jsx46(
|
|
5848
5943
|
"line",
|
|
5849
5944
|
{
|
|
5850
5945
|
className: "ui-chart__cross",
|
|
@@ -5869,7 +5964,7 @@ function columnsDrawing(g) {
|
|
|
5869
5964
|
const y1 = y(layer.to[i]);
|
|
5870
5965
|
const x = centre(i) - w / 2;
|
|
5871
5966
|
const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, 4) : square(x, y1, w, y0 - y1);
|
|
5872
|
-
return /* @__PURE__ */
|
|
5967
|
+
return /* @__PURE__ */ jsx46(
|
|
5873
5968
|
"path",
|
|
5874
5969
|
{
|
|
5875
5970
|
className: cx8("ui-chart__segment", tone(layer.tone), label.estimated && "is-estimated"),
|
|
@@ -5884,10 +5979,10 @@ function rowsDrawing(g, pick) {
|
|
|
5884
5979
|
const { look, labels, format, formatAxis, scale } = g;
|
|
5885
5980
|
const rows = rowsOf(g);
|
|
5886
5981
|
const bottom = rows.row * labels.length;
|
|
5887
|
-
return /* @__PURE__ */
|
|
5888
|
-
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */
|
|
5889
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
5890
|
-
/* @__PURE__ */
|
|
5982
|
+
return /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
5983
|
+
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx46("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
|
|
5984
|
+
scale.ticks.map((tick) => /* @__PURE__ */ jsxs42("g", { children: [
|
|
5985
|
+
/* @__PURE__ */ jsx46(
|
|
5891
5986
|
"line",
|
|
5892
5987
|
{
|
|
5893
5988
|
className: tick === 0 ? "ui-chart__zero" : "ui-chart__grid",
|
|
@@ -5897,7 +5992,7 @@ function rowsDrawing(g, pick) {
|
|
|
5897
5992
|
y2: px(bottom)
|
|
5898
5993
|
}
|
|
5899
5994
|
),
|
|
5900
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx46(
|
|
5901
5996
|
"text",
|
|
5902
5997
|
{
|
|
5903
5998
|
className: "ui-chart__caption",
|
|
@@ -5912,8 +6007,8 @@ function rowsDrawing(g, pick) {
|
|
|
5912
6007
|
labels.map((label, i) => {
|
|
5913
6008
|
const top = rows.top(i);
|
|
5914
6009
|
const filled = look.layers.filter((l) => l.to[i] > l.from[i]);
|
|
5915
|
-
return /* @__PURE__ */
|
|
5916
|
-
/* @__PURE__ */
|
|
6010
|
+
return /* @__PURE__ */ jsxs42("g", { children: [
|
|
6011
|
+
/* @__PURE__ */ jsx46(
|
|
5917
6012
|
"text",
|
|
5918
6013
|
{
|
|
5919
6014
|
className: "ui-chart__caption",
|
|
@@ -5928,7 +6023,7 @@ function rowsDrawing(g, pick) {
|
|
|
5928
6023
|
const x0 = rows.x(layer.from[i]);
|
|
5929
6024
|
const x1 = rows.x(layer.to[i]);
|
|
5930
6025
|
const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, 4) : square(x0, top, x1 - x0, ROW_BAR);
|
|
5931
|
-
return /* @__PURE__ */
|
|
6026
|
+
return /* @__PURE__ */ jsx46(
|
|
5932
6027
|
"path",
|
|
5933
6028
|
{
|
|
5934
6029
|
d,
|
|
@@ -5937,7 +6032,7 @@ function rowsDrawing(g, pick) {
|
|
|
5937
6032
|
`seg-${layer.id}`
|
|
5938
6033
|
);
|
|
5939
6034
|
}),
|
|
5940
|
-
/* @__PURE__ */
|
|
6035
|
+
/* @__PURE__ */ jsx46(
|
|
5941
6036
|
"text",
|
|
5942
6037
|
{
|
|
5943
6038
|
className: "ui-chart__text",
|
|
@@ -5955,8 +6050,8 @@ function ringDrawing(g) {
|
|
|
5955
6050
|
const { look, format } = g;
|
|
5956
6051
|
const ring = ringOf(g);
|
|
5957
6052
|
const total = look.totals[0];
|
|
5958
|
-
return /* @__PURE__ */
|
|
5959
|
-
look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */
|
|
6053
|
+
return /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
6054
|
+
look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx46(
|
|
5960
6055
|
"path",
|
|
5961
6056
|
{
|
|
5962
6057
|
className: cx8("ui-chart__segment", tone(slice.tone)),
|
|
@@ -5964,42 +6059,42 @@ function ringDrawing(g) {
|
|
|
5964
6059
|
},
|
|
5965
6060
|
`slice-${slice.id}`
|
|
5966
6061
|
)),
|
|
5967
|
-
look.look === "thin" && /* @__PURE__ */
|
|
5968
|
-
/* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
6062
|
+
look.look === "thin" && /* @__PURE__ */ jsxs42("g", { "aria-hidden": "true", children: [
|
|
6063
|
+
/* @__PURE__ */ jsx46("text", { className: "ui-chart__total", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 2), children: format(total) }),
|
|
6064
|
+
/* @__PURE__ */ jsx46("text", { className: "ui-chart__caption", textAnchor: "middle", x: px(ring.x), y: px(ring.y + 22), children: look.totalLabel })
|
|
5970
6065
|
] }),
|
|
5971
6066
|
look.look === "labels" && look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => {
|
|
5972
6067
|
const mid = angle((slice.from[0] + slice.to[0]) / 2);
|
|
5973
6068
|
const x = ring.x + (ring.r + 14) * Math.cos(mid);
|
|
5974
6069
|
const y = ring.y + (ring.r + 14) * Math.sin(mid);
|
|
5975
6070
|
const anchor = Math.cos(mid) >= 0 ? "start" : "end";
|
|
5976
|
-
return /* @__PURE__ */
|
|
5977
|
-
/* @__PURE__ */
|
|
5978
|
-
/* @__PURE__ */
|
|
6071
|
+
return /* @__PURE__ */ jsxs42("g", { "aria-hidden": "true", children: [
|
|
6072
|
+
/* @__PURE__ */ jsx46("text", { className: "ui-chart__text ui-chart__text--strong", textAnchor: anchor, x: px(x), y: px(y - 2), children: slice.name }),
|
|
6073
|
+
/* @__PURE__ */ jsx46("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])}` })
|
|
5979
6074
|
] }, `label-${slice.id}`);
|
|
5980
6075
|
})
|
|
5981
6076
|
] });
|
|
5982
6077
|
}
|
|
5983
6078
|
function Shares({ look, format, swatch }) {
|
|
5984
6079
|
const total = look.totals[0];
|
|
5985
|
-
return /* @__PURE__ */
|
|
5986
|
-
look.layers.map((slice) => /* @__PURE__ */
|
|
6080
|
+
return /* @__PURE__ */ jsxs42("ul", { className: "ui-chart__shares", "aria-hidden": "true", children: [
|
|
6081
|
+
look.layers.map((slice) => /* @__PURE__ */ jsxs42("li", { className: tone(slice.tone), children: [
|
|
5987
6082
|
swatch,
|
|
5988
|
-
/* @__PURE__ */
|
|
5989
|
-
/* @__PURE__ */
|
|
5990
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ jsx46("span", { children: slice.name }),
|
|
6084
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-value", children: format(slice.values[0]) }),
|
|
6085
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-pct", children: total > 0 ? pct(slice.to[0] - slice.from[0]) : MISSING })
|
|
5991
6086
|
] }, slice.id)),
|
|
5992
|
-
/* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
5994
|
-
/* @__PURE__ */
|
|
5995
|
-
/* @__PURE__ */
|
|
5996
|
-
/* @__PURE__ */
|
|
6087
|
+
/* @__PURE__ */ jsxs42("li", { className: "ui-chart__shares-total", children: [
|
|
6088
|
+
/* @__PURE__ */ jsx46("span", {}),
|
|
6089
|
+
/* @__PURE__ */ jsx46("span", { children: look.totalLabel }),
|
|
6090
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-value", children: format(total) }),
|
|
6091
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-chart__shares-pct", children: "100%" })
|
|
5997
6092
|
] })
|
|
5998
6093
|
] });
|
|
5999
6094
|
}
|
|
6000
6095
|
|
|
6001
6096
|
// src/Chart.tsx
|
|
6002
|
-
import { Fragment as Fragment21, jsx as
|
|
6097
|
+
import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6003
6098
|
var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
|
|
6004
6099
|
var PAD = 2;
|
|
6005
6100
|
var ZERO_INSET = 1.5;
|
|
@@ -6250,9 +6345,9 @@ function donutFrame(look, slices, totalLabel, format) {
|
|
|
6250
6345
|
}
|
|
6251
6346
|
function KeyMark({ shape }) {
|
|
6252
6347
|
if (shape === "line") {
|
|
6253
|
-
return /* @__PURE__ */
|
|
6348
|
+
return /* @__PURE__ */ jsx47("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx47("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) });
|
|
6254
6349
|
}
|
|
6255
|
-
return /* @__PURE__ */
|
|
6350
|
+
return /* @__PURE__ */ jsx47("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: shape === "fill" ? /* @__PURE__ */ jsx47("rect", { className: "ui-chart__key-swatch", x: "1", y: "1", width: "10", height: "10", rx: "2.5" }) : /* @__PURE__ */ jsx47(
|
|
6256
6351
|
"path",
|
|
6257
6352
|
{
|
|
6258
6353
|
className: "ui-chart__key-swatch",
|
|
@@ -6279,7 +6374,7 @@ function Chart(props) {
|
|
|
6279
6374
|
const showTable = table ?? !spark;
|
|
6280
6375
|
const [view, setView] = useState21("chart");
|
|
6281
6376
|
const asTable = showTable && view === "table";
|
|
6282
|
-
const uid =
|
|
6377
|
+
const uid = useId17().replace(/[^\w-]/g, "");
|
|
6283
6378
|
const frameEl = useRef25(null);
|
|
6284
6379
|
const card = useContext5(CardTools);
|
|
6285
6380
|
const claim = card?.claim;
|
|
@@ -6535,17 +6630,17 @@ function Chart(props) {
|
|
|
6535
6630
|
const estimatedTone = marks.find((m) => m.estimated && m.kind === "bar")?.tone ?? keys[0]?.tone ?? "neutral";
|
|
6536
6631
|
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) };
|
|
6537
6632
|
const legendFirst = !(look?.variant === "donut" && look.look !== "labels");
|
|
6538
|
-
const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */
|
|
6539
|
-
keys.map((key) => /* @__PURE__ */
|
|
6540
|
-
/* @__PURE__ */
|
|
6633
|
+
const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */ jsxs43("ul", { className: "ui-chart__legend", children: [
|
|
6634
|
+
keys.map((key) => /* @__PURE__ */ jsxs43("li", { className: cx9("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
|
|
6635
|
+
/* @__PURE__ */ jsx47(KeyMark, { shape: key.shape }),
|
|
6541
6636
|
key.name
|
|
6542
6637
|
] }, key.id)),
|
|
6543
|
-
estimated.length > 0 && /* @__PURE__ */
|
|
6544
|
-
/* @__PURE__ */
|
|
6638
|
+
estimated.length > 0 && /* @__PURE__ */ jsxs43("li", { className: cx9("ui-chart__key", `ui-chart__tone--${estimatedTone}`), children: [
|
|
6639
|
+
/* @__PURE__ */ jsx47("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx47("rect", { className: "ui-chart__key-estimated", x: "1.5", y: "1.5", width: "9", height: "9", rx: "2.5" }) }),
|
|
6545
6640
|
"Estimated"
|
|
6546
6641
|
] })
|
|
6547
6642
|
] });
|
|
6548
|
-
const viewSwitch = showTable && /* @__PURE__ */
|
|
6643
|
+
const viewSwitch = showTable && /* @__PURE__ */ jsx47(
|
|
6549
6644
|
Segmented,
|
|
6550
6645
|
{
|
|
6551
6646
|
size: "sm",
|
|
@@ -6559,7 +6654,7 @@ function Chart(props) {
|
|
|
6559
6654
|
}
|
|
6560
6655
|
);
|
|
6561
6656
|
const noun = look?.layout === "ring" ? "slices" : look?.layout === "rows" ? "rows" : "columns";
|
|
6562
|
-
return /* @__PURE__ */
|
|
6657
|
+
return /* @__PURE__ */ jsxs43(
|
|
6563
6658
|
"div",
|
|
6564
6659
|
{
|
|
6565
6660
|
className: cx9(
|
|
@@ -6577,11 +6672,11 @@ function Chart(props) {
|
|
|
6577
6672
|
},
|
|
6578
6673
|
children: [
|
|
6579
6674
|
toCard && createPortal8(viewSwitch, toCard),
|
|
6580
|
-
(showTable && !toCard || legendFirst && legend) && /* @__PURE__ */
|
|
6675
|
+
(showTable && !toCard || legendFirst && legend) && /* @__PURE__ */ jsxs43("div", { className: "ui-chart__head", children: [
|
|
6581
6676
|
legendFirst && legend,
|
|
6582
6677
|
!toCard && viewSwitch
|
|
6583
6678
|
] }),
|
|
6584
|
-
/* @__PURE__ */
|
|
6679
|
+
/* @__PURE__ */ jsxs43(
|
|
6585
6680
|
"div",
|
|
6586
6681
|
{
|
|
6587
6682
|
ref: frameEl,
|
|
@@ -6606,8 +6701,8 @@ function Chart(props) {
|
|
|
6606
6701
|
setSaid("");
|
|
6607
6702
|
},
|
|
6608
6703
|
children: [
|
|
6609
|
-
!spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */
|
|
6610
|
-
/* @__PURE__ */
|
|
6704
|
+
!spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */ jsx47("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx47("span", { className: "ui-chart__tick", children: axisFormat(tick) }, tick)) }),
|
|
6705
|
+
/* @__PURE__ */ jsx47(
|
|
6611
6706
|
"div",
|
|
6612
6707
|
{
|
|
6613
6708
|
ref: scroller,
|
|
@@ -6623,8 +6718,8 @@ function Chart(props) {
|
|
|
6623
6718
|
if (mark.right <= view2.left || mark.left >= view2.right) setOpenId(null);
|
|
6624
6719
|
else placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
6625
6720
|
},
|
|
6626
|
-
children: /* @__PURE__ */
|
|
6627
|
-
/* @__PURE__ */
|
|
6721
|
+
children: /* @__PURE__ */ jsxs43("div", { ref: plot, className: "ui-chart__plot", children: [
|
|
6722
|
+
/* @__PURE__ */ jsxs43(
|
|
6628
6723
|
"svg",
|
|
6629
6724
|
{
|
|
6630
6725
|
ref: svgEl,
|
|
@@ -6685,7 +6780,7 @@ function Chart(props) {
|
|
|
6685
6780
|
announce(mark.column, selectable ? mark.column : pick);
|
|
6686
6781
|
},
|
|
6687
6782
|
children: [
|
|
6688
|
-
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */
|
|
6783
|
+
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx47(
|
|
6689
6784
|
"rect",
|
|
6690
6785
|
{
|
|
6691
6786
|
className: "ui-chart__band",
|
|
@@ -6698,7 +6793,7 @@ function Chart(props) {
|
|
|
6698
6793
|
frame.links && frame.bars.slice(0, -1).map((bar, i) => {
|
|
6699
6794
|
const from = byId.get(bar.id);
|
|
6700
6795
|
const to = byId.get(frame.bars[i + 1].id);
|
|
6701
|
-
return from && to ? /* @__PURE__ */
|
|
6796
|
+
return from && to ? /* @__PURE__ */ jsx47(
|
|
6702
6797
|
"line",
|
|
6703
6798
|
{
|
|
6704
6799
|
className: "ui-chart__carry",
|
|
@@ -6710,7 +6805,7 @@ function Chart(props) {
|
|
|
6710
6805
|
`carry-${bar.id}`
|
|
6711
6806
|
) : null;
|
|
6712
6807
|
}),
|
|
6713
|
-
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */
|
|
6808
|
+
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx47(
|
|
6714
6809
|
"line",
|
|
6715
6810
|
{
|
|
6716
6811
|
className: "ui-chart__grid",
|
|
@@ -6721,7 +6816,7 @@ function Chart(props) {
|
|
|
6721
6816
|
},
|
|
6722
6817
|
`grid-${tick}`
|
|
6723
6818
|
)),
|
|
6724
|
-
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */
|
|
6819
|
+
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */ jsx47(
|
|
6725
6820
|
"line",
|
|
6726
6821
|
{
|
|
6727
6822
|
className: "ui-chart__zero",
|
|
@@ -6731,7 +6826,7 @@ function Chart(props) {
|
|
|
6731
6826
|
y2: px2(y(0))
|
|
6732
6827
|
}
|
|
6733
6828
|
),
|
|
6734
|
-
fades.size > 0 && /* @__PURE__ */
|
|
6829
|
+
fades.size > 0 && /* @__PURE__ */ jsx47("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs43(
|
|
6735
6830
|
"linearGradient",
|
|
6736
6831
|
{
|
|
6737
6832
|
id: fade.id,
|
|
@@ -6741,15 +6836,15 @@ function Chart(props) {
|
|
|
6741
6836
|
y1: fade.up ? "1" : "0",
|
|
6742
6837
|
y2: fade.up ? "0" : "1",
|
|
6743
6838
|
children: [
|
|
6744
|
-
/* @__PURE__ */
|
|
6745
|
-
/* @__PURE__ */
|
|
6839
|
+
/* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-base", offset: "0" }),
|
|
6840
|
+
/* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-end", offset: "1" })
|
|
6746
6841
|
]
|
|
6747
6842
|
},
|
|
6748
6843
|
fade.id
|
|
6749
6844
|
)) }),
|
|
6750
6845
|
marks.filter((m) => m.kind === "bar").map((mark) => {
|
|
6751
6846
|
const fade = fadeOf(uid, mark, variant === "bridge");
|
|
6752
|
-
return /* @__PURE__ */
|
|
6847
|
+
return /* @__PURE__ */ jsx47(
|
|
6753
6848
|
"path",
|
|
6754
6849
|
{
|
|
6755
6850
|
className: cx9(
|
|
@@ -6764,7 +6859,7 @@ function Chart(props) {
|
|
|
6764
6859
|
);
|
|
6765
6860
|
}),
|
|
6766
6861
|
["casing", "stroke"].map((layer) => lines.flatMap(
|
|
6767
|
-
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */
|
|
6862
|
+
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx47(
|
|
6768
6863
|
"line",
|
|
6769
6864
|
{
|
|
6770
6865
|
className: layer === "casing" ? "ui-chart__line-casing" : cx9(
|
|
@@ -6780,7 +6875,7 @@ function Chart(props) {
|
|
|
6780
6875
|
`${line.id}-${layer}-${i}`
|
|
6781
6876
|
) : null)
|
|
6782
6877
|
)),
|
|
6783
|
-
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */
|
|
6878
|
+
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx47(
|
|
6784
6879
|
"circle",
|
|
6785
6880
|
{
|
|
6786
6881
|
className: cx9("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
|
|
@@ -6791,8 +6886,8 @@ function Chart(props) {
|
|
|
6791
6886
|
`isolated-${line.id}-${i}`
|
|
6792
6887
|
) : null)),
|
|
6793
6888
|
geometry && lookDrawing(geometry, open?.column ?? null, pick),
|
|
6794
|
-
marks.map((mark) => /* @__PURE__ */
|
|
6795
|
-
mark.hitPath ? /* @__PURE__ */
|
|
6889
|
+
marks.map((mark) => /* @__PURE__ */ jsxs43("g", { "data-mark": mark.id, children: [
|
|
6890
|
+
mark.hitPath ? /* @__PURE__ */ jsx47("path", { className: "ui-chart__hit", d: mark.hitPath }) : mark.kind === "bar" ? /* @__PURE__ */ jsx47(
|
|
6796
6891
|
"rect",
|
|
6797
6892
|
{
|
|
6798
6893
|
className: "ui-chart__hit",
|
|
@@ -6801,7 +6896,7 @@ function Chart(props) {
|
|
|
6801
6896
|
y: px2(hitBand(mark.band).y),
|
|
6802
6897
|
height: px2(hitBand(mark.band).h)
|
|
6803
6898
|
}
|
|
6804
|
-
) : /* @__PURE__ */
|
|
6899
|
+
) : /* @__PURE__ */ jsx47(
|
|
6805
6900
|
"rect",
|
|
6806
6901
|
{
|
|
6807
6902
|
className: "ui-chart__hit",
|
|
@@ -6811,7 +6906,7 @@ function Chart(props) {
|
|
|
6811
6906
|
height: px2(mark.hit?.h ?? TARGET)
|
|
6812
6907
|
}
|
|
6813
6908
|
),
|
|
6814
|
-
/* @__PURE__ */
|
|
6909
|
+
/* @__PURE__ */ jsx47(
|
|
6815
6910
|
"rect",
|
|
6816
6911
|
{
|
|
6817
6912
|
"data-anchor": mark.id,
|
|
@@ -6826,8 +6921,8 @@ function Chart(props) {
|
|
|
6826
6921
|
]
|
|
6827
6922
|
}
|
|
6828
6923
|
),
|
|
6829
|
-
look?.variant === "donut" && look.look === "table" && /* @__PURE__ */
|
|
6830
|
-
!spark && columnsLayout && /* @__PURE__ */
|
|
6924
|
+
look?.variant === "donut" && look.look === "table" && /* @__PURE__ */ jsx47(Shares, { look, format, swatch: /* @__PURE__ */ jsx47(KeyMark, { shape: "fill" }) }),
|
|
6925
|
+
!spark && columnsLayout && /* @__PURE__ */ jsx47("div", { className: "ui-chart__periods", "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx47(
|
|
6831
6926
|
"span",
|
|
6832
6927
|
{
|
|
6833
6928
|
className: cx9("ui-chart__period", pick === i && "is-selected"),
|
|
@@ -6838,46 +6933,46 @@ function Chart(props) {
|
|
|
6838
6933
|
] })
|
|
6839
6934
|
}
|
|
6840
6935
|
),
|
|
6841
|
-
/* @__PURE__ */
|
|
6842
|
-
/* @__PURE__ */
|
|
6843
|
-
open.rows ? /* @__PURE__ */
|
|
6844
|
-
open.rows.map((row) => /* @__PURE__ */
|
|
6845
|
-
/* @__PURE__ */
|
|
6846
|
-
/* @__PURE__ */
|
|
6936
|
+
/* @__PURE__ */ jsx47("span", { ref: tipEl, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs43(Fragment21, { children: [
|
|
6937
|
+
/* @__PURE__ */ jsx47("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
|
|
6938
|
+
open.rows ? /* @__PURE__ */ jsxs43(Fragment21, { children: [
|
|
6939
|
+
open.rows.map((row) => /* @__PURE__ */ jsxs43("span", { className: "ui-tip__value ui-chart__row", children: [
|
|
6940
|
+
/* @__PURE__ */ jsxs43("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
|
|
6941
|
+
/* @__PURE__ */ jsx47(KeyMark, { shape: row.shape }),
|
|
6847
6942
|
row.name
|
|
6848
6943
|
] }),
|
|
6849
|
-
/* @__PURE__ */
|
|
6944
|
+
/* @__PURE__ */ jsx47("span", { children: row.text })
|
|
6850
6945
|
] }, row.name)),
|
|
6851
|
-
open.total && /* @__PURE__ */
|
|
6852
|
-
/* @__PURE__ */
|
|
6853
|
-
/* @__PURE__ */
|
|
6946
|
+
open.total && /* @__PURE__ */ jsxs43("span", { className: "ui-tip__value ui-chart__row", children: [
|
|
6947
|
+
/* @__PURE__ */ jsx47("span", { children: totalLabel }),
|
|
6948
|
+
/* @__PURE__ */ jsx47("span", { children: open.total })
|
|
6854
6949
|
] })
|
|
6855
|
-
] }) : /* @__PURE__ */
|
|
6856
|
-
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */
|
|
6950
|
+
] }) : /* @__PURE__ */ jsx47("span", { className: "ui-tip__value", children: format(open.value) }),
|
|
6951
|
+
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx47("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
|
|
6857
6952
|
] }) })
|
|
6858
6953
|
]
|
|
6859
6954
|
}
|
|
6860
6955
|
),
|
|
6861
6956
|
!legendFirst && legend,
|
|
6862
|
-
/* @__PURE__ */
|
|
6863
|
-
asTable && /* @__PURE__ */
|
|
6957
|
+
/* @__PURE__ */ jsx47("div", { className: "ui-sr", role: "status", children: said }),
|
|
6958
|
+
asTable && /* @__PURE__ */ jsx47("div", { className: "ui-chart__data", children: /* @__PURE__ */ jsx47(
|
|
6864
6959
|
"div",
|
|
6865
6960
|
{
|
|
6866
6961
|
className: "ui-table-scroll",
|
|
6867
6962
|
role: "region",
|
|
6868
6963
|
tabIndex: 0,
|
|
6869
6964
|
"aria-label": `${title}, as a table. Scroll for more columns.`,
|
|
6870
|
-
children: /* @__PURE__ */
|
|
6871
|
-
/* @__PURE__ */
|
|
6872
|
-
/* @__PURE__ */
|
|
6873
|
-
/* @__PURE__ */
|
|
6965
|
+
children: /* @__PURE__ */ jsxs43("table", { className: "ui-table", "aria-label": title, children: [
|
|
6966
|
+
/* @__PURE__ */ jsx47("thead", { children: /* @__PURE__ */ jsx47("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx47("th", { scope: "col", className: cx9(i > 0 && "ui-table__num"), children: head }, head)) }) }),
|
|
6967
|
+
/* @__PURE__ */ jsx47("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs43("tr", { "aria-current": pick === i ? true : void 0, children: [
|
|
6968
|
+
/* @__PURE__ */ jsxs43("th", { scope: "row", children: [
|
|
6874
6969
|
row.column.label,
|
|
6875
|
-
row.column.estimated && /* @__PURE__ */
|
|
6970
|
+
row.column.estimated && /* @__PURE__ */ jsxs43(Fragment21, { children: [
|
|
6876
6971
|
" ",
|
|
6877
|
-
/* @__PURE__ */
|
|
6972
|
+
/* @__PURE__ */ jsx47("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
6878
6973
|
] })
|
|
6879
6974
|
] }),
|
|
6880
|
-
row.cells.map((cell, j) => /* @__PURE__ */
|
|
6975
|
+
row.cells.map((cell, j) => /* @__PURE__ */ jsx47("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
|
|
6881
6976
|
] }, `${row.column.label}-${i}`)) })
|
|
6882
6977
|
] })
|
|
6883
6978
|
}
|
|
@@ -6890,7 +6985,7 @@ function Chart(props) {
|
|
|
6890
6985
|
// src/AccentPicker.tsx
|
|
6891
6986
|
import { forwardRef as forwardRef12 } from "react";
|
|
6892
6987
|
import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
|
|
6893
|
-
import { jsx as
|
|
6988
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
6894
6989
|
var AccentPicker = forwardRef12(function AccentPicker2({
|
|
6895
6990
|
value,
|
|
6896
6991
|
onChange,
|
|
@@ -6899,7 +6994,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6899
6994
|
"aria-label": label = "Accent",
|
|
6900
6995
|
...rest
|
|
6901
6996
|
}, ref) {
|
|
6902
|
-
return /* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ jsx48(
|
|
6903
6998
|
"div",
|
|
6904
6999
|
{
|
|
6905
7000
|
...rest,
|
|
@@ -6910,7 +7005,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6910
7005
|
"aria-label": label,
|
|
6911
7006
|
children: options.map((accent) => {
|
|
6912
7007
|
const title = accent.charAt(0).toUpperCase() + accent.slice(1);
|
|
6913
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ jsx48(
|
|
6914
7009
|
"button",
|
|
6915
7010
|
{
|
|
6916
7011
|
type: "button",
|
|
@@ -6930,8 +7025,8 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6930
7025
|
|
|
6931
7026
|
// src/TopBar.tsx
|
|
6932
7027
|
import { Fragment as Fragment22 } from "react";
|
|
6933
|
-
import { prism as prism3, safeUrl as
|
|
6934
|
-
import { Fragment as Fragment23, jsx as
|
|
7028
|
+
import { prism as prism3, safeUrl as safeUrl6, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
7029
|
+
import { Fragment as Fragment23, jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6935
7030
|
function TopBar({
|
|
6936
7031
|
brand,
|
|
6937
7032
|
word = "Strategy",
|
|
@@ -6943,35 +7038,35 @@ function TopBar({
|
|
|
6943
7038
|
className,
|
|
6944
7039
|
...rest
|
|
6945
7040
|
}) {
|
|
6946
|
-
return /* @__PURE__ */
|
|
6947
|
-
brand ?? /* @__PURE__ */
|
|
6948
|
-
/* @__PURE__ */
|
|
6949
|
-
/* @__PURE__ */
|
|
7041
|
+
return /* @__PURE__ */ jsx49("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs44("div", { className: "topbar__in", children: [
|
|
7042
|
+
brand ?? /* @__PURE__ */ jsxs44("a", { className: "brand", href: safeUrl6(brandHref), "aria-label": `Apliteni ${word}`, children: [
|
|
7043
|
+
/* @__PURE__ */ jsx49("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
|
|
7044
|
+
/* @__PURE__ */ jsx49("span", { children: word })
|
|
6950
7045
|
] }),
|
|
6951
7046
|
view,
|
|
6952
|
-
/* @__PURE__ */
|
|
7047
|
+
/* @__PURE__ */ jsx49("span", { className: "spacer" }),
|
|
6953
7048
|
version,
|
|
6954
7049
|
theme,
|
|
6955
7050
|
account
|
|
6956
7051
|
] }) });
|
|
6957
7052
|
}
|
|
6958
7053
|
function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
6959
|
-
return /* @__PURE__ */
|
|
7054
|
+
return /* @__PURE__ */ jsx49("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
|
|
6960
7055
|
const current = item.id === active;
|
|
6961
7056
|
const linkProps = {
|
|
6962
7057
|
className: current ? "cur" : void 0,
|
|
6963
|
-
href:
|
|
7058
|
+
href: safeUrl6(item.href || `#${item.id}`),
|
|
6964
7059
|
target: item.target,
|
|
6965
7060
|
"aria-current": current ? "page" : void 0,
|
|
6966
7061
|
children: item.label
|
|
6967
7062
|
};
|
|
6968
|
-
return /* @__PURE__ */
|
|
7063
|
+
return /* @__PURE__ */ jsx49(Fragment22, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx49("a", { ...linkProps }) }, item.id);
|
|
6969
7064
|
}) });
|
|
6970
7065
|
}
|
|
6971
7066
|
var BADGE = { live: "Live", archive: "Archive" };
|
|
6972
7067
|
function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
|
|
6973
7068
|
const current = versions.find((v) => v.value === value);
|
|
6974
|
-
return /* @__PURE__ */
|
|
7069
|
+
return /* @__PURE__ */ jsx49("div", { className: "vsw", children: /* @__PURE__ */ jsx49(
|
|
6975
7070
|
Dropdown,
|
|
6976
7071
|
{
|
|
6977
7072
|
variant: "select",
|
|
@@ -6982,9 +7077,9 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
6982
7077
|
chevron: false,
|
|
6983
7078
|
defaultOpen,
|
|
6984
7079
|
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
6985
|
-
triggerContent: /* @__PURE__ */
|
|
6986
|
-
/* @__PURE__ */
|
|
6987
|
-
/* @__PURE__ */
|
|
7080
|
+
triggerContent: /* @__PURE__ */ jsxs44(Fragment23, { children: [
|
|
7081
|
+
/* @__PURE__ */ jsx49("span", { className: "cur", children: current?.label }),
|
|
7082
|
+
/* @__PURE__ */ jsx49("span", { className: "car", "aria-hidden": "true" })
|
|
6988
7083
|
] }),
|
|
6989
7084
|
items: versions.map((v) => ({
|
|
6990
7085
|
label: v.label,
|
|
@@ -6992,10 +7087,10 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
6992
7087
|
badge: BADGE[v.badge ?? "archive"],
|
|
6993
7088
|
selected: v.value === value
|
|
6994
7089
|
})),
|
|
6995
|
-
row: (item, props) => /* @__PURE__ */
|
|
6996
|
-
/* @__PURE__ */
|
|
6997
|
-
/* @__PURE__ */
|
|
6998
|
-
/* @__PURE__ */
|
|
7090
|
+
row: (item, props) => /* @__PURE__ */ jsxs44("div", { ...props, className: `${props.className} vopt`, children: [
|
|
7091
|
+
/* @__PURE__ */ jsx49("span", { className: "vname", children: item.label }),
|
|
7092
|
+
/* @__PURE__ */ jsx49("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
|
|
7093
|
+
/* @__PURE__ */ jsx49("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8("check") } })
|
|
6999
7094
|
] }),
|
|
7000
7095
|
onSelect: (picked) => {
|
|
7001
7096
|
if (picked != null) onChange?.(String(picked));
|
|
@@ -7024,7 +7119,7 @@ function AccountMenu2({
|
|
|
7024
7119
|
defaultOpen
|
|
7025
7120
|
}) {
|
|
7026
7121
|
const mark = initialsOf(name, email);
|
|
7027
|
-
return /* @__PURE__ */
|
|
7122
|
+
return /* @__PURE__ */ jsx49("div", { className: "acct on", children: /* @__PURE__ */ jsx49(
|
|
7028
7123
|
Dropdown,
|
|
7029
7124
|
{
|
|
7030
7125
|
variant: "menu",
|
|
@@ -7035,22 +7130,22 @@ function AccountMenu2({
|
|
|
7035
7130
|
defaultOpen,
|
|
7036
7131
|
ariaLabel: "Account",
|
|
7037
7132
|
triggerContent: mark,
|
|
7038
|
-
header: /* @__PURE__ */
|
|
7039
|
-
/* @__PURE__ */
|
|
7040
|
-
/* @__PURE__ */
|
|
7041
|
-
/* @__PURE__ */
|
|
7042
|
-
/* @__PURE__ */
|
|
7133
|
+
header: /* @__PURE__ */ jsxs44("div", { className: "ahead", children: [
|
|
7134
|
+
/* @__PURE__ */ jsx49("span", { className: "avatar", children: mark }),
|
|
7135
|
+
/* @__PURE__ */ jsxs44("span", { className: "aw", children: [
|
|
7136
|
+
/* @__PURE__ */ jsx49("span", { className: "anm", children: name }),
|
|
7137
|
+
/* @__PURE__ */ jsx49("span", { className: "aem", title: email, children: email })
|
|
7043
7138
|
] })
|
|
7044
7139
|
] }),
|
|
7045
7140
|
items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
|
|
7046
|
-
row: (item, props) => /* @__PURE__ */
|
|
7141
|
+
row: (item, props) => /* @__PURE__ */ jsxs44(
|
|
7047
7142
|
"a",
|
|
7048
7143
|
{
|
|
7049
7144
|
...props,
|
|
7050
|
-
href: item.disabled ? void 0 : item.href ?
|
|
7145
|
+
href: item.disabled ? void 0 : item.href ? safeUrl6(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl6(item.value === "sign-out" ? "#logout" : `#${item.value}`),
|
|
7051
7146
|
className: [props.className, !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
7052
7147
|
children: [
|
|
7053
|
-
item.icon && /* @__PURE__ */
|
|
7148
|
+
item.icon && /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
7054
7149
|
item.label
|
|
7055
7150
|
]
|
|
7056
7151
|
}
|
|
@@ -7125,6 +7220,7 @@ export {
|
|
|
7125
7220
|
Tabs,
|
|
7126
7221
|
TextArea,
|
|
7127
7222
|
TextField,
|
|
7223
|
+
ThemeChoice,
|
|
7128
7224
|
ThemeToggle,
|
|
7129
7225
|
Timeline,
|
|
7130
7226
|
Toast,
|