@estiva-app/ui 0.95.0 → 0.97.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 (205) hide show
  1. package/dist/AppShell.d.ts +25 -7
  2. package/dist/AppShell.d.ts.map +1 -1
  3. package/dist/ArchivedNotice.d.ts +28 -0
  4. package/dist/ArchivedNotice.d.ts.map +1 -0
  5. package/dist/Avatar.d.ts +6 -1
  6. package/dist/Avatar.d.ts.map +1 -1
  7. package/dist/AvatarGroup.d.ts +2 -0
  8. package/dist/AvatarGroup.d.ts.map +1 -1
  9. package/dist/Button.d.ts +4 -3
  10. package/dist/Button.d.ts.map +1 -1
  11. package/dist/Card.d.ts.map +1 -1
  12. package/dist/CommentBox.d.ts.map +1 -1
  13. package/dist/ComposerTriggers.d.ts +2 -0
  14. package/dist/ComposerTriggers.d.ts.map +1 -1
  15. package/dist/ConversationActions.d.ts +24 -0
  16. package/dist/ConversationActions.d.ts.map +1 -0
  17. package/dist/ConversationCard.d.ts +90 -0
  18. package/dist/ConversationCard.d.ts.map +1 -0
  19. package/dist/ConversationLayout.d.ts +50 -0
  20. package/dist/ConversationLayout.d.ts.map +1 -0
  21. package/dist/ConversationMenu.d.ts +24 -0
  22. package/dist/ConversationMenu.d.ts.map +1 -0
  23. package/dist/Divider.d.ts +23 -4
  24. package/dist/Divider.d.ts.map +1 -1
  25. package/dist/EditedMarker.d.ts +11 -0
  26. package/dist/EditedMarker.d.ts.map +1 -0
  27. package/dist/IconButton.d.ts +3 -3
  28. package/dist/IconButton.d.ts.map +1 -1
  29. package/dist/LinkParts.d.ts +4 -1
  30. package/dist/LinkParts.d.ts.map +1 -1
  31. package/dist/ListColumn.d.ts +3 -1
  32. package/dist/ListColumn.d.ts.map +1 -1
  33. package/dist/MembersDialog.d.ts +4 -0
  34. package/dist/MembersDialog.d.ts.map +1 -1
  35. package/dist/MetaText.d.ts +22 -0
  36. package/dist/MetaText.d.ts.map +1 -0
  37. package/dist/NavItem.d.ts.map +1 -1
  38. package/dist/PageHeader.d.ts +50 -0
  39. package/dist/PageHeader.d.ts.map +1 -0
  40. package/dist/Panel.d.ts +6 -0
  41. package/dist/Panel.d.ts.map +1 -1
  42. package/dist/Person.d.ts +3 -1
  43. package/dist/Person.d.ts.map +1 -1
  44. package/dist/PersonTrigger.d.ts +1 -1
  45. package/dist/PersonTrigger.d.ts.map +1 -1
  46. package/dist/PinnedComment.d.ts +17 -0
  47. package/dist/PinnedComment.d.ts.map +1 -0
  48. package/dist/QuotedLine.d.ts +16 -0
  49. package/dist/QuotedLine.d.ts.map +1 -0
  50. package/dist/ReactionHorizon.d.ts +14 -0
  51. package/dist/ReactionHorizon.d.ts.map +1 -0
  52. package/dist/RepliesRow.d.ts +27 -0
  53. package/dist/RepliesRow.d.ts.map +1 -0
  54. package/dist/ResolveDialog.d.ts +13 -0
  55. package/dist/ResolveDialog.d.ts.map +1 -0
  56. package/dist/Select.d.ts +1 -1
  57. package/dist/Select.d.ts.map +1 -1
  58. package/dist/Skeleton.d.ts +8 -4
  59. package/dist/Skeleton.d.ts.map +1 -1
  60. package/dist/Thread.d.ts +38 -0
  61. package/dist/Thread.d.ts.map +1 -0
  62. package/dist/TopBar.d.ts +3 -2
  63. package/dist/TopBar.d.ts.map +1 -1
  64. package/dist/UrgentMark.d.ts +6 -0
  65. package/dist/UrgentMark.d.ts.map +1 -0
  66. package/dist/commentBoxFrame.d.ts +3 -1
  67. package/dist/commentBoxFrame.d.ts.map +1 -1
  68. package/dist/conversation.examples.d.ts +52 -0
  69. package/dist/conversation.examples.d.ts.map +1 -0
  70. package/dist/editor.js +33 -25
  71. package/dist/editor.js.map +2 -2
  72. package/dist/eslint/index.js +2 -1
  73. package/dist/eslint/index.js.map +2 -2
  74. package/dist/eslint/no-native-title.d.ts +1 -1
  75. package/dist/eslint/no-native-title.d.ts.map +1 -1
  76. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  77. package/dist/index.d.ts +18 -2
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +1412 -448
  80. package/dist/index.js.map +4 -4
  81. package/dist/linked.d.ts +4 -0
  82. package/dist/linked.d.ts.map +1 -1
  83. package/dist/linkedFrom.d.ts +2 -0
  84. package/dist/linkedFrom.d.ts.map +1 -1
  85. package/dist/looks.d.ts +13 -1
  86. package/dist/looks.d.ts.map +1 -1
  87. package/dist/threadCard.d.ts +46 -0
  88. package/dist/threadCard.d.ts.map +1 -0
  89. package/package.json +1 -1
  90. package/registry.json +1889 -544
  91. package/src/AppShell.mdx +24 -10
  92. package/src/AppShell.stories.tsx +65 -31
  93. package/src/AppShell.test.tsx +92 -10
  94. package/src/AppShell.tsx +108 -18
  95. package/src/ArchivedNotice.mdx +46 -0
  96. package/src/ArchivedNotice.stories.tsx +52 -0
  97. package/src/ArchivedNotice.test.tsx +42 -0
  98. package/src/ArchivedNotice.tsx +71 -0
  99. package/src/Avatar.agent.test.tsx +63 -0
  100. package/src/Avatar.mdx +25 -0
  101. package/src/Avatar.stories.tsx +13 -0
  102. package/src/Avatar.tsx +51 -3
  103. package/src/AvatarGroup.tsx +3 -1
  104. package/src/Button.mdx +2 -2
  105. package/src/Button.tsx +8 -6
  106. package/src/Card.test.tsx +4 -4
  107. package/src/Card.tsx +6 -2
  108. package/src/CommentBox.test.tsx +2 -1
  109. package/src/CommentBox.tsx +14 -7
  110. package/src/ComposerTriggers.stories.tsx +2 -0
  111. package/src/ComposerTriggers.tsx +3 -1
  112. package/src/ConfirmDialog.stories.tsx +12 -0
  113. package/src/ConversationActions.mdx +47 -0
  114. package/src/ConversationActions.stories.tsx +39 -0
  115. package/src/ConversationActions.tsx +96 -0
  116. package/src/ConversationCard.mdx +72 -0
  117. package/src/ConversationCard.states.test.tsx +330 -0
  118. package/src/ConversationCard.stories.tsx +135 -0
  119. package/src/ConversationCard.test.tsx +159 -0
  120. package/src/ConversationCard.tsx +524 -0
  121. package/src/ConversationLayout.mdx +61 -0
  122. package/src/ConversationLayout.stories.tsx +161 -0
  123. package/src/ConversationLayout.test.tsx +240 -0
  124. package/src/ConversationLayout.tsx +233 -0
  125. package/src/ConversationMenu.mdx +47 -0
  126. package/src/ConversationMenu.stories.tsx +42 -0
  127. package/src/ConversationMenu.test.tsx +47 -0
  128. package/src/ConversationMenu.tsx +57 -0
  129. package/src/Divider.mdx +36 -1
  130. package/src/Divider.stories.tsx +57 -0
  131. package/src/Divider.test.tsx +24 -1
  132. package/src/Divider.tsx +49 -9
  133. package/src/EditedMarker.mdx +36 -0
  134. package/src/EditedMarker.stories.tsx +24 -0
  135. package/src/EditedMarker.tsx +20 -0
  136. package/src/IconButton.mdx +2 -1
  137. package/src/IconButton.tsx +8 -5
  138. package/src/LinkCard.tsx +3 -3
  139. package/src/LinkChip.tsx +1 -1
  140. package/src/LinkParts.mdx +4 -0
  141. package/src/LinkParts.stories.tsx +10 -0
  142. package/src/LinkParts.tsx +9 -5
  143. package/src/LinkRow.tsx +1 -1
  144. package/src/ListColumn.tsx +9 -3
  145. package/src/MembersDialog.stories.tsx +11 -0
  146. package/src/MembersDialog.tsx +7 -3
  147. package/src/MetaText.mdx +41 -0
  148. package/src/MetaText.stories.tsx +29 -0
  149. package/src/MetaText.tsx +38 -0
  150. package/src/NavItem.tsx +2 -11
  151. package/src/PageHeader.mdx +123 -0
  152. package/src/PageHeader.stories.tsx +174 -0
  153. package/src/PageHeader.test.tsx +99 -0
  154. package/src/PageHeader.tsx +105 -0
  155. package/src/Panel.mdx +12 -0
  156. package/src/Panel.stories.tsx +47 -5
  157. package/src/Panel.test.tsx +40 -0
  158. package/src/Panel.tsx +8 -2
  159. package/src/Person.tsx +4 -2
  160. package/src/PersonTrigger.tsx +3 -3
  161. package/src/PinnedComment.mdx +40 -0
  162. package/src/PinnedComment.stories.tsx +21 -0
  163. package/src/PinnedComment.tsx +40 -0
  164. package/src/QuotedLine.mdx +44 -0
  165. package/src/QuotedLine.stories.tsx +30 -0
  166. package/src/QuotedLine.test.tsx +34 -0
  167. package/src/QuotedLine.tsx +33 -0
  168. package/src/ReactionHorizon.mdx +36 -0
  169. package/src/ReactionHorizon.stories.tsx +27 -0
  170. package/src/ReactionHorizon.tsx +27 -0
  171. package/src/RepliesRow.mdx +45 -0
  172. package/src/RepliesRow.stories.tsx +33 -0
  173. package/src/RepliesRow.test.tsx +47 -0
  174. package/src/RepliesRow.tsx +86 -0
  175. package/src/ReplyCard.mdx +50 -0
  176. package/src/ReplyCard.stories.tsx +68 -0
  177. package/src/ResolveDialog.mdx +44 -0
  178. package/src/ResolveDialog.stories.tsx +23 -0
  179. package/src/ResolveDialog.test.tsx +53 -0
  180. package/src/ResolveDialog.tsx +58 -0
  181. package/src/Select.tsx +12 -2
  182. package/src/Skeleton.stories.tsx +4 -1
  183. package/src/Skeleton.tsx +33 -4
  184. package/src/Thread.mdx +53 -0
  185. package/src/Thread.stories.tsx +167 -0
  186. package/src/Thread.test.tsx +83 -0
  187. package/src/Thread.tsx +113 -0
  188. package/src/TopBar.mdx +8 -6
  189. package/src/TopBar.stories.tsx +4 -3
  190. package/src/TopBar.tsx +8 -3
  191. package/src/UrgentMark.mdx +37 -0
  192. package/src/UrgentMark.stories.tsx +27 -0
  193. package/src/UrgentMark.tsx +15 -0
  194. package/src/commentBoxFrame.tsx +8 -4
  195. package/src/conversation.examples.tsx +135 -0
  196. package/src/eslint/no-native-title.ts +1 -1
  197. package/src/eslint/no-restyled-part.ts +1 -0
  198. package/src/index.ts +19 -2
  199. package/src/linked.ts +4 -0
  200. package/src/linkedFrom.ts +5 -3
  201. package/src/looks.ts +18 -2
  202. package/src/registry/registry.test.ts +9 -7
  203. package/src/threadCard.ts +84 -0
  204. package/stories/Choosing.mdx +21 -1
  205. package/tokens.css +14 -10
