@crewlethq/ui 0.12.0 → 0.14.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 (157) hide show
  1. package/README.md +82 -5
  2. package/dist/AppShell/index.js +2 -1
  3. package/dist/Avatar/index.js +1 -1
  4. package/dist/{Avatar-QHYOFID3.css → Avatar-BPJ36QZR.css} +1 -1
  5. package/dist/AvatarPicker/index.js +5 -5
  6. package/dist/Breadcrumb/Breadcrumb.d.ts +68 -0
  7. package/dist/Breadcrumb/index.d.ts +3 -0
  8. package/dist/Breadcrumb/index.js +3 -0
  9. package/dist/Breadcrumb-YMWVM3SV.css +193 -0
  10. package/dist/ChoiceButtons/ChoiceButtons.d.ts +43 -0
  11. package/dist/ChoiceButtons/index.d.ts +3 -0
  12. package/dist/ChoiceButtons/index.js +3 -0
  13. package/dist/ChoiceButtons-DJ5EOGUA.css +127 -0
  14. package/dist/Combobox/index.js +2 -2
  15. package/dist/CommandPalette/CommandPalette.d.ts +48 -1
  16. package/dist/CommandPalette/index.js +3 -3
  17. package/dist/{CommandPalette-C5AMKGN2.css → CommandPalette-HBTNKHZQ.css} +55 -2
  18. package/dist/DataTable/index.js +4 -4
  19. package/dist/DataView/index.js +11 -11
  20. package/dist/DateTimePicker/index.js +2 -2
  21. package/dist/{DateTimePicker-4AZBTODT.css → DateTimePicker-NJ6XH2TE.css} +4 -3
  22. package/dist/Document/Document.d.ts +56 -0
  23. package/dist/Document/index.d.ts +3 -0
  24. package/dist/Document/index.js +2 -0
  25. package/dist/Document-PQGXJHB7.css +288 -0
  26. package/dist/EntityChip/index.js +1 -1
  27. package/dist/Highlight/Highlight.d.ts +45 -0
  28. package/dist/Highlight/index.d.ts +3 -0
  29. package/dist/Highlight/index.js +2 -0
  30. package/dist/Highlight-DXLV2R6L.css +29 -0
  31. package/dist/HuePicker/index.js +3 -3
  32. package/dist/ImageUpload/index.js +2 -2
  33. package/dist/{ImageUpload-L2GE4JUM.css → ImageUpload-NVGMN7DP.css} +9 -6
  34. package/dist/InboxList/InboxList.d.ts +116 -0
  35. package/dist/InboxList/index.d.ts +3 -0
  36. package/dist/InboxList/index.js +5 -0
  37. package/dist/InboxList-YMFWKGGS.css +252 -0
  38. package/dist/KeyChip/KeyChip.d.ts +21 -0
  39. package/dist/KeyChip/index.d.ts +3 -0
  40. package/dist/KeyChip/index.js +2 -0
  41. package/dist/KeyChip-4XJU4BBE.css +30 -0
  42. package/dist/Link/Link.d.ts +17 -2
  43. package/dist/Link/index.js +1 -1
  44. package/dist/{Link-6BEFNMN2.css → Link-WPMVLKLY.css} +36 -1
  45. package/dist/Listbox/index.d.ts +2 -0
  46. package/dist/Listbox/index.js +1 -1
  47. package/dist/Listbox/useHighlightRest.d.ts +35 -0
  48. package/dist/MarkdownEditor/MarkdownEditor.d.ts +93 -0
  49. package/dist/MarkdownEditor/format.d.ts +34 -0
  50. package/dist/MarkdownEditor/index.d.ts +5 -0
  51. package/dist/MarkdownEditor/index.js +12 -0
  52. package/dist/MarkdownEditor-ZLSHTOIZ.css +146 -0
  53. package/dist/Modal/Modal.d.ts +5 -1
  54. package/dist/Modal/index.js +1 -1
  55. package/dist/{Modal-BNT3TDV2.css → Modal-RQAYGG4L.css} +34 -1
  56. package/dist/OrgLabel/index.js +1 -1
  57. package/dist/OrgNode/index.js +1 -1
  58. package/dist/OrgTable/index.js +4 -4
  59. package/dist/Outline/Outline.d.ts +72 -0
  60. package/dist/Outline/index.d.ts +3 -0
  61. package/dist/Outline/index.js +2 -0
  62. package/dist/Outline-VCXKKU3E.css +78 -0
  63. package/dist/Popover/Popover.d.ts +21 -1
  64. package/dist/Popover/index.js +1 -1
  65. package/dist/ReadingPane/ReadingPane.d.ts +95 -0
  66. package/dist/ReadingPane/index.d.ts +3 -0
  67. package/dist/ReadingPane/index.js +4 -0
  68. package/dist/ReadingPane-5UOLPWY5.css +194 -0
  69. package/dist/SegmentedControl/SegmentedControl.d.ts +9 -1
  70. package/dist/SegmentedControl/index.js +3 -3
  71. package/dist/{SegmentedControl-76HODRBT.css → SegmentedControl-PKBLJVSA.css} +18 -0
  72. package/dist/Select/Select.d.ts +22 -0
  73. package/dist/Select/index.js +2 -2
  74. package/dist/{Select-4ANVLHUY.css → Select-2P7AWUE4.css} +56 -6
  75. package/dist/SidebarNav/index.js +2 -1
  76. package/dist/{SidebarNav-X5NLZNWA.css → SidebarNav-KF66MLOM.css} +4 -19
  77. package/dist/Switcher/Switcher.d.ts +151 -0
  78. package/dist/Switcher/index.d.ts +3 -0
  79. package/dist/Switcher/index.js +16 -0
  80. package/dist/Switcher-B44Q4WF4.css +346 -0
  81. package/dist/Tabs/Tabs.d.ts +7 -1
  82. package/dist/Tabs/index.js +1 -1
  83. package/dist/{Tabs-5I5Q5KKM.css → Tabs-ITJYJFMU.css} +49 -0
  84. package/dist/TagsInput/index.js +2 -2
  85. package/dist/ThemeGallery/ThemeGallery.d.ts +65 -0
  86. package/dist/ThemeGallery/index.d.ts +3 -0
  87. package/dist/ThemeGallery/index.js +6 -0
  88. package/dist/ThemeGallery-NITASULQ.css +93 -0
  89. package/dist/ThemeSwatch/ThemeSwatch.d.ts +71 -0
  90. package/dist/ThemeSwatch/index.d.ts +3 -0
  91. package/dist/ThemeSwatch/index.js +2 -0
  92. package/dist/ThemeSwatch-4DL457ZB.css +256 -0
  93. package/dist/ThemeSwitcher/ThemeSwitcher.d.ts +5 -1
  94. package/dist/ThemeSwitcher/index.js +4 -4
  95. package/dist/ThemeToggle/ThemeToggle.d.ts +1 -1
  96. package/dist/ThemeToggle/index.js +1 -1
  97. package/dist/TimeWindowPicker/index.js +4 -4
  98. package/dist/{TimeWindowPicker-GBF4JDFI.css → TimeWindowPicker-BZ5HHATU.css} +5 -4
  99. package/dist/Toaster/index.js +1 -1
  100. package/dist/{Toaster-NVDCEIP5.css → Toaster-VZKISP2S.css} +81 -87
  101. package/dist/Tree/index.d.ts +1 -1
  102. package/dist/Tree/index.js +1 -1
  103. package/dist/Tree/useTreeState.d.ts +37 -7
  104. package/dist/TreeCanvas/index.js +2 -2
  105. package/dist/TreeGrid/TreeGrid.d.ts +22 -2
  106. package/dist/TreeGrid/index.js +2 -2
  107. package/dist/{TreeGrid-NSW7VMOX.css → TreeGrid-FBX3MSJA.css} +19 -0
  108. package/dist/{chunk-EBBAAQDY.js → chunk-26PEPONN.js} +3 -1
  109. package/dist/{chunk-GOUKOXJK.js → chunk-3VVKJ7AZ.js} +3 -3
  110. package/dist/{chunk-HV6IZFBK.js → chunk-4FFHJBEN.js} +2 -2
  111. package/dist/{chunk-JHQUT4WJ.js → chunk-4LDTQWS7.js} +1 -1
  112. package/dist/{chunk-GXYNEDNA.js → chunk-4Y7WKXAW.js} +1 -1
  113. package/dist/{chunk-IINFVK3W.js → chunk-5IXMLWGW.js} +6 -6
  114. package/dist/{chunk-MCPKHYMC.js → chunk-6LXMLQUM.js} +17 -4
  115. package/dist/{chunk-3UK4VFSK.js → chunk-6NIZCQUM.js} +1 -1
  116. package/dist/{chunk-ORNOOMVY.js → chunk-6TSZCBID.js} +2 -2
  117. package/dist/{chunk-ZMJHK7DR.js → chunk-75WOCYGC.js} +2 -2
  118. package/dist/chunk-77IEHFY4.js +299 -0
  119. package/dist/chunk-A5YKNRG6.js +94 -0
  120. package/dist/{chunk-JCNUQ3US.js → chunk-AXNQCAFC.js} +2 -2
  121. package/dist/{chunk-UG5ZMAXW.js → chunk-CBZSSKH3.js} +5 -5
  122. package/dist/{chunk-LAQK4V3Z.js → chunk-DJMLHCLD.js} +1 -1
  123. package/dist/{chunk-6MU7HNB4.js → chunk-F73MC7EZ.js} +47 -2
  124. package/dist/{chunk-ZPSOF6VL.js → chunk-FBSEJO2C.js} +1 -1
  125. package/dist/chunk-FYTIJM2T.js +40 -0
  126. package/dist/chunk-H6VKCIWV.js +41 -0
  127. package/dist/{chunk-HLBRPES3.js → chunk-IFM63LAG.js} +3 -3
  128. package/dist/chunk-IG75YMUN.js +22 -0
  129. package/dist/{chunk-SEFMO2EV.js → chunk-IXUU5DLZ.js} +55 -6
  130. package/dist/{chunk-ZHOM65MI.js → chunk-JCO3SIST.js} +1 -1
  131. package/dist/chunk-KLIEPFEZ.js +95 -0
  132. package/dist/{chunk-7LD6P32I.js → chunk-L3CTFFLZ.js} +2 -18
  133. package/dist/chunk-MNFU2RNT.js +74 -0
  134. package/dist/{chunk-S3BCVWTU.js → chunk-MY374UUD.js} +49 -31
  135. package/dist/{chunk-K5Q2DK3P.js → chunk-NXDEPUVG.js} +1 -1
  136. package/dist/{chunk-PDUZO35I.js → chunk-O2ZDZZS7.js} +15 -6
  137. package/dist/{chunk-5WEVLIB6.js → chunk-RZ7RGECB.js} +1 -1
  138. package/dist/{chunk-WEIINZPA.js → chunk-SBRE7IML.js} +6 -2
  139. package/dist/{chunk-TEEJSTFG.js → chunk-TFMJH2E6.js} +1 -1
  140. package/dist/{chunk-IVFJD7WY.js → chunk-UCCC7YVZ.js} +3 -2
  141. package/dist/chunk-VWNC2L6W.js +110 -0
  142. package/dist/chunk-VYY56AMX.js +2 -0
  143. package/dist/chunk-WI6K5M5X.js +24 -0
  144. package/dist/{chunk-XV65NTIT.js → chunk-WYQOHFML.js} +94 -41
  145. package/dist/chunk-XYCADWZN.js +100 -0
  146. package/dist/chunk-Y6NR7QJ3.js +336 -0
  147. package/dist/chunk-YSJC7AZC.js +62 -0
  148. package/dist/chunk-ZAJHGDAW.js +93 -0
  149. package/dist/generated/index.d.ts +12 -0
  150. package/dist/generated/index.js +64 -51
  151. package/dist/index.js +64 -51
  152. package/dist/styles.css +2711 -402
  153. package/dist/utils/highlight.d.ts +17 -0
  154. package/dist/utils/useMediaMatch.d.ts +12 -0
  155. package/package.json +3 -3
  156. package/dist/chunk-UAQIUSSK.js +0 -2
  157. /package/dist/{chunk-74OVQWA5.js → chunk-6AR2T5Y4.js} +0 -0
