@charcuterie/ui 2.14.0 → 2.15.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.
@@ -0,0 +1,83 @@
1
+ import type { ControlSize, IntentName } from "@charcuterie/tokens";
2
+ import type { Placement } from "@floating-ui/react";
3
+ import type { ComponentPropsWithRef, ReactNode } from "react";
4
+ import type { IntentAppearance } from "../intentStyles.ts";
5
+ import type { ListboxItem } from "../Listbox/Listbox.tsx";
6
+ export type PickerOption = ListboxItem;
7
+ export type PickerProps = Omit<ComponentPropsWithRef<"button">, "disabled" | "onChange" | "value"> & {
8
+ appearance?: IntentAppearance;
9
+ className?: string;
10
+ intent?: IntentName;
11
+ isDisabled?: boolean;
12
+ /**
13
+ * What the control is FOR — "Language", "Quantifier", "Rule type".
14
+ * Not the current value; that is read off `options`.
15
+ */
16
+ label: string;
17
+ /**
18
+ * Defaults to a chevron. Pass `null` to drop it — a picker rendered
19
+ * inside a denser control row may not want the affordance, and a
20
+ * refactor moving an existing hand-rolled trigger onto `Picker`
21
+ * stays pixel-identical by passing `null` rather than re-baselining
22
+ * every screenshot that contains it.
23
+ */
24
+ iconEnd?: ReactNode;
25
+ onChange: (value: string) => void;
26
+ options: readonly PickerOption[];
27
+ placement?: Placement;
28
+ /** Read by the trigger when `value` matches no option. */
29
+ placeholder?: string;
30
+ size?: ControlSize;
31
+ value?: string;
32
+ };
33
+ /**
34
+ * A `Listbox` with the trigger already attached — the shape every app
35
+ * reaches for when it wants "a select, but ours".
36
+ *
37
+ * ### Four repos wrote this, and the fourth is this package
38
+ *
39
+ * `Listbox` is deliberately trigger-agnostic: it takes a `trigger`
40
+ * element and owns none of the open state, which is what lets it hang
41
+ * off a button, a tile, a table header. The cost is that the *common*
42
+ * case — a button showing the current value — is about thirty lines,
43
+ * and the fleet wrote them four times: queuepilot's `SelectListbox`,
44
+ * board-games' `SelectMenu` (on `useState` rather than
45
+ * `useVisibility`), mux-magic's `ListboxPicker`, and — the tell —
46
+ * **twice inside this package**, in `QueryBuilderCombinator` and in
47
+ * `QueryBuilder`'s own story. Each also hand-rolled the same chevron.
48
+ *
49
+ * `Listbox` stays exactly as it is. This is the assembled default.
50
+ *
51
+ * ### Why it is not called `SinglePicker`
52
+ *
53
+ * The state layer has `useSinglePicker` and `useMultiplePicker`, so a
54
+ * name near "picker" invites the question of whether this is their
55
+ * component. It is not, and no component is: `useSinglePicker` is a
56
+ * state kind that `Listbox`, `Combobox` and `Tabs` all compose. This
57
+ * component owns a `useVisibility` and delegates selection to
58
+ * `Listbox`, which is where the picker state actually lives. The name
59
+ * is the owner's, chosen over `SelectListbox` and `ListboxButton`.
60
+ *
61
+ * ### The accessible name carries the current value
62
+ *
63
+ * `"Language: English"`, not `"Language"`. The trigger's visible text
64
+ * IS the current value, and WCAG 2.5.3 requires the visible text to be
65
+ * contained in the accessible name — so a bare `aria-label={label}`
66
+ * fails it, which is a latent defect in one of the hand-rolled
67
+ * versions this replaces. It also makes each control uniquely findable
68
+ * when a form has several, which is the property `expectAgentDrivable`
69
+ * exists to protect.
70
+ *
71
+ * Query it as `getByRole("button", { name: /^Language: / })`.
72
+ *
73
+ * ### `id` does not survive; `data-testid` does
74
+ *
75
+ * `useAnchoredOverlay` overwrites the trigger's `id` with a generated
76
+ * one, so the portalled listbox can point `aria-labelledby` across at
77
+ * it. An `id` passed here is therefore silently replaced — queuepilot
78
+ * found this the hard way and switched its e2e handles to
79
+ * `data-testid`, which nothing injects. Everything else on the button
80
+ * (`data-*`, `onClick`, `form`, …) passes straight through.
81
+ */
82
+ export declare const Picker: ({ appearance, className, iconEnd, intent, isDisabled, label, onChange, options, placement, placeholder, size, value, ...buttonProps }: PickerProps) => ReactNode;
83
+ //# sourceMappingURL=Picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../src/Picker/Picker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGzD,MAAM,MAAM,YAAY,GAAG,WAAW,CAAA;AAwBtC,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,UAAU,GAAG,UAAU,GAAG,OAAO,CAClC,GAAG;IACF,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;IAChC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,eAAO,MAAM,MAAM,GAAI,uIAcpB,WAAW,KAAG,SAoDhB,CAAA"}
@@ -0,0 +1,85 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useVisibility } from "@charcuterie/logic";
3
+ import { Button } from "../Button/Button.js";
4
+ import { Listbox } from "../Listbox/Listbox.js";
5
+ /**
6
+ * A constant element rather than a component, for the same reason
7
+ * `Select` inlines its own: a second component in this file trips the
8
+ * house rule, and this never varies.
9
+ */
10
+ const CHEVRON_DOWN = (_jsx("svg", { "aria-hidden": "true", className: "size-4", fill: "none", focusable: false, stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.75, viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "m6 9 6 6 6-6" }) }));
11
+ /**
12
+ * A `Listbox` with the trigger already attached — the shape every app
13
+ * reaches for when it wants "a select, but ours".
14
+ *
15
+ * ### Four repos wrote this, and the fourth is this package
16
+ *
17
+ * `Listbox` is deliberately trigger-agnostic: it takes a `trigger`
18
+ * element and owns none of the open state, which is what lets it hang
19
+ * off a button, a tile, a table header. The cost is that the *common*
20
+ * case — a button showing the current value — is about thirty lines,
21
+ * and the fleet wrote them four times: queuepilot's `SelectListbox`,
22
+ * board-games' `SelectMenu` (on `useState` rather than
23
+ * `useVisibility`), mux-magic's `ListboxPicker`, and — the tell —
24
+ * **twice inside this package**, in `QueryBuilderCombinator` and in
25
+ * `QueryBuilder`'s own story. Each also hand-rolled the same chevron.
26
+ *
27
+ * `Listbox` stays exactly as it is. This is the assembled default.
28
+ *
29
+ * ### Why it is not called `SinglePicker`
30
+ *
31
+ * The state layer has `useSinglePicker` and `useMultiplePicker`, so a
32
+ * name near "picker" invites the question of whether this is their
33
+ * component. It is not, and no component is: `useSinglePicker` is a
34
+ * state kind that `Listbox`, `Combobox` and `Tabs` all compose. This
35
+ * component owns a `useVisibility` and delegates selection to
36
+ * `Listbox`, which is where the picker state actually lives. The name
37
+ * is the owner's, chosen over `SelectListbox` and `ListboxButton`.
38
+ *
39
+ * ### The accessible name carries the current value
40
+ *
41
+ * `"Language: English"`, not `"Language"`. The trigger's visible text
42
+ * IS the current value, and WCAG 2.5.3 requires the visible text to be
43
+ * contained in the accessible name — so a bare `aria-label={label}`
44
+ * fails it, which is a latent defect in one of the hand-rolled
45
+ * versions this replaces. It also makes each control uniquely findable
46
+ * when a form has several, which is the property `expectAgentDrivable`
47
+ * exists to protect.
48
+ *
49
+ * Query it as `getByRole("button", { name: /^Language: / })`.
50
+ *
51
+ * ### `id` does not survive; `data-testid` does
52
+ *
53
+ * `useAnchoredOverlay` overwrites the trigger's `id` with a generated
54
+ * one, so the portalled listbox can point `aria-labelledby` across at
55
+ * it. An `id` passed here is therefore silently replaced — queuepilot
56
+ * found this the hard way and switched its e2e handles to
57
+ * `data-testid`, which nothing injects. Everything else on the button
58
+ * (`data-*`, `onClick`, `form`, …) passes straight through.
59
+ */
60
+ export const Picker = ({ appearance = "outline", className, iconEnd = CHEVRON_DOWN, intent = "neutral", isDisabled = false, label, onChange, options, placement, placeholder, size, value, ...buttonProps }) => {
61
+ const { hide, isVisible, toggle } = useVisibility();
62
+ const currentOption = options.find((option) => option.value === value);
63
+ const currentText = currentOption === undefined
64
+ ? placeholder
65
+ : (currentOption.textValue ??
66
+ (typeof currentOption.label === "string"
67
+ ? currentOption.label
68
+ : undefined));
69
+ const triggerText = currentText ?? placeholder ?? "";
70
+ return (_jsx(Listbox
71
+ // A disabled control must not open, and hiding the panel is a
72
+ // truer way to say that than trusting the trigger's click alone —
73
+ // Escape and outside-press both route through `onDismiss`.
74
+ , {
75
+ // A disabled control must not open, and hiding the panel is a
76
+ // truer way to say that than trusting the trigger's click alone —
77
+ // Escape and outside-press both route through `onDismiss`.
78
+ isVisible: isVisible && !isDisabled, onDismiss: hide, onSelect: onChange, options: options, placement: placement, selectedValue: value, trigger: _jsx(Button, { ...buttonProps, appearance: appearance, "aria-label": `${label}: ${triggerText}`, className: className, iconEnd: iconEnd, intent: intent, isDisabled: isDisabled, onClick: (clickEvent) => {
79
+ buttonProps.onClick?.(clickEvent);
80
+ toggle();
81
+ }, size: size, type: "button", children: currentOption === undefined
82
+ ? placeholder
83
+ : currentOption.label }) }));
84
+ };
85
+ //# sourceMappingURL=Picker.js.map
@@ -0,0 +1 @@
1
+ {"version":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;gBACtC,CAAC,CAAC,aAAa,CAAC,KAAK;gBACrB,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IAErB,MAAM,WAAW,GAAG,WAAW,IAAI,WAAW,IAAI,EAAE,CAAA;IAEpD,OAAO,CACL,KAAC,OAAO;IACN,8DAA8D;IAC9D,kEAAkE;IAClE,2DAA2D;;QAF3D,8DAA8D;QAC9D,kEAAkE;QAClE,2DAA2D;QAC3D,SAAS,EAAE,SAAS,IAAI,CAAC,UAAU,EACnC,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,KAAK,EACpB,OAAO,EACL,KAAC,MAAM,OACD,WAAW,EACf,UAAU,EAAE,UAAU,gBACV,GAAG,KAAK,KAAK,WAAW,EAAE,EACtC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE;gBACtB,WAAW,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAA;gBAEjC,MAAM,EAAE,CAAA;YACV,CAAC,EACD,IAAI,EAAE,IAAI,EACV,IAAI,EAAC,QAAQ,YAEZ,aAAa,KAAK,SAAS;gBAC1B,CAAC,CAAC,WAAW;gBACb,CAAC,CAAC,aAAa,CAAC,KAAK,GAChB,GAEX,CACH,CAAA;AACH,CAAC,CAAA"}
@@ -12,42 +12,21 @@ export type QueryBuilderCombinatorProps<Combinator> = {
12
12
  /**
13
13
  * One group's combinator picker.
14
14
  *
15
- * A `Listbox`, not a native `Select`, per
15
+ * A `Picker` — a `Listbox` with its trigger attached — rather than a
16
+ * native `Select`, per
16
17
  * [the 2026-08-10 demotion](../../../../docs/decisions/2026-08-10-listbox-and-combobox-are-the-default-and-select-is-demoted.md).
17
- * `QueryBuilder` shipped in #84 with a `Select` the day after that
18
- * record landed; `charcuterie/prefer-listbox-over-select` did not
19
- * catch it because the component-choice block is scoped to app
20
- * packages and exempts this one — right for a primitive, wrong for a
21
- * composite an app consumes whole.
18
+ * This file used to assemble the trigger by hand; `Picker` exists
19
+ * because it was the fourth place in the fleet doing so.
22
20
  *
23
- * ### Why this is its own file
21
+ * ### What is left here, and why it is still a component
24
22
  *
25
- * `Listbox` needs a visibility state, and a group renders one picker
26
- * per group inside a recursive `.map`. A hook cannot be called there,
27
- * so the picker becomes a component — the same member-file case as
28
- * `QueryBuilderRow`.
29
- *
30
- * ### The name, and why it is not a `Field`
31
- *
32
- * `Field` wires `<label htmlFor>` by cloning its `id` onto the
33
- * control. `Listbox`'s trigger cannot take one: `useAnchoredOverlay`
34
- * overwrites the cloned trigger's `id` with the one the panel points
35
- * `aria-labelledby` at, so the label would address an element that no
36
- * longer carries that id — the exact defect `Field` exists to
37
- * prevent. So the caption is plain text and the trigger is named with
38
- * `aria-label`.
39
- *
40
- * That name is `"<label>: <current value>"` rather than bare
41
- * `"<label>"` on purpose: the button's visible text is the current
42
- * combinator, and WCAG 2.5.3 wants the visible text contained in the
43
- * accessible name. "Match" alone would fail it; "Match: ALL — every
44
- * condition" reads correctly and keeps each group's control findable
45
- * by name.
46
- *
47
- * The combinator stays opaque here exactly as it is in the rest of
48
- * the component: `String(value)` bridges it to the string-valued
49
- * `Listbox`, and a selection is mapped back to the real `Combinator`
50
- * before it leaves.
23
+ * Only the bridging. `Combinator` is opaque to `QueryBuilder`, so it
24
+ * cannot reach `Picker`'s string-valued API directly: `String(value)`
25
+ * carries it out and the matching option carries it back, so the
26
+ * generic never leaks. The caption is plain text rather than a
27
+ * `Field`, because `useAnchoredOverlay` overwrites the trigger's `id`
28
+ * and a `<label htmlFor>` would then address an element that no longer
29
+ * carries it — the exact defect `Field` exists to prevent.
51
30
  */
52
31
  export declare const QueryBuilderCombinator: <Combinator>({ label, onChange, options, value, }: QueryBuilderCombinatorProps<Combinator>) => ReactNode;
53
32
  //# sourceMappingURL=QueryBuilderCombinator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderCombinator.d.ts","sourceRoot":"","sources":["../../src/QueryBuilder/QueryBuilderCombinator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,MAAM,2BAA2B,CAAC,UAAU,IAAI;IACpD,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAA;IAC1C,OAAO,EAAE,SAAS;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,UAAU,CAAA;KAClB,EAAE,CAAA;IACH,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,EAAG,sCAKjD,2BAA2B,CAAC,UAAU,CAAC,KAAG,SA6C5C,CAAA"}
1
+ {"version":3,"file":"QueryBuilderCombinator.d.ts","sourceRoot":"","sources":["../../src/QueryBuilder/QueryBuilderCombinator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,2BAA2B,CAAC,UAAU,IAAI;IACpD,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,CAAA;IAC1C,OAAO,EAAE,SAAS;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,UAAU,CAAA;KAClB,EAAE,CAAA;IACH,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,EAAG,sCAKjD,2BAA2B,CAAC,UAAU,CAAC,KAAG,SA6B5C,CAAA"}
@@ -1,59 +1,41 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useVisibility } from "@charcuterie/logic";
3
- import { Button } from "../Button/Button.js";
4
- import { Listbox } from "../Listbox/Listbox.js";
2
+ import { Picker } from "../Picker/Picker.js";
5
3
  /**
6
4
  * One group's combinator picker.
7
5
  *
8
- * A `Listbox`, not a native `Select`, per
6
+ * A `Picker` — a `Listbox` with its trigger attached — rather than a
7
+ * native `Select`, per
9
8
  * [the 2026-08-10 demotion](../../../../docs/decisions/2026-08-10-listbox-and-combobox-are-the-default-and-select-is-demoted.md).
10
- * `QueryBuilder` shipped in #84 with a `Select` the day after that
11
- * record landed; `charcuterie/prefer-listbox-over-select` did not
12
- * catch it because the component-choice block is scoped to app
13
- * packages and exempts this one — right for a primitive, wrong for a
14
- * composite an app consumes whole.
9
+ * This file used to assemble the trigger by hand; `Picker` exists
10
+ * because it was the fourth place in the fleet doing so.
15
11
  *
16
- * ### Why this is its own file
12
+ * ### What is left here, and why it is still a component
17
13
  *
18
- * `Listbox` needs a visibility state, and a group renders one picker
19
- * per group inside a recursive `.map`. A hook cannot be called there,
20
- * so the picker becomes a component — the same member-file case as
21
- * `QueryBuilderRow`.
22
- *
23
- * ### The name, and why it is not a `Field`
24
- *
25
- * `Field` wires `<label htmlFor>` by cloning its `id` onto the
26
- * control. `Listbox`'s trigger cannot take one: `useAnchoredOverlay`
27
- * overwrites the cloned trigger's `id` with the one the panel points
28
- * `aria-labelledby` at, so the label would address an element that no
29
- * longer carries that id — the exact defect `Field` exists to
30
- * prevent. So the caption is plain text and the trigger is named with
31
- * `aria-label`.
32
- *
33
- * That name is `"<label>: <current value>"` rather than bare
34
- * `"<label>"` on purpose: the button's visible text is the current
35
- * combinator, and WCAG 2.5.3 wants the visible text contained in the
36
- * accessible name. "Match" alone would fail it; "Match: ALL — every
37
- * condition" reads correctly and keeps each group's control findable
38
- * by name.
39
- *
40
- * The combinator stays opaque here exactly as it is in the rest of
41
- * the component: `String(value)` bridges it to the string-valued
42
- * `Listbox`, and a selection is mapped back to the real `Combinator`
43
- * before it leaves.
14
+ * Only the bridging. `Combinator` is opaque to `QueryBuilder`, so it
15
+ * cannot reach `Picker`'s string-valued API directly: `String(value)`
16
+ * carries it out and the matching option carries it back, so the
17
+ * generic never leaks. The caption is plain text rather than a
18
+ * `Field`, because `useAnchoredOverlay` overwrites the trigger's `id`
19
+ * and a `<label htmlFor>` would then address an element that no longer
20
+ * carries it — the exact defect `Field` exists to prevent.
44
21
  */
45
- export const QueryBuilderCombinator = ({ label, onChange, options, value, }) => {
46
- const { hide, isVisible, toggle } = useVisibility();
47
- const currentOption = options.find((option) => String(option.value) === String(value));
48
- const currentLabel = currentOption?.label ?? "";
49
- return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "font-medium text-content-primary text-sm", children: label }), _jsx(Listbox, { isVisible: isVisible, onDismiss: hide, onSelect: (nextValue) => {
50
- const match = options.find((option) => String(option.value) === nextValue);
51
- if (match) {
52
- onChange(match.value);
53
- }
54
- }, options: options.map((option) => ({
55
- label: option.label,
56
- value: String(option.value),
57
- })), selectedValue: String(value), trigger: _jsx(Button, { appearance: "outline", "aria-label": `${label}: ${currentLabel}`, intent: "neutral", onClick: toggle, children: currentLabel }) })] }));
58
- };
22
+ export const QueryBuilderCombinator = ({ label, onChange, options, value, }) => (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "font-medium text-content-primary text-sm", children: label }), _jsx(Picker
23
+ // No chevron: this is a refactor onto the shared component, and
24
+ // the trigger that shipped in 2.14.0 had none. Adding the
25
+ // affordance here is a visual change and belongs in its own PR,
26
+ // not smuggled in under an extraction.
27
+ , {
28
+ // No chevron: this is a refactor onto the shared component, and
29
+ // the trigger that shipped in 2.14.0 had none. Adding the
30
+ // affordance here is a visual change and belongs in its own PR,
31
+ // not smuggled in under an extraction.
32
+ iconEnd: null, label: label, onChange: (nextValue) => {
33
+ const match = options.find((option) => String(option.value) === nextValue);
34
+ if (match) {
35
+ onChange(match.value);
36
+ }
37
+ }, options: options.map((option) => ({
38
+ label: option.label,
39
+ value: String(option.value),
40
+ })), value: String(value) })] }));
59
41
  //# sourceMappingURL=QueryBuilderCombinator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"QueryBuilderCombinator.js","sourceRoot":"","sources":["../../src/QueryBuilder/QueryBuilderCombinator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAsB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAwB,CAAA;AAahD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAc,EAClD,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,GACmC,EAAa,EAAE;IACvD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CAAA;IAEnD,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAChC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,CACnD,CAAA;IAED,MAAM,YAAY,GAAG,aAAa,EAAE,KAAK,IAAI,EAAE,CAAA;IAE/C,OAAO,CACL,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAM,SAAS,EAAC,0CAA0C,YACvD,KAAK,GACD,EAEP,KAAC,OAAO,IACN,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;oBACtB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CACxB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAC/C,CAAA;oBAED,IAAI,KAAK,EAAE,CAAC;wBACV,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;oBACvB,CAAC;gBACH,CAAC,EACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;oBAChC,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC5B,CAAC,CAAC,EACH,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,EAC5B,OAAO,EACL,KAAC,MAAM,IACL,UAAU,EAAC,SAAS,gBACR,GAAG,KAAK,KAAK,YAAY,EAAE,EACvC,MAAM,EAAC,SAAS,EAChB,OAAO,EAAE,MAAM,YAEd,YAAY,GACN,GAEX,IACE,CACP,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"QueryBuilderCombinator.js","sourceRoot":"","sources":["../../src/QueryBuilder/QueryBuilderCombinator.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAsB,CAAA;AAa7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAc,EAClD,KAAK,EACL,QAAQ,EACR,OAAO,EACP,KAAK,GACmC,EAAa,EAAE,CAAC,CACxD,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAM,SAAS,EAAC,0CAA0C,YACvD,KAAK,GACD,EAEP,KAAC,MAAM;QACL,gEAAgE;QAChE,0DAA0D;QAC1D,gEAAgE;QAChE,uCAAuC;;YAHvC,gEAAgE;YAChE,0DAA0D;YAC1D,gEAAgE;YAChE,uCAAuC;YACvC,OAAO,EAAE,IAAI,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE;gBACtB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CACxB,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,SAAS,CAC/C,CAAA;gBAED,IAAI,KAAK,EAAE,CAAC;oBACV,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;gBACvB,CAAC;YACH,CAAC,EACD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAChC,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aAC5B,CAAC,CAAC,EACH,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GACpB,IACE,CACP,CAAA"}
