@estiva-app/ui 0.90.2 → 0.91.1

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 (239) hide show
  1. package/dist/AttachedCard.d.ts +30 -0
  2. package/dist/AttachedCard.d.ts.map +1 -0
  3. package/dist/AttachmentCard.d.ts +14 -0
  4. package/dist/AttachmentCard.d.ts.map +1 -1
  5. package/dist/AvatarGroup.d.ts +7 -1
  6. package/dist/AvatarGroup.d.ts.map +1 -1
  7. package/dist/Card.d.ts +4 -1
  8. package/dist/Card.d.ts.map +1 -1
  9. package/dist/CommentBox.d.ts +1 -1
  10. package/dist/CommentBox.d.ts.map +1 -1
  11. package/dist/InlineText.d.ts +5 -2
  12. package/dist/InlineText.d.ts.map +1 -1
  13. package/dist/Link.d.ts +3 -2
  14. package/dist/Link.d.ts.map +1 -1
  15. package/dist/LinkCard.d.ts +3 -3
  16. package/dist/LinkCard.d.ts.map +1 -1
  17. package/dist/LinkChip.d.ts.map +1 -1
  18. package/dist/LinkParts.d.ts +17 -3
  19. package/dist/LinkParts.d.ts.map +1 -1
  20. package/dist/LinkPreview.d.ts.map +1 -1
  21. package/dist/LinkRow.d.ts +10 -5
  22. package/dist/LinkRow.d.ts.map +1 -1
  23. package/dist/PartCard.d.ts +16 -4
  24. package/dist/PartCard.d.ts.map +1 -1
  25. package/dist/Popover.d.ts +8 -1
  26. package/dist/Popover.d.ts.map +1 -1
  27. package/dist/ReactionRow.d.ts.map +1 -1
  28. package/dist/RichText.d.ts.map +1 -1
  29. package/dist/ShowMore.d.ts +8 -3
  30. package/dist/ShowMore.d.ts.map +1 -1
  31. package/dist/SuggestionMenu.d.ts +6 -2
  32. package/dist/SuggestionMenu.d.ts.map +1 -1
  33. package/dist/editor.js +19 -12
  34. package/dist/editor.js.map +3 -3
  35. package/dist/eslint/has-a-page-and-a-story.d.ts.map +1 -1
  36. package/dist/eslint/index.js +1093 -1076
  37. package/dist/eslint/index.js.map +4 -4
  38. package/dist/eslint/no-restyled-part.d.ts +9 -4
  39. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  40. package/dist/gates/{chunk-BS5JASHV.js → chunk-P2P6AHRY.js} +2 -2
  41. package/dist/gates/{chunk-BS5JASHV.js.map → chunk-P2P6AHRY.js.map} +2 -2
  42. package/dist/gates/cli.js +1 -1
  43. package/dist/gates/gate-config.d.ts +4 -1
  44. package/dist/gates/gate-config.d.ts.map +1 -1
  45. package/dist/gates/hook.d.ts.map +1 -1
  46. package/dist/gates/index.js +2 -2
  47. package/dist/gates/index.js.map +2 -2
  48. package/dist/index.d.ts +2 -2
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +318 -200
  51. package/dist/index.js.map +4 -4
  52. package/dist/linked.d.ts +7 -9
  53. package/dist/linked.d.ts.map +1 -1
  54. package/dist/linked.examples.d.ts.map +1 -1
  55. package/dist/linkedFrom.d.ts +5 -0
  56. package/dist/linkedFrom.d.ts.map +1 -1
  57. package/dist/links.d.ts +2 -2
  58. package/dist/links.d.ts.map +1 -1
  59. package/dist/looks.d.ts +24 -0
  60. package/dist/looks.d.ts.map +1 -1
  61. package/dist/registry/{app-X2GI4WTU.js → app-IGBRDD4L.js} +3 -3
  62. package/dist/registry/{build-P6X3PTZP.js → build-MWN4UI23.js} +2 -2
  63. package/dist/registry/{chunk-P55P2QFD.js → chunk-4TWYUIOB.js} +1 -1
  64. package/dist/registry/chunk-4TWYUIOB.js.map +7 -0
  65. package/dist/registry/{chunk-V67F474L.js → chunk-NSHK76XT.js} +2 -2
  66. package/dist/registry/{chunk-4QWD3EBY.js → chunk-THI3SLW5.js} +1 -1
  67. package/dist/registry/{chunk-4QWD3EBY.js.map → chunk-THI3SLW5.js.map} +1 -1
  68. package/dist/registry/cli.js +3 -3
  69. package/dist/registry/find.d.ts +1 -1
  70. package/dist/registry/find.d.ts.map +1 -1
  71. package/dist/registry/index.js +3 -3
  72. package/package.json +1 -1
  73. package/registry.json +532 -462
  74. package/src/AppProvider.stories.tsx +1 -1
  75. package/src/AppShell.stories.tsx +1 -1
  76. package/src/AttachedCard.mdx +55 -0
  77. package/src/{CardUnder.stories.tsx → AttachedCard.stories.tsx} +10 -19
  78. package/src/{CardUnder.test.tsx → AttachedCard.test.tsx} +11 -11
  79. package/src/AttachedCard.tsx +41 -0
  80. package/src/AttachmentCard.stories.tsx +1 -1
  81. package/src/AttachmentCard.tsx +36 -14
  82. package/src/Avatar.stories.tsx +1 -1
  83. package/src/AvatarGroup.stories.tsx +1 -1
  84. package/src/AvatarGroup.tsx +8 -2
  85. package/src/Banner.stories.tsx +1 -1
  86. package/src/BlockHandle.stories.tsx +1 -1
  87. package/src/BlockNodes.stories.tsx +1 -1
  88. package/src/Breadcrumb.stories.tsx +1 -1
  89. package/src/Button.stories.tsx +1 -1
  90. package/src/Card.stories.tsx +1 -1
  91. package/src/Card.test.tsx +1 -1
  92. package/src/Card.tsx +5 -2
  93. package/src/Checkbox.stories.tsx +1 -1
  94. package/src/Chip.stories.tsx +1 -1
  95. package/src/ChipInput.stories.tsx +1 -1
  96. package/src/CodeBlockColours.stories.tsx +1 -1
  97. package/src/CollapsibleSection.stories.tsx +1 -1
  98. package/src/CommandPalette.stories.tsx +1 -1
  99. package/src/CommentBox.mdx +3 -3
  100. package/src/CommentBox.stories.tsx +39 -7
  101. package/src/CommentBox.test.tsx +1 -1
  102. package/src/CommentBox.tsx +27 -17
  103. package/src/CommentHighlights.stories.tsx +1 -1
  104. package/src/ComposerTriggers.stories.tsx +1 -1
  105. package/src/ConfirmDialog.stories.tsx +1 -1
  106. package/src/ContainerHeader.stories.tsx +1 -1
  107. package/src/DialogShell.stories.tsx +1 -1
  108. package/src/Divider.stories.tsx +1 -1
  109. package/src/DocumentEditor.stories.tsx +1 -1
  110. package/src/EditableText.stories.tsx +1 -1
  111. package/src/EditorBlockHandle.stories.tsx +1 -1
  112. package/src/EditorTableControls.stories.tsx +1 -1
  113. package/src/EmptyState.stories.tsx +1 -1
  114. package/src/EntryShell.mdx +1 -1
  115. package/src/EntryShell.stories.tsx +1 -1
  116. package/src/ErrorBoundary.stories.tsx +1 -1
  117. package/src/Field.stories.tsx +1 -1
  118. package/src/FieldLine.stories.tsx +1 -1
  119. package/src/FilePicker.stories.tsx +1 -1
  120. package/src/Form.stories.tsx +1 -1
  121. package/src/IconButton.stories.tsx +1 -1
  122. package/src/IdentityMenu.stories.tsx +1 -1
  123. package/src/InlineChip.stories.tsx +1 -1
  124. package/src/InlineText.mdx +1 -0
  125. package/src/InlineText.stories.tsx +6 -3
  126. package/src/InlineText.tsx +7 -2
  127. package/src/Kbd.stories.tsx +1 -1
  128. package/src/KindIcon.stories.tsx +1 -1
  129. package/src/Lightbox.stories.tsx +1 -1
  130. package/src/Link.mdx +3 -2
  131. package/src/Link.stories.tsx +1 -1
  132. package/src/Link.test.tsx +5 -3
  133. package/src/Link.tsx +5 -3
  134. package/src/LinkCard.mdx +7 -5
  135. package/src/LinkCard.stories.tsx +4 -1
  136. package/src/LinkCard.test.tsx +8 -2
  137. package/src/LinkCard.tsx +97 -67
  138. package/src/LinkChip.mdx +3 -3
  139. package/src/LinkChip.stories.tsx +1 -1
  140. package/src/LinkChip.test.tsx +1 -1
  141. package/src/LinkChip.tsx +17 -4
  142. package/src/LinkChips.stories.tsx +1 -1
  143. package/src/LinkParts.stories.tsx +1 -1
  144. package/src/LinkParts.tsx +40 -8
  145. package/src/LinkPlaces.stories.tsx +1 -1
  146. package/src/LinkPreview.mdx +1 -1
  147. package/src/LinkPreview.stories.tsx +1 -1
  148. package/src/LinkPreview.tsx +3 -1
  149. package/src/LinkRow.mdx +8 -6
  150. package/src/LinkRow.stories.tsx +3 -3
  151. package/src/LinkRow.test.tsx +3 -3
  152. package/src/LinkRow.tsx +71 -41
  153. package/src/ListColumn.stories.tsx +1 -1
  154. package/src/MembersDialog.stories.tsx +1 -1
  155. package/src/MembersPill.stories.tsx +1 -1
  156. package/src/Menu.stories.tsx +1 -1
  157. package/src/MenuItem.stories.tsx +1 -1
  158. package/src/NavItem.stories.tsx +1 -1
  159. package/src/NavTree.stories.tsx +1 -1
  160. package/src/Panel.stories.tsx +1 -1
  161. package/src/PartCard.mdx +5 -4
  162. package/src/PartCard.stories.tsx +34 -7
  163. package/src/PartCard.test.tsx +5 -3
  164. package/src/PartCard.tsx +48 -24
  165. package/src/PastedImages.stories.tsx +1 -1
  166. package/src/PastedMarkdown.stories.tsx +1 -1
  167. package/src/Person.stories.tsx +1 -1
  168. package/src/PersonTrigger.stories.tsx +1 -1
  169. package/src/Popover.stories.tsx +1 -1
  170. package/src/Popover.tsx +6 -2
  171. package/src/PreviewCard.stories.tsx +1 -1
  172. package/src/ProgressBar.stories.tsx +1 -1
  173. package/src/Property.stories.tsx +1 -1
  174. package/src/Rail.stories.tsx +1 -1
  175. package/src/RailItem.stories.tsx +1 -1
  176. package/src/Reaction.stories.tsx +1 -1
  177. package/src/ReactionPicker.stories.tsx +1 -1
  178. package/src/ReactionRow.stories.tsx +1 -1
  179. package/src/ReactionRow.tsx +3 -1
  180. package/src/ReferenceCards.mdx +3 -0
  181. package/src/ReferenceCards.stories.tsx +3 -1
  182. package/src/ReferenceMenu.mdx +1 -1
  183. package/src/ReferenceMenu.stories.tsx +1 -1
  184. package/src/RichText.stories.tsx +1 -1
  185. package/src/RichText.tsx +6 -2
  186. package/src/ScrollArea.stories.tsx +1 -1
  187. package/src/SearchInput.stories.tsx +1 -1
  188. package/src/SectionHeader.stories.tsx +1 -1
  189. package/src/SectionLabel.stories.tsx +1 -1
  190. package/src/Select.stories.tsx +1 -1
  191. package/src/SelectionToolbar.stories.tsx +1 -1
  192. package/src/ShowMore.mdx +4 -4
  193. package/src/ShowMore.stories.tsx +1 -1
  194. package/src/ShowMore.tsx +11 -6
  195. package/src/Sidebar.stories.tsx +1 -1
  196. package/src/Skeleton.stories.tsx +1 -1
  197. package/src/SuggestionMenu.mdx +4 -1
  198. package/src/SuggestionMenu.stories.tsx +14 -8
  199. package/src/SuggestionMenu.tsx +20 -3
  200. package/src/Tabs.stories.tsx +1 -1
  201. package/src/TextInput.stories.tsx +1 -1
  202. package/src/Textarea.stories.tsx +1 -1
  203. package/src/Toast.stories.tsx +1 -1
  204. package/src/Toolbar.stories.tsx +1 -1
  205. package/src/Tooltip.stories.tsx +1 -1
  206. package/src/TopBar.stories.tsx +1 -1
  207. package/src/UnreadDot.stories.tsx +1 -1
  208. package/src/eslint/has-a-page-and-a-story.test.ts +5 -0
  209. package/src/eslint/has-a-page-and-a-story.ts +11 -2
  210. package/src/eslint/no-restyled-part.test.ts +32 -8
  211. package/src/eslint/no-restyled-part.ts +50 -23
  212. package/src/gates/gate-config.ts +5 -2
  213. package/src/gates/gates.test.ts +20 -2
  214. package/src/gates/hook.ts +4 -3
  215. package/src/index.ts +2 -1
  216. package/src/linked.examples.ts +3 -4
  217. package/src/linked.ts +11 -1
  218. package/src/linkedFrom.test.tsx +55 -3
  219. package/src/linkedFrom.ts +47 -2
  220. package/src/links.ts +3 -2
  221. package/src/looks.ts +29 -0
  222. package/src/registry/build.ts +1 -1
  223. package/src/registry/contract.test.ts +1 -1
  224. package/src/registry/find.ts +1 -1
  225. package/src/registry/registry.test.ts +12 -12
  226. package/src/suggestionPopup.tsx +1 -1
  227. package/stories/Choosing.mdx +2 -2
  228. package/stories/DesignTokens.mdx +1 -1
  229. package/stories/GettingStarted.mdx +2 -2
  230. package/stories/Introduction.mdx +23 -4
  231. package/stories/TokensPage.tsx +12 -7
  232. package/dist/CardUnder.d.ts +0 -31
  233. package/dist/CardUnder.d.ts.map +0 -1
  234. package/dist/registry/chunk-P55P2QFD.js.map +0 -7
  235. package/src/CardUnder.mdx +0 -54
  236. package/src/CardUnder.tsx +0 -49
  237. /package/dist/registry/{app-X2GI4WTU.js.map → app-IGBRDD4L.js.map} +0 -0
  238. /package/dist/registry/{build-P6X3PTZP.js.map → build-MWN4UI23.js.map} +0 -0
  239. /package/dist/registry/{chunk-V67F474L.js.map → chunk-NSHK76XT.js.map} +0 -0