@@ -0,0 +1,336 @@
1
+ import { Skeleton } from './chunk-W5J7R5EB.js';
2
+ import { Modal } from './chunk-TFMJH2E6.js';
3
+ import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
4
+ import { Input } from './chunk-FTEJPHBI.js';
5
+ import { KeyChip, highlightMatch } from './chunk-FYTIJM2T.js';
6
+ import { announce } from './chunk-RSAQOKH3.js';
7
+ import { useMediaMatch } from './chunk-IG75YMUN.js';
8
+ import { Popover } from './chunk-O2ZDZZS7.js';
9
+ import { focusables, isComposing } from './chunk-R25RGPUB.js';
10
+ import { VisuallyHidden } from './chunk-BZFWDIV6.js';
11
+ import { cx } from './chunk-ODEQTPFM.js';
12
+ import './Switcher-B44Q4WF4.css';
13
+ import { forwardRef, useId, useRef, useCallback, useMemo, useEffect } from 'react';
14
+ import { ChevronDownGlyph, SearchGlyph } from '@crewlethq/icons/glyphs';
15
+ import { breakpoint } from '@crewlethq/tokens';
16
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
17
+
18
+ var PHONE = `(width < ${breakpoint.phone})`;
19
+ var TOUCH = "(pointer: coarse)";
20
+ var DROP = 6;
21
+ var SKELETON_NAMES = [72, 128, 96, 150, 110, 84];
22
+ function Switcher({ label, open, onOpenChange, trigger, className, ...panel }) {
23
+ const phone = useMediaMatch(PHONE);
24
+ const touch = useMediaMatch(TOUCH);
25
+ const triggerId = useId();
26
+ const body = useRef(null);
27
+ const shift = useRef(0);
28
+ const place = phone ? "sheet" : trigger ? "anchored" : "centered";
29
+ const close = useCallback(() => onOpenChange(false), [onOpenChange]);
30
+ const initialFocus = useCallback(() => touch ? body.current : null, [touch]);
31
+ const alignUnder = useCallback((surface, anchor) => {
32
+ const mark = anchor.querySelector(".crewlet-key-chip, .crewlet-switcher-trigger__label");
33
+ const lead = surface.querySelector(".crewlet-switcher__lead");
34
+ if (mark && lead) {
35
+ const from = mark.getBoundingClientRect().left - anchor.getBoundingClientRect().left;
36
+ const to = lead.getBoundingClientRect().left - surface.getBoundingClientRect().left;
37
+ shift.current = from - to;
38
+ }
39
+ return shift.current;
40
+ }, []);
41
+ function done() {
42
+ close();
43
+ if (place === "anchored") document.getElementById(triggerId)?.focus();
44
+ }
45
+ function leave(back) {
46
+ const button = document.getElementById(triggerId);
47
+ close();
48
+ if (!button) return;
49
+ const surface = body.current;
50
+ const next = back ? void 0 : focusables(document.body).find(
51
+ (el) => (button.compareDocumentPosition(el) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0 && !button.contains(el) && !surface?.contains(el)
52
+ );
53
+ (next ?? button).focus();
54
+ }
55
+ const content = /* @__PURE__ */ jsx(
56
+ SwitcherPanel,
57
+ {
58
+ ...panel,
59
+ panelRef: body,
60
+ onDone: done,
61
+ onLeave: place === "anchored" ? leave : void 0
62
+ }
63
+ );
64
+ if (place === "anchored" && trigger) {
65
+ return /* @__PURE__ */ jsx(
66
+ Popover,
67
+ {
68
+ label,
69
+ open,
70
+ onOpenChange: (next) => onOpenChange(next),
71
+ alignOffset: alignUnder,
72
+ sideOffset: DROP,
73
+ initialFocus,
74
+ className: cx("crewlet-switcher", "crewlet-switcher--anchored", className),
75
+ trigger: (isOpen, toggle) => /* @__PURE__ */ jsx(SwitcherButton, { ...trigger, id: triggerId, expanded: isOpen, onToggle: toggle, onOpen: () => onOpenChange(true) }),
76
+ children: content
77
+ }
78
+ );
79
+ }
80
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
81
+ trigger ? /* @__PURE__ */ jsx(
82
+ SwitcherButton,
83
+ {
84
+ ...trigger,
85
+ id: triggerId,
86
+ expanded: open,
87
+ onToggle: () => onOpenChange(!open),
88
+ onOpen: () => onOpenChange(true)
89
+ }
90
+ ) : null,
91
+ /* @__PURE__ */ jsx(
92
+ Modal,
93
+ {
94
+ open,
95
+ onClose: close,
96
+ placement: place === "sheet" ? "bottom" : "top",
97
+ title: place === "sheet" ? label : void 0,
98
+ ariaLabel: label,
99
+ showCloseButton: place === "sheet",
100
+ flush: true,
101
+ initialFocus,
102
+ className: cx("crewlet-switcher", `crewlet-switcher--${place}`, className),
103
+ children: content
104
+ }
105
+ )
106
+ ] });
107
+ }
108
+ var SwitcherButton = forwardRef(function SwitcherButton2({ label, keyChip, tag, mono, title, id, expanded, onToggle, onOpen, ...rest }, ref) {
109
+ return /* @__PURE__ */ jsxs(
110
+ "button",
111
+ {
112
+ type: "button",
113
+ "aria-haspopup": "dialog",
114
+ "aria-expanded": expanded,
115
+ ...rest,
116
+ ref,
117
+ id,
118
+ title,
119
+ className: cx("crewlet-switcher-trigger", mono && "is-mono"),
120
+ onClick: onToggle,
121
+ onKeyDown: (event) => {
122
+ if (event.key !== "ArrowDown" || expanded || event.altKey || event.ctrlKey || event.metaKey) return;
123
+ event.preventDefault();
124
+ onOpen();
125
+ },
126
+ children: [
127
+ keyChip ? /* @__PURE__ */ jsxs(Fragment, { children: [
128
+ /* @__PURE__ */ jsx(KeyChip, { children: keyChip }),
129
+ " "
130
+ ] }) : null,
131
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher-trigger__label", children: label }),
132
+ tag !== void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
133
+ " ",
134
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher-trigger__tag", children: tag })
135
+ ] }) : null,
136
+ /* @__PURE__ */ jsx(ChevronDownGlyph, { size: "sm", className: "crewlet-switcher-trigger__chevron", "aria-hidden": "true" })
137
+ ]
138
+ }
139
+ );
140
+ });
141
+ function SwitcherPanel({
142
+ query,
143
+ onQueryChange,
144
+ placeholder = "Search",
145
+ listLabel,
146
+ pinned,
147
+ note,
148
+ message,
149
+ groups = [],
150
+ footer = [],
151
+ loading = false,
152
+ loadingLabel = "Loading",
153
+ announcement,
154
+ panelRef,
155
+ onDone,
156
+ onLeave
157
+ }) {
158
+ const id = useId();
159
+ const footerId = `${id}-footer`;
160
+ const noteId = `${id}-note`;
161
+ const titleId = `${id}-message`;
162
+ const bodyId = `${id}-message-body`;
163
+ const flat = useMemo(
164
+ () => [...pinned ? [pinned] : [], ...message?.actions ?? [], ...groups.flatMap((group) => group.options), ...footer],
165
+ [pinned, message, groups, footer]
166
+ );
167
+ const held = useCallback((index2) => Boolean(flat[index2]?.held), [flat]);
168
+ const listbox = useListbox({
169
+ id,
170
+ open: true,
171
+ count: flat.length,
172
+ // The surface around the list owns Escape and a press outside it.
173
+ popup: false,
174
+ // ENTER TAKES A ROW THE WAY A PRESS DOES: through the row's own click, so
175
+ // a link with nothing else to do is followed as a link.
176
+ onCommit: (index2) => document.getElementById(listbox.optionId(index2))?.click(),
177
+ onClose: onDone
178
+ });
179
+ const keys = useOptionKeys({ listbox, count: flat.length, disabled: held, ends: false });
180
+ const { active, setActive } = listbox;
181
+ const { step } = keys;
182
+ useEffect(() => {
183
+ if (active >= 0 && held(active)) setActive(step(active, 1));
184
+ }, [active, held, setActive, step]);
185
+ useEffect(() => setActive(loading ? -1 : 0), [loading, setActive]);
186
+ useEffect(() => {
187
+ if (announcement) announce(announcement);
188
+ }, [announcement]);
189
+ function onKeyDown(event) {
190
+ if (isComposing(event)) return;
191
+ if (keys.onKeyDown(event)) return;
192
+ if (event.key === "Enter" && (event.metaKey || event.ctrlKey) && !event.altKey && !event.shiftKey) {
193
+ const option = flat[active];
194
+ if (option?.href && !option.held) {
195
+ event.preventDefault();
196
+ window.open(option.href, "_blank", "noopener");
197
+ }
198
+ return;
199
+ }
200
+ if (listbox.onKeyDown(event)) return;
201
+ if (event.key === "Tab" && onLeave && !event.altKey && !event.ctrlKey && !event.metaKey) {
202
+ event.preventDefault();
203
+ onLeave(event.shiftKey);
204
+ }
205
+ }
206
+ function onRowClick(event, option) {
207
+ if (option.held) {
208
+ event.preventDefault();
209
+ return;
210
+ }
211
+ if (option.href && (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)) return;
212
+ if (option.onSelect) event.preventDefault();
213
+ if (!option.keepsOpen) onDone();
214
+ option.onSelect?.();
215
+ }
216
+ let index = -1;
217
+ function row(option, highlight) {
218
+ index += 1;
219
+ const mine = index;
220
+ const name = option.accessibleLabel && option.held ? `${option.accessibleLabel}, ${option.held}` : option.accessibleLabel;
221
+ const props = {
222
+ id: listbox.optionId(mine),
223
+ role: "option",
224
+ className: cx("crewlet-listbox__option", "crewlet-switcher__option", option.current && "is-current"),
225
+ "aria-selected": mine === active,
226
+ "aria-current": option.current ? "page" : void 0,
227
+ "aria-disabled": option.held ? true : void 0,
228
+ "aria-label": name,
229
+ // The press is prevented so focus stays in the field; a middle press is
230
+ // left alone, because it is what opens a link in a new tab.
231
+ onMouseDown: (event) => {
232
+ if (event.button === 0) event.preventDefault();
233
+ },
234
+ onMouseEnter: () => {
235
+ if (!option.held) setActive(mine);
236
+ },
237
+ onClick: (event) => onRowClick(event, option)
238
+ };
239
+ const words = /* @__PURE__ */ jsxs(Fragment, { children: [
240
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher__lead", "aria-hidden": option.keyChip ? void 0 : true, children: option.keyChip ? /* @__PURE__ */ jsx(KeyChip, { highlight: highlight ? query : void 0, children: option.keyChip }) : option.icon }),
241
+ " ",
242
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher__label", children: highlight ? highlightMatch(option.label, query, "word", "crewlet-switcher__match") : option.label }),
243
+ option.meta !== void 0 || option.held ? /* @__PURE__ */ jsxs(Fragment, { children: [
244
+ " ",
245
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-switcher__meta", children: [
246
+ option.meta,
247
+ option.held
248
+ ] })
249
+ ] }) : null
250
+ ] });
251
+ return option.href && !option.held ? /* @__PURE__ */ jsx("a", { ...props, href: option.href, tabIndex: -1, children: words }, option.id) : /* @__PURE__ */ jsx("div", { ...props, children: words }, option.id);
252
+ }
253
+ const follows = Boolean(note || message || groups.length > 0 || loading);
254
+ const describedBy = [note ? noteId : "", message ? titleId : "", message?.body ? bodyId : ""].filter(Boolean).join(" ");
255
+ return /* @__PURE__ */ jsxs("div", { ref: panelRef, className: "crewlet-switcher__panel", tabIndex: -1, children: [
256
+ /* @__PURE__ */ jsx(
257
+ Input,
258
+ {
259
+ appearance: "command",
260
+ containerClassName: "crewlet-switcher__search",
261
+ leading: /* @__PURE__ */ jsx(SearchGlyph, { size: "sm" }),
262
+ value: query,
263
+ onChange: (event) => {
264
+ onQueryChange(event.target.value);
265
+ setActive(0);
266
+ },
267
+ onClear: () => {
268
+ onQueryChange("");
269
+ setActive(0);
270
+ },
271
+ clearLabel: "Clear the search",
272
+ onKeyDown,
273
+ placeholder,
274
+ role: "combobox",
275
+ "aria-label": placeholder,
276
+ "aria-expanded": true,
277
+ "aria-controls": listbox.listId,
278
+ "aria-autocomplete": "list",
279
+ "aria-activedescendant": active >= 0 ? listbox.optionId(active) : void 0,
280
+ "aria-describedby": describedBy || void 0,
281
+ autoComplete: "off",
282
+ spellCheck: false
283
+ }
284
+ ),
285
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-switcher__scroller", ref: listbox.listRef, children: [
286
+ /* @__PURE__ */ jsxs(
287
+ "div",
288
+ {
289
+ id: listbox.listId,
290
+ role: "listbox",
291
+ "aria-label": listLabel,
292
+ "aria-owns": footer.length > 0 ? footerId : void 0,
293
+ "aria-busy": loading || void 0,
294
+ className: "crewlet-switcher__list",
295
+ children: [
296
+ pinned ? row(pinned, false) : null,
297
+ pinned && follows ? /* @__PURE__ */ jsx("div", { className: "crewlet-listbox__separator", "aria-hidden": "true" }) : null,
298
+ note ? /* @__PURE__ */ jsx("div", { role: "presentation", id: noteId, className: "crewlet-switcher__note", children: note }) : null,
299
+ message ? (
300
+ // A MESSAGE NAMES WHAT CAN BE DONE ABOUT IT: its actions are a group
301
+ // labelled by it, so a row reached by the arrows is heard with it.
302
+ /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": titleId, "aria-describedby": message.body ? bodyId : void 0, children: [
303
+ /* @__PURE__ */ jsxs("div", { role: "presentation", className: "crewlet-switcher__message", children: [
304
+ /* @__PURE__ */ jsx("span", { id: titleId, className: "crewlet-switcher__message-title", children: message.title }),
305
+ message.body ? /* @__PURE__ */ jsx("span", { id: bodyId, className: "crewlet-switcher__message-body", children: message.body }) : null
306
+ ] }),
307
+ (message.actions ?? []).map((option) => row(option, false))
308
+ ] })
309
+ ) : null,
310
+ groups.map((group) => (
311
+ // Named by its heading's own words, not the figure beside them.
312
+ /* @__PURE__ */ jsxs("div", { role: "group", "aria-labelledby": `${id}-group-${group.id}`, children: [
313
+ /* @__PURE__ */ jsxs("div", { role: "presentation", className: "crewlet-listbox__heading crewlet-switcher__heading", children: [
314
+ /* @__PURE__ */ jsx("span", { id: `${id}-group-${group.id}`, children: group.label }),
315
+ group.count !== void 0 ? /* @__PURE__ */ jsx("span", { className: "crewlet-switcher__count", children: group.count }) : null
316
+ ] }),
317
+ group.options.map((option) => row(option, true))
318
+ ] }, group.id)
319
+ ))
320
+ ]
321
+ }
322
+ ),
323
+ loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
324
+ /* @__PURE__ */ jsx("div", { className: "crewlet-switcher__skeleton", "aria-hidden": "true", children: SKELETON_NAMES.map((width) => /* @__PURE__ */ jsxs("div", { className: "crewlet-switcher__skeleton-row", children: [
325
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher__lead", children: /* @__PURE__ */ jsx(Skeleton, { variant: "box", width: 34, height: 10, borderRadius: 4 }) }),
326
+ /* @__PURE__ */ jsx(Skeleton, { variant: "box", width, height: 10, borderRadius: 4 }),
327
+ /* @__PURE__ */ jsx("span", { className: "crewlet-switcher__meta", children: /* @__PURE__ */ jsx(Skeleton, { variant: "box", width: 14, height: 10, borderRadius: 4 }) })
328
+ ] }, width)) }),
329
+ /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: loadingLabel }) })
330
+ ] }) : null
331
+ ] }),
332
+ footer.length > 0 ? /* @__PURE__ */ jsx("div", { id: footerId, role: "group", className: "crewlet-switcher__footer", children: footer.map((option) => row(option, false)) }) : null
333
+ ] });
334
+ }
335
+
336
+ export { Switcher };
@@ -0,0 +1,62 @@
1
+ import { VisuallyHidden } from './chunk-BZFWDIV6.js';
2
+ import { cx } from './chunk-ODEQTPFM.js';
3
+ import './ChoiceButtons-DJ5EOGUA.css';
4
+ import { useId } from 'react';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
+
7
+ function ChoiceButtons({
8
+ label,
9
+ options,
10
+ recommended,
11
+ recommendedLabel = "Recommended",
12
+ onChoose,
13
+ pending,
14
+ disabledReason,
15
+ className,
16
+ ...rest
17
+ }) {
18
+ const reasonId = useId();
19
+ const first = options.find((o) => o.value === recommended);
20
+ const ordered = first ? [first, ...options.filter((o) => o !== first)] : options;
21
+ const busy = pending !== void 0 && pending !== null;
22
+ const inert = busy || disabledReason !== void 0;
23
+ return /* @__PURE__ */ jsxs("div", { ...rest, role: "group", "aria-label": label, className: cx("crewlet-choice-buttons", className), children: [
24
+ ordered.map((option) => {
25
+ const isRecommended = option === first;
26
+ return /* @__PURE__ */ jsxs(
27
+ "button",
28
+ {
29
+ type: "button",
30
+ className: cx("crewlet-choice-buttons__option", isRecommended && "crewlet-choice-buttons__option--recommended"),
31
+ "aria-disabled": inert || void 0,
32
+ "aria-busy": pending === option.value || void 0,
33
+ "aria-describedby": disabledReason === void 0 ? void 0 : reasonId,
34
+ onClick: (event) => {
35
+ if (inert) {
36
+ event.preventDefault();
37
+ return;
38
+ }
39
+ onChoose(option.value);
40
+ },
41
+ children: [
42
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-choice-buttons__text", children: [
43
+ /* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__label", children: option.label }),
44
+ option.detail === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ " ",
46
+ /* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__detail", children: option.detail })
47
+ ] })
48
+ ] }),
49
+ isRecommended ? /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ " ",
51
+ /* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__note", children: recommendedLabel })
52
+ ] }) : null
53
+ ]
54
+ },
55
+ option.value
56
+ );
57
+ }),
58
+ disabledReason === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, { id: reasonId, children: disabledReason })
59
+ ] });
60
+ }
61
+
62
+ export { ChoiceButtons };
@@ -0,0 +1,93 @@
1
+ import { Eyebrow } from './chunk-RK4XPHVG.js';
2
+ import { useHeadingLevel, HeadingLevelProvider, nextHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
3
+ import { cx } from './chunk-ODEQTPFM.js';
4
+ import './ReadingPane-5UOLPWY5.css';
5
+ import { createContext, useId, useContext } from 'react';
6
+ import { CheckGlyph } from '@crewlethq/icons/glyphs';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+
9
+ var ReadingPaneContext = createContext(null);
10
+ function usePane(part) {
11
+ const pane = useContext(ReadingPaneContext);
12
+ if (pane === null) throw new Error(`${part} must be drawn inside a ReadingPane.`);
13
+ return pane;
14
+ }
15
+ function ReadingPane({ headingLevel, className, children, ...rest }) {
16
+ const titleId = useId();
17
+ const outer = useHeadingLevel();
18
+ const level = headingLevel ?? outer;
19
+ const named = rest["aria-label"] !== void 0 || rest["aria-labelledby"] !== void 0;
20
+ return /* @__PURE__ */ jsx("div", { className: "crewlet-reading-pane", children: /* @__PURE__ */ jsx(
21
+ "article",
22
+ {
23
+ ...rest,
24
+ "aria-labelledby": named ? rest["aria-labelledby"] : titleId,
25
+ className: cx("crewlet-reading-pane__column", className),
26
+ children: /* @__PURE__ */ jsx(ReadingPaneContext.Provider, { value: { titleId, level }, children: /* @__PURE__ */ jsx(HeadingLevelProvider, { level: nextHeadingLevel(level), children }) })
27
+ }
28
+ ) });
29
+ }
30
+ function ReadingPaneByline({ start, leading, note, className, children, ...rest }) {
31
+ return /* @__PURE__ */ jsxs("p", { ...rest, className: cx("crewlet-reading-pane__byline", className), children: [
32
+ start === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-reading-pane__start", children: start }),
33
+ leading === void 0 ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-reading-pane__leading", children: leading }),
34
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-reading-pane__by", children: [
35
+ children,
36
+ note === void 0 || note === null || note === false ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
37
+ " ",
38
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-reading-pane__note", children: [
39
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7 " }),
40
+ note
41
+ ] })
42
+ ] })
43
+ ] })
44
+ ] });
45
+ }
46
+ function ReadingPaneTitle({ className, children, ...rest }) {
47
+ const { titleId, level } = usePane("ReadingPane.Title");
48
+ const Heading = headingTag(level);
49
+ return /* @__PURE__ */ jsx(Heading, { id: titleId, ...rest, className: cx("crewlet-reading-pane__title", className), children });
50
+ }
51
+ function ReadingPaneLead({ className, children, ...rest }) {
52
+ return /* @__PURE__ */ jsx("div", { ...rest, className: cx("crewlet-reading-pane__lead", className), children });
53
+ }
54
+ function ReadingPaneQuote({ verbatim = false, className, children, ...rest }) {
55
+ return /* @__PURE__ */ jsx(
56
+ "blockquote",
57
+ {
58
+ ...rest,
59
+ className: cx("crewlet-reading-pane__quote", verbatim && "crewlet-reading-pane__quote--verbatim", className),
60
+ children
61
+ }
62
+ );
63
+ }
64
+ function ReadingPaneReasoning({ title, footer, className, children, ...rest }) {
65
+ return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("crewlet-reading-pane__reasoning", className), children: [
66
+ /* @__PURE__ */ jsx("p", { className: "crewlet-reading-pane__reasoning-title", children: title }),
67
+ /* @__PURE__ */ jsx("div", { className: "crewlet-reading-pane__reasoning-body", children }),
68
+ footer === void 0 || footer === null || footer === false ? null : /* @__PURE__ */ jsx("div", { className: "crewlet-reading-pane__reasoning-footer", children: footer })
69
+ ] });
70
+ }
71
+ function ReadingPaneOutcome({ className, children, ...rest }) {
72
+ return /* @__PURE__ */ jsxs("p", { role: "status", ...rest, className: cx("crewlet-reading-pane__outcome", className), children: [
73
+ /* @__PURE__ */ jsx(CheckGlyph, { size: "sm", className: "crewlet-reading-pane__outcome-mark" }),
74
+ /* @__PURE__ */ jsx("span", { children })
75
+ ] });
76
+ }
77
+ function ReadingPaneSection({ label, className, children, ...rest }) {
78
+ const labelId = useId();
79
+ const Heading = headingTag(useHeadingLevel());
80
+ return /* @__PURE__ */ jsxs("section", { ...rest, "aria-labelledby": labelId, className: cx("crewlet-reading-pane__section", className), children: [
81
+ /* @__PURE__ */ jsx(Heading, { id: labelId, className: "crewlet-reading-pane__section-label", children: /* @__PURE__ */ jsx(Eyebrow, { children: label }) }),
82
+ children
83
+ ] });
84
+ }
85
+ ReadingPane.Byline = ReadingPaneByline;
86
+ ReadingPane.Title = ReadingPaneTitle;
87
+ ReadingPane.Lead = ReadingPaneLead;
88
+ ReadingPane.Quote = ReadingPaneQuote;
89
+ ReadingPane.Reasoning = ReadingPaneReasoning;
90
+ ReadingPane.Outcome = ReadingPaneOutcome;
91
+ ReadingPane.Section = ReadingPaneSection;
92
+
93
+ export { ReadingPane, ReadingPaneByline, ReadingPaneLead, ReadingPaneOutcome, ReadingPaneQuote, ReadingPaneReasoning, ReadingPaneSection, ReadingPaneTitle };
@@ -5,6 +5,7 @@ export * from '../AppShell/index.js';
5
5
  export * from '../Avatar/index.js';
