@crewlethq/ui 0.4.3 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +888 -24
- package/dist/Accordion/index.js +2 -2
- package/dist/AddPill/index.js +1 -1
- package/dist/{AddPill-DFWXYLIQ.css → AddPill-IJQYCY6C.css} +9 -0
- package/dist/AppShell/AppShell.d.ts +26 -5
- package/dist/AppShell/index.js +3 -3
- package/dist/{AppShell-NVE6LHNI.css → AppShell-XARELGIH.css} +178 -25
- package/dist/Avatar/Avatar.d.ts +85 -40
- package/dist/Avatar/AvatarStack.d.ts +76 -0
- package/dist/Avatar/index.d.ts +5 -2
- package/dist/Avatar/index.js +1 -1
- package/dist/Avatar-XID7Z74C.css +200 -0
- package/dist/AvatarStack-GEJBNV7E.css +72 -0
- package/dist/BrandLockup/index.js +1 -1
- package/dist/{BrandLockup-6ISDEHPJ.css → BrandLockup-JKGXFCZF.css} +25 -19
- package/dist/Button/Button.d.ts +7 -2
- package/dist/Button/index.js +1 -1
- package/dist/{Button-D4J6B4MA.css → Button-X4B2TJAQ.css} +50 -19
- package/dist/Callout/index.js +1 -1
- package/dist/Canvas/index.js +4 -4
- package/dist/Card/Card.d.ts +9 -5
- package/dist/Card/index.js +1 -1
- package/dist/{Card-RLR254LD.css → Card-GLP7SUV6.css} +25 -18
- package/dist/Charts/BarList.d.ts +18 -1
- package/dist/Charts/ChartTooltip.d.ts +68 -0
- package/dist/Charts/StackedBar.d.ts +25 -7
- package/dist/Charts/StackedColumns.d.ts +112 -0
- package/dist/Charts/TimeSeries.d.ts +33 -2
- package/dist/Charts/dataColor.d.ts +22 -14
- package/dist/Charts/index.d.ts +6 -0
- package/dist/Charts/index.js +1 -1
- package/dist/Charts/useChartHover.d.ts +56 -0
- package/dist/Charts-B3YEF7R4.css +742 -0
- package/dist/Checkbox/index.js +1 -1
- package/dist/{Checkbox-VGW26YLQ.css → Checkbox-BOXQ747I.css} +2 -2
- package/dist/CodeBlock/index.js +4 -4
- package/dist/Combobox/index.js +5 -5
- package/dist/CommandPalette/CommandPalette.d.ts +97 -6
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +9 -7
- package/dist/CommandPalette-C5AMKGN2.css +259 -0
- package/dist/Copyable/index.js +3 -3
- package/dist/DataTable/index.js +7 -7
- package/dist/{DataTable-ITNACQ2X.css → DataTable-OLHPF7D4.css} +44 -43
- package/dist/DataView/index.js +14 -14
- package/dist/{DataView-256YF32J.css → DataView-N6JX464S.css} +5 -4
- package/dist/DateTimePicker/index.js +5 -5
- package/dist/DiffList/index.js +1 -1
- package/dist/Disclosure/index.js +2 -2
- package/dist/EntityChip/EntityChip.d.ts +9 -12
- package/dist/EntityChip/index.d.ts +1 -1
- package/dist/EntityChip/index.js +2 -2
- package/dist/ErrorBoundary/index.js +2 -2
- package/dist/{ErrorBoundary-ME36CQTA.css → ErrorBoundary-U2PA3LY2.css} +4 -4
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-VQGNMJDI.css → IconButton-TVEUWK6L.css} +2 -2
- package/dist/ImageUpload/ImageUpload.d.ts +10 -7
- package/dist/ImageUpload/index.js +2 -2
- package/dist/{ImageUpload-HKFIZR6D.css → ImageUpload-YCHJMUGX.css} +24 -10
- package/dist/Input/index.js +2 -2
- package/dist/Kbd/Kbd.d.ts +14 -4
- package/dist/Kbd/index.js +1 -1
- package/dist/Kbd-JPLDVJIP.css +71 -0
- package/dist/Layer/index.js +1 -1
- package/dist/Link/index.js +1 -1
- package/dist/List/index.js +1 -1
- package/dist/{List-XTHESXLR.css → List-MYJIV6MP.css} +12 -2
- package/dist/ListInput/index.js +5 -5
- package/dist/Listbox/index.js +2 -2
- package/dist/Listbox/useListbox.d.ts +16 -0
- package/dist/Listbox/useOptionKeys.d.ts +12 -1
- package/dist/{Listbox-X2DOTSQA.css → Listbox-6WJNJQVQ.css} +60 -7
- package/dist/Menu/index.js +4 -4
- package/dist/{Menu-6DE7I66I.css → Menu-BT5PMFJI.css} +15 -0
- package/dist/Meter/Meter.d.ts +103 -16
- package/dist/Meter/index.d.ts +2 -2
- package/dist/Meter/index.js +1 -1
- package/dist/{Meter-SKOOXQBC.css → Meter-5VCSFMZW.css} +46 -7
- package/dist/Modal/index.js +4 -4
- package/dist/{Modal-XYQJ4BL6.css → Modal-JAYBS2KS.css} +13 -4
- package/dist/OrgLabel/OrgLabel.d.ts +60 -24
- package/dist/OrgLabel/index.d.ts +1 -1
- package/dist/OrgLabel/index.js +2 -1
- package/dist/{OrgLabel-D7U6QJZD.css → OrgLabel-CR233G34.css} +9 -18
- package/dist/OrgNode/index.js +3 -2
- package/dist/OrgTable/OrgTable.d.ts +2 -2
- package/dist/OrgTable/index.js +8 -7
- package/dist/Popover/index.js +2 -2
- package/dist/PricingCard/index.js +3 -3
- package/dist/{PricingCard-JFI7RYXP.css → PricingCard-7EFXRSD2.css} +4 -5
- package/dist/SearchTrigger/SearchTrigger.d.ts +23 -4
- package/dist/SearchTrigger/index.d.ts +1 -1
- package/dist/SearchTrigger/index.js +1 -1
- package/dist/SearchTrigger-Z5D4AAY7.css +112 -0
- package/dist/SegmentedControl/index.js +2 -2
- package/dist/SegmentedMeter/SegmentedMeter.d.ts +107 -0
- package/dist/SegmentedMeter/index.d.ts +3 -0
- package/dist/SegmentedMeter/index.js +2 -0
- package/dist/SegmentedMeter-KQNML2TW.css +109 -0
- package/dist/Select/index.js +3 -3
- package/dist/{Select-2X77FSWR.css → Select-E24U5LBC.css} +34 -0
- package/dist/Shortcut/index.js +2 -2
- package/dist/SidebarNav/SidebarNav.d.ts +85 -25
- package/dist/SidebarNav/index.d.ts +1 -1
- package/dist/SidebarNav/index.js +1 -1
- package/dist/SidebarNav-X5NLZNWA.css +424 -0
- package/dist/StatCard/StatCard.d.ts +59 -12
- package/dist/StatCard/index.d.ts +1 -1
- package/dist/StatCard/index.js +1 -1
- package/dist/StatCard-KPAFD4E2.css +204 -0
- package/dist/StatGroup/index.js +1 -1
- package/dist/{StatGroup-TGB6AEKM.css → StatGroup-HVG6O62W.css} +8 -9
- package/dist/StatusDot/StatusDot.d.ts +24 -6
- package/dist/StatusDot/index.js +1 -1
- package/dist/StatusDot-7OMCQCZF.css +186 -0
- package/dist/Stepper/Stepper.d.ts +78 -0
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +4 -0
- package/dist/Stepper-HW4JM3YH.css +176 -0
- package/dist/Table/index.js +1 -1
- package/dist/{Table-MDOLVUAW.css → Table-TGCS4C3F.css} +14 -4
- package/dist/Tabs/index.js +1 -1
- package/dist/{Tabs-VLICJFVB.css → Tabs-XCNPHA7B.css} +79 -27
- package/dist/Tag/Tag.d.ts +29 -22
- package/dist/Tag/index.js +2 -2
- package/dist/{Tag-VNZEYLB6.css → Tag-GBE7LQJP.css} +82 -83
- package/dist/TagsInput/index.js +6 -6
- package/dist/ThemeSwitcher/ThemeSwitcher.d.ts +53 -21
- package/dist/ThemeSwitcher/index.d.ts +3 -3
- package/dist/ThemeSwitcher/index.js +4 -3
- package/dist/ThemeSwitcher/preferences.d.ts +19 -5
- package/dist/ThemeToggle/ThemeToggle.d.ts +40 -0
- package/dist/ThemeToggle/index.d.ts +2 -0
- package/dist/ThemeToggle/index.js +5 -0
- package/dist/TimeWindowPicker/index.js +8 -8
- package/dist/Toaster/index.js +2 -2
- package/dist/Toolbar/index.js +2 -2
- package/dist/{Toolbar-IP6LXN45.css → Toolbar-HUOSMNTH.css} +3 -1
- package/dist/Tooltip/index.js +2 -2
- package/dist/Tree/index.d.ts +2 -2
- package/dist/Tree/index.js +1 -1
- package/dist/Tree/layout.d.ts +103 -28
- package/dist/TreeCanvas/TreeCanvas.d.ts +60 -14
- package/dist/TreeCanvas/index.d.ts +1 -1
- package/dist/TreeCanvas/index.js +6 -6
- package/dist/TreeCanvas/motion.d.ts +3 -2
- package/dist/{TreeCanvas-WBNQPHC7.css → TreeCanvas-HVOV4SQN.css} +154 -30
- package/dist/TreeGrid/index.js +4 -4
- package/dist/{chunk-F6OE5FH3.js → chunk-2FPENTCF.js} +1 -1
- package/dist/chunk-4AK52VHB.js +88 -0
- package/dist/{chunk-7EM5T4ME.js → chunk-4IQD3HUQ.js} +2 -2
- package/dist/{chunk-YODNNSZL.js → chunk-4PZ6FJKW.js} +43 -13
- package/dist/{chunk-F27EPQ7D.js → chunk-4UQ7SMPK.js} +1 -1
- package/dist/chunk-5QWIJSQM.js +73 -0
- package/dist/{chunk-GTOUGQQK.js → chunk-6MU7HNB4.js} +13 -10
- package/dist/{chunk-S2XHHEW4.js → chunk-74KMX7YH.js} +4 -4
- package/dist/{chunk-WNI2WSJF.js → chunk-7KBNFFM3.js} +1 -1
- package/dist/{chunk-DD5BBGBE.js → chunk-AUS5FNQE.js} +9 -5
- package/dist/{chunk-CMEE37QJ.js → chunk-BMYPGGPV.js} +4 -4
- package/dist/{chunk-H4FBTAYS.js → chunk-BNCCEER3.js} +8 -8
- package/dist/chunk-C5WJUZVR.js +56 -0
- package/dist/{chunk-5WS6L6FA.js → chunk-CAIHUYXV.js} +9 -9
- package/dist/{chunk-XV6WRMBC.js → chunk-CQY5NTRS.js} +4 -1
- package/dist/{chunk-UOGSZKLT.js → chunk-D6EVJUGU.js} +2 -2
- package/dist/{chunk-6ZFVFA56.js → chunk-DHPUMOTX.js} +2 -2
- package/dist/{chunk-HZ5XZNPS.js → chunk-DS2C73RJ.js} +3 -3
- package/dist/{chunk-O6232G37.js → chunk-DSUY5F4E.js} +17 -5
- package/dist/{chunk-Q4ZPPART.js → chunk-EFYPAJT3.js} +3 -3
- package/dist/{chunk-WQX73TWF.js → chunk-ERVO6OUF.js} +18 -17
- package/dist/{chunk-BZYDZBAN.js → chunk-ETYEBKR4.js} +3 -3
- package/dist/{chunk-34VGEDVV.js → chunk-FD5UEN6X.js} +30 -30
- package/dist/{chunk-5SDBMKUO.js → chunk-FIFNP6PL.js} +3 -3
- package/dist/{chunk-7HPRF5XN.js → chunk-FUF52K7E.js} +98 -16
- package/dist/{chunk-5KPQ6D7N.js → chunk-FZVJDJFN.js} +2 -2
- package/dist/chunk-IA232OTU.js +156 -0
- package/dist/{chunk-2EOKFKHX.js → chunk-IG27QX7Q.js} +7 -7
- package/dist/chunk-IKB6HFGK.js +55 -0
- package/dist/{chunk-FBZAKNSX.js → chunk-IPVQKAHO.js} +10 -7
- package/dist/{chunk-3EYF6HKB.js → chunk-IVFJD7WY.js} +28 -9
- package/dist/{chunk-WOYYD2YR.js → chunk-JGRNTBF2.js} +11 -11
- package/dist/chunk-K3OWD7BJ.js +121 -0
- package/dist/{chunk-BJSKPEZI.js → chunk-KD4H66L6.js} +7 -20
- package/dist/{chunk-SFZOKW2G.js → chunk-KJ34ZBBI.js} +8 -3
- package/dist/{chunk-HQNHV7D6.js → chunk-LFHCXZO5.js} +6 -6
- package/dist/{chunk-LWKJQTOM.js → chunk-MICH6QSJ.js} +1 -1
- package/dist/chunk-N3DPO6HG.js +226 -0
- package/dist/{chunk-S4GZWSKR.js → chunk-OM5E3TTK.js} +1 -1
- package/dist/{chunk-3QRYCPXQ.js → chunk-OPKIKM35.js} +6 -6
- package/dist/{chunk-5EKIWVOR.js → chunk-PGRPNDWM.js} +2 -2
- package/dist/{chunk-LFJ6UJTI.js → chunk-PQNILU27.js} +9 -9
- package/dist/{chunk-QNCVHRZL.js → chunk-QVAFL2LE.js} +1 -1
- package/dist/{chunk-QEUY3A5P.js → chunk-QY7UU5ZB.js} +3 -2
- package/dist/{chunk-ITHXJHBB.js → chunk-R25RGPUB.js} +1 -0
- package/dist/{chunk-KLJCCMF3.js → chunk-R6735B37.js} +2 -2
- package/dist/{chunk-3ZP55QZE.js → chunk-R6FBDTP3.js} +4 -4
- package/dist/{chunk-7FZ53WDJ.js → chunk-RIAZM6L3.js} +1 -1
- package/dist/chunk-RJM4QCGG.js +550 -0
- package/dist/{chunk-NTRZGNEX.js → chunk-S3BCVWTU.js} +215 -46
- package/dist/chunk-S7KW47IQ.js +121 -0
- package/dist/{chunk-OFHBK7RI.js → chunk-SJQ546ID.js} +34 -14
- package/dist/{chunk-D35VTV2Z.js → chunk-SV7QAONL.js} +1 -1
- package/dist/{chunk-IAJLHVUA.js → chunk-TIWAHZZ6.js} +1 -1
- package/dist/{chunk-2PRH365R.js → chunk-UA7O3KKJ.js} +1 -1
- package/dist/{chunk-NPZY6YYL.js → chunk-UG5ZMAXW.js} +6 -6
- package/dist/{chunk-FEFTGVMF.js → chunk-V2N3BMOT.js} +7 -2
- package/dist/{chunk-NDCATSW7.js → chunk-V34H2YCY.js} +1 -1
- package/dist/chunk-WIATRXEJ.js +22 -0
- package/dist/{chunk-5C5YMZQU.js → chunk-WOFOMTGB.js} +16 -10
- package/dist/{chunk-QYOFACSP.js → chunk-WSOFKOLP.js} +3 -3
- package/dist/{chunk-MNAXYY3R.js → chunk-WUVZDFHS.js} +31 -11
- package/dist/{chunk-UG46QBLT.js → chunk-YIMOT5OO.js} +10 -10
- package/dist/{chunk-2ZQMA2WB.js → chunk-ZPSOF6VL.js} +2 -2
- package/dist/generated/index.d.ts +3 -0
- package/dist/generated/index.js +66 -62
- package/dist/index.js +66 -62
- package/dist/styles.css +2719 -799
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/tone.d.ts +7 -12
- package/package.json +4 -4
- package/scripts/check-css-literals.mjs +159 -23
- package/scripts/check-css-variables.mjs +5 -3
- package/scripts/css-source.mjs +97 -5
- package/dist/Avatar-P2KRQM2B.css +0 -156
- package/dist/Charts-D7G2BSXH.css +0 -277
- package/dist/CommandPalette-CSJDUCQA.css +0 -115
- package/dist/Kbd-W66MXQI5.css +0 -61
- package/dist/SearchTrigger-QXOYAUUY.css +0 -79
- package/dist/SidebarNav-QGSFKZYA.css +0 -319
- package/dist/StatCard-KYPKZUWX.css +0 -111
- package/dist/StatusDot-HA2L2FSX.css +0 -84
- package/dist/chunk-22O7LAW2.js +0 -41
- package/dist/chunk-2HQR4U4D.js +0 -143
- package/dist/chunk-ESCO4XYW.js +0 -144
- package/dist/chunk-F4PJZ4ED.js +0 -245
- package/dist/chunk-PNFASD6F.js +0 -98
- package/dist/chunk-PZSWF74H.js +0 -15
- /package/dist/{chunk-ZCR6YGQ4.js → chunk-PKIN4IMB.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './List-
|
|
3
|
+
import './List-MYJIV6MP.css';
|
|
4
4
|
import { createContext, useContext, Children, isValidElement, cloneElement } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { CircleAlertGlyph } from '@crewlethq/icons/glyphs';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
var ListContext = createContext({ variant: "divided", templated: false });
|
|
@@ -36,7 +36,7 @@ function ListItem({
|
|
|
36
36
|
const interactive = href !== void 0 || onClick !== void 0 || asChild;
|
|
37
37
|
const contents = (words) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
38
|
tone === "danger" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
39
|
+
/* @__PURE__ */ jsx(CircleAlertGlyph, { className: "crewlet-list__danger-mark", size: "sm" }),
|
|
40
40
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: dangerLabel }),
|
|
41
41
|
" "
|
|
42
42
|
] }) : null,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useHeadingLevel, headingTag, HeadingLevelProvider, nextHeadingLevel } from './chunk-PQADV6P6.js';
|
|
2
|
-
import { IconButton } from './chunk-
|
|
2
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
3
3
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './Input-2PU5CPKK.css';
|
|
6
6
|
import { forwardRef, useRef, useState, useImperativeHandle, useEffect, useId } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { XGlyph } from '@crewlethq/icons/glyphs';
|
|
8
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
var Input = forwardRef(function Input2({
|
|
@@ -68,7 +68,7 @@ var Input = forwardRef(function Input2({
|
|
|
68
68
|
}
|
|
69
69
|
),
|
|
70
70
|
trailing ? /* @__PURE__ */ jsx("span", { className: "crewlet-input__trailing", children: trailing }) : null,
|
|
71
|
-
onClear && filled ? /* @__PURE__ */ jsx("span", { className: "crewlet-input__clear", children: /* @__PURE__ */ jsx(IconButton, { size: "sm", variant: "ghost", label: clearLabel, icon: /* @__PURE__ */ jsx(
|
|
71
|
+
onClear && filled ? /* @__PURE__ */ jsx("span", { className: "crewlet-input__clear", children: /* @__PURE__ */ jsx(IconButton, { size: "sm", variant: "ghost", label: clearLabel, icon: /* @__PURE__ */ jsx(XGlyph, { size: "xs" }), onClick: clear, disabled }) }) : null
|
|
72
72
|
]
|
|
73
73
|
}
|
|
74
74
|
);
|
|
@@ -86,8 +86,20 @@ var Textarea = forwardRef(function Textarea2({ error = false, autoResize = false
|
|
|
86
86
|
if (!autoResize) return;
|
|
87
87
|
const el = localRef.current;
|
|
88
88
|
if (!el) return;
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const measure = () => {
|
|
90
|
+
el.style.height = "auto";
|
|
91
|
+
const style = getComputedStyle(el);
|
|
92
|
+
const border = style.boxSizing === "border-box" ? Number.parseFloat(style.borderTopWidth || "0") + Number.parseFloat(style.borderBottomWidth || "0") : 0;
|
|
93
|
+
el.style.height = `${el.scrollHeight + (Number.isFinite(border) ? border : 0)}px`;
|
|
94
|
+
};
|
|
95
|
+
measure();
|
|
96
|
+
el.addEventListener("input", measure);
|
|
97
|
+
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(measure) : null;
|
|
98
|
+
resize?.observe(el);
|
|
99
|
+
return () => {
|
|
100
|
+
el.removeEventListener("input", measure);
|
|
101
|
+
resize?.disconnect();
|
|
102
|
+
};
|
|
91
103
|
}, [autoResize, value]);
|
|
92
104
|
const control = /* @__PURE__ */ jsx(
|
|
93
105
|
"textarea",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
2
|
-
import './SearchTrigger-
|
|
2
|
+
import './SearchTrigger-Z5D4AAY7.css';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
import { SearchGlyph } from '@crewlethq/icons/glyphs';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var SearchTrigger = forwardRef(function SearchTrigger2({ label = "Search", shortcut, keyshortcuts, icon, className, type = "button", ...rest }, ref) {
|
|
7
|
+
var SearchTrigger = forwardRef(function SearchTrigger2({ label = "Search", variant = "rail", shortcut, keyshortcuts, icon, className, type = "button", ...rest }, ref) {
|
|
8
8
|
return /* @__PURE__ */ jsxs(
|
|
9
9
|
"button",
|
|
10
10
|
{
|
|
11
11
|
...rest,
|
|
12
12
|
ref,
|
|
13
13
|
type,
|
|
14
|
-
className: cx("crewlet-search-trigger", className),
|
|
14
|
+
className: cx("crewlet-search-trigger", `crewlet-search-trigger--${variant}`, className),
|
|
15
15
|
"aria-label": label,
|
|
16
16
|
"aria-keyshortcuts": keyshortcuts,
|
|
17
17
|
children: [
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Menu } from './chunk-
|
|
1
|
+
import { Menu } from './chunk-IPVQKAHO.js';
|
|
2
2
|
import { EmptyValue } from './chunk-EUCC37WY.js';
|
|
3
|
-
import { Modal } from './chunk-
|
|
3
|
+
import { Modal } from './chunk-IG27QX7Q.js';
|
|
4
4
|
import { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
|
|
5
|
-
import { Checkbox } from './chunk-
|
|
5
|
+
import { Checkbox } from './chunk-UA7O3KKJ.js';
|
|
6
6
|
import { useClipboard } from './chunk-5VNUYO76.js';
|
|
7
|
-
import { IconButton } from './chunk-
|
|
8
|
-
import { Button } from './chunk-
|
|
7
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
8
|
+
import { Button } from './chunk-ETYEBKR4.js';
|
|
9
9
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
10
10
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
11
|
-
import './DataTable-
|
|
11
|
+
import './DataTable-OLHPF7D4.css';
|
|
12
12
|
import React, { useState, useCallback, useMemo, useRef, useLayoutEffect, useEffect, useId } from 'react';
|
|
13
13
|
import { createPortal } from 'react-dom';
|
|
14
|
-
import { CheckGlyph,
|
|
14
|
+
import { CheckGlyph, CircleAlertGlyph, CopyGlyph, ChevronsLeftGlyph, ChevronLeftGlyph, ChevronRightGlyph, ChevronsRightGlyph, SettingsGlyph, GripVerticalGlyph, ChevronUpGlyph, ChevronDownGlyph, TrashGlyph, ArrowUpGlyph, ArrowDownGlyph, ChevronsUpDownGlyph, RotateCcwGlyph } from '@crewlethq/icons/glyphs';
|
|
15
15
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
16
16
|
|
|
17
17
|
var CopyableCell = ({
|
|
@@ -39,7 +39,7 @@ var CopyableCell = ({
|
|
|
39
39
|
onClick: onCopy,
|
|
40
40
|
"aria-label": ariaLabel || "Copy to clipboard",
|
|
41
41
|
title: ariaLabel || "Copy to clipboard",
|
|
42
|
-
children: clipboard.state === "copied" ? /* @__PURE__ */ jsx(CheckGlyph, { size: "sm" }) : clipboard.state === "failed" ? /* @__PURE__ */ jsx(
|
|
42
|
+
children: clipboard.state === "copied" ? /* @__PURE__ */ jsx(CheckGlyph, { size: "sm" }) : clipboard.state === "failed" ? /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(CopyGlyph, { size: "sm" })
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
45
|
/* @__PURE__ */ jsx("span", { role: "status", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: clipboard.state === "copied" ? copiedLabel : clipboard.state === "failed" ? failedLabel : "" }) })
|
|
@@ -225,7 +225,7 @@ var DataTable = ({
|
|
|
225
225
|
itemsPerPageOptions = [5, 10, 20, 50, 100],
|
|
226
226
|
onRowAction = null,
|
|
227
227
|
actionLabel = "Delete",
|
|
228
|
-
actionIcon = /* @__PURE__ */ jsx(
|
|
228
|
+
actionIcon = /* @__PURE__ */ jsx(TrashGlyph, { size: "md" }),
|
|
229
229
|
getRowKey,
|
|
230
230
|
rowKey,
|
|
231
231
|
emptyMessage = "No data available",
|
|
@@ -551,6 +551,7 @@ var DataTable = ({
|
|
|
551
551
|
const el = scrollRef.current;
|
|
552
552
|
if (!el) return;
|
|
553
553
|
let lastWidth = el.clientWidth;
|
|
554
|
+
if (typeof ResizeObserver !== "function") return;
|
|
554
555
|
const observer = new ResizeObserver(() => {
|
|
555
556
|
const w = el.clientWidth;
|
|
556
557
|
if (w > 0 && w !== lastWidth) {
|
|
@@ -919,7 +920,7 @@ var DataTable = ({
|
|
|
919
920
|
if (!column) return null;
|
|
920
921
|
const isSortable = column.sortable !== false;
|
|
921
922
|
const isActive = effectiveSort.key === columnKey && effectiveSort.direction !== null;
|
|
922
|
-
const arrow = !isSortable ? null : isActive ? effectiveSort.direction === "asc" ? /* @__PURE__ */ jsx(
|
|
923
|
+
const arrow = !isSortable ? null : isActive ? effectiveSort.direction === "asc" ? /* @__PURE__ */ jsx(ArrowUpGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(ArrowDownGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(ChevronsUpDownGlyph, { size: "sm" });
|
|
923
924
|
const ariaSort = isActive ? effectiveSort.direction === "asc" ? "ascending" : "descending" : void 0;
|
|
924
925
|
const isSticky = column.sticky === "right";
|
|
925
926
|
if (isCompact) {
|
|
@@ -1051,7 +1052,7 @@ var DataTable = ({
|
|
|
1051
1052
|
},
|
|
1052
1053
|
"aria-label": labels.resetColumns,
|
|
1053
1054
|
title: labels.resetColumns,
|
|
1054
|
-
children: /* @__PURE__ */ jsx(
|
|
1055
|
+
children: /* @__PURE__ */ jsx(RotateCcwGlyph, { size: "md" })
|
|
1055
1056
|
}
|
|
1056
1057
|
),
|
|
1057
1058
|
/* @__PURE__ */ jsx(
|
|
@@ -1215,7 +1216,7 @@ var DataTable = ({
|
|
|
1215
1216
|
onClick: () => goToPage(1),
|
|
1216
1217
|
disabled: currentPage <= 1,
|
|
1217
1218
|
label: labels.firstPage,
|
|
1218
|
-
icon: /* @__PURE__ */ jsx(
|
|
1219
|
+
icon: /* @__PURE__ */ jsx(ChevronsLeftGlyph, { size: "md" })
|
|
1219
1220
|
}
|
|
1220
1221
|
),
|
|
1221
1222
|
/* @__PURE__ */ jsx(
|
|
@@ -1256,7 +1257,7 @@ var DataTable = ({
|
|
|
1256
1257
|
onClick: () => goToPage(totalPages),
|
|
1257
1258
|
disabled: currentPage >= totalPages,
|
|
1258
1259
|
label: labels.lastPage,
|
|
1259
|
-
icon: /* @__PURE__ */ jsx(
|
|
1260
|
+
icon: /* @__PURE__ */ jsx(ChevronsRightGlyph, { size: "md" })
|
|
1260
1261
|
}
|
|
1261
1262
|
)
|
|
1262
1263
|
] }),
|
|
@@ -1527,7 +1528,7 @@ var DataTable = ({
|
|
|
1527
1528
|
/* @__PURE__ */ jsx("span", { role: "status", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: settingsSaid }) })
|
|
1528
1529
|
] }),
|
|
1529
1530
|
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1530
|
-
/* @__PURE__ */ jsx(Button, { variant: "
|
|
1531
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: cancelTableSettings, children: labels.cancel }),
|
|
1531
1532
|
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: applyTableSettings, children: labels.apply })
|
|
1532
1533
|
] }),
|
|
1533
1534
|
children: [
|
|
@@ -1590,7 +1591,7 @@ var DataTable = ({
|
|
|
1590
1591
|
size: "sm",
|
|
1591
1592
|
className: "crewlet-data-table__column-drag-handle",
|
|
1592
1593
|
label: labels.reorder(name),
|
|
1593
|
-
icon: /* @__PURE__ */ jsx(
|
|
1594
|
+
icon: /* @__PURE__ */ jsx(GripVerticalGlyph, { size: "md" }),
|
|
1594
1595
|
"aria-describedby": reorderHintId,
|
|
1595
1596
|
draggable: true,
|
|
1596
1597
|
onDragStart: (e) => handleDragStart(e, key),
|
|
@@ -1621,7 +1622,7 @@ var DataTable = ({
|
|
|
1621
1622
|
{
|
|
1622
1623
|
size: "sm",
|
|
1623
1624
|
label: labels.moveUp(name),
|
|
1624
|
-
icon: /* @__PURE__ */ jsx(
|
|
1625
|
+
icon: /* @__PURE__ */ jsx(ChevronUpGlyph, { size: "sm" }),
|
|
1625
1626
|
...index === 0 ? { disabledReason: labels.atTop(name) } : {},
|
|
1626
1627
|
onClick: () => moveColumn(key, -1)
|
|
1627
1628
|
}
|
|
@@ -1631,7 +1632,7 @@ var DataTable = ({
|
|
|
1631
1632
|
{
|
|
1632
1633
|
size: "sm",
|
|
1633
1634
|
label: labels.moveDown(name),
|
|
1634
|
-
icon: /* @__PURE__ */ jsx(
|
|
1635
|
+
icon: /* @__PURE__ */ jsx(ChevronDownGlyph, { size: "sm" }),
|
|
1635
1636
|
...index === draftColumnOrder.length - 1 ? { disabledReason: labels.atBottom(name) } : {},
|
|
1636
1637
|
onClick: () => moveColumn(key, 1)
|
|
1637
1638
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './Button-
|
|
3
|
+
import './Button-X4B2TJAQ.css';
|
|
4
4
|
import { forwardRef, useId, Children, isValidElement, cloneElement } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { ExternalLinkGlyph } from '@crewlethq/icons/glyphs';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
function buttonClass({ variant = "primary", size = "medium", shape = "square", block, className }, extra) {
|
|
@@ -104,7 +104,7 @@ var ButtonLink = forwardRef(function ButtonLink2({
|
|
|
104
104
|
children,
|
|
105
105
|
...rest
|
|
106
106
|
}, ref) {
|
|
107
|
-
const trailing = trailingIcon ?? (external ? /* @__PURE__ */ jsx(
|
|
107
|
+
const trailing = trailingIcon ?? (external ? /* @__PURE__ */ jsx(ExternalLinkGlyph, { size: "sm" }) : void 0);
|
|
108
108
|
return /* @__PURE__ */ jsx(
|
|
109
109
|
"a",
|
|
110
110
|
{
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Toolbar } from './chunk-
|
|
1
|
+
import { Toolbar } from './chunk-PGRPNDWM.js';
|
|
2
2
|
import { PageHeader } from './chunk-HOXGBLEY.js';
|
|
3
3
|
import { RelativeTime } from './chunk-3CZ7XAVY.js';
|
|
4
|
-
import { Kbd } from './chunk-
|
|
5
|
-
import { DataTable } from './chunk-
|
|
6
|
-
import { Menu } from './chunk-
|
|
7
|
-
import { DateTimePicker } from './chunk-
|
|
8
|
-
import { Popover } from './chunk-
|
|
9
|
-
import { useListbox, useOptionKeys } from './chunk-
|
|
10
|
-
import { Input } from './chunk-
|
|
4
|
+
import { Kbd } from './chunk-KJ34ZBBI.js';
|
|
5
|
+
import { DataTable } from './chunk-ERVO6OUF.js';
|
|
6
|
+
import { Menu } from './chunk-IPVQKAHO.js';
|
|
7
|
+
import { DateTimePicker } from './chunk-YIMOT5OO.js';
|
|
8
|
+
import { Popover } from './chunk-AUS5FNQE.js';
|
|
9
|
+
import { useListbox, useOptionKeys } from './chunk-6MU7HNB4.js';
|
|
10
|
+
import { Input } from './chunk-DSUY5F4E.js';
|
|
11
11
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
12
|
-
import { IconButton } from './chunk-
|
|
13
|
-
import { Button } from './chunk-
|
|
12
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
13
|
+
import { Button } from './chunk-ETYEBKR4.js';
|
|
14
14
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
15
15
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
16
|
-
import './DataView-
|
|
16
|
+
import './DataView-N6JX464S.css';
|
|
17
17
|
import { useMemo, useState, useEffect, useCallback, useRef, useId } from 'react';
|
|
18
|
-
import { SearchGlyph,
|
|
18
|
+
import { SearchGlyph, ChevronDownGlyph, SlidersVerticalGlyph, ArrowUpGlyph, ArrowDownGlyph, XGlyph, ArrowUpDownGlyph, EyeGlyph, EyeOffGlyph, HashGlyph, ClockGlyph, ListGlyph, CheckGlyph } from '@crewlethq/icons/glyphs';
|
|
19
19
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
20
20
|
|
|
21
21
|
var DATA_VIEW_TOOLBAR_LABELS = {
|
|
@@ -41,9 +41,9 @@ function glyphForKind(def) {
|
|
|
41
41
|
case "select":
|
|
42
42
|
return /* @__PURE__ */ jsx(ListGlyph, { size: "sm" });
|
|
43
43
|
case "datetime":
|
|
44
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
+
return /* @__PURE__ */ jsx(ClockGlyph, { size: "sm" });
|
|
45
45
|
case "number":
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
+
return /* @__PURE__ */ jsx(HashGlyph, { size: "sm" });
|
|
47
47
|
default:
|
|
48
48
|
return /* @__PURE__ */ jsx(SearchGlyph, { size: "sm" });
|
|
49
49
|
}
|
|
@@ -119,11 +119,11 @@ function DataViewToolbar({
|
|
|
119
119
|
{
|
|
120
120
|
label: labels.addFilter,
|
|
121
121
|
items: filterItems,
|
|
122
|
-
icon: /* @__PURE__ */ jsx(
|
|
122
|
+
icon: /* @__PURE__ */ jsx(SlidersVerticalGlyph, { size: "sm" }),
|
|
123
123
|
triggerVariant: "secondary",
|
|
124
124
|
trigger: /* @__PURE__ */ jsxs("span", { className: "crewlet-data-view-toolbar__menu-label", children: [
|
|
125
125
|
labels.filter,
|
|
126
|
-
/* @__PURE__ */ jsx(
|
|
126
|
+
/* @__PURE__ */ jsx(ChevronDownGlyph, { size: "xs" })
|
|
127
127
|
] })
|
|
128
128
|
}
|
|
129
129
|
) : null,
|
|
@@ -140,15 +140,15 @@ function DataViewToolbar({
|
|
|
140
140
|
variant: "secondary",
|
|
141
141
|
size: "small",
|
|
142
142
|
pressed: sort !== null,
|
|
143
|
-
leadingIcon: /* @__PURE__ */ jsx(
|
|
143
|
+
leadingIcon: /* @__PURE__ */ jsx(ArrowUpDownGlyph, { size: "sm" }),
|
|
144
144
|
onClick: toggle,
|
|
145
145
|
children: /* @__PURE__ */ jsx("span", { className: "crewlet-data-view-toolbar__menu-label", children: sort && sortedName ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
146
|
labels.sortedBy(String(sortedName)),
|
|
147
|
-
sort.direction === "asc" ? /* @__PURE__ */ jsx(
|
|
147
|
+
sort.direction === "asc" ? /* @__PURE__ */ jsx(ArrowUpGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(ArrowDownGlyph, { size: "xs" }),
|
|
148
148
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: sort.direction === "asc" ? labels.ascendingWord : labels.descendingWord })
|
|
149
149
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
150
150
|
labels.sort,
|
|
151
|
-
/* @__PURE__ */ jsx(
|
|
151
|
+
/* @__PURE__ */ jsx(ChevronDownGlyph, { size: "xs" })
|
|
152
152
|
] }) })
|
|
153
153
|
}
|
|
154
154
|
),
|
|
@@ -167,7 +167,7 @@ function DataViewToolbar({
|
|
|
167
167
|
variant: "ghost",
|
|
168
168
|
pressed: isAscending,
|
|
169
169
|
label: labels.ascending(name),
|
|
170
|
-
icon: /* @__PURE__ */ jsx(
|
|
170
|
+
icon: /* @__PURE__ */ jsx(ArrowUpGlyph, { size: "xs" }),
|
|
171
171
|
onClick: () => {
|
|
172
172
|
onSortChange({ key: column.key, direction: "asc" });
|
|
173
173
|
close();
|
|
@@ -181,7 +181,7 @@ function DataViewToolbar({
|
|
|
181
181
|
variant: "ghost",
|
|
182
182
|
pressed: isDescending,
|
|
183
183
|
label: labels.descending(name),
|
|
184
|
-
icon: /* @__PURE__ */ jsx(
|
|
184
|
+
icon: /* @__PURE__ */ jsx(ArrowDownGlyph, { size: "xs" }),
|
|
185
185
|
onClick: () => {
|
|
186
186
|
onSortChange({ key: column.key, direction: "desc" });
|
|
187
187
|
close();
|
|
@@ -194,9 +194,9 @@ function DataViewToolbar({
|
|
|
194
194
|
sort ? /* @__PURE__ */ jsx("div", { className: "crewlet-data-view-toolbar__sort-footer", children: /* @__PURE__ */ jsx(
|
|
195
195
|
Button,
|
|
196
196
|
{
|
|
197
|
-
variant: "
|
|
197
|
+
variant: "ghost",
|
|
198
198
|
size: "small",
|
|
199
|
-
leadingIcon: /* @__PURE__ */ jsx(
|
|
199
|
+
leadingIcon: /* @__PURE__ */ jsx(XGlyph, { size: "xs" }),
|
|
200
200
|
onClick: () => {
|
|
201
201
|
onSortChange(null);
|
|
202
202
|
close();
|
|
@@ -213,7 +213,7 @@ function DataViewToolbar({
|
|
|
213
213
|
variant: "secondary",
|
|
214
214
|
size: "small",
|
|
215
215
|
pressed: showArchived,
|
|
216
|
-
leadingIcon: showArchived ? /* @__PURE__ */ jsx(
|
|
216
|
+
leadingIcon: showArchived ? /* @__PURE__ */ jsx(EyeGlyph, { size: "sm" }) : /* @__PURE__ */ jsx(EyeOffGlyph, { size: "sm" }),
|
|
217
217
|
onClick: () => onShowArchivedChange(!showArchived),
|
|
218
218
|
children: /* @__PURE__ */ jsxs("span", { className: "crewlet-data-view-toolbar__menu-label", children: [
|
|
219
219
|
labels.showArchived(archivedLabel),
|
|
@@ -456,7 +456,7 @@ function OptionListEditor({ def, value, labels, onCommit }) {
|
|
|
456
456
|
role: "listbox",
|
|
457
457
|
"aria-label": labels.options(def.label),
|
|
458
458
|
"aria-multiselectable": multiple || void 0,
|
|
459
|
-
"aria-activedescendant":
|
|
459
|
+
"aria-activedescendant": listbox.active >= 0 ? listbox.optionId(listbox.active) : void 0,
|
|
460
460
|
tabIndex: 0,
|
|
461
461
|
className: "crewlet-filter-axis__options",
|
|
462
462
|
onKeyDown,
|
|
@@ -489,7 +489,7 @@ function OptionListEditor({ def, value, labels, onCommit }) {
|
|
|
489
489
|
}
|
|
490
490
|
),
|
|
491
491
|
multiple && held.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "crewlet-filter-axis__editor-footer", children: [
|
|
492
|
-
/* @__PURE__ */ jsx(Button, { variant: "
|
|
492
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", size: "small", onClick: () => onCommit([]), children: labels.clear }),
|
|
493
493
|
/* @__PURE__ */ jsx(Button, { variant: "primary", size: "small", onClick: () => onCommit(held, { close: true }), children: labels.done })
|
|
494
494
|
] }) : null
|
|
495
495
|
] });
|
|
@@ -578,7 +578,7 @@ function FilterAxisChip({
|
|
|
578
578
|
":"
|
|
579
579
|
] }),
|
|
580
580
|
/* @__PURE__ */ jsx("span", { className: "crewlet-filter-axis-chip__value", children: formatFilterValue(def, value, labels) }),
|
|
581
|
-
/* @__PURE__ */ jsx(
|
|
581
|
+
/* @__PURE__ */ jsx(ChevronDownGlyph, { className: "crewlet-filter-axis-chip__chevron", size: "xs" })
|
|
582
582
|
] }),
|
|
583
583
|
children: editor
|
|
584
584
|
}
|
|
@@ -590,7 +590,7 @@ function FilterAxisChip({
|
|
|
590
590
|
size: "sm",
|
|
591
591
|
variant: "ghost",
|
|
592
592
|
label: labels.remove(def.label),
|
|
593
|
-
icon: /* @__PURE__ */ jsx(
|
|
593
|
+
icon: /* @__PURE__ */ jsx(XGlyph, { size: "xs" }),
|
|
594
594
|
onClick: onRemove
|
|
595
595
|
}
|
|
596
596
|
) : null
|
|
@@ -639,9 +639,9 @@ function FilterAxisBar({
|
|
|
639
639
|
Button,
|
|
640
640
|
{
|
|
641
641
|
className: "crewlet-filter-axis-bar__clear",
|
|
642
|
-
variant: "
|
|
642
|
+
variant: "ghost",
|
|
643
643
|
size: "small",
|
|
644
|
-
leadingIcon: /* @__PURE__ */ jsx(
|
|
644
|
+
leadingIcon: /* @__PURE__ */ jsx(XGlyph, { size: "xs" }),
|
|
645
645
|
onClick: onClearAll,
|
|
646
646
|
children: labels.clearAll
|
|
647
647
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-
|
|
1
|
+
import { useTreeState, treeExpandable, treeLevel, treePosInSet, treeSetSize, treeItemAction, treePrevious, treeNext, treeStep } from './chunk-S3BCVWTU.js';
|
|
2
2
|
import { LayerNodeBridge } from './chunk-53DVJCVW.js';
|
|
3
3
|
import { LayerHost, LAYER_REPOSITION_EVENT } from './chunk-7RPGY3JE.js';
|
|
4
|
-
import { focusables } from './chunk-
|
|
5
|
-
import { IconButton } from './chunk-
|
|
4
|
+
import { focusables } from './chunk-R25RGPUB.js';
|
|
5
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
6
6
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
7
7
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
8
8
|
import './TreeGrid-NSW7VMOX.css';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useTreeState, useMeasuredSizes, layoutForest, treeAncestors, useLayoutAnchor, treeExpandable, layoutConnectors, treeItemAction, treeStep, treePosInSet, treeSetSize, treeLevel } from './chunk-
|
|
2
|
-
import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-
|
|
3
|
-
import { focusables } from './chunk-
|
|
1
|
+
import { useTreeState, useMeasuredSizes, layoutForest, treeAncestors, useLayoutAnchor, treeExpandable, layoutConnectors, treeItemAction, treeStep, treePosInSet, treeSetSize, treeLevel, placeGroups } from './chunk-S3BCVWTU.js';
|
|
2
|
+
import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-BMYPGGPV.js';
|
|
3
|
+
import { focusables } from './chunk-R25RGPUB.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
|
-
import './TreeCanvas-
|
|
6
|
-
import { useState, useRef, useMemo, useLayoutEffect, useCallback, useImperativeHandle, useSyncExternalStore } from 'react';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import './TreeCanvas-HVOV4SQN.css';
|
|
6
|
+
import { useState, useRef, useMemo, useLayoutEffect, useCallback, useImperativeHandle, useId, useSyncExternalStore } from 'react';
|
|
7
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
var ENTRANCE_STEP_MS = 60;
|
|
10
10
|
var REFLOW_MS = 350;
|
|
@@ -90,7 +90,14 @@ function useReflow(layout, still) {
|
|
|
90
90
|
return { ...one, x: was.x + (one.x - was.x) * through, y: was.y + (one.y - was.y) * through };
|
|
91
91
|
});
|
|
92
92
|
record(nodes);
|
|
93
|
-
|
|
93
|
+
const byId = new Map(nodes.map((one) => [one.id, one]));
|
|
94
|
+
setDrawn({
|
|
95
|
+
nodes,
|
|
96
|
+
byId,
|
|
97
|
+
groups: placeGroups(byId, layout.groups ?? []),
|
|
98
|
+
...layout.ranks ? { ranks: layout.ranks } : {},
|
|
99
|
+
bounds: layout.bounds
|
|
100
|
+
});
|
|
94
101
|
frame.current = through < 1 ? requestAnimationFrame(tick) : null;
|
|
95
102
|
};
|
|
96
103
|
frame.current = requestAnimationFrame(tick);
|
|
@@ -100,6 +107,8 @@ function useReflow(layout, still) {
|
|
|
100
107
|
}
|
|
101
108
|
var GAP_PROBE = "crewlet:tree-canvas-gap";
|
|
102
109
|
var MARGIN_PROBE = "crewlet:tree-canvas-margin";
|
|
110
|
+
var GROUP_PAD_PROBE = "crewlet:tree-canvas-group-pad";
|
|
111
|
+
var groupHeadKey = (id) => `crewlet:tree-canvas-group:${id}`;
|
|
103
112
|
function TreeCanvas({
|
|
104
113
|
label,
|
|
105
114
|
nodes,
|
|
@@ -107,11 +116,11 @@ function TreeCanvas({
|
|
|
107
116
|
cardOf,
|
|
108
117
|
renderCard,
|
|
109
118
|
renderUnder,
|
|
110
|
-
cardOutline,
|
|
111
119
|
cardTone,
|
|
112
120
|
appearance = "card",
|
|
113
121
|
ranks,
|
|
114
|
-
connector = "
|
|
122
|
+
connector = "elbow",
|
|
123
|
+
groups,
|
|
115
124
|
onNodeKey,
|
|
116
125
|
onNodeKeyDown,
|
|
117
126
|
hasNodeMenu,
|
|
@@ -154,12 +163,27 @@ function TreeCanvas({
|
|
|
154
163
|
cardForest.forEach(walk);
|
|
155
164
|
return out;
|
|
156
165
|
}, [cardForest]);
|
|
166
|
+
const shownGroups = useMemo(() => {
|
|
167
|
+
if (!groups || groups.length === 0) return [];
|
|
168
|
+
const drawnCards = new Set(cardIds);
|
|
169
|
+
return groups.map((group) => ({ group, members: group.memberIds.filter((id) => drawnCards.has(id)) })).filter((one) => one.members.length > 0);
|
|
170
|
+
}, [groups, cardIds]);
|
|
157
171
|
const spacing = ranks ?? (appearance === "node" ? "shared" : "per-parent");
|
|
158
172
|
const previousLayout = useRef(null);
|
|
159
173
|
const layout = useMemo(() => {
|
|
160
|
-
|
|
174
|
+
const probes = [GAP_PROBE, MARGIN_PROBE];
|
|
175
|
+
if (shownGroups.length > 0) {
|
|
176
|
+
probes.push(GROUP_PAD_PROBE, ...shownGroups.map(({ group }) => groupHeadKey(group.id)));
|
|
177
|
+
}
|
|
178
|
+
if (!measured([...cardIds, ...probes])) return previousLayout.current;
|
|
161
179
|
const size = (id) => sizes.get(id);
|
|
162
180
|
const gap = size(GAP_PROBE);
|
|
181
|
+
const pad = shownGroups.length > 0 ? size(GROUP_PAD_PROBE) : null;
|
|
182
|
+
const boxes = shownGroups.map(({ group, members }) => ({
|
|
183
|
+
id: group.id,
|
|
184
|
+
members,
|
|
185
|
+
inset: { x: pad.width, top: size(groupHeadKey(group.id)).height, bottom: pad.height }
|
|
186
|
+
}));
|
|
163
187
|
const toLayout = (card2) => ({
|
|
164
188
|
id: card2.id,
|
|
165
189
|
width: size(card2.id).width,
|
|
@@ -170,9 +194,10 @@ function TreeCanvas({
|
|
|
170
194
|
gapX: gap.width,
|
|
171
195
|
gapY: gap.height,
|
|
172
196
|
ranks: spacing,
|
|
173
|
-
margin: size(MARGIN_PROBE).width
|
|
197
|
+
margin: size(MARGIN_PROBE).width,
|
|
198
|
+
groups: boxes
|
|
174
199
|
});
|
|
175
|
-
}, [cardForest, cardIds, measured, sizes, spacing]);
|
|
200
|
+
}, [cardForest, cardIds, measured, sizes, spacing, shownGroups]);
|
|
176
201
|
previousLayout.current = layout;
|
|
177
202
|
const still = useStillness();
|
|
178
203
|
const drawn = useReflow(layout, still) ?? layout;
|
|
@@ -362,6 +387,16 @@ function TreeCanvas({
|
|
|
362
387
|
items.current.get(id)?.focus({ preventScroll: true });
|
|
363
388
|
}
|
|
364
389
|
});
|
|
390
|
+
const uid = useId();
|
|
391
|
+
const headIds = useMemo(
|
|
392
|
+
() => new Map(shownGroups.map(({ group }, i) => [group.id, `${uid}-group-${i}`])),
|
|
393
|
+
[shownGroups, uid]
|
|
394
|
+
);
|
|
395
|
+
const describedBy = useMemo(() => {
|
|
396
|
+
const out = /* @__PURE__ */ new Map();
|
|
397
|
+
for (const { group, members } of shownGroups) for (const id of members) out.set(id, headIds.get(group.id));
|
|
398
|
+
return out;
|
|
399
|
+
}, [shownGroups, headIds]);
|
|
365
400
|
const card = {
|
|
366
401
|
item: (id) => ({
|
|
367
402
|
role: "treeitem",
|
|
@@ -371,6 +406,7 @@ function TreeCanvas({
|
|
|
371
406
|
"aria-posinset": treePosInSet(model, id),
|
|
372
407
|
"aria-expanded": treeExpandable(model, id) ? expanded.has(id) : void 0,
|
|
373
408
|
"aria-selected": id === selectedId,
|
|
409
|
+
"aria-describedby": describedBy.get(id),
|
|
374
410
|
"data-tree-id": id,
|
|
375
411
|
ref: refFor(id),
|
|
376
412
|
onClick: (event) => {
|
|
@@ -430,6 +466,21 @@ function TreeCanvas({
|
|
|
430
466
|
children: [
|
|
431
467
|
/* @__PURE__ */ jsx("div", { className: "crewlet-tree-canvas__gap", ref: measure(GAP_PROBE), "aria-hidden": "true" }),
|
|
432
468
|
/* @__PURE__ */ jsx("div", { className: "crewlet-tree-canvas__margin", ref: measure(MARGIN_PROBE), "aria-hidden": "true" }),
|
|
469
|
+
shownGroups.length > 0 && /* @__PURE__ */ jsx("div", { className: "crewlet-tree-canvas__group-pad", ref: measure(GROUP_PAD_PROBE), "aria-hidden": "true" }),
|
|
470
|
+
shownGroups.map(({ group, members }) => {
|
|
471
|
+
const placed = drawn?.groups?.find((one) => one.id === group.id);
|
|
472
|
+
return /* @__PURE__ */ jsx(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
className: "crewlet-tree-canvas__group",
|
|
476
|
+
"aria-hidden": "true",
|
|
477
|
+
"data-group-id": group.id,
|
|
478
|
+
"data-enter": enterOf(members, arrived),
|
|
479
|
+
style: placedStyle(placed, true)
|
|
480
|
+
},
|
|
481
|
+
group.id
|
|
482
|
+
);
|
|
483
|
+
}),
|
|
433
484
|
drawn && /* @__PURE__ */ jsx(
|
|
434
485
|
"svg",
|
|
435
486
|
{
|
|
@@ -449,6 +500,28 @@ function TreeCanvas({
|
|
|
449
500
|
))
|
|
450
501
|
}
|
|
451
502
|
),
|
|
503
|
+
shownGroups.map(({ group, members }) => {
|
|
504
|
+
const placed = drawn?.groups?.find((one) => one.id === group.id);
|
|
505
|
+
return /* @__PURE__ */ jsxs(
|
|
506
|
+
"div",
|
|
507
|
+
{
|
|
508
|
+
id: headIds.get(group.id),
|
|
509
|
+
ref: measure(groupHeadKey(group.id)),
|
|
510
|
+
className: "crewlet-tree-canvas__group-head",
|
|
511
|
+
"aria-hidden": "true",
|
|
512
|
+
"data-enter": enterOf(members, arrived),
|
|
513
|
+
style: placedStyle(placed, false),
|
|
514
|
+
children: [
|
|
515
|
+
group.lead === void 0 || group.lead === null ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
516
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-tree-canvas__group-lead", children: group.lead }),
|
|
517
|
+
" "
|
|
518
|
+
] }),
|
|
519
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-tree-canvas__group-label", children: group.label })
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
group.id
|
|
523
|
+
);
|
|
524
|
+
}),
|
|
452
525
|
/* @__PURE__ */ jsx("div", { role: "tree", "aria-label": label, className: "crewlet-tree-canvas__tree", onKeyDown, children: cardIds.filter((id) => id !== composeId).map((id) => {
|
|
453
526
|
const placed = drawn?.byId.get(id);
|
|
454
527
|
return /* @__PURE__ */ jsxs(
|
|
@@ -456,10 +529,7 @@ function TreeCanvas({
|
|
|
456
529
|
{
|
|
457
530
|
role: "none",
|
|
458
531
|
ref: measure(id),
|
|
459
|
-
className:
|
|
460
|
-
"crewlet-tree-canvas__card",
|
|
461
|
-
cardOutline?.(id) && "crewlet-tree-canvas__card--outline"
|
|
462
|
-
),
|
|
532
|
+
className: "crewlet-tree-canvas__card",
|
|
463
533
|
"data-tone": cardTone?.(id),
|
|
464
534
|
"data-enter": arrived === null ? void 0 : arrived.has(id) ? "shown" : "waiting",
|
|
465
535
|
style: placed ? { transform: `translate(${placed.x}px, ${placed.y}px)` } : { visibility: "hidden" },
|
|
@@ -514,6 +584,18 @@ function UnderSlot({
|
|
|
514
584
|
if (content === null || content === void 0 || content === false) return null;
|
|
515
585
|
return /* @__PURE__ */ jsx("div", { className: "crewlet-tree-canvas__under", "aria-hidden": "true", ...card.press(id), children: content });
|
|
516
586
|
}
|
|
587
|
+
function enterOf(members, arrived) {
|
|
588
|
+
if (arrived === null) return void 0;
|
|
589
|
+
return members.some((id) => arrived.has(id)) ? "shown" : "waiting";
|
|
590
|
+
}
|
|
591
|
+
function placedStyle(placed, box) {
|
|
592
|
+
if (!placed) return { visibility: "hidden" };
|
|
593
|
+
return {
|
|
594
|
+
transform: `translate(${placed.x}px, ${placed.y}px)`,
|
|
595
|
+
width: `${placed.width}px`,
|
|
596
|
+
...box ? { height: `${placed.height}px` } : {}
|
|
597
|
+
};
|
|
598
|
+
}
|
|
517
599
|
function offsetWithin(el, container) {
|
|
518
600
|
let top = 0;
|
|
519
601
|
for (let at = el; at && at !== container; at = at.offsetParent) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
2
2
|
import { headingTag } from './chunk-PQADV6P6.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
|
-
import {
|
|
4
|
+
import { ChevronDownGlyph } from '@crewlethq/icons/glyphs';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
function DisclosureAnatomy({
|
|
@@ -31,7 +31,7 @@ function DisclosureAnatomy({
|
|
|
31
31
|
onClick: onToggle,
|
|
32
32
|
onKeyDown,
|
|
33
33
|
children: [
|
|
34
|
-
/* @__PURE__ */ jsx(
|
|
34
|
+
/* @__PURE__ */ jsx(ChevronDownGlyph, { className: "crewlet-disclosure__chevron", size: "sm" }),
|
|
35
35
|
/* @__PURE__ */ jsx("span", { className: cx("crewlet-disclosure__title", mono && "crewlet-disclosure__title--mono"), children: title }),
|
|
36
36
|
meta === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
37
|
" ",
|