@estiva-app/ui 0.90.2 → 0.91.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 (228) 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/CommentBox.d.ts +1 -1
  8. package/dist/CommentBox.d.ts.map +1 -1
  9. package/dist/InlineText.d.ts +5 -2
  10. package/dist/InlineText.d.ts.map +1 -1
  11. package/dist/Link.d.ts +3 -2
  12. package/dist/Link.d.ts.map +1 -1
  13. package/dist/LinkCard.d.ts +3 -3
  14. package/dist/LinkCard.d.ts.map +1 -1
  15. package/dist/LinkChip.d.ts.map +1 -1
  16. package/dist/LinkParts.d.ts +17 -3
  17. package/dist/LinkParts.d.ts.map +1 -1
  18. package/dist/LinkPreview.d.ts.map +1 -1
  19. package/dist/LinkRow.d.ts +10 -5
  20. package/dist/LinkRow.d.ts.map +1 -1
  21. package/dist/PartCard.d.ts +7 -3
  22. package/dist/PartCard.d.ts.map +1 -1
  23. package/dist/Popover.d.ts +8 -1
  24. package/dist/Popover.d.ts.map +1 -1
  25. package/dist/ReactionRow.d.ts.map +1 -1
  26. package/dist/RichText.d.ts.map +1 -1
  27. package/dist/SuggestionMenu.d.ts +6 -2
  28. package/dist/SuggestionMenu.d.ts.map +1 -1
  29. package/dist/editor.js +19 -12
  30. package/dist/editor.js.map +3 -3
  31. package/dist/eslint/has-a-page-and-a-story.d.ts.map +1 -1
  32. package/dist/eslint/index.js +1093 -1076
  33. package/dist/eslint/index.js.map +4 -4
  34. package/dist/eslint/no-restyled-part.d.ts +9 -4
  35. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  36. package/dist/gates/{chunk-BS5JASHV.js → chunk-P2P6AHRY.js} +2 -2
  37. package/dist/gates/{chunk-BS5JASHV.js.map → chunk-P2P6AHRY.js.map} +2 -2
  38. package/dist/gates/cli.js +1 -1
  39. package/dist/gates/gate-config.d.ts +4 -1
  40. package/dist/gates/gate-config.d.ts.map +1 -1
  41. package/dist/gates/hook.d.ts.map +1 -1
  42. package/dist/gates/index.js +2 -2
  43. package/dist/gates/index.js.map +2 -2
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +275 -185
  47. package/dist/index.js.map +4 -4
  48. package/dist/linked.d.ts +7 -9
  49. package/dist/linked.d.ts.map +1 -1
  50. package/dist/linked.examples.d.ts.map +1 -1
  51. package/dist/linkedFrom.d.ts.map +1 -1
  52. package/dist/links.d.ts +2 -2
  53. package/dist/links.d.ts.map +1 -1
  54. package/dist/looks.d.ts +24 -0
  55. package/dist/looks.d.ts.map +1 -1
  56. package/dist/registry/{app-X2GI4WTU.js → app-IGBRDD4L.js} +3 -3
  57. package/dist/registry/{build-P6X3PTZP.js → build-MWN4UI23.js} +2 -2
  58. package/dist/registry/{chunk-P55P2QFD.js → chunk-4TWYUIOB.js} +1 -1
  59. package/dist/registry/chunk-4TWYUIOB.js.map +7 -0
  60. package/dist/registry/{chunk-V67F474L.js → chunk-NSHK76XT.js} +2 -2
  61. package/dist/registry/{chunk-4QWD3EBY.js → chunk-THI3SLW5.js} +1 -1
  62. package/dist/registry/{chunk-4QWD3EBY.js.map → chunk-THI3SLW5.js.map} +1 -1
  63. package/dist/registry/cli.js +3 -3
  64. package/dist/registry/find.d.ts +1 -1
  65. package/dist/registry/find.d.ts.map +1 -1
  66. package/dist/registry/index.js +3 -3
  67. package/package.json +1 -1
  68. package/registry.json +509 -455
  69. package/src/AppProvider.stories.tsx +1 -1
  70. package/src/AppShell.stories.tsx +1 -1
  71. package/src/AttachedCard.mdx +55 -0
  72. package/src/{CardUnder.stories.tsx → AttachedCard.stories.tsx} +10 -19
  73. package/src/{CardUnder.test.tsx → AttachedCard.test.tsx} +8 -8
  74. package/src/AttachedCard.tsx +43 -0
  75. package/src/AttachmentCard.stories.tsx +1 -1
  76. package/src/AttachmentCard.tsx +36 -14
  77. package/src/Avatar.stories.tsx +1 -1
  78. package/src/AvatarGroup.stories.tsx +1 -1
  79. package/src/AvatarGroup.tsx +8 -2
  80. package/src/Banner.stories.tsx +1 -1
  81. package/src/BlockHandle.stories.tsx +1 -1
  82. package/src/BlockNodes.stories.tsx +1 -1
  83. package/src/Breadcrumb.stories.tsx +1 -1
  84. package/src/Button.stories.tsx +1 -1
  85. package/src/Card.stories.tsx +1 -1
  86. package/src/Checkbox.stories.tsx +1 -1
  87. package/src/Chip.stories.tsx +1 -1
  88. package/src/ChipInput.stories.tsx +1 -1
  89. package/src/CodeBlockColours.stories.tsx +1 -1
  90. package/src/CollapsibleSection.stories.tsx +1 -1
  91. package/src/CommandPalette.stories.tsx +1 -1
  92. package/src/CommentBox.mdx +3 -3
  93. package/src/CommentBox.stories.tsx +39 -7
  94. package/src/CommentBox.tsx +27 -17
  95. package/src/CommentHighlights.stories.tsx +1 -1
  96. package/src/ComposerTriggers.stories.tsx +1 -1
  97. package/src/ConfirmDialog.stories.tsx +1 -1
  98. package/src/ContainerHeader.stories.tsx +1 -1
  99. package/src/DialogShell.stories.tsx +1 -1
  100. package/src/Divider.stories.tsx +1 -1
  101. package/src/DocumentEditor.stories.tsx +1 -1
  102. package/src/EditableText.stories.tsx +1 -1
  103. package/src/EditorBlockHandle.stories.tsx +1 -1
  104. package/src/EditorTableControls.stories.tsx +1 -1
  105. package/src/EmptyState.stories.tsx +1 -1
  106. package/src/EntryShell.mdx +1 -1
  107. package/src/EntryShell.stories.tsx +1 -1
  108. package/src/ErrorBoundary.stories.tsx +1 -1
  109. package/src/Field.stories.tsx +1 -1
  110. package/src/FieldLine.stories.tsx +1 -1
  111. package/src/FilePicker.stories.tsx +1 -1
  112. package/src/Form.stories.tsx +1 -1
  113. package/src/IconButton.stories.tsx +1 -1
  114. package/src/IdentityMenu.stories.tsx +1 -1
  115. package/src/InlineChip.stories.tsx +1 -1
  116. package/src/InlineText.mdx +1 -0
  117. package/src/InlineText.stories.tsx +6 -3
  118. package/src/InlineText.tsx +7 -2
  119. package/src/Kbd.stories.tsx +1 -1
  120. package/src/KindIcon.stories.tsx +1 -1
  121. package/src/Lightbox.stories.tsx +1 -1
  122. package/src/Link.mdx +3 -2
  123. package/src/Link.stories.tsx +1 -1
  124. package/src/Link.test.tsx +5 -3
  125. package/src/Link.tsx +5 -3
  126. package/src/LinkCard.mdx +5 -4
  127. package/src/LinkCard.stories.tsx +1 -1
  128. package/src/LinkCard.test.tsx +1 -1
  129. package/src/LinkCard.tsx +80 -57
  130. package/src/LinkChip.mdx +3 -3
  131. package/src/LinkChip.stories.tsx +1 -1
  132. package/src/LinkChip.test.tsx +1 -1
  133. package/src/LinkChip.tsx +16 -3
  134. package/src/LinkChips.stories.tsx +1 -1
  135. package/src/LinkParts.stories.tsx +1 -1
  136. package/src/LinkParts.tsx +40 -8
  137. package/src/LinkPlaces.stories.tsx +1 -1
  138. package/src/LinkPreview.mdx +1 -1
  139. package/src/LinkPreview.stories.tsx +1 -1
  140. package/src/LinkPreview.tsx +3 -1
  141. package/src/LinkRow.mdx +8 -6
  142. package/src/LinkRow.stories.tsx +3 -3
  143. package/src/LinkRow.test.tsx +3 -3
  144. package/src/LinkRow.tsx +71 -40
  145. package/src/ListColumn.stories.tsx +1 -1
  146. package/src/MembersDialog.stories.tsx +1 -1
  147. package/src/MembersPill.stories.tsx +1 -1
  148. package/src/Menu.stories.tsx +1 -1
  149. package/src/MenuItem.stories.tsx +1 -1
  150. package/src/NavItem.stories.tsx +1 -1
  151. package/src/NavTree.stories.tsx +1 -1
  152. package/src/Panel.stories.tsx +1 -1
  153. package/src/PartCard.mdx +4 -4
  154. package/src/PartCard.stories.tsx +11 -8
  155. package/src/PartCard.test.tsx +5 -3
  156. package/src/PartCard.tsx +33 -24
  157. package/src/PastedImages.stories.tsx +1 -1
  158. package/src/PastedMarkdown.stories.tsx +1 -1
  159. package/src/Person.stories.tsx +1 -1
  160. package/src/PersonTrigger.stories.tsx +1 -1
  161. package/src/Popover.stories.tsx +1 -1
  162. package/src/Popover.tsx +6 -2
  163. package/src/PreviewCard.stories.tsx +1 -1
  164. package/src/ProgressBar.stories.tsx +1 -1
  165. package/src/Property.stories.tsx +1 -1
  166. package/src/Rail.stories.tsx +1 -1
  167. package/src/RailItem.stories.tsx +1 -1
  168. package/src/Reaction.stories.tsx +1 -1
  169. package/src/ReactionPicker.stories.tsx +1 -1
  170. package/src/ReactionRow.stories.tsx +1 -1
  171. package/src/ReactionRow.tsx +3 -1
  172. package/src/ReferenceCards.mdx +3 -0
  173. package/src/ReferenceCards.stories.tsx +3 -1
  174. package/src/ReferenceMenu.mdx +1 -1
  175. package/src/ReferenceMenu.stories.tsx +1 -1
  176. package/src/RichText.stories.tsx +1 -1
  177. package/src/RichText.tsx +6 -2
  178. package/src/ScrollArea.stories.tsx +1 -1
  179. package/src/SearchInput.stories.tsx +1 -1
  180. package/src/SectionHeader.stories.tsx +1 -1
  181. package/src/SectionLabel.stories.tsx +1 -1
  182. package/src/Select.stories.tsx +1 -1
  183. package/src/SelectionToolbar.stories.tsx +1 -1
  184. package/src/ShowMore.stories.tsx +1 -1
  185. package/src/Sidebar.stories.tsx +1 -1
  186. package/src/Skeleton.stories.tsx +1 -1
  187. package/src/SuggestionMenu.mdx +4 -1
  188. package/src/SuggestionMenu.stories.tsx +14 -8
  189. package/src/SuggestionMenu.tsx +20 -3
  190. package/src/Tabs.stories.tsx +1 -1
  191. package/src/TextInput.stories.tsx +1 -1
  192. package/src/Textarea.stories.tsx +1 -1
  193. package/src/Toast.stories.tsx +1 -1
  194. package/src/Toolbar.stories.tsx +1 -1
  195. package/src/Tooltip.stories.tsx +1 -1
  196. package/src/TopBar.stories.tsx +1 -1
  197. package/src/UnreadDot.stories.tsx +1 -1
  198. package/src/eslint/has-a-page-and-a-story.test.ts +5 -0
  199. package/src/eslint/has-a-page-and-a-story.ts +11 -2
  200. package/src/eslint/no-restyled-part.test.ts +32 -8
  201. package/src/eslint/no-restyled-part.ts +50 -23
  202. package/src/gates/gate-config.ts +5 -2
  203. package/src/gates/gates.test.ts +20 -2
  204. package/src/gates/hook.ts +4 -3
  205. package/src/index.ts +2 -1
  206. package/src/linked.examples.ts +2 -3
  207. package/src/linked.ts +11 -1
  208. package/src/linkedFrom.ts +1 -0
  209. package/src/links.ts +3 -2
  210. package/src/looks.ts +29 -0
  211. package/src/registry/build.ts +1 -1
  212. package/src/registry/contract.test.ts +1 -1
  213. package/src/registry/find.ts +1 -1
  214. package/src/registry/registry.test.ts +12 -12
  215. package/src/suggestionPopup.tsx +1 -1
  216. package/stories/Choosing.mdx +2 -2
  217. package/stories/DesignTokens.mdx +1 -1
  218. package/stories/GettingStarted.mdx +2 -2
  219. package/stories/Introduction.mdx +23 -4
  220. package/stories/TokensPage.tsx +12 -7
  221. package/dist/CardUnder.d.ts +0 -31
  222. package/dist/CardUnder.d.ts.map +0 -1
  223. package/dist/registry/chunk-P55P2QFD.js.map +0 -7
  224. package/src/CardUnder.mdx +0 -54
  225. package/src/CardUnder.tsx +0 -49
  226. /package/dist/registry/{app-X2GI4WTU.js.map → app-IGBRDD4L.js.map} +0 -0
  227. /package/dist/registry/{build-P6X3PTZP.js.map → build-MWN4UI23.js.map} +0 -0
  228. /package/dist/registry/{chunk-V67F474L.js.map → chunk-NSHK76XT.js.map} +0 -0