6
6
  export * from '../AvatarPicker/index.js';
7
7
  export * from '../BrandLockup/index.js';
8
+ export * from '../Breadcrumb/index.js';
8
9
  export * from '../Button/index.js';
9
10
  export * from '../CalendarGrid/index.js';
10
11
  export * from '../Callout/index.js';
@@ -13,6 +14,7 @@ export * from '../Card/index.js';
13
14
  export * from '../CharacterPicker/index.js';
14
15
  export * from '../Charts/index.js';
15
16
  export * from '../Checkbox/index.js';
17
+ export * from '../ChoiceButtons/index.js';
16
18
  export * from '../ChoiceList/index.js';
17
19
  export * from '../CodeBlock/index.js';
18
20
  export * from '../Combobox/index.js';
@@ -27,6 +29,7 @@ export * from '../DateTimePicker/index.js';
27
29
  export * from '../DescriptionList/index.js';
28
30
  export * from '../DiffList/index.js';
29
31
  export * from '../Disclosure/index.js';
32
+ export * from '../Document/index.js';
30
33
  export * from '../EmptyState/index.js';
31
34
  export * from '../EmptyValue/index.js';
32
35
  export * from '../EntityChip/index.js';
@@ -35,18 +38,22 @@ export * from '../Eyebrow/index.js';
35
38
  export * from '../FactList/index.js';
