@charcuterie/ui 1.1.0 → 2.0.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.
Files changed (116) hide show
  1. package/dist/Combobox/Combobox.d.ts +54 -0
  2. package/dist/Combobox/Combobox.d.ts.map +1 -0
  3. package/dist/Combobox/Combobox.js +216 -0
  4. package/dist/Combobox/Combobox.js.map +1 -0
  5. package/dist/Combobox/ComboboxOption.d.ts +36 -0
  6. package/dist/Combobox/ComboboxOption.d.ts.map +1 -0
  7. package/dist/Combobox/ComboboxOption.js +32 -0
  8. package/dist/Combobox/ComboboxOption.js.map +1 -0
  9. package/dist/Dialog/Dialog.d.ts +47 -0
  10. package/dist/Dialog/Dialog.d.ts.map +1 -0
  11. package/dist/Dialog/Dialog.js +52 -0
  12. package/dist/Dialog/Dialog.js.map +1 -0
  13. package/dist/Lightbox/Lightbox.d.ts +7 -7
  14. package/dist/Lightbox/Lightbox.js +9 -9
  15. package/dist/Lightbox/Lightbox.js.map +1 -1
  16. package/dist/Listbox/Listbox.d.ts +56 -0
  17. package/dist/Listbox/Listbox.d.ts.map +1 -0
  18. package/dist/Listbox/Listbox.js +151 -0
  19. package/dist/Listbox/Listbox.js.map +1 -0
  20. package/dist/Listbox/ListboxOption.d.ts +36 -0
  21. package/dist/Listbox/ListboxOption.d.ts.map +1 -0
  22. package/dist/Listbox/ListboxOption.js +42 -0
  23. package/dist/Listbox/ListboxOption.js.map +1 -0
  24. package/dist/Menu/Menu.d.ts.map +1 -1
  25. package/dist/Menu/Menu.js +47 -97
  26. package/dist/Menu/Menu.js.map +1 -1
  27. package/dist/Modal/Modal.d.ts +11 -59
  28. package/dist/Modal/Modal.d.ts.map +1 -1
  29. package/dist/Modal/Modal.js +28 -101
  30. package/dist/Modal/Modal.js.map +1 -1
  31. package/dist/Overlay/OverlayPanel.d.ts +50 -0
  32. package/dist/Overlay/OverlayPanel.d.ts.map +1 -0
  33. package/dist/Overlay/OverlayPanel.js +72 -0
  34. package/dist/Overlay/OverlayPanel.js.map +1 -0
  35. package/dist/Overlay/OverlayStack.d.ts +47 -0
  36. package/dist/Overlay/OverlayStack.d.ts.map +1 -0
  37. package/dist/Overlay/OverlayStack.js +46 -0
  38. package/dist/Overlay/OverlayStack.js.map +1 -0
  39. package/dist/Overlay/SharedBackdrop.d.ts +24 -0
  40. package/dist/Overlay/SharedBackdrop.d.ts.map +1 -0
  41. package/dist/Overlay/SharedBackdrop.js +28 -0
  42. package/dist/Overlay/SharedBackdrop.js.map +1 -0
  43. package/dist/Overlay/lockScrollBehind.d.ts.map +1 -0
  44. package/dist/Overlay/lockScrollBehind.js.map +1 -0
  45. package/dist/Overlay/overlayPanelClass.d.ts +17 -0
  46. package/dist/Overlay/overlayPanelClass.d.ts.map +1 -0
  47. package/dist/Overlay/overlayPanelClass.js +17 -0
  48. package/dist/Overlay/overlayPanelClass.js.map +1 -0
  49. package/dist/Overlay/useAnchoredOverlay.d.ts +97 -0
  50. package/dist/Overlay/useAnchoredOverlay.d.ts.map +1 -0
  51. package/dist/Overlay/useAnchoredOverlay.js +81 -0
  52. package/dist/Overlay/useAnchoredOverlay.js.map +1 -0
  53. package/dist/Popover/Popover.d.ts +16 -24
  54. package/dist/Popover/Popover.d.ts.map +1 -1
  55. package/dist/Popover/Popover.js +32 -68
  56. package/dist/Popover/Popover.js.map +1 -1
  57. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  58. package/dist/Tooltip/Tooltip.js +25 -25
  59. package/dist/Tooltip/Tooltip.js.map +1 -1
  60. package/dist/index.d.ts +7 -1
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.js +3 -0
  63. package/dist/index.js.map +1 -1
  64. package/dist/mountStory.testHelpers.d.ts +1 -0
  65. package/dist/mountStory.testHelpers.d.ts.map +1 -1
  66. package/dist/mountStory.testHelpers.js +21 -1
  67. package/dist/mountStory.testHelpers.js.map +1 -1
  68. package/package.json +3 -2
  69. package/src/Combobox/Combobox.mdx +71 -0
  70. package/src/Combobox/Combobox.stories.tsx +245 -0
  71. package/src/Combobox/Combobox.test.tsx +289 -0
  72. package/src/Combobox/Combobox.tsx +513 -0
  73. package/src/Combobox/ComboboxOption.tsx +88 -0
  74. package/src/Dialog/Dialog.mdx +87 -0
  75. package/src/Dialog/Dialog.stories.tsx +347 -0
  76. package/src/Dialog/Dialog.test.tsx +312 -0
  77. package/src/Dialog/Dialog.tsx +127 -0
  78. package/src/Field/Field.test.tsx +6 -4
  79. package/src/Lightbox/Lightbox.mdx +9 -8
  80. package/src/Lightbox/Lightbox.stories.tsx +5 -5
  81. package/src/Lightbox/Lightbox.test.tsx +25 -36
  82. package/src/Lightbox/Lightbox.tsx +10 -10
  83. package/src/Listbox/Listbox.mdx +68 -0
  84. package/src/Listbox/Listbox.stories.tsx +205 -0
  85. package/src/Listbox/Listbox.test.tsx +198 -0
  86. package/src/Listbox/Listbox.tsx +295 -0
  87. package/src/Listbox/ListboxOption.tsx +104 -0
  88. package/src/Menu/Menu.mdx +11 -13
  89. package/src/Menu/Menu.test.tsx +47 -38
  90. package/src/Menu/Menu.tsx +81 -142
  91. package/src/Modal/Modal.mdx +29 -82
  92. package/src/Modal/Modal.stories.tsx +55 -188
  93. package/src/Modal/Modal.test.tsx +44 -177
  94. package/src/Modal/Modal.tsx +54 -204
  95. package/src/Overlay/OverlayPanel.tsx +195 -0
  96. package/src/Overlay/OverlayStack.test.tsx +235 -0
  97. package/src/Overlay/OverlayStack.tsx +132 -0
  98. package/src/Overlay/SharedBackdrop.tsx +40 -0
  99. package/src/Overlay/overlayPanelClass.ts +17 -0
  100. package/src/Overlay/useAnchoredOverlay.ts +197 -0
  101. package/src/Popover/Popover.mdx +17 -20
  102. package/src/Popover/Popover.stories.tsx +33 -0
  103. package/src/Popover/Popover.test.tsx +68 -32
  104. package/src/Popover/Popover.tsx +56 -95
  105. package/src/Tooltip/Tooltip.mdx +12 -9
  106. package/src/Tooltip/Tooltip.test.tsx +17 -19
  107. package/src/Tooltip/Tooltip.tsx +35 -32
  108. package/src/index.ts +13 -4
  109. package/src/mountStory.testHelpers.ts +25 -1
  110. package/src/sourceRules.test.ts +12 -3
  111. package/src/storyControls.test.ts +25 -12
  112. package/dist/Modal/lockScrollBehind.d.ts.map +0 -1
  113. package/dist/Modal/lockScrollBehind.js.map +0 -1
  114. /package/dist/{Modal → Overlay}/lockScrollBehind.d.ts +0 -0
  115. /package/dist/{Modal → Overlay}/lockScrollBehind.js +0 -0
  116. /package/src/{Modal → Overlay}/lockScrollBehind.ts +0 -0
