@charcuterie/ui 3.1.0 → 3.3.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/dist/Dialog/Dialog.d.ts +12 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +2 -2
- package/dist/Dialog/Dialog.js.map +1 -1
- package/dist/Field/Field.d.ts +1 -1
- package/dist/Modal/Modal.d.ts +6 -2
- package/dist/Modal/Modal.d.ts.map +1 -1
- package/dist/Modal/Modal.js +1 -1
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/Overlay/OverlayPanel.d.ts +13 -2
- package/dist/Overlay/OverlayPanel.d.ts.map +1 -1
- package/dist/Overlay/OverlayPanel.js +5 -1
- package/dist/Overlay/OverlayPanel.js.map +1 -1
- package/dist/Select/Select.d.ts +43 -2
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.js +27 -2
- package/dist/Select/Select.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/Dialog/Dialog.stories.tsx +48 -0
- package/src/Dialog/Dialog.test.tsx +30 -0
- package/src/Dialog/Dialog.tsx +13 -1
- package/src/Field/Field.mdx +2 -2
- package/src/Field/Field.stories.tsx +9 -5
- package/src/Field/Field.test.tsx +8 -6
- package/src/Field/Field.tsx +1 -1
- package/src/Modal/Modal.tsx +7 -1
- package/src/Overlay/OverlayPanel.tsx +17 -1
- package/src/Select/Select.mdx +27 -1
- package/src/Select/Select.stories.tsx +6 -1
- package/src/Select/Select.tsx +43 -2
- package/src/index.ts +5 -0
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
2
|
export type DialogSize = "full" | "lg" | "md" | "sm" | "xl";
|
|
3
3
|
export type DialogProps = {
|
|
4
4
|
/**
|
|
@@ -17,6 +17,16 @@ export type DialogProps = {
|
|
|
17
17
|
* Escape and a backdrop press both close. Off for the one honest
|
|
18
18
|
* case — a destructive confirm the user has to answer.
|
|
19
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* Which element takes the caret when the dialog opens.
|
|
22
|
+
*
|
|
23
|
+
* A dialog wrapping a form wants its first field, not the Close
|
|
24
|
+
* button the focus manager would otherwise pick — and a consumer
|
|
25
|
+
* cannot fix that from outside, because focusing in its own
|
|
26
|
+
* effect races the manager and loses. Docket's capture dialog is
|
|
27
|
+
* the case: every keystroke landed on "Close".
|
|
28
|
+
*/
|
|
29
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
20
30
|
isDismissable?: boolean;
|
|
21
31
|
isVisible: boolean;
|
|
22
32
|
/**
|
|
@@ -49,5 +59,5 @@ export type DialogProps = {
|
|
|
49
59
|
* "dialog" and nothing else, which is what every hand-rolled modal in
|
|
50
60
|
* the inventory does.
|
|
51
61
|
*/
|
|
52
|
-
export declare const Dialog: ({ children, className, footer, heading, headingLevel, isDismissable, isVisible, onClose, size, }: DialogProps) => ReactNode;
|
|
62
|
+
export declare const Dialog: ({ children, className, footer, heading, headingLevel, initialFocus, isDismissable, isVisible, onClose, size, }: DialogProps) => ReactNode;
|
|
53
63
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE3D,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACxB;;;OAGG;IACH;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC5C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB,CAAA;AAqBD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,MAAM,GAAI,gHAWpB,WAAW,KAAG,SA6DhB,CAAA"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -44,10 +44,10 @@ const SIZE_CLASS = {
|
|
|
44
44
|
* "dialog" and nothing else, which is what every hand-rolled modal in
|
|
45
45
|
* the inventory does.
|
|
46
46
|
*/
|
|
47
|
-
export const Dialog = ({ children, className, footer, heading, headingLevel = 2, isDismissable = true, isVisible, onClose, size = "md", }) => {
|
|
47
|
+
export const Dialog = ({ children, className, footer, heading, headingLevel = 2, initialFocus, isDismissable = true, isVisible, onClose, size = "md", }) => {
|
|
48
48
|
const headingId = useUniqueId();
|
|
49
49
|
const Heading = `h${headingLevel}`;
|
|
50
|
-
return (_jsxs(Modal, { "aria-labelledby": headingId, className: toClassName(SIZE_CLASS[size], className), isDismissable: isDismissable, isVisible: isVisible, onClose: onClose, children: [_jsxs("header", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border-subtle p-4", children: [_jsx(Heading, { className: "font-semibold text-lg leading-tight", id: headingId, children: heading }), isDismissable ? (_jsx(Button, { appearance: "ghost", intent: "neutral", onClick: onClose, size: "sm", children: "Close" })) : null] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto p-4",
|
|
50
|
+
return (_jsxs(Modal, { "aria-labelledby": headingId, className: toClassName(SIZE_CLASS[size], className), initialFocus: initialFocus, isDismissable: isDismissable, isVisible: isVisible, onClose: onClose, children: [_jsxs("header", { className: "flex shrink-0 items-center justify-between gap-3 border-b border-border-subtle p-4", children: [_jsx(Heading, { className: "font-semibold text-lg leading-tight", id: headingId, children: heading }), isDismissable ? (_jsx(Button, { appearance: "ghost", intent: "neutral", onClick: onClose, size: "sm", children: "Close" })) : null] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto p-4",
|
|
51
51
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: a scroll container must be focusable or a keyboard user can see the pane and cannot scroll it — axe's `scrollable-region-focusable`, which fails this component without the line. Same call, and the same wording, as `LogViewer`'s scroll pane. The rule is right about `<div>`s in general and wrong about scrollers.
|
|
52
52
|
tabIndex: 0, children: children }), footer ? (_jsx("footer", { className: "flex shrink-0 flex-wrap justify-end gap-2 border-t border-border-subtle p-4", children: footer })) : null] }));
|
|
53
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAsB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAoB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,MAAM,EAAE,MAAM,qB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C,CAAC,IAAI,IACD,EAcT,cACE,SAAS,EAAC,kCAAkC;gBAC5C,2WAA2W;gBAC3W,QAAQ,EAAE,CAAC,YAEV,QAAQ,GACL,EAEL,MAAM,CAAC,CAAC,CAAC,CACR,iBAAQ,SAAS,EAAC,6EAA6E,YAC5F,MAAM,GACA,CACV,CAAC,CAAC,CAAC,IAAI,IACF,CACT,CAAA;AACH,CAAC,CAAA"}
|
package/dist/Field/Field.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type FieldProps = SlotProps & {
|
|
|
4
4
|
/**
|
|
5
5
|
* The control. **Cloned, not wrapped** — the same slot contract
|
|
6
6
|
* as `Popover`'s trigger, so a `Field` can go around an `<input>`,
|
|
7
|
-
* a `<textarea>`, a `
|
|
7
|
+
* a `<textarea>`, a `Picker`, or an app's own control without
|
|
8
8
|
* changing that control's layout.
|
|
9
9
|
*/
|
|
10
10
|
children: ReactElement;
|
package/dist/Modal/Modal.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
2
|
export type ModalProps = {
|
|
3
3
|
"aria-label"?: string;
|
|
4
4
|
"aria-labelledby"?: string;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
+
/** Which element takes the caret when the modal opens. Without
|
|
8
|
+
* it the focus manager takes the first tabbable element — the
|
|
9
|
+
* Close button on anything with chrome. */
|
|
10
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
7
11
|
/** Escape and a backdrop press both close. */
|
|
8
12
|
isDismissable?: boolean;
|
|
9
13
|
isVisible: boolean;
|
|
@@ -14,5 +18,5 @@ export type ModalProps = {
|
|
|
14
18
|
onClose: () => void;
|
|
15
19
|
role?: "alertdialog" | "dialog";
|
|
16
20
|
};
|
|
17
|
-
export declare const Modal: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, isDismissable, isVisible, onClose, role, }: ModalProps) => ReactNode;
|
|
21
|
+
export declare const Modal: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, initialFocus, isDismissable, isVisible, onClose, role, }: ModalProps) => ReactNode;
|
|
18
22
|
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;+CAE2C;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAC5C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAA;CAChC,CAAA;AAqCD,eAAO,MAAM,KAAK,GAAI,6IAUnB,UAAU,KAAG,SAaf,CAAA"}
|
package/dist/Modal/Modal.js
CHANGED
|
@@ -34,5 +34,5 @@ import { toClassName } from "../toClassName.js";
|
|
|
34
34
|
* and dismiss top-first.
|
|
35
35
|
*/
|
|
36
36
|
const MODAL_BOX_CLASS = "flex max-h-[85dvh] flex-col overflow-hidden rounded-lg border border-border-default bg-surface-overlay text-content-primary shadow-high";
|
|
37
|
-
export const Modal = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, isDismissable = true, isVisible, onClose, role = "dialog", }) => (_jsx(OverlayPanel, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: toClassName(MODAL_BOX_CLASS, className), isDismissable: isDismissable, isVisible: isVisible, onClose: onClose, role: role, children: children }));
|
|
37
|
+
export const Modal = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, initialFocus, isDismissable = true, isVisible, onClose, role = "dialog", }) => (_jsx(OverlayPanel, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className: toClassName(MODAL_BOX_CLASS, className), initialFocus: initialFocus, isDismissable: isDismissable, isVisible: isVisible, onClose: onClose, role: role, children: children }));
|
|
38
38
|
//# sourceMappingURL=Modal.js.map
|
package/dist/Modal/Modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA6B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Modal.js","sourceRoot":"","sources":["../../src/Modal/Modal.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA6B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAsB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,eAAe,GACnB,yIAAyI,CAAA;AAE3I,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,aAAa,GAAG,IAAI,EACpB,SAAS,EACT,OAAO,EACP,IAAI,GAAG,QAAQ,GACJ,EAAa,EAAE,CAAC,CAC3B,KAAC,YAAY,kBACC,SAAS,qBACJ,cAAc,EAC/B,SAAS,EAAE,WAAW,CAAC,eAAe,EAAE,SAAS,CAAC,EAClD,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,YAET,QAAQ,GACI,CAChB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* The portalled, backdrop-backed, focus-trapping panel that `Modal`
|
|
4
4
|
* renders. No chrome — that is `Dialog`'s job — only the four things
|
|
@@ -40,11 +40,22 @@ export type OverlayPanelProps = {
|
|
|
40
40
|
"aria-labelledby"?: string;
|
|
41
41
|
children: ReactNode;
|
|
42
42
|
className?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Which element takes the caret when the panel opens.
|
|
45
|
+
*
|
|
46
|
+
* Without it the focus manager takes the first tabbable element,
|
|
47
|
+
* which for anything with chrome is the **Close button** — so a
|
|
48
|
+
* panel wrapping a form opens with the caret on "Close" and the
|
|
49
|
+
* first thing typed goes nowhere. A consumer cannot fix that from
|
|
50
|
+
* outside: focusing in its own effect races the manager, and the
|
|
51
|
+
* manager wins, which reads as the app ignoring you.
|
|
52
|
+
*/
|
|
53
|
+
initialFocus?: RefObject<HTMLElement | null>;
|
|
43
54
|
/** Escape and an outside press both close. */
|
|
44
55
|
isDismissable?: boolean;
|
|
45
56
|
isVisible: boolean;
|
|
46
57
|
onClose: () => void;
|
|
47
58
|
role?: "alertdialog" | "dialog";
|
|
48
59
|
};
|
|
49
|
-
export declare const OverlayPanel: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, isDismissable, isVisible, onClose, role, }: OverlayPanelProps) => ReactNode;
|
|
60
|
+
export declare const OverlayPanel: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, initialFocus, isDismissable, isVisible, onClose, role, }: OverlayPanelProps) => ReactNode;
|
|
50
61
|
//# sourceMappingURL=OverlayPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverlayPanel.d.ts","sourceRoot":"","sources":["../../src/Overlay/OverlayPanel.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
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,SA0HtB,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { useCallback, useEffect } from "react";
|
|
|
5
5
|
import { lockScrollBehind } from "./lockScrollBehind.js";
|
|
6
6
|
import { useOverlayStack } from "./OverlayStack.js";
|
|
7
7
|
import { SharedBackdrop } from "./SharedBackdrop.js";
|
|
8
|
-
export const OverlayPanel = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, isDismissable = true, isVisible, onClose, role = "dialog", }) => {
|
|
8
|
+
export const OverlayPanel = ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children, className, initialFocus, isDismissable = true, isVisible, onClose, role = "dialog", }) => {
|
|
9
9
|
const stack = useOverlayStack();
|
|
10
10
|
const id = useUniqueId();
|
|
11
11
|
// A stable close, so registering it does not churn the stack as the
|
|
@@ -59,6 +59,10 @@ export const OverlayPanel = ({ "aria-label": ariaLabel, "aria-labelledby": ariaL
|
|
|
59
59
|
return null;
|
|
60
60
|
}
|
|
61
61
|
return (_jsxs(_Fragment, { children: [stack.isProvided ? null : (_jsx(SharedBackdrop, { isVisible: true })), _jsx(FloatingPortal, { children: _jsx("div", { className: "fixed inset-0 z-[var(--layer-modal)] flex items-center justify-center", children: _jsx(FloatingFocusManager, { context: context,
|
|
62
|
+
// `undefined` keeps the manager's own default (the first
|
|
63
|
+
// tabbable), so nothing changes for a panel that does not
|
|
64
|
+
// ask.
|
|
65
|
+
initialFocus: initialFocus ?? undefined,
|
|
62
66
|
// Only the top traps focus; a lower panel is `inert`
|
|
63
67
|
// anyway, and two live traps fight over one caret.
|
|
64
68
|
disabled: !isTop, modal: true, children: _jsx("div", { ...getFloatingProps(), "aria-label": ariaLabel,
|
|
@@ -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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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,cAAK,SAAS,EAAC,uEAAuE,YACpF,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"}
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import type { ControlSize } from "@charcuterie/tokens";
|
|
2
2
|
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Part of the deprecated native `Select`. The
|
|
5
|
+
* replacement shape is `PickerOption` / `ListboxItem`, whose
|
|
6
|
+
* `label` is a `ReactNode` rather than a `string`.
|
|
7
|
+
*/
|
|
3
8
|
export type SelectOption = {
|
|
4
9
|
isDisabled?: boolean;
|
|
5
10
|
label: string;
|
|
6
11
|
value: string;
|
|
7
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Part of the deprecated native `Select`. `Listbox`
|
|
15
|
+
* has **no `<optgroup>` equivalent**, so a grouped picker is the
|
|
16
|
+
* one shape this deprecation has no replacement for — an app that
|
|
17
|
+
* needs one is a change to `Listbox`, not a reason to keep
|
|
18
|
+
* reaching for the native control.
|
|
19
|
+
*/
|
|
8
20
|
export type SelectOptionGroup = {
|
|
9
21
|
label: string;
|
|
10
22
|
options: readonly SelectOption[];
|
|
11
23
|
};
|
|
24
|
+
/** @deprecated Part of the deprecated native `Select`. */
|
|
12
25
|
export type SelectItem = SelectOption | SelectOptionGroup;
|
|
13
26
|
/**
|
|
27
|
+
* @deprecated Part of the deprecated native `Select` — see the
|
|
28
|
+
* component's docblock. `PickerProps` is the replacement.
|
|
29
|
+
*
|
|
14
30
|
* The HTML attributes are passed through, and that is not
|
|
15
31
|
* convenience — it is what makes the `Field` slot work at all.
|
|
16
32
|
*
|
|
@@ -72,8 +88,33 @@ export type SelectProps = Omit<ComponentPropsWithRef<"select">, "disabled" | "on
|
|
|
72
88
|
value?: string;
|
|
73
89
|
};
|
|
74
90
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
91
|
+
* @deprecated Reach for `Picker` — a `Listbox` with the trigger
|
|
92
|
+
* already attached, and a near drop-in for this component
|
|
93
|
+
* (`label`, `options`, `value`, `onChange`) — or `Combobox` when
|
|
94
|
+
* the list is long enough to want typing.
|
|
95
|
+
*
|
|
96
|
+
* A styled native `<select>`, kept only so the call sites that
|
|
97
|
+
* already have one keep compiling while they are converted.
|
|
98
|
+
*
|
|
99
|
+
* ### Deprecated 2026-08-20, and the platform hatch is closed
|
|
100
|
+
*
|
|
101
|
+
* The 2026-08-10 record demoted this to a stated-reason exception
|
|
102
|
+
* and named four cases where the platform behaviour is the
|
|
103
|
+
* feature: the mobile wheel picker, autofill, `:invalid`, and a
|
|
104
|
+
* form that posts with no JS. **None of them has ever applied to
|
|
105
|
+
* an app in this fleet**, and the exception is what agents kept
|
|
106
|
+
* reading as permission — so the exception is gone. A new native
|
|
107
|
+
* `Select` is a new decision with the reason written down, not a
|
|
108
|
+
* call-site choice.
|
|
109
|
+
*
|
|
110
|
+
* The objection is that the popup is painted by the OS. No token,
|
|
111
|
+
* no class and no amount of `appearance-none` reaches inside it,
|
|
112
|
+
* so a fleet with any of these in it has two focus treatments, two
|
|
113
|
+
* hover treatments and two keyboard feels — which is the thing the
|
|
114
|
+
* library exists to stop.
|
|
115
|
+
*
|
|
116
|
+
* Everything below is how the component works, for the call sites
|
|
117
|
+
* still on it. It is not a reason to add one.
|
|
77
118
|
*
|
|
78
119
|
* ### Sizing: `className` is the wrapper, `controlClassName` is the select
|
|
79
120
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAEV,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAA;AASd,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,iBAAiB,CAAA;AAEzD
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAEV,qBAAqB,EACrB,SAAS,EACV,MAAM,OAAO,CAAA;AASd;;;;GAIG;AACH,MAAM,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|
|
|
4
4
|
import { toClassName } from "../toClassName.js";
|
|
5
5
|
const getIsGroup = (item) => "options" in item;
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* @deprecated Reach for `Picker` — a `Listbox` with the trigger
|
|
8
|
+
* already attached, and a near drop-in for this component
|
|
9
|
+
* (`label`, `options`, `value`, `onChange`) — or `Combobox` when
|
|
10
|
+
* the list is long enough to want typing.
|
|
11
|
+
*
|
|
12
|
+
* A styled native `<select>`, kept only so the call sites that
|
|
13
|
+
* already have one keep compiling while they are converted.
|
|
14
|
+
*
|
|
15
|
+
* ### Deprecated 2026-08-20, and the platform hatch is closed
|
|
16
|
+
*
|
|
17
|
+
* The 2026-08-10 record demoted this to a stated-reason exception
|
|
18
|
+
* and named four cases where the platform behaviour is the
|
|
19
|
+
* feature: the mobile wheel picker, autofill, `:invalid`, and a
|
|
20
|
+
* form that posts with no JS. **None of them has ever applied to
|
|
21
|
+
* an app in this fleet**, and the exception is what agents kept
|
|
22
|
+
* reading as permission — so the exception is gone. A new native
|
|
23
|
+
* `Select` is a new decision with the reason written down, not a
|
|
24
|
+
* call-site choice.
|
|
25
|
+
*
|
|
26
|
+
* The objection is that the popup is painted by the OS. No token,
|
|
27
|
+
* no class and no amount of `appearance-none` reaches inside it,
|
|
28
|
+
* so a fleet with any of these in it has two focus treatments, two
|
|
29
|
+
* hover treatments and two keyboard feels — which is the thing the
|
|
30
|
+
* library exists to stop.
|
|
31
|
+
*
|
|
32
|
+
* Everything below is how the component works, for the call sites
|
|
33
|
+
* still on it. It is not a reason to add one.
|
|
9
34
|
*
|
|
10
35
|
* ### Sizing: `className` is the wrapper, `controlClassName` is the select
|
|
11
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/Select/Select.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EACL,cAAc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AAE,IAAI,EACjB,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B,YAElC,eAAM,CAAC,EAAC,cAAc,GAAG,GACrB,IACF,CACP,CAAA"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EAC1B,iCAAiC,EACjC,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,iCAAiC,CAAA;AACxC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EACL,6BAA6B,EAC7B,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,sCAAsC,CAAA;AAC7C,YAAY,EACV,UAAU,EACV,SAAS,GACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EACV,SAAS,EACT,UAAU,GACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACt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AAO,EAAE,OAAO,EAAE,MAAM,sBAAuB,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,7 @@
|
|
|
1
1
|
import { useVisibility } from "@charcuterie/logic"
|
|
2
2
|
import type { Meta, StoryObj } from "@storybook/react"
|
|
3
3
|
import type { ReactNode } from "react"
|
|
4
|
+
import { useRef } from "react"
|
|
4
5
|
|
|
5
6
|
import { toStoryChoice } from "../argTypes.storyHelpers.ts"
|
|
6
7
|
import { Button } from "../Button/Button.tsx"
|
|
@@ -92,6 +93,34 @@ const DialogDemo = ({
|
|
|
92
93
|
)
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
const InitialFocusDemo = (): ReactNode => {
|
|
97
|
+
const { hide, isVisible, show } = useVisibility()
|
|
98
|
+
const titleRef = useRef<HTMLInputElement>(null)
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<>
|
|
102
|
+
<Button appearance="soft" onClick={show} size="sm">
|
|
103
|
+
Add a title
|
|
104
|
+
</Button>
|
|
105
|
+
|
|
106
|
+
<Dialog
|
|
107
|
+
heading="Add a title"
|
|
108
|
+
initialFocus={titleRef}
|
|
109
|
+
isVisible={isVisible}
|
|
110
|
+
onClose={hide}
|
|
111
|
+
>
|
|
112
|
+
<label className="flex flex-col gap-1 text-sm">
|
|
113
|
+
Title
|
|
114
|
+
<input
|
|
115
|
+
className="rounded-md border border-border-subtle bg-surface-base px-3 py-2"
|
|
116
|
+
ref={titleRef}
|
|
117
|
+
/>
|
|
118
|
+
</label>
|
|
119
|
+
</Dialog>
|
|
120
|
+
</>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
95
124
|
export const Default: Story = {
|
|
96
125
|
args: {
|
|
97
126
|
heading: "Bay 3",
|
|
@@ -366,6 +395,25 @@ export const NoBody: Story = {
|
|
|
366
395
|
render: () => <NoBodyDemo />,
|
|
367
396
|
}
|
|
368
397
|
|
|
398
|
+
/**
|
|
399
|
+
* A dialog that wraps a FORM wants the caret in its first field,
|
|
400
|
+
* not on the Close button the focus manager would otherwise pick.
|
|
401
|
+
*
|
|
402
|
+
* This is not a nicety: a capture dialog exists to be typed into
|
|
403
|
+
* the moment it opens, and without `initialFocus` the first thing
|
|
404
|
+
* typed goes to a button and vanishes. A consumer cannot fix it
|
|
405
|
+
* from outside — focusing in its own effect races the focus
|
|
406
|
+
* manager, and the manager wins.
|
|
407
|
+
*/
|
|
408
|
+
export const InitialFocus: Story = {
|
|
409
|
+
args: {
|
|
410
|
+
heading: "Bay 3",
|
|
411
|
+
isVisible: false,
|
|
412
|
+
onClose: () => {},
|
|
413
|
+
},
|
|
414
|
+
render: () => <InitialFocusDemo />,
|
|
415
|
+
}
|
|
416
|
+
|
|
369
417
|
export const Interactive: Story = {
|
|
370
418
|
args: {
|
|
371
419
|
heading: "Bay 3",
|
|
@@ -14,6 +14,7 @@ const {
|
|
|
14
14
|
AllStates,
|
|
15
15
|
AllVariants,
|
|
16
16
|
Default,
|
|
17
|
+
InitialFocus,
|
|
17
18
|
Interactive,
|
|
18
19
|
NoBody,
|
|
19
20
|
Responsive,
|
|
@@ -338,3 +339,32 @@ test("stacked dialogs share one scrim and dismiss top-first", async () => {
|
|
|
338
339
|
document.body.querySelector(".bg-scrim"),
|
|
339
340
|
).toBeNull()
|
|
340
341
|
})
|
|
342
|
+
|
|
343
|
+
test("initialFocus puts the caret in the field, not on Close", async () => {
|
|
344
|
+
// Without it the focus manager takes the first tabbable element,
|
|
345
|
+
// which is the Close button — so a dialog wrapping a form eats
|
|
346
|
+
// whatever is typed first. The consumer cannot fix that from
|
|
347
|
+
// outside: focusing in its own effect races the manager and
|
|
348
|
+
// loses, which reads as the app ignoring you.
|
|
349
|
+
const { body, canvas } = await mountStory(InitialFocus)
|
|
350
|
+
|
|
351
|
+
await userEvent.click(
|
|
352
|
+
expectAgentDrivable(canvas, {
|
|
353
|
+
name: "Add a title",
|
|
354
|
+
role: "button",
|
|
355
|
+
}),
|
|
356
|
+
)
|
|
357
|
+
|
|
358
|
+
const field = expectAgentDrivable(body, {
|
|
359
|
+
name: "Title",
|
|
360
|
+
role: "textbox",
|
|
361
|
+
})
|
|
362
|
+
|
|
363
|
+
await waitFor(async () => {
|
|
364
|
+
await expect(field).toHaveFocus()
|
|
365
|
+
})
|
|
366
|
+
|
|
367
|
+
await userEvent.keyboard("Sharpen the chisels")
|
|
368
|
+
|
|
369
|
+
await expect(field).toHaveValue("Sharpen the chisels")
|
|
370
|
+
})
|
package/src/Dialog/Dialog.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useUniqueId } from "@charcuterie/logic"
|
|
2
|
-
import type { ReactNode } from "react"
|
|
2
|
+
import type { ReactNode, RefObject } from "react"
|
|
3
3
|
|
|
4
4
|
import { Button } from "../Button/Button.tsx"
|
|
5
5
|
import { Modal } from "../Modal/Modal.tsx"
|
|
@@ -24,6 +24,16 @@ export type DialogProps = {
|
|
|
24
24
|
* Escape and a backdrop press both close. Off for the one honest
|
|
25
25
|
* case — a destructive confirm the user has to answer.
|
|
26
26
|
*/
|
|
27
|
+
/**
|
|
28
|
+
* Which element takes the caret when the dialog opens.
|
|
29
|
+
*
|
|
30
|
+
* A dialog wrapping a form wants its first field, not the Close
|
|
31
|
+
* button the focus manager would otherwise pick — and a consumer
|
|
32
|
+
* cannot fix that from outside, because focusing in its own
|
|
33
|
+
* effect races the manager and loses. Docket's capture dialog is
|
|
34
|
+
* the case: every keystroke landed on "Close".
|
|
35
|
+
*/
|
|
36
|
+
initialFocus?: RefObject<HTMLElement | null>
|
|
27
37
|
isDismissable?: boolean
|
|
28
38
|
isVisible: boolean
|
|
29
39
|
/**
|
|
@@ -82,6 +92,7 @@ export const Dialog = ({
|
|
|
82
92
|
footer,
|
|
83
93
|
heading,
|
|
84
94
|
headingLevel = 2,
|
|
95
|
+
initialFocus,
|
|
85
96
|
isDismissable = true,
|
|
86
97
|
isVisible,
|
|
87
98
|
onClose,
|
|
@@ -95,6 +106,7 @@ export const Dialog = ({
|
|
|
95
106
|
<Modal
|
|
96
107
|
aria-labelledby={headingId}
|
|
97
108
|
className={toClassName(SIZE_CLASS[size], className)}
|
|
109
|
+
initialFocus={initialFocus}
|
|
98
110
|
isDismissable={isDismissable}
|
|
99
111
|
isVisible={isVisible}
|
|
100
112
|
onClose={onClose}
|
package/src/Field/Field.mdx
CHANGED
|
@@ -27,7 +27,7 @@ in one place and cannot be spelled twice.
|
|
|
27
27
|
|
|
28
28
|
<Canvas of={FieldStories.Default} />
|
|
29
29
|
|
|
30
|
-
`Field` is also how a `Picker` (or `Button`, or
|
|
30
|
+
`Field` is also how a `Picker` (or `Button`, or an app's own control) sits next to
|
|
31
31
|
its label **without butting against the last word**. Those controls are
|
|
32
32
|
flush — no outer margin — on purpose. The stacked `gap-1.5` here is the
|
|
33
33
|
gutter. An inline label + trigger is a row with `gap-*`, not a margin
|
|
@@ -40,7 +40,7 @@ on the control. See [Picker](../Picker/Picker.mdx#the-trigger-is-flush--the-pare
|
|
|
40
40
|
## The control is a slot
|
|
41
41
|
|
|
42
42
|
Cloned, not wrapped — the same contract as `Popover`'s trigger. An `<input>`, a
|
|
43
|
-
`<textarea>`, a `
|
|
43
|
+
`<textarea>`, a `Picker`, or an app's own control all go in the same hole, and the `id`,
|
|
44
44
|
`aria-describedby`, `aria-invalid` and `required` are injected onto whatever arrives.
|
|
45
45
|
|
|
46
46
|
<Canvas of={FieldStories.AllVariants} />
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
StoryGrid,
|
|
6
6
|
} from "../board.storyHelpers.tsx"
|
|
7
7
|
import { Picker } from "../Picker/Picker.tsx"
|
|
8
|
-
import { Select } from "../Select/Select.tsx"
|
|
9
8
|
import { Tooltip } from "../Tooltip/Tooltip.tsx"
|
|
10
9
|
import { Field } from "./Field.tsx"
|
|
11
10
|
import { FieldGroup } from "./FieldGroup.tsx"
|
|
@@ -84,7 +83,7 @@ export const AdoptsOverlayTriggerId: Story = {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
/**
|
|
87
|
-
* The control is a slot, not a hardcoded `<input>` — `
|
|
86
|
+
* The control is a slot, not a hardcoded `<input>` — a `Picker` goes
|
|
88
87
|
* in the same hole, and so does an app's own control. The `id`,
|
|
89
88
|
* `aria-describedby`, `aria-invalid`, and `required` are cloned onto
|
|
90
89
|
* whatever is passed.
|
|
@@ -104,13 +103,16 @@ export const AllVariants: Story = {
|
|
|
104
103
|
</Field>
|
|
105
104
|
</StoryCell>
|
|
106
105
|
|
|
107
|
-
<StoryCell label="
|
|
106
|
+
<StoryCell label="picker">
|
|
108
107
|
<Field label="Rip profile">
|
|
109
|
-
<
|
|
108
|
+
<Picker
|
|
109
|
+
label="Rip profile"
|
|
110
|
+
onChange={() => {}}
|
|
110
111
|
options={[
|
|
111
112
|
{ label: "Lossless", value: "lossless" },
|
|
112
113
|
{ label: "Compressed", value: "compressed" },
|
|
113
114
|
]}
|
|
115
|
+
value="lossless"
|
|
114
116
|
/>
|
|
115
117
|
</Field>
|
|
116
118
|
</StoryCell>
|
|
@@ -305,12 +307,14 @@ export const Group: Story = {
|
|
|
305
307
|
label="Chapter split"
|
|
306
308
|
>
|
|
307
309
|
<div className="flex gap-2">
|
|
308
|
-
<
|
|
310
|
+
<Picker
|
|
309
311
|
label="Unit"
|
|
312
|
+
onChange={() => {}}
|
|
310
313
|
options={[
|
|
311
314
|
{ label: "Chapters", value: "chapters" },
|
|
312
315
|
{ label: "Minutes", value: "minutes" },
|
|
313
316
|
]}
|
|
317
|
+
value="chapters"
|
|
314
318
|
/>
|
|
315
319
|
|
|
316
320
|
<input
|
package/src/Field/Field.test.tsx
CHANGED
|
@@ -115,16 +115,18 @@ test("a description is announced with the control", async () => {
|
|
|
115
115
|
).toHaveTextContent("Where finished rips are moved.")
|
|
116
116
|
})
|
|
117
117
|
|
|
118
|
-
test("the slot takes a
|
|
118
|
+
test("the slot takes a Picker as readily as an input", async () => {
|
|
119
119
|
const { canvas, canvasElement } =
|
|
120
120
|
await mountStory(AllVariants)
|
|
121
121
|
|
|
122
|
-
// A
|
|
123
|
-
// by the same cloned `id`. The
|
|
124
|
-
// holding, which is the contract
|
|
122
|
+
// A `Picker` is a `<button>` trigger whose accessible name carries
|
|
123
|
+
// the current value, and it is named by the same cloned `id`. The
|
|
124
|
+
// slot does not know what it is holding, which is the contract —
|
|
125
|
+
// this cell held a native `Select` until that component was
|
|
126
|
+
// deprecated.
|
|
125
127
|
expectAgentDrivable(canvas, {
|
|
126
|
-
name: "Rip profile",
|
|
127
|
-
role: "
|
|
128
|
+
name: "Rip profile: Lossless",
|
|
129
|
+
role: "button",
|
|
128
130
|
})
|
|
129
131
|
|
|
130
132
|
await expectNoAxeViolations(canvasElement)
|
package/src/Field/Field.tsx
CHANGED
|
@@ -12,7 +12,7 @@ export type FieldProps = SlotProps & {
|
|
|
12
12
|
/**
|
|
13
13
|
* The control. **Cloned, not wrapped** — the same slot contract
|
|
14
14
|
* as `Popover`'s trigger, so a `Field` can go around an `<input>`,
|
|
15
|
-
* a `<textarea>`, a `
|
|
15
|
+
* a `<textarea>`, a `Picker`, or an app's own control without
|
|
16
16
|
* changing that control's layout.
|
|
17
17
|
*/
|
|
18
18
|
children: ReactElement
|
package/src/Modal/Modal.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from "react"
|
|
1
|
+
import type { ReactNode, RefObject } from "react"
|
|
2
2
|
|
|
3
3
|
import { OverlayPanel } from "../Overlay/OverlayPanel.tsx"
|
|
4
4
|
import { toClassName } from "../toClassName.ts"
|
|
@@ -8,6 +8,10 @@ export type ModalProps = {
|
|
|
8
8
|
"aria-labelledby"?: string
|
|
9
9
|
children: ReactNode
|
|
10
10
|
className?: string
|
|
11
|
+
/** Which element takes the caret when the modal opens. Without
|
|
12
|
+
* it the focus manager takes the first tabbable element — the
|
|
13
|
+
* Close button on anything with chrome. */
|
|
14
|
+
initialFocus?: RefObject<HTMLElement | null>
|
|
11
15
|
/** Escape and a backdrop press both close. */
|
|
12
16
|
isDismissable?: boolean
|
|
13
17
|
isVisible: boolean
|
|
@@ -59,6 +63,7 @@ export const Modal = ({
|
|
|
59
63
|
"aria-labelledby": ariaLabelledBy,
|
|
60
64
|
children,
|
|
61
65
|
className,
|
|
66
|
+
initialFocus,
|
|
62
67
|
isDismissable = true,
|
|
63
68
|
isVisible,
|
|
64
69
|
onClose,
|
|
@@ -68,6 +73,7 @@ export const Modal = ({
|
|
|
68
73
|
aria-label={ariaLabel}
|
|
69
74
|
aria-labelledby={ariaLabelledBy}
|
|
70
75
|
className={toClassName(MODAL_BOX_CLASS, className)}
|
|
76
|
+
initialFocus={initialFocus}
|
|
71
77
|
isDismissable={isDismissable}
|
|
72
78
|
isVisible={isVisible}
|
|
73
79
|
onClose={onClose}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
useInteractions,
|
|
11
11
|
useRole,
|
|
12
12
|
} from "@floating-ui/react"
|
|
13
|
-
import type { ReactNode } from "react"
|
|
13
|
+
import type { ReactNode, RefObject } from "react"
|
|
14
14
|
import { useCallback, useEffect } from "react"
|
|
15
15
|
|
|
16
16
|
import { lockScrollBehind } from "./lockScrollBehind.ts"
|
|
@@ -58,6 +58,17 @@ export type OverlayPanelProps = {
|
|
|
58
58
|
"aria-labelledby"?: string
|
|
59
59
|
children: ReactNode
|
|
60
60
|
className?: string
|
|
61
|
+
/**
|
|
62
|
+
* Which element takes the caret when the panel opens.
|
|
63
|
+
*
|
|
64
|
+
* Without it the focus manager takes the first tabbable element,
|
|
65
|
+
* which for anything with chrome is the **Close button** — so a
|
|
66
|
+
* panel wrapping a form opens with the caret on "Close" and the
|
|
67
|
+
* first thing typed goes nowhere. A consumer cannot fix that from
|
|
68
|
+
* outside: focusing in its own effect races the manager, and the
|
|
69
|
+
* manager wins, which reads as the app ignoring you.
|
|
70
|
+
*/
|
|
71
|
+
initialFocus?: RefObject<HTMLElement | null>
|
|
61
72
|
/** Escape and an outside press both close. */
|
|
62
73
|
isDismissable?: boolean
|
|
63
74
|
isVisible: boolean
|
|
@@ -70,6 +81,7 @@ export const OverlayPanel = ({
|
|
|
70
81
|
"aria-labelledby": ariaLabelledBy,
|
|
71
82
|
children,
|
|
72
83
|
className,
|
|
84
|
+
initialFocus,
|
|
73
85
|
isDismissable = true,
|
|
74
86
|
isVisible,
|
|
75
87
|
onClose,
|
|
@@ -160,6 +172,10 @@ export const OverlayPanel = ({
|
|
|
160
172
|
<div className="fixed inset-0 z-[var(--layer-modal)] flex items-center justify-center">
|
|
161
173
|
<FloatingFocusManager
|
|
162
174
|
context={context}
|
|
175
|
+
// `undefined` keeps the manager's own default (the first
|
|
176
|
+
// tabbable), so nothing changes for a panel that does not
|
|
177
|
+
// ask.
|
|
178
|
+
initialFocus={initialFocus ?? undefined}
|
|
163
179
|
// Only the top traps focus; a lower panel is `inert`
|
|
164
180
|
// anyway, and two live traps fight over one caret.
|
|
165
181
|
disabled={!isTop}
|
package/src/Select/Select.mdx
CHANGED
|
@@ -4,7 +4,33 @@ import * as SelectStories from "./Select.stories";
|
|
|
4
4
|
|
|
5
5
|
<Meta of={SelectStories} />
|
|
6
6
|
|
|
7
|
-
# Select
|
|
7
|
+
# Select (deprecated)
|
|
8
|
+
|
|
9
|
+
> **Deprecated 2026-08-20. Nothing new gets a native `Select`.**
|
|
10
|
+
>
|
|
11
|
+
> Use **`Picker`** — a `Listbox` with the trigger already attached, and a near drop-in for
|
|
12
|
+
> this component — or **`Combobox`** when the list is long enough to want typing.
|
|
13
|
+
>
|
|
14
|
+
> ```tsx
|
|
15
|
+
> // Before.
|
|
16
|
+
> <Select label="Quality" onChange={setQuality} options={QUALITY_OPTIONS} value={quality} />
|
|
17
|
+
>
|
|
18
|
+
> // After.
|
|
19
|
+
> <Picker label="Quality" onChange={setQuality} options={QUALITY_OPTIONS} value={quality} />
|
|
20
|
+
> ```
|
|
21
|
+
>
|
|
22
|
+
> The [2026-08-10 demotion](https://github.com/Sawtaytoes/charcuterie/blob/master/docs/decisions/2026-08-10-listbox-and-combobox-are-the-default-and-select-is-demoted.md)
|
|
23
|
+
> left four platform cases where native was still the right call — the mobile wheel picker,
|
|
24
|
+
> autofill, `:invalid`, and a form that posts with no JS. **Not one of them has ever applied
|
|
25
|
+
> to an app in this fleet**, and the exception is what agents kept reading as permission. It
|
|
26
|
+
> is closed: a new native `Select` is a new decision with the reason written down, not a
|
|
27
|
+
> call-site choice. `Listbox` has no `<optgroup>` equivalent, and that gap is a change to
|
|
28
|
+
> `Listbox` rather than a reason to keep this.
|
|
29
|
+
>
|
|
30
|
+
> It stays exported so existing call sites keep compiling while they convert, and it will be
|
|
31
|
+
> removed in the next major of `@charcuterie/ui`.
|
|
32
|
+
|
|
33
|
+
Everything below is how the component works, for the call sites still on it.
|
|
8
34
|
|
|
9
35
|
Eighteen sites in the fleet, and they split cleanly in two: **twelve native `<select>`s**
|
|
10
36
|
that differ only in their Tailwind classes, and **six hand-rolled `role="listbox"`
|
|
@@ -41,7 +41,12 @@ const GROUPED: SelectItem[] = [
|
|
|
41
41
|
]
|
|
42
42
|
|
|
43
43
|
const meta = {
|
|
44
|
-
|
|
44
|
+
// `Deprecated/`, not `Components/`, and that is the whole point of
|
|
45
|
+
// moving it: the sidebar is the first place an agent looks for a
|
|
46
|
+
// picker, and a `Select` sitting between `Rail` and `Shell` reads
|
|
47
|
+
// as a component in good standing. Nothing new gets one — `Picker`
|
|
48
|
+
// is the drop-in. See the 2026-08-20 deprecation record.
|
|
49
|
+
title: "Deprecated/Select",
|
|
45
50
|
component: Select,
|
|
46
51
|
parameters: { layout: "padded" },
|
|
47
52
|
argTypes: { size: controlSizeArgType },
|
package/src/Select/Select.tsx
CHANGED
|
@@ -12,20 +12,36 @@ import {
|
|
|
12
12
|
} from "../intentStyles.ts"
|
|
13
13
|
import { toClassName } from "../toClassName.ts"
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Part of the deprecated native `Select`. The
|
|
17
|
+
* replacement shape is `PickerOption` / `ListboxItem`, whose
|
|
18
|
+
* `label` is a `ReactNode` rather than a `string`.
|
|
19
|
+
*/
|
|
15
20
|
export type SelectOption = {
|
|
16
21
|
isDisabled?: boolean
|
|
17
22
|
label: string
|
|
18
23
|
value: string
|
|
19
24
|
}
|
|
20
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Part of the deprecated native `Select`. `Listbox`
|
|
28
|
+
* has **no `<optgroup>` equivalent**, so a grouped picker is the
|
|
29
|
+
* one shape this deprecation has no replacement for — an app that
|
|
30
|
+
* needs one is a change to `Listbox`, not a reason to keep
|
|
31
|
+
* reaching for the native control.
|
|
32
|
+
*/
|
|
21
33
|
export type SelectOptionGroup = {
|
|
22
34
|
label: string
|
|
23
35
|
options: readonly SelectOption[]
|
|
24
36
|
}
|
|
25
37
|
|
|
38
|
+
/** @deprecated Part of the deprecated native `Select`. */
|
|
26
39
|
export type SelectItem = SelectOption | SelectOptionGroup
|
|
27
40
|
|
|
28
41
|
/**
|
|
42
|
+
* @deprecated Part of the deprecated native `Select` — see the
|
|
43
|
+
* component's docblock. `PickerProps` is the replacement.
|
|
44
|
+
*
|
|
29
45
|
* The HTML attributes are passed through, and that is not
|
|
30
46
|
* convenience — it is what makes the `Field` slot work at all.
|
|
31
47
|
*
|
|
@@ -95,8 +111,33 @@ const getIsGroup = (
|
|
|
95
111
|
): item is SelectOptionGroup => "options" in item
|
|
96
112
|
|
|
97
113
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
114
|
+
* @deprecated Reach for `Picker` — a `Listbox` with the trigger
|
|
115
|
+
* already attached, and a near drop-in for this component
|
|
116
|
+
* (`label`, `options`, `value`, `onChange`) — or `Combobox` when
|
|
117
|
+
* the list is long enough to want typing.
|
|
118
|
+
*
|
|
119
|
+
* A styled native `<select>`, kept only so the call sites that
|
|
120
|
+
* already have one keep compiling while they are converted.
|
|
121
|
+
*
|
|
122
|
+
* ### Deprecated 2026-08-20, and the platform hatch is closed
|
|
123
|
+
*
|
|
124
|
+
* The 2026-08-10 record demoted this to a stated-reason exception
|
|
125
|
+
* and named four cases where the platform behaviour is the
|
|
126
|
+
* feature: the mobile wheel picker, autofill, `:invalid`, and a
|
|
127
|
+
* form that posts with no JS. **None of them has ever applied to
|
|
128
|
+
* an app in this fleet**, and the exception is what agents kept
|
|
129
|
+
* reading as permission — so the exception is gone. A new native
|
|
130
|
+
* `Select` is a new decision with the reason written down, not a
|
|
131
|
+
* call-site choice.
|
|
132
|
+
*
|
|
133
|
+
* The objection is that the popup is painted by the OS. No token,
|
|
134
|
+
* no class and no amount of `appearance-none` reaches inside it,
|
|
135
|
+
* so a fleet with any of these in it has two focus treatments, two
|
|
136
|
+
* hover treatments and two keyboard feels — which is the thing the
|
|
137
|
+
* library exists to stop.
|
|
138
|
+
*
|
|
139
|
+
* Everything below is how the component works, for the call sites
|
|
140
|
+
* still on it. It is not a reason to add one.
|
|
100
141
|
*
|
|
101
142
|
* ### Sizing: `className` is the wrapper, `controlClassName` is the select
|
|
102
143
|
*
|
package/src/index.ts
CHANGED
|
@@ -298,6 +298,11 @@ export type {
|
|
|
298
298
|
SegmentedItem,
|
|
299
299
|
} from "./SegmentedControl/SegmentedControl.tsx"
|
|
300
300
|
export { SegmentedControl } from "./SegmentedControl/SegmentedControl.tsx"
|
|
301
|
+
// DEPRECATED 2026-08-20. `Select` is the native `<select>` and
|
|
302
|
+
// nothing new gets one — `Picker` is the drop-in, `Combobox` when
|
|
303
|
+
// the list wants typing. It stays exported so the fleet's existing
|
|
304
|
+
// call sites keep compiling while they convert, and for no other
|
|
305
|
+
// reason; see the decision record next to the component.
|
|
301
306
|
export type {
|
|
302
307
|
SelectItem,
|
|
303
308
|
SelectOption,
|