@crewlethq/ui 0.18.0 → 0.20.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 (155) hide show
  1. package/README.md +40 -4
  2. package/dist/AccessDeniedCard/index.js +2 -2
  3. package/dist/AppShell/index.js +2 -2
  4. package/dist/ArrangeBoard/ArrangeBoard.d.ts +32 -0
  5. package/dist/ArrangeBoard/index.d.ts +3 -0
  6. package/dist/ArrangeBoard/index.js +2 -0
  7. package/dist/ArrangeBoard-MQE35P6Z.css +80 -0
  8. package/dist/ArrangeFrame/ArrangeFrame.d.ts +82 -0
  9. package/dist/ArrangeFrame/index.d.ts +5 -0
  10. package/dist/ArrangeFrame/index.js +5 -0
  11. package/dist/ArrangeFrame/useGridResize.d.ts +66 -0
  12. package/dist/ArrangeFrame-3PLZAG22.css +329 -0
  13. package/dist/ArrangeGroup/ArrangeGroup.d.ts +42 -0
  14. package/dist/ArrangeGroup/index.d.ts +3 -0
  15. package/dist/ArrangeGroup/index.js +4 -0
  16. package/dist/ArrangeGroup-SHFHA7BE.css +170 -0
  17. package/dist/ArrangeList/ArrangeList.d.ts +64 -0
  18. package/dist/ArrangeList/index.d.ts +3 -0
  19. package/dist/ArrangeList/index.js +10 -0
  20. package/dist/ArrangeList-NNRTDFI5.css +94 -0
  21. package/dist/ArtifactCard/index.js +2 -2
  22. package/dist/AuthLayout/index.js +2 -2
  23. package/dist/AvatarPicker/index.js +4 -4
  24. package/dist/Canvas/index.js +2 -2
  25. package/dist/Card/index.js +1 -1
  26. package/dist/Checkbox/index.js +3 -3
  27. package/dist/Combobox/index.js +4 -4
  28. package/dist/CommandPalette/index.js +6 -6
  29. package/dist/CommentThread/CommentThread.d.ts +85 -0
  30. package/dist/CommentThread/index.d.ts +3 -0
  31. package/dist/CommentThread/index.js +16 -0
  32. package/dist/CommentThread-7VXOFTZO.css +90 -0
  33. package/dist/Composer/index.js +3 -3
  34. package/dist/ConfirmField/index.js +3 -3
  35. package/dist/ConflictNote/ConflictNote.d.ts +42 -0
  36. package/dist/ConflictNote/index.d.ts +3 -0
  37. package/dist/ConflictNote/index.js +4 -0
  38. package/dist/ConflictNote-DH77PYF7.css +27 -0
  39. package/dist/DataTable/index.js +8 -8
  40. package/dist/DataView/index.js +13 -13
  41. package/dist/DateTimePicker/index.js +3 -3
  42. package/dist/DiffView/DiffView.d.ts +59 -0
  43. package/dist/DiffView/diff.d.ts +97 -0
  44. package/dist/DiffView/index.d.ts +5 -0
  45. package/dist/DiffView/index.js +3 -0
  46. package/dist/DiffView-RVLIHTKG.css +91 -0
  47. package/dist/Divider/Divider.d.ts +15 -0
  48. package/dist/Divider/index.d.ts +3 -0
  49. package/dist/Divider/index.js +2 -0
  50. package/dist/Divider-3Z77ZAJH.css +37 -0
  51. package/dist/HuePicker/HuePicker.d.ts +16 -4
  52. package/dist/HuePicker/index.js +2 -2
  53. package/dist/{HuePicker-5QIUR6L7.css → HuePicker-PAIGH6LR.css} +6 -0
  54. package/dist/IconTile/IconTile.d.ts +23 -0
  55. package/dist/IconTile/index.d.ts +3 -0
  56. package/dist/IconTile/index.js +2 -0
  57. package/dist/IconTile-4GNWTLAW.css +30 -0
  58. package/dist/Input/index.js +2 -2
  59. package/dist/LinkInterstitial/index.js +4 -4
  60. package/dist/ListInput/index.js +5 -5
  61. package/dist/MarkdownEditor/index.js +2 -2
  62. package/dist/Menu/index.js +2 -2
  63. package/dist/Modal/Modal.d.ts +20 -0
  64. package/dist/Modal/index.js +3 -3
  65. package/dist/{Modal-RQAYGG4L.css → Modal-XOSV6FAH.css} +14 -0
  66. package/dist/Note/Note.d.ts +23 -0
  67. package/dist/Note/index.d.ts +3 -0
  68. package/dist/Note/index.js +2 -0
  69. package/dist/Note-RT4L6VUT.css +58 -0
  70. package/dist/OrgTable/index.js +5 -5
  71. package/dist/PeopleRail/PeopleRail.d.ts +52 -0
  72. package/dist/PeopleRail/index.d.ts +3 -0
  73. package/dist/PeopleRail/index.js +11 -0
  74. package/dist/PeopleRail-R64WVOSH.css +75 -0
  75. package/dist/PinTile/PinTile.d.ts +37 -0
  76. package/dist/PinTile/index.d.ts +3 -0
  77. package/dist/PinTile/index.js +4 -0
  78. package/dist/PinTile-IIA25MNZ.css +141 -0
  79. package/dist/PresenceStack/index.js +1 -1
  80. package/dist/PrincipalPicker/index.js +5 -5
  81. package/dist/Reorder/index.d.ts +2 -0
  82. package/dist/Reorder/index.js +4 -0
  83. package/dist/Reorder/useReorder.d.ts +138 -0
  84. package/dist/ShareDialog/index.js +7 -7
  85. package/dist/SheetGrid/index.js +5 -5
  86. package/dist/StatGroup/StatGroup.d.ts +7 -1
  87. package/dist/StatGroup/index.js +1 -1
  88. package/dist/{StatGroup-HVG6O62W.css → StatGroup-PADTJCUQ.css} +7 -0
  89. package/dist/Switcher/index.js +8 -8
  90. package/dist/TableCells/TableCells.d.ts +153 -0
  91. package/dist/TableCells/index.d.ts +3 -0
  92. package/dist/TableCells/index.js +10 -0
  93. package/dist/TableCells-3VN5N2M3.css +104 -0
  94. package/dist/TagsInput/index.js +3 -3
  95. package/dist/TimeWindowPicker/index.js +5 -5
  96. package/dist/TreeCanvas/index.js +3 -3
  97. package/dist/TreeGrid/index.js +2 -2
  98. package/dist/VersionCompare/VersionCompare.d.ts +70 -0
  99. package/dist/VersionCompare/index.d.ts +3 -0
  100. package/dist/VersionCompare/index.js +11 -0
  101. package/dist/VersionCompare-UUZOPTQO.css +68 -0
  102. package/dist/chunk-35XVR5JQ.js +81 -0
  103. package/dist/chunk-63WJLRB2.js +24 -0
  104. package/dist/{chunk-L4ZLXYPO.js → chunk-6A7P6II6.js} +1 -1
  105. package/dist/chunk-6KWNXIDE.js +18 -0
  106. package/dist/chunk-6MIXD6IW.js +49 -0
  107. package/dist/chunk-73QBUUYX.js +102 -0
  108. package/dist/{chunk-NZY77ZDU.js → chunk-7FQEUNHX.js} +4 -4
  109. package/dist/{chunk-2TZATTIU.js → chunk-7IJARUIF.js} +18 -5
  110. package/dist/{chunk-A7EBCHEG.js → chunk-A4VMJMXJ.js} +1 -1
  111. package/dist/chunk-AIVZVKYZ.js +126 -0
  112. package/dist/{chunk-76FXDZAZ.js → chunk-AJESMWJS.js} +4 -4
  113. package/dist/chunk-BVWSLXTY.js +187 -0
  114. package/dist/chunk-DEJHAOC5.js +279 -0
  115. package/dist/{chunk-ERV5BUS3.js → chunk-EIGEIT4O.js} +3 -3
  116. package/dist/chunk-EZBLOUWX.js +176 -0
  117. package/dist/chunk-FFMCMSJB.js +1 -0
  118. package/dist/{chunk-LFZ45HV2.js → chunk-G3EEUNZQ.js} +1 -1
  119. package/dist/{chunk-2YR5ZPQ3.js → chunk-HTCJSUIZ.js} +3 -3
  120. package/dist/{chunk-75CLJNDQ.js → chunk-I6NZKJGK.js} +1 -1
  121. package/dist/chunk-IXJHTFXG.js +17 -0
  122. package/dist/{chunk-3UAA4IWJ.js → chunk-JEDWC3GI.js} +1 -1
  123. package/dist/{chunk-QVAFL2LE.js → chunk-JXRI5YD2.js} +3 -3
  124. package/dist/{chunk-ZFH7H7GS.js → chunk-LOLELDBW.js} +1 -1
  125. package/dist/chunk-MUGM7SEG.js +88 -0
  126. package/dist/chunk-N4GFRW5C.js +96 -0
  127. package/dist/{chunk-KVT3TJVG.js → chunk-OIMAK5AE.js} +6 -6
  128. package/dist/chunk-QO7QEQKV.js +24 -0
  129. package/dist/{chunk-BOW2VUCH.js → chunk-T7ICFXEC.js} +1 -1
  130. package/dist/{chunk-2OLCUNG7.js → chunk-TBIZSQHB.js} +1 -1
  131. package/dist/{chunk-4U3GQ7D2.js → chunk-TODND5AD.js} +1 -1
  132. package/dist/chunk-UO7JZVCO.js +35 -0
  133. package/dist/{chunk-IFKBDRNJ.js → chunk-UXELEORU.js} +3 -3
  134. package/dist/{chunk-6NIMZ5XC.js → chunk-VJLYGPPE.js} +1 -1
  135. package/dist/{chunk-7QFAORCY.js → chunk-WHZFDS62.js} +1 -1
  136. package/dist/chunk-XJ2QEBMM.js +277 -0
  137. package/dist/{chunk-PA4CYTBY.js → chunk-XU4ZUGLE.js} +19 -4
  138. package/dist/{chunk-T3ZWBZ65.js → chunk-YSJYWQSP.js} +2 -2
  139. package/dist/{chunk-CXBAIVYZ.js → chunk-YSY6UJ4F.js} +1 -1
  140. package/dist/{chunk-EG6NYWVK.js → chunk-YZCJ63JF.js} +1 -1
  141. package/dist/generated/index.d.ts +15 -0
  142. package/dist/generated/index.js +89 -74
  143. package/dist/index.js +89 -74
  144. package/dist/styles.css +1533 -70
  145. package/package.json +3 -3
  146. package/dist/chunk-EXHQ2QVW.js +0 -1
  147. package/dist/{chunk-AQCV62K6.js → chunk-7ZNKEPLN.js} +1 -1
  148. package/dist/{chunk-OYOQU7O5.js → chunk-EDGCPVVD.js} +1 -1
  149. package/dist/{chunk-FYXRWBJJ.js → chunk-J2G4HGQM.js} +1 -1
  150. package/dist/{chunk-NS7BVLL3.js → chunk-JULMZNGT.js} +1 -1
  151. package/dist/{chunk-5NVKTB6E.js → chunk-L4H7SSWF.js} +1 -1
  152. package/dist/{chunk-ESKP3TXM.js → chunk-MSSZHDZI.js} +0 -0
  153. package/dist/{chunk-4GB57WIT.js → chunk-Q55TXPA3.js} +1 -1
  154. package/dist/{chunk-B2Z2CDM5.js → chunk-T5TFZ2JB.js} +1 -1
  155. package/dist/{chunk-AMH67MLM.js → chunk-TXAFKH2A.js} +1 -1
