@hussmartinez/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +493 -1
- package/dist/react.js +849 -68
- package/dist/react.js.map +1 -1
- package/dist/shared/{pair-pt-vUVwu.js → pair-MeX064R6.js} +2 -1
- package/dist/shared/pair-MeX064R6.js.map +1 -0
- package/dist/styles.css +262 -0
- package/dist/ui.d.ts +493 -1
- package/package.json +1 -1
- package/dist/shared/pair-pt-vUVwu.js.map +0 -1
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":["_Fragment","CloseIcon","useMergedRef","CloseIcon","_Fragment","_Fragment"],"sources":["../src/internal/single-copy.ts","../src/components/announcer/Announcer.tsx","../src/components/shared/style-props.ts","../src/components/button/Button.tsx","../src/components/button/IconButton.tsx","../src/components/field/field-context.ts","../src/components/messages/UiMessagesProvider.tsx","../src/components/color-field/ColorField.tsx","../src/components/dialog/CloseIcon.tsx","../src/components/dialog/Dialog.tsx","../src/components/field/Field.tsx","../src/components/file-drop-zone/FileDropZone.tsx","../src/components/shared/number.ts","../src/components/number-field/NumberField.tsx","../src/components/progress-bar/ProgressBar.tsx","../src/components/toolbar/toolbar-context.ts","../src/components/segmented-control/SegmentedControl.tsx","../src/components/slider/Slider.tsx","../src/components/spinner/Spinner.tsx","../src/components/text-area/TextArea.tsx","../src/components/text-field/TextField.tsx","../src/components/toggle-button/ToggleButton.tsx","../src/components/toolbar/roving-focus.ts","../src/components/toolbar/Toolbar.tsx","../src/components/toolbar/ToolbarGroup.tsx","../src/components/toolbar/ToolbarSeparator.tsx","../src/react/use-platform.ts","../src/components/tooltip/Tooltip.tsx","../src/components/visually-hidden/VisuallyHidden.tsx","../src/icons/create-icon.tsx","../src/icons/icons.generated.tsx","../src/react/ThemeProvider.tsx"],"sourcesContent":["import { warnInDevelopment } from \"./development.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * ui's version, written in by the library build. Pipelines that compile the\n * source themselves, such as the catalogue and the tests, may leave it out.\n */\ndeclare const __HM_UI_VERSION__: string | undefined;\n\n/** Where every copy of ui on the page registers itself, shared across copies. */\nconst REGISTRY = /* @__PURE__ */ Symbol.for(\"@hussmartinez/ui\");\n\n/** This copy's identity: two installs of the same version are still two copies. */\nconst THIS_COPY = {};\n\nlet checked = false;\n\n/** This copy's version, or a placeholder where the build didn't write it in. */\nfunction ownVersion(): string {\n return typeof __HM_UI_VERSION__ === \"string\" ? __HM_UI_VERSION__ : \"an unknown version\";\n}\n\n/**\n * Warns once, in development, when a second copy of ui is used on the page\n * (ADR 0036, in sdk-core). Each copy's context is its own, so a provider from\n * one copy doesn't reach components from another: they fall back to English,\n * and announcements go nowhere.\n *\n * Called on first use by ui's providers and context hooks, never on import,\n * so importing ui stays free of side effects. It does nothing in production.\n */\nexport function checkSingleCopy(): void {\n // Inline, so production bundles drop the whole check.\n if (checked || !(typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\")) {\n return;\n }\n checked = true;\n const global = globalThis as { [REGISTRY]?: Map<object, string> };\n const copies = global[REGISTRY] ?? new Map<object, string>();\n global[REGISTRY] = copies;\n copies.set(THIS_COPY, ownVersion());\n if (copies.size > 1) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n `${copies.size} copies of @hussmartinez/ui are in use (${[...copies.values()].join(\", \")}). Providers from one copy don't reach components from another, so text falls back to English and announcements are lost. Install a single version: \\`npm ls @hussmartinez/ui\\` shows where each comes from, and every SDK and your application should use the same minor version.`,\n );\n }\n }\n}\n","import {\n createContext,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * How urgently a message interrupts: `polite` waits for the screen reader to\n * finish, `assertive` interrupts. Use `assertive` only for errors the user\n * must act on.\n *\n * @public\n */\nexport type Politeness = \"polite\" | \"assertive\";\n\n/**\n * Announces a message to screen readers, such as \"Saved 1.3 MB\" (ADR 0014).\n * The message is plain text from your message catalogue.\n *\n * @public\n */\nexport type Announce = (message: string, options?: { politeness?: Politeness }) => void;\n\nconst AnnouncerContext = /* @__PURE__ */ createContext<Announce | undefined>(undefined);\n\n/**\n * Props of {@link AnnouncerProvider}.\n *\n * @public\n */\nexport interface AnnouncerProviderProps {\n readonly children?: ReactNode;\n}\n\n/** One live region's text, and a counter so the same message is announced again. */\ninterface Region {\n readonly message: string;\n readonly count: number;\n}\n\n/**\n * Renders a polite and an assertive `aria-live` region, visually hidden, and\n * lets everything inside announce through {@link useAnnounce}. The regions are\n * in the server-rendered page from the start, as screen readers only announce\n * changes to regions that already exist. Render it once, near the root of an\n * editor or application.\n *\n * @public\n */\nexport function AnnouncerProvider({ children }: AnnouncerProviderProps): ReactElement {\n checkSingleCopy();\n const [polite, setPolite] = useState<Region>({ message: \"\", count: 0 });\n const [assertive, setAssertive] = useState<Region>({ message: \"\", count: 0 });\n // One pending frame per region, so announcing in one region never cancels\n // the other's message.\n const frames = useRef<Partial<Record<Politeness, number>>>({});\n\n useEffect(\n () => () => {\n for (const frame of Object.values(frames.current)) {\n cancelAnimationFrame(frame);\n }\n },\n [],\n );\n\n const announce = useCallback<Announce>((message, options) => {\n const politeness = options?.politeness ?? \"polite\";\n const set = politeness === \"assertive\" ? setAssertive : setPolite;\n // Empty the region first, then fill it on the next frame, so a message\n // that repeats the previous one is still a change, and announced again.\n set((region) => ({ message: \"\", count: region.count }));\n // At most one frame is pending per region, so unmounting can cancel it.\n const pending = frames.current[politeness];\n if (pending !== undefined) {\n cancelAnimationFrame(pending);\n }\n frames.current[politeness] = requestAnimationFrame(() => {\n delete frames.current[politeness];\n set((region) => ({ message, count: region.count + 1 }));\n });\n }, []);\n\n return (\n <AnnouncerContext.Provider value={announce}>\n {children}\n <div className=\"hm-visually-hidden hm-announcer\">\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {polite.message}\n </div>\n <div role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\n {assertive.message}\n </div>\n </div>\n </AnnouncerContext.Provider>\n );\n}\n\nfunction missingProvider(): void {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"useAnnounce needs an AnnouncerProvider above it; the message wasn't announced.\",\n );\n }\n}\n\n/**\n * The `announce` function of the closest {@link AnnouncerProvider}. Without\n * one, announcing does nothing and warns in development.\n *\n * @example\n * ```tsx\n * const announce = useAnnounce();\n * announce(messages.t(\"result.saved\", { size }));\n * ```\n *\n * @public\n */\nexport function useAnnounce(): Announce {\n checkSingleCopy();\n return useContext(AnnouncerContext) ?? missingProvider;\n}\n","/**\n * Extra classes for a component's named parts.\n *\n * @public\n */\nexport type ClassNames<Part extends string> = { readonly [Name in Part]?: string };\n\n/**\n * Styling props every component takes (STANDARDS: React API).\n *\n * @public\n */\nexport interface StyleProps<Part extends string> {\n /** Extra classes on the root element. */\n readonly className?: string | undefined;\n /** Extra classes on each named part. */\n readonly classNames?: ClassNames<Part> | undefined;\n /**\n * Drops the visual styles (colours, borders, typography, motion) and keeps\n * layout, focus indication and target sizes, so the component stays\n * accessible while you style it yourself.\n */\n readonly unstyled?: boolean | undefined;\n}\n\n/** Joins class names, skipping empty ones. */\nexport function cx(...values: (string | false | null | undefined)[]): string | undefined {\n const joined = values.filter(Boolean).join(\" \");\n return joined === \"\" ? undefined : joined;\n}\n\n/** The attribute that turns a component's visual rules off. */\nexport function unstyledAttribute(unstyled: boolean | undefined): \"\" | undefined {\n return unstyled ? \"\" : undefined;\n}\n","import { type ButtonHTMLAttributes, forwardRef, type MouseEvent, type ReactNode } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * How prominent a button is: `primary` for the main action, `secondary`\n * (the default) for others, `quiet` for toolbars and dense places, `danger`\n * for destructive actions.\n *\n * @public\n */\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"quiet\" | \"danger\";\n\n/**\n * Button sizes. Both meet the 24 px target size, and 44 px on coarse\n * pointers (ADR 0014).\n *\n * @public\n */\nexport type ButtonSize = \"medium\" | \"small\";\n\n/**\n * The parts of a button that `classNames` can target.\n *\n * @public\n */\nexport type ButtonPart = \"root\" | \"icon\" | \"label\";\n\n/**\n * Props of {@link Button}. Native button props are passed through.\n *\n * @public\n */\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"className\">,\n StyleProps<ButtonPart> {\n /** Defaults to `secondary`. */\n readonly variant?: ButtonVariant | undefined;\n /** Defaults to `medium`. */\n readonly size?: ButtonSize | undefined;\n /** Makes it a toggle button, on or off, exposed as `aria-pressed`. */\n readonly pressed?: boolean | undefined;\n /** An icon before the label. It's decorative, and draws with `currentColor`. */\n readonly startIcon?: ReactNode;\n /** An icon after the label. */\n readonly endIcon?: ReactNode;\n /**\n * Keeps a disabled button focusable, with `aria-disabled` instead of the\n * `disabled` attribute, so it stays in a toolbar's keyboard order and\n * screen readers can find it. Clicks are ignored.\n */\n readonly focusableWhenDisabled?: boolean | undefined;\n}\n\nfunction Icon({ children, className }: { children: ReactNode; className: string | undefined }) {\n return (\n <span className={cx(\"hm-button-icon\", className)} aria-hidden=\"true\">\n {children}\n </span>\n );\n}\n\n/**\n * A button: a native `<button>`, `type=\"button\"` unless you say otherwise.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" startIcon={<DownloadIcon />} onClick={save}>\n * {messages.t(\"toolbar.download\")}\n * </Button>\n * ```\n *\n * @public\n */\nexport const Button = /* @__PURE__ */ forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"secondary\",\n size = \"medium\",\n pressed,\n startIcon,\n endIcon,\n focusableWhenDisabled,\n disabled,\n className,\n classNames,\n unstyled,\n type = \"button\",\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const softDisabled = Boolean(focusableWhenDisabled && disabled);\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n if (softDisabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n };\n return (\n <button\n {...props}\n ref={ref}\n type={type}\n className={cx(\n \"hm-button\",\n `hm-button--${variant}`,\n size === \"small\" && \"hm-button--small\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n aria-pressed={pressed}\n disabled={softDisabled ? undefined : disabled}\n aria-disabled={softDisabled ? true : props[\"aria-disabled\"]}\n onClick={handleClick}\n >\n {startIcon == null ? null : <Icon className={classNames?.icon}>{startIcon}</Icon>}\n {children == null ? null : (\n <span className={cx(\"hm-button-label\", classNames?.label)}>{children}</span>\n )}\n {endIcon == null ? null : <Icon className={classNames?.icon}>{endIcon}</Icon>}\n </button>\n );\n});\n","import { forwardRef, type ReactNode } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { type ClassNames, cx } from \"../shared/style-props.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link IconButton}.\n *\n * @public\n */\nexport interface IconButtonProps\n extends Omit<ButtonProps, \"startIcon\" | \"endIcon\" | \"children\" | \"classNames\"> {\n /** The accessible name. Required, because the button shows no text. */\n readonly label: string;\n /** The icon. It draws with `currentColor`. */\n readonly icon: ReactNode;\n /** Extra classes on the root and the icon. */\n readonly classNames?: ClassNames<\"root\" | \"icon\"> | undefined;\n}\n\n/**\n * A square button with only an icon. `label` is its accessible name, so it\n * can't be left out.\n *\n * @example\n * ```tsx\n * <IconButton label={messages.t(\"toolbar.rotate\")} icon={<RotateIcon />} onClick={rotate} />\n * ```\n *\n * @public\n */\nexport const IconButton = /* @__PURE__ */ forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton({ label, icon, className, ...props }, ref) {\n if (label.trim() === \"\") {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"IconButton needs a label: it's the button's only accessible name. Pass text from your message catalogue.\",\n );\n }\n }\n return (\n <Button\n {...props}\n ref={ref}\n aria-label={label}\n className={cx(\"hm-icon-button\", className)}\n startIcon={icon}\n />\n );\n },\n);\n","import { createContext, useContext } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The props a {@link Field} gives its control, so the label, description\n * and error reach assistive technology.\n *\n * @public\n */\nexport interface FieldControlProps {\n /** The control's `id`, which the label points at. */\n readonly id: string;\n /** The ids of the description and the error, when there are any. */\n readonly \"aria-describedby\": string | undefined;\n /** `true` while the field shows an error. */\n readonly \"aria-invalid\": true | undefined;\n}\n\nexport const FieldContext = /* @__PURE__ */ createContext<FieldControlProps | undefined>(undefined);\n\n/**\n * The id of the enclosing field's label, for a control that names more than\n * one element from it, such as ColorField's swatch group. It's apart from\n * {@link FieldControlProps}, which hosts spread onto a native control.\n */\nexport const FieldLabelContext = /* @__PURE__ */ createContext<string | undefined>(undefined);\n\n/** The enclosing field's label id, or `undefined` outside a field. */\nexport function useFieldLabelId(): string | undefined {\n return useContext(FieldLabelContext);\n}\n\n/** The enclosing field's control props, or `undefined` outside a field. */\nexport function useFieldControl(): FieldControlProps | undefined {\n checkSingleCopy();\n return useContext(FieldContext);\n}\n\n/** Joins `aria-describedby` id lists, skipping empty ones. */\nexport function joinIds(...ids: (string | undefined)[]): string | undefined {\n const joined = ids.filter(Boolean).join(\" \");\n return joined === \"\" ? undefined : joined;\n}\n\n/** The props a control already has that a field adds to. */\ninterface OwnControlProps {\n readonly id?: string | undefined;\n readonly \"aria-describedby\"?: string | undefined;\n readonly \"aria-invalid\"?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined;\n}\n\n/**\n * Merges the enclosing field's props into a control's own: the field's id\n * unless the control has one, both description lists, and the field's\n * invalid state unless the control sets its own. Inside a field, it warns in\n * development about a control's own `label` or `aria-label`, and its own id.\n */\nexport function useFieldProps(\n own: OwnControlProps & { readonly \"aria-label\"?: string | undefined },\n label?: string,\n): OwnControlProps {\n const field = useFieldControl();\n if (!field) {\n return {\n id: own.id,\n \"aria-describedby\": own[\"aria-describedby\"],\n \"aria-invalid\": own[\"aria-invalid\"],\n };\n }\n // An aria-label replaces the visible label's text as the name, which\n // breaks WCAG 2.5.3, Label in Name, when the two differ.\n if (label !== undefined || own[\"aria-label\"] !== undefined) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"A control inside Field has its own label or aria-label, which replaces the field's visible label for screen readers. Leave it out, and set Field's label instead.\",\n );\n }\n }\n if (own.id !== undefined && own.id !== field.id) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"A control inside Field has its own id, so the field's label doesn't point at it. Pass the id to Field's controlId instead.\",\n );\n }\n }\n return {\n id: own.id ?? field.id,\n \"aria-describedby\": joinIds(field[\"aria-describedby\"], own[\"aria-describedby\"]),\n \"aria-invalid\": own[\"aria-invalid\"] ?? field[\"aria-invalid\"],\n };\n}\n","import { createMessages, type Messages, sdkCoreMessages } from \"@hussmartinez/sdk-core\";\nimport { createContext, type ReactElement, type ReactNode, useContext } from \"react\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\nimport { uiMessages } from \"../../messages/en.js\";\n\n/**\n * Messages that include `ui`'s text: any sdk-core `Messages` object whose\n * catalogue spreads `uiMessages`.\n *\n * @public\n */\nexport type UiMessages = Messages<typeof uiMessages>;\n\nconst UiMessagesContext = /* @__PURE__ */ createContext<UiMessages | undefined>(undefined);\n\nlet english: UiMessages | undefined;\n\n/** English text, created on first use so importing this module does nothing. */\nfunction defaultMessages(): UiMessages {\n english ??= createMessages({ ...sdkCoreMessages, ...uiMessages });\n return english;\n}\n\n/**\n * Props of {@link UiMessagesProvider}.\n *\n * @public\n */\nexport interface UiMessagesProviderProps {\n /** Your catalogue's messages, created with sdk-core's `createMessages`. */\n readonly messages: UiMessages;\n readonly children?: ReactNode;\n}\n\n/**\n * Gives `ui`'s components their text (ADR 0014). SDKs and applications pass\n * their message catalogue once, here; a component's own text props still win.\n * Without a provider, components use English.\n *\n * @example\n * ```tsx\n * const messages = createMessages({ ...sdkCoreMessages, ...uiMessages, ...en }, { locale });\n * <UiMessagesProvider messages={messages}>{editor}</UiMessagesProvider>\n * ```\n *\n * @public\n */\nexport function UiMessagesProvider({ messages, children }: UiMessagesProviderProps): ReactElement {\n checkSingleCopy();\n return <UiMessagesContext.Provider value={messages}>{children}</UiMessagesContext.Provider>;\n}\n\n/**\n * The messages from the closest {@link UiMessagesProvider}, or English.\n *\n * @public\n */\nexport function useUiMessages(): UiMessages {\n checkSingleCopy();\n return useContext(UiMessagesContext) ?? defaultMessages();\n}\n\n/** Keys of `uiMessages` whose English text has no placeholders. */\ntype PlainMessageKey = {\n [Key in keyof typeof uiMessages]: (typeof uiMessages)[Key] extends `${string}{${string}`\n ? never\n : Key;\n}[keyof typeof uiMessages];\n\n/**\n * A component's text for a message without placeholders: from the closest\n * {@link UiMessagesProvider}, or the English text as it is. Unlike\n * {@link useUiMessages}, it doesn't create a messages object when there's no\n * provider, so components using only English don't ship the formatter.\n */\nexport function useUiText(key: PlainMessageKey): string {\n checkSingleCopy();\n const messages = useContext(UiMessagesContext);\n return messages ? messages.t(key) : uiMessages[key];\n}\n\n/**\n * The locale of the enclosing `UiMessagesProvider`, or `\"en\"` without one.\n * It doesn't create the default messages, so components that only need the\n * locale don't ship them.\n */\nexport function useUiLocale(): string {\n checkSingleCopy();\n return useContext(UiMessagesContext)?.locale ?? \"en\";\n}\n","import {\n type ChangeEvent,\n type FocusEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useId,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldLabelId, useFieldProps } from \"../field/field-context.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * A colour a {@link ColorField} offers as a swatch.\n *\n * @public\n */\nexport interface ColorSwatch {\n /** The colour, as `#rrggbb` or `#rgb`. */\n readonly value: string;\n /** The swatch's accessible name, such as \"Red\". Use text from your message catalogue. */\n readonly label: string;\n}\n\n/**\n * The parts of a colour field that `classNames` can target.\n *\n * @public\n */\nexport type ColorFieldPart = \"root\" | \"control\" | \"preview\" | \"input\" | \"swatches\" | \"swatch\";\n\n/**\n * Props of {@link ColorField}. Other props go to the hex input.\n *\n * @public\n */\nexport interface ColorFieldProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"className\" | \"type\" | \"value\" | \"defaultValue\" | \"onChange\"\n >,\n StyleProps<ColorFieldPart> {\n /** The colour, as `#rrggbb`. With it, the field is controlled. */\n readonly value?: string | undefined;\n /** The first colour of an uncontrolled field. Defaults to `#000000`. */\n readonly defaultValue?: string | undefined;\n /** Called with the new colour, always as lowercase `#rrggbb`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /** Colours to pick from, shown under the input. Leave it out for the input alone. */\n readonly swatches?: readonly ColorSwatch[] | undefined;\n /**\n * The accessible name, such as \"Fill\". Leave it out inside a `Field`, or\n * when a visible `<label>` points at the field's `id`.\n */\n readonly label?: string | undefined;\n /** The word that follows the label in the swatch group's name. Defaults to \"swatches\". */\n readonly swatchesLabel?: string | undefined;\n}\n\nconst HEX = /^#?(?:([0-9a-f]{3})|([0-9a-f]{6}))$/i;\n\n/**\n * A colour as lowercase `#rrggbb`, from `#rrggbb`, `#rgb` or either without\n * the `#`; `undefined` for anything else. Its result is the only text that\n * reaches an SVG `fill`.\n */\nfunction parseHex(text: string): string | undefined {\n const match = HEX.exec(text.trim());\n if (!match) {\n return undefined;\n }\n const digits = match[2] ?? (match[1] as string).replace(/./g, \"$&$&\");\n return `#${digits.toLowerCase()}`;\n}\n\n/** A square of one colour, drawn with an SVG fill, which needs no inline style. */\nfunction Fill({ color, className }: { color: string; className: string | undefined }) {\n return (\n <svg\n className={className}\n viewBox=\"0 0 1 1\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect width=\"1\" height=\"1\" fill={color} />\n </svg>\n );\n}\n\n/**\n * A colour input: a hex field with a preview of the colour, and optional\n * swatches to pick from. It works with the keyboard alone and doesn't use\n * the browser's own colour picker, which differs between browsers and can't\n * be themed or translated.\n *\n * - **The input** takes `#rrggbb`, `#rgb` or either without the `#`. Typing\n * doesn't change the value: the text is committed on blur or Enter. Text\n * that isn't a colour goes back to the last value, and Escape throws the\n * typing away.\n * - **The swatches** are a radio group: one Tab stop, and the arrow keys move\n * and select. A swatch is checked while the value is its colour.\n * - **The value** is always lowercase `#rrggbb`. With `name`, forms receive it.\n *\n * @example\n * ```tsx\n * <Field label={t(\"shape.fill\")}>\n * <ColorField\n * value={fill}\n * onValueChange={setFill}\n * swatches={[\n * { value: \"#d92d20\", label: t(\"colors.red\") },\n * { value: \"#1570ef\", label: t(\"colors.blue\") },\n * ]}\n * />\n * </Field>\n * ```\n *\n * @public\n */\nexport const ColorField = /* @__PURE__ */ forwardRef<HTMLDivElement, ColorFieldProps>(\n function ColorField(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n swatches,\n label,\n swatchesLabel,\n name,\n form,\n disabled,\n className,\n classNames,\n unstyled,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) {\n const [uncontrolled, setUncontrolled] = useState(\n () => parseHex(defaultValue ?? \"\") ?? \"#000000\",\n );\n // What's typed and not yet committed; null while the field shows the value.\n const [draft, setDraft] = useState<string | null>(null);\n const value = (controlled === undefined ? undefined : parseHex(controlled)) ?? uncontrolled;\n\n const generated = useId();\n const ownLabelId = `${generated}-label`;\n const swatchesLabelId = `${generated}-swatches`;\n const fieldLabelId = useFieldLabelId();\n const swatchesText = useUiText(\"colorField.swatches\");\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"ColorField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const options: { readonly value: string; readonly label: string }[] = [];\n for (const swatch of swatches ?? []) {\n const color = parseHex(swatch.value);\n if (color === undefined) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n `ColorField skipped the swatch \"${swatch.label}\": its value isn't a colour such as #1570ef.`,\n );\n }\n } else if (!options.some((option) => option.value === color)) {\n options.push({ value: color, label: swatch.label });\n }\n }\n const tabStop = options.find((option) => option.value === value) ?? options[0];\n\n const commit = (next: string): void => {\n setDraft(null);\n if (next === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(next);\n }\n onValueChange?.(next);\n };\n\n // Commits typed text, or goes back to the value when it isn't a colour.\n const commitDraft = (): void => {\n if (draft === null) {\n return;\n }\n const parsed = parseHex(draft);\n if (parsed === undefined) {\n setDraft(null);\n } else {\n commit(parsed);\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n setDraft(event.currentTarget.value);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n commitDraft();\n onBlur?.(event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // An input method editor uses Enter and Escape while composing.\n if (event.defaultPrevented || event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === \"Enter\") {\n // Not prevented, so Enter still submits a form, which then has the\n // new value: the commit renders synchronously, as in NumberField.\n flushSync(commitDraft);\n } else if (event.key === \"Escape\" && draft !== null) {\n // Only the typing goes; a dialog around the field stays open.\n event.preventDefault();\n setDraft(null);\n }\n };\n\n const handleSwatchKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n const step =\n event.key === \"ArrowRight\" || event.key === \"ArrowDown\"\n ? 1\n : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\"\n ? -1\n : 0;\n if (step === 0 || options.length === 0 || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const horizontal = event.key === \"ArrowRight\" || event.key === \"ArrowLeft\";\n const direction = rtl && horizontal ? -step : step;\n const focused = options.findIndex(\n (option) => option.value === (event.target as HTMLElement).dataset[\"hmValue\"],\n );\n const next = options[(Math.max(0, focused) + direction + options.length) % options.length];\n if (next) {\n commit(next.value);\n event.currentTarget\n .querySelector<HTMLElement>(`[data-hm-value=\"${CSS.escape(next.value)}\"]`)\n ?.focus();\n }\n };\n\n // The swatch group's name: the field's label, then \"swatches\".\n const groupLabelIds = [\n fieldLabelId ?? (label === undefined ? props[\"aria-labelledby\"] : ownLabelId),\n swatchesLabelId,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n ref={ref}\n className={cx(\"hm-color-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <div className={cx(\"hm-color-field-control\", classNames?.control)}>\n <Fill color={value} className={cx(\"hm-color-field-preview\", classNames?.preview)} />\n <input\n {...props}\n {...fieldProps}\n type=\"text\"\n autoComplete={props.autoComplete ?? \"off\"}\n autoCapitalize={props.autoCapitalize ?? \"off\"}\n autoCorrect={props.autoCorrect ?? \"off\"}\n spellCheck={props.spellCheck ?? false}\n maxLength={props.maxLength ?? 7}\n disabled={disabled}\n value={draft ?? value}\n aria-label={label ?? props[\"aria-label\"]}\n className={cx(\"hm-text-field\", \"hm-color-field-input\", classNames?.input)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n </div>\n {options.length === 0 ? null : (\n <>\n {label === undefined ? null : (\n <span id={ownLabelId} hidden>\n {label}\n </span>\n )}\n <span id={swatchesLabelId} hidden>\n {swatchesLabel ?? swatchesText}\n </span>\n <div\n role=\"radiogroup\"\n aria-labelledby={groupLabelIds}\n aria-disabled={disabled ? true : undefined}\n className={cx(\"hm-color-field-swatches\", classNames?.swatches)}\n onKeyDown={handleSwatchKeyDown}\n >\n {options.map((option) => {\n const checked = option.value === value;\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native radio can't show its colour without an inline style; buttons with role=\"radio\" are the APG pattern, as in SegmentedControl.\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={option.label}\n disabled={disabled}\n tabIndex={option === tabStop ? 0 : -1}\n data-hm-value={option.value}\n className={cx(\"hm-color-field-swatch\", classNames?.swatch)}\n onClick={() => commit(option.value)}\n >\n <Fill color={option.value} className=\"hm-color-field-swatch-fill\" />\n </button>\n );\n })}\n </div>\n </>\n )}\n {name === undefined ? null : (\n <input type=\"hidden\" name={name} form={form} disabled={disabled} value={value} />\n )}\n </div>\n );\n },\n);\n","/**\n * The dialog's default close icon: a cross that draws with currentColor.\n * Replace it with the dialog's `closeIcon` prop.\n */\nexport function CloseIcon() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n );\n}\n","import {\n type DialogHTMLAttributes,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n type ReactNode,\n type RefObject,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { IconButton } from \"../button/IconButton.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { CloseIcon } from \"./CloseIcon.js\";\n\n/**\n * The parts of a dialog that `classNames` can target.\n *\n * @public\n */\nexport type DialogPart = \"root\" | \"header\" | \"title\" | \"description\" | \"body\" | \"footer\" | \"close\";\n\n/**\n * Props of {@link Dialog}.\n *\n * @public\n */\nexport interface DialogProps\n extends Omit<DialogHTMLAttributes<HTMLDialogElement>, \"className\" | \"title\" | \"open\">,\n StyleProps<DialogPart> {\n /** Whether the dialog is open. The dialog is always controlled. */\n readonly open: boolean;\n /**\n * Called with `false` when the user asks to close: Escape, or the close\n * button. Keep `open` true to refuse, for example while saving.\n */\n readonly onOpenChange: (open: boolean) => void;\n /** The heading, and the dialog's accessible name. */\n readonly title: ReactNode;\n /** A short description under the title, read when the dialog opens. */\n readonly description?: ReactNode;\n /** Actions at the bottom, such as Cancel and Save buttons. */\n readonly footer?: ReactNode;\n /** The close button's accessible name. Defaults to `dialog.close` from the messages. */\n readonly closeLabel?: string | undefined;\n /** Replaces the close icon. It draws with `currentColor`. */\n readonly closeIcon?: ReactNode;\n /** The element to focus when the dialog opens. Defaults to the first focusable one. */\n readonly initialFocus?: RefObject<HTMLElement | null> | undefined;\n /** Defaults to `medium`. */\n readonly size?: \"small\" | \"medium\" | \"large\" | undefined;\n}\n\nfunction useMergedRef<T>(forwarded: ForwardedRef<T>) {\n const local = useRef<T | null>(null);\n const setRef = useCallback(\n (node: T | null) => {\n local.current = node;\n if (typeof forwarded === \"function\") {\n forwarded(node);\n } else if (forwarded) {\n forwarded.current = node;\n }\n },\n [forwarded],\n );\n return [local, setRef] as const;\n}\n\n/**\n * A modal dialog on the native `<dialog>` element with `showModal()` (ADR\n * 0014): it traps focus, makes the page behind it inert, and sits in the top\n * layer, which host z-indexes and overflow can't break.\n *\n * - **Controlled:** `open` decides, and `onOpenChange(false)` asks to close,\n * on Escape or the close button.\n * - **Focus:** moves into the dialog when it opens, to `initialFocus` or the\n * first focusable element, and back to what was focused before when it\n * closes.\n * - **Server rendering:** renders closed, and opens after hydration.\n *\n * @example\n * ```tsx\n * <Dialog\n * open={open}\n * onOpenChange={setOpen}\n * title={messages.t(\"export.title\")}\n * footer={<Button variant=\"primary\" onClick={exportFile}>{messages.t(\"export.confirm\")}</Button>}\n * >\n * {options}\n * </Dialog>\n * ```\n *\n * @public\n */\nexport const Dialog = /* @__PURE__ */ forwardRef(function Dialog(\n {\n open,\n onOpenChange,\n title,\n description,\n footer,\n closeLabel,\n closeIcon,\n initialFocus,\n size = \"medium\",\n className,\n classNames,\n unstyled,\n children,\n onCancel,\n onClose,\n ...props\n }: DialogProps,\n forwardedRef: ForwardedRef<HTMLDialogElement>,\n): ReactElement {\n const defaultCloseLabel = useUiText(\"dialog.close\");\n const [ref, setRef] = useMergedRef(forwardedRef);\n const body = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const descriptionId = useId();\n\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog) {\n return;\n }\n if (open && !dialog.open) {\n // Closing a dialog opened with showModal() returns focus to the element\n // that was focused before, in every supported browser.\n dialog.showModal();\n initialFocus?.current?.focus();\n } else if (!open && dialog.open) {\n dialog.close();\n }\n }, [open, initialFocus, ref]);\n\n // A body that scrolls must be reachable by keyboard, or content without\n // focusable elements can't be scrolled (axe: scrollable-region-focusable).\n // It's a Tab stop only while it overflows, so short dialogs don't get one.\n // A body at its maximum size doesn't resize when content changes, so its\n // children are watched too, including ones added after it opened.\n useEffect(() => {\n const element = body.current;\n if (!element || typeof ResizeObserver === \"undefined\") {\n return;\n }\n const update = (): void => {\n if (element.scrollHeight > element.clientHeight) {\n element.tabIndex = 0;\n } else {\n element.removeAttribute(\"tabindex\");\n }\n };\n const resizes = new ResizeObserver(update);\n resizes.observe(element);\n for (const child of element.children) {\n resizes.observe(child);\n }\n const children = new MutationObserver((records) => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node instanceof Element) {\n resizes.observe(node);\n }\n }\n }\n update();\n });\n children.observe(element, { childList: true });\n update();\n return () => {\n resizes.disconnect();\n children.disconnect();\n };\n }, []);\n\n // Escape fires cancel. The dialog only closes when `open` becomes false.\n const handleCancel = (event: SyntheticEvent<HTMLDialogElement>): void => {\n onCancel?.(event);\n event.preventDefault();\n onOpenChange(false);\n };\n\n // Browsers may close a dialog without a cancellable cancel event, such as\n // on a second Escape without user activation; report it like any close.\n const handleClose = (event: SyntheticEvent<HTMLDialogElement>): void => {\n onClose?.(event);\n if (open) {\n onOpenChange(false);\n }\n };\n\n return (\n <dialog\n {...props}\n ref={setRef}\n aria-labelledby={titleId}\n aria-describedby={description == null ? undefined : descriptionId}\n className={cx(\n \"hm-dialog\",\n size !== \"medium\" && `hm-dialog--${size}`,\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onCancel={handleCancel}\n onClose={handleClose}\n >\n <div className={cx(\"hm-dialog-header\", classNames?.header)}>\n <h2 id={titleId} className={cx(\"hm-dialog-title\", classNames?.title)}>\n {title}\n </h2>\n <IconButton\n variant=\"quiet\"\n size=\"small\"\n label={closeLabel ?? defaultCloseLabel}\n icon={closeIcon ?? <CloseIcon />}\n className={cx(\"hm-dialog-close\", classNames?.close)}\n unstyled={unstyled}\n onClick={() => onOpenChange(false)}\n />\n </div>\n {description == null ? null : (\n <p id={descriptionId} className={cx(\"hm-dialog-description\", classNames?.description)}>\n {description}\n </p>\n )}\n <div ref={body} className={cx(\"hm-dialog-body\", classNames?.body)}>\n {children}\n </div>\n {footer == null ? null : (\n <div className={cx(\"hm-dialog-footer\", classNames?.footer)}>{footer}</div>\n )}\n </dialog>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode, useId } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport {\n FieldContext,\n type FieldControlProps,\n FieldLabelContext,\n joinIds,\n} from \"./field-context.js\";\n\n/**\n * The parts of a field that `classNames` can target.\n *\n * @public\n */\nexport type FieldPart = \"root\" | \"label\" | \"description\" | \"error\";\n\n/**\n * Props of {@link Field}. Native `div` props are passed through to the root.\n *\n * @public\n */\nexport interface FieldProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"children\">,\n StyleProps<FieldPart> {\n /** The visible label. Use text from your message catalogue. */\n readonly label: ReactNode;\n /** Help shown under the label, such as \"Between −24 and 24 dB\". */\n readonly description?: ReactNode;\n /**\n * What's wrong with the value, such as \"Enter a number\". While it's set,\n * the control is marked invalid and the text is read with it.\n */\n readonly error?: ReactNode;\n /** The control's `id`. Defaults to a generated one. */\n readonly controlId?: string | undefined;\n /**\n * The control. `ui` controls, such as `Slider` and `NumberField`, connect\n * themselves. For any other control, pass a function and spread the\n * props it receives onto the control.\n */\n readonly children: ReactNode | ((control: FieldControlProps) => ReactNode);\n}\n\n/**\n * A label, an optional description and an optional error, wired to one\n * control: the label names it, and the description and error describe it.\n *\n * The control must be labelable, such as an `<input>`, `<select>`,\n * `<textarea>` or `ui`'s `Slider`. For a group of controls, such as\n * `SegmentedControl`, use the group's own `label`.\n *\n * An error that appears after the user acts, such as on submit, isn't\n * announced on its own: move focus to the field, or announce it with\n * `useAnnounce`.\n *\n * @example\n * ```tsx\n * <Field label={t(\"export.dpi\")} description={t(\"export.dpiHelp\")} error={dpiError}>\n * <Slider min={72} max={600} value={dpi} onValueChange={setDpi} />\n * </Field>\n *\n * <Field label={t(\"export.name\")}>\n * {(control) => <input {...control} value={name} onChange={onNameChange} />}\n * </Field>\n * ```\n *\n * @public\n */\nexport const Field = /* @__PURE__ */ forwardRef<HTMLDivElement, FieldProps>(function Field(\n { label, description, error, controlId, className, classNames, unstyled, children, ...props },\n ref,\n) {\n const generated = useId();\n const id = controlId ?? `${generated}-control`;\n const labelId = `${generated}-label`;\n const descriptionId = `${generated}-description`;\n const errorId = `${generated}-error`;\n const hasDescription = description != null && description !== false;\n const hasError = error != null && error !== false;\n const control: FieldControlProps = {\n id,\n \"aria-describedby\": joinIds(\n hasDescription ? descriptionId : undefined,\n hasError ? errorId : undefined,\n ),\n \"aria-invalid\": hasError ? true : undefined,\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(\"hm-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <label id={labelId} htmlFor={id} className={cx(\"hm-field-label\", classNames?.label)}>\n {label}\n </label>\n {hasDescription ? (\n <div id={descriptionId} className={cx(\"hm-field-description\", classNames?.description)}>\n {description}\n </div>\n ) : null}\n <FieldContext.Provider value={control}>\n <FieldLabelContext.Provider value={labelId}>\n {typeof children === \"function\" ? children(control) : children}\n </FieldLabelContext.Provider>\n </FieldContext.Provider>\n {hasError ? (\n <div id={errorId} className={cx(\"hm-field-error\", classNames?.error)}>\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import {\n type ChangeEvent,\n type DragEvent,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { Button, type ButtonVariant } from \"../button/Button.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * The parts of a file drop zone that `classNames` can target.\n *\n * @public\n */\nexport type FileDropZonePart = \"root\" | \"button\" | \"hint\";\n\n/**\n * A file that {@link FileDropZone} turned away, and why: `type` when it\n * doesn't match `accept`, `count` when several came and `multiple` is off,\n * `directory` for a dropped folder.\n *\n * @public\n */\nexport interface FileRejection {\n readonly file: File;\n readonly reason: \"type\" | \"count\" | \"directory\";\n}\n\n/**\n * Props of {@link FileDropZone}. Native `div` props are passed through to the\n * zone.\n *\n * @public\n */\nexport interface FileDropZoneProps\n extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"className\" | \"onDrop\" | \"onDragEnter\" | \"onDragOver\" | \"onDragLeave\"\n >,\n StyleProps<FileDropZonePart> {\n /**\n * Called with the files that passed the zone's checks, chosen or dropped,\n * in order. The checks only look at names, types and counts: validate each\n * file's contents before using it.\n */\n readonly onFiles: (files: File[]) => void;\n /** Called with the files the zone turned away, and why. */\n readonly onFilesRejected?: ((rejections: FileRejection[]) => void) | undefined;\n /**\n * The file types to offer and take, as in `<input accept>`: extensions\n * such as `.pdf`, MIME types such as `application/pdf`, or `audio/*`.\n * A hint for the picker and a first filter, not a security check: a\n * file's name and type are whatever its sender chose.\n */\n readonly accept?: string | undefined;\n /** Takes several files at once. Defaults to `false`. */\n readonly multiple?: boolean | undefined;\n /**\n * Turns away files dropped anywhere else on the page while the zone is\n * mounted, so a near miss doesn't open the file in place of the page.\n * Defaults to `true`. Turn it off when the host handles stray drops\n * itself, or embeds the zone in a page whose drag and drop it doesn't own.\n */\n readonly preventStrayDrops?: boolean | undefined;\n /** Turns the button off, and ignores drops. */\n readonly disabled?: boolean | undefined;\n /**\n * The button's text. Defaults to `fileDropZone.choose` from the messages\n * (\"Choose a file\"), or `fileDropZone.chooseMultiple` with `multiple`.\n */\n readonly buttonLabel?: ReactNode;\n /** Defaults to `primary`. */\n readonly buttonVariant?: ButtonVariant | undefined;\n /** A ref to the button, for moving focus to it. */\n readonly buttonRef?: Ref<HTMLButtonElement> | undefined;\n /**\n * Text under the button, which also describes it. Defaults to\n * `fileDropZone.hint` (\"or drop it here\"), or `fileDropZone.hintMultiple`.\n */\n readonly hint?: ReactNode;\n /** Content above the button, such as a title or the reason the last file failed. */\n readonly children?: ReactNode;\n}\n\nconst hasFiles = (event: { dataTransfer: DataTransfer | null }): boolean =>\n event.dataTransfer?.types.includes(\"Files\") ?? false;\n\n/** Whether a file matches an `accept` list, by its name and type only. */\nexport function accepts(file: File, accept: string | undefined): boolean {\n const tokens = (accept ?? \"\")\n .split(\",\")\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) {\n return true;\n }\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return tokens.some((token) =>\n token.startsWith(\".\")\n ? name.endsWith(token)\n : token.endsWith(\"/*\")\n ? type.startsWith(token.slice(0, -1))\n : type === token,\n );\n}\n\n/** Splits files into those that pass the zone's checks and those that don't. */\nexport function check(\n files: readonly File[],\n directories: ReadonlySet<number>,\n accept: string | undefined,\n multiple: boolean,\n): { accepted: File[]; rejected: FileRejection[] } {\n const accepted: File[] = [];\n const rejected: FileRejection[] = [];\n files.forEach((file, index) => {\n if (directories.has(index)) {\n rejected.push({ file, reason: \"directory\" });\n } else if (!multiple && files.length > 1) {\n rejected.push({ file, reason: \"count\" });\n } else if (!accepts(file, accept)) {\n rejected.push({ file, reason: \"type\" });\n } else {\n accepted.push(file);\n }\n });\n return { accepted, rejected };\n}\n\n/**\n * Turns away a file dragged anywhere outside a drop zone, unless something\n * else took it, so a missed drop doesn't open the file in place of the page.\n */\nfunction refuseStrayDrop(event: globalThis.DragEvent): void {\n if (event.defaultPrevented || !hasFiles(event)) {\n return;\n }\n event.preventDefault();\n if (event.dataTransfer && event.type === \"dragover\") {\n event.dataTransfer.dropEffect = \"none\";\n }\n}\n\n/**\n * Where people choose or drop files, such as a document to open. The button\n * opens the system's file picker: it's the keyboard and screen reader path.\n * The zone around it takes dropped files, a shortcut for pointer users, so it\n * isn't focusable itself. While files are dragged over it, it has the\n * `data-hm-dragging` attribute.\n *\n * The zone checks names, types and counts against `accept` and `multiple`,\n * and turns away folders, then calls `onFiles`. It never reads a file and\n * never shows a file's name. Treat files as untrusted: check their contents\n * before using them, and show their names as text.\n *\n * While a zone is on the page, files dropped elsewhere on the page are\n * turned away, so a near miss doesn't navigate away from it. Hosts that\n * handle that themselves turn it off with `preventStrayDrops={false}`.\n *\n * @example\n * ```tsx\n * <FileDropZone accept=\".pdf,application/pdf\" onFiles={([file]) => open(file)}>\n * <p>{messages.t(\"editor.start.title\")}</p>\n * </FileDropZone>\n * ```\n *\n * @public\n */\nexport const FileDropZone = /* @__PURE__ */ forwardRef<HTMLDivElement, FileDropZoneProps>(\n function FileDropZone(\n {\n onFiles,\n onFilesRejected,\n accept,\n multiple = false,\n disabled = false,\n preventStrayDrops = true,\n buttonLabel,\n buttonVariant = \"primary\",\n buttonRef,\n hint,\n className,\n classNames,\n unstyled,\n children,\n ...props\n },\n ref,\n ) {\n const input = useRef<HTMLInputElement>(null);\n // Elements the drag has entered and not yet left. Entering a child fires\n // dragleave on its parent, so the zone only stops being a target when\n // this is empty: no flicker over children.\n const entered = useRef(new Set<EventTarget>());\n const [dragging, setDragging] = useState(false);\n const hintId = useId();\n const defaultLabel = useUiText(\n multiple ? \"fileDropZone.chooseMultiple\" : \"fileDropZone.choose\",\n );\n const defaultHint = useUiText(multiple ? \"fileDropZone.hintMultiple\" : \"fileDropZone.hint\");\n\n useEffect(() => {\n if (!preventStrayDrops) {\n return;\n }\n window.addEventListener(\"dragover\", refuseStrayDrop);\n window.addEventListener(\"drop\", refuseStrayDrop);\n return () => {\n window.removeEventListener(\"dragover\", refuseStrayDrop);\n window.removeEventListener(\"drop\", refuseStrayDrop);\n };\n }, [preventStrayDrops]);\n\n useEffect(() => {\n if (disabled) {\n entered.current.clear();\n setDragging(false);\n }\n }, [disabled]);\n\n const deliver = (files: readonly File[], directories: ReadonlySet<number> = new Set()) => {\n const { accepted, rejected } = check(files, directories, accept, multiple);\n if (accepted.length > 0) {\n onFiles(accepted);\n }\n if (rejected.length > 0) {\n onFilesRejected?.(rejected);\n }\n };\n\n const choose = (event: ChangeEvent<HTMLInputElement>): void => {\n const files = [...(event.currentTarget.files ?? [])];\n // Cleared, so choosing the same file again still delivers it.\n event.currentTarget.value = \"\";\n deliver(files);\n };\n\n const handleDragEnter = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n entered.current.add(event.target);\n setDragging(true);\n };\n\n const handleDragOver = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n event.dataTransfer.dropEffect = disabled ? \"none\" : \"copy\";\n };\n\n const handleDragLeave = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n const zone = event.currentTarget;\n entered.current.delete(event.target);\n // Drop elements that left the zone or the page while the drag was on.\n for (const target of entered.current) {\n if (!(target instanceof Node) || !zone.contains(target)) {\n entered.current.delete(target);\n }\n }\n if (entered.current.size === 0) {\n setDragging(false);\n }\n };\n\n const handleDrop = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n entered.current.clear();\n setDragging(false);\n if (disabled) {\n return;\n }\n const files = [...event.dataTransfer.files];\n // Folders arrive as files; their entries tell them apart, without\n // reading anything. Only available during the drop event.\n const directories = new Set<number>();\n [...event.dataTransfer.items]\n .filter((item) => item.kind === \"file\")\n .forEach((item, index) => {\n if (item.webkitGetAsEntry?.()?.isDirectory) {\n directories.add(index);\n }\n });\n deliver(files, directories);\n };\n\n return (\n // The zone is a pointer shortcut only: the button opens the same picker.\n // biome-ignore lint/a11y/noStaticElementInteractions: a drop target has no keyboard role; the button is the accessible path\n <div\n {...props}\n ref={ref}\n className={cx(\"hm-file-drop-zone\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n data-hm-dragging={dragging ? \"\" : undefined}\n data-hm-disabled={disabled ? \"\" : undefined}\n onDragEnter={handleDragEnter}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {children}\n <Button\n ref={buttonRef}\n variant={buttonVariant}\n className={cx(\"hm-file-drop-zone-button\", classNames?.button)}\n unstyled={unstyled}\n disabled={disabled}\n aria-describedby={hintId}\n onClick={() => input.current?.click()}\n >\n {buttonLabel ?? defaultLabel}\n </Button>\n <div id={hintId} className={cx(\"hm-file-drop-zone-hint\", classNames?.hint)}>\n {hint ?? defaultHint}\n </div>\n <input\n ref={input}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n // The button is the control; this input only opens the picker.\n tabIndex={-1}\n aria-hidden=\"true\"\n hidden\n onChange={choose}\n />\n </div>\n );\n },\n);\n","/** The number of decimals in a number, so steps don't drift: 0.1 + 0.2 is 0.3. */\nexport function decimals(value: number): number {\n const text = String(value);\n const exponent = /e-(\\d+)$/.exec(text);\n if (exponent) {\n return Number(exponent[1]);\n }\n const point = text.indexOf(\".\");\n return point === -1 ? 0 : text.length - point - 1;\n}\n\n/** Rounds away float error at a number of decimals, which `toFixed` caps at 100. */\nexport function roundTo(value: number, places: number): number {\n return Number(value.toFixed(Math.min(places, 100)));\n}\n","import {\n type ChangeEvent,\n type FocusEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useMemo,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { useUiLocale } from \"../messages/UiMessagesProvider.js\";\nimport { decimals, roundTo } from \"../shared/number.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link NumberField}. Native input props are passed through.\n *\n * @public\n */\nexport interface NumberFieldProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | \"className\"\n | \"type\"\n | \"value\"\n | \"defaultValue\"\n | \"min\"\n | \"max\"\n | \"step\"\n | \"onChange\"\n | \"role\"\n | \"aria-valuenow\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuetext\"\n >,\n StyleProps<\"root\"> {\n /** The value, when you control it. Leave it out to let the field keep its own. */\n readonly value?: number | undefined;\n /** The starting value, when the field keeps its own. Defaults to 0, kept within `min` and `max`. */\n readonly defaultValue?: number | undefined;\n /**\n * Called with the new value when it's committed: on blur, on Enter, or\n * with the arrow and Page keys. Never with `NaN`, and never while typing.\n */\n readonly onValueChange?: ((value: number) => void) | undefined;\n /** The smallest value. Values below it are raised to it. */\n readonly min?: number | undefined;\n /** The largest value. Values above it are lowered to it. */\n readonly max?: number | undefined;\n /** The Arrow Up and Arrow Down step. Defaults to 1. Typed values aren't snapped to it. */\n readonly step?: number | undefined;\n /** The Page Up and Page Down step. Defaults to ten steps. */\n readonly largeStep?: number | undefined;\n /**\n * The locale for the default `parse` and `format`, such as `\"de\"`.\n * Defaults to the locale of `UiMessagesProvider`, or `\"en\"`.\n */\n readonly locale?: string | undefined;\n /**\n * Reads typed text as a number, or returns `undefined` when it isn't one.\n * Defaults to the locale's digits, decimal and group separators, and minus\n * sign. Replace it for other notations, such as a timecode.\n */\n readonly parse?: ((text: string) => number | undefined) | undefined;\n /**\n * Writes a value as text: the field shows it, and screen readers read it.\n * Defaults to the locale's number format.\n */\n readonly format?: ((value: number) => string) | undefined;\n /**\n * The accessible name, such as \"Zoom\". Leave it out inside a `Field`, or\n * when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/** How a locale writes numbers, learned from `Intl.NumberFormat`. */\nexport interface Notation {\n readonly group: string;\n readonly decimal: string;\n readonly digits: ReadonlyMap<string, string>;\n}\n\nexport function notationOf(locale: string): Notation {\n const parts = new Intl.NumberFormat(locale).formatToParts(-12345.6);\n const digits = new Map<string, string>();\n const native = new Intl.NumberFormat(locale, { useGrouping: false }).format(9876543210);\n [...native].forEach((digit, index) => {\n digits.set(digit, String(9 - index));\n });\n return {\n group: parts.find((part) => part.type === \"group\")?.value ?? \",\",\n decimal: parts.find((part) => part.type === \"decimal\")?.value ?? \".\",\n digits,\n };\n}\n\n/** Spaces people type for a locale whose group separator is space-like. */\nconst SPACE = /[\\s\\u00a0\\u202f]/;\n\n/** Escapes a separator for use in a regular expression. */\nconst escapeRegExp = (text: string): string => text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/** Matches the group separators people type for a locale. */\nfunction groupPattern(group: string): RegExp {\n if (SPACE.test(group)) {\n return /[\\s\\u00a0\\u202f]/;\n }\n // Swiss German groups with an apostrophe: ' or ’, depending on the\n // engine's data, and people type either.\n if (/^['\\u2019]$/.test(group)) {\n return /['\\u2019]/;\n }\n return new RegExp(escapeRegExp(group));\n}\n\n/**\n * Whether an integer part's groups are where the locale puts them: 1 to 3\n * digits, then groups of 2 or 3, ending in a group of 3, as in 1,234,567\n * or en-IN's 12,34,567. Otherwise a separator is a typo, or another\n * locale's decimal point, such as \"2.5\" typed in German, and reading it as\n * a group would silently multiply the value.\n */\nfunction groupsInPlace(groups: readonly string[]): boolean {\n const last = groups.length - 1;\n return groups.every((group, index) =>\n index === 0\n ? /^\\d{1,3}$/.test(group)\n : index === last\n ? /^\\d{3}$/.test(group)\n : /^\\d{2,3}$/.test(group),\n );\n}\n\n/**\n * Reads a number the way a locale writes it: its digits, decimal separator\n * and group separators, with an optional minus sign, hyphen or plus. Strict:\n * anything else, such as letters, an exponent or a group separator out of\n * place, isn't a number.\n */\nexport function parseIn(notation: Notation, text: string): number | undefined {\n let normal = \"\";\n // Bidirectional marks, such as the one before Arabic's minus sign, aren't\n // part of the number.\n for (const character of text.replace(/[\\u061c\\u200e\\u200f]/g, \"\").trim()) {\n normal += notation.digits.get(character) ?? character;\n }\n const sign = /^[-+\\u2212]/.exec(normal)?.[0];\n if (sign !== undefined) {\n normal = normal.slice(1);\n }\n const parts = normal.split(notation.decimal);\n if (parts.length > 2) {\n return undefined;\n }\n const groups = (parts[0] ?? \"\").split(groupPattern(notation.group));\n if (groups.length > 1 && !groupsInPlace(groups)) {\n return undefined;\n }\n const integer = groups.join(\"\");\n const fraction = parts[1] ?? \"\";\n if (!/^\\d*$/.test(integer) || !/^\\d*$/.test(fraction) || integer + fraction === \"\") {\n return undefined;\n }\n const value = Number(\n `${sign === \"+\" || sign === undefined ? \"\" : \"-\"}${integer || \"0\"}.${fraction || \"0\"}`,\n );\n return Number.isFinite(value) ? value : undefined;\n}\n\n/**\n * A number input: a text field exposed as a spin button, with locale-aware\n * parsing and formatting.\n *\n * Typing never changes the value: the text is committed on blur or Enter,\n * then kept within `min` and `max`. Text that isn't a number, or no text,\n * goes back to the last value, so the value is never `NaN`. Escape throws\n * the typing away. Arrow Up and Arrow Down move by `step`, Page Up and Page\n * Down by `largeStep`, from the typed number when there is one.\n *\n * Other notations are a `parse` and `format` away: a timecode field is a\n * `NumberField` of seconds. With `name`, forms receive the number, not the\n * formatted text.\n *\n * @example\n * ```tsx\n * <Field label={messages.t(\"view.zoom\")}>\n * <NumberField\n * min={10}\n * max={400}\n * step={10}\n * value={zoom}\n * onValueChange={setZoom}\n * format={(percent) => `${percent}%`}\n * parse={(text) => parseFloat(text)}\n * />\n * </Field>\n * ```\n *\n * @public\n */\nexport const NumberField = /* @__PURE__ */ forwardRef<HTMLInputElement, NumberFieldProps>(\n function NumberField(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n min,\n max,\n step = 1,\n largeStep,\n locale,\n parse,\n format,\n label,\n name,\n form,\n disabled,\n readOnly,\n className,\n classNames,\n unstyled,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) {\n const lower = min ?? Number.NEGATIVE_INFINITY;\n const upper = max ?? Number.POSITIVE_INFINITY;\n const clamp = (n: number): number => Math.min(Math.max(n, lower), Math.max(lower, upper));\n\n const [uncontrolled, setUncontrolled] = useState(() => clamp(defaultValue ?? 0));\n // What's typed and not yet committed; null while the field shows the value.\n const [draft, setDraft] = useState<string | null>(null);\n // -0 would show as \"-0\".\n const value = clamp(controlled ?? uncontrolled) || 0;\n\n const contextLocale = useUiLocale();\n const resolvedLocale = locale ?? contextLocale;\n const notation = useMemo(() => notationOf(resolvedLocale), [resolvedLocale]);\n const places = Math.min(20, Math.max(decimals(step), decimals(value)));\n const formatter = useMemo(\n () => new Intl.NumberFormat(resolvedLocale, { maximumFractionDigits: places }),\n [resolvedLocale, places],\n );\n const formatted = format ? format(value) : formatter.format(value);\n const read = (text: string): number | undefined => {\n const parsed = parse ? parse(text) : parseIn(notation, text);\n return parsed !== undefined && Number.isFinite(parsed) ? parsed : undefined;\n };\n\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"NumberField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const commit = (next: number): void => {\n setDraft(null);\n const settled = clamp(next) || 0;\n if (settled === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(settled);\n }\n onValueChange?.(settled);\n };\n\n // Commits typed text, or goes back to the value when it isn't a number.\n const commitDraft = (): void => {\n if (draft === null) {\n return;\n }\n const parsed = read(draft);\n if (parsed === undefined) {\n setDraft(null);\n } else {\n commit(parsed);\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n setDraft(event.currentTarget.value);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n commitDraft();\n onBlur?.(event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // An input method editor uses Enter and Escape while composing.\n if (event.defaultPrevented || event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === \"Enter\") {\n // Not prevented, so Enter still submits a form. The commit renders\n // synchronously, so the form, and a parent's state, have the new\n // value first: Firefox submits before React's usual flush.\n flushSync(commitDraft);\n return;\n }\n if (event.key === \"Escape\") {\n if (draft !== null) {\n // Only the typing goes; a dialog around the field stays open.\n event.preventDefault();\n setDraft(null);\n }\n return;\n }\n if (readOnly || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n const large = largeStep ?? step * 10;\n const steps: Record<string, number> = {\n ArrowUp: step,\n ArrowDown: -step,\n PageUp: large,\n PageDown: -large,\n };\n const delta = steps[event.key];\n if (delta === undefined) {\n return;\n }\n event.preventDefault();\n const base = (draft === null ? undefined : read(draft)) ?? value;\n const precision = Math.max(\n decimals(base),\n decimals(delta),\n min === undefined ? 0 : decimals(min),\n );\n commit(roundTo(base + delta, precision));\n };\n\n return (\n <>\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type=\"text\"\n role=\"spinbutton\"\n inputMode={props.inputMode ?? (lower >= 0 ? \"decimal\" : \"text\")}\n autoComplete={props.autoComplete ?? \"off\"}\n autoCorrect={props.autoCorrect ?? \"off\"}\n spellCheck={props.spellCheck ?? false}\n disabled={disabled}\n readOnly={readOnly}\n value={draft ?? formatted}\n aria-label={label ?? props[\"aria-label\"]}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuetext={formatted}\n className={cx(\"hm-number-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n {name === undefined ? null : (\n <input type=\"hidden\" name={name} form={form} disabled={disabled} value={value} />\n )}\n </>\n );\n },\n);\n","import { forwardRef, type ProgressHTMLAttributes } from \"react\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link ProgressBar}.\n *\n * @public\n */\nexport interface ProgressBarProps\n extends Omit<ProgressHTMLAttributes<HTMLProgressElement>, \"className\" | \"value\" | \"max\">,\n StyleProps<\"root\"> {\n /** How much is done, from 0 to `max`. Leave it out while the amount is unknown. */\n readonly value?: number | undefined;\n /** Defaults to 100. */\n readonly max?: number | undefined;\n /** What's in progress. Defaults to `progress.label` from the messages (\"Progress\"). */\n readonly label?: string | undefined;\n /** The value as words, such as \"Page 3 of 12\", read instead of a percentage. */\n readonly valueText?: string | undefined;\n}\n\n/**\n * Shows how much of a task is done, on the native `<progress>` element: no\n * inline styles, so it renders correctly under a strict Content Security\n * Policy, before hydration too. Without `value`, it's indeterminate and\n * pulses, or stays still under reduced motion.\n *\n * @example\n * ```tsx\n * <ProgressBar value={done} max={total} label={messages.t(\"export.progress\")} />\n * ```\n *\n * @public\n */\nexport const ProgressBar = /* @__PURE__ */ forwardRef<HTMLProgressElement, ProgressBarProps>(\n function ProgressBar(\n { value, max = 100, label, valueText, className, classNames, unstyled, ...props },\n ref,\n ) {\n const defaultLabel = useUiText(\"progress.label\");\n const clamped = value === undefined ? undefined : Math.min(Math.max(value, 0), max);\n return (\n <progress\n {...props}\n ref={ref}\n value={clamped}\n max={max}\n aria-label={label ?? defaultLabel}\n aria-valuetext={valueText}\n className={cx(\"hm-progress-bar\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n />\n );\n },\n);\n","import { createContext, useContext } from \"react\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\n/** What children of a Toolbar need to know. */\nexport interface ToolbarContextValue {\n readonly orientation: \"horizontal\" | \"vertical\";\n}\n\nexport const ToolbarContext = /* @__PURE__ */ createContext<ToolbarContextValue | undefined>(\n undefined,\n);\n\n/** The enclosing toolbar, or `undefined` outside one. */\nexport function useToolbar(): ToolbarContextValue | undefined {\n checkSingleCopy();\n return useContext(ToolbarContext);\n}\n","import {\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n} from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { useToolbar } from \"../toolbar/toolbar-context.js\";\n\n/**\n * One choice in a {@link SegmentedControl}.\n *\n * @public\n */\nexport interface SegmentedControlOption<Value extends string> {\n readonly value: Value;\n /** The option's text, and its accessible name when `hideLabel` is set. */\n readonly label: string;\n /** An icon before the label. It draws with `currentColor`. */\n readonly icon?: ReactNode;\n /** Shows only the icon; `label` stays the accessible name. */\n readonly hideLabel?: boolean;\n readonly disabled?: boolean;\n}\n\n/**\n * The parts of a segmented control that `classNames` can target.\n *\n * @public\n */\nexport type SegmentedControlPart = \"root\" | \"option\" | \"icon\" | \"label\";\n\n/**\n * Props of {@link SegmentedControl}.\n *\n * @public\n */\nexport interface SegmentedControlProps<Value extends string>\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\" | \"onChange\">,\n StyleProps<SegmentedControlPart> {\n /** The group's accessible name, such as \"View\". Required. */\n readonly label: string;\n /** The selected option's value. The control is always controlled. */\n readonly value: Value;\n readonly onValueChange: (value: Value) => void;\n readonly options: readonly SegmentedControlOption<Value>[];\n /** Defaults to `medium`. */\n readonly size?: \"medium\" | \"small\" | undefined;\n}\n\nfunction SegmentedControlImpl<Value extends string>(\n {\n label,\n value,\n onValueChange,\n options,\n size = \"medium\",\n className,\n classNames,\n unstyled,\n onKeyDown,\n ...props\n }: SegmentedControlProps<Value>,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement {\n // Inside a toolbar, the toolbar owns focus: arrows only move, and Space or\n // Enter selects (APG toolbar). Standalone, it's a radio group: one Tab stop\n // on the selected option, and arrows move and select (APG radio group).\n const inToolbar = useToolbar() !== undefined;\n const enabled = options.filter((option) => !option.disabled);\n const tabStop = enabled.find((option) => option.value === value) ?? enabled[0];\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n if (inToolbar || event.defaultPrevented) {\n return;\n }\n const step =\n event.key === \"ArrowRight\" || event.key === \"ArrowDown\"\n ? 1\n : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\"\n ? -1\n : 0;\n if (step === 0 || enabled.length === 0) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const horizontal = event.key === \"ArrowRight\" || event.key === \"ArrowLeft\";\n const direction = rtl && horizontal ? -step : step;\n const current = Math.max(\n 0,\n enabled.findIndex((option) => option.value === value),\n );\n const next = enabled[(current + direction + enabled.length) % enabled.length];\n if (next) {\n onValueChange(next.value);\n event.currentTarget\n .querySelector<HTMLElement>(`[data-hm-value=\"${CSS.escape(next.value)}\"]`)\n ?.focus();\n }\n };\n\n return (\n <div\n {...props}\n ref={ref}\n role=\"radiogroup\"\n aria-label={label}\n className={cx(\n \"hm-segmented-control\",\n size === \"small\" && \"hm-segmented-control--small\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onKeyDown={handleKeyDown}\n >\n {options.map((option) => {\n const checked = option.value === value;\n return (\n // biome-ignore lint/a11y/useSemanticElements: native radios select on arrow keys, which a toolbar must not do; buttons with role=\"radio\" are the APG pattern.\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={option.hideLabel ? option.label : undefined}\n disabled={option.disabled}\n tabIndex={inToolbar ? undefined : option === tabStop ? 0 : -1}\n data-hm-value={option.value}\n className={cx(\"hm-segmented-control-option\", classNames?.option)}\n onClick={() => {\n if (!checked) {\n onValueChange(option.value);\n }\n }}\n >\n {option.icon == null ? null : (\n <span\n className={cx(\"hm-segmented-control-icon\", classNames?.icon)}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>\n )}\n {option.hideLabel ? null : (\n <span className={cx(\"hm-segmented-control-label\", classNames?.label)}>\n {option.label}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n\n/**\n * A small set of mutually exclusive choices shown side by side, such as a\n * view mode. It's a WAI-ARIA radio group: arrow keys move and select. Inside a\n * {@link Toolbar}, it joins the toolbar's arrow-key navigation instead, and\n * Space or Enter selects.\n *\n * @example\n * ```tsx\n * <SegmentedControl\n * label={messages.t(\"view.label\")}\n * value={view}\n * onValueChange={setView}\n * options={[\n * { value: \"single\", label: messages.t(\"view.single\") },\n * { value: \"grid\", label: messages.t(\"view.grid\"), icon: <GridIcon />, hideLabel: true },\n * ]}\n * />\n * ```\n *\n * @public\n */\nexport const SegmentedControl = /* @__PURE__ */ forwardRef(SegmentedControlImpl) as <\n Value extends string,\n>(\n props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>,\n) => ReactElement;\n","import {\n type ChangeEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useState,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { decimals, roundTo } from \"../shared/number.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link Slider}. Native input props are passed through.\n *\n * @public\n */\nexport interface SliderProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | \"className\"\n | \"type\"\n | \"value\"\n | \"defaultValue\"\n | \"min\"\n | \"max\"\n | \"step\"\n | \"onChange\"\n | \"aria-valuetext\"\n >,\n StyleProps<\"root\"> {\n /** The value, when you control it. Leave it out to let the slider keep its own. */\n readonly value?: number | undefined;\n /** The starting value, when the slider keeps its own. Defaults to `min`. */\n readonly defaultValue?: number | undefined;\n /** Called with the new value as it changes, by pointer or keyboard. */\n readonly onValueChange?: ((value: number) => void) | undefined;\n /** Defaults to 0. */\n readonly min?: number | undefined;\n /** Defaults to 100. */\n readonly max?: number | undefined;\n /** The arrow keys' step, and the values the slider snaps to. Defaults to 1. */\n readonly step?: number | undefined;\n /**\n * The Page Up and Page Down step. Defaults to a tenth of the range, rounded\n * to a whole number of steps.\n */\n readonly largeStep?: number | undefined;\n /**\n * Writes the value as text for screen readers, such as \"−6 dB\" or \"1:05\",\n * exposed as `aria-valuetext`. Without it, they read the number. Format\n * for the user's locale, as `Intl.NumberFormat` does.\n */\n readonly formatValue?: ((value: number) => string) | undefined;\n /**\n * The accessible name, such as \"Volume\". Leave it out inside a `Field`,\n * or when a visible `<label>` points at the slider's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/** Keeps a value in range and on a step from `min`, as the native input does. */\nfunction snap(value: number, min: number, max: number, step: number): number {\n const precision = Math.max(decimals(min), decimals(step));\n // Rounds away float error, such as 3 × 0.1 = 0.30000000000000004, before\n // any comparison, so it can't look like an overshoot.\n const round = (n: number): number => roundTo(n, precision);\n const upper = Math.max(min, max);\n const stepped = round(step > 0 ? min + Math.round((value - min) / step) * step : value);\n // A step that doesn't divide the range can overshoot the top; step back.\n const inRange = stepped > upper && step > 0 ? round(stepped - step) : stepped;\n return Math.min(Math.max(inRange, min), upper);\n}\n\n/**\n * A slider for a value in a range, such as volume or zoom, on the native\n * `<input type=\"range\">`.\n *\n * Arrow keys move by `step`, Page Up and Page Down by `largeStep`, and Home\n * and End to the ends. In right-to-left text, the slider is mirrored and the\n * left and right arrows follow it, in every browser. `formatValue` gives\n * screen readers the value as text.\n *\n * Inside a `Toolbar`, the slider keeps the arrow keys, Home and End, so\n * they can't move focus past it: put it last in the toolbar. Tab still\n * leaves the toolbar.\n *\n * It has no filled part of the track, because one would need an inline\n * style, which a strict Content Security Policy blocks.\n *\n * @example\n * ```tsx\n * <Slider\n * label={messages.t(\"player.volume\")}\n * min={-60}\n * max={0}\n * value={gain}\n * onValueChange={setGain}\n * formatValue={(db) => messages.t(\"player.decibels\", { db })}\n * />\n * ```\n *\n * @public\n */\nexport const Slider = /* @__PURE__ */ forwardRef<HTMLInputElement, SliderProps>(function Slider(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n largeStep,\n formatValue,\n label,\n className,\n classNames,\n unstyled,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(() => snap(defaultValue ?? min, min, max, step));\n const value = snap(controlled ?? uncontrolled, min, max, step);\n\n const fieldProps = useFieldProps(props, label);\n\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"Slider needs an accessible name: pass label, or point a visible <label> at its id. Use text from your message catalogue.\",\n );\n }\n }\n\n const change = (next: number): void => {\n const snapped = snap(next, min, max, step);\n if (snapped === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(snapped);\n }\n onValueChange?.(snapped);\n };\n\n // Pointer changes come from the native input.\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n change(event.currentTarget.valueAsNumber);\n };\n\n // Keys are handled here rather than by the browser, so every engine does\n // the same: WebKit doesn't mirror the arrow keys in right-to-left text.\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // Alt and Meta combinations stay with the browser and the system.\n if (event.defaultPrevented || event.altKey || event.metaKey) {\n return;\n }\n const large = largeStep ?? Math.max(step, Math.round((max - min) / 10 / step) * step);\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const targets: Record<string, number> = {\n ArrowUp: value + step,\n ArrowDown: value - step,\n ArrowRight: rtl ? value - step : value + step,\n ArrowLeft: rtl ? value + step : value - step,\n PageUp: value + large,\n PageDown: value - large,\n Home: min,\n End: max,\n };\n const next = targets[event.key];\n if (next === undefined) {\n return;\n }\n event.preventDefault();\n change(next);\n };\n\n return (\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n aria-label={label ?? props[\"aria-label\"]}\n aria-valuetext={formatValue?.(value)}\n className={cx(\"hm-slider\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n />\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link Spinner}.\n *\n * @public\n */\nexport interface SpinnerProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"className\" | \"role\" | \"children\">,\n StyleProps<\"root\"> {\n /** What's loading. Defaults to `spinner.label` from the messages (\"Loading\"). */\n readonly label?: string | undefined;\n}\n\n/**\n * Shows that something is loading, for an unknown time. It's an\n * indeterminate progress bar to assistive technology, named by `label`.\n * Under reduced motion it pulses slowly instead of turning. Its size follows\n * `--hm-spinner-size`.\n *\n * @example\n * ```tsx\n * <Spinner label={messages.t(\"pages.loading\")} />\n * ```\n *\n * @public\n */\nexport const Spinner = /* @__PURE__ */ forwardRef<HTMLSpanElement, SpinnerProps>(function Spinner(\n { label, className, classNames, unstyled, ...props },\n ref,\n) {\n const defaultLabel = useUiText(\"spinner.label\");\n return (\n // A native <progress> can't be drawn as a ring, so this takes its role.\n <span\n {...props}\n ref={ref}\n role=\"progressbar\"\n aria-label={label ?? defaultLabel}\n className={cx(\"hm-spinner\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n />\n );\n});\n","import { type ChangeEvent, forwardRef, type TextareaHTMLAttributes } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link TextArea}. Native textarea props are passed through, so it\n * works controlled with `value` and `onChange`, or uncontrolled with\n * `defaultValue`.\n *\n * @public\n */\nexport interface TextAreaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"className\">,\n StyleProps<\"root\"> {\n /** Called with the new text as it changes, as well as `onChange`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /**\n * The accessible name, such as \"Caption\". Leave it out inside a `Field`,\n * or when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * A multi-line text input, styled like `TextField`, with its tokens. `rows`\n * sets its height, three by default, and the user can drag it taller. Inside\n * a `Field`, it takes the field's label, description and error.\n *\n * Enter adds a line, so it doesn't submit a form. Its value separates lines\n * with `\\n`, whatever was pasted.\n *\n * @example\n * ```tsx\n * <Field label={t(\"text.content\")}>\n * <TextArea value={text} onValueChange={setText} rows={4} />\n * </Field>\n * ```\n *\n * @public\n */\nexport const TextArea = /* @__PURE__ */ forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { rows = 3, onValueChange, onChange, label, className, classNames, unstyled, ...props },\n ref,\n ) {\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"TextArea needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>): void => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n return (\n <textarea\n {...props}\n {...fieldProps}\n ref={ref}\n rows={rows}\n aria-label={label ?? props[\"aria-label\"]}\n // A text field, with its class and tokens, then the area's own layout.\n className={cx(\"hm-text-field\", \"hm-text-area\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n />\n );\n },\n);\n","import { type ChangeEvent, forwardRef, type InputHTMLAttributes } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The kinds of single-line text a {@link TextField} takes.\n *\n * @public\n */\nexport type TextFieldType = \"text\" | \"search\" | \"email\" | \"url\" | \"tel\" | \"password\";\n\n/**\n * Props of {@link TextField}. Native input props are passed through, so it\n * works controlled with `value` and `onChange`, or uncontrolled with\n * `defaultValue`.\n *\n * @public\n */\nexport interface TextFieldProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"className\" | \"type\">,\n StyleProps<\"root\"> {\n /** Defaults to `text`. */\n readonly type?: TextFieldType | undefined;\n /** Called with the new text as it changes, as well as `onChange`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /**\n * The accessible name, such as \"File name\". Leave it out inside a\n * `Field`, or when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * A single-line text input, styled like the family's other fields. Inside a\n * `Field`, it takes the field's label, description and error.\n *\n * @example\n * ```tsx\n * <Field label={t(\"export.fileName\")} error={nameError}>\n * <TextField value={name} onValueChange={setName} autoComplete=\"off\" />\n * </Field>\n * ```\n *\n * @public\n */\nexport const TextField = /* @__PURE__ */ forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n { type = \"text\", onValueChange, onChange, label, className, classNames, unstyled, ...props },\n ref,\n ) {\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"TextField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n return (\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type={type}\n aria-label={label ?? props[\"aria-label\"]}\n className={cx(\"hm-text-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n />\n );\n },\n);\n","import { forwardRef, type MouseEvent, type ReactNode, useState } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { Button, type ButtonPart, type ButtonProps, type ButtonVariant } from \"../button/Button.js\";\nimport { type ClassNames, cx } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * How prominent a toggle button is: `secondary` (the default), or `quiet` for\n * toolbars. There's no `primary` or `danger`: their solid fill would make a\n * toggle that's off look more active than one that's on.\n *\n * @public\n */\nexport type ToggleButtonVariant = Extract<ButtonVariant, \"secondary\" | \"quiet\">;\n\n/**\n * Props every {@link ToggleButton} takes, with or without visible text.\n *\n * @public\n */\nexport interface ToggleButtonBaseProps\n extends Omit<\n ButtonProps,\n \"variant\" | \"pressed\" | \"aria-pressed\" | \"children\" | \"startIcon\" | \"endIcon\" | \"classNames\"\n > {\n /** Defaults to `secondary`. */\n readonly variant?: ToggleButtonVariant | undefined;\n /** Whether it's on, when you control it. Leave it out to let the button keep its own state. */\n readonly pressed?: boolean | undefined;\n /** Whether it starts on, when it keeps its own state. Defaults to `false`. */\n readonly defaultPressed?: boolean | undefined;\n /**\n * Called with the new state when the button is activated. Calling\n * `event.preventDefault()` in `onClick` stops the change.\n */\n readonly onPressedChange?: ((pressed: boolean) => void) | undefined;\n}\n\n/**\n * A toggle button with visible text, and optional icons beside it.\n *\n * @public\n */\nexport interface ToggleButtonTextProps extends ToggleButtonBaseProps {\n /** The label. It must say what the button turns on, and stay the same in both states. */\n readonly children: ReactNode;\n /** An icon before the label. It's decorative, and draws with `currentColor`. */\n readonly startIcon?: ReactNode;\n /** An icon after the label. */\n readonly endIcon?: ReactNode;\n /** Extra classes per part. */\n readonly classNames?: ClassNames<ButtonPart> | undefined;\n readonly icon?: undefined;\n readonly label?: undefined;\n}\n\n/**\n * A square toggle button with only an icon.\n *\n * @public\n */\nexport interface ToggleButtonIconProps extends ToggleButtonBaseProps {\n /** The icon. It draws with `currentColor`. */\n readonly icon: ReactNode;\n /** The accessible name. Required, because the button shows no text. It stays the same in both states. */\n readonly label: string;\n /** Extra classes on the root and the icon. */\n readonly classNames?: ClassNames<\"root\" | \"icon\"> | undefined;\n readonly children?: undefined;\n readonly startIcon?: undefined;\n readonly endIcon?: undefined;\n}\n\n/**\n * Props of {@link ToggleButton}: visible text, or an icon with a `label`.\n *\n * @public\n */\nexport type ToggleButtonProps = ToggleButtonTextProps | ToggleButtonIconProps;\n\n/**\n * A button that turns something on or off, such as loop playback or the\n * active tool, exposed as `aria-pressed`. Controlled with `pressed` and\n * `onPressedChange`, or keeping its own state from `defaultPressed`.\n *\n * Its label names what it turns on and never changes with the state: screen\n * readers announce the state. For a button whose label changes, such as\n * play and pause, use `IconButton` or `Button` and swap the label instead.\n *\n * Inside a `Toolbar`, it's a toolbar item like any button: arrow keys reach\n * it, and Space or Enter toggles it.\n *\n * @example\n * ```tsx\n * <ToggleButton\n * label={messages.t(\"player.loop\")}\n * icon={<LoopIcon />}\n * pressed={loop}\n * onPressedChange={setLoop}\n * />\n * ```\n *\n * @public\n */\nexport const ToggleButton = /* @__PURE__ */ forwardRef<HTMLButtonElement, ToggleButtonProps>(\n function ToggleButton(\n {\n pressed: controlled,\n defaultPressed = false,\n onPressedChange,\n onClick,\n icon,\n label,\n className,\n ...props\n },\n ref,\n ) {\n const [uncontrolled, setUncontrolled] = useState(defaultPressed);\n const pressed = controlled ?? uncontrolled;\n const iconOnly = label !== undefined;\n if (iconOnly && label.trim() === \"\") {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"ToggleButton needs a label when it shows only an icon: it's the button's only accessible name. Pass text from your message catalogue.\",\n );\n }\n }\n\n // Button doesn't call onClick while it's disabled but focusable, so a\n // disabled toggle never changes.\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(!pressed);\n }\n onPressedChange?.(!pressed);\n };\n\n return (\n <Button\n {...props}\n ref={ref}\n {...(iconOnly ? { \"aria-label\": label, startIcon: icon } : {})}\n className={cx(\"hm-toggle-button\", iconOnly && \"hm-icon-button\", className)}\n pressed={pressed}\n onClick={handleClick}\n />\n );\n },\n);\n","/**\n * Roving tabindex for toolbars (WAI-ARIA APG): one Tab stop, and arrow keys\n * between items. Items are found from the DOM when needed, so they don't have\n * to register, and the server renders no tabindex at all, so hydration never\n * mismatches.\n */\n\n// A literal, not a joined array: a call at module scope would make bundlers\n// keep this module in applications that never use a toolbar.\n//\n// Items the toolbar has managed carry data-hm-roving, so a custom item, such\n// as a div with tabindex=\"0\", still counts after the toolbar sets its\n// tabindex to -1. Elements an author set to tabindex=\"-1\" are never marked,\n// so they stay out. A managed item that becomes disabled drops out again.\nconst FOCUSABLE =\n 'button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex^=\"-\"]):not(button, a, input, select, textarea), [data-hm-roving]:not(:disabled)';\n\n/** The toolbar's items, in DOM order, skipping hidden ones. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (element) => !element.closest(\"[hidden], [inert]\") && element.getClientRects().length > 0,\n );\n}\n\n/** Makes `active` the single Tab stop, or the first item when it's not an item. */\nexport function syncTabStop(toolbar: HTMLElement, active?: Element | null): void {\n const list = items(toolbar);\n const current =\n list.find((item) => item === active) ??\n list.find((item) => item.tabIndex === 0 && item.dataset[\"hmTabStop\"] !== undefined) ??\n list[0];\n for (const item of list) {\n const isStop = item === current;\n item.dataset[\"hmRoving\"] = \"\";\n item.tabIndex = isStop ? 0 : -1;\n if (isStop) {\n item.dataset[\"hmTabStop\"] = \"\";\n } else {\n delete item.dataset[\"hmTabStop\"];\n }\n }\n}\n\n/** Keys that never move focus inside text fields, where they edit text. */\nfunction editsText(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLInputElement &&\n ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\"].includes(target.type))\n );\n}\n\n/**\n * Moves focus for an arrow, Home or End key. Returns whether it handled the\n * key, so the caller can prevent the default.\n */\nexport function moveFocus(\n toolbar: HTMLElement,\n event: { key: string; target: EventTarget | null },\n orientation: \"horizontal\" | \"vertical\",\n): boolean {\n if (editsText(event.target)) {\n return false;\n }\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = orientation === \"vertical\" ? \"ArrowDown\" : rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const previous = orientation === \"vertical\" ? \"ArrowUp\" : rtl ? \"ArrowRight\" : \"ArrowLeft\";\n const list = items(toolbar);\n if (list.length === 0) {\n return false;\n }\n const index = list.indexOf(event.target as HTMLElement);\n let target: HTMLElement | undefined;\n switch (event.key) {\n case next:\n target = list[(index + 1) % list.length];\n break;\n case previous:\n target = list[(index - 1 + list.length) % list.length];\n break;\n case \"Home\":\n target = list[0];\n break;\n case \"End\":\n target = list[list.length - 1];\n break;\n default:\n return false;\n }\n if (target) {\n syncTabStop(toolbar, target);\n target.focus();\n }\n return true;\n}\n","import {\n type FocusEvent,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { moveFocus, syncTabStop } from \"./roving-focus.js\";\nimport { ToolbarContext } from \"./toolbar-context.js\";\n\n/**\n * Props of {@link Toolbar}.\n *\n * @public\n */\nexport interface ToolbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\">,\n StyleProps<\"root\"> {\n /** The toolbar's accessible name, such as \"Page tools\". Required. */\n readonly label: string;\n /** Defaults to `horizontal`. Arrow keys follow it. */\n readonly orientation?: \"horizontal\" | \"vertical\" | undefined;\n}\n\nfunction useMergedRef<T>(forwarded: React.ForwardedRef<T>) {\n const local = useRef<T | null>(null);\n const setRef = useCallback(\n (node: T | null) => {\n local.current = node;\n if (typeof forwarded === \"function\") {\n forwarded(node);\n } else if (forwarded) {\n forwarded.current = node;\n }\n },\n [forwarded],\n );\n return [local, setRef] as const;\n}\n\n/**\n * A toolbar (WAI-ARIA `toolbar`): one Tab stop, arrow keys between its items,\n * Home and End to the ends. Items are any focusable descendants, such as\n * `Button`, `IconButton` and `SegmentedControl`. Disabled items that should\n * stay discoverable use `focusableWhenDisabled`.\n *\n * @example\n * ```tsx\n * <Toolbar label={messages.t(\"toolbar.label\")}>\n * <ToolbarGroup label={messages.t(\"toolbar.history\")}>\n * <IconButton label={messages.t(\"toolbar.undo\")} icon={<UndoIcon />} />\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * </Toolbar>\n * ```\n *\n * @public\n */\nexport const Toolbar = /* @__PURE__ */ forwardRef<HTMLDivElement, ToolbarProps>(function Toolbar(\n {\n label,\n orientation = \"horizontal\",\n className,\n classNames,\n unstyled,\n onKeyDown,\n onFocus,\n children,\n ...props\n },\n forwardedRef,\n): ReactElement {\n const [ref, setRef] = useMergedRef(forwardedRef);\n\n // After hydration, and whenever items change, keep exactly one Tab stop.\n useEffect(() => {\n const toolbar = ref.current;\n if (!toolbar) {\n return;\n }\n syncTabStop(toolbar);\n const observer = new MutationObserver(() => syncTabStop(toolbar, document.activeElement));\n observer.observe(toolbar, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\"],\n });\n return () => observer.disconnect();\n }, [ref]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && ref.current && moveFocus(ref.current, event, orientation)) {\n event.preventDefault();\n }\n };\n\n // Clicking or programmatically focusing an item makes it the Tab stop.\n const handleFocus = (event: FocusEvent<HTMLDivElement>): void => {\n onFocus?.(event);\n if (ref.current && event.target !== ref.current) {\n syncTabStop(ref.current, event.target);\n }\n };\n\n return (\n <ToolbarContext.Provider value={{ orientation }}>\n <div\n {...props}\n ref={setRef}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={cx(\n \"hm-toolbar\",\n orientation === \"vertical\" && \"hm-toolbar--vertical\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n >\n {children}\n </div>\n </ToolbarContext.Provider>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link ToolbarGroup}.\n *\n * @public\n */\nexport interface ToolbarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, \"role\"> {\n /** The group's accessible name, such as \"Zoom\". Required. */\n readonly label: string;\n}\n\n/**\n * Related items in a toolbar, announced together as a named group. Arrow keys\n * move across groups as if they weren't there.\n *\n * @public\n */\nexport const ToolbarGroup = /* @__PURE__ */ forwardRef<HTMLDivElement, ToolbarGroupProps>(\n function ToolbarGroup({ label, className, ...props }, ref) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a fieldset brings form semantics and legend rendering a toolbar group shouldn't have.\n <div\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={cx(\"hm-toolbar-group\", className)}\n />\n );\n },\n);\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\nimport { useToolbar } from \"./toolbar-context.js\";\n\n/**\n * Props of {@link ToolbarSeparator}.\n *\n * @public\n */\nexport type ToolbarSeparatorProps = Omit<HTMLAttributes<HTMLHRElement>, \"children\">;\n\n/**\n * A line between toolbar items: a native `<hr>`, so it's a separator to\n * assistive technology. It isn't focusable, and is oriented across the\n * toolbar.\n *\n * @public\n */\nexport const ToolbarSeparator = /* @__PURE__ */ forwardRef<HTMLHRElement, ToolbarSeparatorProps>(\n function ToolbarSeparator({ className, ...props }, ref) {\n const toolbar = useToolbar();\n return (\n <hr\n {...props}\n ref={ref}\n aria-orientation={toolbar?.orientation === \"vertical\" ? \"horizontal\" : \"vertical\"}\n className={cx(\"hm-toolbar-separator\", className)}\n />\n );\n },\n);\n","import { type Platform, platformOf } from \"@hussmartinez/sdk-core\";\nimport { useSyncExternalStore } from \"react\";\n\n// The platform doesn't change while the page is open, so nothing to subscribe to.\nconst subscribe = (): (() => void) => () => undefined;\nconst onClient = (): Platform => platformOf(globalThis.navigator);\nconst onServer = (): Platform => \"other\";\n\n/**\n * The platform whose keyboard conventions apply, for shortcut labels and for\n * sdk-core's `createShortcutRegistry({ platform })`: `\"apple\"` on macOS, iOS\n * and iPadOS, where `Mod` is `Meta` (⌘), and `\"other\"` elsewhere, where it's\n * `Control`.\n *\n * A server can't know the platform, so the server render and hydration both\n * use `\"other\"`, and Apple devices switch to their keys in the render right\n * after hydration. That keeps hydration free of mismatches. Never read\n * `navigator` during render for this.\n *\n * @example\n * ```tsx\n * const platform = usePlatform();\n * const shortcuts = useMemo(() => createShortcutRegistry({ platform, tools }), [platform, tools]);\n * ```\n *\n * @public\n */\nexport function usePlatform(): Platform {\n return useSyncExternalStore(subscribe, onClient, onServer);\n}\n","import type { ShortcutPart } from \"@hussmartinez/sdk-core\";\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n type FocusEvent,\n forwardRef,\n isValidElement,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n version,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { usePlatform } from \"../../react/use-platform.js\";\nimport { joinIds } from \"../field/field-context.js\";\nimport { useUiMessages } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The parts of a tooltip that `classNames` can target.\n *\n * @public\n */\nexport type TooltipPart = \"root\" | \"content\" | \"shortcut\";\n\n/**\n * Props of {@link Tooltip}.\n *\n * @public\n */\nexport interface TooltipProps extends StyleProps<TooltipPart> {\n /** The text. Use text from your message catalogue. */\n readonly content: ReactNode;\n /**\n * How the text reaches assistive technology. `description`, the default,\n * describes the trigger (`aria-describedby`). `label` names it\n * (`aria-labelledby`): use it for an icon-only button whose tooltip says\n * what its label would, so screen readers don't hear it twice.\n */\n readonly type?: \"description\" | \"label\" | undefined;\n /**\n * The trigger's keyboard shortcut, as sdk-core's shortcut registry\n * describes it: `registry.describe(toolId)[0]`. The tooltip shows it in the\n * platform's notation, such as ⌘⇧Z or Ctrl+Shift+Z, and the trigger gets\n * `aria-keyshortcuts`.\n */\n readonly shortcut?: readonly ShortcutPart[] | undefined;\n /** Where it shows, when there's room: `top` (the default) or `bottom`. */\n readonly placement?: \"top\" | \"bottom\" | undefined;\n /** How long the pointer rests on the trigger before it shows, in milliseconds. Defaults to 500. */\n readonly delay?: number | undefined;\n /**\n * The trigger: one element that forwards its ref, such as `IconButton`.\n * A disabled trigger should use `focusableWhenDisabled`: a natively\n * disabled button gets neither focus nor pointer events, so its tooltip\n * can't show.\n */\n readonly children: ReactElement;\n}\n\n/** How long the pointer may take to move from the trigger onto the tooltip. */\nconst GRACE = 100;\n\n/** ARIA's name for a key in `aria-keyshortcuts`, which uses `KeyboardEvent.key` names. */\nconst ariaKey = (part: ShortcutPart): string => (part.value === \" \" ? \"Space\" : part.value);\n\n/** Places the tooltip next to its trigger, inside the viewport, on the side with room. */\nfunction place(trigger: HTMLElement, tooltip: HTMLElement, preferred: \"top\" | \"bottom\"): void {\n const anchor = trigger.getBoundingClientRect();\n const box = tooltip.getBoundingClientRect();\n const viewport = document.documentElement;\n const above = anchor.top;\n const below = viewport.clientHeight - anchor.bottom;\n const fits = (side: \"top\" | \"bottom\") => (side === \"top\" ? above : below) >= box.height;\n const other = preferred === \"top\" ? \"bottom\" : \"top\";\n const side = fits(preferred) || !fits(other) ? preferred : other;\n const left = Math.min(\n Math.max(anchor.left + anchor.width / 2 - box.width / 2, 0),\n Math.max(viewport.clientWidth - box.width, 0),\n );\n // Set through the CSSOM, which a strict Content Security Policy allows.\n tooltip.style.left = `${left}px`;\n tooltip.style.top = `${side === \"top\" ? anchor.top - box.height : anchor.bottom}px`;\n tooltip.dataset[\"hmPlacement\"] = side;\n}\n\n/** The trigger's own ref, where React keeps it in versions 18 and 19. */\nfunction refOf(element: ReactElement): Ref<HTMLElement> | undefined {\n if (version.startsWith(\"18\")) {\n return (element as { ref?: Ref<HTMLElement> }).ref;\n }\n return (element.props as { ref?: Ref<HTMLElement> }).ref;\n}\n\nfunction setRef<T>(ref: Ref<T> | undefined, value: T | null): void {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref) {\n (ref as { current: T | null }).current = value;\n }\n}\n\ntype TriggerProps = ComponentPropsWithRef<\"button\">;\n\n/**\n * A tooltip: short text about a control, shown while the pointer rests on it\n * or while it has keyboard focus (WAI-ARIA tooltip pattern, WCAG 1.4.13).\n *\n * - It shows after `delay` on hover, and at once on keyboard focus, never\n * on a mouse click's focus or on touch.\n * - The pointer can move onto it without it closing, and it stays until the\n * pointer and focus leave. Escape closes it without moving focus, and\n * doesn't close a surrounding dialog.\n * - **While it's open, the first Escape belongs to the tooltip.** It calls\n * `preventDefault()`, so an editor's own Escape action, such as cancelling\n * a crop, runs on the second press. sdk-core's shortcut registry already\n * skips handled events; a handler of your own should check\n * `event.defaultPrevented` too.\n * - It's in the top layer, through the Popover API, so no stacking context\n * can hide it, and it's placed above the trigger, or below when there's no\n * room, without a positioning library (docs/adr/0006).\n *\n * @example\n * ```tsx\n * <Tooltip type=\"label\" content={t(\"toolbar.undo\")} shortcut={shortcuts.describe(\"pdf.undo\")[0]}>\n * <IconButton label={t(\"toolbar.undo\")} icon={<UndoIcon />} onClick={undo} />\n * </Tooltip>\n * ```\n *\n * @public\n */\nexport const Tooltip = /* @__PURE__ */ forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(\n {\n content,\n type = \"description\",\n shortcut,\n placement = \"top\",\n delay = 500,\n className,\n classNames,\n unstyled,\n children,\n },\n ref,\n) {\n const id = useId();\n const contentId = `${id}-content`;\n const platform = usePlatform();\n const messages = useUiMessages();\n const [open, setOpen] = useState(false);\n const trigger = useRef<HTMLElement | null>(null);\n const tooltip = useRef<HTMLDivElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n // Escape keeps it closed until the pointer or focus leaves and comes back.\n const dismissed = useRef(false);\n\n const clear = (): void => {\n clearTimeout(timer.current);\n timer.current = undefined;\n };\n const show = useCallback((after: number): void => {\n clearTimeout(timer.current);\n if (dismissed.current) {\n return;\n }\n timer.current = setTimeout(() => setOpen(true), after);\n }, []);\n const hide = useCallback((after: number): void => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(false), after);\n }, []);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n const element = tooltip.current;\n if (!element || typeof element.showPopover !== \"function\") {\n return;\n }\n if (!open) {\n if (element.matches(\":popover-open\")) {\n element.hidePopover();\n }\n return;\n }\n element.showPopover();\n if (trigger.current) {\n place(trigger.current, element, placement);\n }\n const close = (): void => setOpen(false);\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n // Only the tooltip closes: a surrounding dialog stays open.\n event.preventDefault();\n dismissed.current = true;\n close();\n }\n };\n document.addEventListener(\"keydown\", onKeyDown, true);\n // A moved trigger would leave the tooltip behind, so scrolling closes it.\n window.addEventListener(\"scroll\", close, true);\n window.addEventListener(\"resize\", close);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown, true);\n window.removeEventListener(\"scroll\", close, true);\n window.removeEventListener(\"resize\", close);\n };\n }, [open, placement]);\n\n if (!isValidElement(children)) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\"Tooltip needs one element as its child, such as an IconButton.\");\n }\n return children;\n }\n\n const child = children as ReactElement<TriggerProps>;\n const own = child.props;\n const childRef = refOf(child);\n const keyshortcuts =\n shortcut && shortcut.length > 0 ? shortcut.map(ariaKey).join(\"+\") : own[\"aria-keyshortcuts\"];\n // Every catalogue includes sdkCoreMessages (sdk-core ADR 0019), which has\n // the keys.* messages a shortcut's parts name.\n const text = messages.t as unknown as (key: string) => string;\n\n const triggerProps: Partial<TriggerProps> = {\n ref: (node: HTMLButtonElement | null) => {\n trigger.current = node;\n setRef(childRef, node);\n },\n ...(type === \"label\"\n ? { \"aria-labelledby\": joinIds(contentId, own[\"aria-labelledby\"]) }\n : { \"aria-describedby\": joinIds(own[\"aria-describedby\"], contentId) }),\n \"aria-keyshortcuts\": keyshortcuts,\n onPointerEnter: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerEnter?.(event);\n if (event.pointerType !== \"touch\") {\n show(open ? 0 : delay);\n }\n },\n onPointerLeave: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerLeave?.(event);\n dismissed.current = false;\n hide(GRACE);\n },\n onPointerDown: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerDown?.(event);\n clear();\n setOpen(false);\n },\n onFocus: (event: FocusEvent<HTMLButtonElement>) => {\n own.onFocus?.(event);\n // Keyboard focus only: a click's focus would show it under the pointer.\n // At once, without a timer.\n if (event.currentTarget.matches(\":focus-visible\") && !dismissed.current) {\n clear();\n setOpen(true);\n }\n },\n onBlur: (event: FocusEvent<HTMLButtonElement>) => {\n own.onBlur?.(event);\n dismissed.current = false;\n clear();\n setOpen(false);\n },\n };\n\n return (\n <>\n {cloneElement(child, triggerProps)}\n <div\n ref={(node) => {\n tooltip.current = node;\n setRef(ref, node);\n }}\n id={id}\n role=\"tooltip\"\n popover=\"manual\"\n className={cx(\"hm-tooltip\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n // Hoverable (WCAG 1.4.13): moving onto the tooltip keeps it open.\n onPointerEnter={() => clear()}\n onPointerLeave={() => hide(GRACE)}\n >\n <span id={contentId} className={cx(\"hm-tooltip-content\", classNames?.content)}>\n {content}\n </span>\n {shortcut && shortcut.length > 0 ? (\n // Assistive technology gets it from aria-keyshortcuts on the trigger.\n <span className={cx(\"hm-tooltip-shortcut\", classNames?.shortcut)} aria-hidden=\"true\">\n {shortcut.map((part, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a chord's parts are static and ordered\n <span key={index}>\n {index > 0 && platform === \"other\" ? \"+\" : null}\n <kbd>{part.message ? text(part.message) : part.value}</kbd>\n </span>\n ))}\n </span>\n ) : null}\n </div>\n </>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link VisuallyHidden}.\n *\n * @public\n */\nexport interface VisuallyHiddenProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Defaults to `span`. */\n readonly as?: \"span\" | \"div\";\n}\n\n/**\n * Content for assistive technology only: hidden on screen, but read out and\n * part of the accessible name of its parent. It has no `unstyled` prop,\n * because hiding is its whole purpose.\n *\n * @public\n */\nexport const VisuallyHidden = /* @__PURE__ */ forwardRef<HTMLElement, VisuallyHiddenProps>(\n function VisuallyHidden({ as: Element = \"span\", className, ...props }, ref) {\n return (\n <Element {...props} ref={ref as never} className={cx(\"hm-visually-hidden\", className)} />\n );\n },\n);\n","import type { ReactElement, SVGProps } from \"react\";\nimport { cx } from \"../components/shared/style-props.js\";\n\n/**\n * The shapes an icon is drawn with: an element name and its geometry. The\n * generator only ever writes the shapes and attributes its allowlist accepts.\n */\nexport type IconNode = readonly (readonly [\n \"path\" | \"circle\" | \"rect\" | \"line\" | \"ellipse\" | \"polyline\" | \"polygon\",\n Readonly<Record<string, string>>,\n])[];\n\n/**\n * Props of every icon. SVG attributes are passed through.\n *\n * @public\n */\nexport interface IconProps\n extends Omit<SVGProps<SVGSVGElement>, \"children\" | \"dangerouslySetInnerHTML\" | \"ref\"> {\n /**\n * The accessible name, for an icon that means something on its own.\n * Without it, the icon is decorative and hidden from assistive\n * technology, as it should be inside a labelled button.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * An icon from ui's set, such as `UndoIcon`.\n *\n * @public\n */\nexport type IconComponent = (props: IconProps) => ReactElement;\n\n/**\n * Draws one icon. Each generated icon component calls it with its own name\n * and shapes; it's a plain function rather than a component factory, so every\n * icon is an ordinary module-level function that bundlers drop when unused.\n */\nexport function renderIcon(\n name: string,\n nodes: IconNode,\n mirror: boolean,\n { label, className, ...props }: IconProps,\n): ReactElement {\n return (\n <svg\n {...props}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cx(\"hm-icon\", className)}\n data-hm-icon={name}\n data-hm-mirror={mirror ? \"\" : undefined}\n focusable=\"false\"\n role={label === undefined ? undefined : \"img\"}\n aria-label={label}\n aria-hidden={label === undefined ? true : undefined}\n >\n {nodes.map(([Shape, attributes], index) => (\n // The shapes never change order, so their index is a stable key.\n // biome-ignore lint/suspicious/noArrayIndexKey: static, ordered shapes\n <Shape key={index} {...attributes} />\n ))}\n </svg>\n );\n}\n","/*! Icons from Lucide (https://lucide.dev), ISC licence; those derived from Feather, MIT licence. See THIRD_PARTY_NOTICES.md in @hussmartinez/ui. */\n// Generated by scripts/generate-icons.ts from lucide-static 1.72.0 and\n// src/icons/manifest.ts. Don't edit it: change the manifest and run\n// `pnpm --filter @hussmartinez/ui icons` (docs/adr/0005).\nimport type { ReactElement } from \"react\";\nimport { type IconProps, renderIcon } from \"./create-icon.js\";\n\n/**\n * The `add` icon: Lucide's `plus`.\n *\n * @public\n */\nexport function AddIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"add\",\n [\n [\"path\", { d: \"M5 12h14\" }],\n [\"path\", { d: \"M12 5v14\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `arrow` icon: Lucide's `move-up-right`.\n *\n * @public\n */\nexport function ArrowIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"arrow\",\n [\n [\"path\", { d: \"M13 5H19V11\" }],\n [\"path\", { d: \"M19 5L5 19\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `check` icon: Lucide's `check`.\n *\n * @public\n */\nexport function CheckIcon(props: IconProps): ReactElement {\n return renderIcon(\"check\", [[\"path\", { d: \"M20 6 9 17l-5-5\" }]], false, props);\n}\n\n/**\n * The `chevron-down` icon: Lucide's `chevron-down`.\n *\n * @public\n */\nexport function ChevronDownIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-down\", [[\"path\", { d: \"m6 9 6 6 6-6\" }]], false, props);\n}\n\n/**\n * The `chevron-left` icon: Lucide's `chevron-left`.\n *\n * @public\n */\nexport function ChevronLeftIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-left\", [[\"path\", { d: \"m15 18-6-6 6-6\" }]], false, props);\n}\n\n/**\n * The `chevron-right` icon: Lucide's `chevron-right`.\n *\n * @public\n */\nexport function ChevronRightIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-right\", [[\"path\", { d: \"m9 18 6-6-6-6\" }]], false, props);\n}\n\n/**\n * The `close` icon: Lucide's `x`.\n *\n * @public\n */\nexport function CloseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"close\",\n [\n [\"path\", { d: \"M18 6 6 18\" }],\n [\"path\", { d: \"m6 6 12 12\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `crop` icon: Lucide's `crop`.\n *\n * @public\n */\nexport function CropIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"crop\",\n [\n [\"path\", { d: \"M6 2v14a2 2 0 0 0 2 2h14\" }],\n [\"path\", { d: \"M18 22V8a2 2 0 0 0-2-2H2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `delete` icon: Lucide's `trash`.\n *\n * @public\n */\nexport function DeleteIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"delete\",\n [\n [\"path\", { d: \"M10 11v6\" }],\n [\"path\", { d: \"M14 11v6\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" }],\n [\"path\", { d: \"M3 6h18\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `download` icon: Lucide's `download`.\n *\n * @public\n */\nexport function DownloadIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"download\",\n [\n [\"path\", { d: \"M12 15V3\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" }],\n [\"path\", { d: \"m7 10 5 5 5-5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `duplicate` icon: Lucide's `copy`.\n *\n * @public\n */\nexport function DuplicateIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"duplicate\",\n [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `ellipse` icon: Lucide's `ellipse`.\n *\n * @public\n */\nexport function EllipseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"ellipse\",\n [[\"ellipse\", { cx: \"12\", cy: \"12\", rx: \"10\", ry: \"6\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `fade-in` icon: Lucide's `chart-no-axes-column-increasing`.\n *\n * @public\n */\nexport function FadeInIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fade-in\",\n [\n [\"path\", { d: \"M5 21v-6\" }],\n [\"path\", { d: \"M12 21V9\" }],\n [\"path\", { d: \"M19 21V3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `fade-out` icon: Lucide's `chart-no-axes-column-decreasing`.\n *\n * @public\n */\nexport function FadeOutIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fade-out\",\n [\n [\"path\", { d: \"M5 21V3\" }],\n [\"path\", { d: \"M12 21V9\" }],\n [\"path\", { d: \"M19 21v-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `fit` icon: Lucide's `scan`.\n *\n * @public\n */\nexport function FitIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fit\",\n [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `flip-horizontal` icon: Lucide's `triangles-centerline-dashed-vertical`.\n *\n * @public\n */\nexport function FlipHorizontalIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"flip-horizontal\",\n [\n [\"path\", { d: \"M12 14v2\" }],\n [\"path\", { d: \"M12 20v2\" }],\n [\"path\", { d: \"M12 2v2\" }],\n [\"path\", { d: \"M12 8v2\" }],\n [\n \"path\",\n {\n d: \"M20.288 16.703A1 1 0 0022 16V8a1 1 0 00-1.712-.703l-3.99 3.991a1 1 0 00-.001 1.424z\",\n },\n ],\n [\n \"path\",\n { d: \"M3.712 16.703A1 1 0 012 16V8a1 1 0 011.712-.703l3.99 3.991a1 1 0 01.001 1.424z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `flip-vertical` icon: Lucide's `triangles-centerline-dashed-horizontal`.\n *\n * @public\n */\nexport function FlipVerticalIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"flip-vertical\",\n [\n [\"path\", { d: \"M10 12H8\" }],\n [\"path\", { d: \"M16 12h-2\" }],\n [\"path\", { d: \"M22 12h-2\" }],\n [\"path\", { d: \"M4 12H2\" }],\n [\n \"path\",\n { d: \"M7.298 20.288A1 1 0 008 22h8a1 1 0 00.703-1.712l-3.991-3.99a1 1 0 00-1.424-.001z\" },\n ],\n [\n \"path\",\n { d: \"M7.298 3.712A1 1 0 018 2h8a1 1 0 01.703 1.712l-3.991 3.99a1 1 0 01-1.424.001z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `hidden` icon: Lucide's `eye-off`.\n *\n * @public\n */\nexport function HiddenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"hidden\",\n [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n },\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n },\n ],\n [\"path\", { d: \"m2 2 20 20\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `highlighter` icon: Lucide's `highlighter`.\n *\n * @public\n */\nexport function HighlighterIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"highlighter\",\n [\n [\"path\", { d: \"m9 11-6 6v3h9l3-3\" }],\n [\"path\", { d: \"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `info` icon: Lucide's `info`.\n *\n * @public\n */\nexport function InfoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"info\",\n [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\" }],\n [\"path\", { d: \"M12 16v-4\" }],\n [\"path\", { d: \"M12 8h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `layers` icon: Lucide's `layers`.\n *\n * @public\n */\nexport function LayersIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"layers\",\n [\n [\n \"path\",\n {\n d: \"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\",\n },\n ],\n [\"path\", { d: \"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" }],\n [\"path\", { d: \"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `loop` icon: Lucide's `repeat`.\n *\n * @public\n */\nexport function LoopIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"loop\",\n [\n [\"path\", { d: \"m17 2 4 4-4 4\" }],\n [\"path\", { d: \"M3 11v-1a4 4 0 0 1 4-4h14\" }],\n [\"path\", { d: \"m7 22-4-4 4-4\" }],\n [\"path\", { d: \"M21 13v1a4 4 0 0 1-4 4H3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `menu` icon: Lucide's `menu`.\n *\n * @public\n */\nexport function MenuIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"menu\",\n [\n [\"path\", { d: \"M4 5h16\" }],\n [\"path\", { d: \"M4 12h16\" }],\n [\"path\", { d: \"M4 19h16\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `more` icon: Lucide's `ellipsis`.\n *\n * @public\n */\nexport function MoreIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"more\",\n [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\" }],\n [\"circle\", { cx: \"19\", cy: \"12\", r: \"1\" }],\n [\"circle\", { cx: \"5\", cy: \"12\", r: \"1\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `move-down` icon: Lucide's `arrow-down`.\n *\n * @public\n */\nexport function MoveDownIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"move-down\",\n [\n [\"path\", { d: \"M12 5v14\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `move-up` icon: Lucide's `arrow-up`.\n *\n * @public\n */\nexport function MoveUpIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"move-up\",\n [\n [\"path\", { d: \"m5 12 7-7 7 7\" }],\n [\"path\", { d: \"M12 19V5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `muted` icon: Lucide's `volume-x`.\n *\n * @public\n */\nexport function MutedIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"muted\",\n [\n [\n \"path\",\n {\n d: \"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z\",\n },\n ],\n [\"path\", { d: \"m16.5 14.5 5-5\" }],\n [\"path\", { d: \"m16.5 9.5 5 5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `open` icon: Lucide's `folder-open`.\n *\n * @public\n */\nexport function OpenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"open\",\n [\n [\n \"path\",\n {\n d: \"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-add` icon: Lucide's `file-plus`.\n *\n * @public\n */\nexport function PageAddIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-add\",\n [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n },\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\" }],\n [\"path\", { d: \"M9 15h6\" }],\n [\"path\", { d: \"M12 18v-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-grid` icon: Lucide's `grid-2x2`.\n *\n * @public\n */\nexport function PageGridIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-grid\",\n [\n [\"path\", { d: \"M12 3v18\" }],\n [\"path\", { d: \"M3 12h18\" }],\n [\"rect\", { x: \"3\", y: \"3\", width: \"18\", height: \"18\", rx: \"2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-single` icon: Lucide's `file`.\n *\n * @public\n */\nexport function PageSingleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-single\",\n [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n },\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pan` icon: Lucide's `hand`.\n *\n * @public\n */\nexport function PanIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pan\",\n [\n [\"path\", { d: \"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2\" }],\n [\"path\", { d: \"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2\" }],\n [\"path\", { d: \"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8\" }],\n [\n \"path\",\n {\n d: \"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pause` icon: Lucide's `pause`.\n *\n * @public\n */\nexport function PauseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pause\",\n [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pen` icon: Lucide's `pen`.\n *\n * @public\n */\nexport function PenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pen\",\n [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `play` icon: Lucide's `play`.\n *\n * @public\n */\nexport function PlayIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"play\",\n [\n [\n \"path\",\n { d: \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `rectangle` icon: Lucide's `rectangle-horizontal`.\n *\n * @public\n */\nexport function RectangleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rectangle\",\n [[\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `redact` icon: Lucide's `rectangle-ellipsis`.\n *\n * @public\n */\nexport function RedactIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"redact\",\n [\n [\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\" }],\n [\"path\", { d: \"M12 12h.01\" }],\n [\"path\", { d: \"M17 12h.01\" }],\n [\"path\", { d: \"M7 12h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `redo` icon: Lucide's `redo-2`, mirrored in right-to-left text.\n *\n * @public\n */\nexport function RedoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"redo\",\n [\n [\"path\", { d: \"m15 14 5-5-5-5\" }],\n [\"path\", { d: \"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13\" }],\n ],\n true,\n props,\n );\n}\n\n/**\n * The `remove` icon: Lucide's `minus`.\n *\n * @public\n */\nexport function RemoveIcon(props: IconProps): ReactElement {\n return renderIcon(\"remove\", [[\"path\", { d: \"M5 12h14\" }]], false, props);\n}\n\n/**\n * The `rotate-left` icon: Lucide's `rotate-ccw`.\n *\n * @public\n */\nexport function RotateLeftIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rotate-left\",\n [\n [\"path\", { d: \"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" }],\n [\"path\", { d: \"M3 3v5h5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `rotate-right` icon: Lucide's `rotate-cw`.\n *\n * @public\n */\nexport function RotateRightIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rotate-right\",\n [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" }],\n [\"path\", { d: \"M21 3v5h-5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `search` icon: Lucide's `search`.\n *\n * @public\n */\nexport function SearchIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"search\",\n [\n [\"path\", { d: \"m21 21-4.34-4.34\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `select` icon: Lucide's `mouse-pointer-2`.\n *\n * @public\n */\nexport function SelectIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"select\",\n [\n [\n \"path\",\n {\n d: \"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `skip-back` icon: Lucide's `skip-back`.\n *\n * @public\n */\nexport function SkipBackIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"skip-back\",\n [\n [\n \"path\",\n {\n d: \"M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z\",\n },\n ],\n [\"path\", { d: \"M3 20V4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `skip-forward` icon: Lucide's `skip-forward`.\n *\n * @public\n */\nexport function SkipForwardIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"skip-forward\",\n [\n [\"path\", { d: \"M21 4v16\" }],\n [\n \"path\",\n {\n d: \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `snap` icon: Lucide's `magnet`.\n *\n * @public\n */\nexport function SnapIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"snap\",\n [\n [\"path\", { d: \"m12 15 4 4\" }],\n [\n \"path\",\n {\n d: \"M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z\",\n },\n ],\n [\"path\", { d: \"m5 8 4 4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `split` icon: Lucide's `scissors`.\n *\n * @public\n */\nexport function SplitIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"split\",\n [\n [\"circle\", { cx: \"6\", cy: \"6\", r: \"3\" }],\n [\"path\", { d: \"M8.12 8.12 12 12\" }],\n [\"path\", { d: \"M20 4 8.12 15.88\" }],\n [\"circle\", { cx: \"6\", cy: \"18\", r: \"3\" }],\n [\"path\", { d: \"M14.8 14.8 20 20\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `stop` icon: Lucide's `square`.\n *\n * @public\n */\nexport function StopIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"stop\",\n [[\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `text` icon: Lucide's `type`.\n *\n * @public\n */\nexport function TextIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"text\",\n [\n [\"path\", { d: \"M12 4v16\" }],\n [\"path\", { d: \"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" }],\n [\"path\", { d: \"M9 20h6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `trim-end` icon: Lucide's `arrow-left-from-line`.\n *\n * @public\n */\nexport function TrimEndIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"trim-end\",\n [\n [\"path\", { d: \"m9 6-6 6 6 6\" }],\n [\"path\", { d: \"M3 12h14\" }],\n [\"path\", { d: \"M21 19V5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `trim-start` icon: Lucide's `arrow-right-from-line`.\n *\n * @public\n */\nexport function TrimStartIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"trim-start\",\n [\n [\"path\", { d: \"M3 5v14\" }],\n [\"path\", { d: \"M21 12H7\" }],\n [\"path\", { d: \"m15 18 6-6-6-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `undo` icon: Lucide's `undo-2`, mirrored in right-to-left text.\n *\n * @public\n */\nexport function UndoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"undo\",\n [\n [\"path\", { d: \"M9 14 4 9l5-5\" }],\n [\"path\", { d: \"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" }],\n ],\n true,\n props,\n );\n}\n\n/**\n * The `upload` icon: Lucide's `upload`.\n *\n * @public\n */\nexport function UploadIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"upload\",\n [\n [\"path\", { d: \"M12 3v12\" }],\n [\"path\", { d: \"m17 8-5-5-5 5\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `visible` icon: Lucide's `eye`.\n *\n * @public\n */\nexport function VisibleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"visible\",\n [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `volume` icon: Lucide's `volume-2`.\n *\n * @public\n */\nexport function VolumeIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"volume\",\n [\n [\n \"path\",\n {\n d: \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\",\n },\n ],\n [\"path\", { d: \"M16 9a5 5 0 0 1 0 6\" }],\n [\"path\", { d: \"M19.364 18.364a9 9 0 0 0 0-12.728\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `warning` icon: Lucide's `triangle-exclamation-point`.\n *\n * @public\n */\nexport function WarningIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"warning\",\n [\n [\"path\", { d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" }],\n [\"path\", { d: \"M12 9v4\" }],\n [\"path\", { d: \"M12 17h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `zoom-in` icon: Lucide's `zoom-in`.\n *\n * @public\n */\nexport function ZoomInIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"zoom-in\",\n [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\" }],\n [\"line\", { x1: \"11\", x2: \"11\", y1: \"8\", y2: \"14\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `zoom-out` icon: Lucide's `zoom-out`.\n *\n * @public\n */\nexport function ZoomOutIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"zoom-out\",\n [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\" }],\n ],\n false,\n props,\n );\n}\n","import type { ReactElement, ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { UiError } from \"../errors/ui-error.js\";\nimport { checkSingleCopy } from \"../internal/single-copy.js\";\nimport { isThemePair } from \"../theme/pair.js\";\nimport { cssWriterOf } from \"../theme/registry.js\";\nimport type { ColorMode, Density, Theme, ThemePair } from \"../theme/types.js\";\n\n/**\n * Props of {@link ThemeProvider} shared by every form.\n *\n * @public\n */\nexport interface ThemeProviderBaseProps {\n /** Density of everything inside. Inherited from above when omitted. */\n readonly density?: Density;\n /**\n * The nonce of a Content Security Policy whose `style-src` allows it.\n * Only needed with a custom theme, which renders a `<style>` element.\n */\n readonly nonce?: string;\n readonly children?: ReactNode;\n}\n\n/**\n * The built-in themes, or a custom light and dark pair, with a colour mode.\n *\n * @public\n */\nexport interface ThemeProviderModeProps extends ThemeProviderBaseProps {\n /** A custom `{ light, dark }` pair. The built-in themes when omitted. */\n readonly theme?: ThemePair;\n /** Light, dark, or follow the operating system. Defaults to `\"system\"`. */\n readonly mode?: ColorMode;\n}\n\n/**\n * A single custom theme, which has one colour scheme, so there's no mode.\n *\n * @public\n */\nexport interface ThemeProviderSingleProps extends ThemeProviderBaseProps {\n readonly theme: Theme;\n readonly mode?: undefined;\n}\n\n/**\n * Props of {@link ThemeProvider}.\n *\n * @public\n */\nexport type ThemeProviderProps = ThemeProviderModeProps | ThemeProviderSingleProps;\n\n/** Generated CSS by theme, then by selector. Themes are frozen, so this can't go stale. */\nconst cssCache = new WeakMap<Theme | ThemePair, Map<string, string>>();\n\nfunction cachedCss(theme: Theme | ThemePair, selector: string): string {\n let bySelector = cssCache.get(theme);\n if (!bySelector) {\n bySelector = new Map();\n cssCache.set(theme, bySelector);\n }\n let css = bySelector.get(selector);\n if (css === undefined) {\n // Themes from createTheme carry their CSS writer, so this component never\n // imports the validator: applications using only the built-in themes\n // don't ship it.\n const [light, dark] = isThemePair(theme) ? [theme.light, theme.dark] : [theme, undefined];\n const write = cssWriterOf(light);\n if (!write || (dark !== undefined && !cssWriterOf(dark))) {\n throw new UiError(\"INVALID_THEME_TOKEN\", \"ThemeProvider takes themes from createTheme.\", {\n details: { token: \"theme\", value: \"\", reason: \"pass themes created with createTheme\" },\n });\n }\n css = write(light, dark, selector);\n bySelector.set(selector, css);\n }\n return css;\n}\n\n/**\n * Applies a theme, colour mode and density to everything inside it, with CSS\n * custom properties only: no runtime styling library and no context reads in\n * components (ADR 0006).\n *\n * It renders a wrapper with `display: contents`, so it doesn't affect layout.\n * A custom theme is written as a `<style>` element, rendered on the server\n * with the rest of the page, and `system` mode is pure CSS, so nothing\n * flashes before hydration (ADR 0007). Pass a stable theme object, such as\n * one created at module level, so its CSS is generated once.\n *\n * Under a Content Security Policy, a custom theme needs a `style-src` nonce\n * source and the `nonce` prop. Without a nonce, use `themeToCss` at build\n * time instead. The built-in themes need no inline styles.\n *\n * @example\n * ```tsx\n * <ThemeProvider theme={{ light: brandLight, dark: brandDark }} mode=\"system\" density=\"compact\">\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @public\n */\nexport function ThemeProvider(props: ThemeProviderProps): ReactElement {\n checkSingleCopy();\n const { theme, mode, density, nonce, children } = props;\n // useId keeps server and client markup identical. Its characters vary\n // between React versions, so only selector-safe ones are kept.\n const scopeId = `hm${useId().replace(/[^A-Za-z0-9_-]/g, \"-\")}`;\n const single = theme !== undefined && !isThemePair(theme);\n const css =\n theme === undefined ? undefined : cachedCss(theme, `[data-hm-theme-scope=\"${scopeId}\"]`);\n return (\n <div\n data-hm-theme-scope={scopeId}\n data-hm-theme={single ? undefined : (mode ?? \"system\")}\n data-hm-density={density}\n >\n {css === undefined ? null : (\n <style\n nonce={nonce}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: the CSS comes from themeToCss, which allowlists every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QACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"react.js","names":["_Fragment","CloseIcon","useMergedRef","CloseIcon","_Fragment","syncTabStop","editsText","focusableItems","snap","snap","snapTo","_Fragment","syncTabStop","_Fragment"],"sources":["../src/internal/single-copy.ts","../src/components/announcer/Announcer.tsx","../src/components/shared/style-props.ts","../src/components/button/Button.tsx","../src/components/button/IconButton.tsx","../src/components/field/field-context.ts","../src/components/messages/UiMessagesProvider.tsx","../src/components/color-field/ColorField.tsx","../src/components/dialog/CloseIcon.tsx","../src/components/dialog/Dialog.tsx","../src/components/field/Field.tsx","../src/components/file-drop-zone/FileDropZone.tsx","../src/components/shared/number.ts","../src/components/number-field/NumberField.tsx","../src/components/progress-bar/ProgressBar.tsx","../src/components/toolbar/roving-focus.ts","../src/components/reorderable-list/ReorderableList.tsx","../src/components/toolbar/toolbar-context.ts","../src/components/segmented-control/SegmentedControl.tsx","../src/components/slider/Slider.tsx","../src/components/spinner/Spinner.tsx","../src/components/text-area/TextArea.tsx","../src/components/text-field/TextField.tsx","../src/components/timeline/Timeline.tsx","../src/components/timeline/TimelineClips.tsx","../src/components/timeline/TimelinePlayhead.tsx","../src/components/toggle-button/ToggleButton.tsx","../src/components/toolbar/Toolbar.tsx","../src/components/toolbar/ToolbarGroup.tsx","../src/components/toolbar/ToolbarSeparator.tsx","../src/react/use-platform.ts","../src/components/tooltip/Tooltip.tsx","../src/components/visually-hidden/VisuallyHidden.tsx","../src/icons/create-icon.tsx","../src/icons/icons.generated.tsx","../src/react/ThemeProvider.tsx"],"sourcesContent":["import { warnInDevelopment } from \"./development.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * ui's version, written in by the library build. Pipelines that compile the\n * source themselves, such as the catalogue and the tests, may leave it out.\n */\ndeclare const __HM_UI_VERSION__: string | undefined;\n\n/** Where every copy of ui on the page registers itself, shared across copies. */\nconst REGISTRY = /* @__PURE__ */ Symbol.for(\"@hussmartinez/ui\");\n\n/** This copy's identity: two installs of the same version are still two copies. */\nconst THIS_COPY = {};\n\nlet checked = false;\n\n/** This copy's version, or a placeholder where the build didn't write it in. */\nfunction ownVersion(): string {\n return typeof __HM_UI_VERSION__ === \"string\" ? __HM_UI_VERSION__ : \"an unknown version\";\n}\n\n/**\n * Warns once, in development, when a second copy of ui is used on the page\n * (ADR 0036, in sdk-core). Each copy's context is its own, so a provider from\n * one copy doesn't reach components from another: they fall back to English,\n * and announcements go nowhere.\n *\n * Called on first use by ui's providers and context hooks, never on import,\n * so importing ui stays free of side effects. It does nothing in production.\n */\nexport function checkSingleCopy(): void {\n // Inline, so production bundles drop the whole check.\n if (checked || !(typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\")) {\n return;\n }\n checked = true;\n const global = globalThis as { [REGISTRY]?: Map<object, string> };\n const copies = global[REGISTRY] ?? new Map<object, string>();\n global[REGISTRY] = copies;\n copies.set(THIS_COPY, ownVersion());\n if (copies.size > 1) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n `${copies.size} copies of @hussmartinez/ui are in use (${[...copies.values()].join(\", \")}). Providers from one copy don't reach components from another, so text falls back to English and announcements are lost. Install a single version: \\`npm ls @hussmartinez/ui\\` shows where each comes from, and every SDK and your application should use the same minor version.`,\n );\n }\n }\n}\n","import {\n createContext,\n type ReactElement,\n type ReactNode,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * How urgently a message interrupts: `polite` waits for the screen reader to\n * finish, `assertive` interrupts. Use `assertive` only for errors the user\n * must act on.\n *\n * @public\n */\nexport type Politeness = \"polite\" | \"assertive\";\n\n/**\n * Announces a message to screen readers, such as \"Saved 1.3 MB\" (ADR 0014).\n * The message is plain text from your message catalogue.\n *\n * @public\n */\nexport type Announce = (message: string, options?: { politeness?: Politeness }) => void;\n\nconst AnnouncerContext = /* @__PURE__ */ createContext<Announce | undefined>(undefined);\n\n/**\n * Props of {@link AnnouncerProvider}.\n *\n * @public\n */\nexport interface AnnouncerProviderProps {\n readonly children?: ReactNode;\n}\n\n/** One live region's text, and a counter so the same message is announced again. */\ninterface Region {\n readonly message: string;\n readonly count: number;\n}\n\n/**\n * Renders a polite and an assertive `aria-live` region, visually hidden, and\n * lets everything inside announce through {@link useAnnounce}. The regions are\n * in the server-rendered page from the start, as screen readers only announce\n * changes to regions that already exist. Render it once, near the root of an\n * editor or application.\n *\n * @public\n */\nexport function AnnouncerProvider({ children }: AnnouncerProviderProps): ReactElement {\n checkSingleCopy();\n const [polite, setPolite] = useState<Region>({ message: \"\", count: 0 });\n const [assertive, setAssertive] = useState<Region>({ message: \"\", count: 0 });\n // One pending frame per region, so announcing in one region never cancels\n // the other's message.\n const frames = useRef<Partial<Record<Politeness, number>>>({});\n\n useEffect(\n () => () => {\n for (const frame of Object.values(frames.current)) {\n cancelAnimationFrame(frame);\n }\n },\n [],\n );\n\n const announce = useCallback<Announce>((message, options) => {\n const politeness = options?.politeness ?? \"polite\";\n const set = politeness === \"assertive\" ? setAssertive : setPolite;\n // Empty the region first, then fill it on the next frame, so a message\n // that repeats the previous one is still a change, and announced again.\n set((region) => ({ message: \"\", count: region.count }));\n // At most one frame is pending per region, so unmounting can cancel it.\n const pending = frames.current[politeness];\n if (pending !== undefined) {\n cancelAnimationFrame(pending);\n }\n frames.current[politeness] = requestAnimationFrame(() => {\n delete frames.current[politeness];\n set((region) => ({ message, count: region.count + 1 }));\n });\n }, []);\n\n return (\n <AnnouncerContext.Provider value={announce}>\n {children}\n <div className=\"hm-visually-hidden hm-announcer\">\n <div role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {polite.message}\n </div>\n <div role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\n {assertive.message}\n </div>\n </div>\n </AnnouncerContext.Provider>\n );\n}\n\nfunction missingProvider(): void {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"useAnnounce needs an AnnouncerProvider above it; the message wasn't announced.\",\n );\n }\n}\n\n/**\n * The `announce` function of the closest {@link AnnouncerProvider}. Without\n * one, announcing does nothing and warns in development.\n *\n * @example\n * ```tsx\n * const announce = useAnnounce();\n * announce(messages.t(\"result.saved\", { size }));\n * ```\n *\n * @public\n */\nexport function useAnnounce(): Announce {\n checkSingleCopy();\n return useContext(AnnouncerContext) ?? missingProvider;\n}\n","/**\n * Extra classes for a component's named parts.\n *\n * @public\n */\nexport type ClassNames<Part extends string> = { readonly [Name in Part]?: string };\n\n/**\n * Styling props every component takes (STANDARDS: React API).\n *\n * @public\n */\nexport interface StyleProps<Part extends string> {\n /** Extra classes on the root element. */\n readonly className?: string | undefined;\n /** Extra classes on each named part. */\n readonly classNames?: ClassNames<Part> | undefined;\n /**\n * Drops the visual styles (colours, borders, typography, motion) and keeps\n * layout, focus indication and target sizes, so the component stays\n * accessible while you style it yourself.\n */\n readonly unstyled?: boolean | undefined;\n}\n\n/** Joins class names, skipping empty ones. */\nexport function cx(...values: (string | false | null | undefined)[]): string | undefined {\n const joined = values.filter(Boolean).join(\" \");\n return joined === \"\" ? undefined : joined;\n}\n\n/** The attribute that turns a component's visual rules off. */\nexport function unstyledAttribute(unstyled: boolean | undefined): \"\" | undefined {\n return unstyled ? \"\" : undefined;\n}\n","import { type ButtonHTMLAttributes, forwardRef, type MouseEvent, type ReactNode } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * How prominent a button is: `primary` for the main action, `secondary`\n * (the default) for others, `quiet` for toolbars and dense places, `danger`\n * for destructive actions.\n *\n * @public\n */\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"quiet\" | \"danger\";\n\n/**\n * Button sizes. Both meet the 24 px target size, and 44 px on coarse\n * pointers (ADR 0014).\n *\n * @public\n */\nexport type ButtonSize = \"medium\" | \"small\";\n\n/**\n * The parts of a button that `classNames` can target.\n *\n * @public\n */\nexport type ButtonPart = \"root\" | \"icon\" | \"label\";\n\n/**\n * Props of {@link Button}. Native button props are passed through.\n *\n * @public\n */\nexport interface ButtonProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"className\">,\n StyleProps<ButtonPart> {\n /** Defaults to `secondary`. */\n readonly variant?: ButtonVariant | undefined;\n /** Defaults to `medium`. */\n readonly size?: ButtonSize | undefined;\n /** Makes it a toggle button, on or off, exposed as `aria-pressed`. */\n readonly pressed?: boolean | undefined;\n /** An icon before the label. It's decorative, and draws with `currentColor`. */\n readonly startIcon?: ReactNode;\n /** An icon after the label. */\n readonly endIcon?: ReactNode;\n /**\n * Keeps a disabled button focusable, with `aria-disabled` instead of the\n * `disabled` attribute, so it stays in a toolbar's keyboard order and\n * screen readers can find it. Clicks are ignored.\n */\n readonly focusableWhenDisabled?: boolean | undefined;\n}\n\nfunction Icon({ children, className }: { children: ReactNode; className: string | undefined }) {\n return (\n <span className={cx(\"hm-button-icon\", className)} aria-hidden=\"true\">\n {children}\n </span>\n );\n}\n\n/**\n * A button: a native `<button>`, `type=\"button\"` unless you say otherwise.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" startIcon={<DownloadIcon />} onClick={save}>\n * {messages.t(\"toolbar.download\")}\n * </Button>\n * ```\n *\n * @public\n */\nexport const Button = /* @__PURE__ */ forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = \"secondary\",\n size = \"medium\",\n pressed,\n startIcon,\n endIcon,\n focusableWhenDisabled,\n disabled,\n className,\n classNames,\n unstyled,\n type = \"button\",\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const softDisabled = Boolean(focusableWhenDisabled && disabled);\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n if (softDisabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n };\n return (\n <button\n {...props}\n ref={ref}\n type={type}\n className={cx(\n \"hm-button\",\n `hm-button--${variant}`,\n size === \"small\" && \"hm-button--small\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n aria-pressed={pressed}\n disabled={softDisabled ? undefined : disabled}\n aria-disabled={softDisabled ? true : props[\"aria-disabled\"]}\n onClick={handleClick}\n >\n {startIcon == null ? null : <Icon className={classNames?.icon}>{startIcon}</Icon>}\n {children == null ? null : (\n <span className={cx(\"hm-button-label\", classNames?.label)}>{children}</span>\n )}\n {endIcon == null ? null : <Icon className={classNames?.icon}>{endIcon}</Icon>}\n </button>\n );\n});\n","import { forwardRef, type ReactNode } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { type ClassNames, cx } from \"../shared/style-props.js\";\nimport { Button, type ButtonProps } from \"./Button.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link IconButton}.\n *\n * @public\n */\nexport interface IconButtonProps\n extends Omit<ButtonProps, \"startIcon\" | \"endIcon\" | \"children\" | \"classNames\"> {\n /** The accessible name. Required, because the button shows no text. */\n readonly label: string;\n /** The icon. It draws with `currentColor`. */\n readonly icon: ReactNode;\n /** Extra classes on the root and the icon. */\n readonly classNames?: ClassNames<\"root\" | \"icon\"> | undefined;\n}\n\n/**\n * A square button with only an icon. `label` is its accessible name, so it\n * can't be left out.\n *\n * @example\n * ```tsx\n * <IconButton label={messages.t(\"toolbar.rotate\")} icon={<RotateIcon />} onClick={rotate} />\n * ```\n *\n * @public\n */\nexport const IconButton = /* @__PURE__ */ forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton({ label, icon, className, ...props }, ref) {\n if (label.trim() === \"\") {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"IconButton needs a label: it's the button's only accessible name. Pass text from your message catalogue.\",\n );\n }\n }\n return (\n <Button\n {...props}\n ref={ref}\n aria-label={label}\n className={cx(\"hm-icon-button\", className)}\n startIcon={icon}\n />\n );\n },\n);\n","import { createContext, useContext } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The props a {@link Field} gives its control, so the label, description\n * and error reach assistive technology.\n *\n * @public\n */\nexport interface FieldControlProps {\n /** The control's `id`, which the label points at. */\n readonly id: string;\n /** The ids of the description and the error, when there are any. */\n readonly \"aria-describedby\": string | undefined;\n /** `true` while the field shows an error. */\n readonly \"aria-invalid\": true | undefined;\n}\n\nexport const FieldContext = /* @__PURE__ */ createContext<FieldControlProps | undefined>(undefined);\n\n/**\n * The id of the enclosing field's label, for a control that names more than\n * one element from it, such as ColorField's swatch group. It's apart from\n * {@link FieldControlProps}, which hosts spread onto a native control.\n */\nexport const FieldLabelContext = /* @__PURE__ */ createContext<string | undefined>(undefined);\n\n/** The enclosing field's label id, or `undefined` outside a field. */\nexport function useFieldLabelId(): string | undefined {\n return useContext(FieldLabelContext);\n}\n\n/** The enclosing field's control props, or `undefined` outside a field. */\nexport function useFieldControl(): FieldControlProps | undefined {\n checkSingleCopy();\n return useContext(FieldContext);\n}\n\n/** Joins `aria-describedby` id lists, skipping empty ones. */\nexport function joinIds(...ids: (string | undefined)[]): string | undefined {\n const joined = ids.filter(Boolean).join(\" \");\n return joined === \"\" ? undefined : joined;\n}\n\n/** The props a control already has that a field adds to. */\ninterface OwnControlProps {\n readonly id?: string | undefined;\n readonly \"aria-describedby\"?: string | undefined;\n readonly \"aria-invalid\"?: boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\" | undefined;\n}\n\n/**\n * Merges the enclosing field's props into a control's own: the field's id\n * unless the control has one, both description lists, and the field's\n * invalid state unless the control sets its own. Inside a field, it warns in\n * development about a control's own `label` or `aria-label`, and its own id.\n */\nexport function useFieldProps(\n own: OwnControlProps & { readonly \"aria-label\"?: string | undefined },\n label?: string,\n): OwnControlProps {\n const field = useFieldControl();\n if (!field) {\n return {\n id: own.id,\n \"aria-describedby\": own[\"aria-describedby\"],\n \"aria-invalid\": own[\"aria-invalid\"],\n };\n }\n // An aria-label replaces the visible label's text as the name, which\n // breaks WCAG 2.5.3, Label in Name, when the two differ.\n if (label !== undefined || own[\"aria-label\"] !== undefined) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"A control inside Field has its own label or aria-label, which replaces the field's visible label for screen readers. Leave it out, and set Field's label instead.\",\n );\n }\n }\n if (own.id !== undefined && own.id !== field.id) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"A control inside Field has its own id, so the field's label doesn't point at it. Pass the id to Field's controlId instead.\",\n );\n }\n }\n return {\n id: own.id ?? field.id,\n \"aria-describedby\": joinIds(field[\"aria-describedby\"], own[\"aria-describedby\"]),\n \"aria-invalid\": own[\"aria-invalid\"] ?? field[\"aria-invalid\"],\n };\n}\n","import { createMessages, type Messages, sdkCoreMessages } from \"@hussmartinez/sdk-core\";\nimport { createContext, type ReactElement, type ReactNode, useContext } from \"react\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\nimport { uiMessages } from \"../../messages/en.js\";\n\n/**\n * Messages that include `ui`'s text: any sdk-core `Messages` object whose\n * catalogue spreads `uiMessages`.\n *\n * @public\n */\nexport type UiMessages = Messages<typeof uiMessages>;\n\nconst UiMessagesContext = /* @__PURE__ */ createContext<UiMessages | undefined>(undefined);\n\nlet english: UiMessages | undefined;\n\n/** English text, created on first use so importing this module does nothing. */\nfunction defaultMessages(): UiMessages {\n english ??= createMessages({ ...sdkCoreMessages, ...uiMessages });\n return english;\n}\n\n/**\n * Props of {@link UiMessagesProvider}.\n *\n * @public\n */\nexport interface UiMessagesProviderProps {\n /** Your catalogue's messages, created with sdk-core's `createMessages`. */\n readonly messages: UiMessages;\n readonly children?: ReactNode;\n}\n\n/**\n * Gives `ui`'s components their text (ADR 0014). SDKs and applications pass\n * their message catalogue once, here; a component's own text props still win.\n * Without a provider, components use English.\n *\n * @example\n * ```tsx\n * const messages = createMessages({ ...sdkCoreMessages, ...uiMessages, ...en }, { locale });\n * <UiMessagesProvider messages={messages}>{editor}</UiMessagesProvider>\n * ```\n *\n * @public\n */\nexport function UiMessagesProvider({ messages, children }: UiMessagesProviderProps): ReactElement {\n checkSingleCopy();\n return <UiMessagesContext.Provider value={messages}>{children}</UiMessagesContext.Provider>;\n}\n\n/**\n * The messages from the closest {@link UiMessagesProvider}, or English.\n *\n * @public\n */\nexport function useUiMessages(): UiMessages {\n checkSingleCopy();\n return useContext(UiMessagesContext) ?? defaultMessages();\n}\n\n/** Keys of `uiMessages` whose English text has no placeholders. */\ntype PlainMessageKey = {\n [Key in keyof typeof uiMessages]: (typeof uiMessages)[Key] extends `${string}{${string}`\n ? never\n : Key;\n}[keyof typeof uiMessages];\n\n/**\n * A component's text for a message without placeholders: from the closest\n * {@link UiMessagesProvider}, or the English text as it is. Unlike\n * {@link useUiMessages}, it doesn't create a messages object when there's no\n * provider, so components using only English don't ship the formatter.\n */\nexport function useUiText(key: PlainMessageKey): string {\n checkSingleCopy();\n const messages = useContext(UiMessagesContext);\n return messages ? messages.t(key) : uiMessages[key];\n}\n\n/**\n * The locale of the enclosing `UiMessagesProvider`, or `\"en\"` without one.\n * It doesn't create the default messages, so components that only need the\n * locale don't ship them.\n */\nexport function useUiLocale(): string {\n checkSingleCopy();\n return useContext(UiMessagesContext)?.locale ?? \"en\";\n}\n","import {\n type ChangeEvent,\n type FocusEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useId,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldLabelId, useFieldProps } from \"../field/field-context.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * A colour a {@link ColorField} offers as a swatch.\n *\n * @public\n */\nexport interface ColorSwatch {\n /** The colour, as `#rrggbb` or `#rgb`. */\n readonly value: string;\n /** The swatch's accessible name, such as \"Red\". Use text from your message catalogue. */\n readonly label: string;\n}\n\n/**\n * The parts of a colour field that `classNames` can target.\n *\n * @public\n */\nexport type ColorFieldPart = \"root\" | \"control\" | \"preview\" | \"input\" | \"swatches\" | \"swatch\";\n\n/**\n * Props of {@link ColorField}. Other props go to the hex input.\n *\n * @public\n */\nexport interface ColorFieldProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"className\" | \"type\" | \"value\" | \"defaultValue\" | \"onChange\"\n >,\n StyleProps<ColorFieldPart> {\n /** The colour, as `#rrggbb`. With it, the field is controlled. */\n readonly value?: string | undefined;\n /** The first colour of an uncontrolled field. Defaults to `#000000`. */\n readonly defaultValue?: string | undefined;\n /** Called with the new colour, always as lowercase `#rrggbb`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /** Colours to pick from, shown under the input. Leave it out for the input alone. */\n readonly swatches?: readonly ColorSwatch[] | undefined;\n /**\n * The accessible name, such as \"Fill\". Leave it out inside a `Field`, or\n * when a visible `<label>` points at the field's `id`.\n */\n readonly label?: string | undefined;\n /** The word that follows the label in the swatch group's name. Defaults to \"swatches\". */\n readonly swatchesLabel?: string | undefined;\n}\n\nconst HEX = /^#?(?:([0-9a-f]{3})|([0-9a-f]{6}))$/i;\n\n/**\n * A colour as lowercase `#rrggbb`, from `#rrggbb`, `#rgb` or either without\n * the `#`; `undefined` for anything else. Its result is the only text that\n * reaches an SVG `fill`.\n */\nfunction parseHex(text: string): string | undefined {\n const match = HEX.exec(text.trim());\n if (!match) {\n return undefined;\n }\n const digits = match[2] ?? (match[1] as string).replace(/./g, \"$&$&\");\n return `#${digits.toLowerCase()}`;\n}\n\n/** A square of one colour, drawn with an SVG fill, which needs no inline style. */\nfunction Fill({ color, className }: { color: string; className: string | undefined }) {\n return (\n <svg\n className={className}\n viewBox=\"0 0 1 1\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect width=\"1\" height=\"1\" fill={color} />\n </svg>\n );\n}\n\n/**\n * A colour input: a hex field with a preview of the colour, and optional\n * swatches to pick from. It works with the keyboard alone and doesn't use\n * the browser's own colour picker, which differs between browsers and can't\n * be themed or translated.\n *\n * - **The input** takes `#rrggbb`, `#rgb` or either without the `#`. Typing\n * doesn't change the value: the text is committed on blur or Enter. Text\n * that isn't a colour goes back to the last value, and Escape throws the\n * typing away.\n * - **The swatches** are a radio group: one Tab stop, and the arrow keys move\n * and select. A swatch is checked while the value is its colour.\n * - **The value** is always lowercase `#rrggbb`. With `name`, forms receive it.\n *\n * @example\n * ```tsx\n * <Field label={t(\"shape.fill\")}>\n * <ColorField\n * value={fill}\n * onValueChange={setFill}\n * swatches={[\n * { value: \"#d92d20\", label: t(\"colors.red\") },\n * { value: \"#1570ef\", label: t(\"colors.blue\") },\n * ]}\n * />\n * </Field>\n * ```\n *\n * @public\n */\nexport const ColorField = /* @__PURE__ */ forwardRef<HTMLDivElement, ColorFieldProps>(\n function ColorField(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n swatches,\n label,\n swatchesLabel,\n name,\n form,\n disabled,\n className,\n classNames,\n unstyled,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) {\n const [uncontrolled, setUncontrolled] = useState(\n () => parseHex(defaultValue ?? \"\") ?? \"#000000\",\n );\n // What's typed and not yet committed; null while the field shows the value.\n const [draft, setDraft] = useState<string | null>(null);\n const value = (controlled === undefined ? undefined : parseHex(controlled)) ?? uncontrolled;\n\n const generated = useId();\n const ownLabelId = `${generated}-label`;\n const swatchesLabelId = `${generated}-swatches`;\n const fieldLabelId = useFieldLabelId();\n const swatchesText = useUiText(\"colorField.swatches\");\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"ColorField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const options: { readonly value: string; readonly label: string }[] = [];\n for (const swatch of swatches ?? []) {\n const color = parseHex(swatch.value);\n if (color === undefined) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n `ColorField skipped the swatch \"${swatch.label}\": its value isn't a colour such as #1570ef.`,\n );\n }\n } else if (!options.some((option) => option.value === color)) {\n options.push({ value: color, label: swatch.label });\n }\n }\n const tabStop = options.find((option) => option.value === value) ?? options[0];\n\n const commit = (next: string): void => {\n setDraft(null);\n if (next === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(next);\n }\n onValueChange?.(next);\n };\n\n // Commits typed text, or goes back to the value when it isn't a colour.\n const commitDraft = (): void => {\n if (draft === null) {\n return;\n }\n const parsed = parseHex(draft);\n if (parsed === undefined) {\n setDraft(null);\n } else {\n commit(parsed);\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n setDraft(event.currentTarget.value);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n commitDraft();\n onBlur?.(event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // An input method editor uses Enter and Escape while composing.\n if (event.defaultPrevented || event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === \"Enter\") {\n // Not prevented, so Enter still submits a form, which then has the\n // new value: the commit renders synchronously, as in NumberField.\n flushSync(commitDraft);\n } else if (event.key === \"Escape\" && draft !== null) {\n // Only the typing goes; a dialog around the field stays open.\n event.preventDefault();\n setDraft(null);\n }\n };\n\n const handleSwatchKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n const step =\n event.key === \"ArrowRight\" || event.key === \"ArrowDown\"\n ? 1\n : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\"\n ? -1\n : 0;\n if (step === 0 || options.length === 0 || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const horizontal = event.key === \"ArrowRight\" || event.key === \"ArrowLeft\";\n const direction = rtl && horizontal ? -step : step;\n const focused = options.findIndex(\n (option) => option.value === (event.target as HTMLElement).dataset[\"hmValue\"],\n );\n const next = options[(Math.max(0, focused) + direction + options.length) % options.length];\n if (next) {\n commit(next.value);\n event.currentTarget\n .querySelector<HTMLElement>(`[data-hm-value=\"${CSS.escape(next.value)}\"]`)\n ?.focus();\n }\n };\n\n // The swatch group's name: the field's label, then \"swatches\".\n const groupLabelIds = [\n fieldLabelId ?? (label === undefined ? props[\"aria-labelledby\"] : ownLabelId),\n swatchesLabelId,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <div\n ref={ref}\n className={cx(\"hm-color-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <div className={cx(\"hm-color-field-control\", classNames?.control)}>\n <Fill color={value} className={cx(\"hm-color-field-preview\", classNames?.preview)} />\n <input\n {...props}\n {...fieldProps}\n type=\"text\"\n autoComplete={props.autoComplete ?? \"off\"}\n autoCapitalize={props.autoCapitalize ?? \"off\"}\n autoCorrect={props.autoCorrect ?? \"off\"}\n spellCheck={props.spellCheck ?? false}\n maxLength={props.maxLength ?? 7}\n disabled={disabled}\n value={draft ?? value}\n aria-label={label ?? props[\"aria-label\"]}\n className={cx(\"hm-text-field\", \"hm-color-field-input\", classNames?.input)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n </div>\n {options.length === 0 ? null : (\n <>\n {label === undefined ? null : (\n <span id={ownLabelId} hidden>\n {label}\n </span>\n )}\n <span id={swatchesLabelId} hidden>\n {swatchesLabel ?? swatchesText}\n </span>\n <div\n role=\"radiogroup\"\n aria-labelledby={groupLabelIds}\n aria-disabled={disabled ? true : undefined}\n className={cx(\"hm-color-field-swatches\", classNames?.swatches)}\n onKeyDown={handleSwatchKeyDown}\n >\n {options.map((option) => {\n const checked = option.value === value;\n return (\n // biome-ignore lint/a11y/useSemanticElements: a native radio can't show its colour without an inline style; buttons with role=\"radio\" are the APG pattern, as in SegmentedControl.\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={option.label}\n disabled={disabled}\n tabIndex={option === tabStop ? 0 : -1}\n data-hm-value={option.value}\n className={cx(\"hm-color-field-swatch\", classNames?.swatch)}\n onClick={() => commit(option.value)}\n >\n <Fill color={option.value} className=\"hm-color-field-swatch-fill\" />\n </button>\n );\n })}\n </div>\n </>\n )}\n {name === undefined ? null : (\n <input type=\"hidden\" name={name} form={form} disabled={disabled} value={value} />\n )}\n </div>\n );\n },\n);\n","/**\n * The dialog's default close icon: a cross that draws with currentColor.\n * Replace it with the dialog's `closeIcon` prop.\n */\nexport function CloseIcon() {\n return (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <path d=\"M6 6l12 12M18 6 6 18\" />\n </svg>\n );\n}\n","import {\n type DialogHTMLAttributes,\n type ForwardedRef,\n forwardRef,\n type ReactElement,\n type ReactNode,\n type RefObject,\n type SyntheticEvent,\n useCallback,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { IconButton } from \"../button/IconButton.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { CloseIcon } from \"./CloseIcon.js\";\n\n/**\n * The parts of a dialog that `classNames` can target.\n *\n * @public\n */\nexport type DialogPart = \"root\" | \"header\" | \"title\" | \"description\" | \"body\" | \"footer\" | \"close\";\n\n/**\n * Props of {@link Dialog}.\n *\n * @public\n */\nexport interface DialogProps\n extends Omit<DialogHTMLAttributes<HTMLDialogElement>, \"className\" | \"title\" | \"open\">,\n StyleProps<DialogPart> {\n /** Whether the dialog is open. The dialog is always controlled. */\n readonly open: boolean;\n /**\n * Called with `false` when the user asks to close: Escape, or the close\n * button. Keep `open` true to refuse, for example while saving.\n */\n readonly onOpenChange: (open: boolean) => void;\n /** The heading, and the dialog's accessible name. */\n readonly title: ReactNode;\n /** A short description under the title, read when the dialog opens. */\n readonly description?: ReactNode;\n /** Actions at the bottom, such as Cancel and Save buttons. */\n readonly footer?: ReactNode;\n /** The close button's accessible name. Defaults to `dialog.close` from the messages. */\n readonly closeLabel?: string | undefined;\n /** Replaces the close icon. It draws with `currentColor`. */\n readonly closeIcon?: ReactNode;\n /** The element to focus when the dialog opens. Defaults to the first focusable one. */\n readonly initialFocus?: RefObject<HTMLElement | null> | undefined;\n /** Defaults to `medium`. */\n readonly size?: \"small\" | \"medium\" | \"large\" | undefined;\n}\n\nfunction useMergedRef<T>(forwarded: ForwardedRef<T>) {\n const local = useRef<T | null>(null);\n const setRef = useCallback(\n (node: T | null) => {\n local.current = node;\n if (typeof forwarded === \"function\") {\n forwarded(node);\n } else if (forwarded) {\n forwarded.current = node;\n }\n },\n [forwarded],\n );\n return [local, setRef] as const;\n}\n\n/**\n * A modal dialog on the native `<dialog>` element with `showModal()` (ADR\n * 0014): it traps focus, makes the page behind it inert, and sits in the top\n * layer, which host z-indexes and overflow can't break.\n *\n * - **Controlled:** `open` decides, and `onOpenChange(false)` asks to close,\n * on Escape or the close button.\n * - **Focus:** moves into the dialog when it opens, to `initialFocus` or the\n * first focusable element, and back to what was focused before when it\n * closes.\n * - **Server rendering:** renders closed, and opens after hydration.\n *\n * @example\n * ```tsx\n * <Dialog\n * open={open}\n * onOpenChange={setOpen}\n * title={messages.t(\"export.title\")}\n * footer={<Button variant=\"primary\" onClick={exportFile}>{messages.t(\"export.confirm\")}</Button>}\n * >\n * {options}\n * </Dialog>\n * ```\n *\n * @public\n */\nexport const Dialog = /* @__PURE__ */ forwardRef(function Dialog(\n {\n open,\n onOpenChange,\n title,\n description,\n footer,\n closeLabel,\n closeIcon,\n initialFocus,\n size = \"medium\",\n className,\n classNames,\n unstyled,\n children,\n onCancel,\n onClose,\n ...props\n }: DialogProps,\n forwardedRef: ForwardedRef<HTMLDialogElement>,\n): ReactElement {\n const defaultCloseLabel = useUiText(\"dialog.close\");\n const [ref, setRef] = useMergedRef(forwardedRef);\n const body = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const descriptionId = useId();\n\n useEffect(() => {\n const dialog = ref.current;\n if (!dialog) {\n return;\n }\n if (open && !dialog.open) {\n // Closing a dialog opened with showModal() returns focus to the element\n // that was focused before, in every supported browser.\n dialog.showModal();\n initialFocus?.current?.focus();\n } else if (!open && dialog.open) {\n dialog.close();\n }\n }, [open, initialFocus, ref]);\n\n // A body that scrolls must be reachable by keyboard, or content without\n // focusable elements can't be scrolled (axe: scrollable-region-focusable).\n // It's a Tab stop only while it overflows, so short dialogs don't get one.\n // A body at its maximum size doesn't resize when content changes, so its\n // children are watched too, including ones added after it opened.\n useEffect(() => {\n const element = body.current;\n if (!element || typeof ResizeObserver === \"undefined\") {\n return;\n }\n const update = (): void => {\n if (element.scrollHeight > element.clientHeight) {\n element.tabIndex = 0;\n } else {\n element.removeAttribute(\"tabindex\");\n }\n };\n const resizes = new ResizeObserver(update);\n resizes.observe(element);\n for (const child of element.children) {\n resizes.observe(child);\n }\n const children = new MutationObserver((records) => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node instanceof Element) {\n resizes.observe(node);\n }\n }\n }\n update();\n });\n children.observe(element, { childList: true });\n update();\n return () => {\n resizes.disconnect();\n children.disconnect();\n };\n }, []);\n\n // Escape fires cancel. The dialog only closes when `open` becomes false.\n const handleCancel = (event: SyntheticEvent<HTMLDialogElement>): void => {\n onCancel?.(event);\n event.preventDefault();\n onOpenChange(false);\n };\n\n // Browsers may close a dialog without a cancellable cancel event, such as\n // on a second Escape without user activation; report it like any close.\n const handleClose = (event: SyntheticEvent<HTMLDialogElement>): void => {\n onClose?.(event);\n if (open) {\n onOpenChange(false);\n }\n };\n\n return (\n <dialog\n {...props}\n ref={setRef}\n aria-labelledby={titleId}\n aria-describedby={description == null ? undefined : descriptionId}\n className={cx(\n \"hm-dialog\",\n size !== \"medium\" && `hm-dialog--${size}`,\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onCancel={handleCancel}\n onClose={handleClose}\n >\n <div className={cx(\"hm-dialog-header\", classNames?.header)}>\n <h2 id={titleId} className={cx(\"hm-dialog-title\", classNames?.title)}>\n {title}\n </h2>\n <IconButton\n variant=\"quiet\"\n size=\"small\"\n label={closeLabel ?? defaultCloseLabel}\n icon={closeIcon ?? <CloseIcon />}\n className={cx(\"hm-dialog-close\", classNames?.close)}\n unstyled={unstyled}\n onClick={() => onOpenChange(false)}\n />\n </div>\n {description == null ? null : (\n <p id={descriptionId} className={cx(\"hm-dialog-description\", classNames?.description)}>\n {description}\n </p>\n )}\n <div ref={body} className={cx(\"hm-dialog-body\", classNames?.body)}>\n {children}\n </div>\n {footer == null ? null : (\n <div className={cx(\"hm-dialog-footer\", classNames?.footer)}>{footer}</div>\n )}\n </dialog>\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode, useId } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport {\n FieldContext,\n type FieldControlProps,\n FieldLabelContext,\n joinIds,\n} from \"./field-context.js\";\n\n/**\n * The parts of a field that `classNames` can target.\n *\n * @public\n */\nexport type FieldPart = \"root\" | \"label\" | \"description\" | \"error\";\n\n/**\n * Props of {@link Field}. Native `div` props are passed through to the root.\n *\n * @public\n */\nexport interface FieldProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"children\">,\n StyleProps<FieldPart> {\n /** The visible label. Use text from your message catalogue. */\n readonly label: ReactNode;\n /** Help shown under the label, such as \"Between −24 and 24 dB\". */\n readonly description?: ReactNode;\n /**\n * What's wrong with the value, such as \"Enter a number\". While it's set,\n * the control is marked invalid and the text is read with it.\n */\n readonly error?: ReactNode;\n /** The control's `id`. Defaults to a generated one. */\n readonly controlId?: string | undefined;\n /**\n * The control. `ui` controls, such as `Slider` and `NumberField`, connect\n * themselves. For any other control, pass a function and spread the\n * props it receives onto the control.\n */\n readonly children: ReactNode | ((control: FieldControlProps) => ReactNode);\n}\n\n/**\n * A label, an optional description and an optional error, wired to one\n * control: the label names it, and the description and error describe it.\n *\n * The control must be labelable, such as an `<input>`, `<select>`,\n * `<textarea>` or `ui`'s `Slider`. For a group of controls, such as\n * `SegmentedControl`, use the group's own `label`.\n *\n * An error that appears after the user acts, such as on submit, isn't\n * announced on its own: move focus to the field, or announce it with\n * `useAnnounce`.\n *\n * @example\n * ```tsx\n * <Field label={t(\"export.dpi\")} description={t(\"export.dpiHelp\")} error={dpiError}>\n * <Slider min={72} max={600} value={dpi} onValueChange={setDpi} />\n * </Field>\n *\n * <Field label={t(\"export.name\")}>\n * {(control) => <input {...control} value={name} onChange={onNameChange} />}\n * </Field>\n * ```\n *\n * @public\n */\nexport const Field = /* @__PURE__ */ forwardRef<HTMLDivElement, FieldProps>(function Field(\n { label, description, error, controlId, className, classNames, unstyled, children, ...props },\n ref,\n) {\n const generated = useId();\n const id = controlId ?? `${generated}-control`;\n const labelId = `${generated}-label`;\n const descriptionId = `${generated}-description`;\n const errorId = `${generated}-error`;\n const hasDescription = description != null && description !== false;\n const hasError = error != null && error !== false;\n const control: FieldControlProps = {\n id,\n \"aria-describedby\": joinIds(\n hasDescription ? descriptionId : undefined,\n hasError ? errorId : undefined,\n ),\n \"aria-invalid\": hasError ? true : undefined,\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(\"hm-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <label id={labelId} htmlFor={id} className={cx(\"hm-field-label\", classNames?.label)}>\n {label}\n </label>\n {hasDescription ? (\n <div id={descriptionId} className={cx(\"hm-field-description\", classNames?.description)}>\n {description}\n </div>\n ) : null}\n <FieldContext.Provider value={control}>\n <FieldLabelContext.Provider value={labelId}>\n {typeof children === \"function\" ? children(control) : children}\n </FieldLabelContext.Provider>\n </FieldContext.Provider>\n {hasError ? (\n <div id={errorId} className={cx(\"hm-field-error\", classNames?.error)}>\n {error}\n </div>\n ) : null}\n </div>\n );\n});\n","import {\n type ChangeEvent,\n type DragEvent,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n useEffect,\n useId,\n useRef,\n useState,\n} from \"react\";\nimport { Button, type ButtonVariant } from \"../button/Button.js\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * The parts of a file drop zone that `classNames` can target.\n *\n * @public\n */\nexport type FileDropZonePart = \"root\" | \"button\" | \"hint\";\n\n/**\n * A file that {@link FileDropZone} turned away, and why: `type` when it\n * doesn't match `accept`, `count` when several came and `multiple` is off,\n * `directory` for a dropped folder.\n *\n * @public\n */\nexport interface FileRejection {\n readonly file: File;\n readonly reason: \"type\" | \"count\" | \"directory\";\n}\n\n/**\n * Props of {@link FileDropZone}. Native `div` props are passed through to the\n * zone.\n *\n * @public\n */\nexport interface FileDropZoneProps\n extends Omit<\n HTMLAttributes<HTMLDivElement>,\n \"className\" | \"onDrop\" | \"onDragEnter\" | \"onDragOver\" | \"onDragLeave\"\n >,\n StyleProps<FileDropZonePart> {\n /**\n * Called with the files that passed the zone's checks, chosen or dropped,\n * in order. The checks only look at names, types and counts: validate each\n * file's contents before using it.\n */\n readonly onFiles: (files: File[]) => void;\n /** Called with the files the zone turned away, and why. */\n readonly onFilesRejected?: ((rejections: FileRejection[]) => void) | undefined;\n /**\n * The file types to offer and take, as in `<input accept>`: extensions\n * such as `.pdf`, MIME types such as `application/pdf`, or `audio/*`.\n * A hint for the picker and a first filter, not a security check: a\n * file's name and type are whatever its sender chose.\n */\n readonly accept?: string | undefined;\n /** Takes several files at once. Defaults to `false`. */\n readonly multiple?: boolean | undefined;\n /**\n * Turns away files dropped anywhere else on the page while the zone is\n * mounted, so a near miss doesn't open the file in place of the page.\n * Defaults to `true`. Turn it off when the host handles stray drops\n * itself, or embeds the zone in a page whose drag and drop it doesn't own.\n */\n readonly preventStrayDrops?: boolean | undefined;\n /** Turns the button off, and ignores drops. */\n readonly disabled?: boolean | undefined;\n /**\n * The button's text. Defaults to `fileDropZone.choose` from the messages\n * (\"Choose a file\"), or `fileDropZone.chooseMultiple` with `multiple`.\n */\n readonly buttonLabel?: ReactNode;\n /** Defaults to `primary`. */\n readonly buttonVariant?: ButtonVariant | undefined;\n /** A ref to the button, for moving focus to it. */\n readonly buttonRef?: Ref<HTMLButtonElement> | undefined;\n /**\n * Text under the button, which also describes it. Defaults to\n * `fileDropZone.hint` (\"or drop it here\"), or `fileDropZone.hintMultiple`.\n */\n readonly hint?: ReactNode;\n /** Content above the button, such as a title or the reason the last file failed. */\n readonly children?: ReactNode;\n}\n\nconst hasFiles = (event: { dataTransfer: DataTransfer | null }): boolean =>\n event.dataTransfer?.types.includes(\"Files\") ?? false;\n\n/** Whether a file matches an `accept` list, by its name and type only. */\nexport function accepts(file: File, accept: string | undefined): boolean {\n const tokens = (accept ?? \"\")\n .split(\",\")\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) {\n return true;\n }\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n return tokens.some((token) =>\n token.startsWith(\".\")\n ? name.endsWith(token)\n : token.endsWith(\"/*\")\n ? type.startsWith(token.slice(0, -1))\n : type === token,\n );\n}\n\n/** Splits files into those that pass the zone's checks and those that don't. */\nexport function check(\n files: readonly File[],\n directories: ReadonlySet<number>,\n accept: string | undefined,\n multiple: boolean,\n): { accepted: File[]; rejected: FileRejection[] } {\n const accepted: File[] = [];\n const rejected: FileRejection[] = [];\n files.forEach((file, index) => {\n if (directories.has(index)) {\n rejected.push({ file, reason: \"directory\" });\n } else if (!multiple && files.length > 1) {\n rejected.push({ file, reason: \"count\" });\n } else if (!accepts(file, accept)) {\n rejected.push({ file, reason: \"type\" });\n } else {\n accepted.push(file);\n }\n });\n return { accepted, rejected };\n}\n\n/**\n * Turns away a file dragged anywhere outside a drop zone, unless something\n * else took it, so a missed drop doesn't open the file in place of the page.\n */\nfunction refuseStrayDrop(event: globalThis.DragEvent): void {\n if (event.defaultPrevented || !hasFiles(event)) {\n return;\n }\n event.preventDefault();\n if (event.dataTransfer && event.type === \"dragover\") {\n event.dataTransfer.dropEffect = \"none\";\n }\n}\n\n/**\n * Where people choose or drop files, such as a document to open. The button\n * opens the system's file picker: it's the keyboard and screen reader path.\n * The zone around it takes dropped files, a shortcut for pointer users, so it\n * isn't focusable itself. While files are dragged over it, it has the\n * `data-hm-dragging` attribute.\n *\n * The zone checks names, types and counts against `accept` and `multiple`,\n * and turns away folders, then calls `onFiles`. It never reads a file and\n * never shows a file's name. Treat files as untrusted: check their contents\n * before using them, and show their names as text.\n *\n * While a zone is on the page, files dropped elsewhere on the page are\n * turned away, so a near miss doesn't navigate away from it. Hosts that\n * handle that themselves turn it off with `preventStrayDrops={false}`.\n *\n * @example\n * ```tsx\n * <FileDropZone accept=\".pdf,application/pdf\" onFiles={([file]) => open(file)}>\n * <p>{messages.t(\"editor.start.title\")}</p>\n * </FileDropZone>\n * ```\n *\n * @public\n */\nexport const FileDropZone = /* @__PURE__ */ forwardRef<HTMLDivElement, FileDropZoneProps>(\n function FileDropZone(\n {\n onFiles,\n onFilesRejected,\n accept,\n multiple = false,\n disabled = false,\n preventStrayDrops = true,\n buttonLabel,\n buttonVariant = \"primary\",\n buttonRef,\n hint,\n className,\n classNames,\n unstyled,\n children,\n ...props\n },\n ref,\n ) {\n const input = useRef<HTMLInputElement>(null);\n // Elements the drag has entered and not yet left. Entering a child fires\n // dragleave on its parent, so the zone only stops being a target when\n // this is empty: no flicker over children.\n const entered = useRef(new Set<EventTarget>());\n const [dragging, setDragging] = useState(false);\n const hintId = useId();\n const defaultLabel = useUiText(\n multiple ? \"fileDropZone.chooseMultiple\" : \"fileDropZone.choose\",\n );\n const defaultHint = useUiText(multiple ? \"fileDropZone.hintMultiple\" : \"fileDropZone.hint\");\n\n useEffect(() => {\n if (!preventStrayDrops) {\n return;\n }\n window.addEventListener(\"dragover\", refuseStrayDrop);\n window.addEventListener(\"drop\", refuseStrayDrop);\n return () => {\n window.removeEventListener(\"dragover\", refuseStrayDrop);\n window.removeEventListener(\"drop\", refuseStrayDrop);\n };\n }, [preventStrayDrops]);\n\n useEffect(() => {\n if (disabled) {\n entered.current.clear();\n setDragging(false);\n }\n }, [disabled]);\n\n const deliver = (files: readonly File[], directories: ReadonlySet<number> = new Set()) => {\n const { accepted, rejected } = check(files, directories, accept, multiple);\n if (accepted.length > 0) {\n onFiles(accepted);\n }\n if (rejected.length > 0) {\n onFilesRejected?.(rejected);\n }\n };\n\n const choose = (event: ChangeEvent<HTMLInputElement>): void => {\n const files = [...(event.currentTarget.files ?? [])];\n // Cleared, so choosing the same file again still delivers it.\n event.currentTarget.value = \"\";\n deliver(files);\n };\n\n const handleDragEnter = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n if (disabled) {\n return;\n }\n entered.current.add(event.target);\n setDragging(true);\n };\n\n const handleDragOver = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n event.dataTransfer.dropEffect = disabled ? \"none\" : \"copy\";\n };\n\n const handleDragLeave = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n const zone = event.currentTarget;\n entered.current.delete(event.target);\n // Drop elements that left the zone or the page while the drag was on.\n for (const target of entered.current) {\n if (!(target instanceof Node) || !zone.contains(target)) {\n entered.current.delete(target);\n }\n }\n if (entered.current.size === 0) {\n setDragging(false);\n }\n };\n\n const handleDrop = (event: DragEvent<HTMLDivElement>): void => {\n if (!hasFiles(event)) {\n return;\n }\n event.preventDefault();\n entered.current.clear();\n setDragging(false);\n if (disabled) {\n return;\n }\n const files = [...event.dataTransfer.files];\n // Folders arrive as files; their entries tell them apart, without\n // reading anything. Only available during the drop event.\n const directories = new Set<number>();\n [...event.dataTransfer.items]\n .filter((item) => item.kind === \"file\")\n .forEach((item, index) => {\n if (item.webkitGetAsEntry?.()?.isDirectory) {\n directories.add(index);\n }\n });\n deliver(files, directories);\n };\n\n return (\n // The zone is a pointer shortcut only: the button opens the same picker.\n // biome-ignore lint/a11y/noStaticElementInteractions: a drop target has no keyboard role; the button is the accessible path\n <div\n {...props}\n ref={ref}\n className={cx(\"hm-file-drop-zone\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n data-hm-dragging={dragging ? \"\" : undefined}\n data-hm-disabled={disabled ? \"\" : undefined}\n onDragEnter={handleDragEnter}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n {children}\n <Button\n ref={buttonRef}\n variant={buttonVariant}\n className={cx(\"hm-file-drop-zone-button\", classNames?.button)}\n unstyled={unstyled}\n disabled={disabled}\n aria-describedby={hintId}\n onClick={() => input.current?.click()}\n >\n {buttonLabel ?? defaultLabel}\n </Button>\n <div id={hintId} className={cx(\"hm-file-drop-zone-hint\", classNames?.hint)}>\n {hint ?? defaultHint}\n </div>\n <input\n ref={input}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n // The button is the control; this input only opens the picker.\n tabIndex={-1}\n aria-hidden=\"true\"\n hidden\n onChange={choose}\n />\n </div>\n );\n },\n);\n","/** The number of decimals in a number, so steps don't drift: 0.1 + 0.2 is 0.3. */\nexport function decimals(value: number): number {\n const text = String(value);\n const exponent = /e-(\\d+)$/.exec(text);\n if (exponent) {\n return Number(exponent[1]);\n }\n const point = text.indexOf(\".\");\n return point === -1 ? 0 : text.length - point - 1;\n}\n\n/** Rounds away float error at a number of decimals, which `toFixed` caps at 100. */\nexport function roundTo(value: number, places: number): number {\n return Number(value.toFixed(Math.min(places, 100)));\n}\n","import {\n type ChangeEvent,\n type FocusEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useMemo,\n useState,\n} from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { useUiLocale } from \"../messages/UiMessagesProvider.js\";\nimport { decimals, roundTo } from \"../shared/number.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link NumberField}. Native input props are passed through.\n *\n * @public\n */\nexport interface NumberFieldProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | \"className\"\n | \"type\"\n | \"value\"\n | \"defaultValue\"\n | \"min\"\n | \"max\"\n | \"step\"\n | \"onChange\"\n | \"role\"\n | \"aria-valuenow\"\n | \"aria-valuemin\"\n | \"aria-valuemax\"\n | \"aria-valuetext\"\n >,\n StyleProps<\"root\"> {\n /** The value, when you control it. Leave it out to let the field keep its own. */\n readonly value?: number | undefined;\n /** The starting value, when the field keeps its own. Defaults to 0, kept within `min` and `max`. */\n readonly defaultValue?: number | undefined;\n /**\n * Called with the new value when it's committed: on blur, on Enter, or\n * with the arrow and Page keys. Never with `NaN`, and never while typing.\n */\n readonly onValueChange?: ((value: number) => void) | undefined;\n /** The smallest value. Values below it are raised to it. */\n readonly min?: number | undefined;\n /** The largest value. Values above it are lowered to it. */\n readonly max?: number | undefined;\n /** The Arrow Up and Arrow Down step. Defaults to 1. Typed values aren't snapped to it. */\n readonly step?: number | undefined;\n /** The Page Up and Page Down step. Defaults to ten steps. */\n readonly largeStep?: number | undefined;\n /**\n * The locale for the default `parse` and `format`, such as `\"de\"`.\n * Defaults to the locale of `UiMessagesProvider`, or `\"en\"`.\n */\n readonly locale?: string | undefined;\n /**\n * Reads typed text as a number, or returns `undefined` when it isn't one.\n * Defaults to the locale's digits, decimal and group separators, and minus\n * sign. Replace it for other notations, such as a timecode.\n */\n readonly parse?: ((text: string) => number | undefined) | undefined;\n /**\n * Writes a value as text: the field shows it, and screen readers read it.\n * Defaults to the locale's number format.\n */\n readonly format?: ((value: number) => string) | undefined;\n /**\n * The accessible name, such as \"Zoom\". Leave it out inside a `Field`, or\n * when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/** How a locale writes numbers, learned from `Intl.NumberFormat`. */\nexport interface Notation {\n readonly group: string;\n readonly decimal: string;\n readonly digits: ReadonlyMap<string, string>;\n}\n\nexport function notationOf(locale: string): Notation {\n const parts = new Intl.NumberFormat(locale).formatToParts(-12345.6);\n const digits = new Map<string, string>();\n const native = new Intl.NumberFormat(locale, { useGrouping: false }).format(9876543210);\n [...native].forEach((digit, index) => {\n digits.set(digit, String(9 - index));\n });\n return {\n group: parts.find((part) => part.type === \"group\")?.value ?? \",\",\n decimal: parts.find((part) => part.type === \"decimal\")?.value ?? \".\",\n digits,\n };\n}\n\n/** Spaces people type for a locale whose group separator is space-like. */\nconst SPACE = /[\\s\\u00a0\\u202f]/;\n\n/** Escapes a separator for use in a regular expression. */\nconst escapeRegExp = (text: string): string => text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/** Matches the group separators people type for a locale. */\nfunction groupPattern(group: string): RegExp {\n if (SPACE.test(group)) {\n return /[\\s\\u00a0\\u202f]/;\n }\n // Swiss German groups with an apostrophe: ' or ’, depending on the\n // engine's data, and people type either.\n if (/^['\\u2019]$/.test(group)) {\n return /['\\u2019]/;\n }\n return new RegExp(escapeRegExp(group));\n}\n\n/**\n * Whether an integer part's groups are where the locale puts them: 1 to 3\n * digits, then groups of 2 or 3, ending in a group of 3, as in 1,234,567\n * or en-IN's 12,34,567. Otherwise a separator is a typo, or another\n * locale's decimal point, such as \"2.5\" typed in German, and reading it as\n * a group would silently multiply the value.\n */\nfunction groupsInPlace(groups: readonly string[]): boolean {\n const last = groups.length - 1;\n return groups.every((group, index) =>\n index === 0\n ? /^\\d{1,3}$/.test(group)\n : index === last\n ? /^\\d{3}$/.test(group)\n : /^\\d{2,3}$/.test(group),\n );\n}\n\n/**\n * Reads a number the way a locale writes it: its digits, decimal separator\n * and group separators, with an optional minus sign, hyphen or plus. Strict:\n * anything else, such as letters, an exponent or a group separator out of\n * place, isn't a number.\n */\nexport function parseIn(notation: Notation, text: string): number | undefined {\n let normal = \"\";\n // Bidirectional marks, such as the one before Arabic's minus sign, aren't\n // part of the number.\n for (const character of text.replace(/[\\u061c\\u200e\\u200f]/g, \"\").trim()) {\n normal += notation.digits.get(character) ?? character;\n }\n const sign = /^[-+\\u2212]/.exec(normal)?.[0];\n if (sign !== undefined) {\n normal = normal.slice(1);\n }\n const parts = normal.split(notation.decimal);\n if (parts.length > 2) {\n return undefined;\n }\n const groups = (parts[0] ?? \"\").split(groupPattern(notation.group));\n if (groups.length > 1 && !groupsInPlace(groups)) {\n return undefined;\n }\n const integer = groups.join(\"\");\n const fraction = parts[1] ?? \"\";\n if (!/^\\d*$/.test(integer) || !/^\\d*$/.test(fraction) || integer + fraction === \"\") {\n return undefined;\n }\n const value = Number(\n `${sign === \"+\" || sign === undefined ? \"\" : \"-\"}${integer || \"0\"}.${fraction || \"0\"}`,\n );\n return Number.isFinite(value) ? value : undefined;\n}\n\n/**\n * A number input: a text field exposed as a spin button, with locale-aware\n * parsing and formatting.\n *\n * Typing never changes the value: the text is committed on blur or Enter,\n * then kept within `min` and `max`. Text that isn't a number, or no text,\n * goes back to the last value, so the value is never `NaN`. Escape throws\n * the typing away. Arrow Up and Arrow Down move by `step`, Page Up and Page\n * Down by `largeStep`, from the typed number when there is one.\n *\n * Other notations are a `parse` and `format` away: a timecode field is a\n * `NumberField` of seconds. With `name`, forms receive the number, not the\n * formatted text.\n *\n * @example\n * ```tsx\n * <Field label={messages.t(\"view.zoom\")}>\n * <NumberField\n * min={10}\n * max={400}\n * step={10}\n * value={zoom}\n * onValueChange={setZoom}\n * format={(percent) => `${percent}%`}\n * parse={(text) => parseFloat(text)}\n * />\n * </Field>\n * ```\n *\n * @public\n */\nexport const NumberField = /* @__PURE__ */ forwardRef<HTMLInputElement, NumberFieldProps>(\n function NumberField(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n min,\n max,\n step = 1,\n largeStep,\n locale,\n parse,\n format,\n label,\n name,\n form,\n disabled,\n readOnly,\n className,\n classNames,\n unstyled,\n onBlur,\n onKeyDown,\n ...props\n },\n ref,\n ) {\n const lower = min ?? Number.NEGATIVE_INFINITY;\n const upper = max ?? Number.POSITIVE_INFINITY;\n const clamp = (n: number): number => Math.min(Math.max(n, lower), Math.max(lower, upper));\n\n const [uncontrolled, setUncontrolled] = useState(() => clamp(defaultValue ?? 0));\n // What's typed and not yet committed; null while the field shows the value.\n const [draft, setDraft] = useState<string | null>(null);\n // -0 would show as \"-0\".\n const value = clamp(controlled ?? uncontrolled) || 0;\n\n const contextLocale = useUiLocale();\n const resolvedLocale = locale ?? contextLocale;\n const notation = useMemo(() => notationOf(resolvedLocale), [resolvedLocale]);\n const places = Math.min(20, Math.max(decimals(step), decimals(value)));\n const formatter = useMemo(\n () => new Intl.NumberFormat(resolvedLocale, { maximumFractionDigits: places }),\n [resolvedLocale, places],\n );\n const formatted = format ? format(value) : formatter.format(value);\n const read = (text: string): number | undefined => {\n const parsed = parse ? parse(text) : parseIn(notation, text);\n return parsed !== undefined && Number.isFinite(parsed) ? parsed : undefined;\n };\n\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"NumberField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const commit = (next: number): void => {\n setDraft(null);\n const settled = clamp(next) || 0;\n if (settled === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(settled);\n }\n onValueChange?.(settled);\n };\n\n // Commits typed text, or goes back to the value when it isn't a number.\n const commitDraft = (): void => {\n if (draft === null) {\n return;\n }\n const parsed = read(draft);\n if (parsed === undefined) {\n setDraft(null);\n } else {\n commit(parsed);\n }\n };\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n setDraft(event.currentTarget.value);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n commitDraft();\n onBlur?.(event);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // An input method editor uses Enter and Escape while composing.\n if (event.defaultPrevented || event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === \"Enter\") {\n // Not prevented, so Enter still submits a form. The commit renders\n // synchronously, so the form, and a parent's state, have the new\n // value first: Firefox submits before React's usual flush.\n flushSync(commitDraft);\n return;\n }\n if (event.key === \"Escape\") {\n if (draft !== null) {\n // Only the typing goes; a dialog around the field stays open.\n event.preventDefault();\n setDraft(null);\n }\n return;\n }\n if (readOnly || event.altKey || event.ctrlKey || event.metaKey) {\n return;\n }\n const large = largeStep ?? step * 10;\n const steps: Record<string, number> = {\n ArrowUp: step,\n ArrowDown: -step,\n PageUp: large,\n PageDown: -large,\n };\n const delta = steps[event.key];\n if (delta === undefined) {\n return;\n }\n event.preventDefault();\n const base = (draft === null ? undefined : read(draft)) ?? value;\n const precision = Math.max(\n decimals(base),\n decimals(delta),\n min === undefined ? 0 : decimals(min),\n );\n commit(roundTo(base + delta, precision));\n };\n\n return (\n <>\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type=\"text\"\n role=\"spinbutton\"\n inputMode={props.inputMode ?? (lower >= 0 ? \"decimal\" : \"text\")}\n autoComplete={props.autoComplete ?? \"off\"}\n autoCorrect={props.autoCorrect ?? \"off\"}\n spellCheck={props.spellCheck ?? false}\n disabled={disabled}\n readOnly={readOnly}\n value={draft ?? formatted}\n aria-label={label ?? props[\"aria-label\"]}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuetext={formatted}\n className={cx(\"hm-number-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n />\n {name === undefined ? null : (\n <input type=\"hidden\" name={name} form={form} disabled={disabled} value={value} />\n )}\n </>\n );\n },\n);\n","import { forwardRef, type ProgressHTMLAttributes } from \"react\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link ProgressBar}.\n *\n * @public\n */\nexport interface ProgressBarProps\n extends Omit<ProgressHTMLAttributes<HTMLProgressElement>, \"className\" | \"value\" | \"max\">,\n StyleProps<\"root\"> {\n /** How much is done, from 0 to `max`. Leave it out while the amount is unknown. */\n readonly value?: number | undefined;\n /** Defaults to 100. */\n readonly max?: number | undefined;\n /** What's in progress. Defaults to `progress.label` from the messages (\"Progress\"). */\n readonly label?: string | undefined;\n /** The value as words, such as \"Page 3 of 12\", read instead of a percentage. */\n readonly valueText?: string | undefined;\n}\n\n/**\n * Shows how much of a task is done, on the native `<progress>` element: no\n * inline styles, so it renders correctly under a strict Content Security\n * Policy, before hydration too. Without `value`, it's indeterminate and\n * pulses, or stays still under reduced motion.\n *\n * @example\n * ```tsx\n * <ProgressBar value={done} max={total} label={messages.t(\"export.progress\")} />\n * ```\n *\n * @public\n */\nexport const ProgressBar = /* @__PURE__ */ forwardRef<HTMLProgressElement, ProgressBarProps>(\n function ProgressBar(\n { value, max = 100, label, valueText, className, classNames, unstyled, ...props },\n ref,\n ) {\n const defaultLabel = useUiText(\"progress.label\");\n const clamped = value === undefined ? undefined : Math.min(Math.max(value, 0), max);\n return (\n <progress\n {...props}\n ref={ref}\n value={clamped}\n max={max}\n aria-label={label ?? defaultLabel}\n aria-valuetext={valueText}\n className={cx(\"hm-progress-bar\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n />\n );\n },\n);\n","/**\n * Roving tabindex for toolbars (WAI-ARIA APG): one Tab stop, and arrow keys\n * between items. Items are found from the DOM when needed, so they don't have\n * to register, and the server renders no tabindex at all, so hydration never\n * mismatches.\n */\n\n// A literal, not a joined array: a call at module scope would make bundlers\n// keep this module in applications that never use a toolbar.\n//\n// Items the toolbar has managed carry data-hm-roving, so a custom item, such\n// as a div with tabindex=\"0\", still counts after the toolbar sets its\n// tabindex to -1. Elements an author set to tabindex=\"-1\" are never marked,\n// so they stay out. A managed item that becomes disabled drops out again.\nconst FOCUSABLE =\n 'button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex^=\"-\"]):not(button, a, input, select, textarea), [data-hm-roving]:not(:disabled)';\n\n/** The toolbar's items, in DOM order, skipping hidden ones. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (element) => !element.closest(\"[hidden], [inert]\") && element.getClientRects().length > 0,\n );\n}\n\n/** Makes `active` the single Tab stop, or the first item when it's not an item. */\nexport function syncTabStop(toolbar: HTMLElement, active?: Element | null): void {\n const list = items(toolbar);\n const current =\n list.find((item) => item === active) ??\n list.find((item) => item.tabIndex === 0 && item.dataset[\"hmTabStop\"] !== undefined) ??\n list[0];\n for (const item of list) {\n const isStop = item === current;\n item.dataset[\"hmRoving\"] = \"\";\n item.tabIndex = isStop ? 0 : -1;\n if (isStop) {\n item.dataset[\"hmTabStop\"] = \"\";\n } else {\n delete item.dataset[\"hmTabStop\"];\n }\n }\n}\n\n/** Keys that never move focus inside text fields, where they edit text. */\nfunction editsText(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) {\n return false;\n }\n return (\n target.isContentEditable ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLInputElement &&\n ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\"].includes(target.type))\n );\n}\n\n/**\n * Moves focus for an arrow, Home or End key. Returns whether it handled the\n * key, so the caller can prevent the default.\n */\nexport function moveFocus(\n toolbar: HTMLElement,\n event: { key: string; target: EventTarget | null },\n orientation: \"horizontal\" | \"vertical\",\n): boolean {\n if (editsText(event.target)) {\n return false;\n }\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = orientation === \"vertical\" ? \"ArrowDown\" : rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const previous = orientation === \"vertical\" ? \"ArrowUp\" : rtl ? \"ArrowRight\" : \"ArrowLeft\";\n const list = items(toolbar);\n if (list.length === 0) {\n return false;\n }\n const index = list.indexOf(event.target as HTMLElement);\n let target: HTMLElement | undefined;\n switch (event.key) {\n case next:\n target = list[(index + 1) % list.length];\n break;\n case previous:\n target = list[(index - 1 + list.length) % list.length];\n break;\n case \"Home\":\n target = list[0];\n break;\n case \"End\":\n target = list[list.length - 1];\n break;\n default:\n return false;\n }\n if (target) {\n syncTabStop(toolbar, target);\n target.focus();\n }\n return true;\n}\n","import {\n createContext,\n type FocusEvent,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type MouseEvent,\n type ReactNode,\n useContext,\n useEffect,\n useRef,\n} from \"react\";\nimport { useAnnounce } from \"../announcer/Announcer.js\";\nimport { useUiMessages } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { items as focusableItems } from \"../toolbar/roving-focus.js\";\n\n/**\n * Props of {@link ReorderableList}.\n *\n * @public\n */\nexport interface ReorderableListProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\">,\n StyleProps<\"root\"> {\n /** The list's accessible name, such as \"Layers\". Required. */\n readonly label: string;\n /** The selected item's `id`, or `null` for none. */\n readonly selectedId?: string | null | undefined;\n /** Called with an item's `id` when the user selects it. */\n readonly onSelectedChange?: ((id: string) => void) | undefined;\n /**\n * Called when the user moves an item with Alt+↑ or Alt+↓ (Option on\n * macOS), with its `id` and the position it should have, counted from 0.\n * Render the items in the new order, or leave them when the move isn't\n * allowed. Without it, the list doesn't reorder.\n */\n readonly onMove?: ((id: string, toIndex: number) => void) | undefined;\n /**\n * Called when the user presses Delete or Backspace on an item, with its\n * `id`. Render the items without it. Without it, the keys do nothing.\n */\n readonly onRemove?: ((id: string) => void) | undefined;\n /**\n * Whether the list announces a move to screen readers, through the\n * closest `AnnouncerProvider`. Defaults to `true`; pass `false` when you\n * announce it in your own words.\n */\n readonly announceMoves?: boolean | undefined;\n /** The items: {@link ReorderableListItem} elements, in the order shown. */\n readonly children?: ReactNode;\n}\n\n/**\n * The parts of a reorderable list's item that `classNames` can target.\n *\n * @public\n */\nexport type ReorderableListItemPart = \"root\" | \"item\" | \"control\";\n\n/**\n * Props of {@link ReorderableListItem}.\n *\n * @public\n */\nexport interface ReorderableListItemProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\" | \"id\">,\n StyleProps<ReorderableListItemPart> {\n /** Identifies the item in `selectedId`, `onMove` and `onRemove`. Unique in the list. */\n readonly id: string;\n /**\n * The item's accessible name, such as a layer's name. Start it with the\n * text the item shows, if it shows any.\n */\n readonly label: string;\n /**\n * The item's controls, such as a visibility toggle: one focusable control\n * each, in its own cell. A control that can't act should stay focusable,\n * as `focusableWhenDisabled` makes a button.\n */\n readonly controls?: readonly ReactNode[] | undefined;\n /** What the item shows. */\n readonly children?: ReactNode;\n}\n\ninterface ListContext {\n readonly selectedId: string | null | undefined;\n}\n\nconst ReorderableListContext = /* @__PURE__ */ createContext<ListContext | undefined>(undefined);\n\n/** A change asked for from the keyboard, whose focus is restored once it renders. */\ninterface Pending {\n readonly kind: \"move\" | \"remove\";\n readonly id: string;\n /** The item's position when the key was pressed. */\n readonly index: number;\n /** The focused cell's position in its row. */\n readonly cell: number;\n /** The items' ids when the key was pressed. */\n readonly order: string;\n}\n\n/** Keys that never act inside text fields, where they edit text. */\nfunction editsText(target: EventTarget | null): boolean {\n return (\n target instanceof HTMLElement &&\n (target.isContentEditable ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement ||\n (target instanceof HTMLInputElement &&\n ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\"].includes(target.type)))\n );\n}\n\n/** The list's rows, in the order shown. */\nfunction rowsOf(list: HTMLElement): HTMLElement[] {\n return [...list.children].filter(\n (child): child is HTMLElement =>\n child instanceof HTMLElement && child.getAttribute(\"role\") === \"row\",\n );\n}\n\n/** A row's focus targets: the item's cell, then each cell's control. */\nfunction cellsOf(row: HTMLElement): HTMLElement[] {\n const targets: HTMLElement[] = [];\n for (const cell of row.children) {\n if (!(cell instanceof HTMLElement)) {\n continue;\n }\n if (cell.dataset[\"hmCell\"] === \"item\") {\n targets.push(cell);\n } else {\n const control = focusableItems(cell)[0];\n if (control) {\n targets.push(control);\n }\n }\n }\n return targets;\n}\n\nconst idOf = (row: HTMLElement | undefined): string => row?.dataset[\"hmId\"] ?? \"\";\nconst orderOf = (rows: HTMLElement[]): string => JSON.stringify(rows.map(idOf));\nconst selectedRow = (rows: HTMLElement[]): HTMLElement | undefined =>\n rows.find((row) => row.getAttribute(\"aria-selected\") === \"true\");\n\n/**\n * Makes one cell the list's only Tab stop: `active` when it's a cell, else\n * the cell that already is, else the selected row's item, else the first.\n */\nfunction syncTabStop(list: HTMLElement, active?: Element | null): void {\n const rows = rowsOf(list);\n const all = rows.flatMap(cellsOf);\n const current =\n all.find((cell) => cell === active) ??\n all.find((cell) => cell.dataset[\"hmTabStop\"] !== undefined) ??\n cellsOf(selectedRow(rows) ?? rows[0] ?? list)[0];\n for (const cell of all) {\n const isStop = cell === current;\n // Marks a control the list manages, so it still counts at tabindex -1.\n cell.dataset[\"hmRoving\"] = \"\";\n cell.tabIndex = isStop ? 0 : -1;\n if (isStop) {\n cell.dataset[\"hmTabStop\"] = \"\";\n } else {\n delete cell.dataset[\"hmTabStop\"];\n }\n }\n}\n\n/**\n * A list whose items the user selects, reorders and removes, with one Tab\n * stop and room for controls in each row (docs/adr/0009). It's a WAI-ARIA\n * grid with one column of rows.\n *\n * - **↑ and ↓** move between rows and select; with Ctrl or ⌘, they move\n * without selecting. **← and →**, Home and End move between a row's\n * cells. Ctrl or ⌘ with Home or End goes to the first or last row.\n * Space or Enter on an item selects it.\n * - **Alt+↑ and Alt+↓** (Option on macOS) move the focused item, through\n * `onMove`. **Delete and Backspace** remove it, through `onRemove`.\n * - **You own the order.** The list calls `onMove` and `onRemove`, and you\n * render the result. Focus stays with a moved item, and goes to the next\n * one after a removal.\n * - **Offer buttons too.** The keys are an addition: also render buttons\n * that move the selected item, for touch and for people who don't know\n * the keys, and name the keys on them with `aria-keyshortcuts`.\n *\n * @example\n * ```tsx\n * <ReorderableList\n * label={t(\"layers.label\")}\n * selectedId={selected}\n * onSelectedChange={setSelected}\n * onMove={(id, toIndex) => session.moveLayer(id, toIndex)}\n * onRemove={(id) => session.deleteLayer(id)}\n * >\n * {layers.map((layer) => (\n * <ReorderableListItem\n * key={layer.id}\n * id={layer.id}\n * label={layer.name}\n * controls={[\n * <ToggleButton\n * key=\"visible\"\n * variant=\"quiet\"\n * label={t(\"layers.visible\")}\n * icon={<VisibleIcon />}\n * pressed={layer.visible}\n * onPressedChange={(visible) => session.showLayer(layer.id, visible)}\n * />,\n * ]}\n * >\n * {layer.name}\n * </ReorderableListItem>\n * ))}\n * </ReorderableList>\n * ```\n *\n * @public\n */\nexport const ReorderableList = /* @__PURE__ */ forwardRef<HTMLDivElement, ReorderableListProps>(\n function ReorderableList(\n {\n label,\n selectedId,\n onSelectedChange,\n onMove,\n onRemove,\n announceMoves = true,\n className,\n classNames,\n unstyled,\n onKeyDown,\n onClick,\n onFocus,\n onBlur,\n children,\n ...props\n },\n ref,\n ) {\n const list = useRef<HTMLDivElement | null>(null);\n const pending = useRef<Pending | undefined>(undefined);\n const lastSelected = useRef(selectedId);\n const announce = useAnnounce();\n const messages = useUiMessages();\n\n // After every render: one Tab stop, and the focus a move or a removal\n // asked for, once the host has rendered it.\n useEffect(() => {\n const element = list.current;\n if (!element) {\n return;\n }\n const change = pending.current;\n const rows = rowsOf(element);\n if (change && orderOf(rows) !== change.order) {\n pending.current = undefined;\n const index =\n change.kind === \"move\"\n ? rows.findIndex((row) => idOf(row) === change.id)\n : Math.min(change.index, rows.length - 1);\n const row = rows[index];\n // Only where focus was dropped or is still in the list: never taken\n // from wherever the user has gone since.\n const active = document.activeElement;\n const free = !active || active === document.body || element.contains(active);\n if (row && free) {\n const cells = cellsOf(row);\n const target = cells[change.cell] ?? cells[0];\n syncTabStop(element, target);\n target?.focus();\n }\n if (row && change.kind === \"move\" && announceMoves) {\n announce(\n messages.t(\"reorderableList.moved\", {\n label: cellsOf(row)[0]?.getAttribute(\"aria-label\") ?? \"\",\n position: index + 1,\n count: rows.length,\n }),\n );\n }\n }\n // With focus elsewhere, the Tab stop follows a selection made elsewhere,\n // such as on an editor's stage; with focus inside, it stays with focus.\n const inside = element.contains(document.activeElement);\n const reselected = lastSelected.current !== selectedId;\n lastSelected.current = selectedId;\n syncTabStop(\n element,\n inside\n ? document.activeElement\n : reselected\n ? cellsOf(selectedRow(rowsOf(element)) ?? element)[0]\n : null,\n );\n });\n\n const select = (id: string): void => {\n if (id !== \"\" && id !== selectedId) {\n onSelectedChange?.(id);\n }\n };\n\n const focusCell = (row: HTMLElement | undefined, cell: number): void => {\n if (!row || !list.current) {\n return;\n }\n const cells = cellsOf(row);\n const target = cells[cell] ?? cells[0];\n syncTabStop(list.current, target);\n target?.focus();\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n // Whatever was asked for before, the user has moved on.\n pending.current = undefined;\n if (\n event.defaultPrevented ||\n event.nativeEvent.isComposing ||\n event.shiftKey ||\n editsText(event.target)\n ) {\n return;\n }\n const element = event.currentTarget;\n const rows = rowsOf(element);\n const index = rows.findIndex((row) => row.contains(event.target as Node));\n const row = rows[index];\n if (!row) {\n return;\n }\n const cells = cellsOf(row);\n const cell = cells.indexOf(event.target as HTMLElement);\n if (cell === -1) {\n return;\n }\n // Ctrl or ⌘ moves without selecting, as in pdf-sdk's thumbnails.\n const quiet = event.ctrlKey || event.metaKey;\n const vertical = event.key === \"ArrowUp\" ? -1 : event.key === \"ArrowDown\" ? 1 : 0;\n\n if (event.altKey) {\n // Taken even at the first and last rows, so the page never scrolls.\n if (vertical !== 0 && !quiet && onMove) {\n event.preventDefault();\n const toIndex = index + vertical;\n if (toIndex >= 0 && toIndex < rows.length) {\n pending.current = { kind: \"move\", id: idOf(row), index, cell, order: orderOf(rows) };\n onMove(idOf(row), toIndex);\n }\n }\n return;\n }\n\n if (vertical !== 0) {\n event.preventDefault();\n const next = rows[index + vertical];\n if (next) {\n focusCell(next, cell);\n if (!quiet) {\n select(idOf(next));\n }\n }\n return;\n }\n\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n if (quiet) {\n focusCell(event.key === \"Home\" ? rows[0] : rows[rows.length - 1], cell);\n } else {\n focusCell(row, event.key === \"Home\" ? 0 : cells.length - 1);\n }\n return;\n }\n\n if (quiet) {\n return;\n }\n\n if (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") {\n event.preventDefault();\n const rtl = getComputedStyle(element).direction === \"rtl\";\n const step = (event.key === \"ArrowRight\") === rtl ? -1 : 1;\n if (cells[cell + step]) {\n focusCell(row, cell + step);\n }\n } else if ((event.key === \"Delete\" || event.key === \"Backspace\") && onRemove) {\n event.preventDefault();\n pending.current = { kind: \"remove\", id: idOf(row), index, cell, order: orderOf(rows) };\n onRemove(idOf(row));\n } else if ((event.key === \" \" || event.key === \"Enter\") && cell === 0) {\n // A control keeps Space and Enter for its own action.\n event.preventDefault();\n select(idOf(row));\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>): void => {\n onClick?.(event);\n const target = event.target as HTMLElement;\n const row = rowsOf(event.currentTarget).find((candidate) => candidate.contains(target));\n // A press on a control only acts on the control.\n if (row && !event.defaultPrevented && target.closest('[data-hm-cell=\"control\"]') === null) {\n select(idOf(row));\n }\n };\n\n const handleFocus = (event: FocusEvent<HTMLDivElement>): void => {\n onFocus?.(event);\n syncTabStop(event.currentTarget, event.target);\n };\n\n const handleBlur = (event: FocusEvent<HTMLDivElement>): void => {\n onBlur?.(event);\n // Focus went somewhere else on purpose, so nothing brings it back.\n if (event.relatedTarget && !event.currentTarget.contains(event.relatedTarget)) {\n pending.current = undefined;\n }\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a table can't be a list of rows with one Tab stop; role=\"grid\" on a div is the APG layout grid.\n <div\n {...props}\n ref={(node) => {\n list.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n role=\"grid\"\n aria-label={label}\n className={cx(\"hm-reorderable-list\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onKeyDown={handleKeyDown}\n onClick={handleClick}\n onFocus={handleFocus}\n onBlur={handleBlur}\n >\n <ReorderableListContext.Provider value={{ selectedId }}>\n {children}\n </ReorderableListContext.Provider>\n </div>\n );\n },\n);\n\n/**\n * An item of a {@link ReorderableList}: a row with the item's content, and a\n * cell for each of its `controls`.\n *\n * @public\n */\nexport const ReorderableListItem = /* @__PURE__ */ forwardRef<\n HTMLDivElement,\n ReorderableListItemProps\n>(function ReorderableListItem(\n { id, label, controls, className, classNames, unstyled, children, ...props },\n ref,\n) {\n const selected = useContext(ReorderableListContext)?.selectedId === id;\n return (\n // biome-ignore lint/a11y/useSemanticElements: a row of the APG layout grid; see ReorderableList.\n // biome-ignore lint/a11y/useFocusableInteractive: the row's cells take focus, not the row.\n <div\n {...props}\n ref={ref}\n role=\"row\"\n aria-selected={selected}\n data-hm-id={id}\n className={cx(\"hm-reorderable-list-row\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n {/* biome-ignore lint/a11y/useSemanticElements: a cell of the APG layout grid; see ReorderableList. */}\n <div\n role=\"gridcell\"\n aria-label={label}\n // The list keeps one Tab stop; before it runs, the selected item is it.\n tabIndex={selected ? 0 : -1}\n data-hm-cell=\"item\"\n className={cx(\"hm-reorderable-list-item\", classNames?.item)}\n >\n {children}\n </div>\n {controls?.map((control, index) => (\n // biome-ignore lint/a11y/useSemanticElements: a cell of the APG layout grid; see ReorderableList.\n // biome-ignore lint/a11y/useFocusableInteractive: the control inside the cell takes focus, not the cell.\n <div\n // biome-ignore lint/suspicious/noArrayIndexKey: an item's controls are static and ordered\n key={index}\n role=\"gridcell\"\n data-hm-cell=\"control\"\n className={cx(\"hm-reorderable-list-control\", classNames?.control)}\n >\n {control}\n </div>\n ))}\n </div>\n );\n});\n","import { createContext, useContext } from \"react\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\n\n/** What children of a Toolbar need to know. */\nexport interface ToolbarContextValue {\n readonly orientation: \"horizontal\" | \"vertical\";\n}\n\nexport const ToolbarContext = /* @__PURE__ */ createContext<ToolbarContextValue | undefined>(\n undefined,\n);\n\n/** The enclosing toolbar, or `undefined` outside one. */\nexport function useToolbar(): ToolbarContextValue | undefined {\n checkSingleCopy();\n return useContext(ToolbarContext);\n}\n","import {\n type ForwardedRef,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n} from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { useToolbar } from \"../toolbar/toolbar-context.js\";\n\n/**\n * One choice in a {@link SegmentedControl}.\n *\n * @public\n */\nexport interface SegmentedControlOption<Value extends string> {\n readonly value: Value;\n /** The option's text, and its accessible name when `hideLabel` is set. */\n readonly label: string;\n /** An icon before the label. It draws with `currentColor`. */\n readonly icon?: ReactNode;\n /** Shows only the icon; `label` stays the accessible name. */\n readonly hideLabel?: boolean;\n readonly disabled?: boolean;\n}\n\n/**\n * The parts of a segmented control that `classNames` can target.\n *\n * @public\n */\nexport type SegmentedControlPart = \"root\" | \"option\" | \"icon\" | \"label\";\n\n/**\n * Props of {@link SegmentedControl}.\n *\n * @public\n */\nexport interface SegmentedControlProps<Value extends string>\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\" | \"onChange\">,\n StyleProps<SegmentedControlPart> {\n /** The group's accessible name, such as \"View\". Required. */\n readonly label: string;\n /** The selected option's value. The control is always controlled. */\n readonly value: Value;\n readonly onValueChange: (value: Value) => void;\n readonly options: readonly SegmentedControlOption<Value>[];\n /** Defaults to `medium`. */\n readonly size?: \"medium\" | \"small\" | undefined;\n}\n\nfunction SegmentedControlImpl<Value extends string>(\n {\n label,\n value,\n onValueChange,\n options,\n size = \"medium\",\n className,\n classNames,\n unstyled,\n onKeyDown,\n ...props\n }: SegmentedControlProps<Value>,\n ref: ForwardedRef<HTMLDivElement>,\n): ReactElement {\n // Inside a toolbar, the toolbar owns focus: arrows only move, and Space or\n // Enter selects (APG toolbar). Standalone, it's a radio group: one Tab stop\n // on the selected option, and arrows move and select (APG radio group).\n const inToolbar = useToolbar() !== undefined;\n const enabled = options.filter((option) => !option.disabled);\n const tabStop = enabled.find((option) => option.value === value) ?? enabled[0];\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n if (inToolbar || event.defaultPrevented) {\n return;\n }\n const step =\n event.key === \"ArrowRight\" || event.key === \"ArrowDown\"\n ? 1\n : event.key === \"ArrowLeft\" || event.key === \"ArrowUp\"\n ? -1\n : 0;\n if (step === 0 || enabled.length === 0) {\n return;\n }\n event.preventDefault();\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const horizontal = event.key === \"ArrowRight\" || event.key === \"ArrowLeft\";\n const direction = rtl && horizontal ? -step : step;\n const current = Math.max(\n 0,\n enabled.findIndex((option) => option.value === value),\n );\n const next = enabled[(current + direction + enabled.length) % enabled.length];\n if (next) {\n onValueChange(next.value);\n event.currentTarget\n .querySelector<HTMLElement>(`[data-hm-value=\"${CSS.escape(next.value)}\"]`)\n ?.focus();\n }\n };\n\n return (\n <div\n {...props}\n ref={ref}\n role=\"radiogroup\"\n aria-label={label}\n className={cx(\n \"hm-segmented-control\",\n size === \"small\" && \"hm-segmented-control--small\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onKeyDown={handleKeyDown}\n >\n {options.map((option) => {\n const checked = option.value === value;\n return (\n // biome-ignore lint/a11y/useSemanticElements: native radios select on arrow keys, which a toolbar must not do; buttons with role=\"radio\" are the APG pattern.\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={checked}\n aria-label={option.hideLabel ? option.label : undefined}\n disabled={option.disabled}\n tabIndex={inToolbar ? undefined : option === tabStop ? 0 : -1}\n data-hm-value={option.value}\n className={cx(\"hm-segmented-control-option\", classNames?.option)}\n onClick={() => {\n if (!checked) {\n onValueChange(option.value);\n }\n }}\n >\n {option.icon == null ? null : (\n <span\n className={cx(\"hm-segmented-control-icon\", classNames?.icon)}\n aria-hidden=\"true\"\n >\n {option.icon}\n </span>\n )}\n {option.hideLabel ? null : (\n <span className={cx(\"hm-segmented-control-label\", classNames?.label)}>\n {option.label}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n\n/**\n * A small set of mutually exclusive choices shown side by side, such as a\n * view mode. It's a WAI-ARIA radio group: arrow keys move and select. Inside a\n * {@link Toolbar}, it joins the toolbar's arrow-key navigation instead, and\n * Space or Enter selects.\n *\n * @example\n * ```tsx\n * <SegmentedControl\n * label={messages.t(\"view.label\")}\n * value={view}\n * onValueChange={setView}\n * options={[\n * { value: \"single\", label: messages.t(\"view.single\") },\n * { value: \"grid\", label: messages.t(\"view.grid\"), icon: <GridIcon />, hideLabel: true },\n * ]}\n * />\n * ```\n *\n * @public\n */\nexport const SegmentedControl = /* @__PURE__ */ forwardRef(SegmentedControlImpl) as <\n Value extends string,\n>(\n props: SegmentedControlProps<Value> & RefAttributes<HTMLDivElement>,\n) => ReactElement;\n","import {\n type ChangeEvent,\n forwardRef,\n type InputHTMLAttributes,\n type KeyboardEvent,\n useState,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { decimals, roundTo } from \"../shared/number.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link Slider}. Native input props are passed through.\n *\n * @public\n */\nexport interface SliderProps\n extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n | \"className\"\n | \"type\"\n | \"value\"\n | \"defaultValue\"\n | \"min\"\n | \"max\"\n | \"step\"\n | \"onChange\"\n | \"aria-valuetext\"\n >,\n StyleProps<\"root\"> {\n /** The value, when you control it. Leave it out to let the slider keep its own. */\n readonly value?: number | undefined;\n /** The starting value, when the slider keeps its own. Defaults to `min`. */\n readonly defaultValue?: number | undefined;\n /** Called with the new value as it changes, by pointer or keyboard. */\n readonly onValueChange?: ((value: number) => void) | undefined;\n /** Defaults to 0. */\n readonly min?: number | undefined;\n /** Defaults to 100. */\n readonly max?: number | undefined;\n /** The arrow keys' step, and the values the slider snaps to. Defaults to 1. */\n readonly step?: number | undefined;\n /**\n * The Page Up and Page Down step. Defaults to a tenth of the range, rounded\n * to a whole number of steps.\n */\n readonly largeStep?: number | undefined;\n /**\n * Writes the value as text for screen readers, such as \"−6 dB\" or \"1:05\",\n * exposed as `aria-valuetext`. Without it, they read the number. Format\n * for the user's locale, as `Intl.NumberFormat` does.\n */\n readonly formatValue?: ((value: number) => string) | undefined;\n /**\n * The accessible name, such as \"Volume\". Leave it out inside a `Field`,\n * or when a visible `<label>` points at the slider's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/** Keeps a value in range and on a step from `min`, as the native input does. */\nfunction snap(value: number, min: number, max: number, step: number): number {\n const precision = Math.max(decimals(min), decimals(step));\n // Rounds away float error, such as 3 × 0.1 = 0.30000000000000004, before\n // any comparison, so it can't look like an overshoot.\n const round = (n: number): number => roundTo(n, precision);\n const upper = Math.max(min, max);\n const stepped = round(step > 0 ? min + Math.round((value - min) / step) * step : value);\n // A step that doesn't divide the range can overshoot the top; step back.\n const inRange = stepped > upper && step > 0 ? round(stepped - step) : stepped;\n return Math.min(Math.max(inRange, min), upper);\n}\n\n/**\n * A slider for a value in a range, such as volume or zoom, on the native\n * `<input type=\"range\">`.\n *\n * Arrow keys move by `step`, Page Up and Page Down by `largeStep`, and Home\n * and End to the ends. In right-to-left text, the slider is mirrored and the\n * left and right arrows follow it, in every browser. `formatValue` gives\n * screen readers the value as text.\n *\n * Inside a `Toolbar`, the slider keeps the arrow keys, Home and End, so\n * they can't move focus past it: put it last in the toolbar. Tab still\n * leaves the toolbar.\n *\n * It has no filled part of the track, because one would need an inline\n * style, which a strict Content Security Policy blocks.\n *\n * @example\n * ```tsx\n * <Slider\n * label={messages.t(\"player.volume\")}\n * min={-60}\n * max={0}\n * value={gain}\n * onValueChange={setGain}\n * formatValue={(db) => messages.t(\"player.decibels\", { db })}\n * />\n * ```\n *\n * @public\n */\nexport const Slider = /* @__PURE__ */ forwardRef<HTMLInputElement, SliderProps>(function Slider(\n {\n value: controlled,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n largeStep,\n formatValue,\n label,\n className,\n classNames,\n unstyled,\n onKeyDown,\n ...props\n },\n ref,\n) {\n const [uncontrolled, setUncontrolled] = useState(() => snap(defaultValue ?? min, min, max, step));\n const value = snap(controlled ?? uncontrolled, min, max, step);\n\n const fieldProps = useFieldProps(props, label);\n\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"Slider needs an accessible name: pass label, or point a visible <label> at its id. Use text from your message catalogue.\",\n );\n }\n }\n\n const change = (next: number): void => {\n const snapped = snap(next, min, max, step);\n if (snapped === value) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(snapped);\n }\n onValueChange?.(snapped);\n };\n\n // Pointer changes come from the native input.\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n change(event.currentTarget.valueAsNumber);\n };\n\n // Keys are handled here rather than by the browser, so every engine does\n // the same: WebKit doesn't mirror the arrow keys in right-to-left text.\n const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n onKeyDown?.(event);\n // Alt and Meta combinations stay with the browser and the system.\n if (event.defaultPrevented || event.altKey || event.metaKey) {\n return;\n }\n const large = largeStep ?? Math.max(step, Math.round((max - min) / 10 / step) * step);\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const targets: Record<string, number> = {\n ArrowUp: value + step,\n ArrowDown: value - step,\n ArrowRight: rtl ? value - step : value + step,\n ArrowLeft: rtl ? value + step : value - step,\n PageUp: value + large,\n PageDown: value - large,\n Home: min,\n End: max,\n };\n const next = targets[event.key];\n if (next === undefined) {\n return;\n }\n event.preventDefault();\n change(next);\n };\n\n return (\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n aria-label={label ?? props[\"aria-label\"]}\n aria-valuetext={formatValue?.(value)}\n className={cx(\"hm-slider\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n />\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { useUiText } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link Spinner}.\n *\n * @public\n */\nexport interface SpinnerProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"className\" | \"role\" | \"children\">,\n StyleProps<\"root\"> {\n /** What's loading. Defaults to `spinner.label` from the messages (\"Loading\"). */\n readonly label?: string | undefined;\n}\n\n/**\n * Shows that something is loading, for an unknown time. It's an\n * indeterminate progress bar to assistive technology, named by `label`.\n * Under reduced motion it pulses slowly instead of turning. Its size follows\n * `--hm-spinner-size`.\n *\n * @example\n * ```tsx\n * <Spinner label={messages.t(\"pages.loading\")} />\n * ```\n *\n * @public\n */\nexport const Spinner = /* @__PURE__ */ forwardRef<HTMLSpanElement, SpinnerProps>(function Spinner(\n { label, className, classNames, unstyled, ...props },\n ref,\n) {\n const defaultLabel = useUiText(\"spinner.label\");\n return (\n // A native <progress> can't be drawn as a ring, so this takes its role.\n <span\n {...props}\n ref={ref}\n role=\"progressbar\"\n aria-label={label ?? defaultLabel}\n className={cx(\"hm-spinner\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n />\n );\n});\n","import { type ChangeEvent, forwardRef, type TextareaHTMLAttributes } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * Props of {@link TextArea}. Native textarea props are passed through, so it\n * works controlled with `value` and `onChange`, or uncontrolled with\n * `defaultValue`.\n *\n * @public\n */\nexport interface TextAreaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"className\">,\n StyleProps<\"root\"> {\n /** Called with the new text as it changes, as well as `onChange`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /**\n * The accessible name, such as \"Caption\". Leave it out inside a `Field`,\n * or when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * A multi-line text input, styled like `TextField`, with its tokens. `rows`\n * sets its height, three by default, and the user can drag it taller. Inside\n * a `Field`, it takes the field's label, description and error.\n *\n * Enter adds a line, so it doesn't submit a form. Its value separates lines\n * with `\\n`, whatever was pasted.\n *\n * @example\n * ```tsx\n * <Field label={t(\"text.content\")}>\n * <TextArea value={text} onValueChange={setText} rows={4} />\n * </Field>\n * ```\n *\n * @public\n */\nexport const TextArea = /* @__PURE__ */ forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { rows = 3, onValueChange, onChange, label, className, classNames, unstyled, ...props },\n ref,\n ) {\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"TextArea needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>): void => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n return (\n <textarea\n {...props}\n {...fieldProps}\n ref={ref}\n rows={rows}\n aria-label={label ?? props[\"aria-label\"]}\n // A text field, with its class and tokens, then the area's own layout.\n className={cx(\"hm-text-field\", \"hm-text-area\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n />\n );\n },\n);\n","import { type ChangeEvent, forwardRef, type InputHTMLAttributes } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { useFieldProps } from \"../field/field-context.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The kinds of single-line text a {@link TextField} takes.\n *\n * @public\n */\nexport type TextFieldType = \"text\" | \"search\" | \"email\" | \"url\" | \"tel\" | \"password\";\n\n/**\n * Props of {@link TextField}. Native input props are passed through, so it\n * works controlled with `value` and `onChange`, or uncontrolled with\n * `defaultValue`.\n *\n * @public\n */\nexport interface TextFieldProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, \"className\" | \"type\">,\n StyleProps<\"root\"> {\n /** Defaults to `text`. */\n readonly type?: TextFieldType | undefined;\n /** Called with the new text as it changes, as well as `onChange`. */\n readonly onValueChange?: ((value: string) => void) | undefined;\n /**\n * The accessible name, such as \"File name\". Leave it out inside a\n * `Field`, or when a visible `<label>` points at the field's `id`, or\n * `aria-labelledby` names it.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * A single-line text input, styled like the family's other fields. Inside a\n * `Field`, it takes the field's label, description and error.\n *\n * @example\n * ```tsx\n * <Field label={t(\"export.fileName\")} error={nameError}>\n * <TextField value={name} onValueChange={setName} autoComplete=\"off\" />\n * </Field>\n * ```\n *\n * @public\n */\nexport const TextField = /* @__PURE__ */ forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n { type = \"text\", onValueChange, onChange, label, className, classNames, unstyled, ...props },\n ref,\n ) {\n const fieldProps = useFieldProps(props, label);\n if (\n label === undefined &&\n !props[\"aria-label\"] &&\n !props[\"aria-labelledby\"] &&\n fieldProps.id === undefined\n ) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"TextField needs an accessible name: pass label, or put it in a Field. Use text from your message catalogue.\",\n );\n }\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>): void => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n };\n\n return (\n <input\n {...props}\n {...fieldProps}\n ref={ref}\n type={type}\n aria-label={label ?? props[\"aria-label\"]}\n className={cx(\"hm-text-field\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onChange={handleChange}\n />\n );\n },\n);\n","import { snap as snapTo } from \"@hussmartinez/sdk-core\";\nimport {\n createContext,\n forwardRef,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { checkSingleCopy } from \"../../internal/single-copy.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/** How close a pointer snaps to a target, in CSS pixels (sdk-core ADR 0042). */\nconst SNAP_PIXELS = 8;\n\n/**\n * The widest a track gets, in CSS pixels. Engines stop laying out boxes\n * somewhere above sixteen million pixels, so the zoom stops well before.\n */\nconst MAX_TRACK_PIXELS = 8_000_000;\n\n/**\n * A range of a timeline, in whole units: `start` is the first unit in it,\n * and `end` is the one after its last.\n *\n * @public\n */\nexport interface TimelineRange {\n readonly start: number;\n readonly end: number;\n}\n\n/**\n * How a {@link Timeline} maps its units to pixels, for the parts and layers\n * inside it. Units are whole numbers, such as frames or samples\n * (sdk-core ADR 0042).\n *\n * @public\n */\nexport interface TimelineScale {\n /** The timeline's length, in units. */\n readonly length: number;\n /**\n * CSS pixels for one unit at the current zoom. It's 0 until the timeline\n * has measured itself, which is after the first render in a browser, and\n * always on a server.\n */\n readonly pixelsPerUnit: number;\n /** A unit's distance from the start of the track, in CSS pixels. */\n readonly toPixels: (unit: number) => number;\n /**\n * The unit under a pointer, from its `clientX`, within `0…length`. It\n * follows the reading direction. With `snap`, it snaps to the timeline's\n * targets when `snapping` is on.\n */\n readonly unitAt: (clientX: number, options?: { readonly snap?: boolean }) => number;\n /** A unit snapped to the nearest target within reach, or itself. */\n readonly snap: (unit: number) => number;\n /** The units in view now. Read it when you draw; it isn't state. */\n readonly visibleRange: () => TimelineRange;\n}\n\ninterface TimelineContextValue {\n readonly scale: TimelineScale;\n readonly viewport: RefObject<HTMLDivElement | null>;\n readonly track: RefObject<HTMLDivElement | null>;\n /** Adds snap targets that change over time, such as the playhead. */\n readonly addTargets: (read: () => readonly number[]) => () => void;\n}\n\nconst TimelineContext = /* @__PURE__ */ createContext<TimelineContextValue | undefined>(undefined);\n\n/** The enclosing timeline's context, for its own parts. */\nexport function useTimelineContext(part: string): TimelineContextValue | undefined {\n checkSingleCopy();\n const context = useContext(TimelineContext);\n if (!context) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(`${part} needs a Timeline above it.`);\n }\n }\n return context;\n}\n\nconst NO_SCALE: TimelineScale = {\n length: 0,\n pixelsPerUnit: 0,\n toPixels: () => 0,\n unitAt: () => 0,\n snap: (unit) => unit,\n visibleRange: () => ({ start: 0, end: 0 }),\n};\n\n/**\n * The scale of the {@link Timeline} around a layer or a part: units to\n * pixels and back, snapping, and the range in view.\n *\n * @example\n * ```tsx\n * function Markers({ at }: { at: readonly number[] }) {\n * const scale = useTimelineScale();\n * // Draw each marker at scale.toPixels(unit); hit-test with scale.unitAt(event.clientX).\n * }\n * ```\n *\n * @public\n */\nexport function useTimelineScale(): TimelineScale {\n return useTimelineContext(\"useTimelineScale\")?.scale ?? NO_SCALE;\n}\n\n/**\n * The parts of a timeline that `classNames` can target.\n *\n * @public\n */\nexport type TimelinePart = \"root\" | \"viewport\" | \"track\";\n\n/**\n * Props of {@link Timeline}.\n *\n * @public\n */\nexport interface TimelineProps\n extends Omit<HTMLAttributes<HTMLElement>, \"className\">,\n StyleProps<TimelinePart> {\n /** The timeline's accessible name, such as \"Timeline\". Required. */\n readonly label: string;\n /** The length of what's on the timeline, in whole units, such as frames or samples. */\n readonly length: number;\n /**\n * The zoom, as a multiple of fitting `length` to the timeline's width.\n * Defaults to 1, which fits; less than 1 fits too.\n */\n readonly zoom?: number | undefined;\n /** The closest zoom, in CSS pixels for one unit. Defaults to 48. */\n readonly maxPixelsPerUnit?: number | undefined;\n /**\n * Called with the largest `zoom` that has an effect, when it changes with\n * the timeline's width or `length`, so zoom controls know when to stop.\n */\n readonly onMaxZoomChange?: ((maxZoom: number) => void) | undefined;\n /**\n * Whether pointers snap to targets, within 8 CSS pixels. Defaults to\n * `true`. Holding Alt turns it off for one gesture.\n */\n readonly snapping?: boolean | undefined;\n /** More units to snap to, such as markers. The playhead and the clips' boundaries always are. */\n readonly snapTargets?: readonly number[] | undefined;\n /**\n * Called with the units in view when they change, by scrolling, zooming\n * or resizing: for a layer that draws only what's visible, such as a\n * waveform on a canvas.\n */\n readonly onVisibleRangeChange?: ((range: TimelineRange) => void) | undefined;\n /** The timeline's parts and layers, in the order they stack. */\n readonly children?: ReactNode;\n}\n\n/** Whether an element lays out right to left. */\nconst isRtl = (element: Element): boolean => getComputedStyle(element).direction === \"rtl\";\n\n/**\n * A timeline over whole units, such as frames or samples: a scrolling track\n * as wide as `length` at the current zoom, for a playhead, clips and an\n * editor's own layers (docs/adr/0011). It formats no time and has no text\n * of its own: names and values come from you.\n *\n * - **Zoom** is yours: `zoom` is a multiple of fitting `length` to the\n * width, and `onMaxZoomChange` says where it stops.\n * - **Snapping** pulls a pointer to the playhead, the clips' boundaries and\n * your `snapTargets`, within 8 CSS pixels at any zoom.\n * - **Layers** are your own drawing, such as a waveform, sized to the\n * track. `useTimelineScale()` gives them the same mapping the parts use.\n *\n * @example\n * ```tsx\n * <Timeline label={t(\"timeline.label\")} length={frames} zoom={zoom} onMaxZoomChange={setMaxZoom}>\n * <TimelineLayer>\n * <Waveform />\n * </TimelineLayer>\n * <TimelinePlayhead\n * label={t(\"timeline.playhead\")}\n * position={playhead}\n * onPositionChange={seek}\n * largeStep={framesPerSecond}\n * formatValue={formatTime}\n * />\n * </Timeline>\n * ```\n *\n * @public\n */\nexport const Timeline = /* @__PURE__ */ forwardRef<HTMLElement, TimelineProps>(function Timeline(\n {\n label,\n length: rawLength,\n zoom = 1,\n maxPixelsPerUnit = 48,\n onMaxZoomChange,\n snapping = true,\n snapTargets,\n onVisibleRangeChange,\n className,\n classNames,\n unstyled,\n children,\n ...props\n },\n ref,\n) {\n const length = Number.isSafeInteger(rawLength) && rawLength > 0 ? rawLength : 0;\n const viewport = useRef<HTMLDivElement | null>(null);\n const track = useRef<HTMLDivElement | null>(null);\n // The width the track has to fit into; 0 until it's measured.\n const [room, setRoom] = useState(0);\n // The viewport's padding before the track, which scrolls with it.\n const lead = useRef(0);\n const targets = useRef(new Set<() => readonly number[]>());\n\n // Measured and sized when React commits, through ref callbacks, so the\n // first frame painted is already sized. A ref callback runs only in a\n // browser, so nothing here reads the browser on a server, and there's no\n // layout effect for React 18 to warn about there.\n const measure = (element: HTMLDivElement): void => {\n const style = getComputedStyle(element);\n const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);\n lead.current = Number.parseFloat(style.paddingInlineStart) || 0;\n // The same width again changes nothing, so this settles in one more render.\n setRoom(Math.max(0, element.clientWidth - padding));\n };\n const remeasure = useRef(measure);\n remeasure.current = measure;\n useEffect(() => {\n const element = viewport.current;\n if (!element) {\n return;\n }\n const observer = new ResizeObserver(() => remeasure.current(element));\n observer.observe(element);\n return () => observer.disconnect();\n }, []);\n\n const fit = length > 0 && room > 0 ? room / length : 0;\n // Never closer than one unit to maxPixelsPerUnit, nor a track too wide to\n // lay out, and never further than fitting.\n const closest = Math.max(fit, Math.min(maxPixelsPerUnit, MAX_TRACK_PIXELS / Math.max(length, 1)));\n const pixelsPerUnit = Math.min(Math.max(fit * zoom, fit), closest);\n const maxZoom = fit > 0 ? closest / fit : 1;\n\n const notifyMaxZoom = useRef(onMaxZoomChange);\n notifyMaxZoom.current = onMaxZoomChange;\n useEffect(() => {\n if (fit > 0) {\n notifyMaxZoom.current?.(maxZoom);\n }\n }, [fit, maxZoom]);\n\n // Sizes go through the CSSOM: a style attribute would be blocked by a\n // strict Content Security Policy when rendered on a server.\n const sizeTrack = (element: HTMLDivElement): void => {\n element.style.inlineSize = pixelsPerUnit > 0 ? `${length * pixelsPerUnit}px` : \"\";\n };\n\n const settings = useRef({ snapping, snapTargets });\n settings.current = { snapping, snapTargets };\n\n const scale = useMemo<TimelineScale>(() => {\n const snap = (unit: number): number => {\n if (!settings.current.snapping || pixelsPerUnit <= 0) {\n return unit;\n }\n const all = [...(settings.current.snapTargets ?? [])];\n for (const read of targets.current) {\n all.push(...read());\n }\n const valid = all.filter((target) => Number.isSafeInteger(target) && target >= 0);\n return snapTo(unit, valid, Math.round(SNAP_PIXELS / pixelsPerUnit));\n };\n return {\n length,\n pixelsPerUnit,\n toPixels: (unit) => unit * pixelsPerUnit,\n unitAt: (clientX, options) => {\n const element = track.current;\n if (!element || pixelsPerUnit <= 0) {\n return 0;\n }\n const box = element.getBoundingClientRect();\n const offset = isRtl(element) ? box.right - clientX : clientX - box.left;\n const unit = Math.min(Math.max(Math.round(offset / pixelsPerUnit), 0), length);\n return options?.snap ? Math.min(snap(unit), length) : unit;\n },\n snap,\n visibleRange: () => {\n const element = viewport.current;\n if (!element || pixelsPerUnit <= 0) {\n return { start: 0, end: length };\n }\n // scrollLeft is negative in right-to-left text. The track starts\n // after the viewport's padding.\n const start = (Math.abs(element.scrollLeft) - lead.current) / pixelsPerUnit;\n return {\n start: Math.min(Math.max(Math.floor(start), 0), length),\n end: Math.min(\n Math.max(Math.ceil(start + element.clientWidth / pixelsPerUnit), 0),\n length,\n ),\n };\n },\n };\n }, [length, pixelsPerUnit]);\n\n const addTargets = useCallback((read: () => readonly number[]) => {\n targets.current.add(read);\n return () => {\n targets.current.delete(read);\n };\n }, []);\n\n const notifyRange = useRef(onVisibleRangeChange);\n notifyRange.current = onVisibleRangeChange;\n const lastRange = useRef(\"\");\n const reportRange = useCallback((): void => {\n const range = scale.visibleRange();\n const key = `${range.start}:${range.end}`;\n if (key !== lastRange.current && scale.pixelsPerUnit > 0) {\n lastRange.current = key;\n notifyRange.current?.(range);\n }\n }, [scale]);\n // After a zoom, a resize or a change of length; scrolling reports itself.\n // biome-ignore lint/correctness/useExhaustiveDependencies: room changes the range without changing the scale's identity when the zoom is capped.\n useEffect(reportRange, [reportRange, room]);\n\n const context = useMemo<TimelineContextValue>(\n () => ({ scale, viewport, track, addTargets }),\n [scale, addTargets],\n );\n\n return (\n <section\n {...props}\n ref={ref}\n aria-label={label}\n className={cx(\"hm-timeline\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <div\n // A new function each render, so React calls it at every commit.\n ref={(node) => {\n viewport.current = node;\n if (node) {\n measure(node);\n }\n }}\n className={cx(\"hm-timeline-viewport\", classNames?.viewport)}\n onScroll={reportRange}\n >\n <div\n ref={(node) => {\n track.current = node;\n if (node) {\n sizeTrack(node);\n }\n }}\n className={cx(\"hm-timeline-track\", classNames?.track)}\n >\n <TimelineContext.Provider value={context}>{children}</TimelineContext.Provider>\n </div>\n </div>\n </section>\n );\n});\n\n/**\n * Props of {@link TimelineLayer}.\n *\n * @public\n */\nexport interface TimelineLayerProps extends HTMLAttributes<HTMLDivElement> {\n /** Your drawing: a canvas, markers, a selection. Size it to the layer. */\n readonly children?: ReactNode;\n}\n\n/**\n * A layer of a {@link Timeline} for an editor's own drawing, such as a\n * waveform or a selected range: a box the size of the track. Layers and\n * parts stack in the order written. A layer is as tall as its content, and\n * at least `--hm-timeline-lane-height`.\n *\n * What a layer draws is invisible to assistive technology unless you say\n * otherwise, so give a text equivalent elsewhere, and mark a canvas\n * `aria-hidden`.\n *\n * @public\n */\nexport const TimelineLayer = /* @__PURE__ */ forwardRef<HTMLDivElement, TimelineLayerProps>(\n function TimelineLayer({ className, children, ...props }, ref) {\n return (\n <div {...props} ref={ref} className={cx(\"hm-timeline-layer\", className)}>\n {children}\n </div>\n );\n },\n);\n","import { sequenceOffsets } from \"@hussmartinez/sdk-core\";\nimport {\n type FocusEvent,\n forwardRef,\n type KeyboardEvent,\n type MouseEvent,\n memo,\n type PointerEvent,\n type ReactNode,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { useTimelineContext } from \"./Timeline.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * A clip on a {@link TimelineClips} track.\n *\n * @public\n */\nexport interface TimelineClip {\n /** Identifies the clip in `selectedKeys`. Unique on the track. */\n readonly key: string;\n /** The clip's length, in the timeline's units: a whole number, at least 1. */\n readonly length: number;\n /**\n * The clip's accessible name, with its place and range, such as\n * \"Clip 2 of 5, 0:04.00 to 0:09.20, muted\". Use text from your message\n * catalogue.\n */\n readonly label: string;\n /** What the clip shows, such as its name or a thumbnail. It's cut off where the clip ends. */\n readonly content?: ReactNode;\n /** `data-*` attributes for the clip, for your own states, such as `data-muted`. */\n readonly attributes?: Readonly<Record<`data-${string}`, string | undefined>> | undefined;\n}\n\n/**\n * The parts of a clip track that `classNames` can target.\n *\n * @public\n */\nexport type TimelineClipsPart = \"root\" | \"clip\" | \"content\";\n\n/**\n * What a {@link TimelineClips} ref gives.\n *\n * @public\n */\nexport interface TimelineClipsHandle {\n /** Moves focus to a clip, and scrolls it into view. Returns whether it's on the track. */\n focusClip(key: string): boolean;\n}\n\n/**\n * Props of {@link TimelineClips}.\n *\n * @public\n */\nexport interface TimelineClipsProps extends StyleProps<TimelineClipsPart> {\n /** The track's accessible name, such as \"Clips\". Required. */\n readonly label: string;\n /** The clips, in the order they play. */\n readonly clips: readonly TimelineClip[];\n /**\n * `single`, the default, keeps one clip selected: the focused one.\n * `multiple` adds Shift to extend the selection, Ctrl or ⌘ to move\n * without changing it, and Space to add or remove the focused clip.\n */\n readonly selectionMode?: \"single\" | \"multiple\" | undefined;\n /** The selected clips' keys. */\n readonly selectedKeys: readonly string[];\n /** Called with the new selection, in the clips' order. */\n readonly onSelectedKeysChange: (keys: readonly string[]) => void;\n /**\n * Called when the user moves clips with Alt+← or Alt+→ (Option on macOS),\n * with the keys to move, in order, and `-1` for earlier or `1` for later.\n * They're the selected clips when the focused one is selected, and the\n * focused clip otherwise. Render the clips in the new order, or leave them\n * when the move isn't allowed. The keys are taken at the first and last\n * clips too, and without `onMove`, so the browser never goes back instead.\n */\n readonly onMove?: ((keys: readonly string[], direction: -1 | 1) => void) | undefined;\n /**\n * Called when the user changes a clip's length at one edge, by dragging\n * the edge or with Alt+`[` and Alt+`]`, with the change in units:\n * positive makes the clip longer at that edge, negative shorter. A drag\n * calls it once, when it ends. With it, each clip has edges to drag.\n */\n readonly onTrim?: ((key: string, edge: TimelineClipEdge, delta: number) => void) | undefined;\n /**\n * Called for `[` and `]` on a focused clip: set its start or its end to\n * the playhead. You know where the playhead is.\n */\n readonly onTrimToPlayhead?: ((key: string, edge: TimelineClipEdge) => void) | undefined;\n /** What Alt+`[` and Alt+`]` change an edge by, in units. Defaults to 1. */\n readonly trimStep?: number | undefined;\n /**\n * How far an edge can go, as `onTrim`'s `delta`, such as up to its\n * source's end. A drag stops there. Without it, a clip can shrink to one\n * unit and grow without limit.\n */\n readonly trimLimits?:\n | ((key: string, edge: TimelineClipEdge) => { readonly min?: number; readonly max?: number })\n | undefined;\n}\n\n/**\n * A clip's edge: its start, or its end.\n *\n * @public\n */\nexport type TimelineClipEdge = \"start\" | \"end\";\n\n/** An edge being dragged, and how far it has gone, as `onTrim`'s `delta`. */\ninterface Drag {\n readonly key: string;\n readonly edge: TimelineClipEdge;\n readonly delta: number;\n}\n\ninterface ClipProps {\n readonly clip: TimelineClip;\n readonly selected: boolean;\n readonly tabStop: boolean;\n readonly clipClass: string | undefined;\n readonly contentClass: string | undefined;\n /** Whether the clip has edges to drag. */\n readonly edges: boolean;\n /** The edge of this clip being dragged, if one is. */\n readonly dragging: TimelineClipEdge | undefined;\n}\n\n/** One option. Memoised, so a change of selection renders only the clips it changes. */\nconst Clip = /* @__PURE__ */ memo(function Clip({\n clip,\n selected,\n tabStop,\n clipClass,\n contentClass,\n edges,\n dragging,\n}: ClipProps) {\n return (\n <div\n {...clip.attributes}\n role=\"option\"\n aria-selected={selected}\n aria-label={clip.label}\n tabIndex={tabStop ? 0 : -1}\n data-hm-key={clip.key}\n data-hm-dragging={dragging}\n className={clipClass}\n >\n {clip.content == null ? null : <span className={contentClass}>{clip.content}</span>}\n {/* For a pointer only: the keys and the host's buttons are the other ways. */}\n {edges ? (\n <>\n <span className=\"hm-timeline-clip-edge\" data-hm-edge=\"start\" aria-hidden=\"true\" />\n <span className=\"hm-timeline-clip-edge\" data-hm-edge=\"end\" aria-hidden=\"true\" />\n </>\n ) : null}\n </div>\n );\n});\n\n/**\n * The clip track of a {@link Timeline}: a horizontal listbox with one Tab\n * stop, each clip as wide as its length at the timeline's zoom\n * (docs/adr/0011).\n *\n * - **← and →** move between clips, and Home and End go to the first and\n * last. They follow the reading direction. The selection follows focus.\n * - **With `selectionMode=\"multiple\"`,** Shift extends the selection from\n * the last clip chosen; Ctrl or ⌘ moves focus without changing it; Space\n * adds or removes the focused clip, and Shift+Space selects up to it;\n * Ctrl or ⌘+A selects every clip. A click selects, a Shift-click\n * extends, and a Ctrl- or ⌘-click adds or removes.\n * - **Clips are data.** Give each a `label` that says its place and range,\n * since a screen reader can't see where it is on the track.\n * - **When the focused clip goes,** focus moves to the clip that took its\n * place, or the one before, or the playhead, if focus was on the track.\n *\n * The clips' boundaries are snap targets for the rest of the timeline.\n *\n * @example\n * ```tsx\n * <TimelineClips\n * label={t(\"timeline.clips\")}\n * selectionMode=\"multiple\"\n * clips={plan.clips.map((clip, index) => ({\n * key: clip.key,\n * length: framesOf(clip),\n * label: t(\"timeline.clip\", { index: index + 1, count: plan.clips.length, … }),\n * content: clip.name,\n * }))}\n * selectedKeys={selected}\n * onSelectedKeysChange={setSelected}\n * />\n * ```\n *\n * @public\n */\nexport const TimelineClips = /* @__PURE__ */ forwardRef<TimelineClipsHandle, TimelineClipsProps>(\n function TimelineClips(\n {\n label,\n clips: given,\n selectionMode = \"single\",\n selectedKeys,\n onSelectedKeysChange,\n onMove,\n onTrim,\n onTrimToPlayhead,\n trimStep = 1,\n trimLimits,\n className,\n classNames,\n unstyled,\n },\n ref,\n ) {\n const context = useTimelineContext(\"TimelineClips\");\n const pixelsPerUnit = context?.scale.pixelsPerUnit ?? 0;\n const multiple = selectionMode === \"multiple\";\n\n // A clip has a whole, positive length (sdk-core ADR 0042); others are left out.\n const clips = useMemo(() => {\n const valid = given.filter((clip) => Number.isSafeInteger(clip.length) && clip.length > 0);\n if (valid.length !== given.length) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"TimelineClips left out a clip whose length isn't a whole number of at least 1.\",\n );\n }\n }\n return valid;\n }, [given]);\n const offsets = useMemo(() => sequenceOffsets(clips.map((clip) => clip.length)), [clips]);\n\n const list = useRef<HTMLDivElement | null>(null);\n const [focusKey, setFocusKey] = useState<string | null>(null);\n // The clip a Shift selection extends from.\n const anchor = useRef<string | null>(null);\n // Whether focus was last seen on the track, and where.\n const held = useRef<{ readonly key: string; readonly index: number } | null>(null);\n // Whether the last key asked the host to move clips.\n const moved = useRef(false);\n\n const selected = useMemo(() => new Set(selectedKeys), [selectedKeys]);\n const tabStop =\n clips.find((clip) => clip.key === focusKey) ??\n clips.find((clip) => selected.has(clip.key)) ??\n clips[0];\n\n const option = (key: string): HTMLElement | null => {\n for (const element of list.current?.children ?? []) {\n if ((element as HTMLElement).dataset[\"hmKey\"] === key) {\n return element as HTMLElement;\n }\n }\n return null;\n };\n\n /** Focuses a clip, and scrolls the timeline so it's in view. */\n const focusClip = (key: string): boolean => {\n const element = option(key);\n if (!element) {\n return false;\n }\n setFocusKey(key);\n element.focus({ preventScroll: true });\n const viewport = context?.viewport.current;\n if (viewport) {\n const box = element.getBoundingClientRect();\n const view = viewport.getBoundingClientRect();\n if (box.left < view.left) {\n viewport.scrollLeft -= view.left - box.left;\n } else if (box.right > view.right) {\n // A clip wider than the view shows its start.\n viewport.scrollLeft += Math.min(box.right - view.right, box.left - view.left);\n }\n }\n return true;\n };\n useImperativeHandle(ref, () => ({ focusClip }));\n\n // The clips' boundaries are snap targets for the timeline's other parts.\n const addTargets = context?.addTargets;\n const boundaries = useRef(offsets);\n boundaries.current = offsets;\n useEffect(() => addTargets?.(() => boundaries.current), [addTargets]);\n\n // Widths go through the CSSOM, as the track's does, from a ref callback,\n // so they're there in the frame React commits. Only when the clips or the\n // scale changed: a change of selection sizes nothing.\n const [drag, setDrag] = useState<Drag | null>(null);\n const sized = useRef<{\n clips: readonly TimelineClip[];\n scale: number;\n drag: Drag | null;\n } | null>(null);\n const sizeClips = (element: HTMLDivElement): void => {\n if (\n sized.current?.clips === clips &&\n sized.current.scale === pixelsPerUnit &&\n sized.current.drag === drag\n ) {\n return;\n }\n sized.current = { clips, scale: pixelsPerUnit, drag };\n const elements = element.children;\n for (let index = 0; index < elements.length; index++) {\n const clip = clips[index];\n // A dragged edge shows its clip at the length it would have.\n const length = (clip?.length ?? 0) + (clip && drag?.key === clip.key ? drag.delta : 0);\n (elements[index] as HTMLElement).style.inlineSize =\n pixelsPerUnit > 0 ? `${length * pixelsPerUnit}px` : \"\";\n }\n };\n\n // When the clip that held focus is gone, and focus with it, focus goes\n // to the clip that took its place, or the one before, or the playhead.\n // Never from elsewhere: only when nothing has focus.\n useEffect(() => {\n const was = held.current;\n if (!was) {\n return;\n }\n if (clips.some((clip) => clip.key === was.key)) {\n // After a move, the browser may have dropped focus from the clip as\n // React put it in its new place: it goes back, if nothing else has it.\n const active = document.activeElement;\n if (moved.current && (!active || active === document.body)) {\n focusClip(was.key);\n }\n moved.current = false;\n return;\n }\n moved.current = false;\n held.current = null;\n const active = document.activeElement;\n if (active && active !== document.body) {\n return;\n }\n const next = clips[Math.min(was.index, clips.length - 1)];\n if (next) {\n focusClip(next.key);\n } else {\n context?.track.current?.querySelector<HTMLElement>(\".hm-timeline-playhead-slider\")?.focus();\n }\n });\n\n // An edge being dragged: where it started, and what bounds it.\n const dragging = useRef<{\n readonly pointerId: number;\n readonly x: number;\n readonly key: string;\n readonly edge: TimelineClipEdge;\n readonly boundary: number;\n readonly min: number;\n readonly max: number;\n /** How far the edge has gone; kept here too, for the moment the drag ends. */\n delta: number;\n } | null>(null);\n\n const handlePointerDown = (event: PointerEvent<HTMLDivElement>): void => {\n const handle = (event.target as HTMLElement).closest<HTMLElement>(\"[data-hm-edge]\");\n const key = handle?.closest<HTMLElement>(\"[data-hm-key]\")?.dataset[\"hmKey\"];\n const index = clips.findIndex((clip) => clip.key === key);\n const clip = clips[index];\n if (!handle || !clip || !onTrim || event.button !== 0 || pixelsPerUnit <= 0) {\n return;\n }\n const edge: TimelineClipEdge = handle.dataset[\"hmEdge\"] === \"start\" ? \"start\" : \"end\";\n const limits = trimLimits?.(clip.key, edge);\n dragging.current = {\n pointerId: event.pointerId,\n x: event.clientX,\n key: clip.key,\n edge,\n boundary: offsets[edge === \"start\" ? index : index + 1] ?? 0,\n // Never shorter than one unit.\n min: Math.max(limits?.min ?? Number.NEGATIVE_INFINITY, 1 - clip.length),\n max: limits?.max ?? Number.POSITIVE_INFINITY,\n delta: 0,\n };\n try {\n handle.setPointerCapture(event.pointerId);\n } catch {\n // The pointer is up already; its events still arrive here.\n }\n setDrag({ key: clip.key, edge, delta: 0 });\n };\n\n const handlePointerMove = (event: PointerEvent<HTMLDivElement>): void => {\n const start = dragging.current;\n if (!start || event.pointerId !== start.pointerId || pixelsPerUnit <= 0) {\n return;\n }\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const along = rtl ? start.x - event.clientX : event.clientX - start.x;\n const to = Math.max(0, start.boundary + Math.round(along / pixelsPerUnit));\n // Alt turns snapping off for this drag.\n const snapped = event.altKey ? to : (context?.scale.snap(to) ?? to);\n // The start's edge makes the clip longer as it moves earlier.\n const change = start.edge === \"start\" ? start.boundary - snapped : snapped - start.boundary;\n const delta = Math.min(Math.max(change, start.min), start.max);\n start.delta = delta;\n setDrag((current) => (current && current.delta !== delta ? { ...current, delta } : current));\n };\n\n const endDrag = (commit: boolean): void => {\n const start = dragging.current;\n dragging.current = null;\n setDrag(null);\n if (commit && start && start.delta !== 0) {\n onTrim?.(start.key, start.edge, start.delta);\n }\n };\n\n // Escape cancels a drag, wherever focus is.\n const isDragging = drag !== null;\n useEffect(() => {\n if (!isDragging) {\n return;\n }\n const onKeyDown = (event: globalThis.KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n dragging.current = null;\n setDrag(null);\n }\n };\n document.addEventListener(\"keydown\", onKeyDown, true);\n return () => document.removeEventListener(\"keydown\", onKeyDown, true);\n }, [isDragging]);\n\n const select = (keys: Iterable<string>): void => {\n const wanted = new Set(keys);\n const next = clips.filter((clip) => wanted.has(clip.key)).map((clip) => clip.key);\n if (next.length !== selectedKeys.length || next.some((key, i) => key !== selectedKeys[i])) {\n onSelectedKeysChange(next);\n }\n };\n\n /** The keys from the anchor to a clip, in either order. */\n const range = (to: number): string[] => {\n const from = Math.max(\n 0,\n clips.findIndex((clip) => clip.key === anchor.current),\n );\n return clips.slice(Math.min(from, to), Math.max(from, to) + 1).map((clip) => clip.key);\n };\n\n const toggle = (key: string): void => {\n const next = new Set(selected);\n if (!next.delete(key)) {\n next.add(key);\n }\n anchor.current = key;\n select(next);\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (event.defaultPrevented || event.nativeEvent.isComposing) {\n return;\n }\n const key = (event.target as HTMLElement).dataset[\"hmKey\"];\n const index = clips.findIndex((clip) => clip.key === key);\n const current = clips[index];\n if (!current) {\n return;\n }\n const mod = event.ctrlKey || event.metaKey;\n const rtl = getComputedStyle(event.currentTarget).direction === \"rtl\";\n const forward = rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = rtl ? \"ArrowRight\" : \"ArrowLeft\";\n // By position, not character: Alt changes what the brackets type on\n // Apple's layouts, and other layouts put them elsewhere.\n const edge: TimelineClipEdge | undefined =\n event.code === \"BracketLeft\" ? \"start\" : event.code === \"BracketRight\" ? \"end\" : undefined;\n\n if (event.altKey) {\n if (mod) {\n return;\n }\n if ((event.key === forward || event.key === backward) && !event.shiftKey) {\n // Always taken in the track, at its ends and without onMove too:\n // unprevented, Alt with an arrow is the browser's Back or Forward.\n event.preventDefault();\n if (onMove) {\n moved.current = true;\n onMove(\n selected.has(current.key)\n ? clips.filter((clip) => selected.has(clip.key)).map((clip) => clip.key)\n : [current.key],\n event.key === forward ? 1 : -1,\n );\n }\n } else if (edge && onTrim) {\n // Inward, which shortens the clip; with Shift, outward.\n event.preventDefault();\n onTrim(current.key, edge, event.shiftKey ? trimStep : -trimStep);\n }\n return;\n }\n if (edge && !mod && !event.shiftKey) {\n if (onTrimToPlayhead) {\n event.preventDefault();\n onTrimToPlayhead(current.key, edge);\n }\n return;\n }\n\n let to: number | undefined;\n if (event.key === forward) {\n to = Math.min(index + 1, clips.length - 1);\n } else if (event.key === backward) {\n to = Math.max(index - 1, 0);\n } else if (event.key === \"Home\") {\n to = 0;\n } else if (event.key === \"End\") {\n to = clips.length - 1;\n }\n const target = to === undefined ? undefined : clips[to];\n if (to !== undefined && target) {\n // With Shift and Ctrl or ⌘ together, the key isn't the track's.\n if (event.shiftKey && (mod || !multiple)) {\n return;\n }\n event.preventDefault();\n focusClip(target.key);\n if (event.shiftKey) {\n select(range(to));\n } else if (!mod) {\n anchor.current = target.key;\n select([target.key]);\n }\n return;\n }\n\n if (event.key === \" \" || (event.key === \"Enter\" && !mod && !event.shiftKey)) {\n event.preventDefault();\n if (!multiple) {\n select([current.key]);\n } else if (event.shiftKey) {\n select(range(index));\n } else if (event.key === \" \") {\n toggle(current.key);\n } else {\n anchor.current = current.key;\n select([current.key]);\n }\n } else if (multiple && mod && !event.shiftKey && event.key.toLowerCase() === \"a\") {\n event.preventDefault();\n select(clips.map((clip) => clip.key));\n }\n };\n\n const handleClick = (event: MouseEvent<HTMLDivElement>): void => {\n const element = (event.target as HTMLElement).closest<HTMLElement>(\"[data-hm-key]\");\n const key = element?.dataset[\"hmKey\"];\n const index = clips.findIndex((clip) => clip.key === key);\n if (key === undefined || index === -1 || event.defaultPrevented) {\n return;\n }\n setFocusKey(key);\n if (multiple && event.shiftKey) {\n select(range(index));\n } else if (multiple && (event.ctrlKey || event.metaKey)) {\n toggle(key);\n } else {\n anchor.current = key;\n select([key]);\n }\n };\n\n const handleFocus = (event: FocusEvent<HTMLDivElement>): void => {\n const key = (event.target as HTMLElement).dataset[\"hmKey\"];\n const index = clips.findIndex((clip) => clip.key === key);\n if (key !== undefined && index !== -1) {\n held.current = { key, index };\n setFocusKey(key);\n anchor.current ??= key;\n }\n };\n\n const handleBlur = (event: FocusEvent<HTMLDivElement>): void => {\n if (event.relatedTarget) {\n // Focus went somewhere on purpose, inside the track or out of it.\n if (!event.currentTarget.contains(event.relatedTarget)) {\n held.current = null;\n }\n return;\n }\n // With nowhere to go, either the user left the page's controls, or the\n // clip was removed: only then is it gone from the track a moment later.\n const target = event.target;\n queueMicrotask(() => {\n if (target.isConnected) {\n held.current = null;\n }\n });\n };\n\n const clipClass = cx(\"hm-timeline-clip\", classNames?.clip);\n const contentClass = cx(\"hm-timeline-clip-content\", classNames?.content);\n\n return (\n <div\n ref={(node) => {\n list.current = node;\n if (node) {\n sizeClips(node);\n }\n }}\n role=\"listbox\"\n aria-label={label}\n aria-orientation=\"horizontal\"\n aria-multiselectable={multiple ? true : undefined}\n className={cx(\"hm-timeline-clips\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n // Until the timeline has measured itself, the clips share the track equally.\n data-hm-measured={pixelsPerUnit > 0 ? \"\" : undefined}\n onKeyDown={handleKeyDown}\n onClick={handleClick}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={() => endDrag(true)}\n onPointerCancel={() => endDrag(false)}\n onFocus={handleFocus}\n onBlur={handleBlur}\n >\n {clips.map((clip) => (\n <Clip\n key={clip.key}\n clip={clip}\n selected={selected.has(clip.key)}\n tabStop={clip === tabStop}\n clipClass={clipClass}\n contentClass={contentClass}\n edges={onTrim !== undefined}\n dragging={drag?.key === clip.key ? drag.edge : undefined}\n />\n ))}\n </div>\n );\n },\n);\n","import { forwardRef, useEffect, useRef } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { Slider } from \"../slider/Slider.js\";\nimport { useTimelineContext } from \"./Timeline.js\";\n\n/**\n * The parts of a timeline's playhead that `classNames` can target.\n *\n * @public\n */\nexport type TimelinePlayheadPart = \"root\" | \"slider\" | \"line\";\n\n/**\n * Props of {@link TimelinePlayhead}.\n *\n * @public\n */\nexport interface TimelinePlayheadProps extends StyleProps<TimelinePlayheadPart> {\n /** The slider's accessible name, such as \"Playhead\". Required. */\n readonly label: string;\n /** Where the playhead is, in the timeline's units. */\n readonly position: number;\n /** Called with the unit the user moved the playhead to. */\n readonly onPositionChange: (position: number) => void;\n /** The arrow keys' step, in units. Defaults to 1. */\n readonly step?: number | undefined;\n /** The Page Up and Page Down step, in units, such as one second. */\n readonly largeStep?: number | undefined;\n /**\n * Writes a position as text for screen readers, such as \"0:12.40\",\n * exposed as `aria-valuetext`. Without it, they read the number of units.\n */\n readonly formatValue?: ((position: number) => string) | undefined;\n /**\n * Whether a press on the track, outside the clips and controls, moves the\n * playhead there. Defaults to `true`. Turn it off when a layer of yours\n * handles presses itself, such as one that selects a range by dragging.\n */\n readonly seekOnPress?: boolean | undefined;\n /**\n * Keeps the playhead in view by scrolling, as while playing. Without it,\n * the timeline scrolls only after a zoom.\n */\n readonly following?: boolean | undefined;\n}\n\n/** What a press on the track mustn't take: the parts that have their own. */\nconst OWN_PRESS = 'input, button, a[href], select, textarea, [role=\"option\"], [tabindex]';\n\n/**\n * The playhead of a {@link Timeline}: a slider over the timeline's units,\n * and a line on the track at its position.\n *\n * - **The slider** is a `ui` `Slider` as wide as the track, so its thumb is\n * the playhead's handle. Arrow keys move by `step`, Page Up and Page Down\n * by `largeStep`, and Home and End go to the start and the end.\n * - **A press on the track** moves the playhead there, snapping to the\n * timeline's targets unless Alt is held.\n * - **It's the only part that renders as the playhead moves.** Give it the\n * position from a component of its own, and nothing else in the timeline\n * re-renders while playing.\n *\n * @public\n */\nexport const TimelinePlayhead = /* @__PURE__ */ forwardRef<HTMLInputElement, TimelinePlayheadProps>(\n function TimelinePlayhead(\n {\n label,\n position: rawPosition,\n onPositionChange,\n step = 1,\n largeStep,\n formatValue,\n seekOnPress = true,\n following = false,\n className,\n classNames,\n unstyled,\n },\n ref,\n ) {\n const context = useTimelineContext(\"TimelinePlayhead\");\n const scale = context?.scale;\n const length = scale?.length ?? 0;\n const pixelsPerUnit = scale?.pixelsPerUnit ?? 0;\n const position = Math.min(Math.max(Math.round(rawPosition) || 0, 0), length);\n\n const latest = useRef({ position, onPositionChange });\n latest.current = { position, onPositionChange };\n\n // The playhead is a snap target for everything else on the timeline.\n const addTargets = context?.addTargets;\n useEffect(() => addTargets?.(() => [latest.current.position]), [addTargets]);\n\n // The line's place goes through the CSSOM, as the track's size does,\n // from a ref callback, so it's there in the frame React commits.\n const placeLine = (element: HTMLDivElement): void => {\n element.style.insetInlineStart = `${position * pixelsPerUnit}px`;\n };\n\n // Scrolling: to keep the playhead in view while following; to bring it\n // back after a zoom, which moves everything under the viewport; and to\n // start with it in view, once the timeline has measured itself.\n const viewport = context?.viewport;\n const lastScale = useRef(0);\n useEffect(() => {\n const element = viewport?.current;\n const first = lastScale.current === 0 && pixelsPerUnit > 0;\n const zoomed = lastScale.current !== pixelsPerUnit && lastScale.current > 0;\n lastScale.current = pixelsPerUnit;\n if (!element || pixelsPerUnit <= 0 || !(following || zoomed || first)) {\n return;\n }\n const at = position * pixelsPerUnit;\n const start = Math.abs(element.scrollLeft);\n const width = element.clientWidth;\n if (zoomed || at < start || at > start + width) {\n // In the middle after a zoom and at the start; a tenth in while\n // following, so there's more ahead of the playhead than behind it.\n const to = Math.max(0, at - (zoomed || first ? width / 2 : width / 10));\n element.scrollLeft = getComputedStyle(element).direction === \"rtl\" ? -to : to;\n }\n }, [viewport, position, pixelsPerUnit, following]);\n\n const track = context?.track;\n useEffect(() => {\n const element = track?.current;\n if (!element || !seekOnPress || !scale) {\n return;\n }\n const onPointerDown = (event: PointerEvent): void => {\n if (\n event.button !== 0 ||\n event.defaultPrevented ||\n (event.target as Element).closest(OWN_PRESS)\n ) {\n return;\n }\n const next = scale.unitAt(event.clientX, { snap: !event.altKey });\n if (next !== latest.current.position) {\n latest.current.onPositionChange(next);\n }\n };\n element.addEventListener(\"pointerdown\", onPointerDown);\n return () => element.removeEventListener(\"pointerdown\", onPointerDown);\n }, [track, scale, seekOnPress]);\n\n return (\n <div\n className={cx(\"hm-timeline-playhead\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n >\n <Slider\n ref={ref}\n label={label}\n min={0}\n max={length}\n step={step}\n largeStep={largeStep}\n value={position}\n onValueChange={onPositionChange}\n formatValue={formatValue}\n unstyled={unstyled}\n className={cx(\"hm-timeline-playhead-slider\", classNames?.slider)}\n />\n <div\n ref={(node) => {\n if (node) {\n placeLine(node);\n }\n }}\n className={cx(\"hm-timeline-playhead-line\", classNames?.line)}\n aria-hidden=\"true\"\n />\n </div>\n );\n },\n);\n","import { forwardRef, type MouseEvent, type ReactNode, useState } from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { Button, type ButtonPart, type ButtonProps, type ButtonVariant } from \"../button/Button.js\";\nimport { type ClassNames, cx } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * How prominent a toggle button is: `secondary` (the default), or `quiet` for\n * toolbars. There's no `primary` or `danger`: their solid fill would make a\n * toggle that's off look more active than one that's on.\n *\n * @public\n */\nexport type ToggleButtonVariant = Extract<ButtonVariant, \"secondary\" | \"quiet\">;\n\n/**\n * Props every {@link ToggleButton} takes, with or without visible text.\n *\n * @public\n */\nexport interface ToggleButtonBaseProps\n extends Omit<\n ButtonProps,\n \"variant\" | \"pressed\" | \"aria-pressed\" | \"children\" | \"startIcon\" | \"endIcon\" | \"classNames\"\n > {\n /** Defaults to `secondary`. */\n readonly variant?: ToggleButtonVariant | undefined;\n /** Whether it's on, when you control it. Leave it out to let the button keep its own state. */\n readonly pressed?: boolean | undefined;\n /** Whether it starts on, when it keeps its own state. Defaults to `false`. */\n readonly defaultPressed?: boolean | undefined;\n /**\n * Called with the new state when the button is activated. Calling\n * `event.preventDefault()` in `onClick` stops the change.\n */\n readonly onPressedChange?: ((pressed: boolean) => void) | undefined;\n}\n\n/**\n * A toggle button with visible text, and optional icons beside it.\n *\n * @public\n */\nexport interface ToggleButtonTextProps extends ToggleButtonBaseProps {\n /** The label. It must say what the button turns on, and stay the same in both states. */\n readonly children: ReactNode;\n /** An icon before the label. It's decorative, and draws with `currentColor`. */\n readonly startIcon?: ReactNode;\n /** An icon after the label. */\n readonly endIcon?: ReactNode;\n /** Extra classes per part. */\n readonly classNames?: ClassNames<ButtonPart> | undefined;\n readonly icon?: undefined;\n readonly label?: undefined;\n}\n\n/**\n * A square toggle button with only an icon.\n *\n * @public\n */\nexport interface ToggleButtonIconProps extends ToggleButtonBaseProps {\n /** The icon. It draws with `currentColor`. */\n readonly icon: ReactNode;\n /** The accessible name. Required, because the button shows no text. It stays the same in both states. */\n readonly label: string;\n /** Extra classes on the root and the icon. */\n readonly classNames?: ClassNames<\"root\" | \"icon\"> | undefined;\n readonly children?: undefined;\n readonly startIcon?: undefined;\n readonly endIcon?: undefined;\n}\n\n/**\n * Props of {@link ToggleButton}: visible text, or an icon with a `label`.\n *\n * @public\n */\nexport type ToggleButtonProps = ToggleButtonTextProps | ToggleButtonIconProps;\n\n/**\n * A button that turns something on or off, such as loop playback or the\n * active tool, exposed as `aria-pressed`. Controlled with `pressed` and\n * `onPressedChange`, or keeping its own state from `defaultPressed`.\n *\n * Its label names what it turns on and never changes with the state: screen\n * readers announce the state. For a button whose label changes, such as\n * play and pause, use `IconButton` or `Button` and swap the label instead.\n *\n * Inside a `Toolbar`, it's a toolbar item like any button: arrow keys reach\n * it, and Space or Enter toggles it.\n *\n * @example\n * ```tsx\n * <ToggleButton\n * label={messages.t(\"player.loop\")}\n * icon={<LoopIcon />}\n * pressed={loop}\n * onPressedChange={setLoop}\n * />\n * ```\n *\n * @public\n */\nexport const ToggleButton = /* @__PURE__ */ forwardRef<HTMLButtonElement, ToggleButtonProps>(\n function ToggleButton(\n {\n pressed: controlled,\n defaultPressed = false,\n onPressedChange,\n onClick,\n icon,\n label,\n className,\n ...props\n },\n ref,\n ) {\n const [uncontrolled, setUncontrolled] = useState(defaultPressed);\n const pressed = controlled ?? uncontrolled;\n const iconOnly = label !== undefined;\n if (iconOnly && label.trim() === \"\") {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\n \"ToggleButton needs a label when it shows only an icon: it's the button's only accessible name. Pass text from your message catalogue.\",\n );\n }\n }\n\n // Button doesn't call onClick while it's disabled but focusable, so a\n // disabled toggle never changes.\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n onClick?.(event);\n if (event.defaultPrevented) {\n return;\n }\n if (controlled === undefined) {\n setUncontrolled(!pressed);\n }\n onPressedChange?.(!pressed);\n };\n\n return (\n <Button\n {...props}\n ref={ref}\n {...(iconOnly ? { \"aria-label\": label, startIcon: icon } : {})}\n className={cx(\"hm-toggle-button\", iconOnly && \"hm-icon-button\", className)}\n pressed={pressed}\n onClick={handleClick}\n />\n );\n },\n);\n","import {\n type FocusEvent,\n forwardRef,\n type HTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n useCallback,\n useEffect,\n useRef,\n} from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { moveFocus, syncTabStop } from \"./roving-focus.js\";\nimport { ToolbarContext } from \"./toolbar-context.js\";\n\n/**\n * Props of {@link Toolbar}.\n *\n * @public\n */\nexport interface ToolbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"className\" | \"role\">,\n StyleProps<\"root\"> {\n /** The toolbar's accessible name, such as \"Page tools\". Required. */\n readonly label: string;\n /** Defaults to `horizontal`. Arrow keys follow it. */\n readonly orientation?: \"horizontal\" | \"vertical\" | undefined;\n}\n\nfunction useMergedRef<T>(forwarded: React.ForwardedRef<T>) {\n const local = useRef<T | null>(null);\n const setRef = useCallback(\n (node: T | null) => {\n local.current = node;\n if (typeof forwarded === \"function\") {\n forwarded(node);\n } else if (forwarded) {\n forwarded.current = node;\n }\n },\n [forwarded],\n );\n return [local, setRef] as const;\n}\n\n/**\n * A toolbar (WAI-ARIA `toolbar`): one Tab stop, arrow keys between its items,\n * Home and End to the ends. Items are any focusable descendants, such as\n * `Button`, `IconButton` and `SegmentedControl`. Disabled items that should\n * stay discoverable use `focusableWhenDisabled`.\n *\n * @example\n * ```tsx\n * <Toolbar label={messages.t(\"toolbar.label\")}>\n * <ToolbarGroup label={messages.t(\"toolbar.history\")}>\n * <IconButton label={messages.t(\"toolbar.undo\")} icon={<UndoIcon />} />\n * </ToolbarGroup>\n * <ToolbarSeparator />\n * </Toolbar>\n * ```\n *\n * @public\n */\nexport const Toolbar = /* @__PURE__ */ forwardRef<HTMLDivElement, ToolbarProps>(function Toolbar(\n {\n label,\n orientation = \"horizontal\",\n className,\n classNames,\n unstyled,\n onKeyDown,\n onFocus,\n children,\n ...props\n },\n forwardedRef,\n): ReactElement {\n const [ref, setRef] = useMergedRef(forwardedRef);\n\n // After hydration, and whenever items change, keep exactly one Tab stop.\n useEffect(() => {\n const toolbar = ref.current;\n if (!toolbar) {\n return;\n }\n syncTabStop(toolbar);\n const observer = new MutationObserver(() => syncTabStop(toolbar, document.activeElement));\n observer.observe(toolbar, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: [\"disabled\", \"hidden\"],\n });\n return () => observer.disconnect();\n }, [ref]);\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>): void => {\n onKeyDown?.(event);\n if (!event.defaultPrevented && ref.current && moveFocus(ref.current, event, orientation)) {\n event.preventDefault();\n }\n };\n\n // Clicking or programmatically focusing an item makes it the Tab stop.\n const handleFocus = (event: FocusEvent<HTMLDivElement>): void => {\n onFocus?.(event);\n if (ref.current && event.target !== ref.current) {\n syncTabStop(ref.current, event.target);\n }\n };\n\n return (\n <ToolbarContext.Provider value={{ orientation }}>\n <div\n {...props}\n ref={setRef}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={cx(\n \"hm-toolbar\",\n orientation === \"vertical\" && \"hm-toolbar--vertical\",\n classNames?.root,\n className,\n )}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n >\n {children}\n </div>\n </ToolbarContext.Provider>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link ToolbarGroup}.\n *\n * @public\n */\nexport interface ToolbarGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, \"role\"> {\n /** The group's accessible name, such as \"Zoom\". Required. */\n readonly label: string;\n}\n\n/**\n * Related items in a toolbar, announced together as a named group. Arrow keys\n * move across groups as if they weren't there.\n *\n * @public\n */\nexport const ToolbarGroup = /* @__PURE__ */ forwardRef<HTMLDivElement, ToolbarGroupProps>(\n function ToolbarGroup({ label, className, ...props }, ref) {\n return (\n // biome-ignore lint/a11y/useSemanticElements: a fieldset brings form semantics and legend rendering a toolbar group shouldn't have.\n <div\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={cx(\"hm-toolbar-group\", className)}\n />\n );\n },\n);\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\nimport { useToolbar } from \"./toolbar-context.js\";\n\n/**\n * Props of {@link ToolbarSeparator}.\n *\n * @public\n */\nexport type ToolbarSeparatorProps = Omit<HTMLAttributes<HTMLHRElement>, \"children\">;\n\n/**\n * A line between toolbar items: a native `<hr>`, so it's a separator to\n * assistive technology. It isn't focusable, and is oriented across the\n * toolbar.\n *\n * @public\n */\nexport const ToolbarSeparator = /* @__PURE__ */ forwardRef<HTMLHRElement, ToolbarSeparatorProps>(\n function ToolbarSeparator({ className, ...props }, ref) {\n const toolbar = useToolbar();\n return (\n <hr\n {...props}\n ref={ref}\n aria-orientation={toolbar?.orientation === \"vertical\" ? \"horizontal\" : \"vertical\"}\n className={cx(\"hm-toolbar-separator\", className)}\n />\n );\n },\n);\n","import { type Platform, platformOf } from \"@hussmartinez/sdk-core\";\nimport { useSyncExternalStore } from \"react\";\n\n// The platform doesn't change while the page is open, so nothing to subscribe to.\nconst subscribe = (): (() => void) => () => undefined;\nconst onClient = (): Platform => platformOf(globalThis.navigator);\nconst onServer = (): Platform => \"other\";\n\n/**\n * The platform whose keyboard conventions apply, for shortcut labels and for\n * sdk-core's `createShortcutRegistry({ platform })`: `\"apple\"` on macOS, iOS\n * and iPadOS, where `Mod` is `Meta` (⌘), and `\"other\"` elsewhere, where it's\n * `Control`.\n *\n * A server can't know the platform, so the server render and hydration both\n * use `\"other\"`, and Apple devices switch to their keys in the render right\n * after hydration. That keeps hydration free of mismatches. Never read\n * `navigator` during render for this.\n *\n * @example\n * ```tsx\n * const platform = usePlatform();\n * const shortcuts = useMemo(() => createShortcutRegistry({ platform, tools }), [platform, tools]);\n * ```\n *\n * @public\n */\nexport function usePlatform(): Platform {\n return useSyncExternalStore(subscribe, onClient, onServer);\n}\n","import type { ShortcutPart } from \"@hussmartinez/sdk-core\";\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n type FocusEvent,\n forwardRef,\n isValidElement,\n type PointerEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n version,\n} from \"react\";\nimport { warnInDevelopment } from \"../../internal/development.js\";\nimport { usePlatform } from \"../../react/use-platform.js\";\nimport { joinIds } from \"../field/field-context.js\";\nimport { useUiMessages } from \"../messages/UiMessagesProvider.js\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\n\ndeclare const process: { readonly env: { readonly NODE_ENV?: string } };\n\n/**\n * The parts of a tooltip that `classNames` can target.\n *\n * @public\n */\nexport type TooltipPart = \"root\" | \"content\" | \"shortcut\";\n\n/**\n * Props of {@link Tooltip}.\n *\n * @public\n */\nexport interface TooltipProps extends StyleProps<TooltipPart> {\n /** The text. Use text from your message catalogue. */\n readonly content: ReactNode;\n /**\n * How the text reaches assistive technology. `description`, the default,\n * describes the trigger (`aria-describedby`). `label` names it\n * (`aria-labelledby`): use it for an icon-only button whose tooltip says\n * what its label would, so screen readers don't hear it twice.\n */\n readonly type?: \"description\" | \"label\" | undefined;\n /**\n * The trigger's keyboard shortcut, as sdk-core's shortcut registry\n * describes it: `registry.describe(toolId)[0]`. The tooltip shows it in the\n * platform's notation, such as ⌘⇧Z or Ctrl+Shift+Z, and the trigger gets\n * `aria-keyshortcuts`.\n */\n readonly shortcut?: readonly ShortcutPart[] | undefined;\n /** Where it shows, when there's room: `top` (the default) or `bottom`. */\n readonly placement?: \"top\" | \"bottom\" | undefined;\n /** How long the pointer rests on the trigger before it shows, in milliseconds. Defaults to 500. */\n readonly delay?: number | undefined;\n /**\n * The trigger: one element that forwards its ref, such as `IconButton`.\n * A disabled trigger should use `focusableWhenDisabled`: a natively\n * disabled button gets neither focus nor pointer events, so its tooltip\n * can't show.\n */\n readonly children: ReactElement;\n}\n\n/** How long the pointer may take to move from the trigger onto the tooltip. */\nconst GRACE = 100;\n\n/** ARIA's name for a key in `aria-keyshortcuts`, which uses `KeyboardEvent.key` names. */\nconst ariaKey = (part: ShortcutPart): string => (part.value === \" \" ? \"Space\" : part.value);\n\n/** Places the tooltip next to its trigger, inside the viewport, on the side with room. */\nfunction place(trigger: HTMLElement, tooltip: HTMLElement, preferred: \"top\" | \"bottom\"): void {\n const anchor = trigger.getBoundingClientRect();\n const box = tooltip.getBoundingClientRect();\n const viewport = document.documentElement;\n const above = anchor.top;\n const below = viewport.clientHeight - anchor.bottom;\n const fits = (side: \"top\" | \"bottom\") => (side === \"top\" ? above : below) >= box.height;\n const other = preferred === \"top\" ? \"bottom\" : \"top\";\n const side = fits(preferred) || !fits(other) ? preferred : other;\n const left = Math.min(\n Math.max(anchor.left + anchor.width / 2 - box.width / 2, 0),\n Math.max(viewport.clientWidth - box.width, 0),\n );\n // Set through the CSSOM, which a strict Content Security Policy allows.\n tooltip.style.left = `${left}px`;\n tooltip.style.top = `${side === \"top\" ? anchor.top - box.height : anchor.bottom}px`;\n tooltip.dataset[\"hmPlacement\"] = side;\n}\n\n/** The trigger's own ref, where React keeps it in versions 18 and 19. */\nfunction refOf(element: ReactElement): Ref<HTMLElement> | undefined {\n if (version.startsWith(\"18\")) {\n return (element as { ref?: Ref<HTMLElement> }).ref;\n }\n return (element.props as { ref?: Ref<HTMLElement> }).ref;\n}\n\nfunction setRef<T>(ref: Ref<T> | undefined, value: T | null): void {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (ref) {\n (ref as { current: T | null }).current = value;\n }\n}\n\ntype TriggerProps = ComponentPropsWithRef<\"button\">;\n\n/**\n * A tooltip: short text about a control, shown while the pointer rests on it\n * or while it has keyboard focus (WAI-ARIA tooltip pattern, WCAG 1.4.13).\n *\n * - It shows after `delay` on hover, and at once on keyboard focus, never\n * on a mouse click's focus or on touch.\n * - The pointer can move onto it without it closing, and it stays until the\n * pointer and focus leave. Escape closes it without moving focus, and\n * doesn't close a surrounding dialog.\n * - **While it's open, the first Escape belongs to the tooltip.** It calls\n * `preventDefault()`, so an editor's own Escape action, such as cancelling\n * a crop, runs on the second press. sdk-core's shortcut registry already\n * skips handled events; a handler of your own should check\n * `event.defaultPrevented` too.\n * - It's in the top layer, through the Popover API, so no stacking context\n * can hide it, and it's placed above the trigger, or below when there's no\n * room, without a positioning library (docs/adr/0006).\n *\n * @example\n * ```tsx\n * <Tooltip type=\"label\" content={t(\"toolbar.undo\")} shortcut={shortcuts.describe(\"pdf.undo\")[0]}>\n * <IconButton label={t(\"toolbar.undo\")} icon={<UndoIcon />} onClick={undo} />\n * </Tooltip>\n * ```\n *\n * @public\n */\nexport const Tooltip = /* @__PURE__ */ forwardRef<HTMLDivElement, TooltipProps>(function Tooltip(\n {\n content,\n type = \"description\",\n shortcut,\n placement = \"top\",\n delay = 500,\n className,\n classNames,\n unstyled,\n children,\n },\n ref,\n) {\n const id = useId();\n const contentId = `${id}-content`;\n const platform = usePlatform();\n const messages = useUiMessages();\n const [open, setOpen] = useState(false);\n const trigger = useRef<HTMLElement | null>(null);\n const tooltip = useRef<HTMLDivElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n // Escape keeps it closed until the pointer or focus leaves and comes back.\n const dismissed = useRef(false);\n\n const clear = (): void => {\n clearTimeout(timer.current);\n timer.current = undefined;\n };\n const show = useCallback((after: number): void => {\n clearTimeout(timer.current);\n if (dismissed.current) {\n return;\n }\n timer.current = setTimeout(() => setOpen(true), after);\n }, []);\n const hide = useCallback((after: number): void => {\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(false), after);\n }, []);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n useEffect(() => {\n const element = tooltip.current;\n if (!element || typeof element.showPopover !== \"function\") {\n return;\n }\n if (!open) {\n if (element.matches(\":popover-open\")) {\n element.hidePopover();\n }\n return;\n }\n element.showPopover();\n if (trigger.current) {\n place(trigger.current, element, placement);\n }\n const close = (): void => setOpen(false);\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === \"Escape\") {\n // Only the tooltip closes: a surrounding dialog stays open.\n event.preventDefault();\n dismissed.current = true;\n close();\n }\n };\n document.addEventListener(\"keydown\", onKeyDown, true);\n // A moved trigger would leave the tooltip behind, so scrolling closes it.\n window.addEventListener(\"scroll\", close, true);\n window.addEventListener(\"resize\", close);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown, true);\n window.removeEventListener(\"scroll\", close, true);\n window.removeEventListener(\"resize\", close);\n };\n }, [open, placement]);\n\n if (!isValidElement(children)) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n warnInDevelopment(\"Tooltip needs one element as its child, such as an IconButton.\");\n }\n return children;\n }\n\n const child = children as ReactElement<TriggerProps>;\n const own = child.props;\n const childRef = refOf(child);\n const keyshortcuts =\n shortcut && shortcut.length > 0 ? shortcut.map(ariaKey).join(\"+\") : own[\"aria-keyshortcuts\"];\n // Every catalogue includes sdkCoreMessages (sdk-core ADR 0019), which has\n // the keys.* messages a shortcut's parts name.\n const text = messages.t as unknown as (key: string) => string;\n\n const triggerProps: Partial<TriggerProps> = {\n ref: (node: HTMLButtonElement | null) => {\n trigger.current = node;\n setRef(childRef, node);\n },\n ...(type === \"label\"\n ? { \"aria-labelledby\": joinIds(contentId, own[\"aria-labelledby\"]) }\n : { \"aria-describedby\": joinIds(own[\"aria-describedby\"], contentId) }),\n \"aria-keyshortcuts\": keyshortcuts,\n onPointerEnter: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerEnter?.(event);\n if (event.pointerType !== \"touch\") {\n show(open ? 0 : delay);\n }\n },\n onPointerLeave: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerLeave?.(event);\n dismissed.current = false;\n hide(GRACE);\n },\n onPointerDown: (event: PointerEvent<HTMLButtonElement>) => {\n own.onPointerDown?.(event);\n clear();\n setOpen(false);\n },\n onFocus: (event: FocusEvent<HTMLButtonElement>) => {\n own.onFocus?.(event);\n // Keyboard focus only: a click's focus would show it under the pointer.\n // At once, without a timer.\n if (event.currentTarget.matches(\":focus-visible\") && !dismissed.current) {\n clear();\n setOpen(true);\n }\n },\n onBlur: (event: FocusEvent<HTMLButtonElement>) => {\n own.onBlur?.(event);\n dismissed.current = false;\n clear();\n setOpen(false);\n },\n };\n\n return (\n <>\n {cloneElement(child, triggerProps)}\n <div\n ref={(node) => {\n tooltip.current = node;\n setRef(ref, node);\n }}\n id={id}\n role=\"tooltip\"\n popover=\"manual\"\n className={cx(\"hm-tooltip\", classNames?.root, className)}\n data-hm-unstyled={unstyledAttribute(unstyled)}\n // Hoverable (WCAG 1.4.13): moving onto the tooltip keeps it open.\n onPointerEnter={() => clear()}\n onPointerLeave={() => hide(GRACE)}\n >\n <span id={contentId} className={cx(\"hm-tooltip-content\", classNames?.content)}>\n {content}\n </span>\n {shortcut && shortcut.length > 0 ? (\n // Assistive technology gets it from aria-keyshortcuts on the trigger.\n <span className={cx(\"hm-tooltip-shortcut\", classNames?.shortcut)} aria-hidden=\"true\">\n {shortcut.map((part, index) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: a chord's parts are static and ordered\n <span key={index}>\n {index > 0 && platform === \"other\" ? \"+\" : null}\n <kbd>{part.message ? text(part.message) : part.value}</kbd>\n </span>\n ))}\n </span>\n ) : null}\n </div>\n </>\n );\n});\n","import { forwardRef, type HTMLAttributes } from \"react\";\nimport { cx } from \"../shared/style-props.js\";\n\n/**\n * Props of {@link VisuallyHidden}.\n *\n * @public\n */\nexport interface VisuallyHiddenProps extends HTMLAttributes<HTMLElement> {\n /** The element to render. Defaults to `span`. */\n readonly as?: \"span\" | \"div\";\n}\n\n/**\n * Content for assistive technology only: hidden on screen, but read out and\n * part of the accessible name of its parent. It has no `unstyled` prop,\n * because hiding is its whole purpose.\n *\n * @public\n */\nexport const VisuallyHidden = /* @__PURE__ */ forwardRef<HTMLElement, VisuallyHiddenProps>(\n function VisuallyHidden({ as: Element = \"span\", className, ...props }, ref) {\n return (\n <Element {...props} ref={ref as never} className={cx(\"hm-visually-hidden\", className)} />\n );\n },\n);\n","import type { ReactElement, SVGProps } from \"react\";\nimport { cx } from \"../components/shared/style-props.js\";\n\n/**\n * The shapes an icon is drawn with: an element name and its geometry. The\n * generator only ever writes the shapes and attributes its allowlist accepts.\n */\nexport type IconNode = readonly (readonly [\n \"path\" | \"circle\" | \"rect\" | \"line\" | \"ellipse\" | \"polyline\" | \"polygon\",\n Readonly<Record<string, string>>,\n])[];\n\n/**\n * Props of every icon. SVG attributes are passed through.\n *\n * @public\n */\nexport interface IconProps\n extends Omit<SVGProps<SVGSVGElement>, \"children\" | \"dangerouslySetInnerHTML\" | \"ref\"> {\n /**\n * The accessible name, for an icon that means something on its own.\n * Without it, the icon is decorative and hidden from assistive\n * technology, as it should be inside a labelled button.\n */\n readonly label?: string | undefined;\n}\n\n/**\n * An icon from ui's set, such as `UndoIcon`.\n *\n * @public\n */\nexport type IconComponent = (props: IconProps) => ReactElement;\n\n/**\n * Draws one icon. Each generated icon component calls it with its own name\n * and shapes; it's a plain function rather than a component factory, so every\n * icon is an ordinary module-level function that bundlers drop when unused.\n */\nexport function renderIcon(\n name: string,\n nodes: IconNode,\n mirror: boolean,\n { label, className, ...props }: IconProps,\n): ReactElement {\n return (\n <svg\n {...props}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cx(\"hm-icon\", className)}\n data-hm-icon={name}\n data-hm-mirror={mirror ? \"\" : undefined}\n focusable=\"false\"\n role={label === undefined ? undefined : \"img\"}\n aria-label={label}\n aria-hidden={label === undefined ? true : undefined}\n >\n {nodes.map(([Shape, attributes], index) => (\n // The shapes never change order, so their index is a stable key.\n // biome-ignore lint/suspicious/noArrayIndexKey: static, ordered shapes\n <Shape key={index} {...attributes} />\n ))}\n </svg>\n );\n}\n","/*! Icons from Lucide (https://lucide.dev), ISC licence; those derived from Feather, MIT licence. See THIRD_PARTY_NOTICES.md in @hussmartinez/ui. */\n// Generated by scripts/generate-icons.ts from lucide-static 1.72.0 and\n// src/icons/manifest.ts. Don't edit it: change the manifest and run\n// `pnpm --filter @hussmartinez/ui icons` (docs/adr/0005).\nimport type { ReactElement } from \"react\";\nimport { type IconProps, renderIcon } from \"./create-icon.js\";\n\n/**\n * The `add` icon: Lucide's `plus`.\n *\n * @public\n */\nexport function AddIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"add\",\n [\n [\"path\", { d: \"M5 12h14\" }],\n [\"path\", { d: \"M12 5v14\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `arrow` icon: Lucide's `move-up-right`.\n *\n * @public\n */\nexport function ArrowIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"arrow\",\n [\n [\"path\", { d: \"M13 5H19V11\" }],\n [\"path\", { d: \"M19 5L5 19\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `check` icon: Lucide's `check`.\n *\n * @public\n */\nexport function CheckIcon(props: IconProps): ReactElement {\n return renderIcon(\"check\", [[\"path\", { d: \"M20 6 9 17l-5-5\" }]], false, props);\n}\n\n/**\n * The `chevron-down` icon: Lucide's `chevron-down`.\n *\n * @public\n */\nexport function ChevronDownIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-down\", [[\"path\", { d: \"m6 9 6 6 6-6\" }]], false, props);\n}\n\n/**\n * The `chevron-left` icon: Lucide's `chevron-left`.\n *\n * @public\n */\nexport function ChevronLeftIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-left\", [[\"path\", { d: \"m15 18-6-6 6-6\" }]], false, props);\n}\n\n/**\n * The `chevron-right` icon: Lucide's `chevron-right`.\n *\n * @public\n */\nexport function ChevronRightIcon(props: IconProps): ReactElement {\n return renderIcon(\"chevron-right\", [[\"path\", { d: \"m9 18 6-6-6-6\" }]], false, props);\n}\n\n/**\n * The `close` icon: Lucide's `x`.\n *\n * @public\n */\nexport function CloseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"close\",\n [\n [\"path\", { d: \"M18 6 6 18\" }],\n [\"path\", { d: \"m6 6 12 12\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `crop` icon: Lucide's `crop`.\n *\n * @public\n */\nexport function CropIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"crop\",\n [\n [\"path\", { d: \"M6 2v14a2 2 0 0 0 2 2h14\" }],\n [\"path\", { d: \"M18 22V8a2 2 0 0 0-2-2H2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `delete` icon: Lucide's `trash`.\n *\n * @public\n */\nexport function DeleteIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"delete\",\n [\n [\"path\", { d: \"M10 11v6\" }],\n [\"path\", { d: \"M14 11v6\" }],\n [\"path\", { d: \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" }],\n [\"path\", { d: \"M3 6h18\" }],\n [\"path\", { d: \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `download` icon: Lucide's `download`.\n *\n * @public\n */\nexport function DownloadIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"download\",\n [\n [\"path\", { d: \"M12 15V3\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" }],\n [\"path\", { d: \"m7 10 5 5 5-5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `duplicate` icon: Lucide's `copy`.\n *\n * @public\n */\nexport function DuplicateIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"duplicate\",\n [\n [\"rect\", { width: \"14\", height: \"14\", x: \"8\", y: \"8\", rx: \"2\", ry: \"2\" }],\n [\"path\", { d: \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `ellipse` icon: Lucide's `ellipse`.\n *\n * @public\n */\nexport function EllipseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"ellipse\",\n [[\"ellipse\", { cx: \"12\", cy: \"12\", rx: \"10\", ry: \"6\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `fade-in` icon: Lucide's `chart-no-axes-column-increasing`.\n *\n * @public\n */\nexport function FadeInIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fade-in\",\n [\n [\"path\", { d: \"M5 21v-6\" }],\n [\"path\", { d: \"M12 21V9\" }],\n [\"path\", { d: \"M19 21V3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `fade-out` icon: Lucide's `chart-no-axes-column-decreasing`.\n *\n * @public\n */\nexport function FadeOutIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fade-out\",\n [\n [\"path\", { d: \"M5 21V3\" }],\n [\"path\", { d: \"M12 21V9\" }],\n [\"path\", { d: \"M19 21v-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `fit` icon: Lucide's `scan`.\n *\n * @public\n */\nexport function FitIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"fit\",\n [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `flip-horizontal` icon: Lucide's `triangles-centerline-dashed-vertical`.\n *\n * @public\n */\nexport function FlipHorizontalIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"flip-horizontal\",\n [\n [\"path\", { d: \"M12 14v2\" }],\n [\"path\", { d: \"M12 20v2\" }],\n [\"path\", { d: \"M12 2v2\" }],\n [\"path\", { d: \"M12 8v2\" }],\n [\n \"path\",\n {\n d: \"M20.288 16.703A1 1 0 0022 16V8a1 1 0 00-1.712-.703l-3.99 3.991a1 1 0 00-.001 1.424z\",\n },\n ],\n [\n \"path\",\n { d: \"M3.712 16.703A1 1 0 012 16V8a1 1 0 011.712-.703l3.99 3.991a1 1 0 01.001 1.424z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `flip-vertical` icon: Lucide's `triangles-centerline-dashed-horizontal`.\n *\n * @public\n */\nexport function FlipVerticalIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"flip-vertical\",\n [\n [\"path\", { d: \"M10 12H8\" }],\n [\"path\", { d: \"M16 12h-2\" }],\n [\"path\", { d: \"M22 12h-2\" }],\n [\"path\", { d: \"M4 12H2\" }],\n [\n \"path\",\n { d: \"M7.298 20.288A1 1 0 008 22h8a1 1 0 00.703-1.712l-3.991-3.99a1 1 0 00-1.424-.001z\" },\n ],\n [\n \"path\",\n { d: \"M7.298 3.712A1 1 0 018 2h8a1 1 0 01.703 1.712l-3.991 3.99a1 1 0 01-1.424.001z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `hidden` icon: Lucide's `eye-off`.\n *\n * @public\n */\nexport function HiddenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"hidden\",\n [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n },\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n },\n ],\n [\"path\", { d: \"m2 2 20 20\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `highlighter` icon: Lucide's `highlighter`.\n *\n * @public\n */\nexport function HighlighterIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"highlighter\",\n [\n [\"path\", { d: \"m9 11-6 6v3h9l3-3\" }],\n [\"path\", { d: \"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `image` icon: Lucide's `image`.\n *\n * @public\n */\nexport function ImageIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"image\",\n [\n [\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\", ry: \"2\" }],\n [\"circle\", { cx: \"9\", cy: \"9\", r: \"2\" }],\n [\"path\", { d: \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `info` icon: Lucide's `info`.\n *\n * @public\n */\nexport function InfoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"info\",\n [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\" }],\n [\"path\", { d: \"M12 16v-4\" }],\n [\"path\", { d: \"M12 8h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `layers` icon: Lucide's `layers`.\n *\n * @public\n */\nexport function LayersIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"layers\",\n [\n [\n \"path\",\n {\n d: \"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\",\n },\n ],\n [\"path\", { d: \"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" }],\n [\"path\", { d: \"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `loop` icon: Lucide's `repeat`.\n *\n * @public\n */\nexport function LoopIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"loop\",\n [\n [\"path\", { d: \"m17 2 4 4-4 4\" }],\n [\"path\", { d: \"M3 11v-1a4 4 0 0 1 4-4h14\" }],\n [\"path\", { d: \"m7 22-4-4 4-4\" }],\n [\"path\", { d: \"M21 13v1a4 4 0 0 1-4 4H3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `menu` icon: Lucide's `menu`.\n *\n * @public\n */\nexport function MenuIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"menu\",\n [\n [\"path\", { d: \"M4 5h16\" }],\n [\"path\", { d: \"M4 12h16\" }],\n [\"path\", { d: \"M4 19h16\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `more` icon: Lucide's `ellipsis`.\n *\n * @public\n */\nexport function MoreIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"more\",\n [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"1\" }],\n [\"circle\", { cx: \"19\", cy: \"12\", r: \"1\" }],\n [\"circle\", { cx: \"5\", cy: \"12\", r: \"1\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `move-down` icon: Lucide's `arrow-down`.\n *\n * @public\n */\nexport function MoveDownIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"move-down\",\n [\n [\"path\", { d: \"M12 5v14\" }],\n [\"path\", { d: \"m19 12-7 7-7-7\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `move-up` icon: Lucide's `arrow-up`.\n *\n * @public\n */\nexport function MoveUpIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"move-up\",\n [\n [\"path\", { d: \"m5 12 7-7 7 7\" }],\n [\"path\", { d: \"M12 19V5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `muted` icon: Lucide's `volume-x`.\n *\n * @public\n */\nexport function MutedIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"muted\",\n [\n [\n \"path\",\n {\n d: \"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z\",\n },\n ],\n [\"path\", { d: \"m16.5 14.5 5-5\" }],\n [\"path\", { d: \"m16.5 9.5 5 5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `open` icon: Lucide's `folder-open`.\n *\n * @public\n */\nexport function OpenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"open\",\n [\n [\n \"path\",\n {\n d: \"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-add` icon: Lucide's `file-plus`.\n *\n * @public\n */\nexport function PageAddIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-add\",\n [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n },\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\" }],\n [\"path\", { d: \"M9 15h6\" }],\n [\"path\", { d: \"M12 18v-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-grid` icon: Lucide's `grid-2x2`.\n *\n * @public\n */\nexport function PageGridIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-grid\",\n [\n [\"path\", { d: \"M12 3v18\" }],\n [\"path\", { d: \"M3 12h18\" }],\n [\"rect\", { x: \"3\", y: \"3\", width: \"18\", height: \"18\", rx: \"2\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `page-single` icon: Lucide's `file`.\n *\n * @public\n */\nexport function PageSingleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"page-single\",\n [\n [\n \"path\",\n {\n d: \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\",\n },\n ],\n [\"path\", { d: \"M14 2v5a1 1 0 0 0 1 1h5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pan` icon: Lucide's `hand`.\n *\n * @public\n */\nexport function PanIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pan\",\n [\n [\"path\", { d: \"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2\" }],\n [\"path\", { d: \"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2\" }],\n [\"path\", { d: \"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8\" }],\n [\n \"path\",\n {\n d: \"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pause` icon: Lucide's `pause`.\n *\n * @public\n */\nexport function PauseIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pause\",\n [\n [\"rect\", { x: \"14\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\" }],\n [\"rect\", { x: \"5\", y: \"3\", width: \"5\", height: \"18\", rx: \"1\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `pen` icon: Lucide's `pen`.\n *\n * @public\n */\nexport function PenIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"pen\",\n [\n [\n \"path\",\n {\n d: \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `play` icon: Lucide's `play`.\n *\n * @public\n */\nexport function PlayIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"play\",\n [\n [\n \"path\",\n { d: \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `rectangle` icon: Lucide's `rectangle-horizontal`.\n *\n * @public\n */\nexport function RectangleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rectangle\",\n [[\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `redact` icon: Lucide's `rectangle-ellipsis`.\n *\n * @public\n */\nexport function RedactIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"redact\",\n [\n [\"rect\", { width: \"20\", height: \"12\", x: \"2\", y: \"6\", rx: \"2\" }],\n [\"path\", { d: \"M12 12h.01\" }],\n [\"path\", { d: \"M17 12h.01\" }],\n [\"path\", { d: \"M7 12h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `redo` icon: Lucide's `redo-2`, mirrored in right-to-left text.\n *\n * @public\n */\nexport function RedoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"redo\",\n [\n [\"path\", { d: \"m15 14 5-5-5-5\" }],\n [\"path\", { d: \"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13\" }],\n ],\n true,\n props,\n );\n}\n\n/**\n * The `remove` icon: Lucide's `minus`.\n *\n * @public\n */\nexport function RemoveIcon(props: IconProps): ReactElement {\n return renderIcon(\"remove\", [[\"path\", { d: \"M5 12h14\" }]], false, props);\n}\n\n/**\n * The `rotate-left` icon: Lucide's `rotate-ccw`.\n *\n * @public\n */\nexport function RotateLeftIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rotate-left\",\n [\n [\"path\", { d: \"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\" }],\n [\"path\", { d: \"M3 3v5h5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `rotate-right` icon: Lucide's `rotate-cw`.\n *\n * @public\n */\nexport function RotateRightIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"rotate-right\",\n [\n [\"path\", { d: \"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8\" }],\n [\"path\", { d: \"M21 3v5h-5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `search` icon: Lucide's `search`.\n *\n * @public\n */\nexport function SearchIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"search\",\n [\n [\"path\", { d: \"m21 21-4.34-4.34\" }],\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `select` icon: Lucide's `mouse-pointer-2`.\n *\n * @public\n */\nexport function SelectIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"select\",\n [\n [\n \"path\",\n {\n d: \"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `skip-back` icon: Lucide's `skip-back`.\n *\n * @public\n */\nexport function SkipBackIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"skip-back\",\n [\n [\n \"path\",\n {\n d: \"M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z\",\n },\n ],\n [\"path\", { d: \"M3 20V4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `skip-forward` icon: Lucide's `skip-forward`.\n *\n * @public\n */\nexport function SkipForwardIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"skip-forward\",\n [\n [\"path\", { d: \"M21 4v16\" }],\n [\n \"path\",\n {\n d: \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\",\n },\n ],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `snap` icon: Lucide's `magnet`.\n *\n * @public\n */\nexport function SnapIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"snap\",\n [\n [\"path\", { d: \"m12 15 4 4\" }],\n [\n \"path\",\n {\n d: \"M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z\",\n },\n ],\n [\"path\", { d: \"m5 8 4 4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `split` icon: Lucide's `scissors`.\n *\n * @public\n */\nexport function SplitIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"split\",\n [\n [\"circle\", { cx: \"6\", cy: \"6\", r: \"3\" }],\n [\"path\", { d: \"M8.12 8.12 12 12\" }],\n [\"path\", { d: \"M20 4 8.12 15.88\" }],\n [\"circle\", { cx: \"6\", cy: \"18\", r: \"3\" }],\n [\"path\", { d: \"M14.8 14.8 20 20\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `stop` icon: Lucide's `square`.\n *\n * @public\n */\nexport function StopIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"stop\",\n [[\"rect\", { width: \"18\", height: \"18\", x: \"3\", y: \"3\", rx: \"2\" }]],\n false,\n props,\n );\n}\n\n/**\n * The `text` icon: Lucide's `type`.\n *\n * @public\n */\nexport function TextIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"text\",\n [\n [\"path\", { d: \"M12 4v16\" }],\n [\"path\", { d: \"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2\" }],\n [\"path\", { d: \"M9 20h6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `trim-end` icon: Lucide's `arrow-left-from-line`.\n *\n * @public\n */\nexport function TrimEndIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"trim-end\",\n [\n [\"path\", { d: \"m9 6-6 6 6 6\" }],\n [\"path\", { d: \"M3 12h14\" }],\n [\"path\", { d: \"M21 19V5\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `trim-start` icon: Lucide's `arrow-right-from-line`.\n *\n * @public\n */\nexport function TrimStartIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"trim-start\",\n [\n [\"path\", { d: \"M3 5v14\" }],\n [\"path\", { d: \"M21 12H7\" }],\n [\"path\", { d: \"m15 18 6-6-6-6\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `undo` icon: Lucide's `undo-2`, mirrored in right-to-left text.\n *\n * @public\n */\nexport function UndoIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"undo\",\n [\n [\"path\", { d: \"M9 14 4 9l5-5\" }],\n [\"path\", { d: \"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" }],\n ],\n true,\n props,\n );\n}\n\n/**\n * The `upload` icon: Lucide's `upload`.\n *\n * @public\n */\nexport function UploadIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"upload\",\n [\n [\"path\", { d: \"M12 3v12\" }],\n [\"path\", { d: \"m17 8-5-5-5 5\" }],\n [\"path\", { d: \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `visible` icon: Lucide's `eye`.\n *\n * @public\n */\nexport function VisibleIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"visible\",\n [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n },\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `volume` icon: Lucide's `volume-2`.\n *\n * @public\n */\nexport function VolumeIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"volume\",\n [\n [\n \"path\",\n {\n d: \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\",\n },\n ],\n [\"path\", { d: \"M16 9a5 5 0 0 1 0 6\" }],\n [\"path\", { d: \"M19.364 18.364a9 9 0 0 0 0-12.728\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `warning` icon: Lucide's `triangle-exclamation-point`.\n *\n * @public\n */\nexport function WarningIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"warning\",\n [\n [\"path\", { d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" }],\n [\"path\", { d: \"M12 9v4\" }],\n [\"path\", { d: \"M12 17h.01\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `zoom-in` icon: Lucide's `zoom-in`.\n *\n * @public\n */\nexport function ZoomInIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"zoom-in\",\n [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\" }],\n [\"line\", { x1: \"11\", x2: \"11\", y1: \"8\", y2: \"14\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\" }],\n ],\n false,\n props,\n );\n}\n\n/**\n * The `zoom-out` icon: Lucide's `zoom-out`.\n *\n * @public\n */\nexport function ZoomOutIcon(props: IconProps): ReactElement {\n return renderIcon(\n \"zoom-out\",\n [\n [\"circle\", { cx: \"11\", cy: \"11\", r: \"8\" }],\n [\"line\", { x1: \"21\", x2: \"16.65\", y1: \"21\", y2: \"16.65\" }],\n [\"line\", { x1: \"8\", x2: \"14\", y1: \"11\", y2: \"11\" }],\n ],\n false,\n props,\n );\n}\n","import type { ReactElement, ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { UiError } from \"../errors/ui-error.js\";\nimport { checkSingleCopy } from \"../internal/single-copy.js\";\nimport { isThemePair } from \"../theme/pair.js\";\nimport { cssWriterOf } from \"../theme/registry.js\";\nimport type { ColorMode, Density, Theme, ThemePair } from \"../theme/types.js\";\n\n/**\n * Props of {@link ThemeProvider} shared by every form.\n *\n * @public\n */\nexport interface ThemeProviderBaseProps {\n /** Density of everything inside. Inherited from above when omitted. */\n readonly density?: Density;\n /**\n * The nonce of a Content Security Policy whose `style-src` allows it.\n * Only needed with a custom theme, which renders a `<style>` element.\n */\n readonly nonce?: string;\n readonly children?: ReactNode;\n}\n\n/**\n * The built-in themes, or a custom light and dark pair, with a colour mode.\n *\n * @public\n */\nexport interface ThemeProviderModeProps extends ThemeProviderBaseProps {\n /** A custom `{ light, dark }` pair. The built-in themes when omitted. */\n readonly theme?: ThemePair;\n /** Light, dark, or follow the operating system. Defaults to `\"system\"`. */\n readonly mode?: ColorMode;\n}\n\n/**\n * A single custom theme, which has one colour scheme, so there's no mode.\n *\n * @public\n */\nexport interface ThemeProviderSingleProps extends ThemeProviderBaseProps {\n readonly theme: Theme;\n readonly mode?: undefined;\n}\n\n/**\n * Props of {@link ThemeProvider}.\n *\n * @public\n */\nexport type ThemeProviderProps = ThemeProviderModeProps | ThemeProviderSingleProps;\n\n/** Generated CSS by theme, then by selector. Themes are frozen, so this can't go stale. */\nconst cssCache = new WeakMap<Theme | ThemePair, Map<string, string>>();\n\nfunction cachedCss(theme: Theme | ThemePair, selector: string): string {\n let bySelector = cssCache.get(theme);\n if (!bySelector) {\n bySelector = new Map();\n cssCache.set(theme, bySelector);\n }\n let css = bySelector.get(selector);\n if (css === undefined) {\n // Themes from createTheme carry their CSS writer, so this component never\n // imports the validator: applications using only the built-in themes\n // don't ship it.\n const [light, dark] = isThemePair(theme) ? [theme.light, theme.dark] : [theme, undefined];\n const write = cssWriterOf(light);\n if (!write || (dark !== undefined && !cssWriterOf(dark))) {\n throw new UiError(\"INVALID_THEME_TOKEN\", \"ThemeProvider takes themes from createTheme.\", {\n details: { token: \"theme\", value: \"\", reason: \"pass themes created with createTheme\" },\n });\n }\n css = write(light, dark, selector);\n bySelector.set(selector, css);\n }\n return css;\n}\n\n/**\n * Applies a theme, colour mode and density to everything inside it, with CSS\n * custom properties only: no runtime styling library and no context reads in\n * components (ADR 0006).\n *\n * It renders a wrapper with `display: contents`, so it doesn't affect layout.\n * A custom theme is written as a `<style>` element, rendered on the server\n * with the rest of the page, and `system` mode is pure CSS, so nothing\n * flashes before hydration (ADR 0007). Pass a stable theme object, such as\n * one created at module level, so its CSS is generated once.\n *\n * Under a Content Security Policy, a custom theme needs a `style-src` nonce\n * source and the `nonce` prop. Without a nonce, use `themeToCss` at build\n * time instead. The built-in themes need no inline styles.\n *\n * @example\n * ```tsx\n * <ThemeProvider theme={{ light: brandLight, dark: brandDark }} mode=\"system\" density=\"compact\">\n * <App />\n * </ThemeProvider>\n * ```\n *\n * @public\n */\nexport function ThemeProvider(props: ThemeProviderProps): ReactElement {\n checkSingleCopy();\n const { theme, mode, density, nonce, children } = props;\n // useId keeps server and client markup identical. Its characters vary\n // between React versions, so only selector-safe ones are kept.\n const scopeId = `hm${useId().replace(/[^A-Za-z0-9_-]/g, \"-\")}`;\n const single = theme !== undefined && !isThemePair(theme);\n const css =\n theme === undefined ? undefined : cachedCss(theme, `[data-hm-theme-scope=\"${scopeId}\"]`);\n return (\n <div\n data-hm-theme-scope={scopeId}\n data-hm-theme={single ? undefined : (mode ?? \"system\")}\n data-hm-density={density}\n >\n {css === undefined ? null : (\n <style\n nonce={nonce}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: the CSS comes from themeToCss, which allowlists every value and selector and never emits \"<\".\n dangerouslySetInnerHTML={{ __html: css }}\n />\n )}\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAWA,IAAM,WAA2B,uBAAO,IAAI,kBAAkB;AAG9D,IAAM,YAAY,CAAC;AAEnB,IAAI,UAAU;AAGd,SAAS,aAAqB;CAC5B,OAAA;AACF;AAWA,SAAgB,kBAAwB;CAEtC,IAAI,WAAW,EAAE,OAAO,YAAY,eAAA,QAAA,IAAA,aAAwC,eAC1E;CAEF,UAAU;CACV,MAAM,SAAS;CACf,MAAM,SAAS,OAAO,6BAAa,IAAI,IAAoB;CAC3D,OAAO,YAAY;CACnB,OAAO,IAAI,WAAW,WAAW,CAAC;CAClC,IAAI,OAAO,OAAO,GACZ;MAAA,OAAO,YAAY,eAAA,QAAA,IAAA,aAAwC,cAC7D,kBACE,GAAG,OAAO,KAAK,0CAA0C,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,mRAC3F;CAAA;AAGN;;AChBA,IAAM,mBAAmC,8BAAoC,KAAA,CAAS;AA0BtF,SAAgB,kBAAkB,EAAE,YAAkD;CACpF,gBAAgB;CAChB,MAAM,CAAC,QAAQ,aAAa,SAAiB;EAAE,SAAS;EAAI,OAAO;CAAE,CAAC;CACtE,MAA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