@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/gates/gate-config.ts
CHANGED
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
* Where: every `.ts` and `.tsx` under `src`, stories included (a story is what
|
|
11
11
|
* people read and copy), tests not (a test mounts markup to test it) —
|
|
12
12
|
* Katerina's rulings of 13 September; `.ts` since UIG-8. This package's own
|
|
13
|
-
* inward set reads `.tsx` only, as it always has
|
|
13
|
+
* inward set reads `.tsx` only, as it always has, and its root `stories/` as
|
|
14
|
+
* well as `src/` (28 October): a prototype built there is what a build is
|
|
15
|
+
* checked against, and the One conversation prototype passed unread with five
|
|
16
|
+
* refusals in it.
|
|
14
17
|
*
|
|
15
18
|
* A place that keeps something says why, on the line above:
|
|
16
19
|
* `// @estiva-escape: <reason>`, or `{/* @estiva-escape: <reason> *\/}` as a
|
|
@@ -48,7 +51,7 @@ export function gateLint({ audience = 'app' }: Pick<GateConfigOptions, 'audience
|
|
|
48
51
|
...(audience === 'package' ? estiva.configs.package : estiva.configs.recommended),
|
|
49
52
|
// An app's every script type: a raw <button> in a .jsx, or a key listener in a .mts,
|
|
50
53
|
// passed while only .ts and .tsx were read (the re-review after the audit before UIG-26).
|
|
51
|
-
files: audience === 'package' ? ['src/**/*.tsx'] : ['src/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'],
|
|
54
|
+
files: audience === 'package' ? ['src/**/*.tsx', 'stories/**/*.tsx'] : ['src/**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}'],
|
|
52
55
|
ignores: ['**/*.test.*'],
|
|
53
56
|
languageOptions: {
|
|
54
57
|
parser: typescriptParser,
|
package/src/gates/gates.test.ts
CHANGED
|
@@ -132,10 +132,16 @@ describe('gateConfig', () => {
|
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
|
|
135
|
-
it('reads .ts for an app (UIG-8), and .tsx only for the package', async () => {
|
|
135
|
+
it('reads .ts for an app (UIG-8), and .tsx only for the package, in src/ and its root stories/', async () => {
|
|
136
136
|
const listener = "export function listen() {\n window.addEventListener('keydown', () => {})\n}\n"
|
|
137
137
|
expect(await lintWith(gateConfig(), listener, 'src/lib/probe.ts')).toEqual([expect.objectContaining({ ruleId: 'estiva/no-rebuilt-behaviour' })])
|
|
138
|
-
expect(gateLint({ audience: 'package' }).files).toEqual(['src/**/*.tsx'])
|
|
138
|
+
expect(gateLint({ audience: 'package' }).files).toEqual(['src/**/*.tsx', 'stories/**/*.tsx'])
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
// 28 October: the One conversation prototype, built in the package's root stories/, passed unread.
|
|
142
|
+
it("refuses a buried raw element in the package's root stories/, and asks no page or story of a helper there", async () => {
|
|
143
|
+
const messages = await lintWith(gateConfig({ audience: 'package' }), component('<div><button type="button">x</button></div>'), 'stories/one-conversation/Probe.tsx')
|
|
144
|
+
expect(messages.map((m) => m.ruleId)).toEqual(['estiva/raw-element-outside-a-wrapper'])
|
|
139
145
|
})
|
|
140
146
|
|
|
141
147
|
it('leaves tests alone', async () => {
|
|
@@ -293,6 +299,18 @@ describe('runHook', () => {
|
|
|
293
299
|
expect((await runHook({ root: dir, input: write('src/Probe.test.jsx', component('<button type="button">x</button>')) })).code).toBe(0)
|
|
294
300
|
})
|
|
295
301
|
|
|
302
|
+
// 28 October: the One conversation prototype was written in the package's root stories/, which the hook let through unread.
|
|
303
|
+
it("in the package, judges a write to the root stories/ as well as src/", async () => {
|
|
304
|
+
const pkg = app('hook-package', {})
|
|
305
|
+
writeFileSync(join(pkg, 'package.json'), JSON.stringify({ name: '@estiva-app/ui', private: true, type: 'module' }))
|
|
306
|
+
writeFileSync(join(pkg, 'eslint.gates.config.js'), `import { gateConfig } from '${built}'\nexport default gateConfig({ audience: 'package' })\n`)
|
|
307
|
+
const buried = component('<div><button type="button">x</button></div>')
|
|
308
|
+
const result = await runHook({ root: pkg, audience: 'package', input: write('stories/one-conversation/Probe.tsx', buried) })
|
|
309
|
+
expect(result.code).toBe(2)
|
|
310
|
+
expect(result.message).toContain('estiva/raw-element-outside-a-wrapper')
|
|
311
|
+
expect((await runHook({ root: pkg, audience: 'package', input: write('scripts/probe.tsx', buried) })).code).toBe(0)
|
|
312
|
+
})
|
|
313
|
+
|
|
296
314
|
it('lets through a test, a declaration file, and anything outside src', async () => {
|
|
297
315
|
for (const path of ['src/Probe.test.tsx', 'src/types.d.ts', 'scripts/probe.tsx']) {
|
|
298
316
|
expect((await runHook({ root: dir, input: write(path, component('<button type="button">x</button>')) })).code).toBe(0)
|
package/src/gates/hook.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* token contract too, keeping only that contract's errors (B4), and a copied
|
|
18
18
|
* look, which only warns, reaches Claude as a note on a write let through (R10). Tests are not checked
|
|
19
19
|
* (Katerina, 13 September); stories are. This package's inward gate reads `.tsx`
|
|
20
|
-
* only, as its lint does.
|
|
20
|
+
* only, as its lint does, under `src/` and the root `stories/` (28 October).
|
|
21
21
|
*
|
|
22
22
|
* Input, from Claude Code on stdin: `tool_name` and `tool_input` — `file_path`
|
|
23
23
|
* and `content` for Write; `file_path`, `old_string`, `new_string` and
|
|
@@ -111,8 +111,9 @@ export async function runHook({ root, app = '.', audience = 'app', input, seen }
|
|
|
111
111
|
const file = isAbsolute(args.file_path) ? args.file_path : resolve(call.cwd ?? top, args.file_path)
|
|
112
112
|
const rel = relative(appDir, file).split(sep).join('/')
|
|
113
113
|
// Every script under an app's src/, as the gate reads it (a raw <button> in a .jsx passed
|
|
114
|
-
// before, the re-review after the audit before UIG-26); the package's own gate is .tsx only
|
|
115
|
-
|
|
114
|
+
// before, the re-review after the audit before UIG-26); the package's own gate is .tsx only,
|
|
115
|
+
// in src/ and in the root stories/, where a prototype is built.
|
|
116
|
+
const source = audience === 'package' ? /^(?:src|stories)\/.+\.tsx$/ : APP_SOURCE
|
|
116
117
|
if (rel.startsWith('../') || isAbsolute(rel) || !source.test(rel) || /\.test\.[cm]?[jt]sx?$/.test(rel) || /\.d\.[cm]?ts$/.test(rel)) return PASS
|
|
117
118
|
|
|
118
119
|
const text = proposed(call.tool_name, args, file)
|
package/src/index.ts
CHANGED
|
@@ -88,6 +88,7 @@ export { PreviewCard, type PreviewCardProps } from './PreviewCard'
|
|
|
88
88
|
// How a link draws, wherever it sits: one kit for every app (Widgets 2).
|
|
89
89
|
export {
|
|
90
90
|
chosenOf,
|
|
91
|
+
inTheBox,
|
|
91
92
|
loadingShapeOf,
|
|
92
93
|
unavailableMemory,
|
|
93
94
|
type Linked,
|
|
@@ -118,7 +119,7 @@ export { LinkChip, type LinkChipProps } from './LinkChip'
|
|
|
118
119
|
export { LinkRow, LinkUnavailable, type LinkRowProps, type LinkUnavailableProps } from './LinkRow'
|
|
119
120
|
export { LinkCard, LinkCardLoading, type LinkCardProps, type LinkCardLoadingProps } from './LinkCard'
|
|
120
121
|
export { LinkPreview, LinkPreviewOpen, useCanHover, type LinkPreviewProps } from './LinkPreview'
|
|
121
|
-
export {
|
|
122
|
+
export { AttachedCard, type AttachedCardProps } from './AttachedCard'
|
|
122
123
|
export { PartCard, type PartCardProps } from './PartCard'
|
|
123
124
|
export { Person, type PersonProps } from './Person'
|
|
124
125
|
export { Rail, type RailProps } from './Rail'
|
package/src/linked.examples.ts
CHANGED
|
@@ -24,13 +24,13 @@ const picker = (value: string | undefined, options: PickerOption[], mayChange =
|
|
|
24
24
|
const SUMMARY = 'A one-sentence summary of what this is for.'
|
|
25
25
|
|
|
26
26
|
/** A tracked item: a key, a status and an owner the reader may change, and a conversation. */
|
|
27
|
+
// No subtitle: no app sends one (linkedFrom never fills it), and the examples hold only what an app can (Katerina, 29 Oct).
|
|
27
28
|
export const ITEM: Linked = {
|
|
28
29
|
id: 'example:item',
|
|
29
30
|
kind: 'issue',
|
|
30
31
|
title: 'Item one, with a title long enough to be cut short',
|
|
31
32
|
href: '#item',
|
|
32
33
|
key: 'ABC-2',
|
|
33
|
-
subtitle: 'Group one',
|
|
34
34
|
summary: SUMMARY,
|
|
35
35
|
status: picker('doing', STATUS_OPTIONS),
|
|
36
36
|
owner: picker('a', PEOPLE),
|
|
@@ -86,7 +86,6 @@ export const PAGE: Linked = {
|
|
|
86
86
|
kind: 'page',
|
|
87
87
|
title: 'Page one',
|
|
88
88
|
href: '#page',
|
|
89
|
-
subtitle: 'Shelf one',
|
|
90
89
|
summary: SUMMARY,
|
|
91
90
|
authors: [{ name: 'Person one' }, { name: 'Person three' }],
|
|
92
91
|
updated: 'Yesterday',
|
|
@@ -105,4 +104,4 @@ export const SAID: Linked = {
|
|
|
105
104
|
|
|
106
105
|
export const ready = (linked: Linked): LinkState => ({ state: 'ready', linked })
|
|
107
106
|
export const LOADING: LinkState = { state: 'loading', kind: 'issue' }
|
|
108
|
-
export const UNAVAILABLE: LinkState = { state: 'unavailable', kind: 'issue', noun: '
|
|
107
|
+
export const UNAVAILABLE: LinkState = { state: 'unavailable', kind: 'issue', noun: 'Issue', openIn: { app: 'App one', href: '#elsewhere' } }
|
package/src/linked.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a link stands for, as the link widgets draw it (LinkChip, LinkRow,
|
|
3
|
-
* LinkCard, LinkPreview,
|
|
3
|
+
* LinkCard, LinkPreview, AttachedCard). The app builds it from its own lookup —
|
|
4
4
|
* every Estiva app from `@estiva-app/interop`'s projection — and hands it in
|
|
5
5
|
* whole: the words, the addresses, and the changes the reader may make. The
|
|
6
6
|
* widgets look nothing up, and keep nothing but what a reader does to them.
|
|
@@ -8,8 +8,16 @@
|
|
|
8
8
|
* The shape follows the prototype Miky approved (Widgets 2, 15 Oct; why:
|
|
9
9
|
* https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-link-on-words-counts-toward-the-card.md).
|
|
10
10
|
*/
|
|
11
|
+
import { createContext } from 'react'
|
|
11
12
|
import type { ThingKind } from './KindIcon'
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Inside a box being written in (CommentBox): a card or a part there sits on a
|
|
16
|
+
* file's fill, `elevated`, as the files beside it do, and a card's values read
|
|
17
|
+
* as words, not pickers, until it is sent (Katerina, 29 Oct). False anywhere else.
|
|
18
|
+
*/
|
|
19
|
+
export const inTheBox = createContext(false)
|
|
20
|
+
|
|
13
21
|
/** What a link stands for, by its icon. `page` draws a page of text. */
|
|
14
22
|
export type LinkedKind = ThingKind | 'page'
|
|
15
23
|
|
|
@@ -83,6 +91,8 @@ export interface Linked {
|
|
|
83
91
|
href: string
|
|
84
92
|
/** What the reader calls it, quietly before the title: "ABC-2". */
|
|
85
93
|
key?: string
|
|
94
|
+
/** What the app calls it, from its description of its files: "Issue", "Project", "Topic", "Document". Absent, the kind's own word. */
|
|
95
|
+
noun?: string
|
|
86
96
|
/** The line under a card's title: what it is in. Drawn after the key. */
|
|
87
97
|
subtitle?: string
|
|
88
98
|
/** Its short summary, a sentence or two. Without one a card shows the title alone. */
|
package/src/linkedFrom.ts
CHANGED
|
@@ -250,6 +250,7 @@ export function linkedFrom<T extends LinkedSource>(object: T, options: LinkedFro
|
|
|
250
250
|
title: titleOf(object),
|
|
251
251
|
href,
|
|
252
252
|
...(key ? { key } : {}),
|
|
253
|
+
...(object.noun ? { noun: object.noun.charAt(0).toUpperCase() + object.noun.slice(1) } : {}),
|
|
253
254
|
// Interop reads every file kind's summary into its subtitle (SPEC §6.12).
|
|
254
255
|
...(slots.subtitle?.value ? { summary: slots.subtitle.value } : {}),
|
|
255
256
|
...(status ? { status } : {}),
|
package/src/links.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Extension, type Mark } from '@tiptap/core'
|
|
|
2
2
|
import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state'
|
|
3
3
|
import { Decoration, DecorationSet } from '@tiptap/pm/view'
|
|
4
4
|
import StarterKit from '@tiptap/starter-kit'
|
|
5
|
+
import { WEB_LINK_CLASSES } from './looks'
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Links in the kit's editors: a URL pasted over words, the link mark that holds
|
|
@@ -101,8 +102,8 @@ export const DocumentKit = StarterKit.extend({
|
|
|
101
102
|
const LINK_SPLIT = /\[[^[\]\n]+\]\((?:https?:\/\/|mailto:)[^\s)]+\)|https?:\/\/[^\s]+/g
|
|
102
103
|
/** Punctuation after a bare address ends the sentence, not the address. */
|
|
103
104
|
const TRAILING = /[.,;:!?)\]]+$/
|
|
104
|
-
/** A link's look in an editor: the package `Link variant="text"`, spelled out for a mark's element and a decoration's range
|
|
105
|
-
export const LINK_CLASS =
|
|
105
|
+
/** A link's look in an editor: the package `Link variant="text"`, spelled out for a mark's element and a decoration's range, with the link icon and its underline as in `RichText`. */
|
|
106
|
+
export const LINK_CLASS = `text-info-default cursor-pointer ${WEB_LINK_CLASSES}`
|
|
106
107
|
|
|
107
108
|
/** What a click may open: an address a reader may follow (SPEC §13.1), never `javascript:` and the like. */
|
|
108
109
|
const OPENABLE = /^(https?:\/\/|mailto:)/i
|
package/src/looks.ts
CHANGED
|
@@ -43,6 +43,13 @@ export const COUNT_TEXT_CLASSES = 'font-mono text-caption tabular-nums text-text
|
|
|
43
43
|
/** A chip's words: Chip's label and Reaction's count. */
|
|
44
44
|
export const CHIP_TEXT_CLASSES = 'text-chip signal:font-mono signal:text-small signal:font-semibold signal:tabular-nums'
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The time of something a person said: one line, and in Signal the mono micro-type with even digits, as Peek's
|
|
48
|
+
* conversation draws a message's time (its MetaText). Only there: words a person wrote, and the latest conversation
|
|
49
|
+
* (Katerina, 29 Oct); "Updated" and other times keep the text's own type.
|
|
50
|
+
*/
|
|
51
|
+
export const TIME_CLASSES = 'whitespace-nowrap signal:font-mono signal:text-small signal:tracking-wide signal:tabular-nums'
|
|
52
|
+
|
|
46
53
|
/** Small secondary words that turn mono under signal: Kbd's key, CommandPalette's footer and MembersPill's count. */
|
|
47
54
|
export const MONO_CAPTION_CLASSES = 'text-caption text-text-secondary signal:font-mono signal:text-small'
|
|
48
55
|
|
|
@@ -75,3 +82,25 @@ export const COLLAPSIBLE_PANEL_CLASSES = 'h-[var(--collapsible-panel-height)] ov
|
|
|
75
82
|
*/
|
|
76
83
|
export const WRITING_BOX_CLASSES =
|
|
77
84
|
'relative bg-bg-inset border border-border-default rounded-lg p-3 flex flex-col gap-4 signal:transition-shadow signal:focus-within:border-border-focus signal:focus-within:shadow-focus-ring'
|
|
85
|
+
|
|
86
|
+
/** The 36px tile a file's type sits in: AttachmentCard's, and a link's kind in LinkRow, LinkCard and PartCard (Katerina, 29 Oct). */
|
|
87
|
+
export const TYPE_TILE_CLASSES = 'size-9 rounded-md bg-bg-active flex items-center justify-center shrink-0 text-text-secondary'
|
|
88
|
+
|
|
89
|
+
/** The bar down a quoted part's left edge: PartCard's blocks, and (proposal) a card's latest conversation. */
|
|
90
|
+
export const QUOTE_BAR_CLASSES = 'border-l-2 border-border-default pl-3'
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A link in text: the link icon before its words, in the link's colour and at the text's size, and one underline
|
|
94
|
+
* under the icon and the words together, as Slack draws one, so it never reads as a chip (Katerina, 29 Oct: "icon
|
|
95
|
+
* before but also underlined", "I want the icon to be underlined as well like Slack does"). A chip of an Estiva thing
|
|
96
|
+
* starts with its kind's icon instead and wears none of this.
|
|
97
|
+
*
|
|
98
|
+
* The browser's underline (`text-decoration`) skips an icon, so the line is the link's own background instead: 1px of
|
|
99
|
+
* its colour along the bottom of each line it runs over. Tabler's `link` is drawn as a mask on `::before`, so it takes
|
|
100
|
+
* the link's colour and nothing is added to what is saved or copied. `Link`'s `text` look is this, and so are the
|
|
101
|
+
* editors' links (`LINK_CLASS`).
|
|
102
|
+
*/
|
|
103
|
+
/** The line a link in text draws under everything in it, icon included: its own 1px background, since text-decoration skips an icon. */
|
|
104
|
+
export const LINK_UNDERLINE_CLASSES = 'no-underline bg-[linear-gradient(currentColor,currentColor)] bg-[length:100%_1px] bg-bottom bg-no-repeat'
|
|
105
|
+
|
|
106
|
+
export const WEB_LINK_CLASSES = `${LINK_UNDERLINE_CLASSES} before:content-[''] before:inline-block before:size-[1em] before:mr-0.5 before:align-[-0.125em] before:bg-current before:[mask:url(data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.75%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M9%2015l6%20-6%27%2F%3E%3Cpath%20d%3D%27M11%206l.463%20-.536a5%205%200%200%201%207.071%207.072l-.534%20.464%27%2F%3E%3Cpath%20d%3D%27M13%2018l-.397%20.534a5.068%205.068%200%200%201%20-7.127%200a4.972%204.972%200%200%201%200%20-7.071l.524%20-.463%27%2F%3E%3C%2Fsvg%3E)_center/contain_no-repeat]`
|
package/src/registry/build.ts
CHANGED
|
@@ -76,7 +76,7 @@ export function sanitize(name: string): string {
|
|
|
76
76
|
/**
|
|
77
77
|
* Storybook's `storyNameFromExport`, which is lodash's `startCase`: an export
|
|
78
78
|
* called `WithCounts` is the story "With Counts", and its id is
|
|
79
|
-
* `
|
|
79
|
+
* `page-structure-tabs--with-counts`, not `--withcounts`.
|
|
80
80
|
*
|
|
81
81
|
* Measured against a real `storybook build` (2026-09-18): without this, 11 of
|
|
82
82
|
* the 81 ids resolved nowhere — every export whose name is more than one word.
|
|
@@ -220,7 +220,7 @@ describe('nameProblems', () => {
|
|
|
220
220
|
const seen = '**Seen in** — *Parts/Badge*, *To be removed/\nTopicActivity* and\n*Media/AttachmentCard*.'
|
|
221
221
|
const dir = app({ 'src/Badge.mdx': page('A word.', seen) })
|
|
222
222
|
const titles = new Set(['Parts/Badge'])
|
|
223
|
-
expect(nameProblems(registry(dir), dir, { known, titles, packageIds: ['
|
|
223
|
+
expect(nameProblems(registry(dir), dir, { known, titles, packageIds: ['links-references-attachmentcard--document'] })).toEqual([
|
|
224
224
|
'src/Badge.mdx: "Seen in" names To be removed/TopicActivity, which no Storybook has',
|
|
225
225
|
'src/Badge.mdx: "Seen in" names Media/AttachmentCard, which no Storybook has',
|
|
226
226
|
])
|
package/src/registry/find.ts
CHANGED
|
@@ -175,7 +175,7 @@ export function findInRegistries(registries: Registry[], query: string, { limit
|
|
|
175
175
|
return findings.slice(0, limit)
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
/** `http://localhost:6008/?path=/docs/
|
|
178
|
+
/** `http://localhost:6008/?path=/docs/menus-windows-popover--docs`, or `null` where the entry has no page. */
|
|
179
179
|
export function docsLink(registry: Registry, entry: RegistryEntry): string | null {
|
|
180
180
|
if (!entry.docsId) return null
|
|
181
181
|
return registry.storybook.devUrl + registry.storybook.docsPath.replace('{docsId}', entry.docsId)
|
|
@@ -48,20 +48,20 @@ describe('the registry builds', () => {
|
|
|
48
48
|
expect(registry.entries.map((one) => one.name).sort()).toEqual(values.map((one) => one.name).sort())
|
|
49
49
|
})
|
|
50
50
|
|
|
51
|
-
it('counts
|
|
51
|
+
it('counts 211 names over 98 files: 139 components, 69 helpers and 3 hooks (inTheBox, a card or part in a box being written in, on the files’ fill and in words, on 29 October; archivedLine, the line on an archived file in every app (PEEKM-2), on 23 October; keepCommentBoxWarm, a box built ahead, exported as 0.84.0 promised (PEEKM-1), on 21 October;linkedFrom and linkStateFrom, one card for a file in every app (5ebf2756), on 21 October; ComposeBox, ComposeKeys and COMPOSE_EDITOR_CLASSES gone into CommentBox’s own frame (one box), on 21 October; LinkPlaces with linkPlaceAt and staysChip, a link in a document drawn where it sits (WBD-4), on 20 October; DocumentEditor, one document editor for every app, and PersonReference, `@` in a document (WBD-3), on 20 October; toggleTableHeaderRow, a table’s header row on and off (LEAF-12), on 19 October;EntryShell, the screen while nobody is signed in, moved from Peek (AUT-3), on 17 October; CommentBox with commentBoxRows, and ReactionRow with AddReactionButton and whoReacted, the shared comment box and reaction row (COMM-2), on 17 October; the link widgets — LinkChip, LinkRow, LinkCard, CardUnder, PartCard, LinkPreview and their parts, with useCanHover, chosenOf, loadingShapeOf and unavailableMemory — from the Widgets 2 prototype, on 16 October; InlineText, a title or the line under it edited where it stands (SUM-4), on 16 October; ComposeBox with ComposeKeys and its classes, CommentHighlights with its five helpers, and keepSelection and releaseSelection, from the Leaf prototype (LEAF-4), on 16 October;NavTree, NavTreeSection, the composer triggers and UnreadDot joined on 2 October; BlockHandle and EditorBlockHandle (RIC-18) on 2 October, moveBlock and blockDropCursor, the drop in the gutter, on 5 October, MembersPill and MembersDialog, moved from Peek (SHI-31), on 6 October, ShowMore on 7 October, AppProvider on 8 October, and KindIcon, thingKindOf and PastedImages with its two helpers, moved from Peek, on 8 October; CodeBlockColours, the coloured code block of the editor, on 9 October; Checklist, Callout, isChecklistTick and calloutLook (RIC-19) on 13 October; EditorTableControls and its four actions (RIC-21) on 13 October; ReferenceCards, useReferenceCards and its three helpers, the card a chip in a document asks for, on 14 October; LinkChips and its two helpers, a URL in a document read as its chip, on 14 October; ReferenceMenu, ReferenceMenuView and three helpers, the menu of a chip while writing, on 14 October; PastedMarkdown, markdown pasted as the blocks it spells (LEAF-10), on 15 October; turnIntoRows, turnListInto and turnQuoteInto, the block menu’s Turn into for a list and a quote (LEAF-11), on 15 October)', () => {
|
|
52
52
|
// The reconciliation GATES.md §24 explains. If this changes, that changes.
|
|
53
53
|
// The `EDITOR_EXTENSIONS` count as components by their names; they are
|
|
54
54
|
// editor extensions, documented on SelectionToolbar's, BlockNodes' and
|
|
55
55
|
// ComposerTriggers' pages.
|
|
56
56
|
const kinds = registry.entries.reduce<Record<string, number>>((all, one) => ({ ...all, [one.kind]: (all[one.kind] ?? 0) + 1 }), {})
|
|
57
|
-
expect(kinds).toEqual({ component: 139, helper:
|
|
57
|
+
expect(kinds).toEqual({ component: 139, helper: 69, hook: 3 })
|
|
58
58
|
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(98)
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
it('gives every entry a purpose, from its own page or from the comment above it', () => {
|
|
62
62
|
expect(registry.entries.filter((one) => one.purpose.trim() === '')).toEqual([])
|
|
63
63
|
expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(90)
|
|
64
|
-
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(
|
|
64
|
+
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(121)
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
it('takes a name with a page of its own from the page, and a name without one from the code', () => {
|
|
@@ -72,7 +72,7 @@ describe('the registry builds', () => {
|
|
|
72
72
|
// explained.
|
|
73
73
|
expect(entry('MenuSub').purposeFrom).toBe('comment')
|
|
74
74
|
expect(entry('MenuSub').docPage).toBeNull()
|
|
75
|
-
expect(entry('MenuSub').docsId).toBe('
|
|
75
|
+
expect(entry('MenuSub').docsId).toBe('menus-windows-menu--docs')
|
|
76
76
|
expect(entry('MenuSub').sourceFile).toBe('src/Menu.tsx')
|
|
77
77
|
})
|
|
78
78
|
|
|
@@ -246,13 +246,13 @@ describe('the ids point at something', () => {
|
|
|
246
246
|
* many-word export, and a name documented on a sibling's page.
|
|
247
247
|
*/
|
|
248
248
|
const REAL = [
|
|
249
|
-
['Button', '
|
|
250
|
-
['Tabs', '
|
|
251
|
-
['AvatarGroup', '
|
|
252
|
-
['Breadcrumb', '
|
|
253
|
-
['CommandPalette', '
|
|
254
|
-
['ChipInput', '
|
|
255
|
-
['EnterHint', '
|
|
249
|
+
['Button', 'buttons-links-button--docs', 'buttons-links-button--primary'],
|
|
250
|
+
['Tabs', 'page-structure-tabs--docs', 'page-structure-tabs--with-counts'],
|
|
251
|
+
['AvatarGroup', 'people-avatargroup--docs', 'people-avatargroup--three-members'],
|
|
252
|
+
['Breadcrumb', 'page-structure-breadcrumb--docs', 'page-structure-breadcrumb--on-an-item'],
|
|
253
|
+
['CommandPalette', 'menus-windows-commandpalette--docs', 'menus-windows-commandpalette--first-level'],
|
|
254
|
+
['ChipInput', 'forms-fields-chipinput--docs', 'forms-fields-chipinput--type-to-search'],
|
|
255
|
+
['EnterHint', 'menus-windows-menu--docs', 'menus-windows-menu--items'],
|
|
256
256
|
] as const
|
|
257
257
|
|
|
258
258
|
it.each(REAL)('%s', (name, docsId, storyId) => {
|
|
@@ -263,7 +263,7 @@ describe('the ids point at something', () => {
|
|
|
263
263
|
it('gives every component a page and a story, and only a helper none', () => {
|
|
264
264
|
const without = registry.entries.filter((one) => one.docsId === null || one.storyId === null)
|
|
265
265
|
// The helpers in a file with no page: cn, the shortcut names, the editor's suggestion wiring (documented on SuggestionMenu's page), and the link widgets' data helpers (documented on LinkCard's and LinkChip's pages; linkedFrom's on LinkCard's).
|
|
266
|
-
expect(without.map((one) => one.name).sort()).toEqual(['archivedLine', 'chosenOf', 'cn', 'isApplePlatform', 'isSuggestionActive', 'isSuggestionOpen', 'linkStateFrom', 'linkedFrom', 'loadingShapeOf', 'shortcutLabel', 'suggestionPopup', 'unavailableMemory'])
|
|
266
|
+
expect(without.map((one) => one.name).sort()).toEqual(['archivedLine', 'chosenOf', 'cn', 'inTheBox', 'isApplePlatform', 'isSuggestionActive', 'isSuggestionOpen', 'linkStateFrom', 'linkedFrom', 'loadingShapeOf', 'shortcutLabel', 'suggestionPopup', 'unavailableMemory'])
|
|
267
267
|
expect(without.every((one) => one.kind !== 'component')).toBe(true)
|
|
268
268
|
})
|
|
269
269
|
|
package/src/suggestionPopup.tsx
CHANGED
|
@@ -73,7 +73,7 @@ const Popup = forwardRef<SuggestionMenuHandle, Props<unknown>>(function Popup({
|
|
|
73
73
|
return (
|
|
74
74
|
<SuggestionMenu
|
|
75
75
|
handle={menu}
|
|
76
|
-
rect={props.clientRect
|
|
76
|
+
rect={props.clientRect ?? null}
|
|
77
77
|
editorElement={props.editor.view.dom}
|
|
78
78
|
ariaLabel={options.ariaLabel}
|
|
79
79
|
width={options.width}
|
package/stories/Choosing.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title="
|
|
3
|
+
<Meta title="Start here/Choosing a component" />
|
|
4
4
|
|
|
5
5
|
# Choosing a component
|
|
6
6
|
|
|
@@ -112,7 +112,7 @@ fork freely, owe nothing back, mention it on the package's ticket.
|
|
|
112
112
|
| A link to something an app looked up, in a sentence | **LinkChip** — hover shows its card; loading and "not available" drawn for you. **LinkChips** (editor) turns a URL in a document into one |
|
|
113
113
|
| A link alone on its line | **LinkRow** — one 36px line for every kind; **LinkUnavailable** when it cannot be read |
|
|
114
114
|
| A link's card: what a row cannot hold, with the pickers the reader may use | **LinkCard** — `onChange` on a picker only for a reader who may change it; **LinkCardLoading** at its height |
|
|
115
|
-
| The one card
|
|
115
|
+
| The one card attached to a piece of text, with the ✕ that removes it | **AttachedCard** — in a box, `CommentBox` places it with the files |
|
|
116
116
|
| A link's card on hover, read only | **LinkPreview** — LinkChip and LinkRow already wrap themselves in it |
|
|
117
117
|
| A part of something longer, shared live | **PartCard** — the app draws the blocks |
|
|
118
118
|
| A status and an owner changed in place, a conversation count with its unread dot, a ring | **LinkParts** — `LinkPickers`, `CommentCount`, `StatusMark`, `ProgressRing` |
|
package/stories/DesignTokens.mdx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta, Unstyled } from '@storybook/addon-docs/blocks'
|
|
2
2
|
import { TokensPage } from './TokensPage'
|
|
3
3
|
|
|
4
|
-
<Meta title="
|
|
4
|
+
<Meta title="Start here/Design Tokens" />
|
|
5
5
|
|
|
6
6
|
{/* Unstyled: the docs container sets 16px Nunito Sans on every div outside it,
|
|
7
7
|
at the same specificity as a token class, so the page draws its own type. */}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title="
|
|
3
|
+
<Meta title="Start here/Getting started" />
|
|
4
4
|
|
|
5
5
|
# Getting started
|
|
6
6
|
|
|
@@ -100,7 +100,7 @@ export default function App() {
|
|
|
100
100
|
|
|
101
101
|
## Where next
|
|
102
102
|
|
|
103
|
-
- **[Choosing a component](?path=/docs/
|
|
103
|
+
- **[Choosing a component](?path=/docs/start-here-choosing-a-component--docs)** —
|
|
104
104
|
what to reach for, by what you need.
|
|
105
105
|
- Each component's page: when, when not — with the alternative named — and
|
|
106
106
|
how.
|
package/stories/Introduction.mdx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs/blocks'
|
|
2
2
|
|
|
3
|
-
<Meta title="
|
|
3
|
+
<Meta title="Start here/Introduction" />
|
|
4
4
|
|
|
5
5
|
# @estiva-app/ui
|
|
6
6
|
|
|
@@ -15,15 +15,34 @@ on the package's ticket, and never bend your view around a component.
|
|
|
15
15
|
|
|
16
16
|
## Start here
|
|
17
17
|
|
|
18
|
-
1. **[Getting started](?path=/docs/
|
|
18
|
+
1. **[Getting started](?path=/docs/start-here-getting-started--docs)** — wire a
|
|
19
19
|
new app to the package, in six steps.
|
|
20
|
-
2. **[Choosing a component](?path=/docs/
|
|
20
|
+
2. **[Choosing a component](?path=/docs/start-here-choosing-a-component--docs)**
|
|
21
21
|
— what to reach for, by what you need.
|
|
22
|
-
3. **[Design Tokens](?path=/docs/
|
|
22
|
+
3. **[Design Tokens](?path=/docs/start-here-design-tokens--docs)** — the
|
|
23
23
|
vocabulary everything here is written in.
|
|
24
24
|
4. Every component's own page says **when** to use it, when **not** — with
|
|
25
25
|
the alternative named — and **how**, with its stories live on the page.
|
|
26
26
|
|
|
27
|
+
## Where things are
|
|
28
|
+
|
|
29
|
+
The sidebar is sorted by what a part is for, in the order a screen is built:
|
|
30
|
+
the frame, the page, then what goes in it.
|
|
31
|
+
|
|
32
|
+
| Heading | What is in it |
|
|
33
|
+
|---|---|
|
|
34
|
+
| **Start here** | These pages: the package, how to start, how to choose, the tokens. |
|
|
35
|
+
| **App frame** | The chrome around every screen: the shell, the top bar, the sidebar, the rail. |
|
|
36
|
+
| **Page structure** | How a page is cut up: columns, panels, headers, sections, tabs, cards, lines. |
|
|
37
|
+
| **Buttons & links** | What you click to do something or go somewhere. |
|
|
38
|
+
| **Forms & fields** | Typing or choosing a value, and the form that sends it. |
|
|
39
|
+
| **Menus & windows** | Anything that floats over the page: a tooltip, a menu, a dialog. |
|
|
40
|
+
| **Status & feedback** | What is going on: a state, a message, loading, empty, an error. |
|
|
41
|
+
| **People** | Faces, names, and who is in something. |
|
|
42
|
+
| **Writing** | Writing text: the boxes, what opens while you type, blocks, links in a document, pasting, and reading it back. |
|
|
43
|
+
| **Links & references** | How a link to another thing is drawn: in a sentence, on its own line, as a card, on hover. |
|
|
44
|
+
| **Conversation** | Comments, replies and reactions. |
|
|
45
|
+
|
|
27
46
|
Use the **Theme** toolbar anywhere in this Storybook to see every page
|
|
28
47
|
under each of the package's themes: the same token names, a different look.
|
|
29
48
|
|
package/stories/TokensPage.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useReducer, useRef, useState, type ReactNode } from 'react'
|
|
2
|
+
import { WithTooltip } from '../src/Tooltip'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The Design Tokens page: every token the preset names, its live value in the
|
|
@@ -174,11 +175,15 @@ function Section({ label, blurb, children }: { label: string; blurb: string; chi
|
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
function Users({ names }: { names: string[] }) {
|
|
177
|
-
if (names.length === 0)
|
|
178
|
+
if (names.length === 0)
|
|
179
|
+
return (
|
|
180
|
+
// @estiva-escape(no-handmade-empty-state): a cell of the tokens table, the "Used by" of a token no component spells yet; a value in its row, not a list or a section with nothing in it
|
|
181
|
+
<span className="text-caption text-text-secondary">— none yet</span>
|
|
182
|
+
)
|
|
178
183
|
return (
|
|
179
|
-
<
|
|
180
|
-
{names.join(', ')}
|
|
181
|
-
</
|
|
184
|
+
<WithTooltip label={names.join(', ')} wrapperClassName="min-w-0">
|
|
185
|
+
<span className="min-w-0 truncate text-caption text-text-secondary">{names.join(', ')}</span>
|
|
186
|
+
</WithTooltip>
|
|
182
187
|
)
|
|
183
188
|
}
|
|
184
189
|
|
|
@@ -217,9 +222,9 @@ function TokenRow({ token, utilities }: { token: Token; utilities: string }) {
|
|
|
217
222
|
<SwatchBox token={token} />
|
|
218
223
|
<span className="truncate text-body-2 text-text-primary">{token.key}</span>
|
|
219
224
|
<code className="truncate font-mono text-caption text-text-secondary">{token.cls}</code>
|
|
220
|
-
<
|
|
221
|
-
{resolveVar(token.cssVar)}
|
|
222
|
-
</
|
|
225
|
+
<WithTooltip label={resolveVar(token.cssVar)} wrapperClassName="min-w-0">
|
|
226
|
+
<code className="min-w-0 truncate font-mono text-caption text-text-secondary">{resolveVar(token.cssVar)}</code>
|
|
227
|
+
</WithTooltip>
|
|
223
228
|
<Users names={usedBy(token.key, utilities)} />
|
|
224
229
|
</div>
|
|
225
230
|
)
|
package/dist/CardUnder.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one card added under a piece of text, and the ✕ that removes it (why:
|
|
3
|
-
* https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-link-on-words-counts-toward-the-card.md).
|
|
4
|
-
*
|
|
5
|
-
* Under a box being written in, the ✕ always shows. Under text already sent
|
|
6
|
-
* (`revealOnHover`) it shows when the pointer is over the card or the ✕ has
|
|
7
|
-
* focus, and always on a screen that cannot hover, so a tap reaches it (Miky,
|
|
8
|
-
* 16 Oct, kickoff).
|
|
9
|
-
*/
|
|
10
|
-
import type { ReactNode } from 'react';
|
|
11
|
-
import type { LinkState } from './linked';
|
|
12
|
-
interface CardUnderBase {
|
|
13
|
-
/** Draws the ✕. Without it the card shows with none, as it does to anyone but the author. */
|
|
14
|
-
onRemove?: () => void;
|
|
15
|
-
/** The ✕ waits for hover or focus: under text already sent. Always shown on a screen that cannot hover. */
|
|
16
|
-
revealOnHover?: boolean;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The card is a `LinkCard` of `link`, or the app's own card as `children`: an
|
|
20
|
-
* app that draws a sent card itself draws the one under its box the same way.
|
|
21
|
-
*/
|
|
22
|
-
export type CardUnderProps = CardUnderBase & ({
|
|
23
|
-
link: LinkState;
|
|
24
|
-
children?: never;
|
|
25
|
-
} | {
|
|
26
|
-
link?: never;
|
|
27
|
-
children: ReactNode;
|
|
28
|
-
});
|
|
29
|
-
export declare function CardUnder({ link, children, onRemove, revealOnHover }: CardUnderProps): import("react").JSX.Element;
|
|
30
|
-
export {};
|
|
31
|
-
//# sourceMappingURL=CardUnder.d.ts.map
|
package/dist/CardUnder.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CardUnder.d.ts","sourceRoot":"","sources":["../src/CardUnder.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC,UAAU,aAAa;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,2GAA2G;IAC3G,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AAE5H,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAqB,EAAE,EAAE,cAAc,+BAmB5F"}
|