@@ -0,0 +1,81 @@
1
+ import { useClonedChild, useUniqueId, } from "@charcuterie/logic";
2
+ import { autoUpdate, flip, offset, shift, size, useDismiss, useFloating, useInteractions, useRole, } from "@floating-ui/react";
3
+ export const useAnchoredOverlay = ({ isEscapeDismissable = true, isOutsidePressDismissable = true, isTriggerWidthMatched = false, isVisible, maxHeightPx, offsetValue = 8, onDismiss, placement = "bottom-start", role, trigger, }) => {
4
+ const middleware = [
5
+ offset(offsetValue),
6
+ flip(),
7
+ shift({ padding: 8 }),
8
+ ];
9
+ if (isTriggerWidthMatched || maxHeightPx !== undefined) {
10
+ middleware.push(size({
11
+ padding: 8,
12
+ apply({ availableHeight, elements, rects }) {
13
+ const cap = maxHeightPx === undefined
14
+ ? availableHeight
15
+ : Math.min(maxHeightPx, availableHeight);
16
+ elements.floating.style.maxHeight = `${cap}px`;
17
+ if (isTriggerWidthMatched) {
18
+ elements.floating.style.width = `${rects.reference.width}px`;
19
+ }
20
+ },
21
+ }));
22
+ }
23
+ const { context, floatingStyles, refs } = useFloating({
24
+ // Read-only. Charcuterie remains the sole owner; floating-ui is
25
+ // told what is true and never decides it.
26
+ open: isVisible,
27
+ onOpenChange: (isNextVisible) => {
28
+ if (!isNextVisible) {
29
+ onDismiss();
30
+ }
31
+ },
32
+ placement,
33
+ middleware,
34
+ strategy: "fixed",
35
+ whileElementsMounted: autoUpdate,
36
+ });
37
+ // `useRole` writes `aria-expanded`/`aria-haspopup`/`aria-controls`
38
+ // on the trigger and `id` + `role` on the panel from one source —
39
+ // which is what keeps `aria-controls` pointing at the panel's real
40
+ // id across the portal boundary, the objection the top-layer
41
+ // decision raised and this answers.
42
+ const { getFloatingProps, getReferenceProps } = useInteractions([
43
+ useDismiss(context, {
44
+ escapeKey: isEscapeDismissable,
45
+ outsidePress: isOutsidePressDismissable,
46
+ }),
47
+ useRole(context, { role }),
48
+ ]);
49
+ // `useRole` for a `listbox` overwrites the trigger's own role with
50
+ // `combobox` — the select-only-combobox pattern, which then demands
51
+ // its own `aria-label`. The fleet's pattern is a plain button that
52
+ // *opens* a listbox, so the injected `role` is dropped and the
53
+ // trigger keeps its native semantics while still gaining
54
+ // `aria-haspopup="listbox"`/`aria-expanded`/`aria-controls`. `useRole`
55
+ // injects a reference `role` only for listbox/combobox, so this is a
56
+ // no-op for `Popover` (dialog) and `Menu` (menu).
57
+ const { role: _discardedTriggerRole, ...referenceProps } = getReferenceProps();
58
+ // A stable id on the trigger, so a panel that needs a name can point
59
+ // `aria-labelledby` at it across the portal. `useRole` already gives
60
+ // a `menu`'s reference an id (and labels the panel with it); this
61
+ // reuses that when present and supplies one otherwise — which is what
62
+ // a `listbox` panel needs, since a bare `role="listbox"` is an ARIA
63
+ // input field and must be named.
64
+ const generatedTriggerId = useUniqueId();
65
+ const triggerId = referenceProps.id ??
66
+ generatedTriggerId;
67
+ const clonedTrigger = useClonedChild(trigger, {
68
+ ...referenceProps,
69
+ id: triggerId,
70
+ ref: refs.setReference,
71
+ });
72
+ return {
73
+ clonedTrigger,
74
+ context,
75
+ floatingStyles,
76
+ getFloatingProps,
77
+ setFloating: refs.setFloating,
78
+ triggerId,
79
+ };
80
+ };
81
+ //# sourceMappingURL=useAnchoredOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnchoredOverlay.js","sourceRoot":"","sources":["../../src/Overlay/useAnchoredOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,GACZ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;AACH,CAAC,CAAA"}
@@ -35,32 +35,24 @@ export type PopoverProps = {
35
35
  *
36
36
  * What floating-ui is used for is what only it can do: collision
37
37
  * handling (`flip`, `shift`), a real dismiss layer, and focus
38
- * management. Positioning strategy, the top layer, and the ARIA
39
- * wiring come from the platform and from `useRole`.
38
+ * management — all of it consolidated in `useAnchoredOverlay`.
39
+ * Positioning strategy and the ARIA wiring come from the platform and
40
+ * from `useRole`.
40
41
  *
41
- * ### The top layer, from the platform — not a portal
42
+ * ### Portalled, not the top layer
42
43
  *
43
- * `popover="manual"` puts the panel in the top layer, which is
44
- * what a portal is normally reached for: no `z-index` contest, and
45
- * no `overflow: hidden` ancestor clipping it. Unlike a portal it
46
- * **stays where it is in the DOM**, so `canvas.getByRole("dialog")`
47
- * still finds it and a story keeps its scoping. Same argument as
48
- * `Modal`, one layer down.
49
- *
50
- * `manual`, not `auto`, and that is the state-ownership decision
51
- * again: `auto` brings the UA's own light-dismiss, which closes the
52
- * element by itself and leaves `isVisible` true. `useDismiss` does
53
- * the same job through our callback, so Charcuterie stays the only
54
- * thing that decides.
55
- *
56
- * ### Two UA defaults that have to be undone
57
- *
58
- * `[popover]` ships `position: fixed; inset: 0; margin: auto`,
59
- * which centres the panel in the viewport and fights every
60
- * coordinate floating-ui computes — hence `inset-auto m-0`, and
61
- * `strategy: "fixed"` so the numbers are viewport-relative like the
62
- * top layer itself. Getting either wrong reads as a positioning
63
- * bug rather than as a UA default.
44
+ * The panel goes in a `FloatingPortal` to `document.body`. The top
45
+ * layer (`popover="manual"`) was reached for first — it needs no
46
+ * portal and no `z-index` — but it does not escape an
47
+ * `overflow: hidden` ancestor's *clipping* in every case the fleet
48
+ * hit, and a portal does. The objection a portal used to raise, that
49
+ * it moves the panel out of a scoped `canvas` query, is answered two
50
+ * ways: `useRole` writes `aria-controls` on the trigger pointing at
51
+ * the panel `id`, so trigger→panel stays followable across the
52
+ * boundary; and the story scopes panel queries to
53
+ * `within(document.body)` while the structural `expectAgentDrivable`
54
+ * needs no change. `strategy: "fixed"` keeps the coordinates
55
+ * viewport-relative.
64
56
  */
65
57
  export declare const Popover: ({ children, className, heading, isVisible, onDismiss, placement, trigger, }: PopoverProps) => ReactNode;
66
58
  //# sourceMappingURL=Popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/Popover/Popover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAYnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIpD,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;OAIG;IACH,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,OAAO,GAAI,6EAQrB,YAAY,KAAG,SA2EjB,CAAA"}
1
+ {"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/Popover/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMpD,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;OAIG;IACH,OAAO,EAAE,YAAY,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,OAAO,GAAI,6EAQrB,YAAY,KAAG,SAkDjB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useClonedChild } from "@charcuterie/logic";
3
- import { autoUpdate, FloatingFocusManager, flip, offset, shift, useDismiss, useFloating, useInteractions, useRole, } from "@floating-ui/react";
2
+ import { FloatingFocusManager, FloatingPortal, } from "@floating-ui/react";
3
+ import { PANEL_SURFACE_CLASS } from "../Overlay/overlayPanelClass.js";
4
+ import { useAnchoredOverlay } from "../Overlay/useAnchoredOverlay.js";
4
5
  import { toClassName } from "../toClassName.js";
5
6
  /**
6
7
  * Replaces mux-magic's `@radix-ui/react-popover` re-export, and it
@@ -12,77 +13,40 @@ import { toClassName } from "../toClassName.js";
12
13
  *
13
14
  * What floating-ui is used for is what only it can do: collision
14
15
  * handling (`flip`, `shift`), a real dismiss layer, and focus
15
- * management. Positioning strategy, the top layer, and the ARIA
16
- * wiring come from the platform and from `useRole`.
16
+ * management — all of it consolidated in `useAnchoredOverlay`.
17
+ * Positioning strategy and the ARIA wiring come from the platform and
18
+ * from `useRole`.
17
19
  *
18
- * ### The top layer, from the platform — not a portal
20
+ * ### Portalled, not the top layer
19
21
  *
20
- * `popover="manual"` puts the panel in the top layer, which is
21
- * what a portal is normally reached for: no `z-index` contest, and
22
- * no `overflow: hidden` ancestor clipping it. Unlike a portal it
23
- * **stays where it is in the DOM**, so `canvas.getByRole("dialog")`
24
- * still finds it and a story keeps its scoping. Same argument as
25
- * `Modal`, one layer down.
26
- *
27
- * `manual`, not `auto`, and that is the state-ownership decision
28
- * again: `auto` brings the UA's own light-dismiss, which closes the
29
- * element by itself and leaves `isVisible` true. `useDismiss` does
30
- * the same job through our callback, so Charcuterie stays the only
31
- * thing that decides.
32
- *
33
- * ### Two UA defaults that have to be undone
34
- *
35
- * `[popover]` ships `position: fixed; inset: 0; margin: auto`,
36
- * which centres the panel in the viewport and fights every
37
- * coordinate floating-ui computes — hence `inset-auto m-0`, and
38
- * `strategy: "fixed"` so the numbers are viewport-relative like the
39
- * top layer itself. Getting either wrong reads as a positioning
40
- * bug rather than as a UA default.
22
+ * The panel goes in a `FloatingPortal` to `document.body`. The top
23
+ * layer (`popover="manual"`) was reached for first — it needs no
24
+ * portal and no `z-index` — but it does not escape an
25
+ * `overflow: hidden` ancestor's *clipping* in every case the fleet
26
+ * hit, and a portal does. The objection a portal used to raise, that
27
+ * it moves the panel out of a scoped `canvas` query, is answered two
28
+ * ways: `useRole` writes `aria-controls` on the trigger pointing at
29
+ * the panel `id`, so trigger→panel stays followable across the
30
+ * boundary; and the story scopes panel queries to
31
+ * `within(document.body)` while the structural `expectAgentDrivable`
32
+ * needs no change. `strategy: "fixed"` keeps the coordinates
33
+ * viewport-relative.
41
34
  */
42
35
  export const Popover = ({ children, className, heading, isVisible, onDismiss, placement = "bottom-start", trigger, }) => {
43
- const { context, floatingStyles, refs } = useFloating({
44
- // Read-only. Charcuterie remains the sole owner; floating-ui
45
- // is told what is true and never decides it.
46
- open: isVisible,
47
- onOpenChange: (isNextVisible) => {
48
- if (!isNextVisible) {
49
- onDismiss();
50
- }
51
- },
36
+ const { clonedTrigger, context, floatingStyles, getFloatingProps, setFloating, } = useAnchoredOverlay({
37
+ isVisible,
38
+ offsetValue: 8,
39
+ onDismiss,
52
40
  placement,
53
- middleware: [offset(8), flip(), shift({ padding: 8 })],
54
- strategy: "fixed",
55
- whileElementsMounted: autoUpdate,
56
- });
57
- // `useRole` writes `aria-expanded`, `aria-haspopup`, and
58
- // `aria-controls` on the trigger and `id` + `role="dialog"` on
59
- // the panel, from one source. Hand-writing them alongside is how
60
- // an `aria-controls` ends up pointing at an id that moved.
61
- const { getFloatingProps, getReferenceProps } = useInteractions([
62
- useDismiss(context),
63
- useRole(context, { role: "dialog" }),
64
- ]);
65
- const clonedTrigger = useClonedChild(trigger, {
66
- ...getReferenceProps(),
67
- ref: refs.setReference,
41
+ role: "dialog",
42
+ trigger,
68
43
  });
69
- return (_jsxs(_Fragment, { children: [clonedTrigger, isVisible ? (_jsx(FloatingFocusManager, { context: context, modal: false, children: _jsx("div", { ...getFloatingProps(), "aria-label": heading, className: toClassName("inset-auto m-0 max-w-xs rounded-md border border-border-default bg-surface-overlay p-3 text-content-primary text-sm shadow-medium", className), popover: "manual",
70
- // Duplicated from `getFloatingProps()` on purpose, and
71
- // the two cannot differ — `useRole(context, { role:
72
- // "dialog" })` above is where it comes from. Stated
73
- // here because a linter cannot see a role through a
74
- // spread, and neither can the next reader.
75
- role: "dialog", ref: (node) => {
76
- refs.setFloating(node);
77
- // In a ref callback rather than an effect, because a
78
- // `[popover]` is `display: none` until it is shown —
79
- // and `FloatingFocusManager` is a *child*, so its
80
- // effect runs first and would be focusing into a
81
- // hidden element. Refs are set during commit, before
82
- // any of that.
83
- if (node && !node.matches(":popover-open")) {
84
- node.showPopover();
85
- }
86
- }, style: floatingStyles, children: children }) })) : null] }));
44
+ return (_jsxs(_Fragment, { children: [clonedTrigger, isVisible ? (_jsx(FloatingPortal, { children: _jsx(FloatingFocusManager, { context: context, modal: false, children: _jsx("div", { ...getFloatingProps(), "aria-label": heading, className: toClassName(PANEL_SURFACE_CLASS, "z-[var(--layer-modal)] max-w-xs p-3 text-content-primary text-sm", className), ref: setFloating,
45
+ // Duplicated from `getFloatingProps()` on purpose, and
46
+ // the two cannot differ — `useRole(context, { role:
47
+ // "dialog" })` inside the hook is where it comes from.
48
+ // Stated here because a linter cannot see a role through
49
+ // a spread, and neither can the next reader.
50
+ role: "dialog", style: floatingStyles, children: children }) }) })) : null] }));
87
51
  };
88
52
  //# sourceMappingURL=Popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sour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,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,OAAO,GAAI,wEAOrB,YAAY,KAAG,SAoFjB,CAAA"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAcnD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAIhD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG;IACrC;;;;;;OAMG;IACH,QAAQ,EAAE,YAAY,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,eAAO,MAAM,OAAO,GAAI,wEAOrB,YAAY,KAAG,SAsFjB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useClonedChild, useVisibility, } from "@charcuterie/logic";
3
- import { autoUpdate, flip, offset, shift, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, } from "@floating-ui/react";
3
+ import { autoUpdate, FloatingPortal, flip, offset, shift, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole, } from "@floating-ui/react";
4
4
  import { mergeSlotProps } from "../slotProps.js";
5
5
  import { toClassName } from "../toClassName.js";
6
6
  /**
@@ -96,29 +96,29 @@ export const Tooltip = ({ children, className, delay = 200, label, placement = "
96
96
  ...getReferenceProps(),
97
97
  ref: refs.setReference,
98
98
  }));
99
- return (_jsxs(_Fragment, { children: [clonedTrigger, isVisible ? (_jsx("div", { ...getFloatingProps(), className: toClassName(
100
- // `intent-neutral-solid` + its own `on-solid`, rather
101
- // than `surface-inverse` + `content-on-accent`. The
102
- // second pair looks like the obvious one and is not a
103
- // *pair* at all — nothing in the token set promises those
104
- // two contrast, and in `daylight` dark they land at
105
- // 2.9:1. The `solid`/`on-solid` roles exist precisely to
106
- // be a guaranteed couple, and the contrast gate checks
107
- // them as one.
108
- "inset-auto m-0 max-w-xs rounded-md bg-intent-neutral-solid px-2 py-1 text-intent-neutral-on-solid text-xs shadow-medium", className),
109
- // No `popover="manual"` and no `FloatingFocusManager`,
110
- // unlike `Popover`. Both exist to manage focus, and focus
111
- // never enters a tooltip — moving it here is what makes
112
- // one unescapable. The trade is that a tooltip is not in
113
- // the top layer, so it can be clipped by an
114
- // `overflow: hidden` ancestor; `strategy: "fixed"` keeps
115
- // that to ancestors that actually clip fixed descendants.
116
- ref: refs.setFloating,
117
- // Duplicated from `getFloatingProps()` deliberately, and
118
- // the two cannot differ — `useRole(context, { role:
119
- // "tooltip" })` above is where it comes from. Stated here
120
- // because a linter cannot see a role through a spread, and
121
- // neither can the next reader.
122
- role: "tooltip", style: floatingStyles, children: label })) : null] }));
99
+ return (_jsxs(_Fragment, { children: [clonedTrigger, isVisible ? (_jsx(FloatingPortal, { children: _jsx("div", { ...getFloatingProps(), className: toClassName(
100
+ // `intent-neutral-solid` + its own `on-solid`, rather
101
+ // than `surface-inverse` + `content-on-accent`. The
102
+ // second pair looks like the obvious one and is not a
103
+ // *pair* at all — nothing in the token set promises those
104
+ // two contrast, and in `daylight` dark they land at
105
+ // 2.9:1. The `solid`/`on-solid` roles exist precisely to
106
+ // be a guaranteed couple, and the contrast gate checks
107
+ // them as one.
108
+ "z-[var(--layer-tooltip)] max-w-xs rounded-md bg-intent-neutral-solid px-2 py-1 text-intent-neutral-on-solid text-xs shadow-medium", className),
109
+ // Portalled to `document.body`, the same reversal as the
110
+ // other overlays: `strategy: "fixed"` alone still let an
111
+ // `overflow: hidden` ancestor clip the tip, and a portal
112
+ // does not. No `FloatingFocusManager`, unlike `Popover` —
113
+ // focus never enters a tooltip, and moving it here is what
114
+ // would make one unescapable. `--layer-tooltip` keeps it
115
+ // above a modal.
116
+ ref: refs.setFloating,
117
+ // Duplicated from `getFloatingProps()` deliberately, and
118
+ // the two cannot differ — `useRole(context, { role:
119
+ // "tooltip" })` above is where it comes from. Stated here
120
+ // because a linter cannot see a role through a spread, and
121
+ // neither can the next reader.
122
+ role: "tooltip", style: floatingStyles, children: label }) })) : null] }));
123
123
  };
124
124
  //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../src/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACL,UAAU,EACV,IAAI,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,OAAO,GACR,MAAM,oBAAoB,CAAA;AAI3B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAwB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EACtB,QAAQ,EACR,SAAS,EACT,KAAK,GAAG,GAAG,EACX,KAAK,EACL,SAAS,GAAG,K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D;oBACzD,uDAAuD;oBACvD,eAAe;oBACf,mIAAmI,EACnI,SAAS,CACV;oBACD,yDAAyD;oBACzD,yDAAyD;oBACzD,yDAAyD;oBACzD,0DAA0D;oBAC1D,2DAA2D;oBAC3D,yDAAyD;oBACzD,iBAAiB;oBACjB,GAAG,EAAE,IAAI,CAAC,WAAW;oBACrB,yDAAyD;oBACzD,oDAAoD;oBACpD,0DAA0D;oBAC1D,2DAA2D;oBAC3D,+BAA+B;oBAC/B,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,cAAc,YAEpB,KAAK,GACF,GACS,CAClB,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAA;AACH,CAAC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -44,8 +44,12 @@ export type { ColorSchemeSwitcherProps } from "./ColorSchemeSwitcher/ColorScheme
44
44
  export { ColorSchemeSwitcher } from "./ColorSchemeSwitcher/ColorSchemeSwitcher.tsx";
45
45
  export type { ColorSchemeIcons, ColorSchemeToggleProps, } from "./ColorSchemeToggle/ColorSchemeToggle.tsx";
46
46
  export { ColorSchemeToggle } from "./ColorSchemeToggle/ColorSchemeToggle.tsx";
47
+ export type { ComboboxProps } from "./Combobox/Combobox.tsx";
48
+ export { Combobox } from "./Combobox/Combobox.tsx";
47
49
  export type { BadgeSize } from "./controlStyles.ts";
48
50
  export { BADGE_SIZE_CLASS, CONTROL_SIZE_CLASS, DOT_SIZE_CLASS, ICON_CONTROL_SIZE_CLASS, MIN_TOUCH_TARGET_CLASS, SPINNER_SIZE_CLASS, } from "./controlStyles.ts";
51
+ export type { DialogProps, DialogSize, } from "./Dialog/Dialog.tsx";
52
+ export { Dialog } from "./Dialog/Dialog.tsx";
49
53
  export type { EmptyStateProps, EmptyStateSize, } from "./EmptyState/EmptyState.tsx";
50
54
  export { EmptyState } from "./EmptyState/EmptyState.tsx";
51
55
  export type { FieldProps } from "./Field/Field.tsx";
@@ -60,6 +64,8 @@ export type { IntentAppearance } from "./intentStyles.ts";
60
64
  export { DISABLED_CLASS, FOCUS_RING_CLASS, INTENT_APPEARANCE_CLASS, INTENT_CONTENT_CLASS, INTENT_HOVER_CLASS, INTENT_SOLID_FILL_CLASS, } from "./intentStyles.ts";
61
65
  export type { LightboxProps } from "./Lightbox/Lightbox.tsx";
62
66
  export { Lightbox } from "./Lightbox/Lightbox.tsx";
67
+ export type { ListboxItem, ListboxProps, } from "./Listbox/Listbox.tsx";
68
+ export { Listbox } from "./Listbox/Listbox.tsx";
63
69
  export type { LiveStatusIndicatorProps, LiveStatusIndicatorSize, } from "./LiveStatusIndicator/LiveStatusIndicator.tsx";
64
70
  export { LiveStatusIndicator } from "./LiveStatusIndicator/LiveStatusIndicator.tsx";
65
71
  export type { LogLine, LogViewerProps, } from "./LogViewer/LogViewer.tsx";
@@ -70,7 +76,7 @@ export type { MediaStatus } from "./MediaTile/mediaStatus.ts";
70
76
  export { mediaTransitions } from "./MediaTile/mediaStatus.ts";
71
77
  export type { MenuItem, MenuProps, } from "./Menu/Menu.tsx";
72
78
  export { Menu } from "./Menu/Menu.tsx";
73
- export type { ModalProps, ModalSize, } from "./Modal/Modal.tsx";
79
+ export type { ModalProps } from "./Modal/Modal.tsx";
74
80
  export { Modal } from "./Modal/Modal.tsx";
75
81
  export type { PopoverProps } from "./Popover/Popover.tsx";
76
82
  export { Popover } from "./Popover/Popover.tsx";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,YAAY,EACV,qBAAqB,EACrB,aAAa,EACb,cAAc,GACf,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,YAAY,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EAAE,UAAU,EA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AAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA"}
package/dist/index.js CHANGED
@@ -37,7 +37,9 @@ export { Button } from "./Button/Button.js";
37
37
  export { Card } from "./Card/Card.js";
38
38
  export { ColorSchemeSwitcher } from "./ColorSchemeSwitcher/ColorSchemeSwitcher.js";
39
39
  export { ColorSchemeToggle } from "./ColorSchemeToggle/ColorSchemeToggle.js";
40
+ export { Combobox } from "./Combobox/Combobox.js";
40
41
  export { BADGE_SIZE_CLASS, CONTROL_SIZE_CLASS, DOT_SIZE_CLASS, ICON_CONTROL_SIZE_CLASS, MIN_TOUCH_TARGET_CLASS, SPINNER_SIZE_CLASS, } from "./controlStyles.js";
42
+ export { Dialog } from "./Dialog/Dialog.js";
41
43
  export { EmptyState } from "./EmptyState/EmptyState.js";
42
44
  export { Field } from "./Field/Field.js";
43
45
  export { FieldGroup } from "./Field/FieldGroup.js";
@@ -45,6 +47,7 @@ export { FileDropZone } from "./FileDropZone/FileDropZone.js";
45
47
  export { IconButton } from "./IconButton/IconButton.js";
46
48
  export { DISABLED_CLASS, FOCUS_RING_CLASS, INTENT_APPEARANCE_CLASS, INTENT_CONTENT_CLASS, INTENT_HOVER_CLASS, INTENT_SOLID_FILL_CLASS, } from "./intentStyles.js";
47
49
  export { Lightbox } from "./Lightbox/Lightbox.js";
50
+ export { Listbox } from "./Listbox/Listbox.js";
48
51
  export { LiveStatusIndicator } from "./LiveStatusIndicator/LiveStatusIndicator.js";
49
52
  export { LogViewer } from "./LogViewer/LogViewer.js";
50
53
  export { MediaTile } from "./MediaTile/MediaTile.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA2B,CAAA;AAKrD,OA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,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA+B,CAAA;AAE3D,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,gCAAgC,CAAA;AAKvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAyC,CAAA;AAO1E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAqB,CAAA;AAK5C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAyB,CAAA;AAKlD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA+C,CAAA;AAEnF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EACL,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAO1B,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAiB,CAAA;AAEtC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAKzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAyB,CAAA;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAqC,CAAA"}
@@ -12,6 +12,7 @@ type MountableStory = {
12
12
  }) => Promise<void>;
13
13
  };
14
14
  export declare const mountStory: (story: MountableStory) => Promise<{
15
+ body: Canvas;
15
16
  canvas: Canvas;
16
17
  canvasElement: HTMLElement;
17
18
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"mountStory.testHelpers.d.ts","sourceRoot":"","sources":["../src/mountStory.testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAA;AAEvC;;;;;GAKG;AACH,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,CAAC,OAAO,EAAE;QACb,aAAa,EAAE,WAAW,CAAA;KAC3B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpB,CAAA;AAqCD,eAAO,MAAM,UAAU,GACrB,OAAO,cAAc,KACpB,OAAO,CAAC;IACT,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,WAAW,CAAA;CAC3B,CAcA,CAAA"}
1
+ {"version":3,"file":"mountStory.testHelpers.d.ts","sourceRoot":"","sources":["../src/mountStory.testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAA;AAEvC;;;;;GAKG;AACH,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,CAAC,OAAO,EAAE;QACb,aAAa,EAAE,WAAW,CAAA;KAC3B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpB,CAAA;AAkDD,eAAO,MAAM,UAAU,GACrB,OAAO,cAAc,KACpB,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,WAAW,CAAA;CAC3B,CAwBA,CAAA"}
@@ -31,16 +31,36 @@ import { within } from "storybook/test";
31
31
  * The stale tree is removed rather than unmounted because portable
32
32
  * stories expose no unmount. Detaching is enough: it takes the node
33
33
  * out of the layout, which is the entire problem.
34
+ *
35
+ * ### Portalled panels leave the canvas
36
+ *
37
+ * Once the overlays portal to `document.body`, their panels are no
38
+ * longer inside `canvasElement`, and floating-ui's portal roots
39
+ * (`[data-floating-ui-portal]`) are body children a portable story
40
+ * never unmounts. A previous test's panel therefore lingers next to
41
+ * the live one, and `expectAgentDrivable(body, …)` fails with "2
42
+ * elements match" — the portal analogue of the fixed-position
43
+ * `ToastRegion` bug above. So the same cleanup that detaches stale
44
+ * canvases also removes stale portal roots, and `mountStory` now hands
45
+ * back `body` (scoped to `document.body`) for querying the panels the
46
+ * triggers still open from inside `canvas`.
34
47
  */
35
48
  const mountedCanvases = [];
36
49
  export const mountStory = async (story) => {
37
50
  for (const previous of mountedCanvases.splice(0)) {
38
51
  previous.remove();
39
52
  }
53
+ for (const portalRoot of document.querySelectorAll("[data-floating-ui-portal]")) {
54
+ portalRoot.remove();
55
+ }
40
56
  const canvasElement = document.createElement("div");
41
57
  document.body.append(canvasElement);
42
58
  mountedCanvases.push(canvasElement);
43
59
  await story.run({ canvasElement });
44
- return { canvas: within(canvasElement), canvasElement };
60
+ return {
61
+ body: within(document.body),
62
+ canvas: within(canvasElement),
63
+ canvasElement,
64
+ };
45
65
  };
46
66
  //# sourceMappingURL=mountStory.testHelpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mountStory.testHelpers.js","sourceRoot":"","sources":["../src/mountStory.testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAgBvC;;;;;;;;;;GAUG;AACH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,eAAe,GAAkB,EAAE,CAAA;AAEzC,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,KAAqB,EAIpB,EAAE;IACH,KAAK,MAAM,QAAQ,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,QAAQ,CAAC,MAAM,EAAE,CAAA;IACnB,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAEnD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEnC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAEnC,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC,CAAA;IAElC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;AACzD,CAAC,CAAA"}
1
+ {"version":3,"file":"mountStory.testHelpers.js","sourceRoot":"","sources":["../src/mountStory.testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAgBvC;;;;;;;;;;GAUG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,eAAe,GAAkB,EAAE,CAAA;AAEzC,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAC7B,KAAqB,EAKpB,EAAE;IACH,KAAK,MAAM,QAAQ,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,QAAQ,CAAC,MAAM,EAAE,CAAA;IACnB,CAAC;IAED,KAAK,MAAM,UAAU,IAAI,QAAQ,CAAC,gBAAgB,CAChD,2BAA2B,CAC5B,EAAE,CAAC;QACF,UAAU,CAAC,MAAM,EAAE,CAAA;IACrB,CAAC;IAED,MAAM,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAEnD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAEnC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAEnC,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,CAAC,CAAA;IAElC,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC;QAC7B,aAAa;KACd,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcuterie/ui",
3
- "version": "1.1.0",
3
+ "version": "2.0.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",
@@ -45,7 +45,8 @@
45
45
  "dependencies": {
46
46
  "@charcuterie/logic": "1.1.0",
47
47
  "@charcuterie/tokens": "1.1.0",
48
- "@floating-ui/react": "^0.27.20"
48
+ "@floating-ui/react": "^0.27.20",
49
+ "@tanstack/react-virtual": "^3.13.12"
49
50
  },
50
51
  "peerDependencies": {
51
52
  "react": ">=19",
@@ -0,0 +1,71 @@
1
+ import { Canvas, Controls, Meta } from "@storybook/addon-docs/blocks";
2
+
3
+ import * as ComboboxStories from "./Combobox.stories";
4
+
5
+ <Meta of={ComboboxStories} />
6
+
7
+ # Combobox
8
+
9
+ The searchable, filtering, virtualized picker — the other half of the picker family, and
10
+ the one that consolidates the fleet's hand-rolled dropdowns
11
+ ([decision](../../../docs/decisions/2026-08-03-listbox-and-combobox-are-siblings-of-select.md)).
12
+ Use it when the list is long enough to search or filter; reach for
13
+ [`Listbox`](?path=/docs/components-listbox--docs) for a short rich-option list, and the
14
+ native [`Select`](?path=/docs/components-select--docs) for a plain one.
15
+
16
+ <Canvas of={ComboboxStories.Default} />
17
+
18
+ ## Props
19
+
20
+ <Controls />
21
+
22
+ ## The ARIA is forced, not stylistic
23
+
24
+ Unlike `Listbox`, **focus stays in the text input**, so the active option is tracked with
25
+ `aria-activedescendant`, not roving tabindex. The input is the `role="combobox"`
26
+ (`aria-autocomplete="list"`, `aria-expanded`, `aria-controls`); the popup is a
27
+ `role="listbox"`. Arrows move the active descendant while the caret stays put; Enter
28
+ selects; Escape clears the query before it closes. The options are `<div>`-shaped
29
+ `role="option"`s with **zero** tab stops — a combobox popup legitimately has none.
30
+
31
+ ## Filtering is the consumer's, or the component's
32
+
33
+ Omit `onQueryChange` and the list filters internally by `textValue`. Supply it — a
34
+ react-query search, say — and you own the query: the `options` then arrive pre-filtered,
35
+ and the debounce, the request token, and the per-parent cache stay yours, exactly the way
36
+ `PathPicker` already splits async work.
37
+
38
+ ```tsx
39
+ <Combobox
40
+ isVisible={isVisible}
41
+ onDismiss={hide}
42
+ onQueryChange={setQuery} // omit to filter internally
43
+ onSelect={choose}
44
+ options={results} // pre-filtered when you own the query
45
+ trigger={<Button onClick={toggle}>Search</Button>}
46
+ />
47
+ ```
48
+
49
+ ## Loading, error, empty, footer, creatable, multiple
50
+
51
+ `isLoading` and `error` are panel states (only `PathPicker` had all of them); an empty
52
+ result shows `emptyLabel` and stays open. `footer` is a sticky hint (`LinkPicker`'s "type a
53
+ path directly"). `isCreatable` lets Enter commit the raw query (`AssFieldPicker`), and Tab
54
+ accepts the active suggestion (`PathPicker`). `isMultiple` renders the chosen values as
55
+ removable chips rather than filling the input, and keeps the popup open.
56
+
57
+ <Canvas of={ComboboxStories.AllVariants} />
58
+
59
+ <Canvas of={ComboboxStories.AllStates} />
60
+
61
+ ## Virtualization, and why `aria-setsize` is not optional
62
+
63
+ Above ~100 options (or with `isVirtualized`), the list is windowed with
64
+ `@tanstack/react-virtual` — the second runtime dependency this package has ever taken (MIT,
65
+ US-origin, ~4 KB gz). Because most of the list is not in the DOM, every windowed option
66
+ **must** carry `aria-setsize` and `aria-posinset`, or a screen reader announces "2 of 12"
67
+ for a 4,000-item list. Below the threshold the list is plain DOM.
68
+
69
+ <Canvas of={ComboboxStories.Virtualized} />
70
+
71
+ <Canvas of={ComboboxStories.Interactive} />