@x12i/ui 1.0.0 → 1.1.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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/cx.ts","../src/components/badge.tsx","../src/utils/slot.tsx","../src/components/visually-hidden.tsx","../src/components/spinner.tsx","../src/components/button.tsx","../src/components/divider.tsx","../src/components/icon-button.tsx","../src/components/stack.tsx","../src/providers/density-provider.tsx","../src/utils/use-persisted-choice.ts","../src/providers/theme-provider.tsx"],"sourcesContent":["/** Joins class names, skipping falsy values. */\r\nexport function cx(...values: Array<string | false | null | undefined>): string | undefined {\r\n const joined = values.filter(Boolean).join(\" \");\r\n return joined === \"\" ? undefined : joined;\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\n\r\nexport type BadgeVariant = \"soft\" | \"solid\" | \"outline\";\r\nexport type BadgeTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\r\n\r\nexport interface BadgeProps extends ComponentPropsWithRef<\"span\"> {\r\n variant?: BadgeVariant;\r\n /** Status tones use the same colors as charts, diagrams and report callouts. */\r\n tone?: BadgeTone;\r\n size?: \"sm\" | \"md\";\r\n}\r\n\r\nexport function Badge({\r\n variant = \"soft\",\r\n tone = \"neutral\",\r\n size = \"md\",\r\n className,\r\n ...props\r\n}: BadgeProps) {\r\n return (\r\n <span\r\n data-kit=\"badge\"\r\n data-variant={variant}\r\n data-tone={tone}\r\n data-size={size}\r\n className={cx(className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import {\r\n cloneElement,\r\n isValidElement,\r\n type CSSProperties,\r\n type ReactElement,\r\n type ReactNode,\r\n type Ref,\r\n} from \"react\";\r\nimport { cx } from \"./cx\";\r\n\r\ntype AnyProps = Record<string, unknown>;\r\n\r\nexport function composeRefs<T>(\r\n ...refs: Array<Ref<T> | undefined>\r\n): (node: T | null) => void {\r\n return (node) => {\r\n for (const ref of refs) {\r\n if (typeof ref === \"function\") ref(node);\r\n else if (ref) (ref as { current: T | null }).current = node;\r\n }\r\n };\r\n}\r\n\r\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {\r\n const merged: AnyProps = { ...slotProps, ...childProps };\r\n\r\n for (const key of Object.keys(slotProps)) {\r\n const slotValue = slotProps[key];\r\n const childValue = childProps[key];\r\n\r\n if (/^on[A-Z]/.test(key) && typeof slotValue === \"function\" && typeof childValue === \"function\") {\r\n merged[key] = (...args: unknown[]) => {\r\n childValue(...args);\r\n slotValue(...args);\r\n };\r\n } else if (key === \"style\") {\r\n merged[key] = { ...(slotValue as CSSProperties), ...(childValue as CSSProperties) };\r\n } else if (key === \"className\") {\r\n merged[key] = cx(slotValue as string, childValue as string);\r\n }\r\n }\r\n\r\n return merged;\r\n}\r\n\r\n// The slot forwards a ref for whatever element its child turns out to be.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ntype AnyRef = Ref<any>;\r\n\r\nexport interface SlotProps {\r\n children?: ReactNode;\r\n ref?: AnyRef;\r\n [prop: string]: unknown;\r\n}\r\n\r\n/**\r\n * Renders its single child element with the slot's props merged in. This is how\r\n * `asChild` composition works: `<Button asChild><a href=\"/x\">Go</a></Button>`\r\n * renders an anchor that looks and behaves like a button.\r\n */\r\nexport function Slot({ children, ref, ...slotProps }: SlotProps) {\r\n if (!isValidElement(children)) return null;\r\n\r\n const child = children as ReactElement<AnyProps & { ref?: AnyRef }>;\r\n const { ref: childRef, ...childProps } = child.props;\r\n\r\n return cloneElement(child, {\r\n ...mergeProps(slotProps, childProps),\r\n ref: composeRefs(ref, childRef),\r\n });\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\n\r\nexport interface VisuallyHiddenProps extends ComponentPropsWithRef<\"span\"> {\r\n /** Render the child element instead of a span. */\r\n asChild?: boolean;\r\n}\r\n\r\n/** Hides content visually but keeps it available to assistive technology. */\r\nexport function VisuallyHidden({ asChild = false, className, ...props }: VisuallyHiddenProps) {\r\n const Component = asChild ? Slot : \"span\";\r\n return <Component data-kit=\"visually-hidden\" className={cx(className)} {...props} />;\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { VisuallyHidden } from \"./visually-hidden\";\r\n\r\nexport interface SpinnerProps extends Omit<ComponentPropsWithRef<\"span\">, \"children\"> {\r\n /** Icon size, from the icon size tokens. */\r\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n /**\r\n * Accessible name, for example \"Loading\". When omitted the spinner is\r\n * decorative and hidden from assistive technology. Strings are never baked\r\n * into components, so pass a translated label.\r\n */\r\n label?: string;\r\n}\r\n\r\nexport function Spinner({ size = \"md\", label, className, ref, ...props }: SpinnerProps) {\r\n const decorative = label === undefined;\r\n\r\n return (\r\n <span\r\n ref={ref}\r\n data-kit=\"spinner\"\r\n data-size={size}\r\n role={decorative ? undefined : \"status\"}\r\n aria-hidden={decorative ? true : undefined}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n <svg data-kit-slot=\"spinner-graphic\" viewBox=\"0 0 24 24\" focusable=\"false\" aria-hidden=\"true\">\r\n <circle data-kit-slot=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" />\r\n <circle data-kit-slot=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" />\r\n </svg>\r\n {decorative ? null : <VisuallyHidden>{label}</VisuallyHidden>}\r\n </span>\r\n );\r\n}\r\n","import type { ComponentPropsWithRef, MouseEvent, ReactNode } from \"react\";\r\nimport type { ControlSize } from \"../types\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\nimport { Spinner } from \"./spinner\";\r\n\r\nexport type ButtonVariant = \"solid\" | \"soft\" | \"outline\" | \"ghost\";\r\nexport type ButtonTone = \"accent\" | \"neutral\";\r\n\r\nexport interface ButtonProps extends ComponentPropsWithRef<\"button\"> {\r\n /** Visual weight. `solid` is the primary action; use one per view. */\r\n variant?: ButtonVariant;\r\n /** `accent` marks the primary action and the finding; `neutral` stays grey. */\r\n tone?: ButtonTone;\r\n size?: ControlSize;\r\n /**\r\n * Shows a spinner and blocks activation while keeping focus and layout. The\r\n * button stays focusable so keyboard users do not lose their place.\r\n */\r\n loading?: boolean;\r\n /**\r\n * Accessible name for the spinner, for example \"Saving\". Pass a translated\r\n * string; components never contain user-facing text.\r\n */\r\n loadingLabel?: string;\r\n /** Render the child element (for example an anchor) with button styling. */\r\n asChild?: boolean;\r\n}\r\n\r\nexport function Button({\r\n variant = \"solid\",\r\n tone = \"accent\",\r\n size = \"md\",\r\n loading = false,\r\n loadingLabel,\r\n asChild = false,\r\n disabled = false,\r\n type,\r\n className,\r\n children,\r\n onClick,\r\n ref,\r\n ...props\r\n}: ButtonProps) {\r\n const inactive = disabled || loading;\r\n\r\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\r\n if (inactive) {\r\n event.preventDefault();\r\n return;\r\n }\r\n onClick?.(event);\r\n };\r\n\r\n const shared = {\r\n ref,\r\n \"data-kit\": \"button\",\r\n \"data-variant\": variant,\r\n \"data-tone\": tone,\r\n \"data-size\": size,\r\n \"data-loading\": loading ? \"\" : undefined,\r\n \"data-disabled\": inactive ? \"\" : undefined,\r\n \"aria-busy\": loading ? true : undefined,\r\n className: cx(className),\r\n onClick: handleClick,\r\n ...props,\r\n } as const;\r\n\r\n if (asChild) {\r\n return (\r\n <Slot {...shared} aria-disabled={inactive ? true : undefined}>\r\n {children}\r\n </Slot>\r\n );\r\n }\r\n\r\n const content: ReactNode = (\r\n <>\r\n <span data-kit-slot=\"content\">{children}</span>\r\n {loading ? (\r\n <span data-kit-slot=\"spinner\">\r\n <Spinner size=\"sm\" {...(loadingLabel === undefined ? {} : { label: loadingLabel })} />\r\n </span>\r\n ) : null}\r\n </>\r\n );\r\n\r\n return (\r\n <button\r\n {...shared}\r\n // A loading button stays focusable (aria-disabled); a disabled one is natively disabled.\r\n type={type ?? \"button\"}\r\n disabled={disabled}\r\n aria-disabled={loading && !disabled ? true : undefined}\r\n >\r\n {content}\r\n </button>\r\n );\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\n\r\nexport interface DividerProps extends Omit<ComponentPropsWithRef<\"hr\">, \"children\"> {\r\n orientation?: \"horizontal\" | \"vertical\";\r\n /**\r\n * A decorative divider is hidden from assistive technology. Use it when the\r\n * surrounding structure already separates the content.\r\n */\r\n decorative?: boolean;\r\n}\r\n\r\n/** A separator. Native `<hr>` already has the separator role, so no ARIA role is added. */\r\nexport function Divider({\r\n orientation = \"horizontal\",\r\n decorative = false,\r\n className,\r\n ...props\r\n}: DividerProps) {\r\n return (\r\n <hr\r\n data-kit=\"divider\"\r\n data-orientation={orientation}\r\n role={decorative ? \"presentation\" : undefined}\r\n aria-orientation={!decorative && orientation === \"vertical\" ? \"vertical\" : undefined}\r\n className={cx(className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\nimport { Button, type ButtonProps } from \"./button\";\r\n\r\nexport interface IconButtonProps\r\n extends Omit<ButtonProps, \"children\" | \"aria-label\" | \"aria-labelledby\" | \"asChild\"> {\r\n /**\r\n * Accessible name. Required: an icon-only button without a name is a\r\n * TypeScript error. Pass a translated string.\r\n */\r\n label: string;\r\n /** The icon. It is hidden from assistive technology by the label. */\r\n children: ReactNode;\r\n}\r\n\r\nexport function IconButton({ label, children, ...props }: IconButtonProps) {\r\n return (\r\n <Button {...props} aria-label={label} data-icon-only=\"\">\r\n {children}\r\n </Button>\r\n );\r\n}\r\n","import { cssVar } from \"@x12i/tokens\";\r\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\r\nimport type { SpaceKey } from \"../types\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\n\r\nexport type Align = \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\r\nexport type Justify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\r\n\r\ninterface FlexProps extends ComponentPropsWithRef<\"div\"> {\r\n /** Space between children, from the space scale. */\r\n gap?: SpaceKey;\r\n align?: Align;\r\n justify?: Justify;\r\n wrap?: boolean;\r\n /** Render the child element instead of a div. */\r\n asChild?: boolean;\r\n}\r\n\r\nfunction Flex({\r\n kind,\r\n gap,\r\n align,\r\n justify,\r\n wrap,\r\n asChild = false,\r\n className,\r\n style,\r\n ...props\r\n}: FlexProps & { kind: \"stack\" | \"inline\" }) {\r\n const Component = asChild ? Slot : \"div\";\r\n const gapStyle: CSSProperties | undefined =\r\n gap === undefined ? undefined : { gap: cssVar(`space.${gap}`) };\r\n\r\n return (\r\n <Component\r\n data-kit={kind}\r\n data-align={align}\r\n data-justify={justify}\r\n data-wrap={wrap ? \"\" : undefined}\r\n className={cx(className)}\r\n style={{ ...gapStyle, ...style }}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport type StackProps = FlexProps;\r\n\r\n/** Lays children out in a column. */\r\nexport function Stack({ gap = \"3\", ...props }: StackProps) {\r\n return <Flex kind=\"stack\" gap={gap} {...props} />;\r\n}\r\n\r\nexport type InlineProps = FlexProps;\r\n\r\n/** Lays children out in a row, aligned to the center and wrapping by default. */\r\nexport function Inline({ gap = \"2\", align = \"center\", wrap = true, ...props }: InlineProps) {\r\n return <Flex kind=\"inline\" gap={gap} align={align} wrap={wrap} {...props} />;\r\n}\r\n","import {\r\n DENSITY_ATTRIBUTE,\r\n DENSITY_STORAGE_KEY,\r\n densityNames,\r\n type DensityName,\r\n} from \"@x12i/tokens\";\r\nimport {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n type ComponentPropsWithRef,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { usePersistedChoice } from \"../utils/use-persisted-choice\";\r\n\r\nexport interface DensityContextValue {\r\n density: DensityName;\r\n setDensity: (density: DensityName) => void;\r\n}\r\n\r\nconst DensityContext = createContext<DensityContextValue | null>(null);\r\n\r\nfunction isDensity(value: string): value is DensityName {\r\n return (densityNames as readonly string[]).includes(value);\r\n}\r\n\r\nexport interface DensityProviderProps\r\n extends Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> {\r\n children?: ReactNode;\r\n /** Controlled density. */\r\n density?: DensityName;\r\n defaultDensity?: DensityName;\r\n onDensityChange?: (density: DensityName) => void;\r\n /**\r\n * `root` sets `data-density` on `<html>` and renders no wrapper element.\r\n * `subtree` (default) renders a wrapper that scopes the density to its children.\r\n */\r\n scope?: \"root\" | \"subtree\";\r\n /**\r\n * localStorage key that remembers the choice, or `null` for none. Defaults\r\n * to the shared key for `root` and to none for `subtree`.\r\n */\r\n storageKey?: string | null;\r\n}\r\n\r\n/** Compact, default and comfortable density from one set of components. */\r\nexport function DensityProvider({\r\n children,\r\n density: densityProp,\r\n defaultDensity = \"default\",\r\n onDensityChange,\r\n scope = \"subtree\",\r\n storageKey,\r\n className,\r\n ...props\r\n}: DensityProviderProps) {\r\n const [density, setDensity] = usePersistedChoice<DensityName>({\r\n value: densityProp,\r\n defaultValue: defaultDensity,\r\n onChange: onDensityChange,\r\n storageKey:\r\n storageKey === undefined ? (scope === \"root\" ? DENSITY_STORAGE_KEY : null) : storageKey,\r\n isValid: isDensity,\r\n });\r\n\r\n useEffect(() => {\r\n if (scope !== \"root\") return;\r\n const root = document.documentElement;\r\n const previous = root.getAttribute(DENSITY_ATTRIBUTE);\r\n root.setAttribute(DENSITY_ATTRIBUTE, density);\r\n return () => {\r\n if (previous === null) root.removeAttribute(DENSITY_ATTRIBUTE);\r\n else root.setAttribute(DENSITY_ATTRIBUTE, previous);\r\n };\r\n }, [scope, density]);\r\n\r\n const value = useMemo<DensityContextValue>(\r\n () => ({ density, setDensity }),\r\n [density, setDensity],\r\n );\r\n\r\n return (\r\n <DensityContext value={value}>\r\n {scope === \"root\" ? (\r\n children\r\n ) : (\r\n <div\r\n data-kit=\"density-provider\"\r\n {...{ [DENSITY_ATTRIBUTE]: density }}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n {children}\r\n </div>\r\n )}\r\n </DensityContext>\r\n );\r\n}\r\n\r\n/** Reads and changes the density of the nearest `DensityProvider`. */\r\nexport function useDensity(): DensityContextValue {\r\n const context = useContext(DensityContext);\r\n if (context === null) {\r\n throw new Error(\"useDensity must be used inside a DensityProvider.\");\r\n }\r\n return context;\r\n}\r\n","import { useCallback, useEffect, useState } from \"react\";\r\n\r\nfunction read(key: string): string | null {\r\n try {\r\n return window.localStorage.getItem(key);\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\nfunction write(key: string, value: string) {\r\n try {\r\n window.localStorage.setItem(key, value);\r\n } catch {\r\n // Storage can be blocked (private mode, sandboxed frames). Ignore.\r\n }\r\n}\r\n\r\ninterface Options<T extends string> {\r\n value: T | undefined;\r\n defaultValue: T;\r\n onChange: ((value: T) => void) | undefined;\r\n /** localStorage key, or null to skip persistence. */\r\n storageKey: string | null;\r\n /** Must be a stable function (declare it at module level). */\r\n isValid: (value: string) => value is T;\r\n}\r\n\r\n/**\r\n * Controlled or uncontrolled state with optional persistence. The stored value\r\n * is read after mount, so server and first client render always agree.\r\n */\r\nexport function usePersistedChoice<T extends string>({\r\n value: controlled,\r\n defaultValue,\r\n onChange,\r\n storageKey,\r\n isValid,\r\n}: Options<T>) {\r\n const isControlled = controlled !== undefined;\r\n const [internal, setInternal] = useState<T>(defaultValue);\r\n\r\n useEffect(() => {\r\n if (isControlled || storageKey === null) return;\r\n const stored = read(storageKey);\r\n if (stored !== null && isValid(stored)) setInternal(stored);\r\n }, [isControlled, storageKey, isValid]);\r\n\r\n const setValue = useCallback(\r\n (next: T) => {\r\n if (!isControlled) setInternal(next);\r\n if (storageKey !== null) write(storageKey, next);\r\n onChange?.(next);\r\n },\r\n [isControlled, storageKey, onChange],\r\n );\r\n\r\n return [isControlled ? controlled : internal, setValue] as const;\r\n}\r\n","import {\r\n THEME_ATTRIBUTE,\r\n THEME_STORAGE_KEY,\r\n themeNames,\r\n type ThemeName,\r\n} from \"@x12i/tokens\";\r\nimport {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useSyncExternalStore,\r\n type ComponentPropsWithRef,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { usePersistedChoice } from \"../utils/use-persisted-choice\";\r\n\r\n/** A theme name, or `system` to follow the operating system preference. */\r\nexport type ThemeChoice = ThemeName | \"system\";\r\n\r\nexport interface ThemeContextValue {\r\n /** The user's choice, which can be `system`. */\r\n theme: ThemeChoice;\r\n /** The theme in effect. `system` resolves to `light` or `dark`. */\r\n resolvedTheme: ThemeName;\r\n setTheme: (theme: ThemeChoice) => void;\r\n}\r\n\r\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\r\n\r\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\r\n\r\nfunction subscribeToSystemTheme(onChange: () => void) {\r\n const query = window.matchMedia(DARK_QUERY);\r\n query.addEventListener(\"change\", onChange);\r\n return () => query.removeEventListener(\"change\", onChange);\r\n}\r\n\r\nconst prefersDark = () => window.matchMedia(DARK_QUERY).matches;\r\n// The server cannot know; light matches the CSS fallback.\r\nconst serverPrefersDark = () => false;\r\n\r\nfunction isThemeChoice(value: string): value is ThemeChoice {\r\n return value === \"system\" || (themeNames as readonly string[]).includes(value);\r\n}\r\n\r\nexport interface ThemeProviderProps\r\n extends Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> {\r\n children?: ReactNode;\r\n /** Controlled theme. */\r\n theme?: ThemeChoice;\r\n /** Initial theme when uncontrolled. Defaults to following the system. */\r\n defaultTheme?: ThemeChoice;\r\n onThemeChange?: (theme: ThemeChoice) => void;\r\n /**\r\n * `root` sets `data-theme` on `<html>` and renders no wrapper element.\r\n * `subtree` (default) renders a wrapper that scopes the theme to its children.\r\n */\r\n scope?: \"root\" | \"subtree\";\r\n /**\r\n * localStorage key that remembers the choice, or `null` for none. Defaults\r\n * to the shared key for `root` and to none for `subtree`.\r\n */\r\n storageKey?: string | null;\r\n}\r\n\r\n/**\r\n * Sets the theme for the page or for a subtree. Pair a `root` provider with\r\n * `getNoFlashScript()` from `@x12i/themes` to avoid a flash on first paint.\r\n */\r\nexport function ThemeProvider({\r\n children,\r\n theme: themeProp,\r\n defaultTheme = \"system\",\r\n onThemeChange,\r\n scope = \"subtree\",\r\n storageKey,\r\n className,\r\n ...props\r\n}: ThemeProviderProps) {\r\n const [theme, setTheme] = usePersistedChoice<ThemeChoice>({\r\n value: themeProp,\r\n defaultValue: defaultTheme,\r\n onChange: onThemeChange,\r\n storageKey: storageKey === undefined ? (scope === \"root\" ? THEME_STORAGE_KEY : null) : storageKey,\r\n isValid: isThemeChoice,\r\n });\r\n\r\n const systemIsDark = useSyncExternalStore(subscribeToSystemTheme, prefersDark, serverPrefersDark);\r\n const resolvedTheme: ThemeName = theme === \"system\" ? (systemIsDark ? \"dark\" : \"light\") : theme;\r\n\r\n // `system` leaves the attribute off so the CSS media query decides.\r\n const attribute = theme === \"system\" ? undefined : theme;\r\n\r\n useEffect(() => {\r\n if (scope !== \"root\") return;\r\n const root = document.documentElement;\r\n const previous = root.getAttribute(THEME_ATTRIBUTE);\r\n if (attribute === undefined) root.removeAttribute(THEME_ATTRIBUTE);\r\n else root.setAttribute(THEME_ATTRIBUTE, attribute);\r\n return () => {\r\n if (previous === null) root.removeAttribute(THEME_ATTRIBUTE);\r\n else root.setAttribute(THEME_ATTRIBUTE, previous);\r\n };\r\n }, [scope, attribute]);\r\n\r\n const value = useMemo<ThemeContextValue>(\r\n () => ({ theme, resolvedTheme, setTheme }),\r\n [theme, resolvedTheme, setTheme],\r\n );\r\n\r\n return (\r\n <ThemeContext value={value}>\r\n {scope === \"root\" ? (\r\n children\r\n ) : (\r\n <div\r\n data-kit=\"theme-provider\"\r\n {...{ [THEME_ATTRIBUTE]: attribute }}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n {children}\r\n </div>\r\n )}\r\n </ThemeContext>\r\n );\r\n}\r\n\r\n/** Reads and changes the theme of the nearest `ThemeProvider`. */\r\nexport function useTheme(): ThemeContextValue {\r\n const context = useContext(ThemeContext);\r\n if (context === null) {\r\n throw new Error(\"useTheme must be used inside a ThemeProvider.\");\r\n }\r\n return context;\r\n}\r\n"],"mappings":";;;AACO,SAAS,MAAM,QAAsE;AAC1F,QAAM,SAAS,OAAO,OAAO,OAAO,EAAE,KAAK,GAAG;AAC9C,SAAO,WAAW,KAAK,SAAY;AACrC;;;ACiBI;AARG,SAAS,MAAM;AAAA,EACpB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAe;AACb,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAS;AAAA,MACT,gBAAc;AAAA,MACd,aAAW;AAAA,MACX,aAAW;AAAA,MACX,WAAW,GAAG,SAAS;AAAA,MACtB,GAAG;AAAA;AAAA,EACN;AAEJ;;;AC9BA;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AAKA,SAAS,eACX,MACuB;AAC1B,SAAO,CAAC,SAAS;AACf,eAAW,OAAO,MAAM;AACtB,UAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,eAC9B,IAAK,CAAC,IAA8B,UAAU;AAAA,IACzD;AAAA,EACF;AACF;AAEA,SAAS,WAAW,WAAqB,YAAgC;AACvE,QAAM,SAAmB,EAAE,GAAG,WAAW,GAAG,WAAW;AAEvD,aAAW,OAAO,OAAO,KAAK,SAAS,GAAG;AACxC,UAAM,YAAY,UAAU,GAAG;AAC/B,UAAM,aAAa,WAAW,GAAG;AAEjC,QAAI,WAAW,KAAK,GAAG,KAAK,OAAO,cAAc,cAAc,OAAO,eAAe,YAAY;AAC/F,aAAO,GAAG,IAAI,IAAI,SAAoB;AACpC,mBAAW,GAA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ACjD,WAAO,MAAM;AACX,UAAI,aAAa,KAAM,MAAK,gBAAgB,eAAe;AAAA,UACtD,MAAK,aAAa,iBAAiB,QAAQ;AAAA,IAClD;AAAA,EACF,GAAG,CAAC,OAAO,SAAS,CAAC;AAErB,QAAM,QAAQC;AAAA,IACZ,OAAO,EAAE,OAAO,eAAe,SAAS;AAAA,IACxC,CAAC,OAAO,eAAe,QAAQ;AAAA,EACjC;AAEA,SACE,gBAAAH,KAAC,gBAAa,OACX,oBAAU,SACT,WAEA,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,YAAS;AAAA,MACR,GAAG,EAAE,CAAC,eAAe,GAAG,UAAU;AAAA,MACnC,WAAW,GAAG,SAAS;AAAA,MACtB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GAEJ;AAEJ;AAGO,SAAS,WAA8B;AAC5C,QAAM,UAAUI,YAAW,YAAY;AACvC,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE;AACA,SAAO;AACT;","names":["jsx","jsx","jsx","jsxs","jsx","jsx","jsx","useEffect","jsx","useEffect","createContext","useContext","useEffect","useMemo","jsx","createContext","useEffect","useMemo","useContext"]}
1
+ {"version":3,"sources":["../src/utils/cx.ts","../src/components/badge.tsx","../src/utils/slot.tsx","../src/components/visually-hidden.tsx","../src/components/spinner.tsx","../src/components/button.tsx","../src/components/button-group.tsx","../src/components/copy-button.tsx","../src/components/icon-button.tsx","../src/components/kbd.tsx","../src/components/link.tsx","../src/components/toggle.tsx","../src/components/checkbox.tsx","../src/components/choice.tsx","../src/components/combobox.tsx","../src/components/field.tsx","../src/components/input.tsx","../src/components/number-input.tsx","../src/components/otp-input.tsx","../src/components/radio-group.tsx","../src/components/select.tsx","../src/components/slider.tsx","../src/components/switch.tsx","../src/components/textarea.tsx","../src/components/divider.tsx","../src/components/stack.tsx","../src/components/alert.tsx","../src/components/progress.tsx","../src/components/progress-circle.tsx","../src/components/animated-number.tsx","../src/components/skeleton.tsx","../src/components/empty-state.tsx","../src/components/card.tsx","../src/components/avatar.tsx","../src/components/tag.tsx","../src/components/stat.tsx","../src/components/table.tsx","../src/components/scroll-area.tsx","../src/components/collapsible.tsx","../src/components/tabs.tsx","../src/components/breadcrumb.tsx","../src/components/pagination.tsx","../src/components/accordion.tsx","../src/components/segmented-control.tsx","../src/components/stepper.tsx","../src/components/toolbar.tsx","../src/components/dialog.tsx","../src/components/drawer.tsx","../src/components/popover.tsx","../src/components/tooltip.tsx","../src/components/menu.tsx","../src/components/toast.tsx","../src/components/split-button.tsx","../src/providers/density-provider.tsx","../src/utils/use-persisted-choice.ts","../src/providers/theme-provider.tsx"],"sourcesContent":["/** Joins class names, skipping falsy values. */\r\nexport function cx(...values: Array<string | false | null | undefined>): string | undefined {\r\n const joined = values.filter(Boolean).join(\" \");\r\n return joined === \"\" ? undefined : joined;\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\n\r\nexport type BadgeVariant = \"soft\" | \"solid\" | \"outline\";\r\nexport type BadgeTone = \"neutral\" | \"accent\" | \"success\" | \"warning\" | \"danger\" | \"info\";\r\n\r\nexport interface BadgeProps extends ComponentPropsWithRef<\"span\"> {\r\n variant?: BadgeVariant;\r\n /** Status tones use the same colors as charts, diagrams and report callouts. */\r\n tone?: BadgeTone;\r\n size?: \"sm\" | \"md\";\r\n}\r\n\r\nexport function Badge({\r\n variant = \"soft\",\r\n tone = \"neutral\",\r\n size = \"md\",\r\n className,\r\n ...props\r\n}: BadgeProps) {\r\n return (\r\n <span\r\n data-kit=\"badge\"\r\n data-variant={variant}\r\n data-tone={tone}\r\n data-size={size}\r\n className={cx(className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import {\r\n cloneElement,\r\n isValidElement,\r\n type CSSProperties,\r\n type ReactElement,\r\n type ReactNode,\r\n type Ref,\r\n} from \"react\";\r\nimport { cx } from \"./cx\";\r\n\r\ntype AnyProps = Record<string, unknown>;\r\n\r\nexport function composeRefs<T>(\r\n ...refs: Array<Ref<T> | undefined>\r\n): (node: T | null) => void {\r\n return (node) => {\r\n for (const ref of refs) {\r\n if (typeof ref === \"function\") ref(node);\r\n else if (ref) (ref as { current: T | null }).current = node;\r\n }\r\n };\r\n}\r\n\r\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps): AnyProps {\r\n const merged: AnyProps = { ...slotProps, ...childProps };\r\n\r\n for (const key of Object.keys(slotProps)) {\r\n const slotValue = slotProps[key];\r\n const childValue = childProps[key];\r\n\r\n if (/^on[A-Z]/.test(key) && typeof slotValue === \"function\" && typeof childValue === \"function\") {\r\n merged[key] = (...args: unknown[]) => {\r\n childValue(...args);\r\n slotValue(...args);\r\n };\r\n } else if (key === \"style\") {\r\n merged[key] = { ...(slotValue as CSSProperties), ...(childValue as CSSProperties) };\r\n } else if (key === \"className\") {\r\n merged[key] = cx(slotValue as string, childValue as string);\r\n }\r\n }\r\n\r\n return merged;\r\n}\r\n\r\n// The slot forwards a ref for whatever element its child turns out to be.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\ntype AnyRef = Ref<any>;\r\n\r\nexport interface SlotProps {\r\n children?: ReactNode;\r\n ref?: AnyRef;\r\n [prop: string]: unknown;\r\n}\r\n\r\n/**\r\n * Renders its single child element with the slot's props merged in. This is how\r\n * `asChild` composition works: `<Button asChild><a href=\"/x\">Go</a></Button>`\r\n * renders an anchor that looks and behaves like a button.\r\n */\r\nexport function Slot({ children, ref, ...slotProps }: SlotProps) {\r\n if (!isValidElement(children)) return null;\r\n\r\n const child = children as ReactElement<AnyProps & { ref?: AnyRef }>;\r\n const { ref: childRef, ...childProps } = child.props;\r\n\r\n return cloneElement(child, {\r\n ...mergeProps(slotProps, childProps),\r\n ref: composeRefs(ref, childRef),\r\n });\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\n\r\nexport interface VisuallyHiddenProps extends ComponentPropsWithRef<\"span\"> {\r\n /** Render the child element instead of a span. */\r\n asChild?: boolean;\r\n}\r\n\r\n/** Hides content visually but keeps it available to assistive technology. */\r\nexport function VisuallyHidden({ asChild = false, className, ...props }: VisuallyHiddenProps) {\r\n const Component = asChild ? Slot : \"span\";\r\n return <Component data-kit=\"visually-hidden\" className={cx(className)} {...props} />;\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { VisuallyHidden } from \"./visually-hidden\";\r\n\r\nexport interface SpinnerProps extends Omit<ComponentPropsWithRef<\"span\">, \"children\"> {\r\n /** Icon size, from the icon size tokens. */\r\n size?: \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n /**\r\n * Accessible name, for example \"Loading\". When omitted the spinner is\r\n * decorative and hidden from assistive technology. Strings are never baked\r\n * into components, so pass a translated label.\r\n */\r\n label?: string;\r\n}\r\n\r\nexport function Spinner({ size = \"md\", label, className, ref, ...props }: SpinnerProps) {\r\n const decorative = label === undefined;\r\n\r\n return (\r\n <span\r\n ref={ref}\r\n data-kit=\"spinner\"\r\n data-size={size}\r\n role={decorative ? undefined : \"status\"}\r\n aria-hidden={decorative ? true : undefined}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n <svg data-kit-slot=\"spinner-graphic\" viewBox=\"0 0 24 24\" focusable=\"false\" aria-hidden=\"true\">\r\n <circle data-kit-slot=\"spinner-track\" cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" />\r\n <circle data-kit-slot=\"spinner-arc\" cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" />\r\n </svg>\r\n {decorative ? null : <VisuallyHidden>{label}</VisuallyHidden>}\r\n </span>\r\n );\r\n}\r\n","import type { ComponentPropsWithRef, MouseEvent, ReactNode } from \"react\";\r\nimport type { ControlSize } from \"../types\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\nimport { Spinner } from \"./spinner\";\r\n\r\nexport type ButtonVariant = \"solid\" | \"soft\" | \"outline\" | \"ghost\";\r\nexport type ButtonTone = \"accent\" | \"neutral\";\r\n\r\nexport interface ButtonProps extends ComponentPropsWithRef<\"button\"> {\r\n /** Visual weight. `solid` is the primary action; use one per view. */\r\n variant?: ButtonVariant;\r\n /** `accent` marks the primary action and the finding; `neutral` stays grey. */\r\n tone?: ButtonTone;\r\n size?: ControlSize;\r\n /**\r\n * Shows a spinner and blocks activation while keeping focus and layout. The\r\n * button stays focusable so keyboard users do not lose their place.\r\n */\r\n loading?: boolean;\r\n /**\r\n * Accessible name for the spinner, for example \"Saving\". Pass a translated\r\n * string; components never contain user-facing text.\r\n */\r\n loadingLabel?: string;\r\n /** Render the child element (for example an anchor) with button styling. */\r\n asChild?: boolean;\r\n}\r\n\r\nexport function Button({\r\n variant = \"solid\",\r\n tone = \"accent\",\r\n size = \"md\",\r\n loading = false,\r\n loadingLabel,\r\n asChild = false,\r\n disabled = false,\r\n type,\r\n className,\r\n children,\r\n onClick,\r\n ref,\r\n ...props\r\n}: ButtonProps) {\r\n const inactive = disabled || loading;\r\n\r\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\r\n if (inactive) {\r\n event.preventDefault();\r\n return;\r\n }\r\n onClick?.(event);\r\n };\r\n\r\n const shared = {\r\n ref,\r\n \"data-kit\": \"button\",\r\n \"data-variant\": variant,\r\n \"data-tone\": tone,\r\n \"data-size\": size,\r\n \"data-loading\": loading ? \"\" : undefined,\r\n \"data-disabled\": inactive ? \"\" : undefined,\r\n \"aria-busy\": loading ? true : undefined,\r\n className: cx(className),\r\n onClick: handleClick,\r\n ...props,\r\n } as const;\r\n\r\n if (asChild) {\r\n return (\r\n <Slot {...shared} aria-disabled={inactive ? true : undefined}>\r\n {children}\r\n </Slot>\r\n );\r\n }\r\n\r\n const content: ReactNode = (\r\n <>\r\n <span data-kit-slot=\"content\">{children}</span>\r\n {loading ? (\r\n <span data-kit-slot=\"spinner\">\r\n <Spinner size=\"sm\" {...(loadingLabel === undefined ? {} : { label: loadingLabel })} />\r\n </span>\r\n ) : null}\r\n </>\r\n );\r\n\r\n return (\r\n <button\r\n {...shared}\r\n // A loading button stays focusable (aria-disabled); a disabled one is natively disabled.\r\n type={type ?? \"button\"}\r\n disabled={disabled}\r\n aria-disabled={loading && !disabled ? true : undefined}\r\n >\r\n {content}\r\n </button>\r\n );\r\n}\r\n","import type { ComponentPropsWithRef } from \"react\";\n\nexport interface ButtonGroupProps extends ComponentPropsWithRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * Joins the buttons into one segmented control with shared borders. Turn it\n * off to keep them separate and only group them semantically.\n */\n attached?: boolean;\n}\n\n/**\n * Groups related buttons. It is a `role=\"group\"`: give it an `aria-label` when\n * the buttons need a shared name, for example \"Text alignment\".\n */\nexport function ButtonGroup({\n orientation = \"horizontal\",\n attached = true,\n ...props\n}: ButtonGroupProps) {\n return (\n <div\n role=\"group\"\n data-kit=\"button-group\"\n data-orientation={orientation}\n data-attached={attached ? \"\" : undefined}\n {...props}\n />\n );\n}\n","import { Icon } from \"@x12i/icons\";\nimport { useCallback, useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { IconButton } from \"./icon-button\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\nexport type CopyStatus = \"idle\" | \"copied\" | \"failed\";\n\nexport interface CopyButtonProps\n extends Omit<ButtonProps, \"onClick\" | \"children\" | \"asChild\" | \"aria-label\" | \"loading\" | \"loadingLabel\"> {\n /** The text to copy, or a function that returns it at click time. */\n text: string | (() => string);\n /** Accessible name while idle, for example \"Copy code\". */\n label: string;\n /** Announced after a successful copy, for example \"Copied\". */\n copiedLabel: string;\n /** Announced when the clipboard is unavailable or refused. */\n failedLabel?: string;\n /** Milliseconds before the button returns to idle. Defaults to 2000. */\n timeout?: number;\n /** Called with the copied text. (Not `onCopy`, which is the DOM clipboard event.) */\n onCopied?: (value: string) => void;\n onCopyError?: (error: unknown) => void;\n /** Visible text. Leave it out for an icon-only button. */\n children?: ReactNode;\n}\n\n/**\n * Copies text to the clipboard. The result is announced through a polite live\n * region (the button's own name stays constant, so it is never read twice) and\n * shown with an icon, so color is not the only signal.\n */\nexport function CopyButton({\n text: source,\n label,\n copiedLabel,\n failedLabel,\n timeout = 2000,\n onCopied,\n onCopyError,\n children,\n variant = \"ghost\",\n tone = \"neutral\",\n ...props\n}: CopyButtonProps) {\n const [status, setStatus] = useState<CopyStatus>(\"idle\");\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n const settle = useCallback(\n (next: CopyStatus) => {\n setStatus(next);\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setStatus(\"idle\"), timeout);\n },\n [timeout],\n );\n\n const copy = async () => {\n const text = typeof source === \"function\" ? source() : source;\n try {\n if (!navigator.clipboard) throw new Error(\"Clipboard API is not available\");\n await navigator.clipboard.writeText(text);\n onCopied?.(text);\n settle(\"copied\");\n } catch (error) {\n onCopyError?.(error);\n settle(\"failed\");\n }\n };\n\n const glyph = (\n <Icon name={status === \"copied\" ? \"check\" : status === \"failed\" ? \"alert-circle\" : \"copy\"} />\n );\n const announcement =\n status === \"copied\" ? copiedLabel : status === \"failed\" ? (failedLabel ?? \"\") : \"\";\n\n return (\n <>\n {children === undefined ? (\n <IconButton\n label={label}\n variant={variant}\n tone={tone}\n data-kit-copy=\"\"\n data-status={status}\n onClick={() => void copy()}\n {...props}\n >\n {glyph}\n </IconButton>\n ) : (\n <Button\n variant={variant}\n tone={tone}\n data-kit-copy=\"\"\n data-status={status}\n onClick={() => void copy()}\n {...props}\n >\n {glyph}\n {children}\n </Button>\n )}\n <VisuallyHidden role=\"status\" aria-live=\"polite\">\n {announcement}\n </VisuallyHidden>\n </>\n );\n}\n","import type { ReactNode } from \"react\";\r\nimport { Button, type ButtonProps } from \"./button\";\r\n\r\nexport interface IconButtonProps\r\n extends Omit<ButtonProps, \"children\" | \"aria-label\" | \"aria-labelledby\" | \"asChild\"> {\r\n /**\r\n * Accessible name. Required: an icon-only button without a name is a\r\n * TypeScript error. Pass a translated string.\r\n */\r\n label: string;\r\n /** The icon. It is hidden from assistive technology by the label. */\r\n children: ReactNode;\r\n}\r\n\r\nexport function IconButton({ label, children, ...props }: IconButtonProps) {\r\n return (\r\n <Button {...props} aria-label={label} data-icon-only=\"\">\r\n {children}\r\n </Button>\r\n );\r\n}\r\n","import { Children, type ComponentPropsWithRef, type ReactNode } from \"react\";\n\nexport type KbdProps = ComponentPropsWithRef<\"kbd\">;\n\n/** A keyboard key, for shortcut hints: `<Kbd>Esc</Kbd>`. */\nexport function Kbd(props: KbdProps) {\n return <kbd data-kit=\"kbd\" {...props} />;\n}\n\nexport interface KbdGroupProps extends ComponentPropsWithRef<\"span\"> {\n /** Shown between keys. Hidden from assistive technology. Defaults to \"+\". */\n separator?: ReactNode;\n}\n\n/** Several keys that are pressed together: `<KbdGroup><Kbd>Ctrl</Kbd><Kbd>K</Kbd></KbdGroup>`. */\nexport function KbdGroup({ separator = \"+\", children, ...props }: KbdGroupProps) {\n const keys = Children.toArray(children);\n return (\n <span data-kit=\"kbd-group\" {...props}>\n {keys.map((key, index) => (\n // The keys are static markup the caller wrote, so the index is stable.\n <span key={index} data-kit-slot=\"kbd-item\">\n {index > 0 ? (\n <span aria-hidden=\"true\" data-kit-slot=\"kbd-separator\">\n {separator}\n </span>\n ) : null}\n {key}\n </span>\n ))}\n </span>\n );\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { Slot } from \"../utils/slot\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\nexport interface LinkProps extends ComponentPropsWithRef<\"a\"> {\n /** `accent` uses the link color; `neutral` inherits the surrounding text color. */\n tone?: \"accent\" | \"neutral\";\n /** When the underline shows. Keep `always` inside running text. */\n underline?: \"always\" | \"hover\" | \"none\";\n /**\n * Marks the link as leaving the app: opens in a new tab with\n * `rel=\"noopener noreferrer\"` and shows an icon.\n */\n external?: boolean;\n /**\n * Visually hidden text announced after an external link, for example \"(opens\n * in a new tab)\". Pass a translated string; components contain no text.\n */\n externalLabel?: string;\n /** Render the child element (a router link, say) with link styling. */\n asChild?: boolean;\n}\n\nexport function Link({\n tone = \"accent\",\n underline = \"always\",\n external = false,\n externalLabel,\n asChild = false,\n children,\n ...props\n}: LinkProps) {\n const shared = {\n \"data-kit\": \"link\",\n \"data-tone\": tone,\n \"data-underline\": underline,\n \"data-external\": external ? \"\" : undefined,\n ...(external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {}),\n ...props,\n } as const;\n\n if (asChild) return <Slot {...shared}>{children}</Slot>;\n\n return (\n <a {...shared}>\n {children}\n {external ? (\n <>\n <Icon name=\"external-link\" size={12} data-kit-slot=\"external-icon\" />\n {/* The space is a text node of the link: name computation trims it inside the hidden span. */}\n {externalLabel ? (\n <>\n {\" \"}\n <VisuallyHidden>{externalLabel}</VisuallyHidden>\n </>\n ) : null}\n </>\n ) : null}\n </a>\n );\n}\n","import { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport type { ControlSize } from \"../types\";\n\nexport type ToggleVariant = \"outline\" | \"soft\" | \"ghost\";\n\nexport interface ToggleProps<Value extends string = string> extends BaseToggle.Props<Value> {\n variant?: ToggleVariant;\n size?: ControlSize;\n}\n\n/**\n * A two-state button (`aria-pressed`). Pressed state is shown by color, a\n * border and a bottom bar, so it never relies on color alone. Inside a\n * `ToggleGroup` give each toggle a `value`.\n */\nexport function Toggle<Value extends string = string>({\n variant = \"outline\",\n size = \"md\",\n ...props\n}: ToggleProps<Value>) {\n return <BaseToggle data-kit=\"toggle\" data-variant={variant} data-size={size} {...props} />;\n}\n\nexport interface ToggleGroupProps<Value extends string = string> extends BaseToggleGroup.Props<Value> {\n /** Joins the toggles into one segmented control. Defaults to true. */\n attached?: boolean;\n}\n\n/**\n * A set of toggles with arrow-key navigation and either single selection\n * (default) or `multiple`. Name it with `aria-label`.\n */\nexport function ToggleGroup<Value extends string = string>({\n attached = true,\n orientation = \"horizontal\",\n ...props\n}: ToggleGroupProps<Value>) {\n return (\n <BaseToggleGroup\n data-kit=\"toggle-group\"\n data-attached={attached ? \"\" : undefined}\n orientation={orientation}\n {...props}\n />\n );\n}\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ReactNode } from \"react\";\nimport { ChoiceRow, useChoiceIds } from \"./choice\";\n\nexport interface CheckboxProps extends BaseCheckbox.Root.Props {\n /** Visible label. Clicking it toggles the checkbox. */\n label?: ReactNode;\n /** Help text under the label, announced with the checkbox. */\n description?: ReactNode;\n}\n\n/**\n * A checkbox with an optional label and description. Without a `label`, give it\n * an `aria-label`, or put it inside a `Field`. Supports `indeterminate` for\n * \"select all\" parents.\n */\nexport function Checkbox({ label, description, disabled, ...props }: CheckboxProps) {\n const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);\n const control = (\n <BaseCheckbox.Root data-kit=\"checkbox\" disabled={disabled} {...controlAria} {...props}>\n <BaseCheckbox.Indicator data-kit-slot=\"checkbox-indicator\">\n <Icon name=\"check\" size={12} data-kit-slot=\"checkbox-check\" />\n <Icon name=\"minus\" size={12} data-kit-slot=\"checkbox-dash\" />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n return (\n <ChoiceRow\n kind=\"checkbox\"\n control={control}\n label={label}\n description={description}\n labelId={labelId}\n descriptionId={descriptionId}\n disabled={disabled}\n />\n );\n}\n\nexport type CheckboxGroupProps = BaseCheckboxGroup.Props;\n\n/**\n * Manages the checked values of several checkboxes (`value`, `onValueChange`).\n * Name the group with `aria-label` or wrap it in a `Fieldset`.\n */\nexport function CheckboxGroup(props: CheckboxGroupProps) {\n return <BaseCheckboxGroup data-kit=\"checkbox-group\" {...props} />;\n}\n","import { useId, type ReactNode } from \"react\";\n\n/**\n * Shared shell for checkbox, radio and switch: the control, a label and an\n * optional description laid out as one clickable row.\n *\n * The row is a native `<label>`, so clicking the text toggles the control, and\n * the control is also named with `aria-labelledby` / `aria-describedby`, which\n * keeps its accessible name correct however the control renders internally.\n */\nexport function useChoiceIds(label: ReactNode, description: ReactNode) {\n const labelId = useId();\n const descriptionId = useId();\n return {\n labelId,\n descriptionId,\n controlAria: {\n \"aria-labelledby\": label ? labelId : undefined,\n \"aria-describedby\": description ? descriptionId : undefined,\n },\n };\n}\n\nexport interface ChoiceRowProps {\n kind: \"checkbox\" | \"radio\" | \"switch\";\n control: ReactNode;\n label: ReactNode;\n description: ReactNode;\n labelId: string;\n descriptionId: string;\n disabled?: boolean | undefined;\n}\n\nexport function ChoiceRow({\n kind,\n control,\n label,\n description,\n labelId,\n descriptionId,\n disabled,\n}: ChoiceRowProps) {\n if (!label && !description) return <>{control}</>;\n return (\n <label data-kit=\"choice\" data-choice={kind} data-disabled={disabled ? \"\" : undefined}>\n {control}\n <span data-kit-slot=\"choice-text\">\n {label ? (\n <span id={labelId} data-kit-slot=\"choice-label\">\n {label}\n </span>\n ) : null}\n {description ? (\n <span id={descriptionId} data-kit-slot=\"choice-description\">\n {description}\n </span>\n ) : null}\n </span>\n </label>\n );\n}\n","import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { Icon } from \"@x12i/icons\";\nimport { useId, useRef, type CSSProperties } from \"react\";\nimport type { ControlSize } from \"../types\";\n\nexport interface ComboboxOption {\n value: string;\n /** The text shown and matched against what the user types. */\n label: string;\n disabled?: boolean;\n}\n\ninterface ComboboxCommonProps {\n options: ComboboxOption[];\n placeholder?: string;\n size?: ControlSize;\n invalid?: boolean;\n disabled?: boolean;\n readOnly?: boolean;\n required?: boolean;\n name?: string;\n className?: string;\n style?: CSSProperties;\n /** Text shown when nothing matches what the user typed, for example \"No results\". */\n emptyLabel: string;\n /** Name of the button that clears the value, for example \"Clear\". */\n clearLabel: string;\n /** Name of the button that opens the list, for example \"Show options\". */\n openLabel: string;\n /** Accessible name when the combobox is not inside a `Field`. */\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n}\n\nconst itemToStringLabel = (option: ComboboxOption) => option.label;\nconst itemToStringValue = (option: ComboboxOption) => option.value;\nconst isItemEqualToValue = (a: ComboboxOption, b: ComboboxOption) => a.value === b.value;\n\n/**\n * The arrow that opens the list. Inside a `Field`, Base UI points the button's\n * `aria-labelledby` at the field's label, and that beats `aria-label`, so the\n * button would be announced with the same name as the input. Pointing it at\n * itself keeps the name the app passed.\n */\nfunction OpenButton({ label }: { label: string }) {\n const id = useId();\n return (\n <BaseCombobox.Trigger id={id} aria-labelledby={id} aria-label={label} data-kit-slot=\"combobox-trigger\">\n <Icon name=\"chevron-down\" />\n </BaseCombobox.Trigger>\n );\n}\n\nfunction Options({ emptyLabel }: { emptyLabel: string }) {\n return (\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner sideOffset={4} data-kit=\"combobox-positioner\">\n <BaseCombobox.Popup data-kit=\"combobox-popup\">\n <BaseCombobox.Empty data-kit-slot=\"combobox-empty\">{emptyLabel}</BaseCombobox.Empty>\n <BaseCombobox.List data-kit-slot=\"combobox-list\">\n {(option: ComboboxOption) => (\n <BaseCombobox.Item\n key={option.value}\n value={option}\n disabled={option.disabled}\n data-kit=\"combobox-item\"\n >\n <BaseCombobox.ItemIndicator data-kit-slot=\"combobox-item-indicator\">\n <Icon name=\"check\" size={16} />\n </BaseCombobox.ItemIndicator>\n <span data-kit-slot=\"combobox-item-text\">{option.label}</span>\n </BaseCombobox.Item>\n )}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n );\n}\n\nexport interface ComboboxProps extends ComboboxCommonProps {\n /** The selected option's `value`, or null for none. Pass it to control the component. */\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string | null) => void;\n}\n\n/**\n * A searchable single-choice list. Typing filters the options; arrow keys move\n * through them and Enter picks one. Use `Select` when the list is short and\n * search is not needed.\n */\nexport function Combobox({\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n size = \"md\",\n invalid,\n disabled,\n readOnly,\n required,\n name,\n className,\n style,\n emptyLabel,\n clearLabel,\n openLabel,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n}: ComboboxProps) {\n const find = (key: string | null | undefined) =>\n key === undefined ? undefined : (options.find((option) => option.value === key) ?? null);\n\n return (\n <BaseCombobox.Root<ComboboxOption>\n items={options}\n value={find(value)}\n defaultValue={find(defaultValue)}\n onValueChange={(option) => onValueChange?.(option?.value ?? null)}\n itemToStringLabel={itemToStringLabel}\n itemToStringValue={itemToStringValue}\n isItemEqualToValue={isItemEqualToValue}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n >\n <BaseCombobox.InputGroup\n data-kit=\"combobox\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n className={className}\n style={style}\n >\n <BaseCombobox.Input\n data-kit-slot=\"combobox-input\"\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? true : undefined}\n />\n <BaseCombobox.Clear data-kit-slot=\"combobox-clear\" aria-label={clearLabel}>\n <Icon name=\"close\" size={16} />\n </BaseCombobox.Clear>\n <OpenButton label={openLabel} />\n </BaseCombobox.InputGroup>\n <Options emptyLabel={emptyLabel} />\n </BaseCombobox.Root>\n );\n}\n\nexport interface MultiComboboxProps extends ComboboxCommonProps {\n value?: string[];\n defaultValue?: string[];\n onValueChange?: (value: string[]) => void;\n /** Name of a chip's remove button, for example `(label) => \"Remove \" + label`. */\n removeLabel: (optionLabel: string) => string;\n}\n\n/**\n * A searchable multi-choice list. Selected options appear as removable chips\n * inside the field; Backspace in the empty input removes the last one.\n */\nexport function MultiCombobox({\n options,\n value,\n defaultValue,\n onValueChange,\n placeholder,\n size = \"md\",\n invalid,\n disabled,\n readOnly,\n required,\n name,\n className,\n style,\n emptyLabel,\n clearLabel,\n openLabel,\n removeLabel,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n}: MultiComboboxProps) {\n const anchor = useRef<HTMLDivElement | null>(null);\n const find = (keys: string[] | undefined) =>\n keys === undefined\n ? undefined\n : keys.flatMap((key) => options.filter((option) => option.value === key));\n\n return (\n <BaseCombobox.Root<ComboboxOption, true>\n multiple\n items={options}\n value={find(value)}\n defaultValue={find(defaultValue)}\n onValueChange={(selected) => onValueChange?.(selected.map((option) => option.value))}\n itemToStringLabel={itemToStringLabel}\n itemToStringValue={itemToStringValue}\n isItemEqualToValue={isItemEqualToValue}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n >\n <BaseCombobox.Chips\n ref={anchor}\n data-kit=\"combobox\"\n data-multiple=\"\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n className={className}\n style={style}\n >\n <BaseCombobox.Value>\n {(selected: ComboboxOption[]) => (\n <>\n {selected.map((option) => (\n <BaseCombobox.Chip key={option.value} data-kit-slot=\"combobox-chip\">\n <span data-kit-slot=\"combobox-chip-text\">{option.label}</span>\n <BaseCombobox.ChipRemove\n data-kit-slot=\"combobox-chip-remove\"\n aria-label={removeLabel(option.label)}\n >\n <Icon name=\"close\" size={12} />\n </BaseCombobox.ChipRemove>\n </BaseCombobox.Chip>\n ))}\n <BaseCombobox.Input\n data-kit-slot=\"combobox-input\"\n placeholder={selected.length === 0 ? placeholder : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? true : undefined}\n />\n </>\n )}\n </BaseCombobox.Value>\n <BaseCombobox.Clear data-kit-slot=\"combobox-clear\" aria-label={clearLabel}>\n <Icon name=\"close\" size={16} />\n </BaseCombobox.Clear>\n <OpenButton label={openLabel} />\n </BaseCombobox.Chips>\n <BaseCombobox.Portal>\n <BaseCombobox.Positioner anchor={anchor} sideOffset={4} data-kit=\"combobox-positioner\">\n <BaseCombobox.Popup data-kit=\"combobox-popup\">\n <BaseCombobox.Empty data-kit-slot=\"combobox-empty\">{emptyLabel}</BaseCombobox.Empty>\n <BaseCombobox.List data-kit-slot=\"combobox-list\">\n {(option: ComboboxOption) => (\n <BaseCombobox.Item\n key={option.value}\n value={option}\n disabled={option.disabled}\n data-kit=\"combobox-item\"\n >\n <BaseCombobox.ItemIndicator data-kit-slot=\"combobox-item-indicator\">\n <Icon name=\"check\" size={16} />\n </BaseCombobox.ItemIndicator>\n <span data-kit-slot=\"combobox-item-text\">{option.label}</span>\n </BaseCombobox.Item>\n )}\n </BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n );\n}\n","import { Field as BaseField } from \"@base-ui/react/field\";\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport type { ReactNode } from \"react\";\n\nexport interface FieldProps extends Omit<BaseField.Root.Props, \"children\"> {\n /** The visible label. Clicking it focuses the control. */\n label?: ReactNode;\n /** Help text under the label. It is announced with the control. */\n description?: ReactNode;\n /**\n * An error message. A truthy error marks the field invalid, sets\n * `aria-invalid` on the control and announces the message politely.\n */\n error?: ReactNode;\n /**\n * Draws a required marker next to the label. The marker is decorative: put\n * `required` on the control as well, so assistive technology hears it.\n */\n required?: boolean;\n /** `horizontal` puts the control beside its label, which suits checkboxes and switches. */\n orientation?: \"vertical\" | \"horizontal\";\n /** The control: an `Input`, `Select`, `Checkbox`... Base UI wires its label and description. */\n children: ReactNode;\n}\n\n/**\n * Label, control, description and error as one accessible unit. The label,\n * description and error are linked to the control through Base UI's field\n * context, so no ids need to be passed around.\n */\nexport function Field({\n label,\n description,\n error,\n required = false,\n orientation = \"vertical\",\n invalid,\n children,\n ...props\n}: FieldProps) {\n const hasError = error !== undefined && error !== null && error !== false && error !== \"\";\n return (\n <BaseField.Root\n data-kit=\"field\"\n data-orientation={orientation}\n data-required={required ? \"\" : undefined}\n invalid={invalid ?? (hasError ? true : undefined)}\n {...props}\n >\n {label ? (\n <BaseField.Label data-kit-slot=\"field-label\">\n {label}\n {required ? (\n <span aria-hidden=\"true\" data-kit-slot=\"field-required\">\n *\n </span>\n ) : null}\n </BaseField.Label>\n ) : null}\n {description ? (\n <BaseField.Description data-kit-slot=\"field-description\">{description}</BaseField.Description>\n ) : null}\n <div data-kit-slot=\"field-control\">{children}</div>\n {hasError ? (\n <BaseField.Error match data-kit-slot=\"field-error\" aria-live=\"polite\">\n {error}\n </BaseField.Error>\n ) : null}\n </BaseField.Root>\n );\n}\n\nexport type FieldLabelProps = BaseField.Label.Props;\nexport type FieldDescriptionProps = BaseField.Description.Props;\nexport type FieldErrorProps = BaseField.Error.Props;\n\n/** Parts for custom layouts inside `Field.Root`-style structures. */\nexport function FieldLabel(props: FieldLabelProps) {\n return <BaseField.Label data-kit-slot=\"field-label\" {...props} />;\n}\n\nexport function FieldDescription(props: FieldDescriptionProps) {\n return <BaseField.Description data-kit-slot=\"field-description\" {...props} />;\n}\n\nexport function FieldError(props: FieldErrorProps) {\n return <BaseField.Error data-kit-slot=\"field-error\" aria-live=\"polite\" {...props} />;\n}\n\nexport interface FieldsetProps extends Omit<BaseFieldset.Root.Props, \"children\"> {\n /** The group's name, read before each control inside it. */\n legend: ReactNode;\n /** Help text under the legend. */\n description?: ReactNode;\n children: ReactNode;\n}\n\n/** Groups related controls (radios, checkboxes, an address) under one legend. */\nexport function Fieldset({ legend, description, children, ...props }: FieldsetProps) {\n return (\n <BaseFieldset.Root data-kit=\"fieldset\" {...props}>\n <BaseFieldset.Legend data-kit-slot=\"fieldset-legend\">{legend}</BaseFieldset.Legend>\n {description ? <p data-kit-slot=\"fieldset-description\">{description}</p> : null}\n <div data-kit-slot=\"fieldset-body\">{children}</div>\n </BaseFieldset.Root>\n );\n}\n","import { Input as BaseInput } from \"@base-ui/react/input\";\nimport { Icon } from \"@x12i/icons\";\nimport { useState, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport type { ControlSize } from \"../types\";\nimport { IconButton } from \"./icon-button\";\n\nexport interface InputProps extends Omit<BaseInput.Props, \"size\"> {\n size?: ControlSize;\n /** Marks the input invalid outside a `Field` (inside one, the field does it). */\n invalid?: boolean;\n}\n\n/**\n * A text input. Inside a `Field` it is labelled and described automatically;\n * on its own, give it an `aria-label`.\n */\nexport function Input({ size = \"md\", invalid, ...props }: InputProps) {\n return (\n <BaseInput\n data-kit=\"input\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n aria-invalid={invalid ? true : undefined}\n {...props}\n />\n );\n}\n\nexport interface InputGroupProps extends ComponentPropsWithRef<\"div\"> {\n size?: ControlSize;\n invalid?: boolean;\n disabled?: boolean;\n}\n\n/**\n * Wraps an `Input` with `InputAddon`s (a currency sign, an icon, a button). The\n * group draws the border and the focus ring, so the parts read as one control.\n */\nexport function InputGroup({ size = \"md\", invalid, disabled, ...props }: InputGroupProps) {\n return (\n <div\n data-kit=\"input-group\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-disabled={disabled ? \"\" : undefined}\n {...props}\n />\n );\n}\n\nexport type InputAddonProps = ComponentPropsWithRef<\"span\">;\n\n/** Static text or an icon next to an input. Decorative addons should be `aria-hidden`. */\nexport function InputAddon(props: InputAddonProps) {\n return <span data-kit=\"input-addon\" {...props} />;\n}\n\nexport interface PasswordInputProps extends Omit<InputProps, \"type\"> {\n /** Name of the reveal button while the password is hidden, for example \"Show password\". */\n showLabel: string;\n /** Name of the reveal button while the password is visible, for example \"Hide password\". */\n hideLabel: string;\n /** Extra content before the input, usually a lock icon. */\n startAddon?: ReactNode;\n}\n\n/** A password input with a button that reveals the text. */\nexport function PasswordInput({\n showLabel,\n hideLabel,\n startAddon,\n size = \"md\",\n invalid,\n disabled,\n ...props\n}: PasswordInputProps) {\n const [visible, setVisible] = useState(false);\n return (\n <InputGroup size={size} invalid={invalid} disabled={disabled}>\n {startAddon ? <InputAddon aria-hidden=\"true\">{startAddon}</InputAddon> : null}\n <Input\n size={size}\n invalid={invalid}\n disabled={disabled}\n autoComplete=\"current-password\"\n {...props}\n type={visible ? \"text\" : \"password\"}\n />\n <IconButton\n label={visible ? hideLabel : showLabel}\n variant=\"ghost\"\n tone=\"neutral\"\n size={size === \"xl\" ? \"lg\" : \"sm\"}\n disabled={disabled}\n onClick={() => setVisible((current) => !current)}\n >\n <Icon name={visible ? \"eye-off\" : \"eye\"} />\n </IconButton>\n </InputGroup>\n );\n}\n","import { NumberField as BaseNumberField } from \"@base-ui/react/number-field\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ControlSize } from \"../types\";\n\nexport interface NumberInputProps extends Omit<BaseNumberField.Root.Props, \"children\"> {\n size?: ControlSize;\n invalid?: boolean;\n /** Name of the decrease button, for example \"Decrease\". */\n decrementLabel: string;\n /** Name of the increase button, for example \"Increase\". */\n incrementLabel: string;\n placeholder?: string;\n /** Accessible name when the input is not inside a `Field`. */\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * A number input with stepper buttons. Arrow keys step, Shift+Arrow takes a\n * large step, and the value is parsed and formatted with `Intl` using `locale`\n * and `format`.\n */\nexport function NumberInput({\n size = \"md\",\n invalid,\n decrementLabel,\n incrementLabel,\n placeholder,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...props\n}: NumberInputProps) {\n return (\n <BaseNumberField.Root {...props}>\n <BaseNumberField.Group\n data-kit=\"number-input\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n >\n <BaseNumberField.Decrement data-kit-slot=\"number-decrement\" aria-label={decrementLabel}>\n <Icon name=\"minus\" size={size === \"xs\" || size === \"sm\" ? 12 : 16} />\n </BaseNumberField.Decrement>\n <BaseNumberField.Input\n data-kit-slot=\"number-control\"\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={invalid ? true : undefined}\n />\n <BaseNumberField.Increment data-kit-slot=\"number-increment\" aria-label={incrementLabel}>\n <Icon name=\"plus\" size={size === \"xs\" || size === \"sm\" ? 12 : 16} />\n </BaseNumberField.Increment>\n </BaseNumberField.Group>\n </BaseNumberField.Root>\n );\n}\n","import { OTPField as BaseOTPField } from \"@base-ui/react/otp-field\";\nimport { useId } from \"react\";\nimport type { ControlSize } from \"../types\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\nexport interface OTPInputProps extends Omit<BaseOTPField.Root.Props, \"children\"> {\n size?: ControlSize;\n invalid?: boolean;\n /**\n * Name of the whole code, for example \"Verification code\". It is read with\n * the first box. Not needed inside a `Field`, whose label does this job.\n */\n label?: string;\n /**\n * Name of the other boxes, for example `(i, n) => \"Digit \" + (i + 1) + \" of \" + n`.\n * The first box is named by `label` or by the surrounding `Field`, so it is\n * never passed to this function.\n */\n getInputLabel: (index: number, length: number) => string;\n}\n\n/**\n * A one-time-code input: one box per character with automatic advance, paste\n * of the whole code, and Backspace to step back. `onValueComplete` fires when\n * every box is filled.\n */\nexport function OTPInput({\n size = \"md\",\n invalid,\n length,\n label,\n getInputLabel,\n id,\n ...props\n}: OTPInputProps) {\n const generatedId = useId();\n const firstId = id ?? generatedId;\n return (\n <>\n {label ? (\n <VisuallyHidden>\n <label htmlFor={firstId}>{label}</label>\n </VisuallyHidden>\n ) : null}\n <BaseOTPField.Root\n data-kit=\"otp-input\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n id={firstId}\n length={length}\n {...props}\n >\n {Array.from({ length }, (_, index) => (\n <BaseOTPField.Input\n // Boxes are positional and never reorder, so the index is the identity.\n key={index}\n data-kit-slot=\"otp-box\"\n // Base UI names the first box from a <label>/<Field.Label> and ignores aria-label there.\n aria-label={index === 0 ? undefined : getInputLabel(index, length)}\n aria-invalid={invalid ? true : undefined}\n />\n ))}\n </BaseOTPField.Root>\n </>\n );\n}\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport type { ReactNode } from \"react\";\nimport { ChoiceRow, useChoiceIds } from \"./choice\";\n\nexport interface RadioGroupProps<Value = string> extends BaseRadioGroup.Props<Value> {\n /** Lay the radios out in a row instead of a column. */\n orientation?: \"vertical\" | \"horizontal\";\n}\n\n/**\n * A set of radios where exactly one is chosen. Arrow keys move and select. Name\n * the group with `aria-label` or wrap it in a `Fieldset`.\n */\nexport function RadioGroup<Value = string>({\n orientation = \"vertical\",\n ...props\n}: RadioGroupProps<Value>) {\n return <BaseRadioGroup data-kit=\"radio-group\" data-orientation={orientation} {...props} />;\n}\n\nexport interface RadioProps<Value = string> extends BaseRadio.Root.Props<Value> {\n label?: ReactNode;\n description?: ReactNode;\n}\n\n/** One option in a `RadioGroup`. */\nexport function Radio<Value = string>({\n label,\n description,\n disabled,\n ...props\n}: RadioProps<Value>) {\n const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);\n const control = (\n <BaseRadio.Root data-kit=\"radio\" disabled={disabled} {...controlAria} {...props}>\n <BaseRadio.Indicator data-kit-slot=\"radio-indicator\" />\n </BaseRadio.Root>\n );\n return (\n <ChoiceRow\n kind=\"radio\"\n control={control}\n label={label}\n description={description}\n labelId={labelId}\n descriptionId={descriptionId}\n disabled={disabled}\n />\n );\n}\n","import { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { Icon } from \"@x12i/icons\";\nimport { Fragment, type CSSProperties, type ReactNode } from \"react\";\nimport type { ControlSize } from \"../types\";\n\nexport interface SelectOption<Value extends string | number = string> {\n value: Value;\n /** What the option shows. Use `textValue` when this is not plain text. */\n label: ReactNode;\n disabled?: boolean;\n /** Plain text for typeahead and for form submission. Defaults to `label` when it is a string. */\n textValue?: string;\n}\n\nexport interface SelectGroup<Value extends string | number = string> {\n /** The group's heading, announced when focus enters the group. */\n label: string;\n options: SelectOption<Value>[];\n}\n\nexport type SelectItems<Value extends string | number = string> = Array<\n SelectOption<Value> | SelectGroup<Value>\n>;\n\nfunction isGroup<Value extends string | number>(\n item: SelectOption<Value> | SelectGroup<Value>,\n): item is SelectGroup<Value> {\n return \"options\" in item;\n}\n\nfunction flatten<Value extends string | number>(items: SelectItems<Value>): SelectOption<Value>[] {\n return items.flatMap((item) => (isGroup(item) ? item.options : [item]));\n}\n\nexport interface SelectProps<Value extends string | number = string>\n extends Omit<BaseSelect.Root.Props<Value, false>, \"items\" | \"children\" | \"multiple\"> {\n options: SelectItems<Value>;\n /** Shown while nothing is selected. */\n placeholder?: string;\n size?: ControlSize;\n invalid?: boolean;\n className?: string;\n style?: CSSProperties;\n /** Accessible name when the select is not inside a `Field`. */\n \"aria-label\"?: string;\n \"aria-labelledby\"?: string;\n \"aria-describedby\"?: string;\n}\n\n/**\n * A single-choice dropdown. Typeahead, arrow keys, Home/End and Escape work as\n * in a native select, and the value is submitted with forms through `name`.\n * For long or searchable lists use `Combobox`.\n */\nexport function Select<Value extends string | number = string>({\n options,\n placeholder,\n size = \"md\",\n invalid,\n className,\n style,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...props\n}: SelectProps<Value>) {\n const flat = flatten(options);\n const renderOption = (option: SelectOption<Value>) => (\n <BaseSelect.Item\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n label={option.textValue ?? (typeof option.label === \"string\" ? option.label : String(option.value))}\n data-kit=\"select-item\"\n >\n <BaseSelect.ItemIndicator data-kit-slot=\"select-item-indicator\">\n <Icon name=\"check\" size={16} />\n </BaseSelect.ItemIndicator>\n <BaseSelect.ItemText data-kit-slot=\"select-item-text\">{option.label}</BaseSelect.ItemText>\n </BaseSelect.Item>\n );\n\n return (\n <BaseSelect.Root\n items={flat.map((option) => ({ value: option.value, label: option.label }))}\n {...props}\n >\n <BaseSelect.Trigger\n data-kit=\"select\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n aria-invalid={invalid ? true : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={className}\n style={style}\n >\n <BaseSelect.Value data-kit-slot=\"select-value\" placeholder={placeholder} />\n <BaseSelect.Icon data-kit-slot=\"select-icon\">\n <Icon name=\"chevron-down\" />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n <BaseSelect.Portal>\n <BaseSelect.Positioner sideOffset={4} alignItemWithTrigger={false} data-kit=\"select-positioner\">\n <BaseSelect.Popup data-kit=\"select-popup\">\n <BaseSelect.List data-kit-slot=\"select-list\">\n {options.map((item, index) =>\n isGroup(item) ? (\n <BaseSelect.Group key={`group-${index}`} data-kit-slot=\"select-group\">\n <BaseSelect.GroupLabel data-kit-slot=\"select-group-label\">\n {item.label}\n </BaseSelect.GroupLabel>\n {item.options.map(renderOption)}\n </BaseSelect.Group>\n ) : (\n <Fragment key={item.value}>{renderOption(item)}</Fragment>\n ),\n )}\n </BaseSelect.List>\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n );\n}\n","import { Slider as BaseSlider } from \"@base-ui/react/slider\";\n\nexport interface SliderProps<Value extends number | readonly number[] = number>\n extends Omit<BaseSlider.Root.Props<Value>, \"children\"> {\n /**\n * Name for each thumb. A range slider has two thumbs, so it needs distinct\n * names, for example `(i) => (i === 0 ? \"Minimum price\" : \"Maximum price\")`.\n */\n getThumbLabel?: (index: number, count: number) => string;\n /** Shows the current value(s) after the track. */\n showValue?: boolean;\n /** Accessible name of a single-thumb slider that is not inside a `Field`. */\n \"aria-label\"?: string;\n}\n\nfunction thumbCount(value: unknown): number {\n return Array.isArray(value) ? value.length : 1;\n}\n\n/**\n * A slider for a number or a range. Pass a number for one thumb or an array of\n * numbers for several. Arrow keys step, Page Up/Down take a large step, Home\n * and End jump to the ends.\n */\nexport function Slider<Value extends number | readonly number[] = number>({\n getThumbLabel,\n showValue = false,\n \"aria-label\": ariaLabel,\n ...props\n}: SliderProps<Value>) {\n const count = thumbCount(props.value ?? props.defaultValue);\n return (\n // Center alignment needs no layout measurement, so the thumb is visible on\n // the server and on first paint instead of appearing after hydration.\n <BaseSlider.Root data-kit=\"slider\" {...props}>\n <BaseSlider.Control data-kit-slot=\"slider-control\">\n <BaseSlider.Track data-kit-slot=\"slider-track\">\n <BaseSlider.Indicator data-kit-slot=\"slider-indicator\" />\n {Array.from({ length: count }, (_, index) => {\n const label = getThumbLabel?.(index, count) ?? ariaLabel;\n return (\n <BaseSlider.Thumb\n // Thumbs are positional and never reorder, so the index is the identity.\n key={index}\n index={index}\n data-kit-slot=\"slider-thumb\"\n // Without a label of our own, leave the thumb to Base UI, which names it from the\n // field's label or from `aria-labelledby`. An empty aria-label would hide both.\n getAriaLabel={label === undefined ? undefined : () => label}\n />\n );\n })}\n </BaseSlider.Track>\n </BaseSlider.Control>\n {showValue ? <BaseSlider.Value data-kit-slot=\"slider-value\" /> : null}\n </BaseSlider.Root>\n );\n}\n","import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport type { ReactNode } from \"react\";\nimport { ChoiceRow, useChoiceIds } from \"./choice\";\n\nexport interface SwitchProps extends BaseSwitch.Root.Props {\n label?: ReactNode;\n description?: ReactNode;\n}\n\n/**\n * An on/off switch for a setting that applies immediately. Use a checkbox when\n * the choice is submitted later with a form. Without a `label`, give it an\n * `aria-label`.\n */\nexport function Switch({ label, description, disabled, ...props }: SwitchProps) {\n const { labelId, descriptionId, controlAria } = useChoiceIds(label, description);\n const control = (\n <BaseSwitch.Root data-kit=\"switch\" disabled={disabled} {...controlAria} {...props}>\n <BaseSwitch.Thumb data-kit-slot=\"switch-thumb\" />\n </BaseSwitch.Root>\n );\n return (\n <ChoiceRow\n kind=\"switch\"\n control={control}\n label={label}\n description={description}\n labelId={labelId}\n descriptionId={descriptionId}\n disabled={disabled}\n />\n );\n}\n","import { Field as BaseField } from \"@base-ui/react/field\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport type { ControlSize } from \"../types\";\n\nexport interface TextareaProps\n extends Omit<BaseField.Control.Props, \"render\" | \"size\" | \"type\" | \"rows\"> {\n size?: ControlSize;\n invalid?: boolean;\n rows?: number;\n /** Grows with its content (uses CSS `field-sizing`; falls back to `rows`). */\n autoResize?: boolean;\n}\n\n/**\n * A multi-line input. It is a Base UI field control, so inside a `Field` it is\n * labelled, described and validated like any other control.\n */\nexport function Textarea({\n size = \"md\",\n invalid,\n rows = 3,\n autoResize = false,\n ...props\n}: TextareaProps) {\n return (\n <BaseField.Control\n data-kit=\"textarea\"\n data-size={size}\n data-invalid={invalid ? \"\" : undefined}\n data-auto-resize={autoResize ? \"\" : undefined}\n aria-invalid={invalid ? true : undefined}\n render={(controlProps) => (\n <textarea {...(controlProps as ComponentPropsWithRef<\"textarea\">)} rows={rows} />\n )}\n {...props}\n />\n );\n}\n","import type { ComponentPropsWithRef } from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\n\r\nexport interface DividerProps extends Omit<ComponentPropsWithRef<\"hr\">, \"children\"> {\r\n orientation?: \"horizontal\" | \"vertical\";\r\n /**\r\n * A decorative divider is hidden from assistive technology. Use it when the\r\n * surrounding structure already separates the content.\r\n */\r\n decorative?: boolean;\r\n}\r\n\r\n/** A separator. Native `<hr>` already has the separator role, so no ARIA role is added. */\r\nexport function Divider({\r\n orientation = \"horizontal\",\r\n decorative = false,\r\n className,\r\n ...props\r\n}: DividerProps) {\r\n return (\r\n <hr\r\n data-kit=\"divider\"\r\n data-orientation={orientation}\r\n role={decorative ? \"presentation\" : undefined}\r\n aria-orientation={!decorative && orientation === \"vertical\" ? \"vertical\" : undefined}\r\n className={cx(className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n","import { cssVar } from \"@x12i/tokens\";\r\nimport type { ComponentPropsWithRef, CSSProperties } from \"react\";\r\nimport type { SpaceKey } from \"../types\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { Slot } from \"../utils/slot\";\r\n\r\nexport type Align = \"start\" | \"center\" | \"end\" | \"stretch\" | \"baseline\";\r\nexport type Justify = \"start\" | \"center\" | \"end\" | \"between\" | \"around\";\r\n\r\ninterface FlexProps extends ComponentPropsWithRef<\"div\"> {\r\n /** Space between children, from the space scale. */\r\n gap?: SpaceKey;\r\n align?: Align;\r\n justify?: Justify;\r\n wrap?: boolean;\r\n /** Render the child element instead of a div. */\r\n asChild?: boolean;\r\n}\r\n\r\nfunction Flex({\r\n kind,\r\n gap,\r\n align,\r\n justify,\r\n wrap,\r\n asChild = false,\r\n className,\r\n style,\r\n ...props\r\n}: FlexProps & { kind: \"stack\" | \"inline\" }) {\r\n const Component = asChild ? Slot : \"div\";\r\n const gapStyle: CSSProperties | undefined =\r\n gap === undefined ? undefined : { gap: cssVar(`space.${gap}`) };\r\n\r\n return (\r\n <Component\r\n data-kit={kind}\r\n data-align={align}\r\n data-justify={justify}\r\n data-wrap={wrap ? \"\" : undefined}\r\n className={cx(className)}\r\n style={{ ...gapStyle, ...style }}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport type StackProps = FlexProps;\r\n\r\n/** Lays children out in a column. */\r\nexport function Stack({ gap = \"3\", ...props }: StackProps) {\r\n return <Flex kind=\"stack\" gap={gap} {...props} />;\r\n}\r\n\r\nexport type InlineProps = FlexProps;\r\n\r\n/** Lays children out in a row, aligned to the center and wrapping by default. */\r\nexport function Inline({ gap = \"2\", align = \"center\", wrap = true, ...props }: InlineProps) {\r\n return <Flex kind=\"inline\" gap={gap} align={align} wrap={wrap} {...props} />;\r\n}\r\n","import { Icon, type IconName } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport type { StatusTone } from \"../types\";\nimport { IconButton } from \"./icon-button\";\n\nexport const toneIcons: Record<StatusTone, IconName> = {\n neutral: \"info\",\n accent: \"info\",\n info: \"info\",\n success: \"check-circle\",\n warning: \"alert-triangle\",\n danger: \"alert-circle\",\n};\n\ntype Dismissal =\n | { onDismiss?: undefined; dismissLabel?: string }\n | {\n /** Shows a close button. */\n onDismiss: () => void;\n /** Name of the close button, for example \"Dismiss\". Required with `onDismiss`. */\n dismissLabel: string;\n };\n\nexport type AlertProps = Omit<ComponentPropsWithRef<\"div\">, \"title\"> &\n Dismissal & {\n tone?: StatusTone;\n title?: ReactNode;\n /** Replaces the tone's icon. Pass `false` for none. */\n icon?: ReactNode | false;\n /** A button or link shown after the message. */\n action?: ReactNode;\n };\n\n/**\n * A message about the state of the page or a process. Danger alerts use\n * `role=\"alert\"` and interrupt assistive technology; every other tone uses\n * `role=\"status\"` and waits politely. Override with the `role` prop. The tone\n * is carried by an icon and the title as well as color.\n */\nexport function Alert({\n tone = \"info\",\n title,\n icon,\n action,\n onDismiss,\n dismissLabel,\n role,\n children,\n ...props\n}: AlertProps) {\n const glyph = icon === false ? null : (icon ?? <Icon name={toneIcons[tone]} size={20} />);\n return (\n <div\n data-kit=\"alert\"\n data-tone={tone}\n role={role ?? (tone === \"danger\" ? \"alert\" : \"status\")}\n {...props}\n >\n {glyph ? (\n <span data-kit-slot=\"alert-icon\" aria-hidden=\"true\">\n {glyph}\n </span>\n ) : null}\n <div data-kit-slot=\"alert-body\">\n {title ? <div data-kit-slot=\"alert-title\">{title}</div> : null}\n {children ? <div data-kit-slot=\"alert-message\">{children}</div> : null}\n </div>\n {action ? <div data-kit-slot=\"alert-action\">{action}</div> : null}\n {onDismiss ? (\n <IconButton label={dismissLabel} variant=\"ghost\" tone=\"neutral\" size=\"sm\" onClick={onDismiss}>\n <Icon name=\"close\" />\n </IconButton>\n ) : null}\n </div>\n );\n}\n\nexport interface CalloutProps extends Omit<ComponentPropsWithRef<\"aside\">, \"title\"> {\n tone?: StatusTone;\n title?: ReactNode;\n icon?: ReactNode | false;\n}\n\n/**\n * A highlighted aside inside content: a note, a tip, a warning. Unlike `Alert`\n * it is part of the page and is not announced when it appears. The same shape\n * is used by the editor's callout block and by reports.\n */\nexport function Callout({ tone = \"info\", title, icon, children, ...props }: CalloutProps) {\n const glyph = icon === false ? null : (icon ?? <Icon name={toneIcons[tone]} size={20} />);\n return (\n <aside data-kit=\"callout\" data-tone={tone} {...props}>\n {glyph ? (\n <span data-kit-slot=\"callout-icon\" aria-hidden=\"true\">\n {glyph}\n </span>\n ) : null}\n <div data-kit-slot=\"callout-body\">\n {title ? <div data-kit-slot=\"callout-title\">{title}</div> : null}\n {children ? <div data-kit-slot=\"callout-content\">{children}</div> : null}\n </div>\n </aside>\n );\n}\n","import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport type { ReactNode } from \"react\";\n\ntype BarTone = \"accent\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface ProgressProps extends Omit<BaseProgress.Root.Props, \"children\"> {\n /** Visible label. Without one, pass `aria-label`. */\n label?: ReactNode;\n /** Shows the formatted value, for example \"40%\". */\n showValue?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n tone?: BarTone;\n}\n\n/**\n * Progress of a task. `value` is a number between `min` and `max`, or `null`\n * for an indeterminate task. The bar never shows color alone: the value text\n * and the accessible value stay in sync.\n */\nexport function Progress({\n label,\n showValue = false,\n size = \"md\",\n tone = \"accent\",\n ...props\n}: ProgressProps) {\n return (\n <BaseProgress.Root data-kit=\"progress\" data-size={size} data-tone={tone} {...props}>\n {label || showValue ? (\n <div data-kit-slot=\"progress-header\">\n {label ? <BaseProgress.Label data-kit-slot=\"progress-label\">{label}</BaseProgress.Label> : null}\n {showValue ? <BaseProgress.Value data-kit-slot=\"progress-value\" /> : null}\n </div>\n ) : null}\n <BaseProgress.Track data-kit-slot=\"progress-track\">\n <BaseProgress.Indicator data-kit-slot=\"progress-indicator\" />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n\nexport interface MeterProps extends Omit<BaseMeter.Root.Props, \"children\"> {\n label?: ReactNode;\n showValue?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n tone?: BarTone;\n}\n\n/**\n * A gauge for a known quantity inside a range, such as disk usage. Use\n * `Progress` instead for a task that moves toward completion.\n */\nexport function Meter({ label, showValue = false, size = \"md\", tone = \"accent\", ...props }: MeterProps) {\n return (\n <BaseMeter.Root data-kit=\"meter\" data-size={size} data-tone={tone} {...props}>\n {label || showValue ? (\n <div data-kit-slot=\"progress-header\">\n {label ? <BaseMeter.Label data-kit-slot=\"progress-label\">{label}</BaseMeter.Label> : null}\n {showValue ? <BaseMeter.Value data-kit-slot=\"progress-value\" /> : null}\n </div>\n ) : null}\n <BaseMeter.Track data-kit-slot=\"progress-track\">\n <BaseMeter.Indicator data-kit-slot=\"progress-indicator\" />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n","import { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport type { CSSProperties, ReactNode } from \"react\";\n\ntype CircleTone = \"accent\" | \"success\" | \"warning\" | \"danger\";\n\n/**\n * The ring is drawn in a 100 wide box, so its geometry is unitless and scales\n * with the size token. This is the radius of the stroke's center line; with a\n * stroke up to 10 wide it still fits inside the box.\n */\nconst RADIUS = 45;\n\n/** How much of the ring is drawn, in percent, while the value is unknown. */\nconst INDETERMINATE_PERCENT = 25;\n\nexport interface ProgressCircleProps extends Omit<BaseProgress.Root.Props, \"children\"> {\n /** Visible label under the ring. Without one, pass `aria-label`. */\n label?: ReactNode;\n /**\n * Shows the formatted value, for example \"40%\", in the middle of the ring.\n * Not shown at `sm`, where the ring is too small to hold text.\n */\n showValue?: boolean;\n /** Replaces the value in the middle of the ring, for example an icon. */\n children?: ReactNode;\n size?: \"sm\" | \"md\" | \"lg\";\n tone?: CircleTone;\n}\n\nfunction percentOf(value: number | null, min: number, max: number): number {\n if (value === null || !Number.isFinite(value) || max <= min) return 0;\n const percent = ((value - min) / (max - min)) * 100;\n return Math.round(Math.min(100, Math.max(0, percent)) * 100) / 100;\n}\n\n/**\n * Progress of a task as a ring. It reports the same role, value and text as\n * `Progress`, so use it where a bar does not fit: a card corner, a table cell,\n * a toolbar. `value` is a number between `min` and `max`, or `null` while the\n * amount is unknown, which turns the ring into a quiet spinner.\n *\n * The ring starts at the top and runs clockwise in every language. It never\n * carries meaning by color alone: the value is exposed to assistive technology\n * and can be shown in the middle.\n */\nexport function ProgressCircle({\n label,\n showValue = false,\n children,\n size = \"md\",\n tone = \"accent\",\n value,\n min = 0,\n max = 100,\n ...props\n}: ProgressCircleProps) {\n const percent = value === null ? INDETERMINATE_PERCENT : percentOf(value, min, max);\n const center = children ?? (showValue && size !== \"sm\" ? <BaseProgress.Value /> : null);\n\n return (\n <BaseProgress.Root\n data-kit=\"progress-circle\"\n data-size={size}\n data-tone={tone}\n value={value}\n min={min}\n max={max}\n {...props}\n >\n <div data-kit-slot=\"progress-circle-ring\" style={{ \"--_percent\": percent } as CSSProperties}>\n <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\" focusable=\"false\" data-kit-slot=\"progress-circle-svg\">\n <circle data-kit-slot=\"progress-circle-track\" cx={50} cy={50} r={RADIUS} />\n {/* pathLength makes one dash unit one percent, so CSS needs no circumference. */}\n <circle data-kit-slot=\"progress-circle-indicator\" cx={50} cy={50} r={RADIUS} pathLength={100} />\n </svg>\n {center ? <span data-kit-slot=\"progress-circle-center\">{center}</span> : null}\n </div>\n {label ? <BaseProgress.Label data-kit-slot=\"progress-circle-label\">{label}</BaseProgress.Label> : null}\n </BaseProgress.Root>\n );\n}\n","import { type ComponentPropsWithRef, useEffect, useMemo, useRef, useState } from \"react\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\n/** Used when the theme does not define `--kit-duration-slow`, in milliseconds. */\nconst FALLBACK_DURATION = 400;\n\n/** `Intl` shows at most this many decimals when asked for no particular number. */\nconst DEFAULT_MAX_DECIMALS = 3;\n\nconst REDUCED_MOTION = \"(prefers-reduced-motion: reduce)\";\n\nexport interface AnimatedNumberProps extends Omit<ComponentPropsWithRef<\"span\">, \"children\"> {\n value: number;\n /** `Intl.NumberFormatOptions`, for example `{ style: \"currency\", currency: \"EUR\" }`. */\n format?: Intl.NumberFormatOptions;\n /** The locale for digits and separators. Defaults to the user's runtime locale. */\n locale?: Intl.LocalesArgument;\n /** Milliseconds. Defaults to the theme's `--kit-duration-slow`. */\n duration?: number;\n /**\n * Count up from this number the first time the component appears. Without\n * it the first render shows `value`, so the real number is in the page\n * before any script runs. With it, that first render shows `from` instead.\n */\n from?: number;\n}\n\n/** A strong ease-out: most of the change happens early, then it settles. */\nconst easeOut = (t: number) => 1 - (1 - t) ** 3;\n\nfunction prefersReducedMotion(): boolean {\n return typeof window !== \"undefined\" && typeof window.matchMedia === \"function\" && window.matchMedia(REDUCED_MOTION).matches;\n}\n\n/** The theme's slow duration in milliseconds, so a theme can retune the count. */\nfunction themeDuration(element: Element | null): number {\n if (!element || typeof getComputedStyle !== \"function\") return FALLBACK_DURATION;\n const raw = getComputedStyle(element).getPropertyValue(\"--kit-duration-slow\").trim();\n const match = /^(\\d*\\.?\\d+)(ms|s)$/.exec(raw);\n if (!match) return FALLBACK_DURATION;\n return Number(match[1]) * (match[2] === \"s\" ? 1000 : 1);\n}\n\n/** How many decimals the target needs, so every frame prints the same count. */\nfunction decimalsOf(value: number): number {\n if (!Number.isFinite(value)) return 0;\n const [, decimals = \"\"] = value.toFixed(DEFAULT_MAX_DECIMALS).replace(/0+$/, \"\").split(\".\");\n return decimals.length;\n}\n\n/**\n * Pins the number of decimals while counting. Otherwise `Intl` would print\n * \"1,234.567\" on the way to \"1,234\", and the width would jitter. Only applies\n * to plain numbers with no digit options, and gives the same final text as\n * `Intl.NumberFormat` would.\n */\nfunction stableFormat(format: Intl.NumberFormatOptions, digits: number): Intl.NumberFormatOptions {\n const plain =\n (format.style === undefined || format.style === \"decimal\" || format.style === \"unit\") &&\n (format.notation === undefined || format.notation === \"standard\") &&\n format.minimumFractionDigits === undefined &&\n format.maximumFractionDigits === undefined &&\n format.minimumSignificantDigits === undefined &&\n format.maximumSignificantDigits === undefined;\n return plain ? { ...format, minimumFractionDigits: digits, maximumFractionDigits: digits } : format;\n}\n\n/**\n * A number that counts to its new value instead of jumping. Put it anywhere a\n * number goes, for example in a `Stat`.\n *\n * - Screen readers get only the final number, once. The counting text is\n * hidden from them.\n * - With `prefers-reduced-motion: reduce` it jumps straight to the value.\n * - Digits are tabular, so the width does not jitter.\n * - A new `value` in the middle of a count continues from what is on screen.\n */\nexport function AnimatedNumber({ value, format, locale, duration, from, ...props }: AnimatedNumberProps) {\n const [shown, setShown] = useState(from ?? value);\n const shownRef = useRef(shown);\n const visualRef = useRef<HTMLSpanElement>(null);\n\n const formatKey = JSON.stringify(format ?? {});\n const localeKey = locale === undefined ? \"\" : String(locale);\n // The final number decides the decimals for the whole count.\n const digits = decimalsOf(value);\n const formatter = useMemo(\n () =>\n new Intl.NumberFormat(\n localeKey === \"\" ? undefined : localeKey.split(\",\"),\n stableFormat(JSON.parse(formatKey) as Intl.NumberFormatOptions, digits),\n ),\n [localeKey, formatKey, digits],\n );\n\n useEffect(() => {\n const start = shownRef.current;\n if (Object.is(start, value)) return;\n\n const settle = () => {\n shownRef.current = value;\n setShown(value);\n };\n const ms = duration ?? themeDuration(visualRef.current);\n if (!Number.isFinite(value) || !Number.isFinite(start) || ms <= 0 || prefersReducedMotion()) {\n settle();\n return;\n }\n\n const startedAt = performance.now();\n let frame = 0;\n const tick = (now: number) => {\n // A frame's timestamp can predate `startedAt` by a millisecond; never run backwards.\n const progress = Math.max(0, Math.min(1, (now - startedAt) / ms));\n if (progress === 1) {\n settle();\n return;\n }\n const next = start + (value - start) * easeOut(progress);\n shownRef.current = next;\n setShown(next);\n frame = requestAnimationFrame(tick);\n };\n frame = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(frame);\n }, [value, duration]);\n\n return (\n <span data-kit=\"animated-number\" data-animating={Object.is(shown, value) ? undefined : \"\"} {...props}>\n <span ref={visualRef} aria-hidden=\"true\" data-kit-slot=\"animated-number-visual\">\n {formatter.format(shown)}\n </span>\n <VisuallyHidden>{formatter.format(value)}</VisuallyHidden>\n </span>\n );\n}\n","import type { ComponentPropsWithRef, CSSProperties } from \"react\";\n\nexport interface SkeletonProps extends ComponentPropsWithRef<\"div\"> {\n variant?: \"text\" | \"rect\" | \"circle\";\n /** CSS length or number of pixels. Defaults to the full width (text, rect) or the avatar size (circle). */\n width?: CSSProperties[\"inlineSize\"];\n height?: CSSProperties[\"blockSize\"];\n}\n\n/**\n * A placeholder shape shown while content loads. It is hidden from assistive\n * technology: mark the loading region itself with `aria-busy=\"true\"` and give\n * a status message elsewhere.\n */\nexport function Skeleton({ variant = \"text\", width, height, style, ...props }: SkeletonProps) {\n return (\n <div\n aria-hidden=\"true\"\n data-kit=\"skeleton\"\n data-variant={variant}\n style={{ inlineSize: width, blockSize: height, ...style }}\n {...props}\n />\n );\n}\n\nexport interface SkeletonTextProps extends ComponentPropsWithRef<\"div\"> {\n lines?: number;\n}\n\n/** Several text-line skeletons; the last one is shorter, like a paragraph. */\nexport function SkeletonText({ lines = 3, ...props }: SkeletonTextProps) {\n return (\n <div data-kit=\"skeleton-text\" aria-hidden=\"true\" {...props}>\n {Array.from({ length: lines }, (_, index) => (\n <Skeleton\n // Lines are identical placeholders in a fixed order.\n key={index}\n variant=\"text\"\n width={index === lines - 1 && lines > 1 ? \"60%\" : undefined}\n />\n ))}\n </div>\n );\n}\n","import type { ComponentPropsWithRef, ReactNode } from \"react\";\n\nexport interface EmptyStateProps extends Omit<ComponentPropsWithRef<\"div\">, \"title\"> {\n /** A decorative illustration or icon. It is hidden from assistive technology. */\n icon?: ReactNode;\n title: ReactNode;\n description?: ReactNode;\n /** The next step: a `Button` or a link. */\n action?: ReactNode;\n /** The title's heading level, so it fits the page outline. Defaults to 3. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n}\n\n/**\n * What to show when a list, table or search has nothing to display. It says\n * what is missing and offers the next step.\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n headingLevel = 3,\n ...props\n}: EmptyStateProps) {\n const Heading = `h${headingLevel}` as const;\n return (\n <div data-kit=\"empty-state\" {...props}>\n {icon ? (\n <div data-kit-slot=\"empty-icon\" aria-hidden=\"true\">\n {icon}\n </div>\n ) : null}\n <Heading data-kit-slot=\"empty-title\">{title}</Heading>\n {description ? <p data-kit-slot=\"empty-description\">{description}</p> : null}\n {action ? <div data-kit-slot=\"empty-action\">{action}</div> : null}\n </div>\n );\n}\n","import type { ComponentPropsWithRef } from \"react\";\nimport { Slot } from \"../utils/slot\";\n\nexport interface CardProps extends ComponentPropsWithRef<\"div\"> {\n /** `outlined` has a border, `raised` a shadow, `flat` a quiet background. */\n variant?: \"outlined\" | \"raised\" | \"flat\";\n padding?: \"none\" | \"sm\" | \"md\" | \"lg\";\n /** Adds hover and focus styling for a card that is, or contains, the action. */\n interactive?: boolean;\n /** Render the child element (a link, an article) as the card. */\n asChild?: boolean;\n}\n\n/** A surface that groups related content. Compose it with the `Card*` parts. */\nexport function Card({\n variant = \"outlined\",\n padding = \"md\",\n interactive = false,\n asChild = false,\n ...props\n}: CardProps) {\n const shared = {\n \"data-kit\": \"card\",\n \"data-variant\": variant,\n \"data-padding\": padding,\n \"data-interactive\": interactive ? \"\" : undefined,\n ...props,\n } as const;\n return asChild ? <Slot {...shared} /> : <div {...shared} />;\n}\n\nexport type CardSectionProps = ComponentPropsWithRef<\"div\">;\n\nexport function CardHeader(props: CardSectionProps) {\n return <div data-kit-slot=\"card-header\" {...props} />;\n}\n\nexport interface CardTitleProps extends ComponentPropsWithRef<\"h3\"> {\n /** Heading level, so the title fits the page outline. Defaults to 3. */\n level?: 2 | 3 | 4 | 5 | 6;\n}\n\nexport function CardTitle({ level = 3, ...props }: CardTitleProps) {\n const Heading = `h${level}` as const;\n return <Heading data-kit-slot=\"card-title\" {...props} />;\n}\n\nexport function CardDescription(props: ComponentPropsWithRef<\"p\">) {\n return <p data-kit-slot=\"card-description\" {...props} />;\n}\n\nexport function CardContent(props: CardSectionProps) {\n return <div data-kit-slot=\"card-content\" {...props} />;\n}\n\nexport function CardFooter(props: CardSectionProps) {\n return <div data-kit-slot=\"card-footer\" {...props} />;\n}\n","import { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { Children, type ComponentPropsWithRef, type ReactNode } from \"react\";\n\nexport type AvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** First letters of the first and last words, using whole characters (not UTF-16 halves). */\nexport function getInitials(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return \"\";\n const first = Array.from(words[0] ?? \"\")[0] ?? \"\";\n const last = words.length > 1 ? (Array.from(words[words.length - 1] ?? \"\")[0] ?? \"\") : \"\";\n return `${first}${last}`.toLocaleUpperCase();\n}\n\nexport interface AvatarProps extends Omit<BaseAvatar.Root.Props, \"children\"> {\n /** Image URL. If it fails to load, the initials show instead. */\n src?: string;\n /**\n * Person's name. Used for the initials and, unless `alt` is set, as the\n * accessible name of the image.\n */\n name?: string;\n /** Overrides the accessible name. Pass `\"\"` when the name is shown next to the avatar. */\n alt?: string;\n size?: AvatarSize;\n shape?: \"circle\" | \"square\";\n /** Shown instead of initials, for example an icon. */\n fallback?: ReactNode;\n}\n\n/** A person or entity: an image with initials as the fallback. */\nexport function Avatar({\n src,\n name,\n alt,\n size = \"md\",\n shape = \"circle\",\n fallback,\n ...props\n}: AvatarProps) {\n const label = alt ?? name ?? \"\";\n const decorative = label === \"\";\n return (\n <BaseAvatar.Root\n data-kit=\"avatar\"\n data-size={size}\n data-shape={shape}\n role={decorative ? undefined : \"img\"}\n aria-label={decorative ? undefined : label}\n {...props}\n >\n {src ? <BaseAvatar.Image data-kit-slot=\"avatar-image\" src={src} alt=\"\" /> : null}\n <BaseAvatar.Fallback data-kit-slot=\"avatar-fallback\" aria-hidden=\"true\">\n {fallback ?? (name ? getInitials(name) : null)}\n </BaseAvatar.Fallback>\n </BaseAvatar.Root>\n );\n}\n\nexport interface AvatarGroupProps extends ComponentPropsWithRef<\"div\"> {\n /** Most avatars to show before collapsing the rest into \"+N\". Defaults to 4. */\n max?: number;\n /** Name of the \"+N\" chip, for example `(n) => n + \" more people\"`. Required when it can appear. */\n overflowLabel?: (hidden: number) => string;\n size?: AvatarSize;\n}\n\n/** Overlapping avatars with a \"+N\" chip for the rest. */\nexport function AvatarGroup({\n max = 4,\n overflowLabel,\n size = \"md\",\n children,\n ...props\n}: AvatarGroupProps) {\n const avatars = Children.toArray(children);\n const shown = avatars.slice(0, max);\n const hidden = avatars.length - shown.length;\n return (\n <div role=\"group\" data-kit=\"avatar-group\" data-size={size} {...props}>\n {shown}\n {hidden > 0 ? (\n <span\n data-kit=\"avatar\"\n data-size={size}\n data-shape=\"circle\"\n data-overflow=\"\"\n role=\"img\"\n aria-label={overflowLabel?.(hidden) ?? `+${hidden}`}\n >\n <span aria-hidden=\"true\" data-kit-slot=\"avatar-fallback\">{`+${hidden}`}</span>\n </span>\n ) : null}\n </div>\n );\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport type { StatusTone } from \"../types\";\n\ntype RemoveProps =\n | { onRemove?: undefined; removeLabel?: string }\n | {\n /** Shows a remove button. */\n onRemove: () => void;\n /** Name of the remove button, for example \"Remove design\". Required with `onRemove`. */\n removeLabel: string;\n };\n\nexport type TagProps = ComponentPropsWithRef<\"span\"> &\n RemoveProps & {\n tone?: StatusTone;\n size?: \"sm\" | \"md\";\n /** Decorative leading content, such as an icon or a color dot. */\n icon?: ReactNode;\n };\n\n/**\n * A label that categorises or filters, optionally removable. Use `Badge` for a\n * status and `Tag` for something the user can add or take away.\n */\nexport function Tag({\n tone = \"neutral\",\n size = \"md\",\n icon,\n onRemove,\n removeLabel,\n children,\n ...props\n}: TagProps) {\n return (\n <span data-kit=\"tag\" data-tone={tone} data-size={size} {...props}>\n {icon ? (\n <span data-kit-slot=\"tag-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span data-kit-slot=\"tag-text\">{children}</span>\n {onRemove ? (\n <button type=\"button\" data-kit-slot=\"tag-remove\" aria-label={removeLabel} onClick={onRemove}>\n <Icon name=\"close\" size={12} />\n </button>\n ) : null}\n </span>\n );\n}\n","import { Icon, type IconName } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\nexport type StatTrend = \"up\" | \"down\" | \"flat\";\nexport type StatIntent = \"positive\" | \"negative\" | \"neutral\";\n\nconst trendIcon: Record<StatTrend, IconName> = {\n up: \"chevron-up\",\n down: \"chevron-down\",\n flat: \"minus\",\n};\n\nexport interface StatProps extends ComponentPropsWithRef<\"dl\"> {\n label: ReactNode;\n value: ReactNode;\n /** The change, for example \"12.4%\". */\n delta?: ReactNode;\n trend?: StatTrend;\n /**\n * Whether the change is good or bad. Defaults to `positive` for up and\n * `negative` for down; set it when the opposite is true (cost going down).\n */\n intent?: StatIntent;\n /**\n * Spoken before the delta, for example \"Increased by\". The arrow icon is\n * decorative, so this is what tells a screen reader the direction.\n */\n trendLabel?: string;\n /** A short note under the value, for example \"vs. last month\". */\n help?: ReactNode;\n}\n\n/**\n * One headline number with its label and change. It is a description list, so\n * the label and value stay linked for assistive technology. Direction is shown\n * with an arrow and text, never color alone.\n */\nexport function Stat({\n label,\n value,\n delta,\n trend = \"flat\",\n intent,\n trendLabel,\n help,\n ...props\n}: StatProps) {\n const resolvedIntent: StatIntent =\n intent ?? (trend === \"up\" ? \"positive\" : trend === \"down\" ? \"negative\" : \"neutral\");\n return (\n <dl data-kit=\"stat\" {...props}>\n <dt data-kit-slot=\"stat-label\">{label}</dt>\n <dd data-kit-slot=\"stat-value\">{value}</dd>\n {delta ? (\n <dd data-kit-slot=\"stat-delta\" data-trend={trend} data-intent={resolvedIntent}>\n <Icon name={trendIcon[trend]} size={16} />\n {trendLabel ? <VisuallyHidden>{`${trendLabel} `}</VisuallyHidden> : null}\n {delta}\n </dd>\n ) : null}\n {help ? <dd data-kit-slot=\"stat-help\">{help}</dd> : null}\n </dl>\n );\n}\n","import type { ComponentPropsWithRef } from \"react\";\n\nexport interface TableContainerProps extends ComponentPropsWithRef<\"div\"> {\n /**\n * Name of the scrollable region, for example \"Invoices\". A region that can\n * scroll must be focusable and named so keyboard users can reach it.\n */\n label: string;\n}\n\n/** Wraps a wide table so it scrolls horizontally without breaking the page. */\nexport function TableContainer({ label, ...props }: TableContainerProps) {\n return <div data-kit=\"table-container\" role=\"region\" aria-label={label} tabIndex={0} {...props} />;\n}\n\nexport interface TableProps extends ComponentPropsWithRef<\"table\"> {\n striped?: boolean;\n /** Keeps the header visible while the body scrolls inside a height-limited container. */\n stickyHeader?: boolean;\n /** Overrides the density for this table only. */\n density?: \"compact\" | \"default\" | \"comfortable\";\n}\n\n/**\n * A static, semantic table for small and medium datasets. For sorting,\n * filtering, selection and large data use `DataGrid` from `@x12i/data`.\n */\nexport function Table({ striped, stickyHeader, density, ...props }: TableProps) {\n return (\n <table\n data-kit=\"table\"\n data-striped={striped ? \"\" : undefined}\n data-sticky-header={stickyHeader ? \"\" : undefined}\n data-density={density}\n {...props}\n />\n );\n}\n\nexport function TableCaption(props: ComponentPropsWithRef<\"caption\">) {\n return <caption data-kit-slot=\"table-caption\" {...props} />;\n}\n\nexport function TableHead(props: ComponentPropsWithRef<\"thead\">) {\n return <thead data-kit-slot=\"table-head\" {...props} />;\n}\n\nexport function TableBody(props: ComponentPropsWithRef<\"tbody\">) {\n return <tbody data-kit-slot=\"table-body\" {...props} />;\n}\n\nexport function TableFoot(props: ComponentPropsWithRef<\"tfoot\">) {\n return <tfoot data-kit-slot=\"table-foot\" {...props} />;\n}\n\nexport interface TableRowProps extends ComponentPropsWithRef<\"tr\"> {\n /** Styles the row as selected. Selection semantics belong to the control inside it. */\n selected?: boolean;\n}\n\nexport function TableRow({ selected, ...props }: TableRowProps) {\n return <tr data-kit-slot=\"table-row\" data-selected={selected ? \"\" : undefined} {...props} />;\n}\n\ntype Align = \"start\" | \"center\" | \"end\" | \"numeric\";\n\nexport interface TableHeaderCellProps extends Omit<ComponentPropsWithRef<\"th\">, \"align\"> {\n align?: Align;\n /** Marks the column as sorted, for `aria-sort`. */\n sort?: \"ascending\" | \"descending\" | \"none\";\n}\n\nexport function TableHeaderCell({ align = \"start\", sort, scope = \"col\", ...props }: TableHeaderCellProps) {\n return (\n <th\n data-kit-slot=\"table-header-cell\"\n data-align={align}\n data-sort={sort && sort !== \"none\" ? sort : undefined}\n aria-sort={sort}\n scope={scope}\n {...props}\n />\n );\n}\n\nexport interface TableCellProps extends Omit<ComponentPropsWithRef<\"td\">, \"align\"> {\n /** `numeric` right-aligns (start-aligned in RTL it mirrors) and uses tabular digits. */\n align?: Align;\n}\n\nexport function TableCell({ align = \"start\", ...props }: TableCellProps) {\n return <td data-kit-slot=\"table-cell\" data-align={align} {...props} />;\n}\n","import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\n\nexport interface ScrollAreaProps extends BaseScrollArea.Root.Props {\n /**\n * Name of the scrollable region, for example \"Chat messages\". Required: a\n * scrollable region is focusable so keyboard users can scroll it, and a\n * focusable region needs a name.\n */\n label: string;\n /** Which scrollbars to draw. Defaults to `vertical`. */\n orientation?: \"vertical\" | \"horizontal\" | \"both\";\n}\n\n/**\n * A scroll container with themed scrollbars. The viewport is focusable and\n * named, and scrolls with the arrow keys, Page Up/Down, Home and End.\n */\nexport function ScrollArea({\n label,\n orientation = \"vertical\",\n children,\n ...props\n}: ScrollAreaProps) {\n return (\n <BaseScrollArea.Root data-kit=\"scroll-area\" {...props}>\n <BaseScrollArea.Viewport\n data-kit-slot=\"scroll-viewport\"\n role=\"region\"\n aria-label={label}\n tabIndex={0}\n >\n <BaseScrollArea.Content data-kit-slot=\"scroll-content\">{children}</BaseScrollArea.Content>\n </BaseScrollArea.Viewport>\n {orientation !== \"horizontal\" ? (\n <BaseScrollArea.Scrollbar orientation=\"vertical\" data-kit-slot=\"scrollbar\">\n <BaseScrollArea.Thumb data-kit-slot=\"scroll-thumb\" />\n </BaseScrollArea.Scrollbar>\n ) : null}\n {orientation !== \"vertical\" ? (\n <BaseScrollArea.Scrollbar orientation=\"horizontal\" data-kit-slot=\"scrollbar\">\n <BaseScrollArea.Thumb data-kit-slot=\"scroll-thumb\" />\n </BaseScrollArea.Scrollbar>\n ) : null}\n {orientation === \"both\" ? <BaseScrollArea.Corner data-kit-slot=\"scroll-corner\" /> : null}\n </BaseScrollArea.Root>\n );\n}\n","import { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { Icon } from \"@x12i/icons\";\n\nexport type CollapsibleProps = BaseCollapsible.Root.Props;\n\n/** Shows and hides one region of content. Compose with the trigger and panel. */\nexport function Collapsible(props: CollapsibleProps) {\n return <BaseCollapsible.Root data-kit=\"collapsible\" {...props} />;\n}\n\nexport type CollapsibleTriggerProps = BaseCollapsible.Trigger.Props;\n\n/** The button that toggles the panel. It carries `aria-expanded` and `aria-controls`. */\nexport function CollapsibleTrigger({ children, ...props }: CollapsibleTriggerProps) {\n return (\n <BaseCollapsible.Trigger data-kit-slot=\"collapsible-trigger\" {...props}>\n <Icon name=\"chevron-right\" data-kit-slot=\"collapsible-chevron\" />\n {children}\n </BaseCollapsible.Trigger>\n );\n}\n\nexport type CollapsiblePanelProps = BaseCollapsible.Panel.Props;\n\nexport function CollapsiblePanel(props: CollapsiblePanelProps) {\n return <BaseCollapsible.Panel data-kit-slot=\"collapsible-panel\" {...props} />;\n}\n","import { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\n\nexport interface TabsProps extends BaseTabs.Root.Props {\n /** `line` underlines the active tab; `pill` highlights it. */\n variant?: \"line\" | \"pill\";\n}\n\n/**\n * Tabs with automatic activation: arrow keys move focus and select, Home and\n * End jump to the ends. Compose with `TabList`, `Tab` and `TabPanel`.\n */\nexport function Tabs({ variant = \"line\", ...props }: TabsProps) {\n return <BaseTabs.Root data-kit=\"tabs\" data-variant={variant} {...props} />;\n}\n\nexport type TabListProps = BaseTabs.List.Props;\n\n/** The row of tabs. Name it with `aria-label` when the page has more than one set of tabs. */\nexport function TabList({ children, ...props }: TabListProps) {\n return (\n <BaseTabs.List data-kit-slot=\"tab-list\" {...props}>\n {children}\n <BaseTabs.Indicator data-kit-slot=\"tab-indicator\" />\n </BaseTabs.List>\n );\n}\n\nexport type TabProps = BaseTabs.Tab.Props;\n\nexport function Tab(props: TabProps) {\n return <BaseTabs.Tab data-kit-slot=\"tab\" {...props} />;\n}\n\nexport type TabPanelProps = BaseTabs.Panel.Props;\n\nexport function TabPanel(props: TabPanelProps) {\n return <BaseTabs.Panel data-kit-slot=\"tab-panel\" {...props} />;\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport { Link } from \"./link\";\n\nexport interface BreadcrumbItemData {\n label: ReactNode;\n /** Omit for the current page, which renders as plain text. */\n href?: string;\n}\n\nexport interface BreadcrumbProps extends Omit<ComponentPropsWithRef<\"nav\">, \"children\"> {\n /** Name of the landmark, for example \"Breadcrumb\". Pass a translated string. */\n label: string;\n /** From the root to the current page. The last item is the current page. */\n items: BreadcrumbItemData[];\n /**\n * Renders a link, so a router's link component can be used. Receives the\n * href and the label.\n */\n renderLink?: (item: { href: string; label: ReactNode }) => ReactNode;\n}\n\n/**\n * Where the user is in a hierarchy. The last item is marked\n * `aria-current=\"page\"`; the separators are decorative and mirror in RTL.\n */\nexport function Breadcrumb({ label, items, renderLink, ...props }: BreadcrumbProps) {\n return (\n <nav data-kit=\"breadcrumb\" aria-label={label} {...props}>\n <ol data-kit-slot=\"breadcrumb-list\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n return (\n <li key={index} data-kit-slot=\"breadcrumb-item\">\n {item.href && !isLast ? (\n (renderLink?.({ href: item.href, label: item.label }) ?? (\n <Link href={item.href} tone=\"neutral\" underline=\"hover\">\n {item.label}\n </Link>\n ))\n ) : (\n <span data-kit-slot=\"breadcrumb-page\" aria-current={isLast ? \"page\" : undefined}>\n {item.label}\n </span>\n )}\n {isLast ? null : (\n <span data-kit-slot=\"breadcrumb-separator\" aria-hidden=\"true\">\n <Icon name=\"chevron-right\" size={12} />\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef } from \"react\";\n\nexport type PaginationItem = number | \"ellipsis-start\" | \"ellipsis-end\";\n\n/**\n * The page numbers to show: always the first and last page, the current page\n * with `siblingCount` neighbours on each side, and an ellipsis for each gap.\n * The list has a stable length, so the control does not change width while the\n * user pages through.\n */\nexport function getPaginationRange(\n page: number,\n pageCount: number,\n siblingCount = 1,\n): PaginationItem[] {\n const range = (from: number, to: number) =>\n Array.from({ length: Math.max(0, to - from + 1) }, (_, index) => from + index);\n\n const slots = siblingCount * 2 + 5;\n if (pageCount <= slots) return range(1, pageCount);\n\n const current = Math.min(Math.max(page, 1), pageCount);\n const left = Math.max(current - siblingCount, 1);\n const right = Math.min(current + siblingCount, pageCount);\n const showLeftEllipsis = left > 2;\n const showRightEllipsis = right < pageCount - 1;\n const edgeCount = 3 + siblingCount * 2;\n\n if (!showLeftEllipsis && showRightEllipsis) {\n return [...range(1, edgeCount), \"ellipsis-end\", pageCount];\n }\n if (showLeftEllipsis && !showRightEllipsis) {\n return [1, \"ellipsis-start\", ...range(pageCount - edgeCount + 1, pageCount)];\n }\n return [1, \"ellipsis-start\", ...range(left, right), \"ellipsis-end\", pageCount];\n}\n\nexport interface PaginationProps extends Omit<ComponentPropsWithRef<\"nav\">, \"onChange\"> {\n /** Current page, starting at 1. */\n page: number;\n pageCount: number;\n onPageChange: (page: number) => void;\n /** Page numbers shown on each side of the current page. Defaults to 1. */\n siblingCount?: number;\n /** Name of the landmark, for example \"Pagination\". */\n label: string;\n previousLabel: string;\n nextLabel: string;\n /** Name of a page button, for example `(n) => \"Page \" + n`. */\n getPageLabel: (page: number) => string;\n}\n\n/**\n * Page navigation. The current page has `aria-current=\"page\"`. Previous and\n * next are disabled at the ends instead of disappearing, so the layout holds.\n */\nexport function Pagination({\n page,\n pageCount,\n onPageChange,\n siblingCount = 1,\n label,\n previousLabel,\n nextLabel,\n getPageLabel,\n ...props\n}: PaginationProps) {\n const items = getPaginationRange(page, pageCount, siblingCount);\n return (\n <nav data-kit=\"pagination\" aria-label={label} {...props}>\n <ul data-kit-slot=\"pagination-list\">\n <li>\n <button\n type=\"button\"\n data-kit-slot=\"pagination-step\"\n data-direction=\"previous\"\n aria-label={previousLabel}\n disabled={page <= 1}\n onClick={() => onPageChange(page - 1)}\n >\n <Icon name=\"chevron-left\" />\n </button>\n </li>\n {items.map((item) =>\n typeof item === \"number\" ? (\n <li key={item}>\n <button\n type=\"button\"\n data-kit-slot=\"pagination-page\"\n data-current={item === page ? \"\" : undefined}\n aria-label={getPageLabel(item)}\n aria-current={item === page ? \"page\" : undefined}\n onClick={() => onPageChange(item)}\n >\n {item}\n </button>\n </li>\n ) : (\n <li key={item} data-kit-slot=\"pagination-ellipsis\" aria-hidden=\"true\">\n …\n </li>\n ),\n )}\n <li>\n <button\n type=\"button\"\n data-kit-slot=\"pagination-step\"\n data-direction=\"next\"\n aria-label={nextLabel}\n disabled={page >= pageCount}\n onClick={() => onPageChange(page + 1)}\n >\n <Icon name=\"chevron-right\" />\n </button>\n </li>\n </ul>\n </nav>\n );\n}\n","import { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { Icon } from \"@x12i/icons\";\nimport { createElement, type ReactNode } from \"react\";\n\nexport type AccordionProps<Value = string> = BaseAccordion.Root.Props<Value>;\n\n/**\n * A stack of sections that expand and collapse. One section is open at a time\n * unless `multiple` is set. Arrow keys move between headers.\n */\nexport function Accordion<Value = string>(props: AccordionProps<Value>) {\n return <BaseAccordion.Root data-kit=\"accordion\" {...props} />;\n}\n\nexport interface AccordionItemProps extends Omit<BaseAccordion.Item.Props, \"children\" | \"title\"> {\n /** The header text. It is the button that toggles the section. */\n title: ReactNode;\n children: ReactNode;\n /** The heading level of the header, so it fits the page outline. Defaults to 3. */\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n}\n\nexport function AccordionItem({ title, children, headingLevel = 3, ...props }: AccordionItemProps) {\n return (\n <BaseAccordion.Item data-kit-slot=\"accordion-item\" {...props}>\n <BaseAccordion.Header data-kit-slot=\"accordion-header\" render={createElement(`h${headingLevel}`)}>\n <BaseAccordion.Trigger data-kit-slot=\"accordion-trigger\">\n <span data-kit-slot=\"accordion-title\">{title}</span>\n <Icon name=\"chevron-down\" data-kit-slot=\"accordion-chevron\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n <BaseAccordion.Panel data-kit-slot=\"accordion-panel\">\n <div data-kit-slot=\"accordion-content\">{children}</div>\n </BaseAccordion.Panel>\n </BaseAccordion.Item>\n );\n}\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport type { ReactNode } from \"react\";\nimport type { ControlSize } from \"../types\";\n\nexport interface SegmentedOption<Value extends string = string> {\n value: Value;\n label: ReactNode;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps<Value extends string = string>\n extends Omit<BaseRadioGroup.Props<Value>, \"children\" | \"render\"> {\n options: SegmentedOption<Value>[];\n size?: ControlSize;\n /** Stretch the segments to fill the available width. */\n fullWidth?: boolean;\n}\n\n/**\n * Switches between a few views of the same content (Day / Week / Month). It is\n * a radio group, so arrow keys select and exactly one option is always chosen.\n * Use `Tabs` when each option reveals a different panel of content.\n */\nexport function SegmentedControl<Value extends string = string>({\n options,\n size = \"md\",\n fullWidth = false,\n ...props\n}: SegmentedControlProps<Value>) {\n return (\n <BaseRadioGroup\n data-kit=\"segmented-control\"\n data-size={size}\n data-full-width={fullWidth ? \"\" : undefined}\n {...props}\n >\n {options.map((option) => (\n <BaseRadio.Root\n key={option.value}\n value={option.value}\n disabled={option.disabled}\n data-kit-slot=\"segment\"\n >\n {option.label}\n </BaseRadio.Root>\n ))}\n </BaseRadioGroup>\n );\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef, ReactNode } from \"react\";\nimport { VisuallyHidden } from \"./visually-hidden\";\n\nexport type StepStatus = \"complete\" | \"current\" | \"upcoming\";\n\nexport interface StepperStep {\n id: string;\n label: ReactNode;\n description?: ReactNode;\n}\n\nexport interface StepperProps extends ComponentPropsWithRef<\"ol\"> {\n steps: StepperStep[];\n /** Index of the current step, starting at 0. Earlier steps are complete. */\n current: number;\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * Spoken after each step's label, for example\n * `(status) => status === \"complete\" ? \"Completed\" : status === \"current\" ? \"Current step\" : \"Not started\"`.\n * Required for assistive technology to hear progress.\n */\n getStatusLabel: (status: StepStatus) => string;\n}\n\n/**\n * Where the user is in a multi-step process. It is a display, not navigation:\n * put the controls that move between steps (Back, Next) outside it. The\n * current step has `aria-current=\"step\"`, and each step's status is spoken as\n * text and drawn as an icon, not just a color.\n */\nexport function Stepper({\n steps,\n current,\n orientation = \"horizontal\",\n getStatusLabel,\n ...props\n}: StepperProps) {\n return (\n <ol data-kit=\"stepper\" data-orientation={orientation} {...props}>\n {steps.map((step, index) => {\n const status: StepStatus = index < current ? \"complete\" : index === current ? \"current\" : \"upcoming\";\n return (\n <li\n key={step.id}\n data-kit-slot=\"step\"\n data-status={status}\n aria-current={status === \"current\" ? \"step\" : undefined}\n >\n <span data-kit-slot=\"step-marker\" aria-hidden=\"true\">\n {status === \"complete\" ? <Icon name=\"check\" size={16} /> : index + 1}\n </span>\n <span data-kit-slot=\"step-text\">\n <span data-kit-slot=\"step-label\">\n {step.label}\n <VisuallyHidden>{`. ${getStatusLabel(status)}`}</VisuallyHidden>\n </span>\n {step.description ? <span data-kit-slot=\"step-description\">{step.description}</span> : null}\n </span>\n </li>\n );\n })}\n </ol>\n );\n}\n","import { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { Button, type ButtonProps } from \"./button\";\n\nexport type ToolbarProps = BaseToolbar.Root.Props;\n\n/**\n * A row of controls with one tab stop and arrow-key navigation (roving focus).\n * Name it with `aria-label`.\n */\nexport function Toolbar(props: ToolbarProps) {\n return <BaseToolbar.Root data-kit=\"toolbar\" {...props} />;\n}\n\nexport type ToolbarGroupProps = BaseToolbar.Group.Props;\n\nexport function ToolbarGroup(props: ToolbarGroupProps) {\n return <BaseToolbar.Group data-kit-slot=\"toolbar-group\" {...props} />;\n}\n\nexport interface ToolbarButtonProps\n extends Omit<BaseToolbar.Button.Props, \"render\">,\n Pick<ButtonProps, \"variant\" | \"tone\" | \"size\"> {}\n\n/** A button that takes part in the toolbar's arrow-key navigation. */\nexport function ToolbarButton({\n variant = \"ghost\",\n tone = \"neutral\",\n size = \"sm\",\n ...props\n}: ToolbarButtonProps) {\n return (\n <BaseToolbar.Button render={<Button variant={variant} tone={tone} size={size} />} {...props} />\n );\n}\n\nexport type ToolbarSeparatorProps = BaseToolbar.Separator.Props;\n\nexport function ToolbarSeparator(props: ToolbarSeparatorProps) {\n return <BaseToolbar.Separator data-kit-slot=\"toolbar-separator\" {...props} />;\n}\n","import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { IconButton } from \"./icon-button\";\n\nexport type DialogSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\nexport type DialogProps = BaseDialog.Root.Props;\n\n/**\n * A modal dialog. Focus moves into it when it opens, stays inside, and returns\n * to the trigger when it closes; Escape closes it. Compose with\n * `DialogTrigger`, `DialogContent`, `DialogTitle` and the other parts.\n */\nexport const Dialog = BaseDialog.Root;\n\nexport type DialogTriggerProps = BaseDialog.Trigger.Props;\n\nexport function DialogTrigger(props: DialogTriggerProps) {\n return <BaseDialog.Trigger {...props} />;\n}\n\nexport interface DialogContentProps extends BaseDialog.Popup.Props {\n size?: DialogSize;\n /**\n * Name of the corner close button, for example \"Close\". Leave it out to hide\n * the button; the dialog must then contain its own `DialogClose` action.\n */\n closeLabel?: string;\n}\n\n/** The dialog panel with its backdrop. It must contain a `DialogTitle`. */\nexport function DialogContent({ size = \"md\", closeLabel, children, ...props }: DialogContentProps) {\n return (\n <BaseDialog.Portal>\n <BaseDialog.Backdrop data-kit=\"dialog-backdrop\" />\n <BaseDialog.Viewport data-kit=\"dialog-viewport\">\n <BaseDialog.Popup data-kit=\"dialog\" data-size={size} {...props}>\n {children}\n {closeLabel ? (\n <BaseDialog.Close\n data-kit-slot=\"dialog-close\"\n render={\n <IconButton label={closeLabel} variant=\"ghost\" tone=\"neutral\" size=\"sm\">\n <Icon name=\"close\" />\n </IconButton>\n }\n />\n ) : null}\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n );\n}\n\nexport function DialogTitle(props: BaseDialog.Title.Props) {\n return <BaseDialog.Title data-kit-slot=\"dialog-title\" {...props} />;\n}\n\nexport function DialogDescription(props: BaseDialog.Description.Props) {\n return <BaseDialog.Description data-kit-slot=\"dialog-description\" {...props} />;\n}\n\nexport function DialogHeader(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"dialog-header\" {...props} />;\n}\n\nexport function DialogBody(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"dialog-body\" {...props} />;\n}\n\nexport function DialogFooter(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"dialog-footer\" {...props} />;\n}\n\n/** Closes the dialog. Use `render={<Button />}` to style it as a button. */\nexport function DialogClose(props: BaseDialog.Close.Props) {\n return <BaseDialog.Close {...props} />;\n}\n\n/* ------------------------------------------------------------ AlertDialog */\n\nexport type AlertDialogProps = BaseAlertDialog.Root.Props;\n\n/**\n * A dialog that interrupts to ask for a decision (delete, discard). It cannot\n * be dismissed by clicking outside, has no corner close button, and announces\n * itself as an alert dialog.\n */\nexport const AlertDialog = BaseAlertDialog.Root;\n\nexport function AlertDialogTrigger(props: BaseAlertDialog.Trigger.Props) {\n return <BaseAlertDialog.Trigger {...props} />;\n}\n\nexport interface AlertDialogContentProps extends BaseAlertDialog.Popup.Props {\n size?: \"sm\" | \"md\";\n}\n\nexport function AlertDialogContent({ size = \"sm\", ...props }: AlertDialogContentProps) {\n return (\n <BaseAlertDialog.Portal>\n <BaseAlertDialog.Backdrop data-kit=\"dialog-backdrop\" />\n <BaseAlertDialog.Viewport data-kit=\"dialog-viewport\">\n <BaseAlertDialog.Popup data-kit=\"dialog\" data-kind=\"alert\" data-size={size} {...props} />\n </BaseAlertDialog.Viewport>\n </BaseAlertDialog.Portal>\n );\n}\n\nexport function AlertDialogTitle(props: BaseAlertDialog.Title.Props) {\n return <BaseAlertDialog.Title data-kit-slot=\"dialog-title\" {...props} />;\n}\n\nexport function AlertDialogDescription(props: BaseAlertDialog.Description.Props) {\n return <BaseAlertDialog.Description data-kit-slot=\"dialog-description\" {...props} />;\n}\n\nexport function AlertDialogFooter(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"dialog-footer\" {...props} />;\n}\n\n/** Closes the alert dialog: wire both the cancel and the confirm buttons through it. */\nexport function AlertDialogClose(props: BaseAlertDialog.Close.Props) {\n return <BaseAlertDialog.Close {...props} />;\n}\n","import { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { IconButton } from \"./icon-button\";\n\nexport type DrawerSide = \"start\" | \"end\" | \"top\" | \"bottom\";\n\nexport type DrawerProps = Omit<BaseDrawer.Root.Props, \"swipeDirection\"> & {\n /** The edge the drawer slides in from. `start` and `end` follow the text direction. */\n side?: DrawerSide;\n};\n\nfunction isRtl(): boolean {\n return typeof document !== \"undefined\" && getComputedStyle(document.documentElement).direction === \"rtl\";\n}\n\n/** The direction that swipes the drawer away: toward the edge it came from. */\nfunction swipeDirection(side: DrawerSide): \"left\" | \"right\" | \"up\" | \"down\" {\n if (side === \"top\") return \"up\";\n if (side === \"bottom\") return \"down\";\n const rtl = isRtl();\n return (side === \"start\") !== rtl ? \"left\" : \"right\";\n}\n\n/**\n * A panel that slides in from an edge and can be swiped away on touch devices.\n * It behaves like a modal dialog: focus is trapped, Escape closes it, and\n * focus returns to the trigger. Swipe direction follows the document's `dir`.\n */\nexport function Drawer({ side = \"end\", ...props }: DrawerProps) {\n return <BaseDrawer.Root swipeDirection={swipeDirection(side)} {...props} />;\n}\n\nexport function DrawerTrigger(props: BaseDrawer.Trigger.Props) {\n return <BaseDrawer.Trigger {...props} />;\n}\n\nexport interface DrawerContentProps extends BaseDrawer.Popup.Props {\n side?: DrawerSide;\n /** Name of the corner close button. Leave it out to hide the button. */\n closeLabel?: string;\n}\n\n/** The drawer panel and its backdrop. It must contain a `DrawerTitle`. */\nexport function DrawerContent({ side = \"end\", closeLabel, children, ...props }: DrawerContentProps) {\n return (\n <BaseDrawer.Portal>\n <BaseDrawer.Backdrop data-kit=\"drawer-backdrop\" />\n <BaseDrawer.Viewport data-kit=\"drawer-viewport\">\n <BaseDrawer.Popup data-kit=\"drawer\" data-side={side} {...props}>\n {children}\n {closeLabel ? (\n <BaseDrawer.Close\n data-kit-slot=\"drawer-close\"\n render={\n <IconButton label={closeLabel} variant=\"ghost\" tone=\"neutral\" size=\"sm\">\n <Icon name=\"close\" />\n </IconButton>\n }\n />\n ) : null}\n </BaseDrawer.Popup>\n </BaseDrawer.Viewport>\n </BaseDrawer.Portal>\n );\n}\n\nexport function DrawerTitle(props: BaseDrawer.Title.Props) {\n return <BaseDrawer.Title data-kit-slot=\"drawer-title\" {...props} />;\n}\n\nexport function DrawerDescription(props: BaseDrawer.Description.Props) {\n return <BaseDrawer.Description data-kit-slot=\"drawer-description\" {...props} />;\n}\n\nexport function DrawerHeader(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"drawer-header\" {...props} />;\n}\n\nexport function DrawerBody(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"drawer-body\" {...props} />;\n}\n\nexport function DrawerFooter(props: ComponentPropsWithRef<\"div\">) {\n return <div data-kit-slot=\"drawer-footer\" {...props} />;\n}\n\nexport function DrawerClose(props: BaseDrawer.Close.Props) {\n return <BaseDrawer.Close {...props} />;\n}\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport type { PositionProps } from \"./positioning\";\n\nexport type PopoverProps = BasePopover.Root.Props;\n\n/**\n * A floating panel anchored to a trigger, for rich content or a small form.\n * Escape and outside click close it; focus moves into it and returns to the\n * trigger. Use `Tooltip` for a short, non-interactive hint.\n */\nexport const Popover = BasePopover.Root;\n\nexport function PopoverTrigger(props: BasePopover.Trigger.Props) {\n return <BasePopover.Trigger {...props} />;\n}\n\nexport interface PopoverContentProps extends BasePopover.Popup.Props, PositionProps {\n /** Draws an arrow pointing at the trigger. */\n arrow?: boolean;\n}\n\nexport function PopoverContent({\n side = \"bottom\",\n align = \"center\",\n sideOffset = 8,\n alignOffset,\n collisionPadding = 8,\n anchor,\n arrow = false,\n children,\n ...props\n}: PopoverContentProps) {\n return (\n <BasePopover.Portal>\n <BasePopover.Positioner\n data-kit=\"popover-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n anchor={anchor}\n >\n <BasePopover.Popup data-kit=\"popover\" {...props}>\n {arrow ? <BasePopover.Arrow data-kit-slot=\"popup-arrow\" /> : null}\n {children}\n </BasePopover.Popup>\n </BasePopover.Positioner>\n </BasePopover.Portal>\n );\n}\n\nexport function PopoverTitle(props: BasePopover.Title.Props) {\n return <BasePopover.Title data-kit-slot=\"popover-title\" {...props} />;\n}\n\nexport function PopoverDescription(props: BasePopover.Description.Props) {\n return <BasePopover.Description data-kit-slot=\"popover-description\" {...props} />;\n}\n\nexport function PopoverClose(props: BasePopover.Close.Props) {\n return <BasePopover.Close {...props} />;\n}\n","import { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport { type ReactElement, type ReactNode, useId, useState } from \"react\";\nimport type { PositionProps } from \"./positioning\";\n\n/**\n * Shares open and close delays between tooltips, so moving from one trigger to\n * the next shows the second tooltip immediately. Wrap the app once.\n */\nexport const TooltipProvider = BaseTooltip.Provider;\n\nexport interface TooltipProps extends Omit<PositionProps, \"anchor\"> {\n /**\n * Short, plain text. A tooltip is not focusable and disappears when the\n * pointer or focus leaves, so never put actions or required information in\n * it, and never use it as the only name of an icon button.\n */\n content: ReactNode;\n /** The element the tooltip describes. It must accept a ref and DOM props. */\n children: ReactElement<{ \"aria-describedby\"?: string }>;\n /** Milliseconds before it opens on hover. Defaults to 600. */\n delay?: number;\n closeDelay?: number;\n disabled?: boolean;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\n/**\n * A short hint shown on hover and keyboard focus. While it is open the\n * trigger is linked to it with `aria-describedby` and the panel has\n * `role=\"tooltip\"`. Escape closes it.\n */\nexport function Tooltip({\n content,\n children,\n side = \"top\",\n align = \"center\",\n sideOffset = 6,\n alignOffset,\n collisionPadding = 8,\n delay = 600,\n closeDelay,\n disabled,\n open,\n defaultOpen = false,\n onOpenChange,\n}: TooltipProps) {\n const id = useId();\n // Base UI adds no tooltip semantics, so open state is tracked here to link\n // the trigger to the panel only while the panel exists.\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isOpen = open ?? internalOpen;\n\n const own = children.props[\"aria-describedby\"];\n const describedBy = isOpen ? [own, id].filter(Boolean).join(\" \") : own;\n\n return (\n <BaseTooltip.Root\n open={isOpen}\n onOpenChange={(next) => {\n setInternalOpen(next);\n onOpenChange?.(next);\n }}\n disabled={disabled}\n >\n <BaseTooltip.Trigger\n render={children}\n delay={delay}\n closeDelay={closeDelay}\n aria-describedby={describedBy}\n />\n <BaseTooltip.Portal>\n <BaseTooltip.Positioner\n data-kit=\"tooltip-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n >\n <BaseTooltip.Popup data-kit=\"tooltip\" id={id} role=\"tooltip\">\n {content}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n </BaseTooltip.Root>\n );\n}\n","import { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ReactNode } from \"react\";\nimport type { PositionProps } from \"./positioning\";\n\nexport type MenuProps = BaseMenu.Root.Props;\n\n/**\n * A menu of actions opened from a button. Arrow keys move, Home/End jump,\n * typing jumps to a matching item, Enter or Space activates, Escape closes.\n * Use `Select` to choose a value instead of run a command.\n */\nexport const Menu = BaseMenu.Root;\n\nexport function MenuTrigger(props: BaseMenu.Trigger.Props) {\n return <BaseMenu.Trigger {...props} />;\n}\n\nexport interface MenuContentProps extends BaseMenu.Popup.Props, PositionProps {}\n\nexport function MenuContent({\n side = \"bottom\",\n align = \"start\",\n sideOffset = 4,\n alignOffset,\n collisionPadding = 8,\n anchor,\n ...props\n}: MenuContentProps) {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n data-kit=\"menu-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n anchor={anchor}\n >\n <BaseMenu.Popup data-kit=\"menu\" {...props} />\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n}\n\nexport interface MenuItemProps extends BaseMenu.Item.Props {\n /** Decorative icon before the label. */\n icon?: ReactNode;\n /** A shortcut hint such as `<Kbd>⌘K</Kbd>`. It is decorative; the shortcut must work elsewhere. */\n shortcut?: ReactNode;\n /** `danger` marks a destructive action. The label must still say what it does. */\n tone?: \"default\" | \"danger\";\n}\n\n/** One action. Also works inside `ContextMenuContent`. */\nexport function MenuItem({ icon, shortcut, tone = \"default\", children, ...props }: MenuItemProps) {\n return (\n <BaseMenu.Item data-kit=\"menu-item\" data-tone={tone} {...props}>\n {icon ? (\n <span data-kit-slot=\"menu-item-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span data-kit-slot=\"menu-item-text\">{children}</span>\n {shortcut ? (\n <span data-kit-slot=\"menu-item-shortcut\" aria-hidden=\"true\">\n {shortcut}\n </span>\n ) : null}\n </BaseMenu.Item>\n );\n}\n\nexport function MenuCheckboxItem({ children, ...props }: BaseMenu.CheckboxItem.Props) {\n return (\n <BaseMenu.CheckboxItem data-kit=\"menu-item\" data-choice=\"checkbox\" {...props}>\n <span data-kit-slot=\"menu-item-icon\" aria-hidden=\"true\">\n <BaseMenu.CheckboxItemIndicator>\n <Icon name=\"check\" />\n </BaseMenu.CheckboxItemIndicator>\n </span>\n <span data-kit-slot=\"menu-item-text\">{children}</span>\n </BaseMenu.CheckboxItem>\n );\n}\n\nexport function MenuRadioGroup(props: BaseMenu.RadioGroup.Props) {\n return <BaseMenu.RadioGroup {...props} />;\n}\n\nexport function MenuRadioItem({ children, ...props }: BaseMenu.RadioItem.Props) {\n return (\n <BaseMenu.RadioItem data-kit=\"menu-item\" data-choice=\"radio\" {...props}>\n <span data-kit-slot=\"menu-item-icon\" aria-hidden=\"true\">\n <BaseMenu.RadioItemIndicator data-kit-slot=\"menu-radio-dot\" />\n </span>\n <span data-kit-slot=\"menu-item-text\">{children}</span>\n </BaseMenu.RadioItem>\n );\n}\n\nexport function MenuGroup(props: BaseMenu.Group.Props) {\n return <BaseMenu.Group data-kit-slot=\"menu-group\" {...props} />;\n}\n\n/** The heading of a `MenuGroup`, announced when focus enters the group. */\nexport function MenuLabel(props: BaseMenu.GroupLabel.Props) {\n return <BaseMenu.GroupLabel data-kit-slot=\"menu-label\" {...props} />;\n}\n\nexport function MenuSeparator(props: BaseMenu.Separator.Props) {\n return <BaseMenu.Separator data-kit-slot=\"menu-separator\" {...props} />;\n}\n\n/** A nested menu. Open it with the arrow key that points away from the parent. */\nexport const SubMenu = BaseMenu.SubmenuRoot;\n\nexport function SubMenuTrigger({ icon, children, ...props }: BaseMenu.SubmenuTrigger.Props & { icon?: ReactNode }) {\n return (\n <BaseMenu.SubmenuTrigger data-kit=\"menu-item\" data-submenu=\"\" {...props}>\n {icon ? (\n <span data-kit-slot=\"menu-item-icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span data-kit-slot=\"menu-item-text\">{children}</span>\n <span data-kit-slot=\"menu-item-chevron\" aria-hidden=\"true\">\n <Icon name=\"chevron-right\" />\n </span>\n </BaseMenu.SubmenuTrigger>\n );\n}\n\nexport function SubMenuContent({\n side = \"inline-end\",\n align = \"start\",\n sideOffset = 2,\n alignOffset,\n collisionPadding = 8,\n ...props\n}: MenuContentProps) {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n data-kit=\"menu-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n >\n <BaseMenu.Popup data-kit=\"menu\" {...props} />\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n );\n}\n\n/* ----------------------------------------------------------- ContextMenu */\n\n/**\n * A menu opened by right-click, long-press or the context-menu key on an\n * area. It must never be the only way to reach an action: also offer the\n * action in a visible control.\n */\nexport const ContextMenu = BaseContextMenu.Root;\n\nexport function ContextMenuTrigger(props: BaseContextMenu.Trigger.Props) {\n return <BaseContextMenu.Trigger data-kit-slot=\"context-trigger\" {...props} />;\n}\n\nexport function ContextMenuContent({\n side,\n align,\n sideOffset,\n alignOffset,\n collisionPadding = 8,\n ...props\n}: Omit<MenuContentProps, \"anchor\">) {\n return (\n <BaseContextMenu.Portal>\n <BaseContextMenu.Positioner\n data-kit=\"menu-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={collisionPadding}\n >\n <BaseContextMenu.Popup data-kit=\"menu\" {...props} />\n </BaseContextMenu.Positioner>\n </BaseContextMenu.Portal>\n );\n}\n","import { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { Icon } from \"@x12i/icons\";\nimport type { ReactNode } from \"react\";\nimport type { StatusTone } from \"../types\";\nimport { toneIcons } from \"./alert\";\nimport { IconButton } from \"./icon-button\";\nimport { Spinner } from \"./spinner\";\n\nexport type ToastPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\";\n\nexport interface ToastOptions {\n title?: ReactNode;\n description?: ReactNode;\n tone?: StatusTone;\n /** Milliseconds before it closes itself. `0` keeps it until dismissed. Defaults to the provider's. */\n timeout?: number;\n /** `high` is announced assertively (use it for errors); `low` waits politely. */\n priority?: \"low\" | \"high\";\n /** One optional action, for example \"Undo\". */\n action?: { label: string; onClick: () => void };\n onClose?: () => void;\n}\n\nexport interface ToastProviderProps {\n children: ReactNode;\n /** Name of the dismiss button on each toast, for example \"Dismiss notification\". */\n closeLabel: string;\n /** Name of the region that holds the toasts, for example \"Notifications\". */\n regionLabel: string;\n /** Default milliseconds before a toast closes. Defaults to 5000. */\n timeout?: number;\n /** Most toasts shown at once. Defaults to 3. */\n limit?: number;\n placement?: ToastPlacement;\n}\n\nconst tones: ReadonlySet<string> = new Set<StatusTone>([\n \"neutral\",\n \"accent\",\n \"success\",\n \"warning\",\n \"danger\",\n \"info\",\n]);\n\n/** Base UI names the failed outcome of a promise toast `error`; this kit calls it `danger`. */\nfunction toneOf(type: string | undefined): StatusTone {\n if (type === \"error\") return \"danger\";\n return type && tones.has(type) ? (type as StatusTone) : \"neutral\";\n}\n\nfunction ToastList({ closeLabel }: { closeLabel: string }) {\n const { toasts } = BaseToast.useToastManager();\n return (\n <>\n {toasts.map((toast) => {\n // `loading` is the type Base UI gives the first stage of a promise toast.\n const loading = toast.type === \"loading\";\n const tone = toneOf(toast.type);\n return (\n <BaseToast.Root\n key={toast.id}\n toast={toast}\n data-kit=\"toast\"\n data-tone={tone}\n data-loading={loading ? \"\" : undefined}\n >\n <span data-kit-slot=\"toast-icon\" aria-hidden=\"true\">\n {loading ? <Spinner size=\"sm\" /> : <Icon name={toneIcons[tone]} size={20} />}\n </span>\n <BaseToast.Content data-kit-slot=\"toast-content\">\n {toast.title ? <BaseToast.Title data-kit-slot=\"toast-title\" /> : null}\n {toast.description ? <BaseToast.Description data-kit-slot=\"toast-description\" /> : null}\n {toast.actionProps ? <BaseToast.Action data-kit-slot=\"toast-action\" /> : null}\n </BaseToast.Content>\n <BaseToast.Close\n data-kit-slot=\"toast-close\"\n // Base UI hides the button while a stack of toasts is collapsed. This\n // kit lays toasts out in a list, so the button is always available.\n aria-hidden={false}\n render={\n <IconButton label={closeLabel} variant=\"ghost\" tone=\"neutral\" size=\"sm\">\n <Icon name=\"close\" />\n </IconButton>\n }\n />\n </BaseToast.Root>\n );\n })}\n </>\n );\n}\n\n/**\n * Hosts transient messages. Toasts pause while hovered or focused, are\n * announced through a live region, and can be dismissed from the keyboard\n * (F6 jumps to the region). Do not put anything essential in a toast: it\n * disappears. Use `Alert` for messages that must stay.\n */\nexport function ToastProvider({\n children,\n closeLabel,\n regionLabel,\n timeout = 5000,\n limit = 3,\n placement = \"bottom-end\",\n}: ToastProviderProps) {\n return (\n <BaseToast.Provider timeout={timeout} limit={limit}>\n {children}\n <BaseToast.Portal>\n <BaseToast.Viewport\n data-kit=\"toast-viewport\"\n data-placement={placement}\n aria-label={regionLabel}\n >\n <ToastList closeLabel={closeLabel} />\n </BaseToast.Viewport>\n </BaseToast.Portal>\n </BaseToast.Provider>\n );\n}\n\nexport interface ToastApi {\n /** Shows a toast and returns its id. */\n show: (options: ToastOptions) => string;\n update: (id: string, options: ToastOptions) => void;\n close: (id?: string) => void;\n /**\n * Shows a loading toast and updates it when the promise settles. The tone\n * follows the outcome (success or danger), so the messages take no `tone`.\n * The returned promise settles like the one passed in, so a rejection must\n * still be handled by the caller.\n */\n promise: <Value>(\n promise: Promise<Value>,\n messages: {\n loading: PromiseToastMessage;\n success: PromiseToastMessage | ((value: Value) => PromiseToastMessage);\n error: PromiseToastMessage | ((error: unknown) => PromiseToastMessage);\n },\n ) => Promise<Value>;\n}\n\nexport type PromiseToastMessage = Omit<ToastOptions, \"tone\">;\n\nfunction toManagerOptions(options: ToastOptions) {\n const { tone, action, ...rest } = options;\n return {\n ...rest,\n ...(tone ? { type: tone } : {}),\n ...(action ? { actionProps: { children: action.label, onClick: action.onClick } } : {}),\n };\n}\n\n/** Read the toast API anywhere under `ToastProvider`. */\nexport function useToast(): ToastApi {\n const manager = BaseToast.useToastManager();\n return {\n show: (options) => manager.add(toManagerOptions(options)),\n update: (id, options) => manager.update(id, toManagerOptions(options)),\n close: (id) => manager.close(id),\n promise: (promise, messages) =>\n manager.promise(promise, {\n loading: toManagerOptions(messages.loading),\n success: (value) =>\n toManagerOptions(typeof messages.success === \"function\" ? messages.success(value) : messages.success),\n error: (error) =>\n toManagerOptions(typeof messages.error === \"function\" ? messages.error(error) : messages.error),\n }),\n };\n}\n","import { Icon } from \"@x12i/icons\";\nimport type { ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { ButtonGroup } from \"./button-group\";\nimport { IconButton } from \"./icon-button\";\nimport { Menu, MenuContent, MenuTrigger } from \"./menu\";\n\nexport interface SplitButtonProps\n extends Pick<ButtonProps, \"variant\" | \"tone\" | \"size\" | \"disabled\" | \"loading\" | \"loadingLabel\" | \"onClick\" | \"type\"> {\n /** The primary action's label. */\n children: ReactNode;\n /** Name of the arrow button that opens the other actions, for example \"More actions\". */\n menuLabel: string;\n /** The other actions: `MenuItem`s. */\n menu: ReactNode;\n}\n\n/**\n * A primary action with a menu of related ones, for example \"Save\" with \"Save\n * as draft\" and \"Save and close\". The two parts are separate tab stops, so\n * the primary action stays one keypress away.\n */\nexport function SplitButton({\n children,\n menuLabel,\n menu,\n variant = \"solid\",\n tone = \"accent\",\n size = \"md\",\n disabled,\n loading,\n loadingLabel,\n onClick,\n type,\n}: SplitButtonProps) {\n return (\n <ButtonGroup data-kit-split=\"\">\n <Button\n variant={variant}\n tone={tone}\n size={size}\n disabled={disabled}\n loading={loading}\n loadingLabel={loadingLabel}\n onClick={onClick}\n type={type}\n >\n {children}\n </Button>\n <Menu>\n <MenuTrigger\n disabled={disabled || loading}\n render={\n <IconButton label={menuLabel} variant={variant} tone={tone} size={size}>\n <Icon name=\"chevron-down\" />\n </IconButton>\n }\n />\n <MenuContent align=\"end\">{menu}</MenuContent>\n </Menu>\n </ButtonGroup>\n );\n}\n","import {\r\n DENSITY_ATTRIBUTE,\r\n DENSITY_STORAGE_KEY,\r\n densityNames,\r\n type DensityName,\r\n} from \"@x12i/tokens\";\r\nimport {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n type ComponentPropsWithRef,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { usePersistedChoice } from \"../utils/use-persisted-choice\";\r\n\r\nexport interface DensityContextValue {\r\n density: DensityName;\r\n setDensity: (density: DensityName) => void;\r\n}\r\n\r\nconst DensityContext = createContext<DensityContextValue | null>(null);\r\n\r\nfunction isDensity(value: string): value is DensityName {\r\n return (densityNames as readonly string[]).includes(value);\r\n}\r\n\r\nexport interface DensityProviderProps\r\n extends Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> {\r\n children?: ReactNode;\r\n /** Controlled density. */\r\n density?: DensityName;\r\n defaultDensity?: DensityName;\r\n onDensityChange?: (density: DensityName) => void;\r\n /**\r\n * `root` sets `data-density` on `<html>` and renders no wrapper element.\r\n * `subtree` (default) renders a wrapper that scopes the density to its children.\r\n */\r\n scope?: \"root\" | \"subtree\";\r\n /**\r\n * localStorage key that remembers the choice, or `null` for none. Defaults\r\n * to the shared key for `root` and to none for `subtree`.\r\n */\r\n storageKey?: string | null;\r\n}\r\n\r\n/** Compact, default and comfortable density from one set of components. */\r\nexport function DensityProvider({\r\n children,\r\n density: densityProp,\r\n defaultDensity = \"default\",\r\n onDensityChange,\r\n scope = \"subtree\",\r\n storageKey,\r\n className,\r\n ...props\r\n}: DensityProviderProps) {\r\n const [density, setDensity] = usePersistedChoice<DensityName>({\r\n value: densityProp,\r\n defaultValue: defaultDensity,\r\n onChange: onDensityChange,\r\n storageKey:\r\n storageKey === undefined ? (scope === \"root\" ? DENSITY_STORAGE_KEY : null) : storageKey,\r\n isValid: isDensity,\r\n });\r\n\r\n useEffect(() => {\r\n if (scope !== \"root\") return;\r\n const root = document.documentElement;\r\n const previous = root.getAttribute(DENSITY_ATTRIBUTE);\r\n root.setAttribute(DENSITY_ATTRIBUTE, density);\r\n return () => {\r\n if (previous === null) root.removeAttribute(DENSITY_ATTRIBUTE);\r\n else root.setAttribute(DENSITY_ATTRIBUTE, previous);\r\n };\r\n }, [scope, density]);\r\n\r\n const value = useMemo<DensityContextValue>(\r\n () => ({ density, setDensity }),\r\n [density, setDensity],\r\n );\r\n\r\n return (\r\n <DensityContext value={value}>\r\n {scope === \"root\" ? (\r\n children\r\n ) : (\r\n <div\r\n data-kit=\"density-provider\"\r\n {...{ [DENSITY_ATTRIBUTE]: density }}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n {children}\r\n </div>\r\n )}\r\n </DensityContext>\r\n );\r\n}\r\n\r\n/** Reads and changes the density of the nearest `DensityProvider`. */\r\nexport function useDensity(): DensityContextValue {\r\n const context = useContext(DensityContext);\r\n if (context === null) {\r\n throw new Error(\"useDensity must be used inside a DensityProvider.\");\r\n }\r\n return context;\r\n}\r\n","import { useCallback, useEffect, useState } from \"react\";\r\n\r\nfunction read(key: string): string | null {\r\n try {\r\n return window.localStorage.getItem(key);\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\nfunction write(key: string, value: string) {\r\n try {\r\n window.localStorage.setItem(key, value);\r\n } catch {\r\n // Storage can be blocked (private mode, sandboxed frames). Ignore.\r\n }\r\n}\r\n\r\ninterface Options<T extends string> {\r\n value: T | undefined;\r\n defaultValue: T;\r\n onChange: ((value: T) => void) | undefined;\r\n /** localStorage key, or null to skip persistence. */\r\n storageKey: string | null;\r\n /** Must be a stable function (declare it at module level). */\r\n isValid: (value: string) => value is T;\r\n}\r\n\r\n/**\r\n * Controlled or uncontrolled state with optional persistence. The stored value\r\n * is read after mount, so server and first client render always agree.\r\n */\r\nexport function usePersistedChoice<T extends string>({\r\n value: controlled,\r\n defaultValue,\r\n onChange,\r\n storageKey,\r\n isValid,\r\n}: Options<T>) {\r\n const isControlled = controlled !== undefined;\r\n const [internal, setInternal] = useState<T>(defaultValue);\r\n\r\n useEffect(() => {\r\n if (isControlled || storageKey === null) return;\r\n const stored = read(storageKey);\r\n if (stored !== null && isValid(stored)) setInternal(stored);\r\n }, [isControlled, storageKey, isValid]);\r\n\r\n const setValue = useCallback(\r\n (next: T) => {\r\n if (!isControlled) setInternal(next);\r\n if (storageKey !== null) write(storageKey, next);\r\n onChange?.(next);\r\n },\r\n [isControlled, storageKey, onChange],\r\n );\r\n\r\n return [isControlled ? controlled : internal, setValue] as const;\r\n}\r\n","import {\r\n THEME_ATTRIBUTE,\r\n THEME_STORAGE_KEY,\r\n themeNames,\r\n type ThemeName,\r\n} from \"@x12i/tokens\";\r\nimport {\r\n createContext,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useSyncExternalStore,\r\n type ComponentPropsWithRef,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { cx } from \"../utils/cx\";\r\nimport { usePersistedChoice } from \"../utils/use-persisted-choice\";\r\n\r\n/** A theme name, or `system` to follow the operating system preference. */\r\nexport type ThemeChoice = ThemeName | \"system\";\r\n\r\nexport interface ThemeContextValue {\r\n /** The user's choice, which can be `system`. */\r\n theme: ThemeChoice;\r\n /** The theme in effect. `system` resolves to `light` or `dark`. */\r\n resolvedTheme: ThemeName;\r\n setTheme: (theme: ThemeChoice) => void;\r\n}\r\n\r\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\r\n\r\nconst DARK_QUERY = \"(prefers-color-scheme: dark)\";\r\n\r\nfunction subscribeToSystemTheme(onChange: () => void) {\r\n const query = window.matchMedia(DARK_QUERY);\r\n query.addEventListener(\"change\", onChange);\r\n return () => query.removeEventListener(\"change\", onChange);\r\n}\r\n\r\nconst prefersDark = () => window.matchMedia(DARK_QUERY).matches;\r\n// The server cannot know; light matches the CSS fallback.\r\nconst serverPrefersDark = () => false;\r\n\r\nfunction isThemeChoice(value: string): value is ThemeChoice {\r\n return value === \"system\" || (themeNames as readonly string[]).includes(value);\r\n}\r\n\r\nexport interface ThemeProviderProps\r\n extends Omit<ComponentPropsWithRef<\"div\">, \"children\" | \"onChange\"> {\r\n children?: ReactNode;\r\n /** Controlled theme. */\r\n theme?: ThemeChoice;\r\n /** Initial theme when uncontrolled. Defaults to following the system. */\r\n defaultTheme?: ThemeChoice;\r\n onThemeChange?: (theme: ThemeChoice) => void;\r\n /**\r\n * `root` sets `data-theme` on `<html>` and renders no wrapper element.\r\n * `subtree` (default) renders a wrapper that scopes the theme to its children.\r\n */\r\n scope?: \"root\" | \"subtree\";\r\n /**\r\n * localStorage key that remembers the choice, or `null` for none. Defaults\r\n * to the shared key for `root` and to none for `subtree`.\r\n */\r\n storageKey?: string | null;\r\n}\r\n\r\n/**\r\n * Sets the theme for the page or for a subtree. Pair a `root` provider with\r\n * `getNoFlashScript()` from `@x12i/themes` to avoid a flash on first paint.\r\n */\r\nexport function ThemeProvider({\r\n children,\r\n theme: themeProp,\r\n defaultTheme = \"system\",\r\n onThemeChange,\r\n scope = \"subtree\",\r\n storageKey,\r\n className,\r\n ...props\r\n}: ThemeProviderProps) {\r\n const [theme, setTheme] = usePersistedChoice<ThemeChoice>({\r\n value: themeProp,\r\n defaultValue: defaultTheme,\r\n onChange: onThemeChange,\r\n storageKey: storageKey === undefined ? (scope === \"root\" ? THEME_STORAGE_KEY : null) : storageKey,\r\n isValid: isThemeChoice,\r\n });\r\n\r\n const systemIsDark = useSyncExternalStore(subscribeToSystemTheme, prefersDark, serverPrefersDark);\r\n const resolvedTheme: ThemeName = theme === \"system\" ? (systemIsDark ? \"dark\" : \"light\") : theme;\r\n\r\n // `system` leaves the attribute off so the CSS media query decides.\r\n const attribute = theme === \"system\" ? undefined : theme;\r\n\r\n useEffect(() => {\r\n if (scope !== \"root\") return;\r\n const root = document.documentElement;\r\n const previous = root.getAttribute(THEME_ATTRIBUTE);\r\n if (attribute === undefined) root.removeAttribute(THEME_ATTRIBUTE);\r\n else root.setAttribute(THEME_ATTRIBUTE, attribute);\r\n return () => {\r\n if (previous === null) root.removeAttribute(THEME_ATTRIBUTE);\r\n else root.setAttribute(THEME_ATTRIBUTE, previous);\r\n };\r\n }, [scope, attribute]);\r\n\r\n const value = useMemo<ThemeContextValue>(\r\n () => ({ theme, resolvedTheme, setTheme }),\r\n [theme, resolvedTheme, setTheme],\r\n );\r\n\r\n return (\r\n <ThemeContext value={value}>\r\n {scope === \"root\" ? (\r\n children\r\n ) : (\r\n <div\r\n data-kit=\"theme-provider\"\r\n {...{ [THEME_ATTRIBUTE]: attribute }}\r\n className={cx(className)}\r\n {...props}\r\n >\r\n {children}\r\n </div>\r\n )}\r\n </ThemeContext>\r\n );\r\n}\r\n\r\n/** Reads and changes the theme of the nearest `ThemeProvider`. */\r\nexport function useTheme(): ThemeContextValue {\r\n const context = useContext(ThemeContext);\r\n if (context === null) {\r\n throw new Error(\"useTheme must be used inside a ThemeProvider.\");\r\n }\r\n return context;\r\n}\r\n"],"mappings":";;;AACO,SAAS,MAAM,QAAsE;AAC1F,QAAM,SAAS,OAAO,OAAO,OAAO,EAAE,KAAK,GAAG;AAC9C,SAAO,WAAW,KAAK,SAAY;AACrC;;;ACiBI;AARG,SAAS,MAAM;AAAA,EACpB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAe;AACb,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAS;AAAA,MACT,gBAAc;AAAA,MACd,aAAW;AAAA,MACX,aAAW;AAAA,MACX,WAAW,GAAG,SAAS;AAAA,MACtB,GAAG;AAAA;AAAA,EAC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Ae;AAAA,QAC5D,MAAK,aAAa,iBAAiB,SAAS;AACjD,WAAO,MAAM;AACX,UAAI,aAAa,KAAM,MAAK,gBAAgB,eAAe;AAAA,UACtD,MAAK,aAAa,iBAAiB,QAAQ;AAAA,IAClD;AAAA,EACF,GAAG,CAAC,OAAO,SAAS,CAAC;AAErB,QAAM,QAAQC;AAAA,IACZ,OAAO,EAAE,OAAO,eAAe,SAAS;AAAA,IACxC,CAAC,OAAO,eAAe,QAAQ;AAAA,EACjC;AAEA,SACE,gBAAAH,MAAC,gBAAa,OACX,oBAAU,SACT,WAEA,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,YAAS;AAAA,MACR,GAAG,EAAE,CAAC,eAAe,GAAG,UAAU;AAAA,MACnC,WAAW,GAAG,SAAS;AAAA,MACtB,GAAG;AAAA,MAEH;AAAA;AAAA,EACH,GAEJ;AAEJ;AAGO,SAAS,WAA8B;AAC5C,QAAM,UAAUI,YAAW,YAAY;AACvC,MAAI,YAAY,MAAM;AACpB,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE;AACA,SAAO;AACT;","names":["jsx","jsx","jsx","jsxs","jsx","jsx","Fragment","jsx","jsxs","jsx","jsxs","Icon","Fragment","jsx","jsxs","Icon","jsx","Icon","Fragment","jsx","jsxs","jsx","jsxs","Icon","Icon","useId","useRef","Fragment","jsx","jsxs","jsx","jsxs","Icon","useState","jsx","jsxs","useState","Icon","Icon","jsx","jsxs","useId","Fragment","jsx","jsxs","useId","jsx","Icon","Fragment","jsx","jsxs","jsx","jsxs","jsx","BaseField","jsx","jsx","jsx","Icon","jsx","jsxs","Icon","jsx","jsxs","BaseProgress","jsx","jsxs","useEffect","useRef","useState","jsx","jsxs","useState","useRef","useEffect","jsx","jsx","jsxs","jsx","Children","jsx","jsxs","Icon","jsx","jsxs","Icon","jsx","jsxs","Icon","jsx","jsx","jsxs","Icon","jsx","jsxs","jsx","jsxs","Icon","jsx","jsxs","Icon","Icon","jsx","jsxs","Icon","jsx","jsxs","BaseRadio","BaseRadioGroup","jsx","Icon","jsx","jsxs","Icon","jsx","Icon","jsx","jsxs","Icon","Icon","jsx","jsxs","Icon","jsx","jsxs","useId","useState","jsx","jsxs","Icon","jsx","jsxs","Icon","Fragment","jsx","jsxs","Icon","Icon","jsx","jsxs","Icon","useEffect","useMemo","useCallback","useEffect","useState","jsx","useEffect","useMemo","createContext","useContext","useEffect","useMemo","jsx","createContext","useEffect","useMemo","useContext"]}