@estiva-app/ui 0.95.0 → 0.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/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/Button.d.ts +4 -3
  6. package/dist/Button.d.ts.map +1 -1
  7. package/dist/Card.d.ts.map +1 -1
  8. package/dist/CommentBox.d.ts.map +1 -1
  9. package/dist/ConversationActions.d.ts +24 -0
  10. package/dist/ConversationActions.d.ts.map +1 -0
  11. package/dist/ConversationCard.d.ts +88 -0
  12. package/dist/ConversationCard.d.ts.map +1 -0
  13. package/dist/ConversationLayout.d.ts +50 -0
  14. package/dist/ConversationLayout.d.ts.map +1 -0
  15. package/dist/ConversationMenu.d.ts +24 -0
  16. package/dist/ConversationMenu.d.ts.map +1 -0
  17. package/dist/Divider.d.ts +23 -4
  18. package/dist/Divider.d.ts.map +1 -1
  19. package/dist/EditedMarker.d.ts +11 -0
  20. package/dist/EditedMarker.d.ts.map +1 -0
  21. package/dist/IconButton.d.ts +3 -3
  22. package/dist/IconButton.d.ts.map +1 -1
  23. package/dist/LinkParts.d.ts +3 -1
  24. package/dist/LinkParts.d.ts.map +1 -1
  25. package/dist/ListColumn.d.ts +3 -1
  26. package/dist/ListColumn.d.ts.map +1 -1
  27. package/dist/MetaText.d.ts +22 -0
  28. package/dist/MetaText.d.ts.map +1 -0
  29. package/dist/NavItem.d.ts.map +1 -1
  30. package/dist/PageHeader.d.ts +50 -0
  31. package/dist/PageHeader.d.ts.map +1 -0
  32. package/dist/Panel.d.ts +6 -0
  33. package/dist/Panel.d.ts.map +1 -1
  34. package/dist/PinnedComment.d.ts +17 -0
  35. package/dist/PinnedComment.d.ts.map +1 -0
  36. package/dist/QuotedLine.d.ts +16 -0
  37. package/dist/QuotedLine.d.ts.map +1 -0
  38. package/dist/ReactionHorizon.d.ts +14 -0
  39. package/dist/ReactionHorizon.d.ts.map +1 -0
  40. package/dist/RepliesRow.d.ts +26 -0
  41. package/dist/RepliesRow.d.ts.map +1 -0
  42. package/dist/ResolveDialog.d.ts +13 -0
  43. package/dist/ResolveDialog.d.ts.map +1 -0
  44. package/dist/Select.d.ts +1 -1
  45. package/dist/Select.d.ts.map +1 -1
  46. package/dist/Skeleton.d.ts +8 -4
  47. package/dist/Skeleton.d.ts.map +1 -1
  48. package/dist/Thread.d.ts +38 -0
  49. package/dist/Thread.d.ts.map +1 -0
  50. package/dist/TopBar.d.ts +3 -2
  51. package/dist/TopBar.d.ts.map +1 -1
  52. package/dist/UrgentMark.d.ts +6 -0
  53. package/dist/UrgentMark.d.ts.map +1 -0
  54. package/dist/commentBoxFrame.d.ts +3 -1
  55. package/dist/commentBoxFrame.d.ts.map +1 -1
  56. package/dist/conversation.examples.d.ts +52 -0
  57. package/dist/conversation.examples.d.ts.map +1 -0
  58. package/dist/editor.js +32 -24
  59. package/dist/editor.js.map +2 -2
  60. package/dist/eslint/index.js +2 -1
  61. package/dist/eslint/index.js.map +2 -2
  62. package/dist/eslint/no-native-title.d.ts +1 -1
  63. package/dist/eslint/no-native-title.d.ts.map +1 -1
  64. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  65. package/dist/index.d.ts +18 -2
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +1376 -433
  68. package/dist/index.js.map +4 -4
  69. package/dist/looks.d.ts +13 -1
  70. package/dist/looks.d.ts.map +1 -1
  71. package/dist/threadCard.d.ts +46 -0
  72. package/dist/threadCard.d.ts.map +1 -0
  73. package/package.json +1 -1
  74. package/registry.json +1873 -546
  75. package/src/AppShell.mdx +24 -10
  76. package/src/AppShell.stories.tsx +65 -31
  77. package/src/AppShell.test.tsx +92 -10
  78. package/src/AppShell.tsx +108 -18
  79. package/src/ArchivedNotice.mdx +46 -0
  80. package/src/ArchivedNotice.stories.tsx +52 -0
  81. package/src/ArchivedNotice.test.tsx +42 -0
  82. package/src/ArchivedNotice.tsx +71 -0
  83. package/src/Button.mdx +2 -2
  84. package/src/Button.tsx +8 -6
  85. package/src/Card.test.tsx +4 -4
  86. package/src/Card.tsx +6 -2
  87. package/src/CommentBox.test.tsx +2 -1
  88. package/src/CommentBox.tsx +14 -7
  89. package/src/ConfirmDialog.stories.tsx +12 -0
  90. package/src/ConversationActions.mdx +47 -0
  91. package/src/ConversationActions.stories.tsx +39 -0
  92. package/src/ConversationActions.tsx +96 -0
  93. package/src/ConversationCard.mdx +72 -0
  94. package/src/ConversationCard.states.test.tsx +330 -0
  95. package/src/ConversationCard.stories.tsx +135 -0
  96. package/src/ConversationCard.test.tsx +159 -0
  97. package/src/ConversationCard.tsx +522 -0
  98. package/src/ConversationLayout.mdx +61 -0
  99. package/src/ConversationLayout.stories.tsx +161 -0
  100. package/src/ConversationLayout.test.tsx +240 -0
  101. package/src/ConversationLayout.tsx +233 -0
  102. package/src/ConversationMenu.mdx +47 -0
  103. package/src/ConversationMenu.stories.tsx +42 -0
  104. package/src/ConversationMenu.test.tsx +47 -0
  105. package/src/ConversationMenu.tsx +57 -0
  106. package/src/Divider.mdx +36 -1
  107. package/src/Divider.stories.tsx +57 -0
  108. package/src/Divider.test.tsx +24 -1
  109. package/src/Divider.tsx +49 -9
  110. package/src/EditedMarker.mdx +36 -0
  111. package/src/EditedMarker.stories.tsx +24 -0
  112. package/src/EditedMarker.tsx +20 -0
  113. package/src/IconButton.mdx +2 -1
  114. package/src/IconButton.tsx +8 -5
  115. package/src/LinkParts.mdx +4 -0
  116. package/src/LinkParts.stories.tsx +10 -0
  117. package/src/LinkParts.tsx +5 -1
  118. package/src/ListColumn.tsx +9 -3
  119. package/src/MetaText.mdx +41 -0
  120. package/src/MetaText.stories.tsx +29 -0
  121. package/src/MetaText.tsx +38 -0
  122. package/src/NavItem.tsx +2 -11
  123. package/src/PageHeader.mdx +123 -0
  124. package/src/PageHeader.stories.tsx +174 -0
  125. package/src/PageHeader.test.tsx +99 -0
  126. package/src/PageHeader.tsx +105 -0
  127. package/src/Panel.mdx +12 -0
  128. package/src/Panel.stories.tsx +47 -5
  129. package/src/Panel.test.tsx +40 -0
  130. package/src/Panel.tsx +8 -2
  131. package/src/PinnedComment.mdx +40 -0
  132. package/src/PinnedComment.stories.tsx +21 -0
  133. package/src/PinnedComment.tsx +40 -0
  134. package/src/QuotedLine.mdx +44 -0
  135. package/src/QuotedLine.stories.tsx +30 -0
  136. package/src/QuotedLine.test.tsx +34 -0
  137. package/src/QuotedLine.tsx +33 -0
  138. package/src/ReactionHorizon.mdx +36 -0
  139. package/src/ReactionHorizon.stories.tsx +27 -0
  140. package/src/ReactionHorizon.tsx +27 -0
  141. package/src/RepliesRow.mdx +45 -0
  142. package/src/RepliesRow.stories.tsx +33 -0
  143. package/src/RepliesRow.test.tsx +47 -0
  144. package/src/RepliesRow.tsx +86 -0
  145. package/src/ReplyCard.mdx +50 -0
  146. package/src/ReplyCard.stories.tsx +68 -0
  147. package/src/ResolveDialog.mdx +44 -0
  148. package/src/ResolveDialog.stories.tsx +23 -0
  149. package/src/ResolveDialog.test.tsx +53 -0
  150. package/src/ResolveDialog.tsx +58 -0
  151. package/src/Select.tsx +12 -2
  152. package/src/Skeleton.stories.tsx +4 -1
  153. package/src/Skeleton.tsx +33 -4
  154. package/src/Thread.mdx +53 -0
  155. package/src/Thread.stories.tsx +167 -0
  156. package/src/Thread.test.tsx +83 -0
  157. package/src/Thread.tsx +113 -0
  158. package/src/TopBar.mdx +8 -6
  159. package/src/TopBar.stories.tsx +4 -3
  160. package/src/TopBar.tsx +8 -3
  161. package/src/UrgentMark.mdx +37 -0
  162. package/src/UrgentMark.stories.tsx +27 -0
  163. package/src/UrgentMark.tsx +15 -0
  164. package/src/commentBoxFrame.tsx +8 -4
  165. package/src/conversation.examples.tsx +135 -0
  166. package/src/eslint/no-native-title.ts +1 -1
  167. package/src/eslint/no-restyled-part.ts +1 -0
  168. package/src/index.ts +19 -2
  169. package/src/looks.ts +18 -2
  170. package/src/registry/registry.test.ts +7 -6
  171. package/src/threadCard.ts +84 -0
  172. package/stories/Choosing.mdx +21 -1
  173. package/tokens.css +14 -10