package/src/LinkRow.tsx CHANGED
@@ -1,34 +1,52 @@
1
1
  /**
2
- * A link alone on its line: one 36px row for every kind. Hovering it shows its
2
+ * A link alone on its line, in look C (Katerina, 29 Oct): its kind in a file's
3
+ * 36px tile, as an attached file has its type, the title and one line under
4
+ * it (its key and its kind's word), and on the title's line its state, its
5
+ * comments and its faces, the faces at the far right. Hovering it shows its
3
6
  * card; a tap opens it. Loading draws the row in bars; not available says so
4
- * in one line of the same height.
7
+ * in a row of the same shape.
8
+ *
9
+ * At most 480px in a message or a document, as a card is; in a box being
10
+ * written in it fills the box.
5
11
  */
12
+ import { useContext } from 'react'
6
13
  import { Avatar } from './Avatar'
7
14
  import { AvatarGroup } from './AvatarGroup'
8
15
  import { Card } from './Card'
16
+ import { cn } from './cn'
9
17
  import { Link } from './Link'
10
- import { chosenOf, type LinkedKind, type LinkState } from './linked'
11
- import { CommentCount, LinkedIcon, LinkKey, ProgressRing, StatusMark } from './LinkParts'
18
+ import { chosenOf, inTheBox, type Linked, type LinkedKind, type LinkState } from './linked'
19
+ import { CommentCount, kindNounOf, LinkedIcon, LinkTile, ProgressRing, StatusMark } from './LinkParts'
12
20
  import { LinkPreview } from './LinkPreview'
