@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/CommentBox.tsx
CHANGED
|
@@ -2,11 +2,11 @@ import { Fragment, useCallback, useEffect, useLayoutEffect, useRef, useState, ty
|
|
|
2
2
|
import { Extension, type AnyExtension, type EditorOptions } from '@tiptap/core'
|
|
3
3
|
import { Editor, type JSONContent } from '@tiptap/react'
|
|
4
4
|
import { IconLock, IconPaperclip, IconSquareRounded } from '@tabler/icons-react'
|
|
5
|
+
import { AttachedCard } from './AttachedCard'
|
|
5
6
|
import { AttachmentCard } from './AttachmentCard'
|
|
6
7
|
import { ReferenceNode, type ReferenceViewProps } from './BlockNodes'
|
|
7
8
|
import { Button } from './Button'
|
|
8
9
|
import { Card } from './Card'
|
|
9
|
-
import { CardUnder } from './CardUnder'
|
|
10
10
|
import { cn } from './cn'
|
|
11
11
|
import { BoxFrame, ComposeKeys, COMPOSE_EDITOR_CLASSES, isEmptyDoc as isEmpty, SendBox } from './commentBoxFrame'
|
|
12
12
|
import {
|
|
@@ -26,7 +26,8 @@ import {
|
|
|
26
26
|
import { FieldLine } from './Field'
|
|
27
27
|
import { FilePicker } from './FilePicker'
|
|
28
28
|
import { Kbd } from './Kbd'
|
|
29
|
-
import {
|
|
29
|
+
import { inTheBox } from './linked'
|
|
30
|
+
import { BoxKit, LINK_MARK_ATTRIBUTES, PasteOverWords } from './links'
|
|
30
31
|
import { PastedImages } from './PastedImages'
|
|
31
32
|
import { KeptSelection } from './SelectionToolbar'
|
|
32
33
|
import { isSuggestionOpen } from './suggestionPopup'
|
|
@@ -138,7 +139,7 @@ export interface CommentBoxProps {
|
|
|
138
139
|
code?: CodeFormat
|
|
139
140
|
/** Send what is written, with the files that are ready and the card still shown; resolves with the relay's answer. */
|
|
140
141
|
send: (body: JSONContent, files: BoxFile[], under: BoxSentUnder) => Promise<SendAnswer>
|
|
141
|
-
/** The card and parts
|
|
142
|
+
/** The card and parts in the box while something is written, with the files, ✕ on the card. Absent, there are none. */
|
|
142
143
|
under?: BoxUnder
|
|
143
144
|
/**
|
|
144
145
|
* The app shows a send before the relay answers: the box empties at once,
|
|
@@ -245,7 +246,8 @@ const sameApp = (a: BoxApp, b: BoxApp) =>
|
|
|
245
246
|
function boxExtensions(hold: BoxHold, app: BoxApp): AnyExtension[] {
|
|
246
247
|
const iconFor = (uri: string | null) => hold.current.referenceIcon?.(uri)
|
|
247
248
|
return [
|
|
248
|
-
|
|
249
|
+
// A link drawn as one, as in a document: it read as plain words in the box before (Katerina, 29 Oct).
|
|
250
|
+
BoxKit.configure({ link: { openOnClick: false, HTMLAttributes: LINK_MARK_ATTRIBUTES } }),
|
|
249
251
|
PasteOverWords,
|
|
250
252
|
KeptSelection,
|
|
251
253
|
ComposeKeys,
|
|
@@ -651,18 +653,28 @@ export function CommentBox({
|
|
|
651
653
|
</>
|
|
652
654
|
) : undefined
|
|
653
655
|
|
|
654
|
-
//
|
|
656
|
+
// In the box, under the text with the files (Katerina, 29 Oct: "the file's ✕ and inside the box"): the files, then
|
|
657
|
+
// the card with its ✕ and the live parts on a line of their own (none in an edit, which carries none). On the files'
|
|
658
|
+
// fill, the card's values as words until it is sent (`inTheBox`).
|
|
655
659
|
const card = reading?.card && !removed.has(reading.card.value) ? reading.card : undefined
|
|
656
660
|
const parts = edit ? [] : (reading?.parts ?? [])
|
|
657
|
-
const
|
|
661
|
+
const attached =
|
|
658
662
|
card || parts.length > 0 ? (
|
|
659
|
-
|
|
660
|
-
{
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
<>
|
|
664
|
+
{fileCards}
|
|
665
|
+
<inTheBox.Provider value>
|
|
666
|
+
{/* min-w-0: a card with a long title would otherwise be as wide as its title, past the box's edge (29 Oct). */}
|
|
667
|
+
<div data-box-under className="flex min-w-0 basis-full flex-col gap-2">
|
|
668
|
+
{card && <AttachedCard onRemove={() => setRemoved((was) => new Set([...was, card.value]))}>{card.view}</AttachedCard>}
|
|
669
|
+
{parts.map((part) => (
|
|
670
|
+
<Fragment key={part.key}>{part.view}</Fragment>
|
|
671
|
+
))}
|
|
672
|
+
</div>
|
|
673
|
+
</inTheBox.Provider>
|
|
674
|
+
</>
|
|
675
|
+
) : (
|
|
676
|
+
fileCards
|
|
677
|
+
)
|
|
666
678
|
|
|
667
679
|
const refusedLine = refused && (
|
|
668
680
|
<FieldLine tone="error">
|
|
@@ -697,7 +709,7 @@ export function CommentBox({
|
|
|
697
709
|
marked={marking}
|
|
698
710
|
// The same strip as the send box: writing and editing work the same way (Katerina, 21 Oct).
|
|
699
711
|
selection={{ link: true }}
|
|
700
|
-
attachments={
|
|
712
|
+
attachments={attached}
|
|
701
713
|
className={cn(sending && '[&_.ProseMirror]:text-text-muted')}
|
|
702
714
|
footer={
|
|
703
715
|
<div className="flex items-center justify-between gap-2">
|
|
@@ -715,7 +727,6 @@ export function CommentBox({
|
|
|
715
727
|
</div>
|
|
716
728
|
}
|
|
717
729
|
/>
|
|
718
|
-
{underBox}
|
|
719
730
|
{takesFiles && <FilePicker ref={picker} multiple accept={accept} onPick={attachFiles} />}
|
|
720
731
|
{sending && <FieldLine>Saving…</FieldLine>}
|
|
721
732
|
{fileLines}
|
|
@@ -737,14 +748,13 @@ export function CommentBox({
|
|
|
737
748
|
</ToolbarButton>
|
|
738
749
|
) : undefined
|
|
739
750
|
}
|
|
740
|
-
attachments={
|
|
751
|
+
attachments={attached}
|
|
741
752
|
ready={ready}
|
|
742
753
|
marked={marking}
|
|
743
754
|
holding={uploading || failed > 0 || sending}
|
|
744
755
|
selection={{ link: true }}
|
|
745
756
|
className={cn(sending && '[&_[data-composer-editor]]:text-text-muted')}
|
|
746
757
|
/>
|
|
747
|
-
{underBox}
|
|
748
758
|
{upload && <FilePicker ref={picker} multiple accept={accept} onPick={attachFiles} />}
|
|
749
759
|
{sending && <FieldLine>Sending…</FieldLine>}
|
|
750
760
|
{fileLines}
|
|
@@ -9,7 +9,7 @@ import { Card } from './Card'
|
|
|
9
9
|
const inColumn: Decorator = (Story) => <Card clip className="w-96">{Story()}</Card>
|
|
10
10
|
|
|
11
11
|
const meta = {
|
|
12
|
-
title: '
|
|
12
|
+
title: 'Page structure/ContainerHeader',
|
|
13
13
|
component: ContainerHeader,
|
|
14
14
|
args: { title: 'Items' },
|
|
15
15
|
argTypes: { actions: { control: false } },
|
package/src/Divider.stories.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { Card } from './Card'
|
|
|
5
5
|
|
|
6
6
|
/** A hairline in `border-subtle`, inset 12px each side — or standing up between two columns. */
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Page structure/Divider',
|
|
9
9
|
component: Divider,
|
|
10
10
|
} satisfies Meta<typeof Divider>
|
|
11
11
|
|
|
@@ -28,7 +28,7 @@ import { MenuItem } from './Menu'
|
|
|
28
28
|
* ending. Pick the theme in the toolbar.
|
|
29
29
|
*/
|
|
30
30
|
const meta = {
|
|
31
|
-
title: '
|
|
31
|
+
title: 'Writing/DocumentEditor',
|
|
32
32
|
component: DocumentEditor,
|
|
33
33
|
parameters: { layout: 'padded' },
|
|
34
34
|
} satisfies Meta<typeof DocumentEditor>
|
|
@@ -13,7 +13,7 @@ import { richTextClassName } from './RichText'
|
|
|
13
13
|
* Turn into, Duplicate, Delete, then the app's rows.
|
|
14
14
|
*/
|
|
15
15
|
const meta = {
|
|
16
|
-
title: '
|
|
16
|
+
title: 'Writing/EditorBlockHandle',
|
|
17
17
|
// The handle sits 28px left of the content, in the page's margin.
|
|
18
18
|
parameters: { layout: 'padded' },
|
|
19
19
|
} satisfies Meta
|
|
@@ -13,7 +13,7 @@ import { richTextClassName } from './RichText'
|
|
|
13
13
|
* it.
|
|
14
14
|
*/
|
|
15
15
|
const meta = {
|
|
16
|
-
title: '
|
|
16
|
+
title: 'Writing/EditorTableControls',
|
|
17
17
|
// The block handle sits 28px left of the content, and the column ➕ 16px right of the table.
|
|
18
18
|
parameters: { layout: 'padded' },
|
|
19
19
|
} satisfies Meta
|
|
@@ -6,7 +6,7 @@ import { EmptyState } from './EmptyState'
|
|
|
6
6
|
const inBox: Decorator = (Story) => <div className="flex h-[280px] w-[480px] flex-col rounded-lg border border-border-default p-4">{Story()}</div>
|
|
7
7
|
|
|
8
8
|
const meta = {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Status & feedback/EmptyState',
|
|
10
10
|
component: EmptyState,
|
|
11
11
|
args: { message: 'Nothing here yet.' },
|
|
12
12
|
argTypes: { icon: { control: false } },
|
package/src/EntryShell.mdx
CHANGED
|
@@ -32,7 +32,7 @@ why, and at most one button.
|
|
|
32
32
|
|
|
33
33
|
- Inside the app's frame. It stands in *for* the whole app while entry is
|
|
34
34
|
decided; a page or a section with nothing to show inside the frame is an
|
|
35
|
-
[**EmptyState**](?path=/docs/feedback-emptystate--docs).
|
|
35
|
+
[**EmptyState**](?path=/docs/status-feedback-emptystate--docs).
|
|
36
36
|
|
|
37
37
|
## How
|
|
38
38
|
|
|
@@ -8,7 +8,7 @@ import { ErrorBoundary } from './ErrorBoundary'
|
|
|
8
8
|
* page keeps working. Try again draws the part again.
|
|
9
9
|
*/
|
|
10
10
|
const meta = {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Status & feedback/ErrorBoundary',
|
|
12
12
|
component: ErrorBoundary,
|
|
13
13
|
parameters: { layout: 'fullscreen' },
|
|
14
14
|
args: { label: 'panel', children: null },
|
package/src/Field.stories.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { TextInput } from './TextInput'
|
|
|
7
7
|
|
|
8
8
|
/** The small line a Field draws under a control, on its own — for a group of controls. */
|
|
9
9
|
const meta = {
|
|
10
|
-
title: '
|
|
10
|
+
title: 'Forms & fields/Field line',
|
|
11
11
|
component: FieldLine,
|
|
12
12
|
parameters: { layout: 'padded' },
|
|
13
13
|
args: { tone: 'helper', children: 'Leave this empty and one is made for you.' },
|
|
@@ -7,7 +7,7 @@ import { IconButton } from './IconButton'
|
|
|
7
7
|
import { EmptyState } from './EmptyState'
|
|
8
8
|
|
|
9
9
|
const meta = {
|
|
10
|
-
title: '
|
|
10
|
+
title: 'Forms & fields/FilePicker',
|
|
11
11
|
component: FilePicker,
|
|
12
12
|
// The code tab shows each story's own code: building it from the rendered
|
|
13
13
|
// element reads `element.ref`, which React 19 warns about.
|
package/src/Form.stories.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { TextInput } from './TextInput'
|
|
|
8
8
|
import { Textarea } from './Textarea'
|
|
9
9
|
|
|
10
10
|
const meta = {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Forms & fields/Form',
|
|
12
12
|
component: Form,
|
|
13
13
|
parameters: { layout: 'padded' },
|
|
14
14
|
args: { onSubmit: fn(), busy: false, 'aria-label': 'Example', children: null },
|
|
@@ -3,7 +3,7 @@ import { IconSettings } from '@tabler/icons-react'
|
|
|
3
3
|
import { IconButton } from './IconButton'
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Buttons & links/IconButton',
|
|
7
7
|
component: IconButton,
|
|
8
8
|
// An icon-only button owes its name; axe's button-name rule fails without it.
|
|
9
9
|
args: { variant: 'muted', disabled: false, 'aria-label': 'Settings', children: <IconSettings className="size-4" stroke={1.5} /> },
|
|
@@ -3,7 +3,7 @@ import { IconSquareRounded } from '@tabler/icons-react'
|
|
|
3
3
|
import { InlineChip } from './InlineChip'
|
|
4
4
|
|
|
5
5
|
const meta = {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Links & references/InlineChip',
|
|
7
7
|
component: InlineChip,
|
|
8
8
|
args: { tone: 'neutral', children: 'Label' },
|
|
9
9
|
argTypes: {
|
package/src/InlineText.mdx
CHANGED
|
@@ -12,6 +12,7 @@ A page's title, or the line under it, edited where it stands, as in a document:
|
|
|
12
12
|
## When
|
|
13
13
|
|
|
14
14
|
- **`variant="title"`**: a page's heading. Left empty, the saved one comes back.
|
|
15
|
+
- **`variant="heading"`**: a document's title, at the largest heading size, as Leaf's file page has it. As a title, left empty, the saved one comes back.
|
|
15
16
|
- **`variant="summary"`** with **`clearable`**: the quieter line under it. Left empty, it is saved as nothing.
|
|
16
17
|
- `readOnly` for someone who cannot change it, or until the app can save: the same text in the same place.
|
|
17
18
|
|
|
@@ -9,7 +9,7 @@ import { InlineText, type InlineTextHandle } from './InlineText'
|
|
|
9
9
|
* page; Escape or clicking away saves too.
|
|
10
10
|
*/
|
|
11
11
|
const meta = {
|
|
12
|
-
title: '
|
|
12
|
+
title: 'Writing/InlineText',
|
|
13
13
|
component: InlineText,
|
|
14
14
|
parameters: { layout: 'padded' },
|
|
15
15
|
decorators: [
|
|
@@ -28,7 +28,7 @@ const LINE = 'A line of plain text under the title, saying in a sentence what th
|
|
|
28
28
|
const LONG = 'A line of plain text under the title that goes on for longer than a line should, so it wraps the way the text around it does and the reader sees all of it, without anything cut off at the edge or hidden behind a control.'
|
|
29
29
|
|
|
30
30
|
/** A title, the line under it, and the text below: Enter in the title goes to the line, Enter in the line goes to the text. */
|
|
31
|
-
function Page({ title = 'Item one', line = LINE, refuse = false, readOnly = false }: { title?: string; line?: string; refuse?: boolean; readOnly?: boolean }) {
|
|
31
|
+
function Page({ title = 'Item one', line = LINE, refuse = false, readOnly = false, heading = false }: { title?: string; line?: string; refuse?: boolean; readOnly?: boolean; heading?: boolean }) {
|
|
32
32
|
const lineRef = useRef<InlineTextHandle>(null)
|
|
33
33
|
const textRef = useRef<HTMLParagraphElement>(null)
|
|
34
34
|
const [saved, setSaved] = useState({ title, line })
|
|
@@ -36,7 +36,7 @@ function Page({ title = 'Item one', line = LINE, refuse = false, readOnly = fals
|
|
|
36
36
|
return (
|
|
37
37
|
<div className="flex flex-col">
|
|
38
38
|
<InlineText
|
|
39
|
-
variant=
|
|
39
|
+
variant={heading ? 'heading' : 'title'}
|
|
40
40
|
label="Title"
|
|
41
41
|
placeholder="Untitled"
|
|
42
42
|
value={saved.title}
|
|
@@ -73,6 +73,9 @@ function Page({ title = 'Item one', line = LINE, refuse = false, readOnly = fals
|
|
|
73
73
|
|
|
74
74
|
export const Default: Story = { render: () => <Page /> }
|
|
75
75
|
|
|
76
|
+
/** A document's title, at the largest heading size: `variant="heading"`, as Leaf's file page draws it. */
|
|
77
|
+
export const DocumentHeading: Story = { render: () => <Page title="Document one" heading /> }
|
|
78
|
+
|
|
76
79
|
/** Nothing written yet: what each is for, muted, in its place. */
|
|
77
80
|
export const Empty: Story = { render: () => <Page title="" line="" /> }
|
|
78
81
|
|
package/src/InlineText.tsx
CHANGED
|
@@ -41,8 +41,11 @@ export interface InlineTextProps {
|
|
|
41
41
|
onText?: (text: string | null) => void
|
|
42
42
|
/** Enter, after the save has started: where the caret goes next. */
|
|
43
43
|
onEnter?: () => void
|
|
44
|
-
/**
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* `title`: the page's heading. `heading`: a document's title, at the largest heading size (Leaf's file page).
|
|
46
|
+
* `summary`: the line under either, quieter.
|
|
47
|
+
*/
|
|
48
|
+
variant?: 'title' | 'heading' | 'summary'
|
|
46
49
|
/** Empty is a value (a summary). Otherwise leaving it empty brings the saved one back (a title). */
|
|
47
50
|
clearable?: boolean
|
|
48
51
|
/** Text only, the same size and place: nobody can change it, or the editor is not ready. */
|
|
@@ -62,6 +65,8 @@ export interface InlineTextHandle {
|
|
|
62
65
|
/** Size and tone, per variant: the same for the text at rest and while it is written. */
|
|
63
66
|
const VARIANT = {
|
|
64
67
|
title: 'text-h2 text-text-primary',
|
|
68
|
+
// A document's title: Leaf set text-h1 on InlineText from outside, which the gate refuses (Katerina, 29 Oct: "I choose A").
|
|
69
|
+
heading: 'text-h1 text-text-primary',
|
|
65
70
|
summary: 'text-body-1 text-text-secondary',
|
|
66
71
|
} as const
|
|
67
72
|
|
package/src/Kbd.stories.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { MenuItem, MenuPanel, MenuSection } from './Menu'
|
|
|
4
4
|
import { Tooltip } from './Tooltip'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Buttons & links/Kbd',
|
|
8
8
|
component: Kbd,
|
|
9
9
|
args: { children: 'Cmd+K' },
|
|
10
10
|
argTypes: { children: { control: 'text' } },
|
package/src/KindIcon.stories.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { KindIcon, type ThingKind } from './KindIcon'
|
|
|
4
4
|
import { MenuItem, MenuPanel, MenuSection } from './Menu'
|
|
5
5
|
|
|
6
6
|
const meta = {
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Links & references/KindIcon',
|
|
8
8
|
component: KindIcon,
|
|
9
9
|
args: { kind: 'topic' },
|
|
10
10
|
argTypes: { kind: { control: 'select', options: ['topic', 'project', 'issue', 'file', 'message'] } },
|
package/src/Lightbox.stories.tsx
CHANGED
package/src/Link.mdx
CHANGED
|
@@ -14,8 +14,9 @@ the app decides how it navigates.
|
|
|
14
14
|
|
|
15
15
|
- **It takes the size and colour of the text around it**: put it inside that
|
|
16
16
|
text.
|
|
17
|
-
- **`text`** — a link written inside text: the theme's link colour,
|
|
18
|
-
|
|
17
|
+
- **`text`** — a link written inside text: the theme's link colour, the link
|
|
18
|
+
icon before its words and one underline under both, dimming on hover. A chip
|
|
19
|
+
of an Estiva thing is **LinkChip**, which starts with its kind's icon instead.
|
|
19
20
|
- **`quiet`** — a title or a time that is also a link. It takes the colour and
|
|
20
21
|
size of the text it sits in, and underlines on hover.
|
|
21
22
|
- **`underlined`** — a short "open it there" beside a note. It takes the
|
package/src/Link.stories.tsx
CHANGED
package/src/Link.test.tsx
CHANGED
|
@@ -53,12 +53,14 @@ describe('Link', () => {
|
|
|
53
53
|
expect(screen.getByRole('link', { name: 'Documents' }).getAttribute('href')).toBe('/documents')
|
|
54
54
|
})
|
|
55
55
|
|
|
56
|
-
it('text is the link colour,
|
|
56
|
+
it('text is the link colour, the link icon before its words with one underline under both, and is the default', () => {
|
|
57
57
|
render(<Link href="#">Label</Link>)
|
|
58
58
|
const classes = classesOf(screen.getByRole('link'))
|
|
59
59
|
expect(classes).toContain('text-text-interactive')
|
|
60
|
-
|
|
61
|
-
expect(classes).toContain('underline
|
|
60
|
+
// One line under the icon and the words: the link's own background, not text-decoration, which skips the icon.
|
|
61
|
+
expect(classes).toContain('no-underline')
|
|
62
|
+
expect(classes).toContain('bg-[length:100%_1px]')
|
|
63
|
+
expect(classes).toContain("before:content-['']")
|
|
62
64
|
})
|
|
63
65
|
|
|
64
66
|
it('quiet sets no colour and no size of its own, and underlines on hover', () => {
|
package/src/Link.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react'
|
|
2
2
|
import { useInAppClick } from './AppProvider'
|
|
3
3
|
import { cn } from './cn'
|
|
4
|
+
import { WEB_LINK_CLASSES } from './looks'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* A link: an anchor with one of four looks, and nothing else of its own.
|
|
@@ -9,8 +10,9 @@ import { cn } from './cn'
|
|
|
9
10
|
* on 13 September 2026, in three jobs (UIG-27). The looks are the ones those
|
|
10
11
|
* links already had, reduced by Katerina's ruling:
|
|
11
12
|
*
|
|
12
|
-
* - `text` — a link inside written text: the theme's link colour,
|
|
13
|
-
*
|
|
13
|
+
* - `text` — a link inside written text: the theme's link colour, the link icon
|
|
14
|
+
* before its words and one underline under both, dimming on hover (Katerina,
|
|
15
|
+
* 29 Oct, after Slack). `WEB_LINK_CLASSES`, which the editors' links wear too.
|
|
14
16
|
* - `quiet` — a title or a timestamp that is also a link. It takes the colour
|
|
15
17
|
* and size of the text it sits in and underlines on hover. Two looks that
|
|
16
18
|
* differed only in their text became this one (her ruling, 13 September).
|
|
@@ -43,7 +45,7 @@ export type LinkVariant = 'text' | 'quiet' | 'underlined' | 'plain'
|
|
|
43
45
|
const COVER_CLASSES = 'after:absolute after:inset-0 after:rounded-md focus-visible:outline-none focus-visible:after:[outline-style:auto]'
|
|
44
46
|
|
|
45
47
|
const VARIANT_CLASSES: Record<LinkVariant, string> = {
|
|
46
|
-
text:
|
|
48
|
+
text: `text-text-interactive hover:opacity-80 ${WEB_LINK_CLASSES}`,
|
|
47
49
|
quiet: 'hover:underline',
|
|
48
50
|
underlined: 'underline underline-offset-2 hover:text-text-primary',
|
|
49
51
|
plain: '',
|
package/src/LinkCard.mdx
CHANGED
|
@@ -11,11 +11,12 @@ A link's card: what a row cannot hold, and the changes the reader may make from
|
|
|
11
11
|
|
|
12
12
|
## When
|
|
13
13
|
|
|
14
|
-
- **ready** — the title as the link
|
|
14
|
+
- **ready** — it starts as its row does: its kind in a file's 36px tile, the title as the link on one line, cut short when long, and under it the key and what it is ("ABC-2 · Issue"); a ring or faces on the title's line. Then its summary, the items inside it in a box of their own, its newest conversation as a quote, and a footer: the pickers and the conversation count, or who wrote it and when. No summary, the title alone.
|
|
15
|
+
- **width** — at most 480px in a message or a document; in a box being written in it fills the box, on the files' fill, its values as words until it is sent.
|
|
15
16
|
- **read only** — a picker the app passed no `onChange` for reads as words in the same place: the reader may not change it. `readOnly` makes every value words, as the hover preview does.
|
|
16
|
-
- **words a person wrote** — their face, their name, the time as the link, and the words.
|
|
17
|
+
- **words a person wrote** — their 24px face, their name, the time beside it as the link, and the words.
|
|
17
18
|
- **loading** — the card it will become in bars, at its own height: `shape` from `loadingShapeOf(linked)` the last time it drew, or the kind's usual card. **LinkCardLoading**, from this file.
|
|
18
|
-
- **unavailable** — one
|
|
19
|
+
- **unavailable** — one row, as **LinkRow** draws it.
|
|
19
20
|
|
|
20
21
|
<Canvas of={LinkCardStories.ReadOnly} />
|
|
21
22
|
<Canvas of={LinkCardStories.Loading} />
|
|
@@ -23,7 +24,7 @@ A link's card: what a row cannot hold, and the changes the reader may make from
|
|
|
23
24
|
## When not
|
|
24
25
|
|
|
25
26
|
- A link alone on its line, where the card was not chosen → **LinkRow**.
|
|
26
|
-
- The one card
|
|
27
|
+
- The one card attached to a piece of text, with its ✕ → **AttachedCard**, which draws this.
|
|
27
28
|
- A part of something longer → **PartCard**.
|
|
28
29
|
|
|
29
30
|
## How
|
package/src/LinkCard.stories.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import { loadingShapeOf, type Linked } from './linked'
|
|
|
5
5
|
import { GROUP, ITEM, ITEM_NO_SUMMARY, ITEM_READ_ONLY, ITEM_UNREAD, PAGE, PLACE, ready, SAID, UNAVAILABLE } from './linked.examples'
|
|
6
6
|
|
|
7
7
|
const meta = {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Links & references/LinkCard',
|
|
9
9
|
component: LinkCard,
|
|
10
10
|
parameters: { layout: 'padded' },
|
|
11
11
|
args: { link: ready(ITEM) },
|
package/src/LinkCard.test.tsx
CHANGED
|
@@ -97,7 +97,7 @@ describe('LinkCard', () => {
|
|
|
97
97
|
|
|
98
98
|
it('says it is not available, and where it may still open', () => {
|
|
99
99
|
render(<LinkCard link={UNAVAILABLE} />)
|
|
100
|
-
expect(screen.getByText('
|
|
100
|
+
expect(screen.getByText('Issue — not available.')).toBeTruthy()
|
|
101
101
|
expect(screen.getByRole('link', { name: /Open in App one/ }).getAttribute('href')).toBe('#elsewhere')
|
|
102
102
|
})
|
|
103
103
|
})
|