@charcuterie/ui 4.4.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/ActionTiles/ActionTiles.d.ts +2 -1
- package/dist/ActionTiles/ActionTiles.d.ts.map +1 -1
- package/dist/ActionTiles/ActionTiles.js +4 -2
- package/dist/ActionTiles/ActionTiles.js.map +1 -1
- 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 +3 -2
- 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 +7 -1
- package/src/ActionTiles/ActionTiles.stories.tsx +3 -1
- package/src/ActionTiles/ActionTiles.test.tsx +3 -3
- package/src/ActionTiles/ActionTiles.tsx +4 -2
- 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
|
@@ -9,7 +9,7 @@ import * as stories from "./MarkdownView.stories.tsx"
|
|
|
9
9
|
|
|
10
10
|
const {
|
|
11
11
|
AllStates,
|
|
12
|
-
|
|
12
|
+
Playground,
|
|
13
13
|
HostileMarkdown,
|
|
14
14
|
Interactive,
|
|
15
15
|
NestedLinkText,
|
|
@@ -26,7 +26,7 @@ const {
|
|
|
26
26
|
* there is the fix.
|
|
27
27
|
*/
|
|
28
28
|
test("there is no toolbar, not a hidden one", async () => {
|
|
29
|
-
const { canvas } = await mountStory(
|
|
29
|
+
const { canvas } = await mountStory(Playground)
|
|
30
30
|
|
|
31
31
|
await expect(canvas.queryAllByRole("toolbar")).toEqual([])
|
|
32
32
|
|
|
@@ -47,7 +47,7 @@ test("there is no toolbar, not a hidden one", async () => {
|
|
|
47
47
|
* asserted together.
|
|
48
48
|
*/
|
|
49
49
|
test("it is an article whose headings are headings", async () => {
|
|
50
|
-
const { canvas } = await mountStory(
|
|
50
|
+
const { canvas } = await mountStory(Playground)
|
|
51
51
|
|
|
52
52
|
const article = expectAgentDrivable(canvas, {
|
|
53
53
|
name: "Description",
|
|
@@ -86,12 +86,28 @@ test("it is an article whose headings are headings", async () => {
|
|
|
86
86
|
test("it renders what the editor renders", async () => {
|
|
87
87
|
const { canvas } = await mountStory(SameAsTheEditor)
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
// ⚠️ WAIT FOR THE COUNT, not for "a table".
|
|
90
|
+
//
|
|
91
|
+
// This test is the only one in the file that mounts a story with
|
|
92
|
+
// BOTH surfaces, so it is the only one that has to wait for
|
|
93
|
+
// CodeMirror. `MarkdownView` paints its table in the first commit;
|
|
94
|
+
// CodeMirror parses and decorates the document afterwards. A
|
|
95
|
+
// synchronous `getAllByRole("table")` therefore returned ONE table
|
|
96
|
+
// on a slow runner, `editorTable` was `undefined`, and the failure
|
|
97
|
+
// read "expected undefined to be defined" — which says nothing
|
|
98
|
+
// about the real cause (CI, 2026-09-14).
|
|
99
|
+
//
|
|
100
|
+
// ⚠️ A bare `findAllByRole` does NOT fix it. `findAllBy*` retries
|
|
101
|
+
// until the query matches AT LEAST ONE element, and one element is
|
|
102
|
+
// exactly the broken state: the view's table is there from the
|
|
103
|
+
// start. The count is the condition, so the count goes in the wait.
|
|
104
|
+
const [viewTable, editorTable] = await waitFor(() => {
|
|
105
|
+
const tables = canvas.getAllByRole("table")
|
|
106
|
+
|
|
107
|
+
expect(tables).toHaveLength(2)
|
|
108
|
+
|
|
109
|
+
return tables
|
|
110
|
+
})
|
|
95
111
|
|
|
96
112
|
const toCellText = (table: HTMLElement) =>
|
|
97
113
|
Array.from(table.querySelectorAll("th, td")).map(
|
|
@@ -103,10 +119,16 @@ test("it renders what the editor renders", async () => {
|
|
|
103
119
|
).toEqual(toCellText(editorTable as HTMLElement))
|
|
104
120
|
|
|
105
121
|
// Three task boxes in each, and the first one ticked in each.
|
|
106
|
-
|
|
107
|
-
|
|
122
|
+
// Same wait, same reason: CodeMirror's boxes arrive with its
|
|
123
|
+
// decorations, so a count taken too early sees only the view's.
|
|
124
|
+
const checkboxes = await waitFor(() => {
|
|
125
|
+
const boxes: HTMLInputElement[] =
|
|
126
|
+
canvas.getAllByRole("checkbox")
|
|
108
127
|
|
|
109
|
-
|
|
128
|
+
expect(boxes).toHaveLength(6)
|
|
129
|
+
|
|
130
|
+
return boxes
|
|
131
|
+
})
|
|
110
132
|
|
|
111
133
|
await expect(
|
|
112
134
|
checkboxes.filter((checkbox) => checkbox.checked),
|
|
@@ -114,11 +136,13 @@ test("it renders what the editor renders", async () => {
|
|
|
114
136
|
|
|
115
137
|
// The bare URL, autolinked on both sides with nothing typed
|
|
116
138
|
// around it.
|
|
117
|
-
await
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
139
|
+
await waitFor(() => {
|
|
140
|
+
expect(
|
|
141
|
+
canvas.getAllByText(
|
|
142
|
+
"https://example.invalid/product?id=1234",
|
|
143
|
+
),
|
|
144
|
+
).toHaveLength(2)
|
|
145
|
+
})
|
|
122
146
|
})
|
|
123
147
|
|
|
124
148
|
/**
|
|
@@ -265,7 +289,7 @@ test("hostile markdown renders as characters, not as behaviour", async () => {
|
|
|
265
289
|
* else noticing.
|
|
266
290
|
*/
|
|
267
291
|
test("the text can be selected", async () => {
|
|
268
|
-
const { canvas } = await mountStory(
|
|
292
|
+
const { canvas } = await mountStory(Playground)
|
|
269
293
|
|
|
270
294
|
const article = canvas.getByRole("article")
|
|
271
295
|
|
|
@@ -360,7 +384,7 @@ test.each([
|
|
|
360
384
|
* survives a change to the base font size.
|
|
361
385
|
*/
|
|
362
386
|
test("the document is set at prose leading", async () => {
|
|
363
|
-
const { canvas } = await mountStory(
|
|
387
|
+
const { canvas } = await mountStory(Playground)
|
|
364
388
|
|
|
365
389
|
const article = canvas.getByRole("article")
|
|
366
390
|
|
|
@@ -379,7 +403,7 @@ test("the document is set at prose leading", async () => {
|
|
|
379
403
|
* backticks comes out as a wall of emphasis nobody asked for.
|
|
380
404
|
*/
|
|
381
405
|
test("a code span is smaller than the prose it sits in", async () => {
|
|
382
|
-
const { canvas } = await mountStory(
|
|
406
|
+
const { canvas } = await mountStory(Playground)
|
|
383
407
|
|
|
384
408
|
const article = canvas.getByRole("article")
|
|
385
409
|
|
|
@@ -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 {
|
|
3
4
|
MemoryRouter,
|
|
@@ -92,7 +93,8 @@ const EpisodePage = () => (
|
|
|
92
93
|
* `TextLink` becomes a soft navigation and `Main` keeps the
|
|
93
94
|
* reader's place because `ReactRouterAdapter` is above them both.
|
|
94
95
|
*/
|
|
95
|
-
export const
|
|
96
|
+
export const Playground: Story = {
|
|
97
|
+
parameters: playgroundParameters,
|
|
96
98
|
render: () => (
|
|
97
99
|
<MemoryRouter initialEntries={["/library"]}>
|
|
98
100
|
<ReactRouterAdapter>
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "../viewport.testHelpers.ts"
|
|
12
12
|
import * as stories from "./ReactRouterAdapter.stories.tsx"
|
|
13
13
|
|
|
14
|
-
const {
|
|
14
|
+
const { Playground } = composeStories(stories)
|
|
15
15
|
|
|
16
16
|
// The offsets are module state, so they outlive a mount. A test
|
|
17
17
|
// must not.
|
|
@@ -33,7 +33,7 @@ afterEach(() => {
|
|
|
33
33
|
test("an app renders one component and gets both seams", async () => {
|
|
34
34
|
await setViewport(DESKTOP)
|
|
35
35
|
|
|
36
|
-
const { canvas } = await mountStory(
|
|
36
|
+
const { canvas } = await mountStory(Playground)
|
|
37
37
|
|
|
38
38
|
const main = canvas.getByRole("main")
|
|
39
39
|
|