package/dist/index.js CHANGED
@@ -70,11 +70,37 @@ function cn(...inputs) {
70
70
  return twMerge(clsx(inputs));
71
71
  }
72
72
 
73
+ // src/looks.ts
74
+ var FIELD_BOX_CLASSES = "bg-bg-field border border-border-field shadow-field hover:border-border-strong group-hover/field:border-border-strong focus:border-border-focus group-hover/field:focus:border-border-focus rounded-lg";
75
+ var FIELD_TEXT_CLASSES = "text-text-primary placeholder:text-text-muted";
76
+ var FIELD_DISABLED_CLASSES = "disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field group-hover/field:disabled:border-border-field";
77
+ var FIELD_FOCUS_RING_CLASSES = "signal:transition-shadow signal:focus:shadow-focus-ring";
78
+ var FIELD_SIZE_CLASSES = {
79
+ default: "px-3 py-2 text-input-value",
80
+ small: "h-6 min-h-6 px-2 text-caption"
81
+ };
82
+ var FIELD_SHELL_CLASSES = "bg-bg-field border border-border-field shadow-field hover:border-border-strong group-hover/field:border-border-strong rounded-lg transition-colors";
83
+ var FLOATING_SURFACE_CLASSES = "rounded-lg border border-border-default bg-bg-elevated shadow-lg";
84
+ var COUNT_TEXT_CLASSES = "font-mono text-caption tabular-nums text-text-muted";
85
+ var CHIP_TEXT_CLASSES = "text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums";
86
+ var TIME_CLASSES = "whitespace-nowrap signal:font-mono signal:text-small signal:tracking-wide signal:tabular-nums";
87
+ var MONO_CAPTION_CLASSES = "text-caption text-text-secondary signal:font-mono signal:text-small";
88
+ var BARE_INPUT_CLASSES = "bg-transparent text-text-primary placeholder:text-text-muted outline-none";
89
+ var SIDEBAR_ROW_CLASSES = "rounded-lg transition-colors";
90
+ var SIDEBAR_ROW_TEXT_CLASSES = "text-text-secondary hover:text-text-primary";
91
+ var MUTED_CONTROL_CLASSES = "text-text-secondary hover:bg-bg-hover hover:text-text-primary";
92
+ var MENU_TRIGGER_CLASSES = "cursor-pointer rounded-md transition-colors hover:bg-bg-hover data-[popup-open]:bg-bg-hover";
93
+ var COLLAPSIBLE_PANEL_CLASSES = "h-[var(--collapsible-panel-height)] overflow-hidden transition-[height] duration-150 ease-out motion-reduce:transition-none data-[starting-style]:h-0 data-[ending-style]:h-0";
94
+ var TYPE_TILE_CLASSES = "size-9 rounded-md bg-bg-active flex items-center justify-center shrink-0 text-text-secondary";
95
+ var QUOTE_BAR_CLASSES = "border-l-2 border-border-default pl-3";
96
+ var LINK_UNDERLINE_CLASSES = "no-underline bg-[linear-gradient(currentColor,currentColor)] bg-[length:100%_1px] bg-bottom bg-no-repeat";
97
+ var WEB_LINK_CLASSES = `${LINK_UNDERLINE_CLASSES} before:content-[''] before:inline-block before:size-[1em] before:mr-0.5 before:align-[-0.125em] before:bg-current before:[mask:url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9%2015l6%20-6%27%2F%3E%3Cpath%20d%3D%27M11%206l.463%20-.536a5%205%200%200%201%207.071%207.072l-.534%20.464%27%2F%3E%3Cpath%20d%3D%27M13%2018l-.397%20.534a5.068%205.068%200%200%201%20-7.127%200a4.972%204.972%200%200%201%200%20-7.071l.524%20-.463%27%2F%3E%3C%2Fsvg%3E)_center/contain_no-repeat]`;
98
+
73
99
  // src/Link.tsx
74
100
  import { jsx as jsx2 } from "react/jsx-runtime";
75
101
  var COVER_CLASSES = "after:absolute after:inset-0 after:rounded-md focus-visible:outline-none focus-visible:after:[outline-style:auto]";
