@allxsmith/bestax-bulma 5.54.1 → 5.55.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/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/Command.js +22 -22
- package/dist/esm/components/Command.js.map +1 -1
- package/dist/esm/components/DataTable.js +215 -0
- package/dist/esm/components/DataTable.js.map +1 -0
- package/dist/esm/components/useDataTable.js +482 -0
- package/dist/esm/components/useDataTable.js.map +1 -0
- package/dist/esm/elements/ColorSwatch.js +49 -0
- package/dist/esm/elements/ColorSwatch.js.map +1 -0
- package/dist/esm/elements/RingProgress.js +3 -3
- package/dist/esm/elements/Td.js +4 -2
- package/dist/esm/elements/Td.js.map +1 -1
- package/dist/esm/elements/Th.js +13 -5
- package/dist/esm/elements/Th.js.map +1 -1
- package/dist/esm/elements/Tr.js.map +1 -1
- package/dist/esm/form/ColorPicker.js +540 -0
- package/dist/esm/form/ColorPicker.js.map +1 -0
- package/dist/esm/form/Combobox.js +18 -18
- package/dist/esm/form/Combobox.js.map +1 -1
- package/dist/esm/form/Dropzone.js +524 -0
- package/dist/esm/form/Dropzone.js.map +1 -0
- package/dist/esm/form/_colorInternals/colorMath.js +292 -0
- package/dist/esm/form/_colorInternals/colorMath.js.map +1 -0
- package/dist/esm/form/_colorInternals/pickerState.js +160 -0
- package/dist/esm/form/_colorInternals/pickerState.js.map +1 -0
- package/dist/esm/helpers/statusRegion.js +3 -3
- package/dist/esm/helpers/statusRegion.js.map +1 -1
- package/dist/esm/helpers/useFocusTrap.js +2 -2
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +2986 -796
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/DataTable.d.ts +120 -0
- package/dist/types/components/useDataTable.d.ts +445 -0
- package/dist/types/elements/ColorSwatch.d.ts +54 -0
- package/dist/types/elements/Td.d.ts +9 -1
- package/dist/types/elements/Th.d.ts +14 -2
- package/dist/types/elements/Tr.d.ts +10 -1
- package/dist/types/form/ColorPicker.d.ts +266 -0
- package/dist/types/form/Dropzone.d.ts +138 -0
- package/dist/types/form/_colorInternals/colorMath.d.ts +63 -0
- package/dist/types/form/_colorInternals/pickerState.d.ts +62 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types-cjs/components/DataTable.d.ts +120 -0
- package/dist/types-cjs/components/useDataTable.d.ts +445 -0
- package/dist/types-cjs/elements/ColorSwatch.d.ts +54 -0
- package/dist/types-cjs/elements/Td.d.ts +9 -1
- package/dist/types-cjs/elements/Th.d.ts +14 -2
- package/dist/types-cjs/elements/Tr.d.ts +10 -1
- package/dist/types-cjs/form/ColorPicker.d.ts +266 -0
- package/dist/types-cjs/form/Dropzone.d.ts +138 -0
- package/dist/types-cjs/form/_colorInternals/colorMath.d.ts +63 -0
- package/dist/types-cjs/form/_colorInternals/pickerState.d.ts +62 -0
- package/dist/types-cjs/index.d.ts +4 -0
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/components/_datatable.scss +152 -0
- package/src/scss/components/_index.scss +1 -0
- package/src/scss/elements/_colorswatch.scss +100 -0
- package/src/scss/elements/_index.scss +1 -0
- package/src/scss/form/_checkbox.scss +53 -0
- package/src/scss/form/_colorpicker.scss +354 -0
- package/src/scss/form/_dropzone.scss +233 -0
- package/src/scss/form/_index.scss +2 -0
|
@@ -25,12 +25,12 @@ const defaultEmpty = 'No results';
|
|
|
25
25
|
const typedNoMatches$2 = [{ id: 'empty' }];
|
|
26
26
|
const nothingToAnnounce$2 = [];
|
|
27
27
|
/** Whether a slot was given something to show. */
|
|
28
|
-
const isShown = (node) => node !== undefined && node !== null && node !== false && node !== '';
|
|
29
|
-
const noop$
|
|
30
|
-
const registerNothing$1 = () => noop$
|
|
28
|
+
const isShown$1 = (node) => node !== undefined && node !== null && node !== false && node !== '';
|
|
29
|
+
const noop$2 = () => { };
|
|
30
|
+
const registerNothing$1 = () => noop$2;
|
|
31
31
|
// What a part rendered outside a Command reads: nothing to report to, so it
|
|
32
32
|
// renders its markup and does nothing.
|
|
33
|
-
const standalone$
|
|
33
|
+
const standalone$2 = {
|
|
34
34
|
engine: {
|
|
35
35
|
open: false,
|
|
36
36
|
expanded: false,
|
|
@@ -43,26 +43,26 @@ const standalone$1 = {
|
|
|
43
43
|
listboxRef: { current: null },
|
|
44
44
|
registerPopup: registerNothing$1,
|
|
45
45
|
registerItem: registerNothing$1,
|
|
46
|
-
onKeyDown: noop$
|
|
47
|
-
onChange: noop$
|
|
48
|
-
onClick: noop$
|
|
49
|
-
onBlur: noop$
|
|
50
|
-
hover: noop$
|
|
51
|
-
pick: noop$
|
|
52
|
-
keepFocus: noop$
|
|
53
|
-
markInside: noop$
|
|
46
|
+
onKeyDown: noop$2,
|
|
47
|
+
onChange: noop$2,
|
|
48
|
+
onClick: noop$2,
|
|
49
|
+
onBlur: noop$2,
|
|
50
|
+
hover: noop$2,
|
|
51
|
+
pick: noop$2,
|
|
52
|
+
keepFocus: noop$2,
|
|
53
|
+
markInside: noop$2,
|
|
54
54
|
},
|
|
55
55
|
label: defaultLabel,
|
|
56
56
|
query: '',
|
|
57
|
-
onFieldChange: noop$
|
|
58
|
-
reportLoading: noop$
|
|
57
|
+
onFieldChange: noop$2,
|
|
58
|
+
reportLoading: noop$2,
|
|
59
59
|
reportEmpty: registerNothing$1,
|
|
60
60
|
registerHandler: registerNothing$1,
|
|
61
61
|
};
|
|
62
62
|
const CommandContext = createContext(null);
|
|
63
|
-
const useCommand = () => useContext(CommandContext) ?? standalone$
|
|
63
|
+
const useCommand = () => useContext(CommandContext) ?? standalone$2;
|
|
64
64
|
/** Hands a node to a forwarded ref and to one of the component's own. */
|
|
65
|
-
function setRefs$
|
|
65
|
+
function setRefs$2(node, own, forwarded) {
|
|
66
66
|
own.current = node;
|
|
67
67
|
if (typeof forwarded === 'function')
|
|
68
68
|
forwarded(node);
|
|
@@ -179,7 +179,7 @@ const CommandParts = forwardRef(({ children, label, query: controlledQuery, defa
|
|
|
179
179
|
registerHandler,
|
|
180
180
|
};
|
|
181
181
|
const { rootRef } = engine;
|
|
182
|
-
const rootRefs = useCallback((node) => setRefs$
|
|
182
|
+
const rootRefs = useCallback((node) => setRefs$2(node, rootRef, ref), [rootRef, ref]);
|
|
183
183
|
return (jsxs("div", { className: classNames(rootClass, bulmaHelperClasses, className), ...rest, ref: rootRefs, children: [jsx(CommandContext.Provider, { value: context, children: children }), jsx(StatusRegion, { items: announced, describe: describeEmpty })] }));
|
|
184
184
|
});
|
|
185
185
|
CommandParts.displayName = 'CommandParts';
|
|
@@ -199,7 +199,7 @@ const CommandInput = forwardRef(({ isLoading, iconLeft, iconLeftName, onKeyDown,
|
|
|
199
199
|
return () => reportLoading(false);
|
|
200
200
|
}, [reportLoading, isLoading]);
|
|
201
201
|
const { inputRef } = engine;
|
|
202
|
-
const inputRefs = useCallback((node) => setRefs$
|
|
202
|
+
const inputRefs = useCallback((node) => setRefs$2(node, inputRef, ref), [inputRef, ref]);
|
|
203
203
|
const { expanded, highlighted } = engine;
|
|
204
204
|
// A name the caller gave the field wins over the Command's `label`.
|
|
205
205
|
const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;
|
|
@@ -288,10 +288,10 @@ const CommandItem = ({ value, disabled = false, onSelect, icon, description, hin
|
|
|
288
288
|
// the rest, and described by the description and the hint.
|
|
289
289
|
const baseId = useId();
|
|
290
290
|
const labelId = `${baseId}label`;
|
|
291
|
-
const descriptionId = isShown(description)
|
|
291
|
+
const descriptionId = isShown$1(description)
|
|
292
292
|
? `${baseId}description`
|
|
293
293
|
: undefined;
|
|
294
|
-
const hintId = isShown(hint) ? `${baseId}hint` : undefined;
|
|
294
|
+
const hintId = isShown$1(hint) ? `${baseId}hint` : undefined;
|
|
295
295
|
const describedBy = [descriptionId, hintId].filter(Boolean).join(' ') || undefined;
|
|
296
296
|
const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;
|
|
297
297
|
return (jsxs("div", { className: classNames(itemClass, className), "aria-describedby": describedBy, ...props, ref: itemRef, id: engine.itemId(value) || undefined, role: "option", "aria-selected": disabled ? undefined : highlighted || undefined, "aria-disabled": disabled || undefined, "aria-labelledby": callerNamed ? props['aria-labelledby'] : labelId, onClick: event => {
|
|
@@ -302,7 +302,7 @@ const CommandItem = ({ value, disabled = false, onSelect, icon, description, hin
|
|
|
302
302
|
onPointerMove?.(event);
|
|
303
303
|
if (!disabled && !highlighted)
|
|
304
304
|
engine.hover(value);
|
|
305
|
-
}, children: [isShown(icon) && (jsx("span", { className: iconClass, "aria-hidden": "true", children: icon })), jsxs("span", { className: bodyClass, children: [jsx("span", { className: labelClass, id: labelId, children: children }), descriptionId && (jsx("span", { className: descriptionClass, id: descriptionId, children: description }))] }), hintId && (jsx("span", { className: hintClass, id: hintId, children: hint }))] }));
|
|
305
|
+
}, children: [isShown$1(icon) && (jsx("span", { className: iconClass, "aria-hidden": "true", children: icon })), jsxs("span", { className: bodyClass, children: [jsx("span", { className: labelClass, id: labelId, children: children }), descriptionId && (jsx("span", { className: descriptionClass, id: descriptionId, children: description }))] }), hintId && (jsx("span", { className: hintClass, id: hintId, children: hint }))] }));
|
|
306
306
|
};
|
|
307
307
|
CommandItem.displayName = 'CommandItem';
|
|
308
308
|
/**
|
|
@@ -341,7 +341,7 @@ const CommandActionsContent = ({ actions, filter, placeholder, empty, }) => {
|
|
|
341
341
|
sections.set(group, [...(sections.get(group) ?? []), action]);
|
|
342
342
|
}
|
|
343
343
|
const renderItem = (action) => (jsx(CommandItem, { value: action.id, disabled: action.disabled, icon: action.icon, description: action.description, hint: action.hint, onSelect: action.onSelect, children: action.label }, action.id));
|
|
344
|
-
return (jsxs(Fragment, { children: [jsx(CommandInput, { placeholder: placeholder }), shown.length > 0 ? (jsx(CommandList, { children: Array.from(sections, ([group, members]) => group ? (jsx(CommandGroup, { label: group, children: members.map(renderItem) }, group)) : (members.map(renderItem))) })) : isShown(empty) ? (jsx(CommandEmpty, { children: empty })) : null] }));
|
|
344
|
+
return (jsxs(Fragment, { children: [jsx(CommandInput, { placeholder: placeholder }), shown.length > 0 ? (jsx(CommandList, { children: Array.from(sections, ([group, members]) => group ? (jsx(CommandGroup, { label: group, children: members.map(renderItem) }, group)) : (members.map(renderItem))) })) : isShown$1(empty) ? (jsx(CommandEmpty, { children: empty })) : null] }));
|
|
345
345
|
};
|
|
346
346
|
/**
|
|
347
347
|
* The Command given `actions`. It renders the parts itself and filters the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.js","sources":["../../../src/components/Command.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { useLatestRef } from '../helpers/useLatestRef';\nimport { flattenChildren } from '../helpers/flattenChildren';\nimport { warnOnce } from '../helpers/devWarnings';\nimport { useLocaleMatcher, type TextMatcher } from '../helpers/localeFormat';\nimport { isModalOverlayOpen } from '../helpers/overlayStack';\nimport { StatusRegion, spokenText } from '../helpers/statusRegion';\nimport {\n ComboboxEngine,\n useComboboxEngine,\n} from '../helpers/useComboboxEngine';\nimport { Input, InputProps } from '../form/Input';\nimport { Modal } from './Modal';\n\n/** What names a Command that's given no `label`. */\nconst defaultLabel = 'Commands';\n\n/** What a Command given `actions` shows when nothing matches, unless it's given `empty`. */\nconst defaultEmpty = 'No results';\n\n// What the status region announces: the `Command.Empty` content, as the one\n// item it's handed while that content is on screen because of the user's\n// typing.\nconst typedNoMatches = [{ id: 'empty' }];\nconst nothingToAnnounce: Array<{ id: string }> = [];\n\n/** Whether a slot was given something to show. */\nconst isShown = (node: React.ReactNode): boolean =>\n node !== undefined && node !== null && node !== false && node !== '';\n\n/** One action in a Command's `actions`. */\nexport interface CommandAction {\n /** Unique within the Command. It's the item's `value`, so `onSelect` hands it back. */\n id: string;\n /** What the item shows, and what typing matches first. */\n label: string;\n /**\n * A line under the label, such as what the action does or where it goes.\n * Typing matches it too, after the labels. A screen reader hears it after\n * the label, as the item's description.\n */\n description?: string;\n /**\n * More words typing matches, after the labels, such as `['theme']` for\n * \"Dark mode\". They aren't shown.\n */\n keywords?: string[];\n /**\n * The heading the action goes under. Groups show in the order the matches\n * first name them, so the best match is always on top, and the actions with\n * no group show together where the first of them is.\n */\n group?: string;\n /** Shown before the label, and hidden from assistive tech. */\n icon?: React.ReactNode;\n /**\n * Shown at the end of the row, such as the action's own keyboard shortcut in\n * a `Kbd.Group`, or a `Tag`. It only shows: nothing listens for a shortcut\n * written here. A screen reader hears it after the label, with the\n * description.\n */\n hint?: React.ReactNode;\n /** Shown, and reached with the arrows so a screen reader user finds it, but never run. */\n disabled?: boolean;\n /** Runs the action, when it's picked with Enter or a click, before the Command's `onSelect`. */\n onSelect?: () => void;\n}\n\n/** What a Command takes whether it's given `actions` or built from parts. */\ninterface CommandBaseProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'onSelect'>,\n Omit<BulmaClassesProps, 'color'> {\n /**\n * What the Command is for, such as \"Commands\" or \"Settings\". It's never\n * shown: it names the search field and the list for assistive tech, and in\n * `Command.Dialog` the dialog too. An empty string counts as none.\n * @defaultValue 'Commands'\n */\n label?: string;\n /**\n * The search, controlled: the text in the field. Pair it with\n * `onQueryChange`.\n */\n query?: string;\n /**\n * The search to start with when uncontrolled.\n * @defaultValue ''\n */\n defaultQuery?: string;\n /**\n * Called with the search as the user types it. Built from parts, this is\n * where the app filters its items.\n */\n onQueryChange?: (query: string) => void;\n /**\n * Called with the picked item's `value`, an action's `id`, when it's run\n * with Enter or a click, after the item's own `onSelect`. A disabled item\n * is never run.\n */\n onSelect?: (value: string) => void;\n}\n\n/** Props for a Command given `actions`. */\nexport interface CommandActionsProps extends CommandBaseProps {\n /**\n * The actions, for a Command that renders the field, the list, the groups\n * and the empty message itself. Typing filters them by label, keywords and\n * description, ignoring case, with label matches first. Inside a\n * `LocaleProvider` with a `locale`, it ignores accents too where that\n * language does, so \"cafe\" finds \"Café\". Leave it out to build the\n * Command from parts.\n */\n actions: CommandAction[];\n /**\n * Takes over the filtering, with `actions`: it's handed the search as typed\n * and every action, and returns the ones to show, in the order to show\n * them, which is how to plug in fuzzy matching or cut the list short. It's\n * called with an empty search too.\n */\n filter?: (query: string, actions: CommandAction[]) => CommandAction[];\n /** The field's placeholder, with `actions`. */\n placeholder?: string;\n /**\n * What shows in place of the list, with `actions`, when nothing matches.\n * It's announced the way `Command.Empty` is. `null` shows nothing.\n * @defaultValue 'No results'\n */\n empty?: React.ReactNode;\n /** @internal With `actions`, the Command renders its own parts. */\n children?: never;\n}\n\n/** Props for a Command built from parts. */\nexport interface CommandPartsProps extends CommandBaseProps {\n /**\n * The parts, in order: `Command.Input`, then `Command.List` while there are\n * items and `Command.Empty` while there aren't. Nothing filters them, so\n * render the items that match the search `onQueryChange` reports. With\n * `actions` there are none to give: children given with it are ignored,\n * with a warning in development.\n */\n children?: React.ReactNode;\n /** @internal Built from parts, the app renders the items. */\n actions?: never;\n /** @internal Built from parts, the app filters. */\n filter?: never;\n /** @internal Built from parts, `Command.Input` takes the placeholder. */\n placeholder?: never;\n /** @internal Built from parts, `Command.Empty` is the empty message. */\n empty?: never;\n}\n\n/**\n * Props for the Command component: given `actions`, it renders, filters and\n * groups them itself, and without them it's built from parts. The helper\n * props, the other attributes and the `ref` land on the `div.command` around\n * the field and the list.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `div.command` around the field and the list.\n */\nexport type CommandProps = CommandActionsProps | CommandPartsProps;\n\n/** What Command.Dialog takes on top of a Command's props. */\ninterface CommandDialogOwnProps {\n /** Controlled open state. When set, opening and closing only report through `onOpenChange`. */\n open?: boolean;\n /**\n * Initial open state when uncontrolled.\n * @defaultValue false\n */\n defaultOpen?: boolean;\n /**\n * Called with the open state asked for: `true` from the `shortcut`, and\n * `false` from Escape, a click on the background, or a pick while\n * `closeOnSelect` is on. Fires in controlled and uncontrolled use.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * A key combination that opens the dialog from anywhere on the page, such\n * as `\"mod+k\"`: modifiers and a key joined by `+`, where `mod` is Ctrl or\n * ⌘ (either one, on every platform), and the others are `ctrl`, `meta`,\n * `alt` and `shift`. It's ignored while the user is typing in a text field,\n * a select or editable content, while an IME is composing, while a modal\n * overlay is open (a `Modal`, a `Dialog`, a `Sidebar` with its overlay or a\n * full-page `Loading`), and when something else has already used the key.\n * It only opens the dialog. Off unless given.\n */\n shortcut?: string;\n /**\n * Closes the dialog once an item has run. Turn it off for an item that\n * opens another page of the palette, and close it yourself with `open`.\n * @defaultValue true\n */\n closeOnSelect?: boolean;\n /**\n * Clears the search when the dialog closes: an uncontrolled one itself,\n * and a controlled one through `onQueryChange('')`.\n * @defaultValue true\n */\n clearOnClose?: boolean;\n /**\n * Renders the dialog into a portal target instead of inline. Forwarded to\n * the underlying `Modal`; see its `portal` prop for the accepted values.\n * @defaultValue false\n */\n portal?: boolean | string | HTMLElement;\n}\n\n/** Props for a Command.Dialog given `actions`. */\nexport interface CommandDialogActionsProps\n extends CommandActionsProps, CommandDialogOwnProps {}\n\n/** Props for a Command.Dialog built from parts. */\nexport interface CommandDialogPartsProps\n extends CommandPartsProps, CommandDialogOwnProps {}\n\n/**\n * Props for Command.Dialog, the Command in a modal: a Command's props, given\n * `actions` or built from parts, and the dialog's own. The helper props, the\n * other attributes and the `ref` land on the `div.command` that is the\n * dialog.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `div.command` that is the dialog.\n */\nexport type CommandDialogProps =\n CommandDialogActionsProps | CommandDialogPartsProps;\n\n/**\n * Props for Command.Input, the search field. It renders `Input`, so its\n * icons, `isLoading` and `color` work as they do there. Its text is the\n * Command's `query`, and it's `autoComplete=\"off\"`, so the browser's own\n * suggestions don't open over the list: neither is yours to set.\n */\nexport type CommandInputProps = Omit<\n InputProps,\n // By name, since the docs read only names out of an Omit. The Field props:\n | 'label'\n | 'labelSize'\n | 'labelProps'\n | 'horizontal'\n | 'message'\n | 'messageColor'\n | 'fieldClassName'\n // And what the Command sets on the field itself:\n | 'role'\n | 'autoComplete'\n | 'value'\n | 'defaultValue'\n>;\n\n/**\n * Props for Command.List, the list. Its `id` is the one the field's\n * `aria-controls` names, so it isn't yours to set.\n */\nexport interface CommandListProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role' | 'id'\n> {\n /** `Command.Item`s and `Command.Group`s, in the order they're shown. */\n children?: React.ReactNode;\n}\n\n/** Props for Command.Group, items under a heading. */\nexport interface CommandGroupProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role'\n> {\n /**\n * The heading, which also names the group for assistive tech, unless you\n * give the group an `aria-label` or `aria-labelledby` of its own.\n */\n label: React.ReactNode;\n /** The group's `Command.Item`s. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for Command.Item, one thing to do in the list. Its `id` follows from\n * its `value`, since the field's `aria-activedescendant` names it, so it\n * isn't yours to set.\n */\nexport interface CommandItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role' | 'onSelect' | 'id'\n> {\n /** What the Command's `onSelect` hands back. Unique within the Command. */\n value: string;\n /**\n * Can't be run. The arrows still reach it, so a screen reader user finds\n * it, and it's never `aria-selected`.\n * @defaultValue false\n */\n disabled?: boolean;\n /** Runs the item, when it's picked with Enter or a click, before the Command's `onSelect`. */\n onSelect?: () => void;\n /** Shown before the label, and hidden from assistive tech. */\n icon?: React.ReactNode;\n /**\n * A line under the label. A screen reader hears it after the label, as the\n * item's description.\n */\n description?: React.ReactNode;\n /**\n * Shown at the end of the row, such as a keyboard shortcut in a\n * `Kbd.Group`, or a `Tag`. It only shows. A screen reader hears it after\n * the label, with the description.\n */\n hint?: React.ReactNode;\n /** The label, which names the item. */\n children?: React.ReactNode;\n}\n\n/** Props for Command.Empty, the message shown in place of the list. */\nexport interface CommandEmptyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The message, such as \"No commands match\". Its text is announced when\n * typing brings it on screen and isn't read again while it stays, so a\n * message that names the search is heard for the first search only.\n */\n children?: React.ReactNode;\n}\n\n/** A handler an item registers, read when it's run. */\ntype ItemHandler = { readonly current: (() => void) | undefined };\n\n/** What the Command hands its parts. */\ninterface CommandContextValue {\n engine: ComboboxEngine;\n /** What names the field and the list. */\n label: string;\n /** The search. */\n query: string;\n /** A change to the field's value, which is the user typing. */\n onFieldChange: (value: string) => void;\n /** Tells the Command the field's `isLoading`, which holds the empty message's announcement. */\n reportLoading: (loading: boolean) => void;\n /** Records the empty message while it's on screen. Returns the function that forgets it. */\n reportEmpty: (element: HTMLElement) => () => void;\n /** Records an item's `onSelect`. Returns the function that forgets it. */\n registerHandler: (value: string, handler: ItemHandler) => () => void;\n}\n\nconst noop = () => {};\nconst registerNothing = () => noop;\n\n// What a part rendered outside a Command reads: nothing to report to, so it\n// renders its markup and does nothing.\nconst standalone: CommandContextValue = {\n engine: {\n open: false,\n expanded: false,\n highlighted: null,\n typed: false,\n listboxId: '',\n itemId: () => '',\n rootRef: { current: null },\n inputRef: { current: null },\n listboxRef: { current: null },\n registerPopup: registerNothing,\n registerItem: registerNothing,\n onKeyDown: noop,\n onChange: noop,\n onClick: noop,\n onBlur: noop,\n hover: noop,\n pick: noop,\n keepFocus: noop,\n markInside: noop,\n },\n label: defaultLabel,\n query: '',\n onFieldChange: noop,\n reportLoading: noop,\n reportEmpty: registerNothing,\n registerHandler: registerNothing,\n};\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\n\nconst useCommand = () => useContext(CommandContext) ?? standalone;\n\n/** Hands a node to a forwarded ref and to one of the component's own. */\nfunction setRefs<T>(\n node: T | null,\n own: React.MutableRefObject<T | null>,\n forwarded: React.ForwardedRef<T>\n) {\n own.current = node;\n if (typeof forwarded === 'function') forwarded(node);\n else if (forwarded) forwarded.current = node;\n}\n\n/**\n * The default filter: the actions whose label, keywords or description hold\n * the search, ignoring case and the spaces around it, label matches first and\n * the order otherwise kept. An empty search keeps them all. `matchText`, a\n * `LocaleProvider`'s locale-aware matcher, replaces the lowercased\n * comparison when there is one.\n */\nconst filterActions = (\n query: string,\n actions: CommandAction[],\n matchText?: TextMatcher | null\n): CommandAction[] => {\n const search = query.trim();\n if (search === '') return actions;\n const term = search.toLowerCase();\n const holds = matchText\n ? (text: string) => matchText(text, search)\n : (text: string) => text.toLowerCase().includes(term);\n const byLabel: CommandAction[] = [];\n const byOther: CommandAction[] = [];\n for (const action of actions) {\n if (holds(action.label)) {\n byLabel.push(action);\n } else if (\n (action.description !== undefined && holds(action.description)) ||\n action.keywords?.some(holds)\n ) {\n byOther.push(action);\n }\n }\n return [...byLabel, ...byOther];\n};\n\n/** The search icon at the start of the field. */\nconst SearchIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n width=\"1em\"\n height=\"1em\"\n focusable=\"false\"\n >\n <circle cx=\"7\" cy=\"7\" r=\"4.75\" />\n <path d=\"M10.5 10.5L14 14\" />\n </svg>\n);\n\n/**\n * The Command built from parts: the field, the list, the keys and the run,\n * with the items and their filtering left to the app.\n */\nconst CommandParts = forwardRef<HTMLDivElement, CommandPartsProps>(\n (\n {\n children,\n label,\n query: controlledQuery,\n defaultQuery = '',\n onQueryChange,\n onSelect,\n className,\n ...props\n },\n ref\n ) => {\n const [ownQuery, setOwnQuery] = useState(defaultQuery);\n const query = controlledQuery ?? ownQuery;\n\n // Each item's `onSelect`, by value, read when it runs.\n const handlersRef = useRef(new Map<string, ItemHandler>());\n const registerHandler = useCallback(\n (value: string, handler: ItemHandler) => {\n const handlers = handlersRef.current;\n handlers.set(value, handler);\n return () => {\n if (handlers.get(value) === handler) handlers.delete(value);\n };\n },\n []\n );\n const run = (value: string) => {\n handlersRef.current.get(value)?.current?.();\n onSelect?.(value);\n };\n\n // Inline: the list is always on screen, nothing opens or closes it, and\n // Escape goes on to what's around it. `keepFirst` keeps the highlight on\n // the top match, so Enter runs it.\n const engine = useComboboxEngine({\n defaultOpen: true,\n onSelect: run,\n keepFirst: true,\n multiple: false,\n inline: true,\n deferred: false,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const rootClass = usePrefixedClassNames('command');\n\n // A polite status region, in the page from the start so it's there\n // before anything is written into it, announces `Command.Empty` when the\n // user's typing leaves it on screen: once each time that happens, not\n // again on each keystroke while it stays. An empty search isn't a search,\n // so it stays quiet then, and while the field's `isLoading` says results\n // are on their way, it waits.\n const [inputLoading, setInputLoading] = useState(false);\n const emptyRef = useRef<HTMLElement | null>(null);\n const [emptyShown, setEmptyShown] = useState(false);\n const announced =\n engine.typed && query !== '' && emptyShown && !inputLoading\n ? typedNoMatches\n : nothingToAnnounce;\n // The region reads the text on screen, whatever the message renders.\n const describeEmpty = useCallback(() => {\n const node = emptyRef.current;\n /* istanbul ignore if: it's only announced while it's on screen */\n if (!node) return null;\n return spokenText(node);\n }, []);\n const reportEmpty = useCallback((element: HTMLElement) => {\n emptyRef.current = element;\n setEmptyShown(true);\n return () => {\n emptyRef.current = null;\n setEmptyShown(false);\n };\n }, []);\n\n const onFieldChange = (value: string) => {\n if (controlledQuery === undefined) setOwnQuery(value);\n onQueryChange?.(value);\n engine.onChange();\n };\n\n // A new value each render: the engine's state and handlers are, and the\n // parts read the highlight from it.\n const context: CommandContextValue = {\n engine,\n label: label || defaultLabel,\n query,\n onFieldChange,\n reportLoading: setInputLoading,\n reportEmpty,\n registerHandler,\n };\n\n const { rootRef } = engine;\n const rootRefs = useCallback(\n (node: HTMLDivElement | null) => setRefs(node, rootRef, ref),\n [rootRef, ref]\n );\n\n return (\n // The ref after the spread, so the element stays the Command's.\n <div\n className={classNames(rootClass, bulmaHelperClasses, className)}\n {...rest}\n ref={rootRefs}\n >\n <CommandContext.Provider value={context}>\n {children}\n </CommandContext.Provider>\n <StatusRegion items={announced} describe={describeEmpty} />\n </div>\n );\n }\n);\nCommandParts.displayName = 'CommandParts';\n\n/**\n * The search field, with the combobox role and the keys, rendered as an `Input` with a search icon.\n *\n * @function\n * @param {CommandInputProps} props - Props for the Command.Input component.\n * @param {React.Ref<HTMLInputElement>} ref - Forwarded ref to the `<input>`.\n * @returns {JSX.Element} The field in its Control.\n */\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(\n (\n {\n isLoading,\n iconLeft,\n iconLeftName,\n onKeyDown,\n onChange,\n onClick,\n onBlur,\n 'aria-autocomplete': ariaAutocomplete,\n ...props\n },\n ref\n ) => {\n const context = useCommand();\n const { engine, reportLoading } = context;\n useClientLayoutEffect(() => {\n reportLoading(!!isLoading);\n return () => reportLoading(false);\n }, [reportLoading, isLoading]);\n const { inputRef } = engine;\n const inputRefs = useCallback(\n (node: HTMLInputElement | null) => setRefs(node, inputRef, ref),\n [inputRef, ref]\n );\n const { expanded, highlighted } = engine;\n // A name the caller gave the field wins over the Command's `label`.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n\n return (\n // The attributes the Command owns after the caller's, so a stray\n // `aria-expanded` never wins. A search isn't prose, so the browser's\n // spelling and autocorrect stay out of it unless the caller asks.\n <Input\n autoCorrect=\"off\"\n spellCheck={false}\n {...props}\n ref={inputRefs}\n value={context.query}\n iconLeft={\n iconLeft === undefined && !iconLeftName ? <SearchIcon /> : iconLeft\n }\n iconLeftName={iconLeftName}\n isLoading={isLoading}\n aria-label={callerNamed ? props['aria-label'] : context.label}\n role=\"combobox\"\n aria-autocomplete={ariaAutocomplete ?? 'list'}\n aria-haspopup=\"listbox\"\n aria-expanded={expanded}\n aria-controls={expanded ? engine.listboxId : undefined}\n aria-activedescendant={\n expanded && highlighted !== null\n ? engine.itemId(highlighted)\n : undefined\n }\n autoComplete=\"off\"\n onKeyDown={event => {\n onKeyDown?.(event);\n engine.onKeyDown(event);\n }}\n onChange={event => {\n onChange?.(event);\n context.onFieldChange(event.target.value);\n }}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) engine.onClick();\n }}\n onBlur={event => {\n onBlur?.(event);\n engine.onBlur(event);\n }}\n />\n );\n }\n);\nCommandInput.displayName = 'CommandInput';\n\n/**\n * The list of items, a `listbox` named by the Command's `label`.\n *\n * @function\n * @param {CommandListProps} props - Props for the Command.List component.\n * @returns {JSX.Element} The listbox.\n */\nexport const CommandList: React.FC<CommandListProps> = ({\n children,\n className,\n onMouseDown,\n ...props\n}) => {\n const { engine, label } = useCommand();\n const { listboxRef, listboxId, keepFocus } = engine;\n const listClass = usePrefixedClassNames('command-list');\n // A name the caller gave the list wins over the Command's.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n return (\n <div\n className={classNames(listClass, className)}\n {...props}\n ref={listboxRef}\n id={listboxId || undefined}\n role=\"listbox\"\n aria-label={callerNamed ? props['aria-label'] : label}\n onMouseDown={event => {\n onMouseDown?.(event);\n keepFocus(event);\n }}\n >\n {children}\n </div>\n );\n};\nCommandList.displayName = 'CommandList';\n\n/**\n * Items under a heading, a `group` named by it.\n *\n * @function\n * @param {CommandGroupProps} props - Props for the Command.Group component.\n * @returns {JSX.Element} The group and its heading.\n */\nexport const CommandGroup: React.FC<CommandGroupProps> = ({\n label,\n children,\n className,\n ...props\n}) => {\n const labelId = useId();\n const groupClass = usePrefixedClassNames('command-group');\n const labelClass = usePrefixedClassNames('command-group-label');\n // A name the caller gave the group wins over its heading's, as on the list.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n return (\n <div\n className={classNames(groupClass, className)}\n {...props}\n role=\"group\"\n aria-labelledby={callerNamed ? props['aria-labelledby'] : labelId}\n >\n <div className={labelClass} id={labelId}>\n {label}\n </div>\n {children}\n </div>\n );\n};\nCommandGroup.displayName = 'CommandGroup';\n\n/**\n * One thing to do in the list, named by its label and described by its description and hint.\n *\n * @function\n * @param {CommandItemProps} props - Props for the Command.Item component.\n * @returns {JSX.Element} The item.\n */\nexport const CommandItem: React.FC<CommandItemProps> = ({\n value,\n disabled = false,\n onSelect,\n icon,\n description,\n hint,\n children,\n className,\n onClick,\n onPointerMove,\n ...props\n}) => {\n const { engine, registerHandler } = useCommand();\n const itemRef = useRef<HTMLDivElement>(null);\n const { registerItem } = engine;\n useClientLayoutEffect(\n () =>\n registerItem(itemRef.current as HTMLDivElement, {\n value,\n disabled,\n checked: false,\n }),\n [registerItem, value, disabled]\n );\n const onSelectRef = useLatestRef(onSelect);\n useClientLayoutEffect(\n () => registerHandler(value, onSelectRef),\n [registerHandler, value, onSelectRef]\n );\n const highlighted = engine.highlighted === value;\n const itemClass = usePrefixedClassNames('command-item', {\n 'is-active': highlighted,\n 'is-disabled': disabled,\n });\n const iconClass = usePrefixedClassNames('command-item-icon');\n const bodyClass = usePrefixedClassNames('command-item-body');\n const labelClass = usePrefixedClassNames('command-item-label');\n const descriptionClass = usePrefixedClassNames('command-item-description');\n const hintClass = usePrefixedClassNames('command-item-hint');\n\n // Named by its label alone, so a screen reader says what it does before\n // the rest, and described by the description and the hint.\n const baseId = useId();\n const labelId = `${baseId}label`;\n const descriptionId = isShown(description)\n ? `${baseId}description`\n : undefined;\n const hintId = isShown(hint) ? `${baseId}hint` : undefined;\n const describedBy =\n [descriptionId, hintId].filter(Boolean).join(' ') || undefined;\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n\n return (\n <div\n className={classNames(itemClass, className)}\n aria-describedby={describedBy}\n {...props}\n ref={itemRef}\n id={engine.itemId(value) || undefined}\n role=\"option\"\n // The highlighted option, as the ARIA Authoring Practices' combobox\n // has it, and no attribute on the rest. Never a disabled option.\n aria-selected={disabled ? undefined : highlighted || undefined}\n aria-disabled={disabled || undefined}\n aria-labelledby={callerNamed ? props['aria-labelledby'] : labelId}\n onClick={event => {\n onClick?.(event);\n if (!disabled && !event.defaultPrevented) engine.pick(value);\n }}\n onPointerMove={event => {\n onPointerMove?.(event);\n if (!disabled && !highlighted) engine.hover(value);\n }}\n >\n {isShown(icon) && (\n <span className={iconClass} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className={bodyClass}>\n <span className={labelClass} id={labelId}>\n {children}\n </span>\n {descriptionId && (\n <span className={descriptionClass} id={descriptionId}>\n {description}\n </span>\n )}\n </span>\n {hintId && (\n <span className={hintClass} id={hintId}>\n {hint}\n </span>\n )}\n </div>\n );\n};\nCommandItem.displayName = 'CommandItem';\n\n/**\n * The message shown in place of the list when nothing matches, announced when typing brings it on screen.\n *\n * @function\n * @param {CommandEmptyProps} props - Props for the Command.Empty component.\n * @returns {JSX.Element} The message.\n */\nexport const CommandEmpty: React.FC<CommandEmptyProps> = ({\n children,\n className,\n onMouseDown,\n ...props\n}) => {\n const { engine, reportEmpty } = useCommand();\n const emptyRef = useRef<HTMLDivElement>(null);\n useClientLayoutEffect(\n () => reportEmpty(emptyRef.current as HTMLDivElement),\n [reportEmpty]\n );\n const emptyClass = usePrefixedClassNames('command-empty');\n return (\n <div\n className={classNames(emptyClass, className)}\n {...props}\n ref={emptyRef}\n onMouseDown={event => {\n onMouseDown?.(event);\n engine.keepFocus(event);\n }}\n >\n {children}\n </div>\n );\n};\nCommandEmpty.displayName = 'CommandEmpty';\n\n/** What a Command given `actions` renders inside its parts root. */\ninterface CommandActionsContentProps {\n actions: CommandAction[];\n filter: CommandActionsProps['filter'];\n placeholder: string | undefined;\n empty: React.ReactNode;\n}\n\n/**\n * The field, and the actions that match the search, grouped, or the empty\n * message. The search is the parts root's, read from its context.\n */\nconst CommandActionsContent = ({\n actions,\n filter,\n placeholder,\n empty,\n}: CommandActionsContentProps) => {\n const { query } = useCommand();\n const matchText = useLocaleMatcher();\n const shown = filter\n ? filter(query, actions)\n : filterActions(query, actions, matchText);\n\n // Each group where the matches first name it, and the actions with none\n // together where the first of them is, so the best match stays on top.\n const sections = new Map<string, CommandAction[]>();\n for (const action of shown) {\n const group = action.group ?? '';\n sections.set(group, [...(sections.get(group) ?? []), action]);\n }\n const renderItem = (action: CommandAction) => (\n <CommandItem\n key={action.id}\n value={action.id}\n disabled={action.disabled}\n icon={action.icon}\n description={action.description}\n hint={action.hint}\n onSelect={action.onSelect}\n >\n {action.label}\n </CommandItem>\n );\n\n return (\n <>\n <CommandInput placeholder={placeholder} />\n {shown.length > 0 ? (\n <CommandList>\n {Array.from(sections, ([group, members]) =>\n group ? (\n <CommandGroup key={group} label={group}>\n {members.map(renderItem)}\n </CommandGroup>\n ) : (\n members.map(renderItem)\n )\n )}\n </CommandList>\n ) : isShown(empty) ? (\n <CommandEmpty>{empty}</CommandEmpty>\n ) : null}\n </>\n );\n};\n\n/**\n * The Command given `actions`. It renders the parts itself and filters the\n * actions as the user types, so a run goes through the same parts, keys and\n * ARIA as one built by hand.\n */\nconst CommandFromActions = forwardRef<HTMLDivElement, CommandActionsProps>(\n (\n { actions, filter, placeholder, empty = defaultEmpty, children, ...rest },\n ref\n ) => {\n if (flattenChildren(children).length > 0) {\n warnOnce(\n 'Command:actions-children',\n '[bestax-bulma] <Command actions> renders its own field and items, ' +\n 'so its children are ignored. Give it actions or build it from ' +\n 'parts, not both.'\n );\n }\n return (\n <CommandParts {...rest} ref={ref}>\n <CommandActionsContent\n actions={actions}\n filter={filter}\n placeholder={placeholder}\n empty={empty}\n />\n </CommandParts>\n );\n }\n);\nCommandFromActions.displayName = 'CommandFromActions';\n\n/**\n * The `Command` component is a search field over a list of things to do, which narrows as you type and runs the top match on Enter: inline by default, and a command palette in a modal as `Command.Dialog`.\n *\n * Given `actions`, it's one element. It renders the field, the list, the\n * groups and the empty message, and filters the actions by label, keywords\n * and description as the user types, with label matches first. `filter`\n * takes over the matching, for fuzzy search.\n *\n * Built from parts, the app owns the items: what's in the list and how it's\n * filtered, from the search `onQueryChange` reports. Nothing filters them,\n * so a server's answer shows as it came.\n *\n * Either way, focus stays in the field, and the highlighted item is its\n * `aria-activedescendant`. The first enabled item is highlighted whenever\n * the items change, so Enter runs the top match. Running an item calls its\n * own `onSelect`, then the Command's.\n *\n * When typing leaves the empty message on screen, its text is announced\n * through a polite status region, once, after any loading ends. Result\n * counts aren't announced: a screen reader reads the list's size from the\n * markup, and a count on every keystroke talks over the typing.\n *\n * @function\n * @param {CommandProps} props - Props for the Command component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `div.command`.\n * @returns {JSX.Element} The field and its list.\n *\n * @example\n * <Command\n * label=\"Settings\"\n * placeholder=\"Search settings\"\n * actions={[\n * { id: 'profile', label: 'Edit profile', onSelect: openProfile },\n * { id: 'theme', label: 'Dark mode', keywords: ['theme'], onSelect: toggleTheme },\n * ]}\n * />\n *\n * @example\n * <Command label=\"People\" onQueryChange={setQuery} onSelect={openProfile}>\n * <Command.Input placeholder=\"Find a person\" />\n * {matches.length > 0 ? (\n * <Command.List>\n * {matches.map(person => (\n * <Command.Item key={person.id} value={person.id}>\n * {person.name}\n * </Command.Item>\n * ))}\n * </Command.List>\n * ) : (\n * <Command.Empty>No one matches</Command.Empty>\n * )}\n * </Command>\n */\nconst CommandRoot = forwardRef<HTMLDivElement, CommandProps>((props, ref) =>\n props.actions === undefined ? (\n <CommandParts {...props} ref={ref} />\n ) : (\n <CommandFromActions {...props} ref={ref} />\n )\n);\n\n/** A key combination, read from a `shortcut` string. */\ninterface ParsedShortcut {\n /** The key, lowercased, as `KeyboardEvent.key` names it. */\n key: string;\n mod: boolean;\n ctrl: boolean;\n meta: boolean;\n alt: boolean;\n shift: boolean;\n}\n\n/** Other names a key goes by in a `shortcut`, for the ones `key` spells otherwise. */\nconst keyAliases: Record<string, string> = {\n space: ' ',\n esc: 'escape',\n};\n\n/**\n * Reads a `shortcut` such as `\"mod+k\"` or `\"ctrl + shift + p\"`.\n *\n * @param shortcut - Modifiers and a key, joined by `+`.\n * @returns The combination, or `null` when it doesn't read as one.\n */\nconst parseShortcut = (shortcut: string): ParsedShortcut | null => {\n const parts = shortcut\n .toLowerCase()\n .split('+')\n .map(part => part.trim());\n const key = parts.pop() as string;\n if (key === '') return null;\n const parsed: ParsedShortcut = {\n key: keyAliases[key] ?? key,\n mod: false,\n ctrl: false,\n meta: false,\n alt: false,\n shift: false,\n };\n for (const part of parts) {\n if (part === 'mod') parsed.mod = true;\n else if (part === 'ctrl' || part === 'control') parsed.ctrl = true;\n else if (part === 'meta' || part === 'cmd' || part === 'command')\n parsed.meta = true;\n else if (part === 'alt' || part === 'option') parsed.alt = true;\n else if (part === 'shift') parsed.shift = true;\n else return null;\n }\n return parsed;\n};\n\n/**\n * Whether a keydown is the combination. `mod` takes Ctrl or ⌘, and any other\n * modifier has to be as the combination says, so `mod+k` isn't\n * `mod+shift+k`. A letter or digit is matched by its key, and by where it\n * sits on the keyboard only when the key isn't a Latin letter or digit at\n * all, as on a Cyrillic layout or with Option held on a Mac, so another\n * Latin layout's own letters keep their own shortcuts.\n */\nconst matchesShortcut = (\n event: KeyboardEvent,\n shortcut: ParsedShortcut\n): boolean => {\n if (event.altKey !== shortcut.alt) return false;\n // A symbol such as `?` already says whether Shift was down, and which key\n // takes Shift to type it depends on the layout, so Shift is only checked\n // for a letter, a digit or a named key, unless the combination names it.\n const shiftMatters =\n shortcut.shift ||\n shortcut.key.length > 1 ||\n /^[a-z0-9]$/.test(shortcut.key);\n if (shiftMatters && event.shiftKey !== shortcut.shift) return false;\n if (shortcut.mod) {\n if (!event.ctrlKey && !event.metaKey) return false;\n } else if (\n event.ctrlKey !== shortcut.ctrl ||\n event.metaKey !== shortcut.meta\n ) {\n return false;\n }\n const key = (event.key ?? '').toLowerCase();\n if (key === shortcut.key) return true;\n if (/^[a-z0-9]$/.test(key)) return false;\n if (/^[a-z]$/.test(shortcut.key)) {\n return event.code === `Key${shortcut.key.toUpperCase()}`;\n }\n if (/^[0-9]$/.test(shortcut.key)) {\n return event.code === `Digit${shortcut.key}`;\n }\n return false;\n};\n\n/** Input types that take no typing, so a shortcut pressed in one still counts. */\nconst untypedInputs = new Set([\n 'button',\n 'checkbox',\n 'color',\n 'file',\n 'hidden',\n 'image',\n 'radio',\n 'range',\n 'reset',\n 'submit',\n]);\n\n/**\n * Whether a keydown happened while the user was typing: in a text field, a\n * text area, a select, or editable content. The composed path's first entry\n * is the element itself, even inside a shadow root.\n */\nconst isTyping = (event: KeyboardEvent): boolean => {\n const target = event.composedPath()[0] as Partial<Element> | undefined;\n if (typeof target?.closest !== 'function') return false;\n const element = target as Element;\n const editable = element.closest('[contenteditable]');\n if (editable && editable.getAttribute('contenteditable') !== 'false') {\n return true;\n }\n const tag = element.tagName;\n if (tag === 'TEXTAREA' || tag === 'SELECT') return true;\n return (\n tag === 'INPUT' &&\n !untypedInputs.has((element as HTMLInputElement).type.toLowerCase())\n );\n};\n\n/**\n * The Command in a modal, a command palette, opened by its `shortcut` or by `open`, that closes once an item has run.\n *\n * It renders nothing while it's closed. Open, it's a `Modal` with a\n * background and the Command's box as the `dialog`, named by `label`:\n * focus goes to the search field, Tab stays inside, Escape and a click on\n * the background close it, the page behind it doesn't scroll, and focus goes\n * back to where it was when it closes.\n *\n * @function\n * @param {CommandDialogProps} props - Props for the Command.Dialog component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `div.command` that is the dialog.\n * @returns {JSX.Element | null} The dialog, or nothing while it's closed.\n */\nexport const CommandDialog = forwardRef<HTMLDivElement, CommandDialogProps>(\n (\n {\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n shortcut,\n closeOnSelect = true,\n clearOnClose = true,\n portal,\n label,\n query: controlledQuery,\n defaultQuery = '',\n onQueryChange,\n onSelect,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = controlledOpen ?? ownOpen;\n // Only ever asked for the other state: the shortcut listens while it's\n // closed, and everything that closes it is there while it's open.\n const setOpen = (next: boolean) => {\n if (controlledOpen === undefined) setOwnOpen(next);\n onOpenChange?.(next);\n };\n\n // The search is held here rather than in the Command, which is only\n // mounted while the dialog is open, so it can outlive a close when\n // `clearOnClose` is off.\n const [ownQuery, setOwnQuery] = useState(defaultQuery);\n const query = controlledQuery ?? ownQuery;\n const setQuery = (next: string) => {\n if (controlledQuery === undefined) setOwnQuery(next);\n onQueryChange?.(next);\n };\n // Closing clears the search, however the dialog closed. Our own is\n // cleared during render, React's pattern for adjusting state when other\n // state changes, and a controlled one is asked for after the commit.\n const [shownOpen, setShownOpen] = useState(open);\n if (shownOpen !== open) {\n setShownOpen(open);\n if (!open && clearOnClose && controlledQuery === undefined) {\n setOwnQuery('');\n }\n }\n const wasOpenRef = useRef(open);\n const clearRef = useLatestRef(() => {\n if (clearOnClose && controlledQuery !== undefined && query !== '') {\n onQueryChange?.('');\n }\n });\n useEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (wasOpen && !open) clearRef.current();\n }, [open, clearRef]);\n\n if (controlledOpen === undefined && !defaultOpen && !shortcut) {\n warnOnce(\n 'Command.Dialog:no-opener',\n '[bestax-bulma] <Command.Dialog> has no way to open. Give it a ' +\n 'shortcut, or open and onOpenChange.'\n );\n }\n if (shortcut && !parseShortcut(shortcut)) {\n warnOnce(\n `Command.Dialog:shortcut:${shortcut}`,\n `[bestax-bulma] <Command.Dialog> can't read the shortcut ` +\n `\"${shortcut}\". Write modifiers and a key joined by +, such as ` +\n `\"mod+k\", where the modifiers are mod, ctrl, meta, alt and shift.`\n );\n }\n\n const openFromShortcut = useLatestRef(() => setOpen(true));\n useEffect(() => {\n const combination = shortcut ? parseShortcut(shortcut) : null;\n if (!combination || open) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (\n event.defaultPrevented ||\n event.isComposing ||\n event.keyCode === 229 ||\n !matchesShortcut(event, combination) ||\n isTyping(event) ||\n // A Modal, a Dialog, a Sidebar with its overlay or a full-page\n // Loading has the page shut off, so the key isn't the page's. A\n // Sidebar without one leaves the page in use, so it still opens.\n isModalOverlayOpen()\n ) {\n return;\n }\n // The browser's own use of the combination, such as Ctrl+K's search\n // in the address bar, doesn't happen as well.\n event.preventDefault();\n openFromShortcut.current();\n };\n // On `window`, where a keydown arrives last, so anything on the page\n // that used the key first has said so with `preventDefault()`.\n window.addEventListener('keydown', onKeyDown);\n return () => window.removeEventListener('keydown', onKeyDown);\n }, [shortcut, open, openFromShortcut]);\n\n const dialogClass = usePrefixedClassNames('command-dialog');\n\n if (!open) return null;\n\n const close = () => setOpen(false);\n const run = (value: string) => {\n onSelect?.(value);\n if (closeOnSelect) close();\n };\n\n return (\n <Modal isActive onClose={close} role=\"presentation\" portal={portal}>\n <Modal.Background onClick={close} />\n <CommandRoot\n {...(props as CommandProps)}\n ref={ref}\n className={classNames(dialogClass, className)}\n label={label}\n query={query}\n onQueryChange={setQuery}\n onSelect={run}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={\n ariaLabelledBy === undefined\n ? ariaLabel || label || defaultLabel\n : ariaLabel\n }\n aria-labelledby={ariaLabelledBy}\n />\n </Modal>\n );\n }\n);\nCommandDialog.displayName = 'CommandDialog';\n\n/** Command with Input, List, Group, Item, Empty and Dialog sub-components. */\nexport const Command = withSubComponents(\n CommandRoot,\n {\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n Empty: CommandEmpty,\n Dialog: CommandDialog,\n },\n 'Command'\n);\n\nexport default Command;\n"],"names":["typedNoMatches","nothingToAnnounce","noop","registerNoth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ACF,MAAM,EAAA,YAAA,EAEf,cAAc,KAAK;AACjB,sBAAE,SAAS,IAAI,KAAK,IAAI;AACxB,sBAAE,SAAS,EAAA,iBAAA,EAEE,cAAc,EAAA,CAC/B,CAAA,EAAA,CACI;AAEZ,CAAC;AAEH,aAAa,CAAC,WAAW,GAAG,eAAe;AAE3C;AACO,MAAM,OAAO,GAAG,iBAAiB,CACtC,WAAW,EACX;AACE,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,YAAY;AACnB,IAAA,MAAM,EAAE,aAAa;CACtB,EACD,SAAS;;"}
|
|
1
|
+
{"version":3,"file":"Command.js","sources":["../../../src/components/Command.tsx"],"sourcesContent":["import React, {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { useLatestRef } from '../helpers/useLatestRef';\nimport { flattenChildren } from '../helpers/flattenChildren';\nimport { warnOnce } from '../helpers/devWarnings';\nimport { useLocaleMatcher, type TextMatcher } from '../helpers/localeFormat';\nimport { isModalOverlayOpen } from '../helpers/overlayStack';\nimport { StatusRegion, spokenText } from '../helpers/statusRegion';\nimport {\n ComboboxEngine,\n useComboboxEngine,\n} from '../helpers/useComboboxEngine';\nimport { Input, InputProps } from '../form/Input';\nimport { Modal } from './Modal';\n\n/** What names a Command that's given no `label`. */\nconst defaultLabel = 'Commands';\n\n/** What a Command given `actions` shows when nothing matches, unless it's given `empty`. */\nconst defaultEmpty = 'No results';\n\n// What the status region announces: the `Command.Empty` content, as the one\n// item it's handed while that content is on screen because of the user's\n// typing.\nconst typedNoMatches = [{ id: 'empty' }];\nconst nothingToAnnounce: Array<{ id: string }> = [];\n\n/** Whether a slot was given something to show. */\nconst isShown = (node: React.ReactNode): boolean =>\n node !== undefined && node !== null && node !== false && node !== '';\n\n/** One action in a Command's `actions`. */\nexport interface CommandAction {\n /** Unique within the Command. It's the item's `value`, so `onSelect` hands it back. */\n id: string;\n /** What the item shows, and what typing matches first. */\n label: string;\n /**\n * A line under the label, such as what the action does or where it goes.\n * Typing matches it too, after the labels. A screen reader hears it after\n * the label, as the item's description.\n */\n description?: string;\n /**\n * More words typing matches, after the labels, such as `['theme']` for\n * \"Dark mode\". They aren't shown.\n */\n keywords?: string[];\n /**\n * The heading the action goes under. Groups show in the order the matches\n * first name them, so the best match is always on top, and the actions with\n * no group show together where the first of them is.\n */\n group?: string;\n /** Shown before the label, and hidden from assistive tech. */\n icon?: React.ReactNode;\n /**\n * Shown at the end of the row, such as the action's own keyboard shortcut in\n * a `Kbd.Group`, or a `Tag`. It only shows: nothing listens for a shortcut\n * written here. A screen reader hears it after the label, with the\n * description.\n */\n hint?: React.ReactNode;\n /** Shown, and reached with the arrows so a screen reader user finds it, but never run. */\n disabled?: boolean;\n /** Runs the action, when it's picked with Enter or a click, before the Command's `onSelect`. */\n onSelect?: () => void;\n}\n\n/** What a Command takes whether it's given `actions` or built from parts. */\ninterface CommandBaseProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'onSelect'>,\n Omit<BulmaClassesProps, 'color'> {\n /**\n * What the Command is for, such as \"Commands\" or \"Settings\". It's never\n * shown: it names the search field and the list for assistive tech, and in\n * `Command.Dialog` the dialog too. An empty string counts as none.\n * @defaultValue 'Commands'\n */\n label?: string;\n /**\n * The search, controlled: the text in the field. Pair it with\n * `onQueryChange`.\n */\n query?: string;\n /**\n * The search to start with when uncontrolled.\n * @defaultValue ''\n */\n defaultQuery?: string;\n /**\n * Called with the search as the user types it. Built from parts, this is\n * where the app filters its items.\n */\n onQueryChange?: (query: string) => void;\n /**\n * Called with the picked item's `value`, an action's `id`, when it's run\n * with Enter or a click, after the item's own `onSelect`. A disabled item\n * is never run.\n */\n onSelect?: (value: string) => void;\n}\n\n/** Props for a Command given `actions`. */\nexport interface CommandActionsProps extends CommandBaseProps {\n /**\n * The actions, for a Command that renders the field, the list, the groups\n * and the empty message itself. Typing filters them by label, keywords and\n * description, ignoring case, with label matches first. Inside a\n * `LocaleProvider` with a `locale`, it ignores accents too where that\n * language does, so \"cafe\" finds \"Café\". Leave it out to build the\n * Command from parts.\n */\n actions: CommandAction[];\n /**\n * Takes over the filtering, with `actions`: it's handed the search as typed\n * and every action, and returns the ones to show, in the order to show\n * them, which is how to plug in fuzzy matching or cut the list short. It's\n * called with an empty search too.\n */\n filter?: (query: string, actions: CommandAction[]) => CommandAction[];\n /** The field's placeholder, with `actions`. */\n placeholder?: string;\n /**\n * What shows in place of the list, with `actions`, when nothing matches.\n * It's announced the way `Command.Empty` is. `null` shows nothing.\n * @defaultValue 'No results'\n */\n empty?: React.ReactNode;\n /** @internal With `actions`, the Command renders its own parts. */\n children?: never;\n}\n\n/** Props for a Command built from parts. */\nexport interface CommandPartsProps extends CommandBaseProps {\n /**\n * The parts, in order: `Command.Input`, then `Command.List` while there are\n * items and `Command.Empty` while there aren't. Nothing filters them, so\n * render the items that match the search `onQueryChange` reports. With\n * `actions` there are none to give: children given with it are ignored,\n * with a warning in development.\n */\n children?: React.ReactNode;\n /** @internal Built from parts, the app renders the items. */\n actions?: never;\n /** @internal Built from parts, the app filters. */\n filter?: never;\n /** @internal Built from parts, `Command.Input` takes the placeholder. */\n placeholder?: never;\n /** @internal Built from parts, `Command.Empty` is the empty message. */\n empty?: never;\n}\n\n/**\n * Props for the Command component: given `actions`, it renders, filters and\n * groups them itself, and without them it's built from parts. The helper\n * props, the other attributes and the `ref` land on the `div.command` around\n * the field and the list.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `div.command` around the field and the list.\n */\nexport type CommandProps = CommandActionsProps | CommandPartsProps;\n\n/** What Command.Dialog takes on top of a Command's props. */\ninterface CommandDialogOwnProps {\n /** Controlled open state. When set, opening and closing only report through `onOpenChange`. */\n open?: boolean;\n /**\n * Initial open state when uncontrolled.\n * @defaultValue false\n */\n defaultOpen?: boolean;\n /**\n * Called with the open state asked for: `true` from the `shortcut`, and\n * `false` from Escape, a click on the background, or a pick while\n * `closeOnSelect` is on. Fires in controlled and uncontrolled use.\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * A key combination that opens the dialog from anywhere on the page, such\n * as `\"mod+k\"`: modifiers and a key joined by `+`, where `mod` is Ctrl or\n * ⌘ (either one, on every platform), and the others are `ctrl`, `meta`,\n * `alt` and `shift`. It's ignored while the user is typing in a text field,\n * a select or editable content, while an IME is composing, while a modal\n * overlay is open (a `Modal`, a `Dialog`, a `Sidebar` with its overlay or a\n * full-page `Loading`), and when something else has already used the key.\n * It only opens the dialog. Off unless given.\n */\n shortcut?: string;\n /**\n * Closes the dialog once an item has run. Turn it off for an item that\n * opens another page of the palette, and close it yourself with `open`.\n * @defaultValue true\n */\n closeOnSelect?: boolean;\n /**\n * Clears the search when the dialog closes: an uncontrolled one itself,\n * and a controlled one through `onQueryChange('')`.\n * @defaultValue true\n */\n clearOnClose?: boolean;\n /**\n * Renders the dialog into a portal target instead of inline. Forwarded to\n * the underlying `Modal`; see its `portal` prop for the accepted values.\n * @defaultValue false\n */\n portal?: boolean | string | HTMLElement;\n}\n\n/** Props for a Command.Dialog given `actions`. */\nexport interface CommandDialogActionsProps\n extends CommandActionsProps, CommandDialogOwnProps {}\n\n/** Props for a Command.Dialog built from parts. */\nexport interface CommandDialogPartsProps\n extends CommandPartsProps, CommandDialogOwnProps {}\n\n/**\n * Props for Command.Dialog, the Command in a modal: a Command's props, given\n * `actions` or built from parts, and the dialog's own. The helper props, the\n * other attributes and the `ref` land on the `div.command` that is the\n * dialog.\n *\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `div.command` that is the dialog.\n */\nexport type CommandDialogProps =\n CommandDialogActionsProps | CommandDialogPartsProps;\n\n/**\n * Props for Command.Input, the search field. It renders `Input`, so its\n * icons, `isLoading` and `color` work as they do there. Its text is the\n * Command's `query`, and it's `autoComplete=\"off\"`, so the browser's own\n * suggestions don't open over the list: neither is yours to set.\n */\nexport type CommandInputProps = Omit<\n InputProps,\n // By name, since the docs read only names out of an Omit. The Field props:\n | 'label'\n | 'labelSize'\n | 'labelProps'\n | 'horizontal'\n | 'message'\n | 'messageColor'\n | 'fieldClassName'\n // And what the Command sets on the field itself:\n | 'role'\n | 'autoComplete'\n | 'value'\n | 'defaultValue'\n>;\n\n/**\n * Props for Command.List, the list. Its `id` is the one the field's\n * `aria-controls` names, so it isn't yours to set.\n */\nexport interface CommandListProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role' | 'id'\n> {\n /** `Command.Item`s and `Command.Group`s, in the order they're shown. */\n children?: React.ReactNode;\n}\n\n/** Props for Command.Group, items under a heading. */\nexport interface CommandGroupProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role'\n> {\n /**\n * The heading, which also names the group for assistive tech, unless you\n * give the group an `aria-label` or `aria-labelledby` of its own.\n */\n label: React.ReactNode;\n /** The group's `Command.Item`s. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for Command.Item, one thing to do in the list. Its `id` follows from\n * its `value`, since the field's `aria-activedescendant` names it, so it\n * isn't yours to set.\n */\nexport interface CommandItemProps extends Omit<\n React.HTMLAttributes<HTMLDivElement>,\n 'role' | 'onSelect' | 'id'\n> {\n /** What the Command's `onSelect` hands back. Unique within the Command. */\n value: string;\n /**\n * Can't be run. The arrows still reach it, so a screen reader user finds\n * it, and it's never `aria-selected`.\n * @defaultValue false\n */\n disabled?: boolean;\n /** Runs the item, when it's picked with Enter or a click, before the Command's `onSelect`. */\n onSelect?: () => void;\n /** Shown before the label, and hidden from assistive tech. */\n icon?: React.ReactNode;\n /**\n * A line under the label. A screen reader hears it after the label, as the\n * item's description.\n */\n description?: React.ReactNode;\n /**\n * Shown at the end of the row, such as a keyboard shortcut in a\n * `Kbd.Group`, or a `Tag`. It only shows. A screen reader hears it after\n * the label, with the description.\n */\n hint?: React.ReactNode;\n /** The label, which names the item. */\n children?: React.ReactNode;\n}\n\n/** Props for Command.Empty, the message shown in place of the list. */\nexport interface CommandEmptyProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * The message, such as \"No commands match\". Its text is announced when\n * typing brings it on screen and isn't read again while it stays, so a\n * message that names the search is heard for the first search only.\n */\n children?: React.ReactNode;\n}\n\n/** A handler an item registers, read when it's run. */\ntype ItemHandler = { readonly current: (() => void) | undefined };\n\n/** What the Command hands its parts. */\ninterface CommandContextValue {\n engine: ComboboxEngine;\n /** What names the field and the list. */\n label: string;\n /** The search. */\n query: string;\n /** A change to the field's value, which is the user typing. */\n onFieldChange: (value: string) => void;\n /** Tells the Command the field's `isLoading`, which holds the empty message's announcement. */\n reportLoading: (loading: boolean) => void;\n /** Records the empty message while it's on screen. Returns the function that forgets it. */\n reportEmpty: (element: HTMLElement) => () => void;\n /** Records an item's `onSelect`. Returns the function that forgets it. */\n registerHandler: (value: string, handler: ItemHandler) => () => void;\n}\n\nconst noop = () => {};\nconst registerNothing = () => noop;\n\n// What a part rendered outside a Command reads: nothing to report to, so it\n// renders its markup and does nothing.\nconst standalone: CommandContextValue = {\n engine: {\n open: false,\n expanded: false,\n highlighted: null,\n typed: false,\n listboxId: '',\n itemId: () => '',\n rootRef: { current: null },\n inputRef: { current: null },\n listboxRef: { current: null },\n registerPopup: registerNothing,\n registerItem: registerNothing,\n onKeyDown: noop,\n onChange: noop,\n onClick: noop,\n onBlur: noop,\n hover: noop,\n pick: noop,\n keepFocus: noop,\n markInside: noop,\n },\n label: defaultLabel,\n query: '',\n onFieldChange: noop,\n reportLoading: noop,\n reportEmpty: registerNothing,\n registerHandler: registerNothing,\n};\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\n\nconst useCommand = () => useContext(CommandContext) ?? standalone;\n\n/** Hands a node to a forwarded ref and to one of the component's own. */\nfunction setRefs<T>(\n node: T | null,\n own: React.MutableRefObject<T | null>,\n forwarded: React.ForwardedRef<T>\n) {\n own.current = node;\n if (typeof forwarded === 'function') forwarded(node);\n else if (forwarded) forwarded.current = node;\n}\n\n/**\n * The default filter: the actions whose label, keywords or description hold\n * the search, ignoring case and the spaces around it, label matches first and\n * the order otherwise kept. An empty search keeps them all. `matchText`, a\n * `LocaleProvider`'s locale-aware matcher, replaces the lowercased\n * comparison when there is one.\n */\nconst filterActions = (\n query: string,\n actions: CommandAction[],\n matchText?: TextMatcher | null\n): CommandAction[] => {\n const search = query.trim();\n if (search === '') return actions;\n const term = search.toLowerCase();\n const holds = matchText\n ? (text: string) => matchText(text, search)\n : (text: string) => text.toLowerCase().includes(term);\n const byLabel: CommandAction[] = [];\n const byOther: CommandAction[] = [];\n for (const action of actions) {\n if (holds(action.label)) {\n byLabel.push(action);\n } else if (\n (action.description !== undefined && holds(action.description)) ||\n action.keywords?.some(holds)\n ) {\n byOther.push(action);\n }\n }\n return [...byLabel, ...byOther];\n};\n\n/** The search icon at the start of the field. */\nconst SearchIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n width=\"1em\"\n height=\"1em\"\n focusable=\"false\"\n >\n <circle cx=\"7\" cy=\"7\" r=\"4.75\" />\n <path d=\"M10.5 10.5L14 14\" />\n </svg>\n);\n\n/**\n * The Command built from parts: the field, the list, the keys and the run,\n * with the items and their filtering left to the app.\n */\nconst CommandParts = forwardRef<HTMLDivElement, CommandPartsProps>(\n (\n {\n children,\n label,\n query: controlledQuery,\n defaultQuery = '',\n onQueryChange,\n onSelect,\n className,\n ...props\n },\n ref\n ) => {\n const [ownQuery, setOwnQuery] = useState(defaultQuery);\n const query = controlledQuery ?? ownQuery;\n\n // Each item's `onSelect`, by value, read when it runs.\n const handlersRef = useRef(new Map<string, ItemHandler>());\n const registerHandler = useCallback(\n (value: string, handler: ItemHandler) => {\n const handlers = handlersRef.current;\n handlers.set(value, handler);\n return () => {\n if (handlers.get(value) === handler) handlers.delete(value);\n };\n },\n []\n );\n const run = (value: string) => {\n handlersRef.current.get(value)?.current?.();\n onSelect?.(value);\n };\n\n // Inline: the list is always on screen, nothing opens or closes it, and\n // Escape goes on to what's around it. `keepFirst` keeps the highlight on\n // the top match, so Enter runs it.\n const engine = useComboboxEngine({\n defaultOpen: true,\n onSelect: run,\n keepFirst: true,\n multiple: false,\n inline: true,\n deferred: false,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const rootClass = usePrefixedClassNames('command');\n\n // A polite status region, in the page from the start so it's there\n // before anything is written into it, announces `Command.Empty` when the\n // user's typing leaves it on screen: once each time that happens, not\n // again on each keystroke while it stays. An empty search isn't a search,\n // so it stays quiet then, and while the field's `isLoading` says results\n // are on their way, it waits.\n const [inputLoading, setInputLoading] = useState(false);\n const emptyRef = useRef<HTMLElement | null>(null);\n const [emptyShown, setEmptyShown] = useState(false);\n const announced =\n engine.typed && query !== '' && emptyShown && !inputLoading\n ? typedNoMatches\n : nothingToAnnounce;\n // The region reads the text on screen, whatever the message renders.\n const describeEmpty = useCallback(() => {\n const node = emptyRef.current;\n /* istanbul ignore if: it's only announced while it's on screen */\n if (!node) return null;\n return spokenText(node);\n }, []);\n const reportEmpty = useCallback((element: HTMLElement) => {\n emptyRef.current = element;\n setEmptyShown(true);\n return () => {\n emptyRef.current = null;\n setEmptyShown(false);\n };\n }, []);\n\n const onFieldChange = (value: string) => {\n if (controlledQuery === undefined) setOwnQuery(value);\n onQueryChange?.(value);\n engine.onChange();\n };\n\n // A new value each render: the engine's state and handlers are, and the\n // parts read the highlight from it.\n const context: CommandContextValue = {\n engine,\n label: label || defaultLabel,\n query,\n onFieldChange,\n reportLoading: setInputLoading,\n reportEmpty,\n registerHandler,\n };\n\n const { rootRef } = engine;\n const rootRefs = useCallback(\n (node: HTMLDivElement | null) => setRefs(node, rootRef, ref),\n [rootRef, ref]\n );\n\n return (\n // The ref after the spread, so the element stays the Command's.\n <div\n className={classNames(rootClass, bulmaHelperClasses, className)}\n {...rest}\n ref={rootRefs}\n >\n <CommandContext.Provider value={context}>\n {children}\n </CommandContext.Provider>\n <StatusRegion items={announced} describe={describeEmpty} />\n </div>\n );\n }\n);\nCommandParts.displayName = 'CommandParts';\n\n/**\n * The search field, with the combobox role and the keys, rendered as an `Input` with a search icon.\n *\n * @function\n * @param {CommandInputProps} props - Props for the Command.Input component.\n * @param {React.Ref<HTMLInputElement>} ref - Forwarded ref to the `<input>`.\n * @returns {JSX.Element} The field in its Control.\n */\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(\n (\n {\n isLoading,\n iconLeft,\n iconLeftName,\n onKeyDown,\n onChange,\n onClick,\n onBlur,\n 'aria-autocomplete': ariaAutocomplete,\n ...props\n },\n ref\n ) => {\n const context = useCommand();\n const { engine, reportLoading } = context;\n useClientLayoutEffect(() => {\n reportLoading(!!isLoading);\n return () => reportLoading(false);\n }, [reportLoading, isLoading]);\n const { inputRef } = engine;\n const inputRefs = useCallback(\n (node: HTMLInputElement | null) => setRefs(node, inputRef, ref),\n [inputRef, ref]\n );\n const { expanded, highlighted } = engine;\n // A name the caller gave the field wins over the Command's `label`.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n\n return (\n // The attributes the Command owns after the caller's, so a stray\n // `aria-expanded` never wins. A search isn't prose, so the browser's\n // spelling and autocorrect stay out of it unless the caller asks.\n <Input\n autoCorrect=\"off\"\n spellCheck={false}\n {...props}\n ref={inputRefs}\n value={context.query}\n iconLeft={\n iconLeft === undefined && !iconLeftName ? <SearchIcon /> : iconLeft\n }\n iconLeftName={iconLeftName}\n isLoading={isLoading}\n aria-label={callerNamed ? props['aria-label'] : context.label}\n role=\"combobox\"\n aria-autocomplete={ariaAutocomplete ?? 'list'}\n aria-haspopup=\"listbox\"\n aria-expanded={expanded}\n aria-controls={expanded ? engine.listboxId : undefined}\n aria-activedescendant={\n expanded && highlighted !== null\n ? engine.itemId(highlighted)\n : undefined\n }\n autoComplete=\"off\"\n onKeyDown={event => {\n onKeyDown?.(event);\n engine.onKeyDown(event);\n }}\n onChange={event => {\n onChange?.(event);\n context.onFieldChange(event.target.value);\n }}\n onClick={event => {\n onClick?.(event);\n if (!event.defaultPrevented) engine.onClick();\n }}\n onBlur={event => {\n onBlur?.(event);\n engine.onBlur(event);\n }}\n />\n );\n }\n);\nCommandInput.displayName = 'CommandInput';\n\n/**\n * The list of items, a `listbox` named by the Command's `label`.\n *\n * @function\n * @param {CommandListProps} props - Props for the Command.List component.\n * @returns {JSX.Element} The listbox.\n */\nexport const CommandList: React.FC<CommandListProps> = ({\n children,\n className,\n onMouseDown,\n ...props\n}) => {\n const { engine, label } = useCommand();\n const { listboxRef, listboxId, keepFocus } = engine;\n const listClass = usePrefixedClassNames('command-list');\n // A name the caller gave the list wins over the Command's.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n return (\n <div\n className={classNames(listClass, className)}\n {...props}\n ref={listboxRef}\n id={listboxId || undefined}\n role=\"listbox\"\n aria-label={callerNamed ? props['aria-label'] : label}\n onMouseDown={event => {\n onMouseDown?.(event);\n keepFocus(event);\n }}\n >\n {children}\n </div>\n );\n};\nCommandList.displayName = 'CommandList';\n\n/**\n * Items under a heading, a `group` named by it.\n *\n * @function\n * @param {CommandGroupProps} props - Props for the Command.Group component.\n * @returns {JSX.Element} The group and its heading.\n */\nexport const CommandGroup: React.FC<CommandGroupProps> = ({\n label,\n children,\n className,\n ...props\n}) => {\n const labelId = useId();\n const groupClass = usePrefixedClassNames('command-group');\n const labelClass = usePrefixedClassNames('command-group-label');\n // A name the caller gave the group wins over its heading's, as on the list.\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n return (\n <div\n className={classNames(groupClass, className)}\n {...props}\n role=\"group\"\n aria-labelledby={callerNamed ? props['aria-labelledby'] : labelId}\n >\n <div className={labelClass} id={labelId}>\n {label}\n </div>\n {children}\n </div>\n );\n};\nCommandGroup.displayName = 'CommandGroup';\n\n/**\n * One thing to do in the list, named by its label and described by its description and hint.\n *\n * @function\n * @param {CommandItemProps} props - Props for the Command.Item component.\n * @returns {JSX.Element} The item.\n */\nexport const CommandItem: React.FC<CommandItemProps> = ({\n value,\n disabled = false,\n onSelect,\n icon,\n description,\n hint,\n children,\n className,\n onClick,\n onPointerMove,\n ...props\n}) => {\n const { engine, registerHandler } = useCommand();\n const itemRef = useRef<HTMLDivElement>(null);\n const { registerItem } = engine;\n useClientLayoutEffect(\n () =>\n registerItem(itemRef.current as HTMLDivElement, {\n value,\n disabled,\n checked: false,\n }),\n [registerItem, value, disabled]\n );\n const onSelectRef = useLatestRef(onSelect);\n useClientLayoutEffect(\n () => registerHandler(value, onSelectRef),\n [registerHandler, value, onSelectRef]\n );\n const highlighted = engine.highlighted === value;\n const itemClass = usePrefixedClassNames('command-item', {\n 'is-active': highlighted,\n 'is-disabled': disabled,\n });\n const iconClass = usePrefixedClassNames('command-item-icon');\n const bodyClass = usePrefixedClassNames('command-item-body');\n const labelClass = usePrefixedClassNames('command-item-label');\n const descriptionClass = usePrefixedClassNames('command-item-description');\n const hintClass = usePrefixedClassNames('command-item-hint');\n\n // Named by its label alone, so a screen reader says what it does before\n // the rest, and described by the description and the hint.\n const baseId = useId();\n const labelId = `${baseId}label`;\n const descriptionId = isShown(description)\n ? `${baseId}description`\n : undefined;\n const hintId = isShown(hint) ? `${baseId}hint` : undefined;\n const describedBy =\n [descriptionId, hintId].filter(Boolean).join(' ') || undefined;\n const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;\n\n return (\n <div\n className={classNames(itemClass, className)}\n aria-describedby={describedBy}\n {...props}\n ref={itemRef}\n id={engine.itemId(value) || undefined}\n role=\"option\"\n // The highlighted option, as the ARIA Authoring Practices' combobox\n // has it, and no attribute on the rest. Never a disabled option.\n aria-selected={disabled ? undefined : highlighted || undefined}\n aria-disabled={disabled || undefined}\n aria-labelledby={callerNamed ? props['aria-labelledby'] : labelId}\n onClick={event => {\n onClick?.(event);\n if (!disabled && !event.defaultPrevented) engine.pick(value);\n }}\n onPointerMove={event => {\n onPointerMove?.(event);\n if (!disabled && !highlighted) engine.hover(value);\n }}\n >\n {isShown(icon) && (\n <span className={iconClass} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n <span className={bodyClass}>\n <span className={labelClass} id={labelId}>\n {children}\n </span>\n {descriptionId && (\n <span className={descriptionClass} id={descriptionId}>\n {description}\n </span>\n )}\n </span>\n {hintId && (\n <span className={hintClass} id={hintId}>\n {hint}\n </span>\n )}\n </div>\n );\n};\nCommandItem.displayName = 'CommandItem';\n\n/**\n * The message shown in place of the list when nothing matches, announced when typing brings it on screen.\n *\n * @function\n * @param {CommandEmptyProps} props - Props for the Command.Empty component.\n * @returns {JSX.Element} The message.\n */\nexport const CommandEmpty: React.FC<CommandEmptyProps> = ({\n children,\n className,\n onMouseDown,\n ...props\n}) => {\n const { engine, reportEmpty } = useCommand();\n const emptyRef = useRef<HTMLDivElement>(null);\n useClientLayoutEffect(\n () => reportEmpty(emptyRef.current as HTMLDivElement),\n [reportEmpty]\n );\n const emptyClass = usePrefixedClassNames('command-empty');\n return (\n <div\n className={classNames(emptyClass, className)}\n {...props}\n ref={emptyRef}\n onMouseDown={event => {\n onMouseDown?.(event);\n engine.keepFocus(event);\n }}\n >\n {children}\n </div>\n );\n};\nCommandEmpty.displayName = 'CommandEmpty';\n\n/** What a Command given `actions` renders inside its parts root. */\ninterface CommandActionsContentProps {\n actions: CommandAction[];\n filter: CommandActionsProps['filter'];\n placeholder: string | undefined;\n empty: React.ReactNode;\n}\n\n/**\n * The field, and the actions that match the search, grouped, or the empty\n * message. The search is the parts root's, read from its context.\n */\nconst CommandActionsContent = ({\n actions,\n filter,\n placeholder,\n empty,\n}: CommandActionsContentProps) => {\n const { query } = useCommand();\n const matchText = useLocaleMatcher();\n const shown = filter\n ? filter(query, actions)\n : filterActions(query, actions, matchText);\n\n // Each group where the matches first name it, and the actions with none\n // together where the first of them is, so the best match stays on top.\n const sections = new Map<string, CommandAction[]>();\n for (const action of shown) {\n const group = action.group ?? '';\n sections.set(group, [...(sections.get(group) ?? []), action]);\n }\n const renderItem = (action: CommandAction) => (\n <CommandItem\n key={action.id}\n value={action.id}\n disabled={action.disabled}\n icon={action.icon}\n description={action.description}\n hint={action.hint}\n onSelect={action.onSelect}\n >\n {action.label}\n </CommandItem>\n );\n\n return (\n <>\n <CommandInput placeholder={placeholder} />\n {shown.length > 0 ? (\n <CommandList>\n {Array.from(sections, ([group, members]) =>\n group ? (\n <CommandGroup key={group} label={group}>\n {members.map(renderItem)}\n </CommandGroup>\n ) : (\n members.map(renderItem)\n )\n )}\n </CommandList>\n ) : isShown(empty) ? (\n <CommandEmpty>{empty}</CommandEmpty>\n ) : null}\n </>\n );\n};\n\n/**\n * The Command given `actions`. It renders the parts itself and filters the\n * actions as the user types, so a run goes through the same parts, keys and\n * ARIA as one built by hand.\n */\nconst CommandFromActions = forwardRef<HTMLDivElement, CommandActionsProps>(\n (\n { actions, filter, placeholder, empty = defaultEmpty, children, ...rest },\n ref\n ) => {\n if (flattenChildren(children).length > 0) {\n warnOnce(\n 'Command:actions-children',\n '[bestax-bulma] <Command actions> renders its own field and items, ' +\n 'so its children are ignored. Give it actions or build it from ' +\n 'parts, not both.'\n );\n }\n return (\n <CommandParts {...rest} ref={ref}>\n <CommandActionsContent\n actions={actions}\n filter={filter}\n placeholder={placeholder}\n empty={empty}\n />\n </CommandParts>\n );\n }\n);\nCommandFromActions.displayName = 'CommandFromActions';\n\n/**\n * The `Command` component is a search field over a list of things to do, which narrows as you type and runs the top match on Enter: inline by default, and a command palette in a modal as `Command.Dialog`.\n *\n * Given `actions`, it's one element. It renders the field, the list, the\n * groups and the empty message, and filters the actions by label, keywords\n * and description as the user types, with label matches first. `filter`\n * takes over the matching, for fuzzy search.\n *\n * Built from parts, the app owns the items: what's in the list and how it's\n * filtered, from the search `onQueryChange` reports. Nothing filters them,\n * so a server's answer shows as it came.\n *\n * Either way, focus stays in the field, and the highlighted item is its\n * `aria-activedescendant`. The first enabled item is highlighted whenever\n * the items change, so Enter runs the top match. Running an item calls its\n * own `onSelect`, then the Command's.\n *\n * When typing leaves the empty message on screen, its text is announced\n * through a polite status region, once, after any loading ends. Result\n * counts aren't announced: a screen reader reads the list's size from the\n * markup, and a count on every keystroke talks over the typing.\n *\n * @function\n * @param {CommandProps} props - Props for the Command component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `div.command`.\n * @returns {JSX.Element} The field and its list.\n *\n * @example\n * <Command\n * label=\"Settings\"\n * placeholder=\"Search settings\"\n * actions={[\n * { id: 'profile', label: 'Edit profile', onSelect: openProfile },\n * { id: 'theme', label: 'Dark mode', keywords: ['theme'], onSelect: toggleTheme },\n * ]}\n * />\n *\n * @example\n * <Command label=\"People\" onQueryChange={setQuery} onSelect={openProfile}>\n * <Command.Input placeholder=\"Find a person\" />\n * {matches.length > 0 ? (\n * <Command.List>\n * {matches.map(person => (\n * <Command.Item key={person.id} value={person.id}>\n * {person.name}\n * </Command.Item>\n * ))}\n * </Command.List>\n * ) : (\n * <Command.Empty>No one matches</Command.Empty>\n * )}\n * </Command>\n */\nconst CommandRoot = forwardRef<HTMLDivElement, CommandProps>((props, ref) =>\n props.actions === undefined ? (\n <CommandParts {...props} ref={ref} />\n ) : (\n <CommandFromActions {...props} ref={ref} />\n )\n);\n\n/** A key combination, read from a `shortcut` string. */\ninterface ParsedShortcut {\n /** The key, lowercased, as `KeyboardEvent.key` names it. */\n key: string;\n mod: boolean;\n ctrl: boolean;\n meta: boolean;\n alt: boolean;\n shift: boolean;\n}\n\n/** Other names a key goes by in a `shortcut`, for the ones `key` spells otherwise. */\nconst keyAliases: Record<string, string> = {\n space: ' ',\n esc: 'escape',\n};\n\n/**\n * Reads a `shortcut` such as `\"mod+k\"` or `\"ctrl + shift + p\"`.\n *\n * @param shortcut - Modifiers and a key, joined by `+`.\n * @returns The combination, or `null` when it doesn't read as one.\n */\nconst parseShortcut = (shortcut: string): ParsedShortcut | null => {\n const parts = shortcut\n .toLowerCase()\n .split('+')\n .map(part => part.trim());\n const key = parts.pop() as string;\n if (key === '') return null;\n const parsed: ParsedShortcut = {\n key: keyAliases[key] ?? key,\n mod: false,\n ctrl: false,\n meta: false,\n alt: false,\n shift: false,\n };\n for (const part of parts) {\n if (part === 'mod') parsed.mod = true;\n else if (part === 'ctrl' || part === 'control') parsed.ctrl = true;\n else if (part === 'meta' || part === 'cmd' || part === 'command')\n parsed.meta = true;\n else if (part === 'alt' || part === 'option') parsed.alt = true;\n else if (part === 'shift') parsed.shift = true;\n else return null;\n }\n return parsed;\n};\n\n/**\n * Whether a keydown is the combination. `mod` takes Ctrl or ⌘, and any other\n * modifier has to be as the combination says, so `mod+k` isn't\n * `mod+shift+k`. A letter or digit is matched by its key, and by where it\n * sits on the keyboard only when the key isn't a Latin letter or digit at\n * all, as on a Cyrillic layout or with Option held on a Mac, so another\n * Latin layout's own letters keep their own shortcuts.\n */\nconst matchesShortcut = (\n event: KeyboardEvent,\n shortcut: ParsedShortcut\n): boolean => {\n if (event.altKey !== shortcut.alt) return false;\n // A symbol such as `?` already says whether Shift was down, and which key\n // takes Shift to type it depends on the layout, so Shift is only checked\n // for a letter, a digit or a named key, unless the combination names it.\n const shiftMatters =\n shortcut.shift ||\n shortcut.key.length > 1 ||\n /^[a-z0-9]$/.test(shortcut.key);\n if (shiftMatters && event.shiftKey !== shortcut.shift) return false;\n if (shortcut.mod) {\n if (!event.ctrlKey && !event.metaKey) return false;\n } else if (\n event.ctrlKey !== shortcut.ctrl ||\n event.metaKey !== shortcut.meta\n ) {\n return false;\n }\n const key = (event.key ?? '').toLowerCase();\n if (key === shortcut.key) return true;\n if (/^[a-z0-9]$/.test(key)) return false;\n if (/^[a-z]$/.test(shortcut.key)) {\n return event.code === `Key${shortcut.key.toUpperCase()}`;\n }\n if (/^[0-9]$/.test(shortcut.key)) {\n return event.code === `Digit${shortcut.key}`;\n }\n return false;\n};\n\n/** Input types that take no typing, so a shortcut pressed in one still counts. */\nconst untypedInputs = new Set([\n 'button',\n 'checkbox',\n 'color',\n 'file',\n 'hidden',\n 'image',\n 'radio',\n 'range',\n 'reset',\n 'submit',\n]);\n\n/**\n * Whether a keydown happened while the user was typing: in a text field, a\n * text area, a select, or editable content. The composed path's first entry\n * is the element itself, even inside a shadow root.\n */\nconst isTyping = (event: KeyboardEvent): boolean => {\n const target = event.composedPath()[0] as Partial<Element> | undefined;\n if (typeof target?.closest !== 'function') return false;\n const element = target as Element;\n const editable = element.closest('[contenteditable]');\n if (editable && editable.getAttribute('contenteditable') !== 'false') {\n return true;\n }\n const tag = element.tagName;\n if (tag === 'TEXTAREA' || tag === 'SELECT') return true;\n return (\n tag === 'INPUT' &&\n !untypedInputs.has((element as HTMLInputElement).type.toLowerCase())\n );\n};\n\n/**\n * The Command in a modal, a command palette, opened by its `shortcut` or by `open`, that closes once an item has run.\n *\n * It renders nothing while it's closed. Open, it's a `Modal` with a\n * background and the Command's box as the `dialog`, named by `label`:\n * focus goes to the search field, Tab stays inside, Escape and a click on\n * the background close it, the page behind it doesn't scroll, and focus goes\n * back to where it was when it closes.\n *\n * @function\n * @param {CommandDialogProps} props - Props for the Command.Dialog component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `div.command` that is the dialog.\n * @returns {JSX.Element | null} The dialog, or nothing while it's closed.\n */\nexport const CommandDialog = forwardRef<HTMLDivElement, CommandDialogProps>(\n (\n {\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n shortcut,\n closeOnSelect = true,\n clearOnClose = true,\n portal,\n label,\n query: controlledQuery,\n defaultQuery = '',\n onQueryChange,\n onSelect,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...props\n },\n ref\n ) => {\n const [ownOpen, setOwnOpen] = useState(defaultOpen);\n const open = controlledOpen ?? ownOpen;\n // Only ever asked for the other state: the shortcut listens while it's\n // closed, and everything that closes it is there while it's open.\n const setOpen = (next: boolean) => {\n if (controlledOpen === undefined) setOwnOpen(next);\n onOpenChange?.(next);\n };\n\n // The search is held here rather than in the Command, which is only\n // mounted while the dialog is open, so it can outlive a close when\n // `clearOnClose` is off.\n const [ownQuery, setOwnQuery] = useState(defaultQuery);\n const query = controlledQuery ?? ownQuery;\n const setQuery = (next: string) => {\n if (controlledQuery === undefined) setOwnQuery(next);\n onQueryChange?.(next);\n };\n // Closing clears the search, however the dialog closed. Our own is\n // cleared during render, React's pattern for adjusting state when other\n // state changes, and a controlled one is asked for after the commit.\n const [shownOpen, setShownOpen] = useState(open);\n if (shownOpen !== open) {\n setShownOpen(open);\n if (!open && clearOnClose && controlledQuery === undefined) {\n setOwnQuery('');\n }\n }\n const wasOpenRef = useRef(open);\n const clearRef = useLatestRef(() => {\n if (clearOnClose && controlledQuery !== undefined && query !== '') {\n onQueryChange?.('');\n }\n });\n useEffect(() => {\n const wasOpen = wasOpenRef.current;\n wasOpenRef.current = open;\n if (wasOpen && !open) clearRef.current();\n }, [open, clearRef]);\n\n if (controlledOpen === undefined && !defaultOpen && !shortcut) {\n warnOnce(\n 'Command.Dialog:no-opener',\n '[bestax-bulma] <Command.Dialog> has no way to open. Give it a ' +\n 'shortcut, or open and onOpenChange.'\n );\n }\n if (shortcut && !parseShortcut(shortcut)) {\n warnOnce(\n `Command.Dialog:shortcut:${shortcut}`,\n `[bestax-bulma] <Command.Dialog> can't read the shortcut ` +\n `\"${shortcut}\". Write modifiers and a key joined by +, such as ` +\n `\"mod+k\", where the modifiers are mod, ctrl, meta, alt and shift.`\n );\n }\n\n const openFromShortcut = useLatestRef(() => setOpen(true));\n useEffect(() => {\n const combination = shortcut ? parseShortcut(shortcut) : null;\n if (!combination || open) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (\n event.defaultPrevented ||\n event.isComposing ||\n event.keyCode === 229 ||\n !matchesShortcut(event, combination) ||\n isTyping(event) ||\n // A Modal, a Dialog, a Sidebar with its overlay or a full-page\n // Loading has the page shut off, so the key isn't the page's. A\n // Sidebar without one leaves the page in use, so it still opens.\n isModalOverlayOpen()\n ) {\n return;\n }\n // The browser's own use of the combination, such as Ctrl+K's search\n // in the address bar, doesn't happen as well.\n event.preventDefault();\n openFromShortcut.current();\n };\n // On `window`, where a keydown arrives last, so anything on the page\n // that used the key first has said so with `preventDefault()`.\n window.addEventListener('keydown', onKeyDown);\n return () => window.removeEventListener('keydown', onKeyDown);\n }, [shortcut, open, openFromShortcut]);\n\n const dialogClass = usePrefixedClassNames('command-dialog');\n\n if (!open) return null;\n\n const close = () => setOpen(false);\n const run = (value: string) => {\n onSelect?.(value);\n if (closeOnSelect) close();\n };\n\n return (\n <Modal isActive onClose={close} role=\"presentation\" portal={portal}>\n <Modal.Background onClick={close} />\n <CommandRoot\n {...(props as CommandProps)}\n ref={ref}\n className={classNames(dialogClass, className)}\n label={label}\n query={query}\n onQueryChange={setQuery}\n onSelect={run}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={\n ariaLabelledBy === undefined\n ? ariaLabel || label || defaultLabel\n : ariaLabel\n }\n aria-labelledby={ariaLabelledBy}\n />\n </Modal>\n );\n }\n);\nCommandDialog.displayName = 'CommandDialog';\n\n/** Command with Input, List, Group, Item, Empty and Dialog sub-components. */\nexport const Command = withSubComponents(\n CommandRoot,\n {\n Input: CommandInput,\n List: CommandList,\n Group: CommandGroup,\n Item: CommandItem,\n Empty: CommandEmpty,\n Dialog: CommandDialog,\n },\n 'Command'\n);\n\nexport default Command;\n"],"names":["typedNoMatches","nothingToAnnounce","isShown","noop","registerNothing","standalone","setRefs","_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;;;AA2BA;AACA,MAAM,YAAY,GAAG,UAAU;AAE/B;AACA,MAAM,YAAY,GAAG,YAAY;AAEjC;AACA;AAC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