@@ -0,0 +1,96 @@
1
+ import { PRESENCE_LABELS, presenceOrder, collapseSessions } from './chunk-S35G6PNC.js';
2
+ import { Button } from './chunk-OG6CL3EB.js';
3
+ import { Avatar } from './chunk-5OM447RW.js';
4
+ import { headingTag, useHeadingLevel } from './chunk-PQADV6P6.js';
5
+ import { IconButton } from './chunk-4FQT6ZAY.js';
6
+ import { cx } from './chunk-ODEQTPFM.js';
7
+ import './PeopleRail-R64WVOSH.css';
8
+ import { useId } from 'react';
9
+ import { isCrewletCharacter } from '@crewlethq/icons/characters';
10
+ import { XGlyph } from '@crewlethq/icons/glyphs';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
12
+
13
+ var PEOPLE_RAIL_LABELS = {
14
+ title: "People here",
15
+ close: "Close people",
16
+ you: "You",
17
+ nobody: "Nobody else is here right now.",
18
+ follow: "Follow",
19
+ following: "Following",
20
+ followName: (name) => `Follow ${name}`,
21
+ stopFollowingName: (name) => `Stop following ${name}`,
22
+ activity: PRESENCE_LABELS.activity
23
+ };
24
+ function peopleRailKey(member) {
25
+ return member.seat ?? member.id;
26
+ }
27
+ function PeopleRail({
28
+ members,
29
+ self,
30
+ following,
31
+ onFollow,
32
+ onClose,
33
+ actions,
34
+ labels: overrides,
35
+ className
36
+ }) {
37
+ const labels = overrides ? { ...PEOPLE_RAIL_LABELS, ...overrides } : PEOPLE_RAIL_LABELS;
38
+ const headingID = useId();
39
+ const Heading = headingTag(useHeadingLevel());
40
+ const others = presenceOrder(collapseSessions(members));
41
+ return /* @__PURE__ */ jsxs("aside", { className: cx("crewlet-people-rail", className), "aria-labelledby": headingID, children: [
42
+ /* @__PURE__ */ jsxs("div", { className: "crewlet-people-rail__head", children: [
43
+ /* @__PURE__ */ jsx(Heading, { className: "crewlet-people-rail__title", id: headingID, children: labels.title }),
44
+ onClose && /* @__PURE__ */ jsx(IconButton, { size: "sm", variant: "ghost", label: labels.close, icon: /* @__PURE__ */ jsx(XGlyph, { size: "sm" }), onClick: onClose })
45
+ ] }),
46
+ /* @__PURE__ */ jsxs("ul", { role: "list", className: "crewlet-people-rail__list", children: [
47
+ self && /* @__PURE__ */ jsxs("li", { className: "crewlet-people-rail__person", children: [
48
+ /* @__PURE__ */ jsx(PresenceBadge, { member: self }),
49
+ /* @__PURE__ */ jsx("span", { className: "crewlet-people-rail__text", children: /* @__PURE__ */ jsx("span", { className: "crewlet-people-rail__name", children: labels.you }) })
50
+ ] }),
51
+ others.map((member) => {
52
+ const key = peopleRailKey(member);
53
+ const followed = following !== void 0 && following === key;
54
+ const extra = actions?.(member);
55
+ return /* @__PURE__ */ jsxs("li", { className: "crewlet-people-rail__person", children: [
56
+ /* @__PURE__ */ jsx(PresenceBadge, { member }),
57
+ /* @__PURE__ */ jsxs("span", { className: "crewlet-people-rail__text", children: [
58
+ /* @__PURE__ */ jsx("span", { className: "crewlet-people-rail__name", children: member.name }),
59
+ /* @__PURE__ */ jsx("span", { className: "crewlet-people-rail__where", children: member.location ?? labels.activity(member.activity, member.kind) })
60
+ ] }),
61
+ extra !== void 0 && extra !== null || onFollow ? /* @__PURE__ */ jsxs("span", { className: "crewlet-people-rail__actions", children: [
62
+ extra,
63
+ onFollow && /* @__PURE__ */ jsx(
64
+ Button,
65
+ {
66
+ size: "small",
67
+ variant: followed ? "primary" : "secondary",
68
+ pressed: followed,
69
+ "aria-label": followed ? labels.stopFollowingName(member.name) : labels.followName(member.name),
70
+ onClick: () => onFollow(followed ? null : member),
71
+ children: followed ? labels.following : labels.follow
72
+ }
73
+ )
74
+ ] }) : null
75
+ ] }, key);
76
+ })
77
+ ] }),
78
+ others.length === 0 && /* @__PURE__ */ jsx("p", { className: "crewlet-people-rail__note", children: labels.nobody })
79
+ ] });
80
+ }
81
+ function PresenceBadge({ member }) {
82
+ return /* @__PURE__ */ jsx(
83
+ Avatar,
84
+ {
85
+ name: member.name,
86
+ kind: member.kind,
87
+ src: member.src,
88
+ character: member.character !== void 0 && isCrewletCharacter(member.character) ? member.character : void 0,
89
+ hue: member.kind === "agent" ? member.hue : void 0,
90
+ size: "sm",
91
+ decorative: true
92
+ }
93
+ );
94
+ }
95
+
96
+ export { PEOPLE_RAIL_LABELS, PeopleRail, peopleRailKey };
@@ -1,16 +1,16 @@
1
1
  import { PageHeader } from './chunk-HOXGBLEY.js';