36
39
  export * from '../FilterChip/index.js';
37
40
  export * from '../Fullscreen/index.js';
41
+ export * from '../Highlight/index.js';
38
42
  export * from '../HuePicker/index.js';
39
43
  export * from '../IconButton/index.js';
40
44
  export * from '../ImageUpload/index.js';
45
+ export * from '../InboxList/index.js';
41
46
  export * from '../InlineCode/index.js';
42
47
  export * from '../Input/index.js';
43
48
  export * from '../Kbd/index.js';
49
+ export * from '../KeyChip/index.js';
44
50
  export * from '../Layer/index.js';
45
51
  export * from '../Layout/index.js';
46
52
  export * from '../Link/index.js';
47
53
  export * from '../List/index.js';
48
54
  export * from '../ListInput/index.js';
49
55
  export * from '../Listbox/index.js';
56
+ export * from '../MarkdownEditor/index.js';
50
57
  export * from '../Menu/index.js';
51
58
  export * from '../Meter/index.js';
52
59
  export * from '../Modal/index.js';
@@ -54,10 +61,12 @@ export * from '../NewItemsNotice/index.js';
54
61
  export * from '../OrgLabel/index.js';
55
62
  export * from '../OrgNode/index.js';
56
63
  export * from '../OrgTable/index.js';
