@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,7 +1,7 @@
|
|
|
1
1
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
3
|
import './DiffList-3EX64AAE.css';
|
|
4
|
-
import {
|
|
4
|
+
import { DiffGlyph, MinusGlyph, PlusGlyph, ArrowRightGlyph } from '@crewlethq/icons/glyphs';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
var DIFF_LIST_LABELS = {
|
|
@@ -11,9 +11,9 @@ var DIFF_LIST_LABELS = {
|
|
|
11
11
|
to: "to"
|
|
12
12
|
};
|
|
13
13
|
var GLYPHS = {
|
|
14
|
-
added:
|
|
15
|
-
removed:
|
|
16
|
-
changed:
|
|
14
|
+
added: PlusGlyph,
|
|
15
|
+
removed: MinusGlyph,
|
|
16
|
+
changed: DiffGlyph
|
|
17
17
|
};
|
|
18
18
|
function DiffList({ rows, emptyMessage, labels: overrides, className }) {
|
|
19
19
|
const labels = overrides ? { ...DIFF_LIST_LABELS, ...overrides } : DIFF_LIST_LABELS;
|
|
@@ -37,9 +37,9 @@ function DiffList({ rows, emptyMessage, labels: overrides, className }) {
|
|
|
37
37
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: labels[row.kind] })
|
|
38
38
|
] }),
|
|
39
39
|
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__path", children: row.path }),
|
|
40
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__value", children: row.kind === "added" ? row.to : row.kind === "removed" ? row.from : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__value", children: row.kind === "added" ? /* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__to", children: row.to }) : row.kind === "removed" ? /* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__from", children: row.from }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
41
|
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__from", children: row.from }),
|
|
42
|
-
/* @__PURE__ */ jsx(
|
|
42
|
+
/* @__PURE__ */ jsx(ArrowRightGlyph, { className: "crewlet-diff-list__arrow", size: "sm" }),
|
|
43
43
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: labels.to }),
|
|
44
44
|
/* @__PURE__ */ jsx("span", { className: "crewlet-diff-list__to", children: row.to })
|
|
45
45
|
] }) })
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { Kbd } from './chunk-KJ34ZBBI.js';
|
|
2
|
+
import { Modal } from './chunk-IG27QX7Q.js';
|
|
3
|
+
import { useListbox } from './chunk-6MU7HNB4.js';
|
|
4
|
+
import { Input } from './chunk-DSUY5F4E.js';
|
|
5
|
+
import { Count } from './chunk-BHHIIK3M.js';
|
|
6
|
+
import { isComposing } from './chunk-R25RGPUB.js';
|
|
7
|
+
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
8
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
9
|
+
import './CommandPalette-C5AMKGN2.css';
|
|
10
|
+
import { useId, useMemo } from 'react';
|
|
11
|
+
import { SearchGlyph } from '@crewlethq/icons/glyphs';
|
|
12
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
|
+
|
|
14
|
+
function CommandPalette(props) {
|
|
15
|
+
return props.open ? /* @__PURE__ */ jsx(Palette, { ...props }) : null;
|
|
16
|
+
}
|
|
17
|
+
function Palette({
|
|
18
|
+
open: _open,
|
|
19
|
+
onClose,
|
|
20
|
+
label = "Search",
|
|
21
|
+
query,
|
|
22
|
+
onQueryChange,
|
|
23
|
+
groups,
|
|
24
|
+
placeholder = "Search",
|
|
25
|
+
lead,
|
|
26
|
+
footer,
|
|
27
|
+
escapeHint = false,
|
|
28
|
+
emptyMessage = "Nothing matches that search.",
|
|
29
|
+
pendingMessage = "Searching\u2026",
|
|
30
|
+
resultsLabel = "Results",
|
|
31
|
+
scopes,
|
|
32
|
+
scope,
|
|
33
|
+
onScopeChange,
|
|
34
|
+
groupsScope,
|
|
35
|
+
scopesLabel = "Search in",
|
|
36
|
+
className,
|
|
37
|
+
...rest
|
|
38
|
+
}) {
|
|
39
|
+
const id = useId();
|
|
40
|
+
const stale = scopes !== void 0 && groupsScope !== scope;
|
|
41
|
+
const shown = useMemo(() => stale ? [] : groups, [stale, groups]);
|
|
42
|
+
const flat = useMemo(() => shown.flatMap((group) => group.items), [shown]);
|
|
43
|
+
const listbox = useListbox({
|
|
44
|
+
id,
|
|
45
|
+
open: true,
|
|
46
|
+
count: flat.length,
|
|
47
|
+
popup: false,
|
|
48
|
+
onCommit: (at) => {
|
|
49
|
+
const item = flat[at];
|
|
50
|
+
if (!item) return;
|
|
51
|
+
item.onSelect();
|
|
52
|
+
onClose();
|
|
53
|
+
},
|
|
54
|
+
onClose
|
|
55
|
+
});
|
|
56
|
+
const tabId = (scopeId) => `${id}-scope-${scopeId}`;
|
|
57
|
+
const panelId = `${id}-panel`;
|
|
58
|
+
const current = scopes?.find((candidate) => candidate.id === scope);
|
|
59
|
+
function choose(next) {
|
|
60
|
+
if (!onScopeChange || next === scope) return;
|
|
61
|
+
onScopeChange(next);
|
|
62
|
+
listbox.setActive(0);
|
|
63
|
+
}
|
|
64
|
+
function onKeyDown(event) {
|
|
65
|
+
if (listbox.onKeyDown(event)) return;
|
|
66
|
+
if (!scopes || scopes.length === 0 || isComposing(event)) return;
|
|
67
|
+
if (event.altKey || event.ctrlKey || event.metaKey) return;
|
|
68
|
+
let step = 0;
|
|
69
|
+
if (event.key === "Tab") step = event.shiftKey ? -1 : 1;
|
|
70
|
+
else if (query === "" && !event.shiftKey && event.key === "ArrowRight") step = 1;
|
|
71
|
+
else if (query === "" && !event.shiftKey && event.key === "ArrowLeft") step = -1;
|
|
72
|
+
if (step === 0) return;
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
const at = scopes.findIndex((candidate) => candidate.id === scope);
|
|
75
|
+
const next = scopes[(at + step + scopes.length) % scopes.length];
|
|
76
|
+
if (next) choose(next.id);
|
|
77
|
+
}
|
|
78
|
+
const active = listbox.active;
|
|
79
|
+
let index = -1;
|
|
80
|
+
return /* @__PURE__ */ jsxs(
|
|
81
|
+
Modal,
|
|
82
|
+
{
|
|
83
|
+
...rest,
|
|
84
|
+
open: true,
|
|
85
|
+
onClose,
|
|
86
|
+
placement: "top",
|
|
87
|
+
size: "md",
|
|
88
|
+
ariaLabel: label,
|
|
89
|
+
showCloseButton: false,
|
|
90
|
+
flush: true,
|
|
91
|
+
className: cx("crewlet-palette", className),
|
|
92
|
+
footerStart: footer,
|
|
93
|
+
children: [
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
Input,
|
|
96
|
+
{
|
|
97
|
+
appearance: "command",
|
|
98
|
+
containerClassName: "crewlet-palette__field",
|
|
99
|
+
leading: /* @__PURE__ */ jsx(SearchGlyph, { size: "sm" }),
|
|
100
|
+
trailing: escapeHint ? /* @__PURE__ */ jsx(Kbd, { subtle: true, "aria-hidden": true, className: "crewlet-palette__escape", children: "Esc" }) : void 0,
|
|
101
|
+
value: query,
|
|
102
|
+
onChange: (event) => {
|
|
103
|
+
onQueryChange(event.target.value);
|
|
104
|
+
listbox.setActive(0);
|
|
105
|
+
},
|
|
106
|
+
onKeyDown,
|
|
107
|
+
placeholder,
|
|
108
|
+
role: "combobox",
|
|
109
|
+
"aria-label": label,
|
|
110
|
+
"aria-expanded": true,
|
|
111
|
+
"aria-controls": listbox.listId,
|
|
112
|
+
"aria-autocomplete": "list",
|
|
113
|
+
"aria-activedescendant": active >= 0 ? listbox.optionId(active) : void 0,
|
|
114
|
+
"aria-describedby": current ? tabId(current.id) : void 0,
|
|
115
|
+
autoComplete: "off",
|
|
116
|
+
spellCheck: false
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
scopes ? /* @__PURE__ */ jsx("div", { className: "crewlet-palette__scopes", role: "tablist", "aria-label": scopesLabel, children: scopes.map((candidate) => {
|
|
120
|
+
const selected = candidate.id === scope;
|
|
121
|
+
return /* @__PURE__ */ jsxs(
|
|
122
|
+
"button",
|
|
123
|
+
{
|
|
124
|
+
type: "button",
|
|
125
|
+
role: "tab",
|
|
126
|
+
id: tabId(candidate.id),
|
|
127
|
+
className: cx("crewlet-palette__scope", selected && "is-active"),
|
|
128
|
+
"aria-selected": selected,
|
|
129
|
+
"aria-controls": panelId,
|
|
130
|
+
tabIndex: -1,
|
|
131
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
132
|
+
onClick: () => choose(candidate.id),
|
|
133
|
+
children: [
|
|
134
|
+
candidate.label,
|
|
135
|
+
candidate.count !== void 0 ? /* @__PURE__ */ jsx(Count, { value: candidate.count }) : null
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
candidate.id
|
|
139
|
+
);
|
|
140
|
+
}) }) : null,
|
|
141
|
+
/* @__PURE__ */ jsxs(
|
|
142
|
+
"div",
|
|
143
|
+
{
|
|
144
|
+
className: "crewlet-palette__results",
|
|
145
|
+
ref: listbox.listRef,
|
|
146
|
+
...scopes ? { id: panelId, role: "tabpanel", "aria-labelledby": current ? tabId(current.id) : void 0 } : {},
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-palette__lead", "aria-live": "polite", children: lead }),
|
|
149
|
+
/* @__PURE__ */ jsx(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: "crewlet-palette__list",
|
|
153
|
+
id: listbox.listId,
|
|
154
|
+
role: "listbox",
|
|
155
|
+
"aria-label": resultsLabel,
|
|
156
|
+
"aria-busy": stale || void 0,
|
|
157
|
+
children: shown.map((group) => (
|
|
158
|
+
// Named by the id of its own heading, never by the heading's text:
|
|
159
|
+
// `aria-label` would repeat words already on screen, and
|
|
160
|
+
// `aria-labelledby` given a name with a space in it splits on it.
|
|
161
|
+
/* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": `${id}-group-${group.id}`, children: [
|
|
162
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-listbox__heading", id: `${id}-group-${group.id}`, role: "presentation", children: group.label }),
|
|
163
|
+
group.items.map((item) => {
|
|
164
|
+
index += 1;
|
|
165
|
+
const mine = index;
|
|
166
|
+
return (
|
|
167
|
+
/*
|
|
168
|
+
* NOT A BUTTON, and not focusable: focus never leaves the
|
|
169
|
+
* field, so a row is reached by the arrows and by the pointer.
|
|
170
|
+
*
|
|
171
|
+
* The two rules turned off here are both asking for the shape
|
|
172
|
+
* this pattern is defined NOT to have. A combobox points at
|
|
173
|
+
* its active option with `aria-activedescendant`, which
|
|
174
|
+
* requires that the option itself never take focus, and the
|
|
175
|
+
* keys that take a row (Enter) are handled on the field,
|
|
176
|
+
* where the rule cannot see them. Making a row focusable
|
|
177
|
+
* would put one tab stop per result between the field and
|
|
178
|
+
* itself, which is the defect this replaced. The axe run in
|
|
179
|
+
* the suite beside this file is what actually holds the
|
|
180
|
+
* surface accessible.
|
|
181
|
+
*/
|
|
182
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus
|
|
183
|
+
/* @__PURE__ */ jsxs(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
id: listbox.optionId(mine),
|
|
187
|
+
className: "crewlet-listbox__option crewlet-palette__row",
|
|
188
|
+
role: "option",
|
|
189
|
+
"aria-selected": mine === active,
|
|
190
|
+
onMouseEnter: listbox.optionHandlers(mine).onMouseEnter,
|
|
191
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
192
|
+
onClick: () => {
|
|
193
|
+
item.onSelect();
|
|
194
|
+
onClose();
|
|
195
|
+
},
|
|
196
|
+
children: [
|
|
197
|
+
item.icon !== void 0 ? /* @__PURE__ */ jsx("span", { className: "crewlet-palette__icon", "aria-hidden": "true", children: item.icon }) : null,
|
|
198
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-palette__text", children: [
|
|
199
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-palette__label", children: item.label }),
|
|
200
|
+
item.hint !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
201
|
+
" ",
|
|
202
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-palette__hint", children: item.hint })
|
|
203
|
+
] }) : null
|
|
204
|
+
] }),
|
|
205
|
+
item.meta !== void 0 ? /* @__PURE__ */ jsx("span", { className: "crewlet-palette__meta", children: item.meta }) : null
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
item.id
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
})
|
|
212
|
+
] }, group.id)
|
|
213
|
+
))
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
flat.length === 0 ? /* @__PURE__ */ jsx("p", { className: "crewlet-palette__empty", children: stale ? pendingMessage : emptyMessage }) : null
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
current ? /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: /* @__PURE__ */ jsx("span", { children: current.label }, current.id) }) }) : null
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export { CommandPalette };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './AddPill-
|
|
3
|
+
import './AddPill-IJQYCY6C.css';
|
|
4
4
|
import { useState, useId, useRef, useCallback, useEffect, Fragment } from 'react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useClipboard } from './chunk-5VNUYO76.js';
|
|
2
|
-
import { IconButton } from './chunk-
|
|
3
|
-
import { Button } from './chunk-
|
|
2
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
3
|
+
import { Button } from './chunk-ETYEBKR4.js';
|
|
4
4
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './Copyable-5PNRFOLS.css';
|
|
7
7
|
import { useCallback } from 'react';
|
|
8
|
-
import { CheckGlyph,
|
|
8
|
+
import { CheckGlyph, CircleAlertGlyph, CopyGlyph } from '@crewlethq/icons/glyphs';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
function copyGlyph(state) {
|
|
12
12
|
if (state === "copied") return /* @__PURE__ */ jsx(CheckGlyph, { size: "sm" });
|
|
13
|
-
if (state === "failed") return /* @__PURE__ */ jsx(
|
|
14
|
-
return /* @__PURE__ */ jsx(
|
|
13
|
+
if (state === "failed") return /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm" });
|
|
14
|
+
return /* @__PURE__ */ jsx(CopyGlyph, { size: "sm" });
|
|
15
15
|
}
|
|
16
16
|
function CopyStatus({ state, copiedMessage, failedMessage }) {
|
|
17
17
|
return /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: state === "copied" ? copiedMessage : state === "failed" ? failedMessage : "" }) });
|
|
@@ -24,7 +24,7 @@ function CopyButton({
|
|
|
24
24
|
copiedMessage = "copied to the clipboard",
|
|
25
25
|
failedMessage = "the browser refused the clipboard",
|
|
26
26
|
size = "small",
|
|
27
|
-
variant = "
|
|
27
|
+
variant = "ghost",
|
|
28
28
|
title,
|
|
29
29
|
resetMs,
|
|
30
30
|
failedResetMs,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isComposing } from './chunk-
|
|
1
|
+
import { isComposing } from './chunk-R25RGPUB.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './Toolbar-
|
|
3
|
+
import './Toolbar-HUOSMNTH.css';
|
|
4
4
|
import { useRef, useState, useEffect, useCallback } from 'react';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Kbd } from './chunk-
|
|
2
|
-
import { FormField, Textarea, Input } from './chunk-
|
|
1
|
+
import { Kbd } from './chunk-KJ34ZBBI.js';
|
|
2
|
+
import { FormField, Textarea, Input } from './chunk-DSUY5F4E.js';
|
|
3
3
|
import { announce } from './chunk-RSAQOKH3.js';
|
|
4
|
-
import { isComposing } from './chunk-
|
|
5
|
-
import { IconButton } from './chunk-
|
|
4
|
+
import { isComposing } from './chunk-R25RGPUB.js';
|
|
5
|
+
import { IconButton } from './chunk-4UQ7SMPK.js';
|
|
6
6
|
import './ListInput-O7LJKOIG.css';
|
|
7
7
|
import { useState, useRef, useLayoutEffect } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { ArrowUpGlyph, ArrowDownGlyph, XGlyph, PlusGlyph } from '@crewlethq/icons/glyphs';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
10
10
|
|
|
11
11
|
var minted = 0;
|
|
@@ -163,7 +163,7 @@ function ListInput({
|
|
|
163
163
|
size: "sm",
|
|
164
164
|
variant: "soft-brand",
|
|
165
165
|
label: addLabel(itemName),
|
|
166
|
-
icon: /* @__PURE__ */ jsx(
|
|
166
|
+
icon: /* @__PURE__ */ jsx(PlusGlyph, {}),
|
|
167
167
|
disabled: disabled || draft.trim() === "",
|
|
168
168
|
onClick: add
|
|
169
169
|
}
|
|
@@ -210,7 +210,7 @@ function ListInput({
|
|
|
210
210
|
{
|
|
211
211
|
size: "sm",
|
|
212
212
|
label: moveUpLabel(itemName, position),
|
|
213
|
-
icon: /* @__PURE__ */ jsx(
|
|
213
|
+
icon: /* @__PURE__ */ jsx(ArrowUpGlyph, {}),
|
|
214
214
|
disabled: disabled || index === 0,
|
|
215
215
|
onClick: () => move(index, -1, "up"),
|
|
216
216
|
ref: (el) => {
|
|
@@ -224,7 +224,7 @@ function ListInput({
|
|
|
224
224
|
{
|
|
225
225
|
size: "sm",
|
|
226
226
|
label: moveDownLabel(itemName, position),
|
|
227
|
-
icon: /* @__PURE__ */ jsx(
|
|
227
|
+
icon: /* @__PURE__ */ jsx(ArrowDownGlyph, {}),
|
|
228
228
|
disabled: disabled || index === count - 1,
|
|
229
229
|
onClick: () => move(index, 1, "down"),
|
|
230
230
|
ref: (el) => {
|
|
@@ -240,7 +240,7 @@ function ListInput({
|
|
|
240
240
|
size: "sm",
|
|
241
241
|
variant: "ghost-danger",
|
|
242
242
|
label: removeLabel(itemName, position),
|
|
243
|
-
icon: /* @__PURE__ */ jsx(
|
|
243
|
+
icon: /* @__PURE__ */ jsx(XGlyph, {}),
|
|
244
244
|
disabled,
|
|
245
245
|
onClick: () => remove(index)
|
|
246
246
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
-
import './Tabs-
|
|
3
|
+
import './Tabs-XCNPHA7B.css';
|
|
4
4
|
import React, { useRef, useState, useLayoutEffect } from 'react';
|
|
5
5
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -107,10 +107,11 @@ function Tabs({
|
|
|
107
107
|
update();
|
|
108
108
|
reveal(nav);
|
|
109
109
|
const mutation = new MutationObserver(update);
|
|
110
|
+
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(update) : null;
|
|
110
111
|
nav.querySelectorAll(".crewlet-tabs__tab").forEach((tab) => {
|
|
111
112
|
mutation.observe(tab, { attributes: true, attributeFilter: ["class"] });
|
|
113
|
+
resize?.observe(tab);
|
|
112
114
|
});
|
|
113
|
-
const resize = typeof ResizeObserver === "function" ? new ResizeObserver(update) : null;
|
|
114
115
|
resize?.observe(nav);
|
|
115
116
|
return () => {
|
|
116
117
|
mutation.disconnect();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
2
2
|
import './Callout-S7QDWHDL.css';
|
|
3
|
-
import {
|
|
3
|
+
import { CircleAlertGlyph, TriangleAlertGlyph, CircleCheckGlyph, InfoGlyph } from '@crewlethq/icons/glyphs';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
var GLYPHS = {
|
|
7
7
|
neutral: /* @__PURE__ */ jsx(InfoGlyph, { size: "md" }),
|
|
8
8
|
info: /* @__PURE__ */ jsx(InfoGlyph, { size: "md" }),
|
|
9
|
-
success: /* @__PURE__ */ jsx(
|
|
10
|
-
warning: /* @__PURE__ */ jsx(
|
|
11
|
-
danger: /* @__PURE__ */ jsx(
|
|
9
|
+
success: /* @__PURE__ */ jsx(CircleCheckGlyph, { size: "md" }),
|
|
10
|
+
warning: /* @__PURE__ */ jsx(TriangleAlertGlyph, { size: "md" }),
|
|
11
|
+
danger: /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "md" })
|
|
12
12
|
};
|
|
13
13
|
var Callout = ({
|
|
14
14
|
variant = "info",
|