2
2
  import { Toolbar } from './chunk-PGRPNDWM.js';
3
- import { DataTable } from './chunk-76FXDZAZ.js';
4
- import { Menu } from './chunk-NS7BVLL3.js';
5
- import { DateTimePicker } from './chunk-5NVKTB6E.js';
3
+ import { DataTable } from './chunk-AJESMWJS.js';
4
+ import { Menu } from './chunk-JULMZNGT.js';
5
+ import { DateTimePicker } from './chunk-L4H7SSWF.js';
6
6
  import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
7
7
  import { Kbd } from './chunk-SMBKXWML.js';
8
- import { Input } from './chunk-4GB57WIT.js';
9
- import { Popover } from './chunk-BWRGFKJP.js';
10
8
  import { Button } from './chunk-OG6CL3EB.js';
11
- import { IconButton } from './chunk-4FQT6ZAY.js';
9
+ import { Input } from './chunk-Q55TXPA3.js';
12
10
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
11
+ import { Popover } from './chunk-BWRGFKJP.js';
13
12
  import { Count } from './chunk-BHHIIK3M.js';
13
+ import { IconButton } from './chunk-4FQT6ZAY.js';
14
14
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
15
15
  import { cx } from './chunk-ODEQTPFM.js';
16
16
  import './DataView-N6JX464S.css';