64
+ export * from '../Outline/index.js';
57
65
  export * from '../PageHeader/index.js';
58
66
  export * from '../Popover/index.js';
59
67
  export * from '../PricingCard/index.js';
60
68
  export * from '../Prose/index.js';
69
+ export * from '../ReadingPane/index.js';
61
70
  export * from '../RelativeTime/index.js';
62
71
  export * from '../SearchTrigger/index.js';
63
72
  export * from '../Section/index.js';
@@ -72,12 +81,15 @@ export * from '../StatGroup/index.js';
72
81
  export * from '../StatusDot/index.js';
73
82
  export * from '../Stepper/index.js';
74
83
  export * from '../Switch/index.js';
84
+ export * from '../Switcher/index.js';
75
85
  export * from '../Table/index.js';
76
86
  export * from '../Tabs/index.js';
77
87
  export * from '../Tag/index.js';
78
88
  export * from '../TagGroup/index.js';
79
89
  export * from '../TagsInput/index.js';
80
90
  export * from '../Text/index.js';
91
+ export * from '../ThemeGallery/index.js';
92
+ export * from '../ThemeSwatch/index.js';
81
93
  export * from '../ThemeSwitcher/index.js';
82
94
  export * from '../ThemeToggle/index.js';
83
95
  export * from '../TimeWindowPicker/index.js';