@crewlethq/ui 0.35.1 → 0.36.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 (164) hide show
  1. package/README.md +73 -0
  2. package/dist/AgentHandoffPanel/AgentHandoffPanel.d.ts +99 -0
  3. package/dist/AgentHandoffPanel/index.d.ts +3 -0
  4. package/dist/AgentHandoffPanel/index.js +16 -0
  5. package/dist/AgentHandoffPanel-JWSW62GU.css +151 -0
  6. package/dist/ArrangeFrame/index.js +1 -1
  7. package/dist/{ArrangeFrame-3PLZAG22.css → ArrangeFrame-QXOQTFAH.css} +22 -5
  8. package/dist/ArrangeList/index.js +4 -3
  9. package/dist/ArtifactBar/ArtifactBar.d.ts +2 -1
  10. package/dist/ArtifactBar/index.js +2 -2
  11. package/dist/{ArtifactBar-HV5AT4RG.css → ArtifactBar-FWPBBKQ5.css} +8 -0
  12. package/dist/ArtifactCard/index.js +3 -3
  13. package/dist/ArtifactCover/index.js +3 -2
  14. package/dist/ArtifactKindIllustration/ArtifactKindIllustration.d.ts +16 -7
  15. package/dist/ArtifactKindIllustration/index.js +1 -1
  16. package/dist/{ArtifactKindIllustration-5FPRJQ3P.css → ArtifactKindIllustration-5KTP43QS.css} +36 -0
  17. package/dist/ArtifactMakeRow/ArtifactMakeRow.d.ts +39 -0
  18. package/dist/ArtifactMakeRow/index.d.ts +4 -0
  19. package/dist/ArtifactMakeRow/index.js +4 -0
  20. package/dist/ArtifactMakeRow-RWUTS5MC.css +167 -0
  21. package/dist/ArtifactPanel/ArtifactPanel.d.ts +8 -1
  22. package/dist/ArtifactPanel/index.js +1 -1
  23. package/dist/{ArtifactPanel-HW3SU7CP.css → ArtifactPanel-KKUUIPEU.css} +9 -0
  24. package/dist/AuthLayout/index.js +2 -2
  25. package/dist/AvatarPicker/index.js +2 -2
  26. package/dist/Canvas/index.js +2 -2
  27. package/dist/CanvasBoard/CanvasBoard.d.ts +27 -13
  28. package/dist/CanvasBoard/index.d.ts +1 -1
  29. package/dist/CanvasBoard/index.js +4 -4
  30. package/dist/{CanvasBoard-5NNSKY6A.css → CanvasBoard-TS4P356F.css} +13 -6
  31. package/dist/CanvasToolbar/index.js +3 -3
  32. package/dist/Card/index.js +1 -1
  33. package/dist/{Card-KJOYHDTJ.css → Card-QOVASQNU.css} +17 -12
  34. package/dist/Checkbox/index.js +3 -2
  35. package/dist/ChoiceButtons/index.js +1 -1
  36. package/dist/{ChoiceButtons-DJ5EOGUA.css → ChoiceButtons-FLIFXFFS.css} +10 -0
  37. package/dist/ChoiceList/index.js +1 -1
  38. package/dist/{ChoiceList-RBL7FNQL.css → ChoiceList-EA2W6MOS.css} +36 -5
  39. package/dist/Combobox/index.js +3 -2
  40. package/dist/CommandPalette/index.js +3 -2
  41. package/dist/CommentThread/index.js +6 -5
  42. package/dist/Composer/Composer.d.ts +4 -0
  43. package/dist/Composer/index.js +3 -2
  44. package/dist/{Composer-ABGJIAIR.css → Composer-PXITWNEK.css} +26 -15
  45. package/dist/ConfirmField/index.js +3 -2
  46. package/dist/DataTable/index.js +5 -4
  47. package/dist/DataView/index.js +9 -8
  48. package/dist/DatasetSource/DatasetSource.d.ts +4 -0
  49. package/dist/DatasetSource/index.js +1 -1
  50. package/dist/{DatasetSource-XFPZBRXL.css → DatasetSource-SMGX4PS5.css} +38 -4
  51. package/dist/DateTimePicker/index.js +2 -1
  52. package/dist/{DateTimePicker-HG2KQXQ6.css → DateTimePicker-2IVTKFV2.css} +15 -2
  53. package/dist/DocTabsEditor/index.js +4 -3
  54. package/dist/Document/Document.d.ts +15 -3
  55. package/dist/Document/index.js +2 -1
  56. package/dist/{Document-JUGCSQ4L.css → Document-YFWTWXJP.css} +34 -2
  57. package/dist/{Editor-BVQHBF7L.js → Editor-HORWMUM3.js} +2 -1
  58. package/dist/FilterChip/index.js +1 -1
  59. package/dist/{FilterChip-EZ4QMW4E.css → FilterChip-VL33P3JL.css} +5 -1
  60. package/dist/Input/index.js +2 -1
  61. package/dist/{Input-GBZSFXLU.css → Input-ABGOFENS.css} +46 -10
  62. package/dist/LayersList/index.js +1 -1
  63. package/dist/{LayersList-NQZEIPZB.css → LayersList-TBNF4XGL.css} +16 -3
  64. package/dist/LinkInterstitial/index.js +2 -2
  65. package/dist/ListInput/index.js +4 -3
  66. package/dist/LivePreview/LivePreview.d.ts +105 -25
  67. package/dist/LivePreview/budget.d.ts +64 -20
  68. package/dist/LivePreview/index.d.ts +5 -3
  69. package/dist/LivePreview/index.js +1 -1
  70. package/dist/LivePreview/stills.d.ts +57 -0
  71. package/dist/LivePreview-BROGKR4N.css +113 -0
  72. package/dist/PresenterView/index.js +2 -2
  73. package/dist/PrincipalPicker/index.js +4 -3
  74. package/dist/RichEditor/index.js +1 -1
  75. package/dist/Select/index.js +2 -1
  76. package/dist/{Select-A54YS5EP.css → Select-W3CHTZXP.css} +18 -2
  77. package/dist/ShareDialog/index.js +5 -4
  78. package/dist/SheetColumnEditor/index.js +6 -5
  79. package/dist/SheetGrid/index.js +4 -4
  80. package/dist/SlideCompare/index.js +2 -2
  81. package/dist/SlideFilmstrip/index.js +3 -3
  82. package/dist/{SlideFilmstrip-4ITZLMO4.css → SlideFilmstrip-PAT7P4OG.css} +26 -7
  83. package/dist/SlideGrid/index.js +2 -2
  84. package/dist/{SlideGrid-S4LTJ4UU.css → SlideGrid-FJA33DV4.css} +11 -1
  85. package/dist/SlideStage/index.js +1 -1
  86. package/dist/{SlideStage-S2FISF4C.css → SlideStage-ZTTEQSS2.css} +4 -2
  87. package/dist/SourceEditor/index.js +2 -1
  88. package/dist/{SourceEditor-G2C3STPX.css → SourceEditor-QAYE2JS6.css} +19 -12
  89. package/dist/Switcher/index.js +5 -4
  90. package/dist/TagsInput/index.js +3 -2
  91. package/dist/{TagsInput-XMXTI5Q4.css → TagsInput-7EGBBXHS.css} +7 -1
  92. package/dist/ThemeGallery/index.js +1 -1
  93. package/dist/{ThemeGallery-HSUKBDWY.css → ThemeGallery-X35Y25EX.css} +26 -5
  94. package/dist/TimeWindowPicker/index.js +4 -3
  95. package/dist/{TimeWindowPicker-T763GLXH.css → TimeWindowPicker-DEFDV77Z.css} +15 -2
  96. package/dist/TreeCanvas/index.js +3 -3
  97. package/dist/VersionTimeline/index.js +2 -2
  98. package/dist/{chunk-V43UVX4H.js → chunk-27GD7LVR.js} +1 -1
  99. package/dist/{chunk-CCLNGVCM.js → chunk-2DV4THNQ.js} +2 -2
  100. package/dist/{chunk-2CQLNML5.js → chunk-3PTUDKSR.js} +4 -2
  101. package/dist/{chunk-ONL54WMH.js → chunk-46RL3E54.js} +1 -1
  102. package/dist/{chunk-UHJQDFKQ.js → chunk-4ZJLOKSS.js} +1 -1
  103. package/dist/{chunk-ACA27MZH.js → chunk-5QXRI35B.js} +1 -1
  104. package/dist/{chunk-LL5AFXU7.js → chunk-5RT5O4JR.js} +1 -1
  105. package/dist/chunk-66ADEPFB.js +51 -0
  106. package/dist/{chunk-3Y56GQPM.js → chunk-7VAUGG6B.js} +1 -1
  107. package/dist/{chunk-NKZCJRKO.js → chunk-APDKUGSH.js} +2 -2
  108. package/dist/{chunk-YSJC7AZC.js → chunk-BWOIUOO3.js} +1 -1
  109. package/dist/{chunk-PI7HKLIT.js → chunk-D7GNNID2.js} +3 -1
  110. package/dist/{chunk-THROPJZC.js → chunk-DEMALFHY.js} +1 -1
  111. package/dist/chunk-EOQFPZEE.js +138 -0
  112. package/dist/{chunk-QFNWMWWY.js → chunk-ES4RKQ7B.js} +4 -4
  113. package/dist/{chunk-J6YZ4IYV.js → chunk-FG4O64DV.js} +3 -3
  114. package/dist/{chunk-E35CMI5D.js → chunk-FHHYXZSP.js} +31 -13
  115. package/dist/{chunk-AYB6AYNH.js → chunk-GMLAKNFY.js} +1 -1
  116. package/dist/{chunk-ZB5O3ELS.js → chunk-GRYZ5EP3.js} +4 -2
  117. package/dist/{chunk-ILAEBSLJ.js → chunk-H5NOLRGH.js} +2 -2
  118. package/dist/{chunk-W3UVOZKL.js → chunk-IPAU6FLH.js} +6 -2
  119. package/dist/{chunk-Z6VW6CXX.js → chunk-IQH3DDZ2.js} +2 -2
  120. package/dist/{chunk-6QFAK2WV.js → chunk-IUYUS2SO.js} +4 -1
  121. package/dist/{chunk-AXBRWRGV.js → chunk-JQLS3MZB.js} +1 -1
  122. package/dist/{chunk-FGYET26P.js → chunk-KJW2AS57.js} +1 -1
  123. package/dist/{chunk-QIXMNOBD.js → chunk-KYZMN6I6.js} +2 -2
  124. package/dist/{chunk-73A7D5CE.js → chunk-L4WZSVMT.js} +3 -1
  125. package/dist/{chunk-W7QBBKUE.js → chunk-MJW6SQYB.js} +7 -3
  126. package/dist/{chunk-GMU6SQ6B.js → chunk-MRMHZ437.js} +3 -3
  127. package/dist/{chunk-ULPL26BU.js → chunk-N5SKHIAP.js} +1 -1
  128. package/dist/{chunk-LV4APO72.js → chunk-NQGPD6NX.js} +1 -1
  129. package/dist/{chunk-7UYONN6K.js → chunk-OSZDHN5Z.js} +2 -2
  130. package/dist/chunk-P6WFZDKS.js +111 -0
  131. package/dist/{chunk-CPEPST4S.js → chunk-PJIPUEJ3.js} +1 -1
  132. package/dist/{chunk-QS4ZGTEU.js → chunk-PPFX6GRK.js} +1 -1
  133. package/dist/{chunk-7DZDSSJS.js → chunk-RH2NCQBZ.js} +5 -4
  134. package/dist/{chunk-3VD3G3IL.js → chunk-T5RQGI6O.js} +1 -1
  135. package/dist/{chunk-F2KY4RLI.js → chunk-TVRBQMIX.js} +5 -3
  136. package/dist/{chunk-QEFHYUCY.js → chunk-UWGUKMBK.js} +1 -1
  137. package/dist/{chunk-5YLON2PW.js → chunk-UYZZV4DZ.js} +1 -1
  138. package/dist/{chunk-BQ7AKL2N.js → chunk-VKKUGZ3G.js} +3 -1
  139. package/dist/{chunk-DEJHAOC5.js → chunk-WMXAX6VA.js} +1 -1
  140. package/dist/{chunk-6JVRY5DQ.js → chunk-WNAYQQ6Y.js} +2 -2
  141. package/dist/{chunk-VDPJGP4Q.js → chunk-WX2NIG4G.js} +1 -1
  142. package/dist/{chunk-ZU3DUXD2.js → chunk-WZGYIVYH.js} +1 -1
  143. package/dist/chunk-XGBLRDSU.js +446 -0
  144. package/dist/{chunk-22CQQDFW.js → chunk-XMRTFPWX.js} +2 -2
  145. package/dist/{chunk-HUVG2FFT.js → chunk-Y5BD4MTE.js} +4 -2
  146. package/dist/chunk-YSGLEHND.js +56 -0
  147. package/dist/generated/index.d.ts +2 -0
  148. package/dist/generated/index.js +95 -92
  149. package/dist/index.js +95 -92
  150. package/dist/styles.css +862 -130
  151. package/dist/utils/focusModality.d.ts +41 -0
  152. package/dist/utils/index.d.ts +2 -0
  153. package/dist/utils/index.js +2 -1
  154. package/package.json +3 -3
  155. package/dist/LivePreview-SRO7KHO4.css +0 -65
  156. package/dist/chunk-KF6YGL4B.js +0 -160
  157. package/dist/chunk-TYKQ33CL.js +0 -35
  158. package/dist/{chunk-3P4Y5RX6.js → chunk-4BYHAOHH.js} +1 -1
  159. package/dist/{chunk-3WCNHYXE.js → chunk-5BP6IS3N.js} +0 -0
  160. package/dist/{chunk-KD2IRYCT.js → chunk-5WDXPHEW.js} +1 -1
  161. package/dist/{chunk-OSFA5ROT.js → chunk-FEJANUZK.js} +0 -0
  162. package/dist/{chunk-FJJHD73S.js → chunk-GYBDPCRC.js} +1 -1
  163. package/dist/{chunk-VHZ3AXJD.js → chunk-NQCY44B3.js} +1 -1
  164. package/dist/{chunk-FF5OZV77.js → chunk-W3HYWD63.js} +2 -2