76
102
  var VARIANT_CLASSES = {
77
- text: "text-text-interactive underline underline-offset-2 hover:opacity-80",
103
+ text: `text-text-interactive hover:opacity-80 ${WEB_LINK_CLASSES}`,
78
104
  quiet: "hover:underline",
79
105
  underlined: "underline underline-offset-2 hover:text-text-primary",
80
106
  plain: ""
@@ -99,7 +125,7 @@ import { jsx as jsx3 } from "react/jsx-runtime";
99
125
  var FILL_CLASSES = {
100
126
  surface: "bg-bg-surface border-border-default",
101
127
  elevated: "bg-bg-elevated border-border-default",
102
- inset: "bg-bg-inset border-border-subtle",
128
+ inset: "bg-bg-wash border-border-subtle",
103
129
  none: "border-border-subtle"
104
130
  };
105
131
  var HAIRLINE_HOVER_CLASSES = {
@@ -170,27 +196,6 @@ function Card({
170
196
  // src/IconButton.tsx
171
197
  import { Button as BaseButton } from "@base-ui/react/button";
172
198
 
173
- // src/looks.ts
174
- var FIELD_BOX_CLASSES = "bg-bg-field border border-border-field shadow-field hover:border-border-strong group-hover/field:border-border-strong focus:border-border-focus group-hover/field:focus:border-border-focus rounded-lg";
175
- var FIELD_TEXT_CLASSES = "text-text-primary placeholder:text-text-muted";
176
- var FIELD_DISABLED_CLASSES = "disabled:pointer-events-none disabled:bg-bg-disabled disabled:text-text-disabled disabled:border-border-field group-hover/field:disabled:border-border-field";
177
- var FIELD_FOCUS_RING_CLASSES = "signal:transition-shadow signal:focus:shadow-focus-ring";
178
- var FIELD_SIZE_CLASSES = {
179
- default: "px-3 py-2 text-input-value",
180
- small: "h-6 min-h-6 px-2 text-caption"
181
- };
182
- var FIELD_SHELL_CLASSES = "bg-bg-field border border-border-field shadow-field hover:border-border-strong group-hover/field:border-border-strong rounded-lg transition-colors";
183
- var FLOATING_SURFACE_CLASSES = "rounded-lg border border-border-default bg-bg-elevated shadow-lg";
184
- var COUNT_TEXT_CLASSES = "font-mono text-caption tabular-nums text-text-muted";
185
- var CHIP_TEXT_CLASSES = "text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums";
186
- var MONO_CAPTION_CLASSES = "text-caption text-text-secondary signal:font-mono signal:text-small";
187
- var BARE_INPUT_CLASSES = "bg-transparent text-text-primary placeholder:text-text-muted outline-none";
188
- var SIDEBAR_ROW_CLASSES = "rounded-lg transition-colors";
189
- var SIDEBAR_ROW_TEXT_CLASSES = "text-text-secondary hover:text-text-primary";
190
- var MUTED_CONTROL_CLASSES = "text-text-secondary hover:bg-bg-hover hover:text-text-primary";
191
- var MENU_TRIGGER_CLASSES = "cursor-pointer rounded-md transition-colors hover:bg-bg-hover data-[popup-open]:bg-bg-hover";
192
- var COLLAPSIBLE_PANEL_CLASSES = "h-[var(--collapsible-panel-height)] overflow-hidden transition-[height] duration-150 ease-out motion-reduce:transition-none data-[starting-style]:h-0 data-[ending-style]:h-0";
193
-
194
199
  // src/formBusy.ts
195
200
  import { createContext as createContext2, useContext as useContext2 } from "react";
196
201
  var FormBusyContext = createContext2(false);
@@ -621,7 +626,7 @@ var formatBytes = (bytes) => {
621
626
  return `${(kb / 1024).toFixed(1)} MB`;
622
627
  };
623
628
  var typeLabelOf = (name) => extensionOf(name).toUpperCase() || "FILE";
624
- var TILE_CLASSES = "size-9 rounded-md bg-bg-active flex items-center justify-center shrink-0 text-text-secondary";
629
+ var TILE_CLASSES = TYPE_TILE_CLASSES;
625
630
  var NAME_CLASSES = "text-caption font-medium text-text-primary truncate";
626
631
  var NOTE_CLASSES = "text-small tracking-wide leading-tight truncate";
627
632
  function TypeIcon({ name }) {
@@ -652,6 +657,24 @@ function Truncating({ text, hint, className, wrapperClassName, placement }) {
652
657
  if (!hint && !cut) return line;
653
658
  return /* @__PURE__ */ jsx12(WithTooltip, { label: hint ?? text, placement, wrapperClassName: cn("min-w-0 flex-col", wrapperClassName), children: line });
654
659
  }
660
+ function RemoveBadge({ label, onRemove, className }) {
661
+ return /* @__PURE__ */ jsx12(
662
+ BaseButton3,
663
+ {
664
+ type: "button",
665
+ "aria-label": label,
666
+ className: cn(
667
+ "absolute -top-1.5 -right-1.5 size-5 rounded-full bg-bg-elevated border border-border-strong flex items-center justify-center text-text-secondary hover:text-text-primary transition-opacity",
668
+ className
669
+ ),
670
+ onClick: (event) => {
671
+ event.stopPropagation();
672
+ onRemove();
673
+ },
674
+ children: /* @__PURE__ */ jsx12(IconX2, { size: 11, stroke: 1.75 })
675
+ }
676
+ );
677
+ }
655
678
  function useRemoteImage(url, fetchImage) {
656
679
  const [result, setResult] = useState({});
657
680
  const fetcher = useRef3(fetchImage);
@@ -771,16 +794,11 @@ function AttachmentCard({
771
794
  )
772
795
  ] }),
773
796
  onRemove && /* @__PURE__ */ jsx12(
774
- BaseButton3,
797
+ RemoveBadge,
775
798
  {
776
- type: "button",
777
- "aria-label": `Remove ${name}`,
778
- className: "absolute -top-1.5 -right-1.5 size-5 rounded-full bg-bg-elevated border border-border-strong flex items-center justify-center text-text-secondary hover:text-text-primary opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 transition-opacity",
779
- onClick: (event) => {
780
- event.stopPropagation();
781
- onRemove();
782
- },
783
- children: /* @__PURE__ */ jsx12(IconX2, { size: 11, stroke: 1.75 })
799
+ label: `Remove ${name}`,
800
+ onRemove,
801
+ className: "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100"
784
802
  }
785
803
  )
786
804
  ]
@@ -937,7 +955,7 @@ function Avatar({ src, name, alt = "", size = 36, label: spoken, className }) {
937
955
 
938
956
  // src/AvatarGroup.tsx
939
957
  import { jsx as jsx14 } from "react/jsx-runtime";
940
- function AvatarGroup({ members, size = 24 }) {
958
+ function AvatarGroup({ members, size = 24, on = "surface" }) {
941
959
  const visible = members.slice(0, 3);
942
960
  const overlap = Math.round(size / 3);
943
961
  const ring = size / 12;
@@ -951,7 +969,7 @@ function AvatarGroup({ members, size = 24 }) {
951
969
  "span",
952
970
  {
953
971
  className: "relative flex rounded-sm",
954
- style: { marginRight: -overlap, boxShadow: `0 0 0 ${ring}px var(--bg-surface)` },
972
+ style: { marginRight: -overlap, boxShadow: `0 0 0 ${ring}px var(--bg-${on})` },
955
973
  children: /* @__PURE__ */ jsx14(Avatar, { size, name: member.name, src: member.picture, label: member.name })
956
974
  },
957
975
  i
@@ -3754,7 +3772,7 @@ var VIEWPORT_PAD5 = 8;
3754
3772
  function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpenChange, finalFocus, actionsRef, ariaLabel, children, className, contentClassName, maxHeight }) {
3755
3773
  const anchorTarget = useMemo4(() => {
3756
3774
  if (!anchor) return void 0;
3757
- if (anchor instanceof Element) return anchor;
3775
+ if (anchor instanceof Element || "getBoundingClientRect" in anchor) return anchor;
3758
3776
  return { getBoundingClientRect: () => anchor };
3759
3777
  }, [anchor]);
3760
3778
  return /* @__PURE__ */ jsxs37(
@@ -3804,6 +3822,17 @@ function Popover({ trigger, anchor, align = "left", side = "bottom", open, onOpe
3804
3822
  import { useCallback as useCallback4, useEffect as useEffect7, useId as useId3, useImperativeHandle, useMemo as useMemo5, useRef as useRef12, useState as useState11 } from "react";
3805
3823
  import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
3806
3824
  function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sections, itemKey, row, onSelect, handle }) {
3825
+ const last = useRef12(null);
3826
+ const anchor = useMemo5(() => {
3827
+ if (typeof rect !== "function") return rect;
3828
+ return {
3829
+ getBoundingClientRect: () => {
3830
+ last.current = rect() ?? last.current;
3831
+ return last.current ?? new DOMRect();
3832
+ },
3833
+ contextElement: editorElement ?? void 0
3834
+ };
3835
+ }, [rect, editorElement]);
3807
3836
  const shown = useMemo5(() => sections.filter((section) => section.items.length > 0), [sections]);
3808
3837
  const items = useMemo5(() => shown.flatMap((section) => section.items), [shown]);
3809
3838
  const keys = items.map(itemKey).join("\n");
@@ -3895,7 +3924,7 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
3895
3924
  };
3896
3925
  return (
3897
3926
  // finalFocus={false}: focus never left the text, and a list that closes because focus moved elsewhere must not pull it back (71a4577b).
3898
- /* @__PURE__ */ jsx55(Popover, { anchor: rect, open: rect !== null, side: "top", align: "left", className: width, maxHeight, ariaLabel, finalFocus: false, children: /* @__PURE__ */ jsx55("div", { ref: keepFocus, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "flex flex-col gap-0.5", children: shown.map((section, i) => /* @__PURE__ */ jsxs38("div", { className: "contents", children: [
3927
+ /* @__PURE__ */ jsx55(Popover, { anchor, open: rect !== null, side: "top", align: "left", className: width, maxHeight, ariaLabel, finalFocus: false, children: /* @__PURE__ */ jsx55("div", { ref: keepFocus, id: listboxId, role: "listbox", "aria-label": ariaLabel, className: "flex flex-col gap-0.5", children: shown.map((section, i) => /* @__PURE__ */ jsxs38("div", { className: "contents", children: [
3899
3928
  i > 0 && /* @__PURE__ */ jsx55(MenuSeparator, {}),
3900
3929
  section.label ? /* @__PURE__ */ jsx55("div", { role: "group", "aria-label": section.label, children: /* @__PURE__ */ jsx55(MenuSection, { label: section.label, className: section.className, children: section.items.map(drawRow) }) }) : section.items.map(drawRow)
3901
3930
  ] }, section.label ?? i)) }) })
@@ -3906,8 +3935,8 @@ function SuggestionMenu({ rect, editorElement, ariaLabel, width, maxHeight, sect
3906
3935
  import { useLayoutEffect as useLayoutEffect5, useRef as useRef13, useState as useState12 } from "react";
3907
3936
  import { IconChevronDown as IconChevronDown4, IconChevronUp } from "@tabler/icons-react";
3908
3937
  import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
3909
- var FADE_CLASSES = { surface: "from-bg-surface", inset: "from-bg-inset" };
3910
- function ShowMore({ children, maxHeight = 96, surface = "surface", action, className }) {
3938
+ var FADE = "linear-gradient(to top, transparent, black 40px)";
3939
+ function ShowMore({ children, maxHeight = 96, action, contentClassName, className }) {
3911
3940
  const box = useRef13(null);
3912
3941
  const [open, setOpen] = useState12(false);
3913
3942
  const [overflows, setOverflows] = useState12(false);
@@ -3923,10 +3952,7 @@ function ShowMore({ children, maxHeight = 96, surface = "surface", action, class
3923
3952
  }, [maxHeight]);
3924
3953
  const cut = overflows && !open;
3925
3954
  return /* @__PURE__ */ jsxs39("div", { className: cn("flex flex-col items-start", className), children: [
3926
- /* @__PURE__ */ jsxs39("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden"), style: cut ? { maxHeight } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children: [
3927
- children,
3928
- cut && /* @__PURE__ */ jsx56("div", { "aria-hidden": true, className: cn("pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-gradient-to-t to-transparent", FADE_CLASSES[surface]) })
3929
- ] }),
3955
+ /* @__PURE__ */ jsx56("div", { ref: box, className: cn("relative w-full", cut && "overflow-hidden", contentClassName), style: cut ? { maxHeight, maskImage: FADE, WebkitMaskImage: FADE } : void 0, onFocus: cut ? () => setOpen(true) : void 0, children }),
3930
3956
  action ? /* @__PURE__ */ jsxs39("div", { className: cn("mt-1 flex w-full items-center gap-2", overflows ? "justify-between" : "justify-end"), children: [
3931
3957
  overflows && /* @__PURE__ */ jsx56(Toggle, { open, onToggle: () => setOpen((o) => !o) }),
3932
3958
  /* @__PURE__ */ jsx56("div", { className: "-mr-2 flex shrink-0", children: action })
@@ -4060,6 +4086,8 @@ function PreviewCard({ content, children, side = "right", delay = OPEN_DELAY2, c
4060
4086
  }
4061
4087
 
4062
4088
  // src/linked.ts
4089
+ import { createContext as createContext7 } from "react";
4090
+ var inTheBox = createContext7(false);
4063
4091
  function chosenOf(picker) {
4064
4092
  return picker?.value === void 0 ? void 0 : picker.options.find((option) => option.value === picker.value);
4065
4093
  }
@@ -4126,6 +4154,16 @@ function archivedLine(archive, noun, options = {}) {
4126
4154
  var archivedLine2 = archivedLine;
4127
4155
 
4128
4156
  // src/linkedFrom.ts
4157
+ function agoOf(seconds, now = Date.now()) {
4158
+ const gone = Math.max(0, Math.floor(now / 1e3 - seconds));
4159
+ if (gone < 60) return "just now";
4160
+ if (gone < 3600) return `${Math.floor(gone / 60)}m ago`;
4161
+ if (gone < 86400) return `${Math.floor(gone / 3600)}h ago`;
4162
+ if (gone < 7 * 86400) return `${Math.floor(gone / 86400)}d ago`;
4163
+ const date = new Date(seconds * 1e3);
4164
+ const year = date.getFullYear() === new Date(now).getFullYear() ? {} : { year: "numeric" };
4165
+ return date.toLocaleDateString(void 0, { day: "numeric", month: "short", ...year });
4166
+ }
4129
4167
  var CARD_ROWS = 7;
4130
4168
  var KIND_PAGE = 30842;
4131
4169
  var KIND_CHANNEL2 = 39e3;
@@ -4227,15 +4265,32 @@ function ownerOf(object, options, onAct) {
4227
4265
  ...slot.label ? { ownerLabel: slot.label } : {}
4228
4266
  };
4229
4267
  }
4268
+ function authorOf(object, directory) {
4269
+ if (object.kind === KIND_CHANNEL2 || !object.address) return void 0;
4270
+ const pubkey = object.address.split(":")[1];
4271
+ if (!pubkey || !/^[0-9a-f]{64}$/.test(pubkey)) return void 0;
4272
+ const profile = object.people?.[pubkey] ?? directory?.[pubkey];
4273
+ if (!profile?.displayName) return void 0;
4274
+ return { name: profile.displayName, ...profile.picture ? { picture: profile.picture } : {} };
4275
+ }
4230
4276
  function linkedFrom(object, options) {
4231
4277
  const { slots, people } = object;
4232
4278
  const id = idOf(object);
4233
4279
  const href = options.hrefOf(object, true);
4280
+ const updated = object.changedAt !== void 0 ? (options.whenOf ?? agoOf)(object.changedAt) : void 0;
4234
4281
  if (isMessage(object) && slots.title?.isPubkey) {
4235
4282
  const person = people?.[slots.title.value];
4236
4283
  const name = person?.displayName ?? "\u2014";
4237
4284
  const body = slots.body?.value ? options.previewText(slots.body.value, people) : "";
4238
- return { id, kind: "message", title: name, href, author: { name, ...person?.picture ? { picture: person.picture } : {} }, ...body ? { body } : {} };
4285
+ return {
4286
+ id,
4287
+ kind: "message",
4288
+ title: name,
4289
+ href,
4290
+ author: { name, ...person?.picture ? { picture: person.picture } : {} },
4291
+ ...body ? { body } : {},
4292
+ ...updated ? { updated } : {}
4293
+ };
4239
4294
  }
4240
4295
  const onAct = object.archived ? void 0 : options.onAct;
4241
4296
  const key = keyOf(object);
@@ -4243,19 +4298,23 @@ function linkedFrom(object, options) {
4243
4298
  const owner = ownerOf(object, options, onAct);
4244
4299
  const children = childrenOf(object, options);
4245
4300
  const done = doneOf(object);
4301
+ const author = owner ? void 0 : authorOf(object, options.directory);
4246
4302
  return {
4247
4303
  id,
4248
4304
  kind: linkedKindOfKind(object.kind),
4249
4305
  title: titleOf(object),
4250
4306
  href,
4251
4307
  ...key ? { key } : {},
4308
+ ...object.noun ? { noun: object.noun.charAt(0).toUpperCase() + object.noun.slice(1) } : {},
4252
4309
  // Interop reads every file kind's summary into its subtitle (SPEC §6.12).
4253
4310
  ...slots.subtitle?.value ? { summary: slots.subtitle.value } : {},
4254
4311
  ...status ? { status } : {},
4255
4312
  ...owner ?? {},
4256
4313
  ...options.conversation ? { conversation: options.conversation } : {},
4257
4314
  ...children ? { children } : {},
4258
- ...done ? { done } : {}
4315
+ ...done ? { done } : {},
4316
+ ...author ? { authors: [author] } : {},
4317
+ ...updated ? { updated } : {}
4259
4318
  };
4260
4319
  }
4261
4320
  function linkStateFrom(object, unread, options) {
@@ -4296,8 +4355,16 @@ function LinkedIcon({ kind, size = 16, tone = "secondary" }) {
4296
4355
  if (kind === "page") return /* @__PURE__ */ jsx60(IconFileText, { size, stroke: 1.5, className: cn("shrink-0", tone === "secondary" && "text-text-secondary"), "aria-hidden": true });
4297
4356
  return /* @__PURE__ */ jsx60(KindIcon, { kind, size, tone });
4298
4357
  }
4299
- function LinkKey({ children }) {
4300
- return /* @__PURE__ */ jsx60("span", { className: "shrink-0 text-caption tabular-nums text-text-muted", children });
4358
+ function LinkKey({ children, tone = "muted" }) {
4359
+ return /* @__PURE__ */ jsx60("span", { className: cn("shrink-0 text-caption tabular-nums", tone === "secondary" ? "text-text-secondary" : "text-text-muted"), children });
4360
+ }
4361
+ var KIND_NOUN = { issue: "Issue", project: "Project", topic: "Topic", page: "Document" };
4362
+ function kindNounOf(linked) {
4363
+ return linked.noun ?? KIND_NOUN[linked.kind];
4364
+ }
4365
+ function LinkTile({ kind, author }) {
4366
+ if (author) return /* @__PURE__ */ jsx60(Avatar, { name: author.name, src: author.picture, size: 36 });
4367
+ return /* @__PURE__ */ jsx60("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx60(LinkedIcon, { kind }) });
4301
4368
  }
4302
4369
  function ProgressRing({ done, total }) {
4303
4370
  const size = 16;
@@ -4305,7 +4372,7 @@ function ProgressRing({ done, total }) {
4305
4372
  const r = (size - stroke) / 2;
4306
4373
  const c = 2 * Math.PI * r;
4307
4374
  const share = total > 0 ? Math.min(done, total) / total : 0;
4308
- return /* @__PURE__ */ jsx60(WithTooltip, { label: `${done} of ${total} done`, inline: true, wrapperClassName: "inline-flex shrink-0", children: /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1 text-caption tabular-nums text-text-secondary", children: [
4375
+ return /* @__PURE__ */ jsx60(WithTooltip, { label: `${done} of ${total} done`, inline: true, wrapperClassName: "inline-flex shrink-0", children: /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1.5 text-small tabular-nums text-text-secondary", children: [
4309
4376
  /* @__PURE__ */ jsxs41("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "shrink-0 -rotate-90", "aria-hidden": true, children: [
4310
4377
  /* @__PURE__ */ jsx60("circle", { cx: size / 2, cy: size / 2, r, fill: "none", strokeWidth: stroke, className: "stroke-border-default" }),
4311
4378
  /* @__PURE__ */ jsx60("circle", { cx: size / 2, cy: size / 2, r, fill: "none", strokeWidth: stroke, strokeLinecap: "round", strokeDasharray: `${c * share} ${c}`, className: "stroke-success-default" })
@@ -4317,62 +4384,80 @@ function ProgressRing({ done, total }) {
4317
4384
  }
4318
4385
  function CommentCount({ conversation, noun = "comments" }) {
4319
4386
  const { count, href, unread = false } = conversation;
4320
- return /* @__PURE__ */ jsx60("span", { className: cn("relative z-10 -mx-1 inline-flex shrink-0 rounded-sm px-1 text-caption tabular-nums hover:bg-bg-active", unread ? "font-medium text-text-primary" : "text-text-secondary"), children: /* @__PURE__ */ jsxs41(Link, { href, variant: "plain", className: "inline-flex items-center gap-1", children: [
4321
- /* @__PURE__ */ jsx60(IconMessage22, { size: 14, stroke: 1.5, "aria-hidden": true }),
4322
- count,
4323
- /* @__PURE__ */ jsx60("span", { className: "sr-only", children: unread ? `${noun}, unread \u2014 open the conversation` : `${noun} \u2014 open the conversation` }),
4324
- unread && /* @__PURE__ */ jsx60(UnreadDot, { className: "h-auto w-auto" })
4325
- ] }) });
4387
+ return (
4388
+ /*
4389
+ * A small button's shape, as Button's small one is: 24px tall like the pickers beside it, 6px each side, its corners
4390
+ * and its hover. It was 15px tall, 1px above and below its icon and 4px at the sides, and read as squashed
4391
+ * (Katerina, 29 Oct). The link fills the box, so all of it opens the conversation. The box keeps its own room:
4392
+ * its 6px and the row's gap part it from the faces and the ring beside it (14px to its icon). The count is in
4393
+ * the small size (10px).
4394
+ */
4395
+ /* @__PURE__ */ jsx60("span", { className: cn("relative z-10 inline-flex h-6 shrink-0 rounded-md text-small tabular-nums transition-colors hover:bg-bg-hover", unread ? "font-medium text-text-primary" : "text-text-secondary"), children: /* @__PURE__ */ jsxs41(Link, { href, variant: "plain", className: "flex h-full items-center gap-1 px-1.5", children: [
4396
+ /* @__PURE__ */ jsx60(IconMessage22, { size: 14, stroke: 1.5, "aria-hidden": true }),
4397
+ count,
4398
+ /* @__PURE__ */ jsx60("span", { className: "sr-only", children: unread ? `${noun}, unread \u2014 open the conversation` : `${noun} \u2014 open the conversation` }),
4399
+ unread && /* @__PURE__ */ jsx60(UnreadDot, { className: "h-auto w-auto" })
4400
+ ] }) })
4401
+ );
4326
4402
  }
4327
4403
  function LinkPickers({ status, owner, ownerLabel = "Owner", readOnly = false }) {
4328
4404
  const statusNow = chosenOf(status);
4329
4405
  const ownerNow = chosenOf(owner);
4330
4406
  const statusWords = status && (readOnly || !status.onChange);
4331
4407
  const ownerWords = owner && (readOnly || !owner.onChange);
4332
- return /* @__PURE__ */ jsxs41("span", { className: "flex h-6 min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
4333
- status && (statusWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
4334
- statusNow?.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: statusNow.colour }),
4335
- statusNow?.label ?? "No status"
4336
- ] }) : /* @__PURE__ */ jsx60(
4337
- Select,
4338
- {
4339
- size: "small",
4340
- className: "w-auto",
4341
- value: status.value ?? "",
4342
- onChange: (value) => status.onChange?.(value),
4343
- ariaLabel: "Status",
4344
- options: status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: option.colour }) }))
4345
- }
4346
- )),
4347
- owner && (ownerWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex min-w-0 items-center gap-1", children: [
4348
- /* @__PURE__ */ jsx60(Avatar, { name: ownerNow?.label, src: ownerNow?.picture, size: 16 }),
4349
- /* @__PURE__ */ jsx60("span", { className: "truncate", children: ownerNow?.label ?? "Unassigned" })
4350
- ] }) : /* @__PURE__ */ jsx60(
4351
- Select,
4352
- {
4353
- size: "small",
4354
- className: "w-auto",
4355
- value: owner.value ?? "",
4356
- placeholder: "Unassigned",
4357
- onChange: (value) => owner.onChange?.(value),
4358
- ariaLabel: ownerLabel,
4359
- options: owner.options.map((option) => ({ value: option.value, label: option.label, leading: /* @__PURE__ */ jsx60(Avatar, { name: option.label, src: option.picture, size: 16 }) }))
4360
- }
4361
- ))
4362
- ] });
4408
+ return (
4409
+ // As words, 16px apart, so the status and the person read as two things; as boxed pickers their borders already part them (Katerina, 29 Oct).
4410
+ /* @__PURE__ */ jsxs41("span", { className: cn("flex h-6 min-w-0 items-center text-caption text-text-secondary", statusWords || ownerWords ? "gap-4" : "gap-2"), children: [
4411
+ status && (statusWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex shrink-0 items-center gap-1", children: [
4412
+ statusNow?.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: statusNow.colour }),
4413
+ statusNow?.label ?? "No status"
4414
+ ] }) : /* @__PURE__ */ jsx60(
4415
+ Select,
4416
+ {
4417
+ size: "small",
4418
+ className: "w-auto",
4419
+ value: status.value ?? "",
4420
+ onChange: (value) => status.onChange?.(value),
4421
+ ariaLabel: "Status",
4422
+ options: status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && /* @__PURE__ */ jsx60(StatusIcon, { colour: option.colour }) }))
4423
+ }
4424
+ )),
4425
+ owner && (ownerWords ? /* @__PURE__ */ jsxs41("span", { className: "inline-flex min-w-0 items-center gap-1", children: [
4426
+ /* @__PURE__ */ jsx60(Avatar, { name: ownerNow?.label, src: ownerNow?.picture, size: 16 }),
4427
+ /* @__PURE__ */ jsx60("span", { className: "truncate", children: ownerNow?.label ?? "Unassigned" })
4428
+ ] }) : /* @__PURE__ */ jsx60(
4429
+ Select,
4430
+ {
4431
+ size: "small",
4432
+ className: "w-auto",
4433
+ value: owner.value ?? "",
4434
+ placeholder: "Unassigned",
4435
+ onChange: (value) => owner.onChange?.(value),
4436
+ ariaLabel: ownerLabel,
4437
+ options: owner.options.map((option) => ({ value: option.value, label: option.label, leading: /* @__PURE__ */ jsx60(Avatar, { name: option.label, src: option.picture, size: 16 }) }))
4438
+ }
4439
+ ))
4440
+ ] })
4441
+ );
4363
4442
  }
4364
4443
 
4365
4444
  // src/LinkPreview.tsx
4366
4445
  import { useSyncExternalStore } from "react";
4367
4446
 
4447
+ // src/LinkCard.tsx
4448
+ import { useContext as useContext8 } from "react";
4449
+
4368
4450
  // src/LinkRow.tsx
4369
- import { Fragment as Fragment15, jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
4370
- function LinkUnavailable({ kind, noun, openIn }) {
4371
- return /* @__PURE__ */ jsxs42(Card, { fill: "none", unreadable: true, className: "flex h-9 items-center gap-2 px-3", children: [
4372
- /* @__PURE__ */ jsx61(LinkedIcon, { kind }),
4451
+ import { useContext as useContext7 } from "react";
4452
+ import { jsx as jsx61, jsxs as jsxs42 } from "react/jsx-runtime";
4453
+ var ROW_CLASSES2 = "flex items-center gap-3 p-1.5 pr-3";
4454
+ function LinkUnavailable({ kind, noun, openIn, card = false }) {
4455
+ const wide = useContext7(inTheBox);
4456
+ return /* @__PURE__ */ jsxs42(Card, { fill: wide ? "elevated" : "inset", className: cn(card ? "flex items-center gap-3 p-3" : ROW_CLASSES2, "max-w-[480px]"), children: [
4457
+ /* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind }) }),
4373
4458
  /* @__PURE__ */ jsxs42("span", { className: "min-w-0 flex-1 truncate text-body-2 text-text-muted", children: [
4374
4459
  noun,
4375
- " \u2014 not available."
4460
+ " not available"
4376
4461
  ] }),
4377
4462
  openIn && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: /* @__PURE__ */ jsxs42(Link, { href: openIn.href, variant: "quiet", external: true, children: [
4378
4463
  "Open in ",
@@ -4381,135 +4466,160 @@ function LinkUnavailable({ kind, noun, openIn }) {
4381
4466
  ] }) })
4382
4467
  ] });
4383
4468
  }
4469
+ function linkMetaOf(linked, withWhen = false) {
4470
+ return [linked.key, kindNounOf(linked), linked.subtitle, withWhen ? linked.updated : void 0].filter(Boolean).join(" \xB7 ");
4471
+ }
4384
4472
  function LinkRow({ link, preview = true }) {
4473
+ const width = "max-w-[480px]";
4385
4474
  if (link.state === "loading") {
4386
- return /* @__PURE__ */ jsx61("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs42(Card, { fill: "inset", "aria-hidden": true, className: "flex h-9 items-center gap-2 px-3", children: [
4387
- /* @__PURE__ */ jsx61(LinkedIcon, { kind: link.kind }),
4388
- /* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", className: "h-3 w-2/5" }),
4389
- /* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", shape: "round", className: "ml-auto size-4" })
4475
+ return /* @__PURE__ */ jsx61("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs42(Card, { fill: "inset", "aria-hidden": true, className: cn(ROW_CLASSES2, width), children: [
4476
+ /* @__PURE__ */ jsx61("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx61(LinkedIcon, { kind: link.kind }) }),
4477
+ /* @__PURE__ */ jsxs42("span", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
4478
+ /* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", className: "h-3 w-2/5" }),
4479
+ /* @__PURE__ */ jsx61(SkeletonBar, { on: "inset", className: "h-2.5 w-1/4" })
4480
+ ] })
4390
4481
  ] }) });
4391
4482
  }
4392
4483
  if (link.state === "unavailable") return /* @__PURE__ */ jsx61(LinkUnavailable, { kind: link.kind, noun: link.noun, openIn: link.openIn });
4393
4484
  const { linked } = link;
4394
4485
  const status = chosenOf(linked.status);
4395
4486
  const owner = chosenOf(linked.owner);
4396
- const said = linked.kind === "message" && linked.author;
4397
- const row = /* @__PURE__ */ jsxs42(Card, { fill: "inset", hover: "hairline", className: "relative flex h-9 items-center gap-2 px-3", children: [
4398
- said ? /* @__PURE__ */ jsx61(Avatar, { name: said.name, src: said.picture, size: 16 }) : /* @__PURE__ */ jsx61(LinkedIcon, { kind: linked.kind }),
4399
- said ? /* @__PURE__ */ jsxs42("span", { className: "flex min-w-0 flex-1 items-baseline gap-2 text-body-2", children: [
4400
- /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-body-2-strong text-text-primary", children: said.name }),
4401
- /* @__PURE__ */ jsx61("span", { className: "contents text-text-secondary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, children: linked.body ?? linked.title }) })
4402
- ] }) : /* @__PURE__ */ jsxs42(Fragment15, { children: [
4403
- linked.key && /* @__PURE__ */ jsx61(LinkKey, { children: linked.key }),
4404
- /* @__PURE__ */ jsx61("span", { className: "contents text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, className: "min-w-0 flex-1", children: linked.title }) })
4487
+ const said = linked.kind === "message" ? linked.author : void 0;
4488
+ const meta = said ? linked.body ?? "" : linkMetaOf(linked, true) || linked.summary;
4489
+ const row = /* @__PURE__ */ jsxs42(Card, { fill: "inset", hover: "hairline", className: cn("relative", ROW_CLASSES2, width), children: [
4490
+ /* @__PURE__ */ jsx61(LinkTile, { kind: linked.kind, author: said }),
4491
+ /* @__PURE__ */ jsxs42("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
4492
+ said ? (
4493
+ // As a card of words a person wrote: the name, then the time beside it, muted.
4494
+ /* @__PURE__ */ jsxs42("span", { className: "flex min-w-0 items-baseline gap-2", children: [
4495
+ /* @__PURE__ */ jsx61("span", { className: "contents text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, children: said.name }) }),
4496
+ linked.updated && /* @__PURE__ */ jsx61("span", { className: cn("shrink-0 text-caption text-text-muted", TIME_CLASSES), children: linked.updated })
4497
+ ] })
4498
+ ) : /* @__PURE__ */ jsx61("span", { className: "contents text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx61(Link, { href: linked.href, variant: "quiet", cover: true, truncate: true, children: linked.title }) }),
4499
+ meta && /* @__PURE__ */ jsx61("span", { className: "truncate text-caption text-text-secondary", children: meta })
4405
4500
  ] }),
4406
- linked.updated && /* @__PURE__ */ jsx61("span", { className: "shrink-0 text-caption text-text-secondary", children: linked.updated }),
4407
- linked.conversation && (linked.conversation.unread || linked.kind === "topic") && /* @__PURE__ */ jsx61(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
4408
- status?.colour && !linked.done && /* @__PURE__ */ jsx61(StatusMark, { status: { label: status.label, colour: status.colour } }),
4409
- linked.done && /* @__PURE__ */ jsx61(ProgressRing, { done: linked.done.done, total: linked.done.total }),
4410
- owner && /* @__PURE__ */ jsx61(Avatar, { name: owner.label, src: owner.picture, size: 16 }),
4411
- linked.members && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.members, size: 16 }),
4412
- linked.authors && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.authors, size: 16 })
4501
+ /* @__PURE__ */ jsxs42("span", { className: "flex h-[19.6px] shrink-0 items-center gap-2 self-start", children: [
4502
+ linked.done ? /* @__PURE__ */ jsx61(ProgressRing, { done: linked.done.done, total: linked.done.total }) : status?.colour && /* @__PURE__ */ jsx61(StatusMark, { status: { label: status.label, colour: status.colour } }),
4503
+ linked.conversation && /* @__PURE__ */ jsx61(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
4504
+ owner && /* @__PURE__ */ jsx61(Avatar, { name: owner.label, src: owner.picture, size: 16 }),
4505
+ linked.members && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.members, size: 16, on: "inset" }),
4506
+ linked.authors && /* @__PURE__ */ jsx61(AvatarGroup, { members: linked.authors, size: 16, on: "inset" })
4507
+ ] })
4413
4508
  ] });
4414
4509
  return preview ? /* @__PURE__ */ jsx61(LinkPreview, { linked, block: true, children: row }) : row;
4415
4510
  }
4416
4511
 
4417
4512
  // src/LinkCard.tsx
4418
- import { Fragment as Fragment16, jsx as jsx62, jsxs as jsxs43 } from "react/jsx-runtime";
4513
+ import { Fragment as Fragment15, jsx as jsx62, jsxs as jsxs43 } from "react/jsx-runtime";
4514
+ var CARD_CLASSES = "flex flex-col gap-3 p-3";
4419
4515
  function LinkCard({ link, readOnly = false, bare = false }) {
4516
+ const boxed = useContext8(inTheBox);
4420
4517
  if (link.state === "loading") return /* @__PURE__ */ jsx62(LinkCardLoading, { kind: link.kind, shape: link.shape });
4421
- if (link.state === "unavailable") return /* @__PURE__ */ jsx62(LinkUnavailable, { kind: link.kind, noun: link.noun, openIn: link.openIn });
4518
+ if (link.state === "unavailable") return /* @__PURE__ */ jsx62(LinkUnavailable, { kind: link.kind, noun: link.noun, openIn: link.openIn, card: true });
4422
4519
  const { linked } = link;
4423
- const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx62(SaidBody, { linked }) : /* @__PURE__ */ jsx62(CardBody, { linked, readOnly });
4424
- if (bare) return /* @__PURE__ */ jsx62("div", { className: "flex flex-col gap-2 p-3", children: body });
4425
- return /* @__PURE__ */ jsx62(Card, { fill: "inset", className: "flex flex-col gap-2 p-3", children: body });
4520
+ const body = linked.kind === "message" && linked.author ? /* @__PURE__ */ jsx62(SaidBody, { linked }) : /* @__PURE__ */ jsx62(CardBody, { linked, readOnly: readOnly || boxed });
4521
+ if (bare) return /* @__PURE__ */ jsx62("div", { className: CARD_CLASSES, children: body });
4522
+ return /* @__PURE__ */ jsx62(Card, { fill: boxed ? "elevated" : "inset", className: cn(CARD_CLASSES, "max-w-[480px]"), children: body });
4426
4523
  }
4427
4524
  function CardBody({ linked, readOnly }) {
4428
- return /* @__PURE__ */ jsxs43(Fragment16, { children: [
4429
- /* @__PURE__ */ jsxs43("div", { className: "flex min-h-[19.6px] items-center gap-2", children: [
4430
- /* @__PURE__ */ jsx62("span", { className: "flex min-w-0 flex-1 text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsxs43(Link, { href: linked.href, variant: "quiet", className: "flex min-w-0 flex-1 items-center gap-2", children: [
4431
- /* @__PURE__ */ jsx62(LinkedIcon, { kind: linked.kind }),
4432
- /* @__PURE__ */ jsx62("span", { className: "truncate", children: linked.title })
4433
- ] }) }),
4434
- linked.done && /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }),
4435
- linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16 })
4525
+ const boxed = useContext8(inTheBox);
4526
+ const on = boxed ? "elevated" : "inset";
4527
+ const meta = linkMetaOf(linked);
4528
+ const footed = Boolean(linked.status || linked.owner || linked.authors || linked.updated);
4529
+ return /* @__PURE__ */ jsxs43(Fragment15, { children: [
4530
+ /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
4531
+ /* @__PURE__ */ jsx62(LinkTile, { kind: linked.kind }),
4532
+ /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
4533
+ /* @__PURE__ */ jsx62("span", { className: "block min-w-0 text-body-2-strong text-text-primary", children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", truncate: true, className: "block", children: linked.title }) }),
4534
+ meta && /* @__PURE__ */ jsx62("span", { className: "truncate text-caption text-text-secondary", children: meta })
4535
+ ] }),
4536
+ (linked.done || linked.conversation || linked.members) && // On the title's line, not halfway down the header: the ring, the count, the faces, as a row's (Katerina, 30 Oct).
4537
+ /* @__PURE__ */ jsxs43("span", { className: "flex h-[19.6px] shrink-0 items-center gap-2 self-start", children: [
4538
+ linked.done && /* @__PURE__ */ jsx62(ProgressRing, { done: linked.done.done, total: linked.done.total }),
4539
+ linked.conversation && /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }),
4540
+ linked.members && /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.members, size: 16, on })
4541
+ ] })
4436
4542
  ] }),
4437
- (linked.key || linked.subtitle) && /* @__PURE__ */ jsx62("p", { className: "-mt-1 pl-6 text-caption text-text-secondary", children: [linked.key, linked.subtitle].filter(Boolean).join(" \xB7 ") }),
4438
4543
  linked.summary && /* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.summary }),
4439
- linked.children && linked.children.length > 0 && /* @__PURE__ */ jsx62("div", { className: "flex flex-col divide-y divide-border-subtle rounded-md border border-border-subtle leaf:divide-border-strong leaf:border-border-strong", children: linked.children.map((child) => /* @__PURE__ */ jsxs43("div", { className: "relative flex h-8 items-center gap-2 px-2 hover:bg-bg-active", children: [
4544
+ linked.children && linked.children.length > 0 && // In a box of their own, a hairline between them, as the card first drew them (Katerina, 29 Oct: "add back the borders").
4545
+ /* @__PURE__ */ jsx62("div", { className: "flex flex-col divide-y divide-border-subtle rounded-md border border-border-subtle leaf:divide-border-strong leaf:border-border-strong", children: linked.children.map((child) => /* @__PURE__ */ jsxs43("div", { className: "relative flex h-8 items-center gap-2 px-2 hover:bg-bg-active", children: [
4440
4546
  /* @__PURE__ */ jsx62(StatusMark, { status: child.status }),
4441
4547
  child.key && /* @__PURE__ */ jsx62(LinkKey, { children: child.key }),
4442
4548
  /* @__PURE__ */ jsx62("span", { className: "contents text-body-2 text-text-primary", children: /* @__PURE__ */ jsx62(Link, { href: child.href, variant: "quiet", cover: true, truncate: true, className: "min-w-0 flex-1", children: child.title }) }),
4443
4549
  child.owner ? /* @__PURE__ */ jsx62(Avatar, { name: child.owner.name, src: child.owner.picture, size: 16 }) : /* @__PURE__ */ jsx62("span", { className: "size-4 shrink-0", "aria-hidden": true })
4444
4550
  ] }, child.id)) }),
4445
- linked.latest && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1", children: [
4551
+ linked.latest && // 12px between the words "Latest conversation" and the quote they name (Katerina, 29 Oct).
4552
+ /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-3", children: [
4446
4553
  /* @__PURE__ */ jsx62("span", { className: "text-caption text-text-muted", children: "Latest conversation" }),
4447
- /* @__PURE__ */ jsxs43("div", { className: "flex gap-2 rounded-md border border-border-subtle p-2 leaf:border-border-strong", children: [
4448
- /* @__PURE__ */ jsx62(Avatar, { name: linked.latest.author.name, src: linked.latest.author.picture, size: 16 }),
4449
- /* @__PURE__ */ jsxs43("div", { className: "min-w-0 flex-1", children: [
4450
- /* @__PURE__ */ jsxs43("div", { className: "flex items-baseline gap-2 text-caption", children: [
4451
- /* @__PURE__ */ jsx62("span", { className: "text-text-primary", children: linked.latest.author.name }),
4452
- /* @__PURE__ */ jsx62("span", { className: "text-text-muted", children: linked.latest.at })
4453
- ] }),
4454
- /* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.latest.body })
4455
- ] })
4554
+ /* @__PURE__ */ jsxs43("div", { className: cn("flex flex-col gap-1", QUOTE_BAR_CLASSES), children: [
4555
+ /* @__PURE__ */ jsxs43("span", { className: "flex items-center gap-2 text-caption", children: [
4556
+ /* @__PURE__ */ jsx62(Avatar, { name: linked.latest.author.name, src: linked.latest.author.picture, size: 16 }),
4557
+ /* @__PURE__ */ jsx62("span", { className: "text-text-primary", children: linked.latest.author.name }),
4558
+ /* @__PURE__ */ jsx62("span", { className: cn("text-text-muted", TIME_CLASSES), children: linked.latest.at })
4559
+ ] }),
4560
+ /* @__PURE__ */ jsx62("p", { className: "line-clamp-2 text-body-2 text-text-secondary", children: linked.latest.body })
4456
4561
  ] })
4457
4562
  ] }),
4458
- /* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2 border-t border-border-subtle pt-2 leaf:border-border-strong", children: [
4563
+ footed && /* @__PURE__ */ jsxs43("div", { className: "flex min-h-6 items-center gap-2", children: [
4459
4564
  (linked.status || linked.owner) && /* @__PURE__ */ jsx62(LinkPickers, { status: linked.status, owner: linked.owner, ownerLabel: linked.ownerLabel, readOnly }),
4460
4565
  linked.authors ? /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 items-center gap-2 text-caption text-text-secondary", children: [
4461
- /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16 }),
4462
- linked.updated && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: linked.updated })
4463
- ] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */ jsxs43("span", { className: "text-caption text-text-secondary", children: [
4566
+ /* @__PURE__ */ jsx62(AvatarGroup, { members: linked.authors, size: 16, on }),
4567
+ linked.updated && /* @__PURE__ */ jsxs43("span", { className: "shrink-0 italic", children: [
4568
+ "Updated ",
4569
+ linked.updated
4570
+ ] })
4571
+ ] }) : !linked.status && !linked.owner && linked.updated && /* @__PURE__ */ jsxs43("span", { className: "text-caption italic text-text-secondary", children: [
4464
4572
  "Updated ",
4465
4573
  linked.updated
4466
- ] }),
4467
- linked.conversation && /* @__PURE__ */ jsx62("span", { className: "ml-auto flex", children: /* @__PURE__ */ jsx62(CommentCount, { conversation: linked.conversation, noun: linked.conversation.noun }) })
4574
+ ] })
4468
4575
  ] })
4469
4576
  ] });
4470
4577
  }
4471
4578
  function SaidBody({ linked }) {
4472
4579
  const author = linked.author;
4473
- return /* @__PURE__ */ jsxs43(Fragment16, { children: [
4580
+ return /* @__PURE__ */ jsxs43(Fragment15, { children: [
4474
4581
  /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-2", children: [
4475
4582
  /* @__PURE__ */ jsx62(Avatar, { name: author.name, src: author.picture, size: 24 }),
4476
- /* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: author.name }),
4477
- /* @__PURE__ */ jsx62("span", { className: "text-caption text-text-muted", children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated ?? "Open" }) })
4583
+ /* @__PURE__ */ jsx62("span", { className: "text-body-2-strong text-text-primary", children: linked.updated ? author.name : /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: author.name }) }),
4584
+ linked.updated && /* @__PURE__ */ jsx62("span", { className: cn("text-caption text-text-muted", TIME_CLASSES), children: /* @__PURE__ */ jsx62(Link, { href: linked.href, variant: "quiet", children: linked.updated }) })
4478
4585
  ] }),
4479
- /* @__PURE__ */ jsx62("p", { className: "line-clamp-4 text-body-2 text-text-primary", children: linked.body ?? linked.title })
4586
+ /* @__PURE__ */ jsx62("p", { className: "line-clamp-4 text-body-2 text-text-secondary", children: linked.body ?? linked.title })
4480
4587
  ] });
4481
4588
  }
4482
4589
  var KIND_SHAPE = {
4483
4590
  issue: { subtitle: true, summary: true, footer: "pickers" },
4484
- project: { subtitle: false, summary: true, rows: 3, ring: true, footer: "pickers" },
4485
- topic: { summary: true, latest: true, footer: "line" },
4591
+ project: { subtitle: true, summary: true, rows: 3, ring: true, footer: "pickers" },
4592
+ topic: { subtitle: true, summary: true, latest: true, footer: "line" },
4486
4593
  page: { subtitle: true, summary: true, footer: "people" },
4487
4594
  file: { summary: false, footer: "line" },
4488
4595
  message: { summary: true, footer: "none" }
4489
4596
  };
4490
4597
  function LinkCardLoading({ kind, shape }) {
4491
4598
  const { subtitle = false, summary = true, rows = 0, latest = false, ring = false, footer = "line" } = shape ?? KIND_SHAPE[kind];
4492
- return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: "inset", "aria-hidden": true, className: "flex flex-col gap-2 p-3", children: [
4493
- /* @__PURE__ */ jsxs43("div", { className: "flex h-[19.6px] items-center gap-2", children: [
4494
- /* @__PURE__ */ jsx62(LinkedIcon, { kind }),
4495
- /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3.5 w-1/2" }),
4496
- ring && /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "round", className: "ml-auto size-4" })
4599
+ const boxed = useContext8(inTheBox);
4600
+ return /* @__PURE__ */ jsx62("div", { className: "animate-skeleton-in", "aria-busy": true, children: /* @__PURE__ */ jsxs43(Card, { fill: boxed ? "elevated" : "inset", "aria-hidden": true, className: cn(CARD_CLASSES, "max-w-[480px]"), children: [
4601
+ /* @__PURE__ */ jsxs43("div", { className: "flex items-center gap-3", children: [
4602
+ /* @__PURE__ */ jsx62("span", { className: TYPE_TILE_CLASSES, children: /* @__PURE__ */ jsx62(LinkedIcon, { kind }) }),
4603
+ /* @__PURE__ */ jsxs43("span", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
4604
+ /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3.5 w-1/2" }),
4605
+ subtitle && /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-20" })
4606
+ ] }),
4607
+ ring && /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "round", className: "size-4 self-start" })
4497
4608
  ] }),
4498
- subtitle && /* @__PURE__ */ jsx62("div", { className: "-mt-1 flex h-[14.4px] items-center pl-6", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-20" }) }),
4499
4609
  summary && /* @__PURE__ */ jsx62("div", { className: "flex h-[19.6px] items-center", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-4/5" }) }),
4500
4610
  rows > 0 && /* @__PURE__ */ jsx62("div", { className: "flex flex-col divide-y divide-border-subtle rounded-md border border-border-subtle leaf:divide-border-strong leaf:border-border-strong", children: Array.from({ length: rows }, (_, i) => /* @__PURE__ */ jsx62("div", { className: "flex h-8 items-center px-2", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-1/3" }) }, i)) }),
4501
- latest && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-1", children: [
4611
+ latest && /* @__PURE__ */ jsxs43("div", { className: "flex flex-col gap-3", children: [
4502
4612
  /* @__PURE__ */ jsx62("div", { className: "flex h-[14.4px] items-center", children: /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-28" }) }),
4503
- /* @__PURE__ */ jsxs43("div", { className: "flex h-[71.6px] flex-col justify-center gap-2 rounded-md border border-border-subtle p-2 leaf:border-border-strong", children: [
4613
+ /* @__PURE__ */ jsxs43("div", { className: cn("flex h-[57.6px] flex-col justify-center gap-2", QUOTE_BAR_CLASSES), children: [
4504
4614
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-2.5 w-24" }),
4505
4615
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-full" }),
4506
4616
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-3/5" })
4507
4617
  ] })
4508
4618
  ] }),
4509
- footer !== "none" && /* @__PURE__ */ jsx62("div", { className: "flex min-h-6 items-center gap-2 border-t border-border-subtle pt-2 leaf:border-border-strong", children: footer === "pickers" ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
4619
+ footer !== "none" && /* @__PURE__ */ jsx62("div", { className: "flex min-h-6 items-center gap-2", children: footer === "pickers" ? /* @__PURE__ */ jsxs43(Fragment15, { children: [
4510
4620
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "control", className: "h-6 w-24" }),
4511
4621
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "control", className: "h-6 w-28" })
4512
- ] }) : footer === "people" ? /* @__PURE__ */ jsxs43(Fragment16, { children: [
4622
+ ] }) : footer === "people" ? /* @__PURE__ */ jsxs43(Fragment15, { children: [
4513
4623
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", shape: "round", className: "size-4" }),
4514
4624
  /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-40" })
4515
4625
  ] }) : /* @__PURE__ */ jsx62(SkeletonBar, { on: "inset", className: "h-3 w-40" }) })
@@ -4517,7 +4627,7 @@ function LinkCardLoading({ kind, shape }) {
4517
4627
  }
4518
4628
 
4519
4629
  // src/LinkPreview.tsx
4520
- import { Fragment as Fragment17, jsx as jsx63 } from "react/jsx-runtime";
4630
+ import { Fragment as Fragment16, jsx as jsx63 } from "react/jsx-runtime";
4521
4631
  var HOVER = "(hover: hover)";
4522
4632
  function subscribe(onChange) {
4523
4633
  if (typeof window === "undefined" || !window.matchMedia) return () => {
@@ -4535,8 +4645,8 @@ function useCanHover() {
4535
4645
  }
4536
4646
  function LinkPreview({ linked, block = false, children }) {
4537
4647
  const canHover = useCanHover();
4538
- if (!canHover) return /* @__PURE__ */ jsx63(Fragment17, { children });
4539
- return /* @__PURE__ */ jsx63(PreviewCard, { side: "bottom", content: /* @__PURE__ */ jsx63(LinkCard, { link: { state: "ready", linked }, bare: true, readOnly: true }), wrapperClassName: block ? "grid w-full min-w-0 grid-cols-[minmax(0,1fr)]" : "max-w-full", children });
4648
+ if (!canHover) return /* @__PURE__ */ jsx63(Fragment16, { children });
4649
+ return /* @__PURE__ */ jsx63(PreviewCard, { side: "top", contentClassName: "p-0", content: /* @__PURE__ */ jsx63(LinkCard, { link: { state: "ready", linked }, bare: true, readOnly: true }), wrapperClassName: block ? "grid w-full min-w-0 grid-cols-[minmax(0,1fr)]" : "max-w-full", children });
4540
4650
  }
4541
4651
  function LinkPreviewOpen({ linked }) {
4542
4652
  return /* @__PURE__ */ jsx63(MenuPanel, { className: "w-[360px] p-0", children: /* @__PURE__ */ jsx63(LinkCard, { link: { state: "ready", linked }, bare: true, readOnly: true }) });
@@ -4551,7 +4661,7 @@ function LinkChip({ link, preview = true }) {
4551
4661
  if (link.state === "unavailable") {
4552
4662
  return /* @__PURE__ */ jsxs44(InlineChip, { tone: "muted", icon: /* @__PURE__ */ jsx64(LinkedIcon, { kind: link.kind, size: 14, tone: "inherit" }), children: [
4553
4663
  link.noun,
4554
- ", not available"
4664
+ " not available"
4555
4665
  ] });
4556
4666
  }
4557
4667
  const { linked } = link;
@@ -4560,11 +4670,12 @@ function LinkChip({ link, preview = true }) {
4560
4670
  const chip = /* @__PURE__ */ jsxs44(
4561
4671
  InlineChip,
4562
4672
  {
4563
- icon: said ? /* @__PURE__ */ jsx64(Avatar, { name: said.name, src: said.picture, size: 16 }) : /* @__PURE__ */ jsx64(LinkedIcon, { kind: linked.kind, size: 14, tone: "inherit" }),
4673
+ icon: said ? /* @__PURE__ */ jsx64(Avatar, { name: said.name, src: said.picture, size: 14 }) : /* @__PURE__ */ jsx64(LinkedIcon, { kind: linked.kind, size: 14, tone: "inherit" }),
4564
4674
  href: linked.href,
4565
- className: "max-w-[28ch]",
4675
+ className: preview ? "min-w-0 max-w-[40ch]" : "max-w-[min(40ch,calc(100%_-_4px))]",
4566
4676
  children: [
4567
- linked.key && /* @__PURE__ */ jsx64(LinkKey, { children: linked.key }),
4677
+ linked.key && // 4px more than the chip's gap after it, and kept whole: "ABC-2" never breaks at its hyphen.
4678
+ /* @__PURE__ */ jsx64("span", { className: "mr-1 shrink-0 whitespace-nowrap", children: /* @__PURE__ */ jsx64(LinkKey, { tone: "secondary", children: linked.key }) }),
4568
4679
  /* @__PURE__ */ jsx64("span", { className: "truncate", children: said ? `${said.name}: ${linked.body ?? linked.title}` : linked.title }),
4569
4680
  status?.colour && /* @__PURE__ */ jsx64(StatusMark, { status: { label: status.label, colour: status.colour } })
4570
4681
  ]
@@ -4573,40 +4684,46 @@ function LinkChip({ link, preview = true }) {
4573
4684
  return preview ? /* @__PURE__ */ jsx64(LinkPreview, { linked, children: chip }) : chip;
4574
4685
  }
4575
4686
 
4576
- // src/CardUnder.tsx
4577
- import { IconX as IconX6 } from "@tabler/icons-react";
4687
+ // src/AttachedCard.tsx
4578
4688
  import { jsx as jsx65, jsxs as jsxs45 } from "react/jsx-runtime";
4579
- function CardUnder({ link, children, onRemove, revealOnHover = false }) {
4580
- return /* @__PURE__ */ jsxs45("div", { className: "group/card flex max-w-[480px] items-start gap-1", children: [
4581
- /* @__PURE__ */ jsx65("div", { className: "min-w-0 flex-1", children: link ? /* @__PURE__ */ jsx65(LinkCard, { link }) : children }),
4582
- onRemove && // At the card's top corner: halfway down a tall card a ✕ reads as belonging to nothing.
4583
- /* @__PURE__ */ jsx65(
4584
- "div",
4585
- {
4586
- className: cn(
4587
- "flex shrink-0 self-start pt-2",
4588
- revealOnHover && "opacity-0 transition-opacity group-hover/card:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-100"
4589
- ),
4590
- children: /* @__PURE__ */ jsx65(IconButton, { "aria-label": "Remove card", tooltip: "Remove card", onClick: onRemove, children: /* @__PURE__ */ jsx65(IconX6, { size: 16 }) })
4591
- }
4592
- )
4593
- ] });
4689
+ function AttachedCard({ link, children, onRemove }) {
4690
+ return (
4691
+ // At most 480px, so it never runs a column's or a wide box's whole width (Katerina, 29 and 30 Oct).
4692
+ /* @__PURE__ */ jsxs45("div", { className: "group/card relative max-w-[480px]", children: [
4693
+ link ? /* @__PURE__ */ jsx65(LinkCard, { link }) : children,
4694
+ onRemove && /* @__PURE__ */ jsx65(
4695
+ RemoveBadge,
4696
+ {
4697
+ label: "Remove",
4698
+ onRemove,
4699
+ className: "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100"
4700
+ }
4701
+ )
4702
+ ] })
4703
+ );
4594
4704
  }
4595
4705
 
4596
4706
  // src/PartCard.tsx
4597
- import { Fragment as Fragment18, jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
4598
- function PartCard({ state = "ready", kind, heading, href, partKey, noun = "Item", openIn, children }) {
4707
+ import { useContext as useContext9 } from "react";
4708
+ import { jsx as jsx66, jsxs as jsxs46 } from "react/jsx-runtime";
4709
+ function PartCard({ state = "ready", kind, heading, href, partKey, noun, openIn, children, action, maxHeight }) {
4710
+ const word = noun ?? kindNounOf({ kind }) ?? "File";
4711
+ const boxed = useContext9(inTheBox);
4599
4712
  if (state === "loading") return /* @__PURE__ */ jsx66(LinkCardLoading, { kind, shape: { summary: true, rows: 0, footer: "none" } });
4600
- if (state === "unavailable") return /* @__PURE__ */ jsx66(LinkUnavailable, { kind, noun: `A part of this ${noun.toLowerCase()}`, openIn });
4601
- const header = /* @__PURE__ */ jsxs46(Fragment18, { children: [
4602
- /* @__PURE__ */ jsx66(LinkedIcon, { kind }),
4603
- partKey && /* @__PURE__ */ jsx66(LinkKey, { children: partKey }),
4604
- /* @__PURE__ */ jsx66("span", { className: "truncate", children: heading })
4605
- ] });
4606
- return /* @__PURE__ */ jsxs46(Card, { fill: "inset", className: "flex flex-col gap-2 p-3", children: [
4607
- /* @__PURE__ */ jsx66("span", { className: "flex min-w-0 items-center gap-2 text-body-2-strong text-text-primary", children: href ? /* @__PURE__ */ jsx66(Link, { href, variant: "quiet", className: "flex min-w-0 items-center gap-2", children: header }) : header }),
4608
- /* @__PURE__ */ jsx66("div", { className: "border-l-2 border-border-default pl-3", children })
4609
- ] });
4713
+ if (state === "unavailable") return /* @__PURE__ */ jsx66(LinkUnavailable, { kind, noun: `A part of this ${word.toLowerCase()}`, openIn, card: true });
4714
+ return (
4715
+ // At most 480px wide, in a box too; in a box being written in, on the files' fill as the card beside it is.
4716
+ /* @__PURE__ */ jsxs46(Card, { fill: boxed ? "elevated" : "inset", className: "flex max-w-[480px] flex-col gap-3 p-3", children: [
4717
+ /* @__PURE__ */ jsxs46("div", { className: "flex items-center gap-3", children: [
4718
+ /* @__PURE__ */ jsx66(LinkTile, { kind }),
4719
+ /* @__PURE__ */ jsxs46("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
4720
+ /* @__PURE__ */ jsx66("span", { className: "block min-w-0 text-body-2-strong text-text-primary", children: href ? /* @__PURE__ */ jsx66(Link, { href, variant: "quiet", truncate: true, className: "block", children: heading }) : /* @__PURE__ */ jsx66("span", { className: "block truncate", children: heading }) }),
4721
+ /* @__PURE__ */ jsx66("span", { className: "truncate text-caption text-text-secondary", children: partKey ? `A part of ${partKey}` : `A part of this ${word.toLowerCase()}` })
4722
+ ] })
4723
+ ] }),
4724
+ action || maxHeight !== void 0 ? /* @__PURE__ */ jsx66(ShowMore, { maxHeight: maxHeight ?? Infinity, surface: boxed ? "elevated" : "inset", action, contentClassName: QUOTE_BAR_CLASSES, children }) : /* @__PURE__ */ jsx66("div", { className: QUOTE_BAR_CLASSES, children })
4725
+ ] })
4726
+ );
4610
4727
  }
4611
4728
 
4612
4729
  // src/Rail.tsx
@@ -4737,7 +4854,7 @@ function AddReactionButton({ options, onPick, className }) {
4737
4854
  align: "left",
4738
4855
  ariaLabel: "Add a reaction",
4739
4856
  contentClassName: "p-1",
4740
- className,
4857
+ className: cn("w-auto min-w-0", className),
4741
4858
  trigger: /* @__PURE__ */ jsx71(IconButton, { variant: "muted", tooltip: "Add a reaction", "aria-label": "Add a reaction", children: /* @__PURE__ */ jsx71(IconMoodPlus, { size: 16, stroke: 1.5 }) }),
4742
4859
  children: /* @__PURE__ */ jsx71(
4743
4860
  ReactionPicker,
@@ -4869,7 +4986,7 @@ function ListColumn(props) {
4869
4986
 
4870
4987
  // src/Tabs.tsx
4871
4988
  import { Tabs as BaseTabs } from "@base-ui/react/tabs";
4872
- import { Fragment as Fragment19, jsx as jsx75, jsxs as jsxs54 } from "react/jsx-runtime";
4989
+ import { Fragment as Fragment17, jsx as jsx75, jsxs as jsxs54 } from "react/jsx-runtime";
4873
4990
  function Tabs({ tabs, active, onChange, size = "default", className, ...aria }) {
4874
4991
  return /* @__PURE__ */ jsx75(
4875
4992
  BaseTabs.Root,
@@ -4903,7 +5020,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
4903
5020
  tab.label,
4904
5021
  tab.count !== void 0 ? /* @__PURE__ */ jsx75("span", { className: "ml-2.5 font-mono text-caption tabular-nums text-text-secondary", children: tab.count }) : null
4905
5022
  ] }),
4906
- tab.unread ? /* @__PURE__ */ jsxs54(Fragment19, { children: [
5023
+ tab.unread ? /* @__PURE__ */ jsxs54(Fragment17, { children: [
4907
5024
  /* @__PURE__ */ jsx75(UnreadDot, { className: "h-auto w-auto" }),
4908
5025
  /* @__PURE__ */ jsx75("span", { className: "sr-only", children: "new" })
4909
5026
  ] }) : null
@@ -4918,7 +5035,7 @@ function Tabs({ tabs, active, onChange, size = "default", className, ...aria })
4918
5035
  }
4919
5036
 
4920
5037
  // src/Toast.tsx
4921
- import { createContext as createContext7, useContext as useContext7, useMemo as useMemo6 } from "react";
5038
+ import { createContext as createContext8, useContext as useContext10, useMemo as useMemo6 } from "react";
4922
5039
  import { Toast as BaseToast } from "@base-ui/react/toast";
4923
5040
  import { IconAlertCircle as IconAlertCircle2, IconCircleCheck as IconCircleCheck2, IconCircleX as IconCircleX2 } from "@tabler/icons-react";
4924
5041
  import { jsx as jsx76, jsxs as jsxs55 } from "react/jsx-runtime";
@@ -4969,7 +5086,7 @@ function Toast({ label, type = "neutral", leadingIcon = true, actionLabel, onAct
4969
5086
  hasAction && /* @__PURE__ */ jsx76(Button, { variant: "outlined", size: "small", onClick: onAction, children: actionLabel })
4970
5087
  ] });
4971
5088
  }
4972
- var ToastContext = createContext7(null);
5089
+ var ToastContext = createContext8(null);
4973
5090
  var VISIBLE_TOASTS = 3;
4974
5091
  function ToastProvider({ children }) {
4975
5092
  const manager = useMemo6(() => BaseToast.createToastManager(), []);
@@ -5025,7 +5142,7 @@ function ToastList() {
5025
5142
  });
5026
5143
  }
5027
5144
  function useToast() {
5028
- const ctx = useContext7(ToastContext);
5145
+ const ctx = useContext10(ToastContext);
5029
5146
  if (!ctx) throw new Error("useToast must be used within ToastProvider");
5030
5147
  return ctx;
5031
5148
  }
@@ -5033,6 +5150,7 @@ export {
5033
5150
  AddReactionButton,
5034
5151
  AppProvider,
5035
5152
  AppShell,
5153
+ AttachedCard,
5036
5154
  AttachmentCard,
5037
5155
  Avatar,
5038
5156
  AvatarGroup,
@@ -5041,7 +5159,6 @@ export {
5041
5159
  Breadcrumb,
5042
5160
  Button,
5043
5161
  Card,
5044
- CardUnder,
5045
5162
  Checkbox,
5046
5163
  Chip,
5047
5164
  ChipInput,
@@ -5149,6 +5266,7 @@ export {
5149
5266
  chosenOf,
5150
5267
  cn,
5151
5268
  hueFor,
5269
+ inTheBox,
5152
5270
  initialsFor,
5153
5271
  inlineChipClassName,
5154
5272
  isApplePlatform,