@estiva-app/ui 0.112.0 → 0.114.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.112.0",
3
+ "version": "0.114.0",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/registry.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "kind": "package",
5
5
  "repo": "estiva-ui",
6
6
  "package": "@estiva-app/ui",
7
- "packageVersion": "0.112.0",
7
+ "packageVersion": "0.114.0",
8
8
  "exports": 253,
9
9
  "typeExports": 263,
10
10
  "files": null
@@ -7660,6 +7660,12 @@
7660
7660
  "required": false,
7661
7661
  "note": "With `unread`: the warning badge in the dot's place."
7662
7662
  },
7663
+ {
7664
+ "name": "preview",
7665
+ "takes": "anything",
7666
+ "required": false,
7667
+ "note": "More about the row, in the package's `PreviewCard` while the row itself is pointed at — never the rows under it — such as a short list of what is new there."
7668
+ },
7663
7669
  {
7664
7670
  "name": "children",
7665
7671
  "takes": "anything",
@@ -8726,6 +8732,12 @@
8726
8732
  "takes": "text",
8727
8733
  "required": false,
8728
8734
  "note": "Extra classes on the trigger wrapper — e.g."
8735
+ },
8736
+ {
8737
+ "name": "openOnTap",
8738
+ "takes": "true/false",
8739
+ "required": false,
8740
+ "note": "A tap on the trigger opens the card, and a second tap closes it, for a touch screen, where nothing hovers (ACT-4: the dot beside a page's title)."
8729
8741
  }
8730
8742
  ],
8731
8743
  "variants": [
@@ -12355,6 +12367,12 @@
12355
12367
  "takes": "text",
12356
12368
  "required": false,
12357
12369
  "note": null
12370
+ },
12371
+ {
12372
+ "name": "quiet",
12373
+ "takes": "true/false",
12374
+ "required": false,
12375
+ "note": null
12358
12376
  }
12359
12377
  ],
12360
12378
  "variants": [],
package/src/NavItem.mdx CHANGED
@@ -59,6 +59,14 @@ count — a muted mono number whose tooltip says what it counts.
59
59
 
60
60
  <Canvas of={NavItemStories.LabelTooltip} />
61
61
 
62
+ - More about the row than a sentence (a short list of what is new there) is
63
+ `preview`: it opens the **PreviewCard** while the row itself is pointed at,
64
+ the ⋮ included, and never while a row under it is. Unlike `tooltip`, the
65
+ pointer can move into it. A screen with no hover never shows it either, so
66
+ the row must still make sense without it.
67
+
68
+ <Canvas of={NavItemStories.RowPreview} />
69
+
62
70
  - Something new on the row is `unread`: its words and icon brighten, the
63
71
  label is set in medium, and the **UnreadDot** sits at the right.
64
72
  `urgent` with it draws the warning badge in the dot's place. Say "unread"
@@ -128,6 +128,21 @@ export const LabelTooltip: Story = {
128
128
  args: { icon: placeholder, action: REMOVE, tooltip: 'One sentence saying what this item is about, shown while its label is pointed at.' },
129
129
  }
130
130
 
131
+ /** `preview`: rest the pointer on the row and a card opens beside it, holding content you can move into; the rows under it open nothing. */
132
+ export const RowPreview: Story = {
133
+ args: {
134
+ icon: placeholder,
135
+ unread: true,
136
+ preview: (
137
+ <div className="flex flex-col gap-1 p-2 text-caption text-text-secondary">
138
+ <span>Line one of what the card holds.</span>
139
+ <span>Line two of what the card holds.</span>
140
+ </div>
141
+ ),
142
+ children: <NavItem href="#two" label="Item two" icon={placeholder} />,
143
+ },
144
+ }
145
+
131
146
  /** A hint and a button: point at it and the chip shows, then the button — a row whose state is a word (here, archived) and which can be taken off the list. */
