@hussmartinez/ui 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/react.d.ts +85 -1
- package/dist/react.js +89 -2
- package/dist/react.js.map +1 -1
- package/dist/ui.d.ts +85 -1
- package/package.json +5 -5
package/dist/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","names":["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/messages/UiMessagesProvider.tsx","../src/components/dialog/CloseIcon.tsx","../src/components/dialog/Dialog.tsx","../src/components/field/field-context.ts","../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-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 { 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","/**\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 { 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/** 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 { forwardRef, type HTMLAttributes, type ReactNode, useId } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { FieldContext, type FieldControlProps, joinIds } 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 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 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 {typeof children === \"function\" ? children(control) : children}\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 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 `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 `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 `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 `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 `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-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 `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 `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 `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 }}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U;CAChC;CACA,IAAI,MAAM,WAAW,IAAI,QAAQ;CACjC,IAAI,QAAQ,KAAA,GAAW;EAIrB,MAAM,CAAC,OAAO,QAAQ,YAAY,KAAK,IAAI,CAAC,MAAM,OAAO,MAAM,IAAI,IAAI,CAAC,OAAO,KAAA,CAAS;EACxF,MAAM,QAAQ,YAAY,KAAK;EAC/B,IAAI,CAAC,SAAU,SAAS,KAAA,KAAa,CAAC,YAAY,IAAI,GACpD,MAAM,IAAI,QAAQ,uBAAuB,gDAAgD,EACvF,SAAS;GAAE,OAAO;GAAS,OAAO;GAAI,QAAQ;EAAuC,EACvF,CAAC;EAEH,MAAM,MAAM,OAAO,MAAM,QAAQ;EACjC,WAAW,IAAI,UAAU,GAAG;CAC9B;CACA,OAAO;AACT;AA0BA,SAAgB,cAAc,OAAyC;CACrE,gBAAgB;CAChB,MAAM,EAAE,OAAO,MAAM,SAAS,OAAO,aAAa;CAGlD,MAAM,UAAU,KAAK,MAAM,CAAC,CAAC,QAAQ,mBAAmB,GAAG;CAC3D,MAAM,SAAS,UAAU,KAAA,KAAa,CAAC,YAAY,KAAK;CACxD,MAAM,MACJ,UAAU,KAAA,IAAY,KAAA,IAAY,UAAU,OAAO,yBAAyB,QAAQ,GAAG;CACzF,OACE,qBAAC,OAAD;EACE,uBAAqB;EACrB,iBAAe,SAAS,KAAA,IAAa,QAAQ;EAC7C,mBAAiB;EAHnB,UAAA,CAKG,QAAQ,KAAA,IAAY,OACnB,oBAAC,SAAD;GACS;GAEP,yBAAyB,EAAE,QAAQ,IAAI;EACxC,CAAA,GAEF,QACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"react.js","names":["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/messages/UiMessagesProvider.tsx","../src/components/dialog/CloseIcon.tsx","../src/components/dialog/Dialog.tsx","../src/components/field/field-context.ts","../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-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 { 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","/**\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 { 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/** 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 { forwardRef, type HTMLAttributes, type ReactNode, useId } from \"react\";\nimport { cx, type StyleProps, unstyledAttribute } from \"../shared/style-props.js\";\nimport { FieldContext, type FieldControlProps, joinIds } 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 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 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 {typeof children === \"function\" ? children(control) : children}\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 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 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,MAAM,CAAC,WAAW,gBAAgB,SAAiB;EAAE,SAAS;EAAI,OAAO;CAAE,CAAC;CAG5E,MAAM,SAAS,OAA4C,CAAC,CAAC;CAE7D,sBACc;EACV,KAAK,M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