21
+ import { TIME_CLASSES, TYPE_TILE_CLASSES } from './looks'
13
22
  import { SkeletonBar } from './Skeleton'
14
23
 
15
24
  export interface LinkUnavailableProps {
16
25
  kind: LinkedKind
17
- /** What it is, in a word: "Item". Drawn as "Item — not available.". */
26
+ /** What it is, in a word: "Issue". Drawn as "Issue — not available.". */
18
27
  noun: string
19
28
  /** Where it may still open, for someone who can: its app and address. */
20
29
  openIn?: { app: string; href: string }
30
+ /** In a card's place: a card's 12px round it. Default a row's. */
31
+ card?: boolean
21
32
  }
22
33
 
34
+ /** A row's frame: the tile, the two lines and the marks, 6px round the tile. */
35
+ const ROW_CLASSES = 'flex items-center gap-3 p-1.5 pr-3'
36
+
23
37
  /**
24
38
  * Not available: deleted, or not this reader's to see, which read the same.
25
- * One line at a row's height, whether a row or a card was to draw. The way
26
- * out stays, since the app it lives in may still open it for you.
39
+ * Drawn as the row or the card it would have been, on the same fill and edge
40
+ * (Katerina, 29 Oct: "same styling as the linkcard default"), its words muted.
41
+ * The way out stays, since the app it lives in may still open it for you.
27
42
  */