package/dist/index.d.ts CHANGED
@@ -92,6 +92,8 @@ export type { MenuItem, MenuProps, } from "./Menu/Menu.tsx";
92
92
  export { Menu } from "./Menu/Menu.tsx";
93
93
  export type { ModalProps } from "./Modal/Modal.tsx";
94
94
  export { Modal } from "./Modal/Modal.tsx";
95
+ export type { PickerOption, PickerProps, } from "./Picker/Picker.tsx";
96
+ export { Picker } from "./Picker/Picker.tsx";
95
97
  export type { PopoverProps } from "./Popover/Popover.tsx";
96
98
  export { Popover } from "./Popover/Popover.tsx";
97
99
  export type { ProgressBarProps, ProgressBarSize, } from "./ProgressBar/ProgressBar.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,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC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Aa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,OAAO,EACP,cAAc,EACd,eAAe,EACf,SAAS,GACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,YAAY,EACV,kBAAkB,EAClB,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EACV,WAAW,EACX,gBAAgB,GACjB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,YAAY,EACV,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAA"}
package/dist/index.js CHANGED
@@ -61,6 +61,7 @@ export { MediaTile } from "./MediaTile/MediaTile.js";
61
61
  export { mediaTransitions } from "./MediaTile/mediaStatus.js";