@@ -0,0 +1,138 @@
1
+ import { Timeline } from './chunk-AUQPBL4O.js';
2
+ import { Section } from './chunk-3TFDQLW3.js';
3
+ import { Disclosure } from './chunk-MICH6QSJ.js';
4
+ import { Composer } from './chunk-RH2NCQBZ.js';
5
+ import { ArtifactPanel } from './chunk-Y5BD4MTE.js';
6
+ import { Button } from './chunk-OG6CL3EB.js';
7
+ import { cx } from './chunk-ODEQTPFM.js';
8
+ import './AgentHandoffPanel-JWSW62GU.css';
9
+ import { useId, useRef, useEffect } from 'react';
10
+ import { jsx, jsxs } from 'react/jsx-runtime';
11
+
12
+ var AGENT_HANDOFF_LABELS = {
13
+ title: "Ask an agent",
14
+ brief: "Brief",
15
+ starters: "Start from",
16
+ agent: "Who builds it",
17
+ carried: "Goes with it",
18
+ task: "The task as it is filed",
19
+ next: "What happens next",
20
+ step: "Step"
21
+ };
22
+ function AgentHandoffPanel({
23
+ onClose,
24
+ icon,
25
+ focusOnOpen,
26
+ intro,
27
+ brief,
28
+ onBriefChange,
29
+ briefLabel,
30
+ briefPlaceholder,
31
+ briefHelper,
32
+ briefMaxLength,
33
+ briefRef,
34
+ starters = [],
35
+ onStarter,
36
+ children,
37
+ agent,
38
+ carried = [],
39
+ task,
40
+ steps = [],
41
+ notice,
42
+ send,
43
+ labels,
44
+ className
45
+ }) {
46
+ const words = { ...AGENT_HANDOFF_LABELS, ...labels };
47
+ const briefId = useId();
48
+ const helperId = useId();
49
+ const held = send.disabledReason !== void 0 || send.busy === true;
50
+ const press = () => {
51
+ if (!held) send.onSend();
52
+ };
53
+ const body = useRef(null);
54
+ const sendNow = useRef(press);
55
+ sendNow.current = press;
56
+ useEffect(() => {
57
+ const root = body.current;
58
+ if (!root) return void 0;
59
+ const doc = root.ownerDocument;
60
+ const onKeyDown = (event) => {
61
+ if (event.defaultPrevented || event.isComposing) return;
62
+ if (event.key !== "Enter" || !(event.metaKey || event.ctrlKey)) return;
63
+ if (!(event.target instanceof Node) || !root.contains(event.target)) return;
64
+ event.preventDefault();
65
+ sendNow.current();
66
+ };
67
+ doc.addEventListener("keydown", onKeyDown);
68
+ return () => doc.removeEventListener("keydown", onKeyDown);
69
+ }, []);
70
+ return /* @__PURE__ */ jsx(
71
+ ArtifactPanel,
72
+ {
73
+ title: words.title,
74
+ icon,
75
+ onClose,
76
+ focusOnOpen,
77
+ className: cx("crewlet-agent-handoff", className),
78
+ footer: /* @__PURE__ */ jsxs("div", { className: "crewlet-agent-handoff__foot", children: [
79
+ send.disabledReason && !send.busy ? /* @__PURE__ */ jsx("p", { className: "crewlet-agent-handoff__reason", children: send.disabledReason }) : null,
80
+ /* @__PURE__ */ jsx(
81
+ Button,
82
+ {
83
+ className: "crewlet-agent-handoff__send",
84
+ variant: "primary",
85
+ block: true,
86
+ leadingIcon: send.media ? /* @__PURE__ */ jsx("span", { className: "crewlet-agent-handoff__media", "aria-hidden": true, children: send.media }) : void 0,
87
+ loading: send.busy,
88
+ disabledReason: send.busy ? void 0 : send.disabledReason,
89
+ onClick: press,
90
+ children: send.label
91
+ }
92
+ )
93
+ ] }),
94
+ children: /* @__PURE__ */ jsxs("div", { ref: body, className: "crewlet-agent-handoff__body", children: [
95
+ intro ? /* @__PURE__ */ jsx("p", { className: "crewlet-agent-handoff__intro", children: intro }) : null,
96
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-agent-handoff__brief", children: [
97
+ /* @__PURE__ */ jsx("label", { className: "crewlet-agent-handoff__label", htmlFor: briefId, children: briefLabel ?? words.brief }),
98
+ /* @__PURE__ */ jsx(
99
+ Composer,
100
+ {
101
+ ref: briefRef,
102
+ id: briefId,
103
+ label: briefLabel ?? words.brief,
104
+ "aria-describedby": briefHelper ? helperId : void 0,
105
+ value: brief,
106
+ onChange: onBriefChange,
107
+ onSubmit: press,
108
+ placeholder: briefPlaceholder,
109
+ maxLength: briefMaxLength,
110
+ rows: 4
111
+ }
112
+ ),
113
+ briefHelper ? /* @__PURE__ */ jsx("p", { id: helperId, className: "crewlet-agent-handoff__helper", children: briefHelper }) : null,
114
+ starters.length > 0 && onStarter && brief.trim() === "" ? /* @__PURE__ */ jsx("div", { className: "crewlet-agent-handoff__starters", role: "group", "aria-label": words.starters, children: starters.map((s) => /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onClick: () => onStarter(s.key), children: s.label }, s.key)) }) : null
115
+ ] }),
116
+ children,
117
+ /* @__PURE__ */ jsx(Section, { title: words.agent, className: "crewlet-agent-handoff__section", children: agent }),
118
+ carried.length > 0 || task ? /* @__PURE__ */ jsxs(Section, { title: words.carried, className: "crewlet-agent-handoff__section", children: [
119
+ carried.length > 0 ? /* @__PURE__ */ jsx("ul", { className: "crewlet-agent-handoff__carried", children: carried.map((item) => /* @__PURE__ */ jsxs("li", { className: "crewlet-agent-handoff__item", children: [
120
+ item.icon ? /* @__PURE__ */ jsx("span", { className: "crewlet-agent-handoff__item-icon", "aria-hidden": true, children: item.icon }) : null,
121
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-agent-handoff__item-words", children: [
122
+ /* @__PURE__ */ jsx("span", { className: "crewlet-agent-handoff__item-label", children: item.label }),
123
+ item.detail ? /* @__PURE__ */ jsx("span", { className: "crewlet-agent-handoff__item-detail", children: item.detail }) : null
124
+ ] })
125
+ ] }, item.key)) }) : null,
126
+ task ? /* @__PURE__ */ jsx(Disclosure, { title: words.task, size: "compact", headingLevel: "none", lazy: true, children: /* @__PURE__ */ jsxs("div", { className: "crewlet-agent-handoff__task", children: [
127
+ /* @__PURE__ */ jsx("p", { className: "crewlet-agent-handoff__task-title", children: task.title }),
128
+ /* @__PURE__ */ jsx("pre", { className: "crewlet-agent-handoff__task-body", children: task.body })
129
+ ] }) }) : null
130
+ ] }) : null,
131
+ steps.length > 0 ? /* @__PURE__ */ jsx(Section, { title: words.next, className: "crewlet-agent-handoff__section", children: /* @__PURE__ */ jsx(Timeline, { itemLabel: words.step, children: steps.map((step, i) => /* @__PURE__ */ jsx(Timeline.Item, { children: step }, i)) }) }) : null,
132
+ notice
133
+ ] })
134
+ }
135
+ );
136
+ }
137
+
138
+ export { AGENT_HANDOFF_LABELS, AgentHandoffPanel };
@@ -1,12 +1,12 @@
1
1
  import { PageHeader } from './chunk-HOXGBLEY.js';