28
- export function LinkUnavailable({ kind, noun, openIn }: LinkUnavailableProps) {
43
+ export function LinkUnavailable({ kind, noun, openIn, card = false }: LinkUnavailableProps) {
44
+ const wide = useContext(inTheBox)
29
45
  return (
30
- <Card fill="none" unreadable className="flex h-9 items-center gap-2 px-3">
31
- <LinkedIcon kind={kind} />
46
+ <Card fill={wide ? 'elevated' : 'inset'} className={cn(card ? 'flex items-center gap-3 p-3' : ROW_CLASSES, !wide && 'max-w-[480px]')}>
47
+ <span className={TYPE_TILE_CLASSES}>
48
+ <LinkedIcon kind={kind} />
49
+ </span>
32
50
  <span className="min-w-0 flex-1 truncate text-body-2 text-text-muted">{noun} — not available.</span>
33
51
  {openIn && (
34
52
  <span className="shrink-0 text-caption text-text-secondary">
@@ -41,6 +59,11 @@ export function LinkUnavailable({ kind, noun, openIn }: LinkUnavailableProps) {
41
59
  )
42
60
  }
43
61
 
62
+ /** The line under a row's or a card's title: its key and what it is, then where it lives and when, as far as the app says. */
63
+ export function linkMetaOf(linked: Linked, withWhen = false): string {
64
+ return [linked.key, kindNounOf(linked), linked.subtitle, withWhen ? linked.updated : undefined].filter(Boolean).join(' · ')
65
+ }
66
+
44
67
  export interface LinkRowProps {
45
68
  link: LinkState
46
69
  /** Hovering shows its card. */
@@ -48,13 +71,19 @@ export interface LinkRowProps {
48
71
  }
49
72
 
50
73
  export function LinkRow({ link, preview = true }: LinkRowProps) {
74
+ const wide = useContext(inTheBox)
75
+ const width = !wide && 'max-w-[480px]'
51
76
  if (link.state === 'loading') {
52
77
  return (
53
78
  <div className="animate-skeleton-in" aria-busy>
54
- <Card fill="inset" aria-hidden className="flex h-9 items-center gap-2 px-3">
55
- <LinkedIcon kind={link.kind} />
56
- <SkeletonBar on="inset" className="h-3 w-2/5" />
57
- <SkeletonBar on="inset" shape="round" className="ml-auto size-4" />
79
+ <Card fill="inset" aria-hidden className={cn(ROW_CLASSES, width)}>
80
+ <span className={TYPE_TILE_CLASSES}>
81
+ <LinkedIcon kind={link.kind} />
82
+ </span>
83
+ <span className="flex min-w-0 flex-1 flex-col gap-1.5">
84
+ <SkeletonBar on="inset" className="h-3 w-2/5" />
85
+ <SkeletonBar on="inset" className="h-2.5 w-1/4" />
86
+ </span>
58
87
  </Card>
59
88
  </div>
60
89
  )
@@ -63,38 +92,40 @@ export function LinkRow({ link, preview = true }: LinkRowProps) {
63
92
  const { linked } = link
64
93
  const status = chosenOf(linked.status)
65
94
  const owner = chosenOf(linked.owner)
66
- const said = linked.kind === 'message' && linked.author
95
+ const said = linked.kind === 'message' ? linked.author : undefined
96
+ const meta = said ? (linked.body ?? '') : linkMetaOf(linked, true) || linked.summary
67
97
  const row = (
68
- <Card fill="inset" hover="hairline" className="relative flex h-9 items-center gap-2 px-3">
69
- {said ? <Avatar name={said.name} src={said.picture} size={16} /> : <LinkedIcon kind={linked.kind} />}
70
- {said ? (
71
- <span className="flex min-w-0 flex-1 items-baseline gap-2 text-body-2">
72
- <span className="shrink-0 text-body-2-strong text-text-primary">{said.name}</span>
73
- <span className="contents text-text-secondary">
74
- <Link href={linked.href} variant="quiet" cover truncate>
75
- {linked.body ?? linked.title}
76
- </Link>
98
+ <Card fill="inset" hover="hairline" className={cn('relative', ROW_CLASSES, width)}>
99
+ <LinkTile kind={linked.kind} author={said} />
100
+ <span className="flex min-w-0 flex-1 flex-col gap-0.5">
101
+ {said ? (
102
+ // As a card of words a person wrote: the name, then the time beside it, muted.
103
+ <span className="flex min-w-0 items-baseline gap-2">
104
+ <span className="contents text-body-2-strong text-text-primary">
105
+ <Link href={linked.href} variant="quiet" cover truncate>
106
+ {said.name}
107
+ </Link>
108
+ </span>
109
+ {linked.updated && <span className={cn('shrink-0 text-caption text-text-muted', TIME_CLASSES)}>{linked.updated}</span>}
77
110
  </span>
78
- </span>
79
- ) : (
80
- <>
81
- {linked.key && <LinkKey>{linked.key}</LinkKey>}
111
+ ) : (
82
112
  <span className="contents text-body-2-strong text-text-primary">
83
- <Link href={linked.href} variant="quiet" cover truncate className="min-w-0 flex-1">
113
+ <Link href={linked.href} variant="quiet" cover truncate>
84
114
  {linked.title}
85
115
  </Link>
86
116
  </span>
87
- </>
88
- )}
89
- {linked.updated && <span className="shrink-0 text-caption text-text-secondary">{linked.updated}</span>}
90
- {/* A row keeps to one line: the count shows only when there is something unread in it, except where conversations are what it holds. */}
91
- {linked.conversation && (linked.conversation.unread || linked.kind === 'topic') && <CommentCount conversation={linked.conversation} noun={linked.conversation.noun} />}
92
- {/* A ring already says how far along it is. */}
93
- {status?.colour && !linked.done && <StatusMark status={{ label: status.label, colour: status.colour }} />}
94
- {linked.done && <ProgressRing done={linked.done.done} total={linked.done.total} />}
95
- {owner && <Avatar name={owner.label} src={owner.picture} size={16} />}
96
- {linked.members && <AvatarGroup members={linked.members} size={16} />}
97
- {linked.authors && <AvatarGroup members={linked.authors} size={16} />}
117
+ )}
118
+ {meta && <span className="truncate text-caption text-text-secondary">{meta}</span>}
119
+ </span>
120
+ {/* On the title's line, not halfway down the row: the state, the comments, then the faces at the far right. */}
121
+ <span className="flex h-[19.6px] shrink-0 items-center gap-2 self-start">
122
+ {/* A ring already says how far along it is. */}
123
+ {linked.done ? <ProgressRing done={linked.done.done} total={linked.done.total} /> : status?.colour && <StatusMark status={{ label: status.label, colour: status.colour }} />}
124
+ {linked.conversation && <CommentCount conversation={linked.conversation} noun={linked.conversation.noun} />}
125
+ {owner && <Avatar name={owner.label} src={owner.picture} size={16} />}
126
+ {linked.members && <AvatarGroup members={linked.members} size={16} on="inset" />}
127
+ {linked.authors && <AvatarGroup members={linked.authors} size={16} on="inset" />}
128
+ </span>
98
129
  </Card>
99
130
  )
100
131
  return preview ? (
@@ -18,7 +18,7 @@ import { Toolbar, ToolbarButton } from './Toolbar'
18
18
  * stand-ins.
19
19
  */
20
20
  const meta = {
21
- title: 'Layout/ListColumn',
21
+ title: 'Page structure/ListColumn',
22
22
  component: ListColumn,
23
23
  parameters: { layout: 'fullscreen' },
24
24
  args: { title: 'Items', children: null },
@@ -9,7 +9,7 @@ const people = [
9
9
  ]
10
10
 
11
11
  const meta = {
12
- title: 'Primitives/MembersDialog',
12
+ title: 'People/MembersDialog',
13
13
  component: MembersDialog,
14
14
  args: {
15
15
  members: [
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { MembersPill } from './MembersPill'
3
3
 
4
4
  const meta = {
5
- title: 'Primitives/MembersPill',
5
+ title: 'People/MembersPill',
6
6
  component: MembersPill,
7
7
  args: {
8
8
  members: [{ name: 'Ana Duarte' }, { name: 'Ravi Mehta' }],
@@ -20,7 +20,7 @@ import { SectionLabel } from './SectionLabel'
20
20
  * story below them is live (Katerina, D25).
21
21
  */
22
22
  const meta = {
23
- title: 'Overlays/Menu',
23
+ title: 'Menus & windows/Menu',
24
24
  component: Menu,
25
25
  decorators: [(Story) => <div className="flex min-h-[260px] w-full items-start justify-center pt-6"><Story /></div>],
26
26
  args: { trigger: <Button variant="outlined">Open the menu</Button>, children: null },
@@ -16,7 +16,7 @@ import { EnterHint, Menu, MenuItem, MenuPanel, MenuSub } from './Menu'
16
16
  * FromATrigger** is where the keyboard and the placement are.
17
17
  */
18
18
  const meta = {
19
- title: 'Overlays/MenuItem',
19
+ title: 'Menus & windows/MenuItem',
20
20
  component: MenuItem,
21
21
  decorators: [
22
22
  (Story) => (
@@ -7,7 +7,7 @@ import { NavItem } from './NavItem'
7
7
  const placeholder = <IconSquareRounded size={16} stroke={1.5} />
8
8
 
9
9
  const meta = {
10
- title: 'Frame/NavItem',
10
+ title: 'App frame/NavItem',
11
11
  component: NavItem,
12
12
  args: { label: 'Item', href: '#', active: false },
13
13
  argTypes: { icon: { control: false } },
@@ -39,7 +39,7 @@ const GROUPS: NavTreeGroup[] = [
39
39
  ]
40
40
 
41
41
  const meta = {
42
- title: 'Frame/NavTree',
42
+ title: 'App frame/NavTree',
43
43
  component: NavTree,
44
44
  parameters: { layout: 'fullscreen' },
45
45
  args: { title: 'Groups', groups: GROUPS, selected: 'b', emptyMessage: 'Nothing here yet.' },
@@ -9,7 +9,7 @@ import { Panel } from './Panel'
9
9
  * stand-ins.
10
10
  */
11
11
  const meta = {
12
- title: 'Layout/Panel',
12
+ title: 'Page structure/Panel',
13
13
  component: Panel,
14
14
  parameters: { layout: 'fullscreen' },
15
15
  args: { title: 'Details', children: null, bodyClassName: 'flex flex-col gap-3 px-4 pt-3 pb-4' },
package/src/PartCard.mdx CHANGED
@@ -5,19 +5,19 @@ import * as PartCardStories from './PartCard.stories'
5
5
 
6
6
  # PartCard
7
7
 
8
- A part of something longer, shared live: its blocks as they are now, under the header of what it is part of.
8
+ A part of something longer, shared live: its blocks as they are now, under the title of what it is part of.
9
9
 
10
10
  <Canvas of={PartCardStories.Default} />
11
11
 
12
12
  ## When
13
13
 
14
- - **ready** — the icon, the key and the title of what it is part of, as the link, and the blocks the app draws as `children`.
14
+ - **ready** — what it is part of, as a card starts: its kind in a file's 36px tile, its title as the link, and "A part of ABC-2" under it; then the blocks the app draws as `children`, behind a quote bar that starts where the tile does. The apps draw the blocks with **RichText** `size="small"`.
15
15
  - **loading** — at a card's height.
16
- - **unavailable** — one line: "A part of this item — not available.".
16
+ - **unavailable** — one row: "A part of this issue — not available.", in the app's word for it, else its kind's.
17
17
 
18
18
  ## When not
19
19
 
20
- - A link to the whole thing → **LinkCard** or **CardUnder**.
20
+ - A link to the whole thing → **LinkCard** or **AttachedCard**.
21
21
 
22
22
  ## How
23
23
 
@@ -1,8 +1,15 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { PartCard } from './PartCard'
3
+ import { RichText, type RichTextBlock } from './RichText'
4
+
5
+ /** A part as it is quoted: a heading and the text under it. */
6
+ const PART_BLOCKS: RichTextBlock[] = [
7
+ { type: 'heading', level: 2, inline: [{ text: 'A heading in the part', marks: [] }] },
8
+ { type: 'paragraph', inline: [{ text: 'The blocks of the part, as they are now. They change when the text they came from changes.', marks: [] }] },
9
+ ]
3
10
 
4
11
  const meta = {
5
- title: 'Components/PartCard',
12
+ title: 'Links & references/PartCard',
6
13
  component: PartCard,
7
14
  parameters: { layout: 'padded' },
8
15
  decorators: [(Story) => <div className="max-w-[480px]">{Story()}</div>],
@@ -19,12 +26,8 @@ export const Default: Story = {
19
26
  heading: 'Item one',
20
27
  partKey: 'ABC-2',
21
28
  href: '#part',
22
- children: (
23
- <>
24
- <p className="text-body-2-strong text-text-primary">A heading in the part</p>
25
- <p className="text-body-2 text-text-secondary">The blocks of the part, as they are now. They change when the text they came from changes.</p>
26
- </>
27
- ),
29
+ // As the apps draw a part's blocks: RichText in its small size (Peek's and Leaf's PartCard do), not sizes typed by hand.
30
+ children: <RichText blocks={PART_BLOCKS} size="small" />,
28
31
  },
29
32
  }
30
33
 
@@ -32,4 +35,4 @@ export const Default: Story = {
32
35
  export const Loading: Story = { args: { state: 'loading', kind: 'issue' } }
33
36
 
34
37
  /** The part, or what it is part of, is gone or not this reader's to see. */
35
- export const NotAvailable: Story = { args: { state: 'unavailable', kind: 'issue', noun: 'Item', openIn: { app: 'App one', href: '#elsewhere' } } }
38
+ export const NotAvailable: Story = { args: { state: 'unavailable', kind: 'issue', noun: 'Issue', openIn: { app: 'App one', href: '#elsewhere' } } }
@@ -13,13 +13,15 @@ describe('PartCard', () => {
13
13
  <p>The blocks</p>
14
14
  </PartCard>,
15
15
  )
16
- expect(screen.getByRole('link', { name: /ABC-2.*Item one/ }).getAttribute('href')).toBe('#part')
16
+ expect(screen.getByRole('link', { name: 'Item one' }).getAttribute('href')).toBe('#part')
17
+ // The key under the heading, as a card's second line.
18
+ expect(screen.getByText('A part of ABC-2')).toBeTruthy()
17
19
  expect(screen.getByText('The blocks')).toBeTruthy()
18
20
  })
19
21
 
20
22
  it('says a part is not available in words', () => {
21
- render(<PartCard state="unavailable" kind="issue" noun="Item" />)
22
- expect(screen.getByText('A part of this item — not available.')).toBeTruthy()
23
+ render(<PartCard state="unavailable" kind="issue" noun="Issue" />)
24
+ expect(screen.getByText('A part of this issue — not available.')).toBeTruthy()
23
25
  })
24
26
 
25
27
  it('while it loads, is busy and shows nothing of it', () => {
package/src/PartCard.tsx CHANGED
@@ -4,14 +4,20 @@
4
4
  * https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-shared-part-of-a-page-is-a-selected-run-of-blocks.md).
5
5
  * There is no row or card choice for a part: it draws itself. The app draws
6
6
  * the blocks and passes them as `children`.
7
+ *
8
+ * Look C (Katerina, 29 Oct): what it is part of as a card starts, its kind in a
9
+ * file's 36px tile, its title and "A part of ABC-2" under it; then the blocks
10
+ * behind a quote bar that starts where the tile does.
7
11
  */
8
- import type { ReactNode } from 'react'
12
+ import { useContext, type ReactNode } from 'react'
9
13
  import { Card } from './Card'
14
+ import { cn } from './cn'
10
15
  import { Link } from './Link'
11
16
  import { LinkCardLoading } from './LinkCard'
12
- import type { LinkedKind } from './linked'
13
- import { LinkedIcon, LinkKey } from './LinkParts'
17
+ import { inTheBox, type LinkedKind } from './linked'
18
+ import { kindNounOf, LinkTile } from './LinkParts'
14
19
  import { LinkUnavailable } from './LinkRow'
20
+ import { QUOTE_BAR_CLASSES } from './looks'
15
21
 
16
22
  export interface PartCardProps {
17
23
  /** Where its lookup stands. Default `ready`. */
@@ -24,7 +30,7 @@ export interface PartCardProps {
24
30
  href?: string
25
31
  /** The key of what it is part of: "ABC-2". */
26
32
  partKey?: string
27
- /** What it is part of, in a word, for "A part of this item — not available.". */
33
+ /** What it is part of, in a word, for "A part of this issue — not available.". Absent, its kind's word. */
28
34
  noun?: string
29
35
  /** Where it may still open, for someone who can, when it is not available. */
30
36
  openIn?: { app: string; href: string }
@@ -32,28 +38,31 @@ export interface PartCardProps {
32
38
  children?: ReactNode
33
39
  }
34
40
 
35
- export function PartCard({ state = 'ready', kind, heading, href, partKey, noun = 'Item', openIn, children }: PartCardProps) {
41
+ export function PartCard({ state = 'ready', kind, heading, href, partKey, noun, openIn, children }: PartCardProps) {
42
+ const word = noun ?? kindNounOf({ kind }) ?? 'File'
43
+ const boxed = useContext(inTheBox)
36
44
  if (state === 'loading') return <LinkCardLoading kind={kind} shape={{ summary: true, rows: 0, footer: 'none' }} />
37
- if (state === 'unavailable') return <LinkUnavailable kind={kind} noun={`A part of this ${noun.toLowerCase()}`} openIn={openIn} />
38
- const header = (
39
- <>
40
- <LinkedIcon kind={kind} />
41
- {partKey && <LinkKey>{partKey}</LinkKey>}
42
- <span className="truncate">{heading}</span>
43
- </>
44
- )
45
+ if (state === 'unavailable') return <LinkUnavailable kind={kind} noun={`A part of this ${word.toLowerCase()}`} openIn={openIn} card />
45
46
  return (
46
- <Card fill="inset" className="flex flex-col gap-2 p-3">
47
- <span className="flex min-w-0 items-center gap-2 text-body-2-strong text-text-primary">
48
- {href ? (
49
- <Link href={href} variant="quiet" className="flex min-w-0 items-center gap-2">
50
- {header}
51
- </Link>
52
- ) : (
53
- header
54
- )}
55
- </span>
56
- <div className="border-l-2 border-border-default pl-3">{children}</div>
47
+ // In a box being written in, on the files' fill as the card beside it is; elsewhere at most 480px.
48
+ <Card fill={boxed ? 'elevated' : 'inset'} className={cn('flex flex-col gap-3 p-3', !boxed && 'max-w-[480px]')}>
49
+ <div className="flex items-center gap-3">
50
+ <LinkTile kind={kind} />
51
+ <span className="flex min-w-0 flex-1 flex-col gap-0.5">
52
+ <span className="block min-w-0 text-body-2-strong text-text-primary">
53
+ {href ? (
54
+ <Link href={href} variant="quiet" truncate className="block">
55
+ {heading}
56
+ </Link>
57
+ ) : (
58
+ <span className="block truncate">{heading}</span>
59
+ )}
60
+ </span>
61
+ <span className="truncate text-caption text-text-secondary">{partKey ? `A part of ${partKey}` : `A part of this ${word.toLowerCase()}`}</span>
62
+ </span>
63
+ </div>
64
+ {/* The quote bar starts where the tile above it starts (Katerina, 29 Oct). */}
65
+ <div className={QUOTE_BAR_CLASSES}>{children}</div>
57
66
  </Card>
58
67
  )
59
68
  }
@@ -13,7 +13,7 @@ import { richTextClassName } from './RichText'
13
13
  * the text wins.
14
14
  */
15
15
  const meta = {
16
- title: 'Primitives/PastedImages',
16
+ title: 'Writing/PastedImages',
17
17
  parameters: { layout: 'padded' },
18
18
  } satisfies Meta
19
19
 
@@ -14,7 +14,7 @@ import { richTextClassName } from './RichText'
14
14
  * Ctrl/Cmd+Shift+V: they stay text.
15
15
  */
16
16
  const meta = {
17
- title: 'Primitives/PastedMarkdown',
17
+ title: 'Writing/PastedMarkdown',
18
18
  parameters: { layout: 'padded' },
19
19
  } satisfies Meta
20
20
 
@@ -3,7 +3,7 @@ import { Person } from './Person'
3
3
 
4
4
  /** A face beside a name — never a key. */
5
5
  const meta = {
6
- title: 'Components/Person',
6
+ title: 'People/Person',
7
7
  component: Person,
8
8
  args: { name: 'Ana Duarte', size: 20 },
9
9
  } satisfies Meta<typeof Person>
@@ -3,7 +3,7 @@ import { PersonTrigger } from './PersonTrigger'
3
3
 
4
4
  /** The person, as the button that opens the account menu. The menu itself stays in the app. */
5
5
  const meta = {
6
- title: 'Components/PersonTrigger',
6
+ title: 'People/PersonTrigger',
7
7
  component: PersonTrigger,
8
8
  args: { name: 'Ana Duarte', open: false, compact: false },
9
9
  } satisfies Meta<typeof PersonTrigger>
@@ -16,7 +16,7 @@ import { Toolbar, ToolbarButton, ToolbarInput, ToolbarSeparator } from './Toolba
16
16
  * with `MenuPanel` and everything below it is live (Katerina, D25).
17
17
  */
18
18
  const meta = {
19
- title: 'Overlays/Popover',
19
+ title: 'Menus & windows/Popover',
20
20
  component: Popover,
21
21
  decorators: [(Story) => <div className="flex min-h-[260px] w-full items-start justify-center pt-6"><Story /></div>],
22
22
  args: { children: null },
package/src/Popover.tsx CHANGED
@@ -45,13 +45,17 @@ export interface PopoverProps {
45
45
  * measured — a text selection's. Pair it with `open`, since there is nothing
46
46
  * for Base UI to watch.
47
47
  *
48
+ * **A place that moves**, a caret's, is `{ getBoundingClientRect, contextElement }`:
49
+ * asked again each time the panel is placed, and `contextElement` names what
50
+ * it sits in, so the panel follows when that scrolls. A rect stays where it was.
51
+ *
48
52
  * An anchored panel **does not take focus**, because the person is still in
49
53
  * whatever produced it. That also means it cannot be reached by keyboard, so
50
54
  * everything in one must be reachable another way.
51
55
  *
52
56
  * Render it always and toggle `open`; do not mount it only while it is open.
53
57
  */
54
- anchor?: HTMLElement | DOMRect | null
58
+ anchor?: HTMLElement | DOMRect | { getBoundingClientRect: () => DOMRect; contextElement?: Element } | null
55
59
  /**
56
60
  * Which of the panel's edges hangs from the trigger's, or `center` to put
57
61
  * the panel's middle over the anchor's. Default left.
@@ -143,7 +147,7 @@ export function Popover({ trigger, anchor, align = 'left', side = 'bottom', open
143
147
  Floating UI takes besides an element. */
144
148
  const anchorTarget = useMemo(() => {
145
149
  if (!anchor) return undefined
146
- if (anchor instanceof Element) return anchor
150
+ if (anchor instanceof Element || 'getBoundingClientRect' in anchor) return anchor
147
151
  return { getBoundingClientRect: () => anchor }
148
152
  }, [anchor])
149
153
 
@@ -16,7 +16,7 @@ import { SkeletonBar } from './Skeleton'
16
16
  * places itself; **`OnARow`** and **`Scrolling`** are the live ones (D25).
17
17
  */
18
18
  const meta = {
19
- title: 'Overlays/PreviewCard',
19
+ title: 'Menus & windows/PreviewCard',
20
20
  component: PreviewCard,
21
21
  decorators: [(Story) => <div className="flex min-h-[260px] w-full items-center justify-center"><Story /></div>],
22
22
  args: { content: null, children: null },
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { ProgressBar } from './ProgressBar'
3
3
 
4
4
  const meta = {
5
- title: 'Feedback/ProgressBar',
5
+ title: 'Status & feedback/ProgressBar',
6
6
  component: ProgressBar,
7
7
  args: { value: 10, max: 14, label: 'Items done', variant: 'default' },
8
8
  argTypes: { variant: { control: 'inline-radio', options: ['default', 'quiet'] } },
@@ -7,7 +7,7 @@ import { Select } from './Select'
7
7
 
8
8
  /** A labelled property — the 68px label column is what lines the values up. */
9
9
  const meta = {
10
- title: 'Primitives/Property',
10
+ title: 'Page structure/Property',
11
11
  component: Property,
12
12
  decorators: [(Story) => <div className="w-[260px]"><Story /></div>],
13
13
  args: { label: 'Status', children: <Chip type="success" label="Done" /> },
@@ -13,7 +13,7 @@ const placeholder = <IconSquareRounded size={16} stroke={1.5} />
13
13
  * background, so every canvas here is full height against one.
14
14
  */
15
15
  const meta = {
16
- title: 'Frame/Rail',
16
+ title: 'App frame/Rail',
17
17
  component: Rail,
18
18
  parameters: { layout: 'fullscreen' },
19
19
  args: { 'aria-label': 'Navigation', children: null },
@@ -6,7 +6,7 @@ import { RailItem } from './RailItem'
6
6
  const placeholder = <IconSquareRounded size={16} stroke={1.5} />
7
7
 
8
8
  const meta = {
9
- title: 'Frame/RailItem',
9
+ title: 'App frame/RailItem',
10
10
  component: RailItem,
11
11
  args: { label: 'Item', href: '#', active: false, icon: placeholder },
12
12
  argTypes: { icon: { control: false } },
@@ -3,7 +3,7 @@ import { fn } from 'storybook/test'
3
3
  import { Reaction } from './Reaction'
4
4
 
5
5
  const meta = {
6
- title: 'Components/Reaction',
6
+ title: 'Conversation/Reaction',
7
7
  component: Reaction,
8
8
  args: { emoji: '👍', count: 2, 'aria-label': 'Makes sense, 2', onClick: fn() },
9
9
  } satisfies Meta<typeof Reaction>
@@ -27,7 +27,7 @@ const OPTIONS: ReactionOption[] = [
27
27
  ]
28
28
 
29
29
  const meta = {
30
- title: 'Components/ReactionPicker',
30
+ title: 'Conversation/ReactionPicker',
31
31
  component: ReactionPicker,
32
32
  args: { options: OPTIONS, onSelect: () => {} },
33
33
  argTypes: { options: { control: false }, onSelect: { control: false } },
@@ -8,7 +8,7 @@ import { AddReactionButton, ReactionRow, type ReactionCount } from './ReactionRo
8
8
  * reacted.
9
9
  */
10
10
  const meta = {
11
- title: 'Primitives/ReactionRow',
11
+ title: 'Conversation/ReactionRow',
12
12
  component: ReactionRow,
13
13
  parameters: { layout: 'padded' },
14
14
  } satisfies Meta<typeof ReactionRow>
@@ -62,7 +62,9 @@ export function AddReactionButton({ options, onPick, className }: AddReactionBut
62
62
  align="left"
63
63
  ariaLabel="Add a reaction"
64
64
  contentClassName="p-1"
65
- className={className}
65
+ // As wide as its strip: a panel's 180px is a menu's, and left 24px empty right of the emoji (Katerina, 29 Oct).
66
+ // SelectionToolbar's and Peek's quick menu's panels do the same.
67
+ className={cn('w-auto min-w-0', className)}
66
68
  trigger={
67
69
  <IconButton variant="muted" tooltip="Add a reaction" aria-label="Add a reaction">
68
70
  <IconMoodPlus size={16} stroke={1.5} />
@@ -5,6 +5,9 @@ import * as ReferenceCardsStories from './ReferenceCards.stories'
5
5
 
6
6
  # ReferenceCards
7
7
 
8
+ **Deprecated.** A new editor uses **LinkPlaces**. This stays only for an editor
9
+ that has not moved yet.
10
+
8
11
  A chip in a document can ask for a card after its line: compact, detailed or
9
12
  none. The choice is the chip's own `embed`, so the card moves and goes with it.
10
13
  This draws no card itself. It places a slot after each line that asks for
@@ -14,7 +14,9 @@ import { richTextClassName } from './RichText'
14
14
  * one is the app's, which knows how to resolve what the chip points at.
15
15
  */
16
16
  const meta = {
17
- title: 'Primitives/ReferenceCards',
17
+ title: 'Writing/ReferenceCards',
18
+ // On its way out: the sidebar says "deprecated" beside its name (.storybook/manager.ts).
19
+ tags: ['deprecated'],
18
20
  parameters: { layout: 'padded' },
19
21
  } satisfies Meta
20
22
 
@@ -23,7 +23,7 @@ Folder alone on its line (which stay chips), offer Open only.
23
23
 
24
24
  - A document that is only read → **RichText**: a click on a link follows it.
25
25
  - A message's box, where every link is a chip and its card goes under the
26
- message → **CardUnder**; leave this out, and a click on a chip follows it.
26
+ message → **AttachedCard**; leave this out, and a click on a chip follows it.
27
27
 
28
28
  ## How
29
29