@kb.ui/react 0.0.0-stage → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +767 -2
- package/dist/check-versions.js +34 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Callout/Callout.d.ts +19 -0
- package/dist/components/Card/Card.d.ts +12 -0
- package/dist/components/Checkbox/Checkbox.d.ts +23 -0
- package/dist/components/Code/Code.d.ts +3 -0
- package/dist/components/Combobox/Combobox.d.ts +65 -0
- package/dist/components/Container/Container.d.ts +14 -0
- package/dist/components/Dialog/Dialog.d.ts +50 -0
- package/dist/components/ErrorSummary/ErrorSummary.d.ts +28 -0
- package/dist/components/Fieldset/Fieldset.d.ts +17 -0
- package/dist/components/FileInput/FileInput.d.ts +59 -0
- package/dist/components/FormActions/FormActions.d.ts +10 -0
- package/dist/components/Grid/Grid.d.ts +12 -0
- package/dist/components/Heading/Heading.d.ts +293 -0
- package/dist/components/Inline/Inline.d.ts +14 -0
- package/dist/components/Input/Input.d.ts +25 -0
- package/dist/components/Link/Link.d.ts +6 -0
- package/dist/components/Menu/Menu.d.ts +34 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +67 -0
- package/dist/components/NumberField/NumberField.d.ts +53 -0
- package/dist/components/Panel/Panel.d.ts +75 -0
- package/dist/components/Progress/Progress.d.ts +17 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +45 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +17 -0
- package/dist/components/Select/Select.d.ts +39 -0
- package/dist/components/Separator/Separator.d.ts +9 -0
- package/dist/components/Split/Split.d.ts +20 -0
- package/dist/components/Stat/Stat.d.ts +15 -0
- package/dist/components/Status/Status.d.ts +22 -0
- package/dist/components/Switch/Switch.d.ts +41 -0
- package/dist/components/Text/Text.d.ts +15 -0
- package/dist/components/Textarea/Textarea.d.ts +24 -0
- package/dist/components/Toolbar/Toolbar.d.ts +31 -0
- package/dist/components/Tooltip/Tooltip.d.ts +20 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1770 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/utils/kb.d.ts +11 -0
- package/dist/utils/layout.d.ts +10 -0
- package/package.json +53 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Base","Base","Base","defaultRemoveLabel","_Fragment","BaseInput","Base","Separator","Base","Base","Base","BaseGroup","Base","Base","Base","Base","Button$1","Combobox$1","Dialog$1","Input$1","Menu$1","Separator$1","NumberField$1","Progress$1","RadioGroup$1","ScrollArea$1","Select$1","Toolbar$1","Tooltip$1","kb","out","clsx","name","className","key","value","attrs","resolveInvalid","hasAria","ariaInvalid","invalid","hasError","Badge","props","preserveCase","Button","Callout","live","icon","classNames","title","actions","Card","createElement","as","Checkbox","providedId","callerAriaInvalid","generated","useId","id","input","useRef","useImperativeHandle","ref","useLayoutEffect","indeterminate","error","described","description","theme","style","property","checked","readOnly","controlClassName","disabled","onCheckedChange","event","visuallyHidden","label","Code","Combobox","forwardRef","ariaDescribedBy","rest","uid","rootRef","inputId","labelId","descId","errId","isInvalid","hasDescription","describedBy","collection","useMemo","options","o","validValue","onValueChange","next","clearLabel","toggleLabel","container","option","emptyMessage","Container","gutter","DialogRoot","DialogTrigger","DialogClose","DialogTitle","DialogDescription","DialogActions","DialogHeader","DialogBody","DialogFooter","DialogContent","children","Dialog","FOCUSABLE_CHILD_SELECTOR","focusTargetByHref","href","rawId","targetId","element","doc","focusTarget","ErrorSummary","ariaLabelledBy","reactId","items","baseId","titleId","descriptionId","labelledBy","HeadingTag","headingLevel","seenKeys","baseKey","item","occurrence","itemKey","onItemSelect","Fieldset","errorId","legend","defaultRemoveLabel$1","defaultRemovedMessage","defaultSelectionMessage","count","FileInput","callerDescription","trigger","removeButtons","pending","announcement","setAnnouncement","useState","inputRef","triggerRef","blocked","request","active","removedMessage","onBlurCapture","control","files","onFiles","selectionMessage","triggerClassName","chooseLabel","listClassName","itemClassName","renderItem","Fragment","node","removeLabel","onRemove","FormActions","Grid","sizes","Heading","level","Inline","Input","Field","startContent","endContent","Link","PointerFocus","createContext","MenuRoot","pointerFocus","setPointerFocus","useEffect","keyboard","details","onOpenChange","open","MenuTrigger","useContext","MenuContent","MenuItem","MenuSeparator","Menu","defaultRemoveLabel","chipAriaReset","MultiSelect","optionMap","selectedValues","v","idx","selectedOptions","NumberField","inputProps","step","groupClassName","decrementLabel","inputClassName","incrementLabel","NestedContext","CollapsibleContext","DirectionContext","paneBefore","handle","PanelRoot","content","collapsible","rail","Collapsible","defaultOpen","PanelHeader","PanelToolbar","PanelBody","merged","jsx","PanelFooter","PanelWell","PanelToggle","PanelGroup","direction","PanelHandle","row","clamp","max","min","inner","setInner","defaultSize","current","size","controls","setControls","dragging","setDragging","restore","fallbackId","target","commit","onSizeChange","keys","handleKeyDown","handlePointerDown","onPointerDown","handlePointerMove","group","start","offset","length","endDrag","onPointerUp","onPointerCancel","Panel","Progress","valueText","formatted","EntryContext","RadioOptions","track","selection","setSelection","segmented","measure","resize","observeItems","changes","RadioControl","entry","update","remove","eligible","customTabIndex","tabIndex","RadioGroupRoot","focused","inside","setInside","markFocused","useCallback","entries","setEntries","previous","data","onFocusCapture","selectionMotion","selectionTone","appearance","RadioGroupItem","Radio","controlProps","state","RadioGroup","ScrollArea","vars","maxHeight","Select","root","popup","interaction","empty","inactive","help","popupClassName","Separator","decorative","orientation","Split","trackClassName","Children","child","Stat","Status","Switch","rootStyle","offColor","onColor","resolvedOffTone","offTone","resolvedOnTone","onTone","tone","controlId","descriptions","offIcon","onIcon","Text","Textarea","onChange","ToolbarRoot","ToolbarGroup","ToolbarButton","ToolbarSeparator","Toolbar","Tooltip"],"sources":["../src/utils/kb.ts","../src/components/Badge/Badge.tsx","../src/components/Button/Button.tsx","../src/components/Callout/Callout.tsx","../src/components/Card/Card.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Code/Code.tsx","../src/components/Combobox/Combobox.tsx","../src/components/Container/Container.tsx","../src/components/Dialog/Dialog.tsx","../src/components/ErrorSummary/ErrorSummary.tsx","../src/components/Fieldset/Fieldset.tsx","../src/components/FileInput/FileInput.tsx","../src/components/FormActions/FormActions.tsx","../src/components/Grid/Grid.tsx","../src/components/Heading/Heading.tsx","../src/components/Inline/Inline.tsx","../src/components/Input/Input.tsx","../src/components/Link/Link.tsx","../src/components/Menu/Menu.tsx","../src/components/MultiSelect/MultiSelect.tsx","../src/components/NumberField/NumberField.tsx","../src/components/Panel/Panel.tsx","../src/components/Progress/Progress.tsx","../src/components/RadioGroup/RadioGroup.tsx","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Select/Select.tsx","../src/components/Separator/Separator.tsx","../src/components/Split/Split.tsx","../src/components/Stat/Stat.tsx","../src/components/Status/Status.tsx","../src/components/Switch/Switch.tsx","../src/components/Text/Text.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Toolbar/Toolbar.tsx","../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import { clsx } from \"clsx\";\n\nexport type KbAttrs = Record<string, string | boolean | undefined>;\n// Extra classes per inner part, applied after kbui's own class.\nexport type ClassNames<Slot extends string> = Partial<Record<Slot, string>>;\nexport type KbProps = { className: string } & Record<`data-${string}`, string>;\nexport type AriaInvalid = boolean | \"false\" | \"true\" | \"grammar\" | \"spelling\" | undefined;\n\n// false/undefined vanish so data-disabled=\"false\" can never leak into the DOM.\nexport function kb(name: string, attrs: KbAttrs = {}, className?: string): KbProps {\n const out: KbProps = { className: clsx(`kb-${name}`, className) };\n for (const [key, value] of Object.entries(attrs)) {\n if (value === undefined || value === false) continue;\n out[`data-${key}`] = value === true ? \"\" : value;\n }\n return out;\n}\n\n// Preserves caller aria-invalid tokens (e.g. \"grammar\") while syncing wrapper data-invalid.\nexport function resolveInvalid(\n hasError: boolean,\n ariaInvalid?: AriaInvalid,\n): { invalid: boolean; ariaInvalid: AriaInvalid } {\n const hasAria = ariaInvalid !== undefined && ariaInvalid !== false && ariaInvalid !== \"false\";\n const invalid = hasError || hasAria;\n return { invalid, ariaInvalid: hasAria ? ariaInvalid : invalid ? true : ariaInvalid };\n}\n","import type { ComponentProps } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type BadgeTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\nexport type BadgeAppearance = \"chip\" | \"plain\";\n\n/** Static metadata label; use Status for a state that changes. */\nexport type BadgeProps = ComponentProps<\"span\"> & {\n /** Ink and tint. */\n tone?: BadgeTone;\n /** Chip draws a tinted ring; plain is inline text. */\n appearance?: BadgeAppearance;\n /** Small uppercase monospace, for identifiers and roles. */\n mono?: boolean;\n /** Keep the text's case and spacing, for case-sensitive values such as branches and paths. */\n preserveCase?: boolean;\n};\n\nexport function Badge({\n tone = \"neutral\",\n appearance = \"chip\",\n mono = false,\n preserveCase = false,\n className,\n ...props\n}: BadgeProps) {\n return (\n <span\n {...props}\n {...kb(\"badge\", { tone, appearance, mono, \"preserve-case\": preserveCase }, className)}\n />\n );\n}\n","import { Button as Base } from \"@base-ui/react/button\";\nimport { kb } from \"../../utils/kb\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\nexport type ButtonSize = \"sm\" | \"md\" | \"lg\" | \"icon\";\n\ntype ButtonBaseProps = Omit<Base.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Action emphasis: primary main, secondary supporting, ghost quiet, danger destructive. */\n variant?: ButtonVariant;\n};\n\n/** Navigation use: pass render={<a href/>} nativeButton={false} role=\"link\". Icon size needs aria-label. */\nexport type ButtonProps = ButtonBaseProps &\n (\n | {\n /** Height and padding scale; icon is a square for a lone icon. */\n size?: Exclude<ButtonSize, \"icon\">;\n }\n | { size: \"icon\"; \"aria-label\": string }\n );\n\nexport function Button({ variant = \"primary\", size = \"md\", className, ...props }: ButtonProps) {\n return <Base {...props} {...kb(\"button\", { variant, size }, className)} />;\n}\n","import { clsx } from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\nexport type CalloutTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\n/** Inline message with optional actions; text carries the meaning, tone only reinforces it. */\nexport type CalloutProps = Omit<ComponentProps<\"div\">, \"title\"> & {\n /** Ink of the edge, tint and icon. */\n tone?: CalloutTone;\n /** Short heading line. */\n title?: ReactNode;\n /** Caller-provided decorative icon. */\n icon?: ReactNode;\n /** Buttons that resolve the message. */\n actions?: ReactNode;\n /** Announce changes: adds role=\"status\" and nothing else. */\n live?: boolean;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"icon\" | \"content\" | \"title\" | \"body\" | \"actions\">;\n};\n\nexport function Callout({\n classNames,\n tone = \"neutral\",\n title,\n icon,\n actions,\n live = false,\n className,\n children,\n ...props\n}: CalloutProps) {\n return (\n <div {...props} {...(live ? { role: \"status\" } : {})} {...kb(\"callout\", { tone }, className)}>\n {icon != null ? (\n <span className={clsx(\"kb-callout-icon\", classNames?.icon)} aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <div className={clsx(\"kb-callout-content\", classNames?.content)}>\n {title != null ? (\n <div className={clsx(\"kb-callout-title\", classNames?.title)}>{title}</div>\n ) : null}\n <div className={clsx(\"kb-callout-body\", classNames?.body)}>{children}</div>\n {actions != null ? (\n <div className={clsx(\"kb-callout-actions\", classNames?.actions)}>{actions}</div>\n ) : null}\n </div>\n </div>\n );\n}\n","import { type ComponentProps, createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\ntype Container = \"article\" | \"div\" | \"li\";\nexport type CardProps<T extends Container = \"article\"> = ComponentProps<T> & {\n /** Semantic container; links and controls stay caller-owned. */\n as?: T;\n /** Outlined surface or unstyled list content. */\n appearance?: \"outlined\" | \"plain\";\n};\n\nexport function Card<T extends Container = \"article\">({\n as,\n appearance = \"outlined\",\n className,\n ...props\n}: CardProps<T>) {\n return createElement(as ?? \"article\", { ...props, ...kb(\"card\", { appearance }, className) });\n}\n","import { clsx } from \"clsx\";\nimport { type ComponentProps, useId, useImperativeHandle, useLayoutEffect, useRef } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\nexport type CheckboxProps = Omit<\n ComponentProps<\"input\">,\n \"type\" | \"checked\" | \"defaultChecked\" | \"onChange\" | \"size\"\n> & {\n /** Visible accessible label. */\n label: string;\n /** Controlled checked state. */\n checked: boolean;\n /** Receives next checked state; mixed resolves to checked. */\n onCheckedChange: (checked: boolean) => void;\n /** Announce a mixed aggregate selection. */\n indeterminate?: boolean;\n /** Hide label text visually. */\n visuallyHidden?: boolean;\n /** Helper text associated with the input. */\n description?: string;\n /** Visible error; marks the input invalid. */\n error?: string;\n /** Class on the native input slot. */\n controlClassName?: string;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\n \"control\" | \"label\" | \"mark\" | \"tick\" | \"mixed\" | \"description\" | \"error\"\n >;\n};\nexport function Checkbox({\n classNames,\n label,\n checked,\n onCheckedChange,\n indeterminate = false,\n visuallyHidden,\n description,\n error,\n disabled,\n readOnly,\n className,\n controlClassName,\n id: providedId,\n ref,\n style,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: CheckboxProps) {\n const generated = useId();\n const id = providedId ?? generated;\n const input = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => input.current as HTMLInputElement);\n useLayoutEffect(() => {\n if (input.current) input.current.indeterminate = indeterminate;\n });\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const described =\n [\n description ? `${id}-description` : null,\n error ? `${id}-error` : null,\n props[\"aria-describedby\"],\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n const theme = Object.fromEntries(\n Object.entries(style ?? {}).filter(([property]) => property.startsWith(\"--\")),\n );\n return (\n <div {...kb(\"checkbox\", { disabled, invalid }, className)} style={theme}>\n <input\n {...props}\n style={style}\n id={id}\n ref={input}\n type=\"checkbox\"\n checked={checked}\n aria-checked={indeterminate ? \"mixed\" : checked}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly || undefined}\n aria-invalid={ariaInvalid}\n aria-describedby={described}\n className={clsx(\"kb-checkbox-control\", classNames?.control, controlClassName)}\n onChange={(event) => {\n event.target.indeterminate = indeterminate;\n if (!disabled && !readOnly) onCheckedChange(indeterminate ? true : event.target.checked);\n }}\n />\n <span className={clsx(\"kb-checkbox-mark\", classNames?.mark)} aria-hidden=\"true\">\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <path className={clsx(\"kb-checkbox-tick\", classNames?.tick)} d=\"m3 8 3 3 7-7\" />\n <path className={clsx(\"kb-checkbox-mixed\", classNames?.mixed)} d=\"M3 8h10\" />\n </svg>\n </span>\n <label\n htmlFor={id}\n className={clsx(\"kb-checkbox-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n >\n {label}\n </label>\n {description && (\n <p\n id={`${id}-description`}\n className={clsx(\"kb-checkbox-description\", classNames?.description)}\n >\n {description}\n </p>\n )}\n {error && (\n <p id={`${id}-error`} className={clsx(\"kb-checkbox-error\", classNames?.error)}>\n {error}\n </p>\n )}\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type CodeProps = ComponentProps<\"code\">;\n\nexport function Code({ className, ...props }: CodeProps) {\n return <code {...props} {...kb(\"code\", {}, className)} />;\n}\n","import { Combobox as Base } from \"@base-ui/react/combobox\";\nimport { clsx } from \"clsx\";\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\n/** Single selectable option in a Combobox list. */\nexport interface ComboboxOption {\n /** Option value committed to `onValueChange`. */\n value: string;\n /** Visible option label used for display and filtering. */\n label: string;\n /** Prevent selecting this option while keeping it visible. */\n disabled?: boolean;\n}\n\n/** Styleable inner anatomy slots of Combobox. */\nexport type ComboboxSlot =\n | \"label\"\n | \"shell\"\n | \"input\"\n | \"actions\"\n | \"clear\"\n | \"trigger\"\n | \"positioner\"\n | \"popup\"\n | \"list\"\n | \"option\"\n | \"optionIndicator\"\n | \"optionLabel\"\n | \"empty\"\n | \"description\"\n | \"error\";\n\n/** Props for the searchable single-select Combobox component. */\nexport interface ComboboxProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"defaultValue\" | \"onChange\"> {\n /** Visible label naming the combobox input. */\n label: string;\n /** Selectable options shown and filtered in the popup list. */\n options: readonly ComboboxOption[];\n /** Selected option value, or `null` when nothing is selected. */\n value: string | null;\n /** Called when the user selects or clears an option. */\n onValueChange: (value: string | null) => void;\n /** Placeholder text shown when the input is empty. */\n placeholder?: string;\n /** Message announced and shown when no options match the query. */\n emptyMessage?: ReactNode;\n /** Control height and typography scale. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Supporting helper text linked through `aria-describedby`. */\n description?: ReactNode;\n /** Validation error message; marks the control invalid when truthy. */\n error?: ReactNode;\n /** Mark the control invalid without an error message. */\n invalid?: boolean;\n /** Disable interaction and form submission. */\n disabled?: boolean;\n /** Allow focus and inspection while preventing value changes. */\n readOnly?: boolean;\n /** Require a selection for form validation. */\n required?: boolean;\n /** Form field name for native form submission. */\n name?: string;\n /** Controlled popup open state. */\n open?: boolean;\n /** Initial popup open state when uncontrolled. */\n defaultOpen?: boolean;\n /** Called when the popup opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Controlled search query text inside the input. */\n inputValue?: string;\n /** Called when the search query text changes. */\n onInputValueChange?: (inputValue: string) => void;\n /** Accessible name for the clear button (defaults to `\"Clear {label}\"`). */\n clearLabel?: string;\n /** Accessible name for the popup toggle button (defaults to `\"Toggle {label} options\"`). */\n toggleLabel?: string;\n /** Portal host; defaults to field root to retain nested themes. */\n container?: Base.Portal.Props[\"container\"];\n /** Extra classes for inner parts, keyed by slot name. */\n classNames?: ClassNames<ComboboxSlot>;\n}\n\n/** Searchable single-choice combobox with type-to-filter and removable selection. */\nexport const Combobox = forwardRef<HTMLInputElement, ComboboxProps>(function Combobox(\n {\n label,\n options,\n value,\n onValueChange,\n placeholder,\n emptyMessage = \"No matching options\",\n size = \"md\",\n description,\n error,\n invalid,\n disabled = false,\n readOnly = false,\n required = false,\n name,\n open,\n defaultOpen,\n onOpenChange,\n inputValue,\n onInputValueChange,\n clearLabel,\n toggleLabel,\n container,\n className,\n classNames,\n id,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": callerAriaInvalid,\n ...rest\n },\n ref,\n) {\n const uid = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const inputId = id ?? `${uid}-input`;\n const labelId = `${uid}-label`;\n const descId = `${uid}-desc`;\n const errId = `${uid}-err`;\n const hasError = Boolean(error);\n const { invalid: isInvalid, ariaInvalid } = resolveInvalid(\n Boolean(invalid) || hasError,\n callerAriaInvalid,\n );\n const hasDescription = Boolean(description);\n const describedBy =\n [hasDescription ? descId : null, hasError ? errId : null, ariaDescribedBy]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const collection = useMemo(\n () => Base.createItems(options, { getValue: (o) => o.value, getLabel: (o) => o.label }),\n [options],\n );\n\n const validValue = useMemo(\n () => (value !== null && options.some((o) => o.value === value) ? value : null),\n [value, options],\n );\n\n return (\n <Base.Root<string, false, ComboboxOption>\n items={collection}\n value={validValue}\n onValueChange={(next) => {\n if (disabled || readOnly) return;\n onValueChange(next ?? null);\n }}\n inputValue={inputValue}\n onInputValueChange={(next) => {\n onInputValueChange?.(next);\n }}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={(next) => {\n onOpenChange?.(next);\n }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n >\n <div\n {...rest}\n ref={rootRef}\n {...kb(\n \"combobox\",\n {\n size,\n invalid: isInvalid,\n disabled,\n readonly: readOnly,\n required,\n },\n className,\n )}\n >\n <label\n id={labelId}\n htmlFor={inputId}\n className={clsx(\"kb-combobox-label\", classNames?.label)}\n >\n {label}\n </label>\n <Base.InputGroup\n aria-labelledby={labelId}\n className={clsx(\"kb-combobox-shell\", classNames?.shell)}\n >\n <Base.Input\n ref={ref}\n id={inputId}\n placeholder={placeholder}\n aria-labelledby={labelId}\n aria-invalid={ariaInvalid}\n aria-describedby={describedBy}\n className={clsx(\"kb-combobox-input\", classNames?.input)}\n />\n <div className={clsx(\"kb-combobox-actions\", classNames?.actions)}>\n <Base.Clear\n aria-label={clearLabel ?? `Clear ${label}`}\n disabled={disabled || readOnly}\n className={clsx(\"kb-combobox-clear\", classNames?.clear)}\n >\n <span aria-hidden=\"true\">×</span>\n </Base.Clear>\n <Base.Trigger\n aria-label={toggleLabel ?? `Toggle ${label} options`}\n disabled={disabled}\n className={clsx(\"kb-combobox-trigger\", classNames?.trigger)}\n >\n <span aria-hidden=\"true\">▾</span>\n </Base.Trigger>\n </div>\n </Base.InputGroup>\n <Base.Portal container={container ?? rootRef}>\n <Base.Positioner\n sideOffset={6}\n className={clsx(\"kb-combobox-positioner\", classNames?.positioner)}\n >\n <Base.Popup className={clsx(\"kb-combobox-popup\", classNames?.popup)}>\n <Base.List\n aria-labelledby={labelId}\n className={clsx(\"kb-combobox-list\", classNames?.list)}\n >\n {(option: ComboboxOption) => (\n <Base.Item\n key={option.value}\n value={option.value}\n disabled={Boolean(option.disabled)}\n className={clsx(\"kb-combobox-option\", classNames?.option)}\n >\n <Base.ItemIndicator\n keepMounted\n className={clsx(\"kb-combobox-option-indicator\", classNames?.optionIndicator)}\n >\n ✓\n </Base.ItemIndicator>\n <span className={clsx(\"kb-combobox-option-label\", classNames?.optionLabel)}>\n {option.label}\n </span>\n </Base.Item>\n )}\n </Base.List>\n <Base.Empty className={clsx(\"kb-combobox-empty\", classNames?.empty)}>\n {emptyMessage}\n </Base.Empty>\n </Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n {hasDescription && (\n <p id={descId} className={clsx(\"kb-combobox-description\", classNames?.description)}>\n {description}\n </p>\n )}\n {hasError && (\n <p id={errId} className={clsx(\"kb-combobox-error\", classNames?.error)}>\n {error}\n </p>\n )}\n </div>\n </Base.Root>\n );\n});\n","import { createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\nimport type { LayoutElementProps } from \"../../utils/layout\";\n\nexport type ContainerElement =\n | \"div\"\n | \"main\"\n | \"section\"\n | \"article\"\n | \"aside\"\n | \"header\"\n | \"footer\";\nexport type ContainerSize = \"sm\" | \"md\" | \"lg\" | \"full\";\nexport type ContainerProps<T extends ContainerElement = \"div\"> = LayoutElementProps<T> & {\n /** Maximum outer width, including gutters. */\n size?: ContainerSize;\n /** Shared responsive gutters; disable when the parent owns padding. */\n gutter?: boolean;\n};\n\nexport function Container<T extends ContainerElement = \"div\">({\n as,\n size = \"lg\",\n gutter = true,\n className,\n ...props\n}: ContainerProps<T>) {\n return createElement(as ?? \"div\", {\n ...props,\n \"data-gutter\": undefined,\n ...kb(\"container\", { size, gutter: gutter ? undefined : \"none\" }, className),\n });\n}\n","import { Dialog as Base } from \"@base-ui/react/dialog\";\nimport { clsx } from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport type { ClassNames } from \"../../utils/kb\";\n\nexport type DialogProps = Base.Root.Props;\nexport type DialogTriggerProps = Base.Trigger.Props;\nexport type DialogCloseProps = Base.Close.Props;\nexport type DialogTitleProps = Omit<Base.Title.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type DialogDescriptionProps = Omit<Base.Description.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type DialogActionsProps = ComponentProps<\"div\">;\nexport type DialogSectionProps = ComponentProps<\"div\">;\n\nexport type DialogContentProps = Omit<Base.Popup.Props, \"className\" | \"title\"> & {\n /** Accessible name; mutually exclusive with a composed Dialog.Title. */\n title?: ReactNode;\n /** Accessible description; mutually exclusive with a composed Dialog.Description. */\n description?: ReactNode;\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Portal target; defaults to document.body. */\n container?: Base.Portal.Props[\"container\"];\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"backdrop\">;\n};\n\nfunction DialogRoot(props: DialogProps) {\n return <Base.Root {...props} />;\n}\n\nfunction DialogTrigger(props: DialogTriggerProps) {\n return <Base.Trigger {...props} />;\n}\n\nfunction DialogClose(props: DialogCloseProps) {\n return <Base.Close {...props} />;\n}\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return <Base.Title {...props} className={clsx(\"kb-dialog-title\", className)} />;\n}\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return <Base.Description {...props} className={clsx(\"kb-dialog-description\", className)} />;\n}\n\nfunction DialogActions({ className, ...props }: DialogActionsProps) {\n return <div {...props} className={clsx(\"kb-dialog-actions\", className)} />;\n}\n\nfunction DialogHeader({ className, ...props }: DialogSectionProps) {\n return <div {...props} className={clsx(\"kb-dialog-header\", className)} />;\n}\nfunction DialogBody({ className, ...props }: DialogSectionProps) {\n return <div {...props} className={clsx(\"kb-dialog-body\", className)} />;\n}\nfunction DialogFooter({ className, ...props }: DialogSectionProps) {\n return <div {...props} className={clsx(\"kb-dialog-footer\", className)} />;\n}\n\nfunction DialogContent({\n classNames,\n title,\n description,\n container,\n children,\n className,\n ...props\n}: DialogContentProps) {\n return (\n <Base.Portal container={container}>\n <Base.Backdrop className={clsx(\"kb-dialog-backdrop\", classNames?.backdrop)} />\n <Base.Popup {...props} className={clsx(\"kb-dialog-popup\", className)}>\n {title != null && title !== \"\" ? <DialogTitle>{title}</DialogTitle> : null}\n {description != null && description !== \"\" ? (\n <DialogDescription>{description}</DialogDescription>\n ) : null}\n {children}\n </Base.Popup>\n </Base.Portal>\n );\n}\n\nexport const Dialog = Object.assign(DialogRoot, {\n Trigger: DialogTrigger,\n Content: DialogContent,\n Title: DialogTitle,\n Description: DialogDescription,\n Close: DialogClose,\n Actions: DialogActions,\n Header: DialogHeader,\n Body: DialogBody,\n Footer: DialogFooter,\n});\n","import { clsx } from \"clsx\";\nimport { type ComponentProps, type MouseEvent, type ReactNode, useId } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\nexport type ErrorSummaryHeadingLevel = 2 | 3 | 4;\nexport type ErrorSummaryPart = \"title\" | \"description\" | \"list\" | \"item\" | \"link\";\n\nexport interface ErrorSummaryItem {\n /** Optional key when multiple items point to the same href. */\n id?: string | undefined;\n /** Anchor fragment such as \"#email\" targeting the invalid field or group. */\n href: string;\n /** Actionable message naming the field and how to fix it. */\n label: ReactNode;\n}\n\nexport interface ErrorSummaryProps extends Omit<ComponentProps<\"div\">, \"title\"> {\n /** Summary heading displayed above the error list. */\n title?: ReactNode | undefined;\n /** Optional guidance shown between the heading and list. */\n description?: ReactNode | undefined;\n /** Ordered field errors with fragment links for focus recovery. */\n items: readonly ErrorSummaryItem[];\n /** Document heading rank for the summary title. */\n headingLevel?: ErrorSummaryHeadingLevel | undefined;\n /** Callback fired when a recovery link is activated. */\n onItemSelect?: ((href: string, event: MouseEvent<HTMLAnchorElement>) => void) | undefined;\n /** Classes for the title, description, list, item and link slots. */\n classNames?: ClassNames<ErrorSummaryPart> | undefined;\n}\n\nconst FOCUSABLE_CHILD_SELECTOR = [\n \"input:not(:disabled):not([type='hidden']):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])\",\n \"textarea:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])\",\n \"select:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])\",\n \"button:not(:disabled):not([hidden]):not([tabindex='-1']):not([aria-hidden='true'])\",\n \"[tabindex]:not([tabindex='-1']):not(:disabled):not([hidden]):not([aria-hidden='true']):not([aria-disabled='true'])\",\n].join(\", \");\n\nfunction focusTargetByHref(doc: Document, href: string): boolean {\n if (!href.startsWith(\"#\") || href.length < 2) return false;\n const rawId = href.slice(1);\n let targetId = rawId;\n try {\n targetId = decodeURIComponent(rawId);\n } catch {\n targetId = rawId;\n }\n const element = doc.getElementById(targetId);\n if (!element) return false;\n\n const focusTarget = element.matches(FOCUSABLE_CHILD_SELECTOR)\n ? element\n : (element.querySelector<HTMLElement>(FOCUSABLE_CHILD_SELECTOR) ??\n (element.hasAttribute(\"tabindex\") && !element.matches(\":disabled\") && !element.hidden\n ? element\n : null));\n if (!focusTarget) return false;\n\n focusTarget.focus();\n focusTarget.scrollIntoView?.({ block: \"nearest\" });\n return true;\n}\n\n/** Focusable form-level validation alert that links each error to its field. */\nexport const ErrorSummary = ({\n ref,\n title = \"There is a problem\",\n description,\n items,\n headingLevel = 2,\n onItemSelect,\n tabIndex = -1,\n className,\n classNames,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-describedby\": ariaDescribedBy,\n ...props\n}: ErrorSummaryProps) => {\n const reactId = useId();\n if (items.length === 0) return null;\n\n const baseId = props.id ?? `kb-errorsummary-${reactId}`;\n const titleId = `${baseId}-title`;\n const descriptionId = description ? `${baseId}-description` : undefined;\n const labelledBy = ariaLabelledBy ?? titleId;\n const describedBy = [descriptionId, ariaDescribedBy].filter(Boolean).join(\" \") || undefined;\n const HeadingTag = `h${headingLevel}` as const;\n const seenKeys = new Map<string, number>();\n\n return (\n <div\n {...props}\n ref={ref}\n role=\"alert\"\n tabIndex={tabIndex}\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n {...kb(\"errorsummary\", {}, className)}\n >\n <HeadingTag id={titleId} className={clsx(\"kb-errorsummary-title\", classNames?.title)}>\n {title}\n </HeadingTag>\n {description ? (\n <p\n id={descriptionId}\n className={clsx(\"kb-errorsummary-description\", classNames?.description)}\n >\n {description}\n </p>\n ) : null}\n <ul className={clsx(\"kb-errorsummary-list\", classNames?.list)}>\n {items.map((item) => {\n const baseKey =\n item.id ??\n `${item.href}:${typeof item.label === \"string\" || typeof item.label === \"number\" ? item.label : \"\"}`;\n const occurrence = (seenKeys.get(baseKey) ?? 0) + 1;\n seenKeys.set(baseKey, occurrence);\n const itemKey = occurrence === 1 ? baseKey : `${baseKey}:${occurrence}`;\n return (\n <li key={itemKey} className={clsx(\"kb-errorsummary-item\", classNames?.item)}>\n <a\n href={item.href}\n className={clsx(\"kb-errorsummary-link\", classNames?.link)}\n onClick={(event) => {\n onItemSelect?.(item.href, event);\n if (event.defaultPrevented) return;\n if (focusTargetByHref(event.currentTarget.ownerDocument, item.href)) {\n event.preventDefault();\n }\n }}\n >\n {item.label}\n </a>\n </li>\n );\n })}\n </ul>\n </div>\n );\n};\n","import { clsx } from \"clsx\";\nimport { type ComponentProps, type ReactNode, useId } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\nexport type FieldsetPart = \"legend\" | \"description\" | \"fields\" | \"error\";\n\nexport interface FieldsetProps extends ComponentProps<\"fieldset\"> {\n /** Group heading rendered inside the native legend element. */\n legend: ReactNode;\n /** Hide the legend visually while keeping the accessible group name. */\n visuallyHidden?: boolean | undefined;\n /** Supporting context explaining the grouped fields. */\n description?: ReactNode | undefined;\n /** Group-level validation error message. */\n error?: ReactNode | undefined;\n /** Classes for the legend, description, fields and error slots. */\n classNames?: ClassNames<FieldsetPart> | undefined;\n}\n\n/** Semantic fieldset and legend section that groups related form controls. */\nexport const Fieldset = ({\n ref,\n legend,\n visuallyHidden,\n description,\n error,\n disabled,\n className,\n classNames,\n children,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: FieldsetProps) => {\n const reactId = useId();\n const baseId = props.id ?? `kb-fieldset-${reactId}`;\n const hasError = Boolean(error);\n const { invalid, ariaInvalid } = resolveInvalid(hasError, callerAriaInvalid);\n const descriptionId = description ? `${baseId}-description` : undefined;\n const errorId = hasError ? `${baseId}-error` : undefined;\n const describedBy =\n [descriptionId, errorId, ariaDescribedBy].filter(Boolean).join(\" \") || undefined;\n\n return (\n <fieldset\n {...props}\n ref={ref}\n disabled={disabled}\n aria-invalid={ariaInvalid}\n aria-describedby={describedBy}\n {...kb(\"fieldset\", { disabled: Boolean(disabled), invalid }, className)}\n >\n <legend\n className={clsx(\"kb-fieldset-legend\", visuallyHidden && \"kb-sr-only\", classNames?.legend)}\n >\n {legend}\n </legend>\n {description ? (\n <p id={descriptionId} className={clsx(\"kb-fieldset-description\", classNames?.description)}>\n {description}\n </p>\n ) : null}\n <div className={clsx(\"kb-fieldset-fields\", classNames?.fields)}>{children}</div>\n {hasError ? (\n <div id={errorId} className={clsx(\"kb-fieldset-error\", classNames?.error)}>\n {error}\n </div>\n ) : null}\n </fieldset>\n );\n};\n","import { clsx } from \"clsx\";\nimport {\n type ComponentProps,\n type ReactNode,\n type Ref,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\nimport { Button } from \"../Button/Button\";\n\nexport type FileInputItem = {\n /** Stable unique identity independent of display name. */\n id: string;\n /** Visible filename and default accessible removal name. */\n name: string;\n /** Caller-owned metadata such as size or processing status. */\n description?: ReactNode;\n};\nexport type FileInputProps = Omit<\n ComponentProps<\"div\">,\n \"onChange\" | \"children\" | \"defaultValue\"\n> & {\n /** Accessible field label. */\n label: string;\n /** Retained items; caller owns acceptance and list updates. */\n items: readonly FileInputItem[];\n /** Receives original native File objects without policy filtering. */\n onFiles: (files: File[]) => void;\n /** Requests removal; focus moves only after items change. */\n onRemove: (id: string) => void;\n /** Native picker hint; callers must validate selected files. */\n accept?: string;\n /** Allow multiple selections; defaults to true. */\n multiple?: boolean;\n /** Block selection, removal and mutation callbacks. */\n disabled?: boolean;\n /** Keep retained items readable while blocking changes. */\n readOnly?: boolean;\n /** Helper text associated with picker action. */\n description?: string;\n /** Caller-owned rejection/error text; announced when shown. */\n error?: string;\n /** Hide field label visually while retaining accessible name. */\n visuallyHidden?: boolean;\n /** Localized picker action; defaults to Choose files. */\n chooseLabel?: string;\n /** Localized empty list message. */\n emptyMessage?: string;\n /** Localized accessible remove action for an item. */\n removeLabel?: (item: FileInputItem) => string;\n /** Localized announcement after controlled removal succeeds. */\n removedMessage?: (item: FileInputItem) => string;\n /** Localized native selection announcement; does not imply acceptance. */\n selectionMessage?: (count: number) => string;\n /** Custom item content; retain visible file identity. */\n renderItem?: (item: FileInputItem) => ReactNode;\n /** Class on picker action. */\n triggerClassName?: string;\n /** Class on retained-item list. */\n listClassName?: string;\n /** Class on each retained item. */\n itemClassName?: string;\n /** Ref to native hidden file input. */\n inputRef?: Ref<HTMLInputElement>;\n /** Ref to accessible picker button. */\n triggerRef?: Ref<HTMLButtonElement>;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\n | \"label\"\n | \"trigger\"\n | \"list\"\n | \"item\"\n | \"native\"\n | \"description\"\n | \"error\"\n | \"content\"\n | \"name\"\n | \"metadata\"\n | \"remove\"\n | \"empty\"\n >;\n};\nconst defaultRemoveLabel = (item: FileInputItem) => `Remove ${item.name}`;\nconst defaultRemovedMessage = (item: FileInputItem) => `${item.name} removed.`;\nconst defaultSelectionMessage = (count: number) =>\n `${count} ${count === 1 ? \"file\" : \"files\"} selected.`;\n\nexport function FileInput({\n classNames,\n label,\n items,\n onFiles,\n onRemove,\n accept,\n multiple = true,\n disabled = false,\n readOnly = false,\n description,\n error,\n visuallyHidden,\n chooseLabel = \"Choose files\",\n emptyMessage = \"No files added.\",\n removeLabel = defaultRemoveLabel,\n removedMessage = defaultRemovedMessage,\n selectionMessage = defaultSelectionMessage,\n renderItem,\n triggerClassName,\n listClassName,\n itemClassName,\n inputRef,\n triggerRef,\n className,\n onBlurCapture,\n \"aria-describedby\": callerDescription,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: FileInputProps) {\n const id = useId();\n const input = useRef<HTMLInputElement>(null);\n const trigger = useRef<HTMLButtonElement>(null);\n const removeButtons = useRef(new Map<string, HTMLButtonElement>());\n const pending = useRef<{ item: FileInputItem; index: number; button: HTMLButtonElement } | null>(\n null,\n );\n const [announcement, setAnnouncement] = useState(\"\");\n useImperativeHandle(inputRef, () => input.current as HTMLInputElement);\n useImperativeHandle(triggerRef, () => trigger.current as HTMLButtonElement);\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const blocked = disabled || readOnly;\n const described =\n [description ? `${id}-description` : null, error ? `${id}-error` : null, callerDescription]\n .filter(Boolean)\n .join(\" \") || undefined;\n useLayoutEffect(() => {\n const request = pending.current;\n if (!request || items.some((item) => item.id === request.item.id)) return;\n pending.current = null;\n const active = request.button.ownerDocument.activeElement;\n if (!blocked && (active === request.button.ownerDocument.body || active === request.button)) {\n const next = items[Math.min(request.index, items.length - 1)];\n (next ? removeButtons.current.get(next.id) : trigger.current)?.focus();\n }\n setAnnouncement(removedMessage(request.item));\n }, [items, blocked, removedMessage]);\n return (\n <div\n {...props}\n {...kb(\"fileinput\", { disabled, readonly: readOnly, invalid }, className)}\n onBlurCapture={(event) => {\n if (\n pending.current?.button.isSameNode(event.target) &&\n event.relatedTarget !== pending.current.button\n )\n pending.current = null;\n onBlurCapture?.(event);\n }}\n >\n <span\n id={`${id}-label`}\n className={clsx(\"kb-fileinput-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n >\n {label}\n </span>\n <input\n ref={input}\n type=\"file\"\n hidden\n className={clsx(\"kb-fileinput-native\", classNames?.native)}\n accept={accept}\n multiple={multiple}\n disabled={blocked}\n onChange={(event) => {\n const control = event.currentTarget;\n try {\n const files = Array.from(control.files ?? []);\n if (!blocked && files.length) {\n onFiles(files);\n setAnnouncement(selectionMessage(files.length));\n }\n } finally {\n control.value = \"\";\n }\n }}\n />\n <Button\n ref={trigger}\n type=\"button\"\n size=\"lg\"\n variant=\"secondary\"\n disabled={blocked}\n aria-labelledby={`${id}-label ${id}-action`}\n aria-describedby={described}\n aria-invalid={ariaInvalid}\n className={clsx(\"kb-fileinput-trigger\", classNames?.trigger, triggerClassName)}\n onClick={() => {\n if (!blocked) input.current?.click();\n }}\n >\n <span id={`${id}-action`}>{chooseLabel}</span>\n </Button>\n {description && (\n <p\n id={`${id}-description`}\n className={clsx(\"kb-fileinput-description\", classNames?.description)}\n >\n {description}\n </p>\n )}\n {error && (\n <p\n id={`${id}-error`}\n className={clsx(\"kb-fileinput-error\", classNames?.error)}\n role=\"alert\"\n >\n {error}\n </p>\n )}\n {items.length ? (\n <ul\n className={clsx(\"kb-fileinput-list\", classNames?.list, listClassName)}\n aria-labelledby={`${id}-label`}\n >\n {items.map((item, index) => (\n <li\n className={clsx(\"kb-fileinput-item\", classNames?.item, itemClassName)}\n key={item.id}\n >\n <div className={clsx(\"kb-fileinput-content\", classNames?.content)}>\n {renderItem ? (\n renderItem(item)\n ) : (\n <>\n <span className={clsx(\"kb-fileinput-name\", classNames?.name)}>{item.name}</span>\n {item.description && (\n <span className={clsx(\"kb-fileinput-metadata\", classNames?.metadata)}>\n {item.description}\n </span>\n )}\n </>\n )}\n </div>\n <Button\n ref={(node) => {\n if (node) removeButtons.current.set(item.id, node);\n else removeButtons.current.delete(item.id);\n }}\n type=\"button\"\n size=\"lg\"\n variant=\"ghost\"\n disabled={blocked}\n className={clsx(\"kb-fileinput-remove\", classNames?.remove)}\n aria-label={removeLabel(item)}\n onClick={(event) => {\n if (blocked) return;\n if (event.currentTarget === event.currentTarget.ownerDocument.activeElement)\n pending.current = { item, index, button: event.currentTarget };\n onRemove(item.id);\n }}\n >\n <span aria-hidden=\"true\">×</span>\n </Button>\n </li>\n ))}\n </ul>\n ) : (\n <p className={clsx(\"kb-fileinput-empty\", classNames?.empty)}>{emptyMessage}</p>\n )}\n <p role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" className=\"kb-sr-only\">\n {announcement}\n </p>\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type FormActionsAlign = \"end\" | \"start\" | \"between\";\n\nexport interface FormActionsProps extends ComponentProps<\"div\"> {\n /** Horizontal alignment for form action buttons. */\n align?: FormActionsAlign | undefined;\n /** Add a top border and spacing above the action row. */\n divider?: boolean | undefined;\n}\n\n/** Wrapping action footer for form submit, reset and secondary buttons. */\nexport const FormActions = ({\n ref,\n align = \"end\",\n divider = false,\n className,\n children,\n ...props\n}: FormActionsProps) => (\n <div {...props} ref={ref} {...kb(\"formactions\", { align, divider }, className)}>\n {children}\n </div>\n);\n","import { type ComponentProps, createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\ntype Container = \"div\" | \"ul\" | \"ol\";\nexport type GridProps<T extends Container = \"div\"> = ComponentProps<T> & {\n /** Native container; list children must be list items. */\n as?: T;\n /** Responsive equal columns or a single vertical track. */\n layout?: \"auto\" | \"stack\";\n};\n\nexport function Grid<T extends Container = \"div\">({\n as,\n layout = \"auto\",\n className,\n ...props\n}: GridProps<T>) {\n return createElement(as ?? \"div\", { ...props, ...kb(\"grid\", { layout }, className) });\n}\n","import { type ComponentProps, createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type HeadingSize = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"display\";\nexport type HeadingProps = ComponentProps<\"h2\"> & {\n /** Native heading rank; follow document hierarchy. */\n level?: HeadingLevel;\n /** Visual size, independent of rank; defaults from level. */\n size?: HeadingSize;\n};\n\nconst sizes: Record<HeadingLevel, HeadingSize> = {\n 1: \"xl\",\n 2: \"lg\",\n 3: \"md\",\n 4: \"sm\",\n 5: \"sm\",\n 6: \"sm\",\n};\n\nexport function Heading({ level = 2, size = sizes[level], className, ...props }: HeadingProps) {\n return createElement(`h${level}`, { ...props, ...kb(\"heading\", { size }, className) });\n}\n","import { createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\nimport type { LayoutAlign, LayoutElementProps, LayoutGap } from \"../../utils/layout\";\n\nexport type InlineElement = \"div\" | \"ul\" | \"ol\" | \"nav\";\nexport type InlineJustify = \"start\" | \"center\" | \"end\" | \"between\";\nexport type InlineProps<T extends InlineElement = \"div\"> = LayoutElementProps<T> & {\n /** Space between items and wrapped rows. */\n gap?: LayoutGap;\n /** Cross-axis alignment within each row. */\n align?: LayoutAlign;\n /** Main-axis distribution within each row. */\n justify?: InlineJustify;\n};\n\nexport function Inline<T extends InlineElement = \"div\">({\n as,\n gap = \"md\",\n align = \"center\",\n justify = \"start\",\n className,\n ...props\n}: InlineProps<T>) {\n return createElement(as ?? \"div\", {\n ...props,\n ...kb(\"inline\", { gap, align, justify }, className),\n });\n}\n","import { Field } from \"@base-ui/react/field\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { clsx } from \"clsx\";\nimport type { ReactNode } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\nexport type InputSize = \"sm\" | \"md\" | \"lg\";\n\nexport type InputProps = Omit<BaseInput.Props, \"size\" | \"className\"> & {\n /** Plain class string for the root. */\n className?: string;\n /** Visible label; required for accessibility. */\n label: string;\n /** Hide the label visually, keep it for screen readers. */\n visuallyHidden?: boolean;\n /** Helper text under the control. */\n description?: string;\n /** Error message; when set the field is invalid. */\n error?: string;\n /** Control height scale. */\n size?: InputSize;\n /** Content before control text, such as icons. */\n startContent?: ReactNode;\n /** Content after control text, such as a named action. */\n endContent?: ReactNode;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\n \"label\" | \"shell\" | \"start\" | \"control\" | \"end\" | \"description\" | \"error\"\n >;\n};\n\nexport function Input({\n classNames,\n label,\n visuallyHidden,\n description,\n error,\n size = \"md\",\n disabled,\n className,\n startContent,\n endContent,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: InputProps) {\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n return (\n <Field.Root\n {...kb(\n \"input\",\n {\n size,\n invalid,\n \"start-adornment\": Boolean(startContent),\n \"end-adornment\": Boolean(endContent),\n },\n className,\n )}\n invalid={invalid}\n disabled={Boolean(disabled)}\n >\n <Field.Label\n className={clsx(\"kb-input-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n >\n {label}\n </Field.Label>\n <div className={clsx(\"kb-input-shell\", classNames?.shell)}>\n {startContent && (\n <span className={clsx(\"kb-input-start\", classNames?.start)}>{startContent}</span>\n )}\n <BaseInput\n {...props}\n aria-invalid={ariaInvalid}\n render={\n props.render ??\n (typeof ariaInvalid === \"string\" ? <input aria-invalid={ariaInvalid} /> : undefined)\n }\n className={clsx(\"kb-input-control\", classNames?.control)}\n />\n {endContent && <span className={clsx(\"kb-input-end\", classNames?.end)}>{endContent}</span>}\n </div>\n {description ? (\n <Field.Description className={clsx(\"kb-input-description\", classNames?.description)}>\n {description}\n </Field.Description>\n ) : null}\n {error ? (\n <Field.Error className={clsx(\"kb-input-error\", classNames?.error)} match>\n {error}\n </Field.Error>\n ) : null}\n </Field.Root>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type LinkProps = ComponentProps<\"a\"> & {\n /** Navigation destination; use Button for actions. */\n href: string;\n};\n\nexport function Link({ className, ...props }: LinkProps) {\n return <a {...props} {...kb(\"link\", {}, className)} />;\n}\n","import { Menu as Base } from \"@base-ui/react/menu\";\nimport { Separator } from \"@base-ui/react/separator\";\nimport { clsx } from \"clsx\";\nimport { createContext, useContext, useEffect, useState } from \"react\";\n\nconst PointerFocus = createContext(false);\n\nexport type MenuProps = Base.Root.Props;\nexport type MenuTriggerProps = Base.Trigger.Props;\nexport type MenuItemProps = Omit<Base.Item.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type MenuSeparatorProps = Omit<Separator.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type MenuContentProps = Omit<Base.Popup.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Portal target; pass the consumer theme host for nested themes. */\n container?: Base.Portal.Props[\"container\"];\n /** Side of the trigger the popup prefers. */\n side?: Base.Positioner.Props[\"side\"];\n /** Alignment along that side. */\n align?: Base.Positioner.Props[\"align\"];\n};\n\nfunction MenuRoot({ onOpenChange, ...props }: MenuProps) {\n const [pointerFocus, setPointerFocus] = useState(false);\n useEffect(() => {\n if (!pointerFocus) return;\n const keyboard = () => setPointerFocus(false);\n document.addEventListener(\"keydown\", keyboard, { capture: true, once: true });\n return () => document.removeEventListener(\"keydown\", keyboard, true);\n }, [pointerFocus]);\n return (\n <PointerFocus.Provider value={pointerFocus}>\n <Base.Root\n {...props}\n onOpenChange={(open, details) => {\n const event = details.event;\n setPointerFocus(\n /^(pointer|mouse|touch|click)/.test(event.type) &&\n !(event.type === \"click\" && \"detail\" in event && event.detail === 0),\n );\n onOpenChange?.(open, details);\n }}\n />\n </PointerFocus.Provider>\n );\n}\n\nfunction MenuTrigger(props: MenuTriggerProps) {\n const pointerFocus = useContext(PointerFocus);\n return (\n <Base.Trigger\n {...props}\n data-kb-menu-trigger=\"\"\n data-pointer-focus={pointerFocus || undefined}\n />\n );\n}\n\nfunction MenuContent({\n side = \"bottom\",\n align = \"start\",\n className,\n container,\n ...props\n}: MenuContentProps) {\n return (\n <Base.Portal container={container}>\n <Base.Positioner side={side} align={align} sideOffset={6}>\n <Base.Popup {...props} className={clsx(\"kb-menu\", className)} />\n </Base.Positioner>\n </Base.Portal>\n );\n}\n\nfunction MenuItem({ className, ...props }: MenuItemProps) {\n return <Base.Item {...props} className={clsx(\"kb-menu-item\", className)} />;\n}\n\nfunction MenuSeparator({ className, ...props }: MenuSeparatorProps) {\n return <Separator {...props} className={clsx(\"kb-menu-separator\", className)} />;\n}\n\nexport const Menu = Object.assign(MenuRoot, {\n Trigger: MenuTrigger,\n Content: MenuContent,\n Item: MenuItem,\n Separator: MenuSeparator,\n});\n","import { Combobox as Base } from \"@base-ui/react/combobox\";\nimport { clsx } from \"clsx\";\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type ReactNode,\n useId,\n useMemo,\n useRef,\n} from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\n/** Single selectable option in a MultiSelect list. */\nexport interface MultiSelectOption {\n /** Option value included in `value` and passed to `onValueChange`. */\n value: string;\n /** Visible option label shown in the popup list and selection chip. */\n label: string;\n /** Prevent selecting or deselecting this option in the list. */\n disabled?: boolean;\n}\n\n/** Styleable inner anatomy slots of MultiSelect. */\nexport type MultiSelectSlot =\n | \"label\"\n | \"shell\"\n | \"chips\"\n | \"chip\"\n | \"chipLabel\"\n | \"chipRemove\"\n | \"input\"\n | \"actions\"\n | \"clear\"\n | \"trigger\"\n | \"positioner\"\n | \"popup\"\n | \"list\"\n | \"option\"\n | \"optionIndicator\"\n | \"optionLabel\"\n | \"empty\"\n | \"description\"\n | \"error\";\n\n/** Props for the searchable multi-select component with removable chips. */\nexport interface MultiSelectProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"defaultValue\" | \"onChange\"> {\n /** Visible label naming the multiselect input. */\n label: string;\n /** Selectable options shown and filtered in the popup list. */\n options: readonly MultiSelectOption[];\n /** Selected option values rendered as removable chips. */\n value: readonly string[];\n /** Called when the user adds, removes, or clears selected values. */\n onValueChange: (value: string[]) => void;\n /** Placeholder text shown when the input is empty. */\n placeholder?: string;\n /** Message announced and shown when no options match the query. */\n emptyMessage?: ReactNode;\n /** Control height and typography scale. */\n size?: \"sm\" | \"md\" | \"lg\";\n /** Supporting helper text linked through `aria-describedby`. */\n description?: ReactNode;\n /** Validation error message; marks the control invalid when truthy. */\n error?: ReactNode;\n /** Mark the control invalid without an error message. */\n invalid?: boolean;\n /** Disable interaction and form submission. */\n disabled?: boolean;\n /** Allow focus and inspection while preventing value changes. */\n readOnly?: boolean;\n /** Require at least one selection for form validation. */\n required?: boolean;\n /** Form field name for native form submission. */\n name?: string;\n /** Controlled popup open state. */\n open?: boolean;\n /** Initial popup open state when uncontrolled. */\n defaultOpen?: boolean;\n /** Called when the popup opens or closes. */\n onOpenChange?: (open: boolean) => void;\n /** Controlled search query text inside the input. */\n inputValue?: string;\n /** Called when the search query text changes. */\n onInputValueChange?: (inputValue: string) => void;\n /** Accessible name builder for each chip remove button (defaults to `\"Remove {option.label}\"`). */\n removeLabel?: (option: MultiSelectOption) => string;\n /** Accessible name for the clear-all button (defaults to `\"Clear {label}\"`). */\n clearLabel?: string;\n /** Accessible name for the popup toggle button (defaults to `\"Toggle {label} options\"`). */\n toggleLabel?: string;\n /** Portal host; defaults to field root to retain nested themes. */\n container?: Base.Portal.Props[\"container\"];\n /** Extra classes for inner parts, keyed by slot name. */\n classNames?: ClassNames<MultiSelectSlot>;\n}\n\nconst defaultRemoveLabel = (option: MultiSelectOption) => `Remove ${option.label}`;\n// Strip prohibited aria-readonly/aria-disabled emitted by Base UI on generic chip div.\nconst chipAriaReset: Record<string, undefined> = {\n \"aria-readonly\": undefined,\n \"aria-disabled\": undefined,\n};\n\n/** Searchable multi-choice selection control with removable selection chips. */\nexport const MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(function MultiSelect(\n {\n label,\n options,\n value,\n onValueChange,\n placeholder,\n emptyMessage = \"No matching options\",\n size = \"md\",\n description,\n error,\n invalid,\n disabled = false,\n readOnly = false,\n required = false,\n name,\n open,\n defaultOpen,\n onOpenChange,\n inputValue,\n onInputValueChange,\n removeLabel = defaultRemoveLabel,\n clearLabel,\n toggleLabel,\n container,\n className,\n classNames,\n id,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": callerAriaInvalid,\n ...rest\n },\n ref,\n) {\n const uid = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const inputId = id ?? `${uid}-input`;\n const labelId = `${uid}-label`;\n const descId = `${uid}-desc`;\n const errId = `${uid}-err`;\n const hasError = Boolean(error);\n const { invalid: isInvalid, ariaInvalid } = resolveInvalid(\n Boolean(invalid) || hasError,\n callerAriaInvalid,\n );\n const hasDescription = Boolean(description);\n const describedBy =\n [hasDescription ? descId : null, hasError ? errId : null, ariaDescribedBy]\n .filter(Boolean)\n .join(\" \") || undefined;\n\n const collection = useMemo(\n () => Base.createItems(options, { getValue: (o) => o.value, getLabel: (o) => o.label }),\n [options],\n );\n\n const optionMap = useMemo(() => new Map(options.map((o) => [o.value, o])), [options]);\n\n const selectedValues = useMemo(\n () => value.filter((v, idx) => optionMap.has(v) && value.indexOf(v) === idx),\n [value, optionMap],\n );\n\n const selectedOptions = useMemo(\n () =>\n selectedValues\n .map((v) => optionMap.get(v))\n .filter((o): o is MultiSelectOption => o !== undefined),\n [selectedValues, optionMap],\n );\n\n return (\n <Base.Root<string, true, MultiSelectOption>\n multiple\n items={collection}\n value={selectedValues}\n onValueChange={(next) => {\n if (disabled || readOnly) return;\n onValueChange(next ?? []);\n }}\n inputValue={inputValue}\n onInputValueChange={(next) => {\n onInputValueChange?.(next);\n }}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={(next) => {\n onOpenChange?.(next);\n }}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n >\n <div\n {...rest}\n ref={rootRef}\n {...kb(\n \"multiselect\",\n {\n size,\n invalid: isInvalid,\n disabled,\n readonly: readOnly,\n required,\n },\n className,\n )}\n >\n <label\n id={labelId}\n htmlFor={inputId}\n className={clsx(\"kb-multiselect-label\", classNames?.label)}\n >\n {label}\n </label>\n <Base.InputGroup\n aria-labelledby={labelId}\n className={clsx(\"kb-multiselect-shell\", classNames?.shell)}\n >\n <Base.Chips\n aria-label={`${label} selections`}\n className={clsx(\"kb-multiselect-chips\", classNames?.chips)}\n >\n {selectedOptions.map((option) => (\n <Base.Chip\n key={option.value}\n {...chipAriaReset}\n className={clsx(\"kb-multiselect-chip\", classNames?.chip)}\n >\n <span className={clsx(\"kb-multiselect-chip-label\", classNames?.chipLabel)}>\n {option.label}\n </span>\n <Base.ChipRemove\n aria-label={removeLabel(option)}\n disabled={disabled || readOnly}\n className={clsx(\"kb-multiselect-chip-remove\", classNames?.chipRemove)}\n >\n <span aria-hidden=\"true\">×</span>\n </Base.ChipRemove>\n </Base.Chip>\n ))}\n <Base.Input\n ref={ref}\n id={inputId}\n placeholder={placeholder}\n aria-labelledby={labelId}\n aria-invalid={ariaInvalid}\n aria-describedby={describedBy}\n className={clsx(\"kb-multiselect-input\", classNames?.input)}\n />\n </Base.Chips>\n <div className={clsx(\"kb-multiselect-actions\", classNames?.actions)}>\n <Base.Clear\n aria-label={clearLabel ?? `Clear ${label}`}\n disabled={disabled || readOnly}\n className={clsx(\"kb-multiselect-clear\", classNames?.clear)}\n >\n <span aria-hidden=\"true\">×</span>\n </Base.Clear>\n <Base.Trigger\n aria-label={toggleLabel ?? `Toggle ${label} options`}\n disabled={disabled}\n className={clsx(\"kb-multiselect-trigger\", classNames?.trigger)}\n >\n <span aria-hidden=\"true\">▾</span>\n </Base.Trigger>\n </div>\n </Base.InputGroup>\n <Base.Portal container={container ?? rootRef}>\n <Base.Positioner\n sideOffset={6}\n className={clsx(\"kb-multiselect-positioner\", classNames?.positioner)}\n >\n <Base.Popup className={clsx(\"kb-multiselect-popup\", classNames?.popup)}>\n <Base.List\n aria-labelledby={labelId}\n className={clsx(\"kb-multiselect-list\", classNames?.list)}\n >\n {(option: MultiSelectOption) => (\n <Base.Item\n key={option.value}\n value={option.value}\n disabled={Boolean(option.disabled)}\n className={clsx(\"kb-multiselect-option\", classNames?.option)}\n >\n <Base.ItemIndicator\n keepMounted\n className={clsx(\n \"kb-multiselect-option-indicator\",\n classNames?.optionIndicator,\n )}\n >\n ✓\n </Base.ItemIndicator>\n <span className={clsx(\"kb-multiselect-option-label\", classNames?.optionLabel)}>\n {option.label}\n </span>\n </Base.Item>\n )}\n </Base.List>\n <Base.Empty className={clsx(\"kb-multiselect-empty\", classNames?.empty)}>\n {emptyMessage}\n </Base.Empty>\n </Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n {hasDescription && (\n <p id={descId} className={clsx(\"kb-multiselect-description\", classNames?.description)}>\n {description}\n </p>\n )}\n {hasError && (\n <p id={errId} className={clsx(\"kb-multiselect-error\", classNames?.error)}>\n {error}\n </p>\n )}\n </div>\n </Base.Root>\n );\n});\n","import { NumberField as Base } from \"@base-ui/react/number-field\";\nimport { clsx } from \"clsx\";\nimport { type ComponentProps, type Ref, useId } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\nexport type NumberFieldSize = \"sm\" | \"md\" | \"lg\";\nexport type NumberFieldProps = Omit<\n ComponentProps<\"div\">,\n \"onChange\" | \"children\" | \"defaultValue\"\n> & {\n /** Accessible label for the numeric input. */\n label: string;\n /** Controlled number; null represents an empty field. */\n value: number | null;\n /** Receives numeric edits and null on clearing. */\n onValueChange: (value: number | null) => void;\n /** Lower stepping bound; typed drafts remain visible outside it. */\n min?: number;\n /** Upper stepping bound; typed drafts remain visible outside it. */\n max?: number;\n /** Step for buttons and arrows; defaults to one. */\n step?: number;\n /** Locale for numeric editing and display. */\n locale?: Intl.LocalesArgument;\n /** Native form field name. */\n name?: string;\n /** External native form identifier. */\n form?: string;\n /** Require a value for native form validation. */\n required?: boolean;\n /** Disable editing, stepping and form submission. */\n disabled?: boolean;\n /** Preserve value while blocking edits and stepping. */\n readOnly?: boolean;\n /** Keep label accessible while hiding it visually. */\n visuallyHidden?: boolean;\n /** Help associated with the visible input. */\n description?: string;\n /** Invalid message; callers own business validation. */\n error?: string;\n /** Control height; defaults to md. */\n size?: NumberFieldSize;\n /** Class on the visible numeric input. */\n inputClassName?: string;\n /** Class on the group containing the input and steppers. */\n groupClassName?: string;\n /** Ref to the visible input; root ref targets the outer div. */\n inputRef?: Ref<HTMLInputElement>;\n /** Native input extensions; value and behavior remain controlled. */\n inputProps?: Omit<\n Base.Input.Props,\n | \"className\"\n | \"render\"\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"id\"\n | \"ref\"\n | \"type\"\n | \"disabled\"\n | \"readOnly\"\n | \"required\"\n | \"name\"\n >;\n /** Localized decrement action; defaults to Decrease plus label. */\n decrementLabel?: string;\n /** Localized increment action; defaults to Increase plus label. */\n incrementLabel?: string;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\n \"label\" | \"group\" | \"input\" | \"editor\" | \"decrement\" | \"increment\" | \"description\" | \"error\"\n >;\n};\n\nexport function NumberField({\n classNames,\n label,\n value,\n onValueChange,\n min,\n max,\n step = 1,\n locale,\n name,\n form,\n required,\n disabled = false,\n readOnly = false,\n visuallyHidden,\n description,\n error,\n size = \"md\",\n inputClassName,\n groupClassName,\n inputRef,\n inputProps,\n decrementLabel = `Decrease ${label}`,\n incrementLabel = `Increase ${label}`,\n className,\n \"aria-describedby\": callerDescription,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: NumberFieldProps) {\n const id = useId();\n const { invalid, ariaInvalid } = resolveInvalid(\n Boolean(error),\n inputProps?.[\"aria-invalid\"] ?? callerAriaInvalid,\n );\n const described =\n [\n description ? `${id}-description` : null,\n error ? `${id}-error` : null,\n callerDescription,\n inputProps?.[\"aria-describedby\"],\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n return (\n <div\n {...props}\n {...kb(\"numberfield\", { size, disabled, readonly: readOnly, invalid }, className)}\n >\n <label\n htmlFor={id}\n className={clsx(\"kb-numberfield-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n >\n {label}\n </label>\n <Base.Root\n id={id}\n value={value}\n onValueChange={(next) => {\n if (!disabled && !readOnly) onValueChange(next);\n }}\n min={min}\n max={max}\n step={step}\n smallStep={step}\n largeStep={step * 10}\n locale={locale}\n name={name}\n form={form}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n snapOnStep\n allowOutOfRange\n allowWheelScrub={false}\n className={clsx(\"kb-numberfield-editor\", classNames?.editor)}\n >\n <Base.Group className={clsx(\"kb-numberfield-group\", classNames?.group, groupClassName)}>\n <Base.Decrement\n aria-label={decrementLabel}\n className={clsx(\"kb-numberfield-decrement\", classNames?.decrement)}\n >\n −\n </Base.Decrement>\n <Base.Input\n {...inputProps}\n ref={inputRef}\n aria-describedby={described}\n aria-invalid={ariaInvalid}\n className={clsx(\"kb-numberfield-input\", classNames?.input, inputClassName)}\n />\n <Base.Increment\n aria-label={incrementLabel}\n className={clsx(\"kb-numberfield-increment\", classNames?.increment)}\n >\n +\n </Base.Increment>\n </Base.Group>\n </Base.Root>\n {description && (\n <p\n id={`${id}-description`}\n className={clsx(\"kb-numberfield-description\", classNames?.description)}\n >\n {description}\n </p>\n )}\n {error && (\n <p id={`${id}-error`} className={clsx(\"kb-numberfield-error\", classNames?.error)}>\n {error}\n </p>\n )}\n </div>\n );\n}\n","import { Collapsible } from \"@base-ui/react/collapsible\";\nimport { clsx } from \"clsx\";\nimport {\n type ComponentProps,\n createContext,\n type KeyboardEvent,\n type PointerEvent,\n type Ref,\n useContext,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type PanelTone = \"quiet\" | \"default\" | \"sunken\" | \"active\" | \"critical\";\nexport type PanelRail = \"none\" | \"accent\" | \"status\";\nexport type PanelDensity = \"compact\" | \"standard\";\nexport type PanelGroupDirection = \"row\" | \"column\";\n\n/** Name the region with aria-labelledby pointing at the heading inside Panel.Header. */\nexport type PanelProps = ComponentProps<\"section\"> & {\n /** Plane weight: quiet has no seam, sunken recesses, active lifts, critical warns. */\n tone?: PanelTone;\n /** Inline-start rail: accent is always accent; status follows the tone. */\n rail?: PanelRail;\n /** Padding scale. */\n density?: PanelDensity;\n /** Makes Panel.Body collapse and expand from Panel.Toggle. */\n collapsible?: boolean;\n /** Controlled open state; collapsible only. */\n open?: boolean;\n /** Initial open state; collapsible only. */\n defaultOpen?: boolean;\n /** Called when the toggle changes the open state; collapsible only. */\n onOpenChange?: (open: boolean) => void;\n};\nexport type PanelHeaderProps = ComponentProps<\"header\">;\nexport type PanelToolbarProps = ComponentProps<\"div\">;\nexport type PanelBodyProps = ComponentProps<\"div\">;\nexport type PanelFooterProps = ComponentProps<\"footer\">;\nexport type PanelWellProps = ComponentProps<\"div\">;\nexport type PanelToggleProps = Omit<Collapsible.Trigger.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type PanelGroupProps = ComponentProps<\"div\"> & {\n /** Flow of the panels inside the group. */\n direction?: PanelGroupDirection;\n};\n/** Sizes the panel right before it; the panel after it takes the rest. Needs a name. */\nexport type PanelHandleProps = Omit<ComponentProps<\"div\">, \"children\" | \"role\"> & {\n /** Controlled size of the panel before the handle, in percent of the group. */\n size?: number;\n /** Initial size when uncontrolled, in percent. */\n defaultSize?: number;\n /** Smallest size in percent; Enter collapses to it. */\n min?: number;\n /** Largest size in percent. */\n max?: number;\n /** Arrow-key change in percent. */\n step?: number;\n /** Called with the next size after a key press or drag. */\n onSizeChange?: (size: number) => void;\n} & ({ \"aria-label\": string } | { \"aria-labelledby\": string });\n\nconst NestedContext = createContext(false);\nconst CollapsibleContext = createContext(false);\nconst DirectionContext = createContext<PanelGroupDirection>(\"column\");\n\nconst paneBefore = (handle: HTMLElement | null) =>\n handle?.previousElementSibling as HTMLElement | null | undefined;\n\nfunction PanelRoot({\n tone = \"default\",\n rail = \"none\",\n density = \"standard\",\n collapsible = false,\n open,\n defaultOpen,\n onOpenChange,\n className,\n children,\n ref,\n ...props\n}: PanelProps) {\n const nested = useContext(NestedContext);\n const attrs = kb(\"panel\", { tone, rail, density, nested, collapsible }, className);\n const content = (\n <NestedContext value={true}>\n <CollapsibleContext value={collapsible}>\n <span className=\"kb-panel-glow\" aria-hidden=\"true\" />\n <span className=\"kb-panel-plate\" aria-hidden=\"true\">\n {rail !== \"none\" ? <span className=\"kb-panel-rail\" /> : null}\n </span>\n {children}\n </CollapsibleContext>\n </NestedContext>\n );\n if (!collapsible) {\n return (\n <section {...props} ref={ref} {...attrs}>\n {content}\n </section>\n );\n }\n return (\n <Collapsible.Root\n {...props}\n // Base UI types the root as a div; render swaps in the section.\n ref={ref as Ref<HTMLDivElement>}\n {...(open !== undefined ? { open } : {})}\n {...(defaultOpen !== undefined ? { defaultOpen } : {})}\n {...(onOpenChange ? { onOpenChange: (next: boolean) => onOpenChange(next) } : {})}\n render={<section />}\n {...attrs}\n >\n {content}\n </Collapsible.Root>\n );\n}\n\nfunction PanelHeader({ className, ...props }: PanelHeaderProps) {\n return <header {...props} className={clsx(\"kb-panel-header\", className)} />;\n}\n\nfunction PanelToolbar({ className, ...props }: PanelToolbarProps) {\n return <div {...props} className={clsx(\"kb-panel-toolbar\", className)} />;\n}\n\nfunction PanelBody({ className, ...props }: PanelBodyProps) {\n const collapsible = useContext(CollapsibleContext);\n const merged = clsx(\"kb-panel-body\", className);\n if (collapsible) return <Collapsible.Panel {...props} className={merged} />;\n return <div {...props} className={merged} />;\n}\n\nfunction PanelFooter({ className, ...props }: PanelFooterProps) {\n return <footer {...props} className={clsx(\"kb-panel-footer\", className)} />;\n}\n\nfunction PanelWell({ className, ...props }: PanelWellProps) {\n return <div {...props} className={clsx(\"kb-panel-well\", className)} />;\n}\n\nfunction PanelToggle({ className, ...props }: PanelToggleProps) {\n return <Collapsible.Trigger {...props} className={clsx(\"kb-panel-toggle\", className)} />;\n}\n\nfunction PanelGroup({ direction = \"column\", className, ...props }: PanelGroupProps) {\n return (\n <DirectionContext value={direction}>\n <div {...props} {...kb(\"panel-group\", { direction }, className)} />\n </DirectionContext>\n );\n}\n\nfunction PanelHandle({\n size,\n defaultSize = 50,\n min = 10,\n max = 90,\n step = 5,\n onSizeChange,\n className,\n ref,\n onKeyDown,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n ...props\n}: PanelHandleProps) {\n const row = useContext(DirectionContext) === \"row\";\n const clamp = (value: number) => Math.min(max, Math.max(min, value));\n const [inner, setInner] = useState(defaultSize);\n const current = clamp(size ?? inner);\n const [controls, setControls] = useState<string>();\n const [dragging, setDragging] = useState(false);\n const restore = useRef(current);\n const node = useRef<HTMLDivElement | null>(null);\n const fallbackId = useId();\n\n useLayoutEffect(() => {\n const target = paneBefore(node.current);\n if (!target) return;\n target.id ||= fallbackId;\n setControls(target.id);\n }, [fallbackId]);\n\n useLayoutEffect(() => {\n paneBefore(node.current)?.style.setProperty(\"--kb-panel-size\", `${current}%`);\n }, [current]);\n\n const commit = (value: number) => {\n const next = clamp(value);\n if (next === current) return;\n if (size === undefined) setInner(next);\n onSizeChange?.(next);\n };\n\n const keys: Record<string, () => number> = {\n [row ? \"ArrowLeft\" : \"ArrowUp\"]: () => current - step,\n [row ? \"ArrowRight\" : \"ArrowDown\"]: () => current + step,\n Home: () => min,\n End: () => max,\n Enter: () => {\n if (current > min) {\n restore.current = current;\n return min;\n }\n return restore.current;\n },\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n const next = keys[event.key];\n if (event.defaultPrevented || !next) return;\n event.preventDefault();\n commit(next());\n };\n\n const handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0) return;\n event.preventDefault();\n event.currentTarget.setPointerCapture?.(event.pointerId);\n setDragging(true);\n };\n\n const handlePointerMove = (event: PointerEvent<HTMLDivElement>) => {\n onPointerMove?.(event);\n const group = node.current?.parentElement?.getBoundingClientRect();\n const start = paneBefore(node.current)?.getBoundingClientRect();\n if (!dragging || !group || !start) return;\n const offset = row ? event.clientX - start.left : event.clientY - start.top;\n const length = row ? group.width : group.height;\n // One decimal keeps drags smooth without leaking float noise into aria-valuenow.\n if (length > 0) commit(Math.round((offset / length) * 1000) / 10);\n };\n\n const endDrag = (event: PointerEvent<HTMLDivElement>) => {\n event.currentTarget.releasePointerCapture?.(event.pointerId);\n setDragging(false);\n };\n\n return (\n // biome-ignore lint/a11y/useSemanticElements: a focusable splitter with a value cannot be an hr.\n <div\n {...props}\n ref={(element) => {\n node.current = element;\n if (typeof ref === \"function\") return ref(element);\n if (ref) ref.current = element;\n }}\n role=\"separator\"\n tabIndex={0}\n aria-orientation={row ? \"vertical\" : \"horizontal\"}\n aria-valuenow={current}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-controls={controls}\n onKeyDown={handleKeyDown}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={(event) => {\n onPointerUp?.(event);\n endDrag(event);\n }}\n onPointerCancel={(event) => {\n onPointerCancel?.(event);\n endDrag(event);\n }}\n {...kb(\"panel-handle\", { orientation: row ? \"vertical\" : \"horizontal\", dragging }, className)}\n />\n );\n}\n\nexport const Panel = Object.assign(PanelRoot, {\n Header: PanelHeader,\n Toolbar: PanelToolbar,\n Body: PanelBody,\n Footer: PanelFooter,\n Well: PanelWell,\n Toggle: PanelToggle,\n Group: PanelGroup,\n Handle: PanelHandle,\n});\n","import { Progress as Base } from \"@base-ui/react/progress\";\nimport { clsx } from \"clsx\";\nimport type { ReactNode } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\n/** Determinate progress with a visible label; valueText replaces the percent, e.g. \"3 of 5\". */\nexport type ProgressProps = Omit<Base.Root.Props, \"className\" | \"children\" | \"value\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Visible name of the progressbar. */\n label: ReactNode;\n /** Current value, from 0 to max. */\n value: number;\n /** Shown beside the label and announced instead of the percent. */\n valueText?: string;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"head\" | \"label\" | \"value\" | \"track\" | \"indicator\">;\n};\n\nexport function Progress({\n classNames,\n label,\n value,\n valueText,\n className,\n ...props\n}: ProgressProps) {\n return (\n <Base.Root\n {...props}\n value={value}\n {...(valueText ? { getAriaValueText: () => valueText } : {})}\n {...kb(\"progress\", {}, className)}\n >\n <div className={clsx(\"kb-progress-head\", classNames?.head)}>\n <Base.Label className={clsx(\"kb-progress-label\", classNames?.label)}>{label}</Base.Label>\n <Base.Value className={clsx(\"kb-progress-value\", classNames?.value)}>\n {(formatted) => valueText ?? formatted}\n </Base.Value>\n </div>\n <Base.Track className={clsx(\"kb-progress-track\", classNames?.track)}>\n <Base.Indicator className={clsx(\"kb-progress-indicator\", classNames?.indicator)} />\n </Base.Track>\n </Base.Root>\n );\n}\n","import { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseGroup } from \"@base-ui/react/radio-group\";\nimport { clsx } from \"clsx\";\nimport {\n type ComponentProps,\n createContext,\n type ReactNode,\n useCallback,\n useContext,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\nexport type RadioGroupProps = Omit<ComponentProps<\"div\">, \"onChange\" | \"defaultValue\"> & {\n /** Visible group label. */\n label: string;\n /** Controlled choice; null means none selected. */\n value: string | null;\n /** Receives the selected item's value. */\n onValueChange: (value: string) => void;\n /** Disable all items. */\n disabled?: boolean;\n /** Segmented visual treatment; native single-choice behavior stays shared. */\n appearance?: \"standard\" | \"segmented\";\n /** Segmented background movement; reduced motion always wins. */\n selectionMotion?: \"slide\" | \"none\";\n /** Segmented selection color. */\n selectionTone?: \"primary\" | \"neutral\";\n /** Native form field name. */\n name?: string;\n /** Helper text for group. */\n description?: string;\n /** Group error message. */\n error?: string;\n /** Keep group label accessible but visually hidden. */\n visuallyHidden?: boolean;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"label\" | \"options\" | \"description\" | \"error\">;\n};\nexport type RadioGroupItemProps = Omit<\n Radio.Root.Props<string>,\n \"className\" | \"children\" | \"render\"\n> & {\n /** Plain class on item label. */\n className?: string;\n /** Caller content supplies meaningful item label. */\n children: ReactNode;\n /** Class on focusable radio slot. */\n controlClassName?: string;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"item\" | \"control\" | \"indicator\" | \"content\">;\n};\ntype EntryData = { checked: boolean; eligible: boolean; tabIndex: number | undefined };\ntype EntryState = {\n target: string | null;\n update: (id: string, data: EntryData) => void;\n remove: (id: string) => void;\n markFocused: (id: string) => void;\n inside: boolean;\n};\nconst EntryContext = createContext<EntryState | null>(null);\n\ntype SelectionBounds = { x: number; y: number; width: number; height: number; disabled: boolean };\n\nfunction RadioOptions({\n segmented,\n className,\n children,\n}: {\n segmented: boolean;\n className: string | undefined;\n children: ReactNode;\n}) {\n const track = useRef<HTMLDivElement>(null);\n const [selection, setSelection] = useState<SelectionBounds | null>(null);\n useLayoutEffect(() => {\n const options = track.current;\n if (!options || !segmented) {\n setSelection(null);\n return;\n }\n const measure = () => {\n const control = options.querySelector<HTMLElement>(\".kb-radiogroup-control[data-checked]\");\n const item = control?.closest<HTMLLabelElement>(\".kb-radiogroup-item\");\n const next =\n item && item.offsetWidth > 0 && item.offsetHeight > 0\n ? {\n x: item.offsetLeft,\n y: item.offsetTop,\n width: item.offsetWidth,\n height: item.offsetHeight,\n disabled: control?.hasAttribute(\"data-disabled\") ?? false,\n }\n : null;\n setSelection((current) =>\n current?.x === next?.x &&\n current?.y === next?.y &&\n current?.width === next?.width &&\n current?.height === next?.height &&\n current?.disabled === next?.disabled\n ? current\n : next,\n );\n };\n const resize = typeof ResizeObserver === \"undefined\" ? null : new ResizeObserver(measure);\n const observeItems = () => {\n resize?.disconnect();\n resize?.observe(options);\n for (const item of options.querySelectorAll(\".kb-radiogroup-item\")) resize?.observe(item);\n measure();\n };\n // Observe committed selection and layout; focus may move before owner accepts value.\n const changes = new MutationObserver(observeItems);\n changes.observe(options, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"data-checked\", \"data-disabled\"],\n });\n observeItems();\n return () => {\n resize?.disconnect();\n changes.disconnect();\n };\n }, [segmented]);\n return (\n <div\n ref={track}\n className={clsx(\"kb-radiogroup-options\", className)}\n data-selection={segmented && selection ? \"\" : undefined}\n >\n {segmented && selection && (\n <span\n aria-hidden=\"true\"\n className=\"kb-radiogroup-selection\"\n data-disabled={selection.disabled ? \"\" : undefined}\n style={{\n width: selection.width,\n height: selection.height,\n transform: `translate(${selection.x}px, ${selection.y}px)`,\n }}\n />\n )}\n {children}\n </div>\n );\n}\n\nfunction RadioControl({\n checked,\n disabled,\n customTabIndex,\n ...props\n}: ComponentProps<\"span\"> & {\n checked: boolean;\n disabled: boolean;\n customTabIndex: number | undefined;\n}) {\n const entry = useContext(EntryContext);\n const update = entry?.update;\n const remove = entry?.remove;\n const id = useId();\n const eligible = !disabled && (customTabIndex === undefined || customTabIndex >= 0);\n useLayoutEffect(\n () => () => {\n remove?.(id);\n },\n [remove, id],\n );\n useLayoutEffect(() => {\n update?.(id, { checked, eligible, tabIndex: props.tabIndex });\n }, [update, id, checked, eligible, props.tabIndex]);\n // Entry follows selection; vendor retains arrow focus while user stays inside.\n const tabIndex = disabled\n ? -1\n : (customTabIndex ??\n (entry && !entry.inside && entry.target !== null\n ? entry.target === id\n ? 0\n : -1\n : props.tabIndex));\n return (\n // biome-ignore lint/a11y/noStaticElementInteractions: Base UI render props supply radio role.\n <span\n {...props}\n tabIndex={tabIndex}\n onFocus={(event) => {\n // Mark before handlers; caller may remove this control during focus.\n entry?.markFocused(id);\n props.onFocus?.(event);\n }}\n />\n );\n}\n\nfunction RadioGroupRoot({\n classNames,\n label,\n value,\n onValueChange,\n disabled = false,\n appearance = \"standard\",\n selectionMotion = \"slide\",\n selectionTone = \"primary\",\n name,\n description,\n error,\n visuallyHidden,\n className,\n children,\n onFocusCapture,\n onBlurCapture,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: RadioGroupProps) {\n const id = useId();\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const focused = useRef<string | null>(null);\n const [inside, setInside] = useState(false);\n const markFocused = useCallback((id: string) => {\n focused.current = id;\n }, []);\n const [entries, setEntries] = useState<Map<string, EntryData>>(() => new Map());\n const update = useCallback((id: string, data: EntryData) => {\n setEntries((current) => {\n const previous = current.get(id);\n if (\n previous &&\n previous.checked === data.checked &&\n previous.eligible === data.eligible &&\n previous.tabIndex === data.tabIndex\n )\n return current;\n return new Map(current).set(id, data);\n });\n }, []);\n const remove = useCallback((id: string) => {\n if (focused.current === id) {\n focused.current = null;\n setInside(false);\n }\n setEntries((current) => {\n if (!current.has(id)) return current;\n const next = new Map(current);\n next.delete(id);\n return next;\n });\n }, []);\n const eligible = [...entries].filter(([, item]) => item.eligible);\n const target =\n (eligible.find(([, item]) => item.checked) ??\n eligible.find(([, item]) => item.tabIndex === 0) ??\n eligible[0])?.[0] ?? null;\n const described =\n [\n description ? `${id}-description` : null,\n error ? `${id}-error` : null,\n props[\"aria-describedby\"],\n ]\n .filter(Boolean)\n .join(\" \") || undefined;\n return (\n <EntryContext.Provider value={{ target, update, remove, markFocused, inside }}>\n <BaseGroup<string | null>\n {...props}\n value={value}\n onFocusCapture={(event) => {\n setInside(true);\n onFocusCapture?.(event);\n }}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n focused.current = null;\n setInside(false);\n }\n onBlurCapture?.(event);\n }}\n onValueChange={(next) => {\n if (next !== null && !disabled) onValueChange(next);\n }}\n disabled={disabled}\n {...(name ? { name } : {})}\n {...kb(\n \"radiogroup\",\n {\n invalid,\n disabled,\n appearance,\n \"selection-motion\": selectionMotion,\n \"selection-tone\": selectionTone,\n },\n className,\n )}\n aria-labelledby={`${id}-label`}\n aria-describedby={described}\n aria-invalid={ariaInvalid}\n >\n <div\n className={clsx(\"kb-radiogroup-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n id={`${id}-label`}\n >\n {label}\n </div>\n <RadioOptions segmented={appearance === \"segmented\"} className={classNames?.options}>\n {children}\n </RadioOptions>\n {description && (\n <p\n id={`${id}-description`}\n className={clsx(\"kb-radiogroup-description\", classNames?.description)}\n >\n {description}\n </p>\n )}\n {error && (\n <p id={`${id}-error`} className={clsx(\"kb-radiogroup-error\", classNames?.error)}>\n {error}\n </p>\n )}\n </BaseGroup>\n </EntryContext.Provider>\n );\n}\nfunction RadioGroupItem({\n classNames,\n className,\n children,\n controlClassName,\n ...props\n}: RadioGroupItemProps) {\n return (\n // biome-ignore lint/a11y/noLabelWithoutControl: Base UI Radio.Root renders its native input inside this label.\n <label className={clsx(\"kb-radiogroup-item\", classNames?.item, className)}>\n <Radio.Root\n {...props}\n className={clsx(\"kb-radiogroup-control\", classNames?.control, controlClassName)}\n render={(controlProps, state) => (\n <RadioControl\n {...controlProps}\n checked={state.checked}\n disabled={state.disabled}\n customTabIndex={props.tabIndex}\n />\n )}\n >\n <Radio.Indicator className={clsx(\"kb-radiogroup-indicator\", classNames?.indicator)} />\n </Radio.Root>\n <span className={clsx(\"kb-radiogroup-content\", classNames?.content)}>{children}</span>\n </label>\n );\n}\nexport const RadioGroup = Object.assign(RadioGroupRoot, { Item: RadioGroupItem });\n","import { ScrollArea as Base } from \"@base-ui/react/scroll-area\";\nimport { clsx } from \"clsx\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\n/** Scrolling region that keyboard users can reach: the viewport is a named, focusable region. */\nexport type ScrollAreaProps = Omit<Base.Root.Props, \"className\" | \"children\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Accessible name of the region. */\n label: string;\n /** Height cap, any CSS length; content scrolls past it. */\n maxHeight?: string;\n /** Scrolled content. */\n children: ReactNode;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"viewport\" | \"scrollbar\" | \"thumb\">;\n};\n\nexport function ScrollArea({\n classNames,\n label,\n maxHeight,\n className,\n style,\n children,\n ...props\n}: ScrollAreaProps) {\n const vars = maxHeight ? ({ \"--_scrollarea-max-height\": maxHeight } as CSSProperties) : {};\n return (\n <Base.Root\n {...props}\n style={{ ...vars, ...(typeof style === \"object\" ? style : {}) }}\n {...kb(\"scrollarea\", {}, className)}\n >\n <Base.Viewport\n className={clsx(\"kb-scrollarea-viewport\", classNames?.viewport)}\n tabIndex={0}\n role=\"region\"\n aria-label={label}\n >\n <Base.Content>{children}</Base.Content>\n </Base.Viewport>\n <Base.Scrollbar\n className={clsx(\"kb-scrollarea-scrollbar\", classNames?.scrollbar)}\n orientation=\"vertical\"\n >\n <Base.Thumb className={clsx(\"kb-scrollarea-thumb\", classNames?.thumb)} />\n </Base.Scrollbar>\n </Base.Root>\n );\n}\n","import { Select as Base } from \"@base-ui/react/select\";\nimport { clsx } from \"clsx\";\nimport { type ComponentProps, useId, useImperativeHandle, useRef, useState } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\nexport type SelectOption = { value: string; label: string; disabled?: boolean };\nexport type SelectProps = Omit<ComponentProps<\"div\">, \"onChange\" | \"children\" | \"defaultValue\"> & {\n /** Visible label for the trigger. */\n label: string;\n /** Controlled selection; null displays the placeholder. */\n value: string | null;\n /** Receives selected value; consumers own domain transitions. */\n onValueChange: (value: string | null) => void;\n /** Unique string-valued options; an empty collection is supported. */\n options: readonly SelectOption[];\n /** Text when value is null. */\n placeholder?: string;\n /** Field helper text. */\n description?: string;\n /** Visible invalid-state message. */\n error?: string;\n /** Disable interaction and form submission. */\n disabled?: boolean;\n /** Preserve value while preventing changes. */\n readOnly?: boolean;\n /** Native form field name. */\n name?: string;\n /** Class on trigger slot. */\n controlClassName?: string;\n /** Class on popup slot. */\n popupClassName?: string;\n /** Portal host; defaults to field root to retain theme. */\n container?: Base.Portal.Props[\"container\"];\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\n | \"control\"\n | \"popup\"\n | \"label\"\n | \"icon\"\n | \"portal\"\n | \"positioner\"\n | \"list\"\n | \"item\"\n | \"indicator\"\n | \"empty\"\n | \"description\"\n | \"error\"\n >;\n};\nexport function Select({\n classNames,\n label,\n value,\n onValueChange,\n options,\n placeholder = \"Choose an option\",\n description,\n error,\n disabled = false,\n readOnly = false,\n name,\n className,\n controlClassName,\n popupClassName,\n container,\n ref,\n \"aria-describedby\": callerDescription,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: SelectProps) {\n const id = useId();\n const root = useRef<HTMLDivElement>(null);\n const trigger = useRef<HTMLButtonElement>(null);\n const popup = useRef<HTMLDivElement>(null);\n const interaction = useRef<\"pointer\" | \"keyboard\">(\"keyboard\");\n const [pointerFocus, setPointerFocus] = useState(false);\n useImperativeHandle(ref, () => root.current as HTMLDivElement);\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const empty = options.length === 0;\n const inactive = disabled || empty;\n const help =\n [description, empty && \"No options available\"].filter(Boolean).join(\" \") || undefined;\n const described =\n [help ? `${id}-description` : null, error ? `${id}-error` : null, callerDescription]\n .filter(Boolean)\n .join(\" \") || undefined;\n return (\n <div {...props} ref={root} {...kb(\"select\", { disabled: inactive, invalid }, className)}>\n <Base.Root<string>\n modal={false}\n items={options}\n value={value}\n onValueChange={(next) => {\n if (\n !inactive &&\n !readOnly &&\n (next === null || options.some((item) => item.value === next && !item.disabled))\n )\n onValueChange(next);\n }}\n disabled={inactive}\n readOnly={readOnly}\n onOpenChange={(_open, details) => {\n if (details.event.type.startsWith(\"key\")) interaction.current = \"keyboard\";\n else if (/^(pointer|mouse)/.test(details.event.type)) interaction.current = \"pointer\";\n }}\n {...(name ? { name } : {})}\n >\n <Base.Label className={clsx(\"kb-select-label\", classNames?.label)}>{label}</Base.Label>\n <Base.Trigger\n ref={trigger}\n className={clsx(\"kb-select-control\", classNames?.control, controlClassName)}\n aria-describedby={described}\n aria-invalid={ariaInvalid}\n data-pointer-focus={pointerFocus || undefined}\n onPointerDown={() => {\n interaction.current = \"pointer\";\n setPointerFocus(true);\n }}\n onKeyDown={() => {\n interaction.current = \"keyboard\";\n setPointerFocus(false);\n }}\n onBlur={() => setPointerFocus(false)}\n >\n <Base.Value placeholder={placeholder} />\n <Base.Icon className={clsx(\"kb-select-icon\", classNames?.icon)} aria-hidden=\"true\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path d=\"m4 6 4 4 4-4\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n </Base.Icon>\n </Base.Trigger>\n <Base.Portal\n container={container ?? root}\n className={clsx(\"kb-select-portal\", classNames?.portal)}\n >\n <Base.Positioner\n className={clsx(\"kb-select-positioner\", classNames?.positioner)}\n sideOffset={6}\n alignItemWithTrigger={false}\n >\n <Base.Popup\n ref={popup}\n className={clsx(\"kb-select-popup\", classNames?.popup, popupClassName)}\n onPointerDownCapture={() => {\n interaction.current = \"pointer\";\n }}\n onKeyDownCapture={() => {\n interaction.current = \"keyboard\";\n }}\n finalFocus={() => {\n const active = document.activeElement;\n if (\n active instanceof HTMLElement &&\n active !== document.body &&\n active !== trigger.current &&\n !popup.current?.contains(active) &&\n !active.hasAttribute(\"data-base-ui-focus-guard\")\n ) {\n setPointerFocus(false);\n return false;\n }\n setPointerFocus(interaction.current === \"pointer\");\n return true;\n }}\n >\n <Base.List className={clsx(\"kb-select-list\", classNames?.list)} aria-label={label}>\n {options.length ? (\n options.map((option) => (\n <Base.Item\n key={option.value}\n value={option.value}\n disabled={Boolean(option.disabled)}\n className={clsx(\"kb-select-item\", classNames?.item)}\n >\n <Base.ItemText>{option.label}</Base.ItemText>\n <Base.ItemIndicator\n className={clsx(\"kb-select-indicator\", classNames?.indicator)}\n aria-hidden=\"true\"\n >\n ✓\n </Base.ItemIndicator>\n </Base.Item>\n ))\n ) : (\n <Base.Item\n value=\"\"\n disabled\n className={clsx(\n \"kb-select-item kb-select-empty\",\n classNames?.item,\n classNames?.empty,\n )}\n >\n <Base.ItemText>No options available</Base.ItemText>\n </Base.Item>\n )}\n </Base.List>\n </Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n </Base.Root>\n {help && (\n <p\n className={clsx(\"kb-select-description\", classNames?.description)}\n id={`${id}-description`}\n >\n {help}\n </p>\n )}\n {error && (\n <p className={clsx(\"kb-select-error\", classNames?.error)} id={`${id}-error`}>\n {error}\n </p>\n )}\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type SeparatorOrientation = \"horizontal\" | \"vertical\";\nexport type SeparatorProps = Omit<\n ComponentProps<\"hr\">,\n \"children\" | \"role\" | \"aria-hidden\" | \"aria-orientation\"\n> & {\n /** Direction of the visible rule and announced separator. */\n orientation?: SeparatorOrientation;\n /** Hide a visual-only divider from assistive technology. */\n decorative?: boolean;\n};\n\nexport function Separator({\n orientation = \"horizontal\",\n decorative = false,\n className,\n ...props\n}: SeparatorProps) {\n return (\n <hr\n {...props}\n {...kb(\"separator\", { orientation }, className)}\n role={decorative ? \"none\" : undefined}\n aria-hidden={decorative ? true : undefined}\n aria-orientation={decorative ? undefined : orientation}\n />\n );\n}\n","import { clsx } from \"clsx\";\nimport { Children, createElement } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\nimport type { LayoutAlign, LayoutElementProps, LayoutGap } from \"../../utils/layout\";\n\nexport type SplitElement = \"div\" | \"section\" | \"article\";\nexport type SplitRatio = \"equal\" | \"wide-start\" | \"wide-end\";\nexport type SplitCollapse = \"sm\" | \"md\" | \"lg\";\nexport type SplitProps<T extends SplitElement = \"div\"> = LayoutElementProps<T> & {\n /** Classes for each layout-owned column track. */\n classNames?: ClassNames<\"track\">;\n /** Column proportions: 1:1, 2:1 or 1:2 in source order. */\n ratio?: SplitRatio;\n /** Available-width threshold below which columns stack. */\n collapse?: SplitCollapse;\n /** Space between columns or stacked rows. */\n gap?: LayoutGap;\n /** Cross-axis alignment while columns share a row. */\n align?: LayoutAlign;\n};\n\nexport function Split<T extends SplitElement = \"div\">({\n as,\n ratio = \"equal\",\n collapse = \"md\",\n gap = \"md\",\n align = \"stretch\",\n className,\n classNames,\n children,\n ...props\n}: SplitProps<T>) {\n const trackClassName = clsx(\"kb-split-track\", classNames?.track);\n return createElement(\n as ?? \"div\",\n { ...props, ...kb(\"split\", { ratio, collapse, gap, align }, className) },\n Children.map(children, (child) =>\n child == null ? null : <div className={trackClassName}>{child}</div>,\n ),\n );\n}\n","import { clsx } from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\nexport type StatSize = \"md\" | \"display\";\n\n/** A labelled value; the label renders first so it is read first. */\nexport type StatProps = Omit<ComponentProps<\"div\">, \"children\"> & {\n /** What the value measures. */\n label: ReactNode;\n /** The number or short text; figures are tabular. */\n value: ReactNode;\n /** Value size; display is for one headline number. */\n size?: StatSize;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"label\" | \"value\">;\n};\n\nexport function Stat({ classNames, label, value, size = \"md\", className, ...props }: StatProps) {\n return (\n <div {...props} {...kb(\"stat\", { size }, className)}>\n <span className={clsx(\"kb-stat-label\", classNames?.label)}>{label}</span>\n <span className={clsx(\"kb-stat-value\", classNames?.value)}>{value}</span>\n </div>\n );\n}\n","import { clsx } from \"clsx\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { type ClassNames, kb } from \"../../utils/kb\";\n\nexport type StatusTone = \"neutral\" | \"info\" | \"running\" | \"success\" | \"warning\" | \"blocked\";\nexport type StatusAppearance = \"plain\" | \"chip\";\n\n/** Text is mandatory: tone is never conveyed by color alone. */\nexport type StatusProps = Omit<ComponentProps<\"span\">, \"children\"> & {\n /** Visible label. */\n children: ReactNode;\n /** Meaning of the state; drives color and the icon slot's color. */\n tone?: StatusTone;\n /** Caller-provided decorative icon; kbui ships no icons. */\n icon?: ReactNode;\n /** Announce changes: adds role=\"status\" and nothing else. */\n live?: boolean;\n /** Plain text and icon, or a chip tinted from the tone. */\n appearance?: StatusAppearance;\n /** Tighter spacing and smaller text; the text stays visible. */\n compact?: boolean;\n /** Classes for inner parts, keyed by part. */\n classNames?: ClassNames<\"icon\" | \"text\">;\n};\n\nexport function Status({\n classNames,\n tone = \"neutral\",\n appearance = \"plain\",\n icon,\n live = false,\n compact = false,\n className,\n children,\n ...props\n}: StatusProps) {\n return (\n <span\n {...props}\n {...(live ? { role: \"status\" } : {})}\n {...kb(\"status\", { tone, appearance, compact }, className)}\n >\n {icon != null ? (\n <span className={clsx(\"kb-status-icon\", classNames?.icon)} aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n <span className={clsx(\"kb-status-text\", classNames?.text)}>{children}</span>\n </span>\n );\n}\n","import { clsx } from \"clsx\";\nimport { type ComponentProps, type CSSProperties, type ReactNode, useId } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\nexport type SwitchSize = \"sm\" | \"md\" | \"lg\";\nexport type SwitchTone = \"neutral\" | \"accent\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\nexport type SwitchProps = Omit<\n ComponentProps<\"input\">,\n \"type\" | \"role\" | \"checked\" | \"defaultChecked\" | \"onChange\" | \"size\" | \"children\" | \"style\"\n> & {\n /** Visible, associated label. */\n label: string;\n /** Owner controls checked state. */\n checked: boolean;\n /** Requests next checked state. */\n onCheckedChange: (checked: boolean) => void;\n /** Track size; defaults to sm inside Fieldset and md elsewhere. */\n size?: SwitchSize | undefined;\n /** Shorthand tone for the on side when onTone is omitted. */\n tone?: SwitchTone | undefined;\n /** Semantic tone for the off side. */\n offTone?: SwitchTone | undefined;\n /** Semantic tone for the on side; defaults to accent. */\n onTone?: SwitchTone | undefined;\n /** Custom CSS color or token for the off side. */\n offColor?: string | undefined;\n /** Custom CSS color or token for the on side. */\n onColor?: string | undefined;\n /** Associated helper text. */\n description?: string | undefined;\n /** Associated error; marks native control invalid for assistive technology. */\n error?: string | undefined;\n /** Hide label visually; keep its accessible name. */\n visuallyHidden?: boolean | undefined;\n /** Decorative content in off position. */\n offIcon?: ReactNode;\n /** Decorative content in on position. */\n onIcon?: ReactNode;\n /** Added to native input; className belongs to root. */\n controlClassName?: string | undefined;\n /** Native styles; custom properties also feed visible planes. */\n style?: CSSProperties | (CSSProperties & Record<`--${string}`, string | number | undefined>);\n /** Classes for inner parts, keyed by part. */\n classNames?:\n | ClassNames<\n | \"control\"\n | \"label\"\n | \"field\"\n | \"target\"\n | \"track\"\n | \"thumb\"\n | \"off\"\n | \"on\"\n | \"description\"\n | \"error\"\n >\n | undefined;\n};\n\nexport function Switch({\n classNames,\n label,\n checked,\n onCheckedChange,\n size,\n tone,\n offTone,\n onTone,\n offColor,\n onColor,\n description,\n error,\n visuallyHidden,\n offIcon,\n onIcon,\n controlClassName,\n className,\n style,\n id,\n disabled,\n readOnly,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: SwitchProps) {\n const customVars = Object.fromEntries(\n Object.entries(style ?? {}).filter(([property]) => property.startsWith(\"--\")),\n );\n const rootStyle = {\n ...customVars,\n ...(offColor ? { \"--kb-switch-off-color\": offColor } : {}),\n ...(onColor ? { \"--kb-switch-on-color\": onColor } : {}),\n } as CSSProperties;\n const resolvedOffTone = offColor ? \"custom\" : offTone;\n const resolvedOnTone = onColor ? \"custom\" : (onTone ?? tone ?? \"accent\");\n const generated = useId();\n const controlId = id ?? `kb-switch-${generated}`;\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const descriptions =\n [describedBy, description && descriptionId, error && errorId].filter(Boolean).join(\" \") ||\n undefined;\n return (\n <div\n style={rootStyle}\n {...kb(\n \"switch\",\n {\n size,\n \"off-tone\": resolvedOffTone,\n \"on-tone\": resolvedOnTone,\n checked,\n disabled,\n readonly: readOnly,\n invalid,\n },\n className,\n )}\n >\n <div className={clsx(\"kb-switch-field\", classNames?.field)}>\n <span className={clsx(\"kb-switch-target\", classNames?.target)}>\n <input\n {...props}\n style={style}\n id={controlId}\n type=\"checkbox\"\n role=\"switch\"\n aria-checked={checked}\n className={clsx(\"kb-switch-control\", classNames?.control, controlClassName)}\n checked={checked}\n disabled={disabled}\n readOnly={readOnly}\n aria-readonly={readOnly || undefined}\n aria-invalid={ariaInvalid}\n aria-describedby={descriptions}\n onChange={(event) => {\n if (!readOnly) onCheckedChange(event.currentTarget.checked);\n }}\n />\n <span className={clsx(\"kb-switch-track\", classNames?.track)} aria-hidden=\"true\">\n <span className={clsx(\"kb-switch-thumb\", classNames?.thumb)} />\n <span className={clsx(\"kb-switch-off\", classNames?.off)}>{offIcon}</span>\n <span className={clsx(\"kb-switch-on\", classNames?.on)}>{onIcon}</span>\n </span>\n </span>\n <label\n htmlFor={controlId}\n className={clsx(\"kb-switch-label\", classNames?.label, visuallyHidden && \"kb-sr-only\")}\n >\n {label}\n </label>\n </div>\n {description && (\n <p className={clsx(\"kb-switch-description\", classNames?.description)} id={descriptionId}>\n {description}\n </p>\n )}\n {error && (\n <p className={clsx(\"kb-switch-error\", classNames?.error)} id={errorId}>\n {error}\n </p>\n )}\n </div>\n );\n}\n","import { type ComponentProps, createElement } from \"react\";\nimport { kb } from \"../../utils/kb\";\n\nexport type TextElement = \"p\" | \"span\" | \"div\";\nexport type TextSize = \"sm\" | \"md\" | \"lg\";\nexport type TextTone = \"default\" | \"muted\";\nexport type TextProps<T extends TextElement = \"p\"> = ComponentProps<T> & {\n /** Native element; use span inside paragraphs and div for block children. */\n as?: T;\n /** Body size; inline links and code inherit surrounding size. */\n size?: TextSize;\n /** Default ink or secondary text with readable contrast. */\n tone?: TextTone;\n};\n\nexport function Text<T extends TextElement = \"p\">({\n as,\n size = \"md\",\n tone = \"default\",\n className,\n ...props\n}: TextProps<T>) {\n return createElement(as ?? \"p\", { ...props, ...kb(\"text\", { size, tone }, className) });\n}\n","import { clsx } from \"clsx\";\nimport { type ComponentProps, useId } from \"react\";\nimport { type ClassNames, kb, resolveInvalid } from \"../../utils/kb\";\n\nexport type TextareaResize = \"vertical\" | \"none\" | \"both\";\nexport type TextareaPart = \"label\" | \"control\" | \"description\" | \"error\";\n\nexport interface TextareaProps extends Omit<ComponentProps<\"textarea\">, \"children\"> {\n /** Visible field label and accessible name. */\n label: string;\n /** Hide the label visually while keeping its accessible name. */\n visuallyHidden?: boolean | undefined;\n /** Supporting helper text below the textarea. */\n description?: string | undefined;\n /** Validation error message; marks the textarea invalid. */\n error?: string | undefined;\n /** Drag-resize axis for the native textarea. */\n resize?: TextareaResize | undefined;\n /** Callback fired with the next string value on change. */\n onValueChange?: ((value: string) => void) | undefined;\n /** Root wrapper class name. */\n className?: string | undefined;\n /** Classes for the label, control, description and error slots. */\n classNames?: ClassNames<TextareaPart> | undefined;\n}\n\n/** Labelled multiline text control with associated helper and error messages. */\nexport const Textarea = ({\n ref,\n id,\n label,\n visuallyHidden,\n description,\n error,\n resize = \"vertical\",\n rows = 4,\n disabled,\n readOnly,\n onChange,\n onValueChange,\n className,\n classNames,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": callerAriaInvalid,\n ...props\n}: TextareaProps) => {\n const reactId = useId();\n const controlId = id ?? `kb-textarea-${reactId}`;\n const { invalid, ariaInvalid } = resolveInvalid(Boolean(error), callerAriaInvalid);\n const descriptionId = description ? `${controlId}-description` : undefined;\n const errorId = error ? `${controlId}-error` : undefined;\n const describedBy =\n [descriptionId, errorId, ariaDescribedBy].filter(Boolean).join(\" \") || undefined;\n\n return (\n <div {...kb(\"textarea\", { resize, invalid, disabled, readonly: readOnly }, className)}>\n <label\n htmlFor={controlId}\n className={clsx(\"kb-textarea-label\", visuallyHidden && \"kb-sr-only\", classNames?.label)}\n >\n {label}\n </label>\n <textarea\n {...props}\n ref={ref}\n id={controlId}\n rows={rows}\n disabled={disabled}\n readOnly={readOnly}\n aria-invalid={ariaInvalid}\n aria-describedby={describedBy}\n className={clsx(\"kb-textarea-control\", classNames?.control)}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n />\n {description ? (\n <p id={descriptionId} className={clsx(\"kb-textarea-description\", classNames?.description)}>\n {description}\n </p>\n ) : null}\n {error ? (\n <div id={errorId} className={clsx(\"kb-textarea-error\", classNames?.error)}>\n {error}\n </div>\n ) : null}\n </div>\n );\n};\n","import { Toolbar as Base } from \"@base-ui/react/toolbar\";\nimport { clsx } from \"clsx\";\nimport { Button, type ButtonVariant } from \"../Button/Button\";\n\n/** One tab stop for a row of actions; arrow keys move between them. Name it with aria-label. */\nexport type ToolbarProps = Omit<Base.Root.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type ToolbarGroupProps = Omit<Base.Group.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\nexport type ToolbarButtonProps = Omit<Base.Button.Props, \"className\" | \"render\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n /** Button weight; toolbars default to ghost. */\n variant?: ButtonVariant;\n};\nexport type ToolbarSeparatorProps = Omit<Base.Separator.Props, \"className\"> & {\n /** Plain class string; Base UI's function form is not supported. */\n className?: string;\n};\n\nfunction ToolbarRoot({ className, ...props }: ToolbarProps) {\n return <Base.Root {...props} className={clsx(\"kb-toolbar\", className)} />;\n}\n\nfunction ToolbarGroup({ className, ...props }: ToolbarGroupProps) {\n return <Base.Group {...props} className={clsx(\"kb-toolbar-group\", className)} />;\n}\n\nfunction ToolbarButton({ variant = \"ghost\", className, ...props }: ToolbarButtonProps) {\n return (\n <Base.Button\n {...props}\n render={<Button variant={variant} size=\"sm\" {...(className ? { className } : {})} />}\n />\n );\n}\n\nfunction ToolbarSeparator({ className, ...props }: ToolbarSeparatorProps) {\n return <Base.Separator {...props} className={clsx(\"kb-toolbar-separator\", className)} />;\n}\n\nexport const Toolbar = Object.assign(ToolbarRoot, {\n Group: ToolbarGroup,\n Button: ToolbarButton,\n Separator: ToolbarSeparator,\n});\n","import { Tooltip as Base } from \"@base-ui/react/tooltip\";\nimport { clsx } from \"clsx\";\nimport type { ReactElement, ReactNode, Ref } from \"react\";\n\n/** A visual hint only; the trigger still needs its own accessible name. */\nexport type TooltipProps = {\n /** Text shown in the popup. */\n content: ReactNode;\n /** The element that shows the tooltip on hover and focus. */\n children: ReactElement;\n /** Portal target for nested consumer themes. */\n container?: Base.Portal.Props[\"container\"];\n /** Plain class on popup slot. */\n className?: string;\n /** Side of the trigger the popup prefers. */\n side?: Base.Positioner.Props[\"side\"];\n /** Hover delay in ms before opening. */\n delay?: number;\n /** Ref forwarded to the popup element. */\n ref?: Ref<HTMLDivElement>;\n};\n\nexport function Tooltip({\n content,\n children,\n side = \"top\",\n delay = 400,\n container,\n className,\n ref,\n}: TooltipProps) {\n return (\n <Base.Root>\n <Base.Trigger delay={delay} render={children} />\n <Base.Portal container={container}>\n <Base.Positioner side={side} sideOffset={6}>\n <Base.Popup ref={ref} className={clsx(\"kb-tooltip\", className)}>\n {content}\n </Base.Popup>\n </Base.Positioner>\n </Base.Portal>\n </Base.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,SAAgB6B,EAAG,GAAc,IAAiB,CAAC,GAAG,GAA6B;CACjF,IAAMC,IAAe,EAAE,WAAWC,EAAK,MAAMC,KAAQC,CAAS,EAAE;CAChE,KAAK,IAAM,CAACC,GAAKC,MAAU,OAAO,QAAQC,CAAK,GAC7C,AAAID,MAAU,KAAA,KAAaA,MAAU,OACrC,EAAI,QAAQD,OAASC,MAAU,KAAO,KAAKA;CAE7C,OAAOL;AACT;AAGA,SAAgBO,EACd,GACA,GACgD;CAChD,IAAMC,IAAUC,MAAgB,KAAA,KAAaA,MAAgB,MAASA,MAAgB,SAChFC,IAAUC,KAAYH;CAC5B,OAAO;EAAE;EAAS,aAAaA,IAAUC,IAAcC,IAAU,KAAOD;CAAY;AACtF;;;ACRA,SAAgBG,EAAM,EACpB,UAAO,WACP,gBAAa,QACb,UAAO,IACP,kBAAe,IACf,cACA,GAAGC,KACU;CACb,OACE,kBAAC,QAAD;EACE,GAAIA;EACJ,GAAId,EAAG,SAAS;GAAE;GAAM;GAAY;GAAM,iBAAiBe;EAAa,GAAGX,CAAS;CACrF,CAAA;AAEL;;;ACTA,SAAgBY,EAAO,EAAE,aAAU,WAAW,UAAO,MAAM,cAAW,GAAGF,KAAsB;CAC7F,OAAO,kBAAC3C,GAAD;EAAM,GAAI2C;EAAO,GAAId,EAAG,UAAU;GAAE;GAAS;EAAK,GAAGI,CAAS;CAAI,CAAA;AAC3E;;;ACHA,SAAgBa,EAAQ,EACtB,eACA,UAAO,WACP,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