@@ -0,0 +1,42 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import { userEvent, within } from 'storybook/test'
3
+ import { Button } from './Button'
4
+ import { ConversationMenu } from './ConversationMenu'
5
+ import { MenuItem } from './Menu'
6
+
7
+ /**
8
+ * The ⋯ menu of a comment or a reply. On a card its trigger is the ⋯ on the strip; here, a button, so it can be
9
+ * seen. Each story opens it; on this page, press the button.
10
+ */
11
+ const meta = {
12
+ title: 'Conversation/ConversationMenu',
13
+ component: ConversationMenu,
14
+ parameters: { layout: 'padded' },
15
+ args: { trigger: <Button variant="outlined">Open the menu</Button> },
16
+ argTypes: { trigger: { control: false }, children: { control: false } },
17
+ decorators: [(Story) => <div className="flex min-h-[220px] items-start pl-[200px] pt-2">{Story()}</div>],
18
+ play: async ({ canvasElement }) => {
19
+ await userEvent.click(within(canvasElement).getByRole('button', { name: 'Open the menu' }))
20
+ },
21
+ } satisfies Meta<typeof ConversationMenu>
22
+
23
+ export default meta
24
+ type Story = StoryObj<typeof meta>
25
+
26
+ /** On your own: Resolve, then Edit and Delete. */
27
+ export const Yours: Story = { args: { onResolve: () => {}, onEdit: () => {}, onDelete: () => {} } }
28
+
29
+ /** On someone else's: Resolve only. */
30
+ export const Theirs: Story = { args: { onResolve: () => {} } }
31
+
32
+ /** Resolved: Reopen in place of Resolve. */
33
+ export const Resolved: Story = { args: { resolved: true, onReopen: () => {}, onEdit: () => {}, onDelete: () => {} } }
34
+
35
+ /** Your own reply: no Resolve, so Edit and Delete only. */
36
+ export const Reply: Story = { args: { onEdit: () => {}, onDelete: () => {} } }
37
+
38
+ /** The app's own rows, after Resolve and before Edit. */
39
+ export const MoreRows: Story = {
40
+ name: 'More rows',
41
+ args: { onResolve: () => {}, onEdit: () => {}, onDelete: () => {}, children: <MenuItem label="Item one" onClick={() => {}} /> },
42
+ }
@@ -0,0 +1,47 @@
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 { ConversationMenu } from './ConversationMenu'
5
+ import { MenuItem } from './Menu'
6
+
7
+ afterEach(cleanup)
8
+
9
+ /** Opens the menu from its own ⋯ button. */
10
+ async function open() {
11
+ fireEvent.click(screen.getByRole('button', { name: 'More actions' }))
12
+ await screen.findByRole('menu')
13
+ }
14
+
15
+ const names = () => screen.getAllByRole('menuitem').map((row) => row.textContent)
16
+
17
+ describe('ConversationMenu', () => {
18
+ it('offers Resolve, then the app’s rows, then Edit and Delete, the last two apart', async () => {
19
+ const onResolve = vi.fn()
20
+ render(
21
+ <ConversationMenu onResolve={onResolve} onEdit={() => {}} onDelete={() => {}}>
22
+ <MenuItem label="Open work" onClick={() => {}} />
23
+ </ConversationMenu>,
24
+ )
25
+ await open()
26
+ expect(names()).toEqual(['Resolve', 'Open work', 'Edit', 'Delete'])
27
+ expect(screen.getAllByRole('separator').length).toBe(1)
28
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Resolve' }))
29
+ expect(onResolve).toHaveBeenCalledOnce()
30
+ })
31
+
32
+ it('offers Reopen in place of Resolve once resolved', async () => {
33
+ const onReopen = vi.fn()
34
+ render(<ConversationMenu resolved onResolve={() => {}} onReopen={onReopen} />)
35
+ await open()
36
+ expect(names()).toEqual(['Reopen'])
37
+ fireEvent.click(screen.getByRole('menuitem', { name: 'Reopen' }))
38
+ expect(onReopen).toHaveBeenCalledOnce()
39
+ })
40
+
41
+ it('offers Edit and Delete only when given, with no line before them alone', async () => {
42
+ render(<ConversationMenu onEdit={() => {}} onDelete={() => {}} />)
43
+ await open()
44
+ expect(names()).toEqual(['Edit', 'Delete'])
45
+ expect(screen.queryByRole('separator')).toBeNull()
46
+ })
47
+ })
@@ -0,0 +1,57 @@
1
+ import type { ReactElement, ReactNode } from 'react'
2
+ import { IconCircleCheck, IconCircleDashed, IconDotsVertical } from '@tabler/icons-react'
3
+ import { IconButton } from './IconButton'
4
+ import { Menu, MenuItem, MenuSeparator } from './Menu'
5
+
6
+ export interface ConversationMenuProps {
7
+ /** Resolved: the menu offers Reopen in place of Resolve. */
8
+ resolved?: boolean
9
+ onResolve?: () => void
10
+ onReopen?: () => void
11
+ /** The app's own rows, between Resolve and Edit: `MenuItem`s. */
12
+ children?: ReactNode
13
+ /** Offered on your own only. */
14
+ onEdit?: () => void
15
+ /** Offered on your own only; the card asks before it deletes. */
16
+ onDelete?: () => void
17
+ open?: boolean
18
+ onOpenChange?: (open: boolean) => void
19
+ /** The button that opens it: a `ToolbarButton` inside `ConversationActions`. Absent: an `IconButton`. */
20
+ trigger?: ReactElement
21
+ }
22
+
23
+ /**
24
+ * The ⋯ menu of a comment or a reply: Resolve or Reopen and the app's own rows, then Edit and Delete on your own.
25
+ * A card offers it only when it has a row to show.
26
+ * Peek's, moved with the conversation; its "Utilities" heading went, as the kit names no app's furniture.
27
+ */
28
+ export function ConversationMenu({ resolved = false, onResolve, onReopen, children, onEdit, onDelete, open, onOpenChange, trigger }: ConversationMenuProps) {
29
+ const resolves = resolved ? onReopen : onResolve
30
+ return (
31
+ <Menu
32
+ trigger={
33
+ trigger ?? (
34
+ <IconButton tooltip="More actions" aria-label="More actions">
35
+ <IconDotsVertical size={16} stroke={1.5} />
36
+ </IconButton>
37
+ )
38
+ }
39
+ align="right"
40
+ open={open}
41
+ onOpenChange={onOpenChange}
42
+ className="w-[244px]"
43
+ >
44
+ {resolves &&
45
+ (resolved ? (
46
+ <MenuItem leading={<IconCircleDashed size={16} stroke={1.5} className="text-text-secondary" />} label="Reopen" onClick={onReopen} />
47
+ ) : (
48
+ <MenuItem leading={<IconCircleCheck size={16} stroke={1.5} className="text-text-secondary" />} label="Resolve" onClick={onResolve} />
49
+ ))}
50
+ {children}
51
+ {/* Edit and Delete are one group, as in Peek; the line only between two groups that are both there. */}
52
+ {(resolves || children) && (onEdit || onDelete) && <MenuSeparator />}
53
+ {onEdit && <MenuItem label="Edit" onClick={onEdit} />}
54
+ {onDelete && <MenuItem label="Delete" destructive onClick={onDelete} />}
55
+ </Menu>
56
+ )
57
+ }
package/src/Divider.mdx CHANGED
@@ -26,6 +26,23 @@ orientation for assistive tech.
26
26
 