2
- import { DataTable } from './chunk-22CQQDFW.js';
3
- import { DateTimePicker } from './chunk-73A7D5CE.js';
2
+ import { DataTable } from './chunk-XMRTFPWX.js';
3
+ import { DateTimePicker } from './chunk-L4WZSVMT.js';
4
4
  import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
5
5
  import { Toolbar } from './chunk-PGRPNDWM.js';
6
6
  import { Popover } from './chunk-K3IJQNB7.js';
7
- import { Input } from './chunk-6QFAK2WV.js';
8
- import { Kbd } from './chunk-SMBKXWML.js';
9
7
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
8
+ import { Input } from './chunk-IUYUS2SO.js';
9
+ import { Kbd } from './chunk-SMBKXWML.js';
10
10
  import { Count } from './chunk-BHHIIK3M.js';
11
11
  import { Menu } from './chunk-BUVCV3WI.js';
12
12
  import { Button } from './chunk-OG6CL3EB.js';
@@ -1,9 +1,9 @@
1
- import { Select } from './chunk-BQ7AKL2N.js';
1
+ import { Select } from './chunk-VKKUGZ3G.js';
2
2
  import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
3
3
  import { HueSwatch } from './chunk-SUXP4OBT.js';
4
4
  import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
5
- import { Checkbox } from './chunk-CPEPST4S.js';
6
- import { FormField, Input } from './chunk-6QFAK2WV.js';
5
+ import { Checkbox } from './chunk-PJIPUEJ3.js';
6
+ import { FormField, Input } from './chunk-IUYUS2SO.js';
7
7
  import { Kbd } from './chunk-SMBKXWML.js';
