@crewlethq/ui 0.61.0 → 0.63.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.
Files changed (103) hide show
  1. package/README.md +8 -0
  2. package/dist/AgentHandoffPanel/index.js +1 -1
  3. package/dist/AppShell/index.js +1 -1
  4. package/dist/ArtifactBar/index.js +5 -5
  5. package/dist/ArtifactCard/index.js +3 -3
  6. package/dist/AttachmentChip/AttachmentChip.d.ts +37 -0
  7. package/dist/AttachmentChip/index.d.ts +3 -0
  8. package/dist/AttachmentChip/index.js +6 -0
  9. package/dist/AttachmentChip-XF4KPQ3G.css +16 -0
  10. package/dist/AvatarPicker/index.js +6 -6
  11. package/dist/Canvas/index.js +1 -1
  12. package/dist/CanvasBoard/index.js +1 -1
  13. package/dist/CanvasToolbar/index.js +1 -1
  14. package/dist/Combobox/index.js +1 -1
  15. package/dist/CommandPalette/index.js +1 -1
  16. package/dist/CommentThread/index.js +1 -1
  17. package/dist/ContrastBadge/index.js +2 -2
  18. package/dist/ContrastHelp/index.js +3 -3
  19. package/dist/DataTable/index.js +1 -1
  20. package/dist/DataView/index.js +1 -1
  21. package/dist/DateTimePicker/index.js +1 -1
  22. package/dist/DeepWorkCard/DeepWorkCard.d.ts +85 -0
  23. package/dist/DeepWorkCard/index.d.ts +3 -0
  24. package/dist/DeepWorkCard/index.js +17 -0
  25. package/dist/DeepWorkCard-DGHRIQDM.css +80 -0
  26. package/dist/DocTabsEditor/index.js +1 -1
  27. package/dist/DownloadButton/DownloadButton.d.ts +7 -1
  28. package/dist/DownloadButton/index.js +1 -1
  29. package/dist/FileList/FileList.d.ts +42 -0
  30. package/dist/FileList/index.d.ts +3 -0
  31. package/dist/FileList/index.js +3 -0
  32. package/dist/FileList-TGDNV2QS.css +89 -0
  33. package/dist/FollowBanner/index.js +1 -1
  34. package/dist/HuePicker/index.js +5 -5
  35. package/dist/InlineEditor/index.js +1 -1
  36. package/dist/LinkInterstitial/index.js +1 -1
  37. package/dist/ListInput/index.js +1 -1
  38. package/dist/LogoSlot/index.js +3 -3
  39. package/dist/MarkdownEditor/index.js +5 -5
  40. package/dist/Menu/index.js +1 -1
  41. package/dist/MergeConflicts/index.js +5 -5
  42. package/dist/Modal/index.js +1 -1
  43. package/dist/OpenInAppCard/index.js +2 -2
  44. package/dist/PeekRail/index.js +1 -1
  45. package/dist/PresenterView/index.js +1 -1
  46. package/dist/PrincipalPicker/index.js +2 -2
  47. package/dist/ResultTableCard/index.js +3 -3
  48. package/dist/RichEditor/index.js +1 -1
  49. package/dist/SegmentedControl/index.js +4 -4
  50. package/dist/SelectionBar/index.js +1 -1
  51. package/dist/SetupWizard/index.js +2 -2
  52. package/dist/ShareDialog/index.js +1 -1
  53. package/dist/SheetColumnEditor/index.js +6 -6
  54. package/dist/SheetGrid/index.js +3 -3
  55. package/dist/SlideCompare/index.js +1 -1
  56. package/dist/SlideFilmstrip/index.js +1 -1
  57. package/dist/Switcher/index.js +1 -1
  58. package/dist/Tabs/index.js +3 -3
  59. package/dist/ThemeGallery/index.js +1 -1
  60. package/dist/ThemeSwitcher/index.js +5 -5
  61. package/dist/TimeRangePicker/index.js +5 -5
  62. package/dist/TimeWindowPicker/index.js +1 -1
  63. package/dist/TreeCanvas/index.js +1 -1
  64. package/dist/ValueField/ValueField.d.ts +117 -0
  65. package/dist/ValueField/index.d.ts +10 -0
  66. package/dist/ValueField/index.js +15 -0
  67. package/dist/ValueField/references.d.ts +66 -0
  68. package/dist/ValueField-EIBD6RYS.css +13 -0
  69. package/dist/VersionCompare/index.js +5 -5
  70. package/dist/{chunk-53NTMTRM.js → chunk-6IGIYOTV.js} +1 -1
  71. package/dist/chunk-CZXF6EFK.js +52 -0
  72. package/dist/{chunk-5ZGJ22CO.js → chunk-DHIO6Q75.js} +1 -1
  73. package/dist/{chunk-3BQWARG2.js → chunk-F7VBYCW2.js} +1 -1
  74. package/dist/{chunk-5G76O23M.js → chunk-IJIC4COR.js} +1 -1
  75. package/dist/{chunk-RPHQNXE5.js → chunk-IOZFPFQS.js} +1 -1
  76. package/dist/{chunk-NL72YZWF.js → chunk-ISHLFPNN.js} +1 -1
  77. package/dist/{chunk-5KW63GZ3.js → chunk-JAOJLEYB.js} +1 -1
  78. package/dist/{chunk-MOW65OIJ.js → chunk-JPVORBWC.js} +1 -1
  79. package/dist/chunk-KYTOEWJD.js +56 -0
  80. package/dist/chunk-LA4PX7Z6.js +118 -0
  81. package/dist/{chunk-LG6TUGET.js → chunk-NSCYGUDG.js} +2 -0
  82. package/dist/chunk-OD3Z6QKN.js +237 -0
  83. package/dist/{chunk-OM6CPZB7.js → chunk-OIMWGV2N.js} +1 -1
  84. package/dist/{chunk-5PMFRAGL.js → chunk-OU4FLGOZ.js} +1 -1
  85. package/dist/{chunk-5MN2HISF.js → chunk-PHQPQZUX.js} +1 -1
  86. package/dist/{chunk-VC2M2E7N.js → chunk-PK2P2QH6.js} +4 -3
  87. package/dist/{chunk-NRMXUNLR.js → chunk-QCVAVAF6.js} +1 -1
  88. package/dist/{chunk-LND6XSXN.js → chunk-S2VMOITT.js} +1 -1
  89. package/dist/{chunk-VRPDQSXZ.js → chunk-SELUJSTZ.js} +2 -2
  90. package/dist/{chunk-3633T7EJ.js → chunk-WSV3MBOE.js} +1 -1
  91. package/dist/generated/index.d.ts +4 -0
  92. package/dist/generated/index.js +88 -84
  93. package/dist/index.js +88 -84
  94. package/dist/styles.css +210 -0
  95. package/package.json +3 -3
  96. package/dist/{Editor-DM7X24B7.js → Editor-GHHWWXXL.js} +1 -1
  97. package/dist/{chunk-VN3DCUED.js → chunk-27JCHL64.js} +1 -1
  98. package/dist/{chunk-T4THNJ6E.js → chunk-5DCY2QUY.js} +1 -1
  99. package/dist/{chunk-WDRYUMN6.js → chunk-BSAQE7PO.js} +1 -1
  100. package/dist/{chunk-I43D5K6A.js → chunk-CT6I36FH.js} +1 -1
  101. package/dist/{chunk-MHFTG2LO.js → chunk-EBCH3MRX.js} +1 -1
  102. package/dist/{chunk-OXZKRUGM.js → chunk-TXQNWGUD.js} +0 -0
  103. package/dist/{chunk-WXSGCYZO.js → chunk-VVVB3OBW.js} +1 -1
