@crewlethq/ui 0.111.0 → 0.113.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 (173) hide show
  1. package/README.md +1 -1
  2. package/dist/ActivityLine/ActivityLine.d.ts +16 -22
  3. package/dist/ActivityLine/index.js +4 -2
  4. package/dist/ActivityLine-TIMSOQGU.css +32 -0
  5. package/dist/AgentHandoffPanel/index.js +4 -3
  6. package/dist/AppShell/index.js +2 -2
  7. package/dist/ArrangeList/index.js +4 -3
  8. package/dist/ArtifactBar/index.js +4 -4
  9. package/dist/ArtifactCard/index.js +6 -5
  10. package/dist/Avatar/AvatarStack.d.ts +9 -3
  11. package/dist/Avatar/index.js +1 -1
  12. package/dist/AvatarPicker/index.js +8 -8
  13. package/dist/{AvatarStack-EQZZJZ3V.css → AvatarStack-GNEJHEU6.css} +20 -0
  14. package/dist/CharacterPicker/index.js +2 -2
  15. package/dist/ChatDay/ChatDay.d.ts +3 -1
  16. package/dist/ChatDay/index.js +2 -2
  17. package/dist/ChatDivider/ChatDivider.d.ts +8 -1
  18. package/dist/ChatDivider/index.js +1 -1
  19. package/dist/{ChatDivider-7SPCQXUQ.css → ChatDivider-BRODST2E.css} +23 -0
  20. package/dist/ChatMessage/ChatMessage.d.ts +10 -3
  21. package/dist/ChatMessage/index.js +2 -2
  22. package/dist/{ChatMessage-5AMJCGZY.css → ChatMessage-SZGZT7O2.css} +15 -0
  23. package/dist/ChatThread/index.js +2 -2
  24. package/dist/CheckGrid/index.js +4 -3
  25. package/dist/Checkbox/index.js +3 -2
  26. package/dist/ColorField/index.js +3 -2
  27. package/dist/Combobox/index.js +3 -2
  28. package/dist/CommandPalette/index.js +3 -2
  29. package/dist/CommentThread/index.js +6 -5
  30. package/dist/Composer/index.js +3 -2
  31. package/dist/ConfirmField/index.js +3 -2
  32. package/dist/ContrastHelp/index.js +2 -2
  33. package/dist/DataGrid/index.js +4 -3
  34. package/dist/DataTable/index.js +5 -4
  35. package/dist/DataView/index.js +8 -7
  36. package/dist/DateTimePicker/index.js +2 -2
  37. package/dist/DocTabsEditor/index.js +4 -3
  38. package/dist/{Editor-VAEC6MIJ.js → Editor-XT73VTSJ.js} +3 -2
  39. package/dist/EmojiPicker/EmojiPicker.d.ts +23 -5
  40. package/dist/EmojiPicker/index.d.ts +1 -1
  41. package/dist/EmojiPicker/index.js +5 -3
  42. package/dist/EmojiPicker-V6XM56GJ.css +180 -0
  43. package/dist/EntityChip/index.js +1 -1
  44. package/dist/HuePicker/index.js +4 -4
  45. package/dist/ImageUpload/index.js +1 -1
  46. package/dist/Input/index.js +2 -1
  47. package/dist/KeyValueRows/index.js +3 -2
  48. package/dist/Layer/index.d.ts +1 -1
  49. package/dist/Layer/place.d.ts +6 -0
  50. package/dist/ListInput/index.js +3 -2
  51. package/dist/MarkdownEditor/index.js +4 -4
  52. package/dist/MemberPicker/index.js +4 -3
  53. package/dist/MentionMenu/MentionMenu.d.ts +18 -2
  54. package/dist/MentionMenu/index.d.ts +4 -1
  55. package/dist/MentionMenu/index.js +2 -1
  56. package/dist/{MentionMenu-77P7C4F7.css → MentionMenu-AWZSOTNU.css} +45 -1
  57. package/dist/Menu/Menu.d.ts +4 -1
  58. package/dist/Menu/index.js +1 -1
  59. package/dist/{Menu-UY2O4OCZ.css → Menu-PXOAJ4DP.css} +5 -0
  60. package/dist/MergeConflicts/index.js +4 -4
  61. package/dist/MessageActions/index.js +5 -4
  62. package/dist/OrgLabel/index.js +1 -1
  63. package/dist/OrgNode/index.js +1 -1
  64. package/dist/OrgTable/index.js +8 -7
  65. package/dist/PeopleRail/index.js +1 -1
  66. package/dist/Popover/Popover.d.ts +4 -2
  67. package/dist/Popover/index.js +1 -1
  68. package/dist/{Popover-QCINR7WG.css → Popover-EKG6OBZL.css} +5 -0
  69. package/dist/PresenceStack/index.js +1 -1
  70. package/dist/Principal/index.js +1 -1
  71. package/dist/PrincipalPicker/index.js +5 -4
  72. package/dist/ProposalCard/index.js +4 -3
  73. package/dist/ReactionBar/ReactionBar.d.ts +4 -2
  74. package/dist/ReactionBar/index.js +6 -4
  75. package/dist/RecordChip/index.js +2 -2
  76. package/dist/RichEditor/index.js +1 -1
  77. package/dist/SegmentedControl/index.js +3 -3
  78. package/dist/ShareDialog/index.js +2 -2
  79. package/dist/SheetColumnEditor/index.js +8 -7
  80. package/dist/SheetGrid/index.js +5 -5
  81. package/dist/SlideFilmstrip/index.js +2 -2
  82. package/dist/Switcher/index.js +4 -3
  83. package/dist/TableCells/index.js +2 -2
  84. package/dist/Tabs/index.js +2 -2
  85. package/dist/ThemeSwitcher/index.js +4 -4
  86. package/dist/ThreadSummary/ThreadSummary.d.ts +3 -1
  87. package/dist/ThreadSummary/index.d.ts +1 -1
  88. package/dist/ThreadSummary/index.js +3 -3
  89. package/dist/{ThreadSummary-CFAHYY57.css → ThreadSummary-2AFEU6NH.css} +2 -1
  90. package/dist/TimeRangePicker/index.js +6 -5
  91. package/dist/TimeWindowPicker/index.js +4 -3
  92. package/dist/TreeGrid/index.js +5 -4
  93. package/dist/ValueField/index.js +4 -3
  94. package/dist/VersionCompare/index.js +4 -4
  95. package/dist/VersionTimeline/index.js +1 -1
  96. package/dist/WorkingLine/BouncingDots.d.ts +8 -0
  97. package/dist/WorkingLine/WorkingLine.d.ts +97 -0
  98. package/dist/WorkingLine/index.d.ts +5 -0
  99. package/dist/WorkingLine/index.js +5 -0
  100. package/dist/WorkingLine-NUFSSAOL.css +332 -0
  101. package/dist/{chunk-S4AQ7HAA.js → chunk-2NUQBD3O.js} +3 -3
  102. package/dist/{chunk-GMBXRSC5.js → chunk-32QH3CAO.js} +3 -3
  103. package/dist/{chunk-QEGOVWYP.js → chunk-3UFIYOVD.js} +1 -1
  104. package/dist/chunk-47V3ASMW.js +74 -0
  105. package/dist/{chunk-ADIJ6TLF.js → chunk-5FOJLJYN.js} +1 -1
  106. package/dist/{chunk-A2BL2EF6.js → chunk-5G3KASPV.js} +1 -1
  107. package/dist/{chunk-FXRXV6QH.js → chunk-5SBMYPWG.js} +1 -1
  108. package/dist/{chunk-WUCRLA25.js → chunk-5SMYKL3D.js} +9 -3
  109. package/dist/{chunk-NQKHOLC7.js → chunk-6S2Q4DGN.js} +1 -1
  110. package/dist/{chunk-LTNWLZLG.js → chunk-76LJUPDA.js} +2 -2
  111. package/dist/{chunk-ECTHM76P.js → chunk-7TLM7E5N.js} +2 -2
  112. package/dist/{chunk-5272PYQD.js → chunk-BBE656JU.js} +1 -1
  113. package/dist/{chunk-BM76TWJ7.js → chunk-CHB7T3PT.js} +4 -4
  114. package/dist/{chunk-XKU733RV.js → chunk-CJRWESDZ.js} +1 -1
  115. package/dist/{chunk-WIMKLLMH.js → chunk-CTIJTW4R.js} +1 -1
  116. package/dist/{chunk-MV56SO2V.js → chunk-D7NXK77P.js} +1 -1
  117. package/dist/{chunk-XR6IZOLT.js → chunk-DRI6OXWY.js} +1 -1
  118. package/dist/{chunk-E7NTBXXE.js → chunk-DTEDUAEW.js} +1 -1
  119. package/dist/{chunk-RG6X2EQP.js → chunk-DTZ72KVX.js} +2 -2
  120. package/dist/{chunk-TWNOYES7.js → chunk-GFOPTRRY.js} +1 -1
  121. package/dist/{chunk-PH5APLMB.js → chunk-GMQ54OQF.js} +1 -1
  122. package/dist/{chunk-TZNNLLXI.js → chunk-HHRYIXBM.js} +1 -1
  123. package/dist/{chunk-ETFBEHMH.js → chunk-J4OL6KHY.js} +1 -1
  124. package/dist/{chunk-VYUEAMA4.js → chunk-KDRJZWE3.js} +3 -1
  125. package/dist/{chunk-IW7EEYBS.js → chunk-KG3PHAUX.js} +2 -2
  126. package/dist/{chunk-GYLXJ6VC.js → chunk-KVNVLBCB.js} +1 -1
  127. package/dist/{chunk-EBIYEUE3.js → chunk-KYWIUH5R.js} +5 -5
  128. package/dist/{chunk-TDE6MUAQ.js → chunk-LGJJIPYZ.js} +1 -1
  129. package/dist/{chunk-XL6DTL36.js → chunk-M7EALYXZ.js} +1 -1
  130. package/dist/{chunk-L544S4UU.js → chunk-NOP55WRY.js} +107 -44
  131. package/dist/{chunk-WMLXOW7D.js → chunk-P366K4RX.js} +3 -2
  132. package/dist/{chunk-3ZIGF6LK.js → chunk-PBDMJHXV.js} +1 -1
  133. package/dist/chunk-PJV5HVZY.js +67 -0
  134. package/dist/{chunk-57SISFHX.js → chunk-PWB2LWBE.js} +1 -1
  135. package/dist/chunk-Q5LDZPFF.js +2 -0
  136. package/dist/{chunk-JLL7KQV5.js → chunk-QCJ3UBCZ.js} +1 -1
  137. package/dist/{chunk-YBPBSLGY.js → chunk-QHUKJN33.js} +3 -1
  138. package/dist/{chunk-3DUNIA3E.js → chunk-QLGZBN6A.js} +4 -4
  139. package/dist/{chunk-7ZIKXGIJ.js → chunk-QMEKGAEA.js} +2 -2
  140. package/dist/{chunk-TTQOKYTO.js → chunk-QVNEQSOL.js} +1 -1
  141. package/dist/{chunk-OTGWNFBE.js → chunk-RHD46WIZ.js} +1 -1
  142. package/dist/chunk-RNIPNSCH.js +158 -0
  143. package/dist/{chunk-4A75O7NL.js → chunk-RTDFRFTF.js} +8 -3
  144. package/dist/{chunk-6ZC2LPCM.js → chunk-SDYLFZKZ.js} +2 -2
  145. package/dist/{chunk-OIFITGYL.js → chunk-SJNJBXUA.js} +2 -2
  146. package/dist/{chunk-CJNSPA5F.js → chunk-STJPIP3R.js} +1 -1
  147. package/dist/{chunk-HKCOGDXN.js → chunk-TE3OMB3Z.js} +2 -28
  148. package/dist/{chunk-2DXZ2ZJR.js → chunk-TEOJ7OKD.js} +2 -2
  149. package/dist/{chunk-2SHRZ42G.js → chunk-TP7PRSGX.js} +1 -1
  150. package/dist/{chunk-YECS3C4D.js → chunk-V6BEBGO3.js} +2 -2
  151. package/dist/{chunk-LKBJE5J7.js → chunk-VZ42TS3C.js} +1 -1
  152. package/dist/{chunk-PZ4RVNSC.js → chunk-WEZU4DX2.js} +1 -1
  153. package/dist/{chunk-HKJTZG75.js → chunk-Y36N7TB7.js} +1 -1
  154. package/dist/{chunk-SRID7K37.js → chunk-Y3FLNQEE.js} +1 -1
  155. package/dist/{chunk-BHR72Z7M.js → chunk-YD5UCBFV.js} +1 -1
  156. package/dist/{chunk-MWKJEZBY.js → chunk-YE76GTQU.js} +2 -2
  157. package/dist/{chunk-SQSFVBDF.js → chunk-ZGJCVXFU.js} +1 -1
  158. package/dist/{chunk-PGMKJ4OD.js → chunk-ZJVGVTC3.js} +19 -5
  159. package/dist/chunk-ZLCPU4HW.js +17 -0
  160. package/dist/{chunk-EXYO45GN.js → chunk-ZUFV7753.js} +5 -4
  161. package/dist/generated/index.d.ts +1 -0
  162. package/dist/generated/index.js +76 -74
  163. package/dist/index.js +76 -74
  164. package/dist/styles.css +552 -71
  165. package/dist/utils/fieldMirror.d.ts +22 -0
  166. package/package.json +3 -3
  167. package/dist/ActivityLine-AMSERTOB.css +0 -74
  168. package/dist/EmojiPicker-W722WJ5M.css +0 -105
  169. package/dist/chunk-3KLVK655.js +0 -2
  170. package/dist/chunk-5YFQMMTJ.js +0 -29
  171. package/dist/chunk-VZ7DNXCW.js +0 -58
  172. package/dist/{chunk-LNQSNXGJ.js → chunk-S4JRQJEP.js} +1 -1
  173. /package/dist/{chunk-2DYEPDT7.js → chunk-XDBCWSM5.js} +0 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A hidden mirror of a text field: the styles that decide where its text
