@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,86 @@
1
+ import { IconChevronRight, IconMessage2 } from '@tabler/icons-react'
2
+ import { AvatarGroup } from './AvatarGroup'
3
+ import { Chip } from './Chip'
4
+ import { cn } from './cn'
5
+ import { TIME_CLASSES } from './looks'
6
+
7
+ export interface RepliesRowProps {
8
+ /** How many replies. */
9
+ count: number
10
+ /** Who replied: their faces. */
11
+ faces?: readonly { name: string; picture?: string }[]
12
+ /** The last reply's time, in the app's words. */
13
+ last?: string
14
+ /** "1 new": a reply you have not read. */
15
+ isNew?: boolean
16
+ /** The "1 new" chip in the warning colour, for an urgent thread. */
17
+ urgent?: boolean
18
+ /** Opens the thread. Absent, the row only says how many (the card around it opens the thread). */
19
+ onOpen?: () => void
20
+ /** Its thread is open under it, in one column: the chevron turns down and the row stays marked; a press closes it (Katerina, 31 October). */
21
+ open?: boolean
22
+ }
23
+
24
+ const ROW_CLASSES = 'flex w-full items-center gap-2 pb-1.5 pl-8 pr-2'
25
+ /** Open: the row keeps the look a pointer gives it, so it reads as the thread's open way in. */
26
+ const OPEN_CLASSES = 'border-accent-outline bg-accent-wash'
27
+ const BOX_CLASSES =
28
+ 'group/replies flex shrink-0 items-center gap-2 rounded-lg border border-transparent px-2 py-1.5 transition-colors hover:border-accent-outline hover:bg-accent-wash'
29
+
30
+ /**
31
+ * The way into a thread, under its comment: who replied, "2 replies", the last reply's time, and "1 new" until it is
32
+ * read. Peek's, moved with the conversation; in every app the row a thread opens from, the same in every theme
33
+ * (Katerina, 31 October), each in its own colours.
34
+ */
35
+ export function RepliesRow({ count, faces, last, isNew = false, urgent = false, onOpen, open = false }: RepliesRowProps) {
36
+ const withFaces = !!faces && faces.length > 0
37
+ const label = `${count} ${count === 1 ? 'reply' : 'replies'}`
38
+ const inner = (
39
+ <>
40
+ {withFaces && (
41
+ <span className="flex shrink-0 items-center">
42
+ <AvatarGroup size={18} members={faces.map((f) => ({ name: f.name, picture: f.picture }))} />
43
+ </span>
44
+ )}
45
+ <IconMessage2
46
+ size={16}
47
+ stroke={1.5}
48
+ className={cn(
49
+ 'shrink-0 text-text-interactive transition-colors group-hover/replies:text-text-primary',
50
+ withFaces && 'hidden',
51
+ )}
52
+ />
53
+ <span className="text-chip font-medium text-text-interactive transition-colors group-hover/replies:text-text-primary">
54
+ {label}
55
+ </span>
56
+ {last && <span className={cn('mt-px text-small leading-3 text-text-muted', TIME_CLASSES)}>{last}</span>}
57
+ {/* Turned down while its thread is open, as a tree row's chevron is. */}
58
+ <IconChevronRight
59
+ size={12}
60
+ stroke={2}
61
+ className={cn('transition-all group-hover/replies:text-text-primary', open ? 'rotate-90 text-text-primary' : 'text-text-muted group-hover/replies:translate-x-0.5')}
62
+ />
63
+ </>
64
+ )
65
+ const chip = isNew && (
66
+ <>
67
+ <span className="h-0.5 w-0.5 shrink-0 rounded-full bg-text-muted" />
68
+ <Chip type={urgent ? 'warning' : 'brand'} label="1 new" />
69
+ </>
70
+ )
71
+ if (!onOpen) {
72
+ return (
73
+ <div className={ROW_CLASSES}>
74
+ <div className={BOX_CLASSES}>{inner}</div>
75
+ {chip}
76
+ </div>
77
+ )
78
+ }
79
+ return (
80
+ // @estiva-escape(no-raw-element): the row is the thread's way in, Peek's replies row; no kit button takes a face stack, a count, a time and the new chip in one press
81
+ <button type="button" className={cn(ROW_CLASSES, 'cursor-pointer text-left')} onClick={onOpen} aria-expanded={open} aria-label={`${label}, ${open ? 'close' : 'open'} the thread`} data-interactive>
82
+ <span className={cn(BOX_CLASSES, open && OPEN_CLASSES)}>{inner}</span>
83
+ {chip}
84
+ </button>
85
+ )
86
+ }
@@ -0,0 +1,50 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
2
+ import * as Stories from './ReplyCard.stories'
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ReplyCard
7
+
8
+ One reply in a thread: the same pieces as a comment, without replies of its own or Resolve.
9
+
10
+ <Canvas of={Stories.Reply} />
11
+
12
+ ## When
13
+
14
+ - **A reply**, inside a **Thread**, in time order.
15
+ - `timeHref`: its time is a link to it, "Link to this".
16
+ - `own` on yours: Edit and Delete in its menu.
17
+
18
+ <Canvas of={Stories.Yours} />
19
+
20
+ <Canvas of={Stories.Linked} />
21
+
22
+ ## When not
23
+
24
+ - A comment, with its replies and Resolve → **ConversationCard**.
25
+ - Who resolved the thread, and the note → the comment says it (**ConversationCard** `resolved`), not a line among the replies.
26
+
27
+ ## How
28
+
29
+ ```tsx
30
+ import { ReplyCard, Thread } from '@estiva-app/ui'
31
+
32
+ <Thread start={start} box={box} onClose={close}>
33
+ <ReplyCard author={author} time={time} timeHref={linkToReply} own={isMine} onDelete={() => remove(reply)}>
34
+ {wordsOf(reply)}
35
+ </ReplyCard>
36
+ </Thread>
37
+ ```
38
+
39
+ - Everything a comment takes about its words, its files, its reactions and its editing, a reply takes the same way.
40
+
41
+ ## What it owns
42
+
43
+ | It does | So you never write | Refused when written by hand |
44
+ |---|---|---|
45
+ | Shows its actions while pointed at, and holds them while a menu is open | hover state and an outside-click check | |
46
+ | Asks before it deletes | a confirm dialog | |
47
+
48
+ ## Props
49
+
50
+ <Controls />
@@ -0,0 +1,68 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import { useState } from 'react'
3
+ import { userEvent, within } from 'storybook/test'
4
+ import { ReplyCard, type ReplyCardProps } from './ConversationCard'
5
+ import { Column, EditBox, Files, ONE, SHORT, SOME, WithCard, YOU, useReactions } from './conversation.examples'
6
+ import type { ReactionCount } from './ReactionRow'
7
+
8
+ /** One reply, live: point at it to react, and on your own edit or delete it. */
9
+ const meta = {
10
+ title: 'Conversation/ReplyCard',
11
+ component: ReplyCard,
12
+ parameters: { layout: 'padded' },
13
+ args: { author: ONE, time: '11:40 AM', children: SHORT },
14
+ decorators: [(Story) => <Column>{Story()}</Column>],
15
+ } satisfies Meta<typeof ReplyCard>
16
+
17
+ export default meta
18
+ type Story = StoryObj<typeof meta>
19
+
20
+ function Live({ start, ...props }: ReplyCardProps & { start?: readonly ReactionCount[] }) {
21
+ const reacting = useReactions(start)
22
+ const [gone, setGone] = useState(false)
23
+ if (gone) return null
24
+ return (
25
+ <ReplyCard
26
+ {...props}
27
+ reactions={props.readOnly ? { ...reacting, onToggle: undefined } : reacting}
28
+ onDelete={() => setGone(true)}
29
+ editor={props.own ? (done) => <EditBox text={SHORT} done={done} /> : undefined}
30
+ />
31
+ )
32
+ }
33
+
34
+ /** Someone's reply. */
35
+ export const Reply: Story = { render: (args) => <Live {...args} /> }
36
+
37
+ /** Yours: Edit and Delete in its ⋯ menu. */
38
+ export const Yours: Story = { render: (args) => <Live {...args} author={YOU} own /> }
39
+
40
+ /** Edited since it was sent. */
41
+ export const Edited: Story = { render: (args) => <Live {...args} edited="Edited 11:52 AM" /> }
42
+
43
+ /** Not read yet. */
44
+ export const New: Story = { render: (args) => <Live {...args} isNew /> }
45
+
46
+ /** Urgent and not read yet. */
47
+ export const Urgent: Story = { render: (args) => <Live {...args} isNew urgent /> }
48
+
49
+ /** With reactions. */
50
+ export const Reactions: Story = { render: (args) => <Live {...args} start={SOME} /> }
51
+
52
+ /** Pictures and files under the words. */
53
+ export const WithFiles: Story = { name: 'Files', render: (args) => <Live {...args} files={<Files />} /> }
54
+
55
+ /** A card its author attached. */
56
+ export const Card: Story = { render: (args) => <Live {...args}><WithCard /></Live> }
57
+
58
+ /** Its time is a link to it, "Link to this" on hover: the story points at it. */
59
+ export const Linked: Story = {
60
+ name: 'Time is a link',
61
+ render: (args) => <Live {...args} timeHref="#reply" />,
62
+ play: async ({ canvasElement }) => {
63
+ await userEvent.hover(within(canvasElement).getByRole('link', { name: '11:40 AM' }))
64
+ },
65
+ }
66
+
67
+ /** Nothing can be changed: no strip, reactions only shown. */
68
+ export const ReadOnly: Story = { name: 'Read-only', render: (args) => <Live {...args} readOnly start={SOME} /> }
@@ -0,0 +1,44 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
2
+ import * as Stories from './ResolveDialog.stories'
3
+
4
+ <Meta of={Stories} />
5
+
6
+ # ResolveDialog
7
+
8
+ Resolve, with an optional note: the same dialog in every app.
9
+
10
+ <Canvas of={Stories.Resolve} />
11
+
12
+ ## When
13
+
14
+ - When someone resolves a thread: **ConversationCard** opens it for you from Resolve.
15
+
16
+ <Canvas of={Stories.Refused} />
17
+
18
+ ## When not
19
+
20
+ - A question before something is deleted → **ConfirmDialog**.
21
+ - Any other dialog → **DialogShell**.
22
+
23
+ ## How
24
+
25
+ ```tsx
26
+ import { ResolveDialog } from '@estiva-app/ui'
27
+
28
+ <ResolveDialog onResolve={(note) => resolve(thread, note)} onCancel={close} refused={why} />
29
+ ```
30
+
31
+ - Ctrl+Enter resolves from the note; Enter there is a new line.
32
+ - Answer `false` from `onResolve` when it was refused, and pass why in `refused`.
33
+
34
+ ## What it owns
35
+
36
+ | It does | So you never write | Refused when written by hand |
37
+ |---|---|---|
38
+ | Resolves on Ctrl+Enter from the note | a key handler | |
39
+ | Switches everything off while it waits for the answer | a busy state | |
40
+ | Says why a resolve was refused, under the note | an error line | |
41
+
42
+ ## Props
43
+
44
+ <Controls />
@@ -0,0 +1,23 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+ import { ResolveDialog } from './ResolveDialog'
3
+
4
+ /** Resolve, with an optional note. Ctrl+Enter resolves from the note. */
5
+ const meta = {
6
+ title: 'Conversation/ResolveDialog',
7
+ component: ResolveDialog,
8
+ parameters: { layout: 'fullscreen' },
9
+ args: { onResolve: () => {}, onCancel: () => {} },
10
+ decorators: [(Story) => <div className="h-screen">{Story()}</div>],
11
+ } satisfies Meta<typeof ResolveDialog>
12
+
13
+ export default meta
14
+ type Story = StoryObj<typeof meta>
15
+
16
+ /** Nothing written yet: the note is optional. */
17
+ export const Resolve: Story = {}
18
+
19
+ /** Waiting for the answer: everything inside is switched off. */
20
+ export const Sending: Story = { args: { onResolve: () => new Promise(() => {}) } }
21
+
22
+ /** The last resolve was refused: said under the note. */
23
+ export const Refused: Story = { args: { refused: 'Not resolved: try again in a moment.' } }
@@ -0,0 +1,53 @@
1
+ // @vitest-environment jsdom
2
+ import { afterEach, describe, expect, it, vi } from 'vitest'
3
+ import { cleanup, render, screen, within } from '@testing-library/react'
4
+ import userEvent from '@testing-library/user-event'
5
+ import { ResolveDialog } from './ResolveDialog'
6
+
7
+ afterEach(cleanup)
8
+
9
+ describe('ResolveDialog', () => {
10
+ it('resolves with the note written', async () => {
11
+ const user = userEvent.setup()
12
+ const onResolve = vi.fn()
13
+ render(<ResolveDialog onResolve={onResolve} onCancel={() => {}} />)
14
+ const dialog = screen.getByRole('dialog')
15
+ await user.type(within(dialog).getByRole('textbox'), 'Going with the first one')
16
+ await user.click(within(dialog).getByRole('button', { name: 'Resolve' }))
17
+ expect(onResolve).toHaveBeenCalledWith('Going with the first one')
18
+ })
19
+
20
+ it('resolves with no note: the note is optional', async () => {
21
+ const user = userEvent.setup()
22
+ const onResolve = vi.fn()
23
+ render(<ResolveDialog onResolve={onResolve} onCancel={() => {}} />)
24
+ await user.click(screen.getByRole('button', { name: 'Resolve' }))
25
+ expect(onResolve).toHaveBeenCalledWith('')
26
+ })
27
+
28
+ it('resolves with Ctrl+Enter from the note, where Enter is a new line', async () => {
29
+ const user = userEvent.setup()
30
+ const onResolve = vi.fn()
31
+ render(<ResolveDialog onResolve={onResolve} onCancel={() => {}} />)
32
+ const note = screen.getByRole('textbox')
33
+ await user.type(note, 'First line{Enter}second')
34
+ expect(onResolve).not.toHaveBeenCalled()
35
+ await user.keyboard('{Control>}{Enter}{/Control}')
36
+ expect(onResolve).toHaveBeenCalledWith('First line\nsecond')
37
+ })
38
+
39
+ it('Cancel resolves nothing', async () => {
40
+ const user = userEvent.setup()
41
+ const onResolve = vi.fn()
42
+ const onCancel = vi.fn()
43
+ render(<ResolveDialog onResolve={onResolve} onCancel={onCancel} />)
44
+ await user.click(screen.getByRole('button', { name: 'Cancel' }))
45
+ expect(onCancel).toHaveBeenCalledOnce()
46
+ expect(onResolve).not.toHaveBeenCalled()
47
+ })
48
+
49
+ it('says why the last resolve was refused, under the note', () => {
50
+ render(<ResolveDialog onResolve={() => false} onCancel={() => {}} refused="The file is archived" />)
51
+ expect(screen.getByText(/The file is archived/)).toBeTruthy()
52
+ })
53
+ })
@@ -0,0 +1,58 @@
1
+ import { useId, useState } from 'react'
2
+ import { Button } from './Button'
3
+ import { DialogShell } from './DialogShell'
4
+ import { Field } from './Field'
5
+ import { Form } from './Form'
6
+ import { Textarea } from './Textarea'
7
+
8
+ export interface ResolveDialogProps {
9
+ /** Resolve, with what was written (an empty string for none). Answer `false` when it was refused: the dialog stays, with `refused` under the field. */
10
+ onResolve: (note: string) => Promise<boolean | void> | boolean | void
11
+ onCancel: () => void
12
+ /** Why the last resolve was refused, in plain words. */
13
+ refused?: string
14
+ }
15
+
16
+ /**
17
+ * Resolve, with an optional note: the same dialog in every app (Katerina, 31 October). Ctrl+Enter resolves from the
18
+ * note; Enter there is a new line. Peek's, moved with the conversation.
19
+ */
20
+ export function ResolveDialog({ onResolve, onCancel, refused }: ResolveDialogProps) {
21
+ const [note, setNote] = useState('')
22
+ const [busy, setBusy] = useState(false)
23
+ const formId = useId()
24
+ return (
25
+ <DialogShell
26
+ title="Resolve"
27
+ onClose={onCancel}
28
+ footer={
29
+ <>
30
+ <Button variant="muted" onClick={onCancel}>
31
+ Cancel
32
+ </Button>
33
+ {/* Outlined at rest and green on hover in Signal, the kit's `resolve` look. */}
34
+ <Button variant="resolve" type="submit" form={formId} disabled={busy}>
35
+ Resolve
36
+ </Button>
37
+ </>
38
+ }
39
+ >
40
+ <Form
41
+ id={formId}
42
+ busy={busy}
43
+ onSubmit={async () => {
44
+ setBusy(true)
45
+ try {
46
+ await onResolve(note)
47
+ } finally {
48
+ setBusy(false)
49
+ }
50
+ }}
51
+ >
52
+ <Field label="Resolution message (optional)" error={refused}>
53
+ <Textarea autoFocus value={note} onChange={(e) => setNote(e.target.value)} placeholder="Summarize the outcome or decision..." className="h-[109px]" />
54
+ </Field>
55
+ </Form>
56
+ </DialogShell>
57
+ )
58
+ }
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 />