27
27
  <Canvas of={DividerStories.Warning} />
28
28
 
29
+ - `look="section"` between stretches of a list, in the list's own voice: a
30
+ date, where the answers to the first item begin. The words are
31
+ `SectionLabel`'s muted voice and are cut short with an ellipsis where there
32
+ is no room; the lines run edge to edge, 8px in, and the whole line is 24px
33
+ tall. A node may stand for the words; it names the line by them. It is
34
+ always muted: where what is new begins is the caption look's `warning`,
35
+ in the same list.
36
+
37
+ <Canvas of={DividerStories.ADate} />
38
+
39
+ <Canvas of={DividerStories.New} />
40
+
41
+ - `sticky` keeps it at the top of its list while its stretch scrolls under
42
+ it, until the next one takes its place.
43
+
44
+ <Canvas of={DividerStories.Sticky} />
45
+
29
46
  ## When not
30
47
 
31
48
  - Between groups in a menu → **MenuSeparator**: this line with its own 4px
@@ -44,12 +61,28 @@ import { Divider } from '@estiva-app/ui'
44
61
  <Divider orientation="vertical" />
45
62
  <Divider label="Today" />
46
63
  <Divider label="New since you last read this" tone="warning" />
64
+
65
+ <Divider look="section" label="Replies" />
66
+
67
+ // Each line first in the box that holds its stretch.
68
+ {days.map((day) => (
69
+ <div key={day.id} className="flex flex-col">
70
+ <Divider look="section" label={day.label} sticky />
71
+ {day.rows}
72
+ </div>
73
+ ))}
47
74
  ```
48
75
 
49
76
  - **Inside a `Menu` or a `Popover` it has no inset**: the hairline runs the
50
77
  width of the rows. The panel tells it so; nothing is passed in.
51
78
 
52
- - The line is 1px; the room around it is yours.
79
+ - The line is 1px; the room around it is yours. The section look brings its
80
+ own: 8px at each side, 6px above and below; a `className` such as
81
+ `px-4 py-2` changes it.
82
+ - **`sticky` sticks to the nearest box that scrolls**, and only while the box
83
+ that holds it is in view: put each line first in the box that holds its
84
+ stretch, as above. It is drawn on the surface's fill (`bg-surface`), so the
85
+ rows pass under it unseen; a list on another fill is not covered yet.
53
86
 
54
87
  ## What it owns
55
88
 
@@ -59,6 +92,8 @@ It does these by itself. Write none of them around it.
59
92
  |---|---|---|
60
93
  | Says what it is to assistive technology: a separator | `role="separator"` | ✓ |
61
94
  | Keeps its 1px line in a scrolling column | `shrink-0` | |
95
+ | Cuts a long label short with an ellipsis, in the section look | `min-w-0 truncate` around the words | |
96
+ | Stays at the top of its list while its stretch scrolls, with `sticky` | `sticky top-0 z-10 bg-bg-surface` | |
62
97
 
63
98
  ## Props
64
99
 
@@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { Divider } from './Divider'
3
3
  import { MenuPanel } from './Menu'
4
4
  import { Card } from './Card'
5
+ import { ScrollArea } from './ScrollArea'
5
6
 
6
7
  /** A hairline in `border-subtle`, inset 12px each side — or standing up between two columns. */
7
8
  const meta = {
@@ -69,3 +70,59 @@ export const Warning: Story = {
69
70
  </div></Card>
70
71
  ),
71
72
  }
73
+
74
+ /** Between two stretches of a list, in the section-label voice: a date. Lines edge to edge, 8px in, 24px tall. */
75
+ export const ADate: Story = {
76
+ render: () => (
77
+ <Card className="w-96 py-3"><div className="text-body-2 text-text-primary">
78
+ <p className="px-3 pb-2">The last item of one day.</p>
79
+ <Divider look="section" label="Wednesday, 29 October" />
80
+ <p className="px-3 pt-2">The first item of the next.</p>
81
+ </div></Card>
82
+ ),
83
+ }
84
+
85
+ /** Where what answers the first item begins. */
86
+ export const Replies: Story = {
87
+ render: () => (
88
+ <Card className="w-96 py-3"><div className="text-body-2 text-text-primary">
89
+ <p className="px-3 pb-2">The item everything below answers.</p>
90
+ <Divider look="section" label="Replies" />
91
+ <p className="px-3 pt-2">The first answer.</p>
92
+ </div></Card>
93
+ ),
94
+ }
95
+
96
+ /** In a list with its date lines: where what is new to the reader begins, in the caption look and the warning colour, which asks for attention. */
97
+ export const New: Story = {
98
+ render: () => (
99
+ <Card className="w-96 py-3"><div className="text-body-2 text-text-primary">
100
+ <Divider look="section" label="Wednesday, 29 October" />
101
+ <p className="px-3 py-2">The last item already read.</p>
102
+ <Divider label="New" tone="warning" />
103
+ <p className="px-3 pt-2">The first new one.</p>
104
+ </div></Card>
105
+ ),
106
+ }
107
+
108
+ /** Each line stays at the top of the list while its stretch scrolls under it, until the next one takes its place. Scroll the box. */
109
+ export const Sticky: Story = {
110
+ parameters: { controls: { disable: true } },
111
+ render: () => (
112
+ <Card clip className="h-64 w-96">
113
+ <ScrollArea className="h-full">
114
+ {['Tuesday, 28 October', 'Wednesday, 29 October'].map((day) => (
115
+ // The line first in the box that holds its stretch: it stays while the box is in view.
116
+ <div key={day} className="flex flex-col">
117
+ <Divider look="section" label={day} sticky />
118
+ {Array.from({ length: 6 }, (_, i) => (
119
+ <p key={i} className="px-4 py-3 text-body-2 text-text-secondary">
120
+ Item {i + 1} of {day}
121
+ </p>
122
+ ))}
123
+ </div>
124
+ ))}
125
+ </ScrollArea>
126
+ </Card>
127
+ ),
128
+ }
@@ -1,5 +1,5 @@
1
1
  // @vitest-environment jsdom
2
- /** What the Divider page claims, pinned: the role, and a label that names the line. */
2
+ /** What the Divider page claims, pinned: the role, and a label that names the line, in either look. */
3
3
  import { afterEach, describe, expect, it } from 'vitest'
4
4
  import { cleanup, render, screen } from '@testing-library/react'
5
5
  import { Divider } from './Divider'
@@ -38,4 +38,27 @@ describe('Divider', () => {
38
38
  render(<Divider orientation="vertical" label="Nope" />)
39
39
  expect(screen.getByRole('separator').textContent).toBe('')
40
40
  })
41
+
42
+ it('in the section look, a string label still names the line, and its words are drawn once', () => {
43
+ render(<Divider look="section" label="Replies" />)
44
+ const rule = screen.getByRole('separator', { name: 'Replies' })
45
+ expect(rule.textContent).toBe('Replies')
46
+ expect(rule.querySelectorAll('[aria-hidden="true"]')).toHaveLength(2)
47
+ })
48
+
49
+ it('a label that is a node names the line by its words, in either look', () => {
50
+ render(
51
+ <>
52
+ <Divider label={<>Wednesday, <b>29 October</b></>} />
53
+ <Divider look="section" label={<>Item <b>two</b></>} />
54
+ </>,
55
+ )
56
+ expect(screen.getByRole('separator', { name: 'Wednesday, 29 October' }).textContent).toBe('Wednesday, 29 October')
57
+ expect(screen.getByRole('separator', { name: 'Item two' }).textContent).toBe('Item two')
58
+ })
59
+
60
+ it('vertical ignores the section look and its label too', () => {
61
+ render(<Divider orientation="vertical" look="section" label="Nope" sticky />)
62
+ expect(screen.getByRole('separator').textContent).toBe('')
63
+ })
41
64
  })
package/src/Divider.tsx CHANGED
@@ -1,6 +1,7 @@
1
- import { createContext, useContext } from 'react'
1
+ import { createContext, useContext, useId, type ReactNode } from 'react'
2
2
  import { Separator } from '@base-ui/react/separator'
3
3
  import { cn } from './cn'
4
+ import { SectionLabel } from './SectionLabel'
4
5
 
5
6
  /**
6
7
  * Inside a `Menu` or a `Popover` a hairline runs edge to edge of the rows,
@@ -23,33 +24,72 @@ export interface DividerProps {
23
24
  orientation?: 'horizontal' | 'vertical'
24
25
  /**
25
26
  * Words in the middle of the line — "New since you last read this", a
26
- * date. Horizontal only; the line splits around the label.
27
+ * date. Horizontal only; the line splits around the label. A string names
28
+ * the line for assistive tech; so does a node, by its words.
27
29
  */
28
- label?: string
30
+ label?: ReactNode
31
+ /**
32
+ * How the words in the middle are drawn.
33
+ *
34
+ * - `caption` (default): the muted caption, the line inset 12px each side.
35
+ * - `section`: Peek's line between stretches of a list (its `DateDivider`,
36
+ * measured 31 October): the words in `SectionLabel`'s muted voice, cut
37
+ * short with an ellipsis where there is no room; the lines edge to edge,
38
+ * 8px in and 6px above and below — 24px tall.
39
+ */
40
+ look?: 'caption' | 'section'
41
+ /**
42
+ * Stays at the top of the list that scrolls under it until the next one
43
+ * takes its place: `sticky top-0` on the surface's fill, as Peek's date
44
+ * lines are. Put each one first in the box that holds its stretch.
45
+ */
46
+ sticky?: boolean
29
47
  /**
30
48
  * `warning` for a line that asks for attention: the label in the warning
31
49
  * colour, the lines in its wash. Peek and Ship both drew their "new since
32
50
  * you last read" rule in the accent, which measures 3.3:1 on Ship's
33
51
  * background and could not be read (Katerina, 2026-09-08); the warning
34
52
  * colour measures 9.6:1 there. Default: the muted text, `border-subtle`
35
- * lines, for a date.
53
+ * lines, for a date. The caption look's only: the section look is always
54
+ * muted.
36
55
  */
37
56
  tone?: 'default' | 'warning'
38
57
  className?: string
39
58
  }
40
59
 
41
- export function Divider({ orientation = 'horizontal', label, tone = 'default', className }: DividerProps) {
60
+ export function Divider({ orientation = 'horizontal', label, tone = 'default', look = 'caption', sticky = false, className }: DividerProps) {
42
61
  const inset = useContext(DividerInPanel) ? 'mx-0' : 'mx-3'
43
- if (label && orientation === 'horizontal') {
62
+ const labelId = useId()
63
+ if (label != null && label !== false && label !== '' && orientation === 'horizontal') {
44
64
  const line = tone === 'warning' ? 'bg-warning-muted' : 'bg-border-subtle'
65
+ // A string names the line itself, as it always has; a node names it by its words.
66
+ const named = typeof label === 'string' ? { 'aria-label': label } : { 'aria-labelledby': labelId }
67
+ const id = typeof label === 'string' ? undefined : labelId
68
+ const stays = sticky && 'sticky top-0 z-10 bg-bg-surface'
69
+ if (look === 'section') {
70
+ // No warning here: SectionLabel has no warning voice, and a line that asks for attention is the caption
71
+ // look's, as both apps' "New" lines are.
72
+ return (
73
+ <Separator orientation="horizontal" {...named} className={cn('flex shrink-0 items-center gap-2 px-2 py-1.5', stays, className)}>
74
+ <span aria-hidden="true" className="h-px flex-1 bg-border-subtle" />
75
+ {/* min-w-0 on the way down: a long label is cut short with an ellipsis instead of pushing past the edge. */}
76
+ <span id={id} className="flex min-w-0">
77
+ <SectionLabel tone="muted" truncate>
78
+ {label}
79
+ </SectionLabel>
80
+ </span>
81
+ <span aria-hidden="true" className="h-px flex-1 bg-border-subtle" />
82
+ </Separator>
83
+ )
84
+ }
45
85
  return (
46
86
  <Separator
47
87
  orientation="horizontal"
48
- aria-label={label}
49
- className={cn('flex shrink-0 items-center gap-2', inset, className)}
88
+ {...named}
89
+ className={cn('flex shrink-0 items-center gap-2', inset, stays, className)}
50
90
  >
51
91
  <span aria-hidden="true" className={cn('h-px flex-1', line)} />
52
- <span className={cn('shrink-0 text-caption', tone === 'warning' ? 'text-warning-default' : 'text-text-muted')}>{label}</span>
92
+ <span id={id} className={cn('shrink-0 text-caption', tone === 'warning' ? 'text-warning-default' : 'text-text-muted')}>{label}</span>
53
93
  <span aria-hidden="true" className={cn('h-px flex-1', line)} />
54
94
  </Separator>
55
95
  )
@@ -0,0 +1,36 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
2
+ import * as Stories from './EditedMarker.stories'
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # EditedMarker
7
+
8
+ "(edited)" beside a time, with when it was edited on hover. Nothing is drawn when it was never edited.
9
+
10
+ <Canvas of={Stories.Edited} />
11
+
12
+ ## When
13
+
14
+ - Beside the time of anything people wrote and can edit: the cards draw it from `edited`.
15
+
16
+ ## When not
17
+
18
+ - A time on its own → **MetaText**.
19
+
20
+ ## How
21
+
22
+ ```tsx
23
+ import { EditedMarker } from '@estiva-app/ui'
24
+
25
+ <EditedMarker edited={editedWords} />
26
+ ```
27
+
28
+ - The words in `edited` are the app's: its own way of saying a time.
29
+
30
+ ## What it owns
31
+
32
+ Nothing. It only draws. Clicks and keys are yours.
33
+
34
+ ## Props
35
+
36
+ <Controls />
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import { EditedMarker } from './EditedMarker'
3
+ import { MetaText } from './MetaText'
4
+
5
+ /** "(edited)" beside a time. Point at it for when. */
6
+ const meta = {
7
+ title: 'Conversation/EditedMarker',
8
+ component: EditedMarker,
9
+ parameters: { layout: 'padded' },
10
+ args: { edited: 'Edited 11:20 AM' },
11
+ } satisfies Meta<typeof EditedMarker>
12
+
13
+ export default meta
14
+ type Story = StoryObj<typeof meta>
15
+
16
+ /** Beside a time, as a card draws it. */
17
+ export const Edited: Story = {
18
+ render: (args) => (
19
+ <span className="flex items-center gap-2">
20
+ <MetaText>11:08 AM</MetaText>
21
+ <EditedMarker {...args} />
22
+ </span>
23
+ ),
24
+ }
@@ -0,0 +1,20 @@
1
+ import { WithTooltip } from './Tooltip'
2
+
3
+ export interface EditedMarkerProps {
4
+ /** When it was edited, in the app's words for the tooltip ("Edited 11:20 AM"). Absent: nothing is drawn. */
5
+ edited?: string
6
+ }
7
+
8
+ /**
9
+ * "(edited)" beside a comment's time: the reader is told the words changed, so a reply written to the old words is
10
+ * not misread. The time it was edited is in the tooltip, so the line stays one line. Peek's, moved with the
11
+ * conversation (the record that makes one conversation ends its "stays Peek's" ruling).
12
+ */
13
+ export function EditedMarker({ edited }: EditedMarkerProps) {
14
+ if (!edited) return null
15
+ return (
16
+ <WithTooltip label={edited} wrapperClassName="shrink-0">
17
+ <span className="whitespace-nowrap text-caption text-text-muted">(edited)</span>
18
+ </WithTooltip>
19
+ )
20
+ }
@@ -42,7 +42,7 @@ import { IconPencil } from '@tabler/icons-react'
42
42
  - The icon is 16px at stroke 1.5.
43
43
  - `variant="current"` takes the colour of what it sits in — the ✕ on a
44
44
  `Banner` wears the banner's tone. `variant="resolve"` is `muted` that turns
45
- green when pointed at in Signal: Resolve, wherever it appears.
45
+ green when pointed at, in every theme: Resolve, wherever it appears.
46
46
  - `pressed` is a toggle that is on — Bold while the selection is bold: the
47
47
  active fill, and `aria-pressed`. A `ToolbarButton` takes it too.
48
48
  - `glow` lights it in Signal — the send arrow while there is something to send.
@@ -51,6 +51,7 @@ import { IconPencil } from '@tabler/icons-react'
51
51
  shadow is refused by the lint (`estiva/no-restyled-part`).
52
52
  - `type` defaults to `"button"`; it is a native `<button>` on Base UI's
53
53
  Button, and every native prop passes through.
54
+ - A disabled `primary` keeps the disabled fill, as the comment box's Send while it is empty; in Leaf it is a quiet icon with no fill, in the muted words' colour. It takes the accent once it can be pressed.
54
55
  - `disabledReason="Read only"` disables it, keeps it reachable by Tab,
55
56
  and shows the reason in place of the tooltip — **on keyboard focus as
56
57
  well as on hover**.
@@ -22,9 +22,9 @@ export type IconButtonVariant = 'muted' | 'outlined' | 'primary' | 'current' | '
22
22
  export interface IconButtonProps extends ComponentPropsWithRef<'button'> {
23
23
  /**
24
24
  * `current` takes the colour of what it sits in — the ✕ on a `Banner` wears
25
- * the banner's tone. `resolve` is `muted` that turns green when pointed at in
26
- * Signal, Peek's Resolve (UIG-9, 17 September; before, each app passed these
27
- * as classes).
25
+ * the banner's tone. `resolve` is `muted` that turns green when pointed at, in
26
+ * every theme: Peek's Resolve (UIG-9, 17 September; before, each app passed
27
+ * these as classes), Signal's look in Ship and Leaf too (Katerina, 31 October).
28
28
  */
29
29
  variant?: IconButtonVariant
30
30
  /** On, like a Bold button while the selection is bold: the active fill, and `aria-pressed`. */
@@ -89,12 +89,15 @@ export function IconButton({
89
89
  !off && (variant === 'muted' || variant === 'resolve') && MUTED_CONTROL_CLASSES,
90
90
  !off && variant === 'outlined' && 'border border-border-default hover:bg-bg-hover text-text-secondary',
91
91
  !off && variant === 'current' && 'hover:bg-bg-hover',
92
- off && variant === 'primary' && 'bg-bg-disabled text-text-disabled',
92
+ // Not yet usable, as the comment box's Send while the box is empty: the disabled fill, as every app shows it
93
+ // (Katerina, 1 November). In Leaf, a quiet icon with no fill, in the muted words' colour, so it still reads on
94
+ // the box's grey (31 October: the disabled fill and colour were 1.06 and 1.29 : 1 there).
95
+ off && variant === 'primary' && 'bg-bg-disabled text-text-disabled leaf:bg-transparent leaf:text-text-muted',
93
96
  off && (variant === 'muted' || variant === 'resolve') && 'text-text-disabled',
94
97
  off && variant === 'outlined' && 'border border-border-default text-text-disabled',
95
98
  // Always, disabled too: the colour of where it sits, and Resolve's green.
96
99
  variant === 'current' && 'text-current',
97
- variant === 'resolve' && 'signal:hover:bg-success-muted signal:hover:text-success-default',
100
+ variant === 'resolve' && 'hover:bg-success-muted hover:text-success-default',
98
101
  pressed && 'bg-bg-active text-text-primary',
99
102
  glow && 'signal:shadow-glow-accent',
100
103
  // `pointer-events-none` only where the button is truly out of reach:
package/src/LinkParts.mdx CHANGED
@@ -18,6 +18,10 @@ The small parts the link widgets are built from: the pickers, the conversation c
18
18
  - **LinkedIcon**, **LinkKey** — the icon for what a link stands for, and its key.
19
19
 
20
20
  <Canvas of={LinkPartsStories.PickersReadOnly} />
21
+
22
+ - With `disabledReason` (an archived file) the pickers stay where they are, shut, and say why on hover, as every disabled field does.
23
+
24
+ <Canvas of={LinkPartsStories.PickersDisabled} />
21
25
  <Canvas of={LinkPartsStories.Unassigned} />
22
26
  <Canvas of={LinkPartsStories.Conversation} />
23
27
  <Canvas of={LinkPartsStories.Marks} />
@@ -32,6 +32,16 @@ export const PickersReadOnly: Story = {
32
32
  args: { status: { value: 'doing', options: STATUS_OPTIONS }, owner: { value: 'b', options: PEOPLE } },
33
33
  }
34
34
 
35
+ /** Shut for now (an archived file): the pickers stay, and say why on hover. */
36
+ export const PickersDisabled: Story = {
37
+ name: 'Pickers, disabled',
38
+ args: {
39
+ status: { value: 'doing', options: STATUS_OPTIONS, onChange: () => {} },
40
+ owner: { value: 'b', options: PEOPLE, onChange: () => {} },
41
+ disabledReason: 'Archived: unarchive it to change it.',
42
+ },
43
+ }
44
+
35
45
  /** Nobody owns it yet, read only. */
36
46
  export const NoOwner: Story = {
37
47
  args: { status: { value: 'todo', options: STATUS_OPTIONS }, owner: { value: undefined, options: PEOPLE } },
package/src/LinkParts.tsx CHANGED
@@ -154,6 +154,8 @@ export interface LinkPickersProps {
154
154
  ownerLabel?: string
155
155
  /** Draws the values as words even where they could be changed: the hover preview. */
156
156
  readOnly?: boolean
157
+ /** Why they cannot be changed right now (an archived file): the pickers stay, shut, saying it on hover. */
158
+ disabledReason?: string
157
159
  }
158
160
 
159
161
  /** The face for an owner option: nobody (value `''`, "Unassigned") is the silhouette, never a letter (Katerina, 30 Oct). */
@@ -167,7 +169,7 @@ function OwnerFace({ option }: { option: { value: string; label: string; picture
167
169
  * picker whose app passed no `onChange` reads as words in the same place: the
168
170
  * reader may not change it. The hover preview is always words.
169
171
  */
170
- export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = false }: LinkPickersProps) {
172
+ export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = false, disabledReason }: LinkPickersProps) {
171
173
  const statusNow = chosenOf(status)
172
174
  const ownerNow = chosenOf(owner)
173
175
  const statusWords = status && (readOnly || !status.onChange)
@@ -190,6 +192,7 @@ export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = fa
190
192
  value={status.value ?? ''}
191
193
  onChange={(value) => status.onChange?.(value)}
192
194
  ariaLabel="Status"
195
+ disabledReason={disabledReason}
193
196
  options={status.options.map((option) => ({ value: option.value, label: option.label, leading: option.colour && <StatusIcon colour={option.colour} /> }))}
194
197
  />
195
198
  ))}
@@ -208,6 +211,7 @@ export function LinkPickers({ status, owner, ownerLabel = 'Owner', readOnly = fa
208
211
  placeholder="Unassigned"
209
212
  onChange={(value) => owner.onChange?.(value)}
210
213
  ariaLabel={ownerLabel}
214
+ disabledReason={disabledReason}
211
215
  options={owner.options.map((option) => ({ value: option.value, label: option.label, leading: <OwnerFace option={option} /> }))}
212
216
  />
213
217
  ))}
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react'
2
2
  import { cn } from './cn'
3
3
  import { ContainerHeader } from './ContainerHeader'
4
4
  import { ErrorBoundary } from './ErrorBoundary'
5
+ import { FOLDED_CLASSES, FOLD_MOTION_CLASSES, UNFOLDED_CLASSES } from './looks'
5
6
  import { ScrollArea } from './ScrollArea'
6
7
 
7
8
  /**
@@ -25,7 +26,9 @@ import { ScrollArea } from './ScrollArea'
25
26
  * in the middle of the room the list had, and the rest of the page keeps working.
26
27
  *
27
28
  * `collapsed` closes it with the rail, as Peek's did: it narrows to nothing
28
- * and fades, in 300ms. What opens and closes the rail stays the app's.
29
+ * and fades, in 300ms, as `AppShell`'s fold does, and nothing in it can be
30
+ * reached. The fold that closes it is the frame's; whether it is closed is
31
+ * the app's to hand on.
29
32
  */
30
33
  export interface ListColumnProps {
31
34
  /** The column's name, in its header. A node for a title that is more than words. */
@@ -51,11 +54,14 @@ function Column({ title, chevron = false, titleMenu, actions, above, collapsed =
51
54
  <div
52
55
  className={cn(
53
56
  // `shrink-0`: the column keeps its 290px beside a main area that grows.
54
- 'flex shrink-0 flex-col overflow-hidden border-r border-border-subtle transition-[width,opacity] duration-300 ease-in-out',
55
- collapsed ? 'w-0 border-r-0 opacity-0' : 'w-[290px] opacity-100',
57
+ 'flex shrink-0 flex-col overflow-hidden border-r border-border-subtle transition-[width,opacity,visibility]',
58
+ FOLD_MOTION_CLASSES,
59
+ collapsed ? cn('w-0 border-r-0', FOLDED_CLASSES) : cn('w-[290px]', UNFOLDED_CLASSES),
56
60
  className,
57
61
  )}
58
62
  data-collapsed={collapsed || undefined}
63
+ // Closed, nothing in it can be reached: inert at once, hidden once it has faded, as AppShell's folded navigation.
64
+ inert={collapsed}
59
65
  >
60
66
  <ContainerHeader title={title} chevron={chevron} titleMenu={titleMenu} actions={actions} />
61
67
  {above}