3
+ * wraps, and the caret's place measured on such a mirror. Shared by the
4
+ * Textarea's auto-resize and the mention list's caret anchor.
5
+ */
6
+ /** The text styles a mirror copies so it wraps exactly as the field does. */
7
+ export declare const MIRRORED_TEXT_STYLES: readonly ["boxSizing", "width", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth", "borderStyle", "direction", "fontFamily", "fontSize", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "letterSpacing", "lineHeight", "tabSize", "textIndent", "textTransform", "whiteSpace", "wordBreak", "wordSpacing", "overflowWrap"];
8
+ /** Copies a field's wrapping styles onto its mirror. */
9
+ export declare function copyTextStyles(from: CSSStyleDeclaration, to: HTMLElement): void;
10
+ /** Where a character of a text field starts: px from a box's left and top edges, and the line's height. */
11
+ export interface CaretPoint {
12
+ left: number;
13
+ top: number;
14
+ height: number;
15
+ }
16
+ /**
17
+ * Where character `index` of a text field starts, measured on a hidden mirror
18
+ * of the field that wraps its text the same way, less the field's scroll. In
19
+ * px from the field's border box, or from `relativeTo`'s when given (the box a
20
+ * `MentionMenu` is placed in, for its `anchor`).
21
+ */
22
+ export declare function caretPoint(field: HTMLTextAreaElement | HTMLInputElement, index: number, relativeTo?: Element): CaretPoint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/ui",
3
- "version": "0.111.0",
3
+ "version": "0.113.0",
4
4
  "description": "Crewlet shared React components built on @crewlethq/tokens and @crewlethq/icons.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,8 +42,8 @@
42
42
  "clean": "rm -rf dist src/generated"
43
43
  },
