@charcuterie/ui 4.5.0 → 4.5.1
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/README.md +7 -2
- package/dist/Card/Card.d.ts +5 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +23 -3
- package/dist/Card/Card.js.map +1 -1
- package/package.json +2 -1
- package/src/Accordion/Accordion.mdx +1 -1
- package/src/Accordion/Accordion.stories.tsx +3 -1
- package/src/Accordion/Accordion.test.tsx +4 -4
- package/src/ActionTiles/ActionTiles.mdx +1 -1
- package/src/ActionTiles/ActionTiles.stories.tsx +3 -1
- package/src/ActionTiles/ActionTiles.test.tsx +3 -3
- package/src/AdaptiveGrid/AdaptiveGrid.mdx +1 -1
- package/src/AdaptiveGrid/AdaptiveGrid.stories.tsx +3 -1
- package/src/AdaptiveGrid/AdaptiveGrid.test.tsx +5 -5
- package/src/Alert/Alert.mdx +1 -1
- package/src/Alert/Alert.stories.tsx +3 -1
- package/src/Alert/Alert.test.tsx +2 -2
- package/src/Avatar/Avatar.mdx +1 -1
- package/src/Avatar/Avatar.stories.tsx +4 -1
- package/src/Avatar/Avatar.test.tsx +2 -2
- package/src/Badge/Badge.mdx +1 -1
- package/src/Badge/Badge.stories.tsx +3 -1
- package/src/Badge/Badge.test.tsx +3 -3
- package/src/BadgeButton/BadgeButton.mdx +1 -1
- package/src/BadgeButton/BadgeButton.stories.tsx +3 -1
- package/src/BadgeButton/BadgeButton.test.tsx +2 -2
- package/src/Board/Board.mdx +1 -1
- package/src/Board/Board.stories.tsx +4 -1
- package/src/Board/Board.test.tsx +2 -2
- package/src/Button/Button.mdx +1 -1
- package/src/Button/Button.stories.tsx +3 -1
- package/src/Button/Button.test.tsx +2 -2
- package/src/ButtonLink/ButtonLink.mdx +1 -1
- package/src/ButtonLink/ButtonLink.stories.tsx +3 -1
- package/src/ButtonLink/ButtonLink.test.tsx +3 -3
- package/src/Card/Card.mdx +21 -1
- package/src/Card/Card.stories.tsx +91 -1
- package/src/Card/Card.test.tsx +60 -3
- package/src/Card/Card.tsx +24 -2
- package/src/Checkbox/Checkbox.mdx +1 -1
- package/src/Checkbox/Checkbox.stories.tsx +3 -1
- package/src/Checkbox/Checkbox.test.tsx +4 -4
- package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.mdx +1 -1
- package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.stories.tsx +3 -1
- package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.test.tsx +5 -5
- package/src/ColorSchemeToggle/ColorSchemeToggle.mdx +1 -1
- package/src/ColorSchemeToggle/ColorSchemeToggle.stories.tsx +3 -1
- package/src/ColorSchemeToggle/ColorSchemeToggle.test.tsx +5 -5
- package/src/Combobox/Combobox.mdx +1 -1
- package/src/Combobox/Combobox.stories.tsx +3 -1
- package/src/Combobox/Combobox.test.tsx +2 -2
- package/src/CopyButton/CopyButton.mdx +1 -1
- package/src/CopyButton/CopyButton.stories.tsx +4 -1
- package/src/CopyButton/CopyButton.test.tsx +3 -3
- package/src/DataTable/DataTable.mdx +1 -1
- package/src/DataTable/DataTable.stories.tsx +3 -1
- package/src/DataTable/DataTable.test.tsx +3 -3
- package/src/DatePicker/DatePicker.mdx +1 -1
- package/src/DatePicker/DatePicker.stories.tsx +3 -1
- package/src/DatePicker/DatePicker.test.tsx +3 -3
- package/src/DatePicker/plainDate.test.ts +21 -3
- package/src/Dialog/Dialog.mdx +1 -1
- package/src/Dialog/Dialog.stories.tsx +3 -1
- package/src/Dialog/Dialog.test.tsx +2 -2
- package/src/DropRail/DropRail.mdx +1 -1
- package/src/DropRail/DropRail.stories.tsx +4 -1
- package/src/DropRail/DropRail.test.tsx +4 -4
- package/src/EmptyState/EmptyState.mdx +1 -1
- package/src/EmptyState/EmptyState.stories.tsx +3 -1
- package/src/EmptyState/EmptyState.test.tsx +2 -2
- package/src/Field/Field.mdx +1 -1
- package/src/Field/Field.stories.tsx +3 -1
- package/src/Field/Field.test.tsx +4 -4
- package/src/FileDropZone/FileDropZone.mdx +1 -1
- package/src/FileDropZone/FileDropZone.stories.tsx +3 -1
- package/src/FileDropZone/FileDropZone.test.tsx +3 -3
- package/src/Header/Header.mdx +1 -1
- package/src/Header/Header.stories.tsx +3 -1
- package/src/IconButton/IconButton.mdx +1 -1
- package/src/IconButton/IconButton.stories.tsx +3 -1
- package/src/IconButton/IconButton.test.tsx +2 -2
- package/src/Lightbox/Lightbox.mdx +1 -1
- package/src/Lightbox/Lightbox.stories.tsx +3 -1
- package/src/Lightbox/Lightbox.test.tsx +2 -2
- package/src/Listbox/Listbox.mdx +1 -1
- package/src/Listbox/Listbox.stories.tsx +3 -1
- package/src/Listbox/Listbox.test.tsx +5 -5
- package/src/LiveStatusIndicator/LiveStatusIndicator.mdx +1 -1
- package/src/LiveStatusIndicator/LiveStatusIndicator.stories.tsx +3 -1
- package/src/LiveStatusIndicator/LiveStatusIndicator.test.tsx +2 -2
- package/src/LogViewer/LogViewer.mdx +1 -1
- package/src/LogViewer/LogViewer.stories.tsx +3 -1
- package/src/LogViewer/LogViewer.test.tsx +2 -2
- package/src/Main/Main.mdx +1 -1
- package/src/Main/Main.stories.tsx +3 -1
- package/src/Main/Main.test.tsx +3 -3
- package/src/MarkdownEditor/MarkdownEditor.mdx +1 -1
- package/src/MarkdownEditor/MarkdownEditor.stories.tsx +3 -1
- package/src/MarkdownEditor/MarkdownEditor.test.tsx +4 -4
- package/src/MarkdownLine/MarkdownLine.mdx +1 -1
- package/src/MarkdownLine/MarkdownLine.stories.tsx +4 -1
- package/src/MarkdownLine/MarkdownLine.test.tsx +3 -3
- package/src/MediaTile/MediaTile.stories.tsx +3 -1
- package/src/MediaTile/MediaTile.test.tsx +2 -2
- package/src/Menu/Menu.mdx +1 -1
- package/src/Menu/Menu.stories.tsx +3 -1
- package/src/Modal/Modal.mdx +1 -1
- package/src/Modal/Modal.stories.tsx +3 -1
- package/src/Modal/Modal.test.tsx +3 -3
- package/src/Nav/Nav.mdx +1 -1
- package/src/Nav/Nav.stories.tsx +3 -1
- package/src/Nav/Nav.test.tsx +6 -6
- package/src/NavBar/NavBar.mdx +1 -1
- package/src/NavBar/NavBar.stories.tsx +3 -1
- package/src/NavBar/NavBar.test.tsx +3 -3
- package/src/Picker/Picker.mdx +1 -1
- package/src/Picker/Picker.stories.tsx +3 -1
- package/src/Picker/Picker.test.tsx +2 -2
- package/src/Popover/Popover.mdx +1 -1
- package/src/Popover/Popover.stories.tsx +3 -1
- package/src/Popover/Popover.test.tsx +2 -2
- package/src/PortraitTiles/PortraitTiles.mdx +1 -1
- package/src/PortraitTiles/PortraitTiles.stories.tsx +3 -1
- package/src/PortraitTiles/PortraitTiles.test.tsx +5 -5
- package/src/ProgressBar/ProgressBar.mdx +1 -1
- package/src/ProgressBar/ProgressBar.stories.tsx +3 -1
- package/src/ProgressBar/ProgressBar.test.tsx +2 -2
- package/src/QueryBuilder/QueryBuilder.mdx +1 -1
- package/src/QueryBuilder/QueryBuilder.stories.tsx +3 -1
- package/src/QueryBuilder/QueryBuilder.test.tsx +2 -2
- package/src/RadioGroup/RadioGroup.mdx +1 -1
- package/src/RadioGroup/RadioGroup.stories.tsx +3 -1
- package/src/RadioGroup/RadioGroup.test.tsx +2 -2
- package/src/Rail/Rail.mdx +1 -1
- package/src/Rail/Rail.stories.tsx +3 -1
- package/src/Rail/Rail.test.tsx +2 -2
- package/src/RangeSlider/RangeSlider.mdx +1 -1
- package/src/RangeSlider/RangeSlider.stories.tsx +3 -1
- package/src/RangeSlider/RangeSlider.test.tsx +7 -3
- package/src/ReorderList/ReorderList.mdx +1 -1
- package/src/ReorderList/ReorderList.stories.tsx +3 -1
- package/src/ReorderList/ReorderList.test.tsx +7 -7
- package/src/RouterLink/UnstyledLink.stories.tsx +4 -1
- package/src/RouterLink/UnstyledLink.test.tsx +2 -2
- package/src/SearchInput/SearchInput.mdx +1 -1
- package/src/SearchInput/SearchInput.stories.tsx +3 -1
- package/src/SegmentedControl/SegmentedControl.mdx +1 -1
- package/src/SegmentedControl/SegmentedControl.stories.tsx +3 -1
- package/src/SegmentedControl/SegmentedControl.test.tsx +2 -2
- package/src/Select/Select.mdx +1 -1
- package/src/Select/Select.stories.tsx +3 -1
- package/src/Select/Select.test.tsx +4 -4
- package/src/Shell/Shell.mdx +1 -1
- package/src/Shell/Shell.stories.tsx +3 -1
- package/src/Shell/Shell.test.tsx +2 -2
- package/src/Skeleton/Skeleton.mdx +1 -1
- package/src/Skeleton/Skeleton.stories.tsx +3 -1
- package/src/Skeleton/Skeleton.test.tsx +2 -2
- package/src/Slider/Slider.mdx +1 -1
- package/src/Slider/Slider.stories.tsx +3 -1
- package/src/Slider/Slider.test.tsx +2 -2
- package/src/SortableTableHeader/SortableTableHeader.mdx +1 -1
- package/src/SortableTableHeader/SortableTableHeader.stories.tsx +3 -1
- package/src/SortableTableHeader/SortableTableHeader.test.tsx +3 -3
- package/src/Spinner/Spinner.mdx +1 -1
- package/src/Spinner/Spinner.stories.tsx +3 -1
- package/src/Spinner/Spinner.test.tsx +2 -2
- package/src/Stepper/Stepper.mdx +1 -1
- package/src/Stepper/Stepper.stories.tsx +4 -1
- package/src/Stepper/Stepper.test.tsx +7 -7
- package/src/Swatch/Swatch.mdx +1 -1
- package/src/Swatch/Swatch.stories.tsx +4 -1
- package/src/Swatch/Swatch.test.tsx +3 -3
- package/src/Switch/Switch.mdx +1 -1
- package/src/Switch/Switch.stories.tsx +3 -1
- package/src/Switch/Switch.test.tsx +2 -2
- package/src/Tabs/Tabs.mdx +1 -1
- package/src/Tabs/Tabs.stories.tsx +3 -1
- package/src/Tabs/Tabs.test.tsx +3 -3
- package/src/TextLink/TextLink.mdx +1 -1
- package/src/TextLink/TextLink.stories.tsx +3 -1
- package/src/TextLink/TextLink.test.tsx +4 -4
- package/src/TimecodeInput/TimecodeInput.mdx +1 -1
- package/src/TimecodeInput/TimecodeInput.stories.tsx +3 -1
- package/src/Toast/Toast.mdx +1 -1
- package/src/Toast/Toast.stories.tsx +3 -1
- package/src/Toast/Toast.test.tsx +2 -2
- package/src/Toolbar/Toolbar.mdx +1 -1
- package/src/Toolbar/Toolbar.stories.tsx +3 -1
- package/src/Toolbar/Toolbar.test.tsx +5 -5
- package/src/Tooltip/Tooltip.mdx +1 -1
- package/src/Tooltip/Tooltip.stories.tsx +3 -1
- package/src/Tooltip/Tooltip.test.tsx +2 -2
- package/src/VirtualizedGrid/VirtualizedGrid.mdx +1 -1
- package/src/VirtualizedGrid/VirtualizedGrid.stories.tsx +4 -1
- package/src/VirtualizedGrid/VirtualizedGrid.test.tsx +5 -5
- package/src/VisuallyHidden/VisuallyHidden.mdx +1 -1
- package/src/VisuallyHidden/VisuallyHidden.stories.tsx +3 -1
- package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.mdx +1 -1
- package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.stories.tsx +3 -1
- package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.test.tsx +3 -3
- package/src/markdownEditorCodeMirror/MarkdownView.mdx +1 -1
- package/src/markdownEditorCodeMirror/MarkdownView.stories.tsx +4 -1
- package/src/markdownEditorCodeMirror/MarkdownView.test.tsx +44 -20
- package/src/reactRouter/ReactRouterAdapter.stories.tsx +3 -1
- package/src/reactRouter/ReactRouterAdapter.test.tsx +2 -2
|
@@ -13,7 +13,7 @@ replaces destroyed data by storing HTML in a field it later read back as text. S
|
|
|
13
13
|
constraint is not "prefer markdown" — it is that an HTML tag must not be *able* to reach the
|
|
14
14
|
stored string.
|
|
15
15
|
|
|
16
|
-
<Canvas of={MarkdownEditorStories.
|
|
16
|
+
<Canvas of={MarkdownEditorStories.Playground} />
|
|
17
17
|
|
|
18
18
|
> **Reading rather than editing?** `isReadOnly` here leaves the toolbar on screen, because it
|
|
19
19
|
> means "an editor you cannot type in". A surface with no toolbar in the DOM is
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import { useState } from "react"
|
|
3
4
|
|
|
@@ -61,7 +62,8 @@ export default meta
|
|
|
61
62
|
|
|
62
63
|
type Story = StoryObj<typeof meta>
|
|
63
64
|
|
|
64
|
-
export const
|
|
65
|
+
export const Playground: Story = {
|
|
66
|
+
parameters: playgroundParameters,
|
|
65
67
|
args: {
|
|
66
68
|
defaultValue: SAMPLE,
|
|
67
69
|
label: "Description",
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
AllStates,
|
|
12
12
|
AllVariants,
|
|
13
13
|
Blank,
|
|
14
|
-
|
|
14
|
+
Playground,
|
|
15
15
|
Interactive,
|
|
16
16
|
NoUpload,
|
|
17
17
|
Responsive,
|
|
@@ -59,7 +59,7 @@ const resyncHarness = (editor: HTMLTextAreaElement) => {
|
|
|
59
59
|
*/
|
|
60
60
|
test("the surface is a real textbox an agent can find", async () => {
|
|
61
61
|
const { canvas, canvasElement } =
|
|
62
|
-
await mountStory(
|
|
62
|
+
await mountStory(Playground)
|
|
63
63
|
|
|
64
64
|
expectAgentDrivable(canvas, {
|
|
65
65
|
name: "Description",
|
|
@@ -77,7 +77,7 @@ test("the surface is a real textbox an agent can find", async () => {
|
|
|
77
77
|
|
|
78
78
|
test("the toolbar is one tab stop with arrow keys inside it", async () => {
|
|
79
79
|
const { canvas, canvasElement } =
|
|
80
|
-
await mountStory(
|
|
80
|
+
await mountStory(Playground)
|
|
81
81
|
|
|
82
82
|
expectAgentDrivable(canvas, {
|
|
83
83
|
name: "Markdown formatting",
|
|
@@ -133,7 +133,7 @@ test("markdown goes in and the same markdown comes out", async () => {
|
|
|
133
133
|
* drifts away from the glyphs it is supposed to be sitting between.
|
|
134
134
|
*/
|
|
135
135
|
test("the painted layer holds exactly the textarea's text", async () => {
|
|
136
|
-
const { canvas } = await mountStory(
|
|
136
|
+
const { canvas } = await mountStory(Playground)
|
|
137
137
|
|
|
138
138
|
const editor = getEditor(canvas, "Description")
|
|
139
139
|
|
|
@@ -10,7 +10,7 @@ import * as MarkdownLineStories from "./MarkdownLine.stories";
|
|
|
10
10
|
wherever a stored string is a *name* rather than a document — a card title, a lane heading,
|
|
11
11
|
a table cell, a breadcrumb.
|
|
12
12
|
|
|
13
|
-
<Canvas of={MarkdownLineStories.
|
|
13
|
+
<Canvas of={MarkdownLineStories.Playground} />
|
|
14
14
|
|
|
15
15
|
## Props
|
|
16
16
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import type { ReactNode } from "react"
|
|
3
4
|
|
|
@@ -52,7 +53,9 @@ export default meta
|
|
|
52
53
|
|
|
53
54
|
type Story = StoryObj<typeof meta>
|
|
54
55
|
|
|
55
|
-
export const
|
|
56
|
+
export const Playground: Story = {
|
|
57
|
+
parameters: playgroundParameters,
|
|
58
|
+
}
|
|
56
59
|
|
|
57
60
|
/**
|
|
58
61
|
* The four marks, each in the shape a title actually uses it for.
|
|
@@ -22,7 +22,7 @@ import * as stories from "./MarkdownLine.stories.tsx"
|
|
|
22
22
|
const {
|
|
23
23
|
AllMarks,
|
|
24
24
|
AsALink,
|
|
25
|
-
|
|
25
|
+
Playground,
|
|
26
26
|
FileNames,
|
|
27
27
|
InsideACardLink,
|
|
28
28
|
RefusedUrl,
|
|
@@ -31,7 +31,7 @@ const {
|
|
|
31
31
|
} = composeStories(stories)
|
|
32
32
|
|
|
33
33
|
test("a code span is a `code` element, and the backticks are gone", async () => {
|
|
34
|
-
const { canvasElement } = await mountStory(
|
|
34
|
+
const { canvasElement } = await mountStory(Playground)
|
|
35
35
|
|
|
36
36
|
await expect(
|
|
37
37
|
[...canvasElement.querySelectorAll("code")].map(
|
|
@@ -80,7 +80,7 @@ test("an underscore inside a word marks nothing", async () => {
|
|
|
80
80
|
})
|
|
81
81
|
|
|
82
82
|
test("a line with no href has nothing to click", async () => {
|
|
83
|
-
const { canvasElement } = await mountStory(
|
|
83
|
+
const { canvasElement } = await mountStory(Playground)
|
|
84
84
|
|
|
85
85
|
await expect(canvasElement.querySelector("a")).toBe(null)
|
|
86
86
|
})
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
|
|
3
4
|
import { Badge } from "../Badge/Badge.tsx"
|
|
@@ -35,7 +36,8 @@ export default meta
|
|
|
35
36
|
|
|
36
37
|
type Story = StoryObj<typeof meta>
|
|
37
38
|
|
|
38
|
-
export const
|
|
39
|
+
export const Playground: Story = {
|
|
40
|
+
parameters: playgroundParameters,
|
|
39
41
|
args: {
|
|
40
42
|
alt: "Blade Runner (1982) poster",
|
|
41
43
|
src: toPosterSrc("Blade Runner"),
|
|
@@ -6,11 +6,11 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
6
6
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
7
7
|
import * as stories from "./MediaTile.stories.tsx"
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const { Playground, Interactive, InteractiveButton } =
|
|
10
10
|
composeStories(stories)
|
|
11
11
|
|
|
12
12
|
test("an unlinked tile's poster carries the name", async () => {
|
|
13
|
-
const { canvas } = await mountStory(
|
|
13
|
+
const { canvas } = await mountStory(Playground)
|
|
14
14
|
|
|
15
15
|
expectAgentDrivable(canvas, {
|
|
16
16
|
name: "Blade Runner (1982) poster",
|
package/src/Menu/Menu.mdx
CHANGED
|
@@ -10,7 +10,7 @@ A menu is **not** a listbox, and mux-magic's `TypePicker` is the fleet's one att
|
|
|
10
10
|
telling them apart — it renders `role="menu"` over items that set a value, which is a
|
|
11
11
|
listbox wearing the wrong role.
|
|
12
12
|
|
|
13
|
-
<Canvas of={MenuStories.
|
|
13
|
+
<Canvas of={MenuStories.Playground} />
|
|
14
14
|
|
|
15
15
|
## Props
|
|
16
16
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useVisibility } from "@charcuterie/logic"
|
|
2
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
2
3
|
import type { ControlSize } from "@charcuterie/tokens"
|
|
3
4
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
5
|
import type { ReactNode } from "react"
|
|
@@ -166,7 +167,8 @@ export default meta
|
|
|
166
167
|
|
|
167
168
|
type Story = StoryObj<typeof meta>
|
|
168
169
|
|
|
169
|
-
export const
|
|
170
|
+
export const Playground: Story = {
|
|
171
|
+
parameters: playgroundParameters,
|
|
170
172
|
args: {
|
|
171
173
|
isVisible: false,
|
|
172
174
|
onDismiss: noop,
|
package/src/Modal/Modal.mdx
CHANGED
|
@@ -12,7 +12,7 @@ anything else that wants a scrim over the page. `Modal` is that foundation, and
|
|
|
12
12
|
[`Dialog`](?path=/docs/components-dialog--docs) is `Modal` plus the
|
|
13
13
|
heading/Close/footer/size chrome the component shipped with before the M8 rebuild.
|
|
14
14
|
|
|
15
|
-
<Canvas of={ModalStories.
|
|
15
|
+
<Canvas of={ModalStories.Playground} />
|
|
16
16
|
|
|
17
17
|
## Props
|
|
18
18
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useVisibility } from "@charcuterie/logic"
|
|
2
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
2
3
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
4
|
import type { ReactNode } from "react"
|
|
4
5
|
|
|
@@ -73,7 +74,8 @@ const ModalDemo = ({
|
|
|
73
74
|
)
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
export const
|
|
77
|
+
export const Playground: Story = {
|
|
78
|
+
parameters: playgroundParameters,
|
|
77
79
|
args: {
|
|
78
80
|
"aria-label": "Read error on title 4",
|
|
79
81
|
children: null,
|
package/src/Modal/Modal.test.tsx
CHANGED
|
@@ -7,12 +7,12 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
7
7
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
8
8
|
import * as stories from "./Modal.stories.tsx"
|
|
9
9
|
|
|
10
|
-
const { Alert,
|
|
10
|
+
const { Alert, Playground, Interactive } =
|
|
11
11
|
composeStories(stories)
|
|
12
12
|
|
|
13
13
|
test("the base modal portals to the body, named by its aria-label", async () => {
|
|
14
14
|
const { body, canvas, canvasElement } =
|
|
15
|
-
await mountStory(
|
|
15
|
+
await mountStory(Playground)
|
|
16
16
|
|
|
17
17
|
await userEvent.click(
|
|
18
18
|
expectAgentDrivable(canvas, {
|
|
@@ -50,7 +50,7 @@ test("an alertdialog role is carried through", async () => {
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
test("Escape and an outside press both close through onClose", async () => {
|
|
53
|
-
const { body, canvas } = await mountStory(
|
|
53
|
+
const { body, canvas } = await mountStory(Playground)
|
|
54
54
|
|
|
55
55
|
const trigger = expectAgentDrivable(canvas, {
|
|
56
56
|
name: "Open the base modal",
|
package/src/Nav/Nav.mdx
CHANGED
|
@@ -14,7 +14,7 @@ of a phone, or a panel behind one control — the same list, drawn where it fits
|
|
|
14
14
|
> layout and behaves identically, down to the measured whole-row fold — see *`bar` folds
|
|
15
15
|
> whole* below.
|
|
16
16
|
|
|
17
|
-
<Canvas of={NavStories.
|
|
17
|
+
<Canvas of={NavStories.Playground} />
|
|
18
18
|
|
|
19
19
|
## Props
|
|
20
20
|
|
package/src/Nav/Nav.stories.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import type { ReactNode } from "react"
|
|
3
4
|
import { useState } from "react"
|
|
@@ -153,7 +154,8 @@ type Story = StoryObj<typeof Nav>
|
|
|
153
154
|
* A header row, which is what an app with a handful of destinations
|
|
154
155
|
* wants: ai-usage, folio, mux-magic, portly-controllers.
|
|
155
156
|
*/
|
|
156
|
-
export const
|
|
157
|
+
export const Playground: Story = {
|
|
158
|
+
parameters: playgroundParameters,
|
|
157
159
|
args: {
|
|
158
160
|
activeHref: "/library",
|
|
159
161
|
items: STATION_ITEMS,
|
package/src/Nav/Nav.test.tsx
CHANGED
|
@@ -12,11 +12,11 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
12
12
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
13
13
|
import * as stories from "./Nav.stories.tsx"
|
|
14
14
|
|
|
15
|
-
const { AllStates, AllVariants,
|
|
15
|
+
const { AllStates, AllVariants, Playground, Interactive } =
|
|
16
16
|
composeStories(stories)
|
|
17
17
|
|
|
18
18
|
test("the destinations are a named navigation landmark", async () => {
|
|
19
|
-
const { canvas } = await mountStory(
|
|
19
|
+
const { canvas } = await mountStory(Playground)
|
|
20
20
|
|
|
21
21
|
const nav = expectAgentDrivable(canvas, {
|
|
22
22
|
name: "Main",
|
|
@@ -33,7 +33,7 @@ test("the destinations are a named navigation landmark", async () => {
|
|
|
33
33
|
* a new tab", the status bar, and "copy link address".
|
|
34
34
|
*/
|
|
35
35
|
test("every destination is a real link with an href", async () => {
|
|
36
|
-
const { canvas } = await mountStory(
|
|
36
|
+
const { canvas } = await mountStory(Playground)
|
|
37
37
|
|
|
38
38
|
const links = canvas.getAllByRole("link")
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ test("every destination is a real link with an href", async () => {
|
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
test("the current destination is announced, not only coloured", async () => {
|
|
48
|
-
const { canvas } = await mountStory(
|
|
48
|
+
const { canvas } = await mountStory(Playground)
|
|
49
49
|
|
|
50
50
|
const current = canvas.getByRole("link", {
|
|
51
51
|
name: "Library",
|
|
@@ -240,7 +240,7 @@ test("a long label truncates rather than widening the column", async () => {
|
|
|
240
240
|
* button permanently.
|
|
241
241
|
*/
|
|
242
242
|
test("a bar with room shows no menu trigger", async () => {
|
|
243
|
-
const { canvas } = await mountStory(
|
|
243
|
+
const { canvas } = await mountStory(Playground)
|
|
244
244
|
|
|
245
245
|
const nav = canvas.getByRole("navigation", {
|
|
246
246
|
name: "Main",
|
|
@@ -330,7 +330,7 @@ test("a folded destination is still a real link", async () => {
|
|
|
330
330
|
* tell which one a human can see.
|
|
331
331
|
*/
|
|
332
332
|
test("a destination is mounted exactly once", async () => {
|
|
333
|
-
const { canvas } = await mountStory(
|
|
333
|
+
const { canvas } = await mountStory(Playground)
|
|
334
334
|
|
|
335
335
|
expect(
|
|
336
336
|
canvas.getAllByRole("link", { name: "Tonight" }),
|
package/src/NavBar/NavBar.mdx
CHANGED
|
@@ -35,7 +35,7 @@ import * as NavBarStories from "./NavBar.stories";
|
|
|
35
35
|
The app's destinations as real links, in one line — folding into a single menu button,
|
|
36
36
|
**whole**, when that line does not fit.
|
|
37
37
|
|
|
38
|
-
<Canvas of={NavBarStories.
|
|
38
|
+
<Canvas of={NavBarStories.Playground} />
|
|
39
39
|
|
|
40
40
|
## Props
|
|
41
41
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import type { ReactNode } from "react"
|
|
3
4
|
|
|
@@ -131,7 +132,8 @@ type Story = StoryObj<typeof meta>
|
|
|
131
132
|
* a trigger that shows at every width is not a fold, it is a nav
|
|
132
133
|
* you have permanently hidden.
|
|
133
134
|
*/
|
|
134
|
-
export const
|
|
135
|
+
export const Playground: Story = {
|
|
136
|
+
parameters: playgroundParameters,
|
|
135
137
|
render: (navBarProps) => (
|
|
136
138
|
<Frame inlineSize="52rem">
|
|
137
139
|
<NavBar {...navBarProps} />
|
|
@@ -15,13 +15,13 @@ import * as stories from "./NavBar.stories.tsx"
|
|
|
15
15
|
const {
|
|
16
16
|
AllStates,
|
|
17
17
|
AllVariants,
|
|
18
|
-
|
|
18
|
+
Playground,
|
|
19
19
|
InAppShell,
|
|
20
20
|
Interactive,
|
|
21
21
|
} = composeStories(stories)
|
|
22
22
|
|
|
23
23
|
test("the nav is named, and its destinations are links", async () => {
|
|
24
|
-
const { canvas } = await mountStory(
|
|
24
|
+
const { canvas } = await mountStory(Playground)
|
|
25
25
|
|
|
26
26
|
const nav = expectAgentDrivable(canvas, {
|
|
27
27
|
name: "Main",
|
|
@@ -48,7 +48,7 @@ test("the nav is named, and its destinations are links", async () => {
|
|
|
48
48
|
* button permanently.
|
|
49
49
|
*/
|
|
50
50
|
test("a bar with room shows no menu trigger", async () => {
|
|
51
|
-
const { canvas } = await mountStory(
|
|
51
|
+
const { canvas } = await mountStory(Playground)
|
|
52
52
|
|
|
53
53
|
const nav = expectAgentDrivable(canvas, {
|
|
54
54
|
name: "Main",
|
package/src/Picker/Picker.mdx
CHANGED
|
@@ -9,7 +9,7 @@ import * as PickerStories from "./Picker.stories.tsx"
|
|
|
9
9
|
A `Listbox` with its trigger already attached — the shape an app reaches for when it wants
|
|
10
10
|
"a select, but ours".
|
|
11
11
|
|
|
12
|
-
<Canvas of={PickerStories.
|
|
12
|
+
<Canvas of={PickerStories.Playground} />
|
|
13
13
|
|
|
14
14
|
## Why this exists when `Listbox` already does
|
|
15
15
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import type { ReactNode } from "react"
|
|
3
4
|
import { useState } from "react"
|
|
@@ -106,7 +107,8 @@ const PickerHarness = ({
|
|
|
106
107
|
* The assembled default: a button showing the current value, a
|
|
107
108
|
* chevron, and the `Listbox` panel already wired to it.
|
|
108
109
|
*/
|
|
109
|
-
export const
|
|
110
|
+
export const Playground: Story = {
|
|
111
|
+
parameters: playgroundParameters,
|
|
110
112
|
render: () => (
|
|
111
113
|
<PickerHarness
|
|
112
114
|
initialValue="eng"
|
|
@@ -7,12 +7,12 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
7
7
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
8
8
|
import * as stories from "./Picker.stories.tsx"
|
|
9
9
|
|
|
10
|
-
const { AllStates,
|
|
10
|
+
const { AllStates, Playground, Interactive, NextToText } =
|
|
11
11
|
composeStories(stories)
|
|
12
12
|
|
|
13
13
|
test("the trigger's accessible name carries the current value", async () => {
|
|
14
14
|
const { canvas, canvasElement } =
|
|
15
|
-
await mountStory(
|
|
15
|
+
await mountStory(Playground)
|
|
16
16
|
|
|
17
17
|
// Not a bare "Language": the button's VISIBLE text is the value, and
|
|
18
18
|
// WCAG 2.5.3 wants the visible text inside the accessible name.
|
package/src/Popover/Popover.mdx
CHANGED
|
@@ -11,7 +11,7 @@ for one reason: **Radix owns `open`.** Wrapping it leaves `useVisibility` and Ra
|
|
|
11
11
|
believing they hold the state, which is the conflict the whole state layer exists to
|
|
12
12
|
avoid.
|
|
13
13
|
|
|
14
|
-
<Canvas of={PopoverStories.
|
|
14
|
+
<Canvas of={PopoverStories.Playground} />
|
|
15
15
|
|
|
16
16
|
## Props
|
|
17
17
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useVisibility } from "@charcuterie/logic"
|
|
2
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
2
3
|
import type { Placement } from "@floating-ui/react"
|
|
3
4
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
5
|
import type { ReactNode } from "react"
|
|
@@ -73,7 +74,8 @@ const PopoverDemo = ({
|
|
|
73
74
|
)
|
|
74
75
|
}
|
|
75
76
|
|
|
76
|
-
export const
|
|
77
|
+
export const Playground: Story = {
|
|
78
|
+
parameters: playgroundParameters,
|
|
77
79
|
args: {
|
|
78
80
|
children: null,
|
|
79
81
|
heading: "Filters",
|
|
@@ -10,14 +10,14 @@ import * as stories from "./Popover.stories.tsx"
|
|
|
10
10
|
const {
|
|
11
11
|
AllStates,
|
|
12
12
|
AllVariants,
|
|
13
|
-
|
|
13
|
+
Playground,
|
|
14
14
|
EscapesOverflowClip,
|
|
15
15
|
Interactive,
|
|
16
16
|
Responsive,
|
|
17
17
|
} = composeStories(stories)
|
|
18
18
|
|
|
19
19
|
test("the trigger and the panel agree about each other", async () => {
|
|
20
|
-
const { body, canvas } = await mountStory(
|
|
20
|
+
const { body, canvas } = await mountStory(Playground)
|
|
21
21
|
|
|
22
22
|
const trigger = expectAgentDrivable(canvas, {
|
|
23
23
|
name: "Filters",
|
|
@@ -13,7 +13,7 @@ points-market's "Who's shopping?" is the shape this is taken from. It had been h
|
|
|
13
13
|
there since the app was built, and it is the third tile shape the fleet grew on its own,
|
|
14
14
|
after mux-magic's and Gallery Downloader's "Pick a tool" cards.
|
|
15
15
|
|
|
16
|
-
<Canvas of={PortraitTilesStories.
|
|
16
|
+
<Canvas of={PortraitTilesStories.Playground} />
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
|
|
3
4
|
import { controlSizeArgType } from "../argTypes.storyHelpers.ts"
|
|
@@ -154,7 +155,8 @@ export default meta
|
|
|
154
155
|
|
|
155
156
|
type Story = StoryObj<typeof meta>
|
|
156
157
|
|
|
157
|
-
export const
|
|
158
|
+
export const Playground: Story = {
|
|
159
|
+
parameters: playgroundParameters,
|
|
158
160
|
args: {
|
|
159
161
|
items: SHOPPER_ITEMS,
|
|
160
162
|
label: "Who's shopping?",
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
AllStates,
|
|
12
12
|
AllVariants,
|
|
13
13
|
DataColours,
|
|
14
|
-
|
|
14
|
+
Playground,
|
|
15
15
|
Interactive,
|
|
16
16
|
NamedHues,
|
|
17
17
|
Responsive,
|
|
@@ -20,7 +20,7 @@ const {
|
|
|
20
20
|
|
|
21
21
|
test("it is a named group of pressable portraits", async () => {
|
|
22
22
|
const { canvas, canvasElement } =
|
|
23
|
-
await mountStory(
|
|
23
|
+
await mountStory(Playground)
|
|
24
24
|
|
|
25
25
|
const group = expectAgentDrivable(canvas, {
|
|
26
26
|
name: "Who's shopping?",
|
|
@@ -50,7 +50,7 @@ test("it is a named group of pressable portraits", async () => {
|
|
|
50
50
|
* thing the portrait was being chosen by.
|
|
51
51
|
*/
|
|
52
52
|
test("the name, the number and its unit are one accessible name", async () => {
|
|
53
|
-
const { canvas } = await mountStory(
|
|
53
|
+
const { canvas } = await mountStory(Playground)
|
|
54
54
|
|
|
55
55
|
expectAgentDrivable(canvas, {
|
|
56
56
|
name: "Avery 1,240 points",
|
|
@@ -194,7 +194,7 @@ test("a fixed layout skips the query", async () => {
|
|
|
194
194
|
* how a token name that did not exist shipped in Docket.
|
|
195
195
|
*/
|
|
196
196
|
test("each portrait wears a different hue, and a named one holds it", async () => {
|
|
197
|
-
const { canvas } = await mountStory(
|
|
197
|
+
const { canvas } = await mountStory(Playground)
|
|
198
198
|
|
|
199
199
|
const faces = Array.from(
|
|
200
200
|
expectAgentDrivable(canvas, {
|
|
@@ -380,7 +380,7 @@ test("an href portrait is a real anchor", async () => {
|
|
|
380
380
|
* promise that survives exactly one edit.
|
|
381
381
|
*/
|
|
382
382
|
test("a portrait is the same box as an action tile", async () => {
|
|
383
|
-
const { canvas } = await mountStory(
|
|
383
|
+
const { canvas } = await mountStory(Playground)
|
|
384
384
|
|
|
385
385
|
const portrait = expectAgentDrivable(canvas, {
|
|
386
386
|
name: "Avery 1,240 points",
|
|
@@ -13,7 +13,7 @@ are a `<div>` with a percentage width: invisible to assistive technology and to
|
|
|
13
13
|
This is the union — rip-deck's ARIA and its indeterminate sweep, plus threshold colours
|
|
14
14
|
nobody has yet.
|
|
15
15
|
|
|
16
|
-
<Canvas of={ProgressBarStories.
|
|
16
|
+
<Canvas of={ProgressBarStories.Playground} />
|
|
17
17
|
|
|
18
18
|
## Props
|
|
19
19
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
import { useState } from "react"
|
|
3
4
|
|
|
@@ -43,7 +44,8 @@ type Story = StoryObj<typeof meta>
|
|
|
43
44
|
* is not printed, and the value sits on the *track* — so an agent's
|
|
44
45
|
* bounding box is the widget, not the filled 38%.
|
|
45
46
|
*/
|
|
46
|
-
export const
|
|
47
|
+
export const Playground: Story = {
|
|
48
|
+
parameters: playgroundParameters,
|
|
47
49
|
args: { label: "Ripping title 4 of 9", value: 38 },
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -6,11 +6,11 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
6
6
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
7
7
|
import * as stories from "./ProgressBar.stories.tsx"
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const { Playground, Indeterminate, Interactive } =
|
|
10
10
|
composeStories(stories)
|
|
11
11
|
|
|
12
12
|
test("the name is real and the value sits on the track", async () => {
|
|
13
|
-
const { canvas } = await mountStory(
|
|
13
|
+
const { canvas } = await mountStory(Playground)
|
|
14
14
|
|
|
15
15
|
const bar = expectAgentDrivable(canvas, {
|
|
16
16
|
name: "Ripping title 4 of 9",
|
|
@@ -14,7 +14,7 @@ mail rules (leaf = field/operator/value, combinators AND/OR) and mux-magic's job
|
|
|
14
14
|
combinator** are fully opaque here — `Combinator` and `Leaf` only ever pass through to the
|
|
15
15
|
consumer's `renderLeaf` and `combinatorOptions`.
|
|
16
16
|
|
|
17
|
-
<Canvas of={QueryBuilderStories.
|
|
17
|
+
<Canvas of={QueryBuilderStories.Playground} />
|
|
18
18
|
|
|
19
19
|
## Props
|
|
20
20
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SerializedTree } from "@charcuterie/logic"
|
|
2
2
|
import { createTree, useTree } from "@charcuterie/logic"
|
|
3
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
3
4
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
4
5
|
import type { ReactNode } from "react"
|
|
5
6
|
import { useState } from "react"
|
|
@@ -194,7 +195,8 @@ type Story = StoryObj<typeof meta>
|
|
|
194
195
|
* A flat group of two conditions joined by ALL. Change the combinator,
|
|
195
196
|
* edit a condition, or add another with "+ Add condition".
|
|
196
197
|
*/
|
|
197
|
-
export const
|
|
198
|
+
export const Playground: Story = {
|
|
199
|
+
parameters: playgroundParameters,
|
|
198
200
|
render: () => (
|
|
199
201
|
<QueryBuilderHarness initialTree={FLAT_TREE} />
|
|
200
202
|
),
|
|
@@ -10,13 +10,13 @@ import * as stories from "./QueryBuilder.stories.tsx"
|
|
|
10
10
|
const {
|
|
11
11
|
AllStates,
|
|
12
12
|
CustomCombinator,
|
|
13
|
-
|
|
13
|
+
Playground,
|
|
14
14
|
Interactive,
|
|
15
15
|
} = composeStories(stories)
|
|
16
16
|
|
|
17
17
|
test("the root group exposes its combinator as a named 'Match' control", async () => {
|
|
18
18
|
const { canvas, canvasElement } =
|
|
19
|
-
await mountStory(
|
|
19
|
+
await mountStory(Playground)
|
|
20
20
|
|
|
21
21
|
// One root group, so exactly one combinator picker. It is a
|
|
22
22
|
// `Listbox` trigger, so the control is a button that opens a
|
|
@@ -16,7 +16,7 @@ each option carries a real sentence and an in-line strip would wrap. Choosing be
|
|
|
16
16
|
is layout, not behaviour, which is why the keyboard model is identical and lives in the same
|
|
17
17
|
two hooks.
|
|
18
18
|
|
|
19
|
-
<Canvas of={RadioGroupStories.
|
|
19
|
+
<Canvas of={RadioGroupStories.Playground} />
|
|
20
20
|
|
|
21
21
|
## Props
|
|
22
22
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { playgroundParameters } from "@charcuterie/storybook-config/story-parameters"
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
2
3
|
|
|
3
4
|
import { controlSizeArgType } from "../argTypes.storyHelpers.ts"
|
|
@@ -98,7 +99,8 @@ export default meta
|
|
|
98
99
|
|
|
99
100
|
type Story = StoryObj<typeof meta>
|
|
100
101
|
|
|
101
|
-
export const
|
|
102
|
+
export const Playground: Story = {
|
|
103
|
+
parameters: playgroundParameters,
|
|
102
104
|
args: { items: NAMING_ITEMS, label: "Naming scheme" },
|
|
103
105
|
}
|
|
104
106
|
|
|
@@ -9,7 +9,7 @@ import * as stories from "./RadioGroup.stories.tsx"
|
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
AllStates,
|
|
12
|
-
|
|
12
|
+
Playground,
|
|
13
13
|
Interactive,
|
|
14
14
|
Responsive,
|
|
15
15
|
Tiles,
|
|
@@ -30,7 +30,7 @@ const getOptions = (group: HTMLElement) =>
|
|
|
30
30
|
|
|
31
31
|
test("it is a radio group with exactly one option checked", async () => {
|
|
32
32
|
const { canvas, canvasElement } =
|
|
33
|
-
await mountStory(
|
|
33
|
+
await mountStory(Playground)
|
|
34
34
|
|
|
35
35
|
const group = expectAgentDrivable(canvas, {
|
|
36
36
|
name: "Naming scheme",
|
package/src/Rail/Rail.mdx
CHANGED
|
@@ -9,7 +9,7 @@ import * as RailStories from "./Rail.stories";
|
|
|
9
9
|
A side column — the app's sections, a filter panel, the selected job's detail. `side` places
|
|
10
10
|
it, `landmark` decides what it is, and `label` is required.
|
|
11
11
|
|
|
12
|
-
<Canvas of={RailStories.
|
|
12
|
+
<Canvas of={RailStories.Playground} />
|
|
13
13
|
|
|
14
14
|
## Props
|
|
15
15
|
|