8
8
  import { Menu } from './chunk-BUVCV3WI.js';
9
9
  import { Button } from './chunk-OG6CL3EB.js';
@@ -1,9 +1,9 @@
1
1
  import { Note } from './chunk-5SZGKSGL.js';
2
- import { CanvasToolbar, toolForKey } from './chunk-3Y56GQPM.js';
3
- import { IDENTITY_VIEW, Canvas } from './chunk-3P4Y5RX6.js';
2
+ import { CanvasToolbar, toolForKey } from './chunk-7VAUGG6B.js';
3
+ import { IDENTITY_VIEW, Canvas } from './chunk-4BYHAOHH.js';
4
4
  import { IconButton } from './chunk-4FQT6ZAY.js';
5
5
  import { cx } from './chunk-ODEQTPFM.js';
6
- import './CanvasBoard-5NNSKY6A.css';
6
+ import './CanvasBoard-TS4P356F.css';
7
7
  import { useState, useRef, useImperativeHandle, useCallback, useMemo, useEffect } from 'react';
8
8
  import { MaximizeGlyph, PencilGlyph, TrashGlyph, MousePointer2Glyph, HandGlyph, FrameGlyph, TypeGlyph, StickyNoteGlyph } from '@crewlethq/icons/glyphs';
9
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -207,12 +207,23 @@ function useFrameGestures(zoom, minSide, maxSide, commit) {
207
207
  }
208
208
  var sameSelection = (a, b) => a === b || a !== null && b !== null && a.kind === b.kind && a.id === b.id;