44
44
  "dependencies": {
45
- "@crewlethq/icons": "0.111.0",
46
- "@crewlethq/tokens": "0.111.0",
45
+ "@crewlethq/icons": "0.113.0",
46
+ "@crewlethq/tokens": "0.113.0",
47
47
  "prosemirror-commands": "1.7.2",
48
48
  "prosemirror-gapcursor": "1.4.1",
49
49
  "prosemirror-history": "1.5.1",
@@ -1,74 +0,0 @@
1
- /*
2
- * Who is typing and which agent is working, under a composer, in the meta
3
- * step and the tertiary ink.
4
- */
5
-
6
- .crewlet-activity-line {
7
- display: flex;
8
- flex-wrap: wrap;
9
- align-items: center;
10
- gap: var(--spacing-1) var(--spacing-4);
11
- min-height: 20px;
12
- min-width: 0;
13
- color: var(--color-text-tertiary);
14
- font-size: var(--crewlet-chat-meta);
15
- }
16
-
17
- /* No piece is wider than the line: a long working status truncates. */
18
- .crewlet-activity-line > * {
19
- max-width: 100%;
20
- }
21
-
22
- /* The working line in the line's own step, over the indicator's. */
23
- .crewlet-activity-line .crewlet-activity-line__working {
24
- font-size: var(--crewlet-chat-meta);
25
- }
26
-
27
- .crewlet-activity-line__typing {
28
- display: inline-flex;
29
- align-items: center;
30
- gap: var(--spacing-2);
31
- }
32
-
33
- .crewlet-activity-line__dots {
34
- display: inline-flex;
35
- gap: 2px;
36
- }
37
-
38
- .crewlet-activity-line__dots > i {
39
- width: 4px;
40
- height: 4px;
41
- border-radius: var(--radius-circle);
42
- background: currentColor;
43
- animation: crewlet-activity-line-typing calc(var(--motion-duration-slow) * 4) var(--motion-easing-in-out) infinite;
44
- }
45
-
46
- .crewlet-activity-line__dots > i:nth-child(2) {
47
- animation-delay: var(--motion-duration-base);
48
- }
49
-
50
- .crewlet-activity-line__dots > i:nth-child(3) {
51
- animation-delay: var(--motion-duration-slow);
52
- }
53
-
54
- @keyframes crewlet-activity-line-typing {
55
- 0%,
56
- 60%,
57
- 100% {
58
- opacity: 0.3;
59
- transform: none;
60
- }
61
-
62
- 30% {
63
- opacity: 1;
64
- transform: translateY(-2px);
65
- }
66
- }
67
-
68
- /* Under reduced motion the dots hold still at full strength: the words say
69
- who is typing. */
70
- @media (prefers-reduced-motion: reduce) {
71
- .crewlet-activity-line__dots > i {
72
- animation: none;
73
- }
74
- }
@@ -1,105 +0,0 @@
1
- /*
2
- * A searchable grid of emoji in a popover: the field, then each group under
3
- * its quiet heading, eight to a row, in a scroller of its own, and a preview
4
- * line under the grid that is always there, so the panel never changes size.
5
- */
6
-
7
- .crewlet-emoji-picker__body {
8
- display: flex;
9
- flex-direction: column;
10
- gap: var(--spacing-2);
11
- width: 296px;
12
- max-width: 100%;
13
- box-sizing: border-box;
14
- padding: var(--spacing-2);
15
- }
16
-
17
- .crewlet-emoji-picker__scroll {
18
- max-height: 240px;
19
- overflow-y: auto;
20
- overscroll-behavior: contain;
21
- }
22
-
23
- /* A group's heading, in the meta register at the regular weight. */
24
- .crewlet-emoji-picker__group {
25
- padding: var(--spacing-2) var(--spacing-1) var(--spacing-1);
26
- color: var(--color-text-tertiary);
27
- font-size: var(--font-size-2xs);
28
- font-weight: var(--font-weight-regular);
29
- letter-spacing: var(--font-letter-spacing-wide);
30
- text-transform: uppercase;
31
- }
32
-
33
- .crewlet-emoji-picker__grid {
34
- display: grid;
35
- grid-template-columns: repeat(var(--crewlet-emoji-picker-columns), minmax(0, 1fr));
36
- gap: 2px;
37
- }
38
-
39
- .crewlet-emoji-picker__cell {
40
- aspect-ratio: 1;
41
- padding: 0;
42
- border: 0;
43
- border-radius: var(--radius-sm);
44
- background: transparent;
45
- font-size: var(--font-size-lg);
46
- line-height: 1;
47
- cursor: pointer;
48
- }
49
-
50
- .crewlet-emoji-picker__cell:hover {
51
- background: var(--color-surface-hover);
52
- }
53
-
54
- /* The match Enter picks while searching: the accent's soft fill, which the
55
- pointer's step does not take away. */
56
- .crewlet-emoji-picker__cell.is-chosen {
57
- background: var(--color-brand-accent-soft);
58
- }
59
-
60
- .crewlet-emoji-picker__cell:focus-visible {
61
- background: var(--color-surface-hover);
62
- outline: 2px solid var(--color-focus);
63
- outline-offset: var(--size-focus-ring-inset-offset);
64
- }
65
-
66
- .crewlet-emoji-picker__preview {
67
- display: flex;
68
- align-items: center;
69
- gap: var(--spacing-2);
70
- min-height: var(--size-control-md);
71
- padding: var(--spacing-2) var(--spacing-1) 0;
72
- border-top: 1px solid var(--color-edge-hairline);
73
- }
74
-
75
- .crewlet-emoji-picker__preview-emoji {
76
- font-size: var(--font-size-xl);
77
- line-height: 1;
78
- }
79
-
80
- .crewlet-emoji-picker__preview-words {
81
- display: flex;
82
- flex-direction: column;
83
- min-width: 0;
84
- }
85
-
86
- .crewlet-emoji-picker__preview-name {
87
- overflow: hidden;
88
- color: var(--color-text-primary);
89
- font-size: var(--font-size-sm);
90
- font-weight: var(--font-weight-semibold);
91
- text-overflow: ellipsis;
92
- white-space: nowrap;
93
- }
94
-
95
- .crewlet-emoji-picker__preview-code,
96
- .crewlet-emoji-picker__preview-idle {
97
- color: var(--color-text-tertiary);
98
- font-size: var(--font-size-xs);
99
- }
100
-
101
- .crewlet-emoji-picker__none {
102
- margin: var(--spacing-3) var(--spacing-1);
103
- color: var(--color-text-tertiary);
104
- font-size: var(--font-size-sm);
105
- }
@@ -1,2 +0,0 @@
1
- import './ChatScale-6NM4TP7R.css';
2
- import './ChatMessage-5AMJCGZY.css';
@@ -1,29 +0,0 @@
1
- import { ThinkingIndicator } from './chunk-DX7ZHO47.js';
2
- import { cx } from './chunk-ODEQTPFM.js';
3
- import './ChatScale-6NM4TP7R.css';
4
- import './ActivityLine-AMSERTOB.css';
5
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
-
7
- function ActivityLine({ typing, working, workingLabel, queued, className, ...rest }) {
8
- return /* @__PURE__ */ jsxs("div", { ...rest, className: cx("crewlet-activity-line", className), children: [
9
- working ? /* @__PURE__ */ jsx(
10
- ThinkingIndicator,
11
- {
12
- status: working,
13
- label: workingLabel ?? working,
14
- queued,
15
- className: "crewlet-activity-line__working"
16
- }
17
- ) : null,
18
- /* @__PURE__ */ jsx("span", { className: "crewlet-activity-line__typing", role: "status", children: typing ? /* @__PURE__ */ jsxs(Fragment, { children: [
19
- /* @__PURE__ */ jsxs("span", { className: "crewlet-activity-line__dots", "aria-hidden": "true", children: [
20
- /* @__PURE__ */ jsx("i", {}),
21
- /* @__PURE__ */ jsx("i", {}),
22
- /* @__PURE__ */ jsx("i", {})
23
- ] }),
24
- typing
25
- ] }) : null })
26
- ] });
27
- }
28
-
29
- export { ActivityLine };
@@ -1,58 +0,0 @@
1
- import { PersonRow } from './chunk-XROJ6XQ3.js';
2
- import { cx } from './chunk-ODEQTPFM.js';
3
- import './PersonRow-3HOWUD6H.css';
4
- import './MentionMenu-77P7C4F7.css';
5
- import { jsx, jsxs } from 'react/jsx-runtime';
6
-
7
- var MENTION_MENU_LABELS = {
8
- hints: ["\u2191\u2193 to move", "Enter or Tab to choose", "Esc to close"]
9
- };
10
- function MentionMenu({
11
- id,
12
- label,
13
- options,
14
- active,
15
- onPick,
16
- onHover,
17
- listRef,
18
- keyed = true,
19
- footer,
20
- labels: overrides,
21
- className
22
- }) {
23
- const labels = overrides ? { ...MENTION_MENU_LABELS, ...overrides } : MENTION_MENU_LABELS;
24
- const foot = footer === void 0 ? /* @__PURE__ */ jsx("div", { className: "crewlet-mention-menu__footer", children: labels.hints.map((hint) => /* @__PURE__ */ jsx("span", { children: hint }, hint)) }) : footer === null ? null : /* @__PURE__ */ jsx("div", { className: "crewlet-mention-menu__footer", children: footer });
25
- return /* @__PURE__ */ jsxs("div", { className: cx("crewlet-mention-menu", !keyed && "crewlet-mention-menu--resting", className), children: [
26
- /* @__PURE__ */ jsx("div", { className: "crewlet-mention-menu__label", "aria-hidden": "true", children: label }),
27
- /* @__PURE__ */ jsx("ul", { ref: listRef, id, role: "listbox", "aria-label": label, className: "crewlet-mention-menu__list", children: options.map((option, index) => /* @__PURE__ */ jsx(
28
- PersonRow,
29
- {
30
- as: "option",
31
- id: `${id}-${index}`,
32
- density: "compact",
33
- avatar: option.mark,
34
- name: option.label,
35
- detail: option.detail,
36
- meta: option.note,
37
- selected: index === active,
38
- highlighted: index === active,
39
- onMouseDown: (event) => {
40
- event.preventDefault();
41
- onPick(option, index);
42
- },
43
- onMouseEnter: () => onHover(index)
44
- },
45
- option.id
46
- )) }),
47
- foot
48
- ] });
49
- }
50
- function mentionQuery(text, caret) {
51
- const before = text.slice(0, Math.max(0, Math.min(caret, text.length)));
52
- const match = /(^|\s)([@#])([\p{L}\p{N}_-]*)$/u.exec(before);
53
- if (!match) return null;
54
- const query = match[3] ?? "";
55
- return { trigger: match[2], query, start: before.length - query.length - 1 };
56
- }
57
-
58
- export { MENTION_MENU_LABELS, MentionMenu, mentionQuery };
@@ -1,5 +1,5 @@
1
- import { Avatar } from './chunk-XZY6S3UC.js';
2
1
  import { useRoving, tabStop } from './chunk-EGMQURBR.js';
2
+ import { Avatar } from './chunk-XZY6S3UC.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import { CREWLET_CHARACTERS, CREWLET_CHARACTER_GEOMETRY } from '@crewlethq/icons/characters';
5
5
  import { jsx } from 'react/jsx-runtime';
File without changes