@charcuterie/ui 4.5.0 → 4.6.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/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/dist/Overlay/OverlayPanel.d.ts.map +1 -1
- package/dist/Overlay/OverlayPanel.js +54 -2
- package/dist/Overlay/OverlayPanel.js.map +1 -1
- package/dist/Overlay/OverlayStack.d.ts +5 -0
- package/dist/Overlay/OverlayStack.d.ts.map +1 -1
- package/dist/Overlay/OverlayStack.js +2 -0
- package/dist/Overlay/OverlayStack.js.map +1 -1
- package/dist/Toast/ToastRegion.d.ts +61 -0
- package/dist/Toast/ToastRegion.d.ts.map +1 -1
- package/dist/Toast/ToastRegion.js +80 -3
- package/dist/Toast/ToastRegion.js.map +1 -1
- package/dist/Toolbar/useToolbarOverflow.d.ts.map +1 -1
- package/dist/Toolbar/useToolbarOverflow.js +39 -0
- package/dist/Toolbar/useToolbarOverflow.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 +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/Overlay/OverlayPanel.tsx +63 -2
- package/src/Overlay/OverlayStack.tsx +7 -1
- 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 +157 -1
- package/src/Toast/Toast.test.tsx +2 -2
- package/src/Toast/ToastRegion.test.tsx +172 -0
- package/src/Toast/ToastRegion.tsx +120 -32
- package/src/Toolbar/Toolbar.mdx +1 -1
- package/src/Toolbar/Toolbar.stories.tsx +3 -1
- package/src/Toolbar/Toolbar.test.tsx +89 -5
- package/src/Toolbar/useToolbarOverflow.ts +43 -0
- 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
package/README.md
CHANGED
|
@@ -284,8 +284,13 @@ rename breaks only the rendered page).
|
|
|
284
284
|
([decision](../../docs/decisions/2026-08-21-a-deprecation-is-a-badge-in-place-and-the-sidebar-has-groups.md)).
|
|
285
285
|
2. Colours from `intentStyles.ts`, sizes from `controlStyles.ts`. No hex, no `*-slate-*`
|
|
286
286
|
(a test checks).
|
|
287
|
-
3. The five stories: `
|
|
288
|
-
widths, via `ContainerBoard`), `Interactive` (the complete keyboard path).
|
|
287
|
+
3. The five stories: `Playground`, `AllVariants`, `AllStates`, `Responsive` (three
|
|
288
|
+
container widths, via `ContainerBoard`), `Interactive` (the complete keyboard path).
|
|
289
|
+
**`Playground` is the only one that carries `parameters: playgroundParameters`.** The
|
|
290
|
+
addon panel is closed on every story in this Storybook, and that line is how the one
|
|
291
|
+
story whose `args` drive a single instance opens it again. The other four render their
|
|
292
|
+
own matrix, so a control moves at most one cell of the board
|
|
293
|
+
([decision](../../docs/decisions/2026-09-13-the-addon-panel-is-closed-except-on-the-playground-story.md)).
|
|
289
294
|
4. Export from `src/index.ts` — the one sanctioned barrel. Components import each other
|
|
290
295
|
directly, never through it.
|
|
291
296
|
5. **If it is an overlay, portal it to the body** — `FloatingPortal`, through
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -41,7 +41,10 @@ export declare const ELEVATION_CLASS: Record<ElevationStep, string>;
|
|
|
41
41
|
*
|
|
42
42
|
* `aria-labelledby` rather than `aria-label`, because the heading is
|
|
43
43
|
* on screen already and stating the name twice is how the two drift
|
|
44
|
-
* apart.
|
|
44
|
+
* apart. A card with **no** `heading` keeps the `aria-labelledby`
|
|
45
|
+
* the call site passed, for the app that draws its own title row
|
|
46
|
+
* inside the card — the name still points at text on screen, which
|
|
47
|
+
* is the same rule one level out.
|
|
45
48
|
*
|
|
46
49
|
* **Density is not a prop here.** mux-magic's inventory turned up a
|
|
47
50
|
* `CardDensityProvider` in the withdrawn bambuddy evidence, and it
|
|
@@ -51,5 +54,5 @@ export declare const ELEVATION_CLASS: Record<ElevationStep, string>;
|
|
|
51
54
|
* because a card wrapping a poster grid genuinely has none, which is
|
|
52
55
|
* a layout fact rather than a density one.
|
|
53
56
|
*/
|
|
54
|
-
export declare const Card: ({ accentEdge, actions, children, className, elevation, footer, heading, headingLevel, padding, style, surface, ...sectionProps }: CardProps) => ReactNode;
|
|
57
|
+
export declare const Card: ({ "aria-labelledby": ariaLabelledBy, accentEdge, actions, children, className, elevation, footer, heading, headingLevel, padding, style, surface, ...sectionProps }: CardProps) => ReactNode;
|
|
55
58
|
//# sourceMappingURL=Card.d.ts.map
|
package/dist/Card/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EACZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAMzD,MAAM,MAAM,WAAW,GAAG,OAAO,CAC/B,WAAW,EACX,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAC7B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;AAErD,MAAM,MAAM,SAAS,GAAG,qBAAqB,CAAC,SAAS,CAAC,GAAG;IACzD;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,uDAAuD;IACvD,OAAO,CAAC,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;AAQD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,aAAa,EACb,MAAM,CAMP,CAAA;AASD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,IAAI,GAAI,qKAclB,SAAS,KAAG,SAqFd,CAAA"}
|
package/dist/Card/Card.js
CHANGED
|
@@ -36,7 +36,10 @@ const PADDING_CLASS = {
|
|
|
36
36
|
*
|
|
37
37
|
* `aria-labelledby` rather than `aria-label`, because the heading is
|
|
38
38
|
* on screen already and stating the name twice is how the two drift
|
|
39
|
-
* apart.
|
|
39
|
+
* apart. A card with **no** `heading` keeps the `aria-labelledby`
|
|
40
|
+
* the call site passed, for the app that draws its own title row
|
|
41
|
+
* inside the card — the name still points at text on screen, which
|
|
42
|
+
* is the same rule one level out.
|
|
40
43
|
*
|
|
41
44
|
* **Density is not a prop here.** mux-magic's inventory turned up a
|
|
42
45
|
* `CardDensityProvider` in the withdrawn bambuddy evidence, and it
|
|
@@ -46,7 +49,7 @@ const PADDING_CLASS = {
|
|
|
46
49
|
* because a card wrapping a poster grid genuinely has none, which is
|
|
47
50
|
* a layout fact rather than a density one.
|
|
48
51
|
*/
|
|
49
|
-
export const Card = ({ accentEdge, actions, children, className, elevation = "low", footer, heading, headingLevel = 2, padding = "md", style, surface = "raised", ...sectionProps }) => {
|
|
52
|
+
export const Card = ({ "aria-labelledby": ariaLabelledBy, accentEdge, actions, children, className, elevation = "low", footer, heading, headingLevel = 2, padding = "md", style, surface = "raised", ...sectionProps }) => {
|
|
50
53
|
const headingId = useUniqueId();
|
|
51
54
|
// The caller's own `style` wins. An accent colour is one custom
|
|
52
55
|
// property, and silently dropping whatever else the call site set
|
|
@@ -57,8 +60,25 @@ export const Card = ({ accentEdge, actions, children, className, elevation = "lo
|
|
|
57
60
|
const mergedStyle = accentEdgeStyle == null
|
|
58
61
|
? style
|
|
59
62
|
: { ...accentEdgeStyle, ...style };
|
|
63
|
+
// The caller's own pointer is the FALLBACK, not the loser. This
|
|
64
|
+
// attribute is written *after* the spread, so `undefined` here
|
|
65
|
+
// does not mean "leave whatever the call site passed": it
|
|
66
|
+
// overwrites it, React then drops the attribute entirely, and the
|
|
67
|
+
// card's accessible name falls back to its whole subtree with
|
|
68
|
+
// nothing failing — not typecheck, not axe, not a render. A
|
|
69
|
+
// `role="button"` tile in mail-sifter naming itself
|
|
70
|
+
// `aria-labelledby="recent-tile-heading"` announced as "Recent
|
|
71
|
+
// Mail 6 40 arrived in the last 24 hours, 34 done".
|
|
72
|
+
//
|
|
73
|
+
// `heading` still wins when it is given, because that is the name
|
|
74
|
+
// the reader can see and this component renders it. Do not
|
|
75
|
+
// "simplify" this back to a ternary ending in `undefined`.
|
|
76
|
+
//
|
|
77
|
+
// `aria-label` needs no equivalent: the component never writes
|
|
78
|
+
// one, so the spread carries the caller's through untouched.
|
|
79
|
+
const labelledById = heading ? headingId : ariaLabelledBy;
|
|
60
80
|
const Heading = `h${headingLevel}`;
|
|
61
|
-
return (_jsxs("section", { ...sectionProps, "aria-labelledby":
|
|
81
|
+
return (_jsxs("section", { ...sectionProps, "aria-labelledby": labelledById, className: toClassName(
|
|
62
82
|
// `@container` here, not on a wrapper, is what lets the
|
|
63
83
|
// header stack at narrow widths *inside a wide viewport* —
|
|
64
84
|
// a card in a sidebar and the same card full-bleed are the
|
package/dist/Card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAUhD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EACL,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AA8B5B,MAAM,aAAa,GAAgC;IACjD,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,mBAAmB;IAC3B,MAAM,EAAE,mBAAmB;CAC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,CACT,KAAC,OAAO,IACN,SAAS,EAAC,qCAAqC,EAC/C,EAAE,EAAE,SAAS,YAEZ,OAAO,GACA,CACX,CAAC,CAAC,CAAC,IAAI,EAEP,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,SAAS,EAAC,kCAAkC,YAC9C,OAAO,GACJ,CACP,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAC,CAAC,CAAC,IAAI,EAEP,QAAQ,EAER,MAAM,CAAC,CAAC,CAAC,CACR,iBAAQ,SAAS,EAAC,mEAAmE,YAClF,MAAM,GACA,CACV,CAAC,CAAC,CAAC,IAAI,IACA,CACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPanel.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayPanel.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC5C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,6IAU1B,iBAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"OverlayPanel.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayPanel.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC5C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,6IAU1B,iBAAiB,KAAG,SAuLtB,CAAA"}
|
|
@@ -30,11 +30,46 @@ export const OverlayPanel = ({ "aria-label": ariaLabel, "aria-labelledby": ariaL
|
|
|
30
30
|
// `outsidePress` on a *lower* modal would close it too, so it is
|
|
31
31
|
// scoped to the top — which is also why the scrim needs no click
|
|
32
32
|
// handler of its own.
|
|
33
|
-
outsidePress:
|
|
33
|
+
outsidePress: (event) => {
|
|
34
|
+
if (!isDismissable || !isTop)
|
|
35
|
+
return false;
|
|
36
|
+
/*
|
|
37
|
+
* ⚠️ A press on a toast is NOT an outside press.
|
|
38
|
+
*
|
|
39
|
+
* A `ToastRegion` renders in the page, so floating-ui sees a
|
|
40
|
+
* press on its Undo as a press outside the floating element
|
|
41
|
+
* — and closing the modal on the way to taking an action
|
|
42
|
+
* back is the opposite of what the button says. The region
|
|
43
|
+
* marks itself with `data-charcuterie-toast-region`; nothing
|
|
44
|
+
* else in the fleet carries that attribute.
|
|
45
|
+
*
|
|
46
|
+
* ⚠️ Do not delete this on the evidence of a small story.
|
|
47
|
+
* floating-ui has a *second*, accidental guard that hides
|
|
48
|
+
* this one: `closeOnPressOutside` bails out early when the
|
|
49
|
+
* press target's body-level ancestor contains none of the
|
|
50
|
+
* `[data-floating-ui-inert]` markers `markOthers` left
|
|
51
|
+
* behind, on the theory that such an element was injected
|
|
52
|
+
* after the panel opened. A page that is nothing but a
|
|
53
|
+
* region takes that branch and never reaches this predicate
|
|
54
|
+
* at all. A page with content beside the region — every real
|
|
55
|
+
* app — does reach it. `Toast.stories.tsx`'s
|
|
56
|
+
* `OverStackedModals` carries a heading and a paragraph for
|
|
57
|
+
* exactly that reason, and `ToastRegion.test.tsx` fails
|
|
58
|
+
* without this predicate only because they are there.
|
|
59
|
+
*/
|
|
60
|
+
const target = event.target;
|
|
61
|
+
return (target?.closest?.("[data-charcuterie-toast-region]") == null);
|
|
62
|
+
},
|
|
34
63
|
}),
|
|
35
64
|
useRole(context, { role }),
|
|
36
65
|
]);
|
|
37
66
|
const { register, unregister } = stack;
|
|
67
|
+
/**
|
|
68
|
+
* Where this panel sits in the stack, and therefore how far above
|
|
69
|
+
* `--layer-modal` it paints. `0` when unprovided — a lone `Modal`
|
|
70
|
+
* is the only thing open.
|
|
71
|
+
*/
|
|
72
|
+
const stackIndex = Math.max(stack.orderedIds.indexOf(id), 0);
|
|
38
73
|
useEffect(() => {
|
|
39
74
|
if (!isVisible) {
|
|
40
75
|
return;
|
|
@@ -58,7 +93,24 @@ export const OverlayPanel = ({ "aria-label": ariaLabel, "aria-labelledby": ariaL
|
|
|
58
93
|
if (!isVisible) {
|
|
59
94
|
return null;
|
|
60
95
|
}
|
|
61
|
-
return (_jsxs(_Fragment, { children: [stack.isProvided ? null : (_jsx(SharedBackdrop, { isVisible: true })), _jsx(FloatingPortal, { children: _jsx("div", { className: "fixed inset-0
|
|
96
|
+
return (_jsxs(_Fragment, { children: [stack.isProvided ? null : (_jsx(SharedBackdrop, { isVisible: true })), _jsx(FloatingPortal, { children: _jsx("div", { className: "fixed inset-0 flex items-center justify-center",
|
|
97
|
+
/*
|
|
98
|
+
* ⚠️ Cascading, not one shared layer.
|
|
99
|
+
*
|
|
100
|
+
* Every panel used to render at the one `--layer-modal`, and
|
|
101
|
+
* which of two open modals painted on top fell out of the
|
|
102
|
+
* order their portals happened to be appended in. A modal
|
|
103
|
+
* opened from inside another is the case that made this
|
|
104
|
+
* visible. The index in the stack is the answer the stack
|
|
105
|
+
* already knows.
|
|
106
|
+
*
|
|
107
|
+
* The scale's gaps are 100, so a cascade this deep is
|
|
108
|
+
* arithmetic nobody has to think about — and the toast sits
|
|
109
|
+
* at `--layer-toast` plus the same depth, above all of it.
|
|
110
|
+
*/
|
|
111
|
+
style: {
|
|
112
|
+
zIndex: `calc(var(--layer-modal) + ${stackIndex})`,
|
|
113
|
+
}, children: _jsx(FloatingFocusManager, { context: context,
|
|
62
114
|
// `undefined` keeps the manager's own default (the first
|
|
63
115
|
// tabbable), so nothing changes for a panel that does not
|
|
64
116
|
// ask.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPanel.js","sourceRoot":"","sources":["../../src/Overlay/OverlayPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,WAAW,GACZ,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,OAAO,GACR,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAoB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;AA6DrD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,QAAQ,E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AC;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC,CAAA;IAE1C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,8BAGG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACzB,KAAC,cAAc,IAAC,SAAS,SAAG,CAC7B,EAED,KAAC,cAAc,cACb,cACE,SAAS,EAAC,gDAAgD;oBAC1D;;;;;;;;;;;;;uBAaG;oBACH,KAAK,EAAE;wBACL,MAAM,EAAE,6BAA6B,UAAU,GAAG;qBACnD,YAED,KAAC,oBAAoB,IACnB,OAAO,EAAE,OAAO;wBAChB,yDAAyD;wBACzD,0DAA0D;wBAC1D,OAAO;wBACP,YAAY,EAAE,YAAY,IAAI,SAAS;wBACvC,qDAAqD;wBACrD,mDAAmD;wBACnD,QAAQ,EAAE,CAAC,KAAK,EAChB,KAAK,kBAEL,iBACM,gBAAgB,EAAE,EAOpB,YAAY,EAAE,SAAS;4BACvB,iBAAiB,EAAE,cAAc,EAEnC,SAAS,EAAE,SAAS;4BACpB,0DAA0D;4BAC1D,0DAA0D;4BAC1D,sDAAsD;4BACtD,kDAAkD;4BAClD,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAC/B,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,IAAI,EAAE,IAAI,YAET,QAAQ,GACL,GACe,GACnB,GACS,IAChB,CACJ,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -28,6 +28,11 @@ export type OverlayStackEntry = {
|
|
|
28
28
|
};
|
|
29
29
|
export type OverlayStackValue = {
|
|
30
30
|
depth: number;
|
|
31
|
+
/**
|
|
32
|
+
* The open ids, oldest first. A panel reads its own index out of
|
|
33
|
+
* this to cascade its z-index above the one below it.
|
|
34
|
+
*/
|
|
35
|
+
orderedIds: string[];
|
|
31
36
|
/**
|
|
32
37
|
* `false` in the context default. An `OverlayPanel` reads this to
|
|
33
38
|
* decide whether to render its own scrim (unprovided) or defer to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayStack.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC5C,sEAAsE;IACtE,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;IACpB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,CAAA;
|
|
1
|
+
{"version":3,"file":"OverlayStack.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAWtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC5C,sEAAsE;IACtE,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;IACpB,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CACjC,CAAA;AAeD,eAAO,MAAM,eAAe,QAAO,iBACF,CAAA;AAEjC,eAAO,MAAM,oBAAoB,GAAI,eAElC;IACD,QAAQ,EAAE,SAAS,CAAA;CACpB,KAAG,SAyDH,CAAA"}
|
|
@@ -5,6 +5,7 @@ import { SharedBackdrop } from "./SharedBackdrop.js";
|
|
|
5
5
|
const DEFAULT_STACK = {
|
|
6
6
|
depth: 0,
|
|
7
7
|
isProvided: false,
|
|
8
|
+
orderedIds: [],
|
|
8
9
|
register: () => { },
|
|
9
10
|
requestCloseTop: () => { },
|
|
10
11
|
topId: null,
|
|
@@ -36,6 +37,7 @@ export const OverlayStackProvider = ({ children, }) => {
|
|
|
36
37
|
const value = useMemo(() => ({
|
|
37
38
|
depth: entries.length,
|
|
38
39
|
isProvided: true,
|
|
40
|
+
orderedIds: entries.map((one) => one.id),
|
|
39
41
|
register,
|
|
40
42
|
requestCloseTop,
|
|
41
43
|
topId: entries.at(-1)?.id ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayStack.js","sourceRoot":"","sources":["../../src/Overlay/OverlayStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"OverlayStack.js","sourceRoot":"","sources":["../../src/Overlay/OverlayStack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,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which is why `Toast` owns that and nothing more.
|
|
48
48
|
*
|
|
49
|
+
* ### It is the top of the layer scale, and it moves to stay there
|
|
50
|
+
*
|
|
51
|
+
* ⚠️ The container was `z-50` — a hand-picked number, in the library
|
|
52
|
+
* whose whole point is that nobody picks one. It is
|
|
53
|
+
* `--layer-toast` now, the top of the scale, above `--layer-tooltip`.
|
|
54
|
+
* The owner's rule: *"I think toast should always exist on top of
|
|
55
|
+
* everything."*
|
|
56
|
+
*
|
|
57
|
+
* The open panels cascade — a modal over a modal paints at
|
|
58
|
+
* `--layer-modal + n` — so the depth is added here too, and the
|
|
59
|
+
* toast clears the whole stack rather than only its first floor.
|
|
60
|
+
* Both numbers come off `useOverlayStack`, so the ordering is
|
|
61
|
+
* arithmetic rather than portal-append order.
|
|
62
|
+
*
|
|
63
|
+
* ### Painting on top is only half of "on top"
|
|
64
|
+
*
|
|
65
|
+
* ⚠️ A press on a toast while a `Modal` is open is an **outside**
|
|
66
|
+
* press as far as floating-ui is concerned, and `useDismiss` would
|
|
67
|
+
* close the modal on the way to taking an action back. That is why
|
|
68
|
+
* the container carries `data-charcuterie-toast-region`:
|
|
69
|
+
* `OverlayPanel`'s `outsidePress` reads it and lets the press
|
|
70
|
+
* through. Nothing else in the fleet carries that attribute.
|
|
71
|
+
*
|
|
72
|
+
* ⚠️ Do **not** move this region inside the panel's portal to solve
|
|
73
|
+
* that. Two reasons, both measured. `FloatingFocusManager`'s `modal`
|
|
74
|
+
* already leaves it alone — `markOthers` concatenates
|
|
75
|
+
* `body.querySelectorAll('[aria-live],[role="status"],output')` onto
|
|
76
|
+
* its keep-list, and this region is a `role="status"`, so it is
|
|
77
|
+
* never marked `aria-hidden` where it stands. And the panel's
|
|
78
|
+
* container sets a z-index, so a region nested inside it would be
|
|
79
|
+
* trapped in that stacking context and lose to the *next* modal
|
|
80
|
+
* however high `--layer-toast` climbs.
|
|
81
|
+
*
|
|
49
82
|
* ### `pointer-events-none` on the container, `auto` on each toast
|
|
50
83
|
*
|
|
51
84
|
* A fixed overlay across the bottom of the viewport swallows every
|
|
52
85
|
* click in that band, including on the app behind it, and it does so
|
|
53
86
|
* invisibly. The container passes clicks through and each toast
|
|
54
87
|
* takes them back.
|
|
88
|
+
*
|
|
89
|
+
* The list keeps `pointer-events: none` and still scrolls: a wheel
|
|
90
|
+
* event over a toast chains to the nearest scrollable **ancestor**,
|
|
91
|
+
* which is the list, and hit-testing never has to reach it.
|
|
92
|
+
*
|
|
93
|
+
* ### Many at once, and the newest is the one you can see
|
|
94
|
+
*
|
|
95
|
+
* The column grows upward from the bottom of the viewport, so
|
|
96
|
+
* without a bound the oldest toasts climb off the top of the page —
|
|
97
|
+
* clipped by the viewport, and unreachable, because a fixed element
|
|
98
|
+
* is not something the page can scroll to. The list is capped at
|
|
99
|
+
* `min(60dvh, 32rem)` and scrolls `overscroll-contain`, so the page
|
|
100
|
+
* behind never moves because a notification arrived. The owner's
|
|
101
|
+
* rule: *"if you have multiple toasts, it should accomodate them
|
|
102
|
+
* somehow."*
|
|
103
|
+
*
|
|
104
|
+
* ⚠️ Bottom-pinned with `margin-block-start: auto` on the first
|
|
105
|
+
* toast, **not** `justify-content: flex-end`. Measured in chromium:
|
|
106
|
+
* with `justify-end` an overflowing list reports
|
|
107
|
+
* `scrollHeight === clientHeight` and the toasts above the fold
|
|
108
|
+
* cannot be scrolled to at all — content overflowing a flex
|
|
109
|
+
* container's *start* edge is not reachable overflow. An auto margin
|
|
110
|
+
* resolves to `0` the moment the free space runs out, so the same
|
|
111
|
+
* rule pins a short list and scrolls a long one.
|
|
112
|
+
*
|
|
113
|
+
* The scroll is taken to the bottom whenever the count changes,
|
|
114
|
+
* because the newest toast is the one with the action on it and it
|
|
115
|
+
* is the one at the far end.
|
|
55
116
|
*/
|
|
56
117
|
export declare const ToastRegion: ({ className, label, onDismiss, toasts, }: ToastRegionProps) => ReactNode;
|
|
57
118
|
//# sourceMappingURL=ToastRegion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastRegion.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ToastRegion.d.ts","sourceRoot":"","sources":["../../src/Toast/ToastRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8FG;AACH,eAAO,MAAM,WAAW,GAAI,0CAKzB,gBAAgB,KAAG,SAwDrB,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { useOverlayStack } from "../Overlay/OverlayStack.js";
|
|
2
4
|
import { toClassName } from "../toClassName.js";
|
|
3
5
|
import { Toast } from "./Toast.js";
|
|
4
6
|
/**
|
|
@@ -28,14 +30,89 @@ import { Toast } from "./Toast.js";
|
|
|
28
30
|
* sync. The lifecycle *inside* one toast is state a store cannot
|
|
29
31
|
* see, which is why `Toast` owns that and nothing more.
|
|
30
32
|
*
|
|
33
|
+
* ### It is the top of the layer scale, and it moves to stay there
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ The container was `z-50` — a hand-picked number, in the library
|
|
36
|
+
* whose whole point is that nobody picks one. It is
|
|
37
|
+
* `--layer-toast` now, the top of the scale, above `--layer-tooltip`.
|
|
38
|
+
* The owner's rule: *"I think toast should always exist on top of
|
|
39
|
+
* everything."*
|
|
40
|
+
*
|
|
41
|
+
* The open panels cascade — a modal over a modal paints at
|
|
42
|
+
* `--layer-modal + n` — so the depth is added here too, and the
|
|
43
|
+
* toast clears the whole stack rather than only its first floor.
|
|
44
|
+
* Both numbers come off `useOverlayStack`, so the ordering is
|
|
45
|
+
* arithmetic rather than portal-append order.
|
|
46
|
+
*
|
|
47
|
+
* ### Painting on top is only half of "on top"
|
|
48
|
+
*
|
|
49
|
+
* ⚠️ A press on a toast while a `Modal` is open is an **outside**
|
|
50
|
+
* press as far as floating-ui is concerned, and `useDismiss` would
|
|
51
|
+
* close the modal on the way to taking an action back. That is why
|
|
52
|
+
* the container carries `data-charcuterie-toast-region`:
|
|
53
|
+
* `OverlayPanel`'s `outsidePress` reads it and lets the press
|
|
54
|
+
* through. Nothing else in the fleet carries that attribute.
|
|
55
|
+
*
|
|
56
|
+
* ⚠️ Do **not** move this region inside the panel's portal to solve
|
|
57
|
+
* that. Two reasons, both measured. `FloatingFocusManager`'s `modal`
|
|
58
|
+
* already leaves it alone — `markOthers` concatenates
|
|
59
|
+
* `body.querySelectorAll('[aria-live],[role="status"],output')` onto
|
|
60
|
+
* its keep-list, and this region is a `role="status"`, so it is
|
|
61
|
+
* never marked `aria-hidden` where it stands. And the panel's
|
|
62
|
+
* container sets a z-index, so a region nested inside it would be
|
|
63
|
+
* trapped in that stacking context and lose to the *next* modal
|
|
64
|
+
* however high `--layer-toast` climbs.
|
|
65
|
+
*
|
|
31
66
|
* ### `pointer-events-none` on the container, `auto` on each toast
|
|
32
67
|
*
|
|
33
68
|
* A fixed overlay across the bottom of the viewport swallows every
|
|
34
69
|
* click in that band, including on the app behind it, and it does so
|
|
35
70
|
* invisibly. The container passes clicks through and each toast
|
|
36
71
|
* takes them back.
|
|
72
|
+
*
|
|
73
|
+
* The list keeps `pointer-events: none` and still scrolls: a wheel
|
|
74
|
+
* event over a toast chains to the nearest scrollable **ancestor**,
|
|
75
|
+
* which is the list, and hit-testing never has to reach it.
|
|
76
|
+
*
|
|
77
|
+
* ### Many at once, and the newest is the one you can see
|
|
78
|
+
*
|
|
79
|
+
* The column grows upward from the bottom of the viewport, so
|
|
80
|
+
* without a bound the oldest toasts climb off the top of the page —
|
|
81
|
+
* clipped by the viewport, and unreachable, because a fixed element
|
|
82
|
+
* is not something the page can scroll to. The list is capped at
|
|
83
|
+
* `min(60dvh, 32rem)` and scrolls `overscroll-contain`, so the page
|
|
84
|
+
* behind never moves because a notification arrived. The owner's
|
|
85
|
+
* rule: *"if you have multiple toasts, it should accomodate them
|
|
86
|
+
* somehow."*
|
|
87
|
+
*
|
|
88
|
+
* ⚠️ Bottom-pinned with `margin-block-start: auto` on the first
|
|
89
|
+
* toast, **not** `justify-content: flex-end`. Measured in chromium:
|
|
90
|
+
* with `justify-end` an overflowing list reports
|
|
91
|
+
* `scrollHeight === clientHeight` and the toasts above the fold
|
|
92
|
+
* cannot be scrolled to at all — content overflowing a flex
|
|
93
|
+
* container's *start* edge is not reachable overflow. An auto margin
|
|
94
|
+
* resolves to `0` the moment the free space runs out, so the same
|
|
95
|
+
* rule pins a short list and scrolls a long one.
|
|
96
|
+
*
|
|
97
|
+
* The scroll is taken to the bottom whenever the count changes,
|
|
98
|
+
* because the newest toast is the one with the action on it and it
|
|
99
|
+
* is the one at the far end.
|
|
37
100
|
*/
|
|
38
|
-
export const ToastRegion = ({ className, label = "Notifications", onDismiss, toasts, }) =>
|
|
39
|
-
|
|
40
|
-
|
|
101
|
+
export const ToastRegion = ({ className, label = "Notifications", onDismiss, toasts, }) => {
|
|
102
|
+
const { depth } = useOverlayStack();
|
|
103
|
+
const listRef = useRef(null);
|
|
104
|
+
const _toastCount = toasts.length;
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
const list = listRef.current;
|
|
107
|
+
if (!list) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
list.scrollTop = list.scrollHeight;
|
|
111
|
+
}, []);
|
|
112
|
+
return (_jsx("div", { "aria-label": label, "data-charcuterie-toast-region": "", "aria-atomic": "false", className: toClassName("pointer-events-none fixed inset-x-0 bottom-0 flex flex-col items-center gap-2 p-4", className), role: "status", style: {
|
|
113
|
+
zIndex: `calc(var(--layer-toast) + ${depth})`,
|
|
114
|
+
}, children: _jsx("ul", { ref: listRef, className: "charcuterie-scrollbar pointer-events-none flex max-h-[min(60dvh,32rem)] w-full max-w-sm list-none flex-col gap-2 overflow-y-auto overscroll-contain p-0 [&>li]:shrink-0 [&>li:first-child]:mt-auto", children: toasts.map((toast) => (_jsx(Toast, { duration: toast.duration, intent: toast.intent, onRemove: () => {
|
|
115
|
+
onDismiss(toast.key);
|
|
116
|
+
}, title: toast.title, children: toast.description }, toast.key))) }) }));
|
|
117
|
+
};
|
|
41
118
|
//# sourceMappingURL=ToastRegion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToastRegion.js","sourceRoot":"","sources":["../../src/Toast/ToastRegion.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ToastRegion.js","sourceRoot":"","sources":["../../src/Toast/ToastRegion.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA6B,CAAA;AAC7D,OAAO,EAAE,WAAW,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,KAAK,YAEjB,KAAK,CAAC,WAAW,IANb,KAAK,CAAC,GAAG,CAOR,CACT,CAAC,GACC,GACD,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarOverflow.d.ts","sourceRoot":"","sources":["../../src/Toolbar/useToolbarOverflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,kBAAkB,GAAI,eAEhC;IACD,qCAAqC;IACrC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B,KAAG;IACF,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,2DAA2D;IAC3D,SAAS,EAAE,CACT,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GAAG,IAAI,KACxB,IAAI,CAAA;IACT,mDAAmD;IACnD,YAAY,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IACnD,YAAY,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"useToolbarOverflow.d.ts","sourceRoot":"","sources":["../../src/Toolbar/useToolbarOverflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAUtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,kBAAkB,GAAI,eAEhC;IACD,qCAAqC;IACrC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B,KAAG;IACF,YAAY,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC9C,2DAA2D;IAC3D,SAAS,EAAE,CACT,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,GAAG,IAAI,KACxB,IAAI,CAAA;IACT,mDAAmD;IACnD,YAAY,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAA;IACnD,YAAY,EAAE,MAAM,CAAA;CAmNrB,CAAA"}
|
|
@@ -103,6 +103,45 @@ export const useToolbarOverflow = ({ itemKeys, }) => {
|
|
|
103
103
|
* answer, so a stable bar renders once and stops.
|
|
104
104
|
*/
|
|
105
105
|
useLayoutEffect(measure);
|
|
106
|
+
/**
|
|
107
|
+
* Measure again once the webfont has actually arrived.
|
|
108
|
+
*
|
|
109
|
+
* Every width above is a **text** width, so it is only as correct
|
|
110
|
+
* as the font that was loaded when it was read. On a cold cache
|
|
111
|
+
* the first measurement happens in the fallback face, the items
|
|
112
|
+
* come out a few pixels off, and `chooseVisibleCount` keeps or
|
|
113
|
+
* drops one action it should not have — then never revisits it,
|
|
114
|
+
* because swapping a font changes no box the `ResizeObserver`
|
|
115
|
+
* watches and triggers no render.
|
|
116
|
+
*
|
|
117
|
+
* The user-visible symptom is a bar that settles one button wrong
|
|
118
|
+
* and stays there. It needs the two faces to disagree across a
|
|
119
|
+
* collapse boundary, so it is latent rather than observed: no
|
|
120
|
+
* story in the library crosses one today, which is why `vrt`
|
|
121
|
+
* reports nothing either way. That makes it a gap to close, not a
|
|
122
|
+
* regression to chase — the bar is supposed to measure what is on
|
|
123
|
+
* screen, and until now it could not.
|
|
124
|
+
*
|
|
125
|
+
* `document.fonts.ready` resolves immediately when the fonts are
|
|
126
|
+
* already in, so a warm load pays one microtask and
|
|
127
|
+
* `setVisibleCount` bails on the unchanged answer.
|
|
128
|
+
*/
|
|
129
|
+
useLayoutEffect(() => {
|
|
130
|
+
// jsdom has no `document.fonts`, and neither does a very old
|
|
131
|
+
// browser. Nothing to wait for is not an error.
|
|
132
|
+
if (!document.fonts) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
let isActive = true;
|
|
136
|
+
document.fonts.ready.then(() => {
|
|
137
|
+
if (isActive) {
|
|
138
|
+
measure();
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
return () => {
|
|
142
|
+
isActive = false;
|
|
143
|
+
};
|
|
144
|
+
}, [measure]);
|
|
106
145
|
useLayoutEffect(() => {
|
|
107
146
|
const container = containerRef.current;
|
|
108
147
|
if (!container) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbarOverflow.js","sourceRoot":"","sources":["../../src/Toolbar/useToolbarOverflow.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,QAAQ,GAIT,EAUC,EAAE;IACF,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAEjD,MAAM,YAAY,GAAG,MAAM,CACzB,IAAI,GAAG,EAAuB,CAC/B,CAAA;IAED,MAAM,cAAc,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAA;IAEvD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,GAAG,EAAkB,CAAC,CAAA;IAEzD;;;;;;;;OAQG;IACH,MAAM,iBAAiB,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAEnC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,QAAQ,CAAC,MAAM,CAChB,CAAA;IAED;;;;;;;;;OASG;IACH,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;IAEpC,WAAW,CAAC,OAAO,GAAG,QAAQ,CAAA;IAE9B,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAM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ACN,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAClC,CAAC;IACH,CAAC,EACD,EAAE,CACH,CAAA;IAED,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,OAA2B,EAAE,EAAE;QAC9B,cAAc,CAAC,OAAO,GAAG,OAAO,CAAA;IAClC,CAAC,EACD,EAAE,CACH,CAAA;IAED,OAAO;QACL,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;KACb,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@charcuterie/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "The Charcuterie components. Tokens for look, @charcuterie/logic for state, ARIA that agents can actually drive.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@charcuterie/logic": "2.3.0",
|
|
57
|
-
"@charcuterie/tokens": "1.
|
|
57
|
+
"@charcuterie/tokens": "1.10.0",
|
|
58
58
|
"@floating-ui/react": "^0.27.20",
|
|
59
59
|
"@tanstack/react-virtual": "^3.13.12",
|
|
60
60
|
"tailwind-merge": "^3.6.0"
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
+
"@charcuterie/storybook-config": "0.4.1",
|
|
97
98
|
"@codemirror/commands": "^6",
|
|
98
99
|
"@codemirror/lang-markdown": "^6",
|
|
99
100
|
"@codemirror/language": "^6",
|
|
@@ -9,7 +9,7 @@ import * as AccordionStories from "./Accordion.stories";
|
|
|
9
9
|
Eleven sites in the fleet. The plan called it "nearly free once `Tabs` exists" — it is, the
|
|
10
10
|
exclusive mode is `VisibilityGroup` and nothing else — but the saving is not why it ships.
|
|
11
11
|
|
|
12
|
-
<Canvas of={AccordionStories.
|
|
12
|
+
<Canvas of={AccordionStories.Playground} />
|
|
13
13
|
|
|
14
14
|
## Props
|
|
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
|
|
|
3
4
|
import { Badge } from "../Badge/Badge.tsx"
|
|
@@ -67,7 +68,8 @@ export default meta
|
|
|
67
68
|
|
|
68
69
|
type Story = StoryObj<typeof meta>
|
|
69
70
|
|
|
70
|
-
export const
|
|
71
|
+
export const Playground: Story = {
|
|
72
|
+
parameters: playgroundParameters,
|
|
71
73
|
args: { expandedKeys: ["disc"], items: JOB_SECTIONS },
|
|
72
74
|
}
|
|
73
75
|
|
|
@@ -7,12 +7,12 @@ import { mountStory } from "../mountStory.testHelpers.ts"
|
|
|
7
7
|
import { expectAgentDrivable } from "../testing/index.ts"
|
|
8
8
|
import * as stories from "./Accordion.stories.tsx"
|
|
9
9
|
|
|
10
|
-
const { AllStates, AllVariants,
|
|
10
|
+
const { AllStates, AllVariants, Playground } =
|
|
11
11
|
composeStories(stories)
|
|
12
12
|
|
|
13
13
|
test("a trigger says what it controls and whether it is open", async () => {
|
|
14
14
|
const { canvas, canvasElement } =
|
|
15
|
-
await mountStory(
|
|
15
|
+
await mountStory(Playground)
|
|
16
16
|
|
|
17
17
|
const disc = expectAgentDrivable(canvas, {
|
|
18
18
|
name: "Disc",
|
|
@@ -57,7 +57,7 @@ test("a trigger says what it controls and whether it is open", async () => {
|
|
|
57
57
|
* frame later.
|
|
58
58
|
*/
|
|
59
59
|
test("the initially expanded section is expanded on the first paint", async () => {
|
|
60
|
-
const { canvas } = await mountStory(
|
|
60
|
+
const { canvas } = await mountStory(Playground)
|
|
61
61
|
|
|
62
62
|
const expanded = canvas
|
|
63
63
|
.queryAllByRole("button")
|
|
@@ -72,7 +72,7 @@ test("the initially expanded section is expanded on the first paint", async () =
|
|
|
72
72
|
})
|
|
73
73
|
|
|
74
74
|
test("exclusive means opening one closes the other", async () => {
|
|
75
|
-
const { canvas } = await mountStory(
|
|
75
|
+
const { canvas } = await mountStory(Playground)
|
|
76
76
|
|
|
77
77
|
const log = expectAgentDrivable(canvas, {
|
|
78
78
|
name: "Log",
|
|
@@ -15,7 +15,7 @@ named this case under *"What this deliberately does not cover"*: mux-magic's "Pi
|
|
|
15
15
|
tiles are `<a href>` and points-market's are `<Link>`, and *"a link is not a radio, and
|
|
16
16
|
giving one `aria-checked` would be worse than the paint it replaced"*.
|
|
17
17
|
|
|
18
|
-
<Canvas of={ActionTilesStories.
|
|
18
|
+
<Canvas of={ActionTilesStories.Playground} />
|
|
19
19
|
|
|
20
20
|
## Props
|
|
21
21
|
|
|
@@ -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"
|
|
@@ -142,7 +143,8 @@ export default meta
|
|
|
142
143
|
|
|
143
144
|
type Story = StoryObj<typeof meta>
|
|
144
145
|
|
|
145
|
-
export const
|
|
146
|
+
export const Playground: Story = {
|
|
147
|
+
parameters: playgroundParameters,
|
|
146
148
|
args: { items: QUEUE_TYPE_ITEMS, label: "Queue type" },
|
|
147
149
|
}
|
|
148
150
|
|