@apliteni/apliteni-ui 0.180.0 → 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 +40 -8
- package/guidelines/account-and-settings.md +13 -13
- package/package.json +1 -1
- package/react/README.md +14 -0
- package/react/dist/index.css +117 -0
- package/react/dist/index.d.ts +10 -2
- package/react/dist/index.js +224 -153
- package/src/styles/card.css +10 -1
- package/src/styles/table.css +17 -0
- package/src/tokens/tokens.css +3 -0
package/react/dist/index.js
CHANGED
|
@@ -2257,6 +2257,28 @@ function DataTable({
|
|
|
2257
2257
|
measure();
|
|
2258
2258
|
return () => observer.disconnect();
|
|
2259
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
|
+
};
|
|
2260
2282
|
const [localSort, setLocalSort] = useState10(
|
|
2261
2283
|
{ key: columns.find((c) => c.sortable)?.key, dir: -1 }
|
|
2262
2284
|
);
|
|
@@ -2311,7 +2333,7 @@ function DataTable({
|
|
|
2311
2333
|
const pageAllOn = selectable && slice.length > 0 && slice.every((r) => selected.has(r.name));
|
|
2312
2334
|
const pageSomeOn = selectable && !pageAllOn && slice.some((r) => selected.has(r.name));
|
|
2313
2335
|
return /* @__PURE__ */ jsxs19(Fragment12, { children: [
|
|
2314
|
-
/* @__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(
|
|
2315
2337
|
"table",
|
|
2316
2338
|
{
|
|
2317
2339
|
ref: table,
|
|
@@ -3201,6 +3223,7 @@ function Dropdown({
|
|
|
3201
3223
|
const uid = id ?? auto;
|
|
3202
3224
|
const inField = useContext3(FieldContext);
|
|
3203
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;
|
|
3204
3227
|
const setOpen = useCallback6((next) => {
|
|
3205
3228
|
if (openProp === void 0) setSelfOpen(next);
|
|
3206
3229
|
onOpenChange?.(next);
|
|
@@ -3630,7 +3653,7 @@ function Dropdown({
|
|
|
3630
3653
|
disabled: disabled || void 0,
|
|
3631
3654
|
"aria-haspopup": sx ? "dialog" : listRole,
|
|
3632
3655
|
"aria-expanded": open,
|
|
3633
|
-
id: fieldName?.id,
|
|
3656
|
+
id: fieldName?.id ?? byContent,
|
|
3634
3657
|
"aria-label": ariaLabel && triggerContent != null ? ariaLabel : void 0,
|
|
3635
3658
|
title,
|
|
3636
3659
|
"aria-labelledby": fieldName?.labelledBy,
|
|
@@ -3665,7 +3688,7 @@ function Dropdown({
|
|
|
3665
3688
|
"data-dropdown-panel": "",
|
|
3666
3689
|
role: sx ? "dialog" : listRole,
|
|
3667
3690
|
"aria-label": sx ? name : ariaLabel,
|
|
3668
|
-
"aria-labelledby": !sx && !ariaLabel ? fieldName?.labelId : void 0,
|
|
3691
|
+
"aria-labelledby": !sx && !ariaLabel ? fieldName?.labelId ?? byContent : void 0,
|
|
3669
3692
|
style: sx ? void 0 : cap,
|
|
3670
3693
|
ref: panel,
|
|
3671
3694
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -4982,7 +5005,6 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
|
|
|
4982
5005
|
align: "start",
|
|
4983
5006
|
chevron: true,
|
|
4984
5007
|
open,
|
|
4985
|
-
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
4986
5008
|
triggerClass: "ui-app__user-trigger",
|
|
4987
5009
|
panelClass: `ui-app__user-panel${sub && inPlace ? " is-sub" : ""}`,
|
|
4988
5010
|
onOpenChange: (next) => {
|
|
@@ -4990,8 +5012,9 @@ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
|
|
|
4990
5012
|
if (!next) setSub(false);
|
|
4991
5013
|
},
|
|
4992
5014
|
triggerContent: /* @__PURE__ */ jsxs36(Fragment18, { children: [
|
|
5015
|
+
/* @__PURE__ */ jsx40("span", { className: "ui-sr", children: `Signed in as ${account.name}, ${account.email}` }),
|
|
4993
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 }) }),
|
|
4994
|
-
/* @__PURE__ */ jsxs36("span", { className: "ui-app__who", children: [
|
|
5017
|
+
/* @__PURE__ */ jsxs36("span", { className: "ui-app__who", "aria-hidden": "true", children: [
|
|
4995
5018
|
/* @__PURE__ */ jsx40("b", { children: account.name }),
|
|
4996
5019
|
/* @__PURE__ */ jsx40("span", { children: account.email })
|
|
4997
5020
|
] })
|
|
@@ -5269,11 +5292,13 @@ function AppShell({
|
|
|
5269
5292
|
variant: "menu",
|
|
5270
5293
|
align: "end",
|
|
5271
5294
|
chevron: false,
|
|
5272
|
-
ariaLabel: `Signed in as ${account.name}, ${account.email}`,
|
|
5273
5295
|
title: `Signed in as ${account.name}, ${account.email}`,
|
|
5274
5296
|
triggerClass: "ui-app__user-trigger",
|
|
5275
5297
|
panelClass: "ui-app__user-panel",
|
|
5276
|
-
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
|
+
] }),
|
|
5277
5302
|
header: /* @__PURE__ */ jsxs37("div", { className: "ui-dropdown__head", children: [
|
|
5278
5303
|
/* @__PURE__ */ jsx41("b", { children: account.name }),
|
|
5279
5304
|
/* @__PURE__ */ jsx41("span", { children: account.email })
|
|
@@ -5387,12 +5412,57 @@ function Footer({
|
|
|
5387
5412
|
] }) });
|
|
5388
5413
|
}
|
|
5389
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
|
+
|
|
5390
5460
|
// src/Success.tsx
|
|
5391
5461
|
import { forwardRef as forwardRef11, useEffect as useEffect20, useRef as useRef24, useState as useState20 } from "react";
|
|
5392
|
-
import { jsx as
|
|
5462
|
+
import { jsx as jsx45, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5393
5463
|
var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
|
|
5394
5464
|
const circled = variant === "circled";
|
|
5395
|
-
return /* @__PURE__ */
|
|
5465
|
+
return /* @__PURE__ */ jsxs41(
|
|
5396
5466
|
"svg",
|
|
5397
5467
|
{
|
|
5398
5468
|
...rest,
|
|
@@ -5404,18 +5474,18 @@ var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", class
|
|
|
5404
5474
|
"aria-hidden": "true",
|
|
5405
5475
|
focusable: "false",
|
|
5406
5476
|
children: [
|
|
5407
|
-
circled && /* @__PURE__ */
|
|
5408
|
-
/* @__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" })
|
|
5409
5479
|
]
|
|
5410
5480
|
}
|
|
5411
5481
|
);
|
|
5412
5482
|
});
|
|
5413
5483
|
var SuccessPanel = forwardRef11(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
|
|
5414
5484
|
const circled = check === "circled";
|
|
5415
|
-
return /* @__PURE__ */
|
|
5416
|
-
/* @__PURE__ */
|
|
5417
|
-
/* @__PURE__ */
|
|
5418
|
-
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 })
|
|
5419
5489
|
] });
|
|
5420
5490
|
});
|
|
5421
5491
|
var pieces = [
|
|
@@ -5452,12 +5522,12 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
|
5452
5522
|
}, 1e3);
|
|
5453
5523
|
return () => clearInterval(timer);
|
|
5454
5524
|
}, [seconds]);
|
|
5455
|
-
return /* @__PURE__ */
|
|
5456
|
-
/* @__PURE__ */
|
|
5457
|
-
/* @__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: [
|
|
5458
5528
|
label,
|
|
5459
5529
|
" in ",
|
|
5460
|
-
/* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ jsx45("b", { "data-sx-num": "", children: remaining }),
|
|
5461
5531
|
"s"
|
|
5462
5532
|
] })
|
|
5463
5533
|
] });
|
|
@@ -5484,7 +5554,7 @@ var Success = forwardRef11(function Success2({
|
|
|
5484
5554
|
const seconds = countdown?.seconds;
|
|
5485
5555
|
const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
|
|
5486
5556
|
const mark = check === "circled" ? "circled" : "line";
|
|
5487
|
-
return /* @__PURE__ */
|
|
5557
|
+
return /* @__PURE__ */ jsxs41(
|
|
5488
5558
|
"div",
|
|
5489
5559
|
{
|
|
5490
5560
|
role: "status",
|
|
@@ -5493,16 +5563,16 @@ var Success = forwardRef11(function Success2({
|
|
|
5493
5563
|
ref,
|
|
5494
5564
|
className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
|
|
5495
5565
|
children: [
|
|
5496
|
-
confetti && /* @__PURE__ */
|
|
5497
|
-
([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)
|
|
5498
5568
|
) }),
|
|
5499
|
-
/* @__PURE__ */
|
|
5500
|
-
/* @__PURE__ */
|
|
5501
|
-
/* @__PURE__ */
|
|
5502
|
-
/* @__PURE__ */
|
|
5503
|
-
body && /* @__PURE__ */
|
|
5504
|
-
hasActions && /* @__PURE__ */
|
|
5505
|
-
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)
|
|
5506
5576
|
] })
|
|
5507
5577
|
] })
|
|
5508
5578
|
]
|
|
@@ -5515,7 +5585,7 @@ import {
|
|
|
5515
5585
|
useCallback as useCallback8,
|
|
5516
5586
|
useContext as useContext5,
|
|
5517
5587
|
useEffect as useEffect21,
|
|
5518
|
-
useId as
|
|
5588
|
+
useId as useId17,
|
|
5519
5589
|
useLayoutEffect as useLayoutEffect5,
|
|
5520
5590
|
useMemo as useMemo6,
|
|
5521
5591
|
useRef as useRef25,
|
|
@@ -5525,7 +5595,7 @@ import { createPortal as createPortal8 } from "react-dom";
|
|
|
5525
5595
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
5526
5596
|
|
|
5527
5597
|
// src/chart-looks.tsx
|
|
5528
|
-
import { Fragment as Fragment20, jsx as
|
|
5598
|
+
import { Fragment as Fragment20, jsx as jsx46, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5529
5599
|
var LOOK_DEFAULT = {
|
|
5530
5600
|
line: "thin",
|
|
5531
5601
|
area: "stacked",
|
|
@@ -5747,7 +5817,7 @@ function linesDrawing(g, open) {
|
|
|
5747
5817
|
const [a, b] = [run[0], run[run.length - 1]];
|
|
5748
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`;
|
|
5749
5819
|
}).join("");
|
|
5750
|
-
return d && /* @__PURE__ */
|
|
5820
|
+
return d && /* @__PURE__ */ jsx46(
|
|
5751
5821
|
"path",
|
|
5752
5822
|
{
|
|
5753
5823
|
className: cx8("ui-chart__area", tone(layer.tone)),
|
|
@@ -5757,7 +5827,7 @@ function linesDrawing(g, open) {
|
|
|
5757
5827
|
`fill-${layer.id}`
|
|
5758
5828
|
);
|
|
5759
5829
|
}
|
|
5760
|
-
return /* @__PURE__ */
|
|
5830
|
+
return /* @__PURE__ */ jsx46(
|
|
5761
5831
|
"path",
|
|
5762
5832
|
{
|
|
5763
5833
|
className: cx8(look.share ? "ui-chart__segment" : "ui-chart__area", tone(layer.tone)),
|
|
@@ -5767,7 +5837,7 @@ function linesDrawing(g, open) {
|
|
|
5767
5837
|
`fill-${layer.id}`
|
|
5768
5838
|
);
|
|
5769
5839
|
});
|
|
5770
|
-
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(
|
|
5771
5841
|
"path",
|
|
5772
5842
|
{
|
|
5773
5843
|
className: cx8(
|
|
@@ -5778,7 +5848,7 @@ function linesDrawing(g, open) {
|
|
|
5778
5848
|
d: `M${px(centre(i))} ${px(y(at(layer, i)))}${bend(k, i)}`
|
|
5779
5849
|
},
|
|
5780
5850
|
`edge-${layer.id}-${i}`
|
|
5781
|
-
) : 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(
|
|
5782
5852
|
"line",
|
|
5783
5853
|
{
|
|
5784
5854
|
className: cx8(
|
|
@@ -5800,7 +5870,7 @@ function linesDrawing(g, open) {
|
|
|
5800
5870
|
const shown = i === open || points || lonely && !look.share;
|
|
5801
5871
|
if (!shown || look.share && i !== open) return null;
|
|
5802
5872
|
if (look.share && layer !== look.layers[look.layers.length - 1]) return null;
|
|
5803
|
-
return /* @__PURE__ */
|
|
5873
|
+
return /* @__PURE__ */ jsx46(
|
|
5804
5874
|
"circle",
|
|
5805
5875
|
{
|
|
5806
5876
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5828,8 +5898,8 @@ function linesDrawing(g, open) {
|
|
|
5828
5898
|
base = at2 + Math.max(drop, fall + gap + ascent);
|
|
5829
5899
|
}
|
|
5830
5900
|
}
|
|
5831
|
-
return /* @__PURE__ */
|
|
5832
|
-
/* @__PURE__ */
|
|
5901
|
+
return /* @__PURE__ */ jsxs42("g", { children: [
|
|
5902
|
+
/* @__PURE__ */ jsx46(
|
|
5833
5903
|
"circle",
|
|
5834
5904
|
{
|
|
5835
5905
|
className: cx8("ui-chart__dot", tone(layer.tone)),
|
|
@@ -5838,7 +5908,7 @@ function linesDrawing(g, open) {
|
|
|
5838
5908
|
r: "4"
|
|
5839
5909
|
}
|
|
5840
5910
|
),
|
|
5841
|
-
/* @__PURE__ */
|
|
5911
|
+
/* @__PURE__ */ jsx46(
|
|
5842
5912
|
"text",
|
|
5843
5913
|
{
|
|
5844
5914
|
className: "ui-chart__text ui-chart__text--strong",
|
|
@@ -5850,8 +5920,8 @@ function linesDrawing(g, open) {
|
|
|
5850
5920
|
)
|
|
5851
5921
|
] }, `end-${layer.id}`);
|
|
5852
5922
|
});
|
|
5853
|
-
return /* @__PURE__ */
|
|
5854
|
-
ramps.some(Boolean) && /* @__PURE__ */
|
|
5923
|
+
return /* @__PURE__ */ jsxs42(Fragment20, { children: [
|
|
5924
|
+
ramps.some(Boolean) && /* @__PURE__ */ jsx46("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs42(
|
|
5855
5925
|
"linearGradient",
|
|
5856
5926
|
{
|
|
5857
5927
|
id: ramp.id,
|
|
@@ -5862,14 +5932,14 @@ function linesDrawing(g, open) {
|
|
|
5862
5932
|
y1: px(y(ramp.lo)),
|
|
5863
5933
|
y2: px(y(ramp.hi)),
|
|
5864
5934
|
children: [
|
|
5865
|
-
/* @__PURE__ */
|
|
5866
|
-
/* @__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" })
|
|
5867
5937
|
]
|
|
5868
5938
|
},
|
|
5869
5939
|
ramp.id
|
|
5870
5940
|
)) }),
|
|
5871
5941
|
fills,
|
|
5872
|
-
open !== null && /* @__PURE__ */
|
|
5942
|
+
open !== null && /* @__PURE__ */ jsx46(
|
|
5873
5943
|
"line",
|
|
5874
5944
|
{
|
|
5875
5945
|
className: "ui-chart__cross",
|
|
@@ -5894,7 +5964,7 @@ function columnsDrawing(g) {
|
|
|
5894
5964
|
const y1 = y(layer.to[i]);
|
|
5895
5965
|
const x = centre(i) - w / 2;
|
|
5896
5966
|
const d = layer === filled[filled.length - 1] ? topRounded(x, y1, w, y0 - y1, 4) : square(x, y1, w, y0 - y1);
|
|
5897
|
-
return /* @__PURE__ */
|
|
5967
|
+
return /* @__PURE__ */ jsx46(
|
|
5898
5968
|
"path",
|
|
5899
5969
|
{
|
|
5900
5970
|
className: cx8("ui-chart__segment", tone(layer.tone), label.estimated && "is-estimated"),
|
|
@@ -5909,10 +5979,10 @@ function rowsDrawing(g, pick) {
|
|
|
5909
5979
|
const { look, labels, format, formatAxis, scale } = g;
|
|
5910
5980
|
const rows = rowsOf(g);
|
|
5911
5981
|
const bottom = rows.row * labels.length;
|
|
5912
|
-
return /* @__PURE__ */
|
|
5913
|
-
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */
|
|
5914
|
-
scale.ticks.map((tick) => /* @__PURE__ */
|
|
5915
|
-
/* @__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(
|
|
5916
5986
|
"line",
|
|
5917
5987
|
{
|
|
5918
5988
|
className: tick === 0 ? "ui-chart__zero" : "ui-chart__grid",
|
|
@@ -5922,7 +5992,7 @@ function rowsDrawing(g, pick) {
|
|
|
5922
5992
|
y2: px(bottom)
|
|
5923
5993
|
}
|
|
5924
5994
|
),
|
|
5925
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx46(
|
|
5926
5996
|
"text",
|
|
5927
5997
|
{
|
|
5928
5998
|
className: "ui-chart__caption",
|
|
@@ -5937,8 +6007,8 @@ function rowsDrawing(g, pick) {
|
|
|
5937
6007
|
labels.map((label, i) => {
|
|
5938
6008
|
const top = rows.top(i);
|
|
5939
6009
|
const filled = look.layers.filter((l) => l.to[i] > l.from[i]);
|
|
5940
|
-
return /* @__PURE__ */
|
|
5941
|
-
/* @__PURE__ */
|
|
6010
|
+
return /* @__PURE__ */ jsxs42("g", { children: [
|
|
6011
|
+
/* @__PURE__ */ jsx46(
|
|
5942
6012
|
"text",
|
|
5943
6013
|
{
|
|
5944
6014
|
className: "ui-chart__caption",
|
|
@@ -5953,7 +6023,7 @@ function rowsDrawing(g, pick) {
|
|
|
5953
6023
|
const x0 = rows.x(layer.from[i]);
|
|
5954
6024
|
const x1 = rows.x(layer.to[i]);
|
|
5955
6025
|
const d = layer === filled[filled.length - 1] ? rightRounded(x0, top, x1 - x0, ROW_BAR, 4) : square(x0, top, x1 - x0, ROW_BAR);
|
|
5956
|
-
return /* @__PURE__ */
|
|
6026
|
+
return /* @__PURE__ */ jsx46(
|
|
5957
6027
|
"path",
|
|
5958
6028
|
{
|
|
5959
6029
|
d,
|
|
@@ -5962,7 +6032,7 @@ function rowsDrawing(g, pick) {
|
|
|
5962
6032
|
`seg-${layer.id}`
|
|
5963
6033
|
);
|
|
5964
6034
|
}),
|
|
5965
|
-
/* @__PURE__ */
|
|
6035
|
+
/* @__PURE__ */ jsx46(
|
|
5966
6036
|
"text",
|
|
5967
6037
|
{
|
|
5968
6038
|
className: "ui-chart__text",
|
|
@@ -5980,8 +6050,8 @@ function ringDrawing(g) {
|
|
|
5980
6050
|
const { look, format } = g;
|
|
5981
6051
|
const ring = ringOf(g);
|
|
5982
6052
|
const total = look.totals[0];
|
|
5983
|
-
return /* @__PURE__ */
|
|
5984
|
-
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(
|
|
5985
6055
|
"path",
|
|
5986
6056
|
{
|
|
5987
6057
|
className: cx8("ui-chart__segment", tone(slice.tone)),
|
|
@@ -5989,42 +6059,42 @@ function ringDrawing(g) {
|
|
|
5989
6059
|
},
|
|
5990
6060
|
`slice-${slice.id}`
|
|
5991
6061
|
)),
|
|
5992
|
-
look.look === "thin" && /* @__PURE__ */
|
|
5993
|
-
/* @__PURE__ */
|
|
5994
|
-
/* @__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 })
|
|
5995
6065
|
] }),
|
|
5996
6066
|
look.look === "labels" && look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => {
|
|
5997
6067
|
const mid = angle((slice.from[0] + slice.to[0]) / 2);
|
|
5998
6068
|
const x = ring.x + (ring.r + 14) * Math.cos(mid);
|
|
5999
6069
|
const y = ring.y + (ring.r + 14) * Math.sin(mid);
|
|
6000
6070
|
const anchor = Math.cos(mid) >= 0 ? "start" : "end";
|
|
6001
|
-
return /* @__PURE__ */
|
|
6002
|
-
/* @__PURE__ */
|
|
6003
|
-
/* @__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])}` })
|
|
6004
6074
|
] }, `label-${slice.id}`);
|
|
6005
6075
|
})
|
|
6006
6076
|
] });
|
|
6007
6077
|
}
|
|
6008
6078
|
function Shares({ look, format, swatch }) {
|
|
6009
6079
|
const total = look.totals[0];
|
|
6010
|
-
return /* @__PURE__ */
|
|
6011
|
-
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: [
|
|
6012
6082
|
swatch,
|
|
6013
|
-
/* @__PURE__ */
|
|
6014
|
-
/* @__PURE__ */
|
|
6015
|
-
/* @__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 })
|
|
6016
6086
|
] }, slice.id)),
|
|
6017
|
-
/* @__PURE__ */
|
|
6018
|
-
/* @__PURE__ */
|
|
6019
|
-
/* @__PURE__ */
|
|
6020
|
-
/* @__PURE__ */
|
|
6021
|
-
/* @__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%" })
|
|
6022
6092
|
] })
|
|
6023
6093
|
] });
|
|
6024
6094
|
}
|
|
6025
6095
|
|
|
6026
6096
|
// src/Chart.tsx
|
|
6027
|
-
import { Fragment as Fragment21, jsx as
|
|
6097
|
+
import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6028
6098
|
var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
|
|
6029
6099
|
var PAD = 2;
|
|
6030
6100
|
var ZERO_INSET = 1.5;
|
|
@@ -6275,9 +6345,9 @@ function donutFrame(look, slices, totalLabel, format) {
|
|
|
6275
6345
|
}
|
|
6276
6346
|
function KeyMark({ shape }) {
|
|
6277
6347
|
if (shape === "line") {
|
|
6278
|
-
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" }) });
|
|
6279
6349
|
}
|
|
6280
|
-
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(
|
|
6281
6351
|
"path",
|
|
6282
6352
|
{
|
|
6283
6353
|
className: "ui-chart__key-swatch",
|
|
@@ -6304,7 +6374,7 @@ function Chart(props) {
|
|
|
6304
6374
|
const showTable = table ?? !spark;
|
|
6305
6375
|
const [view, setView] = useState21("chart");
|
|
6306
6376
|
const asTable = showTable && view === "table";
|
|
6307
|
-
const uid =
|
|
6377
|
+
const uid = useId17().replace(/[^\w-]/g, "");
|
|
6308
6378
|
const frameEl = useRef25(null);
|
|
6309
6379
|
const card = useContext5(CardTools);
|
|
6310
6380
|
const claim = card?.claim;
|
|
@@ -6560,17 +6630,17 @@ function Chart(props) {
|
|
|
6560
6630
|
const estimatedTone = marks.find((m) => m.estimated && m.kind === "bar")?.tone ?? keys[0]?.tone ?? "neutral";
|
|
6561
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) };
|
|
6562
6632
|
const legendFirst = !(look?.variant === "donut" && look.look !== "labels");
|
|
6563
|
-
const legend = keyed && !asTable && keys.length > 0 && !(look?.variant === "donut" && look.look === "table") && /* @__PURE__ */
|
|
6564
|
-
keys.map((key) => /* @__PURE__ */
|
|
6565
|
-
/* @__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 }),
|
|
6566
6636
|
key.name
|
|
6567
6637
|
] }, key.id)),
|
|
6568
|
-
estimated.length > 0 && /* @__PURE__ */
|
|
6569
|
-
/* @__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" }) }),
|
|
6570
6640
|
"Estimated"
|
|
6571
6641
|
] })
|
|
6572
6642
|
] });
|
|
6573
|
-
const viewSwitch = showTable && /* @__PURE__ */
|
|
6643
|
+
const viewSwitch = showTable && /* @__PURE__ */ jsx47(
|
|
6574
6644
|
Segmented,
|
|
6575
6645
|
{
|
|
6576
6646
|
size: "sm",
|
|
@@ -6584,7 +6654,7 @@ function Chart(props) {
|
|
|
6584
6654
|
}
|
|
6585
6655
|
);
|
|
6586
6656
|
const noun = look?.layout === "ring" ? "slices" : look?.layout === "rows" ? "rows" : "columns";
|
|
6587
|
-
return /* @__PURE__ */
|
|
6657
|
+
return /* @__PURE__ */ jsxs43(
|
|
6588
6658
|
"div",
|
|
6589
6659
|
{
|
|
6590
6660
|
className: cx9(
|
|
@@ -6602,11 +6672,11 @@ function Chart(props) {
|
|
|
6602
6672
|
},
|
|
6603
6673
|
children: [
|
|
6604
6674
|
toCard && createPortal8(viewSwitch, toCard),
|
|
6605
|
-
(showTable && !toCard || legendFirst && legend) && /* @__PURE__ */
|
|
6675
|
+
(showTable && !toCard || legendFirst && legend) && /* @__PURE__ */ jsxs43("div", { className: "ui-chart__head", children: [
|
|
6606
6676
|
legendFirst && legend,
|
|
6607
6677
|
!toCard && viewSwitch
|
|
6608
6678
|
] }),
|
|
6609
|
-
/* @__PURE__ */
|
|
6679
|
+
/* @__PURE__ */ jsxs43(
|
|
6610
6680
|
"div",
|
|
6611
6681
|
{
|
|
6612
6682
|
ref: frameEl,
|
|
@@ -6631,8 +6701,8 @@ function Chart(props) {
|
|
|
6631
6701
|
setSaid("");
|
|
6632
6702
|
},
|
|
6633
6703
|
children: [
|
|
6634
|
-
!spark && columnsLayout && scale.ticks.length > 0 && /* @__PURE__ */
|
|
6635
|
-
/* @__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(
|
|
6636
6706
|
"div",
|
|
6637
6707
|
{
|
|
6638
6708
|
ref: scroller,
|
|
@@ -6648,8 +6718,8 @@ function Chart(props) {
|
|
|
6648
6718
|
if (mark.right <= view2.left || mark.left >= view2.right) setOpenId(null);
|
|
6649
6719
|
else placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
6650
6720
|
},
|
|
6651
|
-
children: /* @__PURE__ */
|
|
6652
|
-
/* @__PURE__ */
|
|
6721
|
+
children: /* @__PURE__ */ jsxs43("div", { ref: plot, className: "ui-chart__plot", children: [
|
|
6722
|
+
/* @__PURE__ */ jsxs43(
|
|
6653
6723
|
"svg",
|
|
6654
6724
|
{
|
|
6655
6725
|
ref: svgEl,
|
|
@@ -6710,7 +6780,7 @@ function Chart(props) {
|
|
|
6710
6780
|
announce(mark.column, selectable ? mark.column : pick);
|
|
6711
6781
|
},
|
|
6712
6782
|
children: [
|
|
6713
|
-
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */
|
|
6783
|
+
!spark && columnsLayout && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx47(
|
|
6714
6784
|
"rect",
|
|
6715
6785
|
{
|
|
6716
6786
|
className: "ui-chart__band",
|
|
@@ -6723,7 +6793,7 @@ function Chart(props) {
|
|
|
6723
6793
|
frame.links && frame.bars.slice(0, -1).map((bar, i) => {
|
|
6724
6794
|
const from = byId.get(bar.id);
|
|
6725
6795
|
const to = byId.get(frame.bars[i + 1].id);
|
|
6726
|
-
return from && to ? /* @__PURE__ */
|
|
6796
|
+
return from && to ? /* @__PURE__ */ jsx47(
|
|
6727
6797
|
"line",
|
|
6728
6798
|
{
|
|
6729
6799
|
className: "ui-chart__carry",
|
|
@@ -6735,7 +6805,7 @@ function Chart(props) {
|
|
|
6735
6805
|
`carry-${bar.id}`
|
|
6736
6806
|
) : null;
|
|
6737
6807
|
}),
|
|
6738
|
-
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */
|
|
6808
|
+
!spark && columnsLayout && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx47(
|
|
6739
6809
|
"line",
|
|
6740
6810
|
{
|
|
6741
6811
|
className: "ui-chart__grid",
|
|
@@ -6746,7 +6816,7 @@ function Chart(props) {
|
|
|
6746
6816
|
},
|
|
6747
6817
|
`grid-${tick}`
|
|
6748
6818
|
)),
|
|
6749
|
-
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */
|
|
6819
|
+
!spark && columnsLayout && scale.ticks.includes(0) && /* @__PURE__ */ jsx47(
|
|
6750
6820
|
"line",
|
|
6751
6821
|
{
|
|
6752
6822
|
className: "ui-chart__zero",
|
|
@@ -6756,7 +6826,7 @@ function Chart(props) {
|
|
|
6756
6826
|
y2: px2(y(0))
|
|
6757
6827
|
}
|
|
6758
6828
|
),
|
|
6759
|
-
fades.size > 0 && /* @__PURE__ */
|
|
6829
|
+
fades.size > 0 && /* @__PURE__ */ jsx47("defs", { children: [...fades.values()].map((fade) => /* @__PURE__ */ jsxs43(
|
|
6760
6830
|
"linearGradient",
|
|
6761
6831
|
{
|
|
6762
6832
|
id: fade.id,
|
|
@@ -6766,15 +6836,15 @@ function Chart(props) {
|
|
|
6766
6836
|
y1: fade.up ? "1" : "0",
|
|
6767
6837
|
y2: fade.up ? "0" : "1",
|
|
6768
6838
|
children: [
|
|
6769
|
-
/* @__PURE__ */
|
|
6770
|
-
/* @__PURE__ */
|
|
6839
|
+
/* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-base", offset: "0" }),
|
|
6840
|
+
/* @__PURE__ */ jsx47("stop", { className: "ui-chart__fade-end", offset: "1" })
|
|
6771
6841
|
]
|
|
6772
6842
|
},
|
|
6773
6843
|
fade.id
|
|
6774
6844
|
)) }),
|
|
6775
6845
|
marks.filter((m) => m.kind === "bar").map((mark) => {
|
|
6776
6846
|
const fade = fadeOf(uid, mark, variant === "bridge");
|
|
6777
|
-
return /* @__PURE__ */
|
|
6847
|
+
return /* @__PURE__ */ jsx47(
|
|
6778
6848
|
"path",
|
|
6779
6849
|
{
|
|
6780
6850
|
className: cx9(
|
|
@@ -6789,7 +6859,7 @@ function Chart(props) {
|
|
|
6789
6859
|
);
|
|
6790
6860
|
}),
|
|
6791
6861
|
["casing", "stroke"].map((layer) => lines.flatMap(
|
|
6792
|
-
(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(
|
|
6793
6863
|
"line",
|
|
6794
6864
|
{
|
|
6795
6865
|
className: layer === "casing" ? "ui-chart__line-casing" : cx9(
|
|
@@ -6805,7 +6875,7 @@ function Chart(props) {
|
|
|
6805
6875
|
`${line.id}-${layer}-${i}`
|
|
6806
6876
|
) : null)
|
|
6807
6877
|
)),
|
|
6808
|
-
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(
|
|
6809
6879
|
"circle",
|
|
6810
6880
|
{
|
|
6811
6881
|
className: cx9("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
|
|
@@ -6816,8 +6886,8 @@ function Chart(props) {
|
|
|
6816
6886
|
`isolated-${line.id}-${i}`
|
|
6817
6887
|
) : null)),
|
|
6818
6888
|
geometry && lookDrawing(geometry, open?.column ?? null, pick),
|
|
6819
|
-
marks.map((mark) => /* @__PURE__ */
|
|
6820
|
-
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(
|
|
6821
6891
|
"rect",
|
|
6822
6892
|
{
|
|
6823
6893
|
className: "ui-chart__hit",
|
|
@@ -6826,7 +6896,7 @@ function Chart(props) {
|
|
|
6826
6896
|
y: px2(hitBand(mark.band).y),
|
|
6827
6897
|
height: px2(hitBand(mark.band).h)
|
|
6828
6898
|
}
|
|
6829
|
-
) : /* @__PURE__ */
|
|
6899
|
+
) : /* @__PURE__ */ jsx47(
|
|
6830
6900
|
"rect",
|
|
6831
6901
|
{
|
|
6832
6902
|
className: "ui-chart__hit",
|
|
@@ -6836,7 +6906,7 @@ function Chart(props) {
|
|
|
6836
6906
|
height: px2(mark.hit?.h ?? TARGET)
|
|
6837
6907
|
}
|
|
6838
6908
|
),
|
|
6839
|
-
/* @__PURE__ */
|
|
6909
|
+
/* @__PURE__ */ jsx47(
|
|
6840
6910
|
"rect",
|
|
6841
6911
|
{
|
|
6842
6912
|
"data-anchor": mark.id,
|
|
@@ -6851,8 +6921,8 @@ function Chart(props) {
|
|
|
6851
6921
|
]
|
|
6852
6922
|
}
|
|
6853
6923
|
),
|
|
6854
|
-
look?.variant === "donut" && look.look === "table" && /* @__PURE__ */
|
|
6855
|
-
!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(
|
|
6856
6926
|
"span",
|
|
6857
6927
|
{
|
|
6858
6928
|
className: cx9("ui-chart__period", pick === i && "is-selected"),
|
|
@@ -6863,46 +6933,46 @@ function Chart(props) {
|
|
|
6863
6933
|
] })
|
|
6864
6934
|
}
|
|
6865
6935
|
),
|
|
6866
|
-
/* @__PURE__ */
|
|
6867
|
-
/* @__PURE__ */
|
|
6868
|
-
open.rows ? /* @__PURE__ */
|
|
6869
|
-
open.rows.map((row) => /* @__PURE__ */
|
|
6870
|
-
/* @__PURE__ */
|
|
6871
|
-
/* @__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 }),
|
|
6872
6942
|
row.name
|
|
6873
6943
|
] }),
|
|
6874
|
-
/* @__PURE__ */
|
|
6944
|
+
/* @__PURE__ */ jsx47("span", { children: row.text })
|
|
6875
6945
|
] }, row.name)),
|
|
6876
|
-
open.total && /* @__PURE__ */
|
|
6877
|
-
/* @__PURE__ */
|
|
6878
|
-
/* @__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 })
|
|
6879
6949
|
] })
|
|
6880
|
-
] }) : /* @__PURE__ */
|
|
6881
|
-
(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 })
|
|
6882
6952
|
] }) })
|
|
6883
6953
|
]
|
|
6884
6954
|
}
|
|
6885
6955
|
),
|
|
6886
6956
|
!legendFirst && legend,
|
|
6887
|
-
/* @__PURE__ */
|
|
6888
|
-
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(
|
|
6889
6959
|
"div",
|
|
6890
6960
|
{
|
|
6891
6961
|
className: "ui-table-scroll",
|
|
6892
6962
|
role: "region",
|
|
6893
6963
|
tabIndex: 0,
|
|
6894
6964
|
"aria-label": `${title}, as a table. Scroll for more columns.`,
|
|
6895
|
-
children: /* @__PURE__ */
|
|
6896
|
-
/* @__PURE__ */
|
|
6897
|
-
/* @__PURE__ */
|
|
6898
|
-
/* @__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: [
|
|
6899
6969
|
row.column.label,
|
|
6900
|
-
row.column.estimated && /* @__PURE__ */
|
|
6970
|
+
row.column.estimated && /* @__PURE__ */ jsxs43(Fragment21, { children: [
|
|
6901
6971
|
" ",
|
|
6902
|
-
/* @__PURE__ */
|
|
6972
|
+
/* @__PURE__ */ jsx47("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
6903
6973
|
] })
|
|
6904
6974
|
] }),
|
|
6905
|
-
row.cells.map((cell, j) => /* @__PURE__ */
|
|
6975
|
+
row.cells.map((cell, j) => /* @__PURE__ */ jsx47("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
|
|
6906
6976
|
] }, `${row.column.label}-${i}`)) })
|
|
6907
6977
|
] })
|
|
6908
6978
|
}
|
|
@@ -6915,7 +6985,7 @@ function Chart(props) {
|
|
|
6915
6985
|
// src/AccentPicker.tsx
|
|
6916
6986
|
import { forwardRef as forwardRef12 } from "react";
|
|
6917
6987
|
import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
|
|
6918
|
-
import { jsx as
|
|
6988
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
6919
6989
|
var AccentPicker = forwardRef12(function AccentPicker2({
|
|
6920
6990
|
value,
|
|
6921
6991
|
onChange,
|
|
@@ -6924,7 +6994,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6924
6994
|
"aria-label": label = "Accent",
|
|
6925
6995
|
...rest
|
|
6926
6996
|
}, ref) {
|
|
6927
|
-
return /* @__PURE__ */
|
|
6997
|
+
return /* @__PURE__ */ jsx48(
|
|
6928
6998
|
"div",
|
|
6929
6999
|
{
|
|
6930
7000
|
...rest,
|
|
@@ -6935,7 +7005,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6935
7005
|
"aria-label": label,
|
|
6936
7006
|
children: options.map((accent) => {
|
|
6937
7007
|
const title = accent.charAt(0).toUpperCase() + accent.slice(1);
|
|
6938
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ jsx48(
|
|
6939
7009
|
"button",
|
|
6940
7010
|
{
|
|
6941
7011
|
type: "button",
|
|
@@ -6956,7 +7026,7 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
6956
7026
|
// src/TopBar.tsx
|
|
6957
7027
|
import { Fragment as Fragment22 } from "react";
|
|
6958
7028
|
import { prism as prism3, safeUrl as safeUrl6, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
6959
|
-
import { Fragment as Fragment23, jsx as
|
|
7029
|
+
import { Fragment as Fragment23, jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6960
7030
|
function TopBar({
|
|
6961
7031
|
brand,
|
|
6962
7032
|
word = "Strategy",
|
|
@@ -6968,20 +7038,20 @@ function TopBar({
|
|
|
6968
7038
|
className,
|
|
6969
7039
|
...rest
|
|
6970
7040
|
}) {
|
|
6971
|
-
return /* @__PURE__ */
|
|
6972
|
-
brand ?? /* @__PURE__ */
|
|
6973
|
-
/* @__PURE__ */
|
|
6974
|
-
/* @__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 })
|
|
6975
7045
|
] }),
|
|
6976
7046
|
view,
|
|
6977
|
-
/* @__PURE__ */
|
|
7047
|
+
/* @__PURE__ */ jsx49("span", { className: "spacer" }),
|
|
6978
7048
|
version,
|
|
6979
7049
|
theme,
|
|
6980
7050
|
account
|
|
6981
7051
|
] }) });
|
|
6982
7052
|
}
|
|
6983
7053
|
function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
6984
|
-
return /* @__PURE__ */
|
|
7054
|
+
return /* @__PURE__ */ jsx49("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
|
|
6985
7055
|
const current = item.id === active;
|
|
6986
7056
|
const linkProps = {
|
|
6987
7057
|
className: current ? "cur" : void 0,
|
|
@@ -6990,13 +7060,13 @@ function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
|
6990
7060
|
"aria-current": current ? "page" : void 0,
|
|
6991
7061
|
children: item.label
|
|
6992
7062
|
};
|
|
6993
|
-
return /* @__PURE__ */
|
|
7063
|
+
return /* @__PURE__ */ jsx49(Fragment22, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx49("a", { ...linkProps }) }, item.id);
|
|
6994
7064
|
}) });
|
|
6995
7065
|
}
|
|
6996
7066
|
var BADGE = { live: "Live", archive: "Archive" };
|
|
6997
7067
|
function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
|
|
6998
7068
|
const current = versions.find((v) => v.value === value);
|
|
6999
|
-
return /* @__PURE__ */
|
|
7069
|
+
return /* @__PURE__ */ jsx49("div", { className: "vsw", children: /* @__PURE__ */ jsx49(
|
|
7000
7070
|
Dropdown,
|
|
7001
7071
|
{
|
|
7002
7072
|
variant: "select",
|
|
@@ -7007,9 +7077,9 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
7007
7077
|
chevron: false,
|
|
7008
7078
|
defaultOpen,
|
|
7009
7079
|
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
7010
|
-
triggerContent: /* @__PURE__ */
|
|
7011
|
-
/* @__PURE__ */
|
|
7012
|
-
/* @__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" })
|
|
7013
7083
|
] }),
|
|
7014
7084
|
items: versions.map((v) => ({
|
|
7015
7085
|
label: v.label,
|
|
@@ -7017,10 +7087,10 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
7017
7087
|
badge: BADGE[v.badge ?? "archive"],
|
|
7018
7088
|
selected: v.value === value
|
|
7019
7089
|
})),
|
|
7020
|
-
row: (item, props) => /* @__PURE__ */
|
|
7021
|
-
/* @__PURE__ */
|
|
7022
|
-
/* @__PURE__ */
|
|
7023
|
-
/* @__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") } })
|
|
7024
7094
|
] }),
|
|
7025
7095
|
onSelect: (picked) => {
|
|
7026
7096
|
if (picked != null) onChange?.(String(picked));
|
|
@@ -7049,7 +7119,7 @@ function AccountMenu2({
|
|
|
7049
7119
|
defaultOpen
|
|
7050
7120
|
}) {
|
|
7051
7121
|
const mark = initialsOf(name, email);
|
|
7052
|
-
return /* @__PURE__ */
|
|
7122
|
+
return /* @__PURE__ */ jsx49("div", { className: "acct on", children: /* @__PURE__ */ jsx49(
|
|
7053
7123
|
Dropdown,
|
|
7054
7124
|
{
|
|
7055
7125
|
variant: "menu",
|
|
@@ -7060,22 +7130,22 @@ function AccountMenu2({
|
|
|
7060
7130
|
defaultOpen,
|
|
7061
7131
|
ariaLabel: "Account",
|
|
7062
7132
|
triggerContent: mark,
|
|
7063
|
-
header: /* @__PURE__ */
|
|
7064
|
-
/* @__PURE__ */
|
|
7065
|
-
/* @__PURE__ */
|
|
7066
|
-
/* @__PURE__ */
|
|
7067
|
-
/* @__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 })
|
|
7068
7138
|
] })
|
|
7069
7139
|
] }),
|
|
7070
7140
|
items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
|
|
7071
|
-
row: (item, props) => /* @__PURE__ */
|
|
7141
|
+
row: (item, props) => /* @__PURE__ */ jsxs44(
|
|
7072
7142
|
"a",
|
|
7073
7143
|
{
|
|
7074
7144
|
...props,
|
|
7075
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}`),
|
|
7076
7146
|
className: [props.className, !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
7077
7147
|
children: [
|
|
7078
|
-
item.icon && /* @__PURE__ */
|
|
7148
|
+
item.icon && /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
7079
7149
|
item.label
|
|
7080
7150
|
]
|
|
7081
7151
|
}
|
|
@@ -7150,6 +7220,7 @@ export {
|
|
|
7150
7220
|
Tabs,
|
|
7151
7221
|
TextArea,
|
|
7152
7222
|
TextField,
|
|
7223
|
+
ThemeChoice,
|
|
7153
7224
|
ThemeToggle,
|
|
7154
7225
|
Timeline,
|
|
7155
7226
|
Toast,
|