@@ -0,0 +1,24 @@
1
+ import { cx } from './chunk-ODEQTPFM.js';
2
+ import './ArrangeBoard-MQE35P6Z.css';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function ArrangeBoard({
6
+ editing,
7
+ columns = 12,
8
+ className,
9
+ style,
10
+ children,
11
+ ...rest
12
+ }) {
13
+ return /* @__PURE__ */ jsx(
14
+ "div",
15
+ {
16
+ className: cx("crewlet-arrange-board", editing && "is-editing", className),
17
+ style: { ...style, "--crewlet-arrange-board-columns": columns },
18
+ ...rest,
19
+ children
20
+ }
21
+ );
22
+ }
23
+
24
+ export { ArrangeBoard };
@@ -1,4 +1,4 @@
1
- import { HuePicker } from './chunk-PA4CYTBY.js';
1
+ import { HuePicker } from './chunk-XU4ZUGLE.js';
2
2
  import { Popover } from './chunk-BWRGFKJP.js';
3
3
  import { NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
4
4
  import { CharacterPicker } from './chunk-5PSXBL73.js';
@@ -1,5 +1,5 @@
1
1
  import { useTreeState, useMeasuredSizes, layoutForest, treeAncestors, useLayoutAnchor, treeExpandable, layoutConnectors, treeItemAction, treeStep, treePosInSet, treeSetSize, treeLevel, placeGroups } from './chunk-MY374UUD.js';
2
- import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-AMH67MLM.js';
2
+ import { CANVAS_COMPOSE_CONTEXT, CANVAS_FIT_MAX_ZOOM, Canvas } from './chunk-TXAFKH2A.js';
3
3
  import { focusables } from './chunk-R25RGPUB.js';
4
4
  import { cx } from './chunk-ODEQTPFM.js';
5
5
  import './TreeCanvas-L2XYONWL.css';
@@ -1,7 +1,7 @@
1
1
  import { PrincipalAvatar } from './chunk-4KP4RC3O.js';
2
2
  import { RelativeTime } from './chunk-3CZ7XAVY.js';
3
3
  import { AvatarStack } from './chunk-UAN5NE7M.js';
4
- import { Card } from './chunk-EG6NYWVK.js';
4
+ import { Card } from './chunk-YZCJ63JF.js';
5
5
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
7
  import './ArtifactCard-EXVAEBV6.css';
@@ -0,0 +1,35 @@
1
+ import { Button } from './chunk-OG6CL3EB.js';
2
+ import { cx } from './chunk-ODEQTPFM.js';
3
+ import './ConflictNote-DH77PYF7.css';
4
+ import { CircleAlertGlyph } from '@crewlethq/icons/glyphs';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+
7
+ var CONFLICT_NOTE_LABELS = {
8
+ changedBy: (subject, name) => `${subject} was changed by ${name} since you opened it. Look again, then retry.`,
9
+ changed: (subject) => `${subject} was changed since you opened it. Look again, then retry.`,
10
+ dismiss: "Dismiss"
11
+ };
12
+ function ConflictNote({
13
+ subject,
14
+ changedBy,
15
+ message,
16
+ onDismiss,
17
+ actions,
18
+ labels: overrides,
19
+ className,
20
+ ...rest
21
+ }) {
22
+ const labels = overrides ? { ...CONFLICT_NOTE_LABELS, ...overrides } : CONFLICT_NOTE_LABELS;
23
+ const named = changedBy !== void 0 && changedBy !== "";
24
+ const sentence = named ? labels.changedBy(subject, changedBy) : message ?? labels.changed(subject);
25
+ return /* @__PURE__ */ jsxs("div", { ...rest, role: "alert", className: cx("crewlet-conflict-note", className), children: [
26
+ /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm", className: "crewlet-conflict-note__glyph" }),
27
+ /* @__PURE__ */ jsx("span", { className: "crewlet-conflict-note__text", children: sentence }),
28
+ (actions !== void 0 || onDismiss) && /* @__PURE__ */ jsxs("span", { className: "crewlet-conflict-note__actions", children: [
29
+ actions,
30
+ onDismiss && /* @__PURE__ */ jsx(Button, { size: "small", variant: "ghost", onClick: onDismiss, children: labels.dismiss })
31
+ ] })
32
+ ] });
33
+ }
34
+
35
+ export { CONFLICT_NOTE_LABELS, ConflictNote };
@@ -1,9 +1,9 @@
1
- import { Modal } from './chunk-2TZATTIU.js';
1
+ import { Modal } from './chunk-7IJARUIF.js';
2
2
  import { useListbox, useHighlightRest } from './chunk-F73MC7EZ.js';
3
3
  import { Kbd } from './chunk-SMBKXWML.js';
4
- import { Input } from './chunk-4GB57WIT.js';
5
- import { isComposing } from './chunk-R25RGPUB.js';
4
+ import { Input } from './chunk-Q55TXPA3.js';
6
5
  import { Count } from './chunk-BHHIIK3M.js';
6
+ import { isComposing } from './chunk-R25RGPUB.js';
7
7
  import { VisuallyHidden } from './chunk-BZFWDIV6.js';
8
8
  import { cx } from './chunk-ODEQTPFM.js';
9
9
  import './CommandPalette-HBTNKHZQ.css';
@@ -1,5 +1,5 @@
1
1
  import { Kbd } from './chunk-SMBKXWML.js';
2
- import { Textarea } from './chunk-4GB57WIT.js';
2
+ import { Textarea } from './chunk-Q55TXPA3.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './Composer-ABGJIAIR.css';
5
5
  import { forwardRef } from 'react';
@@ -1,5 +1,5 @@
1
1
  import { BrandLockup } from './chunk-7KBNFFM3.js';
2
- import { Card } from './chunk-EG6NYWVK.js';
2
+ import { Card } from './chunk-YZCJ63JF.js';
3
3
  import { cx } from './chunk-ODEQTPFM.js';
4
4
  import './AuthLayout-ODHBUPHQ.css';
5
5
  import { useId } from 'react';
@@ -0,0 +1,277 @@
1
+ import { announce } from './chunk-RSAQOKH3.js';
2
+ import { useId, useState, useRef, useCallback, useLayoutEffect, useMemo } from 'react';
3
+
4
+ var DEFAULT_REORDER_LABELS = {
5
+ handle: (name) => `Move ${name}`,
6
+ hint: "Drag to move, or press the arrow keys.",
7
+ moved: (name, position, total) => `${name} moved to position ${position} of ${total}.`
8
+ };
9
+ function moveKey(keys, key, to) {
10
+ const next = keys.filter((k) => k !== key);
11
+ next.splice(Math.max(0, Math.min(to, next.length)), 0, key);
12
+ return next;
13
+ }
14
+ function listOf(lists, key) {
15
+ for (const [id, keys] of Object.entries(lists)) if (keys.includes(key)) return id;
16
+ return null;
17
+ }
18
+ function place(lists, key, list, index) {
19
+ const next = {};
20
+ for (const [id, keys] of Object.entries(lists)) next[id] = keys.filter((k) => k !== key);
21
+ const target = next[list] ?? [];
22
+ target.splice(Math.max(0, Math.min(index, target.length)), 0, key);
23
+ next[list] = target;
24
+ return next;
25
+ }
26
+ var SETTLE_MS = 200;
27
+ var settleMs = () => typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? 20 : SETTLE_MS;
28
+ var now = () => typeof performance !== "undefined" ? performance.now() : Date.now();
29
+ function byRows(node, axis) {
30
+ if (axis === "vertical") return true;
31
+ const row = node.parentElement?.getBoundingClientRect();
32
+ return row !== void 0 && node.getBoundingClientRect().width > row.width * 0.75;
33
+ }
34
+ var lineOf = (node, axis) => byRows(node, axis) ? "horizontal" : "vertical";
35
+ function inEarlierHalf(node, axis, x, y) {
36
+ const r = node.getBoundingClientRect();
37
+ return byRows(node, axis) ? y < r.top + r.height / 2 : x < r.left + r.width / 2;
38
+ }
39
+ function lastOf(keys, except) {
40
+ const rest = (keys ?? []).filter((k) => k !== except);
41
+ return rest[rest.length - 1];
42
+ }
43
+ var sameLists = (a, b) => JSON.stringify(a) === JSON.stringify(b);
44
+ var PREVIOUS = {
45
+ vertical: ["ArrowUp"],
46
+ grid: ["ArrowUp", "ArrowLeft"]
47
+ };
48
+ var NEXT = {
49
+ vertical: ["ArrowDown"],
50
+ grid: ["ArrowDown", "ArrowRight"]
51
+ };
52
+ function useReorderLists({
53
+ lists,
54
+ onReorder,
55
+ nameOf,
56
+ accepts,
57
+ axis = "vertical",
58
+ labels: labelOverrides
59
+ }) {
60
+ const labels = { ...DEFAULT_REORDER_LABELS, ...labelOverrides };
61
+ const hintId = `${useId()}-reorder-hint`;
62
+ const [dragging, setDragging] = useState(null);
63
+ const [preview, setPreview] = useState(null);
64
+ const [target, setTarget] = useState(
65
+ null
66
+ );
67
+ const shown = preview ?? lists;
68
+ const nodes = useRef(/* @__PURE__ */ new Map());
69
+ const before = useRef(/* @__PURE__ */ new Map());
70
+ const measure = useCallback(() => {
71
+ before.current = /* @__PURE__ */ new Map();
72
+ for (const [key, node] of nodes.current) {
73
+ for (const a of node.getAnimations?.() ?? []) a.finish();
74
+ before.current.set(key, node.getBoundingClientRect());
75
+ }
76
+ }, []);
77
+ const shape = JSON.stringify(shown);
78
+ useLayoutEffect(() => {
79
+ const last = before.current;
80
+ before.current = /* @__PURE__ */ new Map();
81
+ if (last.size === 0) return;
82
+ if (typeof window === "undefined" || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
83
+ for (const [key, node] of nodes.current) {
84
+ const was = last.get(key);
85
+ if (!was) continue;
86
+ const now2 = node.getBoundingClientRect();
87
+ const dx = was.left - now2.left;
88
+ const dy = was.top - now2.top;
89
+ if (dx === 0 && dy === 0) continue;
90
+ node.animate?.([{ transform: `translate(${dx}px, ${dy}px)` }, { transform: "translate(0, 0)" }], {
91
+ duration: 180,
92
+ easing: "cubic-bezier(0.2, 0, 0, 1)"
93
+ });
94
+ }
95
+ }, [shape]);
96
+ const said = useRef(labels.moved);
97
+ said.current = labels.moved;
98
+ const commit = useCallback(
99
+ (next, moved) => {
100
+ onReorder(next);
101
+ const list = listOf(next, moved);
102
+ const keys = list ? next[list] ?? [] : [];
103
+ announce(said.current(nameOf(moved), keys.indexOf(moved) + 1, keys.length));
104
+ },
105
+ [onReorder, nameOf]
106
+ );
107
+ const move = useCallback(
108
+ (key, by) => {
109
+ const list = listOf(lists, key);
110
+ if (list === null) return;
111
+ const keys = lists[list] ?? [];
112
+ const at = keys.indexOf(key);
113
+ const to = Math.max(0, Math.min(keys.length - 1, at + by));
114
+ if (to === at) return;
115
+ measure();
116
+ commit(place(lists, key, list, to), key);
117
+ },
118
+ [lists, measure, commit]
119
+ );
120
+ const moveTo = useCallback(
121
+ (key, list) => {
122
+ if (listOf(lists, key) === list) return;
123
+ if (accepts && !accepts(key, list)) return;
124
+ measure();
125
+ commit(place(lists, key, list, (lists[list] ?? []).length), key);
126
+ },
127
+ [lists, accepts, measure, commit]
128
+ );
129
+ const settled = useRef(0);
130
+ const insertionPoint = (list, moved, x, y) => {
131
+ let last;
132
+ for (const k of preview?.[list] ?? []) {
133
+ if (k === moved) continue;
134
+ const node = nodes.current.get(k);
135
+ if (!node) continue;
136
+ last = node;
137
+ const r = node.getBoundingClientRect();
138
+ if (y < r.top || y <= r.bottom && inEarlierHalf(node, axis, x, y)) {
139
+ return { list, before: k, line: lineOf(node, axis) };
140
+ }
141
+ }
142
+ return { list, before: null, line: last ? lineOf(last, axis) : "vertical" };
143
+ };
144
+ const aim = (list, moved, x, y) => {
145
+ const next = insertionPoint(list, moved, x, y);
146
+ if (target?.list !== next.list || target.before !== next.before || target.line !== next.line) setTarget(next);
147
+ };
148
+ const reset = () => {
149
+ setDragging(null);
150
+ setPreview(null);
151
+ setTarget(null);
152
+ settled.current = 0;
153
+ };
154
+ const drop = (event) => {
155
+ if (dragging === null || !preview) return;
156
+ event.preventDefault();
157
+ event.stopPropagation();
158
+ const moved = dragging;
159
+ let next = preview;
160
+ if (target) {
161
+ const keys = (preview[target.list] ?? []).filter((k) => k !== moved);
162
+ const at = target.before === null ? keys.length : keys.indexOf(target.before);
163
+ next = place(preview, moved, target.list, at < 0 ? keys.length : at);
164
+ }
165
+ reset();
166
+ if (!sameLists(next, lists)) {
167
+ measure();
168
+ commit(next, moved);
169
+ }
170
+ };
171
+ const handleProps = (key) => ({
172
+ draggable: true,
173
+ "aria-label": labels.handle(nameOf(key)),
174
+ "aria-describedby": hintId,
175
+ onDragStart: (event) => {
176
+ event.stopPropagation();
177
+ event.dataTransfer.effectAllowed = "move";
178
+ event.dataTransfer.setData("text/plain", nameOf(key));
179
+ const node = nodes.current.get(key);
180
+ if (node) event.dataTransfer.setDragImage(node, 24, 16);
181
+ setDragging(key);
182
+ setPreview(Object.fromEntries(Object.entries(lists).map(([id, keys]) => [id, [...keys]])));
183
+ },
184
+ // Whatever ended the drag, the preview goes: a drop has already committed.
185
+ onDragEnd: reset,
186
+ onKeyDown: (event) => {
187
+ if (event.altKey || event.ctrlKey || event.metaKey) return;
188
+ const by = PREVIOUS[axis].includes(event.key) ? -1 : NEXT[axis].includes(event.key) ? 1 : 0;
189
+ if (by === 0) return;
190
+ event.preventDefault();
191
+ event.stopPropagation();
192
+ move(key, by);
193
+ }
194
+ });
195
+ const markerOf = (key) => {
196
+ if (!target) return {};
197
+ const edge = target.before === key ? "before" : target.before === null && lastOf(preview?.[target.list], dragging) === key ? "after" : void 0;
198
+ return edge ? { "data-reorder-target": edge, "data-reorder-line": target.line } : {};
199
+ };
200
+ const itemProps = (key) => ({
201
+ ref: (node) => {
202
+ if (node) nodes.current.set(key, node);
203
+ else nodes.current.delete(key);
204
+ },
205
+ "data-reorder": dragging === key ? "dragging" : "idle",
206
+ ...markerOf(key),
207
+ onDragOver: (event) => {
208
+ if (dragging === null || !preview) return;
209
+ const list = listOf(preview, key);
210
+ if (list === null) return;
211
+ if (accepts && !accepts(dragging, list)) return;
212
+ event.preventDefault();
213
+ event.stopPropagation();
214
+ event.dataTransfer.dropEffect = "move";
215
+ if (key === dragging) return;
216
+ if (listOf(preview, dragging) !== list) {
217
+ aim(list, dragging, event.clientX, event.clientY);
218
+ return;
219
+ }
220
+ if (target) setTarget(null);
221
+ if (now() < settled.current) return;
222
+ const keys = preview[list] ?? [];
223
+ const from = keys.indexOf(dragging);
224
+ const to = keys.indexOf(key);
225
+ if (from === to) return;
226
+ const early = inEarlierHalf(event.currentTarget, axis, event.clientX, event.clientY);
227
+ if (from < to && early) return;
228
+ if (from > to && !early) return;
229
+ measure();
230
+ setPreview(place(preview, dragging, list, to));
231
+ settled.current = now() + settleMs();
232
+ },
233
+ onDrop: drop
234
+ });
235
+ const listProps = (list) => ({
236
+ // Lit only when the item would move INTO this list: reordering within a
237
+ // list is already shown by the items moving.
238
+ "data-reorder-over": dragging !== null && target?.list === list ? "true" : void 0,
239
+ onDragOver: (event) => {
240
+ if (dragging === null || !preview) return;
241
+ if (accepts && !accepts(dragging, list)) return;
242
+ event.preventDefault();
243
+ event.stopPropagation();
244
+ if (listOf(preview, dragging) === list) {
245
+ if (target) setTarget(null);
246
+ return;
247
+ }
248
+ aim(list, dragging, event.clientX, event.clientY);
249
+ },
250
+ onDrop: drop
251
+ });
252
+ return { lists: shown, dragging, handleProps, itemProps, listProps, move, moveTo, hintId, hint: labels.hint };
253
+ }
254
+ var ONLY = "list";
255
+ function useReorder({
256
+ keys,
257
+ onReorder,
258
+ nameOf,
259
+ axis,
260
+ labels
261
+ }) {
262
+ const lists = useMemo(() => ({ [ONLY]: keys }), [keys]);
263
+ const report = useCallback((next) => onReorder(next[ONLY] ?? []), [onReorder]);
264
+ const r = useReorderLists({ lists, onReorder: report, nameOf, axis, labels });
265
+ return {
266
+ order: r.lists[ONLY] ?? [],
267
+ dragging: r.dragging,
268
+ handleProps: r.handleProps,
269
+ itemProps: r.itemProps,
270
+ containerProps: r.listProps(ONLY),
271
+ move: r.move,
272
+ hintId: r.hintId,
273
+ hint: r.hint
274
+ };
275
+ }
276
+
277
+ export { DEFAULT_REORDER_LABELS, moveKey, useReorder, useReorderLists };
@@ -11,16 +11,31 @@ var optionsFor = (disabled) => NODE_HUES.map((hue) => ({
11
11
  }));
12
12
  var ENABLED = optionsFor(false);
13
13
  var DISABLED = optionsFor(true);
14
- function HuePicker({ label, value, onValueChange, size, disabled = false, className }) {
14
+ function HuePicker(props) {
15
+ const { label, size, disabled = false, className } = props;
16
+ const hues = disabled ? DISABLED : ENABLED;
17
+ const options = props.none === void 0 ? hues : [
18
+ {
19
+ value: "none",
20
+ label: props.none,
21
+ icon: /* @__PURE__ */ jsx("span", { className: "crewlet-hue-picker__swatch crewlet-hue-picker__swatch--none" }),
22
+ disabled
23
+ },
24
+ ...hues
25
+ ];
15
26
  return /* @__PURE__ */ jsx(
16
27
  SegmentedControl,
17
28
  {
18
29
  semantics: "radio",
19
30
  layout: "chips",
20
31
  label,
21
- options: disabled ? DISABLED : ENABLED,
22
- value,
23
- onValueChange,
32
+ options,
33
+ value: props.value,
34
+ onValueChange: (next) => {
35
+ if (props.none === void 0) {
36
+ if (next !== "none") props.onValueChange(next);
37
+ } else props.onValueChange(next);
38
+ },
24
39
  size,
25
40
  className: cx("crewlet-hue-picker", className)
26
41
  }
@@ -1,8 +1,8 @@
1
1
  import { Kbd } from './chunk-SMBKXWML.js';
2
- import { FormField, Textarea, Input } from './chunk-4GB57WIT.js';
2
+ import { FormField, Textarea, Input } from './chunk-Q55TXPA3.js';
3
+ import { isComposing } from './chunk-R25RGPUB.js';
3
4
  import { announce } from './chunk-RSAQOKH3.js';
4
5
  import { IconButton } from './chunk-4FQT6ZAY.js';
5
- import { isComposing } from './chunk-R25RGPUB.js';
6
6
  import './ListInput-O7LJKOIG.css';
7
7
  import { useState, useRef, useLayoutEffect } from 'react';
8
8
  import { ArrowUpGlyph, ArrowDownGlyph, XGlyph, PlusGlyph } from '@crewlethq/icons/glyphs';
@@ -1,5 +1,5 @@
1
1
  import { InlineCode } from './chunk-5CLW2CXT.js';
2
- import { FormField, Input } from './chunk-4GB57WIT.js';
2
+ import { FormField, Input } from './chunk-Q55TXPA3.js';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
 
5
5
  function confirmMatches(typed, phrase) {
@@ -101,7 +101,7 @@ var CardRoot = ({
101
101
  },
102
102
  flush
103
103
  );
104
- const content = flush ? withBodies(slots.nodes, contentPadding) : children;
104
+ const content = flush ? withBodies(slots.nodes, contentPadding) : inner;
105
105
  const [chromeNode, setChromeNode] = useState(null);
106
106
  const chromeHolder = useRef(null);
107
107
  const hostChrome = useCallback((node) => setChromeNode(node), []);
@@ -3,6 +3,10 @@ export * from '../Accordion/index.js';
3
3
  export * from '../AddPill/index.js';
4
4
  export * from '../Announcer/index.js';
5
5
  export * from '../AppShell/index.js';
6
+ export * from '../ArrangeBoard/index.js';
7
+ export * from '../ArrangeFrame/index.js';
8
+ export * from '../ArrangeGroup/index.js';
9
+ export * from '../ArrangeList/index.js';
6
10
  export * from '../ArtifactCard/index.js';
7
11
  export * from '../AuthLayout/index.js';
8
12
  export * from '../Avatar/index.js';
@@ -23,8 +27,10 @@ export * from '../ChoiceList/index.js';
23
27
  export * from '../CodeBlock/index.js';
24
28
  export * from '../Combobox/index.js';
25
29
  export * from '../CommandPalette/index.js';
30
+ export * from '../CommentThread/index.js';
26
31
  export * from '../Composer/index.js';
27
32
  export * from '../ConfirmField/index.js';
33
+ export * from '../ConflictNote/index.js';
28
34
  export * from '../Container/index.js';
29
35
  export * from '../Copyable/index.js';
30
36
  export * from '../Count/index.js';
@@ -34,7 +40,9 @@ export * from '../DataView/index.js';
34
40
  export * from '../DateTimePicker/index.js';
35
41
  export * from '../DescriptionList/index.js';
36
42
  export * from '../DiffList/index.js';
43
+ export * from '../DiffView/index.js';
37
44
  export * from '../Disclosure/index.js';
45
+ export * from '../Divider/index.js';
38
46
  export * from '../Document/index.js';
39
47
  export * from '../DownloadButton/index.js';
40
48
  export * from '../EmptyState/index.js';
@@ -50,6 +58,7 @@ export * from '../Fullscreen/index.js';
50
58
  export * from '../Highlight/index.js';
51
59
  export * from '../HuePicker/index.js';
52
60
  export * from '../IconButton/index.js';
61
+ export * from '../IconTile/index.js';
53
62
  export * from '../ImageUpload/index.js';
54
63
  export * from '../InboxList/index.js';
55
64
  export * from '../InlineCode/index.js';
@@ -69,12 +78,15 @@ export * from '../Menu/index.js';
69
78
  export * from '../Meter/index.js';
70
79
  export * from '../Modal/index.js';
71
80
  export * from '../NewItemsNotice/index.js';
81
+ export * from '../Note/index.js';
72
82
  export * from '../ObjectHeader/index.js';
73
83
  export * from '../OrgLabel/index.js';
74
84
  export * from '../OrgNode/index.js';
75
85
  export * from '../OrgTable/index.js';
76
86
  export * from '../Outline/index.js';
77
87
  export * from '../PageHeader/index.js';
88
+ export * from '../PeopleRail/index.js';
89
+ export * from '../PinTile/index.js';
78
90
  export * from '../Popover/index.js';
79
91
  export * from '../PresenceModel/index.js';
80
92
  export * from '../PresenceRing/index.js';
@@ -86,6 +98,7 @@ export * from '../Prose/index.js';
86
98
  export * from '../QrCode/index.js';
87
99
  export * from '../ReadingPane/index.js';
88
100
  export * from '../RelativeTime/index.js';
101
+ export * from '../Reorder/index.js';
89
102
  export * from '../SandboxedFrame/index.js';
90
103
  export * from '../SearchTrigger/index.js';
91
104
  export * from '../Section/index.js';
@@ -105,6 +118,7 @@ export * from '../Stepper/index.js';
105
118
  export * from '../Switch/index.js';
106
119
  export * from '../Switcher/index.js';
107
120
  export * from '../Table/index.js';
121
+ export * from '../TableCells/index.js';
108
122
  export * from '../Tabs/index.js';
109
123
  export * from '../Tag/index.js';
110
124
  export * from '../TagGroup/index.js';
@@ -122,6 +136,7 @@ export * from '../Tooltip/index.js';
122
136
  export * from '../Tree/index.js';
123
137
  export * from '../TreeCanvas/index.js';
124
138
  export * from '../TreeGrid/index.js';
139
+ export * from '../VersionCompare/index.js';
125
140
  export * from '../VersionTimeline/index.js';
126
141
  export * from '../VisuallyHidden/index.js';
127
142
  export * from '../utils/index.js';