package/src/Select.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IconCheck, IconChevronDown } from '@tabler/icons-react'
2
2
  import { Select as BaseSelect } from '@base-ui/react/select'
3
- import type { ReactNode } from 'react'
3
+ import { useEffect, useState, type ReactNode } from 'react'
4
4
  import { cn } from './cn'
5
5
  import { ScrollArea } from './ScrollArea'
6
6
  import { MenuPanel, menuItemClassName } from './Menu'
@@ -79,6 +79,11 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
79
79
  // With a reason it is held shut rather than disabled: a disabled trigger is
80
80
  // a native `disabled` button, which Tab skips and a tooltip cannot open on.
81
81
  const held = Boolean(disabledReason)
82
+ const [open, setOpen] = useState(false)
83
+ // Held while open (an archive arriving): it shuts, and stays shut once let go, until it is pressed again.
84
+ useEffect(() => {
85
+ if (held) setOpen(false)
86
+ }, [held])
82
87
  const trigger = (
83
88
  // @estiva-escape(no-copied-look): N1 (Katerina, 24 September: record only): Select's box drops the hover while held, so it cannot take FIELD_SHELL_CLASSES as it is
84
89
  <BaseSelect.Trigger
@@ -129,7 +134,12 @@ export function Select({ value, onChange, options, size = 'default', fill = 'fie
129
134
  onValueChange={(next) => {
130
135
  if (!held) onChange(next as string)
131
136
  }}
132
- {...(held ? { open: false, onOpenChange: () => {} } : {})}
137
+ // Always controlled: held, it stays shut; let go, it opens again. Passing `open` only while held switched Base UI
138
+ // between controlled and uncontrolled the moment a reason went (an unarchive), and it warned.
139
+ open={held ? false : open}
140
+ onOpenChange={(next) => {
141
+ if (!held) setOpen(next)
142
+ }}
133
143
  disabled={disabled && !held}
134
144
  // Non-modal, as it has always been: the page behind stays scrollable and
135
145
  // keeps its scrollbar, so opening a select never shifts the layout.
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite'
2
- import { SkeletonBar, SkeletonList, SkeletonRow } from './Skeleton'
2
+ import { SkeletonBar, SkeletonConversation, SkeletonList, SkeletonRow } from './Skeleton'
3
3
 
4
4
  const meta = {
5
5
  title: 'Status & feedback/Skeleton',
@@ -31,3 +31,6 @@ export const Bar: Story = {
31
31
  </div>
32
32
  ),
33
33
  }
34
+
35
+ /** Comments still coming, in a 384px column: three placeholders shaped like a comment. */
36
+ export const Conversation: Story = { decorators: [(Story) => <div className="w-[384px]"><Story /></div>], render: () => <SkeletonConversation /> }
package/src/Skeleton.tsx CHANGED
@@ -2,10 +2,10 @@ import type { CSSProperties } from 'react'
2
2
  import { cn } from './cn'
3
3
 
4
4
  /**
5
- * Peek's Skeleton (2026-08-28), the generic parts only: the bar, a row
6
- * shaped like a list row, and a list of them. Peek's placeholders shaped
7
- * like a conversation card or a huddle card know what those are and stay
8
- * in Peek, built from the bar.
5
+ * Peek's Skeleton (2026-08-28): the bar, a row shaped like a list row, a
6
+ * list of them, and the conversation's placeholder, moved with the
7
+ * conversation (Katerina, 31 October). Placeholders of an app's own cards
8
+ * stay in the app, built from the bar.
9
9
  *
10
10
  * A list reveals after 150ms (`animate-skeleton-in`, in the preset) so a
11
11
  * fast load never flashes a skeleton — Peek's rule.
@@ -42,3 +42,32 @@ export function SkeletonList({ rows = 8, className }: { rows?: number; className
42
42
  </div>
43
43
  )
44
44
  }
45
+
46
+ /** One comment's placeholder: a face, a name and a time, and two lines of words. */
47
+ function SkeletonCard({ secondLine }: { secondLine: number }) {
48
+ return (
49
+ <div className="rounded-lg px-2 pt-2">
50
+ <div className="flex w-full items-center gap-2">
51
+ <SkeletonBar className="h-6 w-6 shrink-0" />
52
+ <SkeletonBar className="h-3.5 w-[110px]" />
53
+ <SkeletonBar className="h-3 w-10" />
54
+ </div>
55
+ <div className="flex flex-col gap-2 pb-2 pl-8 pr-2 pt-2">
56
+ <SkeletonBar className="h-3.5 w-full" />
57
+ {/* Never wider than its row: in a 384px column the line ran past the edge. */}
58
+ <SkeletonBar className="h-3.5 max-w-full" style={{ width: secondLine }} />
59
+ </div>
60
+ </div>
61
+ )
62
+ }
63
+
64
+ /** Comments still coming: three placeholders shaped like `ConversationCard`, revealed after 150ms. Peek's, moved with the conversation. */
65
+ export function SkeletonConversation({ className }: { className?: string }) {
66
+ return (
67
+ <div className={cn('flex flex-col gap-2 animate-skeleton-in', className)} aria-hidden>
68
+ <SkeletonCard secondLine={420} />
69
+ <SkeletonCard secondLine={300} />
70
+ <SkeletonCard secondLine={500} />
71
+ </div>
72
+ )
73
+ }
package/src/Thread.mdx ADDED
@@ -0,0 +1,53 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
2
+ import * as Stories from './Thread.stories'
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # Thread
7
+
8
+ A comment's replies, with the box to write one: in the right column under its own header, or under its comment.
9
+
10
+ <Canvas of={Stories.Column} />
11
+
12
+ ## When
13
+
14
+ - `place="beside"`: in the right column, beside the comments (two columns). The comment is pinned at the top, then "Replies", then the replies; the box stays at the bottom.
15
+ - `place="under"`: under its comment, in one column. The replies hang from a line under the comment's face, with no fill until pointed at, and the box is under them. **ConversationLayout** makes the comment and its thread one card.
16
+ - `resolved`: "Resolved" at the top of the column, in green.
17
+ - `notice` in place of the box: why no reply can be written.
18
+
19
+ <Canvas of={Stories.Resolved} />
20
+
21
+ <Canvas of={Stories.Under} />
22
+
23
+ ## When not
24
+
25
+ - The comments and where their threads open → **ConversationLayout**.
26
+ - Any other column → **Panel**.
27
+
28
+ ## How
29
+
30
+ ```tsx
31
+ import { ReplyCard, Thread } from '@estiva-app/ui'
32
+
33
+ <Thread start={start} resolved={resolved} onClose={close} box={replyBox}>
34
+ <ReplyCard author={author} time={time}>
35
+ {words}
36
+ </ReplyCard>
37
+ </Thread>
38
+ ```
39
+
40
+ - Its replies are yours to put in time order. Who resolved it is said on the comment, not among them.
41
+ - Still reading: `loading`. Nobody replied yet: nothing in `children`.
42
+
43
+ ## What it owns
44
+
45
+ | It does | So you never write | Refused when written by hand |
46
+ |---|---|---|
47
+ | Pins the comment at the top, and keeps the box under the replies | a header and a fixed footer | |
48
+ | Placeholders while reading, and a line when nobody replied | a loading and an empty state | |
49
+ | "Resolved" in green at the top of the column | a chip | |
50
+
51
+ ## Props
52
+
53
+ <Controls />
@@ -0,0 +1,167 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import type { ReactNode } from 'react'
3
+ import { archivedLine } from './archivedLine'
4
+ import { Card } from './Card'
5
+ import { ConversationCard, ReplyCard } from './ConversationCard'
6
+ import { ConversationLayout } from './ConversationLayout'
7
+ import { ONE, SHORT, SOME, THREE, TWO, WORDS, WriteBox, YOU, useReactions } from './conversation.examples'
8
+ import { MembersPill } from './MembersPill'
9
+ import { Thread } from './Thread'
10
+
11
+ /** A comment's replies, with the box to write one: in the right column, or under its comment. */
12
+ const meta = {
13
+ title: 'Conversation/Thread',
14
+ component: Thread,
15
+ parameters: { layout: 'padded' },
16
+ } satisfies Meta<typeof Thread>
17
+
18
+ export default meta
19
+ type Story = StoryObj<typeof meta>
20
+
21
+ /** The right column: 384px, the height of the page. */
22
+ function Side({ children }: { children: ReactNode }) {
23
+ return (
24
+ <Card fill="surface" clip className="flex h-[640px] w-[384px] flex-col">
25
+ {children}
26
+ </Card>
27
+ )
28
+ }
29
+
30
+ const START = { author: ONE, time: '11:08 AM', words: WORDS }
31
+
32
+ function Replies({ readOnly = false }: { readOnly?: boolean }) {
33
+ const one = useReactions(SOME)
34
+ const two = useReactions()
35
+ return (
36
+ <>
37
+ <ReplyCard author={TWO} time="11:40 AM" reactions={one} readOnly={readOnly}>
38
+ {SHORT}
39
+ </ReplyCard>
40
+ <ReplyCard author={THREE} time="11:52 AM" reactions={two} readOnly={readOnly}>
41
+ A second reply, under the first, in the order they were written.
42
+ </ReplyCard>
43
+ </>
44
+ )
45
+ }
46
+
47
+ /** In the right column: the comment pinned at the top, its replies, and the box. */
48
+ export const Column: Story = {
49
+ render: () => (
50
+ <Side>
51
+ <Thread start={START} onClose={() => {}} box={<WriteBox />}>
52
+ <Replies />
53
+ </Thread>
54
+ </Side>
55
+ ),
56
+ }
57
+
58
+ /** Resolved: "Resolved" at the top. Who resolved it, and the note, are said on the comment, not among the replies. */
59
+ export const Resolved: Story = {
60
+ render: () => (
61
+ <Side>
62
+ <Thread start={START} resolved onClose={() => {}} box={<WriteBox />}>
63
+ <Replies />
64
+ </Thread>
65
+ </Side>
66
+ ),
67
+ }
68
+
69
+ /** With the column's own actions before Close: who is in it. */
70
+ export const WithMembers: Story = {
71
+ name: 'With members',
72
+ render: () => (
73
+ <Side>
74
+ <Thread start={START} onClose={() => {}} actions={<MembersPill members={[ONE, TWO, THREE]} count={3} />} box={<WriteBox />}>
75
+ <Replies />
76
+ </Thread>
77
+ </Side>
78
+ ),
79
+ }
80
+
81
+ /** Still reading the replies. */
82
+ export const Loading: Story = {
83
+ render: () => (
84
+ <Side>
85
+ <Thread start={START} loading onClose={() => {}} box={<WriteBox />} />
86
+ </Side>
87
+ ),
88
+ }
89
+
90
+ /** Nobody has replied yet. */
91
+ export const NoReplies: Story = {
92
+ name: 'No replies',
93
+ render: () => (
94
+ <Side>
95
+ <Thread start={START} onClose={() => {}} box={<WriteBox />} />
96
+ </Side>
97
+ ),
98
+ }
99
+
100
+ /** The comment was deleted: its replies stay, and no new one can be written. */
101
+ export const StartDeleted: Story = {
102
+ name: 'Comment deleted',
103
+ render: () => (
104
+ <Side>
105
+ <Thread start={{ ...START, deleted: true }} onClose={() => {}} notice={<WriteBox closed="The comment was deleted, so its thread takes no new replies." />}>
106
+ <Replies />
107
+ </Thread>
108
+ </Side>
109
+ ),
110
+ }
111
+
112
+ /** Archived: nothing can be changed. The reactions show but cannot be pressed, and the box says why, in every app's words (`archivedLine`). */
113
+ export const ReadOnly: Story = {
114
+ name: 'Read-only',
115
+ render: () => (
116
+ <Side>
117
+ <Thread start={START} onClose={() => {}} notice={<WriteBox closed={archivedLine({})} />}>
118
+ <Replies readOnly />
119
+ </Thread>
120
+ </Side>
121
+ ),
122
+ }
123
+
124
+ /** Under its comment, in one column: one card with the comment, its replies hung from a line, and the box. */
125
+ export const Under: Story = {
126
+ render: function Render() {
127
+ const reacting = useReactions()
128
+ return (
129
+ <div className="flex h-[640px]">
130
+ <ConversationLayout
131
+ threads="under"
132
+ open="c1"
133
+ items={[
134
+ {
135
+ id: 'c1',
136
+ card: (
137
+ <ConversationCard author={ONE} time="11:08 AM" reactions={reacting} replies={{ count: 2, faces: [TWO, THREE], last: '11:52 AM' }}>
138
+ {WORDS}
139
+ </ConversationCard>
140
+ ),
141
+ thread: (
142
+ <Thread place="under" box={<WriteBox />}>
143
+ <Replies />
144
+ </Thread>
145
+ ),
146
+ },
147
+ ]}
148
+ />
149
+ </div>
150
+ )
151
+ },
152
+ }
153
+
154
+ /** Your reply among them. */
155
+ export const WithYours: Story = {
156
+ name: 'With yours',
157
+ render: () => (
158
+ <Side>
159
+ <Thread start={START} onClose={() => {}} box={<WriteBox />}>
160
+ <Replies />
161
+ <ReplyCard author={YOU} time="12:01 PM" own onDelete={() => {}}>
162
+ Your own reply, with Edit and Delete in its menu.
163
+ </ReplyCard>
164
+ </Thread>
165
+ </Side>
166
+ ),
167
+ }
@@ -0,0 +1,83 @@
1
+ // @vitest-environment jsdom
2
+ import { afterEach, describe, expect, it, vi } from 'vitest'
3
+ import { cleanup, fireEvent, render, screen } from '@testing-library/react'
4
+ import { Thread } from './Thread'
5
+
6
+ afterEach(cleanup)
7
+
8
+ const START = { author: { name: 'Person one' }, time: '11:08 AM', words: 'The comment it answers' }
9
+
10
+ describe('Thread, beside (the right column)', () => {
11
+ it('pins the comment it answers at the top, then "Replies", then the replies, and the box under them', () => {
12
+ render(
13
+ <Thread start={START} box={<p>The box</p>}>
14
+ <p>A reply</p>
15
+ </Thread>,
16
+ )
17
+ const order = ['The comment it answers', 'A reply', 'The box'].map((words) => screen.getByText(words))
18
+ expect(order[0].compareDocumentPosition(order[1]) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()
19
+ expect(order[1].compareDocumentPosition(order[2]) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()
20
+ // "Replies" twice: the column's name, and the line between the comment and its replies.
21
+ expect(screen.getAllByText('Replies').length).toBe(2)
22
+ })
23
+
24
+ it('says when nobody replied yet, and shows placeholders while reading', () => {
25
+ render(<Thread start={START} />)
26
+ expect(screen.getByText('No replies yet.')).toBeTruthy()
27
+ cleanup()
28
+ render(<Thread start={START} loading />)
29
+ expect(screen.queryByText('No replies yet.')).toBeNull()
30
+ })
31
+
32
+ it('closes with its Close button, and says "Resolved" at the top when it is', () => {
33
+ const onClose = vi.fn()
34
+ render(<Thread start={START} resolved onClose={onClose} />)
35
+ expect(screen.getByText('Resolved')).toBeTruthy()
36
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }))
37
+ expect(onClose).toHaveBeenCalledOnce()
38
+ })
39
+
40
+ it('says why no reply can be written in place of the box', () => {
41
+ render(<Thread start={START} box={<p>The box</p>} notice={<p>This file is archived.</p>} />)
42
+ expect(screen.getByText('This file is archived.')).toBeTruthy()
43
+ expect(screen.queryByText('The box')).toBeNull()
44
+ })
45
+ })
46
+
47
+ describe('Thread, with an empty list of replies (an app’s replies.map with none)', () => {
48
+ it('beside: says nobody replied yet', () => {
49
+ render(<Thread start={START}>{[]}</Thread>)
50
+ expect(screen.getByText('No replies yet.')).toBeTruthy()
51
+ })
52
+
53
+ it('under: draws no empty line of replies, only the box', () => {
54
+ const { container } = render(
55
+ <Thread place="under" box={<p>The box</p>}>
56
+ {[]}
57
+ </Thread>,
58
+ )
59
+ expect(container.querySelector('[data-thread-replies]')).toBeNull()
60
+ })
61
+ })
62
+
63
+ describe('Thread, under its comment (one column)', () => {
64
+ it('draws no header, no Close and no pinned comment: its replies, then the box', () => {
65
+ render(
66
+ <Thread place="under" start={START} onClose={() => {}} box={<p>The box</p>}>
67
+ <p>A reply</p>
68
+ </Thread>,
69
+ )
70
+ expect(screen.queryByText('Replies')).toBeNull()
71
+ expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()
72
+ expect(screen.queryByText('The comment it answers')).toBeNull()
73
+ const reply = screen.getByText('A reply')
74
+ expect(reply.compareDocumentPosition(screen.getByText('The box')) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()
75
+ })
76
+
77
+ it('with no replies yet, only the box: no line saying so', () => {
78
+ const { container } = render(<Thread place="under" box={<p>The box</p>} />)
79
+ expect(screen.getByText('The box')).toBeTruthy()
80
+ expect(screen.queryByText('No replies yet.')).toBeNull()
81
+ expect(container.querySelector('[data-thread-replies]')).toBeNull()
82
+ })
83
+ })
package/src/Thread.tsx ADDED
@@ -0,0 +1,113 @@
1
+ import { Children, type ReactNode, type Ref } from 'react'
2
+ import { IconX } from '@tabler/icons-react'
3
+ import { Chip } from './Chip'
4
+ import { cn } from './cn'
5
+ import { Divider } from './Divider'
6
+ import { EmptyState } from './EmptyState'
7
+ import { IconButton } from './IconButton'
8
+ import { Panel } from './Panel'
9
+ import { PinnedComment, type PinnedCommentProps } from './PinnedComment'
10
+ import { SkeletonConversation } from './Skeleton'
11
+ import { useContext } from 'react'
12
+ import { caretOnOpen, LineByLayout } from './threadCard'
13
+
14
+ /** The comment a thread answers, pinned at the top of its column. */
15
+ export type ThreadStart = PinnedCommentProps
16
+
17
+ export interface ThreadProps {
18
+ /** `beside`: in the right column, beside the comments, under its own header. `under`: open under its comment, in a one-column conversation: its replies hang from a line, quiet, and the box is under them; ConversationLayout makes the comment and its thread one card. */
19
+ place?: 'beside' | 'under'
20
+ /** The comment it answers, pinned at the top of the column. Under its comment it is not repeated. */
21
+ start?: ThreadStart
22
+ /** Its replies, in time order: `ReplyCard`s. How it was resolved is said on its comment, not among them (Katerina, 1 November). */
23
+ children?: ReactNode
24
+ /** Still reading the replies: placeholders in their place. */
25
+ loading?: boolean
26
+ /** Resolved: "Resolved" at the top of the column, in green. */
27
+ resolved?: boolean
28
+ /** The box a reply is written in: the app's `CommentBox`. */
29
+ box?: ReactNode
30
+ /** Said in place of the box: why no reply can be written (an archived page, a deleted comment). */
31
+ notice?: ReactNode
32
+ /** The column's own actions, before Close: a `MembersPill`, an `IconButton` to where it was first said. */
33
+ actions?: ReactNode
34
+ /** Closes the column. */
35
+ onClose?: () => void
36
+ /** The column's name. */
37
+ title?: ReactNode
38
+ /** The column's scrolling box, for opening at the newest reply. */
39
+ bodyRef?: Ref<HTMLDivElement>
40
+ /** Placement only. */
41
+ className?: string
42
+ }
43
+
44
+ /** Whether there are replies: an app's `replies.map(…)` with none is an empty list, which is not nothing to React but is to the reader. */
45
+ const anyIn = (children: ReactNode) => Children.toArray(children).length > 0
46
+
47
+ function Replies({ children, loading }: { children?: ReactNode; loading: boolean }) {
48
+ if (loading) return <SkeletonConversation />
49
+ if (!anyIn(children)) return <EmptyState scope="section" message="No replies yet." />
50
+ return <>{children}</>
51
+ }
52
+
53
+ /**
54
+ * A comment's replies, with the box to write one. In the right column (two columns: Peek's file pages), under its
55
+ * own header with the comment pinned at the top, "Replies", and the box fixed at the bottom. Under its comment (one
56
+ * column: Ship's and Leaf's), the replies hung from a line, quiet, and the box under them, all one card with the
57
+ * comment (Ship's way). Peek's replies column, moved with the conversation.
58
+ */
59
+ export function Thread({ place = 'beside', start, children, loading = false, resolved = false, box, notice, actions, onClose, title = 'Replies', bodyRef, className }: ThreadProps) {
60
+ const foot = notice ?? box
61
+ // In a ConversationLayout the layout draws the line, from the comment's face to the last reply, as one bar.
62
+ const layoutLine = useContext(LineByLayout)
63
+ if (place === 'under') {
64
+ return (
65
+ <div data-thread="under" className={cn('flex flex-col', className)}>
66
+ {(loading || anyIn(children)) && (
67
+ // The replies hang from a line under the comment's face (20px in: its 8px and half its 24px), one step in (Ship's way).
68
+ // 8px from the one card's right edge too, as the box under them: a hovered reply never touches it (Katerina, 31 October).
69
+ // 2px, as the line from the comment's face that runs into it (Katerina, 1 November), and drawn the same way, a
70
+ // filled bar rather than a border: a border snaps to the screen's pixels on its own, and at some zooms the two
71
+ // stood a pixel apart (Katerina: "the line breaks in the middle").
72
+ <div data-thread-replies className="relative ml-[19px] mr-2 flex flex-col gap-1 pl-2.5">
73
+ {!layoutLine && <span aria-hidden className="absolute bottom-0 left-0 top-0 w-0.5 bg-border-default" />}
74
+ <caretOnOpen.Provider value={0}>{loading ? <SkeletonConversation /> : children}</caretOnOpen.Provider>
75
+ </div>
76
+ )}
77
+ {foot && <div className="px-2 pt-2">{foot}</div>}
78
+ </div>
79
+ )
80
+ }
81
+ return (
82
+ <Panel
83
+ className={className}
84
+ bodyRef={bodyRef}
85
+ bodyClassName="flex flex-col"
86
+ title={title}
87
+ actions={
88
+ <>
89
+ {resolved && <Chip type="success" label="Resolved" />}
90
+ {actions}
91
+ {onClose && (
92
+ <IconButton tooltip="Close" aria-label="Close" onClick={onClose}>
93
+ <IconX size={16} stroke={1.5} />
94
+ </IconButton>
95
+ )}
96
+ </>
97
+ }
98
+ footer={foot && <div className="p-3">{foot}</div>}
99
+ >
100
+ {start && (
101
+ <div className="px-4 pb-2 pt-4">
102
+ <PinnedComment {...start} />
103
+ </div>
104
+ )}
105
+ <Divider look="section" label="Replies" className="px-4 py-2" />
106
+ <div className="flex flex-col gap-2 px-4 pb-4">
107
+ <caretOnOpen.Provider value={0}>
108
+ <Replies loading={loading}>{children}</Replies>
109
+ </caretOnOpen.Provider>
110
+ </div>
111
+ </Panel>
112
+ )
113
+ }
package/src/TopBar.mdx CHANGED
@@ -24,9 +24,10 @@ bar ignores the pointer so the content underneath stays reachable.
24
24
  - **`floating`** — an app whose content runs to the top edge; the bar
25
25
  floats over it and only its clusters catch clicks (AppShell's
26
26
  `floating` variant).
27
- - `menu` is the menu button, in an app whose navigation collapses — the
28
- collapsing itself stays the caller's. `logo` sits beside it: the app's
29
- name as text, or a mark.
27
+ - `menu` is the menu button, in an app whose navigation folds. Inside an
28
+ **AppShell** it is the frame's fold ("Hide the sidebar" / "Show the
29
+ sidebar"), the same button in every app (Katerina, 31 October): pass
30
+ nothing. `logo` sits beside it: the app's name as text, or a mark.
30
31
  - `onSearch` is what searching opens — your command launcher. With it the
31
32
  bar draws the search field itself: **SearchInput**'s look, 290px, as a
32
33
  button showing `searchPlaceholder` ("Search…") and the shortcut. A click on
@@ -61,7 +62,8 @@ import { TopBar, IdentityMenu } from '@estiva-app/ui'
61
62
  ```
62
63
 
63
64
  - Geometry is fixed: 52px, `pl-5 pr-[26px]`, right cluster `gap-[6px]` —
64
- don't restyle it per app.
65
+ don't restyle it per app. With a menu button in the solid or inset bar it
66
+ starts at `pl-3.5`, so the button's icon lines up with the Sidebar's.
65
67
  - `onSearch` is called on every Ctrl+K, open or not: to close the launcher
66
68
  on a second Ctrl+K, toggle in your handler.
67
69
  - A click on the field leaves focus where it was, so a launcher can act on the
@@ -69,8 +71,8 @@ import { TopBar, IdentityMenu } from '@estiva-app/ui'
69
71
  - The frame is desktop-only for now — there is no narrow-screen
70
72
  behaviour; the menu button collapses panels, it does not open a drawer.
71
73
 
72
- - The bar is 52px tall, 20px in on the left and 26px on the right, 16px between
73
- its slots.
74
+ - The bar is 52px tall, 20px in on the left (14px with a menu button over a
75
+ Sidebar) and 26px on the right, 16px between its slots.
74
76
 
75
77
  ## What it owns
76
78
 
@@ -1,5 +1,5 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite'
2
- import { IconMenu2 } from '@tabler/icons-react'
2
+ import { IconLayoutSidebarLeftCollapse } from '@tabler/icons-react'
3
3
  import { useState, type ReactNode } from 'react'
4
4
  import { IconButton } from './IconButton'
5
5
  import { PersonTrigger } from './PersonTrigger'
@@ -34,9 +34,10 @@ export default meta
34
34
  type Story = StoryObj<typeof meta>
35
35
 
36
36
  const face = <PersonTrigger name="Ana Duarte" />
37
+ /** The fold AppShell draws there (Katerina, 31 October: the same button in every app). */
37
38
  const menuButton = (
38
- <IconButton tooltip="Toggle menu" tooltipPlacement="bottom" aria-label="Toggle menu">
39
- <IconMenu2 size={16} stroke={1.5} />
39
+ <IconButton tooltip="Hide the sidebar" tooltipPlacement="bottom" aria-label="Hide the sidebar">
40
+ <IconLayoutSidebarLeftCollapse size={16} stroke={1.5} />
40
41
  </IconButton>
41
42
  )
42
43
 
package/src/TopBar.tsx CHANGED
@@ -20,7 +20,8 @@ import { shortcutLabel } from './shortcuts'
20
20
  * (Katerina, 28 September).
21
21
  *
22
22
  * Geometry both apps agreed on before extraction: 52px tall, `pl-5
23
- * pr-[26px]`, right cluster `gap-[6px]`. The left region is two slots
23
+ * pr-[26px]`, right cluster `gap-[6px]`; with a menu button over a
24
+ * Sidebar (solid, inset), `pl-3.5`, so its icon lines up with the rows'. The left region is two slots
24
25
  * side by side — `menu` (the menu button, in an app whose navigation
25
26
  * collapses) and `logo` (the mark or name beside it; Katerina,
26
27
  * 2026-09-02). This component does not know who you are or what is being
@@ -40,7 +41,7 @@ import { shortcutLabel } from './shortcuts'
40
41
  */
41
42
  export interface TopBarProps {
42
43
  variant?: 'solid' | 'floating' | 'inset'
43
- /** Far left: the menu button, in an app whose navigation collapses. Stays the caller's — the bar only places it. */
44
+ /** Far left: the menu button, in an app whose navigation folds. Inside an `AppShell`, the frame's own fold. */
44
45
  menu?: ReactNode
45
46
  /** Beside the menu button: the app's logo mark, or its name as text. */
46
47
  logo?: ReactNode
@@ -83,10 +84,14 @@ export function TopBar({ variant = 'solid', menu, logo, search, onSearch, search
83
84
  <Kbd>{shortcutLabel('Mod-K')}</Kbd>
84
85
  </BaseButton>
85
86
  ))
87
+ /* The menu button's icon stands over the navigation's icons (Katerina, 31 October: the fold's left padding was too
88
+ much, out of line with the rows below). A Sidebar's icon is 18px in (its 10px and the row's 8px), the button's 4px
89
+ inside it, so the bar starts 14px in; a Rail centres its icons on 24px, which the bar's own 20px already meets. */
86
90
  return (
87
91
  <header
88
92
  className={cn(
89
- 'flex h-[52px] items-center pl-5 pr-[26px]',
93
+ 'flex h-[52px] items-center pr-[26px]',
94
+ menu && !floating ? 'pl-3.5' : 'pl-5',
90
95
  floating
91
96
  ? 'pointer-events-none absolute left-0 right-0 top-0 z-10'
92
97
  : cn('shrink-0 gap-4', variant === 'solid' && 'border-b border-border-default bg-bg-surface'),
@@ -0,0 +1,37 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
2
+ import * as Stories from './UrgentMark.stories'
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # UrgentMark
7
+
8
+ Urgent and new: a small warning mark on its tint, in the unread dot's 24px slot.
9
+
10
+ <Canvas of={Stories.Urgent} />
11
+
12
+ ## When
13
+
14
+ - In place of **UnreadDot** on something urgent and not read yet: a comment, a reply, a row of the navigation.
15
+
16
+ ## When not
17
+
18
+ - New and not urgent → **UnreadDot**.
19
+ - A count of urgent things → **Chip**.
20
+
21
+ ## How
22
+
23
+ ```tsx
24
+ import { UnreadDot, UrgentMark } from '@estiva-app/ui'
25
+
26
+ <>{isNew && (urgent ? <UrgentMark /> : <UnreadDot />)}</>
27
+ ```
28
+
29
+ - It says nothing to a screen reader: say "urgent" in the row's own words.
30
+
31
+ ## What it owns
32
+
33
+ Nothing. It only draws. Clicks and keys are yours.
34
+
35
+ ## Props
36
+
37
+ <Controls />