62
62
  export { Menu } from "./Menu/Menu.js";
63
63
  export { Modal } from "./Modal/Modal.js";
64
+ export { Picker } from "./Picker/Picker.js";
64
65
  export { Popover } from "./Popover/Popover.js";
65
66
  export { ProgressBar } from "./ProgressBar/ProgressBar.js";
66
67
  export { getProgressIntent, toProgressPercent, toProgressValue, } from "./ProgressBar/progressValue.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;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAiC,CAAA;AAE9D,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AAKxC,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAK7C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAmB,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAqB,CAAA;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA6B,CAAA;AAMxD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAiB,CAAA;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAyB,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA+C,CAAA;AAKnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA2C,CAAA;AAE7E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAyB,CAAA;AAElD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB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B,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAqC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charcuterie/ui",
3
- "version": "2.14.0",
3
+ "version": "2.15.1",
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",
@@ -48,7 +48,7 @@
48
48
  "typecheck": "tsc --noEmit"
49
49
  },
50
50
  "dependencies": {
51
- "@charcuterie/logic": "1.5.0",
51
+ "@charcuterie/logic": "2.0.0",
52
52
  "@charcuterie/tokens": "1.5.0",
53
53
  "@floating-ui/react": "^0.27.20",
54
54
  "@tanstack/react-virtual": "^3.13.12"
@@ -0,0 +1,63 @@
1
+ import { Canvas, Meta } from "@storybook/addon-docs/blocks"
2
+
3
+ import * as PickerStories from "./Picker.stories.tsx"
4
+
5
+ <Meta of={PickerStories} />
6
+
7
+ # Picker
8
+
9
+ A `Listbox` with its trigger already attached — the shape an app reaches for when it wants
10
+ "a select, but ours".
11
+
12
+ <Canvas of={PickerStories.Default} />
13
+
14
+ ## Why this exists when `Listbox` already does
15
+
16
+ `Listbox` is deliberately trigger-agnostic. It takes a `trigger` element and owns none of the
17
+ open state, which is what lets it hang off a button, a tile, or a table header. The cost is
18
+ that the *common* case — a button showing the current value, with a chevron — is about thirty
19
+ lines, and the fleet wrote those lines **four separate times**: queuepilot's
20
+ `SelectListbox`, board-games' `SelectMenu` (on `useState` rather than `useVisibility`),
21
+ mux-magic's `ListboxPicker`, and twice inside this package (`QueryBuilderCombinator` and
22
+ `QueryBuilder`'s own story). Each hand-rolled the same chevron.
23
+
24
+ `Listbox` is unchanged. `Picker` is the assembled default; reach for `Listbox` directly when
25
+ the trigger is not a button.
26
+
27
+ ## The accessible name carries the current value
28
+
29
+ `"Language: English"`, not `"Language"`. The trigger's visible text **is** the value, and
30
+ WCAG 2.5.3 requires the visible text to be contained in the accessible name — a bare
31
+ `aria-label={label}` fails it. It also keeps each control uniquely findable when a form has
32
+ several:
33
+
34
+ ```tsx
35
+ getByRole("button", { name: /^Language: / })
36
+ ```
37
+
38
+ <Canvas of={PickerStories.Interactive} />
39
+
40
+ ## Rich options need a `textValue`
41
+
42
+ `label` takes a `ReactNode` — a flag, a badge, two lines. When it is not a plain string, give
43
+ the option a `textValue`: it is the type-ahead target, and it is what the trigger and the
44
+ accessible name read, so the button says `Audio track: English` rather than the flattened
45
+ text of the whole node.
46
+
47
+ <Canvas of={PickerStories.AllStates} />
48
+
49
+ ## `id` does not survive; `data-testid` does
50
+
51
+ `useAnchoredOverlay` overwrites the trigger's `id` with a generated one so the portalled
52
+ listbox can point `aria-labelledby` across at it. An `id` passed to `Picker` is therefore
53
+ silently replaced — queuepilot found this the hard way and moved its e2e handles to
54
+ `data-testid`, which nothing injects. Every other button prop (`data-*`, `onClick`, `form`,
55
+ …) passes straight through; an `onClick` you pass runs before the panel toggles, which is how
56
+ a picker inside a clickable row stops the event reaching its parent.
57
+
58
+ ## Not the component of `useSinglePicker`
59
+
60
+ The state layer has `useSinglePicker` and `useMultiplePicker`, and the name invites the
61
+ question. `useSinglePicker` is a **state kind** that `Listbox`, `Combobox` and `Tabs` all
62
+ compose; it has no component of its own. `Picker` owns a `useVisibility` and delegates
63
+ selection to `Listbox`, which is where that state actually lives.