209
209
  function boardRoom(width, height) {
210
- const title = width >= BOARD_TITLE_MIN_WIDTH;
211
- if (width >= PLACEHOLDER_FULL.width && height >= PLACEHOLDER_FULL.height) return { title, lines: 2 };
212
- if (width >= PLACEHOLDER_SIZE.width && height >= PLACEHOLDER_SIZE.height) return { title, lines: 1 };
213
- return { title, lines: 0 };
210
+ if (width >= PLACEHOLDER_FULL.width && height >= PLACEHOLDER_FULL.height) return { lines: 2 };
211
+ if (width >= PLACEHOLDER_SIZE.width && height >= PLACEHOLDER_SIZE.height) return { lines: 1 };
212
+ return { lines: 0 };
214
213
  }
215
- var BOARD_TITLE_MIN_WIDTH = 40;
214
+ function boardName(title, position, room) {
215
+ const letters = Array.from(title).length;
216
+ if (room >= (Math.min(letters, BOARD_NAME_MIN_CHARS) + 1) * NAME_GLYPH_PX) {
217
+ return { text: title, whole: room >= letters * NAME_GLYPH_PX };
218
+ }
219
+ const number = String(position);
220
+ if (room >= number.length * NAME_GLYPH_PX) return { text: number, whole: false };
221
+ return null;
222
+ }
223
+ var BOARD_NAME_MIN_CHARS = 3;
224
+ var NAME_GLYPH_PX = 9;
225
+ var HANDLE_END = 9;
226
+ var OPEN_CONTROL = 30;
216
227
  var PLACEHOLDER_SIZE = { width: 96, height: 32 };
217
228
  var PLACEHOLDER_FULL = { width: 200, height: 64 };
218
229
  var TYPING = "input, textarea, select, [contenteditable='true']";
