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