@@ -0,0 +1,237 @@
1
+ import { Select } from './chunk-XQZ6EWOE.js';
2
+ import { Combobox } from './chunk-PK2P2QH6.js';
3
+ import { FormField, Textarea, InputAffix } from './chunk-TLIJG4TP.js';
4
+ import './Input-GMOWHZRG.css';
5
+ import './VisuallyHidden-AOEXU5EB.css';
6
+ import './HitArea-QUOS6ZDJ.css';
7
+ import './Combobox-GBCWXWEB.css';
8
+ import './Select-F526HLNR.css';
9
+ import './ValueField-EIBD6RYS.css';
10
+ import { useId, useRef, useState } from 'react';
11
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
12
+
13
+ // src/ValueField/references.ts
14
+ var REFERENCE_NAME_PATTERN = "[A-Za-z_][A-Za-z0-9_]*";
15
+ var WHOLE_REFERENCE = new RegExp(`^\\$\\{${REFERENCE_NAME_PATTERN}\\}$`);
16
+ function isWholeReference(value) {
17
+ return WHOLE_REFERENCE.test(value.trim());
18
+ }
19
+ function referenceAt(value, caret) {
20
+ const head = value.slice(0, caret);
21
+ for (let i = head.length - 1; i >= 0; i--) {
22
+ const ch = head.charAt(i);
23
+ if (ch === "$") {
24
+ const rest = head.slice(i + 1);
25
+ const name = rest.startsWith("{") ? rest.slice(1) : rest;
26
+ if (!/^[A-Za-z0-9_]*$/.test(name)) return null;
27
+ return { start: i, query: name };
28
+ }
29
+ if (/\s/.test(ch) || ch === "}") return null;
30
+ }
31
+ return null;
32
+ }
33
+ function rankReferences(names, query) {
34
+ const q = query.toLowerCase();
35
+ if (q === "") return [...names];
36
+ const scored = [];
37
+ names.forEach((name, index) => {
38
+ const lower = name.toLowerCase();
39
+ if (lower.startsWith(q)) scored.push({ name, tier: 0, index });
40
+ else if (lower.includes(q)) scored.push({ name, tier: 1, index });
41
+ else if (isSubsequence(lower, q)) scored.push({ name, tier: 2, index });
42
+ });
43
+ return scored.sort((a, b) => a.tier - b.tier || a.index - b.index).map((s) => s.name);
44
+ }
45
+ function isSubsequence(s, q) {
46
+ let at = 0;
47
+ for (const ch of q) {
48
+ at = s.indexOf(ch, at);
49
+ if (at < 0) return false;
50
+ at += 1;
51
+ }
52
+ return true;
53
+ }
54
+ function completeReference(value, caret, at, name) {
55
+ const written = "${" + name + "}";
56
+ const head = value.slice(0, at.start);
57
+ const tail = value.slice(caret).replace(/^\}/, "");
58
+ return { value: head + written + tail, caret: head.length + written.length };
59
+ }
60
+ function urlSchemeOf(value) {
61
+ const lower = value.toLowerCase();
62
+ if (lower.startsWith("https://")) return "https://";
63
+ if (lower.startsWith("http://")) return "http://";
64
+ return "";
65
+ }
66
+ var DEFAULT_LABELS = {
67
+ references: "Secrets",
68
+ choose: "Choose one"
69
+ };
70
+ function ValueField({
71
+ label,
72
+ mark,
73
+ kind = "text",
74
+ value,
75
+ onChange,
76
+ help,
77
+ error,
78
+ placeholder,
79
+ choices,
80
+ disabled,
81
+ required,
82
+ markRequired,
83
+ autoFocus,
84
+ references,
85
+ onReferencesNeeded,
86
+ isReference = isWholeReference,
87
+ rows = 3,
88
+ helperOnFocus,
89
+ labels,
90
+ className
91
+ }) {
92
+ const words = { ...DEFAULT_LABELS, ...labels };
93
+ const id = useId();
94
+ const affixId = `${id}-affix`;
95
+ const picker = kind === "choice" || kind === "handle";
96
+ const reference = isReference(value);
97
+ const masked = kind === "secret" && !reference;
98
+ const tight = kind === "url" || kind === "id" || kind === "email";
99
+ const own = kind === "url" ? urlSchemeOf(value) : "";
100
+ const referenceBase = own === "" && value.trimStart().startsWith("$");
101
+ const affix = kind === "url" && own !== "http://" && !referenceBase ? "https://" : "";
102
+ const shown = affix ? value.slice(own.length) : value;
103
+ const box = useRef(null);
104
+ const [typing, setTyping] = useState(null);
105
+ const offered = typing && references?.length ? rankReferences(references, typing.query) : [];
106
+ function reconsider(text, caretAt) {
107
+ if (affix) return;
108
+ const caret = masked || caretAt === null ? text.length : caretAt;
109
+ const next = referenceAt(text, caret);
110
+ if (next && !typing) onReferencesNeeded?.();
111
+ setTyping(next);
112
+ }
113
+ function reconsiderFrom(input) {
114
+ reconsider(input.value, masked ? null : input.selectionStart);
115
+ }
116
+ function choose(name) {
117
+ const input = box.current;
118
+ if (!input || !typing) return;
119
+ const caret = masked ? input.value.length : input.selectionStart ?? input.value.length;
120
+ const next = completeReference(input.value, caret, typing, name);
121
+ setTyping(null);
122
+ onChange(next.value);
123
+ queueMicrotask(() => {
124
+ input.setSelectionRange(next.caret, next.caret);
125
+ input.focus();
126
+ });
127
+ }
128
+ function changed(raw) {
129
+ const typed = tight ? raw.replace(/\s+/g, "") : raw;
130
+ let next = typed;
131
+ if (affix) {
132
+ const carried = urlSchemeOf(typed);
133
+ const escapes = carried === "http://" || own === "" && typed.trimStart().startsWith("$");
134
+ next = escapes ? typed : affix + typed.slice(carried.length);
135
+ }
136
+ onChange(next);
137
+ return next;
138
+ }
139
+ const options = picker ? choiceOptions(choices, value) : [];
140
+ const chosen = picker ? choices?.find((choice) => choice.value === value) : void 0;
141
+ const helper = chosen?.hint && help ? /* @__PURE__ */ jsxs(Fragment, { children: [
142
+ help,
143
+ " ",
144
+ chosen.hint
145
+ ] }) : chosen?.hint ?? help;
146
+ return /* @__PURE__ */ jsx(
147
+ FormField,
148
+ {
149
+ htmlFor: id,
150
+ className,
151
+ label: mark ? /* @__PURE__ */ jsxs("span", { className: "crewlet-value-field__label", children: [
152
+ mark,
153
+ label
154
+ ] }) : label,
155
+ optional: required === false,
156
+ requiredNews: required === true && markRequired === true,
157
+ helper,
158
+ helperOnFocus,
159
+ error,
160
+ describedBy: affix ? affixId : void 0,
161
+ children: (field) => picker ? /* @__PURE__ */ jsx(
162
+ Select,
163
+ {
164
+ id: field.id,
165
+ value,
166
+ onChange: (next) => onChange(String(next)),
167
+ options,
168
+ placeholder: words.choose,
169
+ disabled: disabled === true,
170
+ autoFocus,
171
+ error: field.invalid,
172
+ required: required === true,
173
+ "aria-describedby": field.describedBy
174
+ }
175
+ ) : kind === "multiline" ? /* @__PURE__ */ jsx(
176
+ Textarea,
177
+ {
178
+ id: field.id,
179
+ rows,
180
+ value,
181
+ placeholder,
182
+ disabled,
183
+ autoComplete: "off",
184
+ spellCheck: true,
185
+ autoFocus,
186
+ "aria-describedby": field.describedBy,
187
+ "aria-required": required === true || void 0,
188
+ error: field.invalid,
189
+ onChange: (event) => onChange(event.target.value)
190
+ }
191
+ ) : /* @__PURE__ */ jsx(
192
+ Combobox,
193
+ {
194
+ id: field.id,
195
+ ref: box,
196
+ appearance: reference ? "reference" : "default",
197
+ type: masked ? "password" : "text",
198
+ inputMode: kind === "email" ? "email" : kind === "url" ? "url" : void 0,
199
+ value: shown,
200
+ placeholder,
201
+ disabled,
202
+ autoFocus,
203
+ error: field.invalid,
204
+ "aria-describedby": field.describedBy,
205
+ "aria-required": required === true || void 0,
206
+ leading: affix ? /* @__PURE__ */ jsx(InputAffix, { text: affix, id: affixId }) : void 0,
207
+ label: words.references,
208
+ mono: true,
209
+ tabCommits: true,
210
+ options: offered.map((name) => ({ value: name })),
211
+ onCommit: (option) => choose(option.value),
212
+ open: offered.length > 0,
213
+ onOpenChange: (open) => {
214
+ if (!open) setTyping(null);
215
+ },
216
+ onValueChange: (raw) => {
217
+ const next = changed(raw);
218
+ reconsider(next, box.current?.selectionStart ?? null);
219
+ },
220
+ onKeyUp: (event) => reconsiderFrom(event.currentTarget),
221
+ onClick: (event) => reconsiderFrom(event.currentTarget),
222
+ onBlur: () => setTyping(null)
223
+ }
224
+ )
225
+ }
226
+ );
227
+ }
228
+ function choiceOptions(choices, value) {
229
+ const all = choices ?? [];
230
+ const rows = all.map((choice) => ({ value: choice.value, label: choice.label, description: choice.hint }));
231
+ if (value !== "" && !all.some((choice) => choice.value === value)) {
232
+ return [{ value, label: value }, ...rows];
233
+ }
234
+ return rows;
235
+ }
236
+
237
+ export { REFERENCE_NAME_PATTERN, ValueField, completeReference, isWholeReference, rankReferences, referenceAt, urlSchemeOf };
@@ -1,6 +1,6 @@
1
1
  import { Table } from './chunk-5DJMFRSZ.js';
