@crewlethq/ui 0.75.4 → 0.76.1
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 +21 -1
- package/dist/AgentHandoffPanel/index.js +3 -3
- package/dist/ArrangeList/index.js +3 -3
- package/dist/ArtifactBar/index.js +4 -4
- package/dist/ArtifactCard/index.js +3 -3
- package/dist/AttachmentChip/index.js +3 -3
- package/dist/AvatarPicker/index.js +5 -5
- package/dist/BriefCard/index.js +4 -4
- package/dist/ChangeList/index.js +3 -3
- package/dist/Checkbox/index.js +2 -2
- package/dist/ChoiceCards/ChoiceCards.d.ts +80 -0
- package/dist/ChoiceCards/index.d.ts +3 -0
- package/dist/ChoiceCards/index.js +3 -0
- package/dist/ChoiceCards-HAGJMK6Q.css +318 -0
- package/dist/ChoiceList/ChoiceList.d.ts +10 -1
- package/dist/ChoiceList/index.js +1 -1
- package/dist/{ChoiceList-Q772QLFX.css → ChoiceList-JN4PPNFW.css} +22 -1
- package/dist/ColorField/index.js +2 -2
- package/dist/Combobox/index.js +2 -2
- package/dist/CommandPalette/index.js +2 -2
- package/dist/CommentThread/index.js +3 -3
- package/dist/Composer/index.js +2 -2
- package/dist/ConfirmField/index.js +2 -2
- package/dist/ContrastBadge/index.js +3 -3
- package/dist/ContrastHelp/index.js +4 -4
- package/dist/DataGrid/index.js +3 -3
- package/dist/DataTable/index.js +3 -3
- package/dist/DataView/index.js +5 -5
- package/dist/DatasetSource/index.js +3 -3
- package/dist/DeepWorkCard/index.js +5 -5
- package/dist/DocTabsEditor/index.js +2 -2
- package/dist/EditingStatus/index.js +2 -2
- package/dist/{Editor-VW5CRDKY.js → Editor-BXOWAV46.js} +1 -1
- package/dist/EntityList/index.js +4 -4
- package/dist/HuePicker/index.js +4 -4
- package/dist/InlineEditor/index.js +3 -3
- package/dist/Input/index.js +1 -1
- package/dist/{Input-GEFFMKBS.css → Input-WSMB7JG2.css} +6 -1
- package/dist/ListInput/index.js +2 -2
- package/dist/LogoSlot/index.js +4 -4
- package/dist/MarkdownEditor/index.js +4 -4
- package/dist/MergeConflicts/index.js +4 -4
- package/dist/OpenInAppCard/index.js +5 -5
- package/dist/PricingCard/index.js +3 -3
- package/dist/PrincipalPicker/index.js +3 -3
- package/dist/ProposalCard/index.js +7 -7
- package/dist/RefusalCard/index.js +4 -4
- package/dist/ResultTableCard/index.js +4 -4
- package/dist/ReviewList/index.js +3 -3
- package/dist/RichEditor/index.js +1 -1
- package/dist/RunChip/index.js +3 -3
- package/dist/SegmentedControl/index.js +3 -3
- package/dist/SettingsTable/index.js +2 -2
- package/dist/SetupWizard/SetupWizard.d.ts +32 -7
- package/dist/SetupWizard/index.js +3 -3
- package/dist/{SetupWizard-WDOFFNIM.css → SetupWizard-Y2PFPBCZ.css} +151 -4
- package/dist/ShareDialog/index.js +1 -1
- package/dist/SheetColumnEditor/index.js +7 -7
- package/dist/SheetGrid/index.js +3 -3
- package/dist/StatusCard/index.js +3 -3
- package/dist/StatusDot/StatusDot.d.ts +7 -0
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-7OMCQCZF.css → StatusDot-FJND3CZY.css} +9 -2
- package/dist/Stepper/index.js +2 -2
- package/dist/{Stepper-32INSYF7.css → Stepper-YQBNYCIS.css} +31 -8
- package/dist/Switcher/index.js +2 -2
- package/dist/TableCells/index.js +3 -3
- package/dist/Tabs/index.js +2 -2
- package/dist/Tag/index.js +2 -2
- package/dist/TagsInput/index.js +3 -3
- package/dist/ThemeGallery/index.js +3 -3
- package/dist/ThemeSwitcher/index.js +4 -4
- package/dist/TimeRangePicker/index.js +5 -5
- package/dist/TimeWindowPicker/index.js +2 -2
- package/dist/ValueField/index.js +3 -3
- package/dist/VersionCompare/index.js +4 -4
- package/dist/{chunk-3N36CYTU.js → chunk-2PIH6JHJ.js} +1 -1
- package/dist/{chunk-RNXYNXKN.js → chunk-2STOSJT3.js} +2 -2
- package/dist/{chunk-P64MIA7C.js → chunk-3JXX5S3Z.js} +2 -2
- package/dist/{chunk-H32JW6CZ.js → chunk-45M73G5A.js} +1 -1
- package/dist/{chunk-6C6YK75K.js → chunk-57AKYFML.js} +1 -1
- package/dist/{chunk-4KSCGXLJ.js → chunk-5BOFC5OP.js} +2 -2
- package/dist/{chunk-NXNLAZPK.js → chunk-5CEQ3HLH.js} +1 -1
- package/dist/chunk-5EFLA6BW.js +205 -0
- package/dist/{chunk-VLGGLLKH.js → chunk-624X3RVA.js} +1 -1
- package/dist/{chunk-LWFOX3PB.js → chunk-63GBSOLU.js} +1 -1
- package/dist/{chunk-ZUBFVK6B.js → chunk-6EWNMSS4.js} +1 -1
- package/dist/{chunk-7IW3P6FH.js → chunk-6G6WHTC7.js} +1 -1
- package/dist/{chunk-JXJNX7QQ.js → chunk-6LXS3X7A.js} +1 -1
- package/dist/{chunk-NQABJAUY.js → chunk-6RW2MUTY.js} +15 -8
- package/dist/{chunk-IPUEVTRJ.js → chunk-6THG44LI.js} +1 -1
- package/dist/{chunk-KWLH45YC.js → chunk-7PJFUQMY.js} +1 -1
- package/dist/{chunk-AB6F5YXX.js → chunk-ADGNISEI.js} +1 -1
- package/dist/{chunk-WQRSZMN4.js → chunk-BBD7PTBG.js} +1 -1
- package/dist/{chunk-TYIHFDMP.js → chunk-BKXUZCZX.js} +1 -1
- package/dist/{chunk-NU5RUT7Y.js → chunk-CFTBESST.js} +1 -1
- package/dist/{chunk-WIATRXEJ.js → chunk-CYQBDZ6M.js} +1 -1
- package/dist/{chunk-ZKIEOWR6.js → chunk-D7G2QGET.js} +1 -1
- package/dist/{chunk-3EY5SEGH.js → chunk-DSMQTED5.js} +3 -3
- package/dist/{chunk-5OFRDX66.js → chunk-E35HYQMK.js} +1 -1
- package/dist/{chunk-ETSF7SU6.js → chunk-FB3TCNQP.js} +1 -1
- package/dist/{chunk-BWAUL5MB.js → chunk-GHQG4VZA.js} +3 -3
- package/dist/{chunk-PIAGTZY3.js → chunk-GPFYITOF.js} +1 -1
- package/dist/{chunk-R6K62EXV.js → chunk-H22SR76M.js} +1 -1
- package/dist/{chunk-IO374IX6.js → chunk-HQOEAUDJ.js} +1 -1
- package/dist/{chunk-J5WWMC35.js → chunk-HWPP22XG.js} +2 -2
- package/dist/{chunk-BWFJB5JD.js → chunk-HZDI2CCS.js} +1 -1
- package/dist/{chunk-3WN5HUAK.js → chunk-I3G5FJ54.js} +1 -1
- package/dist/{chunk-TKBFRGUV.js → chunk-IPBSCJIZ.js} +1 -1
- package/dist/{chunk-ERFXYGRF.js → chunk-IQMWMT4V.js} +2 -2
- package/dist/{chunk-GT2OG2XM.js → chunk-JMTBK55P.js} +2 -2
- package/dist/{chunk-FURJVZCT.js → chunk-LCZULGMB.js} +1 -1
- package/dist/{chunk-PBCNINMB.js → chunk-LMQG3VPG.js} +1 -1
- package/dist/chunk-MKFEVHSR.js +83 -0
- package/dist/{chunk-JPQSVECQ.js → chunk-MP7DGKB6.js} +1 -1
- package/dist/{chunk-DO4J4TBZ.js → chunk-NKBKQEKS.js} +1 -1
- package/dist/{chunk-4MVLED6E.js → chunk-OCGIQGYJ.js} +2 -2
- package/dist/{chunk-EOXI3CRG.js → chunk-OOLMTUCO.js} +1 -1
- package/dist/{chunk-YUHKRRWO.js → chunk-OWHETZIU.js} +1 -1
- package/dist/{chunk-VWMB3CJN.js → chunk-PMBJMNBX.js} +1 -1
- package/dist/{chunk-ADSOY7UM.js → chunk-RIAPCEB5.js} +1 -1
- package/dist/{chunk-HJBHP66O.js → chunk-RJWO2PC5.js} +2 -2
- package/dist/{chunk-NTQPJJAN.js → chunk-RTMNULTL.js} +1 -1
- package/dist/{chunk-AQIFKLXY.js → chunk-SK5SLGZH.js} +1 -1
- package/dist/{chunk-7LSSYHOT.js → chunk-T24HBEU6.js} +1 -1
- package/dist/{chunk-W5AXJWOW.js → chunk-TJIBTHWJ.js} +1 -1
- package/dist/{chunk-TWJERLT3.js → chunk-TKUAGWNR.js} +1 -1
- package/dist/{chunk-JVII5264.js → chunk-TPIMOGOZ.js} +1 -1
- package/dist/{chunk-RQHN4J5P.js → chunk-UYF2B2TH.js} +1 -1
- package/dist/{chunk-I5OIKDX2.js → chunk-VERJCAJ4.js} +1 -1
- package/dist/{chunk-PKVWCKS2.js → chunk-VG3SIJ3M.js} +1 -1
- package/dist/{chunk-HEIOLITO.js → chunk-WK4FQPYW.js} +1 -1
- package/dist/{chunk-4RKTZSEW.js → chunk-WL4TC4YZ.js} +1 -1
- package/dist/{chunk-4DL2BQJE.js → chunk-YL7AR6PR.js} +1 -1
- package/dist/{chunk-LQWORB5B.js → chunk-YQDRJZ5J.js} +1 -1
- package/dist/{chunk-OOPOQKZZ.js → chunk-ZKLEAK7M.js} +1 -1
- package/dist/{chunk-KAA3GFTP.js → chunk-ZMIVQGAB.js} +3 -3
- package/dist/{chunk-OXEOC64K.js → chunk-ZW5SRQ5M.js} +1 -1
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/index.js +80 -79
- package/dist/index.js +80 -79
- package/dist/styles.css +545 -21
- package/package.json +3 -3
- package/dist/chunk-SBHAKX2T.js +0 -124
- /package/dist/{chunk-TWM6G2I2.js → chunk-PCBPDMNU.js} +0 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { Stepper } from './chunk-RJWO2PC5.js';
|
|
2
|
+
import { PageHeader } from './chunk-FPDIHEM4.js';
|
|
3
|
+
import { Disclosure } from './chunk-222VILSP.js';
|
|
4
|
+
import { useHeadingLevel, nextHeadingLevel, headingTag, HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
5
|
+
import { useMediaMatch } from './chunk-RTPQDNW3.js';
|
|
6
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
|
+
import './SetupWizard-Y2PFPBCZ.css';
|
|
8
|
+
import { useId, useRef, useState, useEffect, useCallback, createElement } from 'react';
|
|
9
|
+
import { breakpoint } from '@crewlethq/tokens';
|
|
10
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var LABELS = {
|
|
13
|
+
progress: (position, total) => `Step ${position} of ${total}`,
|
|
14
|
+
asideToggle: "Preview",
|
|
15
|
+
stepsRow: "All steps, scrolls sideways"
|
|
16
|
+
};
|
|
17
|
+
var PHONE = `(width < ${breakpoint.phone})`;
|
|
18
|
+
var STILL_ROW = { overflows: false, left: false, right: false };
|
|
19
|
+
function stepRowOf(scroller) {
|
|
20
|
+
const steps = scroller.querySelectorAll("li");
|
|
21
|
+
if (steps.length === 0) return STILL_ROW;
|
|
22
|
+
const box = scroller.getBoundingClientRect();
|
|
23
|
+
const boxes = [...steps].map((step) => step.getBoundingClientRect());
|
|
24
|
+
const left = Math.min(...boxes.map((r) => r.left)) < box.left - 0.5;
|
|
25
|
+
const right = Math.max(...boxes.map((r) => r.right)) > box.right + 0.5;
|
|
26
|
+
return { overflows: scroller.scrollWidth > scroller.clientWidth + 0.5 || left || right, left, right };
|
|
27
|
+
}
|
|
28
|
+
function clearOfFade(scroller, step) {
|
|
29
|
+
const fade = Number.parseFloat(getComputedStyle(scroller).scrollPaddingInlineStart) || 0;
|
|
30
|
+
const box = scroller.getBoundingClientRect();
|
|
31
|
+
const drawn = step.getBoundingClientRect();
|
|
32
|
+
const pastRight = drawn.right - (box.right - fade);
|
|
33
|
+
const pastLeft = box.left + fade - drawn.left;
|
|
34
|
+
if (pastRight > 0) scroller.scrollLeft += pastRight;
|
|
35
|
+
else if (pastLeft > 0) scroller.scrollLeft -= pastLeft;
|
|
36
|
+
}
|
|
37
|
+
function SetupWizard({
|
|
38
|
+
title,
|
|
39
|
+
headingLevel,
|
|
40
|
+
trail,
|
|
41
|
+
status,
|
|
42
|
+
actions,
|
|
43
|
+
steps,
|
|
44
|
+
current,
|
|
45
|
+
reached,
|
|
46
|
+
onSelect,
|
|
47
|
+
stepsLabel,
|
|
48
|
+
heading,
|
|
49
|
+
lead,
|
|
50
|
+
children,
|
|
51
|
+
aside,
|
|
52
|
+
asideLabel,
|
|
53
|
+
footer,
|
|
54
|
+
primaryAction,
|
|
55
|
+
footerStart,
|
|
56
|
+
wide = false,
|
|
57
|
+
labels,
|
|
58
|
+
className,
|
|
59
|
+
...rest
|
|
60
|
+
}) {
|
|
61
|
+
const text = { ...LABELS, ...labels };
|
|
62
|
+
const phone = useMediaMatch(PHONE);
|
|
63
|
+
const context = useHeadingLevel();
|
|
64
|
+
const titleLevel = headingLevel ?? context;
|
|
65
|
+
const stepLevel = nextHeadingLevel(titleLevel);
|
|
66
|
+
const contentLevel = nextHeadingLevel(stepLevel);
|
|
67
|
+
const headingId = useId();
|
|
68
|
+
const headingRef = useRef(null);
|
|
69
|
+
const stepsRef = useRef(null);
|
|
70
|
+
const [row, setRow] = useState(STILL_ROW);
|
|
71
|
+
const shown = useRef(current);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
if (shown.current === current) return;
|
|
74
|
+
shown.current = current;
|
|
75
|
+
headingRef.current?.focus();
|
|
76
|
+
}, [current]);
|
|
77
|
+
const measure = useCallback(() => {
|
|
78
|
+
const scroller = stepsRef.current;
|
|
79
|
+
if (!scroller) return;
|
|
80
|
+
const next = stepRowOf(scroller);
|
|
81
|
+
setRow((was) => was.overflows === next.overflows && was.left === next.left && was.right === next.right ? was : next);
|
|
82
|
+
}, []);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!phone) return;
|
|
85
|
+
const scroller = stepsRef.current;
|
|
86
|
+
const here = scroller?.querySelector('[aria-current="step"]')?.closest("li");
|
|
87
|
+
if (!scroller || !here) return;
|
|
88
|
+
const box = scroller.getBoundingClientRect();
|
|
89
|
+
const step2 = here.getBoundingClientRect();
|
|
90
|
+
scroller.scrollLeft += step2.left + step2.width / 2 - (box.left + box.width / 2);
|
|
91
|
+
measure();
|
|
92
|
+
}, [phone, current, measure]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
if (!phone) return;
|
|
95
|
+
window.addEventListener("resize", measure);
|
|
96
|
+
return () => window.removeEventListener("resize", measure);
|
|
97
|
+
}, [phone, measure]);
|
|
98
|
+
if (aside !== void 0 && aside !== null && !asideLabel) {
|
|
99
|
+
throw new TypeError("SetupWizard needs an asideLabel with an aside: it names the aside\u2019s landmark");
|
|
100
|
+
}
|
|
101
|
+
const position = steps.findIndex((step2) => step2.id === current);
|
|
102
|
+
const step = steps[position];
|
|
103
|
+
const stepper = /* @__PURE__ */ jsx(
|
|
104
|
+
Stepper,
|
|
105
|
+
{
|
|
106
|
+
label: stepsLabel,
|
|
107
|
+
steps,
|
|
108
|
+
current,
|
|
109
|
+
reached,
|
|
110
|
+
onSelect,
|
|
111
|
+
tone: "brand",
|
|
112
|
+
orientation: phone ? "horizontal" : "vertical"
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
const asideBlock = aside === void 0 || aside === null ? null : /* @__PURE__ */ jsx("aside", { className: "crewlet-setup-wizard__aside", "aria-label": asideLabel, children: /* @__PURE__ */ jsx(HeadingLevelProvider, { level: contentLevel, children: aside }) });
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
...rest,
|
|
120
|
+
className: cx(
|
|
121
|
+
"crewlet-setup-wizard",
|
|
122
|
+
asideBlock === null && "crewlet-setup-wizard--no-aside",
|
|
123
|
+
wide && "crewlet-setup-wizard--wide",
|
|
124
|
+
className
|
|
125
|
+
),
|
|
126
|
+
children: /* @__PURE__ */ jsxs("div", { className: "crewlet-setup-wizard__frame", children: [
|
|
127
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-setup-wizard__head", children: [
|
|
128
|
+
trail ? /* @__PURE__ */ jsx("div", { className: "crewlet-setup-wizard__trail", children: trail }) : null,
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
PageHeader,
|
|
131
|
+
{
|
|
132
|
+
title,
|
|
133
|
+
headingLevel: titleLevel,
|
|
134
|
+
actions: status || actions ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
|
+
status ? /* @__PURE__ */ jsx("span", { className: "crewlet-setup-wizard__status", children: status }) : null,
|
|
136
|
+
actions
|
|
137
|
+
] }) : void 0
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsxs("nav", { className: "crewlet-setup-wizard__rail", "aria-label": stepsLabel, children: [
|
|
142
|
+
phone && step ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ jsxs("p", { className: "crewlet-setup-wizard__position", children: [
|
|
144
|
+
text.progress(position + 1, steps.length),
|
|
145
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " \xB7 " }),
|
|
146
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-setup-wizard__position-step", children: step.label })
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ jsx(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
className: "crewlet-setup-wizard__progress",
|
|
152
|
+
"aria-hidden": "true",
|
|
153
|
+
style: { "--crewlet-setup-wizard-progress": String((position + 1) / steps.length) }
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
] }) : null,
|
|
157
|
+
phone ? (
|
|
158
|
+
// A ROW THAT OVERFLOWS IS A SCROLLER THE KEYBOARD CAN REACH: it
|
|
159
|
+
// takes focus and a name only while it hides steps, since a pill
|
|
160
|
+
// that only labels its step takes no focus of its own. Its focus
|
|
161
|
+
// ring is drawn by the frame around it, which the edge fade does
|
|
162
|
+
// not reach (SetupWizard.css).
|
|
163
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-setup-wizard__steps-frame", children: /* @__PURE__ */ jsx(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: stepsRef,
|
|
167
|
+
className: "crewlet-setup-wizard__steps",
|
|
168
|
+
"data-fade-left": row.left ? "" : void 0,
|
|
169
|
+
"data-fade-right": row.right ? "" : void 0,
|
|
170
|
+
onScroll: measure,
|
|
171
|
+
onFocus: (event) => {
|
|
172
|
+
const step2 = event.target.closest("li");
|
|
173
|
+
if (event.target === event.currentTarget || !step2 || !event.currentTarget.contains(step2)) return;
|
|
174
|
+
clearOfFade(event.currentTarget, step2);
|
|
175
|
+
measure();
|
|
176
|
+
},
|
|
177
|
+
...row.overflows ? { tabIndex: 0, role: "group", "aria-label": text.stepsRow } : {},
|
|
178
|
+
children: stepper
|
|
179
|
+
}
|
|
180
|
+
) })
|
|
181
|
+
) : stepper
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ jsxs("section", { className: "crewlet-setup-wizard__content", "aria-labelledby": headingId, children: [
|
|
184
|
+
createElement(
|
|
185
|
+
headingTag(stepLevel),
|
|
186
|
+
{ id: headingId, ref: headingRef, tabIndex: -1, className: "crewlet-setup-wizard__heading" },
|
|
187
|
+
heading
|
|
188
|
+
),
|
|
189
|
+
lead ? /* @__PURE__ */ jsx("p", { className: "crewlet-setup-wizard__lead", children: lead }) : null,
|
|
190
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-setup-wizard__body", children: /* @__PURE__ */ jsx(HeadingLevelProvider, { level: contentLevel, children }) })
|
|
191
|
+
] }),
|
|
192
|
+
asideBlock === null ? null : phone ? /* @__PURE__ */ jsx(Disclosure, { className: "crewlet-setup-wizard__preview", title: text.asideToggle, headingLevel: stepLevel, children: asideBlock }) : asideBlock,
|
|
193
|
+
/* @__PURE__ */ jsxs("footer", { className: "crewlet-setup-wizard__footer", children: [
|
|
194
|
+
footerStart ? /* @__PURE__ */ jsx("div", { className: "crewlet-setup-wizard__footer-start", children: footerStart }) : null,
|
|
195
|
+
/* @__PURE__ */ jsxs("div", { className: "crewlet-setup-wizard__footer-end", children: [
|
|
196
|
+
footer,
|
|
197
|
+
primaryAction ? /* @__PURE__ */ jsx("span", { className: "crewlet-setup-wizard__primary", children: primaryAction }) : null
|
|
198
|
+
] })
|
|
199
|
+
] })
|
|
200
|
+
] })
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { SetupWizard };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThemeSwatch } from './chunk-3XQUEF5C.js';
|
|
2
2
|
import { useHighlightRest } from './chunk-7KHM2FZH.js';
|
|
3
|
-
import { Tag } from './chunk-
|
|
3
|
+
import { Tag } from './chunk-VERJCAJ4.js';
|
|
4
4
|
import { useRoving, tabStop } from './chunk-EGMQURBR.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './ThemeGallery-UEFZRT6W.css';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useListbox, useOptionKeys } from './chunk-7KHM2FZH.js';
|
|
2
|
-
import { Input } from './chunk-
|
|
2
|
+
import { Input } from './chunk-FB3TCNQP.js';
|
|
3
3
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './HitArea-QUOS6ZDJ.css';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Table } from './chunk-75NQV4R4.js';
|
|
2
2
|
import { DownloadButton } from './chunk-EHFQMY3B.js';
|
|
3
|
-
import { StatusCard } from './chunk-
|
|
3
|
+
import { StatusCard } from './chunk-RTMNULTL.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './ResultTableCard-AP355LQM.css';
|
|
6
6
|
import { useState } from 'react';
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
2
2
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
3
|
import './HitArea-QUOS6ZDJ.css';
|
|
4
|
-
import './ChoiceList-
|
|
4
|
+
import './ChoiceList-JN4PPNFW.css';
|
|
5
5
|
import { useId } from 'react';
|
|
6
6
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
8
|
function ChoiceList({ options, value, onChange, label, footer, disabled, className }) {
|
|
9
9
|
const name = useId();
|
|
10
10
|
return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-choice-list", disabled && "is-disabled", className), children: [
|
|
11
|
-
/* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": label, className: "crewlet-choice-list__group", children: options.map((option) => {
|
|
12
|
-
const id = `${name}-${
|
|
11
|
+
/* @__PURE__ */ jsx("div", { role: "radiogroup", "aria-label": label, className: "crewlet-choice-list__group", children: options.map((option, index) => {
|
|
12
|
+
const id = `${name}-${index}`;
|
|
13
13
|
const checked = option.value === value;
|
|
14
|
+
const off = disabled || option.disabled;
|
|
15
|
+
const reasonId = option.disabled && option.disabledReason ? `${id}-reason` : void 0;
|
|
14
16
|
return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-choice-list__item", option.separated && "is-separated"), children: [
|
|
15
|
-
/* @__PURE__ */ jsxs("label", { className: cx("crewlet-choice-list__row", HIT_AREA_CLASS, option.media != null && "has-media", checked && "is-checked"), htmlFor: id, children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("label", { className: cx("crewlet-choice-list__row", HIT_AREA_CLASS, option.media != null && "has-media", checked && "is-checked", option.disabled && "is-disabled"), htmlFor: id, children: [
|
|
16
18
|
/* @__PURE__ */ jsx(
|
|
17
19
|
"input",
|
|
18
20
|
{
|
|
@@ -21,17 +23,22 @@ function ChoiceList({ options, value, onChange, label, footer, disabled, classNa
|
|
|
21
23
|
name,
|
|
22
24
|
value: option.value,
|
|
23
25
|
checked,
|
|
24
|
-
disabled,
|
|
26
|
+
disabled: off,
|
|
27
|
+
"aria-labelledby": reasonId ? [`${id}-label`, option.detail ? `${id}-detail` : null, option.tag ? `${id}-tag` : null].filter(Boolean).join(" ") : void 0,
|
|
28
|
+
"aria-describedby": reasonId,
|
|
25
29
|
onChange: () => onChange(option.value),
|
|
26
30
|
className: "crewlet-choice-list__radio"
|
|
27
31
|
}
|
|
28
32
|
),
|
|
29
33
|
option.media != null ? /* @__PURE__ */ jsx("span", { className: "crewlet-choice-list__media", "aria-hidden": true, children: option.media }) : null,
|
|
30
34
|
/* @__PURE__ */ jsxs("span", { className: "crewlet-choice-list__text", children: [
|
|
31
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-list__label", children: option.label }),
|
|
32
|
-
option.detail ? /* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ jsx("span", { id: `${id}-label`, className: "crewlet-choice-list__label", children: option.label }),
|
|
36
|
+
option.detail || reasonId ? /* @__PURE__ */ jsxs("span", { className: "crewlet-choice-list__detail", children: [
|
|
37
|
+
option.detail ? /* @__PURE__ */ jsx("span", { id: `${id}-detail`, children: option.detail }) : null,
|
|
38
|
+
reasonId ? /* @__PURE__ */ jsx("span", { id: reasonId, className: "crewlet-choice-list__reason", children: option.disabledReason }) : null
|
|
39
|
+
] }) : null
|
|
33
40
|
] }),
|
|
34
|
-
option.tag ? /* @__PURE__ */ jsx("span", { className: "crewlet-choice-list__tag", children: option.tag }) : null
|
|
41
|
+
option.tag ? /* @__PURE__ */ jsx("span", { id: `${id}-tag`, className: "crewlet-choice-list__tag", children: option.tag }) : null
|
|
35
42
|
] }),
|
|
36
43
|
checked && option.panel ? /* @__PURE__ */ jsx("div", { className: "crewlet-choice-list__panel", children: option.panel }) : null
|
|
37
44
|
] }, option.value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRoving, tabStop } from './chunk-EGMQURBR.js';
|
|
2
|
-
import { StatusDot } from './chunk-
|
|
2
|
+
import { StatusDot } from './chunk-CYQBDZ6M.js';
|
|
3
3
|
import { Count } from './chunk-MLDTLZAO.js';
|
|
4
4
|
import { Menu } from './chunk-OQG4P5KU.js';
|
|
5
5
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
2
|
-
import { Tag } from './chunk-
|
|
2
|
+
import { Tag } from './chunk-VERJCAJ4.js';
|
|
3
3
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './ContrastBadge-CBZPGG3G.css';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PrincipalAvatar } from './chunk-N2BF272H.js';
|
|
2
2
|
import { toInstant, RelativeTime, formatExact, toISO } from './chunk-EJNJMHQG.js';
|
|
3
3
|
import { Document } from './chunk-BXCL6P5Z.js';
|
|
4
|
-
import { Composer } from './chunk-
|
|
4
|
+
import { Composer } from './chunk-E35HYQMK.js';
|
|
5
5
|
import { Count } from './chunk-MLDTLZAO.js';
|
|
6
6
|
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
7
7
|
import { Button } from './chunk-DGXZ635L.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DiffList } from './chunk-LR4IWUWQ.js';
|
|
2
|
-
import { Tag } from './chunk-
|
|
2
|
+
import { Tag } from './chunk-VERJCAJ4.js';
|
|
3
3
|
import { Disclosure } from './chunk-222VILSP.js';
|
|
4
4
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefusalStrip, ReceiptStrip } from './chunk-ZWCK4N4L.js';
|
|
2
|
-
import { ChangeList } from './chunk-
|
|
3
|
-
import { StatusCard } from './chunk-
|
|
4
|
-
import { Checkbox } from './chunk-
|
|
2
|
+
import { ChangeList } from './chunk-BBD7PTBG.js';
|
|
3
|
+
import { StatusCard } from './chunk-RTMNULTL.js';
|
|
4
|
+
import { Checkbox } from './chunk-LMQG3VPG.js';
|
|
5
5
|
import { Disclosure } from './chunk-222VILSP.js';
|
|
6
6
|
import { Button } from './chunk-DGXZ635L.js';
|
|
7
7
|
import { Spinner } from './chunk-XSPCITPN.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Kbd } from './chunk-ANTAQAR4.js';
|
|
2
|
-
import { Textarea } from './chunk-
|
|
2
|
+
import { Textarea } from './chunk-FB3TCNQP.js';
|
|
3
3
|
import { isComposing } from './chunk-H5XTJ7GJ.js';
|
|
4
4
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -6,7 +6,7 @@ import { IconButton } from './chunk-UAUP6XGK.js';
|
|
|
6
6
|
import { useFocusModality } from './chunk-NUZHC6MM.js';
|
|
7
7
|
import { VisuallyHidden } from './chunk-UT6CW3C7.js';
|
|
8
8
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
9
|
-
import './Input-
|
|
9
|
+
import './Input-WSMB7JG2.css';
|
|
10
10
|
import './VisuallyHidden-AOEXU5EB.css';
|
|
11
11
|
import { forwardRef, useRef, useState, useImperativeHandle, useEffect, useId } from 'react';
|
|
12
12
|
import { XGlyph } from '@crewlethq/icons/glyphs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Select } from './chunk-VK45YJLH.js';
|
|
2
|
-
import { Combobox } from './chunk-
|
|
3
|
-
import { FormField, Textarea, InputAffix } from './chunk-
|
|
4
|
-
import './Input-
|
|
2
|
+
import { Combobox } from './chunk-6EWNMSS4.js';
|
|
3
|
+
import { FormField, Textarea, InputAffix } from './chunk-FB3TCNQP.js';
|
|
4
|
+
import './Input-WSMB7JG2.css';
|
|
5
5
|
import './VisuallyHidden-AOEXU5EB.css';
|
|
6
6
|
import './HitArea-QUOS6ZDJ.css';
|
|
7
7
|
import './Combobox-GBCWXWEB.css';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PageHeader } from './chunk-FPDIHEM4.js';
|
|
2
2
|
import { FilterPill } from './chunk-K4LZXSKZ.js';
|
|
3
|
-
import { DataTable } from './chunk-BWFJB5JD.js';
|
|
4
3
|
import { DateTimePicker } from './chunk-HPI5J6AR.js';
|
|
4
|
+
import { DataTable } from './chunk-HZDI2CCS.js';
|
|
5
5
|
import { useListbox, useOptionKeys } from './chunk-7KHM2FZH.js';
|
|
6
6
|
import { Toolbar } from './chunk-NR4CPM4T.js';
|
|
7
7
|
import { Popover } from './chunk-KHJIEPZV.js';
|
|
8
8
|
import { RelativeTime } from './chunk-EJNJMHQG.js';
|
|
9
9
|
import { Kbd } from './chunk-ANTAQAR4.js';
|
|
10
|
-
import { Input } from './chunk-
|
|
10
|
+
import { Input } from './chunk-FB3TCNQP.js';
|
|
11
11
|
import { Count } from './chunk-MLDTLZAO.js';
|
|
12
12
|
import { Menu } from './chunk-OQG4P5KU.js';
|
|
13
13
|
import { Button } from './chunk-DGXZ635L.js';
|
|
@@ -2,7 +2,7 @@ import { Modal } from './chunk-C667GCU7.js';
|
|
|
2
2
|
import { useClipboard } from './chunk-STJ7QBC3.js';
|
|
3
3
|
import { EmptyValue } from './chunk-RE3FBGQQ.js';
|
|
4
4
|
import { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
|
|
5
|
-
import { Checkbox } from './chunk-
|
|
5
|
+
import { Checkbox } from './chunk-LMQG3VPG.js';
|
|
6
6
|
import { Menu } from './chunk-OQG4P5KU.js';
|
|
7
7
|
import { Button } from './chunk-DGXZ635L.js';
|
|
8
8
|
import { IconButton } from './chunk-UAUP6XGK.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tooltip } from './chunk-I33UIUZD.js';
|
|
2
|
-
import { SegmentedControl } from './chunk-
|
|
2
|
+
import { SegmentedControl } from './chunk-BKXUZCZX.js';
|
|
3
3
|
import { ArtifactIcon } from './chunk-AVL52EME.js';
|
|
4
4
|
import { isApplePlatform, Kbd } from './chunk-ANTAQAR4.js';
|
|
5
5
|
import { Menu } from './chunk-OQG4P5KU.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Toolbar } from './chunk-NR4CPM4T.js';
|
|
2
|
-
import { SegmentedControl } from './chunk-
|
|
3
|
-
import { tabId } from './chunk-
|
|
2
|
+
import { SegmentedControl } from './chunk-BKXUZCZX.js';
|
|
3
|
+
import { tabId } from './chunk-6THG44LI.js';
|
|
4
4
|
import { IconButton } from './chunk-UAUP6XGK.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
6
6
|
import './MarkdownEditor-BLCJRGDC.css';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { safeHref } from './chunk-KBZO4B33.js';
|
|
2
1
|
import { IconTile } from './chunk-3LI4TRUR.js';
|
|
2
|
+
import { safeHref } from './chunk-KBZO4B33.js';
|
|
3
3
|
import { ReceiptStrip } from './chunk-ZWCK4N4L.js';
|
|
4
|
-
import { StatusCard } from './chunk-
|
|
4
|
+
import { StatusCard } from './chunk-RTMNULTL.js';
|
|
5
5
|
import { ButtonLink, Button } from './chunk-DGXZ635L.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
7
|
import './OpenInAppCard-CKHCK7DO.css';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { StatusDot } from './chunk-CYQBDZ6M.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './ChoiceCards-HAGJMK6Q.css';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function ChoiceCards({ label, options, value, onChange, minCardWidth = "md", className }) {
|
|
8
|
+
const name = useId();
|
|
9
|
+
const described = options.some((o) => o.description != null && o.description !== false && o.description !== "");
|
|
10
|
+
const facts = Math.max(0, ...options.map((o) => o.facts?.length ?? 0));
|
|
11
|
+
const inFact = (o) => o.disabledReasonAt !== void 0 && o.disabledReasonAt >= 0 && o.disabledReasonAt < (o.facts?.length ?? 0);
|
|
12
|
+
const reasons = options.some((o) => o.disabled && o.disabledReason && !inFact(o)) ? 1 : 0;
|
|
13
|
+
const rows = { "--crewlet-choice-cards-rows": 1 + (described ? 1 : 0) + facts + reasons };
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
role: "radiogroup",
|
|
18
|
+
"aria-label": label,
|
|
19
|
+
className: cx("crewlet-choice-cards", `crewlet-choice-cards--${minCardWidth}`, className),
|
|
20
|
+
style: rows,
|
|
21
|
+
children: options.map((option, index) => {
|
|
22
|
+
const id = `${name}-${index}`;
|
|
23
|
+
const checked = option.value === value;
|
|
24
|
+
const part = (what) => `${id}-${what}`;
|
|
25
|
+
const reason = option.disabled && option.disabledReason ? part("reason") : null;
|
|
26
|
+
const reasonAt = reason && inFact(option) ? option.disabledReasonAt : -1;
|
|
27
|
+
const labelledBy = [part("label"), option.tag ? part("tag") : null].filter(Boolean).join(" ");
|
|
28
|
+
const describedBy = [
|
|
29
|
+
option.description ? part("description") : null,
|
|
30
|
+
...(option.facts ?? []).map((_, at) => at === reasonAt ? reason : part(`fact-${at}`)),
|
|
31
|
+
reasonAt < 0 ? reason : null
|
|
32
|
+
].filter(Boolean).join(" ");
|
|
33
|
+
return /* @__PURE__ */ jsxs(
|
|
34
|
+
"label",
|
|
35
|
+
{
|
|
36
|
+
htmlFor: id,
|
|
37
|
+
className: cx("crewlet-choice-cards__card", checked && "is-checked", option.disabled && "is-disabled"),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
"input",
|
|
41
|
+
{
|
|
42
|
+
id,
|
|
43
|
+
type: "radio",
|
|
44
|
+
name,
|
|
45
|
+
value: option.value,
|
|
46
|
+
checked,
|
|
47
|
+
disabled: option.disabled,
|
|
48
|
+
"aria-labelledby": labelledBy,
|
|
49
|
+
"aria-describedby": describedBy || void 0,
|
|
50
|
+
onChange: () => onChange(option.value),
|
|
51
|
+
className: "crewlet-choice-cards__radio"
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-choice-cards__title", children: [
|
|
55
|
+
option.media != null ? /* @__PURE__ */ jsx("span", { className: "crewlet-choice-cards__media", "aria-hidden": true, children: option.media }) : null,
|
|
56
|
+
/* @__PURE__ */ jsx("span", { id: part("label"), className: "crewlet-choice-cards__label", children: option.label }),
|
|
57
|
+
option.tag ? /* @__PURE__ */ jsx("span", { id: part("tag"), className: "crewlet-choice-cards__tag", children: option.tag }) : null
|
|
58
|
+
] }),
|
|
59
|
+
option.description ? /* @__PURE__ */ jsx("span", { id: part("description"), className: "crewlet-choice-cards__description", children: option.description }) : described ? /* @__PURE__ */ jsx("span", { className: "crewlet-choice-cards__description", "aria-hidden": true }) : null,
|
|
60
|
+
option.facts && option.facts.length > 0 ? /* @__PURE__ */ jsx("span", { className: "crewlet-choice-cards__facts", children: option.facts.map((fact, at) => /* @__PURE__ */ jsxs(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
id: at === reasonAt ? reason : part(`fact-${at}`),
|
|
64
|
+
className: cx("crewlet-choice-cards__fact", at === reasonAt && "is-reason"),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-cards__fact-label", children: fact.label }),
|
|
67
|
+
" ",
|
|
68
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-cards__fact-value", children: fact.tone ? /* @__PURE__ */ jsx(StatusDot, { tone: fact.tone, children: at === reasonAt ? option.disabledReason : fact.value }) : at === reasonAt ? option.disabledReason : fact.value })
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
at
|
|
72
|
+
)) }) : null,
|
|
73
|
+
reason && reasonAt < 0 ? /* @__PURE__ */ jsx("span", { id: reason, className: "crewlet-choice-cards__reason", children: option.disabledReason }) : null
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
option.value
|
|
77
|
+
);
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export { ChoiceCards };
|
|
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
9
|
var engine = null;
|
|
10
10
|
var loading = null;
|
|
11
11
|
function loadEngine() {
|
|
12
|
-
loading ??= import('./Editor-
|
|
12
|
+
loading ??= import('./Editor-BXOWAV46.js').then(
|
|
13
13
|
(module) => {
|
|
14
14
|
engine = module.Editor;
|
|
15
15
|
return engine;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconTile } from './chunk-3LI4TRUR.js';
|
|
2
|
-
import { Tag } from './chunk-
|
|
2
|
+
import { Tag } from './chunk-VERJCAJ4.js';
|
|
3
3
|
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './ReviewList-2IZA67EX.css';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Modal } from './chunk-C667GCU7.js';
|
|
2
2
|
import { Callout } from './chunk-BPCY7ZID.js';
|
|
3
|
-
import { SegmentedControl } from './chunk-
|
|
4
|
-
import { FormField, Input } from './chunk-
|
|
3
|
+
import { SegmentedControl } from './chunk-BKXUZCZX.js';
|
|
4
|
+
import { FormField, Input } from './chunk-FB3TCNQP.js';
|
|
5
5
|
import { Button } from './chunk-DGXZ635L.js';
|
|
6
6
|
import { useState } from 'react';
|
|
7
7
|
import { ClockGlyph } from '@crewlethq/icons/glyphs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { diffLines, diffStat, collapseDiff, DiffSummary, DiffView } from './chunk-AOFVXE6V.js';
|
|
2
|
-
import { SegmentedControl } from './chunk-
|
|
2
|
+
import { SegmentedControl } from './chunk-BKXUZCZX.js';
|
|
3
3
|
import { EmptyState } from './chunk-PPUR46MK.js';
|
|
4
4
|
import { useHeadingLevel, headingTag, nextHeadingLevel, HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|