132
147
  export const WithActionAndHint: Story = {
133
148
  args: { label: 'An item whose label runs much longer than the column has room for', icon: placeholder, action: REMOVE, hint: <Chip type="neutral" label="Archived" /> },
@@ -15,6 +15,43 @@ afterEach(cleanup)
15
15
 
16
16
  const arrow = (name: RegExp) => screen.getByRole('button', { name })
17
17
 
18
+ /*
19
+ Real timers, as PreviewCard's own test: Base UI's hover card never opens under Vitest's fake timers in jsdom. The
20
+ waits are findBy/waitFor polling the screen, not sleeps.
21
+ */
22
+ describe('NavItem with a preview', () => {
23
+ it('opens the card while the row is pointed at, and closes it when the pointer moves to a row under it', async () => {
24
+ const user = userEvent.setup()
25
+ render(
26
+ <NavItem href="#one" label="Item one" unread preview={<span>What is new</span>} menu={<span />}>
27
+ <NavItem href="#two" label="Item two" />
28
+ </NavItem>,
29
+ )
30
+ await user.hover(screen.getByText('Item one'))
31
+ expect(await screen.findByText('What is new')).toBeTruthy()
32
+ await user.unhover(screen.getByText('Item one'))
33
+ await user.hover(screen.getByText('Item two'))
34
+ await waitFor(() => expect(screen.queryByText('What is new')).toBeNull())
35
+ })
36
+
37
+ it('a row with a preview opens the card alone: the label’s tooltip does not stand up beside it', async () => {
38
+ const user = userEvent.setup()
39
+ render(<NavItem href="#one" label="Item one" tooltip="About item one" preview={<span>What is new</span>} />)
40
+ await user.hover(screen.getByText('Item one'))
41
+ // The tooltip's 300ms is shorter than the card's 350ms: had it been drawn, it would be up by now.
42
+ expect(await screen.findByText('What is new')).toBeTruthy()
43
+ expect(screen.queryByText('About item one')).toBeNull()
44
+ })
45
+
46
+ it('a plain row with a preview opens it too', async () => {
47
+ const user = userEvent.setup()
48
+ render(<NavItem href="#one" label="Item one" preview={<span>What is new</span>} />)
49
+ expect(screen.queryByText('What is new')).toBeNull()
50
+ await user.hover(screen.getByText('Item one'))
51
+ expect(await screen.findByText('What is new')).toBeTruthy()
52
+ })
53
+ })
54
+
18
55
  describe('NavItem with rows under it', () => {
19
56
  const tree = (props: Partial<Parameters<typeof NavItem>[0]> = {}) => (
20
57
  <NavItem href="#one" label="Item one" {...props}>
package/src/NavItem.tsx CHANGED
@@ -8,6 +8,7 @@ import { useOpenFor } from './CollapsibleSection'
8
8
  import { COLLAPSIBLE_PANEL_CLASSES, COUNT_TEXT_CLASSES, SIDEBAR_ROW_CLASSES, SIDEBAR_ROW_TEXT_CLASSES } from './looks'
9
9
  import { IconButton } from './IconButton'
10
10
  import { Menu } from './Menu'
11
+ import { PreviewCard } from './PreviewCard'
11
12
  import type { SectionAction } from './SectionHeader'
12
13
  import { UnreadDot } from './UnreadDot'
13
14
  import { WithTooltip } from './Tooltip'
@@ -80,6 +81,13 @@ export interface NavItemProps extends Omit<ComponentPropsWithoutRef<'a'>, 'href'
80
81
  unread?: boolean
81
82
  /** With `unread`: the warning badge in the dot's place. */
82
83
  urgent?: boolean
84
+ /**
85
+ * More about the row, in the package's `PreviewCard` while the row itself is pointed at — never the rows under it —
86
+ * such as a short list of what is new there. Unlike `tooltip`, it holds content the pointer can move into. The card
87
+ * opens on the whole row, the ⋮ included, so a dot the ⋮ steps aside for is not lost as the pointer arrives. With a
88
+ * preview the label draws no `tooltip`: one surface per hover. Absent, no card.
89
+ */
90
+ preview?: ReactNode
83
91
  /** Rows under this one, folding under it: `NavItem`s. While the row is pointed at or focused, its icon becomes the arrow. */
84
92
  children?: ReactNode
85
93
  /** With `children`: open unless told otherwise. */
@@ -117,6 +125,7 @@ export function NavItem({
117
125
  tooltip,
118
126
  unread = false,
119
127
  urgent = false,
128
+ preview,
120
129
  children,
121
130
  defaultOpen = true,
122
131
  open: openProp,
@@ -184,9 +193,10 @@ export function NavItem({
184
193
  {icon}
185
194
  </span>
186
195
  )}
187
- {tooltip?.trim() ? (
196
+ {tooltip?.trim() && preview == null ? (
188
197
  // On the label alone, not the row: the ⋮ and the action keep their
189
- // own tooltips, and the two never stand up at once.
198
+ // own tooltips, and the two never stand up at once. A row with a
199
+ // preview card says more there, so the label has no tooltip beside it.
190
200
  <WithTooltip label={tooltip} inline wrapperClassName="flex min-w-0 flex-1">
191
201
  <span className={cn('flex-1 truncate', unread && 'font-medium')}>{label}</span>
192
202
  </WithTooltip>
@@ -236,7 +246,14 @@ export function NavItem({
236
246
  ) : null}
237
247
  </a>
238
248
  )
239
- if (!besides && hint == null) return row
249
+ // The card's lines are rows with their own padding, so the card keeps only a 4px edge (the content's rhythm is the caller's).
250
+ const card = (trigger: ReactNode) =>
251
+ preview == null ? trigger : (
252
+ <PreviewCard content={preview} contentClassName="gap-0.5 p-1" wrapperClassName="block w-full shrink-0">
253
+ {trigger}
254
+ </PreviewCard>
255
+ )
256
+ if (!besides && hint == null) return card(row)
240
257
  const name = menuLabel ?? `More options for ${label}`
241
258
  const line = (
242
259
  <div className="group/nav relative shrink-0">
@@ -287,10 +304,10 @@ export function NavItem({
287
304
  )}
288
305
  </div>
289
306
  )
290
- if (!hasRows) return line
307
+ if (!hasRows) return card(line)
291
308
  return (
292
309
  <Collapsible.Root open={open} onOpenChange={setOpen} className="flex shrink-0 flex-col">
293
- {line}
310
+ {card(line)}
294
311
  {/* CollapsibleSection's slide, the same way: Base UI measures the panel
295
312
  and the height transitions, none under prefers-reduced-motion. */}
296
313
  <Collapsible.Panel
@@ -107,6 +107,14 @@ There is no keyboard trigger, by design — see above.
107
107
  | pointer moves into the card | it stays up, and can be scrolled |
108
108
  | pointer leaves both | closes after 200ms |
109
109
  | Escape | closes |
110
+ | a tap on the trigger, with `openOnTap` | opens; a second tap closes it, and it stays closed |
111
+ | a screen reader's double-tap, with `openOnTap` | the same as a tap |
112
+
113
+ A touch screen has no hover, so without `openOnTap` a tap opens nothing: a row's card stays hover-only, because a
114
+ tap on a row opens the row. Pass `openOnTap` when the trigger opens nothing of its own, as a dot beside a page's
115
+ title does.
116
+
117
+ <Canvas of={PreviewCardStories.OnATap} />
110
118
 
111
119
  ## Props
112
120
 
@@ -1,5 +1,6 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite'
2
2
  import { IconSquareRounded } from '@tabler/icons-react'
3
+ import { IconButton } from './IconButton'
3
4
  import { MenuPanel } from './Menu'
4
5
  import { PreviewCard } from './PreviewCard'
5
6
  import { SkeletonBar } from './Skeleton'
@@ -118,6 +119,30 @@ export const OnARow: Story = {
118
119
  ),
119
120
  }
120
121
 
122
+ /**
123
+ * Live, with `openOnTap`: on a touch screen a tap on the trigger opens the
124
+ * card and a second tap closes it; a mouse still opens it by resting. For a
125
+ * trigger that answers a tap with nothing of its own.
126
+ */
127
+ export const OnATap: Story = {
128
+ parameters: { controls: { disable: true } },
129
+ render: () => (
130
+ <PreviewCard
131
+ openOnTap
132
+ content={
133
+ <span className="text-caption text-text-secondary">
134
+ This is the card. A tap on the button opened it, and another tap
135
+ closes it.
136
+ </span>
137
+ }
138
+ >
139
+ <IconButton aria-label="Item one">
140
+ <IconSquareRounded size={16} stroke={1.5} />
141
+ </IconButton>
142
+ </PreviewCard>
143
+ ),
144
+ }
145
+
121
146
  /**
122
147
  * A card taller than its cap scrolls, **and you can reach the scrollbar** —
123
148
  * which is the whole difference between this and a tooltip. Rest the pointer
@@ -7,12 +7,15 @@
7
7
  * tested beside itself. Placement is Floating UI's and is measured in a
8
8
  * browser — jsdom lays nothing out — so what is here is the behaviour.
9
9
  */
10
- import { afterEach, describe, expect, it } from 'vitest'
11
- import { cleanup, render, screen } from '@testing-library/react'
10
+ import { afterEach, describe, expect, it, vi } from 'vitest'
11
+ import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
12
12
  import userEvent from '@testing-library/user-event'
13
13
  import { PreviewCard } from './PreviewCard'
14
14
 
15
- afterEach(cleanup)
15
+ afterEach(() => {
16
+ cleanup()
17
+ vi.useRealTimers()
18
+ })
16
19
 
17
20
  describe('PreviewCard', () => {
18
21
  it('renders its trigger, and nothing of its content, until it opens', () => {
@@ -40,6 +43,72 @@ describe('PreviewCard', () => {
40
43
  expect(screen.queryByText('The rest of it')).toBeNull()
41
44
  })
42
45
 
46
+ it('with openOnTap, a tap on a touch screen opens the card and a second tap closes it', async () => {
47
+ const user = userEvent.setup()
48
+ render(
49
+ <PreviewCard content={<span>The rest of it</span>} openOnTap>
50
+ <span>A dot</span>
51
+ </PreviewCard>,
52
+ )
53
+ const dot = screen.getByText('A dot')
54
+ await user.pointer({ keys: '[TouchA]', target: dot })
55
+ expect(await screen.findByText('The rest of it')).toBeTruthy()
56
+ await user.pointer({ keys: '[TouchA]', target: dot })
57
+ expect(screen.queryByText('The rest of it')).toBeNull()
58
+ })
59
+
60
+ it('with openOnTap on a button, a tap that closes the card stays closed: focus from the tap does not reopen it a moment later', async () => {
61
+ vi.useFakeTimers()
62
+ render(
63
+ <PreviewCard content={<span>The rest of it</span>} openOnTap>
64
+ <button type="button">A dot</button>
65
+ </PreviewCard>,
66
+ )
67
+ const dot = screen.getByRole('button', { name: 'A dot' })
68
+ // A finger's tap on a button, in the order a phone sends it: the press and the lift, then the mouse events made
69
+ // from them, focus on the button and the click. Fired by hand, because user-event waits on a clock this test fakes.
70
+ const tap = () => {
71
+ fireEvent.pointerDown(dot, { pointerType: 'touch' })
72
+ fireEvent.pointerUp(dot, { pointerType: 'touch' })
73
+ fireEvent.mouseDown(dot)
74
+ act(() => dot.focus())
75
+ fireEvent.mouseUp(dot)
76
+ fireEvent.click(dot)
77
+ }
78
+ tap()
79
+ expect(screen.getByText('The rest of it')).toBeTruthy()
80
+ tap()
81
+ expect(screen.queryByText('The rest of it')).toBeNull()
82
+ act(() => {
83
+ vi.advanceTimersByTime(1000)
84
+ })
85
+ expect(screen.queryByText('The rest of it')).toBeNull()
86
+ })
87
+
88
+ it('with openOnTap, a click with no press before it (a screen reader double-tap) opens the card, and another closes it', async () => {
89
+ render(
90
+ <PreviewCard content={<span>The rest of it</span>} openOnTap>
91
+ <button type="button">A dot</button>
92
+ </PreviewCard>,
93
+ )
94
+ const dot = screen.getByRole('button', { name: 'A dot' })
95
+ fireEvent.click(dot)
96
+ expect(screen.queryByText('The rest of it')).not.toBeNull()
97
+ fireEvent.click(dot)
98
+ expect(screen.queryByText('The rest of it')).toBeNull()
99
+ })
100
+
101
+ it('without openOnTap, a tap on a touch screen opens nothing, so a row tapped opens the row', async () => {
102
+ const user = userEvent.setup()
103
+ render(
104
+ <PreviewCard content={<span>The rest of it</span>}>
105
+ <span>A row</span>
106
+ </PreviewCard>,
107
+ )
108
+ await user.pointer({ keys: '[TouchA]', target: screen.getByText('A row') })
109
+ expect(screen.queryByText('The rest of it')).toBeNull()
110
+ })
111
+
43
112
  /*
44
113
  * Not here: "the pointer can move into the card, and it scrolls" — the one
45
114
  * claim that separates this from a tooltip.
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from 'react'
1
+ import { useRef, useState, type PointerEvent, type ReactNode } from 'react'
2
2
  import { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card'
3
3
  import { cn } from './cn'
4
4
  import { ScrollArea } from './ScrollArea'
@@ -46,6 +46,13 @@ export interface PreviewCardProps {
46
46
  contentClassName?: string
47
47
  /** Extra classes on the trigger wrapper — e.g. `block w-full` for a row. */
48
48
  wrapperClassName?: string
49
+ /**
50
+ * A tap on the trigger opens the card, and a second tap closes it, for a
51
+ * touch screen, where nothing hovers (ACT-4: the dot beside a page's title).
52
+ * A mouse still opens it by resting. Off by default: a row's card stays
53
+ * hover-only, because a tap on a row opens the row.
54
+ */
55
+ openOnTap?: boolean
49
56
  }
50
57
 
51
58
  /** The card's own numbers: 12px from the trigger, 8px clear of every screen
@@ -65,9 +72,40 @@ const OPEN_DELAY = 350
65
72
  * here the card can be reached, so it can. */
66
73
  const CLOSE_DELAY = 200
67
74
 
68
- export function PreviewCard({ content, children, side = 'right', delay = OPEN_DELAY, closeDelay = CLOSE_DELAY, className, contentClassName, wrapperClassName }: PreviewCardProps) {
75
+ export function PreviewCard({ content, children, side = 'right', delay = OPEN_DELAY, closeDelay = CLOSE_DELAY, className, contentClassName, wrapperClassName, openOnTap = false }: PreviewCardProps) {
76
+ // Held here always, so turning `openOnTap` on or off never switches the card between controlled and not; without it
77
+ // every change is Base UI's own (hover, focus, Escape, a press outside), as before.
78
+ const [open, setOpen] = useState(false)
79
+ // The press the next click belongs to: its pointer type, and whether the card was open when it went down. A tap
80
+ // focuses a button inside, and focus may open the card before the click, so the click sets the opposite of what was
81
+ // there before the press, not of what focus just did. The click uses it up.
82
+ const press = useRef<{ pointerType: string; wasOpen: boolean } | undefined>(undefined)
83
+ // The last press's pointer type, which outlives the click: it says whether a focus that opens the card came from a tap.
84
+ const lastPointer = useRef<string | undefined>(undefined)
85
+ const onOpenChange = (next: boolean, details: BasePreviewCard.Root.ChangeEventDetails) => {
86
+ // Base UI opens on focus after its delay, on a timer a tap's close does not cancel: after a touch, a tapped-shut
87
+ // card would open again a moment later. On a touch screen only a tap opens it.
88
+ if (openOnTap && next && details.reason === 'trigger-focus' && lastPointer.current === 'touch') return
89
+ setOpen(next)
90
+ }
91
+ const tapHandlers = openOnTap
92
+ ? {
93
+ onPointerDown: (event: PointerEvent) => {
94
+ press.current = { pointerType: event.pointerType, wasOpen: open }
95
+ lastPointer.current = event.pointerType
96
+ },
97
+ onClick: () => {
98
+ const last = press.current
99
+ press.current = undefined
100
+ // A mouse or a pen opens it by resting, as Base UI treats both as able to hover. A touch, or a click with no
101
+ // press before it (a screen reader's double-tap sends only the click), sets the opposite.
102
+ if (last?.pointerType === 'mouse' || last?.pointerType === 'pen') return
103
+ setOpen(!(last ? last.wasOpen : open))
104
+ },
105
+ }
106
+ : {}
69
107
  return (
70
- <BasePreviewCard.Root>
108
+ <BasePreviewCard.Root open={open} onOpenChange={onOpenChange}>
71
109
  {/* The part renders an `<a>` by default, which a row is not; `render`
72
110
  makes it the wrapper this component has always been, and the trigger
73
111
  inside keeps whatever element it already is. */}
@@ -75,6 +113,7 @@ export function PreviewCard({ content, children, side = 'right', delay = OPEN_DE
75
113
  delay={delay}
76
114
  closeDelay={closeDelay}
77
115
  render={<span className={cn('inline-flex', wrapperClassName)} />}
116
+ {...tapHandlers}
78
117
  >
79
118
  {children}
80
119
  </BasePreviewCard.Trigger>
package/src/UnreadDot.mdx CHANGED
@@ -54,6 +54,7 @@ It does these by itself. Write none of them around it.
54
54
  | The 6px disc in a 24px slot | a sized box around a round div | |
55
55
  | `data-unread`, the attribute tests and photo runs select on | a marker of your own | |
56
56
  | Keeps its size in a tight row | `shrink-0` | |
57
+ | `quiet`: the same 6px as a ring, not marked `data-unread`, for a dot that is always there and has nothing new | a bordered div of your own | |
57
58
 
58
59
  ## Props
59
60
 
@@ -11,6 +11,9 @@ type Story = StoryObj<typeof meta>
11
11
 
12
12
  export const Default: Story = {}
13
13
 
14
+ /** Nothing new: the ring a dot that is always there draws, so the slot does not empty. */
15
+ export const Quiet: Story = { args: { quiet: true } }
16
+
14
17
  /** Beside a line of text, as a list row draws it: the slot keeps the row's height. */
15
18
  export const InARow: Story = {
16
19
  render: (args) => (
@@ -14,4 +14,9 @@ describe('UnreadDot', () => {
14
14
  expect(slot.className).toContain('w-6')
15
15
  expect((slot.firstElementChild as HTMLElement).className).toContain('w-1.5')
16
16
  })
17
+
18
+ it('a quiet dot, with nothing new, is not marked data-unread, so nothing reads it as unread', () => {
19
+ const { container } = render(<UnreadDot quiet />)
20
+ expect((container.firstElementChild as HTMLElement).hasAttribute('data-unread')).toBe(false)
21
+ })
17
22
  })
package/src/UnreadDot.tsx CHANGED
@@ -7,11 +7,16 @@ import { cn } from './cn'
7
7
  *
8
8
  * Purely visual: the row that draws it says "unread" in its own accessible
9
9
  * name, because a coloured disc reads as nothing to a screen reader.
10
+ *
11
+ * `quiet` draws the same 6px as a ring with nothing new: the dot beside a
12
+ * page's title, which is always there because it opens the page's list
13
+ * (ACT-4; the activity indicator prototype Miky approved, 10 November). A
14
+ * quiet dot is not marked `data-unread`.
10
15
  */
11
- export function UnreadDot({ className }: { className?: string }) {
16
+ export function UnreadDot({ className, quiet = false }: { className?: string; quiet?: boolean }) {
12
17
  return (
13
- <div className={cn('flex h-6 w-6 shrink-0 items-center justify-center', className)} data-unread>
14
- <div className="h-1.5 w-1.5 rounded-full bg-accent-primary" />
18
+ <div className={cn('flex h-6 w-6 shrink-0 items-center justify-center', className)} {...(quiet ? {} : { 'data-unread': '' })}>
19
+ <div className={cn('h-1.5 w-1.5 rounded-full', quiet ? 'border border-border-strong' : 'bg-accent-primary')} />
15
20
  </div>
16
21
  )
17
22
  }
@@ -66,7 +66,7 @@ fork freely, owe nothing back, mention it on the package's ticket.
66
66
  |---|---|
67
67
  | A list of verbs from a trigger | **Menu** — Escape, outside-click and the arrow keys come with it |
68
68
  | A panel of *content* from a trigger — a field, a toolbar, a small form | **Popover** — the menu's surface without a menu's keyboard |
69
- | More of a thing on hover | **PreviewCard** — unlike a tooltip, you can point at it |
69
+ | More of a thing on hover | **PreviewCard** — unlike a tooltip, you can point at it; on a sidebar row, **NavItem** `preview` opens it; `openOnTap` when nothing else on the trigger answers a tap |
70
70
  | A hint on hover or on keyboard focus | **Tooltip** / **WithTooltip** — one `TooltipProvider` at the app root shares the delay |
71
71
  | A strip of controls that act on one thing | **Toolbar** — one Tab stop for the row, arrow keys along it |
72
72
  | Reactions to choose from | **ReactionPicker** — the row; **Reaction** is the pill it produces |
@@ -120,7 +120,7 @@ The same conversation in every app; only its colours are each app's.
120
120
  | A box that can hold more than fits — a list that grows with its data counts, even when today's data fits | **ScrollArea** — its bar is drawn over the content and takes no width |
121
121
  | Text that can run long above things the reader needs, cut behind a fade | **ShowMore** — measures; what fits has no button |
122
122
  | A status, a count or a category, in a small pill | **Chip** — six colour types; the colour is the message, the label makes it legible |
123
- | Something new on a row or a card, no count | **UnreadDot** — the 6px dot in a 24px slot; in a sidebar row, **NavItem** `unread` draws it |
123
+ | Something new on a row or a card, no count | **UnreadDot** — the 6px dot in a 24px slot; in a sidebar row, **NavItem** `unread` draws it; `quiet` for a dot that is always there with nothing new |
124
124
  | One thing — a conversation, a project, an object — as a box you can pick | **Card** — the fill by what it sits on; `href` for a link, `hover="fill"` in a feed, `onPress` when a press opens it |
125
125
  | A section heading, chevron, hover actions, a count beside the title | **SectionHeader** |
126
126
  | A group of rows that opens and closes, and stays how you left it | **CollapsibleSection** — `storageKey` remembers |