@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.
Files changed (212) hide show
  1. package/README.md +7 -2
  2. package/dist/ActionTiles/ActionTiles.d.ts +2 -1
  3. package/dist/ActionTiles/ActionTiles.d.ts.map +1 -1
  4. package/dist/ActionTiles/ActionTiles.js +4 -2
  5. package/dist/ActionTiles/ActionTiles.js.map +1 -1
  6. package/dist/Card/Card.d.ts +5 -2
  7. package/dist/Card/Card.d.ts.map +1 -1
  8. package/dist/Card/Card.js +23 -3
  9. package/dist/Card/Card.js.map +1 -1
  10. package/package.json +3 -2
  11. package/src/Accordion/Accordion.mdx +1 -1
  12. package/src/Accordion/Accordion.stories.tsx +3 -1
  13. package/src/Accordion/Accordion.test.tsx +4 -4
  14. package/src/ActionTiles/ActionTiles.mdx +7 -1
  15. package/src/ActionTiles/ActionTiles.stories.tsx +3 -1
  16. package/src/ActionTiles/ActionTiles.test.tsx +3 -3
  17. package/src/ActionTiles/ActionTiles.tsx +4 -2
  18. package/src/AdaptiveGrid/AdaptiveGrid.mdx +1 -1
  19. package/src/AdaptiveGrid/AdaptiveGrid.stories.tsx +3 -1
  20. package/src/AdaptiveGrid/AdaptiveGrid.test.tsx +5 -5
  21. package/src/Alert/Alert.mdx +1 -1
  22. package/src/Alert/Alert.stories.tsx +3 -1
  23. package/src/Alert/Alert.test.tsx +2 -2
  24. package/src/Avatar/Avatar.mdx +1 -1
  25. package/src/Avatar/Avatar.stories.tsx +4 -1
  26. package/src/Avatar/Avatar.test.tsx +2 -2
  27. package/src/Badge/Badge.mdx +1 -1
  28. package/src/Badge/Badge.stories.tsx +3 -1
  29. package/src/Badge/Badge.test.tsx +3 -3
  30. package/src/BadgeButton/BadgeButton.mdx +1 -1
  31. package/src/BadgeButton/BadgeButton.stories.tsx +3 -1
  32. package/src/BadgeButton/BadgeButton.test.tsx +2 -2
  33. package/src/Board/Board.mdx +1 -1
  34. package/src/Board/Board.stories.tsx +4 -1
  35. package/src/Board/Board.test.tsx +2 -2
  36. package/src/Button/Button.mdx +1 -1
  37. package/src/Button/Button.stories.tsx +3 -1
  38. package/src/Button/Button.test.tsx +2 -2
  39. package/src/ButtonLink/ButtonLink.mdx +1 -1
  40. package/src/ButtonLink/ButtonLink.stories.tsx +3 -1
  41. package/src/ButtonLink/ButtonLink.test.tsx +3 -3
  42. package/src/Card/Card.mdx +21 -1
  43. package/src/Card/Card.stories.tsx +91 -1
  44. package/src/Card/Card.test.tsx +60 -3
  45. package/src/Card/Card.tsx +24 -2
  46. package/src/Checkbox/Checkbox.mdx +1 -1
  47. package/src/Checkbox/Checkbox.stories.tsx +3 -1
  48. package/src/Checkbox/Checkbox.test.tsx +4 -4
  49. package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.mdx +1 -1
  50. package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.stories.tsx +3 -1
  51. package/src/ColorSchemeSwitcher/ColorSchemeSwitcher.test.tsx +5 -5
  52. package/src/ColorSchemeToggle/ColorSchemeToggle.mdx +1 -1
  53. package/src/ColorSchemeToggle/ColorSchemeToggle.stories.tsx +3 -1
  54. package/src/ColorSchemeToggle/ColorSchemeToggle.test.tsx +5 -5
  55. package/src/Combobox/Combobox.mdx +1 -1
  56. package/src/Combobox/Combobox.stories.tsx +3 -1
  57. package/src/Combobox/Combobox.test.tsx +2 -2
  58. package/src/CopyButton/CopyButton.mdx +1 -1
  59. package/src/CopyButton/CopyButton.stories.tsx +4 -1
  60. package/src/CopyButton/CopyButton.test.tsx +3 -3
  61. package/src/DataTable/DataTable.mdx +1 -1
  62. package/src/DataTable/DataTable.stories.tsx +3 -1
  63. package/src/DataTable/DataTable.test.tsx +3 -3
  64. package/src/DatePicker/DatePicker.mdx +1 -1
  65. package/src/DatePicker/DatePicker.stories.tsx +3 -1
  66. package/src/DatePicker/DatePicker.test.tsx +3 -3
  67. package/src/DatePicker/plainDate.test.ts +21 -3
  68. package/src/Dialog/Dialog.mdx +1 -1
  69. package/src/Dialog/Dialog.stories.tsx +3 -1
  70. package/src/Dialog/Dialog.test.tsx +2 -2
  71. package/src/DropRail/DropRail.mdx +1 -1
  72. package/src/DropRail/DropRail.stories.tsx +4 -1
  73. package/src/DropRail/DropRail.test.tsx +4 -4
  74. package/src/EmptyState/EmptyState.mdx +1 -1
  75. package/src/EmptyState/EmptyState.stories.tsx +3 -1
  76. package/src/EmptyState/EmptyState.test.tsx +2 -2
  77. package/src/Field/Field.mdx +1 -1
  78. package/src/Field/Field.stories.tsx +3 -1
  79. package/src/Field/Field.test.tsx +4 -4
  80. package/src/FileDropZone/FileDropZone.mdx +1 -1
  81. package/src/FileDropZone/FileDropZone.stories.tsx +3 -1
  82. package/src/FileDropZone/FileDropZone.test.tsx +3 -3
  83. package/src/Header/Header.mdx +1 -1
  84. package/src/Header/Header.stories.tsx +3 -1
  85. package/src/IconButton/IconButton.mdx +1 -1
  86. package/src/IconButton/IconButton.stories.tsx +3 -1
  87. package/src/IconButton/IconButton.test.tsx +2 -2
  88. package/src/Lightbox/Lightbox.mdx +1 -1
  89. package/src/Lightbox/Lightbox.stories.tsx +3 -1
  90. package/src/Lightbox/Lightbox.test.tsx +2 -2
  91. package/src/Listbox/Listbox.mdx +1 -1
  92. package/src/Listbox/Listbox.stories.tsx +3 -1
  93. package/src/Listbox/Listbox.test.tsx +5 -5
  94. package/src/LiveStatusIndicator/LiveStatusIndicator.mdx +1 -1
  95. package/src/LiveStatusIndicator/LiveStatusIndicator.stories.tsx +3 -1
  96. package/src/LiveStatusIndicator/LiveStatusIndicator.test.tsx +2 -2
  97. package/src/LogViewer/LogViewer.mdx +1 -1
  98. package/src/LogViewer/LogViewer.stories.tsx +3 -1
  99. package/src/LogViewer/LogViewer.test.tsx +2 -2
  100. package/src/Main/Main.mdx +1 -1
  101. package/src/Main/Main.stories.tsx +3 -1
  102. package/src/Main/Main.test.tsx +3 -3
  103. package/src/MarkdownEditor/MarkdownEditor.mdx +1 -1
  104. package/src/MarkdownEditor/MarkdownEditor.stories.tsx +3 -1
  105. package/src/MarkdownEditor/MarkdownEditor.test.tsx +4 -4
  106. package/src/MarkdownLine/MarkdownLine.mdx +1 -1
  107. package/src/MarkdownLine/MarkdownLine.stories.tsx +4 -1
  108. package/src/MarkdownLine/MarkdownLine.test.tsx +3 -3
  109. package/src/MediaTile/MediaTile.stories.tsx +3 -1
  110. package/src/MediaTile/MediaTile.test.tsx +2 -2
  111. package/src/Menu/Menu.mdx +1 -1
  112. package/src/Menu/Menu.stories.tsx +3 -1
  113. package/src/Modal/Modal.mdx +1 -1
  114. package/src/Modal/Modal.stories.tsx +3 -1
  115. package/src/Modal/Modal.test.tsx +3 -3
  116. package/src/Nav/Nav.mdx +1 -1
  117. package/src/Nav/Nav.stories.tsx +3 -1
  118. package/src/Nav/Nav.test.tsx +6 -6
  119. package/src/NavBar/NavBar.mdx +1 -1
  120. package/src/NavBar/NavBar.stories.tsx +3 -1
  121. package/src/NavBar/NavBar.test.tsx +3 -3
  122. package/src/Picker/Picker.mdx +1 -1
  123. package/src/Picker/Picker.stories.tsx +3 -1
  124. package/src/Picker/Picker.test.tsx +2 -2
  125. package/src/Popover/Popover.mdx +1 -1
  126. package/src/Popover/Popover.stories.tsx +3 -1
  127. package/src/Popover/Popover.test.tsx +2 -2
  128. package/src/PortraitTiles/PortraitTiles.mdx +1 -1
  129. package/src/PortraitTiles/PortraitTiles.stories.tsx +3 -1
  130. package/src/PortraitTiles/PortraitTiles.test.tsx +5 -5
  131. package/src/ProgressBar/ProgressBar.mdx +1 -1
  132. package/src/ProgressBar/ProgressBar.stories.tsx +3 -1
  133. package/src/ProgressBar/ProgressBar.test.tsx +2 -2
  134. package/src/QueryBuilder/QueryBuilder.mdx +1 -1
  135. package/src/QueryBuilder/QueryBuilder.stories.tsx +3 -1
  136. package/src/QueryBuilder/QueryBuilder.test.tsx +2 -2
  137. package/src/RadioGroup/RadioGroup.mdx +1 -1
  138. package/src/RadioGroup/RadioGroup.stories.tsx +3 -1
  139. package/src/RadioGroup/RadioGroup.test.tsx +2 -2
  140. package/src/Rail/Rail.mdx +1 -1
  141. package/src/Rail/Rail.stories.tsx +3 -1
  142. package/src/Rail/Rail.test.tsx +2 -2
  143. package/src/RangeSlider/RangeSlider.mdx +1 -1
  144. package/src/RangeSlider/RangeSlider.stories.tsx +3 -1
  145. package/src/RangeSlider/RangeSlider.test.tsx +7 -3
  146. package/src/ReorderList/ReorderList.mdx +1 -1
  147. package/src/ReorderList/ReorderList.stories.tsx +3 -1
  148. package/src/ReorderList/ReorderList.test.tsx +7 -7
  149. package/src/RouterLink/UnstyledLink.stories.tsx +4 -1
  150. package/src/RouterLink/UnstyledLink.test.tsx +2 -2
  151. package/src/SearchInput/SearchInput.mdx +1 -1
  152. package/src/SearchInput/SearchInput.stories.tsx +3 -1
  153. package/src/SegmentedControl/SegmentedControl.mdx +1 -1
  154. package/src/SegmentedControl/SegmentedControl.stories.tsx +3 -1
  155. package/src/SegmentedControl/SegmentedControl.test.tsx +2 -2
  156. package/src/Select/Select.mdx +1 -1
  157. package/src/Select/Select.stories.tsx +3 -1
  158. package/src/Select/Select.test.tsx +4 -4
  159. package/src/Shell/Shell.mdx +1 -1
  160. package/src/Shell/Shell.stories.tsx +3 -1
  161. package/src/Shell/Shell.test.tsx +2 -2
  162. package/src/Skeleton/Skeleton.mdx +1 -1
  163. package/src/Skeleton/Skeleton.stories.tsx +3 -1
  164. package/src/Skeleton/Skeleton.test.tsx +2 -2
  165. package/src/Slider/Slider.mdx +1 -1
  166. package/src/Slider/Slider.stories.tsx +3 -1
  167. package/src/Slider/Slider.test.tsx +2 -2
  168. package/src/SortableTableHeader/SortableTableHeader.mdx +1 -1
  169. package/src/SortableTableHeader/SortableTableHeader.stories.tsx +3 -1
  170. package/src/SortableTableHeader/SortableTableHeader.test.tsx +3 -3
  171. package/src/Spinner/Spinner.mdx +1 -1
  172. package/src/Spinner/Spinner.stories.tsx +3 -1
  173. package/src/Spinner/Spinner.test.tsx +2 -2
  174. package/src/Stepper/Stepper.mdx +1 -1
  175. package/src/Stepper/Stepper.stories.tsx +4 -1
  176. package/src/Stepper/Stepper.test.tsx +7 -7
  177. package/src/Swatch/Swatch.mdx +1 -1
  178. package/src/Swatch/Swatch.stories.tsx +4 -1
  179. package/src/Swatch/Swatch.test.tsx +3 -3
  180. package/src/Switch/Switch.mdx +1 -1
  181. package/src/Switch/Switch.stories.tsx +3 -1
  182. package/src/Switch/Switch.test.tsx +2 -2
  183. package/src/Tabs/Tabs.mdx +1 -1
  184. package/src/Tabs/Tabs.stories.tsx +3 -1
  185. package/src/Tabs/Tabs.test.tsx +3 -3
  186. package/src/TextLink/TextLink.mdx +1 -1
  187. package/src/TextLink/TextLink.stories.tsx +3 -1
  188. package/src/TextLink/TextLink.test.tsx +4 -4
  189. package/src/TimecodeInput/TimecodeInput.mdx +1 -1
  190. package/src/TimecodeInput/TimecodeInput.stories.tsx +3 -1
  191. package/src/Toast/Toast.mdx +1 -1
  192. package/src/Toast/Toast.stories.tsx +3 -1
  193. package/src/Toast/Toast.test.tsx +2 -2
  194. package/src/Toolbar/Toolbar.mdx +1 -1
  195. package/src/Toolbar/Toolbar.stories.tsx +3 -1
  196. package/src/Toolbar/Toolbar.test.tsx +5 -5
  197. package/src/Tooltip/Tooltip.mdx +1 -1
  198. package/src/Tooltip/Tooltip.stories.tsx +3 -1
  199. package/src/Tooltip/Tooltip.test.tsx +2 -2
  200. package/src/VirtualizedGrid/VirtualizedGrid.mdx +1 -1
  201. package/src/VirtualizedGrid/VirtualizedGrid.stories.tsx +4 -1
  202. package/src/VirtualizedGrid/VirtualizedGrid.test.tsx +5 -5
  203. package/src/VisuallyHidden/VisuallyHidden.mdx +1 -1
  204. package/src/VisuallyHidden/VisuallyHidden.stories.tsx +3 -1
  205. package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.mdx +1 -1
  206. package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.stories.tsx +3 -1
  207. package/src/markdownEditorCodeMirror/MarkdownEditorCodeMirror.test.tsx +3 -3
  208. package/src/markdownEditorCodeMirror/MarkdownView.mdx +1 -1
  209. package/src/markdownEditorCodeMirror/MarkdownView.stories.tsx +4 -1
  210. package/src/markdownEditorCodeMirror/MarkdownView.test.tsx +44 -20
  211. package/src/reactRouter/ReactRouterAdapter.stories.tsx +3 -1
  212. 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
- Default,
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(Default)
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(Default)
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
- const [viewTable, editorTable] =
90
- canvas.getAllByRole("table")
91
-
92
- await expect(viewTable).toBeDefined()
93
-
94
- await expect(editorTable).toBeDefined()
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
- const checkboxes: HTMLInputElement[] =
107
- canvas.getAllByRole("checkbox")
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
- await expect(checkboxes).toHaveLength(6)
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 expect(
118
- canvas.getAllByText(
119
- "https://example.invalid/product?id=1234",
120
- ).length,
121
- ).toBe(2)
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(Default)
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(Default)
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(Default)
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 Default: Story = {
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 { Default } = composeStories(stories)
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(Default)
36
+ const { canvas } = await mountStory(Playground)
37
37
 
38
38
  const main = canvas.getByRole("main")
39
39