@@ -412,16 +423,21 @@ function CanvasBoard({
412
423
  },
413
424
  ref: canvas,
414
425
  children: /* @__PURE__ */ jsxs("div", { className: "crewlet-canvas-board__layer", style: zoomVar, children: [
415
- drawnBoards.map((b) => {
426
+ drawnBoards.map((b, index) => {
416
427
  const isLive = live.has(b.id);
417
428
  const isActive = !editable && active === b.id && isLive;
418
429
  const chosen = isSelected("board", b.id);
419
430
  const room = boardRoom(b.w * view.k, b.h * view.k);
431
+ const name = boardName(
432
+ b.title,
433
+ index + 1,
434
+ b.w * view.k - (editable ? HANDLE_END : 0) - (onOpen ? OPEN_CONTROL : 0)
435
+ );
420
436
  return /* @__PURE__ */ jsxs(
421
437
  "section",
422
438
  {
423
439
  className: "crewlet-canvas-board__board",
424
- "data-untitled": !room.title || void 0,
440
+ "data-untitled": !name || void 0,
425
441
  "data-live": isLive || void 0,
426
442
  "data-active": isActive || void 0,
427
443
  "data-selected": chosen || void 0,
@@ -436,9 +452,10 @@ function CanvasBoard({
436
452
  className: "crewlet-canvas-board__title crewlet-canvas-board__handle",
437
453
  "aria-label": text.move(b.title),
438
454
  "aria-pressed": chosen,
455
+ title: name?.whole === false ? b.title : void 0,
439
456
  onFocus: () => setSelected({ kind: "board", id: b.id }),
440
457
  ...boardGestures.handle(b.id, "move", b),
441
- children: b.title
458
+ children: name?.text ?? b.title
442
459
  }
443
460
  ) : (
444
461
  // The name selects its board, as a press on the board
@@ -449,8 +466,9 @@ function CanvasBoard({
449
466
  "span",
450
467
  {
451
468
  className: "crewlet-canvas-board__title",
469
+ title: name?.whole === false ? b.title : void 0,
452
470
  onClick: () => setSelected({ kind: "board", id: b.id }),
453
- children: b.title
471
+ children: name?.text ?? b.title
454
472
  }
455
473
  )
456
474
  ),
@@ -680,4 +698,4 @@ function NoteView({
680
698
  return /* @__PURE__ */ jsx("div", { className: "crewlet-canvas-board__note", "data-kind": "title", style: frame, ...paper, children: body });
681
699
  }
682
700
 
683
- export { BOARD_TITLE_MIN_WIDTH, CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, CANVAS_BOARD_MIN_ZOOM, CANVAS_NOTE_COLORS, CanvasBoard, TITLE_GLYPH_EM, boardRoom, liveBoards, titleSize };
701
+ export { BOARD_NAME_MIN_CHARS, CANVAS_BOARD_MAX_LIVE, CANVAS_BOARD_MIN_LIVE_WIDTH, CANVAS_BOARD_MIN_ZOOM, CANVAS_NOTE_COLORS, CanvasBoard, TITLE_GLYPH_EM, boardName, boardRoom, liveBoards, titleSize };
@@ -1,4 +1,4 @@
1
- import { Combobox } from './chunk-QS4ZGTEU.js';
1
+ import { Combobox } from './chunk-PPFX6GRK.js';
2
2
  import { PRINCIPAL_KINDS, PrincipalAvatar } from './chunk-CI3VPIJN.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './PrincipalPicker-7NNZTGUP.css';
@@ -2,7 +2,7 @@ import { Tag } from './chunk-GFV4LJHH.js';
2
2
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
3
3
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
- import './DatasetSource-XFPZBRXL.css';
5
+ import './DatasetSource-SMGX4PS5.css';
6
6
  import { useId, Children, isValidElement } from 'react';
7
7
  import { ClockGlyph } from '@crewlethq/icons/glyphs';
8
8
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -40,6 +40,7 @@ function DatasetSource({
40
40
  const text = { ...LABELS, ...labels, kinds: { ...LABELS.kinds, ...labels?.kinds } };
41
41
  const titleId = useId();
42
42
  const blocked = status === "refused" || status === "failed";
43
+ const open = selected && children !== void 0 && children !== null && children !== false;
43
44
  const state = status === "loading" ? /* @__PURE__ */ jsx("span", { className: "crewlet-dataset-source__state", children: text.loading }) : blocked ? /* @__PURE__ */ jsx("span", { className: "crewlet-dataset-source__state crewlet-dataset-source__state--blocked", children: detail ?? (status === "refused" ? text.refused : text.failed) }) : status === "live" ? /* @__PURE__ */ jsx("span", { className: "crewlet-dataset-source__state", children: text.live }) : asOf !== void 0 && asOf !== null ? /* @__PURE__ */ jsxs("span", { className: "crewlet-dataset-source__state", children: [
44
45
  text.asOf,
45
46
  " ",
@@ -87,12 +88,13 @@ function DatasetSource({
87
88
  "crewlet-dataset-source",
88
89
  `crewlet-dataset-source--${status}`,
89
90
  selected && "crewlet-dataset-source--selected",
91
+ open && "crewlet-dataset-source--open",
90
92
  className
91
93
  ),
92
94
  "aria-busy": status === "loading" || void 0,
93
95
  children: [
94
96
  onSelect ? /* @__PURE__ */ jsx("button", { type: "button", className: "crewlet-dataset-source__summary", "aria-pressed": selected, onClick: onSelect, children: summary }) : /* @__PURE__ */ jsx("div", { className: "crewlet-dataset-source__summary", children: summary }),
95
- selected && children ? /* @__PURE__ */ jsx("div", { className: "crewlet-dataset-source__preview", role: "group", "aria-labelledby": titleId, children }) : null
97
+ open ? /* @__PURE__ */ jsx("div", { className: "crewlet-dataset-source__preview", role: "group", "aria-labelledby": titleId, children }) : null
96
98
  ]
97
99
  }
98
100
  );
@@ -1,6 +1,6 @@
1
- import { SlideStage } from './chunk-LV4APO72.js';
1
+ import { SlideStage } from './chunk-NQGPD6NX.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './SlideGrid-S4LTJ4UU.css';
3
+ import './SlideGrid-FJA33DV4.css';
4
4
  import { EyeOffGlyph } from '@crewlethq/icons/glyphs';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
6
 
@@ -2,9 +2,10 @@ import { ThemeSwatch } from './chunk-MNFU2RNT.js';
2
2
  import { useHighlightRest } from './chunk-F73MC7EZ.js';
3
3
  import { useRoving, tabStop } from './chunk-RKKO7QHH.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
- import './ThemeGallery-HSUKBDWY.css';
5
+ import './ThemeGallery-X35Y25EX.css';
6
6
  import { useId } from 'react';
7
7
  import { themeGroups, themeRegistry } from '@crewlethq/tokens';
8
+ import { CheckGlyph } from '@crewlethq/icons/glyphs';
8
9
  import { jsx, jsxs } from 'react/jsx-runtime';
9
10
 
10
11
  function ThemeGallery({
@@ -79,7 +80,10 @@ function ThemeGallery({
79
80
  onMouseEnter: () => preview.rest(theme.id),
80
81
  children: [
81
82
  renderPreview ? /* @__PURE__ */ jsx("span", { className: "crewlet-theme-gallery__preview", "aria-hidden": "true", children: renderPreview(theme) }) : theme.swatch ? /* @__PURE__ */ jsx(ThemeSwatch, { swatch: theme.swatch, size: "card" }) : null,
82
- /* @__PURE__ */ jsx("span", { className: "crewlet-theme-gallery__name", children: theme.name })
83
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-theme-gallery__label", children: [
84
+ /* @__PURE__ */ jsx("span", { className: "crewlet-theme-gallery__name", children: theme.name }),
85
+ chosen ? /* @__PURE__ */ jsx(CheckGlyph, { size: "xs", className: "crewlet-theme-gallery__check", "aria-hidden": "true" }) : null
86
+ ] })
83
87
  ]
84
88
  },
85
89
  theme.id
@@ -1,7 +1,7 @@
1
- import { FormField, Textarea, Input } from './chunk-6QFAK2WV.js';
1
+ import { FormField, Textarea, Input } from './chunk-IUYUS2SO.js';
2
2
  import { Kbd } from './chunk-SMBKXWML.js';
3
- import { isComposing } from './chunk-R25RGPUB.js';
4
3
  import { announce } from './chunk-RSAQOKH3.js';
4
+ import { isComposing } from './chunk-R25RGPUB.js';
5
5
  import { IconButton } from './chunk-4FQT6ZAY.js';
6
6
  import './ListInput-O7LJKOIG.css';
7
7
  import { useState, useRef, useLayoutEffect } from 'react';
@@ -1,8 +1,9 @@
1
+ import { useFocusModality } from './chunk-YSGLEHND.js';
1
2
  import { useHeadingLevel, headingTag, HeadingLevelProvider, nextHeadingLevel } from './chunk-PQADV6P6.js';
2
3
  import { IconButton } from './chunk-4FQT6ZAY.js';
3
4
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
4
5
  import { cx } from './chunk-ODEQTPFM.js';
5
- import './Input-GBZSFXLU.css';
6
+ import './Input-ABGOFENS.css';
6
7
  import { forwardRef, useRef, useState, useImperativeHandle, useEffect, useId } from 'react';
7
8
  import { XGlyph } from '@crewlethq/icons/glyphs';
8
9
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -21,6 +22,7 @@ var Input = forwardRef(function Input2({
21
22
  disabled,
22
23
  ...rest
23
24
  }, ref) {
25
+ useFocusModality();
24
26
  const field = useRef(null);
25
27
  const [typed, setTyped] = useState(() => String(rest.defaultValue ?? "") !== "");
26
28
  const controlled = rest.value !== void 0;
@@ -80,6 +82,7 @@ function InputAffix({ text, id, sentence }) {
80
82
  ] });
81
83
  }
82
84
  var Textarea = forwardRef(function Textarea2({ error = false, autoResize = false, trailing, className = "", value, disabled, ...rest }, ref) {
85
+ useFocusModality();
83
86
  const localRef = useRef(null);
84
87
  useImperativeHandle(ref, () => localRef.current);
85
88
  useEffect(() => {
@@ -1,4 +1,4 @@
1
- import { Document } from './chunk-TYKQ33CL.js';
1
+ import { Document } from './chunk-P6WFZDKS.js';
2
2
  import { ArtifactKindGlyph } from './chunk-CE2THTQR.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './ArtifactCover-D4MBEJ5H.css';
@@ -1,5 +1,5 @@
1
1
  import { InlineCode } from './chunk-5CLW2CXT.js';
2
- import { FormField, Input } from './chunk-6QFAK2WV.js';
2
+ import { FormField, Input } from './chunk-IUYUS2SO.js';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
5
5
  function confirmMatches(typed, phrase) {
@@ -1,10 +1,10 @@
1
- import { SlideStage } from './chunk-LV4APO72.js';
1
+ import { SlideStage } from './chunk-NQGPD6NX.js';
2
2
  import { useReorder } from './chunk-XJ2QEBMM.js';
3
3
  import { Kbd, isApplePlatform } from './chunk-SMBKXWML.js';
4
4
  import { Menu } from './chunk-BUVCV3WI.js';
5
5
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
- import './SlideFilmstrip-4ITZLMO4.css';
7
+ import './SlideFilmstrip-PAT7P4OG.css';
8
8
  import { useRef, useLayoutEffect, useState } from 'react';
9
9
  import { EyeOffGlyph, GripVerticalGlyph, EllipsisGlyph, CopyGlyph, TrashGlyph } from '@crewlethq/icons/glyphs';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,9 +1,10 @@
1
1
  import { today, CalendarGrid, shiftMonth, compareDays } from './chunk-GXQ3B46I.js';
2
2
  import { Popover } from './chunk-K3IJQNB7.js';
3
+ import { useFocusModality } from './chunk-YSGLEHND.js';
3
4
  import { Button } from './chunk-OG6CL3EB.js';
4
5
  import { IconButton } from './chunk-4FQT6ZAY.js';
5
6
  import { cx } from './chunk-ODEQTPFM.js';
6
- import './DateTimePicker-HG2KQXQ6.css';
7
+ import './DateTimePicker-2IVTKFV2.css';
7
8
  import { useMemo, useState, useEffect } from 'react';
8
9
  import { CalendarGlyph, ChevronDownGlyph, ChevronsLeftGlyph, ChevronLeftGlyph, ChevronRightGlyph, ChevronsRightGlyph } from '@crewlethq/icons/glyphs';
9
10
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -94,6 +95,7 @@ function DateTimePicker({
94
95
  size = "md",
95
96
  labels: labelOverrides
96
97
  }) {
98
+ useFocusModality();
97
99
  const labels = useMemo(
98
100
  () => labelOverrides ? { ...DEFAULT_DATE_TIME_PICKER_LABELS, ...labelOverrides } : DEFAULT_DATE_TIME_PICKER_LABELS,
99
101
  [labelOverrides]
@@ -1,8 +1,9 @@
1
1
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './ArtifactKinds-CVD3FCYO.css';
4
- import './ArtifactKindIllustration-5FPRJQ3P.css';
4
+ import './ArtifactKindIllustration-5KTP43QS.css';
5
5
  import { useId } from 'react';
6
+ import { CheckGlyph } from '@crewlethq/icons/glyphs';
6
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
8
 
8
9
  function ArtifactKindIllustration({ kind, className }) {
@@ -100,6 +101,7 @@ function ArtifactKindTile({
100
101
  label,
101
102
  href,
102
103
  onSelect,
104
+ selected,
103
105
  face,
104
106
  detail,
105
107
  badge,
@@ -113,7 +115,8 @@ function ArtifactKindTile({
113
115
  /* @__PURE__ */ jsx("span", { className: "crewlet-kind-tile__frame", children: /* @__PURE__ */ jsx(ArtifactKindGround, { kind, className: "crewlet-kind-tile__ground", children: face }) }),
114
116
  /* @__PURE__ */ jsxs("span", { className: "crewlet-kind-tile__label", children: [
115
117
  /* @__PURE__ */ jsx("span", { className: "crewlet-kind-tile__name", children: label }),
116
- badge ? /* @__PURE__ */ jsx("span", { className: "crewlet-kind-tile__badge", children: badge }) : null
118
+ badge ? /* @__PURE__ */ jsx("span", { className: "crewlet-kind-tile__badge", children: badge }) : null,
119
+ selected && href === void 0 ? /* @__PURE__ */ jsx(CheckGlyph, { size: "xs", className: "crewlet-kind-tile__check", "aria-hidden": "true" }) : null
117
120
  ] }),
118
121
  detail ? /* @__PURE__ */ jsx("span", { id: detailId, className: "crewlet-kind-tile__detail", children: detail }) : null
119
122
  ] });
@@ -144,7 +147,8 @@ function ArtifactKindTile({
144
147
  type: "button",
145
148
  "aria-label": name,
146
149
  "aria-describedby": describedBy,
147
- className: cx("crewlet-kind-tile", "crewlet-kind-tile--button", className),
150
+ "aria-pressed": selected,
151
+ className: cx("crewlet-kind-tile", "crewlet-kind-tile--button", selected && "is-selected", className),
148
152
  onClick: onSelect,
149
153
  children: body
150
154
  }
@@ -1,12 +1,12 @@
1
1
  import { Modal } from './chunk-XEGZHHRH.js';
2
2
  import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
3
- import { Popover } from './chunk-K3IJQNB7.js';
4
3
  import { KeyChip, highlightMatch } from './chunk-FYTIJM2T.js';
5
- import { Input } from './chunk-6QFAK2WV.js';
4
+ import { Popover } from './chunk-K3IJQNB7.js';
6
5
  import { Skeleton } from './chunk-TEUQWOWZ.js';
6
+ import { Input } from './chunk-IUYUS2SO.js';
7
+ import { announce } from './chunk-RSAQOKH3.js';
7
8
  import { useMediaMatch } from './chunk-RTPQDNW3.js';
8
9
  import { focusables, isComposing } from './chunk-R25RGPUB.js';
9
- import { announce } from './chunk-RSAQOKH3.js';
10
10
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
11
11
  import { cx } from './chunk-ODEQTPFM.js';
12
12
  import './Switcher-K3EPA2RB.css';
@@ -1,6 +1,6 @@
1
1
  import { Modal } from './chunk-XEGZHHRH.js';
2
2
  import { useListbox, useHighlightRest } from './chunk-F73MC7EZ.js';
3
- import { Input } from './chunk-6QFAK2WV.js';
3
+ import { Input } from './chunk-IUYUS2SO.js';
4
4
  import { Kbd } from './chunk-SMBKXWML.js';
5
5
  import { Count } from './chunk-BHHIIK3M.js';
6
6
  import { isComposing } from './chunk-R25RGPUB.js';
@@ -1,6 +1,6 @@
1
1
  import { isComposing } from './chunk-R25RGPUB.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
- import './SlideStage-S2FISF4C.css';
3
+ import './SlideStage-ZTTEQSS2.css';
4
4
  import { useRef, useState, useLayoutEffect, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
 
@@ -1,8 +1,8 @@
1
1
  import { Skeleton } from './chunk-TEUQWOWZ.js';
2
2
  import { PrincipalAvatar } from './chunk-CI3VPIJN.js';
3
3
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
4
- import { ArtifactKindGround } from './chunk-W7QBBKUE.js';
5
- import { Card } from './chunk-ACA27MZH.js';
4
+ import { ArtifactKindGround } from './chunk-MJW6SQYB.js';
5
+ import { Card } from './chunk-5QXRI35B.js';
6
6
  import { AvatarStack } from './chunk-5AQBPHZD.js';
7
7
  import { ArtifactKindGlyph } from './chunk-CE2THTQR.js';
8
8
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
@@ -0,0 +1,111 @@
1
+ import { useFocusModality } from './chunk-YSGLEHND.js';
2
+ import { cx } from './chunk-ODEQTPFM.js';
3
+ import './Document-YFWTWXJP.css';
4
+ import { forwardRef, useRef, useCallback, useLayoutEffect, useEffect } from 'react';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ function Document({ as: Tag = "div", size = "md", measure = "normal", className, children, ...rest }) {
8
+ return /* @__PURE__ */ jsx(
9
+ Tag,
10
+ {
11
+ ...rest,
12
+ className: cx(
13
+ "crewlet-document",
14
+ `crewlet-document--${size}`,
15
+ measure === "normal" && "crewlet-document--measure",
16
+ className
17
+ ),
18
+ children
19
+ }
20
+ );
21
+ }
22
+ function DocumentTitle({ as: Tag = "h1", className, children, ...rest }) {
23
+ return /* @__PURE__ */ jsx(Tag, { ...rest, className: cx("crewlet-document-title", className), children });
24
+ }
25
+ var LINE_BREAKS = /\r\n|[\r\n\u2028\u2029]/g;
26
+ var DocumentTitleField = forwardRef(function DocumentTitleField2({ error = false, className, onChange, onKeyDown, value, defaultValue, ...rest }, forwarded) {
27
+ useFocusModality();
28
+ const own = useRef(null);
29
+ const ref = useCallback(
30
+ (element) => {
31
+ own.current = element;
32
+ if (typeof forwarded === "function") forwarded(element);
33
+ else if (forwarded) forwarded.current = element;
34
+ },
35
+ [forwarded]
36
+ );
37
+ const fit = useCallback(() => {
38
+ const element = own.current;
39
+ if (!element) return;
40
+ element.style.height = "auto";
41
+ const style = getComputedStyle(element);
42
+ const edges = style.boxSizing === "border-box" ? parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth) : -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));
43
+ element.style.height = `${element.scrollHeight + (Number.isFinite(edges) ? edges : 0)}px`;
44
+ }, []);
45
+ useLayoutEffect(fit, [fit, value]);
46
+ useEffect(() => {
47
+ const element = own.current;
48
+ if (!element || typeof ResizeObserver === "undefined") return void 0;
49
+ let width = element.clientWidth;
50
+ const observer = new ResizeObserver(() => {
51
+ if (element.clientWidth === width) return;
52
+ width = element.clientWidth;
53
+ fit();
54
+ });
55
+ observer.observe(element);
56
+ return () => observer.disconnect();
57
+ }, [fit]);
58
+ useEffect(() => {
59
+ const element = own.current;
60
+ if (!element) return void 0;
61
+ const refuse = (event) => {
62
+ if (event.inputType === "insertLineBreak" || event.inputType === "insertParagraph") event.preventDefault();
63
+ };
64
+ element.addEventListener("beforeinput", refuse);
65
+ return () => element.removeEventListener("beforeinput", refuse);
66
+ }, []);
67
+ const change = (event) => {
68
+ const element = event.currentTarget;
69
+ if (LINE_BREAKS.test(element.value)) {
70
+ LINE_BREAKS.lastIndex = 0;
71
+ const caret = element.selectionStart;
72
+ element.value = element.value.replace(LINE_BREAKS, " ");
73
+ element.setSelectionRange(caret, caret);
74
+ }
75
+ LINE_BREAKS.lastIndex = 0;
76
+ onChange?.(event);
77
+ if (value === void 0) fit();
78
+ };
79
+ const keyDown = (event) => {
80
+ onKeyDown?.(event);
81
+ if (event.key !== "Enter" || event.defaultPrevented || event.nativeEvent.isComposing) return;
82
+ const form = event.currentTarget.form;
83
+ if (!form) return;
84
+ const submitter = form.querySelector(
85
+ 'button[type="submit"], button:not([type]), input[type="submit"], input[type="image"]'
86
+ );
87
+ if (submitter) {
88
+ if (!submitter.disabled) form.requestSubmit(submitter);
89
+ return;
90
+ }
91
+ const fields = form.querySelectorAll('input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]), textarea');
92
+ if (fields.length === 1) form.requestSubmit();
93
+ };
94
+ return /* @__PURE__ */ jsx(
95
+ "textarea",
96
+ {
97
+ ...rest,
98
+ ref,
99
+ rows: 1,
100
+ value,
101
+ defaultValue,
102
+ "aria-multiline": "false",
103
+ "aria-invalid": error || void 0,
104
+ className: cx("crewlet-document-title", "crewlet-document-title-field", className),
105
+ onChange: change,
106
+ onKeyDown: keyDown
107
+ }
108
+ );
109
+ });
110
+
111
+ export { Document, DocumentTitle, DocumentTitleField };
@@ -1,4 +1,4 @@
1
- import { FormField } from './chunk-6QFAK2WV.js';
1
+ import { FormField } from './chunk-IUYUS2SO.js';
2
2
  import { cx } from './chunk-ODEQTPFM.js';
3
3
  import './Checkbox-ALWG3WV2.css';
4
4
  import { forwardRef, useId, useRef, useCallback, useEffect } from 'react';
@@ -1,5 +1,5 @@
1
1
  import { useListbox } from './chunk-F73MC7EZ.js';
2
- import { Input } from './chunk-6QFAK2WV.js';
2
+ import { Input } from './chunk-IUYUS2SO.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './Combobox-4FUVYIE7.css';
5
5
  import { forwardRef, useId, useMemo, useRef, useCallback } from 'react';