2
+ import { DownloadButton } from './chunk-NSCYGUDG.js';
2
3
  import { StatusCard } from './chunk-WW4E5EUS.js';
3
- import { DownloadButton } from './chunk-LG6TUGET.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './ResultTableCard-AP355LQM.css';
6
6
  import { useState } from 'react';
@@ -1,6 +1,6 @@
1
1
  import { Select } from './chunk-XQZ6EWOE.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
- import { HueSwatch } from './chunk-NRMXUNLR.js';
3
+ import { HueSwatch } from './chunk-QCVAVAF6.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
5
  import { Checkbox } from './chunk-KIPAFCVS.js';
6
6
  import { Kbd } from './chunk-ACRRRPWT.js';
@@ -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-DM7X24B7.js').then(
12
+ loading ??= import('./Editor-GHHWWXXL.js').then(
13
13
  (module) => {
14
14
  engine = module.Editor;
15
15
  return engine;
@@ -160,6 +160,7 @@ var Combobox = forwardRef(function Combobox2({
160
160
  ] })
161
161
  ] });
162
162
  }
163
+ const announcesRole = rest.type !== "password" || lists;
163
164
  return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-combobox", containerClassName), ref: listbox.anchorRef, children: [
164
165
  /* @__PURE__ */ jsx(
165
166
  Input,
@@ -169,9 +170,9 @@ var Combobox = forwardRef(function Combobox2({
169
170
  id: fieldId,
170
171
  className,
171
172
  value,
172
- role: "combobox",
173
- "aria-autocomplete": "list",
174
- "aria-expanded": lists,
173
+ role: announcesRole ? "combobox" : void 0,
174
+ "aria-autocomplete": announcesRole ? "list" : void 0,
175
+ "aria-expanded": announcesRole ? lists : void 0,
175
176
  "aria-controls": lists ? listbox.listId : void 0,
176
177
  "aria-activedescendant": lists && offered.length > 0 ? listbox.optionId(listbox.active) : void 0,
177
178
  autoComplete: "off",
@@ -1,5 +1,5 @@
1
1
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
2
- import { SegmentedControl } from './chunk-3BQWARG2.js';
2
+ import { SegmentedControl } from './chunk-F7VBYCW2.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { Modal } from './chunk-KVWZDCTQ.js';
2
2
  import { Callout } from './chunk-BPCY7ZID.js';
3
- import { SegmentedControl } from './chunk-3BQWARG2.js';
3
+ import { SegmentedControl } from './chunk-F7VBYCW2.js';
4
4
  import { FormField, Input } from './chunk-TLIJG4TP.js';
5
5
  import { Button } from './chunk-7QTPJDRF.js';
6
6
  import { useState } from 'react';
@@ -1,6 +1,6 @@
1
1
  import { Toolbar } from './chunk-NR4CPM4T.js';
2
- import { SegmentedControl } from './chunk-3BQWARG2.js';
3
- import { tabId } from './chunk-VN3DCUED.js';
2
+ import { SegmentedControl } from './chunk-F7VBYCW2.js';
3
+ import { tabId } from './chunk-27JCHL64.js';
4
4
  import { IconButton } from './chunk-2XWFWNDT.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
6
  import './MarkdownEditor-WOKV7CLK.css';
@@ -1,4 +1,4 @@
1
- import { ContrastLevelTag } from './chunk-WDRYUMN6.js';
1
+ import { ContrastLevelTag } from './chunk-BSAQE7PO.js';
2
2
  import { Popover } from './chunk-KHJIEPZV.js';
3
3
  import { IconButton } from './chunk-2XWFWNDT.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
@@ -20,6 +20,7 @@ export * from '../ArtifactMakeRow/index.js';
20
20
  export * from '../ArtifactNameCell/index.js';
21
21
  export * from '../ArtifactPanel/index.js';
22
22
  export * from '../AsideLayout/index.js';
23
+ export * from '../AttachmentChip/index.js';
23
24
  export * from '../AuthLayout/index.js';
24
25
  export * from '../Avatar/index.js';
25
26
  export * from '../AvatarPicker/index.js';
@@ -67,6 +68,7 @@ export * from '../DataTable/index.js';
67
68
  export * from '../DataView/index.js';
68
69
  export * from '../DatasetSource/index.js';
69
70
  export * from '../DateTimePicker/index.js';
71
+ export * from '../DeepWorkCard/index.js';
70
72
  export * from '../DescriptionList/index.js';
71
73
  export * from '../DiffList/index.js';
72
74
  export * from '../DiffView/index.js';
@@ -85,6 +87,7 @@ export * from '../ErrorBoundary/index.js';
85
87
  export * from '../Eyebrow/index.js';
86
88
  export * from '../FactList/index.js';
87
89
  export * from '../FileDrop/index.js';
90
+ export * from '../FileList/index.js';
88
91
  export * from '../FilterChip/index.js';
89
92
  export * from '../FindingList/index.js';
90
93
  export * from '../FolderTile/index.js';
@@ -219,6 +222,7 @@ export * from '../Tree/index.js';
219
222
  export * from '../TreeCanvas/index.js';
220
223
  export * from '../TreeGrid/index.js';
221
224
  export * from '../TypeSpecimen/index.js';
225
+ export * from '../ValueField/index.js';
222
226
  export * from '../VersionCompare/index.js';
223
227
  export * from '../VersionTimeline/index.js';
224
228
  export * from '../VisuallyHidden/index.js';