@platned/ui 0.3.0 → 0.5.1
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 +116 -16
- package/dist/index.cjs +6917 -1536
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2136 -235
- package/dist/index.d.ts +2136 -235
- package/dist/index.js +6943 -1531
- package/dist/index.js.map +1 -1
- package/dist/sidebar.cjs +1380 -197
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.d.cts +106 -7
- package/dist/sidebar.d.ts +106 -7
- package/dist/sidebar.js +1410 -211
- package/dist/sidebar.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +27 -4
- package/tailwind-preset.cjs +109 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/forms/button.tsx","../src/components/forms/icon-button.tsx","../src/components/forms/button-group.tsx","../src/components/avatar/avatar.tsx","../src/components/avatar/avatar-group.tsx","../src/components/avatar/avatar-block.tsx","../src/components/forms/input.tsx","../src/components/forms/textarea.tsx","../src/components/forms/select.tsx","../src/components/forms/date-picker.tsx","../src/components/forms/stepper.tsx","../src/components/forms/multiselect-card.tsx","../src/components/forms/toggle.tsx","../src/components/forms/file-drop-zone.tsx","../src/components/forms/form-card.tsx","../src/components/status/badge.tsx","../src/components/status/role-badge.tsx","../src/components/forms/role-combo-box.tsx","../src/components/status/status-badge.tsx","../src/components/status/status-dot.tsx","../src/components/status/status-chip.tsx","../src/components/status/count-badge.tsx","../src/components/status/tag-pill.tsx","../src/components/status/trail-chip.tsx","../src/components/status/user-status-pill.tsx","../src/components/status/check-indicator.tsx","../src/components/status/entity-icon-badge.tsx","../src/components/forms/checkbox.tsx","../src/components/forms/segmented-control.tsx","../src/components/overlays/modal.tsx","../src/lib/cn.ts","../src/components/overlays/overlay.ts","../src/components/overlays/drawer.tsx","../src/components/overlays/confirm-dialog.tsx","../src/components/overlays/note-confirm-modal.tsx","../src/components/overlays/dropdown-menu.tsx","../src/components/cards/card.tsx","../src/components/chrome/page-heading.tsx","../src/components/chrome/page-toolbar.tsx","../src/components/chrome/filter-bar.tsx","../src/components/chrome/tabs.tsx","../src/components/chrome/nav-item.tsx","../src/components/chrome/eyebrow-label.tsx","../src/components/widgets/widget-header.tsx","../src/components/widgets/widget-title.tsx","../src/components/widgets/widget-footer.tsx","../src/components/stats/stat-tile.tsx","../src/components/stats/stat-number.tsx","../src/components/stats/score-value.tsx","../src/components/stats/tile-grid.tsx","../src/components/charts/chart-tone.ts","../src/components/charts/bar-chart.tsx","../src/components/charts/donut-chart.tsx","../src/components/charts/radial-gauge.tsx","../src/components/charts/sparkline.tsx","../src/components/charts/mini-bar-chart.tsx","../src/components/charts/chart-legend.tsx","../src/components/charts/legend-dot.tsx","../src/components/charts/trend-label.tsx","../src/components/lists/list-row.tsx","../src/components/lists/file-row.tsx","../src/components/lists/scored-row.tsx","../src/components/lists/ranked-row.tsx","../src/components/feedback/progress-bar.tsx","../src/components/lists/icon-text-row.tsx","../src/components/lists/checklist-row.tsx","../src/components/lists/numbered-steps-list.tsx","../src/components/lists/meta-field.tsx","../src/components/lists/checked-group-list.tsx","../src/components/lists/data-table.tsx","../src/components/feedback/inline-alert.tsx","../src/components/feedback/empty-state.tsx","../src/components/forms/password-input.tsx","../src/components/ai/ai-chat-bar.tsx","../src/components/ai/ai-suggestion-chip.tsx","../src/components/ai/quick-actions-bar.tsx","../src/components/decorative/aurora-backdrop.tsx","../src/components/icons/solid.tsx"],"sourcesContent":["import { type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'subtle' | 'danger' | 'danger-subtle';\nexport type ButtonSize = 'lg' | 'md' | 'sm';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n}\n\nconst variantStyles: Record<ButtonVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n neutral: clsx(\n 'bg-default border border-default text-default',\n 'hover:bg-default-hover hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n subtle: clsx(\n // border-transparent holds space so hover border doesn't shift layout\n 'bg-transparent border border-transparent text-neutral',\n 'hover:border-default hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n danger: clsx(\n 'bg-danger border border-danger-secondary text-danger-on-danger',\n // border shifts from danger-secondary → danger-default on hover (Figma spec)\n 'hover:bg-danger-hover hover:border-danger',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n 'danger-subtle': clsx(\n // border-transparent base avoids layout shift when hover border appears\n 'bg-transparent border border-transparent text-danger',\n 'hover:bg-danger-tertiary-hover hover:border-danger',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5',\n md: 'h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5',\n sm: 'h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4',\n};\n\nexport function Button({\n variant = 'primary',\n size = 'md',\n leadingIcon,\n trailingIcon,\n children,\n className,\n ...props\n}: ButtonProps) {\n return (\n <button\n className={clsx(\n 'inline-flex items-center justify-center whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n 'disabled:cursor-not-allowed',\n variantStyles[variant],\n sizeStyles[size],\n className,\n )}\n {...props}\n >\n {leadingIcon}\n <div className='px-1'>{children}</div>\n {trailingIcon}\n </button>\n );\n}\n","import { type ButtonHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { type ButtonSize } from './button';\n\nexport type IconButtonVariant = 'primary' | 'neutral' | 'subtle';\n\nexport interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: IconButtonVariant;\n size?: ButtonSize;\n /** Required for accessibility — no visible text label */\n 'aria-label': string;\n}\n\nconst variantStyles: Record<IconButtonVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n // Neutral uses secondary background (light gray) for visual weight without a text label\n neutral: clsx(\n 'bg-default-secondary border border-default text-default',\n // icon turns brand blue on hover (Figma spec)\n 'hover:bg-default-secondary-hover hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n subtle: clsx(\n 'bg-transparent text-neutral',\n // hover uses background-default-default-hover (#f5f5f5), icon turns brand blue (Figma spec)\n 'hover:bg-default-hover hover:text-brand',\n // disabled needs explicit border since there is no base border\n 'disabled:bg-disabled disabled:border disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'size-12 rounded-2xl [&_svg]:size-5',\n md: 'size-9 rounded-lg [&_svg]:size-5',\n sm: 'size-6 rounded-full [&_svg]:size-4',\n};\n\nexport function IconButton({\n variant = 'primary',\n size = 'md',\n children,\n className,\n ...props\n}: IconButtonProps) {\n return (\n <button\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n 'disabled:cursor-not-allowed',\n variantStyles[variant],\n sizeStyles[size],\n className,\n )}\n {...props}\n >\n {children}\n </button>\n );\n}\n","import { type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { type ButtonSize } from './button';\n\nexport type ButtonGroupVariant = 'primary' | 'neutral' | 'filter';\nexport type ButtonGroupAlign = 'justify' | 'start' | 'end' | 'center' | 'stack';\n\nexport interface ButtonGroupItem {\n value: string;\n label: ReactNode;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n disabled?: boolean;\n}\n\nexport interface ButtonGroupProps {\n items: ButtonGroupItem[];\n value: string;\n onChange: (value: string) => void;\n variant?: ButtonGroupVariant;\n size?: ButtonSize;\n align?: ButtonGroupAlign;\n /** Forwarded to the container as aria-label */\n 'aria-label'?: string;\n className?: string;\n}\n\nconst containerStyles: Record<ButtonGroupVariant, string> = {\n primary: 'bg-neutral-tertiary p-1 rounded-2xl',\n neutral: 'bg-neutral-tertiary p-1 rounded-2xl',\n filter: 'bg-default border border-default p-1 rounded-xl',\n};\n\nconst selectedStyles: Record<ButtonGroupVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n ),\n neutral: clsx(\n 'bg-default border border-default text-default',\n 'hover:bg-default-hover',\n ),\n filter: clsx(\n 'bg-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n ),\n};\n\nconst unselectedStyles: Record<ButtonGroupVariant, string> = {\n primary: clsx('bg-transparent text-neutral', 'hover:bg-neutral-tertiary-hover'),\n neutral: clsx('bg-transparent text-neutral', 'hover:bg-neutral-tertiary-hover'),\n filter: clsx('text-default-secondary', 'hover:text-default'),\n};\n\nconst itemSizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5',\n md: 'h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5',\n sm: 'h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4',\n};\n\nconst containerAlignStyles: Record<ButtonGroupAlign, string> = {\n justify: 'flex flex-row items-center',\n start: 'flex flex-row items-center justify-start',\n end: 'flex flex-row items-center justify-end',\n center: 'flex flex-row items-center justify-center',\n stack: 'flex flex-col items-center',\n};\n\nexport function ButtonGroup({\n items,\n value,\n onChange,\n variant = 'primary',\n size = 'md',\n align = 'start',\n className,\n 'aria-label': ariaLabel,\n}: ButtonGroupProps) {\n const isJustify = align === 'justify';\n const isStack = align === 'stack';\n\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n className={clsx(\n containerStyles[variant],\n containerAlignStyles[align],\n className,\n )}\n >\n {items.map((item) => {\n const isSelected = item.value === value;\n return (\n <div\n key={item.value}\n className={clsx(isJustify && 'flex-1 min-w-0', isStack && 'w-full')}\n >\n <button\n type=\"button\"\n aria-pressed={isSelected}\n disabled={item.disabled}\n onClick={() => onChange(item.value)}\n className={clsx(\n 'inline-flex items-center justify-center whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n (isJustify || isStack) && 'w-full',\n itemSizeStyles[size],\n isSelected ? selectedStyles[variant] : unselectedStyles[variant],\n )}\n >\n {item.leadingIcon}\n <div className='px-1'>{item.label}</div>\n {item.trailingIcon}\n </button>\n </div>\n );\n })}\n </div>\n );\n}\n","import clsx from 'clsx';\n\nexport type AvatarSize = 'sm' | 'md' | 'lg';\nexport type AvatarShape = 'circle' | 'square';\n\nexport interface AvatarInitialProps {\n type?: 'initial';\n /** Single character — Figma spec: one letter only to avoid overflow */\n initial: string;\n size?: AvatarSize;\n shape?: AvatarShape;\n className?: string;\n}\n\nexport interface AvatarImageProps {\n type: 'image';\n src: string;\n alt?: string;\n size?: AvatarSize;\n shape?: AvatarShape;\n className?: string;\n}\n\nexport type AvatarProps = AvatarInitialProps | AvatarImageProps;\n\n// Figma sizes: lg=40px, md=32px, sm=24px\nconst sizeStyles: Record<AvatarSize, string> = {\n lg: 'size-10',\n md: 'size-8',\n sm: 'size-6',\n};\n\n// Figma text sizes for initials: body-medium at lg, scales down proportionally\nconst initialTextStyles: Record<AvatarSize, string> = {\n lg: 'text-body font-semibold',\n md: 'text-body-xs font-semibold',\n sm: 'text-body-tiny font-semibold',\n};\n\n// Figma shape radii: circle=full, square: lg/md=8px (rounded-lg), sm=4px (rounded)\nfunction getShapeClass(shape: AvatarShape, size: AvatarSize): string {\n if (shape === 'circle') return 'rounded-full';\n return size === 'sm' ? 'rounded' : 'rounded-lg';\n}\n\nexport function Avatar(props: AvatarProps) {\n const { size = 'lg', shape = 'circle', className } = props;\n\n const base = clsx(\n 'shrink-0 overflow-hidden',\n sizeStyles[size],\n getShapeClass(shape, size),\n className,\n );\n\n if (props.type === 'image') {\n return (\n <div className={base}>\n <img\n src={props.src}\n alt={props.alt ?? ''}\n className=\"size-full object-cover\"\n />\n </div>\n );\n }\n\n return (\n <div\n className={clsx(base, 'flex items-center justify-center')}\n style={{\n background:\n 'linear-gradient(135deg, var(--color-graphic-blue) 30%, var(--color-graphic-red) 100%)',\n }}\n >\n <span\n className={clsx(\n 'select-none leading-none text-brand-on-brand',\n initialTextStyles[size],\n )}\n >\n {props.initial.charAt(0).toUpperCase()}\n </span>\n </div>\n );\n}\n","import { type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type AvatarGroupSpacing = 'spaced' | 'overlap';\n\nexport interface AvatarGroupProps {\n children: ReactNode;\n /** Number shown in the overflow badge — omit to hide the badge */\n overflow?: number;\n spacing?: AvatarGroupSpacing;\n className?: string;\n}\n\nexport function AvatarGroup({\n children,\n overflow,\n spacing = 'spaced',\n className,\n}: AvatarGroupProps) {\n return (\n <div\n className={clsx(\n 'flex items-center',\n spacing === 'spaced' ? 'gap-1' : '-space-x-2 isolate',\n className,\n )}\n >\n {children}\n {overflow !== undefined && (\n <div\n className={clsx(\n 'flex items-center justify-center',\n 'min-w-6 h-6 px-1 rounded-lg',\n 'bg-default-secondary text-default-secondary text-body-sm',\n spacing === 'overlap' && 'drop-shadow-sm',\n )}\n >\n +{overflow}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface AvatarBlockProps {\n children: ReactNode;\n title: string;\n description?: string;\n className?: string;\n}\n\nexport function AvatarBlock({ children, title, description, className }: AvatarBlockProps) {\n return (\n <div className={clsx('flex items-start gap-3', className)}>\n <div className=\"shrink-0\">{children}</div>\n <div className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"text-body font-semibold text-default-secondary\">\n {title}\n </span>\n {description && (\n <span className=\"text-body text-default-tertiary\">\n {description}\n </span>\n )}\n </div>\n </div>\n );\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type InputSize = 'lg' | 'md' | 'sm';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n label?: string;\n description?: string;\n /** Red border + message shown below the input */\n error?: string;\n /** Neutral helper text shown below the input (hidden when error is set) */\n hint?: string;\n size?: InputSize;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n /** Interactive trailing slot (e.g. a show/hide password button) — unlike\n * `trailingIcon` it receives pointer events. */\n trailingAction?: ReactNode;\n}\n\n// Figma sizes: lg=48px md=36px sm=24px\nconst wrapGap: Record<InputSize, string> = {\n lg: 'gap-2', // 8px\n md: 'gap-1', // 4px\n sm: 'gap-0.5', // 2px\n};\n\nconst labelText: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\nconst inputBase: Record<InputSize, string> = {\n lg: 'h-12 px-5 py-3.5 text-body',\n md: 'h-9 px-4 py-2.5 text-body-sm',\n sm: 'h-6 px-3 py-[5px] text-body-tiny',\n};\n\n// Extra left padding to clear the leading icon\n// lg adds 8px for the explicit flex gap Figma uses on large; md/sm have no gap\nconst leadingPad: Record<InputSize, string> = {\n lg: 'pl-12',\n md: 'pl-8',\n sm: 'pl-6',\n};\n\n// Extra right padding to clear the trailing icon\nconst trailingPad: Record<InputSize, string> = {\n lg: 'pr-12',\n md: 'pr-8',\n sm: 'pr-6',\n};\n\n// Icon wrapper: absolutely positioned inside the input container\nconst iconWrap: Record<InputSize, { left: string; right: string; size: string }> = {\n lg: { left: 'left-4', right: 'right-4', size: 'size-5' },\n md: { left: 'left-3', right: 'right-3', size: 'size-4' },\n sm: { left: 'left-2', right: 'right-2', size: 'size-3' },\n};\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, description, error, hint, size = 'md', leadingIcon, trailingIcon, trailingAction, className, disabled, id, ...props },\n ref,\n) {\n const hasError = !!error;\n const iw = iconWrap[size];\n\n return (\n <div className={clsx('flex flex-col', wrapGap[size], className)}>\n {label && (\n <label\n htmlFor={id}\n className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default')}\n >\n {label}\n </label>\n )}\n {description && (\n <p className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default-secondary')}>\n {description}\n </p>\n )}\n <div className=\"relative flex items-center\">\n {leadingIcon && (\n <span className={clsx('pointer-events-none absolute', iw.left, iw.size, 'flex items-center justify-center text-icon-default-secondary')}>\n {leadingIcon}\n </span>\n )}\n <input\n ref={ref}\n id={id}\n disabled={disabled}\n className={clsx(\n 'w-full rounded-lg border outline-none transition-colors',\n 'bg-default text-default',\n 'placeholder:text-default-tertiary',\n inputBase[size],\n leadingIcon && leadingPad[size],\n (trailingIcon || trailingAction) && trailingPad[size],\n disabled\n ? 'cursor-not-allowed bg-disabled border-disabled text-disabled placeholder:text-disabled'\n : hasError\n ? 'border-danger-secondary focus:border-danger-secondary focus:ring-1 focus:ring-danger-secondary'\n : 'border-default focus:border-brand-secondary focus:ring-1 focus:ring-brand-secondary',\n )}\n {...props}\n />\n {trailingIcon && !trailingAction && (\n <span className={clsx('pointer-events-none absolute', iw.right, iw.size, 'flex items-center justify-center text-icon-default-secondary')}>\n {trailingIcon}\n </span>\n )}\n {trailingAction && (\n <span className={clsx('absolute', iw.right, 'flex items-center justify-center text-icon-default-secondary')}>\n {trailingAction}\n </span>\n )}\n </div>\n {hasError && (\n <p className={clsx(labelText[size], 'text-danger')}>{error}</p>\n )}\n {!hasError && hint && (\n <p className={clsx(labelText[size], 'text-default')}>{hint}</p>\n )}\n </div>\n );\n});\n","import { forwardRef, type TextareaHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { type InputSize } from './input';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n label?: string;\n description?: string;\n error?: string;\n hint?: string;\n size?: InputSize;\n}\n\n// Figma sizes — min-heights derived from Figma textarea frame heights\nconst wrapGap: Record<InputSize, string> = {\n lg: 'gap-2',\n md: 'gap-1',\n sm: 'gap-0.5',\n};\n\nconst labelText: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\n// Figma: large textarea inner height ~80px, medium ~68px, small ~52px\nconst textareaBase: Record<InputSize, string> = {\n lg: 'min-h-20 px-4 py-3.5 text-body',\n md: 'min-h-[68px] px-3 py-2.5 text-body-sm',\n sm: 'min-h-[52px] px-2 py-[5px] text-body-tiny',\n};\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { label, description, error, hint, size = 'md', className, disabled, id, ...props },\n ref,\n) {\n const hasError = !!error;\n\n return (\n <div className={clsx('flex flex-col', wrapGap[size], className)}>\n {label && (\n <label\n htmlFor={id}\n className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default')}\n >\n {label}\n </label>\n )}\n {description && (\n <p className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default-secondary')}>\n {description}\n </p>\n )}\n <textarea\n ref={ref}\n id={id}\n disabled={disabled}\n className={clsx(\n 'w-full rounded-lg border outline-none transition-colors resize-y',\n 'bg-default text-default',\n 'placeholder:text-default-tertiary',\n textareaBase[size],\n disabled\n ? 'cursor-not-allowed bg-disabled border-disabled text-disabled placeholder:text-disabled resize-none'\n : hasError\n ? 'border-danger-secondary focus:border-danger-secondary focus:ring-1 focus:ring-danger-secondary'\n : 'border-default focus:border-brand-secondary focus:ring-1 focus:ring-brand-secondary',\n )}\n {...props}\n />\n {hasError && (\n <p className={clsx(labelText[size], 'text-danger')}>{error}</p>\n )}\n {!hasError && hint && (\n <p className={clsx(labelText[size], 'text-default-secondary')}>{hint}</p>\n )}\n </div>\n );\n});\n","import { forwardRef, type SelectHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { LuChevronDown } from 'react-icons/lu';\nimport { type InputSize } from './input';\n\nexport interface SelectOption {\n value: string;\n label: string;\n}\n\nexport interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {\n label?: string;\n description?: string;\n error?: string;\n hint?: string;\n size?: InputSize;\n options: SelectOption[];\n placeholder?: string;\n}\n\nconst wrapGap: Record<InputSize, string> = {\n lg: 'gap-2',\n md: 'gap-1',\n sm: 'gap-0.5',\n};\n\nconst labelText: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\n// pr = chevron right-offset + chevron width (exact minimum to clear the icon)\nconst selectBase: Record<InputSize, string> = {\n lg: 'h-12 pl-4 pr-9 text-body', // right-4 (16) + size-5 (20) = 36px\n md: 'h-9 pl-3 pr-7 text-body-sm', // right-3 (12) + size-4 (16) = 28px\n sm: 'h-6 pl-2 pr-5 text-body-tiny', // right-2 (8) + size-3 (12) = 20px\n};\n\n// Chevron icon size + position per size\nconst chevronPos: Record<InputSize, { right: string; size: string }> = {\n lg: { right: 'right-4', size: 'size-5' },\n md: { right: 'right-3', size: 'size-4' },\n sm: { right: 'right-2', size: 'size-3' },\n};\n\n\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { label, description, error, hint, size = 'md', options, placeholder, className, disabled, id, ...props },\n ref,\n) {\n const hasError = !!error;\n const cp = chevronPos[size];\n\n return (\n <div className={clsx('flex flex-col', wrapGap[size], className)}>\n {label && (\n <label\n htmlFor={id}\n className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default')}\n >\n {label}\n </label>\n )}\n {description && (\n <p className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default-secondary')}>\n {description}\n </p>\n )}\n <div className=\"relative flex items-center\">\n <select\n ref={ref}\n id={id}\n disabled={disabled}\n className={clsx(\n 'w-full appearance-none rounded-lg border outline-none transition-colors pt-0.5',\n 'bg-default text-default',\n selectBase[size],\n disabled\n ? 'cursor-not-allowed bg-disabled border-disabled text-disabled'\n : hasError\n ? 'border-danger-secondary focus:border-danger-secondary focus:ring-1 focus:ring-danger-secondary'\n : 'border-default focus:border-brand-secondary focus:ring-1 focus:ring-brand-secondary',\n )}\n {...props}\n >\n {placeholder && (\n <option value=\"\" disabled>\n {placeholder}\n </option>\n )}\n {options.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n <span\n className={clsx(\n 'pointer-events-none absolute',\n cp.right, cp.size,\n 'flex items-center justify-center',\n disabled ? 'text-icon-disabled' : 'text-icon-default-secondary',\n )}\n >\n <LuChevronDown className=\"size-full\" />\n </span>\n </div>\n {hasError && (\n <p className={clsx(labelText[size], 'text-danger')}>{error}</p>\n )}\n {!hasError && hint && (\n <p className={clsx(labelText[size], 'text-default-secondary')}>{hint}</p>\n )}\n </div>\n );\n});\n","import { forwardRef, type InputHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { LuCalendar } from 'react-icons/lu';\nimport { type InputSize } from './input';\n\nexport interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n label?: string;\n description?: string;\n error?: string;\n hint?: string;\n size?: InputSize;\n}\n\nconst wrapGap: Record<InputSize, string> = {\n lg: 'gap-2',\n md: 'gap-1',\n sm: 'gap-0.5',\n};\n\nconst labelText: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\nconst inputBase: Record<InputSize, string> = {\n lg: 'h-12 px-5 py-3.5 pr-12 text-body',\n md: 'h-9 px-4 py-2.5 pr-8 text-body-sm',\n sm: 'h-6 px-3 py-[5px] pr-6 text-body-tiny',\n};\n\nconst iconWrap: Record<InputSize, { right: string; size: string }> = {\n lg: { right: 'right-4', size: 'size-5' },\n md: { right: 'right-3', size: 'size-4' },\n sm: { right: 'right-2', size: 'size-3' },\n};\n\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n { label, description, error, hint, size = 'md', className, disabled, id, ...props },\n ref,\n) {\n const hasError = !!error;\n const iw = iconWrap[size];\n\n return (\n <div className={clsx('flex flex-col', wrapGap[size], className)}>\n {label && (\n <label\n htmlFor={id}\n className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default')}\n >\n {label}\n </label>\n )}\n {description && (\n <p className={clsx(labelText[size], disabled ? 'text-disabled' : 'text-default-secondary')}>\n {description}\n </p>\n )}\n <div className=\"relative flex items-center\">\n <input\n ref={ref}\n id={id}\n type=\"date\"\n disabled={disabled}\n className={clsx(\n 'w-full rounded-lg border outline-none transition-colors',\n 'bg-default text-default',\n '[&::-webkit-calendar-picker-indicator]:opacity-0',\n '[&::-webkit-calendar-picker-indicator]:absolute',\n '[&::-webkit-calendar-picker-indicator]:right-0',\n '[&::-webkit-calendar-picker-indicator]:h-full',\n '[&::-webkit-calendar-picker-indicator]:w-10',\n '[&::-webkit-calendar-picker-indicator]:cursor-pointer',\n inputBase[size],\n disabled\n ? 'cursor-not-allowed bg-disabled border-disabled text-disabled'\n : hasError\n ? 'border-danger-secondary focus:border-danger-secondary focus:ring-1 focus:ring-danger-secondary'\n : 'border-default focus:border-brand-secondary focus:ring-1 focus:ring-brand-secondary',\n )}\n {...props}\n />\n <span\n className={clsx(\n 'pointer-events-none absolute',\n iw.right, iw.size,\n 'flex items-center justify-center',\n disabled ? 'text-icon-disabled' : 'text-icon-default-secondary',\n )}\n >\n <LuCalendar className=\"size-full\" />\n </span>\n </div>\n {hasError && (\n <p className={clsx(labelText[size], 'text-danger')}>{error}</p>\n )}\n {!hasError && hint && (\n <p className={clsx(labelText[size], 'text-default')}>{hint}</p>\n )}\n </div>\n );\n});\n","import clsx from 'clsx';\nimport { LuCheck, LuChevronRight } from 'react-icons/lu';\n\nexport type StepStatus = 'complete' | 'active' | 'upcoming';\n\nexport interface StepItem {\n label: string;\n status: StepStatus;\n}\n\nexport interface StepperProps {\n steps: StepItem[];\n className?: string;\n}\n\nfunction StepIndicator({ status }: { status: StepStatus }) {\n if (status === 'complete') {\n return (\n <span className=\"flex size-5 shrink-0 items-center justify-center rounded-full bg-brand text-white\">\n <LuCheck size={11} aria-hidden />\n </span>\n );\n }\n\n if (status === 'active') {\n return (\n <span className=\"flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-brand-emphasis\">\n <span className=\"size-2.5 rounded-full bg-brand\" />\n </span>\n );\n }\n\n return (\n <span className=\"size-5 shrink-0 rounded-full border-2 border-disabled\" aria-hidden=\"true\" />\n );\n}\n\nfunction ChevronSeparator() {\n return <LuChevronRight className=\"mx-1 size-4 shrink-0 text-default-tertiary\" aria-hidden />;\n}\n\nconst labelClass: Record<StepStatus, string> = {\n complete: 'text-brand font-semibold',\n active: 'text-brand font-semibold',\n upcoming: 'text-disabled font-regular',\n};\n\nexport function Stepper({ steps, className }: StepperProps) {\n return (\n <ol\n className={clsx('flex items-center overflow-x-auto', className)}\n aria-label=\"Progress\"\n >\n {steps.map((step, i) => (\n <li\n key={i}\n className=\"flex items-center\"\n aria-current={step.status === 'active' ? 'step' : undefined}\n >\n <span className=\"flex items-center gap-1.5\">\n <StepIndicator status={step.status} />\n <span className={clsx('text-body-xs whitespace-nowrap', labelClass[step.status])}>\n {step.label}\n </span>\n </span>\n {i < steps.length - 1 && <ChevronSeparator />}\n </li>\n ))}\n </ol>\n );\n}\n","import clsx from 'clsx';\nimport { type ReactNode } from 'react';\nimport { LuCheck } from 'react-icons/lu';\n\nexport interface MultiSelectCardProps {\n icon: ReactNode;\n title: string;\n description?: string;\n selected: boolean;\n onToggle: () => void;\n className?: string;\n}\n\nexport function MultiSelectCard({\n icon,\n title,\n description,\n selected,\n onToggle,\n className,\n}: MultiSelectCardProps) {\n return (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={selected}\n onClick={onToggle}\n className={clsx(\n 'relative w-full rounded-2xl border-2 p-4 text-left transition-all',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n selected\n ? 'border-brand bg-brand-tertiary'\n : 'border-default bg-default hover:border-default-secondary',\n className,\n )}\n >\n <div className=\"flex items-start justify-between gap-2\">\n <span\n className={clsx(\n 'flex size-10 shrink-0 items-center justify-center rounded-xl',\n selected ? 'bg-brand' : 'bg-brand-tertiary',\n )}\n >\n <span className={clsx('size-5', selected ? 'text-icon-brand-on-brand' : 'text-icon-brand')}>\n {icon}\n </span>\n </span>\n\n {selected ? (\n <span className=\"flex size-5 shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand\">\n <LuCheck className=\"size-3\" strokeWidth={2.5} aria-hidden />\n </span>\n ) : (\n <span\n className=\"size-5 shrink-0 rounded-full border-2 border-default\"\n aria-hidden=\"true\"\n />\n )}\n </div>\n\n <div className=\"mt-3\">\n <p\n className={clsx(\n 'text-body-sm font-semibold',\n selected ? 'text-brand' : 'text-default',\n )}\n >\n {title}\n </p>\n {description && (\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{description}</p>\n )}\n </div>\n </button>\n );\n}\n","import clsx from 'clsx';\n\nexport type ToggleSize = 'sm' | 'md';\n\nexport interface ToggleProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n /** Visible text beside the switch. Doubles as the accessible name. */\n label?: string;\n /** Track size. `sm` is 36×20, `md` is 44×24. */\n size?: ToggleSize;\n disabled?: boolean;\n id?: string;\n /** Accessible name when there is no visible `label`. */\n 'aria-label'?: string;\n /** Points at the id of an existing visible label elsewhere on the page. */\n 'aria-labelledby'?: string;\n className?: string;\n}\n\n/**\n * Track / knob geometry, straight from the Figma `_Toggle base` component.\n * The knob sits on a 2px inset, so travel = track width − knob − (2 × inset).\n */\nconst SIZE: Record<ToggleSize, { track: string; knob: string; translate: string }> = {\n sm: { track: 'h-5 w-9', knob: 'size-4', translate: 'translate-x-4' },\n md: { track: 'h-6 w-11', knob: 'size-5', translate: 'translate-x-5' },\n};\n\nexport function Toggle({\n checked,\n onChange,\n label,\n size = 'md',\n disabled = false,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n className,\n}: ToggleProps) {\n const s = SIZE[size];\n return (\n <button\n type=\"button\"\n role=\"switch\"\n id={id}\n aria-checked={checked}\n // With no visible label the switch would otherwise ship with no accessible name.\n aria-label={label ? undefined : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n disabled={disabled}\n onClick={() => onChange(!checked)}\n className={clsx(\n 'group flex items-center gap-2',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n disabled && 'cursor-not-allowed opacity-50',\n className,\n )}\n >\n <span\n className={clsx(\n 'relative inline-flex shrink-0 rounded-full transition-colors',\n s.track,\n // The unchecked track is borderless per the spec. A border here would also\n // shift the knob's rendered inset by 1px between states, since the knob is\n // positioned against the padding box.\n disabled\n ? 'bg-disabled'\n : checked\n ? 'bg-brand group-hover:bg-brand-hover'\n : 'bg-default-secondary group-hover:bg-default-secondary-hover',\n )}\n >\n <span\n className={clsx(\n 'absolute left-0.5 top-0.5 rounded-full bg-default shadow-sm transition-transform',\n s.knob,\n checked ? s.translate : 'translate-x-0',\n )}\n />\n </span>\n {label && <span className=\"text-body-xs text-default\">{label}</span>}\n </button>\n );\n}\n","import { useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { LuUpload } from 'react-icons/lu';\n\nexport interface FileDropZoneProps {\n className?: string;\n /** Caption shown under \"Upload file\". Defaults to the generic document hint. */\n description?: string;\n accept?: string;\n /** Files above this size are rejected before any upload starts. */\n maxSizeBytes?: number;\n onFileSelected?: (file: File) => void;\n disabled?: boolean;\n}\n\nconst DEFAULT_ACCEPT = '.pdf,.jpg,.jpeg,.png';\nconst DEFAULT_MAX_SIZE_BYTES = 10 * 1024 * 1024;\n\nfunction formatSize(bytes: number): string {\n const mb = bytes / (1024 * 1024);\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const extensions = accept\n .split(',')\n .map((part) => part.trim().toLowerCase())\n .filter((part) => part.startsWith('.'));\n if (extensions.length === 0) {\n return true;\n }\n return extensions.some((extension) => file.name.toLowerCase().endsWith(extension));\n}\n\nexport function FileDropZone({\n className,\n description = 'Drag & drop or browse · PDF, JPG, PNG · up to 10 MB',\n accept = DEFAULT_ACCEPT,\n maxSizeBytes = DEFAULT_MAX_SIZE_BYTES,\n onFileSelected,\n disabled = false,\n}: FileDropZoneProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n function handleFiles(files: FileList | null) {\n const file = files?.[0];\n if (!file) {\n return;\n }\n if (!matchesAccept(file, accept)) {\n setError(`Unsupported file type. Allowed: ${accept}.`);\n return;\n }\n if (file.size > maxSizeBytes) {\n setError(`That file is ${formatSize(file.size)}. The limit is ${formatSize(maxSizeBytes)}.`);\n return;\n }\n setError(null);\n onFileSelected?.(file);\n }\n\n return (\n <>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n className=\"sr-only\"\n tabIndex={-1}\n disabled={disabled}\n onChange={(e) => {\n handleFiles(e.target.files);\n e.target.value = '';\n }}\n />\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled}\n onClick={() => { if (!disabled) inputRef.current?.click(); }}\n onKeyDown={(e) => {\n if (!disabled && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n inputRef.current?.click();\n }\n }}\n onDragOver={(e) => { e.preventDefault(); if (!disabled) setIsDragging(true); }}\n onDragEnter={(e) => { e.preventDefault(); if (!disabled) setIsDragging(true); }}\n onDragLeave={() => setIsDragging(false)}\n onDrop={(e) => {\n e.preventDefault();\n setIsDragging(false);\n if (!disabled) handleFiles(e.dataTransfer.files);\n }}\n className={clsx(\n 'flex flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed py-4 px-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n disabled\n ? 'cursor-not-allowed border-disabled bg-disabled'\n : clsx(\n 'cursor-pointer',\n isDragging\n ? 'border-brand bg-brand-tertiary'\n : 'border-default bg-default-secondary hover:border-brand hover:bg-brand-tertiary',\n ),\n className,\n )}\n >\n <span className={disabled ? 'text-disabled' : isDragging ? 'text-brand' : 'text-default-secondary'}>\n <LuUpload className=\"size-5\" />\n </span>\n <span className={clsx('text-body-sm font-medium', disabled ? 'text-disabled' : 'text-default')}>Upload file</span>\n <span className=\"text-body-xs text-default-secondary text-center\">\n {description}\n </span>\n </div>\n {error && (\n <span role=\"alert\" className=\"text-body-xs text-danger\">\n {error}\n </span>\n )}\n </>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { LuArrowLeft, LuArrowRight } from 'react-icons/lu';\nimport { Button } from './button';\n\n// ── FormCard ───────────────────────────────────────────────────────────────────\n\nexport function FormCard({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={clsx(\n 'overflow-hidden rounded-xl border border-default bg-default',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\n// ── FormCardHeader ─────────────────────────────────────────────────────────────\n\nexport interface FormCardHeaderProps {\n title: string;\n subtitle?: string;\n}\n\nexport function FormCardHeader({ title, subtitle }: FormCardHeaderProps) {\n return (\n <div className=\"border-b border-default px-7 py-6\">\n <h2 className=\"text-heading-sm font-semibold text-default leading-snug\">{title}</h2>\n {subtitle && (\n <p className=\"mt-1 text-body-xs text-default-secondary\">{subtitle}</p>\n )}\n </div>\n );\n}\n\n// ── FormCardFooter ─────────────────────────────────────────────────────────────\n\nexport interface FormCardFooterProps {\n onSaveDraft?: () => void;\n onBack?: () => void;\n onContinue?: () => void;\n continueLabel?: string;\n backDisabled?: boolean;\n continueDisabled?: boolean;\n}\n\nexport function FormCardFooter({\n onSaveDraft,\n onBack,\n onContinue,\n continueLabel = 'Continue',\n backDisabled = false,\n continueDisabled = false,\n}: FormCardFooterProps) {\n return (\n <div className=\"flex items-center justify-between border-t border-default px-7 py-5\">\n {/* No handler means the host has nothing to save to — disable rather than no-op */}\n <Button variant=\"neutral\" size=\"md\" onClick={onSaveDraft} disabled={!onSaveDraft}>\n Save as draft\n </Button>\n <div className=\"flex items-center gap-2\">\n {!backDisabled && (\n <Button variant=\"neutral\" size=\"md\" leadingIcon={<LuArrowLeft size={16} />} onClick={onBack}>\n Back\n </Button>\n )}\n <Button variant=\"primary\" size=\"md\" trailingIcon={<LuArrowRight size={16} />} onClick={onContinue} disabled={continueDisabled}>\n {continueLabel}\n </Button>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuX } from 'react-icons/lu';\n\nexport type BadgeColor = 'gray' | 'red' | 'yellow' | 'lime' | 'green' | 'teal' | 'blue' | 'pink' | 'slate';\nexport type BadgeSize = 'sm' | 'lg';\nexport type BadgeVariant = 'default' | 'subtle';\n\nexport interface BadgeProps {\n label: string;\n color?: BadgeColor;\n size?: BadgeSize;\n variant?: BadgeVariant;\n indicator?: boolean;\n onClose?: () => void;\n className?: string;\n}\n\nconst defaultClasses: Record<BadgeColor, string> = {\n gray: 'bg-badge-gray text-badge-gray',\n red: 'bg-badge-red text-badge-red',\n yellow: 'bg-badge-yellow text-badge-yellow',\n lime: 'bg-badge-lime text-badge-lime',\n green: 'bg-badge-green text-badge-green',\n teal: 'bg-badge-teal text-badge-teal',\n blue: 'bg-badge-blue text-badge-blue',\n pink: 'bg-badge-pink text-badge-pink',\n slate: 'bg-badge-slate text-badge-slate',\n};\n\nconst subtleClasses: Record<BadgeColor, string> = {\n gray: 'border border-badge-gray text-default-secondary',\n red: 'border border-badge-red text-default-secondary',\n yellow: 'border border-badge-yellow text-default-secondary',\n lime: 'border border-badge-lime text-default-secondary',\n green: 'border border-badge-green text-default-secondary',\n teal: 'border border-badge-teal text-default-secondary',\n blue: 'border border-badge-blue text-default-secondary',\n pink: 'border border-badge-pink text-default-secondary',\n slate: 'border border-badge-slate text-default-secondary',\n};\n\nexport function Badge({\n label,\n color = 'gray',\n size = 'sm',\n variant = 'default',\n indicator = false,\n onClose,\n className,\n}: BadgeProps) {\n const isDefault = variant === 'default';\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full px-2 py-0.5',\n size === 'sm' ? 'gap-1' : 'gap-1.5',\n isDefault ? defaultClasses[color] : subtleClasses[color],\n className,\n )}\n >\n {indicator && (\n <span\n className={clsx(\n 'shrink-0 rounded-full bg-current',\n size === 'sm' ? 'h-1.5 w-1.5' : 'h-2 w-2',\n )}\n />\n )}\n <span\n className={clsx(\n 'whitespace-nowrap',\n size === 'sm'\n ? clsx('text-body-tiny', isDefault && 'font-semibold')\n : 'text-body-xs',\n )}\n >\n {label}\n </span>\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center rounded-full opacity-60 transition-opacity hover:opacity-100',\n size === 'sm' ? 'h-3 w-3' : 'h-4 w-4',\n )}\n aria-label=\"Remove\"\n >\n <LuX className=\"h-full w-full\" strokeWidth={2.5} aria-hidden />\n </button>\n )}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nexport interface RoleBadgeProps {\n role: string;\n size?: 'sm' | 'md';\n /**\n * Explicit role colour as a solid 6-digit hex (e.g. `#0c2d58`). When set it drives\n * the badge — text uses the hex and the background a light tint of it. Prefer this\n * over relying on the built-in name map, which only covers a fixed set of English\n * role names. Falls back to the name map, then grey.\n */\n color?: string | null;\n}\n\nconst ROLE_COLORS: Record<string, { bg: string; text: string }> = {\n 'Super Admin': { bg: '#e9eff7', text: '#0c2d58' },\n 'Admin': { bg: '#e9eff7', text: '#0c2d58' },\n 'Compliance Lead': { bg: '#ece6f7', text: '#5b3da8' },\n 'Reviewer': { bg: '#dbeafe', text: '#1d4ed8' },\n 'Requester': { bg: '#e6f4ea', text: '#1f7a3d' },\n 'Entity Manager': { bg: '#fbe6cf', text: '#9a6206' },\n 'Intelligence Analyst': { bg: '#fde2e7', text: '#a3284a' },\n 'Auditor': { bg: '#f5f5f5', text: '#757575' },\n 'Viewer': { bg: '#f5f5f5', text: '#757575' },\n 'User': { bg: '#e9eff7', text: '#0c2d58' },\n};\n\nconst FALLBACK = { bg: '#f5f5f5', text: '#757575' };\n\nconst HEX6 = /^#[0-9a-fA-F]{6}$/;\n\nfunction resolveColors(role: string, color?: string | null): { bg: string; text: string } {\n if (color && HEX6.test(color)) {\n // Light tint of the supplied hue for the background, full hue for the text.\n return { bg: `${color}1F`, text: color };\n }\n return ROLE_COLORS[role] ?? FALLBACK;\n}\n\nexport function RoleBadge({ role, size = 'sm', color }: RoleBadgeProps) {\n const colors = resolveColors(role, color);\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full font-medium whitespace-nowrap',\n size === 'sm' ? 'px-2 py-0.5 text-body-tiny' : 'px-3 py-1 text-body-xs',\n )}\n style={{ backgroundColor: colors.bg, color: colors.text }}\n >\n {role}\n </span>\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { LuChevronDown } from 'react-icons/lu';\nimport { RoleBadge } from '../status/role-badge';\n\nexport interface RoleOption {\n role: string;\n description: string;\n}\n\nexport const ROLE_COMBO_OPTIONS: RoleOption[] = [\n { role: 'Reviewer', description: 'Reviews onboarding requests' },\n { role: 'Admin', description: 'Full org control' },\n { role: 'Compliance Lead', description: 'Owns compliance' },\n { role: 'Requester', description: 'Creates onboarding requests' },\n { role: 'Viewer', description: 'Read-only access' },\n { role: 'User', description: 'Default user access' },\n];\n\nexport interface RoleComboBoxProps {\n value: string;\n onChange: (role: string) => void;\n options?: RoleOption[];\n}\n\n\nexport function RoleComboBox({ value, onChange, options = ROLE_COMBO_OPTIONS }: RoleComboBoxProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (!open) return;\n function onClickOutside(e: MouseEvent) {\n if (containerRef.current && !containerRef.current.contains(e.target as Node)) {\n setOpen(false);\n setQuery('');\n }\n }\n document.addEventListener('mousedown', onClickOutside);\n return () => document.removeEventListener('mousedown', onClickOutside);\n }, [open]);\n\n function openDropdown() {\n setOpen(true);\n setQuery('');\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n\n function select(role: string) {\n onChange(role);\n setOpen(false);\n setQuery('');\n }\n\n const selectedEntry = options.find(o => o.role === value);\n const otherOptions = options.filter(\n o => o.role !== value && o.role.toLowerCase().includes(query.toLowerCase()),\n );\n\n return (\n <div className=\"relative\" ref={containerRef}>\n {/* Trigger */}\n <div\n role=\"combobox\"\n aria-expanded={open}\n aria-haspopup=\"listbox\"\n onClick={openDropdown}\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); openDropdown(); }\n if (e.key === 'Escape') { setOpen(false); setQuery(''); }\n }}\n className={`flex h-11 cursor-pointer items-center gap-2 rounded-lg border-[1.5px] pl-2.5 pr-3 transition-colors ${\n open ? 'border-blue-500' : 'border-default hover:border-brand-tertiary'\n }`}\n >\n <div className=\"flex flex-1 min-w-0 items-center gap-1.5 overflow-hidden\">\n <RoleBadge role={value} size=\"sm\" />\n {value === 'User' && !open && (\n <span className=\"rounded border border-default bg-default-secondary px-1.5 py-0.5 text-body-tiny font-medium text-default-secondary\">\n DEFAULT\n </span>\n )}\n {open && (\n <>\n <input\n ref={inputRef}\n type=\"text\"\n value={query}\n onChange={e => setQuery(e.target.value)}\n onClick={e => e.stopPropagation()}\n className=\"min-w-0 flex-1 bg-transparent text-body-xs text-default outline-none\"\n aria-label=\"Search roles\"\n />\n <span className=\"mx-0.5 h-[18px] w-px shrink-0 bg-divider\" aria-hidden />\n </>\n )}\n </div>\n <span className=\"shrink-0 text-default-secondary\">\n <LuChevronDown size={14} />\n </span>\n </div>\n\n {/* Dropdown */}\n {open && (\n <div\n role=\"listbox\"\n className=\"absolute left-0 right-0 top-full z-20 mt-1 flex max-h-64 flex-col gap-0.5 overflow-y-auto rounded-xl border border-default bg-white p-1.5 shadow-lg\"\n >\n {/* Currently selected */}\n {selectedEntry && (\n <div\n role=\"option\"\n aria-selected\n className=\"flex cursor-pointer items-center gap-2.5 rounded-md bg-blue-50 px-2.5 py-2\"\n onClick={() => select(selectedEntry.role)}\n >\n <RoleBadge role={selectedEntry.role} size=\"sm\" />\n <span className=\"flex-1 text-body-xs text-default-secondary\">\n {selectedEntry.description}\n </span>\n <span className=\"shrink-0 text-sm font-bold text-blue-600\">✓</span>\n </div>\n )}\n\n <div className=\"h-px bg-divider\" />\n\n {/* Other roles */}\n {otherOptions.length > 0 && (\n <>\n <div className=\"px-2.5 pb-1 pt-1.5\">\n <span className=\"text-body-tiny font-semibold uppercase tracking-wide text-default-secondary\">\n Other roles\n </span>\n </div>\n {otherOptions.map(opt => (\n <div\n key={opt.role}\n role=\"option\"\n aria-selected={false}\n className=\"flex cursor-pointer items-center gap-2.5 rounded-md px-2.5 py-2 hover:bg-default-secondary\"\n onClick={() => select(opt.role)}\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); select(opt.role); }\n }}\n >\n <RoleBadge role={opt.role} size=\"sm\" />\n <span className=\"text-body-xs text-default-secondary\">{opt.description}</span>\n </div>\n ))}\n </>\n )}\n\n {otherOptions.length === 0 && query && (\n <p className=\"px-2.5 py-2 text-body-xs text-default-secondary\">\n No roles match \"{query}\"\n </p>\n )}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * The six status tones from the Figma design system.\n * Values live in `src/app/styles/tokens/status.css`; see that file for why they do\n * not derive from the SDS semantic colour families.\n */\nexport type StatusTone =\n | 'neutral'\n | 'info'\n | 'warning'\n | 'caution'\n | 'accent'\n | 'positive'\n | 'danger';\n\nexport type StatusBadgeSize = 'sm' | 'md';\n\nconst TONE_STYLES: Record<StatusTone, string> = {\n neutral: 'bg-status-neutral text-status-neutral',\n info: 'bg-status-info text-status-info',\n warning: 'bg-status-warning text-status-warning',\n caution: 'bg-status-caution text-status-caution',\n accent: 'bg-status-accent text-status-accent',\n positive: 'bg-status-positive text-status-positive',\n danger: 'bg-status-danger text-status-danger',\n};\n\nconst DOT_STYLES: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nconst SIZE_STYLES: Record<StatusBadgeSize, string> = {\n sm: 'px-2 py-0.5 text-body-tiny',\n md: 'px-2.5 py-1 text-body-xs',\n};\n\nexport interface StatusBadgeProps {\n label: string;\n tone?: StatusTone;\n size?: StatusBadgeSize;\n /** Leading dot. On by default — the Figma status pills all carry one. */\n dot?: boolean;\n /**\n * Leading glyph, replacing the dot — e.g. `<LuCheck className=\"size-3\" />`.\n * Use for states a colour alone under-states, like verified or rejected.\n */\n icon?: ReactNode;\n className?: string;\n}\n\n/**\n * The status pill.\n *\n * Replaces thirteen inline re-implementations of the same markup plus five\n * competing hardcoded hex palettes. Generalises `TableCellStatusPill`, which had\n * this exact markup but required callers to pass raw hex strings.\n *\n * Note this is NOT `StatusChip` — that one renders a label *and a count* and is a\n * different component.\n */\nexport function StatusBadge({\n label,\n tone = 'neutral',\n size = 'md',\n dot = true,\n icon,\n className,\n}: StatusBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full font-medium leading-tight whitespace-nowrap',\n SIZE_STYLES[size],\n TONE_STYLES[tone],\n className,\n )}\n >\n {icon ? (\n <span className=\"shrink-0\">{icon}</span>\n ) : (\n dot && <span className={clsx('size-1.5 shrink-0 rounded-full', DOT_STYLES[tone])} />\n )}\n {label}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nexport type StatusDotTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral' | 'default';\n\nexport interface StatusDotProps {\n tone?: StatusDotTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex color, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n color?: string;\n className?: string;\n}\n\nconst dotTones: Record<StatusDotTone, string> = {\n brand: 'bg-brand',\n positive:'bg-positive',\n warning: 'bg-warning',\n danger: 'bg-danger',\n neutral: 'bg-neutral',\n default: 'bg-default-tertiary',\n};\n\nexport function StatusDot({ tone = 'default', color, className }: StatusDotProps) {\n return (\n <span\n className={clsx('inline-block size-1.5 shrink-0 rounded-full', !color && dotTones[tone], className)}\n style={color ? { backgroundColor: color } : undefined}\n />\n );\n}\n","import clsx from 'clsx';\nimport { StatusDot } from './status-dot';\nimport type { StatusDotTone } from './status-dot';\n\nexport interface StatusChipProps {\n label: string;\n count: number | string;\n tone?: StatusDotTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex dot color, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n dotColor?: string;\n bg?: string;\n className?: string;\n}\n\nexport function StatusChip({ label, count, tone = 'default', dotColor, bg, className }: StatusChipProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-1',\n !bg && 'bg-default-secondary',\n className,\n )}\n style={bg ? { backgroundColor: bg } : undefined}\n >\n <StatusDot tone={tone} color={dotColor} />\n <span className=\"text-body-xs font-medium text-default\">{count}</span>\n <span className=\"text-body-xs text-default-secondary\">{label}</span>\n </span>\n );\n}\n","import clsx from 'clsx';\nimport { StatusDot } from './status-dot';\nimport type { StatusDotTone } from './status-dot';\n\nexport interface CountBadgeProps {\n count: number | string;\n label?: string;\n tone?: StatusDotTone;\n className?: string;\n}\n\nexport function CountBadge({ count, label, tone = 'positive', className }: CountBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full border border-default px-2.5 py-1 text-body-xs font-medium text-default',\n className,\n )}\n >\n <StatusDot tone={tone} />\n {count}\n {label && <span className=\"text-default-secondary\">{label}</span>}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nexport type TagPillTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger';\n\nexport interface TagPillProps {\n label: string;\n tone?: TagPillTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex bg/text pair, overrides `tone` via inline style. Use when the exact source colors don't match design tokens. */\n bg?: string;\n color?: string;\n className?: string;\n}\n\nconst toneStyles: Record<TagPillTone, string> = {\n default: 'bg-default-secondary text-default-secondary',\n brand: 'bg-brand-tertiary text-brand',\n positive:'bg-positive-tertiary text-positive',\n warning: 'bg-warning-tertiary text-warning',\n danger: 'bg-danger-tertiary text-danger',\n};\n\nexport function TagPill({ label, tone = 'default', bg, color, className }: TagPillProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-body-xs font-medium',\n !bg && !color && toneStyles[tone],\n className,\n )}\n style={{\n ...(bg ? { backgroundColor: bg } : undefined),\n ...(color ? { color } : undefined),\n }}\n >\n {label}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nimport type { StatusTone } from './status-badge';\n\nconst DOT: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nexport interface TrailChipProps {\n label: string;\n value: string;\n tone?: StatusTone;\n /**\n * Data-driven dot colour, overriding `tone`. The investigations trail mirrors the\n * severity accent of whichever tree node is selected, and those accents come from\n * the row data rather than the status palette — this is the escape hatch Phase 10\n * classifies as \"genuinely data-driven colour\", not a token bypass.\n */\n dotColor?: string;\n className?: string;\n}\n\n/**\n * Dot + small uppercase label + value, used for the drill-down breadcrumb trail on\n * the investigations page.\n *\n * Promoted from `pages/investigations`, where the dot colour was passed as a raw hex.\n */\nexport function TrailChip({ label, value, tone = 'info', dotColor, className }: TrailChipProps) {\n return (\n <div\n className={clsx(\n 'flex items-center gap-2 rounded-full border border-default bg-default px-3 py-1.5',\n className,\n )}\n >\n <span\n className={clsx('size-1.5 shrink-0 rounded-full', !dotColor && DOT[tone])}\n style={dotColor ? { backgroundColor: dotColor } : undefined}\n />\n <span className=\"text-body-tiny font-semibold uppercase tracking-wide text-default-secondary\">\n {label}\n </span>\n <span className=\"text-body-xs font-medium text-default\">{value}</span>\n </div>\n );\n}\n","import { StatusBadge, type StatusTone } from './status-badge';\n\nexport type UserAccountStatus = 'active' | 'pending' | 'deactivated';\n\nconst STATUS_META: Record<UserAccountStatus, { label: string; tone: StatusTone }> = {\n active: { label: 'Active', tone: 'positive' },\n // `caution` (pale yellow), not `warning` (orange) — Pending is one step below a\n // warning on the severity ramp, and reads as waiting rather than at risk.\n pending: { label: 'Pending', tone: 'caution' },\n deactivated: { label: 'Deactivated', tone: 'danger' },\n};\n\nexport interface UserStatusPillProps {\n status: UserAccountStatus;\n}\n\n/** Account-status pill. A thin wrapper over `StatusBadge`. */\nexport function UserStatusPill({ status }: UserStatusPillProps) {\n const { label, tone } = STATUS_META[status];\n return <StatusBadge label={label} tone={tone} />;\n}\n","import clsx from 'clsx';\nimport { LuCheck, LuCircleAlert, LuLoaderCircle, LuMinus, LuX } from 'react-icons/lu';\n\n/**\n * States of a compliance check.\n *\n * Union of the two previously-divergent local unions:\n * - `features/entity-detail` had passed | in_progress | pending | action_required\n * - `features/reviewer-detail` had passed | in-progress | failed | pending | waived\n *\n * Note `in_progress` (underscore) is canonical — entity-detail's spelling, which is\n * the one backed by the API. reviewer-detail used `in-progress` (hyphen) in mock data.\n */\nexport type CheckIndicatorStatus =\n | 'passed'\n | 'in_progress'\n | 'action_required'\n | 'failed'\n | 'pending'\n | 'waived';\n\n/**\n * `action_required` and `failed` share the Figma colours and differ only in glyph\n * (`!` vs `✕`); `waived` shares `pending`'s colours and adds a dash.\n */\nconst STATUS_STYLES: Record<CheckIndicatorStatus, string> = {\n passed: 'bg-status-check-passed border-status-check-passed text-status-check-passed',\n in_progress: 'bg-status-check-progress border-status-check-progress text-status-check-progress',\n action_required: 'bg-status-check-failed border-status-check-failed text-status-check-failed',\n failed: 'bg-status-check-failed border-status-check-failed text-status-check-failed',\n pending: 'bg-status-check-pending border-status-check-pending text-status-check-pending',\n waived: 'bg-status-check-pending border-status-check-pending text-status-check-pending',\n};\n\n/**\n * Glyphs — every one now comes from `react-icons/lu`, so the set is stroke-consistent.\n *\n * The two that used to be typographic: `◐` became `LuLoaderCircle` (lucide has no\n * half-filled circle, but a partial ring reads as in-progress and is a real icon), and\n * `!` became `LuCircleAlert`. Both are a small visual change from 0.2.0.\n */\nfunction StatusGlyph({ status }: { status: CheckIndicatorStatus }) {\n switch (status) {\n case 'passed':\n return <LuCheck className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'failed':\n return <LuX className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'waived':\n return <LuMinus className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'in_progress':\n return <LuLoaderCircle className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'action_required':\n return <LuCircleAlert className=\"size-3.5\" strokeWidth={2.5} aria-hidden />;\n case 'pending':\n return null;\n }\n}\n\nexport interface CheckIndicatorProps {\n status: CheckIndicatorStatus;\n /** Accessible label. Without one the indicator is decorative, which is correct when an adjacent text label already names the state. */\n label?: string;\n className?: string;\n}\n\n/**\n * The 22px outlined circle used for compliance-check state in entity and reviewer\n * detail. Ring and glyph share one colour; see the check tokens in\n * `src/app/styles/tokens/status.css`.\n */\nexport function CheckIndicator({ status, label, className }: CheckIndicatorProps) {\n return (\n <div\n className={clsx(\n 'flex size-[22px] shrink-0 items-center justify-center rounded-full border-[1.5px]',\n STATUS_STYLES[status],\n className,\n )}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n >\n <StatusGlyph status={status} />\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EntityIconBadgeSize = 'sm' | 'md';\nexport type EntityIconBadgeTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';\nexport type EntityIconBadgeShape = 'square' | 'circle';\n\nexport interface EntityIconBadgeProps {\n size?: EntityIconBadgeSize;\n tone?: EntityIconBadgeTone;\n /**\n * `square` is the rounded-rect used on entity rows. `circle` is the tinted glyph\n * circle used in modal headers. A prop rather than a `className` override, so it\n * does not depend on Tailwind's stylesheet emit order.\n */\n shape?: EntityIconBadgeShape;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex background, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n bg?: string;\n iconColor?: string;\n children: ReactNode;\n className?: string;\n}\n\nconst sizeStyles: Record<EntityIconBadgeSize, string> = {\n sm: 'size-8',\n md: 'size-10',\n};\n\nconst shapeStyles: Record<EntityIconBadgeShape, Record<EntityIconBadgeSize, string>> = {\n square: { sm: 'rounded-lg', md: 'rounded-xl' },\n circle: { sm: 'rounded-full', md: 'rounded-full' },\n};\n\nconst toneStyles: Record<EntityIconBadgeTone, string> = {\n default: 'bg-default-secondary text-icon-default',\n brand: 'bg-brand-tertiary text-icon-brand',\n positive:'bg-positive-tertiary text-icon-positive',\n warning: 'bg-warning-tertiary text-icon-warning',\n danger: 'bg-danger-tertiary text-icon-danger',\n neutral: 'bg-neutral-tertiary text-icon-neutral',\n};\n\nexport function EntityIconBadge({ size = 'sm', tone = 'default', shape = 'square', bg, iconColor, children, className }: EntityIconBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center',\n sizeStyles[size],\n shapeStyles[shape][size],\n !bg && !iconColor && toneStyles[tone],\n className,\n )}\n style={{\n ...(bg ? { backgroundColor: bg } : undefined),\n ...(iconColor ? { color: iconColor } : undefined),\n }}\n >\n {children}\n </span>\n );\n}\n","import { useEffect, useRef, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuCheck, LuMinus } from 'react-icons/lu';\n\nexport interface CheckboxProps {\n checked: boolean;\n onChange: (checked: boolean) => void;\n label?: ReactNode;\n disabled?: boolean;\n indeterminate?: boolean;\n className?: string;\n}\n\n/** Checkbox built on a real `<input type=\"checkbox\">` — the hand-rolled `<div onClick>` version\n * this replaces was not keyboard-reachable and exposed no checked state to assistive tech. */\nexport function Checkbox({\n checked,\n onChange,\n label,\n disabled = false,\n indeterminate = false,\n className,\n}: CheckboxProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n return (\n <label\n className={clsx(\n 'group inline-flex items-start gap-2.5',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <input\n ref={inputRef}\n type=\"checkbox\"\n checked={checked}\n disabled={disabled}\n onChange={(e) => onChange(e.target.checked)}\n className=\"peer sr-only\"\n />\n <span\n aria-hidden\n className={clsx(\n 'mt-px flex size-[18px] shrink-0 items-center justify-center rounded-[4px] border-[1.5px] transition-colors',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand peer-focus-visible:ring-offset-1',\n checked || indeterminate\n ? 'border-brand-emphasis bg-brand text-brand-on-brand'\n : 'border-default-secondary bg-default',\n )}\n >\n {indeterminate ? (\n <LuMinus className=\"size-3\" strokeWidth={3} />\n ) : checked ? (\n <LuCheck className=\"size-3\" strokeWidth={3} />\n ) : null}\n </span>\n {label && <span className=\"text-body-xs text-default\">{label}</span>}\n </label>\n );\n}\n","import clsx from 'clsx';\n\nexport interface SegmentedControlOption {\n value: string;\n label: string;\n}\n\nexport interface SegmentedControlProps {\n options: SegmentedControlOption[];\n value: string;\n onChange?: (value: string) => void;\n className?: string;\n}\n\nexport function SegmentedControl({ options, value, onChange, className }: SegmentedControlProps) {\n return (\n <div\n className={clsx(\n 'inline-flex items-center rounded-xl border border-default bg-default-secondary p-0.5',\n className,\n )}\n >\n {options.map((opt) => (\n <button\n key={opt.value}\n type=\"button\"\n onClick={() => onChange?.(opt.value)}\n className={clsx(\n 'rounded-lg px-3.5 py-1.5 text-body-xs font-medium transition-colors',\n opt.value === value\n ? 'bg-default shadow-panel text-default'\n : 'text-default-secondary hover:text-default',\n )}\n >\n {opt.label}\n </button>\n ))}\n </div>\n );\n}\n","import { useRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { LuCircleCheckBig, LuInfo, LuOctagonAlert, LuTriangleAlert, LuX } from 'react-icons/lu';\nimport { cn } from '../../lib/cn';\nimport { EntityIconBadge, type EntityIconBadgeTone } from '../status/entity-icon-badge';\nimport { IconButton } from '../forms/icon-button';\nimport { OVERLAY_SCRIM, useOverlayDismiss } from './overlay';\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl';\n/**\n * Note `positive`, not `success` — every other tone union in the library\n * (`InlineAlertTone`, `TagPillTone`, `EntityIconBadgeTone`) and the token layer say\n * `positive`, and one vocabulary beats a familiar synonym.\n */\nexport type ModalTone = 'default' | 'info' | 'positive' | 'warning' | 'danger';\nexport type ModalFooterAlign = 'start' | 'between' | 'end';\n\n/**\n * The `sm:` prefix is mandatory, not cosmetic. In 0.2.0 `max-w-[540px]` was applied\n * unprefixed, so between 540px and the `sm` breakpoint (640px) the \"bottom sheet\" was\n * a 540px card floating in the middle of the viewport.\n */\nconst SIZE: Record<ModalSize, string> = {\n sm: 'sm:max-w-[420px]',\n md: 'sm:max-w-[540px]',\n lg: 'sm:max-w-[640px]',\n xl: 'sm:max-w-[800px]',\n};\n\n/**\n * `info` / `positive` / `warning` reuse `InlineAlert`'s glyphs, so one semantic has one\n * mark across the system. `danger` deliberately differs from `warning`: a dialog that\n * is about to destroy something should not be glyph-identical to one merely cautioning.\n */\nconst TONE_ICON: Record<Exclude<ModalTone, 'default'>, ReactNode> = {\n info: <LuInfo className=\"size-5\" />,\n positive: <LuCircleCheckBig className=\"size-5\" />,\n warning: <LuTriangleAlert className=\"size-5\" />,\n danger: <LuOctagonAlert className=\"size-5\" />,\n};\n\n/** Reuses EntityIconBadge's tone map — one token map for tinted icon circles. */\nconst TONE_BADGE: Record<Exclude<ModalTone, 'default'>, EntityIconBadgeTone> = {\n info: 'brand',\n positive: 'positive',\n warning: 'warning',\n danger: 'danger',\n};\n\nconst FOOTER_ALIGN: Record<ModalFooterAlign, string> = {\n start: 'justify-start',\n between: 'justify-between',\n end: 'justify-end',\n};\n\n// ── Modal ──────────────────────────────────────────────────────────────────────\n\nexport interface ModalProps {\n isOpen: boolean;\n onClose: () => void;\n /**\n * Accessible name for the dialog. Required, so a slot-composed modal can never ship\n * unnamed. Was `title` in 0.2.0, renamed because `title` is also an HTML attribute\n * that renders a tooltip.\n */\n label: string;\n children: ReactNode;\n size?: ModalSize;\n /** Renders the top-right close button. */\n showClose?: boolean;\n /** Applied to the panel. With `cn`, `className=\"sm:max-w-[560px]\"` beats `size`. */\n className?: string;\n}\n\n/**\n * A centred dialog above `sm`, a bottom sheet below it.\n *\n * Composed from `ModalHeader` / `ModalBody` / `ModalFooter`, mirroring the `Card`\n * parts — so a modal can take any layout a card can, including headerless. Tone lives\n * on `ModalHeader` (the part that draws the glyph); `ConfirmDialog` and\n * `NoteConfirmModal` accept `tone` at their top level and forward it.\n */\nexport function Modal(props: ModalProps) {\n if (!props.isOpen) return null;\n return <ModalShell {...props} />;\n}\n\n/**\n * Split out so the Esc / focus-trap hooks only mount while the dialog is open —\n * calling them in `Modal` itself would break the `if (!isOpen) return null` exit.\n */\nfunction ModalShell({\n onClose,\n label,\n children,\n size = 'md',\n showClose = true,\n className,\n}: Omit<ModalProps, 'isOpen'>) {\n const panelRef = useRef<HTMLDivElement>(null);\n useOverlayDismiss(onClose, panelRef);\n\n return (\n <div\n className={cn('fixed inset-0 z-50 flex items-end justify-center sm:items-center', OVERLAY_SCRIM)}\n // Self-target check, so a click on any child does not dismiss.\n onClick={(e) => {\n if (e.target === e.currentTarget) onClose();\n }}\n >\n <div\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n className={cn(\n 'relative max-h-[92dvh] w-full overflow-y-auto bg-default shadow-xl',\n 'rounded-t-2xl pb-[env(safe-area-inset-bottom)] sm:mx-4 sm:rounded-2xl sm:pb-0',\n SIZE[size],\n className,\n )}\n >\n {showClose && (\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label=\"Close dialog\"\n onClick={onClose}\n // Floating rather than inside the header, so a headerless modal is still\n // dismissible. right-6/top-5 reproduces 0.2.0's position exactly.\n className=\"absolute right-6 top-5 z-10\"\n >\n <LuX size={16} />\n </IconButton>\n )}\n {children}\n </div>\n </div>\n );\n}\n\n// ── ModalHeader ────────────────────────────────────────────────────────────────\n\nexport interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Adds a tinted glyph circle. `default` renders none. */\n tone?: ModalTone;\n divider?: boolean;\n}\n\nexport function ModalHeader({\n children,\n tone = 'default',\n divider = true,\n className,\n ...rest\n}: ModalHeaderProps) {\n return (\n <div\n className={cn(\n // pr-14 reserves the floating close button's column (24px gutter + 24px\n // button + gap), which the old flex-between header used to hold open.\n 'flex items-start gap-3 px-6 py-5 pr-14',\n divider && 'border-b border-default',\n className,\n )}\n {...rest}\n >\n {tone !== 'default' && (\n <EntityIconBadge size=\"md\" shape=\"circle\" tone={TONE_BADGE[tone]}>\n {TONE_ICON[tone]}\n </EntityIconBadge>\n )}\n <div className=\"min-w-0 flex-1\">{children}</div>\n </div>\n );\n}\n\n// ── ModalTitle / ModalDescription / ModalBody / ModalFooter ────────────────────\n\nexport interface ModalTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n children: ReactNode;\n}\n\nexport function ModalTitle({ children, className, ...rest }: ModalTitleProps) {\n return (\n <h2 className={cn('text-heading-sm font-semibold text-default', className)} {...rest}>\n {children}\n </h2>\n );\n}\n\nexport interface ModalDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n children: ReactNode;\n}\n\nexport function ModalDescription({ children, className, ...rest }: ModalDescriptionProps) {\n return (\n <p className={cn('mt-0.5 text-body-xs text-default-secondary', className)} {...rest}>\n {children}\n </p>\n );\n}\n\nexport interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** Must not carry its own `overflow` — the panel is the scroll container. */\nexport function ModalBody({ children, className, ...rest }: ModalBodyProps) {\n return (\n <div className={cn('px-6 py-5', className)} {...rest}>\n {children}\n </div>\n );\n}\n\nexport interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n align?: ModalFooterAlign;\n divider?: boolean;\n}\n\nexport function ModalFooter({\n children,\n align = 'end',\n divider = true,\n className,\n ...rest\n}: ModalFooterProps) {\n return (\n <div\n className={cn(\n 'flex items-center gap-2 px-6 py-4',\n FOOTER_ALIGN[align],\n divider && 'border-t border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * `clsx` + `tailwind-merge`.\n *\n * Use this instead of bare `clsx` in any component whose `className` prop is meant to\n * *override* a base utility — the composable `Card*` and `Modal*` parts, and anything\n * else built to be reshaped by its caller.\n *\n * Why it is necessary: `clsx` only concatenates. When two conflicting Tailwind\n * utilities both end up in the attribute, the winner is decided by *stylesheet order*,\n * not attribute order. Tailwind emits `flex-row` before `flex-col` and `gap-3` before\n * `gap-4`, so under plain `clsx`:\n *\n * <CardBody className=\"flex-row gap-3\" /> // base is 'flex flex-col gap-4 p-4'\n *\n * silently stays a column with a 4-unit gap. `twMerge` drops the losing class instead,\n * so the caller's intent wins.\n *\n * Everywhere else in the library `className` is purely additive, and plain `clsx`\n * remains correct — and cheaper. Do not sweep it out of those files.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { useEffect, type RefObject } from 'react';\n\n/** The one scrim for every overlay primitive.\n *\n * Modal and Drawer both reference this constant, so there is a single place to change\n * the dimming behind a dialog. Backed by `--color-background-utilities-overlay`. */\nexport const OVERLAY_SCRIM = 'bg-overlay';\n\nconst FOCUSABLE = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nfunction focusableWithin(root: HTMLElement): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n (el) => el.offsetParent !== null || el === root,\n );\n}\n\n/** Esc-to-close, a Tab focus trap, and focus restore for a mounted overlay.\n *\n * None of the hand-rolled drawers/modals this replaces handled Esc or trapped focus —\n * they closed on scrim click only. Pass the ref of the panel element (not the scrim). */\nexport function useOverlayDismiss(\n onClose: () => void,\n panelRef: RefObject<HTMLElement | null>,\n): void {\n useEffect(() => {\n function onKeyDown(e: KeyboardEvent) {\n const panel = panelRef.current;\n if (e.key === 'Escape') {\n e.stopPropagation();\n onClose();\n return;\n }\n if (e.key !== 'Tab' || !panel) return;\n\n const items = focusableWithin(panel);\n if (items.length === 0) return;\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n\n if (e.shiftKey && (active === first || !panel.contains(active))) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && active === last) {\n e.preventDefault();\n first.focus();\n }\n }\n\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [onClose, panelRef]);\n\n useEffect(() => {\n const previouslyFocused = document.activeElement as HTMLElement | null;\n const panel = panelRef.current;\n if (panel) {\n const target = focusableWithin(panel)[0] ?? panel;\n target.focus({ preventScroll: true });\n }\n return () => previouslyFocused?.focus?.({ preventScroll: true });\n }, [panelRef]);\n}\n","import { useRef, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuX } from 'react-icons/lu';\n\nimport { IconButton } from '../forms/icon-button';\nimport { OVERLAY_SCRIM, useOverlayDismiss } from './overlay';\n\nexport interface DrawerProps {\n /** Required as of 0.3.0 — every overlay is now `isOpen` + `onClose`. */\n isOpen: boolean;\n onClose: () => void;\n /** Header content (left side). The copies this replaces differ only here — a status badge +\n * title in one, an avatar + title + category in another — so it is a slot, not props. */\n header: ReactNode;\n children: ReactNode;\n footer?: ReactNode;\n /** `between` when the footer has a left-aligned secondary action. */\n footerAlign?: 'end' | 'between';\n /** Panel width. Defaults to the `w-[440px] max-w-[90vw]` shared by every existing drawer. */\n width?: string;\n /** Accessible name for the dialog. */\n label?: string;\n className?: string;\n}\n\n/**\n * Right-hand side panel. Handles Esc, traps Tab focus, and restores focus to the\n * trigger on close.\n */\nexport function Drawer(props: DrawerProps) {\n if (!props.isOpen) return null;\n return <DrawerShell {...props} />;\n}\n\n/**\n * Split out for the same reason as `ModalShell`: the Esc handler and the focus trap\n * must not stay mounted behind a closed drawer, which is what would happen if\n * `useOverlayDismiss` ran above the `isOpen` early exit.\n */\nfunction DrawerShell({\n onClose,\n header,\n children,\n footer,\n footerAlign = 'end',\n width = 'w-[440px] max-w-[90vw]',\n label,\n className,\n}: Omit<DrawerProps, 'isOpen'>) {\n const panelRef = useRef<HTMLElement | null>(null);\n useOverlayDismiss(onClose, panelRef);\n\n return (\n <div\n className={clsx('fixed inset-0 z-50 flex justify-end', OVERLAY_SCRIM)}\n // Self-target check, matching Modal. 0.2.0 used a real <button> scrim, but it sat\n // outside the role=\"dialog\" element, so the focus trap made it unreachable — a\n // labelled control nobody could use.\n onClick={(e) => {\n if (e.target === e.currentTarget) onClose();\n }}\n >\n <aside\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n className={clsx('relative flex h-full flex-col bg-default shadow-2xl', width, className)}\n >\n <div className=\"flex items-start justify-between gap-3 border-b border-default p-6\">\n <div className=\"min-w-0\">{header}</div>\n <IconButton variant=\"subtle\" size=\"sm\" aria-label=\"Close\" onClick={onClose}>\n <LuX size={18} />\n </IconButton>\n </div>\n\n <div className=\"flex-1 space-y-6 overflow-y-auto p-6\">{children}</div>\n\n {footer && (\n <div\n className={clsx(\n 'flex items-center gap-2 border-t border-default px-6 py-4',\n footerAlign === 'between' ? 'justify-between' : 'justify-end',\n )}\n >\n {footer}\n </div>\n )}\n </aside>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\n\nimport { Button } from '../forms/button';\nimport { Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from './modal';\nimport type { ModalSize, ModalTone } from './modal';\n\nexport interface ConfirmDialogProps {\n isOpen: boolean;\n title: string;\n subtitle?: string;\n /**\n * Adds a tinted glyph to the header. Defaults to `default` (no glyph) so existing\n * call sites look unchanged; opt in per dialog rather than deriving it from\n * `confirmVariant`, which would silently restyle every destructive confirm.\n */\n tone?: ModalTone;\n size?: ModalSize;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmVariant?: 'primary' | 'danger';\n /** Disables the confirm button and swaps its label — the double-submit guard. */\n isConfirming?: boolean;\n /** Label shown on the confirm button while `isConfirming`. */\n confirmingLabel?: string;\n /** Optional body — a warning callout, a consequences list, or a failed-attempt error. */\n children?: ReactNode;\n className?: string;\n onConfirm: () => void;\n /** Renamed from `onCancel` in 0.3.0 — every overlay now uses `isOpen` + `onClose`. */\n onClose: () => void;\n}\n\n/**\n * The in-app replacement for `window.confirm`: a title, an optional body, and a\n * cancel/confirm pair.\n *\n * Kept as a preset rather than folded into `Modal` because it carries *behaviour*, not\n * just layout — the `isConfirming` guard that disables the button and swaps its label\n * is the thing call sites get wrong when they hand-roll a confirm. For any other\n * shape, compose `Modal` and its parts directly.\n */\nexport function ConfirmDialog({\n isOpen,\n title,\n subtitle,\n tone = 'default',\n size = 'md',\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n isConfirming = false,\n confirmingLabel = 'Working…',\n children,\n className,\n onConfirm,\n onClose,\n}: ConfirmDialogProps) {\n return (\n <Modal isOpen={isOpen} onClose={onClose} label={title} size={size} className={className}>\n <ModalHeader tone={tone} divider={Boolean(children)}>\n <ModalTitle>{title}</ModalTitle>\n {subtitle && <ModalDescription>{subtitle}</ModalDescription>}\n </ModalHeader>\n {/* Guarded: 0.2.0 always rendered a body, so a childless confirm carried 40px of\n dead space plus a stray rule. */}\n {children && <ModalBody>{children}</ModalBody>}\n <ModalFooter>\n <Button variant=\"neutral\" size=\"md\" onClick={onClose}>\n {cancelLabel}\n </Button>\n <Button variant={confirmVariant} size=\"md\" disabled={isConfirming} onClick={onConfirm}>\n {isConfirming ? confirmingLabel : confirmLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n}\n","import { useState } from 'react';\n\nimport { Button } from '../forms/button';\nimport { Textarea } from '../forms/textarea';\nimport { Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from './modal';\nimport type { ModalSize, ModalTone } from './modal';\n\nexport interface NoteConfirmModalProps {\n /** Required as of 0.3.0 — this is now a controlled overlay like every other. */\n isOpen: boolean;\n title: string;\n subtitle?: string;\n tone?: ModalTone;\n size?: ModalSize;\n confirmLabel: string;\n cancelLabel?: string;\n confirmVariant?: 'primary' | 'danger';\n /** Block confirmation until the note has content. */\n requireNote?: boolean;\n notePlaceholder?: string;\n submittingLabel?: string;\n isSubmitting?: boolean;\n className?: string;\n onClose: () => void;\n onConfirm: (note: string) => void;\n}\n\n/**\n * Confirm dialog that collects a free-text note — approvals, rejections, information\n * requests. The note is trimmed before it reaches `onConfirm`.\n *\n * Kept as a preset because it owns state, and a composition cannot.\n */\nexport function NoteConfirmModal({ isOpen, ...rest }: NoteConfirmModalProps) {\n // The shell split is what resets the note. Before 0.3.0 this component had no\n // `isOpen` and callers mounted it conditionally, so the typed note was discarded for\n // free. Now that it stays mounted, unmounting the shell is what clears it —\n // otherwise a rejection note would reappear the next time the dialog opened.\n if (!isOpen) return null;\n return <NoteConfirmModalShell {...rest} />;\n}\n\nfunction NoteConfirmModalShell({\n title,\n subtitle,\n tone = 'default',\n size = 'md',\n confirmLabel,\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n requireNote = false,\n notePlaceholder = 'Add a note…',\n submittingLabel = 'Saving…',\n isSubmitting = false,\n className,\n onClose,\n onConfirm,\n}: Omit<NoteConfirmModalProps, 'isOpen'>) {\n const [note, setNote] = useState('');\n const disabled = isSubmitting || (requireNote && !note.trim());\n\n return (\n <Modal isOpen onClose={onClose} label={title} size={size} className={className}>\n <ModalHeader tone={tone}>\n <ModalTitle>{title}</ModalTitle>\n {subtitle && <ModalDescription>{subtitle}</ModalDescription>}\n </ModalHeader>\n <ModalBody>\n <Textarea\n value={note}\n onChange={(e) => setNote(e.target.value)}\n placeholder={notePlaceholder}\n rows={4}\n />\n </ModalBody>\n <ModalFooter>\n <Button variant=\"neutral\" size=\"md\" onClick={onClose}>\n {cancelLabel}\n </Button>\n <Button variant={confirmVariant} size=\"md\" disabled={disabled} onClick={() => onConfirm(note.trim())}>\n {isSubmitting ? submittingLabel : confirmLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuEllipsis } from 'react-icons/lu';\n\nexport interface DropdownMenuItem {\n label: string;\n onSelect: () => void;\n tone?: 'default' | 'danger';\n disabled?: boolean;\n /** Draw a separator above this item. */\n separatorBefore?: boolean;\n}\n\nexport interface DropdownMenuProps {\n items: DropdownMenuItem[];\n /** Custom trigger content. Defaults to a `⋯` overflow button. */\n trigger?: ReactNode;\n /** Accessible name for the trigger, e.g. `Open actions for Admin`. */\n label: string;\n align?: 'left' | 'right';\n className?: string;\n}\n\n/** Overflow / row-actions menu.\n *\n * Keeps the outside-click dismissal and `aria-haspopup`/`aria-expanded` wiring from the\n * hand-rolled `RowMenu` it replaces, and adds Esc-to-close. `mousedown` is stopped at the\n * wrapper so the menu works inside clickable table rows. */\nexport function DropdownMenu({\n items,\n trigger,\n label,\n align = 'right',\n className,\n}: DropdownMenuProps) {\n const [open, setOpen] = useState(false);\n const rootRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n\n function handleOutside(e: MouseEvent) {\n const root = rootRef.current;\n if (root && !root.contains(e.target as Node)) setOpen(false);\n }\n function handleKey(e: KeyboardEvent) {\n if (e.key === 'Escape') setOpen(false);\n }\n\n document.addEventListener('mousedown', handleOutside);\n document.addEventListener('keydown', handleKey);\n return () => {\n document.removeEventListener('mousedown', handleOutside);\n document.removeEventListener('keydown', handleKey);\n };\n }, [open]);\n\n const visible = items.filter((item) => item.label);\n\n return (\n <div\n ref={rootRef}\n className={clsx('relative', className)}\n onMouseDown={(e) => e.stopPropagation()}\n >\n <button\n type=\"button\"\n aria-label={label}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n onClick={(e) => {\n e.stopPropagation();\n setOpen((v) => !v);\n }}\n className={clsx(\n 'rounded-md border border-default bg-default text-body-xs font-medium leading-none text-default transition-colors hover:bg-default-secondary',\n trigger ? 'p-1.5' : 'px-2.5 py-1.5',\n )}\n >\n {trigger ?? <LuEllipsis className=\"size-4\" />}\n </button>\n\n {open && (\n <div\n role=\"menu\"\n className={clsx(\n 'absolute top-full z-20 mt-1 min-w-[148px] rounded-lg border border-default bg-default py-1 shadow-lg',\n align === 'right' ? 'right-0' : 'left-0',\n )}\n >\n {visible.map((item, i) => (\n <div key={item.label}>\n {item.separatorBefore && i > 0 && (\n <div className=\"my-1 h-px bg-divider\" />\n )}\n <button\n type=\"button\"\n role=\"menuitem\"\n disabled={item.disabled}\n className={clsx(\n 'flex w-full items-center px-3 py-2 text-left text-body-sm transition-colors',\n item.disabled && 'cursor-not-allowed opacity-50',\n item.tone === 'danger'\n ? 'text-danger hover:bg-danger-tertiary'\n : 'text-default hover:bg-default-secondary',\n )}\n onClick={(e) => {\n e.stopPropagation();\n setOpen(false);\n item.onSelect();\n }}\n >\n {item.label}\n </button>\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\n\nexport type CardSize = 'sm' | 'md' | 'lg';\nexport type CardRadius = 'lg' | 'xl' | '2xl';\nexport type CardTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger';\nexport type CardFooterAlign = 'start' | 'between' | 'end';\n\nconst RADIUS: Record<CardRadius, string> = {\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n};\n\nconst TONE: Record<CardTone, string> = {\n default: 'border-default bg-default',\n brand: 'border-brand-tertiary bg-brand-tertiary',\n positive: 'border-positive-tertiary bg-positive-tertiary',\n warning: 'border-warning-tertiary bg-warning-tertiary',\n // The one asymmetry: danger keeps the strong `border-danger` rather than the\n // tertiary border, because it is the only tone that has to read as an alarm from\n // across a dashboard. Byte-identical to the deleted AlertCard's danger surface.\n danger: 'border-danger bg-danger-tertiary',\n};\n\n/** Header and footer share one padding ladder. */\nconst BOX: Record<CardSize, string> = {\n sm: 'px-3 py-2',\n md: 'px-4 py-3',\n lg: 'px-5 py-4',\n};\n\nconst BODY_BOX: Record<CardSize, string> = {\n sm: 'gap-3 p-3',\n md: 'gap-4 p-4',\n lg: 'gap-5 p-5',\n};\n\nconst TITLE_SIZE: Record<CardSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n};\n\nconst FOOTER_ALIGN: Record<CardFooterAlign, string> = {\n start: 'justify-start',\n between: 'justify-between',\n end: 'justify-end',\n};\n\n// ── Card ───────────────────────────────────────────────────────────────────────\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** `2xl` suits detail pages, `xl` section panels, `lg` dense or nested cards. */\n radius?: CardRadius;\n /**\n * Surface tint. This is a prop rather than a `className` because a tone has to\n * un-set the base `border-default bg-default` pair, not add to it.\n */\n tone?: CardTone;\n}\n\n/**\n * The card shell. Composed from `CardHeader`, `CardBody` and `CardFooter` — or from\n * nothing at all, if you want content to bleed to the edges (drop `CardBody` and put\n * a `DataTable` straight inside).\n *\n * Replaces `SectionCard` and the two monolithic cards that shipped beside it,\n * `AlertCard` and `BenchmarkCard`. Both of those are now documented compositions; see\n * the Cards page. The vocabulary follows shadcn/ui so it is already familiar, with\n * `CardBody` in place of its `CardContent`.\n */\nexport function Card({ children, radius = '2xl', tone = 'default', className, ...rest }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n // `overflow-hidden` is load-bearing: it clips a header's border-b to the\n // rounded corner. Removing it leaves the rule poking past the radius.\n className={cn('flex flex-col overflow-hidden border', RADIUS[radius], TONE[tone], className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n// ── CardHeader ─────────────────────────────────────────────────────────────────\n\nexport interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n /** Bottom rule separating the header from the body. */\n divider?: boolean;\n}\n\n/**\n * Header row. Holds `CardTitle`, `CardDescription` and an optional `CardAction`.\n *\n * The `has-[…]` selector switches to a two-column grid only when a `CardAction` is\n * present, which is what lets title, description and action share a header with no\n * wrapper div and no stray gap when the action is absent.\n */\nexport function CardHeader({\n children,\n size = 'md',\n divider = true,\n className,\n ...rest\n}: CardHeaderProps) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n 'grid auto-rows-min items-center gap-x-3 gap-y-0.5',\n 'has-[[data-slot=card-action]]:grid-cols-[1fr_auto]',\n BOX[size],\n divider && 'border-b border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n// ── CardTitle / CardDescription / CardAction ───────────────────────────────────\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n size?: CardSize;\n /** Heading level. Defaults to `p`; use h2/h3 where the page has a real hierarchy. */\n as?: 'h2' | 'h3' | 'h4' | 'p';\n}\n\nexport function CardTitle({ children, size = 'md', as: Tag = 'p', className, ...rest }: CardTitleProps) {\n return (\n <Tag\n data-slot=\"card-title\"\n // min-w-0 belongs here, not on the parent: a grid item defaults to\n // min-width:auto, so `truncate` on a title would not work without it.\n className={cn('min-w-0 font-semibold text-default', TITLE_SIZE[size], className)}\n {...rest}\n >\n {children}\n </Tag>\n );\n}\n\nexport interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n children: ReactNode;\n}\n\nexport function CardDescription({ children, className, ...rest }: CardDescriptionProps) {\n return (\n <p\n data-slot=\"card-description\"\n className={cn('min-w-0 text-body-tiny text-default-secondary', className)}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\nexport interface CardActionProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** Right-hand slot in a `CardHeader` — a button, a count, a status badge, a menu. */\nexport function CardAction({ children, className, ...rest }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 shrink-0 self-center justify-self-end', className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n// ── CardBody ───────────────────────────────────────────────────────────────────\n\nexport interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n}\n\n/**\n * The content region. A vertical stack by default.\n *\n * Because this file uses `cn`, `className` genuinely overrides the base — so\n * `className=\"flex-row items-center\"` gives you a row, and\n * `className=\"grid grid-cols-3\"` a grid. That is what makes the `AlertCard` and\n * `BenchmarkCard` rebuilds possible without a `layout` prop.\n */\nexport function CardBody({ children, size = 'md', className, ...rest }: CardBodyProps) {\n return (\n <div data-slot=\"card-body\" className={cn('flex flex-col', BODY_BOX[size], className)} {...rest}>\n {children}\n </div>\n );\n}\n\n// ── CardFooter ─────────────────────────────────────────────────────────────────\n\nexport interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n divider?: boolean;\n align?: CardFooterAlign;\n}\n\n/** Action row at the foot of a card. Mirrors `ModalFooter` and `Drawer`'s footer. */\nexport function CardFooter({\n children,\n size = 'md',\n divider = true,\n align = 'end',\n className,\n ...rest\n}: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'flex items-center gap-2',\n BOX[size],\n FOOTER_ALIGN[align],\n divider && 'border-t border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * Two genuinely different heading contexts, which the source markup distinguished:\n *\n * `page` 24px title / 14px subtitle — an in-body page heading (settings, users,\n * alerts), i.e. the old `text-2xl` + `mt-1 text-body-sm` block.\n * `toolbar` 20px title / 13px subtitle — inside a `PageToolbar`, where the bar is\n * only 72px tall. Flattening these into one size would have grown ten\n * toolbar titles by 4px.\n * `section` 18px — a panel or card heading.\n */\nexport type PageHeadingSize = 'page' | 'toolbar' | 'section';\n\nconst TITLE: Record<PageHeadingSize, string> = {\n page: 'text-2xl font-semibold text-default',\n toolbar: 'text-heading-sm font-semibold leading-snug text-default',\n section: 'text-lg font-semibold text-default',\n};\n\nconst SUBTITLE: Record<PageHeadingSize, string> = {\n page: 'mt-1 text-body-sm text-default-secondary',\n toolbar: 'text-body-xs text-default-secondary',\n section: 'mt-1 text-body-sm text-default-secondary',\n};\n\nexport interface PageHeadingProps {\n title: ReactNode;\n subtitle?: ReactNode;\n size?: PageHeadingSize;\n /** Heading level. Defaults to `h1` for page/toolbar and `h2` for section. */\n as?: 'h1' | 'h2' | 'h3';\n /** Right-aligned action cluster. When set, the heading becomes a flex row. */\n actions?: ReactNode;\n /** Clamp a long title to one line — needed when the title is user data, e.g. an article headline. */\n truncateTitle?: boolean;\n className?: string;\n}\n\n/**\n * Page or section title with an optional subtitle underneath.\n *\n * Replaces nine copies of the `<h1>` + `<p className=\"mt-1 …\">` block, plus the\n * heading halves of `SettingsTabs` and `my-account/tabs`.\n *\n * Emitting a real heading element matters: `reviewer-detail`,\n * `settings-audit-log`'s table area and `widget-gallery` render their titles as\n * `<p>`/`<div>` today, so `getByRole('heading')` finds nothing there — an\n * accessibility gap the e2e specs currently work around.\n */\nexport function PageHeading({\n title,\n subtitle,\n size = 'page',\n as,\n actions,\n truncateTitle,\n className,\n}: PageHeadingProps) {\n const Tag = as ?? (size === 'section' ? 'h2' : 'h1');\n\n const heading = (\n <div className=\"flex min-w-0 flex-col gap-0.5\">\n <Tag className={clsx(TITLE[size], truncateTitle && 'truncate')}>{title}</Tag>\n {subtitle && <p className={SUBTITLE[size]}>{subtitle}</p>}\n </div>\n );\n\n if (!actions) return className ? <div className={className}>{heading}</div> : heading;\n\n return (\n <div className={clsx('flex items-start justify-between gap-4', className)}>\n {heading}\n <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type PageToolbarSize = 'sm' | 'md';\n\nexport interface PageToolbarProps {\n children: ReactNode;\n /** Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons). */\n wrap?: boolean;\n /** Bar height and padding. `sm` suits a secondary bar under the main toolbar. */\n size?: PageToolbarSize;\n className?: string;\n}\n\nconst SIZE: Record<PageToolbarSize, string> = {\n sm: 'min-h-[56px] px-4 py-2.5 md:px-7',\n md: 'min-h-[72px] px-4 py-4 md:px-7',\n};\n\n/**\n * The sticky top bar on a full-bleed detail or list screen: title block on the\n * left, actions on the right.\n *\n * Replaces ten copies of this class string. Three of those copies used the\n * responsive `px-4 py-4 md:px-7` and seven used a fixed `px-7 py-4`; the responsive\n * variant is adopted here, which is a deliberate improvement below `md` where the\n * fixed 28px padding was cramped.\n */\nexport function PageToolbar({ children, wrap, size = 'md', className }: PageToolbarProps) {\n return (\n <div\n className={clsx(\n 'flex shrink-0 items-center justify-between gap-4 border-b border-default bg-default',\n SIZE[size],\n wrap && 'flex-wrap gap-2',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type FilterBarSize = 'sm' | 'md';\n\nexport interface FilterBarProps {\n children: ReactNode;\n /** Right-aligned slot for a result count or a secondary action. */\n trailing?: ReactNode;\n /** Gap between controls. `sm` for a filter row inside a card or drawer. */\n size?: FilterBarSize;\n className?: string;\n}\n\nconst GAP: Record<FilterBarSize, string> = {\n sm: 'gap-2',\n md: 'gap-3',\n};\n\n/**\n * Row of search inputs and filter selects above a table.\n *\n * Replaces nine copies of `flex flex-wrap items-center gap-3`. Thin by design — the\n * value is that the spacing is decided once, not that it hides anything.\n */\nexport function FilterBar({ children, trailing, size = 'md', className }: FilterBarProps) {\n return (\n <div className={clsx('flex flex-wrap items-center', GAP[size], className)}>\n {children}\n {trailing && <div className=\"ml-auto flex items-center gap-2\">{trailing}</div>}\n </div>\n );\n}\n","import clsx from 'clsx';\n\nexport type TabsVariant = 'underline' | 'pill';\nexport type TabsSize = 'sm' | 'md';\n\nexport interface TabItem<K extends string = string> {\n key: K;\n label: string;\n /** Renders a count chip after the label. */\n count?: number;\n}\n\nexport interface TabsProps<K extends string = string> {\n items: TabItem<K>[];\n value: K;\n onChange: (key: K) => void;\n /**\n * `underline` is the detail-page form (entity detail, reviewer detail, role detail).\n * `pill` is the filter-style form used by the reviewer queue.\n */\n variant?: TabsVariant;\n /** `md` is the page-level strip; `sm` suits a tab strip inside a card or drawer. */\n size?: TabsSize;\n className?: string;\n}\n\n/**\n * Per-variant sizing. The two variants have genuinely different geometry — a pill has\n * a background to pad against, an underline only has a baseline — so this is a nested\n * map rather than one shared scale.\n */\nconst SIZE: Record<TabsVariant, Record<TabsSize, { strip: string; tab: string }>> = {\n underline: {\n sm: { strip: 'gap-4', tab: 'px-0.5 py-1.5 text-body-xs' },\n md: { strip: 'gap-6', tab: 'px-0.5 py-2.5 text-body-sm' },\n },\n pill: {\n sm: { strip: 'gap-1', tab: 'rounded-md px-2.5 py-1.5 text-body-tiny' },\n md: { strip: 'gap-1.5', tab: 'rounded-lg px-3.5 py-2 text-body-xs' },\n },\n};\n\n/**\n * State-driven tab strip.\n *\n * The `underline` active colour is `background-brand` (#0C2D58), which is what Figma\n * specifies. Two of the source copies also set `style={{ borderColor: '#0c2d58' }}`\n * redundantly next to the same Tailwind class — dropped here.\n */\nexport function Tabs<K extends string = string>({\n items,\n value,\n onChange,\n variant = 'underline',\n size = 'md',\n className,\n}: TabsProps<K>) {\n const isPill = variant === 'pill';\n const s = SIZE[variant][size];\n\n return (\n <div\n role=\"tablist\"\n className={clsx(\n 'flex shrink-0 overflow-x-auto',\n s.strip,\n !isPill && 'border-b border-default',\n className,\n )}\n >\n {items.map((tab) => {\n const active = tab.key === value;\n return (\n <button\n key={tab.key}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n onClick={() => onChange(tab.key)}\n className={clsx(\n 'flex shrink-0 items-center gap-1.5 whitespace-nowrap transition-colors',\n s.tab,\n isPill\n ? clsx(\n 'font-medium',\n active\n ? 'bg-brand text-brand-on-brand'\n : 'text-default-secondary hover:bg-default-secondary',\n )\n : clsx(\n 'leading-snug',\n active\n ? 'border-b-2 border-brand-emphasis font-semibold text-brand-emphasis'\n : 'font-normal text-default-secondary hover:text-default',\n ),\n )}\n >\n {tab.label}\n {tab.count !== undefined && (\n <span\n className={clsx(\n 'rounded-md px-1.5 py-px text-body-tiny font-medium leading-snug',\n active && isPill\n ? 'bg-brand-hover text-brand-on-brand'\n : 'bg-default-secondary text-default-secondary',\n )}\n >\n {tab.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n","import { type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type NavItemSize = 'sm' | 'md';\n\nexport interface NavItemProps {\n icon?: ReactNode;\n label: string;\n isActive?: boolean;\n /** Red indicator dot at top-right corner (e.g. unread count) */\n indicator?: boolean;\n /** Collapsed mode — icon only, label hidden */\n collapsed?: boolean;\n /** Row height. `sm` suits a dense secondary nav or a nested group. */\n size?: NavItemSize;\n className?: string;\n}\n\nconst SIZE: Record<NavItemSize, { box: string; label: string }> = {\n sm: { box: 'h-9 gap-2 rounded-lg px-2.5 py-1.5', label: 'text-body-xs' },\n md: { box: 'h-11 gap-3 rounded-xl px-3.5 py-2.5', label: 'text-body-sm' },\n};\n\nexport function NavItem({\n icon,\n label,\n isActive = false,\n indicator = false,\n collapsed = false,\n size = 'md',\n className,\n}: NavItemProps) {\n const s = SIZE[size];\n return (\n <span\n className={clsx(\n 'relative flex w-full items-center transition-colors',\n s.box,\n collapsed && 'justify-center',\n isActive\n ? 'bg-brand text-brand-on-brand'\n : [\n 'border border-default bg-default text-default-secondary',\n 'hover:bg-brand-tertiary-hover hover:border-brand-tertiary hover:text-brand',\n ],\n className,\n )}\n >\n {icon !== undefined && (\n <span className=\"shrink-0 [&_svg]:size-4\">{icon}</span>\n )}\n {!collapsed && (\n <span className={clsx('min-w-0 flex-1 truncate font-regular leading-snug', s.label)}>\n {label}\n </span>\n )}\n {indicator && (\n <span className=\"absolute -right-px -top-px size-2 rounded-full bg-danger\" />\n )}\n </span>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EyebrowLabelVariant = 'uppercase' | 'plain';\n\nexport interface EyebrowLabelProps {\n children: ReactNode;\n /**\n * `uppercase` is the dominant form (nine of twelve source copies).\n * `plain` covers the entity-detail / reviewer-detail variant, whose label text is\n * already capitalised in the source string.\n */\n variant?: EyebrowLabelVariant;\n className?: string;\n}\n\n/**\n * Small semibold label above a group of fields.\n *\n * Replaces twelve copies across three variants:\n * `mb-2 text-body-tiny font-semibold uppercase tracking-wide …` (×9)\n * `text-[11px] font-semibold … tracking-wide` (×5, entity/reviewer detail)\n * `text-body-tiny font-semibold uppercase tracking-wider` (×2, entity onboarding)\n *\n * `text-body-tiny` is 11px, so the `text-[11px]` variant collapses into it exactly.\n * The `tracking-wider` copies become `tracking-wide` — a 0.0125em difference at 11px,\n * i.e. sub-pixel.\n */\nexport function EyebrowLabel({ children, variant = 'uppercase', className }: EyebrowLabelProps) {\n return (\n <p\n className={clsx(\n 'text-body-tiny font-semibold tracking-wide text-default-secondary',\n variant === 'uppercase' && 'uppercase',\n className,\n )}\n >\n {children}\n </p>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { WidgetTitle } from './widget-title';\nimport type { WidgetTitleSize } from './widget-title';\n\nexport type WidgetHeaderEyebrowVariant = 'uppercase' | 'plain';\n\nexport interface WidgetHeaderProps {\n eyebrow?: string;\n eyebrowVariant?: WidgetHeaderEyebrowVariant;\n title: string;\n titleSize?: WidgetTitleSize;\n subtitle?: string;\n badge?: ReactNode;\n action?: ReactNode;\n className?: string;\n}\n\n// uppercase: 11px/medium/tracked, matches Variation 2 mockups · plain: 13px/regular, matches Variation 1's small label line\nconst eyebrowStyles: Record<WidgetHeaderEyebrowVariant, string> = {\n uppercase: 'text-body-tiny font-medium uppercase tracking-[0.66px] text-default-secondary',\n plain: 'text-body-xs leading-[1.4] text-default-secondary',\n};\n\nexport function WidgetHeader({\n eyebrow,\n eyebrowVariant = 'uppercase',\n title,\n titleSize,\n subtitle,\n badge,\n action,\n className,\n}: WidgetHeaderProps) {\n return (\n <div className={clsx('flex items-start justify-between gap-2', className)}>\n <div className=\"min-w-0 flex-1\">\n {eyebrow && <p className={eyebrowStyles[eyebrowVariant]}>{eyebrow}</p>}\n <WidgetTitle size={titleSize}>{title}</WidgetTitle>\n {subtitle && (\n <p className=\"mt-1 text-body-xs text-default-secondary leading-snug\">{subtitle}</p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {badge}\n {action}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type WidgetTitleSize = 'sm' | 'md' | 'lg';\n\nexport interface WidgetTitleProps {\n children: ReactNode;\n size?: WidgetTitleSize;\n className?: string;\n}\n\n// sm: 16px/semibold (default) · md: 18px/bold (Variation 2 mockups) · lg: 20px/semibold (Variation 1 mockups)\nconst sizeStyles: Record<WidgetTitleSize, string> = {\n sm: 'text-subheading-sm font-semibold leading-none',\n md: 'text-[18px] font-bold leading-normal',\n lg: 'text-subheading font-semibold leading-[1.2]',\n};\n\nexport function WidgetTitle({ children, size = 'sm', className }: WidgetTitleProps) {\n return (\n <h3 className={clsx(sizeStyles[size], 'text-default', className)}>\n {children}\n </h3>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport interface WidgetFooterProps {\n caption?: string;\n subcaption?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport function WidgetFooter({ caption, subcaption, action, className }: WidgetFooterProps) {\n return (\n <div className={clsx('flex items-center gap-3', className)}>\n {caption && (\n <div className=\"flex items-stretch gap-3 flex-1 min-w-0\">\n <div className=\"w-0.5 shrink-0 self-stretch rounded-full bg-brand\" />\n <div className=\"min-w-0\">\n <p className=\"text-body-sm font-medium text-default leading-snug\">\n {caption}\n </p>\n {subcaption && (\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{subcaption}</p>\n )}\n </div>\n </div>\n )}\n {action && <div className=\"ml-auto shrink-0\">{action}</div>}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { StatusTone } from '../status/status-badge';\n\nconst DOT_TONE: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nexport interface StatTileProps {\n label: string;\n value: string | number;\n /** Status tone for the leading dot. Prefer this over `dotColor`. */\n tone?: StatusTone;\n /**\n * @deprecated Pass `tone` instead. A raw colour here bypasses the token layer,\n * which is how competing status palettes drift apart.\n */\n dotColor?: string;\n className?: string;\n}\n\nexport function StatTile({ label, value, tone, dotColor, className }: StatTileProps) {\n const showDot = Boolean(tone || dotColor);\n\n return (\n <div\n className={clsx(\n 'flex flex-col gap-2 rounded-xl border border-default bg-default p-4',\n className,\n )}\n >\n <div className=\"flex items-center gap-1.5\">\n {showDot && (\n <span\n className={clsx('size-2 shrink-0 rounded-full', tone && DOT_TONE[tone])}\n style={tone ? undefined : { backgroundColor: dotColor }}\n />\n )}\n <span className=\"text-body-xs font-medium text-default-secondary whitespace-nowrap\">\n {label}\n </span>\n </div>\n <span className=\"text-heading font-semibold text-default leading-none\">{value}</span>\n </div>\n );\n}\n","import clsx from 'clsx';\n\nexport type StatNumberSize = 'sm' | 'md' | 'lg';\n\nexport type StatNumberWeight = 'medium' | 'bold';\n\nexport interface StatNumberProps {\n value: string | number;\n unit?: string;\n size?: StatNumberSize;\n weight?: StatNumberWeight;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex color, overrides the default text color via inline style. Use when the exact source color doesn't match a design token. */\n color?: string;\n className?: string;\n}\n\n// 32 / 40 / 48px — the --typo-scale-07/08/09 steps. These read `text-scale-0*` until\n// 0.3.0, which the preset never defined, so every size emitted no font-size at all.\nconst sizeStyles: Record<StatNumberSize, string> = {\n sm: 'text-subtitle',\n md: 'text-subtitle-lg',\n lg: 'text-title',\n};\n\nconst weightStyles: Record<StatNumberWeight, string> = {\n medium: 'font-medium',\n bold: 'font-bold',\n};\n\nexport function StatNumber({ value, unit, size = 'md', weight = 'bold', color, className }: StatNumberProps) {\n return (\n <p\n className={clsx(sizeStyles[size], weightStyles[weight], 'leading-none', !color && 'text-default', className)}\n style={color ? { color } : undefined}\n >\n {value}\n {unit && (\n <span className=\"ml-1 text-subheading font-medium text-default-secondary\">{unit}</span>\n )}\n </p>\n );\n}\n","import clsx from 'clsx';\n\nexport type ScoreValueSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';\nexport type ScoreValueWeight = 'normal' | 'semibold' | 'bold';\nexport type ScoreTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral' | 'default';\nexport type ScoreValueTone = ScoreTone | 'auto';\n\n/**\n * The four tones the automatic ramp can produce.\n *\n * Narrower than `ScoreTone` on purpose: a ramp position is always one of these, so the\n * result is directly assignable to `ProgressBarTone` too — which is what lets a caller\n * tone a bar and its score from one `getScoreTone` call.\n */\nexport type ScoreRampTone = 'positive' | 'neutral' | 'warning' | 'danger';\n\n/** Which end of the scale is the bad end. */\nexport type ScoreDirection = 'higher-is-worse' | 'higher-is-better';\n\nexport interface ScoreThresholds {\n /** At or above this, the score is `danger`. */\n danger: number;\n /** At or above this, `warning`. */\n warning: number;\n /** At or above this, `neutral`. Below it, `positive`. */\n neutral: number;\n}\n\n/**\n * Default ramp, on a 0–100 scale read as \"higher is worse\" — the risk case.\n *\n * 0.2.0's ramp had only four stops and resolved 65–79 to `brand` (the blue brand\n * colour), which left `warning` and `positive` unreachable without passing `tone`\n * by hand. This is a real five-stop ramp.\n */\nexport const DEFAULT_SCORE_THRESHOLDS: ScoreThresholds = { danger: 80, warning: 65, neutral: 50 };\n\n/**\n * Resolve a numeric score to a tone.\n *\n * Was `getRiskTone` in 0.2.0, with the thresholds and the direction both hardcoded.\n */\nexport function getScoreTone(\n score: number,\n {\n direction = 'higher-is-worse',\n thresholds = DEFAULT_SCORE_THRESHOLDS,\n }: { direction?: ScoreDirection; thresholds?: ScoreThresholds } = {},\n): ScoreRampTone {\n // Flip the score, not the comparisons — one ramp, read from either end.\n const v = direction === 'higher-is-better' ? 100 - score : score;\n if (v >= thresholds.danger) return 'danger';\n if (v >= thresholds.warning) return 'warning';\n if (v >= thresholds.neutral) return 'neutral';\n return 'positive';\n}\n\n// 13 / 14 / 16 / 20 / 32px\nconst SIZE: Record<ScoreValueSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n xl: 'text-subheading',\n '2xl': 'text-subtitle',\n};\n\nconst WEIGHT: Record<ScoreValueWeight, string> = {\n normal: 'font-normal',\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nconst TONE: Record<ScoreTone, string> = {\n brand: 'text-brand',\n positive: 'text-positive',\n warning: 'text-warning',\n danger: 'text-danger',\n neutral: 'text-default-secondary',\n default: 'text-default',\n};\n\nexport interface ScoreValueProps {\n value: string | number;\n /** Trailing caption — `/100`, `High`, `of target`. */\n label?: string;\n size?: ScoreValueSize;\n weight?: ScoreValueWeight;\n /** `auto` derives the tone from `value` via {@link getScoreTone}. */\n tone?: ScoreValueTone;\n direction?: ScoreDirection;\n thresholds?: ScoreThresholds;\n className?: string;\n}\n\n/**\n * A scored number with an optional caption and a tone that can track its value.\n *\n * Was `RiskScore`. Nothing about it was ever risk-specific except the name and the\n * direction of its ramp, so both are now parameters: use it for a risk score, a\n * compliance score, a match confidence, a utilisation percentage.\n *\n * Not to be confused with `StatNumber`, which is the *large display* number with a\n * unit (32–48px, for tiles and widget headlines). `ScoreValue` is the inline one with\n * a label and a tone ramp.\n */\nexport function ScoreValue({\n value,\n label,\n size = 'md',\n weight = 'bold',\n tone = 'auto',\n direction = 'higher-is-worse',\n thresholds = DEFAULT_SCORE_THRESHOLDS,\n className,\n}: ScoreValueProps) {\n // A numeric-looking string still resolves. In 0.2.0 `tone=\"auto\"` fell back to\n // `default` for any string, so callers passing `score=\"82\"` silently got no tone.\n const numeric = typeof value === 'number' ? value : Number(value);\n const resolved: ScoreTone =\n tone === 'auto'\n ? Number.isFinite(numeric)\n ? getScoreTone(numeric, { direction, thresholds })\n : 'default'\n : tone;\n\n return (\n <span className={clsx('inline-flex items-baseline gap-1', className)}>\n <span className={clsx(SIZE[size], WEIGHT[weight], TONE[resolved])}>{value}</span>\n {label && <span className=\"text-body-xs text-default-secondary whitespace-nowrap\">{label}</span>}\n </span>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type TileGridColumns = 2 | 3 | 4 | 5 | 6;\n\n/**\n * Responsive column counts. Every source copy started two-up on mobile and stepped\n * to its full count at one breakpoint.\n *\n * The twelve source grids disagreed on which: seven used `lg:`, three used `md:`.\n * Standardising on `lg:` matches eight of them byte-for-byte and is the safer choice\n * — five tiles at `md` (768px) was cramped. `alerts`, `settings-users` and\n * `settings-organization` therefore stay two-up slightly longer on tablets than\n * before; that is the one deliberate layout change here.\n *\n * Six keeps its intermediate `sm:grid-cols-3` step, matching entities-listing —\n * without it, six tiles would stack 2×3 on tablet instead of 3×2.\n */\nexport type TileGridBreakpoint = 'sm' | 'md' | 'lg';\n\nconst COLUMNS: Record<TileGridBreakpoint, Record<TileGridColumns, string>> = {\n sm: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 sm:grid-cols-4',\n 5: 'grid-cols-2 sm:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-6',\n },\n md: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 md:grid-cols-3',\n 4: 'grid-cols-2 md:grid-cols-4',\n 5: 'grid-cols-2 md:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-6',\n },\n lg: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 lg:grid-cols-3',\n 4: 'grid-cols-2 lg:grid-cols-4',\n 5: 'grid-cols-2 lg:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n },\n};\n\nexport interface TileGridProps {\n children: ReactNode;\n columns?: TileGridColumns;\n /**\n * Breakpoint at which the grid reaches its full column count. `lg` is the default\n * and correct for a full-width page. Narrow contexts — a stat row inside a panel,\n * as on the article detail page — legitimately need `sm`.\n */\n at?: TileGridBreakpoint;\n className?: string;\n}\n\n/**\n * A responsive grid of equal-width tiles.\n *\n * Was `StatTileGrid`, which read as a `StatTile`-specific component. It has never been\n * coupled to one: no context, no cloning, no constraint on `children`. It takes any\n * nodes — `StatTile`s, `Card`s, chart tiles — and only owns the column counts and the\n * `gap-3`. The rename says so.\n */\nexport function TileGrid({\n children,\n columns = 4,\n at = 'lg',\n className,\n}: TileGridProps) {\n return <div className={clsx('grid gap-3', COLUMNS[at][columns], className)}>{children}</div>;\n}\n","/**\n * Chart colour.\n *\n * SVG paints via the `stroke` / `fill` *attributes*, which cannot take a Tailwind\n * class — so charts resolve a `tone` to a CSS variable reference instead of a utility.\n * That keeps them on the token layer; 0.2.0's charts defaulted to raw hex (`#0c2d58`,\n * `rgba(140,155,176,0.5)`) and drifted from it.\n *\n * Every chart still accepts an explicit `color` string for genuinely data-driven\n * colour — a series whose colour comes from the data, not from semantics.\n */\nexport type ChartTone = 'brand' | 'info' | 'positive' | 'warning' | 'danger' | 'neutral';\n\nexport const CHART_TONE: Record<ChartTone, string> = {\n brand: 'var(--color-background-brand-default)',\n info: 'var(--status-info-dot)',\n positive: 'var(--color-background-positive-default)',\n warning: 'var(--color-background-warning-default)',\n danger: 'var(--color-background-danger-default)',\n neutral: 'var(--color-background-neutral-default)',\n};\n\n/** The muted track/rest colour behind a highlighted series. */\nexport const CHART_TRACK = 'var(--color-background-default-tertiary)';\n\n/**\n * Ordered sequence for multi-series charts, so two donuts in the same product never\n * assign different colours to the same first category. Semantic tones come first\n * because a chart with two or three series is usually still saying something.\n */\nexport const CHART_SEQUENCE: ChartTone[] = ['brand', 'info', 'positive', 'warning', 'danger', 'neutral'];\n\n/** Resolve an explicit colour, else a tone, else the sequence position. */\nexport function resolveChartColor(color: string | undefined, tone: ChartTone | undefined, index = 0): string {\n if (color) return color;\n if (tone) return CHART_TONE[tone];\n return CHART_TONE[CHART_SEQUENCE[index % CHART_SEQUENCE.length]];\n}\n","import clsx from 'clsx';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type BarChartOrientation = 'vertical' | 'horizontal';\nexport type BarChartSize = 'sm' | 'md' | 'lg';\n\n/** Thickness of one bar / one group slot, and the label type step. */\nconst SIZE: Record<BarChartSize, { band: number; gap: number; label: string }> = {\n sm: { band: 14, gap: 6, label: 'text-body-tiny' },\n md: { band: 20, gap: 8, label: 'text-body-xs' },\n lg: { band: 28, gap: 10, label: 'text-body-xs' },\n};\n\nexport interface BarChartSeries {\n label: string;\n /** One value per category. */\n values: number[];\n tone?: ChartTone;\n color?: string;\n}\n\nexport interface BarChartProps {\n /** Category names — the axis labels. */\n categories: string[];\n series: BarChartSeries[];\n orientation?: BarChartOrientation;\n /** Stack series on top of each other instead of placing them side by side. */\n stacked?: boolean;\n size?: BarChartSize;\n /** Overall length of the value axis, in px. */\n length?: number;\n /** Show the category labels along the axis. */\n showLabels?: boolean;\n /** Print each bar's value at the end of the bar. Horizontal orientation only. */\n showValues?: boolean;\n radius?: number;\n label?: string;\n className?: string;\n}\n\n/**\n * Grouped or stacked bars, in either orientation.\n *\n * Horizontal is the orientation the library was missing and the one that actually suits\n * category data, because long category names get a full line of width rather than being\n * rotated or truncated under a vertical bar.\n *\n * Deliberately axis-light: one baseline, no gridlines, no ticks. For anything needing\n * real axes or interaction, this is the wrong component.\n */\nexport function BarChart({\n categories,\n series,\n orientation = 'horizontal',\n stacked = false,\n size = 'md',\n length = 240,\n showLabels = true,\n showValues = false,\n radius = 3,\n label,\n className,\n}: BarChartProps) {\n const { band, gap, label: labelClass } = SIZE[size];\n if (categories.length === 0 || series.length === 0) return null;\n\n // Stacked bars share one band per category; grouped bars split it between series.\n const perCategory = stacked ? band : band * series.length + gap * (series.length - 1);\n\n const categoryTotals = categories.map((_, ci) =>\n stacked\n ? series.reduce((sum, s) => sum + Math.max(0, s.values[ci] ?? 0), 0)\n : Math.max(...series.map((s) => Math.max(0, s.values[ci] ?? 0))),\n );\n const max = Math.max(...categoryTotals, 1);\n\n const horizontal = orientation === 'horizontal';\n\n return (\n <div\n className={clsx('flex w-full min-w-0', horizontal ? 'flex-col gap-2' : 'flex-row items-end gap-3', className)}\n role={label ? 'img' : undefined}\n aria-label={label}\n >\n {categories.map((category, ci) => {\n const bars = series.map((s, si) => ({\n key: s.label,\n value: Math.max(0, s.values[ci] ?? 0),\n color: resolveChartColor(s.color, s.tone, si),\n }));\n\n return (\n <div\n key={category}\n className={clsx('flex min-w-0', horizontal ? 'flex-col gap-1' : 'h-full flex-col justify-end gap-1.5')}\n style={horizontal ? undefined : { width: perCategory }}\n >\n {showLabels && horizontal && (\n <span className={clsx('truncate text-default-secondary', labelClass)}>{category}</span>\n )}\n\n <div\n className={clsx('flex', horizontal ? 'items-center gap-2' : 'w-full flex-1 items-end justify-center')}\n style={horizontal ? undefined : { height: length }}\n >\n <div\n className={clsx('flex min-w-0', stacked ? 'gap-0' : '')}\n style={\n horizontal\n ? { width: length, flexDirection: stacked ? 'row' : 'column', gap: stacked ? 0 : gap }\n : {\n height: '100%',\n width: perCategory,\n flexDirection: stacked ? 'column-reverse' : 'row',\n alignItems: 'flex-end',\n gap: stacked ? 0 : gap,\n }\n }\n >\n {bars.map((bar) => {\n const extent = `${(bar.value / max) * 100}%`;\n return (\n <div\n key={bar.key}\n title={`${category} · ${bar.key}: ${bar.value}`}\n className=\"transition-all\"\n style={{\n backgroundColor: bar.color,\n borderRadius: radius,\n ...(horizontal\n ? { width: extent, height: stacked ? band : band }\n : { height: extent, width: stacked ? perCategory : band }),\n }}\n />\n );\n })}\n </div>\n {showValues && horizontal && (\n <span className={clsx('shrink-0 tabular-nums text-default-secondary', labelClass)}>\n {categoryTotals[ci]}\n </span>\n )}\n </div>\n\n {showLabels && !horizontal && (\n <span className={clsx('truncate text-center text-default-secondary', labelClass)}>{category}</span>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type DonutChartSize = 'sm' | 'md' | 'lg';\n\n/** Diameter and default ring thickness, in px. */\nconst SIZE: Record<DonutChartSize, { box: number; thickness: number }> = {\n sm: { box: 88, thickness: 10 },\n md: { box: 128, thickness: 14 },\n lg: { box: 180, thickness: 20 },\n};\n\nexport interface DonutSegment {\n label: string;\n value: number;\n /** Token-backed colour. Falls back to the segment's position in the chart sequence. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n}\n\nexport interface DonutChartProps {\n segments: DonutSegment[];\n size?: DonutChartSize;\n /** Ring thickness in px. Overrides the `size` preset. */\n thickness?: number;\n /** Large text at the centre — a total, a percentage. */\n centerValue?: ReactNode;\n /** Caption beneath `centerValue`. */\n centerLabel?: ReactNode;\n /** Gap between segments, in degrees. */\n gap?: number;\n /** Accessible description. */\n label?: string;\n className?: string;\n}\n\n/**\n * A proportional ring.\n *\n * Drawn with `stroke-dasharray` on circles rather than arc paths: one element per\n * segment, no trigonometry, and the segments stay crisp at any thickness.\n */\nexport function DonutChart({\n segments,\n size = 'md',\n thickness,\n centerValue,\n centerLabel,\n gap = 2,\n label,\n className,\n}: DonutChartProps) {\n const { box, thickness: presetThickness } = SIZE[size];\n const ring = thickness ?? presetThickness;\n const radius = (box - ring) / 2;\n const circumference = 2 * Math.PI * radius;\n const total = segments.reduce((sum, s) => sum + Math.max(0, s.value), 0);\n\n // A gap is only meaningful between two or more visible segments.\n const visible = segments.filter((s) => s.value > 0);\n const gapLength = visible.length > 1 ? (gap / 360) * circumference : 0;\n\n let offset = 0;\n\n return (\n <div className={clsx('relative inline-flex shrink-0 items-center justify-center', className)}>\n <svg\n width={box}\n height={box}\n viewBox={`0 0 ${box} ${box}`}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n // -90° so the first segment starts at twelve o'clock rather than three.\n className=\"block -rotate-90\"\n >\n <circle cx={box / 2} cy={box / 2} r={radius} fill=\"none\" stroke={CHART_TRACK} strokeWidth={ring} />\n {total > 0 &&\n segments.map((segment, i) => {\n const fraction = Math.max(0, segment.value) / total;\n const length = Math.max(0, fraction * circumference - gapLength);\n const dash = `${length} ${circumference - length}`;\n const thisOffset = offset;\n offset += fraction * circumference;\n if (segment.value <= 0) return null;\n return (\n <circle\n key={segment.label}\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={resolveChartColor(segment.color, segment.tone, i)}\n strokeWidth={ring}\n strokeDasharray={dash}\n strokeDashoffset={-thisOffset}\n strokeLinecap=\"butt\"\n />\n );\n })}\n </svg>\n {(centerValue != null || centerLabel != null) && (\n <div className=\"absolute inset-0 flex flex-col items-center justify-center text-center\">\n {centerValue != null && (\n <span className=\"text-subheading-sm font-bold leading-none text-default\">{centerValue}</span>\n )}\n {centerLabel != null && (\n <span className=\"mt-0.5 text-body-tiny text-default-secondary\">{centerLabel}</span>\n )}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type RadialGaugeSize = 'sm' | 'md' | 'lg';\n\nconst SIZE: Record<RadialGaugeSize, { box: number; thickness: number; value: string }> = {\n sm: { box: 72, thickness: 8, value: 'text-body-sm' },\n md: { box: 104, thickness: 11, value: 'text-subheading-sm' },\n lg: { box: 148, thickness: 15, value: 'text-subheading' },\n};\n\nexport interface RadialGaugeProps {\n value: number;\n /** Top of the scale. */\n max?: number;\n size?: RadialGaugeSize;\n tone?: ChartTone;\n color?: string;\n /** Ring thickness in px. Overrides the `size` preset. */\n thickness?: number;\n /**\n * Sweep in degrees. 360 is a full ring; 270 leaves a gap at the bottom, which reads\n * more like a dial than a pie.\n */\n sweep?: number;\n /** Centre content. Defaults to the value; pass `null` for an empty ring. */\n children?: ReactNode;\n /** Caption beneath the centre value. */\n centerLabel?: ReactNode;\n label?: string;\n className?: string;\n}\n\n/**\n * A single-value arc — a score ring, a utilisation dial, a completion meter.\n *\n * The shape the library had no form for: `ProgressBar` covers linear progress and\n * `DonutChart` compares parts of a whole, but neither draws \"one number against its\n * ceiling\" in a round frame.\n */\nexport function RadialGauge({\n value,\n max = 100,\n size = 'md',\n tone = 'brand',\n color,\n thickness,\n sweep = 270,\n children,\n centerLabel,\n label,\n className,\n}: RadialGaugeProps) {\n const preset = SIZE[size];\n const box = preset.box;\n const ring = thickness ?? preset.thickness;\n const radius = (box - ring) / 2;\n const circumference = 2 * Math.PI * radius;\n\n const clampedSweep = Math.min(360, Math.max(1, sweep));\n const arc = (clampedSweep / 360) * circumference;\n const fraction = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n const stroke = resolveChartColor(color, tone);\n\n // Rotate so the arc is centred on twelve o'clock: -90° puts the start at the top,\n // then half the unswept remainder brings it back round.\n const rotation = -90 + (360 - clampedSweep) / 2;\n\n return (\n <div className={clsx('relative inline-flex shrink-0 items-center justify-center', className)}>\n <svg\n width={box}\n height={box}\n viewBox={`0 0 ${box} ${box}`}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className=\"block\"\n style={{ transform: `rotate(${rotation}deg)` }}\n >\n <circle\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={CHART_TRACK}\n strokeWidth={ring}\n strokeDasharray={`${arc} ${circumference - arc}`}\n strokeLinecap=\"round\"\n />\n <circle\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={ring}\n strokeDasharray={`${arc * fraction} ${circumference - arc * fraction}`}\n strokeLinecap=\"round\"\n className=\"transition-all\"\n />\n </svg>\n <div className=\"absolute inset-0 flex flex-col items-center justify-center text-center\">\n {children === undefined ? (\n <span className={clsx('font-bold leading-none text-default', preset.value)}>{value}</span>\n ) : (\n children\n )}\n {centerLabel != null && (\n <span className=\"mt-0.5 text-body-tiny text-default-secondary\">{centerLabel}</span>\n )}\n </div>\n </div>\n );\n}\n","import { useId } from 'react';\nimport clsx from 'clsx';\nimport { CHART_TONE, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type SparklineVariant = 'line' | 'area';\nexport type SparklineSize = 'sm' | 'md' | 'lg';\n\n/** Size presets, so callers stop passing bare pixel pairs. */\nconst SIZE: Record<SparklineSize, { width: number; height: number }> = {\n sm: { width: 80, height: 24 },\n md: { width: 120, height: 36 },\n lg: { width: 200, height: 56 },\n};\n\nexport interface SparklineProps {\n data: number[];\n variant?: SparklineVariant;\n /** Token-backed colour. Ignored when `color` is set. */\n tone?: ChartTone;\n /** Explicit colour, for series whose colour comes from the data. */\n color?: string;\n size?: SparklineSize;\n /** Overrides the `size` preset. */\n width?: number;\n height?: number;\n strokeWidth?: number;\n /** Dot on the final point — useful when the line is the \"current value\". */\n showEndDot?: boolean;\n /** Accessible description. Omit to keep the chart decorative. */\n label?: string;\n className?: string;\n}\n\n/**\n * A compact trend line, with no axes and no interaction.\n *\n * `variant=\"area\"` adds the gradient fill beneath the line that 0.2.0 had no way to\n * draw, which is what makes a sparkline readable at `lg` where a bare 1.5px stroke\n * looks thin.\n */\nexport function Sparkline({\n data,\n variant = 'line',\n tone = 'brand',\n color,\n size = 'md',\n width,\n height,\n strokeWidth = 1.5,\n showEndDot = false,\n label,\n className,\n}: SparklineProps) {\n const gradientId = useId();\n if (data.length < 2) return null;\n\n const w = width ?? SIZE[size].width;\n const h = height ?? SIZE[size].height;\n const stroke = resolveChartColor(color, tone);\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n const pad = strokeWidth;\n const innerH = h - pad * 2;\n const innerW = w - pad * 2;\n\n const coords = data.map((v, i) => ({\n x: pad + (i / (data.length - 1)) * innerW,\n y: pad + innerH - ((v - min) / range) * innerH,\n }));\n const points = coords.map((p) => `${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(' ');\n // Close the path down to the baseline so the fill has something to fill.\n const areaPath = `M ${points.split(' ').join(' L ')} L ${coords[coords.length - 1].x.toFixed(2)},${h} L ${coords[0].x.toFixed(2)},${h} Z`;\n const last = coords[coords.length - 1];\n\n return (\n <svg\n width={w}\n height={h}\n viewBox={`0 0 ${w} ${h}`}\n fill=\"none\"\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={clsx('block shrink-0', className)}\n >\n {variant === 'area' && (\n <>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={stroke} stopOpacity={0.24} />\n <stop offset=\"100%\" stopColor={stroke} stopOpacity={0} />\n </linearGradient>\n </defs>\n <path d={areaPath} fill={`url(#${gradientId})`} />\n </>\n )}\n <polyline\n points={points}\n stroke={stroke}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n {showEndDot && (\n <circle cx={last.x} cy={last.y} r={strokeWidth * 1.6} fill={stroke} stroke={CHART_TONE.neutral} strokeWidth={0} />\n )}\n </svg>\n );\n}\n","import clsx from 'clsx';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type MiniBarChartSize = 'sm' | 'md' | 'lg';\nexport type MiniBarChartOrientation = 'vertical' | 'horizontal';\n\nconst SIZE: Record<MiniBarChartSize, { width: number; height: number; gap: number }> = {\n sm: { width: 80, height: 32, gap: 2 },\n md: { width: 120, height: 48, gap: 3 },\n lg: { width: 200, height: 72, gap: 4 },\n};\n\nexport interface MiniBarChartProps {\n bars: number[];\n /** Colour of the highlighted bars. */\n tone?: ChartTone;\n color?: string;\n /** Colour of the un-highlighted bars. Defaults to the muted track token. */\n restColor?: string;\n /**\n * Which bars are highlighted. A number or list of indices; negatives count from the\n * end, so `-1` is the last bar. Pass `[]` to highlight none.\n *\n * Replaces 0.2.0's `highlightLastBar` boolean, which could only ever mean `-1`.\n */\n highlight?: number | number[];\n size?: MiniBarChartSize;\n /** Overrides the `size` preset. */\n width?: number;\n height?: number;\n gap?: number;\n orientation?: MiniBarChartOrientation;\n radius?: number;\n label?: string;\n className?: string;\n}\n\n/** A compact bar series with no axes — a distribution or a per-period count. */\nexport function MiniBarChart({\n bars,\n tone = 'brand',\n color,\n restColor = CHART_TRACK,\n highlight = -1,\n size = 'md',\n width,\n height,\n gap,\n orientation = 'vertical',\n radius = 2,\n label,\n className,\n}: MiniBarChartProps) {\n if (bars.length === 0) return null;\n\n const preset = SIZE[size];\n const w = width ?? preset.width;\n const h = height ?? preset.height;\n const g = gap ?? preset.gap;\n const fill = resolveChartColor(color, tone);\n\n const highlighted = new Set(\n (Array.isArray(highlight) ? highlight : [highlight]).map((i) => (i < 0 ? bars.length + i : i)),\n );\n\n const max = Math.max(...bars) || 1;\n const vertical = orientation === 'vertical';\n // The cross-axis is divided between bars; the value axis carries the magnitude.\n const span = vertical ? w : h;\n const extent = vertical ? h : w;\n const barThickness = (span - g * (bars.length - 1)) / bars.length;\n\n return (\n <svg\n width={w}\n height={h}\n viewBox={`0 0 ${w} ${h}`}\n fill=\"none\"\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={clsx('block shrink-0', className)}\n >\n {bars.map((v, i) => {\n const magnitude = Math.max(2, (v / max) * extent);\n const offset = i * (barThickness + g);\n return (\n <rect\n key={i}\n x={(vertical ? offset : 0).toFixed(2)}\n // Vertical bars grow up from the baseline; horizontal ones out from the left.\n y={(vertical ? extent - magnitude : offset).toFixed(2)}\n width={(vertical ? barThickness : magnitude).toFixed(2)}\n height={(vertical ? magnitude : barThickness).toFixed(2)}\n fill={highlighted.has(i) ? fill : restColor}\n rx={radius}\n />\n );\n })}\n </svg>\n );\n}\n","import clsx from 'clsx';\nimport { LegendDot, type LegendDotShape, type LegendDotSize } from './legend-dot';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type ChartLegendOrientation = 'vertical' | 'horizontal';\n\nexport interface ChartLegendItem {\n label: string;\n /** Trailing value. Omit for a legend that only names the series. */\n count?: number | string;\n /** Token-backed colour. Falls back to the item's position in the chart sequence. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n}\n\nexport interface ChartLegendProps {\n items: ChartLegendItem[];\n /**\n * `vertical` spreads each row to fill its container, so the counts align in a column\n * beside a donut. `horizontal` wraps inline, for a legend under a bar chart.\n */\n orientation?: ChartLegendOrientation;\n size?: LegendDotSize;\n shape?: LegendDotShape;\n className?: string;\n}\n\n/** Series names, swatches and optional values. */\nexport function ChartLegend({\n items,\n orientation = 'vertical',\n size = 'md',\n shape = 'dot',\n className,\n}: ChartLegendProps) {\n const horizontal = orientation === 'horizontal';\n\n return (\n <div\n className={clsx(\n horizontal ? 'flex flex-wrap items-center gap-x-4 gap-y-2' : 'flex flex-col gap-3',\n className,\n )}\n >\n {items.map((item, i) => (\n <div\n key={item.label}\n className={clsx('flex items-center gap-2', horizontal ? 'min-w-0' : 'justify-between')}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n {/* Resolved here, not in LegendDot, so the sequence fallback can use the\n item's position — matching how DonutChart colours its segments. */}\n <LegendDot color={resolveChartColor(item.color, item.tone, i)} size={size} shape={shape} />\n <span className=\"truncate text-body-xs text-default-secondary\">{item.label}</span>\n </div>\n {item.count != null && (\n <span className=\"shrink-0 text-body-xs font-semibold tabular-nums text-default\">{item.count}</span>\n )}\n </div>\n ))}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type LegendDotSize = 'sm' | 'md';\n/** `line` is the swatch for a line series; `dot` and `square` for areas and bars. */\nexport type LegendDotShape = 'dot' | 'square' | 'line';\n\nconst SHAPE: Record<LegendDotShape, Record<LegendDotSize, string>> = {\n dot: { sm: 'size-1.5 rounded-full', md: 'size-2 rounded-full' },\n square: { sm: 'size-1.5 rounded-[2px]', md: 'size-2 rounded-[3px]' },\n line: { sm: 'h-0.5 w-3 rounded-full', md: 'h-0.5 w-4 rounded-full' },\n};\n\nexport interface LegendDotProps {\n /** Token-backed colour. Ignored when `color` is set. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n size?: LegendDotSize;\n shape?: LegendDotShape;\n className?: string;\n}\n\n/** The colour swatch beside a series name. */\nexport function LegendDot({ tone, color, size = 'md', shape = 'dot', className }: LegendDotProps) {\n return (\n <span\n className={clsx('inline-block shrink-0', SHAPE[shape][size], className)}\n style={{ backgroundColor: resolveChartColor(color, tone) }}\n aria-hidden\n />\n );\n}\n","import clsx from 'clsx';\nimport { LuTrendingDown, LuTrendingUp } from 'react-icons/lu';\n\nexport type TrendLabelWeight = 'semibold' | 'bold';\nexport type TrendLabelSize = 'sm' | 'md' | 'lg';\n/**\n * Which direction is the good one.\n *\n * A delta component cannot infer this: +4% on-time delivery is good, +4% unit cost is\n * not. 0.2.0 had no such prop, so the only way to render a \"rising is bad\" delta was to\n * pass a raw hex — which is exactly what the deleted `BenchmarkCard` did, inverting its\n * own `positiveColor` default to red to compensate.\n */\nexport type TrendDirection = 'up-is-good' | 'up-is-bad';\n\nconst SIZE: Record<TrendLabelSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n};\n\nconst ICON_SIZE: Record<TrendLabelSize, string> = {\n sm: 'size-3',\n md: 'size-3.5',\n lg: 'size-4',\n};\n\nconst weightBySize: Record<TrendLabelSize, TrendLabelWeight> = {\n sm: 'semibold',\n md: 'semibold',\n lg: 'bold',\n};\n\nconst WEIGHT: Record<TrendLabelWeight, string> = {\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nexport interface TrendLabelProps {\n value: number;\n suffix?: string;\n size?: TrendLabelSize;\n weight?: TrendLabelWeight;\n direction?: TrendDirection;\n /** Trend arrow. On by default — the docs described one long before there was one. */\n showArrow?: boolean;\n /** Explicit colour, for the rare data-driven case. Overrides the direction logic. */\n color?: string;\n className?: string;\n}\n\n/** A signed delta with a direction arrow, toned by whether the movement is good news. */\nexport function TrendLabel({\n value,\n suffix = '%',\n size = 'md',\n weight,\n direction = 'up-is-good',\n showArrow = true,\n color,\n className,\n}: TrendLabelProps) {\n const rising = value > 0;\n // Zero is neither good nor bad. 0.2.0 rendered it as a green \"+0%\".\n const flat = value === 0;\n const good = direction === 'up-is-good' ? rising : !rising;\n const Arrow = rising ? LuTrendingUp : LuTrendingDown;\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1 whitespace-nowrap',\n SIZE[size],\n WEIGHT[weight ?? weightBySize[size]],\n !color && (flat ? 'text-default-secondary' : good ? 'text-positive' : 'text-danger'),\n className,\n )}\n style={color ? { color } : undefined}\n >\n {showArrow && !flat && <Arrow className={clsx('shrink-0', ICON_SIZE[size])} aria-hidden />}\n {rising ? '+' : ''}\n {value}\n {suffix}\n </span>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type ListRowDensity = 'default' | 'compact';\nexport type ListRowDivider = 'none' | 'top' | 'bottom';\n\nconst DENSITY: Record<ListRowDensity, { pad: string; gap: string; title: string; description: string }> = {\n default: {\n pad: 'py-4',\n gap: 'gap-3',\n title: 'text-body-sm font-semibold text-default',\n description: 'text-body-xs text-default-secondary',\n },\n compact: {\n pad: 'py-2.5',\n gap: 'gap-2',\n title: 'text-body-xs font-semibold text-default',\n description: 'text-body-tiny text-default-secondary',\n },\n};\n\nconst DIVIDER: Record<ListRowDivider, string> = {\n none: '',\n top: 'border-t border-default',\n bottom: 'border-b border-default',\n};\n\nexport interface ListRowProps {\n /** Left of the title, on the title line — an icon badge, avatar, checkbox, file chip. */\n leading?: ReactNode;\n title?: ReactNode;\n /** Inline after the title — a Required/Optional chip, a count, a tag. */\n titleMeta?: ReactNode;\n /** Muted line under the title. */\n description?: ReactNode;\n /** Right end of the title line — a `StatusBadge`, a score, a timestamp. */\n meta?: ReactNode;\n /** Right-hand column spanning the whole row, vertically centred — actions, a `Toggle`. */\n trailing?: ReactNode;\n /** Full-width block below the title line — a `FileRow`, a `FileDropZone`, an alert, a nested list. */\n footer?: ReactNode;\n density?: ListRowDensity;\n divider?: ListRowDivider;\n /** Render an `<li>` instead of a `<div>` — use inside a `<ul>`/`<ol>`. */\n as?: 'div' | 'li';\n onClick?: () => void;\n className?: string;\n}\n\n/**\n * The generic list row: six slots and no opinion about what goes in them.\n *\n * Replaces `DocumentRow` and `DocumentChecklistRow`, which baked one product's\n * document-upload flow — its status vocabulary, its five raw-hex pills and its\n * unicode-glyph labels — into the library. Every feature of those rows is reachable by\n * composing this with `FileRow`, `FileDropZone` and `StatusBadge`; see the docs.\n */\nexport function ListRow({\n leading,\n title,\n titleMeta,\n description,\n meta,\n trailing,\n footer,\n density = 'default',\n divider = 'none',\n as: Tag = 'div',\n onClick,\n className,\n}: ListRowProps) {\n const d = DENSITY[density];\n const hasTitleLine = Boolean(leading || title != null || titleMeta || meta);\n\n return (\n <Tag\n className={clsx(\n 'flex w-full items-start',\n d.pad,\n DIVIDER[divider],\n onClick &&\n 'cursor-pointer rounded-lg transition-colors hover:bg-default-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand',\n className,\n )}\n onClick={onClick}\n // Unlike a <tr>, a div/li has no conflicting implicit role, so button is correct here.\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className={clsx('flex min-w-0 flex-1 flex-col', d.gap)}>\n {hasTitleLine && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n {leading}\n {title != null && <span className={clsx('truncate', d.title)}>{title}</span>}\n {titleMeta && <span className=\"shrink-0\">{titleMeta}</span>}\n </div>\n {meta && <span className=\"shrink-0\">{meta}</span>}\n </div>\n )}\n {description && <p className={d.description}>{description}</p>}\n {footer}\n </div>\n {trailing && <div className=\"ml-3 flex shrink-0 items-center self-center\">{trailing}</div>}\n </Tag>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface FileRowProps {\n name: string;\n /** Muted second line — size, upload date, uploader. */\n detail?: ReactNode;\n /** Leading chip showing the file extension, e.g. `\"PDF\"`. Ignored when `leading` is set. */\n fileType?: string;\n /** Custom leading node — overrides `fileType`. */\n leading?: ReactNode;\n /** The canonical action. Renders a text link before `actions`. */\n onDownload?: () => void;\n downloadLabel?: string;\n /** Everything else on the right — `Button`s, a `DropdownMenu`. */\n actions?: ReactNode;\n className?: string;\n}\n\n/** The extension chip. Lifted unchanged from the deleted `DocumentRow`. */\nfunction FileTypeBadge({ type }: { type: string }) {\n return (\n <span className=\"flex size-[34px] shrink-0 items-center justify-center rounded-md bg-brand-tertiary text-body-tiny font-semibold text-brand\">\n {type}\n </span>\n );\n}\n\n/**\n * One attached file: name, optional detail line, and actions.\n *\n * This strip was hardcoded inline inside both `DocumentRow` and\n * `DocumentChecklistRow`. Nothing about it is document-specific — it is the same row\n * for a generated export, an invoice or an evidence attachment.\n */\nexport function FileRow({\n name,\n detail,\n fileType,\n leading,\n onDownload,\n downloadLabel = 'Download',\n actions,\n className,\n}: FileRowProps) {\n const lead = leading ?? (fileType ? <FileTypeBadge type={fileType} /> : null);\n\n return (\n <div\n className={clsx(\n 'flex items-center gap-3 rounded-lg border border-default bg-default px-3 py-2.5',\n className,\n )}\n >\n {lead}\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"truncate text-body-sm font-medium text-default\">{name}</span>\n {detail && <span className=\"text-body-xs text-default-secondary\">{detail}</span>}\n </div>\n {(onDownload || actions) && (\n <div className=\"flex shrink-0 items-center gap-3\">\n {onDownload && (\n <button\n type=\"button\"\n onClick={onDownload}\n className=\"text-body-xs font-medium text-brand hover:underline\"\n >\n {downloadLabel}\n </button>\n )}\n {actions}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type ScoredRowAlign = 'center' | 'end';\n/** 8 / 12 / 20 / 48px — the four gaps the source mockups actually used. */\nexport type ScoredRowGap = 'sm' | 'md' | 'lg' | 'xl';\n\nconst GAP: Record<ScoredRowGap, string> = {\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-12',\n};\n\nconst ALIGN: Record<ScoredRowAlign, string> = {\n center: 'items-center',\n end: 'items-end',\n};\n\nexport interface ScoredRowProps {\n /** Leading visual — an `EntityIconBadge`, an `Avatar`, a rank number, or nothing. */\n leading?: ReactNode;\n title: ReactNode;\n subtitle?: ReactNode;\n /** Fixed-width column between the title block and the meter. */\n aside?: ReactNode;\n /** The bar. Put a `<ProgressBar>` here — the row does not choose one for you. */\n meter?: ReactNode;\n /** Right-hand value — a `<ScoreValue>`, a `<TrendLabel>`, a `<Badge>`, a button. */\n trailing?: ReactNode;\n /** CSS width values. Omit one and that slot flexes instead. */\n titleWidth?: string;\n asideWidth?: string;\n meterWidth?: string;\n trailingWidth?: string;\n gap?: ScoredRowGap;\n /** Gap between `leading` and the title block. Defaults to `gap`. */\n leadingGap?: ScoredRowGap;\n align?: ScoredRowAlign;\n className?: string;\n}\n\n/**\n * A row with a title block, an optional bar and a right-hand value.\n *\n * Was `EntityRow`. The rename is the smaller half of the change: the old component\n * hardcoded `RiskScore`, `WidgetProgressBar`, `TrendLabel` and `getRiskTone`, which\n * locked it to one scoring domain and forced 32 props — including four raw\n * `CSSProperties` escape hatches and a magic `nameWidth = '133px'` — to make it fit\n * anything else. The score and the bar are now slots, so the caller decides.\n */\nexport function ScoredRow({\n leading,\n title,\n subtitle,\n aside,\n meter,\n trailing,\n titleWidth,\n asideWidth,\n meterWidth,\n trailingWidth,\n gap = 'md',\n leadingGap,\n align = 'center',\n className,\n}: ScoredRowProps) {\n return (\n <div className={clsx('flex w-full', ALIGN[align], GAP[gap], className)}>\n <div\n className={clsx(\n 'flex min-w-0',\n ALIGN[align],\n GAP[leadingGap ?? gap],\n titleWidth ? 'shrink-0' : 'flex-1',\n )}\n style={titleWidth ? { width: titleWidth } : undefined}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-body-sm font-medium leading-none text-default\">{title}</p>\n {subtitle && <p className=\"mt-0.5 truncate text-body-xs text-default-secondary\">{subtitle}</p>}\n </div>\n </div>\n\n {aside && (\n <div\n className={clsx('min-w-0', asideWidth ? 'shrink-0' : 'flex-1')}\n style={asideWidth ? { width: asideWidth } : undefined}\n >\n {aside}\n </div>\n )}\n\n {meter && (\n <div\n className={clsx('min-w-0', meterWidth ? 'shrink-0' : 'flex-1')}\n style={meterWidth ? { width: meterWidth } : undefined}\n >\n {meter}\n </div>\n )}\n\n {trailing && (\n <div className=\"shrink-0 text-right\" style={trailingWidth ? { width: trailingWidth } : undefined}>\n {trailing}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { ProgressBar } from '../feedback/progress-bar';\nimport type { ProgressBarTone } from '../feedback/progress-bar';\nimport { ScoreValue, getScoreTone } from '../stats/score-value';\nimport type { ScoreDirection, ScoreValueSize, ScoreValueWeight } from '../stats/score-value';\n\nexport interface RankedRowProps {\n rank?: number;\n name: string;\n sublabel?: string;\n score: number;\n /** Bar and value colour. `auto` derives it from `score`. */\n tone?: ProgressBarTone | 'auto';\n /** Which end of the scale is bad, when `tone` is `auto`. */\n direction?: ScoreDirection;\n scoreSize?: ScoreValueSize;\n scoreWeight?: ScoreValueWeight;\n className?: string;\n}\n\n/**\n * A leaderboard row: rank, name, score, and a full-width bar underneath.\n *\n * Was `RankedListItem` — the only `…Item` in a folder of `…Row`s. Its three raw-hex\n * colour props (`scoreColor`, `barColor`, `barTrackColor`) are gone in favour of\n * `tone`, and its `gap` CSS string is now the `gap-1.5` it always resolved to.\n */\nexport function RankedRow({\n rank,\n name,\n sublabel,\n score,\n tone = 'auto',\n direction = 'higher-is-worse',\n scoreSize = 'md',\n scoreWeight = 'bold',\n className,\n}: RankedRowProps) {\n const resolved = tone === 'auto' ? getScoreTone(score, { direction }) : tone;\n\n return (\n <div className={clsx('flex w-full shrink-0 flex-col gap-1.5', className)}>\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n {rank !== undefined && (\n <p className=\"w-[14px] shrink-0 text-body-xs font-bold text-default-secondary\">{rank}</p>\n )}\n <div className=\"flex min-w-0 flex-col gap-px\">\n <p className=\"truncate text-body-sm font-medium leading-none text-default\">{name}</p>\n {sublabel && <p className=\"text-body-tiny text-default-tertiary\">{sublabel}</p>}\n </div>\n </div>\n <ScoreValue\n value={score}\n size={scoreSize}\n weight={scoreWeight}\n tone={resolved}\n className=\"ml-2 shrink-0\"\n />\n </div>\n <ProgressBar value={score} tone={resolved} aria-label={`${name} score`} />\n </div>\n );\n}\n","import { cn } from '../../lib/cn';\n\nexport type ProgressBarTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';\nexport type ProgressBarSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** 4 / 6 / 8 / 12px. `sm` is 0.2.0's only height, and stays the default. */\nconst SIZE: Record<ProgressBarSize, string> = {\n xs: 'h-1',\n sm: 'h-1.5',\n md: 'h-2',\n lg: 'h-3',\n};\n\nconst FILL: Record<ProgressBarTone, string> = {\n brand: 'bg-brand',\n positive: 'bg-positive',\n warning: 'bg-warning',\n danger: 'bg-danger',\n neutral: 'bg-neutral',\n};\n\nexport interface ProgressBarProps {\n /** 0–100. Values outside the range are clamped. */\n value: number;\n tone?: ProgressBarTone;\n size?: ProgressBarSize;\n /** Caption above the bar. Also becomes the accessible name. */\n label?: string;\n /** Show the percentage at the right of the label row. */\n showValue?: boolean;\n /** CSS radius override, e.g. `'1px'` for a square-ended bar. Defaults to fully round. */\n radius?: string;\n /** Accessible name when there is no visible `label`. */\n 'aria-label'?: string;\n /**\n * Applied to the track. This is how you set a fixed width — `className=\"w-16\"`.\n * It genuinely overrides the base `w-full` because this file uses `cn`.\n */\n className?: string;\n}\n\n/**\n * A horizontal progress / proportion bar.\n *\n * Was `WidgetProgressBar` in 0.2.0, which fixed the height at 6px and lived under\n * `widgets/` despite being a general-purpose primitive — so `TableCellProgress`\n * hand-rolled a second copy rather than reuse it. It also had no ARIA at all.\n */\nexport function ProgressBar({\n value,\n tone = 'brand',\n size = 'sm',\n label,\n showValue = false,\n radius,\n 'aria-label': ariaLabel,\n className,\n}: ProgressBarProps) {\n const clamped = Math.min(100, Math.max(0, value));\n const rounded = radius ? undefined : 'rounded-full';\n\n const track = (\n <div\n role=\"progressbar\"\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={label ? undefined : ariaLabel}\n className={cn('w-full overflow-hidden bg-default-tertiary', SIZE[size], rounded, className)}\n style={radius ? { borderRadius: radius } : undefined}\n >\n <div\n className={cn('h-full transition-all', rounded, FILL[tone])}\n style={{ width: `${clamped}%`, ...(radius ? { borderRadius: radius } : undefined) }}\n />\n </div>\n );\n\n // No caption row means no wrapper — the bar must stay a direct child of whatever\n // laid it out, so a parent's `flex-1` or grid placement still applies to it.\n if (!label && !showValue) return track;\n\n return (\n <div>\n <div className=\"mb-1.5 flex items-center justify-between gap-2\">\n {label && <span className=\"text-body-xs text-default-secondary\">{label}</span>}\n {showValue && (\n <span className=\"ml-auto text-body-xs font-medium tabular-nums text-default\">\n {Math.round(clamped)}%\n </span>\n )}\n </div>\n {track}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface IconTextRowProps {\n icon: ReactNode;\n title: string;\n detail: string;\n className?: string;\n}\n\n/**\n * A circular icon badge, a title, and one line of detail.\n *\n * Feature lists, empty-state explanations, onboarding intros, \"what happens next\"\n * steps. Was `FeatureRow`, which named it after the one screen it was extracted from.\n */\nexport function IconTextRow({ icon, title, detail, className }: IconTextRowProps) {\n return (\n <div className={clsx('flex items-start gap-3', className)}>\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-brand\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-body-sm font-semibold text-default\">{title}</p>\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{detail}</p>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuCheck } from 'react-icons/lu';\n\nexport type ChecklistRowState = 'done' | 'active' | 'pending';\n\nexport interface ChecklistRowProps {\n label: string;\n state: ChecklistRowState;\n className?: string;\n}\n\n/**\n * One step in a progress checklist: a done tick, a spinning active ring, or an empty\n * pending ring.\n *\n * Shared by the event-onboarding \"building your dashboard\" screen and the\n * intelligence page's processing checklist. Both drove the same three states; only\n * the onboarding copy had the animated ring, which is the better treatment and is\n * adopted for both.\n *\n * Renders an `<li>` — callers must wrap it in a list, which is what both sources did.\n */\nexport function ChecklistRow({ label, state, className }: ChecklistRowProps) {\n return (\n <li className={clsx('flex items-center gap-3', className)}>\n <span className=\"flex size-5 shrink-0 items-center justify-center\">\n {state === 'done' ? (\n <LuCheck className=\"size-4 text-positive\" strokeWidth={2.5} aria-hidden />\n ) : (\n <span\n className={clsx(\n 'size-3.5 rounded-full border-2',\n state === 'active'\n ? 'animate-pulse border-brand-emphasis border-t-transparent'\n : 'border-disabled',\n )}\n />\n )}\n </span>\n <span\n className={clsx(\n 'text-body-sm',\n state === 'pending' ? 'text-default-tertiary' : 'font-semibold text-default',\n )}\n >\n {label}\n </span>\n </li>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface NumberedStepsListProps {\n steps: ReactNode[];\n className?: string;\n}\n\n/**\n * Ordered list with small filled number bullets.\n *\n * Promoted from entity-detail's \"what happens next\" panel. The panel's copy is\n * review-lifecycle business content and stays there; only the list chrome moves.\n *\n * The bullet was `bg-[#e7edfb] text-[#1d4ed8]` — a pale blue pair that is not in the\n * token set. It now uses the brand-tertiary background and brand text, which is the\n * documented treatment for a subtle brand-tinted chip.\n */\nexport function NumberedStepsList({ steps, className }: NumberedStepsListProps) {\n return (\n <ol className={clsx('flex flex-col gap-1.5', className)}>\n {steps.map((step, i) => (\n <li key={i} className=\"flex items-start gap-2 text-[12px] text-default\">\n <span className=\"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-[9px] font-bold text-brand\">\n {i + 1}\n </span>\n {step}\n </li>\n ))}\n </ol>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type MetaFieldLayout = 'stacked' | 'inline';\n\nexport interface MetaFieldProps {\n label: string;\n value: ReactNode;\n /** Optional second line under the value (used by the onboarding review sections). */\n detail?: ReactNode;\n /**\n * `stacked` puts the label above the value (detail pages, onboarding review).\n * `inline` puts a fixed-width label beside it (drawer detail rows).\n */\n layout?: MetaFieldLayout;\n /** Fixed width for the `stacked` form, e.g. `sm:w-[262px]` on the overview grid. */\n className?: string;\n}\n\n/**\n * A label/value pair.\n *\n * Consolidates the same shape from six places: the entity-detail overview grid, the\n * reviewer-detail metric column, three `DetailRow` copies in drawers (queues,\n * filings, website-intel) and `ReviewMeta` in both onboarding wizards.\n *\n * An empty value renders an em dash, which is what every source copy did by hand.\n */\nexport function MetaField({\n label,\n value,\n detail,\n layout = 'stacked',\n className,\n}: MetaFieldProps) {\n const shown = value === null || value === undefined || value === '' ? '—' : value;\n\n if (layout === 'inline') {\n return (\n <div className={clsx('flex gap-3 text-body-xs', className)}>\n <span className=\"w-[120px] shrink-0 text-default-secondary\">{label}</span>\n <span className=\"min-w-0 flex-1 text-default\">{shown}</span>\n </div>\n );\n }\n\n return (\n <div className={clsx('flex flex-col gap-0.5', className)}>\n <p className=\"text-body-tiny font-medium text-default-secondary\">{label}</p>\n <p className=\"text-body-sm font-medium text-default\">{shown}</p>\n {detail && <p className=\"text-body-xs text-default-secondary\">{detail}</p>}\n </div>\n );\n}\n\nexport interface MetaFieldGridProps {\n children: ReactNode;\n className?: string;\n}\n\n/**\n * Wrapper for a set of `MetaField`s that wrap into columns.\n *\n * Matches the entity-detail overview grid, which relies on each field carrying its\n * own width rather than on fixed grid columns — long values (aliases, legal names)\n * need to be able to occupy a full row on narrow viewports.\n */\nexport function MetaFieldGrid({ children, className }: MetaFieldGridProps) {\n return (\n <div className={clsx('flex flex-wrap gap-x-4 gap-y-3.5', className)}>{children}</div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { LuCheck } from 'react-icons/lu';\n\nexport type CheckedGroupListColumns = 1 | 2 | 3;\n\n/** One labelled group of ticked items. */\nexport interface CheckedGroup {\n label: string;\n items: string[];\n}\n\nexport interface CheckedGroupListProps {\n groups: CheckedGroup[];\n columns?: CheckedGroupListColumns;\n /** Leading glyph for every item. Defaults to a check; pass `null` for none. */\n icon?: ReactNode | null;\n emptyLabel?: string;\n className?: string;\n}\n\nconst COLUMNS: Record<CheckedGroupListColumns, string> = {\n 1: 'columns-1',\n 2: 'columns-2',\n 3: 'columns-3',\n};\n\n/**\n * A read-only, grouped list of ticked items in a balanced multi-column flow.\n *\n * Was `PermissionGrid` — RBAC-specific naming for a generic shape, and not a grid\n * either: groups pack tightly down each column rather than aligning to shared row\n * heights, so a tall group beside a short one leaves no ragged gap.\n * `break-inside-avoid` keeps each group whole within a column.\n *\n * Granted permissions, included plan features, completed requirements, matched\n * criteria — anything that is \"these labels, grouped, all ticked\".\n */\nexport function CheckedGroupList({\n groups,\n columns = 2,\n icon,\n emptyLabel = 'None.',\n className,\n}: CheckedGroupListProps) {\n if (groups.length === 0) {\n return <p className={clsx('text-body-xs text-default-secondary', className)}>{emptyLabel}</p>;\n }\n\n // `undefined` means \"not passed\" → default check. `null` means \"explicitly none\".\n const glyph = icon === undefined ? <LuCheck className=\"size-3.5\" strokeWidth={2.5} aria-hidden /> : icon;\n\n return (\n <div className={clsx(COLUMNS[columns], 'gap-x-6', className)}>\n {groups.map((group) => (\n <div key={group.label} className=\"mb-5 break-inside-avoid last:mb-0\">\n <p className=\"mb-2 text-body-tiny font-semibold uppercase tracking-wide text-default-secondary\">\n {group.label}\n </p>\n <ul className=\"space-y-1.5\">\n {group.items.map((item) => (\n <li key={item} className=\"flex items-center gap-2 text-body-xs text-default\">\n {glyph && <span className=\"shrink-0\">{glyph}</span>}\n {item}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { Key, ReactNode } from 'react';\nimport { ProgressBar } from '../feedback/progress-bar';\nimport type { ProgressBarTone } from '../feedback/progress-bar';\n\n// ── Column definition ──────────────────────────────────────────────────────────\n\nexport interface ColumnDef<T> {\n key: string;\n header: string;\n /**\n * CSS width value — e.g. `\"320px\"`, `\"10rem\"`. When `grow` is true this becomes the\n * column's floor: it counts toward the table's min-width, below which the wrapper\n * scrolls sideways rather than crushing the columns.\n */\n width: string;\n /**\n * When true the column absorbs the remaining table width.\n *\n * With no `grow` column, `table-fixed` distributes surplus width proportionally\n * across every column — the old flex layout left it blank on the right instead. Mark\n * whichever column should soak it up.\n */\n grow?: boolean;\n render: (row: T) => ReactNode;\n}\n\n// ── Density ────────────────────────────────────────────────────────────────────\n\nexport type DataTableDensity = 'default' | 'compact';\nexport type DataTableAlign = 'center' | 'top';\n\n/**\n * `default` is 0.2.0's spacing verbatim — ten call sites depend on it.\n *\n * `compact` is the audit / AI-widget density: an 11px semibold uppercase header over\n * 13px cells, which are `text-body-tiny` and `text-body-xs` exactly, so the type sizes\n * come across unchanged and only the padding really moves.\n */\nconst DENSITY: Record<DataTableDensity, { headerCell: string; headerText: string; bodyCell: string }> = {\n default: {\n headerCell: 'px-4 py-3',\n headerText: 'text-body-xs font-medium text-default-secondary whitespace-nowrap',\n bodyCell: 'px-4 py-[14px]',\n },\n compact: {\n headerCell: 'px-3 py-2',\n headerText:\n 'text-body-tiny font-semibold uppercase tracking-[0.4px] text-default-secondary whitespace-nowrap',\n bodyCell: 'px-3 py-2 text-body-xs text-default',\n },\n};\n\nconst ALIGN: Record<DataTableAlign, string> = {\n center: 'align-middle',\n top: 'align-top',\n};\n\n// ── DataTable ──────────────────────────────────────────────────────────────────\n\nexport interface DataTableProps<T> {\n columns: ColumnDef<T>[];\n rows: T[];\n getRowKey: (row: T, index: number) => Key;\n /** Row and header padding. `compact` also steps the header and cell type down. */\n density?: DataTableDensity;\n /** Vertical alignment of every body cell. Use `top` for multi-line or ragged cells. */\n align?: DataTableAlign;\n onRowClick?: (row: T) => void;\n /** Rendered as one full-width row when `rows` is empty. Omit to render nothing. */\n emptyLabel?: string;\n className?: string;\n}\n\n/**\n * A real `<table>` with `table-fixed` and a `<colgroup>`.\n *\n * 0.2.0 laid each row out as its own flex container sized `w-max`, so a `grow` column\n * sized itself per row and one long cell shunted that row's remaining columns out of\n * line with its neighbours. `table-fixed` resolves column widths once for the whole\n * table, which is the property the consuming app hand-rolled a separate audit table\n * to get.\n */\nexport function DataTable<T,>({\n columns,\n rows,\n getRowKey,\n density = 'default',\n align = 'center',\n onRowClick,\n emptyLabel,\n className,\n}: DataTableProps<T>) {\n const d = DENSITY[density];\n // Summed as a CSS expression rather than parsed as px, so any unit the caller used\n // (px, rem, ch) still yields a correct floor.\n const minWidth = columns.length ? `calc(${columns.map((c) => c.width).join(' + ')})` : undefined;\n\n return (\n <div className={clsx('overflow-x-auto rounded-xl border border-default bg-default', className)}>\n <table className=\"w-full table-fixed border-collapse text-left\" style={{ minWidth }}>\n <colgroup>\n {columns.map((col) => (\n // A grow column gets no width, so table-fixed hands it the leftover space.\n // Its floor is already counted in the table's min-width.\n <col key={col.key} style={col.grow ? undefined : { width: col.width }} />\n ))}\n </colgroup>\n <thead>\n <tr className=\"bg-default-secondary\">\n {columns.map((col) => (\n <th key={col.key} scope=\"col\" className={clsx('overflow-hidden', d.headerCell, d.headerText)}>\n {col.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0\n ? emptyLabel && (\n <tr>\n <td\n colSpan={columns.length}\n className={clsx(d.bodyCell, 'text-center text-body-sm text-default-secondary')}\n >\n {emptyLabel}\n </td>\n </tr>\n )\n : rows.map((row, i) => (\n <tr\n key={getRowKey(row, i)}\n className={clsx(\n 'transition-colors hover:bg-default-secondary/50',\n i > 0 && 'border-t border-default',\n // outline, not ring: `ring-*` compiles to box-shadow, which browsers\n // do not paint on a <tr> under border-collapse: collapse.\n onRowClick &&\n 'cursor-pointer outline-none focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-brand',\n )}\n // Deliberately no role=\"button\" — it would override the implicit\n // role=\"row\" and detach every row from the table's accessibility\n // tree. The <th scope>/<td> markup supplies the real roles for free.\n tabIndex={onRowClick ? 0 : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n onKeyDown={\n onRowClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onRowClick(row);\n }\n }\n : undefined\n }\n >\n {columns.map((col) => (\n <td key={col.key} className={clsx('overflow-hidden', d.bodyCell, ALIGN[align])}>\n {col.render(row)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n// ── Cell components ────────────────────────────────────────────────────────────\n\n/**\n * Cell type scale.\n *\n * Named `size`, not `density`, and deliberately *not* inherited from the table: the two\n * real compact tables disagree about the mapping — the audit table wants default\n * padding with small cell text — so inheritance could not express it anyway, and it\n * would make these render one size inside a table and another outside one.\n */\nexport type TableCellSize = 'sm' | 'md';\n\nexport interface TableCellLeadTextProps {\n primary: string;\n secondary?: string;\n size?: TableCellSize;\n className?: string;\n}\n\n/** Primary text plus an optional muted subtitle — for lead entity/name cells. */\nexport function TableCellLeadText({ primary, secondary, size = 'md', className }: TableCellLeadTextProps) {\n return (\n <div className={clsx('flex flex-col gap-0.5', className)}>\n <span\n className={clsx(\n 'font-medium leading-snug text-default',\n size === 'sm' ? 'text-body-xs' : 'text-body-sm',\n )}\n >\n {primary}\n </span>\n {secondary && (\n <span\n className={clsx(\n 'font-normal leading-tight text-default-secondary',\n size === 'sm' ? 'text-body-tiny' : 'text-body-xs',\n )}\n >\n {secondary}\n </span>\n )}\n </div>\n );\n}\n\nexport interface TableCellTextProps {\n children: ReactNode;\n /** Muted (secondary) by default; pass false for the primary colour. */\n muted?: boolean;\n size?: TableCellSize;\n /** Ellipsise instead of wrapping, so every row keeps the same height. */\n truncate?: boolean;\n className?: string;\n}\n\n/** Plain text cell. */\nexport function TableCellText({\n children,\n muted = true,\n size = 'md',\n truncate = false,\n className,\n}: TableCellTextProps) {\n return (\n <span\n className={clsx(\n 'font-normal leading-snug',\n size === 'sm' ? 'text-body-tiny' : 'text-body-xs',\n truncate ? 'block truncate' : 'whitespace-nowrap',\n muted ? 'text-default-secondary' : 'text-default',\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\nexport interface TableCellBadgeProps {\n label: string;\n className?: string;\n}\n\n/** Small outlined chip — entity type labels, categories. */\nexport function TableCellBadge({ label, className }: TableCellBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-md border border-default bg-default-secondary px-2 py-0.5 text-body-tiny font-medium text-default-secondary whitespace-nowrap',\n className,\n )}\n >\n {label}\n </span>\n );\n}\n\nexport interface TableCellProgressProps {\n percent: number;\n /**\n * Bar colour. `brand` is 0.2.0's default and byte-identical to it — `bg-brand`\n * resolves to the same `--prim-brand-900` the old raw-hex default hardcoded.\n */\n tone?: ProgressBarTone;\n size?: TableCellSize;\n className?: string;\n}\n\n/** Mini progress bar with a percentage label below. */\nexport function TableCellProgress({\n percent,\n tone = 'brand',\n size = 'md',\n className,\n}: TableCellProgressProps) {\n const clamped = Math.min(100, Math.max(0, percent));\n return (\n <div className={clsx('flex flex-col gap-1', className)}>\n {/* Delegates to ProgressBar rather than hand-rolling a second bar, which is what\n 0.2.0 did — the two then disagreed on the track colour. */}\n <ProgressBar value={clamped} tone={tone} size=\"sm\" className=\"w-16\" aria-label={`${clamped}%`} />\n <span\n className={clsx(\n 'leading-none text-default-secondary',\n size === 'sm' ? 'text-[10px]' : 'text-body-tiny',\n )}\n >\n {percent}%\n </span>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuCircleCheckBig, LuInfo, LuTriangleAlert } from 'react-icons/lu';\n\nexport type InlineAlertTone = 'info' | 'warning' | 'danger' | 'positive';\n\nexport interface InlineAlertProps {\n tone: InlineAlertTone;\n children: ReactNode;\n /** Overrides the per-tone default glyph. Pass `null` for no icon. */\n icon?: ReactNode | null;\n className?: string;\n}\n\nconst toneStyles: Record<InlineAlertTone, string> = {\n info: 'border-brand-tertiary bg-brand-tertiary text-brand',\n warning: 'border-warning-tertiary bg-warning-tertiary text-warning',\n danger: 'border-danger-tertiary bg-danger-tertiary text-danger',\n positive: 'border-positive-tertiary bg-positive-tertiary text-positive',\n};\n\nconst toneIcons: Record<InlineAlertTone, ReactNode> = {\n info: <LuInfo className=\"size-4\" />,\n warning: <LuTriangleAlert className=\"size-4\" />,\n danger: <LuTriangleAlert className=\"size-4\" />,\n positive: <LuCircleCheckBig className=\"size-4\" />,\n};\n\n/** Banner for inline messaging — form errors, destructive-action warnings, success confirmations.\n *\n * Replaces four byte-identical raw-`amber-*` callouts, five competing error-text styles and a\n * standalone `Banner` component. `danger` renders as `role=\"alert\"`; the rest as `role=\"status\"`. */\nexport function InlineAlert({ tone, children, icon, className }: InlineAlertProps) {\n const glyph = icon === undefined ? toneIcons[tone] : icon;\n\n return (\n <div\n role={tone === 'danger' ? 'alert' : 'status'}\n className={clsx(\n 'flex items-start gap-2.5 rounded-xl border p-3.5 text-body-xs',\n toneStyles[tone],\n className,\n )}\n >\n {glyph && <span className=\"mt-px shrink-0\">{glyph}</span>}\n <div className=\"min-w-0\">{children}</div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EmptyStateVariant = 'empty' | 'loading' | 'error';\nexport type EmptyStateSize = 'sm' | 'md' | 'lg';\n\n/**\n * Vertical padding. The eighteen source copies used `py-8`, with divergent siblings\n * at `py-10`, `py-12` and `py-16` — these three sizes absorb all four.\n */\nconst SIZES: Record<EmptyStateSize, string> = {\n sm: 'py-8',\n md: 'py-12',\n lg: 'py-16',\n};\n\nconst TONES: Record<EmptyStateVariant, string> = {\n empty: 'text-default-secondary',\n loading: 'text-default-secondary',\n error: 'text-danger',\n};\n\nexport interface EmptyStateProps {\n message: string;\n /** `error` is the only variant that changes colour; `loading` exists for intent. */\n variant?: EmptyStateVariant;\n size?: EmptyStateSize;\n icon?: ReactNode;\n /** A primary action, e.g. \"Add your first source\". */\n action?: ReactNode;\n className?: string;\n}\n\n/**\n * Centred placeholder for an empty list, a loading list, or a failed fetch.\n *\n * Replaces eighteen copies of `py-8 text-center text-body-sm\n * text-default-secondary` plus four divergent variants. Loading and empty were\n * always the same markup in this codebase, so they are one component with a\n * `variant` rather than two near-identical ones.\n *\n * `aria-live` is set for the loading and error variants so a screen reader announces\n * the state change instead of silently swapping list content.\n */\nexport function EmptyState({\n message,\n variant = 'empty',\n size = 'sm',\n icon,\n action,\n className,\n}: EmptyStateProps) {\n return (\n <div\n className={clsx(\n 'flex flex-col items-center justify-center gap-2 px-4 text-center text-body-sm',\n SIZES[size],\n TONES[variant],\n className,\n )}\n aria-live={variant === 'empty' ? undefined : 'polite'}\n >\n {icon && <span className=\"text-default-tertiary\">{icon}</span>}\n <p>{message}</p>\n {action}\n </div>\n );\n}\n","import { forwardRef, useState } from 'react';\nimport { LuEye, LuEyeOff } from 'react-icons/lu';\n\nimport { Input, type InputProps } from './input';\n\nexport type PasswordInputProps = Omit<InputProps, 'type' | 'trailingIcon' | 'trailingAction'>;\n\n/** Password field with a show/hide visibility toggle. */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(function PasswordInput(props, ref) {\n const [visible, setVisible] = useState(false);\n\n return (\n <Input\n ref={ref}\n {...props}\n type={visible ? 'text' : 'password'}\n trailingAction={\n <button\n type=\"button\"\n aria-label={visible ? 'Hide password' : 'Show password'}\n onClick={() => setVisible((v) => !v)}\n className=\"flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand\"\n >\n {visible ? <LuEyeOff className=\"size-4\" /> : <LuEye className=\"size-4\" />}\n </button>\n }\n />\n );\n});\n","import clsx from 'clsx';\nimport { LuArrowRight, LuSearch } from 'react-icons/lu';\n\nexport interface AIChatBarProps {\n placeholder?: string;\n className?: string;\n}\n\nexport function AIChatBar({\n placeholder = 'Ask Intelligence about any entity, supplier, or risk…',\n className,\n}: AIChatBarProps) {\n return (\n <div\n className={clsx(\n 'flex h-16 items-center gap-3 rounded-2xl border border-default bg-default px-6 shadow-panel',\n className,\n )}\n >\n <span className=\"shrink-0 text-icon-default-secondary\">\n <LuSearch className=\"size-4\" />\n </span>\n <p className=\"flex-1 text-body-sm text-default-tertiary truncate\">{placeholder}</p>\n <button\n type=\"button\"\n className=\"inline-flex shrink-0 items-center gap-2 rounded-xl bg-brand px-4 py-3 text-body-sm font-semibold text-brand-on-brand hover:bg-brand-hover transition-colors\"\n >\n Ask\n <LuArrowRight className=\"size-4\" />\n </button>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuArrowRight, LuCpu } from 'react-icons/lu';\n\nexport interface AISuggestionChipProps {\n prompt: string;\n onClick?: () => void;\n className?: string;\n}\n\nexport function AISuggestionChip({ prompt, onClick, className }: AISuggestionChipProps) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={clsx(\n 'flex h-12 w-full items-center gap-3 rounded-xl border border-default bg-default px-3 text-left hover:bg-default-hover transition-colors',\n className,\n )}\n >\n <span className=\"shrink-0 text-icon-brand\">\n <LuCpu className=\"size-4\" />\n </span>\n <span className=\"flex-1 text-body-sm text-default truncate\">{prompt}</span>\n <span className=\"shrink-0 text-icon-default-secondary\">\n <LuArrowRight className=\"size-3.5\" strokeWidth={2.5} />\n </span>\n </button>\n );\n}\n","import clsx from 'clsx';\nimport { TagPill } from '../status/tag-pill';\n\nexport interface QuickAction {\n label: string;\n value: string;\n}\n\nexport interface QuickActionsBarProps {\n actions: QuickAction[];\n active?: string;\n onSelect?: (value: string) => void;\n className?: string;\n}\n\nexport function QuickActionsBar({ actions, active, onSelect, className }: QuickActionsBarProps) {\n return (\n <div className={clsx('flex items-center gap-3 flex-wrap', className)}>\n {actions.map((action) => (\n <button\n key={action.value}\n type=\"button\"\n onClick={() => onSelect?.(action.value)}\n className=\"focus:outline-none\"\n >\n <TagPill\n label={action.label}\n tone={active === action.value ? 'brand' : 'default'}\n />\n </button>\n ))}\n </div>\n );\n}\n","/** Soft aurora atmosphere used by the public-facing screens (auth, event\n * onboarding) — mirrors AuroraBackground in pages/intelligence. Blobs are\n * corner-anchored so the effect scales from phones to kiosk displays.\n * Render inside a `relative overflow-hidden` container; content goes on top\n * with `relative`. */\nexport function AuroraBackdrop() {\n return (\n <div className=\"pointer-events-none absolute inset-0\" aria-hidden>\n <div className=\"absolute -left-24 -top-28\" style={{ width: 380, height: 380, background: 'radial-gradient(ellipse, rgba(249,133,133,0.45) 0%, transparent 70%)' }} />\n <div className=\"absolute -top-24 right-[-4%]\" style={{ width: 320, height: 320, background: 'radial-gradient(ellipse, rgba(254,160,160,0.4) 0%, transparent 70%)' }} />\n <div className=\"absolute bottom-[-10%] right-[14%]\" style={{ width: 420, height: 420, background: 'radial-gradient(ellipse, rgba(196,181,253,0.3) 0%, transparent 70%)' }} />\n <div className=\"absolute bottom-[-6%] left-[4%]\" style={{ width: 280, height: 280, background: 'radial-gradient(ellipse, rgba(147,197,253,0.25) 0%, transparent 70%)' }} />\n <div className=\"absolute left-[20%] top-[30%]\" style={{ width: 240, height: 240, background: 'radial-gradient(ellipse, rgba(173,216,255,0.18) 0%, transparent 70%)' }} />\n </div>\n );\n}\n","/** Bespoke icon art with no equivalent in the stroked icon set.\n *\n * The library's icons come from `react-icons/lu`, which is a *stroked* set. What\n * lives here is the small set of *filled* 20×20 marks: swapping these for\n * `LuInfo`/`LuArrowRight`/etc. would turn a solid glyph into an outline — a visual\n * change, not a redraw. They keep their own `viewBox=\"0 0 20 20\"` and\n * `fill=\"currentColor\"`, and size via `className` (e.g. `className=\"size-5\"`).\n *\n * Do not add stroked icons here — import them from `react-icons/lu` instead.\n */\n\ninterface SolidIconProps {\n className?: string;\n}\n\nfunction solid(path: string, displayName: string) {\n const Component = ({ className }: SolidIconProps) => (\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" className={className} aria-hidden=\"true\">\n <path fillRule=\"evenodd\" d={path} clipRule=\"evenodd\" />\n </svg>\n );\n Component.displayName = displayName;\n return Component;\n}\n\nexport const SolidAlertTriangle = solid(\n 'M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z',\n 'SolidAlertTriangle',\n);\n\nexport const SolidShieldCheck = solid(\n 'M10 1.944A11.954 11.954 0 012.166 5C2.056 5.649 2 6.319 2 7c0 5.225 3.34 9.67 8 11.317C14.66 16.67 18 12.225 18 7c0-.682-.057-1.35-.166-2.001A11.954 11.954 0 0110 1.944zm1.414 7.349a1 1 0 00-1.414-1.414L8.5 9.379l-.793-.793a1 1 0 00-1.414 1.414l1.5 1.5a1 1 0 001.414 0l2.207-2.207z',\n 'SolidShieldCheck',\n);\n\nexport const SolidGlobe = solid(\n 'M10 18a8 8 0 100-16 8 8 0 000 16zM4.332 8.027a6.012 6.012 0 011.912-2.706C6.512 5.73 6.974 6 7.5 6A1.5 1.5 0 019 7.5V8a2 2 0 004 0 2 2 0 011.523-1.943A5.977 5.977 0 0116 10c0 .34-.028.675-.083 1H15a2 2 0 00-2 2v2.197A5.973 5.973 0 0110 16v-2a2 2 0 00-2-2 2 2 0 01-2-2 2 2 0 00-1.668-1.973z',\n 'SolidGlobe',\n);\n\nexport const SolidMapPin = solid(\n 'M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z',\n 'SolidMapPin',\n);\n\nexport const SolidClock = solid(\n 'M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z',\n 'SolidClock',\n);\n\nexport const SolidArrowRight = solid(\n 'M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z',\n 'SolidArrowRight',\n);\n\nexport const SolidInfoCircle = solid(\n 'M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z',\n 'SolidInfoCircle',\n);\n\nexport const SolidCheck = solid(\n 'M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z',\n 'SolidCheck',\n);\n\n/** Chart bars — the one mark here without a `fillRule`/`clipRule` pair. */\nexport function SolidChartBar({ className }: SolidIconProps) {\n return (\n <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" className={className} aria-hidden=\"true\">\n <path d=\"M2 11a1 1 0 011-1h2a1 1 0 011 1v5a1 1 0 01-1 1H3a1 1 0 01-1-1v-5zM8 7a1 1 0 011-1h2a1 1 0 011 1v9a1 1 0 01-1 1H9a1 1 0 01-1-1V7zM14 4a1 1 0 011-1h2a1 1 0 011 1v12a1 1 0 01-1 1h-2a1 1 0 01-1-1V4z\" />\n </svg>\n );\n}\n"],"mappings":";AACA,OAAO,UAAU;AA2Db,SAYE,KAZF;AA/CJ,IAAM,gBAA+C;AAAA,EACnD,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAQ;AAAA;AAAA,IAEN;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAQ;AAAA,IACN;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EACF;AAAA,EACA,iBAAiB;AAAA;AAAA,IAEf;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,IAAM,aAAyC;AAAA,EAC7C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEO,SAAS,OAAO;AAAA,EACrB,UAAU;AAAA,EACV,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAgB;AACd,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QAC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AEJ;","names":["clsx","jsx","variantStyles","sizeStyles","clsx","jsx","jsxs","clsx","jsx","sizeStyles","clsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","Input","forwardRef","clsx","jsx","jsxs","wrapGap","labelText","Textarea","forwardRef","clsx","jsx","jsxs","wrapGap","labelText","Select","forwardRef","clsx","jsx","jsxs","wrapGap","labelText","inputBase","iconWrap","DatePicker","clsx","jsx","jsxs","clsx","LuCheck","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","jsx","useRef","useState","LuChevronDown","Fragment","jsx","jsxs","useState","useRef","LuChevronDown","clsx","jsx","jsxs","clsx","jsx","clsx","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","clsx","jsx","clsx","jsx","jsxs","jsx","clsx","LuCheck","LuX","jsx","clsx","jsx","sizeStyles","toneStyles","useEffect","useRef","clsx","LuCheck","LuMinus","jsx","jsxs","clsx","jsx","useRef","LuX","clsx","useEffect","jsx","jsxs","SIZE","useRef","LuX","useRef","clsx","LuX","jsx","jsxs","useRef","clsx","LuX","jsx","jsxs","useState","jsx","jsxs","useState","useEffect","useRef","useState","clsx","jsx","jsxs","jsx","FOOTER_ALIGN","clsx","jsx","jsxs","clsx","jsx","SIZE","clsx","jsx","jsxs","clsx","jsx","jsxs","SIZE","clsx","jsx","jsxs","SIZE","clsx","jsx","clsx","clsx","jsx","sizeStyles","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","sizeStyles","clsx","jsx","jsxs","SIZE","TONE","clsx","jsx","clsx","jsx","jsxs","SIZE","labelClass","clsx","clsx","jsx","jsxs","SIZE","clsx","clsx","jsx","jsxs","SIZE","clsx","clsx","Fragment","jsx","jsxs","SIZE","clsx","clsx","jsx","SIZE","clsx","clsx","clsx","jsx","clsx","jsx","jsxs","clsx","clsx","jsx","jsxs","SIZE","WEIGHT","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","GAP","clsx","jsx","jsxs","SIZE","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","LuCheck","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","LuCheck","jsx","jsxs","COLUMNS","clsx","jsx","jsxs","DENSITY","ALIGN","clsx","clsx","LuCircleCheckBig","LuInfo","LuTriangleAlert","jsx","jsxs","toneStyles","clsx","jsx","jsxs","forwardRef","useState","jsx","forwardRef","PasswordInput","useState","clsx","LuArrowRight","jsx","jsxs","clsx","LuArrowRight","jsx","jsxs","clsx","jsx","clsx","jsx","jsxs","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/forms/button.tsx","../src/lib/slot.tsx","../src/components/feedback/spinner.tsx","../src/components/forms/control-size.tsx","../src/components/forms/icon-button.tsx","../src/components/forms/button-group.tsx","../src/components/avatar/avatar.tsx","../src/components/avatar/avatar-group.tsx","../src/components/avatar/avatar-block.tsx","../src/components/forms/field.tsx","../src/lib/cn.ts","../src/components/forms/input.tsx","../src/components/forms/textarea.tsx","../src/components/forms/select.tsx","../src/lib/use-controllable-state.ts","../src/lib/use-roving-focus.ts","../src/components/overlays/floating.tsx","../src/components/overlays/menu-styles.ts","../src/lib/scrollbar.ts","../src/components/overlays/overlay.ts","../src/components/overlays/overlay-stack.ts","../src/components/overlays/portal.tsx","../src/components/forms/date-picker.tsx","../src/components/forms/stepper.tsx","../src/components/forms/multiselect-card.tsx","../src/components/forms/switch.tsx","../src/components/forms/toggle.tsx","../src/components/forms/input-otp.tsx","../src/components/forms/file-drop-zone.tsx","../src/components/forms/form-card.tsx","../src/components/status/badge.tsx","../src/components/status/role-badge.tsx","../src/components/forms/combobox.tsx","../src/components/forms/role-combo-box.tsx","../src/components/forms/command.tsx","../src/components/status/status-badge.tsx","../src/components/status/status-dot.tsx","../src/components/status/status-chip.tsx","../src/components/status/count-badge.tsx","../src/components/status/tag-pill.tsx","../src/components/status/trail-chip.tsx","../src/components/status/user-status-pill.tsx","../src/components/status/check-indicator.tsx","../src/components/status/entity-icon-badge.tsx","../src/components/forms/checkbox.tsx","../src/components/forms/check-control.tsx","../src/components/forms/radio-group.tsx","../src/components/forms/segmented-control.tsx","../src/components/forms/slider.tsx","../src/components/forms/label.tsx","../src/components/forms/calendar.tsx","../src/components/forms/input-group.tsx","../src/components/overlays/modal.tsx","../src/components/overlays/tooltip.tsx","../src/components/overlays/popover.tsx","../src/components/overlays/hover-card.tsx","../src/components/overlays/context-menu.tsx","../src/components/overlays/menu-core.tsx","../src/components/overlays/menubar.tsx","../src/components/overlays/drawer.tsx","../src/components/cards/scroll-area.tsx","../src/components/overlays/confirm-dialog.tsx","../src/components/overlays/note-confirm-modal.tsx","../src/components/overlays/dropdown-menu.tsx","../src/components/cards/card.tsx","../src/components/cards/accordion.tsx","../src/components/cards/collapsible.tsx","../src/components/cards/aspect-ratio.tsx","../src/components/cards/carousel.tsx","../src/components/cards/resizable.tsx","../src/components/chrome/page-heading.tsx","../src/components/chrome/page-toolbar.tsx","../src/components/chrome/filter-bar.tsx","../src/components/chrome/tabs.tsx","../src/components/chrome/nav-item.tsx","../src/components/chrome/eyebrow-label.tsx","../src/components/chrome/separator.tsx","../src/components/chrome/kbd.tsx","../src/components/chrome/breadcrumb.tsx","../src/components/chrome/pagination.tsx","../src/components/chrome/navigation-menu.tsx","../src/components/chrome/typography.tsx","../src/components/widgets/widget-header.tsx","../src/components/widgets/widget-title.tsx","../src/components/widgets/widget-footer.tsx","../src/components/stats/stat-tile.tsx","../src/components/stats/stat-number.tsx","../src/components/stats/score-value.tsx","../src/components/stats/tile-grid.tsx","../src/components/charts/chart-tone.ts","../src/components/charts/bar-chart.tsx","../src/components/charts/donut-chart.tsx","../src/components/charts/radial-gauge.tsx","../src/components/charts/sparkline.tsx","../src/components/charts/mini-bar-chart.tsx","../src/components/charts/chart-legend.tsx","../src/components/charts/legend-dot.tsx","../src/components/charts/trend-label.tsx","../src/components/lists/list-row.tsx","../src/components/lists/file-row.tsx","../src/components/lists/scored-row.tsx","../src/components/lists/numbered-list.tsx","../src/components/feedback/progress-bar.tsx","../src/components/lists/icon-text-row.tsx","../src/components/lists/checklist-row.tsx","../src/components/lists/steps-list.tsx","../src/components/lists/detail-item.tsx","../src/components/lists/checked-group-list.tsx","../src/components/lists/table.tsx","../src/components/lists/data-table.tsx","../src/components/feedback/inline-alert.tsx","../src/components/feedback/empty-state.tsx","../src/components/feedback/skeleton.tsx","../src/components/feedback/banner.tsx","../src/components/feedback/toast.tsx","../src/components/forms/password-input.tsx","../src/components/ai/ai-chat-bar.tsx","../src/components/ai/ai-suggestion-chip.tsx","../src/components/ai/quick-actions-bar.tsx","../src/components/decorative/aurora-backdrop.tsx"],"sourcesContent":["import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Slot } from '../../lib/slot';\nimport { Spinner } from '../feedback/spinner';\nimport { useControlSize } from './control-size';\n\nexport type ButtonVariant = 'primary' | 'neutral' | 'subtle' | 'danger' | 'danger-subtle';\nexport type ButtonSize = 'lg' | 'md' | 'sm';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: ButtonVariant;\n size?: ButtonSize;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n /**\n * Render the single child element instead of a `<button>` — e.g. a router `Link`, so a\n * navigation action can look like a button without nesting an anchor inside one.\n */\n asChild?: boolean;\n /**\n * Swaps the leading icon for a spinner and disables the button. `aria-busy` is set so\n * assistive tech reports the pending state rather than only the disabled one.\n */\n loading?: boolean;\n /** Announced while `loading`. Defaults to the button's own content. */\n loadingLabel?: string;\n}\n\nconst variantStyles: Record<ButtonVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n neutral: clsx(\n 'bg-default border border-default text-default',\n 'hover:bg-default-hover hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n subtle: clsx(\n // border-transparent holds space so hover border doesn't shift layout\n 'bg-transparent border border-transparent text-neutral',\n 'hover:border-default hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n danger: clsx(\n 'bg-danger border border-danger-secondary text-danger-on-danger',\n // border shifts from danger-secondary → danger-default on hover (Figma spec)\n 'hover:bg-danger-hover hover:border-danger',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n 'danger-subtle': clsx(\n // border-transparent base avoids layout shift when hover border appears\n 'bg-transparent border border-transparent text-danger',\n 'hover:bg-danger-tertiary-hover hover:border-danger',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n};\n\n// Horizontal padding is on the label span, not a nested div — through 0.3.0 the children\n// were wrapped in `<div className=\"px-1\">` *inside* the `<button>`, which is a block\n// element inside a phrasing-content context and knocked the flex baseline about.\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5',\n md: 'h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5',\n sm: 'h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4',\n};\n\nconst SPINNER_SIZE: Record<ButtonSize, 'sm' | 'md'> = {\n lg: 'md',\n md: 'sm',\n sm: 'sm',\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'primary',\n size: sizeProp,\n leadingIcon,\n trailingIcon,\n asChild = false,\n loading = false,\n loadingLabel,\n disabled,\n type,\n children,\n className,\n ...props\n },\n ref,\n) {\n const size = useControlSize(sizeProp);\n\n const decorate = (content: ReactNode) => (\n <>\n {loading ? <Spinner size={SPINNER_SIZE[size]} label={loadingLabel} /> : leadingIcon}\n <span className=\"px-1\">{content}</span>\n {trailingIcon}\n </>\n );\n\n const rootProps = {\n className: clsx(\n 'inline-flex items-center justify-center whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed',\n variantStyles[variant],\n sizeStyles[size],\n className,\n ),\n 'aria-busy': loading || undefined,\n ...props,\n };\n\n if (asChild) {\n // `aria-disabled`, not `disabled`: the child may be an `<a>`, which has no disabled\n // attribute, and removing the href would change what the element *is*.\n return (\n <Slot\n ref={ref}\n aria-disabled={disabled || loading || undefined}\n wrapChildren={decorate}\n {...rootProps}\n >\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n // Through 0.3.0 no default `type` was set, so `<Button onClick={…}>` inside a\n // `<form>` submitted it. Every other button in the library set `type=\"button\"`\n // explicitly; this one did not.\n type={type ?? 'button'}\n disabled={disabled || loading}\n {...rootProps}\n >\n {decorate(children)}\n </button>\n );\n});\n","import {\n cloneElement,\n forwardRef,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport clsx from 'clsx';\n\n/**\n * `Slot` renders its own props onto its single child element instead of emitting a\n * wrapper of its own. It is what makes `asChild` work.\n *\n * Why the library needs it: before 0.4.0 there was no way to render a `Button` as a\n * router `<Link>`, or to use any component as a tooltip/popover anchor, because every\n * component hardcoded its host element. The usual workaround — a `component`/`as` prop —\n * multiplies generics across the whole surface and still cannot forward a ref through\n * two levels. Delegating to the child instead keeps the type surface flat.\n *\n * <Button asChild><Link to=\"/x\">Go</Link></Button>\n *\n * Merge rules, in order of who wins:\n * - `className` — concatenated, slot first, so the child's classes come last\n * - `style` — shallow-merged, child wins on conflicting keys\n * - `on*` — both run, slot's handler first; the child's runs even if the slot's\n * called `preventDefault`, matching normal DOM listener behaviour\n * - everything else — child wins, so a child's explicit `type` or `role` is never\n * clobbered by a default the slot happens to carry\n */\nexport interface SlotProps extends HTMLAttributes<HTMLElement> {\n /** The single element to merge into. */\n children?: ReactNode;\n /**\n * Rebuilds the child's children, so a component that decorates its content can keep\n * doing so through `asChild`.\n *\n * `Button` renders `leadingIcon`, a padded label span and `trailingIcon` around whatever\n * it is given. Without this, `<Button asChild><Link>Go</Link></Button>` would either drop\n * the icons (cloning the Link untouched) or drop \"Go\" (replacing the Link's children\n * outright). It receives the child's own children — \"Go\" — and returns the decorated\n * tree to place inside the child.\n */\n wrapChildren?: (childChildren: ReactNode) => ReactNode;\n}\n\nexport const Slot = forwardRef<HTMLElement, SlotProps>(function Slot(\n { children, wrapChildren, ...slotProps },\n forwardedRef,\n) {\n // A bare string, an array, or nothing at all — there is no element to merge into.\n // Rendering the children plain would silently drop every prop the slot carries\n // (including the ref and the ARIA wiring a trigger depends on), so this renders\n // nothing rather than something subtly broken.\n if (!isValidElement(children)) return null;\n\n const child = children as ReactElement<{ children?: ReactNode }>;\n\n const merged = {\n ...mergeProps(slotProps, child.props as Record<string, unknown>),\n ref: composeRefs(forwardedRef, getElementRef(child)),\n } as Record<string, unknown>;\n\n return wrapChildren\n ? cloneElement(child, merged, wrapChildren(child.props.children))\n : cloneElement(child, merged);\n});\n\nfunction mergeProps(\n slotProps: Record<string, unknown>,\n childProps: Record<string, unknown>,\n): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...slotProps };\n\n for (const key in childProps) {\n const slotValue = slotProps[key];\n const childValue = childProps[key];\n\n if (/^on[A-Z]/.test(key)) {\n // Both handlers run. The slot's fires first so a component can set up state\n // before the consumer's own handler observes it.\n if (typeof slotValue === 'function' && typeof childValue === 'function') {\n merged[key] = (...args: unknown[]) => {\n (slotValue as (...a: unknown[]) => void)(...args);\n (childValue as (...a: unknown[]) => void)(...args);\n };\n } else {\n merged[key] = childValue ?? slotValue;\n }\n } else if (key === 'className') {\n merged[key] = clsx(slotValue as string, childValue as string);\n } else if (key === 'style') {\n merged[key] = { ...(slotValue as CSSProperties), ...(childValue as CSSProperties) };\n } else {\n merged[key] = childValue;\n }\n }\n\n return merged;\n}\n\n/**\n * React 19 exposes a `ref` on `props`; React 18 keeps it on the element. The peer range\n * is `>=18`, so both have to be read.\n */\nfunction getElementRef(element: ReactElement): Ref<unknown> | undefined {\n const asRecord = element as unknown as {\n ref?: Ref<unknown>;\n props?: { ref?: Ref<unknown> };\n };\n return asRecord.props?.ref ?? asRecord.ref;\n}\n\n/** Fan one node out to several refs, callback or object. */\nexport function composeRefs<T>(...refs: (Ref<T> | undefined)[]) {\n return (node: T | null) => {\n for (const ref of refs) {\n if (!ref) continue;\n if (typeof ref === 'function') {\n ref(node);\n } else {\n (ref as { current: T | null }).current = node;\n }\n }\n };\n}\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport clsx from 'clsx';\n\nexport type SpinnerSize = 'xs' | 'sm' | 'md' | 'lg';\n\nexport interface SpinnerProps extends HTMLAttributes<HTMLSpanElement> {\n size?: SpinnerSize;\n /**\n * Accessible name. When omitted the spinner is marked decorative — correct when it sits\n * inside a control that already announces the pending state (`Button loading` sets\n * `aria-busy`), and wrong when the spinner is the only thing on screen.\n */\n label?: string;\n}\n\nconst SIZE: Record<SpinnerSize, string> = {\n xs: 'size-3 border',\n sm: 'size-4 border-[1.5px]',\n md: 'size-5 border-2',\n lg: 'size-8 border-2',\n};\n\n/**\n * Indeterminate loading indicator. `ProgressBar` is the determinate counterpart.\n *\n * The spin is a border-based ring rather than an SVG so it inherits `currentColor` and\n * needs no fill/stroke plumbing — it works on any button variant unchanged. The animation\n * is suppressed under `prefers-reduced-motion` by the preset's base rule, which leaves a\n * static ring; that is why the transparent segment is a full quarter and still legible\n * when frozen.\n */\nexport const Spinner = forwardRef<HTMLSpanElement, SpinnerProps>(function Spinner(\n { size = 'sm', label, className, ...rest },\n ref,\n) {\n return (\n <span\n ref={ref}\n role={label ? 'status' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={clsx(\n 'inline-block shrink-0 animate-spin rounded-full',\n 'border-current border-t-transparent',\n SIZE[size],\n className,\n )}\n {...rest}\n />\n );\n});\n","import { createContext, useContext, type ReactNode } from 'react';\nimport type { InputSize } from './input';\n\n/**\n * A default `size` for the form controls inside a container.\n *\n * `FilterBar size=\"sm\"` used to set only the gap between its children, so its own \"Sizes\"\n * example put a 24px Input beside a 36px Select and nothing in the API said the caller had\n * to size each control by hand. A container that has a size prop should mean it.\n *\n * Deliberately narrow: the context carries an `InputSize` and nothing else. It is not a\n * general \"component config\" channel — that is where implicit inheritance stops being\n * predictable. And an explicit `size` prop always wins, so the escape hatch is one prop on\n * the one control that needs to differ.\n *\n * `cloneElement` would have been the alternative and cannot work here: it never reaches a\n * control wrapped for layout (`<div className=\"w-56\"><Input /></div>`) or one nested inside\n * a consumer's own composite, and it would inject `size` into whatever element happens to\n * be the child — including a `<span>`, which React then warns about. Context is also how\n * the library already solves this shape, in `FieldContext`, `RadioGroupContext` and\n * `ToggleGroupContext`.\n */\nconst ControlSizeContext = createContext<InputSize | null>(null);\n\nexport interface ControlSizeProviderProps {\n size: InputSize;\n children: ReactNode;\n}\n\nexport function ControlSizeProvider({ size, children }: ControlSizeProviderProps) {\n return <ControlSizeContext.Provider value={size}>{children}</ControlSizeContext.Provider>;\n}\n\n/**\n * Resolve a control's size: an explicit prop, else the enclosing container's default,\n * else `md`.\n *\n * Call it unconditionally at the top of the component — it is a hook.\n */\nexport function useControlSize(explicit?: InputSize): InputSize {\n const inherited = useContext(ControlSizeContext);\n return explicit ?? inherited ?? 'md';\n}\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Slot } from '../../lib/slot';\nimport { type ButtonSize } from './button';\nimport { useControlSize } from './control-size';\n\nexport type IconButtonVariant = 'primary' | 'neutral' | 'subtle';\n\nexport interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: IconButtonVariant;\n size?: ButtonSize;\n /** Required for accessibility — no visible text label */\n 'aria-label': string;\n /** Render the single child element instead of a `<button>` — e.g. a router `Link`. */\n asChild?: boolean;\n children?: ReactNode;\n}\n\nconst variantStyles: Record<IconButtonVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n // Neutral uses secondary background (light gray) for visual weight without a text label\n neutral: clsx(\n 'bg-default-secondary border border-default text-default',\n // icon turns brand blue on hover (Figma spec)\n 'hover:bg-default-secondary-hover hover:text-brand',\n 'disabled:bg-disabled disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n subtle: clsx(\n 'bg-transparent text-neutral',\n // hover uses background-default-default-hover (#f5f5f5), icon turns brand blue (Figma spec)\n 'hover:bg-default-hover hover:text-brand',\n // disabled needs explicit border since there is no base border\n 'disabled:bg-disabled disabled:border disabled:border-disabled disabled:text-disabled-on-disabled',\n ),\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'size-12 rounded-2xl [&_svg]:size-5',\n md: 'size-9 rounded-lg [&_svg]:size-5',\n sm: 'size-6 rounded-full [&_svg]:size-4',\n};\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(function IconButton(\n { variant = 'primary', size: sizeProp, asChild = false, type, children, className, ...props },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const rootProps = {\n className: clsx(\n 'inline-flex shrink-0 items-center justify-center transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed',\n variantStyles[variant],\n sizeStyles[size],\n className,\n ),\n ...props,\n };\n\n // No `wrapChildren` here: an icon button has no label span or icon slots to rebuild, so\n // the child's own content is already the whole thing.\n if (asChild) {\n return (\n <Slot ref={ref} {...rootProps}>\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={ref}\n // Without an explicit type, a button inside a <form> defaults to `submit` and an\n // icon button meant to reveal a password or open a menu submits the form instead.\n type={type ?? 'button'}\n {...rootProps}\n >\n {children}\n </button>\n );\n});\n","import { type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { type ButtonSize } from './button';\n\nexport type ButtonGroupVariant = 'primary' | 'neutral' | 'filter';\nexport type ButtonGroupAlign = 'justify' | 'start' | 'end' | 'center' | 'stack';\n\nexport interface ButtonGroupItem {\n value: string;\n label: ReactNode;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n disabled?: boolean;\n}\n\nexport interface ButtonGroupProps {\n items: ButtonGroupItem[];\n value: string;\n onChange: (value: string) => void;\n variant?: ButtonGroupVariant;\n size?: ButtonSize;\n align?: ButtonGroupAlign;\n /** Forwarded to the container as aria-label */\n 'aria-label'?: string;\n className?: string;\n}\n\nconst containerStyles: Record<ButtonGroupVariant, string> = {\n primary: 'bg-neutral-tertiary p-1 rounded-2xl',\n neutral: 'bg-neutral-tertiary p-1 rounded-2xl',\n filter: 'bg-default border border-default p-1 rounded-xl',\n};\n\nconst selectedStyles: Record<ButtonGroupVariant, string> = {\n primary: clsx(\n 'bg-brand border border-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n ),\n neutral: clsx(\n 'bg-default border border-default text-default',\n 'hover:bg-default-hover',\n ),\n filter: clsx(\n 'bg-brand text-brand-on-brand',\n 'hover:bg-brand-hover',\n ),\n};\n\nconst unselectedStyles: Record<ButtonGroupVariant, string> = {\n primary: clsx('bg-transparent text-neutral', 'hover:bg-neutral-tertiary-hover'),\n neutral: clsx('bg-transparent text-neutral', 'hover:bg-neutral-tertiary-hover'),\n filter: clsx('text-default-secondary', 'hover:text-default'),\n};\n\nconst itemSizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-3 gap-1 rounded-2xl text-body font-semibold [&_svg]:size-5',\n md: 'h-9 px-2 gap-0.5 rounded-lg text-body-sm font-semibold [&_svg]:size-5',\n sm: 'h-6 px-1.5 pt-0.5 gap-0 rounded-full text-body-tiny font-semibold [&_svg]:size-4',\n};\n\nconst containerAlignStyles: Record<ButtonGroupAlign, string> = {\n justify: 'flex flex-row items-center',\n start: 'flex flex-row items-center justify-start',\n end: 'flex flex-row items-center justify-end',\n center: 'flex flex-row items-center justify-center',\n stack: 'flex flex-col items-center',\n};\n\nexport function ButtonGroup({\n items,\n value,\n onChange,\n variant = 'primary',\n size = 'md',\n align = 'start',\n className,\n 'aria-label': ariaLabel,\n}: ButtonGroupProps) {\n const isJustify = align === 'justify';\n const isStack = align === 'stack';\n\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n className={clsx(\n containerStyles[variant],\n containerAlignStyles[align],\n className,\n )}\n >\n {items.map((item) => {\n const isSelected = item.value === value;\n return (\n <div\n key={item.value}\n className={clsx(isJustify && 'flex-1 min-w-0', isStack && 'w-full')}\n >\n <button\n type=\"button\"\n aria-pressed={isSelected}\n disabled={item.disabled}\n onClick={() => onChange(item.value)}\n className={clsx(\n 'inline-flex items-center justify-center whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n (isJustify || isStack) && 'w-full',\n itemSizeStyles[size],\n isSelected ? selectedStyles[variant] : unselectedStyles[variant],\n )}\n >\n {item.leadingIcon}\n <div className='px-1'>{item.label}</div>\n {item.trailingIcon}\n </button>\n </div>\n );\n })}\n </div>\n );\n}\n","import clsx from 'clsx';\n\nexport type AvatarSize = 'sm' | 'md' | 'lg';\nexport type AvatarShape = 'circle' | 'square';\n\nexport interface AvatarInitialProps {\n type?: 'initial';\n /** Single character — Figma spec: one letter only to avoid overflow */\n initial: string;\n size?: AvatarSize;\n shape?: AvatarShape;\n className?: string;\n}\n\nexport interface AvatarImageProps {\n type: 'image';\n src: string;\n alt?: string;\n size?: AvatarSize;\n shape?: AvatarShape;\n className?: string;\n}\n\nexport type AvatarProps = AvatarInitialProps | AvatarImageProps;\n\n// Figma sizes: lg=40px, md=32px, sm=24px\nconst sizeStyles: Record<AvatarSize, string> = {\n lg: 'size-10',\n md: 'size-8',\n sm: 'size-6',\n};\n\n// Figma text sizes for initials: body-medium at lg, scales down proportionally\nconst initialTextStyles: Record<AvatarSize, string> = {\n lg: 'text-body font-semibold',\n md: 'text-body-xs font-semibold',\n sm: 'text-body-tiny font-semibold',\n};\n\n// Figma shape radii: circle=full, square: lg/md=8px (rounded-lg), sm=4px (rounded)\nfunction getShapeClass(shape: AvatarShape, size: AvatarSize): string {\n if (shape === 'circle') return 'rounded-full';\n return size === 'sm' ? 'rounded' : 'rounded-lg';\n}\n\nexport function Avatar(props: AvatarProps) {\n const { size = 'lg', shape = 'circle', className } = props;\n\n const base = clsx(\n 'shrink-0 overflow-hidden',\n sizeStyles[size],\n getShapeClass(shape, size),\n className,\n );\n\n if (props.type === 'image') {\n return (\n <div className={base}>\n <img\n src={props.src}\n alt={props.alt ?? ''}\n className=\"size-full object-cover\"\n />\n </div>\n );\n }\n\n return (\n <div\n className={clsx(base, 'flex items-center justify-center')}\n style={{\n background:\n 'linear-gradient(135deg, var(--color-graphic-blue) 30%, var(--color-graphic-red) 100%)',\n }}\n >\n <span\n className={clsx(\n 'select-none leading-none text-brand-on-brand',\n initialTextStyles[size],\n )}\n >\n {props.initial.charAt(0).toUpperCase()}\n </span>\n </div>\n );\n}\n","import { type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type AvatarGroupSpacing = 'spaced' | 'overlap';\n\nexport interface AvatarGroupProps {\n children: ReactNode;\n /** Number shown in the overflow badge — omit to hide the badge */\n overflow?: number;\n spacing?: AvatarGroupSpacing;\n className?: string;\n}\n\nexport function AvatarGroup({\n children,\n overflow,\n spacing = 'spaced',\n className,\n}: AvatarGroupProps) {\n return (\n <div\n className={clsx(\n 'flex items-center',\n spacing === 'spaced' ? 'gap-1' : '-space-x-2 isolate',\n className,\n )}\n >\n {children}\n {overflow !== undefined && (\n <div\n className={clsx(\n 'flex items-center justify-center',\n 'min-w-6 h-6 px-1 rounded-lg',\n 'bg-default-secondary text-default-secondary text-body-sm',\n spacing === 'overlap' && 'drop-shadow-sm',\n )}\n >\n +{overflow}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface AvatarBlockProps {\n children: ReactNode;\n title: string;\n description?: string;\n className?: string;\n}\n\nexport function AvatarBlock({ children, title, description, className }: AvatarBlockProps) {\n return (\n <div className={clsx('flex items-start gap-3', className)}>\n <div className=\"shrink-0\">{children}</div>\n <div className=\"flex min-w-0 flex-col gap-0.5\">\n <span className=\"text-body font-semibold text-default-secondary\">\n {title}\n </span>\n {description && (\n <span className=\"text-body text-default-tertiary\">\n {description}\n </span>\n )}\n </div>\n </div>\n );\n}\n","import {\n createContext,\n useContext,\n useId,\n type HTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../lib/cn';\nimport type { InputSize } from './input';\n\n/**\n * The label / description / error / control wiring, in one place.\n *\n * This exists because of the single largest defect the 0.3.0 audit found. `Input`,\n * `Textarea`, `Select` and `DatePicker` all accepted `label`, `description`, `error` and\n * `hint`, rendered them, and then connected **none** of them:\n *\n * - `<label htmlFor={id}>` used the caller's `id` with no fallback. Omit `id` — the\n * common case — and `htmlFor` was `undefined`, so the label pointed at nothing.\n * Clicking it did nothing and assistive tech announced an unlabelled field.\n * - `description`, `error` and `hint` were bare `<p>` elements with no `id`, and no\n * control ever referenced them. A consumer could not fix this from outside either:\n * passing `aria-describedby` had nothing to point at.\n * - `error` drove the border colour and nothing else. No `aria-invalid`, no `role`, no\n * live region — so an async validation failure was completely silent.\n *\n * For scale: `aria-describedby`, `aria-invalid` and `aria-required` appeared nowhere in\n * `src/`, and `useId` was used exactly once in the whole library — in `Sparkline`, for an\n * SVG gradient.\n *\n * `Field` generates the ids and hands them down through context, so a control only has to\n * spread `useFieldControl()` onto its input element. It is also usable directly for\n * controls the library does not wrap, which is why the parts are exported.\n */\n\nexport interface FieldContextValue {\n controlId: string;\n /**\n * Id of the `FieldLabel`, for controls whose accessible name cannot come from a\n * `<label for>` association. A `<button>` is named by its own contents, so the Select\n * trigger has to point `aria-labelledby` at the label explicitly or it announces only\n * the chosen value.\n */\n labelId: string;\n descriptionId: string;\n errorId: string;\n hintId: string;\n hasDescription: boolean;\n hasError: boolean;\n hasHint: boolean;\n invalid: boolean;\n required: boolean;\n disabled: boolean;\n size: InputSize;\n}\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nexport function useFieldContext(): FieldContextValue | null {\n return useContext(FieldContext);\n}\n\n/**\n * Props for the control itself. Spread onto the `<input>`/`<select>`/`<textarea>`.\n *\n * `aria-describedby` deliberately lists description *and* message: a field can carry\n * both persistent guidance and a transient error, and a screen reader should read both\n * rather than have the error replace the instruction that explains the format.\n */\nexport function useFieldControl(): {\n id: string | undefined;\n 'aria-describedby': string | undefined;\n 'aria-invalid': true | undefined;\n 'aria-required': true | undefined;\n disabled: boolean | undefined;\n} {\n const field = useFieldContext();\n if (!field) {\n return {\n id: undefined,\n 'aria-describedby': undefined,\n 'aria-invalid': undefined,\n 'aria-required': undefined,\n disabled: undefined,\n };\n }\n\n const describedBy = [\n field.hasDescription && field.descriptionId,\n field.hasError && field.errorId,\n field.hasHint && !field.hasError && field.hintId,\n ]\n .filter(Boolean)\n .join(' ');\n\n return {\n id: field.controlId,\n 'aria-describedby': describedBy || undefined,\n 'aria-invalid': field.invalid || undefined,\n 'aria-required': field.required || undefined,\n disabled: field.disabled || undefined,\n };\n}\n\n// ── Field ──────────────────────────────────────────────────────────────────────\n\nexport type FieldOrientation = 'vertical' | 'horizontal';\n\nexport interface FieldProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Supply to control the id yourself; otherwise one is generated. */\n id?: string;\n size?: InputSize;\n invalid?: boolean;\n required?: boolean;\n disabled?: boolean;\n /** `horizontal` puts the label beside the control — for switches and checkboxes. */\n orientation?: FieldOrientation;\n /** Set when a `FieldDescription` is rendered. Inferred by the wrapped controls. */\n hasDescription?: boolean;\n hasError?: boolean;\n hasHint?: boolean;\n}\n\nconst GAP: Record<InputSize, string> = {\n lg: 'gap-2',\n md: 'gap-1',\n sm: 'gap-0.5',\n};\n\nexport function Field({\n children,\n id,\n size = 'md',\n invalid = false,\n required = false,\n disabled = false,\n orientation = 'vertical',\n hasDescription = false,\n hasError = false,\n hasHint = false,\n className,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const controlId = id ?? generated;\n\n return (\n <FieldContext.Provider\n value={{\n controlId,\n labelId: `${controlId}-label`,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n hintId: `${controlId}-hint`,\n hasDescription,\n hasError,\n hasHint,\n invalid: invalid || hasError,\n required,\n disabled,\n size,\n }}\n >\n <div\n // role=\"group\" so the label of a fieldset-like cluster is inherited by every\n // control inside it, matching shadcn's Field.\n role={orientation === 'horizontal' ? 'group' : undefined}\n data-slot=\"field\"\n data-invalid={invalid || hasError || undefined}\n data-disabled={disabled || undefined}\n className={cn(\n orientation === 'horizontal'\n ? 'flex flex-row items-center justify-between gap-3'\n : cn('flex flex-col', GAP[size]),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </FieldContext.Provider>\n );\n}\n\n// ── FieldLabel ─────────────────────────────────────────────────────────────────\n\nconst LABEL_TEXT: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\nexport interface FieldLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n children: ReactNode;\n}\n\nexport function FieldLabel({ children, className, htmlFor, ...rest }: FieldLabelProps) {\n const field = useFieldContext();\n\n return (\n <label\n id={field?.labelId}\n htmlFor={htmlFor ?? field?.controlId}\n data-slot=\"field-label\"\n className={cn(\n LABEL_TEXT[field?.size ?? 'md'],\n field?.disabled ? 'text-disabled' : 'text-default',\n // The required marker is CSS generated content, not a child element. An\n // `<span aria-hidden>*</span>` would be correct for accessible-name computation\n // (which skips aria-hidden) but it still lands in `textContent`, so every\n // `getByLabelText('Name')` — ours and every consumer's — would have to become\n // `/Name/`. Generated content is in neither, and the real signal is\n // `aria-required` on the control regardless.\n field?.required && \"after:ml-0.5 after:text-danger after:content-['*']\",\n className,\n )}\n {...rest}\n >\n {children}\n </label>\n );\n}\n\n// ── FieldDescription / FieldError / FieldHint ──────────────────────────────────\n\nexport interface FieldTextProps extends HTMLAttributes<HTMLParagraphElement> {\n children: ReactNode;\n}\n\n/** Persistent guidance, shown above the control and announced with it. */\nexport function FieldDescription({ children, className, ...rest }: FieldTextProps) {\n const field = useFieldContext();\n return (\n <p\n id={field?.descriptionId}\n data-slot=\"field-description\"\n className={cn(\n LABEL_TEXT[field?.size ?? 'md'],\n field?.disabled ? 'text-disabled' : 'text-default-secondary',\n className,\n )}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\n/**\n * Validation message. `role=\"alert\"` because an error that appears after submit —\n * asynchronously, without focus moving — is otherwise never announced at all.\n */\nexport function FieldError({ children, className, ...rest }: FieldTextProps) {\n const field = useFieldContext();\n return (\n <p\n id={field?.errorId}\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(LABEL_TEXT[field?.size ?? 'md'], 'text-danger', className)}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\n/** Neutral helper text. Suppressed while an error is showing, so the two never stack. */\nexport function FieldHint({ children, className, ...rest }: FieldTextProps) {\n const field = useFieldContext();\n return (\n <p\n id={field?.hintId}\n data-slot=\"field-hint\"\n className={cn(LABEL_TEXT[field?.size ?? 'md'], 'text-default-secondary', className)}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\n// ── Grouping ───────────────────────────────────────────────────────────────────\n\nexport interface FieldGroupProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** Stacks several `Field`s with consistent rhythm. */\nexport function FieldGroup({ children, className, ...rest }: FieldGroupProps) {\n return (\n <div data-slot=\"field-group\" className={cn('flex flex-col gap-4', className)} {...rest}>\n {children}\n </div>\n );\n}\n\nexport interface FieldSetProps extends HTMLAttributes<HTMLFieldSetElement> {\n children: ReactNode;\n}\n\n/**\n * A real `<fieldset>`. Required for radio groups and checkbox groups: the group needs a\n * name of its own, and only `<legend>` gives it one that is announced before each option.\n */\nexport function FieldSet({ children, className, ...rest }: FieldSetProps) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn('flex flex-col gap-3 border-0 p-0', className)}\n {...rest}\n >\n {children}\n </fieldset>\n );\n}\n\nexport interface FieldLegendProps extends HTMLAttributes<HTMLLegendElement> {\n children: ReactNode;\n /** `label` matches a field label's weight; `legend` is the larger section heading. */\n variant?: 'legend' | 'label';\n}\n\nexport function FieldLegend({\n children,\n variant = 'legend',\n className,\n ...rest\n}: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n className={cn(\n 'p-0',\n variant === 'legend'\n ? 'text-body font-semibold text-default'\n : 'text-body-sm text-default',\n className,\n )}\n {...rest}\n >\n {children}\n </legend>\n );\n}\n\nexport interface FieldSeparatorProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport function FieldSeparator({ className, ...rest }: FieldSeparatorProps) {\n return (\n <div\n role=\"separator\"\n data-slot=\"field-separator\"\n className={cn('h-px w-full bg-divider', className)}\n {...rest}\n />\n );\n}\n","import { type ClassValue, clsx } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n/**\n * Every `fontSize` key in `tailwind-preset.cjs`, in the same order.\n *\n * `tailwind-merge` decides whether a `text-*` class is a **font size** or a **text colour**\n * by pattern: it recognises t-shirt sizes (`text-sm`, `text-2xl`) and bare lengths, and files\n * everything else under colour. Every size in this design system is a word — `text-body-sm`,\n * `text-heading`, `text-scale-07` — so without this list twMerge calls them colours, and then\n * drops them when a real colour follows in the same string:\n *\n * cn('text-body-micro text-neutral-tertiary') // → 'text-neutral-tertiary'\n *\n * The size vanishes and the element inherits its parent's. That is not hypothetical: it is\n * why the sidebar's group headings rendered at the 16px body default for two releases while\n * the source said `text-body-tiny`, and why chasing the number in the source never moved it.\n *\n * Keep in sync with the preset — `cn.test.ts` fails if they drift.\n */\nconst FONT_SIZES = [\n 'body-micro',\n 'body-tiny',\n 'body-xs',\n 'body-sm',\n 'body',\n 'body-lg',\n 'heading-sm',\n 'heading',\n 'heading-lg',\n 'subheading-sm',\n 'subheading',\n 'subheading-lg',\n 'subtitle-sm',\n 'subtitle',\n 'subtitle-lg',\n 'title-sm',\n 'title',\n 'title-lg',\n 'title-hero',\n 'scale-01',\n 'scale-02',\n 'scale-03',\n 'scale-04',\n 'scale-05',\n 'scale-06',\n 'scale-07',\n 'scale-08',\n 'scale-09',\n 'scale-10',\n 'scale-12',\n] as const;\n\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [{ text: [...FONT_SIZES] }],\n },\n },\n});\n\n/**\n * `clsx` + `tailwind-merge`, taught this system's type scale.\n *\n * Use this instead of bare `clsx` in any component whose `className` prop is meant to\n * *override* a base utility — the composable `Card*` and `Modal*` parts, and anything\n * else built to be reshaped by its caller.\n *\n * Why it is necessary: `clsx` only concatenates. When two conflicting Tailwind\n * utilities both end up in the attribute, the winner is decided by *stylesheet order*,\n * not attribute order. Tailwind emits `flex-row` before `flex-col` and `gap-3` before\n * `gap-4`, so under plain `clsx`:\n *\n * <CardBody className=\"flex-row gap-3\" /> // base is 'flex flex-col gap-4 p-4'\n *\n * silently stays a column with a 4-unit gap. `twMerge` drops the losing class instead,\n * so the caller's intent wins.\n *\n * Everywhere else in the library `className` is purely additive, and plain `clsx`\n * remains correct — and cheaper. Do not sweep it out of those files.\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { useControlSize } from './control-size';\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldHint,\n FieldLabel,\n useFieldControl,\n} from './field';\n\nexport type InputSize = 'lg' | 'md' | 'sm';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n label?: string;\n description?: string;\n /** Red border + message shown below the input. Also sets `aria-invalid`. */\n error?: string;\n /** Neutral helper text shown below the input (hidden when error is set) */\n hint?: string;\n size?: InputSize;\n leadingIcon?: ReactNode;\n trailingIcon?: ReactNode;\n /** Interactive trailing slot (e.g. a show/hide password button) — unlike\n * `trailingIcon` it receives pointer events. */\n trailingAction?: ReactNode;\n}\n\n// Figma sizes: lg=48px md=36px sm=24px\nconst inputBase: Record<InputSize, string> = {\n lg: 'h-12 px-5 py-3.5 text-body',\n md: 'h-9 px-4 py-2.5 text-body-sm',\n sm: 'h-6 px-3 py-[5px] text-body-tiny',\n};\n\n// Extra left padding to clear the leading icon\n// lg adds 8px for the explicit flex gap Figma uses on large; md/sm have no gap\nconst leadingPad: Record<InputSize, string> = {\n lg: 'pl-12',\n md: 'pl-8',\n sm: 'pl-6',\n};\n\n// Extra right padding to clear the trailing icon\nconst trailingPad: Record<InputSize, string> = {\n lg: 'pr-12',\n md: 'pr-8',\n sm: 'pr-6',\n};\n\n// Icon wrapper: absolutely positioned inside the input container\nconst iconWrap: Record<InputSize, { left: string; right: string; size: string }> = {\n lg: { left: 'left-4', right: 'right-4', size: 'size-5' },\n md: { left: 'left-3', right: 'right-3', size: 'size-4' },\n sm: { left: 'left-2', right: 'right-2', size: 'size-3' },\n};\n\n/**\n * Focus styling note: `focus-visible:` rather than `focus:`, and `ring-2 ring-brand` to\n * match the button family. Through 0.3.0 this used `focus:ring-1 ring-brand-secondary`,\n * which showed a ring on plain mouse clicks and was a third distinct focus treatment in a\n * library that already had two.\n */\nexport const inputControlClasses = (size: InputSize, invalid: boolean, disabled?: boolean) =>\n clsx(\n 'w-full rounded-lg border outline-none transition-colors',\n 'bg-default text-default',\n 'placeholder:text-default-tertiary',\n 'focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n inputBase[size],\n disabled\n ? 'cursor-not-allowed bg-disabled border-disabled text-disabled placeholder:text-disabled'\n : invalid\n ? 'border-danger-secondary focus-visible:border-danger focus-visible:ring-danger'\n : 'border-default focus-visible:border-brand focus-visible:ring-brand',\n // read-only is not disabled: the value still matters and is still selectable, but it\n // must not look editable. Nothing in the library styled this before 0.4.0.\n 'read-only:bg-default-secondary read-only:cursor-default',\n );\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n label,\n description,\n error,\n hint,\n size: sizeProp,\n leadingIcon,\n trailingIcon,\n trailingAction,\n className,\n disabled,\n required,\n id,\n ...props\n },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const hasError = !!error;\n const iw = iconWrap[size];\n\n return (\n <Field\n id={id}\n size={size}\n disabled={disabled}\n required={required}\n hasDescription={!!description}\n hasError={hasError}\n hasHint={!!hint}\n className={className}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <div className=\"relative flex items-center\">\n {leadingIcon && (\n <span\n aria-hidden\n className={clsx(\n 'pointer-events-none absolute',\n iw.left,\n iw.size,\n 'flex items-center justify-center text-icon-default-secondary',\n )}\n >\n {leadingIcon}\n </span>\n )}\n <InputControl\n ref={ref}\n size={size}\n invalid={hasError}\n disabled={disabled}\n required={required}\n className={clsx(\n leadingIcon && leadingPad[size],\n (trailingIcon || trailingAction) && trailingPad[size],\n )}\n {...props}\n />\n {trailingIcon && !trailingAction && (\n <span\n aria-hidden\n className={clsx(\n 'pointer-events-none absolute',\n iw.right,\n iw.size,\n 'flex items-center justify-center text-icon-default-secondary',\n )}\n >\n {trailingIcon}\n </span>\n )}\n {trailingAction && (\n <span\n className={clsx(\n 'absolute',\n iw.right,\n 'flex items-center justify-center text-icon-default-secondary',\n )}\n >\n {trailingAction}\n </span>\n )}\n </div>\n\n {hasError && <FieldError>{error}</FieldError>}\n {!hasError && hint && <FieldHint>{hint}</FieldHint>}\n </Field>\n );\n});\n\n/**\n * The bare `<input>` with the field wiring applied and no label/message chrome — for\n * `InputGroup` and any composition that supplies its own `Field`.\n */\nexport interface InputControlProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n size?: InputSize;\n invalid?: boolean;\n}\n\nexport const InputControl = forwardRef<HTMLInputElement, InputControlProps>(\n function InputControl({ size: sizeProp, invalid = false, className, ...props }, ref) {\n const size = useControlSize(sizeProp);\n const field = useFieldControl();\n const isInvalid = invalid || !!field['aria-invalid'];\n const isDisabled = props.disabled ?? field.disabled;\n\n return (\n <input\n ref={ref}\n // A container's default control size is reported so a test — and a caller reading\n // the DOM — can see which size actually won, rather than inferring it from classes.\n data-size={size}\n // Field wiring first so an explicit prop from the caller still wins.\n {...field}\n className={clsx(inputControlClasses(size, isInvalid, isDisabled), className)}\n {...props}\n />\n );\n },\n);\n","import { forwardRef, type TextareaHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { type InputSize } from './input';\nimport { useControlSize } from './control-size';\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldHint,\n FieldLabel,\n useFieldControl,\n} from './field';\n\nexport interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n label?: string;\n description?: string;\n /** Red border + message shown below the control. Also sets `aria-invalid`. */\n error?: string;\n hint?: string;\n size?: InputSize;\n}\n\n// Figma: large textarea inner height ~80px, medium ~68px, small ~52px\nconst textareaBase: Record<InputSize, string> = {\n lg: 'min-h-20 px-4 py-3.5 text-body',\n md: 'min-h-[68px] px-3 py-2.5 text-body-sm',\n sm: 'min-h-[52px] px-2 py-[5px] text-body-tiny',\n};\n\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { label, description, error, hint, size: sizeProp, className, disabled, required, id, ...props },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const hasError = !!error;\n\n return (\n <Field\n id={id}\n size={size}\n disabled={disabled}\n required={required}\n hasDescription={!!description}\n hasError={hasError}\n hasHint={!!hint}\n className={className}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n {description && <FieldDescription>{description}</FieldDescription>}\n <TextareaControl\n ref={ref}\n size={size}\n invalid={hasError}\n disabled={disabled}\n required={required}\n {...props}\n />\n {hasError && <FieldError>{error}</FieldError>}\n {!hasError && hint && <FieldHint>{hint}</FieldHint>}\n </Field>\n );\n});\n\nexport interface TextareaControlProps\n extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n size?: InputSize;\n invalid?: boolean;\n}\n\n/** The bare `<textarea>` with field wiring, for compositions that supply their own `Field`. */\nexport const TextareaControl = forwardRef<HTMLTextAreaElement, TextareaControlProps>(\n function TextareaControl({ size: sizeProp, invalid = false, className, ...props }, ref) {\n const size = useControlSize(sizeProp);\n const field = useFieldControl();\n const isInvalid = invalid || !!field['aria-invalid'];\n const isDisabled = props.disabled ?? field.disabled;\n\n return (\n <textarea\n ref={ref}\n data-size={size}\n {...field}\n className={clsx(\n 'w-full resize-y rounded-lg border outline-none transition-colors',\n 'bg-default text-default',\n 'placeholder:text-default-tertiary',\n 'focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n textareaBase[size],\n isDisabled\n ? 'cursor-not-allowed resize-none border-disabled bg-disabled text-disabled placeholder:text-disabled'\n : isInvalid\n ? 'border-danger-secondary focus-visible:border-danger focus-visible:ring-danger'\n : 'border-default focus-visible:border-brand focus-visible:ring-brand',\n 'read-only:cursor-default read-only:resize-none read-only:bg-default-secondary',\n className,\n )}\n {...props}\n />\n );\n },\n);\n","import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuCheck, LuChevronDown } from 'react-icons/lu';\n\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\nimport { useFloatingPanel } from '../overlays/floating';\nimport {\n OVERLAY_HEADING,\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE,\n OVERLAY_PANEL,\n OVERLAY_PANEL_SCROLL,\n overlayItemTone,\n} from '../overlays/menu-styles';\nimport { useOverlayDismiss } from '../overlays/overlay';\nimport { Portal } from '../overlays/portal';\nimport { useControlSize } from './control-size';\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldHint,\n FieldLabel,\n useFieldContext,\n useFieldControl,\n} from './field';\nimport { type InputSize } from './input';\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectOptionGroup {\n label: string;\n options: SelectOption[];\n}\n\n/** Trigger geometry. `pr` = chevron right-offset + chevron width, the exact clearance. */\nconst selectBase: Record<InputSize, string> = {\n lg: 'h-12 pl-4 pr-9 text-body', // right-4 (16) + size-5 (20) = 36px\n md: 'h-9 pl-3 pr-7 text-body-sm', // right-3 (12) + size-4 (16) = 28px\n sm: 'h-6 pl-2 pr-5 text-body-tiny', // right-2 (8) + size-3 (12) = 20px\n};\n\nconst chevronPos: Record<InputSize, { right: string; size: string }> = {\n lg: { right: 'right-4', size: 'size-5' },\n md: { right: 'right-3', size: 'size-4' },\n sm: { right: 'right-2', size: 'size-3' },\n};\n\nfunction isGroup(entry: SelectOption | SelectOptionGroup): entry is SelectOptionGroup {\n return 'options' in entry;\n}\n\n/** Options in render order, so a roving index is just a position. */\nfunction flatten(entries: (SelectOption | SelectOptionGroup)[]): SelectOption[] {\n return entries.flatMap((entry) => (isGroup(entry) ? entry.options : [entry]));\n}\n\n// ── SelectControl ──────────────────────────────────────────────────────────────\n\nexport interface SelectControlProps\n extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'value' | 'defaultValue' | 'onChange' | 'children' | 'type'\n > {\n /** Flat options, or groups which render as a labelled `role=\"group\"`. */\n options: (SelectOption | SelectOptionGroup)[];\n value?: string | null;\n defaultValue?: string | null;\n onValueChange?: (value: string) => void;\n /**\n * Submits with a surrounding form, through a hidden input. Note that hidden inputs are\n * exempt from constraint validation, so `required` no longer blocks submit — see the\n * note on `Select`.\n */\n name?: string;\n size?: InputSize;\n invalid?: boolean;\n placeholder?: string;\n}\n\n/**\n * The bare trigger and its listbox, with field wiring and no label/message chrome — for\n * `Select` and any composition that supplies its own `Field`.\n */\nexport const SelectControl = forwardRef<HTMLButtonElement, SelectControlProps>(\n function SelectControl(\n {\n options,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n name,\n size: sizeProp,\n invalid = false,\n placeholder = 'Select…',\n className,\n onKeyDown,\n ...props\n },\n ref,\n ) {\n const size = useControlSize(sizeProp);\n const field = useFieldControl();\n const fieldContext = useFieldContext();\n\n const [value, setValue] = useControllableState<string | null>({\n value: valueProp,\n defaultValue,\n onChange: onValueChange as ((next: string | null) => void) | undefined,\n });\n\n const [open, setOpen] = useState(false);\n\n const baseId = useId();\n const listboxId = `${baseId}-listbox`;\n const valueId = `${baseId}-value`;\n const optionId = (index: number) => `${baseId}-option-${index}`;\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [panelNode, setPanelNode] = useState<HTMLDivElement | null>(null);\n\n // Which end to land on when the panel opens. The trigger handles the key before the\n // panel exists, so the intent has to survive one render.\n const pendingEdge = useRef<'start' | 'end'>('start');\n\n const flat = flatten(options);\n const selected = flat.find((option) => option.value === value) ?? null;\n\n const isInvalid = invalid || !!field['aria-invalid'];\n const isDisabled = props.disabled ?? field.disabled;\n\n /**\n * A roving tabindex, not `aria-activedescendant`.\n *\n * `Combobox` uses activedescendant because focus must stay in its text input — moving\n * it into the list would stop the user typing. A Select has no input, so real DOM\n * focus is available, and it brings three things with it: `useRovingFocus` already\n * implements arrows, Home/End, disabled-skipping, wrap **and typeahead** (which the\n * native `<select>` had and losing would be a regression); the browser scrolls the\n * focused option into view for free; and the options are genuinely focusable, so none\n * of the jsx-a11y suppressions the Combobox listbox needs apply here.\n */\n const roving = useRovingFocus({ orientation: 'vertical', loop: true, typeahead: true });\n\n const { refs, floatingStyles } = useFloatingPanel({\n open,\n onOpenChange: setOpen,\n side: 'bottom',\n align: 'start',\n sideOffset: 4,\n matchAnchorWidth: true,\n });\n\n useEffect(() => {\n refs.setReference(triggerRef.current);\n }, [refs, open]);\n\n useOverlayDismiss({\n onDismiss: () => setOpen(false),\n panelRef,\n active: open,\n // Not modal: the page behind stays readable and interactive. Only Escape,\n // outside-press and focus restore — the same four falses as DropdownMenu.\n trapFocus: false,\n lockScroll: false,\n inertBackground: false,\n // The listbox owns its initial focus below; a \"first tabbable element\" scan would\n // fight the roving tabindex, which exposes exactly one option at a time.\n autoFocus: false,\n });\n\n // Keyed on the panel node rather than on `open`: Portal gates its children behind a\n // mounted flag, so on the render where the panel opens the options do not exist yet.\n const wasOpen = useRef(false);\n useEffect(() => {\n if (open && panelNode && !wasOpen.current) {\n const index = selected ? flat.indexOf(selected) : -1;\n // Open onto the current selection when there is one — the native select did, and\n // it is the difference between \"resume\" and \"start over\" on a long list.\n if (index >= 0 && pendingEdge.current === 'start') roving.focusIndex(index);\n else roving.moveToEdge(pendingEdge.current);\n pendingEdge.current = 'start';\n wasOpen.current = true;\n }\n if (!open) wasOpen.current = false;\n // `flat`/`selected` are recomputed every render; including them would re-run this on\n // every keystroke and fight the roving focus it just set.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, panelNode, roving]);\n\n const commit = (option: SelectOption) => {\n if (option.disabled) return;\n setValue(option.value);\n setOpen(false);\n };\n\n const triggerKeyDown = (event: ReactKeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || open) return;\n // Arrows open onto the near or far end, per the APG. Enter and Space arrive as a\n // click on a native button, so `onClick` already covers them.\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n pendingEdge.current = event.key === 'ArrowUp' ? 'end' : 'start';\n setOpen(true);\n }\n };\n\n let cursor = 0;\n\n const renderOption = (option: SelectOption, index: number) => {\n const isSelected = option.value === value;\n const itemProps = roving.itemProps(index, {\n disabled: option.disabled,\n label: option.label,\n });\n\n return (\n <div\n key={option.value}\n // `role=\"option\"` on a div rather than a <button>: the roving tabindex owns\n // focusability, and a native button would re-enter the tab sequence.\n role=\"option\"\n id={optionId(index)}\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n {...itemProps}\n // Restated after the spread so jsx-a11y can see it — it cannot follow a\n // tabIndex that arrives through an object spread.\n tabIndex={itemProps.tabIndex}\n onClick={() => commit(option)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n commit(option);\n }\n }}\n className={clsx(\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE[size],\n 'items-center',\n overlayItemTone('default', !!option.disabled),\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{option.label}</span>\n {isSelected && (\n <LuCheck className=\"size-3.5 shrink-0\" strokeWidth={3} aria-hidden />\n )}\n </div>\n );\n };\n\n const cp = chevronPos[size];\n\n return (\n <>\n <div className=\"relative flex items-center\">\n <button\n ref={composeRefs<HTMLButtonElement>(triggerRef, ref)}\n type=\"button\"\n /**\n * `role=\"combobox\"`, matching Radix Select. It is the role that permits\n * `aria-expanded`, `aria-controls`, `aria-required` and `aria-invalid` — all\n * of which `Field` supplies and none of which a plain `role=\"button\"` accepts.\n * `aria-activedescendant` is optional on a combobox and deliberately absent:\n * real focus moves into the listbox instead.\n */\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? listboxId : undefined}\n // A <button> is named by its contents, so a `<label for>` association does not\n // name it the way it named the old <select>. Point at the label explicitly and\n // let the value follow it: \"Role Analyst\". The second id targets the value span\n // rather than the button itself — a self-reference is legal per spec but several\n // name-computation implementations decline to resolve it.\n aria-labelledby={fieldContext ? `${fieldContext.labelId} ${valueId}` : undefined}\n data-size={size}\n {...field}\n disabled={isDisabled}\n onClick={() => setOpen(!open)}\n onKeyDown={triggerKeyDown}\n className={clsx(\n 'w-full appearance-none rounded-lg border text-left outline-none transition-colors',\n 'bg-default text-default',\n 'focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n selectBase[size],\n isDisabled\n ? 'cursor-not-allowed border-disabled bg-disabled text-disabled'\n : isInvalid\n ? 'border-danger-secondary focus-visible:border-danger focus-visible:ring-danger'\n : 'border-default focus-visible:border-brand focus-visible:ring-brand',\n className,\n )}\n {...props}\n >\n <span\n id={valueId}\n className={clsx('block truncate', !selected && 'text-default-tertiary')}\n >\n {selected?.label ?? placeholder}\n </span>\n </button>\n\n <span\n aria-hidden\n className={clsx(\n 'pointer-events-none absolute',\n cp.right,\n cp.size,\n 'flex items-center justify-center',\n isDisabled ? 'text-icon-disabled' : 'text-icon-default-secondary',\n )}\n >\n <LuChevronDown className=\"size-full\" />\n </span>\n\n {/* Form participation. Not an `sr-only <select>`: that would duplicate every\n option into the accessibility tree, and a real <select> reaching focus would\n reopen the OS picker this component exists to replace. */}\n {name && <input type=\"hidden\" name={name} value={value ?? ''} />}\n </div>\n\n {open && (\n <Portal>\n <div\n ref={composeRefs<HTMLDivElement>(panelRef, setPanelNode, refs.setFloating)}\n id={listboxId}\n role=\"listbox\"\n // Focusable but out of the tab sequence: the fallback target for an empty\n // list, and it keeps key events on the panel.\n tabIndex={-1}\n aria-orientation=\"vertical\"\n aria-labelledby={fieldContext?.labelId}\n aria-required={field['aria-required']}\n aria-invalid={field['aria-invalid']}\n style={{ ...floatingStyles, width: 'var(--panel-anchor-width)' }}\n className={clsx('z-dropdown', OVERLAY_PANEL, OVERLAY_PANEL_SCROLL)}\n {...roving.containerProps}\n onKeyDown={(event) => {\n roving.containerProps.onKeyDown(event);\n // Tab leaves the control rather than walking the list, so close first and\n // let the browser move on from the trigger. No commit: arrowing to an\n // option is browsing, and only Enter, Space or a click chooses it.\n if (event.key === 'Tab') setOpen(false);\n }}\n >\n {options.map((entry, entryIndex) => {\n if (!isGroup(entry)) return renderOption(entry, cursor++);\n\n const headingId = `${baseId}-group-${entryIndex}`;\n return (\n <div key={`group-${entryIndex}`} role=\"group\" aria-labelledby={headingId}>\n <div id={headingId} className={OVERLAY_HEADING}>\n {entry.label}\n </div>\n {entry.options.map((option) => renderOption(option, cursor++))}\n </div>\n );\n })}\n </div>\n </Portal>\n )}\n </>\n );\n },\n);\n\n// ── Select ─────────────────────────────────────────────────────────────────────\n\nexport interface SelectProps extends SelectControlProps {\n label?: string;\n description?: string;\n /** Red border + message shown below the control. Also sets `aria-invalid`. */\n error?: string;\n hint?: string;\n required?: boolean;\n}\n\n/**\n * Single-select dropdown: a trigger and a portalled listbox.\n *\n * Through 0.4.0 this wrapped a native `<select>`, which was the right call for its keyboard\n * contract and the wrong one for everything visual: the option popup is drawn by the OS and\n * cannot be styled at all, so a Select never matched the `DropdownMenu` and `Combobox`\n * panels sitting beside it on the same filter row. It is now the same panel as those, and\n * the keyboard contract it used to inherit is implemented rather than borrowed — arrows,\n * Home/End, typeahead, Escape, and Tab that leaves without committing.\n *\n * Two consequences of dropping the native element, neither papered over:\n *\n * - **No OS picker on mobile.** The wheel/sheet a native select opens is gone.\n * - **`required` no longer blocks submit.** The value posts through a hidden input, and\n * hidden inputs are exempt from constraint validation. `required` remains semantic and\n * visual — `aria-required` on the control and the `*` on its label — which is already\n * true of `Combobox`, `RadioGroup` and `MultiSelectCard`. In react-hook-form, register\n * it with `Controller` rather than `register`.\n *\n * For a list long enough to need filtering, use `Combobox`.\n */\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n label,\n description,\n error,\n hint,\n size: sizeProp,\n className,\n disabled,\n required,\n id,\n ...props\n },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const hasError = !!error;\n\n return (\n <Field\n id={id}\n size={size}\n disabled={disabled}\n required={required}\n hasDescription={!!description}\n hasError={hasError}\n hasHint={!!hint}\n className={className}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n {description && <FieldDescription>{description}</FieldDescription>}\n\n <SelectControl ref={ref} size={size} invalid={hasError} disabled={disabled} {...props} />\n\n {hasError && <FieldError>{error}</FieldError>}\n {!hasError && hint && <FieldHint>{hint}</FieldHint>}\n </Field>\n );\n});\n","import { useCallback, useRef, useState } from 'react';\n\nexport interface UseControllableStateOptions<T> {\n /** The controlled value. Passing anything other than `undefined` takes control. */\n value?: T;\n /** Initial value when uncontrolled. */\n defaultValue: T;\n /** Fired on every change, controlled or not. */\n onChange?: (value: T) => void;\n}\n\n/**\n * One state value that works controlled or uncontrolled, the way every Radix and\n * shadcn/ui control does.\n *\n * Before 0.4.0 nothing in this library supported an uncontrolled mode — `Checkbox`,\n * `Toggle`, `Tabs`, `SegmentedControl`, `ButtonGroup` and `MultiSelectCard` all *required*\n * a value plus a change handler, so the simplest possible use site still needed a\n * `useState` in the consumer. `DropdownMenu` had the opposite problem: its open state was\n * entirely internal, so a caller could neither open it programmatically nor observe it.\n *\n * Control is decided per render by whether `value` is `undefined`. A component that\n * starts controlled and later passes `undefined` will fall back to its internal value —\n * the same caveat React itself has with inputs, and for the same reason.\n */\nexport function useControllableState<T>({\n value,\n defaultValue,\n onChange,\n}: UseControllableStateOptions<T>): [T, (next: T | ((prev: T) => T)) => void] {\n const [internal, setInternal] = useState<T>(defaultValue);\n\n const isControlled = value !== undefined;\n const current = isControlled ? value : internal;\n\n // Kept in a ref so `setValue` stays referentially stable across renders. Without this\n // every consumer that puts it in a dependency array re-subscribes on each render.\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const currentRef = useRef(current);\n currentRef.current = current;\n\n const isControlledRef = useRef(isControlled);\n isControlledRef.current = isControlled;\n\n const setValue = useCallback((next: T | ((prev: T) => T)) => {\n const resolved =\n typeof next === 'function' ? (next as (prev: T) => T)(currentRef.current) : next;\n\n if (resolved === currentRef.current) return;\n\n // A controlled component must not move its own value — the parent owns it and will\n // pass the new one back down. Only the notification goes out.\n if (!isControlledRef.current) setInternal(resolved);\n onChangeRef.current?.(resolved);\n }, []);\n\n return [current, setValue];\n}\n","import { useCallback, useEffect, useRef, useState, type KeyboardEvent } from 'react';\n\nexport type RovingOrientation = 'horizontal' | 'vertical' | 'both';\n\nexport interface UseRovingFocusOptions {\n /** Which arrow keys move focus. `both` accepts all four. Default `horizontal`. */\n orientation?: RovingOrientation;\n /** Wrap past the ends. Default `true`. */\n loop?: boolean;\n /** Jump to an item by typing the start of its label. Default `false`. */\n typeahead?: boolean;\n /** Item to start on. Default `0`. */\n defaultIndex?: number;\n /** Fired when the composite is exited with Escape — menus use it to close. */\n onEscape?: () => void;\n}\n\nexport interface RovingItemOptions {\n disabled?: boolean;\n /** Typeahead match target. Only read when `typeahead` is on. */\n label?: string;\n}\n\nexport interface RovingItemProps {\n ref: (node: HTMLElement | null) => void;\n tabIndex: 0 | -1;\n onFocus: () => void;\n 'data-roving-index': number;\n}\n\n/**\n * Arrow-key navigation with a roving tabindex, for any composite widget that owns a\n * single-stop tab sequence: `menu`, `tablist`, `listbox`, `radiogroup`, `toolbar`.\n *\n * Before 0.4.0 this library had **no arrow-key handling anywhere** — `ArrowDown`,\n * `Home` and `End` appeared in no file. `Tabs`, `DropdownMenu`, `ButtonGroup`,\n * `SegmentedControl` and `RoleComboBox` all announced a composite role to assistive tech\n * while behaving like a plain row of buttons: every item natively tabbable, arrows inert.\n * That is worse than shipping no role at all, because a screen reader tells the user\n * \"tab 3 of 5\" and then the keys it implies do nothing.\n *\n * Keyboard handling lives on the container and is delegated, rather than being attached\n * per item — one listener, and the item list can change length without re-binding.\n *\n * const roving = useRovingFocus({ orientation: 'vertical', loop: true, typeahead: true });\n *\n * <div role=\"menu\" {...roving.containerProps}>\n * {items.map((item, i) => (\n * <button\n * key={item.id}\n * role=\"menuitem\"\n * {...roving.itemProps(i, { disabled: item.disabled, label: item.label })}\n * />\n * ))}\n * </div>\n */\nexport function useRovingFocus({\n orientation = 'horizontal',\n loop = true,\n typeahead = false,\n defaultIndex = 0,\n onEscape,\n}: UseRovingFocusOptions = {}) {\n const [activeIndex, setActiveIndex] = useState(defaultIndex);\n\n const items = useRef<(HTMLElement | null)[]>([]);\n const meta = useRef<RovingItemOptions[]>([]);\n\n const search = useRef('');\n const searchTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (searchTimer.current) clearTimeout(searchTimer.current);\n },\n [],\n );\n\n const focusIndex = useCallback((index: number) => {\n const node = items.current[index];\n if (!node) return;\n setActiveIndex(index);\n node.focus();\n }, []);\n\n /** Walk from `start` in `step` until a registered, enabled item turns up. */\n const move = useCallback(\n (start: number, step: number) => {\n const total = items.current.length;\n if (total === 0) return;\n\n for (let i = 1; i <= total; i++) {\n let next = start + step * i;\n if (loop) {\n next = ((next % total) + total) % total;\n } else if (next < 0 || next >= total) {\n return;\n }\n if (items.current[next] && !meta.current[next]?.disabled) {\n focusIndex(next);\n return;\n }\n }\n },\n [loop, focusIndex],\n );\n\n const moveToEdge = useCallback(\n (from: 'start' | 'end') => {\n const total = items.current.length;\n if (total === 0) return;\n // Start just outside the range so `move` lands on the first enabled item inward.\n move(from === 'start' ? -1 : total, from === 'start' ? 1 : -1);\n },\n [move],\n );\n\n const runTypeahead = useCallback(\n (char: string) => {\n if (searchTimer.current) clearTimeout(searchTimer.current);\n search.current += char.toLowerCase();\n searchTimer.current = setTimeout(() => {\n search.current = '';\n }, 500);\n\n const total = items.current.length;\n const query = search.current;\n\n // Search forward from the item after the active one so repeated presses of the\n // same letter cycle through the matches instead of sticking on the first.\n for (let i = 1; i <= total; i++) {\n const index = (activeIndex + i) % total;\n if (meta.current[index]?.disabled) continue;\n const label = meta.current[index]?.label?.toLowerCase();\n if (label?.startsWith(query)) {\n focusIndex(index);\n return;\n }\n }\n },\n [activeIndex, focusIndex],\n );\n\n const onKeyDown = useCallback(\n (event: KeyboardEvent<HTMLElement>) => {\n const { key } = event;\n const vertical = orientation === 'vertical' || orientation === 'both';\n const horizontal = orientation === 'horizontal' || orientation === 'both';\n\n const next =\n (vertical && key === 'ArrowDown') || (horizontal && key === 'ArrowRight');\n const prev = (vertical && key === 'ArrowUp') || (horizontal && key === 'ArrowLeft');\n\n if (next || prev) {\n event.preventDefault();\n move(activeIndex, next ? 1 : -1);\n return;\n }\n\n if (key === 'Home') {\n event.preventDefault();\n moveToEdge('start');\n return;\n }\n\n if (key === 'End') {\n event.preventDefault();\n moveToEdge('end');\n return;\n }\n\n if (key === 'Escape' && onEscape) {\n onEscape();\n return;\n }\n\n // Single printable character, no modifier — a typeahead jump, not a shortcut.\n if (\n typeahead &&\n key.length === 1 &&\n key !== ' ' &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey\n ) {\n event.preventDefault();\n runTypeahead(key);\n }\n },\n [orientation, activeIndex, move, moveToEdge, onEscape, typeahead, runTypeahead],\n );\n\n const itemProps = useCallback(\n (index: number, options: RovingItemOptions = {}): RovingItemProps => {\n meta.current[index] = options;\n return {\n ref: (node: HTMLElement | null) => {\n items.current[index] = node;\n },\n // The roving part: exactly one item is in the tab sequence, so Tab enters the\n // composite once and Tab again leaves it.\n tabIndex: index === activeIndex ? 0 : -1,\n onFocus: () => setActiveIndex(index),\n 'data-roving-index': index,\n };\n },\n [activeIndex],\n );\n\n return {\n activeIndex,\n setActiveIndex,\n focusIndex,\n moveToEdge,\n itemProps,\n containerProps: { onKeyDown },\n };\n}\n","import { useRef } from 'react';\nimport {\n arrow,\n autoUpdate,\n flip,\n offset,\n shift,\n size,\n useFloating,\n type Middleware,\n type Placement,\n} from '@floating-ui/react';\n\nexport type FloatingSide = 'top' | 'right' | 'bottom' | 'left';\nexport type FloatingAlign = 'start' | 'center' | 'end';\n\nexport interface UseFloatingPanelOptions {\n open: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Preferred edge of the trigger to sit on. Flips when there is no room. Default `bottom`. */\n side?: FloatingSide;\n /** Alignment along that edge. Default `center`. */\n align?: FloatingAlign;\n /** Gap between trigger and panel, in px. Default `6`. */\n sideOffset?: number;\n /** Nudge along the alignment axis, in px. Default `0`. */\n alignOffset?: number;\n /** Minimum gap to keep from the viewport edge, in px. Default `8`. */\n collisionPadding?: number;\n /** Render an arrow and position it. Default `false`. */\n withArrow?: boolean;\n /**\n * Constrain the panel to the space available and expose the trigger's width as\n * `--panel-anchor-width`, so a listbox can match its input. Default `false`.\n */\n matchAnchorWidth?: boolean;\n}\n\n/**\n * The one floating-panel configuration, shared by every popover-shaped component —\n * `DropdownMenu`, `Tooltip`, `Popover`, `HoverCard`, `ContextMenu`, `Combobox`, `Select`.\n *\n * Everything here is behaviour the hand-rolled version had none of. Panels were plain\n * `absolute top-full` with a static `left-0`/`right-0`, so there was no flipping when a\n * panel ran off the bottom of the viewport, no shifting when it ran off the side, no\n * repositioning on scroll or resize (nothing listened for either), and no way to ask for\n * anything other than \"below, aligned left or right\".\n *\n * `side`/`align` is the shadcn/Radix vocabulary rather than Floating UI's single\n * `placement` string, because it keeps the two axes independent at the call site and\n * `align=\"center\"` does not have to be spelled as an empty suffix.\n */\nexport function useFloatingPanel({\n open,\n onOpenChange,\n side = 'bottom',\n align = 'center',\n sideOffset = 6,\n alignOffset = 0,\n collisionPadding = 8,\n withArrow = false,\n matchAnchorWidth = false,\n}: UseFloatingPanelOptions) {\n const arrowRef = useRef<HTMLElement | null>(null);\n\n const placement: Placement = (align === 'center' ? side : `${side}-${align}`) as Placement;\n\n const floating = useFloating({\n open,\n onOpenChange,\n placement,\n // Only track while the panel is actually on screen. `autoUpdate` attaches scroll and\n // resize listeners plus a ResizeObserver, so leaving it running on a closed panel\n // would cost every consumer a listener per menu on the page.\n whileElementsMounted: autoUpdate,\n middleware: [\n offset({ mainAxis: sideOffset, crossAxis: alignOffset }),\n // `flip` before `shift`: try the opposite edge first, and only slide along the\n // current one if neither edge fits. The reverse order produces panels that cling to\n // the viewport edge when they had room to simply flip.\n flip({ padding: collisionPadding }),\n shift({ padding: collisionPadding }),\n matchAnchorWidth &&\n size({\n padding: collisionPadding,\n apply({ rects, elements, availableHeight }) {\n elements.floating.style.setProperty(\n '--panel-anchor-width',\n `${rects.reference.width}px`,\n );\n elements.floating.style.setProperty(\n '--panel-available-height',\n `${availableHeight}px`,\n );\n },\n }),\n withArrow && arrow({ element: arrowRef, padding: 4 }),\n ].filter(Boolean) as Middleware[],\n });\n\n return { ...floating, arrowRef };\n}\n","import clsx from 'clsx';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\nimport type { InputSize } from '../forms/input';\n\n/**\n * The one option-list look, shared by every component that pops a panel of choices:\n * `DropdownMenu`, `ContextMenu`, `Menubar`, `Combobox`, `Command` and `Select`.\n *\n * Before this existed the four implementations had drifted: menus used `py-1` panels with\n * full-bleed square `px-3` items, while `Combobox` and `Command` used `p-1` panels with\n * inset `rounded-md px-2.5` ones. Menus moved, not the other two — a rounded highlight\n * needs the panel's own inset padding or its corners collide with the panel border on the\n * first and last item, and the inset form was already 2 of the 3 sites and the 2 newest.\n *\n * Strings, not components, and deliberately in its own module: `forms/` consumes these,\n * and importing `menu-core` from there would pull the whole menu component tree into the\n * bundle graph — tsup runs with no code splitting.\n */\n\n// ── Panel ──────────────────────────────────────────────────────────────────────\n\nexport const OVERLAY_PANEL = 'rounded-lg border border-default bg-default p-1 shadow-300';\n\n/** Menus need a floor width; anchored lists take their width from the trigger. */\nexport const OVERLAY_PANEL_MENU = clsx(OVERLAY_PANEL, 'min-w-[168px]');\n\n/**\n * Scroll cap for an anchored list. Prefers the collision-aware height `useFloatingPanel`\n * writes to `--panel-available-height` when `matchAnchorWidth` is set, falling back to\n * 16rem so the class is safe on a panel that never measured.\n */\nexport const OVERLAY_PANEL_SCROLL = clsx(\n 'max-h-[min(16rem,var(--panel-available-height,16rem))] overflow-y-auto',\n // A floating panel is already its own scroll container and keeps focus on the input or a\n // roving option, so it needs the scrollbar styling but not `ScrollArea`'s tab stop.\n SCROLLBAR_CLASSES,\n);\n\n// ── Item ───────────────────────────────────────────────────────────────────────\n\n/**\n * Carries no padding and no text size — those live in `OVERLAY_ITEM_SIZE`.\n *\n * `clsx` only concatenates, so a base carrying `px-3` beside a size carrying `px-2.5`\n * would resolve by stylesheet order rather than attribute order. Keeping each utility in\n * exactly one of the two strings makes the composition order-independent.\n */\nexport const OVERLAY_ITEM_BASE =\n 'flex w-full cursor-pointer select-none items-start gap-2 rounded-md text-left outline-none transition-colors';\n\nexport const OVERLAY_ITEM_SIZE: Record<InputSize, string> = {\n lg: 'px-3 py-2.5 text-body',\n md: 'px-2.5 py-2 text-body-sm',\n sm: 'px-2 py-1.5 text-body-tiny',\n};\n\nexport type OverlayItemTone = 'default' | 'danger';\n\n/** Hover and keyboard focus share one background — there is no separate active token. */\nexport function overlayItemTone(tone: OverlayItemTone, disabled: boolean) {\n if (disabled) return 'cursor-not-allowed text-disabled';\n return tone === 'danger'\n ? 'text-danger hover:bg-danger-tertiary focus:bg-danger-tertiary'\n : 'text-default hover:bg-default-secondary focus:bg-default-secondary';\n}\n\n/** Highlight driven by state rather than `:hover` — for lists using aria-activedescendant. */\nexport const OVERLAY_ITEM_ACTIVE = 'bg-default-secondary';\n\n// ── Group heading and separator ────────────────────────────────────────────────\n\nexport const OVERLAY_HEADING =\n 'px-2.5 py-1.5 text-body-tiny font-semibold uppercase tracking-wide text-default-tertiary';\n\n/** `-mx-1` cancels the panel's `p-1` so the rule still spans edge to edge. */\nexport const OVERLAY_SEPARATOR = '-mx-1 my-1 h-px bg-divider';\n","import clsx from 'clsx';\n\n/**\n * Styled native scrollbars, for the components that must own their own overflow and so\n * cannot delegate to `ScrollArea`.\n *\n * Two kinds qualify. A table wrapper, a tab strip or a stepper, where inserting another\n * element would break the layout or the `<table>` element relationship; and a floating panel\n * that is already its own scroll container. Both hold focusable children, so a keyboard user\n * can already reach and scroll them — which is the one thing `ScrollArea` adds beyond these\n * classes, and the one thing they do not need.\n *\n * Prefer `ScrollArea` for a scrolling *region* of content. Reach for this only when a wrapper\n * element is not an option, and say why at the call site.\n *\n * A plain string module rather than an export from `scroll-area.tsx`: `menu-styles.ts` needs\n * it, and importing a component module from a style module would pull the component into the\n * bundle graph for the sake of a class list.\n */\nexport const SCROLLBAR_CLASSES = clsx(\n // Firefox and the standard property.\n '[scrollbar-color:var(--color-background-default-tertiary)_transparent] [scrollbar-width:thin]',\n // WebKit/Blink.\n '[&::-webkit-scrollbar]:size-2',\n '[&::-webkit-scrollbar-track]:bg-transparent',\n '[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-default-tertiary',\n '[&::-webkit-scrollbar-thumb:hover]:bg-neutral-secondary',\n '[&::-webkit-scrollbar-corner]:bg-transparent',\n);\n","import { useEffect, useRef, type RefObject } from 'react';\nimport { tabbable } from 'tabbable';\nimport { useOverlayLayer } from './overlay-stack';\n\n/** The one scrim for every overlay primitive.\n *\n * Modal and Drawer both reference this constant, so there is a single place to change\n * the dimming behind a dialog. Backed by `--color-background-utilities-overlay`. */\nexport const OVERLAY_SCRIM = 'bg-overlay';\n\nexport interface UseOverlayDismissOptions {\n /** Called when the overlay should close. */\n onDismiss: () => void;\n /** The panel element — not the scrim. */\n panelRef: RefObject<HTMLElement | null>;\n /** Set `false` to suspend every behaviour without unmounting. Default `true`. */\n active?: boolean;\n /** Default `true`. */\n closeOnEscape?: boolean;\n /** Default `true`. */\n closeOnOutsidePress?: boolean;\n /** Keep Tab inside the panel. Default `true`. Turn off for non-modal surfaces. */\n trapFocus?: boolean;\n /** Default `true`. */\n lockScroll?: boolean;\n /** Mark sibling content `inert`. Default `true`. */\n inertBackground?: boolean;\n /**\n * Move focus into the panel on mount. Default `true`.\n *\n * Set `false` when the overlay manages its own entry point — a menu with a roving\n * tabindex exposes exactly one focusable item at a time, so a generic\n * \"focus the first tabbable element\" scan would fight it.\n */\n autoFocus?: boolean;\n /** Focus this instead of the first tabbable element. */\n initialFocus?: RefObject<HTMLElement | null>;\n /**\n * Restore focus here instead of wherever it was when the overlay opened.\n *\n * Passing the ref at all takes over the restore: a `current` of `null` means \"leave\n * focus alone\", not \"fall back to the previously focused element\". `Menubar` depends on\n * that — while it is switching from one menu to a sibling, focus already belongs to the\n * sibling and pulling it back to the closing menu's trigger reopens the menu.\n */\n returnFocus?: RefObject<HTMLElement | null>;\n /** Call `preventDefault()` to veto the close — e.g. a form with unsaved input. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /** Call `preventDefault()` to veto the close. */\n onInteractOutside?: (event: PointerEvent) => void;\n}\n\n/** Esc-to-close, a Tab focus trap, scroll lock, an inert background, and focus restore\n * for a mounted overlay. Pass the ref of the panel element (not the scrim).\n *\n * Rewritten in 0.4.0. The previous version handled Esc, Tab and focus restore, and had\n * the following defects — each is now covered by a test:\n *\n * - **One Escape closed every open overlay.** Each overlay put its own listener on\n * `document` and called `stopPropagation`, which stops propagation to other *nodes*,\n * not to sibling listeners on the same node. Dismissal is now gated on `isTopmost`\n * from the shared layer stack.\n * - **A text-selection drag dismissed the dialog.** Outside-press used `click`, whose\n * target for a drag is the nearest common ancestor — the scrim. Now `pointerdown`.\n * - **Forward Tab could walk out of the panel.** The trap only compared against the\n * last tabbable element; once focus was outside by any other route, Tab roamed the\n * background freely. A `focusin` guard now pulls focus back.\n * - **Fixed-position elements were excluded from the trap.** The visibility filter was\n * `offsetParent !== null`, which is `null` for `position: fixed`. Element collection\n * is delegated to `tabbable`, which also honours real tab order (a positive\n * `tabindex` reorders the sequence, so DOM order was the wrong answer), `inert`,\n * `[aria-disabled]`, `contenteditable`, `<summary>`, media with controls, and\n * descendants of a disabled `<fieldset>`.\n * - **Initial focus was a silent no-op for a content-only dialog.** It fell back to\n * focusing the panel, which does nothing without `tabIndex=\"-1\"`. The hook now sets\n * that itself, and retries once content arrives asynchronously.\n * - **Focus restore could land on a detached node**, resetting focus to `<body>`.\n * Now checked with `isConnected`.\n * - No opt-out existed for either dismissal route. Both are now vetoable.\n */\nexport function useOverlayDismiss({\n onDismiss,\n panelRef,\n active = true,\n closeOnEscape = true,\n closeOnOutsidePress = true,\n trapFocus = true,\n lockScroll = true,\n inertBackground = true,\n autoFocus = true,\n initialFocus,\n returnFocus,\n onEscapeKeyDown,\n onInteractOutside,\n}: UseOverlayDismissOptions): void {\n const { isTopmost } = useOverlayLayer(active, {\n lockScroll,\n inertBackground,\n panelRef,\n });\n\n // Read through refs so the listener effects do not re-subscribe on every render of a\n // consumer that passes inline callbacks — which is all of them.\n const handlers = useRef({ onDismiss, onEscapeKeyDown, onInteractOutside });\n handlers.current = { onDismiss, onEscapeKeyDown, onInteractOutside };\n\n const isTopmostRef = useRef(isTopmost);\n isTopmostRef.current = isTopmost;\n\n // ── Escape ───────────────────────────────────────────────────────────────────\n useEffect(() => {\n if (!active || !closeOnEscape) return;\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Escape') return;\n if (!isTopmostRef.current) return;\n\n handlers.current.onEscapeKeyDown?.(event);\n if (event.defaultPrevented) return;\n\n handlers.current.onDismiss();\n }\n\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [active, closeOnEscape]);\n\n // ── Outside press ────────────────────────────────────────────────────────────\n useEffect(() => {\n if (!active || !closeOnOutsidePress) return;\n\n function onPointerDown(event: PointerEvent) {\n if (!isTopmostRef.current) return;\n const panel = panelRef.current;\n if (!panel || panel.contains(event.target as Node)) return;\n\n handlers.current.onInteractOutside?.(event);\n if (event.defaultPrevented) return;\n\n handlers.current.onDismiss();\n }\n\n document.addEventListener('pointerdown', onPointerDown);\n return () => document.removeEventListener('pointerdown', onPointerDown);\n }, [active, closeOnOutsidePress, panelRef]);\n\n // ── Focus trap ───────────────────────────────────────────────────────────────\n useEffect(() => {\n if (!active || !trapFocus) return;\n\n function onKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Tab' || !isTopmostRef.current) return;\n const panel = panelRef.current;\n if (!panel) return;\n\n const items = tabbable(panel);\n if (items.length === 0) {\n // Nothing to cycle between, but Tab must still not escape the dialog.\n event.preventDefault();\n panel.focus({ preventScroll: true });\n return;\n }\n\n const first = items[0];\n const last = items[items.length - 1];\n const activeElement = document.activeElement;\n const inside = panel.contains(activeElement);\n\n if (event.shiftKey && (activeElement === first || !inside)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && (activeElement === last || !inside)) {\n event.preventDefault();\n first.focus();\n }\n }\n\n // The keydown boundary check above only catches the moment focus is *about* to leave.\n // Focus can also arrive outside by a route Tab never sees — a click on the scrim, a\n // programmatic `.focus()`, or a round trip through the browser chrome. This pulls it\n // back whenever that happens.\n function onFocusIn(event: FocusEvent) {\n if (!isTopmostRef.current) return;\n const panel = panelRef.current;\n if (!panel) return;\n if (panel.contains(event.target as Node)) return;\n\n const items = tabbable(panel);\n (items[0] ?? panel).focus({ preventScroll: true });\n }\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('focusin', onFocusIn);\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('focusin', onFocusIn);\n };\n }, [active, trapFocus, panelRef]);\n\n // ── Initial focus and restore ────────────────────────────────────────────────\n useEffect(() => {\n if (!active) return;\n\n const previouslyFocused = document.activeElement as HTMLElement | null;\n const panel = panelRef.current;\n let observer: MutationObserver | null = null;\n\n if (panel && autoFocus) {\n // A content-only dialog has nothing tabbable, and `focus()` on an element without\n // a tabindex silently does nothing. Making the panel itself focusable is what turns\n // the fallback below into a real focus move.\n if (!panel.hasAttribute('tabindex')) panel.setAttribute('tabindex', '-1');\n\n const focusTarget = () => {\n const explicit = initialFocus?.current;\n if (explicit) {\n explicit.focus({ preventScroll: true });\n return true;\n }\n const items = tabbable(panel);\n if (items.length > 0) {\n items[0].focus({ preventScroll: true });\n return true;\n }\n return false;\n };\n\n if (!focusTarget()) {\n panel.focus({ preventScroll: true });\n\n // Panel content can arrive after mount — a fetch, a Suspense boundary. Watch for\n // the first tabbable element and move focus onto it once, then stop.\n observer = new MutationObserver(() => {\n if (focusTarget()) {\n observer?.disconnect();\n observer = null;\n }\n });\n observer.observe(panel, { childList: true, subtree: true });\n }\n }\n\n return () => {\n observer?.disconnect();\n // Reading `returnFocus.current` at cleanup time is the intent, not an oversight:\n // the element to return focus to may not exist when the overlay mounts, and the\n // caller may repoint it while the overlay is open.\n //\n // A caller that passes the ref owns the decision outright, `null` included — `??`\n // here instead of the ternary made `{ current: null }` mean \"restore to whatever\n // was focused before\", the exact opposite of what the one caller passing it wanted.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const target = returnFocus ? returnFocus.current : previouslyFocused;\n // A detached node's `focus()` is a silent no-op that leaves focus on <body>, which\n // strands keyboard users at the top of the page. Better to leave focus where the\n // browser put it than to pretend.\n if (target?.isConnected) target.focus({ preventScroll: true });\n };\n }, [active, panelRef, initialFocus, returnFocus, autoFocus]);\n}\n","import { useEffect, useRef, useState, type RefObject } from 'react';\n\n/**\n * A process-wide stack of the overlays currently mounted, plus the two document-level\n * side effects that belong to \"there is a dialog open\": scroll lock and an inert\n * background.\n *\n * Why a stack rather than per-overlay listeners. Before 0.4.0 every overlay attached its\n * own `keydown` handler to `document`. `useOverlayDismiss` called `e.stopPropagation()`\n * on Escape, which stops propagation *to other nodes* — it does not stop the other\n * listeners already registered on the same node. All of them were on `document`. So a\n * `DropdownMenu` open inside a `Modal` closed both on one Escape, and two stacked modals\n * closed together. Ordering has to be decided centrally, by asking \"am I topmost?\",\n * which is what this module answers.\n */\n\ntype Layer = { id: symbol };\n\nconst layers: Layer[] = [];\nconst listeners = new Set<() => void>();\n\nfunction notify() {\n for (const listener of listeners) listener();\n}\n\nfunction topmost(): symbol | undefined {\n return layers[layers.length - 1]?.id;\n}\n\n// ── Scroll lock ────────────────────────────────────────────────────────────────\n\nlet scrollLocks = 0;\nlet restoreBody: (() => void) | null = null;\n\nfunction lockScroll() {\n scrollLocks += 1;\n if (scrollLocks > 1 || typeof document === 'undefined') return;\n\n const { body, documentElement } = document;\n const previousOverflow = body.style.overflow;\n const previousPaddingRight = body.style.paddingRight;\n\n // Removing the scrollbar reflows the page a few pixels narrower, which reads as the\n // whole layout twitching sideways as the dialog appears. Pad by exactly the width the\n // scrollbar occupied to hold everything still.\n const scrollbarWidth = window.innerWidth - documentElement.clientWidth;\n if (scrollbarWidth > 0) {\n const current = parseFloat(window.getComputedStyle(body).paddingRight) || 0;\n body.style.paddingRight = `${current + scrollbarWidth}px`;\n }\n body.style.overflow = 'hidden';\n\n restoreBody = () => {\n body.style.overflow = previousOverflow;\n body.style.paddingRight = previousPaddingRight;\n };\n}\n\nfunction unlockScroll() {\n scrollLocks = Math.max(0, scrollLocks - 1);\n if (scrollLocks === 0 && restoreBody) {\n restoreBody();\n restoreBody = null;\n }\n}\n\n// ── Inert background ───────────────────────────────────────────────────────────\n\nconst inerted = new Set<HTMLElement>();\n\n/**\n * Marks every top-level sibling of the overlay's own subtree `inert`, which removes it\n * from the accessibility tree *and* from the tab sequence in one attribute.\n *\n * `aria-modal=\"true\"` alone — all this library had before — is honoured by modern screen\n * readers for virtual-cursor browsing but does nothing about focus, and older AT ignores\n * it entirely. `inert` is the actual guarantee.\n */\nfunction applyInert(node: HTMLElement | null) {\n if (typeof document === 'undefined' || !node) return;\n\n // Walk up to whichever direct child of <body> contains this overlay, so the overlay's\n // own portal container is the one subtree left interactive.\n let root: HTMLElement = node;\n while (root.parentElement && root.parentElement !== document.body) {\n root = root.parentElement;\n }\n\n for (const child of Array.from(document.body.children)) {\n if (child === root || !(child instanceof HTMLElement)) continue;\n if (child.hasAttribute('inert')) continue;\n child.setAttribute('inert', '');\n inerted.add(child);\n }\n}\n\nfunction releaseInert() {\n for (const el of inerted) el.removeAttribute('inert');\n inerted.clear();\n}\n\n// ── Hook ───────────────────────────────────────────────────────────────────────\n\nexport interface UseOverlayLayerOptions {\n /** Prevent the page behind from scrolling. Default `true`. */\n lockScroll?: boolean;\n /**\n * Mark sibling content `inert`. Default `true`. Turn it off for non-modal surfaces —\n * a tooltip or a popover must leave the rest of the page usable.\n */\n inertBackground?: boolean;\n /**\n * Ref to the panel element, used to work out which subtree to leave interactive.\n *\n * Deliberately the ref object rather than the node: a node read during render is\n * always `null` on the first pass, and nothing re-renders the consumer once the ref\n * is attached, so the inert pass would never run. Effects read `.current` after the\n * DOM is committed, where it is populated.\n */\n panelRef?: RefObject<HTMLElement | null>;\n}\n\n/**\n * Registers a mounted overlay with the stack.\n *\n * Returns `isTopmost`, which every dismissal handler must gate on so only the frontmost\n * layer reacts to Escape or an outside pointer press.\n */\nexport function useOverlayLayer(\n active: boolean,\n {\n lockScroll: shouldLockScroll = true,\n inertBackground = true,\n panelRef,\n }: UseOverlayLayerOptions = {},\n): { isTopmost: boolean } {\n const id = useRef<symbol>();\n if (!id.current) id.current = Symbol('overlay-layer');\n\n const [isTopmost, setIsTopmost] = useState(false);\n\n useEffect(() => {\n if (!active) return;\n const self = id.current!;\n\n layers.push({ id: self });\n\n const sync = () => setIsTopmost(topmost() === self);\n listeners.add(sync);\n sync();\n notify();\n\n if (shouldLockScroll) lockScroll();\n\n return () => {\n const index = layers.findIndex((layer) => layer.id === self);\n if (index !== -1) layers.splice(index, 1);\n listeners.delete(sync);\n notify();\n if (shouldLockScroll) unlockScroll();\n };\n }, [active, shouldLockScroll]);\n\n useEffect(() => {\n if (!active || !inertBackground) return;\n // Only the bottom-most modal layer needs to set this: it already hides everything\n // outside the overlay tree, and every overlay above it portals into the same root.\n if (inerted.size === 0) applyInert(panelRef?.current ?? null);\n return () => {\n if (layers.length <= 1) releaseInert();\n };\n }, [active, inertBackground, panelRef]);\n\n return { isTopmost };\n}\n","import { useEffect, useState, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport interface PortalProps {\n children: ReactNode;\n /**\n * Where to mount. Defaults to `document.body`.\n *\n * Pass a container when the app renders inside a shadow root or a scoped theme\n * wrapper — the portal must stay inside whatever element the design tokens are\n * declared on, or every `var(--color-*)` resolves to nothing.\n */\n container?: HTMLElement | null;\n}\n\n/**\n * Renders `children` outside the parent DOM hierarchy.\n *\n * Until 0.4.0 this library never called `createPortal` — `Modal`, `Drawer`,\n * `DropdownMenu`, `RoleComboBox` and the sidebar menu all rendered inline. Two concrete\n * failures came out of that:\n *\n * - `DropdownMenu` was positioned `absolute` inside a `relative` wrapper, so it was\n * clipped by `Card`'s `overflow-hidden` and by `DataTable`'s `overflow-x-auto` — the\n * two places its own doc comment said it was for.\n * - `position: fixed` resolves against the nearest ancestor with `transform`, `filter`,\n * `backdrop-filter`, `perspective`, `will-change` or `contain`, so a `Modal` opened\n * from inside any transformed ancestor was positioned against that ancestor rather\n * than the viewport, and `z-50` was scoped to a stacking context it did not control.\n *\n * Mounting is deferred to an effect so the server render and the first client render\n * agree — reaching for `document` during render breaks SSR and hydration.\n */\nexport function Portal({ children, container }: PortalProps) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => setMounted(true), []);\n\n if (!mounted) return null;\n\n const target = container ?? (typeof document === 'undefined' ? null : document.body);\n if (!target) return null;\n\n return createPortal(children, target);\n}\n","import { forwardRef, type InputHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { LuCalendar } from 'react-icons/lu';\nimport { type InputSize } from './input';\nimport { useControlSize } from './control-size';\nimport {\n Field,\n FieldDescription,\n FieldError,\n FieldHint,\n FieldLabel,\n useFieldControl,\n} from './field';\n\nexport interface DatePickerProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n label?: string;\n description?: string;\n /** Red border + message shown below the control. Also sets `aria-invalid`. */\n error?: string;\n hint?: string;\n size?: InputSize;\n}\n\nconst inputBase: Record<InputSize, string> = {\n lg: 'h-12 px-5 py-3.5 pr-12 text-body',\n md: 'h-9 px-4 py-2.5 pr-8 text-body-sm',\n sm: 'h-6 px-3 py-[5px] pr-6 text-body-tiny',\n};\n\nconst iconWrap: Record<InputSize, { right: string; size: string }> = {\n lg: { right: 'right-4', size: 'size-5' },\n md: { right: 'right-3', size: 'size-4' },\n sm: { right: 'right-2', size: 'size-3' },\n};\n\n/**\n * A native `<input type=\"date\">`.\n *\n * The `::-webkit-calendar-picker-indicator` styling below is Chromium-only — on Firefox\n * and Safari the native affordance differs, so the drawn `LuCalendar` sits alongside\n * whatever the platform renders rather than replacing it. That is a known limitation of\n * this component, not a bug to paper over: for a real month grid, range selection, locale\n * control or min/max navigation, use `Calendar` and `DateField` instead.\n */\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(function DatePicker(\n { label, description, error, hint, size: sizeProp, className, disabled, required, id, ...props },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const hasError = !!error;\n const iw = iconWrap[size];\n\n return (\n <Field\n id={id}\n size={size}\n disabled={disabled}\n required={required}\n hasDescription={!!description}\n hasError={hasError}\n hasHint={!!hint}\n className={className}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n {description && <FieldDescription>{description}</FieldDescription>}\n <div className=\"relative flex items-center\">\n <DateInput\n ref={ref}\n size={size}\n invalid={hasError}\n disabled={disabled}\n required={required}\n {...props}\n />\n <span\n aria-hidden\n className={clsx(\n 'pointer-events-none absolute',\n iw.right,\n iw.size,\n 'flex items-center justify-center',\n disabled ? 'text-icon-disabled' : 'text-icon-default-secondary',\n )}\n >\n <LuCalendar className=\"size-full\" />\n </span>\n </div>\n {hasError && <FieldError>{error}</FieldError>}\n {!hasError && hint && <FieldHint>{hint}</FieldHint>}\n </Field>\n );\n});\n\ninterface DateInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n size?: InputSize;\n invalid?: boolean;\n}\n\nconst DateInput = forwardRef<HTMLInputElement, DateInputProps>(function DateInput(\n { size: sizeProp, invalid = false, className, ...props },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const field = useFieldControl();\n const isInvalid = invalid || !!field['aria-invalid'];\n const isDisabled = props.disabled ?? field.disabled;\n\n return (\n <input\n ref={ref}\n type=\"date\"\n {...field}\n className={clsx(\n 'w-full rounded-lg border outline-none transition-colors',\n 'bg-default text-default',\n 'focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n '[&::-webkit-calendar-picker-indicator]:opacity-0',\n '[&::-webkit-calendar-picker-indicator]:absolute',\n '[&::-webkit-calendar-picker-indicator]:right-0',\n '[&::-webkit-calendar-picker-indicator]:h-full',\n '[&::-webkit-calendar-picker-indicator]:w-10',\n '[&::-webkit-calendar-picker-indicator]:cursor-pointer',\n inputBase[size],\n isDisabled\n ? 'cursor-not-allowed border-disabled bg-disabled text-disabled'\n : isInvalid\n ? 'border-danger-secondary focus-visible:border-danger focus-visible:ring-danger'\n : 'border-default focus-visible:border-brand focus-visible:ring-brand',\n className,\n )}\n {...props}\n />\n );\n});\n","import clsx from 'clsx';\nimport { LuCheck, LuChevronRight } from 'react-icons/lu';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\n\nexport type StepStatus = 'complete' | 'active' | 'upcoming';\n\nexport interface StepItem {\n label: string;\n status: StepStatus;\n}\n\nexport type StepperSize = 'sm' | 'md';\n\nexport interface StepperProps {\n steps: StepItem[];\n /** Matches Figma's `Size` axis on the `Stepper` component set. */\n size?: StepperSize;\n /** Names the list. Defaults to `Progress`. Override for a non-English UI. */\n label?: string;\n className?: string;\n}\n\n/**\n * Status words announced after each step's label.\n *\n * Step status was conveyed by colour plus an `aria-hidden` glyph only, so \"complete\" and\n * \"upcoming\" were indistinguishable to a screen reader — `aria-current=\"step\"` marked the\n * active one and nothing said which of the rest were done.\n */\nconst STATUS_TEXT: Record<StepStatus, string> = {\n complete: 'completed',\n active: 'current step',\n upcoming: 'not started',\n};\n\nconst SIZE: Record<StepperSize, { indicator: string; glyph: number; label: string }> = {\n sm: { indicator: 'size-4', glyph: 9, label: 'text-body-tiny' },\n md: { indicator: 'size-5', glyph: 11, label: 'text-body-xs' },\n};\n\nfunction StepIndicator({ status, size }: { status: StepStatus; size: StepperSize }) {\n const s = SIZE[size];\n\n if (status === 'complete') {\n return (\n <span\n aria-hidden\n className={clsx(\n 'flex shrink-0 items-center justify-center rounded-full bg-brand text-brand-on-brand',\n s.indicator,\n )}\n >\n <LuCheck size={s.glyph} />\n </span>\n );\n }\n\n if (status === 'active') {\n return (\n <span\n aria-hidden\n className={clsx(\n 'flex shrink-0 items-center justify-center rounded-full border-2 border-brand-emphasis',\n s.indicator,\n )}\n >\n <span className=\"size-2.5 rounded-full bg-brand\" />\n </span>\n );\n }\n\n return (\n <span\n aria-hidden\n className={clsx('shrink-0 rounded-full border-2 border-disabled', s.indicator)}\n />\n );\n}\n\nfunction ChevronSeparator() {\n return <LuChevronRight className=\"mx-1 size-4 shrink-0 text-default-tertiary\" aria-hidden />;\n}\n\nconst labelClass: Record<StepStatus, string> = {\n complete: 'text-brand font-semibold',\n active: 'text-brand font-semibold',\n upcoming: 'text-disabled font-regular',\n};\n\nexport function Stepper({ steps, size = 'md', label = 'Progress', className }: StepperProps) {\n const s = SIZE[size];\n\n return (\n // An <ol> cannot be wrapped without breaking the list relationship with its <li>s.\n <ol\n className={clsx('flex items-center overflow-x-auto', SCROLLBAR_CLASSES, className)}\n aria-label={label}\n >\n {steps.map((step, i) => (\n <li\n // Keyed by label rather than index, so reordering or inserting a step does not\n // reuse the wrong element's state.\n key={step.label}\n className=\"flex items-center\"\n aria-current={step.status === 'active' ? 'step' : undefined}\n >\n <span className=\"flex items-center gap-1.5\">\n <StepIndicator status={step.status} size={size} />\n <span className={clsx('whitespace-nowrap', s.label, labelClass[step.status])}>\n {step.label}\n </span>\n <span className=\"sr-only\">, {STATUS_TEXT[step.status]}</span>\n </span>\n {i < steps.length - 1 && <ChevronSeparator />}\n </li>\n ))}\n </ol>\n );\n}\n","import clsx from 'clsx';\nimport { type ReactNode } from 'react';\nimport { LuCheck } from 'react-icons/lu';\n\n/** Matches Figma's `Size` axis on `Multiselect Card` (`Default | Small`). */\nexport type MultiSelectCardSize = 'default' | 'sm';\n\nexport interface MultiSelectCardProps {\n icon: ReactNode;\n title: string;\n description?: string;\n selected: boolean;\n onToggle: () => void;\n /**\n * Figma has had this axis since 0.2.0; the 0.3.0 CHANGELOG recorded it as \"left alone\n * pending a design decision\". `Default` and `Small` differ only in padding, icon box and\n * type step, so there was nothing to decide.\n */\n size?: MultiSelectCardSize;\n disabled?: boolean;\n className?: string;\n}\n\nconst SIZE: Record<\n MultiSelectCardSize,\n { pad: string; iconBox: string; icon: string; mark: string; gap: string; title: string }\n> = {\n default: {\n pad: 'p-4',\n iconBox: 'size-10 rounded-xl',\n icon: 'size-5',\n mark: 'size-5',\n gap: 'mt-3',\n title: 'text-body-sm',\n },\n sm: {\n pad: 'p-3',\n iconBox: 'size-8 rounded-lg',\n icon: 'size-4',\n mark: 'size-4',\n gap: 'mt-2',\n title: 'text-body-xs',\n },\n};\n\nexport function MultiSelectCard({\n icon,\n title,\n description,\n selected,\n onToggle,\n size = 'default',\n disabled = false,\n className,\n}: MultiSelectCardProps) {\n const s = SIZE[size];\n\n return (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={selected}\n disabled={disabled}\n onClick={onToggle}\n className={clsx(\n 'relative w-full rounded-2xl border-2 text-left transition-all',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:opacity-60',\n s.pad,\n selected\n ? 'border-brand bg-brand-tertiary'\n : 'border-default bg-default hover:border-default-secondary',\n className,\n )}\n >\n <div className=\"flex items-start justify-between gap-2\">\n <span\n aria-hidden\n className={clsx(\n 'flex shrink-0 items-center justify-center',\n s.iconBox,\n selected ? 'bg-brand' : 'bg-brand-tertiary',\n )}\n >\n <span className={clsx(s.icon, selected ? 'text-icon-brand-on-brand' : 'text-icon-brand')}>\n {icon}\n </span>\n </span>\n\n {selected ? (\n <span\n aria-hidden\n className={clsx(\n 'flex shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand',\n s.mark,\n )}\n >\n <LuCheck className=\"size-3\" strokeWidth={2.5} />\n </span>\n ) : (\n <span\n aria-hidden\n className={clsx('shrink-0 rounded-full border-2 border-default', s.mark)}\n />\n )}\n </div>\n\n <div className={s.gap}>\n <p className={clsx('font-semibold', s.title, selected ? 'text-brand' : 'text-default')}>\n {title}\n </p>\n {description && (\n <p className=\"mt-0.5 text-body-tiny text-default-secondary\">{description}</p>\n )}\n </div>\n </button>\n );\n}\n","import { forwardRef, useId, type ButtonHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\nexport type SwitchSize = 'sm' | 'md';\n\nexport interface SwitchProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'value' | 'type'> {\n /** Controlled. Omit and pass `defaultChecked` for uncontrolled. */\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n /** Visible text beside the switch. Doubles as the accessible name. */\n label?: ReactNode;\n /** Second line under the label. Matches Figma's `Supporting text` axis. */\n description?: ReactNode;\n /** Track size. `sm` is 36×20, `md` is 44×24. */\n size?: SwitchSize;\n}\n\n/**\n * Track / knob geometry, straight from the Figma `_Toggle base` component (see the naming\n * note below). The knob sits on a 2px inset, so travel = track width − knob − (2 × inset).\n */\nconst SIZE: Record<SwitchSize, { track: string; knob: string; translate: string }> = {\n sm: { track: 'h-5 w-9', knob: 'size-4', translate: 'translate-x-4' },\n md: { track: 'h-6 w-11', knob: 'size-5', translate: 'translate-x-5' },\n};\n\n/**\n * An on/off switch — a setting that takes effect immediately, with no save step.\n *\n * **Renamed from `Toggle` in 0.4.0.** It was always a switch: `role=\"switch\"`,\n * `aria-checked`, and the track/knob geometry taken from Figma. The name was blocking,\n * because \"Toggle\" means something else in shadcn/ui and in most design systems — a\n * pressed-state *button*, like a bold button in a text toolbar. That component now exists\n * here under the name everyone expects, and the two are not interchangeable:\n *\n * - `Switch` — `role=\"switch\"`, \"on\"/\"off\", applies immediately. A setting.\n * - `Toggle` — `aria-pressed`, \"pressed\"/\"not pressed\". A button whose effect persists.\n *\n * Figma calls its set `Toggle` with a `Pressed` axis, but its geometry and `_Toggle base`\n * match this component exactly, so Figma's `Toggle` **is** this switch. Figma has no\n * pressed-button equivalent yet; that is a gap on the design side, recorded in the\n * CHANGELOG rather than papered over here.\n */\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(function Switch(\n {\n checked: checkedProp,\n defaultChecked = false,\n onCheckedChange,\n label,\n description,\n size = 'md',\n disabled = false,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n },\n ref,\n) {\n const [checked, setChecked] = useControllableState({\n value: checkedProp,\n defaultValue: defaultChecked,\n onChange: onCheckedChange,\n });\n\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n const s = SIZE[size];\n\n const control = (\n <button\n ref={ref}\n type=\"button\"\n role=\"switch\"\n id={controlId}\n aria-checked={checked}\n // With no visible label the switch would otherwise ship with no accessible name.\n aria-label={label ? undefined : ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={description ? descriptionId : undefined}\n disabled={disabled}\n onClick={() => setChecked(!checked)}\n className={clsx(\n 'group flex items-center gap-2',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n disabled && 'cursor-not-allowed opacity-50',\n !description && className,\n )}\n {...rest}\n >\n <span\n aria-hidden\n className={clsx(\n 'relative inline-flex shrink-0 rounded-full transition-colors',\n s.track,\n // The unchecked track is borderless per the spec. A border here would also shift\n // the knob's rendered inset by 1px between states, since the knob is positioned\n // against the padding box.\n disabled\n ? 'bg-disabled'\n : checked\n ? 'bg-brand group-hover:bg-brand-hover'\n : 'bg-default-secondary group-hover:bg-default-secondary-hover',\n )}\n >\n <span\n className={clsx(\n 'absolute left-0.5 top-0.5 rounded-full bg-default shadow-100 transition-transform',\n s.knob,\n checked ? s.translate : 'translate-x-0',\n )}\n />\n </span>\n {label && <span className=\"text-body-xs text-default\">{label}</span>}\n </button>\n );\n\n if (!description) return control;\n\n return (\n <div className={clsx('flex flex-col', className)}>\n {control}\n {/* Outside the button, so it is not folded into the accessible name — the same\n reasoning as `Checkbox` and `Radio`. Indented past the track. */}\n <span\n id={descriptionId}\n className={clsx(\n 'mt-0.5 text-body-tiny',\n size === 'md' ? 'pl-[52px]' : 'pl-[44px]',\n disabled ? 'text-disabled' : 'text-default-secondary',\n )}\n >\n {description}\n </span>\n </div>\n );\n});\n","import {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n useRef,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\n\nexport type ToggleSize = 'sm' | 'md' | 'lg';\nexport type ToggleVariant = 'ghost' | 'outline';\n\nconst SIZE: Record<ToggleSize, string> = {\n sm: 'h-8 min-w-8 px-2 text-body-tiny [&_svg]:size-3.5',\n md: 'h-9 min-w-9 px-2.5 text-body-xs [&_svg]:size-4',\n lg: 'h-11 min-w-11 px-3 text-body-sm [&_svg]:size-5',\n};\n\nconst VARIANT: Record<ToggleVariant, string> = {\n ghost: 'border border-transparent bg-transparent',\n outline: 'border border-default bg-default',\n};\n\nexport interface ToggleProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'type'> {\n /** Controlled pressed state. Omit and pass `defaultPressed` for uncontrolled. */\n pressed?: boolean;\n defaultPressed?: boolean;\n onPressedChange?: (pressed: boolean) => void;\n size?: ToggleSize;\n variant?: ToggleVariant;\n children?: ReactNode;\n}\n\n/**\n * A button with a sticky pressed state — bold in a text toolbar, a map layer on/off, a\n * filter that stays applied.\n *\n * **New in 0.4.0, and not what `Toggle` used to be.** Through 0.3.0 this name belonged to\n * the on/off switch, which is now `Switch`. The two look similar and mean different things:\n *\n * - `Toggle` — `aria-pressed`. A *button*. \"Bold is pressed.\"\n * - `Switch` — `role=\"switch\"` + `aria-checked`. A *setting*. \"Notifications are on.\"\n *\n * `aria-pressed` rather than `aria-checked` is the whole distinction as far as assistive\n * tech is concerned, and it is why this is not just `Switch` with different styling.\n *\n * An icon-only toggle needs `aria-label`, exactly as `IconButton` does — there is no visible\n * text to name it.\n */\nexport const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(function Toggle(\n {\n pressed: pressedProp,\n defaultPressed = false,\n onPressedChange,\n size = 'md',\n variant = 'ghost',\n disabled,\n children,\n className,\n ...rest\n },\n ref,\n) {\n const group = useContext(ToggleGroupContext);\n\n // Inside a ToggleGroup the group owns the state; standalone it owns its own.\n const [standalonePressed, setStandalonePressed] = useControllableState({\n value: pressedProp,\n defaultValue: defaultPressed,\n onChange: onPressedChange,\n });\n\n const pressed = group ? group.isPressed(rest.value as string) : standalonePressed;\n const isDisabled = disabled ?? group?.disabled;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-pressed={pressed}\n disabled={isDisabled}\n onClick={(event) => {\n rest.onClick?.(event);\n if (group) group.toggle(rest.value as string);\n else setStandalonePressed(!pressed);\n }}\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center gap-1.5 rounded-lg font-medium transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n SIZE[size],\n VARIANT[variant],\n pressed\n ? 'border-brand-tertiary bg-brand-tertiary text-brand'\n : 'text-default-secondary hover:bg-default-secondary hover:text-default',\n className,\n )}\n {...rest}\n >\n {children}\n </button>\n );\n});\n\n// ── ToggleGroup ────────────────────────────────────────────────────────────────\n\nexport type ToggleGroupType = 'single' | 'multiple';\n\ninterface ToggleGroupContextValue {\n isPressed: (value: string) => boolean;\n toggle: (value: string) => void;\n disabled?: boolean;\n /** Items claim a roving index in render order, which is their visual order. */\n claimIndex: () => number;\n roving: ReturnType<typeof useRovingFocus>;\n}\n\nconst ToggleGroupContext = createContext<ToggleGroupContextValue | null>(null);\n\nexport interface ToggleGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n children: ReactNode;\n /** `single` behaves like a radio group; `multiple` like a set of checkboxes. */\n type?: ToggleGroupType;\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: string | string[]) => void;\n /** Names the group. Required by the APG for a toolbar-style group. */\n label: string;\n disabled?: boolean;\n orientation?: 'horizontal' | 'vertical';\n}\n\n/**\n * A set of related toggles sharing one selection.\n *\n * `role=\"group\"` with `aria-pressed` on each child, and a roving tabindex so the set is one\n * tab stop with arrow keys inside — the same contract `SegmentedControl` was missing before\n * 0.4.0.\n *\n * How this differs from the neighbours, since three components in this library now look\n * similar: `SegmentedControl` is a `radiogroup` for choosing *one* of a small set of views,\n * and always has exactly one selection. `ToggleGroup type=\"multiple\"` allows none or many.\n * `ToggleGroup type=\"single\"` allows none or one — the deselectable case a radio group\n * cannot express.\n */\nexport function ToggleGroup({\n children,\n type = 'single',\n value: valueProp,\n defaultValue,\n onValueChange,\n label,\n disabled,\n orientation = 'horizontal',\n className,\n ...rest\n}: ToggleGroupProps) {\n const [value, setValue] = useControllableState<string | string[]>({\n value: valueProp,\n defaultValue: defaultValue ?? (type === 'multiple' ? [] : ''),\n onChange: onValueChange,\n });\n\n const roving = useRovingFocus({\n orientation: orientation === 'vertical' ? 'vertical' : 'horizontal',\n loop: true,\n });\n\n const cursor = useRef(0);\n\n const context = useMemo<ToggleGroupContextValue>(\n () => ({\n isPressed: (itemValue) =>\n Array.isArray(value) ? value.includes(itemValue) : value === itemValue,\n toggle: (itemValue) => {\n if (type === 'multiple') {\n const list = Array.isArray(value) ? value : [];\n setValue(\n list.includes(itemValue) ? list.filter((v) => v !== itemValue) : [...list, itemValue],\n );\n return;\n }\n // Single mode deselects on re-press — the behaviour a radiogroup cannot offer.\n setValue(value === itemValue ? '' : itemValue);\n },\n disabled,\n claimIndex: () => cursor.current++,\n roving,\n }),\n [value, setValue, type, disabled, roving],\n );\n\n // Reset before the children's render bodies run, so indices restart from zero each pass.\n cursor.current = 0;\n\n return (\n <ToggleGroupContext.Provider value={context}>\n <div\n role=\"group\"\n aria-label={label}\n // No `aria-orientation`: `role=\"group\"` does not support it. The orientation only\n // affects which arrow keys move focus, which the roving hook already knows —\n // announcing it here would be an invalid attribute for the role.\n data-slot=\"toggle-group\"\n className={clsx(\n 'inline-flex gap-0.5',\n orientation === 'vertical' ? 'flex-col' : 'flex-row items-center',\n className,\n )}\n {...roving.containerProps}\n {...rest}\n >\n {children}\n </div>\n </ToggleGroupContext.Provider>\n );\n}\n\nexport interface ToggleGroupItemProps extends Omit<ToggleProps, 'pressed' | 'defaultPressed'> {\n value: string;\n}\n\n/** A `Toggle` wired to its `ToggleGroup`, with the roving tabindex applied. */\nexport const ToggleGroupItem = forwardRef<HTMLButtonElement, ToggleGroupItemProps>(\n function ToggleGroupItem({ value, children, ...rest }, ref) {\n const group = useContext(ToggleGroupContext);\n if (!group) throw new Error('<ToggleGroupItem> must be used inside <ToggleGroup>');\n\n const index = group.claimIndex();\n const { ref: rovingRef, ...itemProps } = group.roving.itemProps(index, {\n disabled: rest.disabled ?? group.disabled,\n label: typeof children === 'string' ? children : undefined,\n });\n\n return (\n <Toggle\n ref={composeRefs<HTMLButtonElement>(ref, rovingRef)}\n value={value}\n {...itemProps}\n // Restated after the spread so it is statically visible, and so a group of five\n // toggles is one tab stop rather than five.\n tabIndex={itemProps.tabIndex}\n {...rest}\n >\n {children}\n </Toggle>\n );\n },\n);\n","import {\n forwardRef,\n useId,\n useRef,\n useState,\n type ClipboardEvent as ReactClipboardEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n} from 'react';\nimport clsx from 'clsx';\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\nexport type InputOTPMode = 'numeric' | 'alphanumeric';\n\nexport interface InputOTPProps {\n /** Number of characters. Default `6`. */\n length?: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Fired once the last slot is filled. */\n onComplete?: (value: string) => void;\n mode?: InputOTPMode;\n /** Draws a gap after this many slots — `3` for a `123 456` code. */\n groupAfter?: number;\n /** Accessible name. Default `Verification code`. */\n label?: string;\n disabled?: boolean;\n invalid?: boolean;\n autoFocus?: boolean;\n className?: string;\n}\n\n/**\n * A one-time-code field — the boxed digits from a 2FA or email-verification flow.\n *\n * **One real input, N drawn boxes.** The obvious implementation is N separate `<input>`s,\n * and it is the wrong one: it makes the code N tab stops, breaks paste (the browser puts all\n * six characters in the first box), fights password managers and SMS autofill, and announces\n * \"edit text, blank\" six times. Instead there is a single input holding the whole value —\n * with `autocomplete=\"one-time-code\"`, so iOS and Android offer the code from the incoming\n * message — rendered transparently over the boxes, which are decorative.\n *\n * That means paste, autofill, undo, selection and screen readers all get the real value, and\n * the caret position simply drives which box is highlighted.\n */\nexport const InputOTP = forwardRef<HTMLInputElement, InputOTPProps>(function InputOTP(\n {\n length = 6,\n value: valueProp,\n defaultValue = '',\n onValueChange,\n onComplete,\n mode = 'numeric',\n groupAfter,\n label = 'Verification code',\n disabled = false,\n invalid = false,\n autoFocus = false,\n className,\n },\n ref,\n) {\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue,\n onChange: onValueChange,\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n const [focused, setFocused] = useState(false);\n const describedById = useId();\n\n const pattern = mode === 'numeric' ? /[^0-9]/g : /[^a-zA-Z0-9]/g;\n\n const commit = (next: string) => {\n const cleaned = next.replace(pattern, '').slice(0, length);\n setValue(cleaned);\n if (cleaned.length === length) onComplete?.(cleaned);\n };\n\n const chars = value.split('');\n // The caret sits on the first empty slot, or the last one when full.\n const activeIndex = Math.min(value.length, length - 1);\n\n return (\n <div className={clsx('inline-flex flex-col gap-1.5', className)}>\n {/* Clicking any box focuses the single real input. Not a control itself and not\n focusable — the input stretched across it is the control, and it is already keyboard\n reachable, so no key handler belongs here. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */}\n <div\n className=\"relative inline-flex items-center gap-2\"\n onClick={() => inputRef.current?.focus()}\n >\n <input\n ref={composeRefs<HTMLInputElement>(inputRef, ref)}\n type=\"text\"\n inputMode={mode === 'numeric' ? 'numeric' : 'text'}\n // The one attribute that makes SMS and email autofill work on mobile.\n autoComplete=\"one-time-code\"\n autoCorrect=\"off\"\n spellCheck={false}\n maxLength={length}\n value={value}\n disabled={disabled}\n // Off by default; opt-in for the case this exists for — a verification screen whose\n // only purpose is entering the code that just arrived.\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n aria-label={label}\n aria-invalid={invalid || undefined}\n aria-describedby={describedById}\n onChange={(event) => commit(event.target.value)}\n onFocus={() => setFocused(true)}\n onBlur={() => setFocused(false)}\n onKeyDown={(event: ReactKeyboardEvent<HTMLInputElement>) => {\n // Arrow keys would move the caret into the middle of the value, which has no\n // meaning here — the code is filled left to right.\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') event.preventDefault();\n }}\n onPaste={(event: ReactClipboardEvent<HTMLInputElement>) => {\n // Handled explicitly so a pasted \"123-456\" or \"123 456\" still works.\n event.preventDefault();\n commit(event.clipboardData.getData('text'));\n }}\n // Transparent and stretched across the boxes: the real input stays where the\n // browser expects it (so autofill anchors correctly) while the boxes below are\n // what the user sees.\n className=\"absolute inset-0 z-raised w-full cursor-default bg-transparent text-transparent caret-transparent outline-none\"\n />\n\n {Array.from({ length }, (_, index) => (\n <span\n key={index}\n // Decorative: the input above holds the value and the accessible name.\n aria-hidden\n className={clsx(\n 'flex h-12 w-10 items-center justify-center rounded-lg border text-body font-semibold tabular-nums transition-colors',\n groupAfter && index === groupAfter && 'ml-3',\n disabled\n ? 'border-disabled bg-disabled text-disabled'\n : invalid\n ? 'border-danger-secondary bg-default text-default'\n : 'border-default bg-default text-default',\n focused &&\n !disabled &&\n index === activeIndex &&\n 'border-brand ring-2 ring-brand ring-offset-1 ring-offset-default',\n )}\n >\n {chars[index] ?? ''}\n </span>\n ))}\n </div>\n <span id={describedById} className=\"sr-only\">\n {`Enter the ${length}-character code. ${value.length} of ${length} entered.`}\n </span>\n </div>\n );\n});\n","import { useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { LuUpload } from 'react-icons/lu';\n\nexport interface FileDropZoneProps {\n className?: string;\n /** Caption shown under \"Upload file\". Defaults to the generic document hint. */\n description?: string;\n accept?: string;\n /** Files above this size are rejected before any upload starts. */\n maxSizeBytes?: number;\n onFileSelected?: (file: File) => void;\n disabled?: boolean;\n}\n\nconst DEFAULT_ACCEPT = '.pdf,.jpg,.jpeg,.png';\nconst DEFAULT_MAX_SIZE_BYTES = 10 * 1024 * 1024;\n\nfunction formatSize(bytes: number): string {\n const mb = bytes / (1024 * 1024);\n return `${Number.isInteger(mb) ? mb : mb.toFixed(1)} MB`;\n}\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const extensions = accept\n .split(',')\n .map((part) => part.trim().toLowerCase())\n .filter((part) => part.startsWith('.'));\n if (extensions.length === 0) {\n return true;\n }\n return extensions.some((extension) => file.name.toLowerCase().endsWith(extension));\n}\n\nexport function FileDropZone({\n className,\n description = 'Drag & drop or browse · PDF, JPG, PNG · up to 10 MB',\n accept = DEFAULT_ACCEPT,\n maxSizeBytes = DEFAULT_MAX_SIZE_BYTES,\n onFileSelected,\n disabled = false,\n}: FileDropZoneProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n function handleFiles(files: FileList | null) {\n const file = files?.[0];\n if (!file) {\n return;\n }\n if (!matchesAccept(file, accept)) {\n setError(`Unsupported file type. Allowed: ${accept}.`);\n return;\n }\n if (file.size > maxSizeBytes) {\n setError(`That file is ${formatSize(file.size)}. The limit is ${formatSize(maxSizeBytes)}.`);\n return;\n }\n setError(null);\n onFileSelected?.(file);\n }\n\n return (\n <>\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n className=\"sr-only\"\n tabIndex={-1}\n disabled={disabled}\n onChange={(e) => {\n handleFiles(e.target.files);\n e.target.value = '';\n }}\n />\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n aria-disabled={disabled}\n onClick={() => { if (!disabled) inputRef.current?.click(); }}\n onKeyDown={(e) => {\n if (!disabled && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n inputRef.current?.click();\n }\n }}\n onDragOver={(e) => { e.preventDefault(); if (!disabled) setIsDragging(true); }}\n onDragEnter={(e) => { e.preventDefault(); if (!disabled) setIsDragging(true); }}\n onDragLeave={() => setIsDragging(false)}\n onDrop={(e) => {\n e.preventDefault();\n setIsDragging(false);\n if (!disabled) handleFiles(e.dataTransfer.files);\n }}\n className={clsx(\n 'flex flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed py-4 px-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1',\n disabled\n ? 'cursor-not-allowed border-disabled bg-disabled'\n : clsx(\n 'cursor-pointer',\n isDragging\n ? 'border-brand bg-brand-tertiary'\n : 'border-default bg-default-secondary hover:border-brand hover:bg-brand-tertiary',\n ),\n className,\n )}\n >\n <span\n aria-hidden\n className={disabled ? 'text-disabled' : isDragging ? 'text-brand' : 'text-default-secondary'}\n >\n <LuUpload className=\"size-5\" />\n </span>\n <span className={clsx('text-body-sm font-medium', disabled ? 'text-disabled' : 'text-default')}>Upload file</span>\n <span className=\"text-body-xs text-default-secondary text-center\">\n {description}\n </span>\n </div>\n {error && (\n <span role=\"alert\" className=\"text-body-xs text-danger\">\n {error}\n </span>\n )}\n </>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { LuArrowLeft, LuArrowRight } from 'react-icons/lu';\nimport { Button } from './button';\n\n// ── FormCard ───────────────────────────────────────────────────────────────────\n\nexport function FormCard({\n children,\n className,\n}: {\n children: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={clsx(\n 'overflow-hidden rounded-xl border border-default bg-default',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\n// ── FormCardHeader ─────────────────────────────────────────────────────────────\n\nexport interface FormCardHeaderProps {\n title: string;\n subtitle?: string;\n}\n\nexport function FormCardHeader({ title, subtitle }: FormCardHeaderProps) {\n return (\n <div className=\"border-b border-default px-7 py-6\">\n <h2 className=\"text-heading-sm font-semibold text-default leading-snug\">{title}</h2>\n {subtitle && (\n <p className=\"mt-1 text-body-xs text-default-secondary\">{subtitle}</p>\n )}\n </div>\n );\n}\n\n// ── FormCardFooter ─────────────────────────────────────────────────────────────\n\nexport interface FormCardFooterProps {\n onSaveDraft?: () => void;\n onBack?: () => void;\n onContinue?: () => void;\n continueLabel?: string;\n backDisabled?: boolean;\n continueDisabled?: boolean;\n}\n\nexport function FormCardFooter({\n onSaveDraft,\n onBack,\n onContinue,\n continueLabel = 'Continue',\n backDisabled = false,\n continueDisabled = false,\n}: FormCardFooterProps) {\n return (\n <div className=\"flex items-center justify-between border-t border-default px-7 py-5\">\n {/* No handler means the host has nothing to save to — disable rather than no-op */}\n <Button variant=\"neutral\" size=\"md\" onClick={onSaveDraft} disabled={!onSaveDraft}>\n Save as draft\n </Button>\n <div className=\"flex items-center gap-2\">\n {!backDisabled && (\n <Button\n variant=\"neutral\"\n size=\"md\"\n leadingIcon={<LuArrowLeft aria-hidden size={16} />}\n onClick={onBack}\n >\n Back\n </Button>\n )}\n <Button\n variant=\"primary\"\n size=\"md\"\n trailingIcon={<LuArrowRight aria-hidden size={16} />}\n onClick={onContinue}\n disabled={continueDisabled}\n >\n {continueLabel}\n </Button>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuX } from 'react-icons/lu';\n\nexport type BadgeColor = 'gray' | 'red' | 'yellow' | 'lime' | 'green' | 'teal' | 'blue' | 'pink' | 'slate';\nexport type BadgeSize = 'sm' | 'lg';\nexport type BadgeVariant = 'default' | 'subtle';\n\nexport interface BadgeProps {\n label: string;\n color?: BadgeColor;\n size?: BadgeSize;\n variant?: BadgeVariant;\n indicator?: boolean;\n onClose?: () => void;\n className?: string;\n}\n\nconst defaultClasses: Record<BadgeColor, string> = {\n gray: 'bg-badge-gray text-badge-gray',\n red: 'bg-badge-red text-badge-red',\n yellow: 'bg-badge-yellow text-badge-yellow',\n lime: 'bg-badge-lime text-badge-lime',\n green: 'bg-badge-green text-badge-green',\n teal: 'bg-badge-teal text-badge-teal',\n blue: 'bg-badge-blue text-badge-blue',\n pink: 'bg-badge-pink text-badge-pink',\n slate: 'bg-badge-slate text-badge-slate',\n};\n\nconst subtleClasses: Record<BadgeColor, string> = {\n gray: 'border border-badge-gray text-default-secondary',\n red: 'border border-badge-red text-default-secondary',\n yellow: 'border border-badge-yellow text-default-secondary',\n lime: 'border border-badge-lime text-default-secondary',\n green: 'border border-badge-green text-default-secondary',\n teal: 'border border-badge-teal text-default-secondary',\n blue: 'border border-badge-blue text-default-secondary',\n pink: 'border border-badge-pink text-default-secondary',\n slate: 'border border-badge-slate text-default-secondary',\n};\n\nexport function Badge({\n label,\n color = 'gray',\n size = 'sm',\n variant = 'default',\n indicator = false,\n onClose,\n className,\n}: BadgeProps) {\n const isDefault = variant === 'default';\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full px-2 py-0.5',\n size === 'sm' ? 'gap-1' : 'gap-1.5',\n isDefault ? defaultClasses[color] : subtleClasses[color],\n className,\n )}\n >\n {indicator && (\n <span\n className={clsx(\n 'shrink-0 rounded-full bg-current',\n size === 'sm' ? 'h-1.5 w-1.5' : 'h-2 w-2',\n )}\n />\n )}\n <span\n className={clsx(\n 'whitespace-nowrap',\n size === 'sm'\n ? clsx('text-body-tiny', isDefault && 'font-semibold')\n : 'text-body-xs',\n )}\n >\n {label}\n </span>\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center rounded-full opacity-60 transition-opacity hover:opacity-100',\n size === 'sm' ? 'h-3 w-3' : 'h-4 w-4',\n )}\n // Was a hardcoded \"Remove\", so a row of five dismissible badges produced five\n // identically named buttons with nothing to tell them apart.\n aria-label={`Remove ${label}`}\n >\n <LuX className=\"h-full w-full\" strokeWidth={2.5} aria-hidden />\n </button>\n )}\n </span>\n );\n}\n","import clsx from 'clsx';\n\n/**\n * The nine-hue categorical palette from `badge.css`, which is what roles want: a role is a\n * *category*, not a severity, so it must not borrow the semantic tones — a `danger`-coloured\n * role badge would imply the role itself is a problem.\n */\nexport type RoleBadgeTone =\n | 'slate'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'red'\n | 'pink'\n | 'teal'\n | 'lime'\n | 'gray';\n\nexport interface RoleBadgeProps {\n role: string;\n size?: 'sm' | 'md';\n /**\n * Override the name-map lookup. Use this for roles the map does not know, in preference to\n * `color` — it stays on the token layer and re-themes with the rest of the badge palette.\n */\n tone?: RoleBadgeTone;\n /**\n * @deprecated Bypasses the design tokens — pass `tone` instead. Raw 6-digit hex; text uses\n * the hex and the background a 12% tint of it. Kept for role colours that genuinely come\n * from API data rather than from the design system.\n */\n color?: string | null;\n}\n\n/**\n * Role → palette hue.\n *\n * Through 0.4.0 this was ten hardcoded hex pairs, thirteen of whose twenty values sat off\n * the palette entirely. `Compliance Lead` was the worst: `#5b3da8`, a violet with no ramp in\n * `Color Primitives` at all — a gap `status.css` had already documented for `accent`.\n *\n * Hues were chosen by comparing the original hex against the resolved palette, not by eye.\n * Several land almost exactly:\n *\n * Auditor / Viewer #f5f5f5 / #757575 → gray #f5f5f5 / #757575 (exact)\n * admin family #e9eff7 / #0c2d58 → slate #f1f1f5 / #0c2d58 (text exact)\n * Entity Manager #fbe6cf / #9a6206 → yellow #feedcf / #996100\n * Intelligence Analyst #fde2e7 / #a3284a → red #fce9eb / #bb223a\n * Reviewer #dbeafe / #1d4ed8 → blue\n * Requester #e6f4ea / #1f7a3d → green\n *\n * `Compliance Lead` is the one reassignment rather than a match. Violet has no equivalent at\n * all, and of its two neighbours blue was already Reviewer's — so it takes pink, the nearest\n * remaining hue. `teal` and `lime` are deliberately left free for roles added later.\n */\nconst ROLE_TONES: Record<string, RoleBadgeTone> = {\n 'Super Admin': 'slate',\n 'Admin': 'slate',\n 'User': 'slate',\n 'Compliance Lead': 'pink',\n 'Reviewer': 'blue',\n 'Requester': 'green',\n 'Entity Manager': 'yellow',\n 'Intelligence Analyst': 'red',\n 'Auditor': 'gray',\n 'Viewer': 'gray',\n};\n\nconst FALLBACK_TONE: RoleBadgeTone = 'gray';\n\n/**\n * `bg-badge-*` resolves to `--badge-*-bg` and `text-badge-*` to `--badge-*-text`, so each\n * pair is the label/on-label duo the palette was designed around.\n */\nconst TONE_STYLES: Record<RoleBadgeTone, string> = {\n slate: 'bg-badge-slate text-badge-slate',\n blue: 'bg-badge-blue text-badge-blue',\n green: 'bg-badge-green text-badge-green',\n yellow: 'bg-badge-yellow text-badge-yellow',\n red: 'bg-badge-red text-badge-red',\n pink: 'bg-badge-pink text-badge-pink',\n teal: 'bg-badge-teal text-badge-teal',\n lime: 'bg-badge-lime text-badge-lime',\n gray: 'bg-badge-gray text-badge-gray',\n};\n\nconst HEX6 = /^#[0-9a-fA-F]{6}$/;\n\nexport function RoleBadge({ role, size = 'sm', tone, color }: RoleBadgeProps) {\n // The raw-hex path stays for data-driven colour, but it no longer wins by default: a\n // caller has to opt into leaving the token layer.\n const rawColor = color && HEX6.test(color) ? color : undefined;\n const resolved = tone ?? ROLE_TONES[role] ?? FALLBACK_TONE;\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full font-medium whitespace-nowrap',\n size === 'sm' ? 'px-2 py-0.5 text-body-tiny' : 'px-3 py-1 text-body-xs',\n !rawColor && TONE_STYLES[resolved],\n )}\n style={rawColor ? { backgroundColor: `${rawColor}1F`, color: rawColor } : undefined}\n >\n {role}\n </span>\n );\n}\n","import {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuCheck, LuChevronDown } from 'react-icons/lu';\n\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useFloatingPanel } from '../overlays/floating';\nimport {\n OVERLAY_HEADING,\n OVERLAY_ITEM_ACTIVE,\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE,\n OVERLAY_PANEL,\n OVERLAY_PANEL_SCROLL,\n} from '../overlays/menu-styles';\nimport { Portal } from '../overlays/portal';\nimport { useFieldControl } from './field';\nimport { useControlSize } from './control-size';\nimport type { InputSize } from './input';\n\nexport interface ComboboxOption<T = string> {\n value: T;\n label: string;\n description?: string;\n disabled?: boolean;\n /** Optional group heading. Options sharing a group are rendered together. */\n group?: string;\n}\n\nexport interface ComboboxProps<T extends string = string> {\n options: ComboboxOption<T>[];\n value?: T | null;\n defaultValue?: T | null;\n onValueChange?: (value: T | null) => void;\n /** Accessible name. Required unless the combobox is inside a `Field` with a label. */\n label?: string;\n placeholder?: string;\n size?: InputSize;\n disabled?: boolean;\n invalid?: boolean;\n /** Allow clearing back to `null` by selecting the chosen option again. Default `true`. */\n clearable?: boolean;\n /** Override the filter. Default is a case-insensitive substring match on `label`. */\n filter?: (option: ComboboxOption<T>, query: string) => boolean;\n /** Shown when nothing matches. */\n emptyMessage?: ReactNode;\n /** Custom option rendering. Receives the option and whether it is selected. */\n renderOption?: (option: ComboboxOption<T>, selected: boolean) => ReactNode;\n className?: string;\n}\n\nconst HEIGHT: Record<InputSize, string> = {\n lg: 'h-12 px-4 text-body',\n md: 'h-9 px-3 text-body-sm',\n sm: 'h-6 px-2 text-body-tiny',\n};\n\n/**\n * Single-select combobox with a text filter — an autocomplete.\n *\n * Implements the ARIA 1.2 combobox pattern, which is specific about a few things that are\n * easy to get wrong and were all wrong in the `RoleComboBox` this replaces:\n *\n * - **`role=\"combobox\"` belongs on the text input**, not on a wrapping `<div>`. The div\n * version means the state attributes sit on an element the user never focuses.\n * - **`aria-activedescendant`, not focus, tracks the highlighted option.** Focus stays in\n * the input the whole time — moving DOM focus into the list breaks typing. This is the\n * one place a roving tabindex is the *wrong* answer, which is why this does not use\n * `useRovingFocus`.\n * - **`aria-controls` points at the listbox**, which therefore needs a stable id.\n * - The listbox is portaled, so it is not clipped by a `Card` or a scrolling container.\n *\n * For a command palette — filter over *actions* rather than a value — use `Command`.\n */\nexport function Combobox<T extends string = string>({\n options,\n value: valueProp,\n defaultValue = null,\n onValueChange,\n label,\n placeholder = 'Select…',\n size: sizeProp,\n disabled = false,\n invalid = false,\n clearable = true,\n filter,\n emptyMessage = 'No matches',\n renderOption,\n className,\n}: ComboboxProps<T>) {\n const size = useControlSize(sizeProp);\n const [value, setValue] = useControllableState<T | null>({\n value: valueProp,\n defaultValue,\n onChange: onValueChange as ((next: T | null) => void) | undefined,\n });\n\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useState('');\n const [activeIndex, setActiveIndex] = useState(0);\n\n const baseId = useId();\n const listboxId = `${baseId}-listbox`;\n const optionId = (index: number) => `${baseId}-option-${index}`;\n\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLDivElement | null>(null);\n const rootRef = useRef<HTMLDivElement>(null);\n const field = useFieldControl();\n\n const matches = useMemo(() => {\n const predicate =\n filter ?? ((option: ComboboxOption<T>, q: string) =>\n option.label.toLowerCase().includes(q.toLowerCase()));\n return query ? options.filter((option) => predicate(option, query)) : options;\n }, [options, query, filter]);\n\n const selected = options.find((option) => option.value === value) ?? null;\n\n // What the input displays: the query while filtering, the selection otherwise.\n const displayValue = open ? query : (selected?.label ?? '');\n\n const close = useCallback((restoreFocus = true) => {\n setOpen(false);\n setQuery('');\n if (restoreFocus) inputRef.current?.focus();\n }, []);\n\n const commit = (option: ComboboxOption<T>) => {\n if (option.disabled) return;\n setValue(clearable && option.value === value ? null : option.value);\n close();\n };\n\n const move = (delta: number) => {\n if (matches.length === 0) return;\n setActiveIndex((current) => {\n let next = current;\n for (let i = 0; i < matches.length; i++) {\n next = (next + delta + matches.length) % matches.length;\n if (!matches[next]?.disabled) break;\n }\n return next;\n });\n };\n\n const { refs, floatingStyles } = useFloatingPanel({\n open,\n onOpenChange: setOpen,\n side: 'bottom',\n align: 'start',\n sideOffset: 4,\n matchAnchorWidth: true,\n });\n\n useEffect(() => {\n refs.setReference(rootRef.current);\n }, [refs, open]);\n\n // Reset the highlight whenever the result set changes, so it never points past the end.\n useEffect(() => {\n setActiveIndex(0);\n }, [query, options]);\n\n // Keep the highlighted option in view. `aria-activedescendant` moves the virtual cursor but\n // does not scroll, which DOM focus would have done for free.\n useEffect(() => {\n if (!open) return;\n const node = listRef.current?.querySelector(`#${CSS.escape(optionId(activeIndex))}`);\n // Feature-detected: `scrollIntoView` is absent in jsdom and in some embedded webviews,\n // and an unguarded call there throws during render of an otherwise working combobox.\n if (node instanceof Element && typeof node.scrollIntoView === 'function') {\n node.scrollIntoView({ block: 'nearest' });\n }\n });\n\n useEffect(() => {\n if (!open) return;\n function onPointerDown(event: PointerEvent) {\n const withinRoot = rootRef.current?.contains(event.target as Node);\n const withinList = listRef.current?.contains(event.target as Node);\n if (!withinRoot && !withinList) close(false);\n }\n document.addEventListener('pointerdown', onPointerDown);\n return () => document.removeEventListener('pointerdown', onPointerDown);\n }, [open, close]);\n\n let renderedGroup: string | undefined;\n\n return (\n <div ref={rootRef} className={clsx('relative w-full', className)}>\n <div\n className={clsx(\n 'flex w-full items-center gap-2 rounded-lg border transition-colors',\n HEIGHT[size],\n 'focus-within:ring-2 focus-within:ring-offset-1 focus-within:ring-offset-default',\n disabled\n ? 'cursor-not-allowed border-disabled bg-disabled'\n : invalid || field['aria-invalid']\n ? 'border-danger-secondary focus-within:border-danger focus-within:ring-danger'\n : 'border-default bg-default focus-within:border-brand focus-within:ring-brand',\n )}\n >\n <input\n ref={inputRef}\n // ARIA 1.2: the role goes on the input the user actually focuses.\n role=\"combobox\"\n type=\"text\"\n autoComplete=\"off\"\n aria-expanded={open}\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open && matches.length > 0 ? optionId(activeIndex) : undefined}\n aria-label={label}\n {...field}\n disabled={disabled}\n value={displayValue}\n placeholder={selected ? selected.label : placeholder}\n onChange={(event) => {\n setQuery(event.target.value);\n if (!open) setOpen(true);\n }}\n onFocus={() => !disabled && setOpen(true)}\n onKeyDown={(event) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!open) setOpen(true);\n else move(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (!open) setOpen(true);\n else move(-1);\n break;\n case 'Home':\n if (open) {\n event.preventDefault();\n setActiveIndex(0);\n }\n break;\n case 'End':\n if (open) {\n event.preventDefault();\n setActiveIndex(matches.length - 1);\n }\n break;\n case 'Enter':\n if (open && matches[activeIndex]) {\n event.preventDefault();\n commit(matches[activeIndex]);\n }\n break;\n case 'Escape':\n event.preventDefault();\n close();\n break;\n case 'Tab':\n // Tab commits nothing and closes — the value only changes on Enter or click,\n // so tabbing away cannot silently pick whatever happened to be highlighted.\n if (open) close(false);\n break;\n default:\n break;\n }\n }}\n className={clsx(\n 'min-w-0 flex-1 bg-transparent text-default outline-none',\n 'placeholder:text-default-tertiary',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n )}\n />\n <LuChevronDown\n aria-hidden\n className={clsx(\n 'shrink-0 transition-transform',\n size === 'sm' ? 'size-3' : 'size-4',\n disabled ? 'text-icon-disabled' : 'text-icon-default-secondary',\n open && 'rotate-180',\n )}\n />\n </div>\n\n {open && (\n <Portal>\n <div\n ref={(node) => {\n listRef.current = node;\n refs.setFloating(node);\n }}\n id={listboxId}\n role=\"listbox\"\n aria-label={label}\n style={{ ...floatingStyles, width: 'var(--panel-anchor-width)' }}\n className={clsx('z-dropdown', OVERLAY_PANEL, OVERLAY_PANEL_SCROLL)}\n >\n {matches.length === 0 && (\n <p className=\"px-2.5 py-2 text-body-xs text-default-secondary\">{emptyMessage}</p>\n )}\n {matches.map((option, index) => {\n const isSelected = option.value === value;\n const isActive = index === activeIndex;\n const groupHeading = option.group !== renderedGroup ? option.group : undefined;\n renderedGroup = option.group;\n\n return (\n <div key={String(option.value)}>\n {groupHeading && (\n <div\n role=\"presentation\"\n className={OVERLAY_HEADING}\n >\n {groupHeading}\n </div>\n )}\n {/* Options are deliberately not focusable and carry no key handler. In the\n ARIA 1.2 combobox pattern focus never leaves the input — moving it into\n the list would stop the user typing — and `aria-activedescendant`\n carries the highlight instead, with the input owning every key.\n jsx-a11y cannot model that, so it sees an unreachable option; it is\n reachable, just not by DOM focus. */}\n {/* eslint-disable-next-line jsx-a11y/interactive-supports-focus, jsx-a11y/click-events-have-key-events */}\n <div\n id={optionId(index)}\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={option.disabled || undefined}\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => commit(option)}\n onPointerEnter={() => !option.disabled && setActiveIndex(index)}\n className={clsx(\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE.md,\n 'items-center',\n option.disabled\n ? 'cursor-not-allowed text-disabled'\n : isActive\n ? clsx(OVERLAY_ITEM_ACTIVE, 'text-default')\n : 'text-default',\n )}\n >\n {renderOption ? (\n renderOption(option, isSelected)\n ) : (\n <>\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate\">{option.label}</span>\n {option.description && (\n <span className=\"block truncate text-body-tiny text-default-secondary\">\n {option.description}\n </span>\n )}\n </span>\n {isSelected && (\n <LuCheck aria-hidden className=\"size-3.5 shrink-0 text-brand\" strokeWidth={3} />\n )}\n </>\n )}\n </div>\n </div>\n );\n })}\n </div>\n </Portal>\n )}\n </div>\n );\n}\n","import { RoleBadge } from '../status/role-badge';\nimport { Combobox, type ComboboxOption } from './combobox';\nimport type { InputSize } from './input';\n\nexport interface RoleOption {\n role: string;\n description: string;\n}\n\nexport const ROLE_COMBO_OPTIONS: RoleOption[] = [\n { role: 'Reviewer', description: 'Reviews onboarding requests' },\n { role: 'Admin', description: 'Full org control' },\n { role: 'Compliance Lead', description: 'Owns compliance' },\n { role: 'Requester', description: 'Creates onboarding requests' },\n { role: 'Viewer', description: 'Read-only access' },\n { role: 'User', description: 'Default user access' },\n];\n\nexport interface RoleComboBoxProps {\n value: string;\n onChange: (role: string) => void;\n options?: RoleOption[];\n /** Accessible name. Defaults to `Role`. */\n label?: string;\n size?: InputSize;\n disabled?: boolean;\n className?: string;\n}\n\n/**\n * Role picker.\n *\n * Rebuilt in 0.4.0 as a thin wrapper over `Combobox`, which is all it should ever have been.\n * The version it replaces was the least correct component in the library and is worth\n * recording, because every one of these was a category of bug rather than a detail:\n *\n * - `role=\"combobox\"` sat on a `<div>` while the real `<input>` had no role and none of the\n * state attributes. Under ARIA 1.2 the role belongs on the input.\n * - The `role=\"listbox\"` had no `id`, so `aria-controls` could not point at it, and there\n * was no `aria-activedescendant` at all.\n * - No arrow keys, no Home/End, no wrap. The **selected** option had no `tabIndex`, so it\n * was mouse-only, while every *other* option was individually tabbable.\n * - Escape worked on the trigger but not on the search input or the options, and closing\n * never returned focus to the trigger.\n * - The tick was a literal `✓` text node, announced as \"check mark\" mid-option.\n * - It bypassed the token system entirely — `border-blue-500`, `bg-white`, `bg-blue-50`,\n * `text-blue-600`, `text-sm` — and built its className with a template literal. Both are\n * explicitly against the rules in CLAUDE.md, and the raw colours meant it would not theme.\n *\n * It stays a preset rather than becoming `Combobox` usage at every call site only because it\n * renders a `RoleBadge` per option, which `renderOption` exists for.\n */\nexport function RoleComboBox({\n value,\n onChange,\n options = ROLE_COMBO_OPTIONS,\n label = 'Role',\n size = 'md',\n disabled = false,\n className,\n}: RoleComboBoxProps) {\n const comboboxOptions: ComboboxOption[] = options.map((option) => ({\n value: option.role,\n label: option.role,\n description: option.description,\n }));\n\n return (\n <Combobox\n options={comboboxOptions}\n value={value}\n onValueChange={(next) => next && onChange(next)}\n label={label}\n size={size}\n disabled={disabled}\n // A role is always set — there is no \"no role\" state — so re-selecting must not clear.\n clearable={false}\n emptyMessage=\"No roles match\"\n className={className}\n renderOption={(option) => (\n <>\n <RoleBadge role={option.value} size=\"sm\" />\n <span className=\"min-w-0 flex-1 truncate text-body-xs text-default-secondary\">\n {option.description}\n </span>\n </>\n )}\n />\n );\n}\n","import { useEffect, useId, useMemo, useRef, useState, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuSearch } from 'react-icons/lu';\n\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\n\nimport {\n OVERLAY_HEADING,\n OVERLAY_ITEM_ACTIVE,\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE,\n} from '../overlays/menu-styles';\n\nexport interface CommandItem {\n id: string;\n label: string;\n description?: string;\n /** Group heading. Items sharing a group render together, in the order given. */\n group?: string;\n icon?: ReactNode;\n /** Trailing hint — pass `<Kbd>` elements. */\n shortcut?: ReactNode;\n /** Extra words to match on that are not in the label — synonyms, the old name of a page. */\n keywords?: string[];\n disabled?: boolean;\n onSelect: () => void;\n}\n\nexport interface CommandProps {\n items: CommandItem[];\n /** Accessible name. Default `Command palette`. */\n label?: string;\n placeholder?: string;\n emptyMessage?: ReactNode;\n /** Called after any item is chosen — usually closes the containing dialog. */\n onAfterSelect?: () => void;\n autoFocus?: boolean;\n className?: string;\n}\n\n/**\n * A ⌘K command palette — filter over *actions* and run one.\n *\n * The same ARIA combobox pattern as `Combobox`, and for the same reasons: `role=\"combobox\"`\n * on the input, focus never leaving it, and `aria-activedescendant` carrying the highlight.\n * What differs is the intent, and it changes two behaviours:\n *\n * - Items are **commands, not values**. There is no selected state to display, no way to\n * clear, and choosing one runs a callback rather than setting anything.\n * - Matching includes `keywords`, so \"logout\" can find \"Sign out\" — a palette is useless if\n * you have to already know the wording.\n *\n * This is the palette body only. Put it in a `Modal` for the usual ⌘K overlay; keeping the\n * two separate means the palette can also be embedded in a page or a `Popover`, and the\n * dialog semantics stay with the component that owns them.\n *\n * A live region reports the result count, because otherwise a screen reader user typing into\n * the filter gets no feedback that the list changed underneath them.\n */\nexport function Command({\n items,\n label = 'Command palette',\n placeholder = 'Type a command or search…',\n emptyMessage = 'No results',\n onAfterSelect,\n autoFocus = true,\n className,\n}: CommandProps) {\n const [query, setQuery] = useState('');\n const [activeIndex, setActiveIndex] = useState(0);\n\n const baseId = useId();\n const listboxId = `${baseId}-listbox`;\n const optionId = (index: number) => `${baseId}-option-${index}`;\n\n const listRef = useRef<HTMLDivElement>(null);\n\n const matches = useMemo(() => {\n if (!query) return items;\n const q = query.toLowerCase();\n return items.filter((item) => {\n if (item.label.toLowerCase().includes(q)) return true;\n if (item.group?.toLowerCase().includes(q)) return true;\n return item.keywords?.some((keyword) => keyword.toLowerCase().includes(q)) ?? false;\n });\n }, [items, query]);\n\n useEffect(() => {\n setActiveIndex(0);\n }, [query]);\n\n useEffect(() => {\n const node = listRef.current?.querySelector(`#${CSS.escape(optionId(activeIndex))}`);\n // Feature-detected — see the same note in `Combobox`. Absent in jsdom and some webviews.\n if (node instanceof Element && typeof node.scrollIntoView === 'function') {\n node.scrollIntoView({ block: 'nearest' });\n }\n });\n\n const run = (item: CommandItem) => {\n if (item.disabled) return;\n item.onSelect();\n onAfterSelect?.();\n };\n\n const move = (delta: number) => {\n if (matches.length === 0) return;\n setActiveIndex((current) => {\n let next = current;\n for (let i = 0; i < matches.length; i++) {\n next = (next + delta + matches.length) % matches.length;\n if (!matches[next]?.disabled) break;\n }\n return next;\n });\n };\n\n let renderedGroup: string | undefined;\n\n return (\n <div className={clsx('flex w-full flex-col', className)}>\n <div className=\"flex items-center gap-2 border-b border-default px-3.5 py-3\">\n <LuSearch aria-hidden className=\"size-4 shrink-0 text-icon-default-secondary\" />\n <input\n role=\"combobox\"\n type=\"text\"\n autoComplete=\"off\"\n // A palette's list is always visible while it is open, so `aria-expanded` is\n // permanently true rather than tracking a collapsed state that never happens.\n aria-expanded\n aria-controls={listboxId}\n aria-autocomplete=\"list\"\n aria-activedescendant={matches.length > 0 ? optionId(activeIndex) : undefined}\n aria-label={label}\n // Autofocus is correct here specifically: a command palette is opened by an\n // explicit gesture (⌘K) whose entire purpose is to start typing, so *not* focusing\n // the input would strand the user. The rule guards against autofocus on ordinary\n // page load, which this is not. Caller can still opt out.\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={autoFocus}\n value={query}\n placeholder={placeholder}\n onChange={(event) => setQuery(event.target.value)}\n onKeyDown={(event) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n move(1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n move(-1);\n break;\n case 'Home':\n event.preventDefault();\n setActiveIndex(0);\n break;\n case 'End':\n event.preventDefault();\n setActiveIndex(matches.length - 1);\n break;\n case 'Enter':\n if (matches[activeIndex]) {\n event.preventDefault();\n run(matches[activeIndex]);\n }\n break;\n default:\n break;\n }\n }}\n className=\"min-w-0 flex-1 bg-transparent text-body-sm text-default outline-none placeholder:text-default-tertiary\"\n />\n </div>\n\n <div\n ref={listRef}\n id={listboxId}\n role=\"listbox\"\n aria-label={label}\n // Focus stays in the filter input and `aria-activedescendant` carries the\n // highlight, so this must not become a tab stop of its own.\n className={clsx('max-h-80 overflow-y-auto p-1.5', SCROLLBAR_CLASSES)}\n >\n {matches.length === 0 && (\n <p className=\"px-2.5 py-6 text-center text-body-sm text-default-secondary\">\n {emptyMessage}\n </p>\n )}\n {matches.map((item, index) => {\n const isActive = index === activeIndex;\n const groupHeading = item.group !== renderedGroup ? item.group : undefined;\n renderedGroup = item.group;\n\n return (\n <div key={item.id}>\n {groupHeading && (\n <div\n role=\"presentation\"\n className={OVERLAY_HEADING}\n >\n {groupHeading}\n </div>\n )}\n {/* Not focusable by design — see the note in `Combobox`. Focus stays in the\n filter input and `aria-activedescendant` carries the highlight. */}\n {/* eslint-disable-next-line jsx-a11y/interactive-supports-focus, jsx-a11y/click-events-have-key-events */}\n <div\n id={optionId(index)}\n role=\"option\"\n aria-selected={isActive}\n aria-disabled={item.disabled || undefined}\n onPointerDown={(event) => event.preventDefault()}\n onClick={() => run(item)}\n onPointerEnter={() => !item.disabled && setActiveIndex(index)}\n className={clsx(\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE.md,\n 'items-center',\n item.disabled\n ? 'cursor-not-allowed text-disabled'\n : isActive\n ? clsx(OVERLAY_ITEM_ACTIVE, 'text-default')\n : 'text-default',\n )}\n >\n {item.icon && (\n <span aria-hidden className=\"flex size-4 shrink-0 items-center justify-center\">\n {item.icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate\">{item.label}</span>\n {item.description && (\n <span className=\"block truncate text-body-tiny text-default-secondary\">\n {item.description}\n </span>\n )}\n </span>\n {item.shortcut && (\n <span className=\"ml-auto flex shrink-0 items-center gap-1\">{item.shortcut}</span>\n )}\n </div>\n </div>\n );\n })}\n </div>\n\n {/* Typing filters the list silently otherwise — a sighted user sees it shrink, a\n screen reader user gets nothing. */}\n <span aria-live=\"polite\" className=\"sr-only\">\n {`${matches.length} ${matches.length === 1 ? 'result' : 'results'}`}\n </span>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * The six status tones from the Figma design system.\n * Values live in `src/app/styles/tokens/status.css`; see that file for why they do\n * not derive from the SDS semantic colour families.\n */\nexport type StatusTone =\n | 'neutral'\n | 'info'\n | 'warning'\n | 'caution'\n | 'accent'\n | 'positive'\n | 'danger';\n\nexport type StatusBadgeSize = 'sm' | 'md';\n\nconst TONE_STYLES: Record<StatusTone, string> = {\n neutral: 'bg-status-neutral text-status-neutral',\n info: 'bg-status-info text-status-info',\n warning: 'bg-status-warning text-status-warning',\n caution: 'bg-status-caution text-status-caution',\n accent: 'bg-status-accent text-status-accent',\n positive: 'bg-status-positive text-status-positive',\n danger: 'bg-status-danger text-status-danger',\n};\n\nconst DOT_STYLES: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nconst SIZE_STYLES: Record<StatusBadgeSize, string> = {\n sm: 'px-2 py-0.5 text-body-tiny',\n md: 'px-3 py-1 text-body-xs',\n};\n\nexport interface StatusBadgeProps {\n label: string;\n tone?: StatusTone;\n size?: StatusBadgeSize;\n /** Leading dot. On by default — the Figma status pills all carry one. */\n dot?: boolean;\n /**\n * Leading glyph, replacing the dot — e.g. `<LuCheck className=\"size-3\" />`.\n * Use for states a colour alone under-states, like verified or rejected.\n */\n icon?: ReactNode;\n className?: string;\n}\n\n/**\n * The status pill.\n *\n * Replaces thirteen inline re-implementations of the same markup plus five\n * competing hardcoded hex palettes. Generalises `TableCellStatusPill`, which had\n * this exact markup but required callers to pass raw hex strings.\n *\n * Note this is NOT `StatusChip` — that one renders a label *and a count* and is a\n * different component.\n */\nexport function StatusBadge({\n label,\n tone = 'neutral',\n size = 'md',\n dot = true,\n icon,\n className,\n}: StatusBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full font-medium leading-tight whitespace-nowrap',\n SIZE_STYLES[size],\n TONE_STYLES[tone],\n className,\n )}\n >\n {icon ? (\n <span className=\"shrink-0\">{icon}</span>\n ) : (\n dot && <span className={clsx('size-1.5 shrink-0 rounded-full', DOT_STYLES[tone])} />\n )}\n {label}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nexport type StatusDotTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral' | 'default';\n\nexport interface StatusDotProps {\n tone?: StatusDotTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex color, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n color?: string;\n className?: string;\n}\n\nconst dotTones: Record<StatusDotTone, string> = {\n brand: 'bg-brand',\n positive:'bg-positive',\n warning: 'bg-warning',\n danger: 'bg-danger',\n neutral: 'bg-neutral',\n default: 'bg-default-tertiary',\n};\n\nexport function StatusDot({ tone = 'default', color, className }: StatusDotProps) {\n return (\n <span\n className={clsx('inline-block size-1.5 shrink-0 rounded-full', !color && dotTones[tone], className)}\n style={color ? { backgroundColor: color } : undefined}\n />\n );\n}\n","import clsx from 'clsx';\nimport { StatusDot } from './status-dot';\nimport type { StatusDotTone } from './status-dot';\n\nexport interface StatusChipProps {\n label: string;\n count: number | string;\n tone?: StatusDotTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex dot color, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n dotColor?: string;\n bg?: string;\n className?: string;\n}\n\nexport function StatusChip({ label, count, tone = 'default', dotColor, bg, className }: StatusChipProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full px-3 py-1',\n !bg && 'bg-default-secondary',\n className,\n )}\n style={bg ? { backgroundColor: bg } : undefined}\n >\n <StatusDot tone={tone} color={dotColor} />\n <span className=\"text-body-xs font-medium text-default\">{count}</span>\n <span className=\"text-body-xs text-default-secondary\">{label}</span>\n </span>\n );\n}\n","import clsx from 'clsx';\nimport { StatusDot } from './status-dot';\nimport type { StatusDotTone } from './status-dot';\n\nexport interface CountBadgeProps {\n count: number | string;\n label?: string;\n tone?: StatusDotTone;\n className?: string;\n}\n\nexport function CountBadge({ count, label, tone = 'positive', className }: CountBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded-full border border-default px-3 py-1 text-body-xs font-medium text-default',\n className,\n )}\n >\n <StatusDot tone={tone} />\n {count}\n {label && <span className=\"text-default-secondary\">{label}</span>}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nexport type TagPillTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger';\n\nexport interface TagPillProps {\n label: string;\n tone?: TagPillTone;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex bg/text pair, overrides `tone` via inline style. Use when the exact source colors don't match design tokens. */\n bg?: string;\n color?: string;\n className?: string;\n}\n\nconst toneStyles: Record<TagPillTone, string> = {\n default: 'bg-default-secondary text-default-secondary',\n brand: 'bg-brand-tertiary text-brand',\n positive:'bg-positive-tertiary text-positive',\n warning: 'bg-warning-tertiary text-warning',\n danger: 'bg-danger-tertiary text-danger',\n};\n\nexport function TagPill({ label, tone = 'default', bg, color, className }: TagPillProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-full px-2 py-0.5 text-body-xs font-medium',\n !bg && !color && toneStyles[tone],\n className,\n )}\n style={{\n ...(bg ? { backgroundColor: bg } : undefined),\n ...(color ? { color } : undefined),\n }}\n >\n {label}\n </span>\n );\n}\n","import clsx from 'clsx';\n\nimport type { StatusTone } from './status-badge';\n\nconst DOT: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nexport interface TrailChipProps {\n label: string;\n value: string;\n tone?: StatusTone;\n /**\n * Data-driven dot colour, overriding `tone`. The investigations trail mirrors the\n * severity accent of whichever tree node is selected, and those accents come from\n * the row data rather than the status palette — this is the escape hatch Phase 10\n * classifies as \"genuinely data-driven colour\", not a token bypass.\n */\n dotColor?: string;\n className?: string;\n}\n\n/**\n * Dot + small uppercase label + value, used for the drill-down breadcrumb trail on\n * the investigations page.\n *\n * Promoted from `pages/investigations`, where the dot colour was passed as a raw hex.\n */\nexport function TrailChip({ label, value, tone = 'info', dotColor, className }: TrailChipProps) {\n return (\n <div\n className={clsx(\n 'flex items-center gap-2 rounded-full border border-default bg-default px-3 py-1.5',\n className,\n )}\n >\n <span\n className={clsx('size-1.5 shrink-0 rounded-full', !dotColor && DOT[tone])}\n style={dotColor ? { backgroundColor: dotColor } : undefined}\n />\n <span className=\"text-body-tiny font-semibold uppercase tracking-wide text-default-secondary\">\n {label}\n </span>\n <span className=\"text-body-xs font-medium text-default\">{value}</span>\n </div>\n );\n}\n","import { StatusBadge, type StatusTone } from './status-badge';\n\nexport type UserAccountStatus = 'active' | 'pending' | 'deactivated';\n\nconst STATUS_META: Record<UserAccountStatus, { label: string; tone: StatusTone }> = {\n active: { label: 'Active', tone: 'positive' },\n // `caution` (pale yellow), not `warning` (orange) — Pending is one step below a\n // warning on the severity ramp, and reads as waiting rather than at risk.\n pending: { label: 'Pending', tone: 'caution' },\n deactivated: { label: 'Deactivated', tone: 'danger' },\n};\n\nexport interface UserStatusPillProps {\n status: UserAccountStatus;\n}\n\n/** Account-status pill. A thin wrapper over `StatusBadge`. */\nexport function UserStatusPill({ status }: UserStatusPillProps) {\n const { label, tone } = STATUS_META[status];\n return <StatusBadge label={label} tone={tone} />;\n}\n","import clsx from 'clsx';\nimport { LuCheck, LuCircleAlert, LuLoaderCircle, LuMinus, LuX } from 'react-icons/lu';\n\n/**\n * States of a compliance check.\n *\n * Union of the two previously-divergent local unions:\n * - `features/entity-detail` had passed | in_progress | pending | action_required\n * - `features/reviewer-detail` had passed | in-progress | failed | pending | waived\n *\n * Note `in_progress` (underscore) is canonical — entity-detail's spelling, which is\n * the one backed by the API. reviewer-detail used `in-progress` (hyphen) in mock data.\n */\nexport type CheckIndicatorStatus =\n | 'passed'\n | 'in_progress'\n | 'action_required'\n | 'failed'\n | 'pending'\n | 'waived';\n\n/**\n * `action_required` and `failed` share the Figma colours and differ only in glyph\n * (`!` vs `✕`); `waived` shares `pending`'s colours and adds a dash.\n */\nconst STATUS_STYLES: Record<CheckIndicatorStatus, string> = {\n passed: 'bg-status-check-passed border-status-check-passed text-status-check-passed',\n in_progress: 'bg-status-check-progress border-status-check-progress text-status-check-progress',\n action_required: 'bg-status-check-failed border-status-check-failed text-status-check-failed',\n failed: 'bg-status-check-failed border-status-check-failed text-status-check-failed',\n pending: 'bg-status-check-pending border-status-check-pending text-status-check-pending',\n waived: 'bg-status-check-pending border-status-check-pending text-status-check-pending',\n};\n\n/**\n * Glyphs — every one now comes from `react-icons/lu`, so the set is stroke-consistent.\n *\n * The two that used to be typographic: `◐` became `LuLoaderCircle` (lucide has no\n * half-filled circle, but a partial ring reads as in-progress and is a real icon), and\n * `!` became `LuCircleAlert`. Both are a small visual change from 0.2.0.\n */\nfunction StatusGlyph({ status }: { status: CheckIndicatorStatus }) {\n switch (status) {\n case 'passed':\n return <LuCheck className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'failed':\n return <LuX className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'waived':\n return <LuMinus className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'in_progress':\n return <LuLoaderCircle className=\"size-3\" strokeWidth={3} aria-hidden />;\n case 'action_required':\n return <LuCircleAlert className=\"size-3.5\" strokeWidth={2.5} aria-hidden />;\n case 'pending':\n return null;\n }\n}\n\nexport interface CheckIndicatorProps {\n status: CheckIndicatorStatus;\n /** Accessible label. Without one the indicator is decorative, which is correct when an adjacent text label already names the state. */\n label?: string;\n className?: string;\n}\n\n/**\n * The 22px outlined circle used for compliance-check state in entity and reviewer\n * detail. Ring and glyph share one colour; see the check tokens in\n * `src/app/styles/tokens/status.css`.\n */\nexport function CheckIndicator({ status, label, className }: CheckIndicatorProps) {\n return (\n <div\n className={clsx(\n 'flex size-[22px] shrink-0 items-center justify-center rounded-full border-[1.5px]',\n STATUS_STYLES[status],\n className,\n )}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n >\n <StatusGlyph status={status} />\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EntityIconBadgeSize = 'sm' | 'md';\nexport type EntityIconBadgeTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';\nexport type EntityIconBadgeShape = 'square' | 'circle';\n\nexport interface EntityIconBadgeProps {\n size?: EntityIconBadgeSize;\n tone?: EntityIconBadgeTone;\n /**\n * `square` is the rounded-rect used on entity rows. `circle` is the tinted glyph\n * circle used in modal headers. A prop rather than a `className` override, so it\n * does not depend on Tailwind's stylesheet emit order.\n */\n shape?: EntityIconBadgeShape;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex background, overrides `tone` via inline style. Use when the exact source color doesn't match a design token. */\n bg?: string;\n iconColor?: string;\n children: ReactNode;\n className?: string;\n}\n\nconst sizeStyles: Record<EntityIconBadgeSize, string> = {\n sm: 'size-8',\n md: 'size-10',\n};\n\nconst shapeStyles: Record<EntityIconBadgeShape, Record<EntityIconBadgeSize, string>> = {\n square: { sm: 'rounded-lg', md: 'rounded-xl' },\n circle: { sm: 'rounded-full', md: 'rounded-full' },\n};\n\nconst toneStyles: Record<EntityIconBadgeTone, string> = {\n default: 'bg-default-secondary text-icon-default',\n brand: 'bg-brand-tertiary text-icon-brand',\n positive:'bg-positive-tertiary text-icon-positive',\n warning: 'bg-warning-tertiary text-icon-warning',\n danger: 'bg-danger-tertiary text-icon-danger',\n neutral: 'bg-neutral-tertiary text-icon-neutral',\n};\n\nexport function EntityIconBadge({ size = 'sm', tone = 'default', shape = 'square', bg, iconColor, children, className }: EntityIconBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex shrink-0 items-center justify-center',\n sizeStyles[size],\n shapeStyles[shape][size],\n !bg && !iconColor && toneStyles[tone],\n className,\n )}\n style={{\n ...(bg ? { backgroundColor: bg } : undefined),\n ...(iconColor ? { color: iconColor } : undefined),\n }}\n >\n {children}\n </span>\n );\n}\n","import { forwardRef, useEffect, useId, useRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { CheckControl, type CheckControlSize } from './check-control';\n\nexport type CheckboxSize = CheckControlSize;\n\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'checked'> {\n /** Controlled. Omit and pass `defaultChecked` for uncontrolled. */\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n label?: ReactNode;\n /** Second line under the label. Matches Figma's `Supporting text` axis. */\n description?: ReactNode;\n /** Matches Figma's `Size` axis. Default `md`, which is 0.3.0's fixed 18px. */\n size?: CheckboxSize;\n indeterminate?: boolean;\n invalid?: boolean;\n className?: string;\n}\n\nconst LABEL_TEXT: Record<CheckboxSize, string> = {\n sm: 'text-body-tiny',\n md: 'text-body-xs',\n};\n\n/**\n * Checkbox built on a real `<input type=\"checkbox\">`.\n *\n * Widened in 0.4.0 to match Figma's `Checkbox` set, which has `Size: sm | md`,\n * `Text` and `Supporting text` axes — none of which existed in code, where the control was\n * a fixed 18px with an optional single-line label and no `id`, `name`, `value`, `required`\n * or ref. It also had no uncontrolled mode: `checked` and `onChange` were both required, so\n * the simplest possible use site needed a `useState` in the consumer.\n *\n * `onChange` became `onCheckedChange` and takes a boolean, matching the rest of 0.4.0.\n * The native `onChange` event shape is still reachable — the ref is forwarded to the real\n * input, so `react-hook-form`'s `register()` works.\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n checked: checkedProp,\n defaultChecked = false,\n onCheckedChange,\n label,\n description,\n size = 'md',\n indeterminate = false,\n invalid = false,\n disabled = false,\n id,\n className,\n ...props\n },\n ref,\n) {\n const [checked, setChecked] = useControllableState({\n value: checkedProp,\n defaultValue: defaultChecked,\n onChange: onCheckedChange,\n });\n\n const inputRef = useRef<HTMLInputElement>(null);\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n\n // `indeterminate` is a DOM property with no React attribute, so it has to be applied\n // imperatively.\n useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n return (\n <div className={clsx('flex flex-col', className)}>\n <label\n htmlFor={controlId}\n className={clsx(\n 'group inline-flex items-start gap-2.5',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n )}\n >\n <input\n ref={composeRefs<HTMLInputElement>(inputRef, ref)}\n id={controlId}\n type=\"checkbox\"\n checked={checked}\n disabled={disabled}\n aria-invalid={invalid || undefined}\n aria-describedby={description ? descriptionId : undefined}\n onChange={(event) => setChecked(event.target.checked)}\n className=\"peer sr-only\"\n {...props}\n />\n <CheckControl\n type=\"checkbox\"\n checked={checked}\n indeterminate={indeterminate}\n disabled={disabled}\n invalid={invalid}\n size={size}\n />\n {label && <span className={clsx(LABEL_TEXT[size], 'text-default')}>{label}</span>}\n </label>\n {/* Outside the <label>, deliberately. Anything inside a label becomes part of the\n control's *accessible name*, so a nested description turns the name into\n \"Marketing We will not spam you\" — and `aria-describedby` then points at text that\n was already read as the name. Indented to line up under the label text. */}\n {description && (\n <span\n id={descriptionId}\n className={clsx(\n 'mt-0.5 pl-[26px]',\n LABEL_TEXT[size],\n disabled ? 'text-disabled' : 'text-default-secondary',\n )}\n >\n {description}\n </span>\n )}\n </div>\n );\n});\n","import clsx from 'clsx';\nimport { LuCheck, LuMinus } from 'react-icons/lu';\n\nexport type CheckControlSize = 'sm' | 'md';\n\n/**\n * The box/circle glyph shared by `Checkbox` and `RadioGroup`.\n *\n * Figma models both in a single `Checkbox` component set with a `Type: Checkbox | Radio`\n * axis and a `Size: sm | md` axis, because the geometry, border weight, states and\n * spacing are identical — only the corner radius and the checked mark differ. Splitting\n * them in code while Figma keeps them together is how the two drift, so this holds the\n * shared half.\n *\n * Always `aria-hidden`: the real `<input>` carries the state, and this is its picture.\n */\nexport const CHECK_SIZE: Record<CheckControlSize, { box: string; glyph: string; dot: string }> = {\n sm: { box: 'size-4', glyph: 'size-2.5', dot: 'size-1.5' },\n md: { box: 'size-[18px]', glyph: 'size-3', dot: 'size-2' },\n};\n\nexport interface CheckControlProps {\n type: 'checkbox' | 'radio';\n checked: boolean;\n indeterminate?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n size?: CheckControlSize;\n}\n\nexport function CheckControl({\n type,\n checked,\n indeterminate = false,\n disabled = false,\n invalid = false,\n size = 'md',\n}: CheckControlProps) {\n const s = CHECK_SIZE[size];\n const on = checked || indeterminate;\n\n return (\n <span\n aria-hidden\n className={clsx(\n 'mt-px flex shrink-0 items-center justify-center border-[1.5px] transition-colors',\n s.box,\n type === 'radio' ? 'rounded-full' : 'rounded-[4px]',\n // Ring is drawn from the peer input's focus state, so the visual box tracks real\n // focus rather than hover.\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand peer-focus-visible:ring-offset-1 peer-focus-visible:ring-offset-default',\n disabled\n ? on\n ? 'border-disabled bg-disabled text-disabled-on-disabled'\n : 'border-disabled bg-disabled'\n : on\n ? 'border-brand-emphasis bg-brand text-brand-on-brand'\n : invalid\n ? 'border-danger bg-default'\n : 'border-default-secondary bg-default',\n )}\n >\n {type === 'checkbox' ? (\n indeterminate ? (\n <LuMinus className={s.glyph} strokeWidth={3} />\n ) : checked ? (\n <LuCheck className={s.glyph} strokeWidth={3} />\n ) : null\n ) : checked ? (\n <span className={clsx('rounded-full bg-current', s.dot)} />\n ) : null}\n </span>\n );\n}\n","import {\n createContext,\n forwardRef,\n useContext,\n useId,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { CheckControl, type CheckControlSize } from './check-control';\n\nexport type RadioGroupOrientation = 'vertical' | 'horizontal';\n\ninterface RadioGroupContextValue {\n name: string;\n value: string | undefined;\n setValue: (value: string) => void;\n size: CheckControlSize;\n disabled: boolean;\n invalid: boolean;\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\nexport interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n children: ReactNode;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Shared `name` for the underlying inputs. Generated when omitted. */\n name?: string;\n /** Names the group. Prefer wrapping in `FieldSet` + `FieldLegend` for a visible label. */\n label?: string;\n size?: CheckControlSize;\n orientation?: RadioGroupOrientation;\n disabled?: boolean;\n invalid?: boolean;\n required?: boolean;\n}\n\n/**\n * Radio group. Matches the `Type=Radio` half of Figma's `Checkbox` set, and shares its\n * geometry through `CheckControl`.\n *\n * Built on real `<input type=\"radio\">` elements sharing a `name`, which is what buys the\n * whole keyboard contract for free: arrow keys move *and* select, only the checked radio is\n * in the tab sequence, and the group is announced as \"2 of 4\". A `div`-based\n * `role=\"radiogroup\"` has to reimplement all of that, and the version of this pattern the\n * library already had — `SegmentedControl` before 0.4.0 — shipped with none of it.\n *\n * `role=\"radiogroup\"` is still set explicitly rather than relying on a `<fieldset>`, so the\n * group works with or without a visible legend.\n */\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n children,\n value: valueProp,\n defaultValue,\n onValueChange,\n name,\n label,\n size = 'md',\n orientation = 'vertical',\n disabled = false,\n invalid = false,\n required = false,\n className,\n ...rest\n },\n ref,\n) {\n const generatedName = useId();\n const [value, setValue] = useControllableState<string | undefined>({\n value: valueProp,\n defaultValue,\n onChange: onValueChange as ((next: string | undefined) => void) | undefined,\n });\n\n return (\n <RadioGroupContext.Provider\n value={{\n name: name ?? generatedName,\n value,\n setValue: (next) => setValue(next),\n size,\n disabled,\n invalid,\n }}\n >\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-label={label}\n aria-required={required || undefined}\n aria-invalid={invalid || undefined}\n aria-orientation={orientation}\n data-slot=\"radio-group\"\n className={clsx(\n 'flex',\n orientation === 'vertical' ? 'flex-col gap-2.5' : 'flex-row flex-wrap gap-4',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </RadioGroupContext.Provider>\n );\n});\n\nexport interface RadioProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'onChange' | 'checked'> {\n value: string;\n label?: ReactNode;\n /** Second line under the label. Matches Figma's `Supporting text` axis. */\n description?: ReactNode;\n className?: string;\n}\n\nconst LABEL_TEXT: Record<CheckControlSize, string> = {\n sm: 'text-body-tiny',\n md: 'text-body-xs',\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { value, label, description, disabled, id, className, ...props },\n ref,\n) {\n const group = useContext(RadioGroupContext);\n if (!group) throw new Error('<Radio> must be used inside <RadioGroup>');\n\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n const isDisabled = disabled ?? group.disabled;\n const checked = group.value === value;\n\n return (\n <div className={clsx('flex flex-col', className)}>\n <label\n htmlFor={controlId}\n className={clsx(\n 'group inline-flex items-start gap-2.5',\n isDisabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n )}\n >\n <input\n ref={ref}\n id={controlId}\n type=\"radio\"\n name={group.name}\n value={value}\n checked={checked}\n disabled={isDisabled}\n aria-describedby={description ? descriptionId : undefined}\n onChange={() => group.setValue(value)}\n className=\"peer sr-only\"\n {...props}\n />\n <CheckControl\n type=\"radio\"\n checked={checked}\n disabled={isDisabled}\n invalid={group.invalid}\n size={group.size}\n />\n {label && <span className={clsx(LABEL_TEXT[group.size], 'text-default')}>{label}</span>}\n </label>\n {/* Outside the <label> — see the note in `Checkbox`. Text nested in a label becomes\n part of the accessible *name*, so the description would be read twice: once as\n the name and again as the description. */}\n {description && (\n <span\n id={descriptionId}\n className={clsx(\n 'mt-0.5 pl-[26px]',\n LABEL_TEXT[group.size],\n isDisabled ? 'text-disabled' : 'text-default-secondary',\n )}\n >\n {description}\n </span>\n )}\n </div>\n );\n});\n","import clsx from 'clsx';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\nexport interface SegmentedControlOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SegmentedControlProps {\n options: SegmentedControlOption[];\n /** Controlled selection. Omit and pass `defaultValue` for uncontrolled. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Names the group. Required by the APG when the control has no visible label. */\n label?: string;\n className?: string;\n}\n\n/**\n * Single-select segmented toggle.\n *\n * Through 0.3.0 this had **no ARIA whatsoever** — the selected segment was distinguished\n * only by `bg-default shadow-panel`, so a screen reader user could not tell which of the\n * segments was active. It is single-select, so `radiogroup`/`radio` is the correct pattern\n * rather than a row of `aria-pressed` buttons: it announces \"2 of 3\" and lets the arrow\n * keys move between options, which a toggle-button group does not.\n *\n * `onChange` was also optional, so `<SegmentedControl options value />` rendered a control\n * that looked interactive and silently did nothing.\n */\nexport function SegmentedControl({\n options,\n value: valueProp,\n defaultValue,\n onValueChange,\n label,\n className,\n}: SegmentedControlProps) {\n const [value, setValue] = useControllableState({\n value: valueProp,\n defaultValue: defaultValue ?? options[0]?.value,\n onChange: onValueChange,\n });\n\n const selectedIndex = Math.max(\n 0,\n options.findIndex((option) => option.value === value),\n );\n\n const roving = useRovingFocus({\n orientation: 'horizontal',\n loop: true,\n defaultIndex: selectedIndex,\n });\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={clsx(\n 'inline-flex items-center rounded-xl border border-default bg-default-secondary p-0.5',\n className,\n )}\n {...roving.containerProps}\n >\n {options.map((option, index) => {\n const selected = option.value === value;\n const itemProps = roving.itemProps(index, {\n disabled: option.disabled,\n label: option.label,\n });\n\n return (\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n disabled={option.disabled}\n {...itemProps}\n // The tab stop follows selection, not focus, so Tab lands on the active\n // segment rather than wherever the arrows were last used.\n tabIndex={selected ? 0 : -1}\n onFocus={() => {\n itemProps.onFocus();\n if (!option.disabled) setValue(option.value);\n }}\n onClick={() => !option.disabled && setValue(option.value)}\n className={clsx(\n 'rounded-lg px-3.5 py-1.5 text-body-xs font-medium transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default-secondary',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n selected\n ? 'bg-default text-default shadow-panel'\n : 'text-default-secondary hover:text-default',\n )}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n","import { forwardRef, useId, type InputHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport interface SliderProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size' | 'onChange' | 'value'> {\n value?: number;\n defaultValue?: number;\n onValueChange?: (value: number) => void;\n min?: number;\n max?: number;\n step?: number;\n /** Matches Figma's `Label` / `Has Label`. */\n label?: ReactNode;\n /** Matches Figma's `Description` / `Has Description`. */\n description?: ReactNode;\n /** Show the current value at the right of the label row. */\n showValue?: boolean;\n /** Formats the displayed and announced value — percentages, currency, durations. */\n formatValue?: (value: number) => string;\n className?: string;\n}\n\n/**\n * Range slider. Matches Figma's `Slider Field` (`State: Default | Disabled`, with label and\n * description slots).\n *\n * A native `<input type=\"range\">`, deliberately. It arrives with the entire APG slider\n * contract already implemented — arrow keys, Page Up/Down, Home/End, the correct\n * `aria-valuenow`/`valuemin`/`valuemax`, touch and pointer dragging, and RTL handling — and\n * a `div`-based slider has to rebuild all of it. The track and thumb are styled through the\n * vendor pseudo-elements instead, which is the one place raw `[&::-webkit-…]` selectors are\n * the right tool.\n *\n * `formatValue` feeds `aria-valuetext`, because \"70\" announced on a price slider is\n * meaningless where \"£70\" is not.\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(function Slider(\n {\n value,\n defaultValue,\n onValueChange,\n min = 0,\n max = 100,\n step = 1,\n label,\n description,\n showValue = false,\n formatValue,\n disabled = false,\n id,\n className,\n ...props\n },\n ref,\n) {\n const generatedId = useId();\n const controlId = id ?? generatedId;\n const descriptionId = `${controlId}-description`;\n\n const current = value ?? defaultValue ?? min;\n const display = formatValue ? formatValue(current) : String(current);\n\n return (\n <div className={clsx('flex w-full flex-col gap-1.5', className)}>\n {(label || showValue) && (\n <div className=\"flex items-baseline justify-between gap-2\">\n {label && (\n <label\n htmlFor={controlId}\n className={clsx('text-body-sm', disabled ? 'text-disabled' : 'text-default')}\n >\n {label}\n </label>\n )}\n {showValue && (\n <span className=\"text-body-sm font-medium tabular-nums text-default\">{display}</span>\n )}\n </div>\n )}\n {description && (\n <p\n id={descriptionId}\n className={clsx('text-body-xs', disabled ? 'text-disabled' : 'text-default-secondary')}\n >\n {description}\n </p>\n )}\n <input\n ref={ref}\n id={controlId}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={value}\n defaultValue={value === undefined ? defaultValue : undefined}\n disabled={disabled}\n aria-describedby={description ? descriptionId : undefined}\n // Only when a formatter is supplied — an aria-valuetext that merely repeats\n // aria-valuenow is noise.\n aria-valuetext={formatValue ? display : undefined}\n onChange={(event) => onValueChange?.(Number(event.target.value))}\n className={clsx(\n 'h-5 w-full cursor-pointer appearance-none bg-transparent',\n 'focus-visible:outline-none',\n disabled && 'cursor-not-allowed opacity-50',\n // Track\n '[&::-webkit-slider-runnable-track]:h-1.5 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:bg-default-tertiary',\n '[&::-moz-range-track]:h-1.5 [&::-moz-range-track]:rounded-full [&::-moz-range-track]:bg-default-tertiary',\n '[&::-moz-range-progress]:h-1.5 [&::-moz-range-progress]:rounded-full [&::-moz-range-progress]:bg-brand',\n // Thumb. The negative margin centres it on the track, since the input box is\n // taller than the track to keep a comfortable pointer target.\n '[&::-webkit-slider-thumb]:-mt-[7px] [&::-webkit-slider-thumb]:size-4 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-brand [&::-webkit-slider-thumb]:bg-default [&::-webkit-slider-thumb]:shadow-100',\n '[&::-moz-range-thumb]:size-4 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:border-2 [&::-moz-range-thumb]:border-brand [&::-moz-range-thumb]:bg-default',\n // Focus ring on the thumb, not the whole 100%-wide input — a ring around the\n // full track reads as the row being focused rather than the handle.\n 'focus-visible:[&::-webkit-slider-thumb]:ring-2 focus-visible:[&::-webkit-slider-thumb]:ring-brand focus-visible:[&::-webkit-slider-thumb]:ring-offset-1',\n 'focus-visible:[&::-moz-range-thumb]:ring-2 focus-visible:[&::-moz-range-thumb]:ring-brand',\n )}\n {...props}\n />\n </div>\n );\n});\n","import { forwardRef, type LabelHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { useFieldContext } from './field';\nimport type { InputSize } from './input';\n\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n children: ReactNode;\n size?: InputSize;\n}\n\nconst SIZE: Record<InputSize, string> = {\n lg: 'text-body',\n md: 'text-body-sm',\n sm: 'text-body-tiny',\n};\n\n/**\n * A standalone `<label>`.\n *\n * `FieldLabel` is the one to reach for inside a `Field` — it picks up the generated id,\n * the size and the disabled state from context automatically. This is for the cases that\n * are not a field: naming a `SegmentedControl`, a group of buttons, or any control the\n * library does not wrap. It still reads `Field` context when it happens to be inside one,\n * so it degrades to `FieldLabel` behaviour rather than silently losing the association.\n */\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { children, size, className, htmlFor, ...rest },\n ref,\n) {\n const field = useFieldContext();\n const resolvedSize = size ?? field?.size ?? 'md';\n\n return (\n <label\n ref={ref}\n htmlFor={htmlFor ?? field?.controlId}\n data-slot=\"label\"\n className={clsx(\n 'select-none',\n SIZE[resolvedSize],\n field?.disabled ? 'text-disabled' : 'text-default',\n className,\n )}\n {...rest}\n >\n {children}\n </label>\n );\n});\n","import {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { IconButton } from './icon-button';\n\nexport type CalendarMode = 'single' | 'range';\n\nexport interface DateRange {\n from: Date | null;\n to: Date | null;\n}\n\nexport interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n mode?: CalendarMode;\n /** Selected date in `single` mode. */\n value?: Date | null;\n /** Selected range in `range` mode. */\n range?: DateRange;\n onSelect?: (value: Date) => void;\n onRangeChange?: (range: DateRange) => void;\n /** Month shown on mount. Defaults to the selection's month, else today. */\n defaultMonth?: Date;\n min?: Date;\n max?: Date;\n /** Return `true` to disable a day. Combined with `min`/`max`. */\n isDateDisabled?: (date: Date) => boolean;\n /** 0 = Sunday, 1 = Monday. Default `1`. */\n weekStartsOn?: 0 | 1;\n /** BCP 47 tag for month, weekday and announced day names. Default: the browser's. */\n locale?: string;\n /** Names the grid. Default `Calendar`. */\n label?: string;\n}\n\n// ── Date helpers ───────────────────────────────────────────────────────────────\n// Deliberately no date library. Everything below is calendar-grid arithmetic on local\n// dates, which is a few dozen lines; pulling in date-fns for it would be the largest\n// dependency in the package.\n\nconst startOfDay = (d: Date) => new Date(d.getFullYear(), d.getMonth(), d.getDate());\nconst sameDay = (a: Date | null | undefined, b: Date | null | undefined) =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\nconst addDays = (d: Date, n: number) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\nconst addMonths = (d: Date, n: number) => new Date(d.getFullYear(), d.getMonth() + n, 1);\nconst isBefore = (a: Date, b: Date) => startOfDay(a).getTime() < startOfDay(b).getTime();\nconst isAfter = (a: Date, b: Date) => startOfDay(a).getTime() > startOfDay(b).getTime();\nconst inRange = (d: Date, from: Date, to: Date) =>\n startOfDay(d).getTime() > startOfDay(from).getTime() &&\n startOfDay(d).getTime() < startOfDay(to).getTime();\n\n/** Six weeks of cells so the grid never changes height as the month changes. */\nfunction monthGrid(month: Date, weekStartsOn: 0 | 1): Date[] {\n const first = new Date(month.getFullYear(), month.getMonth(), 1);\n const offset = (first.getDay() - weekStartsOn + 7) % 7;\n const start = addDays(first, -offset);\n return Array.from({ length: 42 }, (_, i) => addDays(start, i));\n}\n\n/**\n * Month grid. Matches Figma's `Calendar`, `Calendar Button`\n * (`State: Default | Hover | Active | Disabled | Range | Range Disabled | Hidden`),\n * `Calendar Select Group` and `Calendar Month/Year Field`.\n *\n * The code had no calendar at all — `DatePicker` was a bare `<input type=\"date\">` with\n * Chromium-only indicator styling, so there was nothing to build a range picker on, no\n * locale control and no min/max navigation.\n *\n * The keyboard model is the APG date-grid pattern, and it is the whole reason this is not\n * just a table of buttons:\n *\n * - **One tab stop.** Tab enters the grid once and leaves it; arrows move within. A grid of\n * 42 individually tabbable buttons takes 42 presses to get past.\n * - **Arrows cross month boundaries.** Pressing Left on the 1st moves to the previous\n * month's last day and pages the view, rather than dead-ending.\n * - **PageUp/PageDown** move by month, **Home/End** to the start/end of the week.\n * - Each day's accessible name is the full date, not the number — \"14\" tells a screen\n * reader user nothing.\n */\nexport function Calendar({\n mode = 'single',\n value,\n range,\n onSelect,\n onRangeChange,\n defaultMonth,\n min,\n max,\n isDateDisabled,\n weekStartsOn = 1,\n locale,\n label = 'Calendar',\n className,\n ...rest\n}: CalendarProps) {\n const today = useMemo(() => startOfDay(new Date()), []);\n const gridId = useId();\n\n const [month, setMonth] = useState<Date>(\n () => defaultMonth ?? value ?? range?.from ?? today,\n );\n // The focused cell, which is what the roving tabindex follows. Distinct from the\n // selection: you can arrow around without selecting.\n const [focusedDate, setFocusedDate] = useState<Date>(\n () => value ?? range?.from ?? today,\n );\n const cellRefs = useRef(new Map<string, HTMLButtonElement>());\n\n const monthFormatter = useMemo(\n () => new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric' }),\n [locale],\n );\n const dayNameFormatter = useMemo(\n () => new Intl.DateTimeFormat(locale, { weekday: 'short' }),\n [locale],\n );\n const fullDateFormatter = useMemo(\n () => new Intl.DateTimeFormat(locale, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }),\n [locale],\n );\n\n const disabled = useCallback(\n (date: Date) => {\n if (min && isBefore(date, min)) return true;\n if (max && isAfter(date, max)) return true;\n return isDateDisabled?.(date) ?? false;\n },\n [min, max, isDateDisabled],\n );\n\n const key = (d: Date) => `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;\n\n // Set by keyboard moves only. Focus must not be stolen on mount, or when a click has\n // already put focus on the cell the user pressed.\n const pendingFocus = useRef(false);\n\n const focusDate = useCallback((date: Date) => {\n pendingFocus.current = true;\n setFocusedDate(date);\n // A move across the month boundary pages the view; the target cell does not exist\n // until after that commit, which is why focus is applied in the effect below rather\n // than here.\n setMonth((current) =>\n current.getFullYear() === date.getFullYear() && current.getMonth() === date.getMonth()\n ? current\n : new Date(date.getFullYear(), date.getMonth(), 1),\n );\n }, []);\n\n useEffect(() => {\n if (!pendingFocus.current) return;\n const node = cellRefs.current.get(key(focusedDate));\n if (node) {\n node.focus();\n pendingFocus.current = false;\n }\n // If the node is still absent the month is mid-change; the next commit re-runs this.\n }, [focusedDate, month]);\n\n const select = (date: Date) => {\n if (disabled(date)) return;\n setFocusedDate(date);\n\n if (mode === 'single') {\n onSelect?.(date);\n return;\n }\n\n const current = range ?? { from: null, to: null };\n // Anchor a new range when there is none, when one is already complete, or when the\n // click lands before the anchor — the last case is what makes dragging backwards work\n // instead of producing an inverted range.\n if (!current.from || current.to || isBefore(date, current.from)) {\n onRangeChange?.({ from: date, to: null });\n } else {\n onRangeChange?.({ from: current.from, to: date });\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n const moves: Record<string, () => Date> = {\n ArrowLeft: () => addDays(focusedDate, -1),\n ArrowRight: () => addDays(focusedDate, 1),\n ArrowUp: () => addDays(focusedDate, -7),\n ArrowDown: () => addDays(focusedDate, 7),\n Home: () => addDays(focusedDate, -((focusedDate.getDay() - weekStartsOn + 7) % 7)),\n End: () => addDays(focusedDate, 6 - ((focusedDate.getDay() - weekStartsOn + 7) % 7)),\n PageUp: () => addDays(focusedDate, 0) && new Date(focusedDate.getFullYear(), focusedDate.getMonth() - 1, focusedDate.getDate()),\n PageDown: () => new Date(focusedDate.getFullYear(), focusedDate.getMonth() + 1, focusedDate.getDate()),\n };\n\n const move = moves[event.key];\n if (move) {\n event.preventDefault();\n focusDate(move());\n }\n };\n\n const days = monthGrid(month, weekStartsOn);\n const weekdayNames = days.slice(0, 7).map((d) => dayNameFormatter.format(d));\n\n return (\n <div\n data-slot=\"calendar\"\n className={clsx('w-fit rounded-xl border border-default bg-default p-3', className)}\n {...rest}\n >\n <div className=\"mb-2 flex items-center justify-between gap-2\">\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label=\"Previous month\"\n disabled={!!min && isBefore(addMonths(month, -1), new Date(min.getFullYear(), min.getMonth(), 1))}\n onClick={() => setMonth(addMonths(month, -1))}\n >\n <LuChevronLeft aria-hidden size={16} />\n </IconButton>\n {/* aria-live so paging the month is announced — otherwise a screen reader user\n arrowing past the end of a month has no idea the view moved. */}\n <span aria-live=\"polite\" className=\"text-body-sm font-semibold text-default\">\n {monthFormatter.format(month)}\n </span>\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label=\"Next month\"\n disabled={!!max && isAfter(addMonths(month, 1), new Date(max.getFullYear(), max.getMonth(), 1))}\n onClick={() => setMonth(addMonths(month, 1))}\n >\n <LuChevronRight aria-hidden size={16} />\n </IconButton>\n </div>\n\n {/* role=\"grid\" with an explicit row/cell structure, so a screen reader announces\n \"column 3, row 2\" and the day headers are tied to the columns. */}\n <div\n role=\"grid\"\n aria-label={label}\n id={gridId}\n // Programmatically focusable but out of the tab sequence: the roving day buttons\n // own the tab stop, and key handling is delegated here so it keeps working while\n // focus moves between cells.\n tabIndex={-1}\n onKeyDown={onKeyDown}\n >\n <div role=\"row\" className=\"mb-1 grid grid-cols-7\">\n {weekdayNames.map((name) => (\n <div\n key={name}\n role=\"columnheader\"\n // The short form is shown; the long form is not needed because each cell\n // announces its own full date.\n className=\"flex h-8 items-center justify-center text-body-tiny font-medium text-default-tertiary\"\n >\n {name}\n </div>\n ))}\n </div>\n\n {Array.from({ length: 6 }, (_, week) => (\n <div key={week} role=\"row\" className=\"grid grid-cols-7\">\n {days.slice(week * 7, week * 7 + 7).map((date) => {\n const outside = date.getMonth() !== month.getMonth();\n const isDisabled = disabled(date);\n const selected =\n mode === 'single'\n ? sameDay(date, value)\n : sameDay(date, range?.from) || sameDay(date, range?.to);\n const between =\n mode === 'range' && range?.from && range?.to\n ? inRange(date, range.from, range.to)\n : false;\n const isFocused = sameDay(date, focusedDate);\n\n return (\n <div role=\"gridcell\" key={key(date)} aria-selected={selected || undefined}>\n <button\n ref={(node) => {\n if (node) cellRefs.current.set(key(date), node);\n else cellRefs.current.delete(key(date));\n }}\n type=\"button\"\n // The roving tab stop: exactly one cell is reachable by Tab.\n tabIndex={isFocused ? 0 : -1}\n disabled={isDisabled}\n aria-label={fullDateFormatter.format(date)}\n aria-current={sameDay(date, today) ? 'date' : undefined}\n onClick={() => select(date)}\n onFocus={() => setFocusedDate(date)}\n className={clsx(\n 'flex size-9 items-center justify-center rounded-lg text-body-sm tabular-nums transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:text-disabled disabled:hover:bg-transparent',\n selected\n ? 'bg-brand font-semibold text-brand-on-brand'\n : between\n ? 'rounded-none bg-brand-tertiary text-default'\n : outside\n ? 'text-default-tertiary hover:bg-default-secondary'\n : 'text-default hover:bg-default-secondary',\n // Today is marked by a ring rather than a fill, so it stays legible\n // when it is also the selected day.\n sameDay(date, today) && !selected && 'ring-1 ring-inset ring-brand-tertiary',\n )}\n >\n {date.getDate()}\n </button>\n </div>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n );\n}\n","import { forwardRef, type HTMLAttributes, type InputHTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuSearch, LuX } from 'react-icons/lu';\nimport { useFieldControl } from './field';\nimport type { InputSize } from './input';\nimport { useControlSize } from './control-size';\n\nexport type InputGroupAlign = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';\n\nconst HEIGHT: Record<InputSize, string> = {\n lg: 'h-12 text-body',\n md: 'h-9 text-body-sm',\n sm: 'h-6 text-body-tiny',\n};\n\nconst PAD: Record<InputSize, string> = {\n lg: 'px-4 gap-2',\n md: 'px-3 gap-1.5',\n sm: 'px-2 gap-1',\n};\n\nexport interface InputGroupProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: InputSize;\n invalid?: boolean;\n disabled?: boolean;\n}\n\n/**\n * A bordered shell that holds an input alongside addons — a prefix, a unit suffix, a\n * search glyph, a clear button, a copy button.\n *\n * This generalises what `PasswordInput` did as a one-off. `Input` has `leadingIcon`,\n * `trailingIcon` and `trailingAction` props, which works for a single decoration but forces\n * absolute positioning and per-size padding maps to keep the text clear of it. Here the\n * addons are real flex siblings, so the input's text box simply ends where the addon\n * begins and nothing has to be measured.\n *\n * The border and focus ring live on the group, not the input — so focusing the input rings\n * the whole control, which is what a user perceives as \"the field\".\n */\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n { children, size: sizeProp, invalid = false, disabled = false, className, ...rest },\n ref,\n) {\n const size = useControlSize(sizeProp);\n\n return (\n <div\n ref={ref}\n data-slot=\"input-group\"\n data-size={size}\n className={clsx(\n 'flex w-full items-center rounded-lg border transition-colors',\n 'bg-default text-default',\n HEIGHT[size],\n PAD[size],\n // `focus-within`, because the focused element is the nested input while the ring\n // belongs to the shell.\n 'focus-within:ring-2 focus-within:ring-offset-1 focus-within:ring-offset-default',\n disabled\n ? 'cursor-not-allowed border-disabled bg-disabled text-disabled'\n : invalid\n ? 'border-danger-secondary focus-within:border-danger focus-within:ring-danger'\n : 'border-default focus-within:border-brand focus-within:ring-brand',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n\nexport interface InputGroupInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {}\n\n/**\n * The input inside an `InputGroup`. Carries no border, background or ring of its own —\n * the group owns all three.\n */\nexport const InputGroupInput = forwardRef<HTMLInputElement, InputGroupInputProps>(\n function InputGroupInput({ className, ...props }, ref) {\n const field = useFieldControl();\n return (\n <input\n ref={ref}\n {...field}\n className={clsx(\n 'min-w-0 flex-1 bg-transparent outline-none',\n 'placeholder:text-default-tertiary',\n 'disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nexport interface InputGroupAddonProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n align?: InputGroupAlign;\n /**\n * `true` when the addon is decoration — an icon, a unit. Decorative addons are\n * `aria-hidden` and ignore pointer events, so they never steal a click meant for the\n * text box. Default `true`; set `false` for an addon containing a control.\n */\n decorative?: boolean;\n}\n\nexport const InputGroupAddon = forwardRef<HTMLSpanElement, InputGroupAddonProps>(\n function InputGroupAddon(\n { children, align = 'inline-start', decorative = true, className, ...rest },\n ref,\n ) {\n return (\n <span\n ref={ref}\n aria-hidden={decorative || undefined}\n data-slot=\"input-group-addon\"\n data-align={align}\n className={clsx(\n 'flex shrink-0 items-center text-icon-default-secondary',\n decorative && 'pointer-events-none',\n align === 'inline-end' && 'order-last',\n className,\n )}\n {...rest}\n >\n {children}\n </span>\n );\n },\n);\n\nexport interface InputGroupTextProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n/** Static text inside the shell — a currency symbol, a domain suffix, a unit. */\nexport const InputGroupText = forwardRef<HTMLSpanElement, InputGroupTextProps>(\n function InputGroupText({ children, className, ...rest }, ref) {\n return (\n <span\n ref={ref}\n className={clsx('shrink-0 whitespace-nowrap text-default-secondary', className)}\n {...rest}\n >\n {children}\n </span>\n );\n },\n);\n\n// ── SearchInput ────────────────────────────────────────────────────────────────\n\nexport interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n size?: InputSize;\n /** Renders a clear button once there is a value. */\n onClear?: () => void;\n /** Accessible name. Default `Search`. */\n label?: string;\n className?: string;\n}\n\n/**\n * Search field. Matches Figma's `Search` set — `Size: Large | Medium | Small`,\n * `State: Default | Disabled`, `Value Type: Filled | Placeholder`.\n *\n * `type=\"search\"` rather than `type=\"text\"`: it gets the platform's search affordances and\n * is announced as a search field. The clear button is a real button so it is keyboard\n * reachable, unlike the UA-provided cancel widget which is pointer-only in most browsers\n * and is therefore suppressed.\n */\nexport const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(function SearchInput(\n { size: sizeProp, onClear, label = 'Search', disabled, value, className, ...props },\n ref,\n) {\n const size = useControlSize(sizeProp);\n const hasValue = value !== undefined && value !== '';\n\n return (\n <InputGroup size={size} disabled={disabled} className={className}>\n <InputGroupAddon>\n <LuSearch className={size === 'sm' ? 'size-3' : 'size-4'} />\n </InputGroupAddon>\n <InputGroupInput\n ref={ref}\n type=\"search\"\n aria-label={label}\n disabled={disabled}\n value={value}\n // The UA cancel button cannot be focused or styled consistently, so it is hidden\n // in favour of the real button below.\n className=\"[&::-webkit-search-cancel-button]:appearance-none\"\n {...props}\n />\n {onClear && hasValue && (\n <InputGroupAddon align=\"inline-end\" decorative={false}>\n <button\n type=\"button\"\n aria-label=\"Clear search\"\n onClick={onClear}\n disabled={disabled}\n className=\"flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand\"\n >\n <LuX aria-hidden className={size === 'sm' ? 'size-3' : 'size-4'} />\n </button>\n </InputGroupAddon>\n )}\n </InputGroup>\n );\n});\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { LuCircleCheckBig, LuInfo, LuOctagonAlert, LuTriangleAlert, LuX } from 'react-icons/lu';\nimport { cn } from '../../lib/cn';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\nimport { EntityIconBadge, type EntityIconBadgeTone } from '../status/entity-icon-badge';\nimport { IconButton } from '../forms/icon-button';\nimport { OVERLAY_SCRIM, useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\nexport type ModalSize = 'sm' | 'md' | 'lg' | 'xl';\n/**\n * Note `positive`, not `success` — every other tone union in the library\n * (`InlineAlertTone`, `TagPillTone`, `EntityIconBadgeTone`) and the token layer say\n * `positive`, and one vocabulary beats a familiar synonym.\n */\nexport type ModalTone = 'default' | 'info' | 'positive' | 'warning' | 'danger';\nexport type ModalFooterAlign = 'start' | 'between' | 'end';\n\n/**\n * The `sm:` prefix is mandatory, not cosmetic. In 0.2.0 `max-w-[540px]` was applied\n * unprefixed, so between 540px and the `sm` breakpoint (640px) the \"bottom sheet\" was\n * a 540px card floating in the middle of the viewport.\n */\nconst SIZE: Record<ModalSize, string> = {\n sm: 'sm:max-w-[420px]',\n md: 'sm:max-w-[540px]',\n lg: 'sm:max-w-[640px]',\n xl: 'sm:max-w-[800px]',\n};\n\n/**\n * `info` / `positive` / `warning` reuse `InlineAlert`'s glyphs, so one semantic has one\n * mark across the system. `danger` deliberately differs from `warning`: a dialog that\n * is about to destroy something should not be glyph-identical to one merely cautioning.\n */\nconst TONE_ICON: Record<Exclude<ModalTone, 'default'>, ReactNode> = {\n info: <LuInfo aria-hidden className=\"size-5\" />,\n positive: <LuCircleCheckBig aria-hidden className=\"size-5\" />,\n warning: <LuTriangleAlert aria-hidden className=\"size-5\" />,\n danger: <LuOctagonAlert aria-hidden className=\"size-5\" />,\n};\n\n/** Reuses EntityIconBadge's tone map — one token map for tinted icon circles. */\nconst TONE_BADGE: Record<Exclude<ModalTone, 'default'>, EntityIconBadgeTone> = {\n info: 'brand',\n positive: 'positive',\n warning: 'warning',\n danger: 'danger',\n};\n\nconst FOOTER_ALIGN: Record<ModalFooterAlign, string> = {\n start: 'justify-start',\n between: 'justify-between',\n end: 'justify-end',\n};\n\n// ── Naming context ─────────────────────────────────────────────────────────────\n\n/**\n * Lets `ModalTitle` and `ModalDescription` name the dialog by reference rather than by\n * having the caller repeat the string.\n *\n * 0.3.0 set `aria-label={label}` on the panel *and* rendered a visible `<h2>`, so the\n * accessible name was a duplicate of the heading that nothing kept in sync — and a rich\n * title (an element, a count, an icon) could not be the name at all. The parts register\n * themselves here on mount, and the panel points `aria-labelledby` /\n * `aria-describedby` at whichever are actually present.\n */\ninterface ModalNamingContext {\n titleId: string;\n descriptionId: string;\n registerTitle: (present: boolean) => void;\n registerDescription: (present: boolean) => void;\n}\n\nconst ModalNaming = createContext<ModalNamingContext | null>(null);\n\n// ── Modal ──────────────────────────────────────────────────────────────────────\n\nexport interface ModalProps {\n open: boolean;\n /** Fired with `false` on Escape, an outside press, or the close button. */\n onOpenChange: (open: boolean) => void;\n /**\n * Accessible name. Only needed when the dialog renders no `ModalTitle` — with one, the\n * name comes from the heading itself via `aria-labelledby`, so it cannot drift.\n */\n label?: string;\n children: ReactNode;\n size?: ModalSize;\n /**\n * `alertdialog` for a dialog that interrupts to confirm or warn — it makes assistive\n * tech announce the body immediately rather than waiting to be browsed. `ConfirmDialog`\n * passes it; plain content dialogs should stay `dialog`.\n */\n role?: 'dialog' | 'alertdialog';\n /** Renders the top-right close button. */\n showClose?: boolean;\n /** Applied to the panel. With `cn`, `className=\"sm:max-w-[560px]\"` beats `size`. */\n className?: string;\n /** Call `preventDefault()` to keep the dialog open — e.g. unsaved input. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /** Call `preventDefault()` to keep the dialog open. */\n onInteractOutside?: (event: PointerEvent) => void;\n /** Focus this on open instead of the first tabbable element. */\n initialFocus?: React.RefObject<HTMLElement | null>;\n}\n\n/**\n * A centred dialog above `sm`, a bottom sheet below it.\n *\n * Composed from `ModalHeader` / `ModalBody` / `ModalFooter`, mirroring the `Card`\n * parts — so a modal can take any layout a card can, including headerless. Tone lives\n * on `ModalHeader` (the part that draws the glyph); `ConfirmDialog` and\n * `NoteConfirmModal` accept `tone` at their top level and forward it.\n */\nexport function Modal(props: ModalProps) {\n if (!props.open) return null;\n return (\n <Portal>\n <ModalShell {...props} />\n </Portal>\n );\n}\n\n/**\n * Split out so the Esc / focus-trap hooks only mount while the dialog is open —\n * calling them in `Modal` itself would break the `if (!open) return null` exit.\n */\nfunction ModalShell({\n onOpenChange,\n label,\n children,\n size = 'md',\n role = 'dialog',\n showClose = true,\n className,\n onEscapeKeyDown,\n onInteractOutside,\n initialFocus,\n}: Omit<ModalProps, 'open'>) {\n const panelRef = useRef<HTMLDivElement>(null);\n const baseId = useId();\n const [hasTitle, setHasTitle] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n\n const titleId = `${baseId}-title`;\n const descriptionId = `${baseId}-description`;\n\n useOverlayDismiss({\n onDismiss: () => onOpenChange(false),\n panelRef,\n initialFocus,\n onEscapeKeyDown,\n onInteractOutside,\n });\n\n return (\n <div\n className={cn(\n 'fixed inset-0 z-overlay flex items-end justify-center sm:items-center',\n OVERLAY_SCRIM,\n )}\n >\n <div\n ref={panelRef}\n role={role}\n aria-modal=\"true\"\n aria-labelledby={hasTitle ? titleId : undefined}\n aria-label={hasTitle ? undefined : label}\n aria-describedby={hasDescription ? descriptionId : undefined}\n className={cn(\n 'relative max-h-[92dvh] w-full overflow-y-auto bg-default shadow-400',\n // Not a `ScrollArea`: the panel is the dialog, so the scroll container has to stay\n // the element carrying `role`, `aria-modal` and the trap boundary. It is already\n // keyboard-scrollable because the trap focuses it on open.\n SCROLLBAR_CLASSES,\n 'rounded-t-2xl pb-[env(safe-area-inset-bottom)] sm:mx-4 sm:rounded-2xl sm:pb-0',\n SIZE[size],\n className,\n )}\n >\n {showClose && (\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label=\"Close dialog\"\n onClick={() => onOpenChange(false)}\n // Floating rather than inside the header, so a headerless modal is still\n // dismissible. right-6/top-5 reproduces 0.2.0's position exactly.\n className=\"absolute right-6 top-5 z-raised\"\n >\n <LuX size={16} aria-hidden />\n </IconButton>\n )}\n <ModalNaming.Provider\n value={{\n titleId,\n descriptionId,\n registerTitle: setHasTitle,\n registerDescription: setHasDescription,\n }}\n >\n {children}\n </ModalNaming.Provider>\n </div>\n </div>\n );\n}\n\n// ── ModalHeader ────────────────────────────────────────────────────────────────\n\nexport interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Adds a tinted glyph circle. `default` renders none. */\n tone?: ModalTone;\n divider?: boolean;\n}\n\nexport function ModalHeader({\n children,\n tone = 'default',\n divider = true,\n className,\n ...rest\n}: ModalHeaderProps) {\n return (\n <div\n className={cn(\n // pr-14 reserves the floating close button's column (24px gutter + 24px\n // button + gap), which the old flex-between header used to hold open.\n 'flex items-start gap-3 px-6 py-5 pr-14',\n divider && 'border-b border-default',\n className,\n )}\n {...rest}\n >\n {tone !== 'default' && (\n <EntityIconBadge size=\"md\" shape=\"circle\" tone={TONE_BADGE[tone]}>\n {TONE_ICON[tone]}\n </EntityIconBadge>\n )}\n <div className=\"min-w-0 flex-1\">{children}</div>\n </div>\n );\n}\n\n// ── ModalTitle / ModalDescription / ModalBody / ModalFooter ────────────────────\n\nexport interface ModalTitleProps extends HTMLAttributes<HTMLHeadingElement> {\n children: ReactNode;\n}\n\nexport function ModalTitle({ children, className, id, ...rest }: ModalTitleProps) {\n const naming = useContext(ModalNaming);\n\n useEffect(() => {\n naming?.registerTitle(true);\n return () => naming?.registerTitle(false);\n }, [naming]);\n\n return (\n <h2\n id={id ?? naming?.titleId}\n className={cn('text-heading-sm font-semibold text-default', className)}\n {...rest}\n >\n {children}\n </h2>\n );\n}\n\nexport interface ModalDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n children: ReactNode;\n}\n\nexport function ModalDescription({ children, className, id, ...rest }: ModalDescriptionProps) {\n const naming = useContext(ModalNaming);\n\n useEffect(() => {\n naming?.registerDescription(true);\n return () => naming?.registerDescription(false);\n }, [naming]);\n\n return (\n <p\n id={id ?? naming?.descriptionId}\n className={cn('mt-0.5 text-body-xs text-default-secondary', className)}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\nexport interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** Must not carry its own `overflow` — the panel is the scroll container. */\nexport function ModalBody({ children, className, ...rest }: ModalBodyProps) {\n return (\n <div className={cn('px-6 py-5', className)} {...rest}>\n {children}\n </div>\n );\n}\n\nexport interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n align?: ModalFooterAlign;\n divider?: boolean;\n}\n\nexport function ModalFooter({\n children,\n align = 'end',\n divider = true,\n className,\n ...rest\n}: ModalFooterProps) {\n return (\n <div\n className={cn(\n 'flex items-center gap-2 px-6 py-4',\n FOOTER_ALIGN[align],\n divider && 'border-t border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useFloatingPanel, type FloatingAlign, type FloatingSide } from './floating';\nimport { Portal } from './portal';\n\nexport interface TooltipProps {\n /**\n * The trigger. Must be a single focusable element — a tooltip that can only be reached\n * with a pointer is invisible to keyboard and touch users, so this deliberately does not\n * wrap its child in a span to make it hoverable.\n */\n children: ReactElement;\n /** Bold first line. Matches Figma's `Title` property. */\n title?: ReactNode;\n /** Supporting line. Matches Figma's `Body` / `Has Body`. */\n body?: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n /** Delay before opening, in ms. Default `150`. */\n openDelay?: number;\n /** Delay before closing, in ms. Default `0`. */\n closeDelay?: number;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * `describedby` — the trigger keeps its own name and the tooltip adds detail. This is\n * almost always what you want. `labelledby` makes the tooltip *be* the trigger's name,\n * for an icon-only button with no other text. Default `describedby`.\n *\n * Deliberately not called `as`: everywhere else in this library `as` chooses the rendered\n * element, and reusing it for something else here would be a trap (it also makes\n * `jsx-a11y`'s polymorphic-component checking treat the value as a tag name).\n */\n association?: 'describedby' | 'labelledby';\n className?: string;\n}\n\n/**\n * Tooltip. Matches Figma's `Tooltip` set — `Placement: Top | Left | Right | Bottom`, with\n * a title and an optional body.\n *\n * Things this gets right that a naive tooltip does not:\n *\n * - **Keyboard and touch reachable.** Opens on `focus` as well as hover, and closes on\n * Escape. A hover-only tooltip is inaccessible to half the people using it.\n * - **Referenced, not floating text.** The panel is wired to the trigger with\n * `aria-describedby` (or `aria-labelledby`), so it is announced *with* the control\n * rather than being an orphan region a screen reader may never reach.\n * - **`role=\"tooltip\"` and no interactive content.** A tooltip cannot be hovered into or\n * focused, so anything interactive inside it is unreachable — use `Popover` for that.\n * - Not modal: no focus trap, no scroll lock, no inert background.\n */\nexport function Tooltip({\n children,\n title,\n body,\n side = 'top',\n align = 'center',\n openDelay = 150,\n closeDelay = 0,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n association = 'describedby',\n className,\n}: TooltipProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const tooltipId = useId();\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearTimer = useCallback(() => {\n if (timer.current) {\n clearTimeout(timer.current);\n timer.current = null;\n }\n }, []);\n\n const schedule = useCallback(\n (next: boolean, delay: number) => {\n clearTimer();\n if (delay === 0) {\n setOpen(next);\n return;\n }\n timer.current = setTimeout(() => setOpen(next), delay);\n },\n [clearTimer, setOpen],\n );\n\n useEffect(() => clearTimer, [clearTimer]);\n\n const { refs, floatingStyles } = useFloatingPanel({\n open,\n onOpenChange: setOpen,\n side,\n align,\n sideOffset: 6,\n });\n\n useEffect(() => {\n refs.setReference(triggerNode);\n }, [refs, triggerNode]);\n\n // Escape must dismiss a tooltip even though it never holds focus, so this listens at the\n // document rather than on the trigger.\n useEffect(() => {\n if (!open) return;\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') setOpen(false);\n }\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [open, setOpen]);\n\n if (!isValidElement(children)) return null;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childProps = child.props;\n const describedBy = association === 'describedby' ? tooltipId : undefined;\n const labelledBy = association === 'labelledby' ? tooltipId : undefined;\n\n const trigger = cloneElement(child, {\n ref: composeRefs<HTMLElement>(\n (node) => setTriggerNode(node),\n (child as unknown as { ref?: React.Ref<HTMLElement> }).ref,\n ),\n 'aria-describedby':\n [childProps['aria-describedby'], open ? describedBy : undefined].filter(Boolean).join(' ') ||\n undefined,\n 'aria-labelledby':\n [childProps['aria-labelledby'], labelledBy].filter(Boolean).join(' ') || undefined,\n onPointerEnter: (event: React.PointerEvent) => {\n (childProps.onPointerEnter as ((e: React.PointerEvent) => void) | undefined)?.(event);\n schedule(true, openDelay);\n },\n onPointerLeave: (event: React.PointerEvent) => {\n (childProps.onPointerLeave as ((e: React.PointerEvent) => void) | undefined)?.(event);\n schedule(false, closeDelay);\n },\n // Focus, not just hover — this is the difference between a tooltip a keyboard user can\n // read and one they cannot.\n onFocus: (event: React.FocusEvent) => {\n (childProps.onFocus as ((e: React.FocusEvent) => void) | undefined)?.(event);\n schedule(true, 0);\n },\n onBlur: (event: React.FocusEvent) => {\n (childProps.onBlur as ((e: React.FocusEvent) => void) | undefined)?.(event);\n schedule(false, 0);\n },\n } as Record<string, unknown>);\n\n return (\n <>\n {trigger}\n {/* Always rendered under `association=\"labelledby\"` so the id it points at exists\n even while closed — an `aria-labelledby` that resolves to nothing leaves the\n trigger unnamed, which is worse than having no tooltip at all. */}\n {(open || association === 'labelledby') && (\n <Portal>\n <div\n ref={refs.setFloating}\n id={tooltipId}\n role=\"tooltip\"\n style={floatingStyles}\n className={clsx(\n 'z-tooltip max-w-[260px] rounded-lg bg-neutral px-3 py-2 shadow-300',\n 'text-body-xs text-neutral-on-neutral',\n !open && 'sr-only',\n className,\n )}\n >\n {title && <p className=\"font-semibold\">{title}</p>}\n {body && <p className={clsx(title && 'mt-0.5 opacity-80')}>{body}</p>}\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport clsx from 'clsx';\n\nimport { Slot, composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useFloatingPanel, type FloatingAlign, type FloatingSide } from './floating';\nimport { useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\ninterface PopoverContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n contentId: string;\n triggerId: string;\n triggerNode: HTMLElement | null;\n setTriggerNode: (node: HTMLElement | null) => void;\n modal: boolean;\n}\n\nconst PopoverContext = createContext<PopoverContextValue | null>(null);\n\nfunction usePopover(part: string): PopoverContextValue {\n const value = useContext(PopoverContext);\n if (!value) throw new Error(`<${part}> must be used inside <Popover>`);\n return value;\n}\n\nexport interface PopoverProps {\n children: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Trap focus, lock scroll and mark the rest of the page inert. Default `false`.\n *\n * A popover is normally non-modal: the page behind stays usable, and Tab moves out of the\n * panel and on through the document. Set `modal` when the panel is a small form whose\n * background must not be touched until it is dismissed.\n */\n modal?: boolean;\n}\n\n/**\n * A floating panel anchored to a trigger, for **interactive** content.\n *\n * The distinction from `Tooltip` is not visual and it matters: a tooltip cannot be hovered\n * into or focused, so anything interactive inside one is unreachable. If the panel holds a\n * link, a button or a field, it has to be a popover — which means a real trigger with\n * `aria-expanded`/`aria-controls`, focus moving into the panel on open, and focus returning\n * to the trigger on close. All of that is here; none of it is in `Tooltip`, by design.\n */\nexport function Popover({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n modal = false,\n}: PopoverProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const baseId = useId();\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n\n const context = useMemo<PopoverContextValue>(\n () => ({\n open,\n setOpen,\n contentId: `${baseId}-content`,\n triggerId: `${baseId}-trigger`,\n triggerNode,\n setTriggerNode,\n modal,\n }),\n [open, setOpen, baseId, triggerNode, modal],\n );\n\n return <PopoverContext.Provider value={context}>{children}</PopoverContext.Provider>;\n}\n\nexport interface PopoverTriggerProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n asChild?: boolean;\n}\n\nexport function PopoverTrigger({\n children,\n asChild = false,\n className,\n ...rest\n}: PopoverTriggerProps) {\n const popover = usePopover('PopoverTrigger');\n\n const triggerProps = {\n id: popover.triggerId,\n // `dialog`, not `menu` — the panel holds arbitrary content, not a list of commands.\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': popover.open,\n 'aria-controls': popover.open ? popover.contentId : undefined,\n onClick: () => popover.setOpen(!popover.open),\n className,\n ...rest,\n };\n\n if (asChild) {\n return (\n <Slot ref={composeRefs(popover.setTriggerNode)} {...triggerProps}>\n {children}\n </Slot>\n );\n }\n\n return (\n <button\n ref={composeRefs(popover.setTriggerNode) as Ref<HTMLButtonElement>}\n type=\"button\"\n {...triggerProps}\n >\n {children}\n </button>\n );\n}\n\nexport interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n sideOffset?: number;\n /** Accessible name for the panel. Falls back to being labelled by the trigger. */\n label?: string;\n}\n\nexport function PopoverContent({\n children,\n side = 'bottom',\n align = 'center',\n sideOffset = 8,\n label,\n className,\n ...rest\n}: PopoverContentProps) {\n const popover = usePopover('PopoverContent');\n const panelRef = useRef<HTMLDivElement | null>(null);\n\n const { refs, floatingStyles } = useFloatingPanel({\n open: popover.open,\n onOpenChange: popover.setOpen,\n side,\n align,\n sideOffset,\n });\n\n useEffect(() => {\n refs.setReference(popover.triggerNode);\n }, [refs, popover.triggerNode]);\n\n useOverlayDismiss({\n onDismiss: () => popover.setOpen(false),\n panelRef,\n active: popover.open,\n // Focus is trapped only in modal mode. In the default non-modal mode Tab should carry\n // on into the rest of the page, which is what users expect of a popover.\n trapFocus: popover.modal,\n lockScroll: popover.modal,\n inertBackground: popover.modal,\n });\n\n if (!popover.open) return null;\n\n return (\n <Portal>\n <div\n ref={composeRefs<HTMLDivElement>(panelRef, refs.setFloating)}\n id={popover.contentId}\n role=\"dialog\"\n aria-modal={popover.modal || undefined}\n aria-label={label}\n aria-labelledby={label ? undefined : popover.triggerId}\n style={floatingStyles}\n className={clsx(\n 'z-popover max-w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-default bg-default p-4 shadow-400',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </Portal>\n );\n}\n","import {\n cloneElement,\n isValidElement,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type FocusEvent as ReactFocusEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react';\nimport clsx from 'clsx';\n\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useFloatingPanel, type FloatingAlign, type FloatingSide } from './floating';\nimport { Portal } from './portal';\n\nexport interface HoverCardProps {\n /** The trigger. Must be a single focusable element — normally a link. */\n children: ReactElement;\n /** Panel content. May contain links and text; see the note on interactivity below. */\n content: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n /** Delay before opening, in ms. Default `400`. */\n openDelay?: number;\n /** Delay before closing, in ms. Default `200`. */\n closeDelay?: number;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n className?: string;\n}\n\n/**\n * A preview panel that appears on hover — a user card on an @mention, a page preview on a\n * link.\n *\n * Sits between `Tooltip` and `Popover`, and the difference is about intent rather than\n * looks:\n *\n * - `Tooltip` is a short label. It cannot be entered, so it must hold no controls.\n * - `HoverCard` is supplementary content that *can* be entered — the panel stays open while\n * the pointer is inside it, so a link in the preview is reachable. It is opened by hover\n * and focus, never by click.\n * - `Popover` is opened deliberately by click and is the only one of the three appropriate\n * for content the user must act on.\n *\n * **It is supplementary by contract.** Hover has no touch equivalent, so anything only\n * reachable here is unreachable on a phone. The panel is `aria-labelledby` the trigger and\n * exposed as a group; the trigger keeps its own name and destination.\n *\n * The close delay is what makes the panel usable: without it, moving the pointer from the\n * trigger to the panel crosses a gap and dismisses the thing you were reaching for.\n */\nexport function HoverCard({\n children,\n content,\n side = 'bottom',\n align = 'center',\n openDelay = 400,\n closeDelay = 200,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n className,\n}: HoverCardProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const baseId = useId();\n const contentId = `${baseId}-content`;\n const triggerId = `${baseId}-trigger`;\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const schedule = useCallback(\n (next: boolean, delay: number) => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(next), delay);\n },\n [setOpen],\n );\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current);\n },\n [],\n );\n\n const { refs, floatingStyles } = useFloatingPanel({\n open,\n onOpenChange: setOpen,\n side,\n align,\n sideOffset: 8,\n });\n\n useEffect(() => {\n refs.setReference(triggerNode);\n }, [refs, triggerNode]);\n\n useEffect(() => {\n if (!open) return;\n function onKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') setOpen(false);\n }\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [open, setOpen]);\n\n if (!isValidElement(children)) return null;\n\n const child = children as ReactElement<Record<string, unknown>>;\n const childProps = child.props;\n\n const trigger = cloneElement(child, {\n id: triggerId,\n ref: composeRefs<HTMLElement>(\n (node) => setTriggerNode(node),\n (child as unknown as { ref?: Ref<HTMLElement> }).ref,\n ),\n // Not `aria-haspopup`: nothing here is triggered by activation, and claiming a popup on\n // a plain link makes a screen reader promise an interaction that does not exist.\n 'aria-describedby': open ? contentId : undefined,\n onPointerEnter: (event: ReactPointerEvent) => {\n (childProps.onPointerEnter as ((e: ReactPointerEvent) => void) | undefined)?.(event);\n schedule(true, openDelay);\n },\n onPointerLeave: (event: ReactPointerEvent) => {\n (childProps.onPointerLeave as ((e: ReactPointerEvent) => void) | undefined)?.(event);\n schedule(false, closeDelay);\n },\n onFocus: (event: ReactFocusEvent) => {\n (childProps.onFocus as ((e: ReactFocusEvent) => void) | undefined)?.(event);\n schedule(true, 0);\n },\n onBlur: (event: ReactFocusEvent) => {\n (childProps.onBlur as ((e: ReactFocusEvent) => void) | undefined)?.(event);\n schedule(false, closeDelay);\n },\n } as Record<string, unknown>);\n\n return (\n <>\n {trigger}\n {open && (\n <Portal>\n <div\n ref={refs.setFloating}\n id={contentId}\n // `group`, not `dialog` — it was not opened deliberately and it traps nothing,\n // so announcing a dialog would be a lie.\n role=\"group\"\n aria-labelledby={triggerId}\n style={floatingStyles}\n // Hovering the panel keeps it open; leaving it closes after the same delay.\n // Without this the panel vanishes as soon as the pointer leaves the trigger.\n onPointerEnter={() => schedule(true, 0)}\n onPointerLeave={() => schedule(false, closeDelay)}\n className={clsx(\n 'z-popover max-w-[min(20rem,calc(100vw-2rem))] rounded-xl border border-default bg-default p-4 shadow-400',\n className,\n )}\n >\n {content}\n </div>\n </Portal>\n )}\n </>\n );\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\n\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { MENU_PANEL_CLASSES, MenuContext, useMenu, useMenuState } from './menu-core';\nimport { useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\ninterface ContextMenuPositionValue {\n point: { x: number; y: number } | null;\n setPoint: (point: { x: number; y: number } | null) => void;\n}\n\nconst PositionContext = createContext<ContextMenuPositionValue | null>(null);\n\nfunction usePosition(): ContextMenuPositionValue {\n const value = useContext(PositionContext);\n if (!value) throw new Error('ContextMenu parts must be used inside <ContextMenu>');\n return value;\n}\n\nexport interface ContextMenuProps {\n children: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\n/**\n * Right-click menu.\n *\n * Shares every item and the whole keyboard contract with `DropdownMenu` via `menu-core`;\n * the only difference is how it opens — at the pointer, with no trigger element to anchor\n * to, so it is positioned from coordinates rather than by Floating UI's reference/floating\n * pair.\n *\n * **A context menu must never be the only way to reach an action.** `contextmenu` fires on\n * right-click and on the Windows Menu / Shift+F10 keys, but not on touch, and plenty of\n * users never right-click at all. `ContextMenuTrigger` therefore also opens on Shift+F10 and\n * the ContextMenu key, and anything in here should have a visible equivalent elsewhere —\n * usually a `DropdownMenu` on the same row.\n */\nexport function ContextMenu({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n}: ContextMenuProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const menu = useMenuState({ open, setOpen });\n const [point, setPoint] = useState<{ x: number; y: number } | null>(null);\n const position = useMemo(() => ({ point, setPoint }), [point]);\n\n return (\n <MenuContext.Provider value={menu}>\n <PositionContext.Provider value={position}>{children}</PositionContext.Provider>\n </MenuContext.Provider>\n );\n}\n\nexport interface ContextMenuTriggerProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n disabled?: boolean;\n}\n\nexport function ContextMenuTrigger({\n children,\n disabled = false,\n className,\n ...rest\n}: ContextMenuTriggerProps) {\n const menu = useMenu('ContextMenuTrigger');\n const position = usePosition();\n\n const openAt = (x: number, y: number) => {\n if (disabled) return;\n position.setPoint({ x, y });\n menu.pendingEdge.current = 'start';\n menu.setOpen(true);\n };\n\n return (\n // A transparent wrapper around arbitrary content, not a control. It must not be\n // focusable or take a role: the actions it exposes have a visible equivalent elsewhere\n // (see the note on `ContextMenu`), and a tab stop here would put an unexplained one in\n // the middle of a table row.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-slot=\"context-menu-trigger\"\n className={className}\n onContextMenu={(event: ReactMouseEvent) => {\n event.preventDefault();\n openAt(event.clientX, event.clientY);\n }}\n onKeyDown={(event) => {\n // Shift+F10 and the dedicated ContextMenu key are the keyboard equivalents of a\n // right-click, and the only way this is reachable without a pointer. The wrapper is\n // not focusable itself — deliberately, so it adds no tab stop — so the key arrives by\n // bubbling from whatever focusable element inside it has focus. That means the\n // trigger's content must contain something focusable for the keyboard path to exist;\n // in practice it always does, since the same content carries the visible actions.\n if (event.key === 'ContextMenu' || (event.shiftKey && event.key === 'F10')) {\n event.preventDefault();\n const rect = event.currentTarget.getBoundingClientRect();\n openAt(rect.left + rect.width / 2, rect.top + rect.height / 2);\n }\n }}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nexport interface ContextMenuContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Minimum gap from the viewport edge, in px. Default `8`. */\n collisionPadding?: number;\n}\n\nexport function ContextMenuContent({\n children,\n collisionPadding = 8,\n className,\n ...rest\n}: ContextMenuContentProps) {\n const menu = useMenu('ContextMenuContent');\n const position = usePosition();\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [panelNode, setPanelNode] = useState<HTMLDivElement | null>(null);\n\n menu.resetIndices();\n\n useOverlayDismiss({\n onDismiss: () => menu.setOpen(false),\n panelRef,\n active: menu.open,\n trapFocus: false,\n lockScroll: false,\n inertBackground: false,\n autoFocus: false,\n });\n\n const wasOpen = useRef(false);\n useEffect(() => {\n if (menu.open && panelNode && !wasOpen.current) {\n menu.roving.moveToEdge(menu.pendingEdge.current);\n wasOpen.current = true;\n }\n if (!menu.open) wasOpen.current = false;\n }, [menu.open, panelNode, menu.roving, menu.pendingEdge]);\n\n // Flip about the pointer when the menu would overflow, which is what every native context\n // menu does. Measured after mount, so the first paint may be one frame off-edge in the\n // rare case the menu is taller than the viewport.\n const [offset, setOffset] = useState({ dx: 0, dy: 0 });\n useEffect(() => {\n if (!panelNode || !position.point) return;\n const rect = panelNode.getBoundingClientRect();\n const overflowX = position.point.x + rect.width + collisionPadding - window.innerWidth;\n const overflowY = position.point.y + rect.height + collisionPadding - window.innerHeight;\n setOffset({\n dx: overflowX > 0 ? -Math.min(rect.width, overflowX) : 0,\n dy: overflowY > 0 ? -Math.min(rect.height, overflowY) : 0,\n });\n }, [panelNode, position.point, collisionPadding]);\n\n if (!menu.open || !position.point) return null;\n\n return (\n <Portal>\n <div\n ref={composeRefs<HTMLDivElement>(panelRef, (node) => setPanelNode(node))}\n id={menu.menuId}\n role=\"menu\"\n tabIndex={-1}\n aria-orientation=\"vertical\"\n style={{\n position: 'fixed',\n left: position.point.x + offset.dx,\n top: position.point.y + offset.dy,\n }}\n className={clsx('z-popover', MENU_PANEL_CLASSES, className)}\n {...menu.roving.containerProps}\n onKeyDown={(event) => {\n menu.roving.containerProps.onKeyDown(event);\n if (event.key === 'Tab') menu.setOpen(false);\n }}\n {...rest}\n >\n {children}\n </div>\n </Portal>\n );\n}\n\nexport {\n MenuItem as ContextMenuItem,\n MenuCheckboxItem as ContextMenuCheckboxItem,\n MenuRadioGroup as ContextMenuRadioGroup,\n MenuRadioItem as ContextMenuRadioItem,\n MenuGroup as ContextMenuGroup,\n MenuLabel as ContextMenuLabel,\n MenuSeparator as ContextMenuSeparator,\n MenuShortcut as ContextMenuShortcut,\n} from './menu-core';\n","import {\n createContext,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuCheck } from 'react-icons/lu';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\nimport {\n OVERLAY_HEADING,\n OVERLAY_ITEM_BASE,\n OVERLAY_ITEM_SIZE,\n OVERLAY_PANEL_MENU,\n OVERLAY_SEPARATOR,\n overlayItemTone,\n type OverlayItemTone,\n} from './menu-styles';\n\n/**\n * The shared machinery behind `DropdownMenu`, `ContextMenu` and `Menubar`.\n *\n * All three are the same WAI-ARIA menu: identical items, identical keyboard contract,\n * identical ARIA. Only how they *open* differs — a trigger button, a right-click at pointer\n * coordinates, or a horizontal bar of triggers. Extracted in 0.4.0 so there is one\n * implementation of the contract rather than three; the version this library shipped\n * through 0.3.0 implemented it zero times, and copying that mistake three ways would have\n * been worse than copying it once.\n *\n * Roots build their context with `useMenuState()` and provide it; items read it and need to\n * know nothing about which kind of menu they are in.\n */\n\nexport interface MenuContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n menuId: string;\n triggerId: string;\n /** Items claim a roving index in render order, which is their visual order. */\n claimIndex: () => number;\n /** Called by the panel before its children render, so indices restart from zero. */\n resetIndices: () => void;\n /**\n * Which end of the list to land on when the menu opens. ArrowUp on a trigger means \"last\n * item\", per the APG. A ref handoff rather than the trigger focusing directly: the panel\n * does not exist yet when the trigger handles the key, and `Portal` adds a further commit\n * before the items mount.\n */\n pendingEdge: { current: 'start' | 'end' };\n roving: ReturnType<typeof useRovingFocus>;\n}\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport function useMenu(part: string): MenuContextValue {\n const context = useContext(MenuContext);\n if (!context) {\n throw new Error(`<${part}> must be used inside a menu root (DropdownMenu, ContextMenu, Menubar)`);\n }\n return context;\n}\n\nexport interface UseMenuStateOptions {\n open: boolean;\n setOpen: (open: boolean) => void;\n}\n\n/** Builds the context value a menu root provides. */\nexport function useMenuState({ open, setOpen }: UseMenuStateOptions): MenuContextValue {\n const baseId = useId();\n const cursor = useRef(0);\n const pendingEdge = useRef<'start' | 'end'>('start');\n\n const roving = useRovingFocus({\n orientation: 'vertical',\n loop: true,\n typeahead: true,\n onEscape: () => setOpen(false),\n });\n\n const claimIndex = useCallback(() => cursor.current++, []);\n const resetIndices = useCallback(() => {\n cursor.current = 0;\n }, []);\n\n return useMemo(\n () => ({\n open,\n setOpen,\n menuId: `${baseId}-menu`,\n triggerId: `${baseId}-trigger`,\n claimIndex,\n resetIndices,\n pendingEdge,\n roving,\n }),\n [open, setOpen, baseId, claimIndex, resetIndices, roving],\n );\n}\n\n/**\n * Panel chrome, shared so the three menus cannot drift apart visually.\n *\n * Now an alias of the library-wide `OVERLAY_PANEL_MENU` — the same chrome backs the\n * Combobox, Command and Select lists. See `menu-styles.ts` for why menus adopted the\n * inset `p-1` panel rather than the other three adopting `py-1`.\n */\nexport const MENU_PANEL_CLASSES = OVERLAY_PANEL_MENU;\n\nconst ITEM_BASE = clsx(OVERLAY_ITEM_BASE, OVERLAY_ITEM_SIZE.md);\n\nexport type MenuItemTone = OverlayItemTone;\n\nconst itemToneClasses = overlayItemTone;\n\n// ── Item ───────────────────────────────────────────────────────────────────────\n\nexport interface MenuItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n children: ReactNode;\n onSelect?: () => void;\n tone?: MenuItemTone;\n disabled?: boolean;\n /** Leading glyph. Marked decorative automatically. Matches Figma's `Icon` / `Has Icon`. */\n icon?: ReactNode;\n /** Second line. Matches Figma's `Description` / `Has Description`. */\n description?: ReactNode;\n /** Trailing shortcut hint. Matches Figma's `Shortcut` / `Has Shortcut`. */\n shortcut?: ReactNode;\n /** Typeahead match text, when `children` is not a plain string. */\n textValue?: string;\n}\n\nexport function MenuItem({\n children,\n onSelect,\n tone = 'default',\n disabled = false,\n icon,\n description,\n shortcut,\n textValue,\n className,\n ...rest\n}: MenuItemProps) {\n const menu = useMenu('MenuItem');\n const index = menu.claimIndex();\n const descriptionId = `${menu.menuId}-desc-${index}`;\n\n const label = textValue ?? (typeof children === 'string' ? children : undefined);\n const itemProps = menu.roving.itemProps(index, { disabled, label });\n\n const activate = () => {\n if (disabled) return;\n menu.setOpen(false);\n onSelect?.();\n };\n\n return (\n <div\n // `role=\"menuitem\"` on a div rather than a <button>: the roving tabindex owns\n // focusability, and a native button would re-enter the tab sequence.\n role=\"menuitem\"\n aria-disabled={disabled || undefined}\n aria-describedby={description ? descriptionId : undefined}\n {...itemProps}\n // Restated after the spread so jsx-a11y can see it — it cannot follow a tabIndex\n // that arrives through an object spread.\n tabIndex={itemProps.tabIndex}\n className={clsx(ITEM_BASE, itemToneClasses(tone, disabled), className)}\n onClick={(event) => {\n event.stopPropagation();\n activate();\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n activate();\n }\n }}\n {...rest}\n >\n {icon && (\n <span aria-hidden className=\"mt-0.5 flex size-4 shrink-0 items-center justify-center\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate\">{children}</span>\n {description && (\n <span id={descriptionId} className=\"mt-0.5 block text-body-tiny text-default-secondary\">\n {description}\n </span>\n )}\n </span>\n {shortcut && (\n <span className=\"ml-auto shrink-0 pl-4 text-body-tiny text-default-tertiary\">\n {shortcut}\n </span>\n )}\n </div>\n );\n}\n\n// ── CheckboxItem ───────────────────────────────────────────────────────────────\n\nexport interface MenuCheckboxItemProps extends Omit<MenuItemProps, 'onSelect' | 'icon'> {\n checked: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport function MenuCheckboxItem({\n children,\n checked,\n onCheckedChange,\n disabled = false,\n tone = 'default',\n shortcut,\n textValue,\n className,\n ...rest\n}: MenuCheckboxItemProps) {\n const menu = useMenu('MenuCheckboxItem');\n const index = menu.claimIndex();\n const label = textValue ?? (typeof children === 'string' ? children : undefined);\n const itemProps = menu.roving.itemProps(index, { disabled, label });\n\n const toggle = () => {\n if (disabled) return;\n onCheckedChange?.(!checked);\n // Deliberately stays open — a checkbox item is for multi-select, and closing after each\n // toggle would make selecting three things take three round trips.\n };\n\n return (\n <div\n role=\"menuitemcheckbox\"\n aria-checked={checked}\n aria-disabled={disabled || undefined}\n {...itemProps}\n tabIndex={itemProps.tabIndex}\n className={clsx(ITEM_BASE, 'items-center', itemToneClasses(tone, disabled), className)}\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n toggle();\n }\n }}\n {...rest}\n >\n <span aria-hidden className=\"flex size-4 shrink-0 items-center justify-center\">\n {checked && <LuCheck className=\"size-3.5\" strokeWidth={3} />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n {shortcut && (\n <span className=\"ml-auto shrink-0 pl-4 text-body-tiny text-default-tertiary\">\n {shortcut}\n </span>\n )}\n </div>\n );\n}\n\n// ── RadioGroup / RadioItem ─────────────────────────────────────────────────────\n\ninterface MenuRadioContextValue {\n value: string | undefined;\n onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioContext = createContext<MenuRadioContextValue | null>(null);\n\nexport interface MenuRadioGroupProps {\n children: ReactNode;\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport function MenuRadioGroup({ children, value, onValueChange }: MenuRadioGroupProps) {\n const context = useMemo(() => ({ value, onValueChange }), [value, onValueChange]);\n return (\n <MenuRadioContext.Provider value={context}>\n <div role=\"group\">{children}</div>\n </MenuRadioContext.Provider>\n );\n}\n\nexport interface MenuRadioItemProps extends Omit<MenuItemProps, 'onSelect' | 'icon'> {\n value: string;\n}\n\nexport function MenuRadioItem({\n children,\n value,\n disabled = false,\n tone = 'default',\n textValue,\n className,\n ...rest\n}: MenuRadioItemProps) {\n const menu = useMenu('MenuRadioItem');\n const group = useContext(MenuRadioContext);\n const index = menu.claimIndex();\n const label = textValue ?? (typeof children === 'string' ? children : undefined);\n const itemProps = menu.roving.itemProps(index, { disabled, label });\n\n const checked = group?.value === value;\n\n const select = () => {\n if (disabled) return;\n group?.onValueChange?.(value);\n menu.setOpen(false);\n };\n\n return (\n <div\n role=\"menuitemradio\"\n aria-checked={checked}\n aria-disabled={disabled || undefined}\n {...itemProps}\n tabIndex={itemProps.tabIndex}\n className={clsx(ITEM_BASE, 'items-center', itemToneClasses(tone, disabled), className)}\n onClick={(event) => {\n event.stopPropagation();\n select();\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n select();\n }\n }}\n {...rest}\n >\n <span aria-hidden className=\"flex size-4 shrink-0 items-center justify-center\">\n {checked && <span className=\"size-1.5 rounded-full bg-current\" />}\n </span>\n <span className=\"min-w-0 flex-1 truncate\">{children}</span>\n </div>\n );\n}\n\n// ── Structure ──────────────────────────────────────────────────────────────────\n\nconst HEADING_CLASSES = OVERLAY_HEADING;\n\nexport interface MenuGroupProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Names the group. Rendered as a heading when set. */\n label?: string;\n}\n\nexport function MenuGroup({ children, label, className, ...rest }: MenuGroupProps) {\n const labelId = useId();\n return (\n <div role=\"group\" aria-labelledby={label ? labelId : undefined} className={className} {...rest}>\n {label && (\n <div id={labelId} className={HEADING_CLASSES}>\n {label}\n </div>\n )}\n {children}\n </div>\n );\n}\n\nexport interface MenuLabelProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** A non-interactive heading inside the menu. Matches Figma's `Menu Heading`. */\nexport function MenuLabel({ children, className, ...rest }: MenuLabelProps) {\n return (\n <div className={clsx(HEADING_CLASSES, className)} {...rest}>\n {children}\n </div>\n );\n}\n\nexport interface MenuSeparatorProps extends HTMLAttributes<HTMLDivElement> {}\n\n/** Matches Figma's `Menu Separator`. Was a bare unlabelled `div` before 0.4.0. */\nexport function MenuSeparator({ className, ...rest }: MenuSeparatorProps) {\n return (\n <div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n className={clsx(OVERLAY_SEPARATOR, className)}\n {...rest}\n />\n );\n}\n\nexport interface MenuShortcutProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\n/** Trailing keyboard hint, for use outside an item's `shortcut` prop. */\nexport function MenuShortcut({ children, className, ...rest }: MenuShortcutProps) {\n return (\n <span\n className={clsx('ml-auto pl-4 text-body-tiny text-default-tertiary', className)}\n {...rest}\n >\n {children}\n </span>\n );\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\n\nimport { composeRefs } from '../../lib/slot';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\nimport { useFloatingPanel } from './floating';\nimport { MENU_PANEL_CLASSES, MenuContext, useMenu, useMenuState } from './menu-core';\nimport { useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\ninterface MenubarContextValue {\n /** Which top-level menu is open, by value. `null` when none is. */\n openValue: string | null;\n setOpenValue: (value: string | null) => void;\n claimMenuIndex: () => number;\n resetMenuIndices: () => void;\n barRoving: ReturnType<typeof useRovingFocus>;\n baseId: string;\n}\n\nconst MenubarContext = createContext<MenubarContextValue | null>(null);\n\nfunction useMenubar(part: string): MenubarContextValue {\n const value = useContext(MenubarContext);\n if (!value) throw new Error(`<${part}> must be used inside <Menubar>`);\n return value;\n}\n\nexport interface MenubarProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Names the menubar. Required by the APG. */\n label: string;\n}\n\n/**\n * An application menu bar — a horizontal row of menus, as in a desktop app.\n *\n * Two things distinguish it from a row of `DropdownMenu`s, and both are in the APG:\n *\n * - **The bar is one tab stop.** Left/Right move between the top-level menus; Tab leaves the\n * bar entirely. A row of independent dropdowns is N tab stops.\n * - **Only one menu is open at a time**, and once any is open, moving along the bar switches\n * directly to the next menu rather than closing and reopening.\n *\n * Items and the vertical keyboard contract come from `menu-core`, shared with\n * `DropdownMenu` and `ContextMenu`.\n */\nexport function Menubar({ children, label, className, ...rest }: MenubarProps) {\n const baseId = useId();\n const [openValue, setOpenValue] = useState<string | null>(null);\n const cursor = useRef(0);\n\n const barRoving = useRovingFocus({\n orientation: 'horizontal',\n loop: true,\n onEscape: () => setOpenValue(null),\n });\n\n const context = useMemo<MenubarContextValue>(\n () => ({\n openValue,\n setOpenValue,\n claimMenuIndex: () => cursor.current++,\n resetMenuIndices: () => {\n cursor.current = 0;\n },\n barRoving,\n baseId,\n }),\n [openValue, barRoving, baseId],\n );\n\n context.resetMenuIndices();\n\n return (\n <MenubarContext.Provider value={context}>\n <div\n role=\"menubar\"\n aria-label={label}\n aria-orientation=\"horizontal\"\n data-slot=\"menubar\"\n className={clsx('flex items-center gap-0.5', className)}\n // Deliberately no `onBlur` close. `MenubarContent` is portaled, so focus moving into\n // an open menu leaves the bar's subtree — a containment check here closed the menu\n // the instant it opened. Dismissal is handled where it can see both the bar and the\n // panel: Escape via the roving hook, outside-press via `useOverlayDismiss`.\n {...barRoving.containerProps}\n {...rest}\n >\n {children}\n </div>\n </MenubarContext.Provider>\n );\n}\n\nexport interface MenubarMenuProps {\n children: ReactNode;\n /** Identifies this menu within the bar. */\n value: string;\n}\n\n/** One menu in the bar. Wraps a `MenubarTrigger` and a `MenubarContent`. */\nexport function MenubarMenu({ children, value }: MenubarMenuProps) {\n const bar = useMenubar('MenubarMenu');\n const index = bar.claimMenuIndex();\n\n const open = bar.openValue === value;\n const menu = useMenuState({\n open,\n setOpen: (next) => bar.setOpenValue(next ? value : null),\n });\n\n const scope = useMemo(() => ({ value, index }), [value, index]);\n\n return (\n <MenuContext.Provider value={menu}>\n <MenubarMenuScope.Provider value={scope}>{children}</MenubarMenuScope.Provider>\n </MenuContext.Provider>\n );\n}\n\nconst MenubarMenuScope = createContext<{ value: string; index: number } | null>(null);\n\nfunction useMenubarMenu(part: string) {\n const value = useContext(MenubarMenuScope);\n if (!value) throw new Error(`<${part}> must be used inside <MenubarMenu>`);\n return value;\n}\n\nexport interface MenubarTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n}\n\nexport function MenubarTrigger({ children, className, ...rest }: MenubarTriggerProps) {\n const bar = useMenubar('MenubarTrigger');\n const menu = useMenu('MenubarTrigger');\n const scope = useMenubarMenu('MenubarTrigger');\n const [node, setNode] = useState<HTMLButtonElement | null>(null);\n\n // The roving hook supplies its own `ref`, so it has to be composed with the local one\n // rather than spread — a second `ref` in the JSX silently wins and the trigger never\n // registers.\n const { ref: rovingRef, ...itemProps } = bar.barRoving.itemProps(scope.index, {\n label: typeof children === 'string' ? children : undefined,\n });\n\n // Registered so `MenubarContent` can anchor to it.\n useEffect(() => {\n triggerNodes.set(scope.value, node);\n return () => {\n triggerNodes.delete(scope.value);\n };\n }, [scope.value, node]);\n\n return (\n <button\n ref={composeRefs<HTMLButtonElement>(setNode, rovingRef)}\n type=\"button\"\n role=\"menuitem\"\n id={menu.triggerId}\n aria-haspopup=\"menu\"\n aria-expanded={menu.open}\n aria-controls={menu.open ? menu.menuId : undefined}\n {...itemProps}\n tabIndex={itemProps.tabIndex}\n onClick={() => menu.setOpen(!menu.open)}\n onFocus={() => {\n itemProps.onFocus();\n // Arrowing along the bar with a menu already open switches directly to this one.\n if (bar.openValue !== null && bar.openValue !== scope.value) {\n bar.setOpenValue(scope.value);\n }\n }}\n onPointerEnter={() => {\n if (bar.openValue !== null) bar.setOpenValue(scope.value);\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n menu.pendingEdge.current = event.key === 'ArrowUp' ? 'end' : 'start';\n menu.setOpen(true);\n }\n }}\n className={clsx(\n 'rounded-md px-2.5 py-1.5 text-body-sm text-default transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n menu.open ? 'bg-default-secondary' : 'hover:bg-default-secondary',\n className,\n )}\n {...rest}\n >\n {children}\n </button>\n );\n}\n\n/** Module-level so `MenubarContent` can find its trigger without another context layer. */\nconst triggerNodes = new Map<string, HTMLElement | null>();\n\nexport interface MenubarContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function MenubarContent({ children, className, ...rest }: MenubarContentProps) {\n const bar = useMenubar('MenubarContent');\n const menu = useMenu('MenubarContent');\n const scope = useMenubarMenu('MenubarContent');\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [panelNode, setPanelNode] = useState<HTMLDivElement | null>(null);\n\n menu.resetIndices();\n\n // Where focus lands when this panel closes. `useOverlayDismiss` reads it at unmount, so\n // it has to be the value from the render that *caused* the close — which is why it is a\n // ref written during render rather than state.\n //\n // Closing the bar outright — an item selected, Escape, a press outside — returns focus\n // to this menu's trigger, per the APG. Switching to a sibling menu must not: the\n // sibling's trigger already has focus, and pulling it back here fires this trigger's\n // `onFocus`, which reopens this menu and closes the one the user just moved to. That is\n // the whole \"only one menu is open at a time\" contract inverting itself, and it fired on\n // every route into a sibling — arrow keys, hover and click alike.\n const returnFocus = useRef<HTMLElement | null>(null);\n returnFocus.current = bar.openValue === null ? (triggerNodes.get(scope.value) ?? null) : null;\n\n const { refs, floatingStyles } = useFloatingPanel({\n open: menu.open,\n onOpenChange: menu.setOpen,\n side: 'bottom',\n align: 'start',\n sideOffset: 4,\n });\n\n useEffect(() => {\n refs.setReference(triggerNodes.get(scope.value) ?? null);\n }, [refs, scope.value, menu.open]);\n\n useOverlayDismiss({\n onDismiss: () => menu.setOpen(false),\n panelRef,\n active: menu.open,\n trapFocus: false,\n lockScroll: false,\n inertBackground: false,\n autoFocus: false,\n returnFocus,\n });\n\n const wasOpen = useRef(false);\n useEffect(() => {\n if (menu.open && panelNode && !wasOpen.current) {\n menu.roving.moveToEdge(menu.pendingEdge.current);\n menu.pendingEdge.current = 'start';\n wasOpen.current = true;\n }\n if (!menu.open) wasOpen.current = false;\n }, [menu.open, panelNode, menu.roving, menu.pendingEdge]);\n\n if (!menu.open) return null;\n\n return (\n <Portal>\n <div\n ref={composeRefs<HTMLDivElement>(panelRef, (node) => setPanelNode(node), refs.setFloating)}\n id={menu.menuId}\n role=\"menu\"\n tabIndex={-1}\n aria-orientation=\"vertical\"\n aria-labelledby={menu.triggerId}\n style={floatingStyles}\n className={clsx('z-dropdown', MENU_PANEL_CLASSES, className)}\n {...menu.roving.containerProps}\n onKeyDown={(event) => {\n menu.roving.containerProps.onKeyDown(event);\n // Left/Right inside an open menu move along the bar, per the APG.\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n event.preventDefault();\n const trigger = triggerNodes.get(scope.value);\n trigger?.focus();\n // Re-dispatch on the bar so its horizontal roving handles the move.\n trigger?.dispatchEvent(\n new KeyboardEvent('keydown', { key: event.key, bubbles: true }),\n );\n }\n if (event.key === 'Tab') menu.setOpen(false);\n }}\n {...rest}\n >\n {children}\n </div>\n </Portal>\n );\n}\n\nexport {\n MenuItem as MenubarItem,\n MenuCheckboxItem as MenubarCheckboxItem,\n MenuRadioGroup as MenubarRadioGroup,\n MenuRadioItem as MenubarRadioItem,\n MenuGroup as MenubarGroup,\n MenuLabel as MenubarLabel,\n MenuSeparator as MenubarSeparator,\n MenuShortcut as MenubarShortcut,\n} from './menu-core';\n","import { useRef, type ReactNode, type RefObject } from 'react';\nimport clsx from 'clsx';\nimport { LuX } from 'react-icons/lu';\n\nimport { ScrollArea } from '../cards/scroll-area';\nimport { IconButton } from '../forms/icon-button';\nimport { OVERLAY_SCRIM, useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\nexport type DrawerSide = 'right' | 'left';\n\nexport interface DrawerProps {\n open: boolean;\n /** Fired with `false` on Escape, an outside press, or the close button. */\n onOpenChange: (open: boolean) => void;\n /** Header content (left side). The copies this replaces differ only here — a status badge +\n * title in one, an avatar + title + category in another — so it is a slot, not props. */\n header: ReactNode;\n children: ReactNode;\n footer?: ReactNode;\n /** `between` when the footer has a left-aligned secondary action. */\n footerAlign?: 'end' | 'between';\n /** Panel width. Defaults to the `w-[440px] max-w-[90vw]` shared by every existing drawer. */\n width?: string;\n /** Which edge the panel slides in from. Default `right`. */\n side?: DrawerSide;\n /**\n * Accessible name for the dialog. **Required** as of 0.4.0.\n *\n * It was optional through 0.3.0 while `Modal.label` was required, which meant the\n * public API allowed a `role=\"dialog\" aria-modal=\"true\"` element with no accessible\n * name at all — a screen reader announced \"dialog\" and nothing else. Unlike `Modal`\n * there is no `DrawerTitle` part to infer a name from, because `header` is a free\n * slot, so the string is the only place it can come from.\n */\n label: string;\n className?: string;\n /** Call `preventDefault()` to keep the drawer open — e.g. unsaved input. */\n onEscapeKeyDown?: (event: KeyboardEvent) => void;\n /** Call `preventDefault()` to keep the drawer open. */\n onInteractOutside?: (event: PointerEvent) => void;\n /** Focus this on open instead of the first tabbable element. */\n initialFocus?: RefObject<HTMLElement | null>;\n}\n\n/**\n * Side panel. Handles Esc, traps Tab focus, locks background scroll, marks the rest of\n * the page inert, and restores focus to the trigger on close.\n */\nexport function Drawer(props: DrawerProps) {\n if (!props.open) return null;\n return (\n <Portal>\n <DrawerShell {...props} />\n </Portal>\n );\n}\n\n/**\n * Split out for the same reason as `ModalShell`: the Esc handler and the focus trap\n * must not stay mounted behind a closed drawer, which is what would happen if\n * `useOverlayDismiss` ran above the `open` early exit.\n */\nfunction DrawerShell({\n onOpenChange,\n header,\n children,\n footer,\n footerAlign = 'end',\n width = 'w-[440px] max-w-[90vw]',\n side = 'right',\n label,\n className,\n onEscapeKeyDown,\n onInteractOutside,\n initialFocus,\n}: Omit<DrawerProps, 'open'>) {\n const panelRef = useRef<HTMLElement | null>(null);\n\n useOverlayDismiss({\n onDismiss: () => onOpenChange(false),\n panelRef,\n initialFocus,\n onEscapeKeyDown,\n onInteractOutside,\n });\n\n return (\n <div\n className={clsx(\n 'fixed inset-0 z-overlay flex',\n side === 'right' ? 'justify-end' : 'justify-start',\n OVERLAY_SCRIM,\n )}\n >\n <aside\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={label}\n className={clsx('relative flex h-full flex-col bg-default shadow-500', width, className)}\n >\n <div className=\"flex items-start justify-between gap-3 border-b border-default p-6\">\n <div className=\"min-w-0\">{header}</div>\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label=\"Close\"\n onClick={() => onOpenChange(false)}\n >\n <LuX size={18} aria-hidden />\n </IconButton>\n </div>\n\n <ScrollArea axis=\"vertical\" label={label} className=\"min-h-0 flex-1\">\n <div className=\"space-y-6 p-6\">{children}</div>\n </ScrollArea>\n\n {footer && (\n <div\n className={clsx(\n 'flex items-center gap-2 border-t border-default px-6 py-4',\n footerAlign === 'between' ? 'justify-between' : 'justify-end',\n )}\n >\n {footer}\n </div>\n )}\n </aside>\n </div>\n );\n}\n","import { forwardRef, useEffect, useRef, useState, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\nimport { composeRefs } from '../../lib/slot';\n\nexport type ScrollAreaAxis = 'vertical' | 'horizontal' | 'both';\n\nexport interface ScrollAreaProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n axis?: ScrollAreaAxis;\n /**\n * Accessible name for the scrollable region. Strongly recommended — a scroll container\n * that becomes focusable (see below) needs to announce what it is.\n */\n label?: string;\n}\n\nconst OVERFLOW: Record<ScrollAreaAxis, string> = {\n vertical: 'overflow-y-auto overflow-x-hidden',\n horizontal: 'overflow-x-auto overflow-y-hidden',\n both: 'overflow-auto',\n};\n\nexport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\n\n/**\n * A scrollable region with styled scrollbars.\n *\n * **Native scrolling, deliberately.** shadcn/Radix replaces the scrollbar with a rendered\n * one, which looks tidier and costs real accessibility: an overlay scrollbar has to\n * reimplement keyboard scrolling, momentum, trackpad and pen behaviour, and the OS\n * \"click the track to page\" convention — and it drops out entirely if the JS fails. Styling\n * `::-webkit-scrollbar` plus `scrollbar-width`/`scrollbar-color` gets most of the look with\n * none of that risk, and degrades to a normal scrollbar where unsupported.\n *\n * The one thing this *does* add is the piece browsers get wrong: a scroll container is not\n * keyboard focusable by default in Chrome or Safari, so a keyboard-only user cannot scroll\n * an overflowing `<div>` at all unless something inside it is focusable. This measures its\n * own content and sets `tabIndex={0}` only while it actually overflows, so the region is\n * scrollable with the arrow keys without adding a pointless tab stop when it does not.\n */\nexport const ScrollArea = forwardRef<HTMLDivElement, ScrollAreaProps>(function ScrollArea(\n { children, axis = 'vertical', label, className, ...rest },\n ref,\n) {\n const localRef = useRef<HTMLDivElement>(null);\n const [overflows, setOverflows] = useState(false);\n\n useEffect(() => {\n const node = localRef.current;\n if (!node) return;\n\n const measure = () => {\n const vertical = node.scrollHeight > node.clientHeight + 1;\n const horizontal = node.scrollWidth > node.clientWidth + 1;\n setOverflows(\n axis === 'vertical' ? vertical : axis === 'horizontal' ? horizontal : vertical || horizontal,\n );\n };\n\n measure();\n\n // Feature-detected: `ResizeObserver` is absent in jsdom, in Safari before 13.1, and\n // during any server render, and an unguarded `new ResizeObserver` throws outright. The\n // measurement above has already run, so without the observer the tab stop is simply\n // decided once at mount rather than tracked — degraded, not broken.\n if (typeof ResizeObserver === 'undefined') return;\n\n // Content and box size both matter, so both are observed. On the element it catches the\n // box; on the first child it catches content growth.\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n if (node.firstElementChild) observer.observe(node.firstElementChild);\n return () => observer.disconnect();\n }, [axis, children]);\n\n return (\n <div\n ref={composeRefs<HTMLDivElement>(localRef, ref)}\n // `role=\"region\"` only once it is focusable and named, so an ordinary non-overflowing\n // wrapper does not add a landmark to the page for nothing.\n role={overflows && label ? 'region' : undefined}\n aria-label={overflows ? label : undefined}\n tabIndex={overflows ? 0 : undefined}\n data-slot=\"scroll-area\"\n className={clsx(\n OVERFLOW[axis],\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n SCROLLBAR_CLASSES,\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import type { ReactNode } from 'react';\n\nimport { Button } from '../forms/button';\nimport { Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from './modal';\nimport type { ModalSize, ModalTone } from './modal';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n title: string;\n subtitle?: string;\n /**\n * Adds a tinted glyph to the header. Defaults to `default` (no glyph) so existing\n * call sites look unchanged; opt in per dialog rather than deriving it from\n * `confirmVariant`, which would silently restyle every destructive confirm.\n */\n tone?: ModalTone;\n size?: ModalSize;\n confirmLabel?: string;\n cancelLabel?: string;\n confirmVariant?: 'primary' | 'danger';\n /** Disables the confirm button and swaps its label — the double-submit guard. */\n isConfirming?: boolean;\n /** Label shown on the confirm button while `isConfirming`. */\n confirmingLabel?: string;\n /** Optional body — a warning callout, a consequences list, or a failed-attempt error. */\n children?: ReactNode;\n className?: string;\n onConfirm: () => void;\n /** Fired with `false` on cancel, Escape, or an outside press. */\n onOpenChange: (open: boolean) => void;\n}\n\n/**\n * The in-app replacement for `window.confirm`: a title, an optional body, and a\n * cancel/confirm pair.\n *\n * Kept as a preset rather than folded into `Modal` because it carries *behaviour*, not\n * just layout — the `isConfirming` guard that disables the button and swaps its label\n * is the thing call sites get wrong when they hand-roll a confirm. For any other\n * shape, compose `Modal` and its parts directly.\n */\nexport function ConfirmDialog({\n open,\n title,\n subtitle,\n tone = 'default',\n size = 'md',\n confirmLabel = 'Confirm',\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n isConfirming = false,\n confirmingLabel = 'Working…',\n children,\n className,\n onConfirm,\n onOpenChange,\n}: ConfirmDialogProps) {\n return (\n // `alertdialog`, not `dialog`: this interrupts to ask a yes/no question, so the body\n // should be announced on open rather than waiting to be browsed to. The name comes\n // from `ModalTitle` via `aria-labelledby`, so there is no `label` to keep in sync.\n <Modal\n open={open}\n onOpenChange={onOpenChange}\n role=\"alertdialog\"\n size={size}\n className={className}\n >\n <ModalHeader tone={tone} divider={Boolean(children)}>\n <ModalTitle>{title}</ModalTitle>\n {subtitle && <ModalDescription>{subtitle}</ModalDescription>}\n </ModalHeader>\n {/* Guarded: 0.2.0 always rendered a body, so a childless confirm carried 40px of\n dead space plus a stray rule. */}\n {children && <ModalBody>{children}</ModalBody>}\n <ModalFooter>\n <Button variant=\"neutral\" size=\"md\" onClick={() => onOpenChange(false)}>\n {cancelLabel}\n </Button>\n <Button variant={confirmVariant} size=\"md\" disabled={isConfirming} onClick={onConfirm}>\n {isConfirming ? confirmingLabel : confirmLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n}\n","import { useState } from 'react';\n\nimport { Button } from '../forms/button';\nimport { Textarea } from '../forms/textarea';\nimport { Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, ModalTitle } from './modal';\nimport type { ModalSize, ModalTone } from './modal';\n\nexport interface NoteConfirmModalProps {\n open: boolean;\n title: string;\n subtitle?: string;\n tone?: ModalTone;\n size?: ModalSize;\n confirmLabel: string;\n cancelLabel?: string;\n confirmVariant?: 'primary' | 'danger';\n /** Block confirmation until the note has content. */\n requireNote?: boolean;\n notePlaceholder?: string;\n submittingLabel?: string;\n isSubmitting?: boolean;\n className?: string;\n /** Fired with `false` on cancel, Escape, or an outside press. */\n onOpenChange: (open: boolean) => void;\n onConfirm: (note: string) => void;\n /**\n * Asked before an Escape or outside press throws away a note that has content.\n * Return `false` to keep the dialog open. Defaults to `window.confirm`.\n */\n onDiscardNote?: (note: string) => boolean;\n}\n\n/**\n * Confirm dialog that collects a free-text note — approvals, rejections, information\n * requests. The note is trimmed before it reaches `onConfirm`.\n *\n * Kept as a preset because it owns state, and a composition cannot.\n */\nexport function NoteConfirmModal({ open, ...rest }: NoteConfirmModalProps) {\n // The shell split is what resets the note. Before 0.3.0 this component had no `open`\n // prop and callers mounted it conditionally, so the typed note was discarded for free.\n // Now that it stays mounted, unmounting the shell is what clears it — otherwise a\n // rejection note would reappear the next time the dialog opened.\n if (!open) return null;\n return <NoteConfirmModalShell {...rest} />;\n}\n\nfunction NoteConfirmModalShell({\n title,\n subtitle,\n tone = 'default',\n size = 'md',\n confirmLabel,\n cancelLabel = 'Cancel',\n confirmVariant = 'primary',\n requireNote = false,\n notePlaceholder = 'Add a note…',\n submittingLabel = 'Saving…',\n isSubmitting = false,\n className,\n onOpenChange,\n onConfirm,\n onDiscardNote,\n}: Omit<NoteConfirmModalProps, 'open'>) {\n const [note, setNote] = useState('');\n const disabled = isSubmitting || (requireNote && !note.trim());\n\n /**\n * Escape and an outside press both unmount the shell, which is what clears the note —\n * so before 0.4.0 either one silently destroyed whatever the user had typed, with no\n * warning and no undo. On a rejection-reason dialog that is real work lost.\n */\n const guardDiscard = (event: { preventDefault: () => void }) => {\n if (!note.trim()) return;\n const confirmed = onDiscardNote\n ? onDiscardNote(note)\n : typeof window !== 'undefined' &&\n window.confirm('Discard your note? It will not be saved.');\n if (!confirmed) event.preventDefault();\n };\n\n return (\n <Modal\n open\n onOpenChange={onOpenChange}\n size={size}\n className={className}\n onEscapeKeyDown={guardDiscard}\n onInteractOutside={guardDiscard}\n >\n <ModalHeader tone={tone}>\n <ModalTitle>{title}</ModalTitle>\n {subtitle && <ModalDescription>{subtitle}</ModalDescription>}\n </ModalHeader>\n <ModalBody>\n <Textarea\n value={note}\n onChange={(e) => setNote(e.target.value)}\n placeholder={notePlaceholder}\n rows={4}\n />\n </ModalBody>\n <ModalFooter>\n <Button variant=\"neutral\" size=\"md\" onClick={() => onOpenChange(false)}>\n {cancelLabel}\n </Button>\n <Button variant={confirmVariant} size=\"md\" disabled={disabled} onClick={() => onConfirm(note.trim())}>\n {isSubmitting ? submittingLabel : confirmLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n}\n","import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n type Ref,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuEllipsis } from 'react-icons/lu';\n\nimport { Slot, composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { IconButton } from '../forms/icon-button';\nimport { useFloatingPanel, type FloatingAlign, type FloatingSide } from './floating';\nimport { MENU_PANEL_CLASSES, MenuContext, useMenu, useMenuState } from './menu-core';\nimport { useOverlayDismiss } from './overlay';\nimport { Portal } from './portal';\n\n/**\n * Overflow / row-actions menu, rebuilt in 0.4.0.\n *\n * The previous version declared `role=\"menu\"` and `role=\"menuitem\"` and implemented none of\n * the WAI-ARIA menu contract. Announcing a pattern you do not implement is worse than\n * announcing nothing, because a screen reader tells the user which keys should work. Fixed:\n * arrow keys, Home/End and typeahead; a roving tabindex (every item used to be a natively\n * tabbable `<button>`, so Tab walked all of them); focus moving into the menu on open and\n * back to the trigger on close; a portal, so the panel is no longer clipped by `Card`'s\n * `overflow-hidden` or `DataTable`'s `overflow-x-auto` — both named in its own doc comment\n * as the reason it exists; collision handling instead of a static `left`/`right`; correct\n * ARIA ownership; and `open`/`onOpenChange`, where open state used to be unreachable.\n *\n * The items and keyboard model now live in `menu-core`, shared with `ContextMenu` and\n * `Menubar`.\n *\n * Not implemented: submenus. Doing them properly needs hover intent and a safe-travel\n * polygon between trigger and panel, and a half-built version is worse than none — nest a\n * second `DropdownMenu` in the meantime.\n */\n\nexport interface DropdownMenuProps {\n children: ReactNode;\n /** Controlled open state. Omit for uncontrolled. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\n/**\n * The trigger element, for Floating UI to measure.\n *\n * Kept out of the shared menu context because only the trigger-anchored menus have one — a\n * `ContextMenu` positions at pointer coordinates and has no trigger element at all.\n */\ninterface TriggerNodeContextValue {\n triggerNode: HTMLElement | null;\n setTriggerNode: (node: HTMLElement | null) => void;\n}\n\nconst TriggerNodeContext = createContext<TriggerNodeContextValue | null>(null);\n\nfunction useTriggerNode(): TriggerNodeContextValue {\n const value = useContext(TriggerNodeContext);\n if (!value) throw new Error('DropdownMenu parts must be used inside <DropdownMenu>');\n return value;\n}\n\nexport function DropdownMenu({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n}: DropdownMenuProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const menu = useMenuState({ open, setOpen });\n // State, not a ref: `DropdownMenuContent` must re-render once the trigger exists so\n // Floating UI can measure it. A ref write would leave the panel positioned at 0,0.\n const [triggerNode, setTriggerNode] = useState<HTMLElement | null>(null);\n const anchor = useMemo(() => ({ triggerNode, setTriggerNode }), [triggerNode]);\n\n return (\n <MenuContext.Provider value={menu}>\n <TriggerNodeContext.Provider value={anchor}>{children}</TriggerNodeContext.Provider>\n </MenuContext.Provider>\n );\n}\n\n// ── Trigger ────────────────────────────────────────────────────────────────────\n\nexport interface DropdownMenuTriggerProps extends HTMLAttributes<HTMLElement> {\n children?: ReactNode;\n /** Render the child element instead of the default overflow button. */\n asChild?: boolean;\n /** Accessible name for the default `⋯` button. Ignored when `asChild` is set. */\n label?: string;\n}\n\nexport function DropdownMenuTrigger({\n children,\n asChild = false,\n label = 'Open menu',\n ...rest\n}: DropdownMenuTriggerProps) {\n const menu = useMenu('DropdownMenuTrigger');\n const anchor = useTriggerNode();\n\n const triggerProps = {\n id: menu.triggerId,\n 'aria-haspopup': 'menu' as const,\n 'aria-expanded': menu.open,\n 'aria-controls': menu.open ? menu.menuId : undefined,\n onClick: (event: ReactMouseEvent) => {\n event.stopPropagation();\n menu.setOpen(!menu.open);\n },\n onKeyDown: (event: ReactKeyboardEvent) => {\n // ArrowDown/Up open the menu and land on the near or far end, per the APG.\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n menu.pendingEdge.current = event.key === 'ArrowUp' ? 'end' : 'start';\n menu.setOpen(true);\n }\n },\n // Stopped at the trigger so the menu works inside a clickable table row — the\n // behaviour the 0.2.0 `RowMenu` had and the reason this component exists.\n onMouseDown: (event: ReactMouseEvent) => event.stopPropagation(),\n ...rest,\n };\n\n if (asChild) {\n return (\n <Slot ref={composeRefs(anchor.setTriggerNode)} {...triggerProps}>\n {children}\n </Slot>\n );\n }\n\n return (\n <IconButton\n ref={composeRefs(anchor.setTriggerNode) as Ref<HTMLButtonElement>}\n variant=\"neutral\"\n size=\"sm\"\n aria-label={label}\n {...triggerProps}\n >\n {children ?? <LuEllipsis className=\"size-4\" aria-hidden />}\n </IconButton>\n );\n}\n\n// ── Content ────────────────────────────────────────────────────────────────────\n\nexport interface DropdownMenuContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n sideOffset?: number;\n}\n\nexport function DropdownMenuContent({\n children,\n side = 'bottom',\n align = 'end',\n sideOffset = 6,\n className,\n ...rest\n}: DropdownMenuContentProps) {\n const menu = useMenu('DropdownMenuContent');\n const anchor = useTriggerNode();\n const panelRef = useRef<HTMLDivElement | null>(null);\n const [panelNode, setPanelNode] = useState<HTMLDivElement | null>(null);\n\n // Must run before any item's render body, so indices are reassigned from zero on every\n // pass. Content is the direct parent of every item, so its render body is guaranteed to\n // run immediately before theirs.\n menu.resetIndices();\n\n const { refs, floatingStyles } = useFloatingPanel({\n open: menu.open,\n onOpenChange: menu.setOpen,\n side,\n align,\n sideOffset,\n });\n\n // Set in an effect rather than during render: `setReference` mutates Floating UI's\n // internal state, and calling it mid-render breaks under StrictMode double-invocation.\n useEffect(() => {\n refs.setReference(anchor.triggerNode);\n }, [refs, anchor.triggerNode]);\n\n useOverlayDismiss({\n onDismiss: () => menu.setOpen(false),\n panelRef,\n active: menu.open,\n // A menu is not modal: the page behind stays readable and interactive, so none of the\n // dialog-grade side effects apply. Only Escape, outside-press and focus restore.\n trapFocus: false,\n lockScroll: false,\n inertBackground: false,\n // The menu owns its own initial focus below; a generic \"first tabbable element\" scan\n // would fight the roving tabindex, which exposes exactly one item at a time.\n autoFocus: false,\n });\n\n // Keyed on the panel node rather than on `open`: `Portal` gates its children behind a\n // mounted flag for SSR safety, so on the render where the menu opens the items do not\n // exist yet, and an effect watching `open` alone fires against an empty item list.\n const wasOpen = useRef(false);\n useEffect(() => {\n if (menu.open && panelNode && !wasOpen.current) {\n menu.roving.moveToEdge(menu.pendingEdge.current);\n menu.pendingEdge.current = 'start';\n wasOpen.current = true;\n }\n if (!menu.open) wasOpen.current = false;\n }, [menu.open, panelNode, menu.roving, menu.pendingEdge]);\n\n if (!menu.open) return null;\n\n return (\n <Portal>\n <div\n ref={composeRefs<HTMLDivElement>(\n panelRef,\n (node) => setPanelNode(node),\n refs.setFloating,\n )}\n id={menu.menuId}\n role=\"menu\"\n // Programmatically focusable but out of the tab sequence: the fallback focus target\n // for an empty menu, and it keeps key events on the panel.\n tabIndex={-1}\n aria-orientation=\"vertical\"\n aria-labelledby={menu.triggerId}\n style={floatingStyles}\n className={clsx('z-dropdown', MENU_PANEL_CLASSES, className)}\n {...menu.roving.containerProps}\n onKeyDown={(event) => {\n menu.roving.containerProps.onKeyDown(event);\n // Tab must leave the menu rather than walk it, so it closes first and lets the\n // browser move focus on from the trigger.\n if (event.key === 'Tab') menu.setOpen(false);\n }}\n {...rest}\n >\n {children}\n </div>\n </Portal>\n );\n}\n\n// ── Items, re-exported under the DropdownMenu* names ───────────────────────────\n// The implementations live in `menu-core` and are shared with ContextMenu and Menubar.\n\nexport {\n MenuItem as DropdownMenuItem,\n MenuCheckboxItem as DropdownMenuCheckboxItem,\n MenuRadioGroup as DropdownMenuRadioGroup,\n MenuRadioItem as DropdownMenuRadioItem,\n MenuGroup as DropdownMenuGroup,\n MenuLabel as DropdownMenuLabel,\n MenuSeparator as DropdownMenuSeparator,\n MenuShortcut as DropdownMenuShortcut,\n} from './menu-core';\n\nexport type {\n MenuItemProps as DropdownMenuItemProps,\n MenuItemTone as DropdownMenuItemTone,\n MenuCheckboxItemProps as DropdownMenuCheckboxItemProps,\n MenuRadioGroupProps as DropdownMenuRadioGroupProps,\n MenuRadioItemProps as DropdownMenuRadioItemProps,\n MenuGroupProps as DropdownMenuGroupProps,\n MenuLabelProps as DropdownMenuLabelProps,\n MenuSeparatorProps as DropdownMenuSeparatorProps,\n MenuShortcutProps as DropdownMenuShortcutProps,\n} from './menu-core';\n","import { createContext, useContext, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\n\nexport type CardSize = 'sm' | 'md' | 'lg';\nexport type CardRadius = 'lg' | 'xl' | '2xl';\nexport type CardTone = 'default' | 'brand' | 'positive' | 'warning' | 'danger';\nexport type CardFooterAlign = 'start' | 'between' | 'end';\n\nconst RADIUS: Record<CardRadius, string> = {\n lg: 'rounded-lg',\n xl: 'rounded-xl',\n '2xl': 'rounded-2xl',\n};\n\nconst TONE: Record<CardTone, string> = {\n default: 'border-default bg-default',\n brand: 'border-brand-tertiary bg-brand-tertiary',\n positive: 'border-positive-tertiary bg-positive-tertiary',\n warning: 'border-warning-tertiary bg-warning-tertiary',\n // The one asymmetry: danger keeps the strong `border-danger` rather than the\n // tertiary border, because it is the only tone that has to read as an alarm from\n // across a dashboard. Byte-identical to the deleted AlertCard's danger surface.\n danger: 'border-danger bg-danger-tertiary',\n};\n\n/**\n * Header and footer share one padding ladder, and it now matches `BODY_BOX` on both axes.\n *\n * It used to match horizontally and not vertically — `px-4 py-3` against the body's `p-4` —\n * so a header sat 4px tighter than the body it capped, and stacking a header on a body put\n * two different rhythms in one card. The horizontal inset was already the value that\n * mattered for aligning a title over its content; the vertical one was simply out of step.\n */\nconst BOX: Record<CardSize, string> = {\n sm: 'px-3 py-3',\n md: 'px-4 py-4',\n lg: 'px-5 py-5',\n};\n\nconst BODY_BOX: Record<CardSize, string> = {\n sm: 'gap-3 p-3',\n md: 'gap-4 p-4',\n lg: 'gap-5 p-5',\n};\n\nconst TITLE_SIZE: Record<CardSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n};\n\n/**\n * One step below the title at every size.\n *\n * `CardDescription` was frozen at `text-body-tiny` while `CardTitle` scaled, so `size=\"lg\"`\n * put an 11px description under a 16px title and `size=\"sm\"` put 11px under 13px — the ratio\n * broke at both ends of the ladder. The size comes from the enclosing `CardHeader` through\n * context rather than a prop, because a description that has to be told its own size at every\n * call site is a size that will drift.\n */\nconst DESCRIPTION_SIZE: Record<CardSize, string> = {\n sm: 'text-body-tiny',\n md: 'text-body-tiny',\n lg: 'text-body-xs',\n};\n\nconst FOOTER_ALIGN: Record<CardFooterAlign, string> = {\n start: 'justify-start',\n between: 'justify-between',\n end: 'justify-end',\n};\n\n/**\n * Set by `CardHeader` so `CardDescription` tracks its sibling title's size.\n *\n * Deliberately only carries the size, and only from the header: the body has its own\n * ladder and nothing inside it reads this.\n */\nconst CardHeaderContext = createContext<CardSize>('md');\n\n// ── Card ───────────────────────────────────────────────────────────────────────\n\nexport interface CardProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** `2xl` suits detail pages, `xl` section panels, `lg` dense or nested cards. */\n radius?: CardRadius;\n /**\n * Surface tint. This is a prop rather than a `className` because a tone has to\n * un-set the base `border-default bg-default` pair, not add to it.\n */\n tone?: CardTone;\n}\n\n/**\n * The card shell. Composed from `CardHeader`, `CardBody` and `CardFooter` — or from\n * nothing at all, if you want content to bleed to the edges (drop `CardBody` and put\n * a `DataTable` straight inside).\n *\n * Replaces `SectionCard` and the two monolithic cards that shipped beside it,\n * `AlertCard` and `BenchmarkCard`. Both of those are now documented compositions; see\n * the Cards page. The vocabulary follows shadcn/ui so it is already familiar, with\n * `CardBody` in place of its `CardContent`.\n */\nexport function Card({ children, radius = '2xl', tone = 'default', className, ...rest }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n // `overflow-hidden` is load-bearing: it clips a header's border-b to the\n // rounded corner. Removing it leaves the rule poking past the radius.\n className={cn('flex flex-col overflow-hidden border', RADIUS[radius], TONE[tone], className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n// ── CardHeader ─────────────────────────────────────────────────────────────────\n\nexport interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n /** Bottom rule separating the header from the body. */\n divider?: boolean;\n}\n\n/**\n * Header row. Holds `CardTitle`, `CardDescription` and an optional `CardAction`.\n *\n * The `has-[…]` selector switches to a two-column grid only when a `CardAction` is\n * present, which is what lets title, description and action share a header with no\n * wrapper div and no stray gap when the action is absent.\n */\nexport function CardHeader({\n children,\n size = 'md',\n divider = true,\n className,\n ...rest\n}: CardHeaderProps) {\n return (\n <CardHeaderContext.Provider value={size}>\n <div\n data-slot=\"card-header\"\n className={cn(\n 'grid auto-rows-min items-center gap-x-3 gap-y-0.5',\n 'has-[[data-slot=card-action]]:grid-cols-[1fr_auto]',\n BOX[size],\n divider && 'border-b border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </CardHeaderContext.Provider>\n );\n}\n\n// ── CardTitle / CardDescription / CardAction ───────────────────────────────────\n\nexport interface CardTitleProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n size?: CardSize;\n /** Heading level. Defaults to `p`; use h2/h3 where the page has a real hierarchy. */\n as?: 'h2' | 'h3' | 'h4' | 'p';\n}\n\nexport function CardTitle({ children, size = 'md', as: Tag = 'p', className, ...rest }: CardTitleProps) {\n return (\n <Tag\n data-slot=\"card-title\"\n // min-w-0 belongs here, not on the parent: a grid item defaults to\n // min-width:auto, so `truncate` on a title would not work without it.\n className={cn('min-w-0 font-semibold text-default', TITLE_SIZE[size], className)}\n {...rest}\n >\n {children}\n </Tag>\n );\n}\n\nexport interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {\n children: ReactNode;\n /** Overrides the size inherited from the enclosing `CardHeader`. */\n size?: CardSize;\n}\n\nexport function CardDescription({ children, size, className, ...rest }: CardDescriptionProps) {\n const inherited = useContext(CardHeaderContext);\n\n return (\n <p\n data-slot=\"card-description\"\n className={cn(\n 'min-w-0 text-default-secondary',\n DESCRIPTION_SIZE[size ?? inherited],\n className,\n )}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\nexport interface CardActionProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n/** Right-hand slot in a `CardHeader` — a button, a count, a status badge, a menu. */\nexport function CardAction({ children, className, ...rest }: CardActionProps) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 shrink-0 self-center justify-self-end', className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\n// ── CardBody ───────────────────────────────────────────────────────────────────\n\nexport interface CardBodyProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n}\n\n/**\n * The content region. A vertical stack by default.\n *\n * Because this file uses `cn`, `className` genuinely overrides the base — so\n * `className=\"flex-row items-center\"` gives you a row, and\n * `className=\"grid grid-cols-3\"` a grid. That is what makes the `AlertCard` and\n * `BenchmarkCard` rebuilds possible without a `layout` prop.\n */\nexport function CardBody({ children, size = 'md', className, ...rest }: CardBodyProps) {\n return (\n <div data-slot=\"card-body\" className={cn('flex flex-col', BODY_BOX[size], className)} {...rest}>\n {children}\n </div>\n );\n}\n\n// ── CardFooter ─────────────────────────────────────────────────────────────────\n\nexport interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n size?: CardSize;\n divider?: boolean;\n align?: CardFooterAlign;\n}\n\n/** Action row at the foot of a card. Mirrors `ModalFooter` and `Drawer`'s footer. */\nexport function CardFooter({\n children,\n size = 'md',\n divider = true,\n align = 'end',\n className,\n ...rest\n}: CardFooterProps) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\n 'flex items-center gap-2',\n BOX[size],\n FOOTER_ALIGN[align],\n divider && 'border-t border-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useId,\n useMemo,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuChevronDown } from 'react-icons/lu';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\n\nexport type AccordionType = 'single' | 'multiple';\n\ninterface AccordionContextValue {\n isOpen: (value: string) => boolean;\n toggle: (value: string) => void;\n baseId: string;\n claimIndex: () => number;\n roving: ReturnType<typeof useRovingFocus>;\n headingLevel: 2 | 3 | 4;\n}\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\nconst AccordionItemContext = createContext<{ value: string; disabled: boolean } | null>(null);\n\nfunction useAccordion(part: string): AccordionContextValue {\n const context = useContext(AccordionContext);\n if (!context) throw new Error(`<${part}> must be used inside <Accordion>`);\n return context;\n}\n\nexport interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n children: ReactNode;\n /** `single` closes the open item when another opens. Default `single`. */\n type?: AccordionType;\n /** Open item value(s) — a string for `single`, an array for `multiple`. */\n value?: string | string[];\n defaultValue?: string | string[];\n onValueChange?: (value: string | string[]) => void;\n /** Allow closing the open item in `single` mode. Default `true`. */\n collapsible?: boolean;\n /**\n * Heading level for each item's trigger. Default `3`.\n *\n * Each trigger is wrapped in a real heading, per the APG, so the accordion appears in\n * the document outline and a screen reader can jump between sections by heading. The\n * right level depends on what surrounds it, which only the caller knows.\n */\n headingLevel?: 2 | 3 | 4;\n}\n\n/**\n * Accordion. Matches Figma's `Accordion` / `Accordion Item` (`State: Closed | Open`).\n *\n * Width is deliberately not set — Figma's own note on `Accordion Item` says the 640px in\n * the component set is a container artefact and the parent should own width, so this is\n * `w-full` and nothing more.\n */\nexport function Accordion({\n children,\n type = 'single',\n value: valueProp,\n defaultValue,\n onValueChange,\n collapsible = true,\n headingLevel = 3,\n className,\n ...rest\n}: AccordionProps) {\n const baseId = useId();\n const cursor = useRef(0);\n\n const [value, setValue] = useControllableState<string | string[]>({\n value: valueProp,\n defaultValue: defaultValue ?? (type === 'multiple' ? [] : ''),\n onChange: onValueChange,\n });\n\n const isOpen = useCallback(\n (itemValue: string) =>\n Array.isArray(value) ? value.includes(itemValue) : value === itemValue,\n [value],\n );\n\n const toggle = useCallback(\n (itemValue: string) => {\n if (type === 'multiple') {\n const list = Array.isArray(value) ? value : [];\n setValue(list.includes(itemValue) ? list.filter((v) => v !== itemValue) : [...list, itemValue]);\n return;\n }\n const open = value === itemValue;\n // Without `collapsible`, clicking the open item is a no-op rather than closing it —\n // which is what you want when the accordion must always show something.\n setValue(open ? (collapsible ? '' : itemValue) : itemValue);\n },\n [type, value, setValue, collapsible],\n );\n\n const roving = useRovingFocus({ orientation: 'vertical', loop: true });\n\n cursor.current = 0;\n const claimIndex = useCallback(() => cursor.current++, []);\n\n const context = useMemo<AccordionContextValue>(\n () => ({ isOpen, toggle, baseId, claimIndex, roving, headingLevel }),\n [isOpen, toggle, baseId, claimIndex, roving, headingLevel],\n );\n\n return (\n <AccordionContext.Provider value={context}>\n <div\n data-slot=\"accordion\"\n className={clsx('w-full', className)}\n {...roving.containerProps}\n {...rest}\n >\n {children}\n </div>\n </AccordionContext.Provider>\n );\n}\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n value: string;\n disabled?: boolean;\n}\n\nexport function AccordionItem({\n children,\n value,\n disabled = false,\n className,\n ...rest\n}: AccordionItemProps) {\n const ctx = useAccordion('AccordionItem');\n const itemContext = useMemo(() => ({ value, disabled }), [value, disabled]);\n\n return (\n <AccordionItemContext.Provider value={itemContext}>\n <div\n data-slot=\"accordion-item\"\n data-state={ctx.isOpen(value) ? 'open' : 'closed'}\n className={clsx('border-b border-default last:border-b-0', className)}\n {...rest}\n >\n {children}\n </div>\n </AccordionItemContext.Provider>\n );\n}\n\nexport interface AccordionTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n /** Hide the chevron — for a trigger that supplies its own affordance. */\n hideIndicator?: boolean;\n}\n\nexport function AccordionTrigger({\n children,\n hideIndicator = false,\n className,\n ...rest\n}: AccordionTriggerProps) {\n const ctx = useAccordion('AccordionTrigger');\n const item = useContext(AccordionItemContext);\n if (!item) throw new Error('<AccordionTrigger> must be used inside <AccordionItem>');\n\n const index = ctx.claimIndex();\n const itemProps = ctx.roving.itemProps(index, {\n disabled: item.disabled,\n label: typeof children === 'string' ? children : undefined,\n });\n\n const open = ctx.isOpen(item.value);\n const Heading = `h${ctx.headingLevel}` as 'h3';\n\n return (\n // The heading carries no styling of its own — it exists so the accordion shows up in\n // the document outline, which is how screen reader users navigate between sections.\n <Heading className=\"m-0\">\n <button\n type=\"button\"\n id={`${ctx.baseId}-trigger-${item.value}`}\n aria-expanded={open}\n aria-controls={`${ctx.baseId}-content-${item.value}`}\n disabled={item.disabled}\n {...itemProps}\n tabIndex={itemProps.tabIndex}\n onClick={() => !item.disabled && ctx.toggle(item.value)}\n className={clsx(\n 'flex w-full items-center justify-between gap-3 py-4 text-left',\n 'text-body-sm font-semibold text-default transition-colors',\n 'hover:text-brand',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n className,\n )}\n {...rest}\n >\n <span className=\"min-w-0 flex-1\">{children}</span>\n {!hideIndicator && (\n <LuChevronDown\n aria-hidden\n className={clsx(\n 'size-4 shrink-0 text-icon-default-secondary transition-transform',\n open && 'rotate-180',\n )}\n />\n )}\n </button>\n </Heading>\n );\n}\n\nexport interface AccordionContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function AccordionContent({ children, className, ...rest }: AccordionContentProps) {\n const ctx = useAccordion('AccordionContent');\n const item = useContext(AccordionItemContext);\n if (!item) throw new Error('<AccordionContent> must be used inside <AccordionItem>');\n\n // Unmounted rather than height-collapsed: a `height: 0` panel keeps its content\n // focusable and announceable, so keyboard users tab into a closed section.\n if (!ctx.isOpen(item.value)) return null;\n\n return (\n <div\n id={`${ctx.baseId}-content-${item.value}`}\n role=\"region\"\n aria-labelledby={`${ctx.baseId}-trigger-${item.value}`}\n data-slot=\"accordion-content\"\n className={clsx('pb-4 text-body-sm text-default-secondary', className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import {\n createContext,\n useContext,\n useId,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { Slot } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\ninterface CollapsibleContextValue {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerId: string;\n contentId: string;\n disabled: boolean;\n}\n\nconst CollapsibleContext = createContext<CollapsibleContextValue | null>(null);\n\nfunction useCollapsible(part: string): CollapsibleContextValue {\n const context = useContext(CollapsibleContext);\n if (!context) throw new Error(`<${part}> must be used inside <Collapsible>`);\n return context;\n}\n\nexport interface CollapsibleProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n}\n\n/**\n * A show/hide region with a trigger. The single-item primitive behind `Accordion`.\n *\n * The whole point is the wiring, which is easy to get wrong by hand: the trigger needs\n * `aria-expanded` and `aria-controls`, the panel needs an id and a matching\n * `aria-labelledby`, and the panel must be genuinely removed from the accessibility tree\n * when closed — `height: 0` with `overflow: hidden` leaves its content focusable and\n * announceable, so a keyboard user tabs into a collapsed section.\n */\nexport function Collapsible({\n children,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n disabled = false,\n className,\n ...rest\n}: CollapsibleProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n\n const baseId = useId();\n\n return (\n <CollapsibleContext.Provider\n value={{\n open,\n setOpen,\n triggerId: `${baseId}-trigger`,\n contentId: `${baseId}-content`,\n disabled,\n }}\n >\n <div data-slot=\"collapsible\" data-state={open ? 'open' : 'closed'} className={className} {...rest}>\n {children}\n </div>\n </CollapsibleContext.Provider>\n );\n}\n\nexport interface CollapsibleTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n children?: ReactNode;\n asChild?: boolean;\n}\n\nexport function CollapsibleTrigger({\n children,\n asChild = false,\n className,\n ...rest\n}: CollapsibleTriggerProps) {\n const ctx = useCollapsible('CollapsibleTrigger');\n\n const triggerProps = {\n id: ctx.triggerId,\n 'aria-expanded': ctx.open,\n 'aria-controls': ctx.contentId,\n 'data-state': ctx.open ? 'open' : 'closed',\n onClick: () => !ctx.disabled && ctx.setOpen(!ctx.open),\n className,\n ...rest,\n };\n\n if (asChild) {\n return (\n <Slot aria-disabled={ctx.disabled || undefined} {...triggerProps}>\n {children}\n </Slot>\n );\n }\n\n return (\n <button type=\"button\" disabled={ctx.disabled} {...triggerProps}>\n {children}\n </button>\n );\n}\n\nexport interface CollapsibleContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /**\n * Keep the content mounted while closed, hidden with `hidden`. Default `false`.\n *\n * `hidden` — not `height: 0` — is what keeps hidden content out of the tab sequence and\n * the accessibility tree, so this stays safe. Use it to preserve form state or scroll\n * position across collapses.\n */\n keepMounted?: boolean;\n}\n\nexport function CollapsibleContent({\n children,\n keepMounted = false,\n className,\n ...rest\n}: CollapsibleContentProps) {\n const ctx = useCollapsible('CollapsibleContent');\n\n if (!ctx.open && !keepMounted) return null;\n\n return (\n <div\n id={ctx.contentId}\n role=\"region\"\n aria-labelledby={ctx.triggerId}\n hidden={!ctx.open}\n data-state={ctx.open ? 'open' : 'closed'}\n className={className}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport interface AspectRatioProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Width ÷ height. `16 / 9` for video, `1` for a square, `4 / 3` for a photo. Default `1`. */\n ratio?: number;\n}\n\n/**\n * Holds a fixed width-to-height ratio for its content.\n *\n * Uses the CSS `aspect-ratio` property rather than the old padding-top percentage hack, so\n * the child is a normal in-flow element instead of being absolutely positioned inside a\n * zero-height box. The ratio is an inline style because it is a per-instance numeric value —\n * a Tailwind class cannot express `16 / 9` without an arbitrary-value escape at every call\n * site.\n */\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { children, ratio = 1, className, style, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"aspect-ratio\"\n style={{ aspectRatio: ratio, ...style }}\n className={clsx('w-full overflow-hidden [&>*]:size-full [&>img]:object-cover', className)}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\nimport { IconButton } from '../forms/icon-button';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\ninterface CarouselContextValue {\n index: number;\n setIndex: (index: number) => void;\n count: number;\n registerSlide: () => number;\n resetSlides: () => void;\n baseId: string;\n loop: boolean;\n paused: boolean;\n setPaused: (paused: boolean) => void;\n hasAutoplay: boolean;\n}\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel(part: string): CarouselContextValue {\n const value = useContext(CarouselContext);\n if (!value) throw new Error(`<${part}> must be used inside <Carousel>`);\n return value;\n}\n\nexport interface CarouselProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Names the carousel region. Required — a nameless region is not navigable. */\n label: string;\n index?: number;\n defaultIndex?: number;\n onIndexChange?: (index: number) => void;\n /** Number of slides. Needed up front for the controls; `CarouselSlide` count is checked against it. */\n count: number;\n loop?: boolean;\n /** Advance every N ms. Omit for a manual carousel. */\n autoplayInterval?: number;\n}\n\n/**\n * A slide carousel.\n *\n * Carousels are one of the most reliably inaccessible patterns on the web, so the parts that\n * look like polish here are the requirements:\n *\n * - **`aria-roledescription=\"carousel\"`** on a named region, so it is announced as a carousel\n * rather than as an anonymous group of divs.\n * - **Slides are `role=\"group\"` with `aria-roledescription=\"slide\"` and an\n * \"N of M\" label** — position is otherwise invisible to anyone not seeing the dots.\n * - **Off-screen slides are `hidden`**, not merely translated out of view. A slide moved with\n * `transform` keeps its links in the tab order, so keyboard users tab into content they\n * cannot see. This is the single most common carousel bug.\n * - **Autoplay stops on hover, on focus, and permanently once the user takes control**, and\n * there is a visible pause button whenever autoplay is on — required by WCAG 2.2.2 for any\n * motion lasting more than five seconds.\n * - **`prefers-reduced-motion` disables autoplay entirely**, rather than just shortening the\n * transition.\n */\nexport function Carousel({\n children,\n label,\n index: indexProp,\n defaultIndex = 0,\n onIndexChange,\n count,\n loop = false,\n autoplayInterval,\n className,\n ...rest\n}: CarouselProps) {\n const [index, setIndex] = useControllableState({\n value: indexProp,\n defaultValue: defaultIndex,\n onChange: onIndexChange,\n });\n\n const baseId = useId();\n const cursor = useRef(0);\n const [paused, setPaused] = useState(false);\n const [userTookControl, setUserTookControl] = useState(false);\n\n const hasAutoplay = autoplayInterval !== undefined && autoplayInterval > 0;\n\n const context = useMemo<CarouselContextValue>(\n () => ({\n index,\n setIndex: (next) => {\n // Any deliberate move stops autoplay for good. Resuming after a user has navigated\n // yanks the content out from under them.\n setUserTookControl(true);\n setIndex(next);\n },\n count,\n registerSlide: () => cursor.current++,\n resetSlides: () => {\n cursor.current = 0;\n },\n baseId,\n loop,\n paused,\n setPaused,\n hasAutoplay,\n }),\n [index, setIndex, count, baseId, loop, paused, hasAutoplay],\n );\n\n context.resetSlides();\n\n useEffect(() => {\n if (!hasAutoplay || paused || userTookControl) return;\n // Autoplay is motion the user did not ask for, so it does not start at all when they\n // have asked for less of it.\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return;\n\n const timer = setInterval(() => {\n setIndex(index === count - 1 ? (loop ? 0 : index) : index + 1);\n }, autoplayInterval);\n return () => clearInterval(timer);\n }, [hasAutoplay, paused, userTookControl, autoplayInterval, index, count, loop, setIndex]);\n\n return (\n <CarouselContext.Provider value={context}>\n {/* The APG carousel pattern puts Left/Right on the region itself, so slides can be\n paged from anywhere inside without first tabbing to the controls. The region is not\n focusable and does not need to be — the keys arrive by bubbling from whatever inside\n it has focus. */}\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}\n <div\n // `region` + roledescription is what makes this announce as a carousel.\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label={label}\n data-slot=\"carousel\"\n className={clsx('relative', className)}\n onPointerEnter={() => hasAutoplay && setPaused(true)}\n onPointerLeave={() => hasAutoplay && setPaused(false)}\n onFocus={() => hasAutoplay && setPaused(true)}\n onBlur={(event) => {\n if (hasAutoplay && !event.currentTarget.contains(event.relatedTarget as Node)) {\n setPaused(false);\n }\n }}\n onKeyDown={(event) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n context.setIndex(index === 0 ? (loop ? count - 1 : 0) : index - 1);\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n context.setIndex(index === count - 1 ? (loop ? 0 : index) : index + 1);\n }\n }}\n {...rest}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nexport interface CarouselViewportProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function CarouselViewport({ children, className, ...rest }: CarouselViewportProps) {\n const carousel = useCarousel('CarouselViewport');\n return (\n <div\n id={`${carousel.baseId}-viewport`}\n data-slot=\"carousel-viewport\"\n className={clsx('overflow-hidden', className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nexport interface CarouselSlideProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\nexport function CarouselSlide({ children, className, ...rest }: CarouselSlideProps) {\n const carousel = useCarousel('CarouselSlide');\n const slideIndex = carousel.registerSlide();\n const active = slideIndex === carousel.index;\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n // Position stated explicitly — without it, only the dots convey where you are.\n aria-label={`${slideIndex + 1} of ${carousel.count}`}\n // `hidden`, not a transform. An off-screen slide that is merely translated keeps its\n // links focusable, so Tab walks into invisible content.\n hidden={!active}\n data-slot=\"carousel-slide\"\n className={className}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nexport interface CarouselControlsProps extends HTMLAttributes<HTMLDivElement> {\n /** Show the dot indicators. Default `true`. */\n showDots?: boolean;\n}\n\nexport function CarouselControls({ showDots = true, className, ...rest }: CarouselControlsProps) {\n const carousel = useCarousel('CarouselControls');\n const { index, count, loop } = carousel;\n\n const go = useCallback(\n (next: number) => {\n const wrapped = ((next % count) + count) % count;\n carousel.setIndex(loop ? wrapped : Math.min(Math.max(next, 0), count - 1));\n },\n [carousel, count, loop],\n );\n\n return (\n <div\n className={clsx('mt-3 flex items-center justify-between gap-3', className)}\n {...rest}\n >\n <IconButton\n variant=\"neutral\"\n size=\"sm\"\n aria-label=\"Previous slide\"\n aria-controls={`${carousel.baseId}-viewport`}\n disabled={!loop && index === 0}\n onClick={() => go(index - 1)}\n >\n <LuChevronLeft aria-hidden size={16} />\n </IconButton>\n\n {showDots && (\n <div role=\"group\" aria-label={`Slide ${index + 1} of ${count}`} className=\"flex items-center gap-2\">\n {Array.from({ length: count }, (_, i) => (\n <button\n key={i}\n type=\"button\"\n aria-label={`Go to slide ${i + 1}`}\n aria-current={i === index ? 'true' : undefined}\n onClick={() => go(i)}\n className={clsx(\n 'size-2 rounded-full transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 focus-visible:ring-offset-default',\n i === index ? 'bg-brand' : 'bg-default-tertiary hover:bg-neutral-secondary',\n )}\n />\n ))}\n </div>\n )}\n\n <div className=\"flex items-center gap-1.5\">\n {/* Required by WCAG 2.2.2 whenever autoplay is on: any motion lasting more than five\n seconds needs a visible, keyboard-reachable way to stop it. */}\n {carousel.hasAutoplay && (\n <IconButton\n variant=\"neutral\"\n size=\"sm\"\n aria-label={carousel.paused ? 'Start automatic slide show' : 'Stop automatic slide show'}\n onClick={() => carousel.setPaused(!carousel.paused)}\n >\n <span aria-hidden className=\"text-body-tiny font-semibold\">\n {carousel.paused ? '▶' : '❚❚'}\n </span>\n </IconButton>\n )}\n <IconButton\n variant=\"neutral\"\n size=\"sm\"\n aria-label=\"Next slide\"\n aria-controls={`${carousel.baseId}-viewport`}\n disabled={!loop && index === count - 1}\n onClick={() => go(index + 1)}\n >\n <LuChevronRight aria-hidden size={16} />\n </IconButton>\n </div>\n </div>\n );\n}\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { ScrollArea } from './scroll-area';\nimport clsx from 'clsx';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\nexport type ResizableDirection = 'horizontal' | 'vertical';\n\ninterface ResizableContextValue {\n direction: ResizableDirection;\n /** First pane's size, as a percentage of the container. */\n size: number;\n setSize: (size: number) => void;\n min: number;\n max: number;\n containerRef: React.RefObject<HTMLDivElement | null>;\n baseId: string;\n dragging: boolean;\n setDragging: (dragging: boolean) => void;\n}\n\nconst ResizableContext = createContext<ResizableContextValue | null>(null);\n\nfunction useResizable(part: string): ResizableContextValue {\n const value = useContext(ResizableContext);\n if (!value) throw new Error(`<${part}> must be used inside <Resizable>`);\n return value;\n}\n\nexport interface ResizableProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n direction?: ResizableDirection;\n /** First pane's size as a percentage. Controlled. */\n size?: number;\n defaultSize?: number;\n onSizeChange?: (size: number) => void;\n /** Percentage bounds. Defaults `10` and `90`. */\n min?: number;\n max?: number;\n}\n\n/**\n * Two resizable panes with a draggable divider.\n *\n * This is the APG **window splitter** pattern, and the handle is the whole component as far\n * as accessibility goes. A `<div>` with pointer listeners — the usual implementation — is\n * completely unusable without a mouse. `ResizableHandle` is therefore a real focusable\n * control with:\n *\n * - `role=\"separator\"` plus `aria-valuenow`/`valuemin`/`valuemax`, so the current split is\n * announced as a percentage rather than being invisible;\n * - `tabIndex={0}` and arrow keys to move it in 1% steps, Shift+arrow in 10%, Home/End to\n * the bounds, and Enter to collapse and restore;\n * - `aria-controls` pointing at the pane it resizes.\n *\n * Sizes are percentages, not pixels, so the split survives a container resize — a pixel\n * split silently becomes wrong the moment the window changes.\n */\nexport function Resizable({\n children,\n direction = 'horizontal',\n size: sizeProp,\n defaultSize = 50,\n onSizeChange,\n min = 10,\n max = 90,\n className,\n ...rest\n}: ResizableProps) {\n const [size, setSize] = useControllableState({\n value: sizeProp,\n defaultValue: defaultSize,\n onChange: onSizeChange,\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n const baseId = useId();\n const [dragging, setDragging] = useState(false);\n\n const context = useMemo<ResizableContextValue>(\n () => ({\n direction,\n size,\n setSize: (next) => setSize(Math.min(Math.max(next, min), max)),\n min,\n max,\n containerRef,\n baseId,\n dragging,\n setDragging,\n }),\n [direction, size, setSize, min, max, baseId, dragging],\n );\n\n return (\n <ResizableContext.Provider value={context}>\n <div\n ref={containerRef}\n data-slot=\"resizable\"\n className={clsx(\n 'flex w-full',\n direction === 'horizontal' ? 'flex-row' : 'flex-col',\n // While dragging, suppress selection and pointer events inside the panes so the\n // gesture cannot start selecting text or hovering things it passes over.\n dragging && 'select-none [&_*]:pointer-events-none',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </ResizableContext.Provider>\n );\n}\n\nexport interface ResizablePanelProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** `first` is the pane the handle sizes; `second` fills the remainder. */\n which: 'first' | 'second';\n}\n\nexport function ResizablePanel({ children, which, className, ...rest }: ResizablePanelProps) {\n const ctx = useResizable('ResizablePanel');\n const axis = ctx.direction === 'horizontal' ? 'width' : 'height';\n\n return (\n // A panel holds arbitrary content, which may be entirely static — so it needs the tab\n // stop `ScrollArea` adds while overflowing, not just the scrollbar styling.\n <ScrollArea\n axis=\"both\"\n id={which === 'first' ? `${ctx.baseId}-first` : `${ctx.baseId}-second`}\n data-slot=\"resizable-panel\"\n style={which === 'first' ? { [axis]: `${ctx.size}%` } : { flex: '1 1 0%' }}\n className={clsx('min-h-0 min-w-0', className)}\n {...rest}\n >\n {children}\n </ScrollArea>\n );\n}\n\nexport interface ResizableHandleProps extends HTMLAttributes<HTMLDivElement> {\n /** Names the splitter. Default `Resize panels`. */\n label?: string;\n /** Show the grip dots. Default `true`. */\n withGrip?: boolean;\n}\n\nexport function ResizableHandle({\n label = 'Resize panels',\n withGrip = true,\n className,\n ...rest\n}: ResizableHandleProps) {\n const ctx = useResizable('ResizableHandle');\n const horizontal = ctx.direction === 'horizontal';\n const collapsedFrom = useRef<number | null>(null);\n\n const fromPointer = useCallback(\n (clientX: number, clientY: number) => {\n const container = ctx.containerRef.current;\n if (!container) return;\n const rect = container.getBoundingClientRect();\n const ratio = horizontal\n ? (clientX - rect.left) / rect.width\n : (clientY - rect.top) / rect.height;\n ctx.setSize(ratio * 100);\n },\n [ctx, horizontal],\n );\n\n useEffect(() => {\n if (!ctx.dragging) return;\n\n const onMove = (event: PointerEvent) => fromPointer(event.clientX, event.clientY);\n const onUp = () => ctx.setDragging(false);\n\n // Listeners on the window, not the handle: the pointer routinely leaves the 8px handle\n // mid-drag, and a handle-scoped listener would drop the gesture.\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n window.addEventListener('pointercancel', onUp);\n return () => {\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n window.removeEventListener('pointercancel', onUp);\n };\n }, [ctx, fromPointer]);\n\n return (\n // A *focusable* separator is the APG window-splitter pattern, and the whole point of this\n // component: without the tab stop and the arrow keys below, a split view can only be\n // resized with a mouse. ARIA explicitly allows a focusable separator, which is what\n // carries `aria-valuenow`; jsx-a11y models `separator` as always non-interactive.\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex, jsx-a11y/no-noninteractive-element-interactions\n <div\n role=\"separator\"\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n aria-label={label}\n aria-orientation={horizontal ? 'vertical' : 'horizontal'}\n aria-valuenow={Math.round(ctx.size)}\n aria-valuemin={ctx.min}\n aria-valuemax={ctx.max}\n aria-controls={`${ctx.baseId}-first`}\n data-slot=\"resizable-handle\"\n onPointerDown={(event) => {\n event.preventDefault();\n ctx.setDragging(true);\n }}\n onKeyDown={(event) => {\n const step = event.shiftKey ? 10 : 1;\n const decrease = horizontal ? 'ArrowLeft' : 'ArrowUp';\n const increase = horizontal ? 'ArrowRight' : 'ArrowDown';\n\n if (event.key === decrease) {\n event.preventDefault();\n ctx.setSize(ctx.size - step);\n } else if (event.key === increase) {\n event.preventDefault();\n ctx.setSize(ctx.size + step);\n } else if (event.key === 'Home') {\n event.preventDefault();\n ctx.setSize(ctx.min);\n } else if (event.key === 'End') {\n event.preventDefault();\n ctx.setSize(ctx.max);\n } else if (event.key === 'Enter') {\n // Collapse/restore, so the splitter is useful without dragging at all.\n event.preventDefault();\n if (collapsedFrom.current === null) {\n collapsedFrom.current = ctx.size;\n ctx.setSize(ctx.min);\n } else {\n ctx.setSize(collapsedFrom.current);\n collapsedFrom.current = null;\n }\n }\n }}\n className={clsx(\n 'group relative flex shrink-0 items-center justify-center bg-divider transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand',\n 'hover:bg-brand-tertiary',\n horizontal ? 'w-px cursor-col-resize' : 'h-px cursor-row-resize',\n className,\n )}\n {...rest}\n >\n {/* An invisible padded hit area, so the 1px rule is grabbable without being 8px of\n visible chrome. */}\n <span\n aria-hidden\n className={clsx('absolute', horizontal ? 'inset-y-0 -inset-x-1.5' : '-inset-y-1.5 inset-x-0')}\n />\n {withGrip && (\n <span\n aria-hidden\n className={clsx(\n 'relative z-raised flex items-center justify-center rounded-full border border-default bg-default',\n 'opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100',\n horizontal ? 'h-6 w-2.5' : 'h-2.5 w-6',\n )}\n >\n <span className={clsx('rounded-full bg-default-tertiary', horizontal ? 'h-2.5 w-px' : 'h-px w-2.5')} />\n </span>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * Two genuinely different heading contexts, which the source markup distinguished:\n *\n * `page` 24px title / 14px subtitle — an in-body page heading (settings, users,\n * alerts), i.e. the old `text-2xl` + `mt-1 text-body-sm` block.\n * `toolbar` 20px title / 13px subtitle — inside a `PageToolbar`, where the bar is\n * only 72px tall. Flattening these into one size would have grown ten\n * toolbar titles by 4px.\n * `section` 18px — a panel or card heading.\n */\nexport type PageHeadingSize = 'page' | 'toolbar' | 'section';\n\nconst TITLE: Record<PageHeadingSize, string> = {\n // `text-2xl` was stock Tailwind rather than the design tokens. Same 24px, now on-token.\n page: 'text-heading font-semibold text-default',\n toolbar: 'text-heading-sm font-semibold leading-snug text-default',\n // Was `text-lg` — stock Tailwind's 18px, off the type scale. Snapped DOWN to 16 rather\n // than up to 20, because 20 is already `toolbar`: rounding up would have made two of the\n // three sizes identical and collapsed the ramp to page 24 / toolbar 20 / section 20.\n section: 'text-subheading-sm font-semibold text-default',\n};\n\nconst SUBTITLE: Record<PageHeadingSize, string> = {\n page: 'mt-1 text-body-sm text-default-secondary',\n toolbar: 'text-body-xs text-default-secondary',\n section: 'mt-1 text-body-sm text-default-secondary',\n};\n\nexport interface PageHeadingProps {\n title: ReactNode;\n subtitle?: ReactNode;\n size?: PageHeadingSize;\n /** Heading level. Defaults to `h1` for page/toolbar and `h2` for section. */\n as?: 'h1' | 'h2' | 'h3';\n /** Right-aligned action cluster. When set, the heading becomes a flex row. */\n actions?: ReactNode;\n /** Clamp a long title to one line — needed when the title is user data, e.g. an article headline. */\n truncateTitle?: boolean;\n className?: string;\n}\n\n/**\n * Page or section title with an optional subtitle underneath.\n *\n * Replaces nine copies of the `<h1>` + `<p className=\"mt-1 …\">` block, plus the\n * heading halves of `SettingsTabs` and `my-account/tabs`.\n *\n * Emitting a real heading element matters: `reviewer-detail`,\n * `settings-audit-log`'s table area and `widget-gallery` render their titles as\n * `<p>`/`<div>` today, so `getByRole('heading')` finds nothing there — an\n * accessibility gap the e2e specs currently work around.\n */\nexport function PageHeading({\n title,\n subtitle,\n size = 'page',\n as,\n actions,\n truncateTitle,\n className,\n}: PageHeadingProps) {\n const Tag = as ?? (size === 'section' ? 'h2' : 'h1');\n\n const heading = (\n <div className=\"flex min-w-0 flex-col gap-0.5\">\n <Tag className={clsx(TITLE[size], truncateTitle && 'truncate')}>{title}</Tag>\n {subtitle && <p className={SUBTITLE[size]}>{subtitle}</p>}\n </div>\n );\n\n if (!actions) return className ? <div className={className}>{heading}</div> : heading;\n\n return (\n <div className={clsx('flex items-start justify-between gap-4', className)}>\n {heading}\n <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type PageToolbarSize = 'sm' | 'md';\n\nexport interface PageToolbarProps {\n children: ReactNode;\n /** Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons). */\n wrap?: boolean;\n /**\n * The bar's **own** height and padding. `sm` suits a secondary bar under the main toolbar.\n *\n * Not to be confused with `FilterBar.size`, which sets the density of the controls\n * *inside* the row. Same literals, different subject: a bar sizes itself, a row of\n * controls sizes its children. `PageToolbar` passes nothing down.\n */\n size?: PageToolbarSize;\n className?: string;\n}\n\nconst SIZE: Record<PageToolbarSize, string> = {\n sm: 'min-h-[56px] px-4 py-3 md:px-7',\n md: 'min-h-[72px] px-4 py-4 md:px-7',\n};\n\n/**\n * The sticky top bar on a full-bleed detail or list screen: title block on the\n * left, actions on the right.\n *\n * Replaces ten copies of this class string. Three of those copies used the\n * responsive `px-4 py-4 md:px-7` and seven used a fixed `px-7 py-4`; the responsive\n * variant is adopted here, which is a deliberate improvement below `md` where the\n * fixed 28px padding was cramped.\n */\nexport function PageToolbar({ children, wrap, size = 'md', className }: PageToolbarProps) {\n return (\n <div\n className={clsx(\n 'flex shrink-0 items-center justify-between gap-4 border-b border-default bg-default',\n SIZE[size],\n wrap && 'flex-wrap gap-2',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { ControlSizeProvider } from '../forms/control-size';\n\nexport type FilterBarSize = 'sm' | 'md';\n\nexport interface FilterBarProps {\n children: ReactNode;\n /** Right-aligned slot for a result count or a secondary action. */\n trailing?: ReactNode;\n /**\n * Row density. Sets the gap between controls **and** the default `size` of the controls\n * inside — an Input, Select, Combobox, DatePicker or Button that is not given its own\n * `size` inherits this one. Pass `size` on a child to opt it out.\n *\n * `sm` is for a filter row inside a card or drawer: 8px gaps and 24px controls.\n */\n size?: FilterBarSize;\n className?: string;\n}\n\nconst GAP: Record<FilterBarSize, string> = {\n sm: 'gap-2',\n md: 'gap-3',\n};\n\n/**\n * Row of search inputs and filter selects above a table.\n *\n * Replaces nine copies of `flex flex-wrap items-center gap-3`.\n *\n * Through 0.4.0 `size` set only the gap, so every caller had to repeat it on each control\n * and the page documenting this component got it wrong: its `size=\"sm\"` example put a 24px\n * Input beside a 36px Select. A container with a size prop should mean it, so the size now\n * reaches the controls through `ControlSizeProvider`.\n */\nexport function FilterBar({ children, trailing, size = 'md', className }: FilterBarProps) {\n return (\n <ControlSizeProvider size={size}>\n <div className={clsx('flex flex-wrap items-center', GAP[size], className)}>\n {children}\n {/* Was a fixed `gap-2`, which disagreed with the row itself at `md`. */}\n {trailing && <div className={clsx('ml-auto flex items-center', GAP[size])}>{trailing}</div>}\n </div>\n </ControlSizeProvider>\n );\n}\n","import { useId, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\nimport { useRovingFocus } from '../../lib/use-roving-focus';\nimport { useControllableState } from '../../lib/use-controllable-state';\n\nexport type TabsVariant = 'underline' | 'pill';\nexport type TabsSize = 'sm' | 'md';\nexport type TabsOrientation = 'horizontal' | 'vertical';\n/**\n * `automatic` selects as focus moves, which is the APG default and right when panels are\n * cheap. `manual` requires Enter/Space — use it when switching tab triggers a fetch, so\n * arrowing across five tabs does not fire five requests.\n */\nexport type TabsActivation = 'automatic' | 'manual';\n\nexport interface TabItem<K extends string = string> {\n key: K;\n label: string;\n /** Renders a count chip after the label. */\n count?: number;\n disabled?: boolean;\n}\n\nexport interface TabsProps<K extends string = string> {\n items: TabItem<K>[];\n /** Controlled selection. Omit and pass `defaultValue` for uncontrolled. */\n value?: K;\n defaultValue?: K;\n onValueChange?: (key: K) => void;\n /**\n * `underline` is the detail-page form (entity detail, reviewer detail, role detail).\n * `pill` is the filter-style form used by the reviewer queue.\n */\n variant?: TabsVariant;\n /** `md` is the page-level strip; `sm` suits a tab strip inside a card or drawer. */\n size?: TabsSize;\n orientation?: TabsOrientation;\n activation?: TabsActivation;\n /**\n * Shared prefix for the generated tab and panel ids. Pass the same value to `TabsPanel`\n * to wire `aria-controls` / `aria-labelledby`. Generated when omitted.\n */\n idPrefix?: string;\n /** Names the tab strip. Required by the APG when there is more than one on a page. */\n label?: string;\n className?: string;\n}\n\n/**\n * Per-variant sizing. The two variants have genuinely different geometry — a pill has\n * a background to pad against, an underline only has a baseline — so this is a nested\n * map rather than one shared scale.\n */\nconst SIZE: Record<TabsVariant, Record<TabsSize, { strip: string; tab: string }>> = {\n underline: {\n sm: { strip: 'gap-4', tab: 'px-0.5 py-1.5 text-body-xs' },\n md: { strip: 'gap-6', tab: 'px-0.5 py-2.5 text-body-sm' },\n },\n pill: {\n sm: { strip: 'gap-1', tab: 'rounded-md px-2.5 py-1.5 text-body-tiny' },\n md: { strip: 'gap-1.5', tab: 'rounded-lg px-3.5 py-2 text-body-xs' },\n },\n};\n\nexport const tabId = (prefix: string, key: string) => `${prefix}-tab-${key}`;\nexport const tabPanelId = (prefix: string, key: string) => `${prefix}-panel-${key}`;\n\n/**\n * Tab strip.\n *\n * Reworked in 0.4.0. It previously carried `role=\"tablist\"`, `role=\"tab\"` and\n * `aria-selected` with **no `onKeyDown` at all** — no Arrow keys, no Home/End, no roving\n * tabindex, no `aria-controls`, and no `role=\"tabpanel\"` counterpart anywhere in the\n * library. That combination is worse than shipping no ARIA: a screen reader announces\n * \"tab 3 of 5\", the user presses the arrow keys it implies, and nothing happens. Every\n * tab was also individually tabbable, so Tab walked the strip instead of leaving it.\n *\n * The `underline` active colour is `background-brand` (#0C2D58), which is what Figma\n * specifies.\n */\nexport function Tabs<K extends string = string>({\n items,\n value: valueProp,\n defaultValue,\n onValueChange,\n variant = 'underline',\n size = 'md',\n orientation = 'horizontal',\n activation = 'automatic',\n idPrefix,\n label,\n className,\n}: TabsProps<K>) {\n const generatedPrefix = useId();\n const prefix = idPrefix ?? generatedPrefix;\n\n const [value, setValue] = useControllableState<K>({\n value: valueProp,\n defaultValue: defaultValue ?? items[0]?.key,\n onChange: onValueChange as ((next: K) => void) | undefined,\n });\n\n const isPill = variant === 'pill';\n const s = SIZE[variant][size];\n\n const selectedIndex = Math.max(\n 0,\n items.findIndex((item) => item.key === value),\n );\n\n const roving = useRovingFocus({\n orientation: orientation === 'vertical' ? 'vertical' : 'horizontal',\n loop: true,\n defaultIndex: selectedIndex,\n });\n\n return (\n <div\n role=\"tablist\"\n aria-label={label}\n aria-orientation={orientation}\n className={clsx(\n 'flex shrink-0',\n // The strip's own children are the tab stops, so it needs no tab stop of its own.\n orientation === 'vertical' ? 'flex-col' : clsx('overflow-x-auto', SCROLLBAR_CLASSES),\n s.strip,\n !isPill && (orientation === 'vertical' ? 'border-r border-default' : 'border-b border-default'),\n className,\n )}\n {...roving.containerProps}\n >\n {items.map((tab, index) => {\n const active = tab.key === value;\n const itemProps = roving.itemProps(index, { disabled: tab.disabled, label: tab.label });\n\n return (\n <button\n key={tab.key}\n type=\"button\"\n role=\"tab\"\n id={tabId(prefix, tab.key)}\n aria-selected={active}\n aria-controls={tabPanelId(prefix, tab.key)}\n disabled={tab.disabled}\n {...itemProps}\n // Selection, not focus, owns the tab stop: Tab must land on the *selected*\n // tab, which is not necessarily the one the arrow keys last visited.\n tabIndex={active ? 0 : -1}\n onFocus={() => {\n itemProps.onFocus();\n // Automatic activation: focus and selection move together.\n if (activation === 'automatic' && !tab.disabled) setValue(tab.key);\n }}\n onClick={() => !tab.disabled && setValue(tab.key)}\n onKeyDown={(event) => {\n if (activation === 'manual' && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n setValue(tab.key);\n }\n }}\n className={clsx(\n 'flex shrink-0 items-center gap-1.5 whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n s.tab,\n isPill\n ? clsx(\n 'font-medium',\n active\n ? 'bg-brand text-brand-on-brand'\n : 'text-default-secondary hover:bg-default-secondary',\n )\n : clsx(\n 'leading-snug',\n active\n ? 'border-b-2 border-brand-emphasis font-semibold text-brand-emphasis'\n : 'font-normal text-default-secondary hover:text-default',\n ),\n )}\n >\n {tab.label}\n {tab.count !== undefined && (\n <span\n className={clsx(\n 'rounded-md px-1.5 py-px text-body-tiny font-medium leading-snug',\n active && isPill\n ? 'bg-brand-hover text-brand-on-brand'\n : 'bg-default-secondary text-default-secondary',\n )}\n >\n {tab.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n\nexport interface TabsPanelProps extends HTMLAttributes<HTMLDivElement> {\n /** The `key` of the tab this panel belongs to. */\n tabKey: string;\n /** Must match the `idPrefix` given to `Tabs`. */\n idPrefix: string;\n /** Whether this panel's tab is the selected one. */\n active: boolean;\n children: ReactNode;\n /**\n * Keep the panel mounted while hidden. Default `false`. Mounting all panels preserves\n * scroll position and form state across tab switches at the cost of rendering them all.\n */\n keepMounted?: boolean;\n}\n\n/**\n * The `role=\"tabpanel\"` half of the pattern, which the library had no equivalent of —\n * so `aria-controls` on a tab pointed at nothing and there was no labelled region for a\n * screen reader to move into.\n *\n * `tabIndex={0}` is deliberate and required: when a panel contains no focusable element,\n * it must be reachable itself, otherwise Tab from the selected tab skips the content\n * entirely.\n */\nexport function TabsPanel({\n tabKey,\n idPrefix,\n active,\n children,\n keepMounted = false,\n className,\n ...rest\n}: TabsPanelProps) {\n if (!active && !keepMounted) return null;\n\n return (\n <div\n role=\"tabpanel\"\n id={tabPanelId(idPrefix, tabKey)}\n aria-labelledby={tabId(idPrefix, tabKey)}\n hidden={!active}\n tabIndex={0}\n className={clsx('focus-visible:outline-none', className)}\n {...rest}\n >\n {children}\n </div>\n );\n}\n","import { type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Slot } from '../../lib/slot';\n\nexport type NavItemSize = 'sm' | 'md';\nexport type NavItemVariant = 'card' | 'plain';\n\nexport interface NavItemProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {\n /**\n * Leading glyph. Optional, but when `collapsed` it is the only thing left to look at, so\n * a row without one falls back to a monogram taken from the label.\n */\n icon?: ReactNode;\n label: string;\n /**\n * The row you are on — the current route. Paints the brand fill and, under `asChild`, sets\n * `aria-current=\"page\"`; it also reflects to `data-state=\"active\"`.\n *\n * Not the same thing as focus, though Figma's `MenuButton` names this variant\n * `state=focussed`. That is a misnomer to fix on the design side: keyboard focus is the\n * ring below, it is transient and can land on any row, and if it painted the brand fill\n * too there would be no way to see which row is the current one while tabbing past it.\n */\n isActive?: boolean;\n /** Red indicator dot at top-right corner (e.g. unread count) */\n indicator?: boolean;\n /** Collapsed mode — label is visually hidden but stays in the accessibility tree. */\n collapsed?: boolean;\n /** Row height. `sm` suits a dense secondary nav or a nested group. */\n size?: NavItemSize;\n /**\n * Row weight.\n *\n * `card` gives every inactive row its own border and surface — right for a short primary\n * rail of eight or ten destinations, where each row is a target in its own right.\n * `plain` drops both, so an inactive row is just text: right for a long grouped nav,\n * where thirty bordered pills read as thirty cards rather than a list.\n *\n * A variant decides what a row looks like **at rest, and nothing else**. Hover and the\n * current-row fill are one vocabulary shared by both — see `STATE`. Through 0.5.0 each\n * variant defined its own, and `plain`'s was invisible against the rail it was written for.\n */\n variant?: NavItemVariant;\n /**\n * Render the single child element as the row, so the row itself is the link or button.\n *\n * `NavItem` is presentational by default — a `<span>` with hover styling. That is fine\n * inside a router `NavLink`, which is how `src/sidebar/` uses it, but on its own it is a\n * nav row that looks interactive and cannot be focused or activated. `asChild` is the\n * fix for anyone using it outside that wrapper:\n *\n * <NavItem asChild icon={<LuHouse />} label=\"Home\">\n * <NavLink to=\"/\" />\n * </NavItem>\n */\n asChild?: boolean;\n children?: ReactNode;\n className?: string;\n}\n\n/**\n * `md` is Figma's `MenuButton` in every dimension: 44px tall, 12px radius, 12px gap, 14px\n * padding-x. `square` is the collapsed footprint — the design does not stretch a collapsed row\n * to the rail width, it centres a 44×44 button, which is exactly `px-3.5` either side of a\n * 16px icon.\n *\n * The label is the one deliberate departure. Figma specifies Body Base (16px); this is\n * `text-body-sm` (14px), because 16px rows read as oversized against everything else in a\n * product shell. The design file is the authority on the box and the colours, not on this.\n *\n * `sm` has no counterpart in the design file; it is a code-only density for long navs.\n */\nconst SIZE: Record<NavItemSize, { box: string; label: string; square: string }> = {\n sm: { box: 'h-9 gap-2 rounded-lg px-3 py-1.5', label: 'text-body-xs', square: 'w-9' },\n md: { box: 'h-11 gap-3 rounded-xl px-3.5 py-2.5', label: 'text-body-sm', square: 'w-11' },\n};\n\n/**\n * Up to two characters standing in for a missing icon in the collapsed rail.\n *\n * Two rather than one because any nav long enough to be worth collapsing collides on first\n * letters — the docs' own sidebar has Button beside Badges and Input beside Icons. Multiple\n * words give one initial each (\"Color Tokens\" → \"CT\"); a single word gives its first two\n * (\"Button\" → \"Bu\"), which stays readable rather than shouting. Words that open with\n * punctuation are skipped, so \"Cards & Containers\" is \"CC\" and not \"C&\".\n */\nfunction monogram(label: string): string {\n const words = label.split(/\\s+/).filter((word) => /^[\\p{L}\\p{N}]/u.test(word));\n const [first, second] = words;\n // A label of nothing but symbols has no initials to take; show its first character.\n if (!first) return Array.from(label.trim())[0]?.toUpperCase() ?? '';\n if (second) return (Array.from(first)[0] + Array.from(second)[0]).toUpperCase();\n const [a, b] = Array.from(first);\n return a.toUpperCase() + (b ?? '').toLowerCase();\n}\n\n/**\n * What a row looks like when you are on it, and when you hover one you are not — shared by\n * both variants and declared nowhere else. Selection means one thing in this library.\n *\n * Through 0.5.0 each variant carried its own pair, and `plain`'s hover was\n * `hover:bg-default-hover` — a generic app-surface token resolving to `--prim-gray-100`,\n * which is the same #F5F5F5 as the `bg-default-secondary` rail a sidebar row sits on. Plain\n * rows therefore had **no visible hover at all** in light mode, and `plain`'s active\n * `bg-brand-tertiary` (#F1F7FD) was a 1.02:1 step against that same rail. The bug survived\n * because the docs demo every variant on `bg-default` — white — where the collision does\n * not occur.\n */\nconst STATE = {\n // Figma MenuButton `state=hover`. No border change: Figma holds it at #D9D9D9 through\n // hover and moves only the fill and the text.\n hover: 'hover:bg-brand-tertiary-hover hover:text-brand',\n // Figma MenuButton `state=focussed`, which is that file's name for selected — see the\n // `isActive` doc comment. Hovering the current row darkens it rather than reverting it to\n // the pale hover tint, which would read as the row losing its selection under the cursor.\n active: 'bg-brand text-brand-on-brand hover:bg-brand-hover',\n} as const;\n\n/** The resting appearance — the whole of the difference between the two variants. */\nconst VARIANT: Record<NavItemVariant, { active: string; inactive: string }> = {\n card: {\n // `border-transparent` holds the 1px so the icon and label do not shift outward when a\n // row becomes the current one — the same trick, for the same reason, as `button.tsx`.\n // `bg-brand` still paints edge to edge, since backgrounds clip to the border box.\n active: clsx('border border-transparent', STATE.active),\n inactive: clsx('border border-default bg-default text-default-secondary', STATE.hover),\n },\n plain: {\n active: STATE.active,\n inactive: clsx('text-default-secondary', STATE.hover),\n },\n};\n\nexport function NavItem({\n icon,\n label,\n isActive = false,\n indicator = false,\n collapsed = false,\n size = 'md',\n variant = 'card',\n asChild = false,\n children,\n className,\n ...rest\n}: NavItemProps) {\n const s = SIZE[size];\n const v = VARIANT[variant];\n\n const rootProps = {\n // Only meaningful when `asChild` renders a real link — a decorative span with\n // aria-current would be a lie.\n 'aria-current': asChild && isActive ? ('page' as const) : undefined,\n // Same attribute the disclosure components and `TableRow` use, so the state is\n // addressable from a consumer's CSS. `active` rather than `selected`: a nav row is where\n // you *are* (`aria-current=\"page\"`), which is a different thing from a row you have\n // *picked* (`aria-selected`) — `TableRow` is the latter and says `selected`.\n 'data-state': isActive ? ('active' as const) : undefined,\n className: clsx(\n 'relative flex items-center transition-colors',\n // Unconditional: a row can also become focusable by the caller putting it inside a\n // link, which is how `src/sidebar/` uses it. A ring that only appears under `asChild`\n // leaves that case with no visible focus at all.\n // The offset is `default-secondary`, not `default`: a nav row's home is the sidebar\n // rail, and `ring-offset-default` is #FFFFFF, so a focused `plain` row drew a 1px white\n // halo on the #F5F5F5 rail. The offset itself is load-bearing — in dark mode\n // `ring-brand` and `bg-brand` are both #F1F7FD, so without it a focused *active* row\n // would have no visible ring at its inner edge.\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default-secondary',\n s.box,\n // Expanded rows fill the nav; a collapsed one is a centred square, not a stretched row.\n collapsed ? clsx('justify-center', s.square) : 'w-full',\n isActive ? v.active : v.inactive,\n className,\n ),\n ...rest,\n };\n\n const content = (\n <>\n {icon != null ? (\n <span aria-hidden className=\"shrink-0 [&_svg]:size-4\">\n {icon}\n </span>\n ) : (\n // Icons are optional, but the collapsed rail hides the label — so a row with neither\n // renders as an empty box. Through 0.5.0 that is exactly what a nav without icons\n // collapsed to, the docs site's own 36-row sidebar included. The monogram is\n // decorative in the same way the icon is: the `sr-only` label below still names the\n // row.\n collapsed && (\n <span\n aria-hidden\n // `min-w-4` rather than `size-4`: the box matches the 16px an icon would take,\n // but a wide pair like \"MW\" is allowed to outgrow it rather than be clipped.\n className=\"flex h-4 min-w-4 shrink-0 items-center justify-center text-body-tiny font-semibold leading-none tracking-tight\"\n >\n {monogram(label)}\n </span>\n )\n )}\n {/* `collapsed` hides the label visually but keeps it in the accessibility tree.\n Through 0.3.0 the span was not rendered at all and no `aria-label` replaced it,\n so a collapsed sidebar was nine unlabelled icon links — the icon itself carries\n no name, being decorative. */}\n <span\n className={clsx(\n 'min-w-0 truncate font-regular leading-snug',\n s.label,\n collapsed ? 'sr-only' : 'flex-1',\n )}\n >\n {label}\n </span>\n {indicator && (\n <span\n // The dot is the only carrier of \"there is something new here\", so it needs a\n // name of its own rather than being purely decorative.\n role=\"status\"\n aria-label=\"Unread\"\n className=\"absolute -right-px -top-px size-2 rounded-full bg-danger\"\n />\n )}\n </>\n );\n\n if (asChild) {\n // The child element becomes the row itself, so the icon/label/indicator go inside it\n // and its own children (usually nothing, since the label comes from `label`) are\n // discarded in favour of the composed content.\n return (\n <Slot wrapChildren={() => content} {...rootProps}>\n {children}\n </Slot>\n );\n }\n\n return <span {...rootProps}>{content}</span>;\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EyebrowLabelVariant = 'uppercase' | 'plain';\n\nexport interface EyebrowLabelProps {\n children: ReactNode;\n /**\n * `uppercase` is the dominant form (nine of twelve source copies).\n * `plain` covers the entity-detail / reviewer-detail variant, whose label text is\n * already capitalised in the source string.\n */\n variant?: EyebrowLabelVariant;\n className?: string;\n}\n\n/**\n * Small semibold label above a group of fields.\n *\n * Replaces twelve copies across three variants:\n * `mb-2 text-body-tiny font-semibold uppercase tracking-wide …` (×9)\n * `text-[11px] font-semibold … tracking-wide` (×5, entity/reviewer detail)\n * `text-body-tiny font-semibold uppercase tracking-wider` (×2, entity onboarding)\n *\n * `text-body-tiny` is 11px, so the `text-[11px]` variant collapses into it exactly.\n * The `tracking-wider` copies become `tracking-wide` — a 0.0125em difference at 11px,\n * i.e. sub-pixel.\n */\nexport function EyebrowLabel({ children, variant = 'uppercase', className }: EyebrowLabelProps) {\n return (\n <p\n className={clsx(\n 'text-body-tiny font-semibold tracking-wide text-default-secondary',\n variant === 'uppercase' && 'uppercase',\n className,\n )}\n >\n {children}\n </p>\n );\n}\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport clsx from 'clsx';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {\n orientation?: SeparatorOrientation;\n /**\n * `true` when the rule is purely visual, which is the common case. A decorative\n * separator is `role=\"none\"` and stays out of the accessibility tree; a semantic one\n * is `role=\"separator\"` and announces a break between groups.\n */\n decorative?: boolean;\n}\n\n/**\n * A hairline rule. Matches Figma's `Menu Separator`, generalised to both orientations.\n *\n * Drawn as a filled element rather than a border, because a 1px border on a flex child\n * collapses to nothing at some zoom levels while a `1px` height does not — which is why\n * the preset carries a `divider` background token separate from `border-default`.\n */\nexport const Separator = forwardRef<HTMLDivElement, SeparatorProps>(function Separator(\n { orientation = 'horizontal', decorative = true, className, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role={decorative ? 'none' : 'separator'}\n aria-orientation={decorative ? undefined : orientation}\n data-slot=\"separator\"\n className={clsx(\n 'shrink-0 bg-divider',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className,\n )}\n {...rest}\n />\n );\n});\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type KbdSize = 'sm' | 'md';\n\nexport interface KbdProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n size?: KbdSize;\n}\n\nconst SIZE: Record<KbdSize, string> = {\n sm: 'h-4 min-w-4 px-1 text-body-tiny',\n md: 'h-5 min-w-5 px-1.5 text-body-xs',\n};\n\n/**\n * A keyboard key. Matches Figma's `Menu Shortcut`.\n *\n * Renders a real `<kbd>` so assistive tech announces it as key input rather than as a\n * stray glyph — `⌘K` read as plain text is \"place of interest sign K\".\n *\n * Pass one key per element and let the caller supply the joiner, so a shortcut reads as\n * separate keys instead of one run-together string:\n *\n * <Kbd>⌘</Kbd><Kbd>K</Kbd>\n */\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd(\n { children, size = 'md', className, ...rest },\n ref,\n) {\n return (\n <kbd\n ref={ref}\n data-slot=\"kbd\"\n className={clsx(\n 'inline-flex items-center justify-center rounded border border-default bg-default-secondary',\n 'font-medium tabular-nums text-default-secondary',\n SIZE[size],\n className,\n )}\n {...rest}\n >\n {children}\n </kbd>\n );\n});\n","import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuChevronRight } from 'react-icons/lu';\nimport { Slot } from '../../lib/slot';\n\nexport interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n /** Names the landmark. Default `Breadcrumb`. */\n label?: string;\n}\n\n/**\n * Breadcrumb trail.\n *\n * A `<nav>` wrapping an ordered list, which is the whole semantic point: the order *is* the\n * hierarchy, so `<ol>` says something `<div>` cannot, and the landmark lets a screen reader\n * user jump to the trail without walking the header.\n *\n * The separators are `aria-hidden` and generated by the list, not passed in — a chevron\n * announced between every crumb is noise, and the `/` characters people usually hand-type\n * get read out one by one.\n */\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(function Breadcrumb(\n { children, label = 'Breadcrumb', className, ...rest },\n ref,\n) {\n return (\n <nav ref={ref} aria-label={label} data-slot=\"breadcrumb\" {...rest}>\n <ol className={clsx('flex flex-wrap items-center gap-1.5 p-0 text-body-xs', className)}>\n {children}\n </ol>\n </nav>\n );\n});\n\nexport interface BreadcrumbItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n children: ReactNode;\n /**\n * The page you are on. Renders as plain text with `aria-current=\"page\"` rather than a\n * link — a link to the current page is a dead control, and the APG says the last crumb\n * should not be one.\n */\n current?: boolean;\n /** Render a router `Link` instead of an `<a>`. */\n asChild?: boolean;\n /** Suppress the leading separator. Set automatically on the first item you render. */\n first?: boolean;\n}\n\nexport const BreadcrumbItem = forwardRef<HTMLAnchorElement, BreadcrumbItemProps>(\n function BreadcrumbItem({ children, current = false, asChild = false, first = false, className, ...rest }, ref) {\n return (\n <li className=\"flex items-center gap-1.5\">\n {!first && (\n <LuChevronRight aria-hidden className=\"size-3.5 shrink-0 text-icon-default-tertiary\" />\n )}\n {current ? (\n <span aria-current=\"page\" className={clsx('font-medium text-default', className)}>\n {children}\n </span>\n ) : asChild ? (\n <Slot\n className={clsx(\n 'rounded text-default-secondary transition-colors hover:text-brand',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n className,\n )}\n {...rest}\n >\n {children}\n </Slot>\n ) : (\n <a\n ref={ref}\n className={clsx(\n 'rounded text-default-secondary transition-colors hover:text-brand',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n className,\n )}\n {...rest}\n >\n {children}\n </a>\n )}\n </li>\n );\n },\n);\n\nexport interface BreadcrumbEllipsisProps extends HTMLAttributes<HTMLSpanElement> {}\n\n/**\n * Stands in for collapsed middle crumbs on a deep trail.\n *\n * A `<span>`, not a button: it is a truncation marker, and making it a disabled control\n * puts an unusable stop in the tab order. If the hidden crumbs need to be reachable, wrap\n * this in a `DropdownMenuTrigger` and list them.\n */\nexport const BreadcrumbEllipsis = forwardRef<HTMLSpanElement, BreadcrumbEllipsisProps>(\n function BreadcrumbEllipsis({ className, ...rest }, ref) {\n return (\n <li className=\"flex items-center gap-1.5\">\n <LuChevronRight aria-hidden className=\"size-3.5 shrink-0 text-icon-default-tertiary\" />\n <span\n ref={ref}\n aria-label=\"Collapsed items\"\n className={clsx('px-0.5 text-default-tertiary', className)}\n {...rest}\n >\n …\n </span>\n </li>\n );\n },\n);\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { LuChevronLeft, LuChevronRight } from 'react-icons/lu';\n\nexport type PaginationType = 'default' | 'dots';\n\nexport interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {\n /** 1-based. */\n page: number;\n /** Total number of pages. Values below 1 render nothing. */\n pageCount: number;\n onPageChange: (page: number) => void;\n /** Matches Figma's `Type` axis. `dots` is the compact carousel form. */\n type?: PaginationType;\n /** How many numbered pages to show either side of the current one. Default `1`. */\n siblingCount?: number;\n /** Names the nav landmark. Default `Pagination`. */\n label?: string;\n}\n\nconst GAP = '…';\n\n/**\n * Builds the visible page list with ellipses.\n *\n * Always returns first and last, the current page, and `siblingCount` either side. The\n * window is widened rather than allowed to shrink near the ends, so the control does not\n * change width as the user pages through — a row of buttons that reflows under the cursor\n * is how you mis-click.\n */\nexport function paginationRange(\n page: number,\n pageCount: number,\n siblingCount = 1,\n): (number | typeof GAP)[] {\n // first + last + current + 2 siblings + 2 possible gaps\n const totalSlots = siblingCount * 2 + 5;\n if (pageCount <= totalSlots) {\n return Array.from({ length: pageCount }, (_, i) => i + 1);\n }\n\n const left = Math.max(page - siblingCount, 1);\n const right = Math.min(page + siblingCount, pageCount);\n\n const showLeftGap = left > 3;\n const showRightGap = right < pageCount - 2;\n\n if (!showLeftGap && showRightGap) {\n const count = siblingCount * 2 + 3;\n return [...Array.from({ length: count }, (_, i) => i + 1), GAP, pageCount];\n }\n\n if (showLeftGap && !showRightGap) {\n const count = siblingCount * 2 + 3;\n return [1, GAP, ...Array.from({ length: count }, (_, i) => pageCount - count + 1 + i)];\n }\n\n return [\n 1,\n GAP,\n ...Array.from({ length: right - left + 1 }, (_, i) => left + i),\n GAP,\n pageCount,\n ];\n}\n\nconst ARROW_BASE = clsx(\n 'inline-flex size-9 shrink-0 items-center justify-center rounded-lg border transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n 'disabled:cursor-not-allowed disabled:border-disabled disabled:bg-disabled disabled:text-disabled',\n 'border-default bg-default text-default hover:bg-default-secondary hover:text-brand',\n);\n\n/**\n * Pagination. Matches Figma's `Pagination` (`Type: Default | Dots`), `Pagination Page`\n * (`State: Default | Hover | Current | Current Hover`), `Pagination Next` / `Previous`\n * (`Default | Hover | Disabled`) and `Pagination dots` (`Active | Inactive`).\n *\n * `DataTable` had no pager at all, so every consumer built one. Notes on the semantics:\n *\n * - A `<nav>` landmark with a name, so it is reachable by landmark navigation.\n * - `aria-current=\"page\"` on the active page. It is the only non-visual signal of which\n * page you are on; the filled background is not announced.\n * - Each page button is named \"Page 3\", not \"3\" — a bare number read out of context tells\n * a screen reader user nothing about what activating it does.\n * - The ellipsis is inert text, not a disabled button, so it is skipped rather than\n * announced as an unavailable control.\n */\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n page,\n pageCount,\n onPageChange,\n type = 'default',\n siblingCount = 1,\n label = 'Pagination',\n className,\n ...rest\n },\n ref,\n) {\n if (pageCount < 1) return null;\n\n const go = (next: number) => {\n const clamped = Math.min(Math.max(next, 1), pageCount);\n if (clamped !== page) onPageChange(clamped);\n };\n\n return (\n <nav\n ref={ref}\n aria-label={label}\n data-slot=\"pagination\"\n className={clsx('flex items-center gap-1.5', className)}\n {...rest}\n >\n <button\n type=\"button\"\n aria-label=\"Previous page\"\n disabled={page <= 1}\n onClick={() => go(page - 1)}\n className={ARROW_BASE}\n >\n <LuChevronLeft aria-hidden className=\"size-4\" />\n </button>\n\n {type === 'dots' ? (\n // The dots form has no room for numbers, so the list itself is the only place the\n // position can be stated — hence the live-region-free but explicitly named group.\n <span\n role=\"group\"\n aria-label={`Page ${page} of ${pageCount}`}\n className=\"flex items-center gap-2 px-2\"\n >\n {Array.from({ length: pageCount }, (_, i) => i + 1).map((n) => (\n <button\n key={n}\n type=\"button\"\n aria-label={`Page ${n}`}\n aria-current={n === page ? 'page' : undefined}\n onClick={() => go(n)}\n className={clsx(\n 'size-2 rounded-full transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-2 focus-visible:ring-offset-default',\n n === page ? 'bg-brand' : 'bg-default-tertiary hover:bg-neutral-secondary',\n )}\n />\n ))}\n </span>\n ) : (\n paginationRange(page, pageCount, siblingCount).map((entry, index) =>\n entry === GAP ? (\n <span\n key={`gap-${index}`}\n aria-hidden\n className=\"inline-flex size-9 items-center justify-center text-body-sm text-default-tertiary\"\n >\n {GAP}\n </span>\n ) : (\n <button\n key={entry}\n type=\"button\"\n aria-label={`Page ${entry}`}\n aria-current={entry === page ? 'page' : undefined}\n onClick={() => go(entry)}\n className={clsx(\n 'inline-flex size-9 shrink-0 items-center justify-center rounded-lg border text-body-sm tabular-nums transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n entry === page\n ? 'border-brand bg-brand font-semibold text-brand-on-brand'\n : 'border-default bg-default text-default hover:bg-default-secondary hover:text-brand',\n )}\n >\n {entry}\n </button>\n ),\n )\n )}\n\n <button\n type=\"button\"\n aria-label=\"Next page\"\n disabled={page >= pageCount}\n onClick={() => go(page + 1)}\n className={ARROW_BASE}\n >\n <LuChevronRight aria-hidden className=\"size-4\" />\n </button>\n </nav>\n );\n});\n","import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Slot } from '../../lib/slot';\n\nexport type NavigationMenuOrientation = 'horizontal' | 'vertical';\nexport type NavigationMenuVariant = 'pill' | 'link';\n\nexport interface NavigationMenuProps extends HTMLAttributes<HTMLElement> {\n children: ReactNode;\n orientation?: NavigationMenuOrientation;\n /** Names the nav landmark. Required when a page has more than one `<nav>`. */\n label: string;\n}\n\n/**\n * A navigation landmark wrapping a list of links. Matches Figma's `Navigation Pill List`\n * and `Navigation Button List`.\n *\n * Why the `<nav>` + `<ul>` + `<li>` nesting rather than a flat row of anchors: the list is\n * what makes a screen reader announce \"list, 5 items\" and lets the user jump the whole\n * block. A bare row of links is announced one at a time with no sense of how many there\n * are or where the set ends. The `label` is required for the same reason — an unnamed\n * landmark in a page with a sidebar *and* a top bar is not navigable.\n */\nexport const NavigationMenu = forwardRef<HTMLElement, NavigationMenuProps>(\n function NavigationMenu({ children, orientation = 'horizontal', label, className, ...rest }, ref) {\n return (\n <nav ref={ref} aria-label={label} data-slot=\"navigation-menu\" {...rest}>\n <ul\n className={clsx(\n 'flex list-none p-0',\n orientation === 'vertical' ? 'flex-col gap-1' : 'flex-row items-center gap-1',\n className,\n )}\n >\n {children}\n </ul>\n </nav>\n );\n },\n);\n\nexport interface NavigationMenuItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n children: ReactNode;\n /** Matches Figma's `State: Active`. Sets `aria-current=\"page\"`. */\n active?: boolean;\n variant?: NavigationMenuVariant;\n /** Render a router `Link` instead of an `<a>`. */\n asChild?: boolean;\n /** Leading glyph. Marked decorative automatically. */\n icon?: ReactNode;\n}\n\n/**\n * A single navigation link. Matches Figma's `Navigation Pill` and `Navigation Button`\n * (`State: Default | Active | Hover`).\n *\n * `aria-current=\"page\"` is the point: the filled pill is not announced, so without it a\n * screen reader user cannot tell which page they are on.\n */\nexport const NavigationMenuItem = forwardRef<HTMLAnchorElement, NavigationMenuItemProps>(\n function NavigationMenuItem(\n { children, active = false, variant = 'pill', asChild = false, icon, className, ...rest },\n ref,\n ) {\n const content = (\n <>\n {icon && (\n <span aria-hidden className=\"shrink-0 [&_svg]:size-4\">\n {icon}\n </span>\n )}\n <span className=\"min-w-0 truncate\">{children}</span>\n </>\n );\n\n const linkProps = {\n 'aria-current': active ? ('page' as const) : undefined,\n className: clsx(\n 'inline-flex items-center gap-2 whitespace-nowrap transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n variant === 'pill'\n ? clsx(\n 'rounded-lg px-3 py-1.5 text-body-xs font-medium',\n active\n ? 'bg-brand text-brand-on-brand'\n : 'text-default-secondary hover:bg-default-secondary hover:text-default',\n )\n : clsx(\n 'rounded px-1 py-0.5 text-body-sm',\n active\n ? 'font-semibold text-brand'\n : 'text-default-secondary hover:text-default',\n ),\n className,\n ),\n ...rest,\n };\n\n return (\n <li>\n {asChild ? (\n <Slot wrapChildren={() => content} {...linkProps}>\n {children}\n </Slot>\n ) : (\n <a ref={ref} {...linkProps}>\n {content}\n </a>\n )}\n </li>\n );\n },\n);\n","import { forwardRef, type AnchorHTMLAttributes, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { Slot } from '../../lib/slot';\n\n/**\n * The type ramp as components, mirroring Figma's `Text*` primitives one-for-one:\n * `Text`, `Text Strong`, `Text Emphasis`, `Text Small`, `Text Code`, `Text Link`,\n * `Text Heading`, `Text Subheading`, `Text Subtitle`, `Text Title Page`,\n * `Text Title Hero`, `Text List`, `Text List Item`, `Text Link List`.\n *\n * These existed in Figma with settled styles and had no code counterpart, so every\n * consumer reached for a raw `text-body-sm text-default` triplet and the ramp drifted.\n * Each component pins the size/weight/colour combination and nothing else, so layout\n * stays the caller's job.\n *\n * All of them take `asChild`, because the right element is contextual — a `Heading` is an\n * `<h2>` on a page and an `<h3>` inside a card, and only the caller knows the outline.\n */\n\ntype BaseProps = HTMLAttributes<HTMLElement> & {\n children?: ReactNode;\n asChild?: boolean;\n};\n\n/** Factory for the plain ramp entries — identical except for element and classes. */\nfunction textComponent(\n displayName: string,\n defaultElement: 'p' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'strong' | 'em' | 'code',\n classes: string,\n) {\n const Component = forwardRef<HTMLElement, BaseProps>(function TextComponent(\n { children, asChild = false, className, ...rest },\n ref,\n ) {\n const Root = (asChild ? Slot : defaultElement) as 'p';\n return (\n <Root ref={ref as never} className={clsx(classes, className)} {...rest}>\n {children}\n </Root>\n );\n });\n Component.displayName = displayName;\n return Component;\n}\n\n// ── Body ───────────────────────────────────────────────────────────────────────\n\nexport type TextProps = BaseProps;\n\n/** `Text` — the default body paragraph. */\nexport const Text = textComponent('Text', 'p', 'text-body text-default');\n\n/** `Text Small` — secondary body copy. */\nexport const TextSmall = textComponent('TextSmall', 'p', 'text-body-sm text-default-secondary');\n\n/** `Text Tiny` — the smallest readable step; captions and table meta. */\nexport const TextTiny = textComponent('TextTiny', 'p', 'text-body-tiny text-default-secondary');\n\n/** `Text Strong` — emphasis by weight, in a real `<strong>`. */\nexport const TextStrong = textComponent('TextStrong', 'strong', 'font-semibold text-default');\n\n/** `Text Emphasis` — emphasis by slant, in a real `<em>`. */\nexport const TextEmphasis = textComponent('TextEmphasis', 'em', 'italic text-default');\n\n/** `Text Code` — inline monospace. */\nexport const TextCode = textComponent(\n 'TextCode',\n 'code',\n 'rounded border border-default bg-default-secondary px-1 py-0.5 font-mono text-body-xs text-default',\n);\n\n// ── Headings ───────────────────────────────────────────────────────────────────\n\n/** `Text Title Hero` — the largest step, one per page at most. */\nexport const TitleHero = textComponent('TitleHero', 'h1', 'text-title-hero font-bold text-default');\n\n/** `Text Title Page` — page title. */\nexport const TitlePage = textComponent('TitlePage', 'h1', 'text-title font-bold text-default');\n\n/** `Text Subtitle` — a lead paragraph under a title; regular weight by design. */\nexport const Subtitle = textComponent('Subtitle', 'p', 'text-subtitle text-default-secondary');\n\n/** `Text Heading` — section heading. */\nexport const Heading = textComponent('Heading', 'h2', 'text-heading font-semibold text-default');\n\n/** `Text Subheading` — subsection heading; regular weight, matching Figma. */\nexport const Subheading = textComponent('Subheading', 'h3', 'text-subheading text-default');\n\n// ── Link ───────────────────────────────────────────────────────────────────────\n\nexport interface TextLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n children?: ReactNode;\n asChild?: boolean;\n}\n\n/**\n * `Text Link`. Underlined rather than colour-only: colour alone is not a sufficient\n * distinction for a link inside a run of text (WCAG 1.4.1).\n */\nexport const TextLink = forwardRef<HTMLAnchorElement, TextLinkProps>(function TextLink(\n { children, asChild = false, className, ...rest },\n ref,\n) {\n const Root = (asChild ? Slot : 'a') as 'a';\n return (\n <Root\n ref={ref}\n className={clsx(\n 'rounded text-brand underline decoration-1 underline-offset-2 transition-colors',\n 'hover:text-brand-secondary',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n className,\n )}\n {...rest}\n >\n {children}\n </Root>\n );\n});\n\n// ── Lists ──────────────────────────────────────────────────────────────────────\n\nexport type TextListVariant = 'bulleted' | 'numbered' | 'plain';\nexport type TextListDensity = 'default' | 'compact';\n\nexport interface TextListProps extends HTMLAttributes<HTMLElement> {\n children?: ReactNode;\n variant?: TextListVariant;\n /** Matches Figma's `Density` axis on `Text List` / `Text Link List`. */\n density?: TextListDensity;\n}\n\nconst LIST_MARKER: Record<TextListVariant, string> = {\n bulleted: 'list-disc pl-5',\n numbered: 'list-decimal pl-5',\n plain: 'list-none pl-0',\n};\n\n/** `Text List` — a real `<ul>`/`<ol>`, so item count is announced. */\nexport const TextList = forwardRef<HTMLElement, TextListProps>(function TextList(\n { children, variant = 'bulleted', density = 'default', className, ...rest },\n ref,\n) {\n const Root = (variant === 'numbered' ? 'ol' : 'ul') as 'ul';\n return (\n <Root\n ref={ref as never}\n className={clsx(\n 'text-body text-default',\n LIST_MARKER[variant],\n density === 'compact' ? 'space-y-0.5' : 'space-y-1.5',\n className,\n )}\n {...rest}\n >\n {children}\n </Root>\n );\n});\n\nexport type TextListItemProps = HTMLAttributes<HTMLLIElement> & { children?: ReactNode };\n\n/** `Text List Item`. */\nexport const TextListItem = forwardRef<HTMLLIElement, TextListItemProps>(function TextListItem(\n { children, className, ...rest },\n ref,\n) {\n return (\n <li ref={ref} className={clsx('text-body text-default', className)} {...rest}>\n {children}\n </li>\n );\n});\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { WidgetTitle } from './widget-title';\nimport type { WidgetTitleSize } from './widget-title';\n\nexport type WidgetHeaderEyebrowVariant = 'uppercase' | 'plain';\n\nexport interface WidgetHeaderProps {\n eyebrow?: string;\n eyebrowVariant?: WidgetHeaderEyebrowVariant;\n title: string;\n titleSize?: WidgetTitleSize;\n subtitle?: string;\n badge?: ReactNode;\n action?: ReactNode;\n className?: string;\n}\n\n// uppercase: 11px/medium/tracked, matches Variation 2 mockups · plain: 13px/regular, matches Variation 1's small label line\nconst eyebrowStyles: Record<WidgetHeaderEyebrowVariant, string> = {\n uppercase: 'text-body-tiny font-medium uppercase tracking-[0.66px] text-default-secondary',\n plain: 'text-body-xs leading-[1.4] text-default-secondary',\n};\n\nexport function WidgetHeader({\n eyebrow,\n eyebrowVariant = 'uppercase',\n title,\n titleSize,\n subtitle,\n badge,\n action,\n className,\n}: WidgetHeaderProps) {\n return (\n <div className={clsx('flex items-start justify-between gap-2', className)}>\n <div className=\"min-w-0 flex-1\">\n {eyebrow && <p className={eyebrowStyles[eyebrowVariant]}>{eyebrow}</p>}\n <WidgetTitle size={titleSize}>{title}</WidgetTitle>\n {subtitle && (\n <p className=\"mt-1 text-body-xs text-default-secondary leading-snug\">{subtitle}</p>\n )}\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {badge}\n {action}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport type WidgetTitleSize = 'sm' | 'md' | 'lg';\n\nexport interface WidgetTitleProps {\n children: ReactNode;\n size?: WidgetTitleSize;\n className?: string;\n}\n\n// sm: 16px/semibold (default) · md: 18px/bold (Variation 2 mockups) · lg: 20px/semibold (Variation 1 mockups)\nconst sizeStyles: Record<WidgetTitleSize, string> = {\n sm: 'text-subheading-sm font-semibold leading-none',\n // Was `text-[18px]`, which had no step on the type scale (Scale 04 = 16, Scale 05 = 20).\n // Now 20px, so `md` and `lg` are the same size and separate on weight alone — bold vs\n // semibold. That is the intended trade for getting off an off-scale literal.\n md: 'text-subheading font-bold leading-normal',\n lg: 'text-subheading font-semibold leading-[1.2]',\n};\n\nexport function WidgetTitle({ children, size = 'sm', className }: WidgetTitleProps) {\n return (\n <h3 className={clsx(sizeStyles[size], 'text-default', className)}>\n {children}\n </h3>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\n\nexport interface WidgetFooterProps {\n caption?: string;\n subcaption?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport function WidgetFooter({ caption, subcaption, action, className }: WidgetFooterProps) {\n return (\n <div className={clsx('flex items-center gap-3', className)}>\n {caption && (\n <div className=\"flex items-stretch gap-3 flex-1 min-w-0\">\n <div className=\"w-0.5 shrink-0 self-stretch rounded-full bg-brand\" />\n <div className=\"min-w-0\">\n <p className=\"text-body-sm font-medium text-default leading-snug\">\n {caption}\n </p>\n {subcaption && (\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{subcaption}</p>\n )}\n </div>\n </div>\n )}\n {action && <div className=\"ml-auto shrink-0\">{action}</div>}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { StatusTone } from '../status/status-badge';\n\nconst DOT_TONE: Record<StatusTone, string> = {\n neutral: 'bg-status-dot-neutral',\n info: 'bg-status-dot-info',\n warning: 'bg-status-dot-warning',\n caution: 'bg-status-dot-caution',\n accent: 'bg-status-dot-accent',\n positive: 'bg-status-dot-positive',\n danger: 'bg-status-dot-danger',\n};\n\nexport interface StatTileProps {\n label: string;\n value: string | number;\n /** Status tone for the leading dot. Prefer this over `dotColor`. */\n tone?: StatusTone;\n /**\n * @deprecated Pass `tone` instead. A raw colour here bypasses the token layer,\n * which is how competing status palettes drift apart.\n */\n dotColor?: string;\n className?: string;\n}\n\nexport function StatTile({ label, value, tone, dotColor, className }: StatTileProps) {\n const showDot = Boolean(tone || dotColor);\n\n return (\n <div\n className={clsx(\n 'flex flex-col gap-2 rounded-xl border border-default bg-default p-4',\n className,\n )}\n >\n <div className=\"flex items-center gap-1.5\">\n {showDot && (\n <span\n className={clsx('size-2 shrink-0 rounded-full', tone && DOT_TONE[tone])}\n style={tone ? undefined : { backgroundColor: dotColor }}\n />\n )}\n <span className=\"text-body-xs font-medium text-default-secondary whitespace-nowrap\">\n {label}\n </span>\n </div>\n <span className=\"text-heading font-semibold text-default leading-none\">{value}</span>\n </div>\n );\n}\n","import clsx from 'clsx';\n\nexport type StatNumberSize = 'sm' | 'md' | 'lg';\n\nexport type StatNumberWeight = 'medium' | 'bold';\n\nexport interface StatNumberProps {\n value: string | number;\n unit?: string;\n size?: StatNumberSize;\n weight?: StatNumberWeight;\n /** @deprecated Bypasses the design tokens — pass `tone` instead. Raw hex color, overrides the default text color via inline style. Use when the exact source color doesn't match a design token. */\n color?: string;\n className?: string;\n}\n\n// 32 / 40 / 48px — the --typo-scale-07/08/09 steps. These read `text-scale-0*` until\n// 0.3.0, which the preset never defined, so every size emitted no font-size at all.\nconst sizeStyles: Record<StatNumberSize, string> = {\n sm: 'text-subtitle',\n md: 'text-subtitle-lg',\n lg: 'text-title',\n};\n\nconst weightStyles: Record<StatNumberWeight, string> = {\n medium: 'font-medium',\n bold: 'font-bold',\n};\n\nexport function StatNumber({ value, unit, size = 'md', weight = 'bold', color, className }: StatNumberProps) {\n return (\n <p\n className={clsx(sizeStyles[size], weightStyles[weight], 'leading-none', !color && 'text-default', className)}\n style={color ? { color } : undefined}\n >\n {value}\n {unit && (\n <span className=\"ml-1 text-subheading font-medium text-default-secondary\">{unit}</span>\n )}\n </p>\n );\n}\n","import clsx from 'clsx';\n\nexport type ScoreValueSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';\nexport type ScoreValueWeight = 'normal' | 'semibold' | 'bold';\nexport type ScoreTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral' | 'default';\nexport type ScoreValueTone = ScoreTone | 'auto';\n\n/**\n * The four tones the automatic ramp can produce.\n *\n * Narrower than `ScoreTone` on purpose: a ramp position is always one of these, so the\n * result is directly assignable to `ProgressBarTone` too — which is what lets a caller\n * tone a bar and its score from one `getScoreTone` call.\n */\nexport type ScoreRampTone = 'positive' | 'neutral' | 'warning' | 'danger';\n\n/** Which end of the scale is the bad end. */\nexport type ScoreDirection = 'higher-is-worse' | 'higher-is-better';\n\nexport interface ScoreThresholds {\n /** At or above this, the score is `danger`. */\n danger: number;\n /** At or above this, `warning`. */\n warning: number;\n /** At or above this, `neutral`. Below it, `positive`. */\n neutral: number;\n}\n\n/**\n * Default ramp, on a 0–100 scale read as \"higher is worse\" — the risk case.\n *\n * 0.2.0's ramp had only four stops and resolved 65–79 to `brand` (the blue brand\n * colour), which left `warning` and `positive` unreachable without passing `tone`\n * by hand. This is a real five-stop ramp.\n */\nexport const DEFAULT_SCORE_THRESHOLDS: ScoreThresholds = { danger: 80, warning: 65, neutral: 50 };\n\n/**\n * Resolve a numeric score to a tone.\n *\n * Was `getRiskTone` in 0.2.0, with the thresholds and the direction both hardcoded.\n */\nexport function getScoreTone(\n score: number,\n {\n direction = 'higher-is-worse',\n thresholds = DEFAULT_SCORE_THRESHOLDS,\n }: { direction?: ScoreDirection; thresholds?: ScoreThresholds } = {},\n): ScoreRampTone {\n // Flip the score, not the comparisons — one ramp, read from either end.\n const v = direction === 'higher-is-better' ? 100 - score : score;\n if (v >= thresholds.danger) return 'danger';\n if (v >= thresholds.warning) return 'warning';\n if (v >= thresholds.neutral) return 'neutral';\n return 'positive';\n}\n\n// 13 / 14 / 16 / 20 / 32px\nconst SIZE: Record<ScoreValueSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n xl: 'text-subheading',\n '2xl': 'text-subtitle',\n};\n\nconst WEIGHT: Record<ScoreValueWeight, string> = {\n normal: 'font-normal',\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nconst TONE: Record<ScoreTone, string> = {\n brand: 'text-brand',\n positive: 'text-positive',\n warning: 'text-warning',\n danger: 'text-danger',\n neutral: 'text-default-secondary',\n default: 'text-default',\n};\n\nexport interface ScoreValueProps {\n value: string | number;\n /** Trailing caption — `/100`, `High`, `of target`. */\n label?: string;\n size?: ScoreValueSize;\n weight?: ScoreValueWeight;\n /** `auto` derives the tone from `value` via {@link getScoreTone}. */\n tone?: ScoreValueTone;\n direction?: ScoreDirection;\n thresholds?: ScoreThresholds;\n className?: string;\n}\n\n/**\n * A scored number with an optional caption and a tone that can track its value.\n *\n * Was `RiskScore`. Nothing about it was ever risk-specific except the name and the\n * direction of its ramp, so both are now parameters: use it for a risk score, a\n * compliance score, a match confidence, a utilisation percentage.\n *\n * Not to be confused with `StatNumber`, which is the *large display* number with a\n * unit (32–48px, for tiles and widget headlines). `ScoreValue` is the inline one with\n * a label and a tone ramp.\n */\nexport function ScoreValue({\n value,\n label,\n size = 'md',\n weight = 'bold',\n tone = 'auto',\n direction = 'higher-is-worse',\n thresholds = DEFAULT_SCORE_THRESHOLDS,\n className,\n}: ScoreValueProps) {\n // A numeric-looking string still resolves. In 0.2.0 `tone=\"auto\"` fell back to\n // `default` for any string, so callers passing `score=\"82\"` silently got no tone.\n const numeric = typeof value === 'number' ? value : Number(value);\n const resolved: ScoreTone =\n tone === 'auto'\n ? Number.isFinite(numeric)\n ? getScoreTone(numeric, { direction, thresholds })\n : 'default'\n : tone;\n\n return (\n <span className={clsx('inline-flex items-baseline gap-1', className)}>\n <span className={clsx(SIZE[size], WEIGHT[weight], TONE[resolved])}>{value}</span>\n {label && <span className=\"text-body-xs text-default-secondary whitespace-nowrap\">{label}</span>}\n </span>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type TileGridColumns = 2 | 3 | 4 | 5 | 6;\n\n/**\n * Responsive column counts. Every source copy started two-up on mobile and stepped\n * to its full count at one breakpoint.\n *\n * The twelve source grids disagreed on which: seven used `lg:`, three used `md:`.\n * Standardising on `lg:` matches eight of them byte-for-byte and is the safer choice\n * — five tiles at `md` (768px) was cramped. `alerts`, `settings-users` and\n * `settings-organization` therefore stay two-up slightly longer on tablets than\n * before; that is the one deliberate layout change here.\n *\n * Six keeps its intermediate `sm:grid-cols-3` step, matching entities-listing —\n * without it, six tiles would stack 2×3 on tablet instead of 3×2.\n */\nexport type TileGridBreakpoint = 'sm' | 'md' | 'lg';\n\nconst COLUMNS: Record<TileGridBreakpoint, Record<TileGridColumns, string>> = {\n sm: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 sm:grid-cols-4',\n 5: 'grid-cols-2 sm:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-6',\n },\n md: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 md:grid-cols-3',\n 4: 'grid-cols-2 md:grid-cols-4',\n 5: 'grid-cols-2 md:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 md:grid-cols-6',\n },\n lg: {\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 lg:grid-cols-3',\n 4: 'grid-cols-2 lg:grid-cols-4',\n 5: 'grid-cols-2 lg:grid-cols-5',\n 6: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6',\n },\n};\n\nexport interface TileGridProps {\n children: ReactNode;\n columns?: TileGridColumns;\n /**\n * Breakpoint at which the grid reaches its full column count. `lg` is the default\n * and correct for a full-width page. Narrow contexts — a stat row inside a panel,\n * as on the article detail page — legitimately need `sm`.\n */\n at?: TileGridBreakpoint;\n className?: string;\n}\n\n/**\n * A responsive grid of equal-width tiles.\n *\n * Was `StatTileGrid`, which read as a `StatTile`-specific component. It has never been\n * coupled to one: no context, no cloning, no constraint on `children`. It takes any\n * nodes — `StatTile`s, `Card`s, chart tiles — and only owns the column counts and the\n * `gap-3`. The rename says so.\n */\nexport function TileGrid({\n children,\n columns = 4,\n at = 'lg',\n className,\n}: TileGridProps) {\n return <div className={clsx('grid gap-3', COLUMNS[at][columns], className)}>{children}</div>;\n}\n","/**\n * Chart colour.\n *\n * SVG paints via the `stroke` / `fill` *attributes*, which cannot take a Tailwind\n * class — so charts resolve a `tone` to a CSS variable reference instead of a utility.\n * That keeps them on the token layer; 0.2.0's charts defaulted to raw hex (`#0c2d58`,\n * `rgba(140,155,176,0.5)`) and drifted from it.\n *\n * Every chart still accepts an explicit `color` string for genuinely data-driven\n * colour — a series whose colour comes from the data, not from semantics.\n */\nexport type ChartTone = 'brand' | 'info' | 'positive' | 'warning' | 'danger' | 'neutral';\n\nexport const CHART_TONE: Record<ChartTone, string> = {\n brand: 'var(--color-background-brand-default)',\n info: 'var(--status-info-dot)',\n positive: 'var(--color-background-positive-default)',\n warning: 'var(--color-background-warning-default)',\n danger: 'var(--color-background-danger-default)',\n neutral: 'var(--color-background-neutral-default)',\n};\n\n/** The muted track/rest colour behind a highlighted series. */\nexport const CHART_TRACK = 'var(--color-background-default-tertiary)';\n\n/**\n * Ordered sequence for multi-series charts, so two donuts in the same product never\n * assign different colours to the same first category. Semantic tones come first\n * because a chart with two or three series is usually still saying something.\n */\nexport const CHART_SEQUENCE: ChartTone[] = ['brand', 'info', 'positive', 'warning', 'danger', 'neutral'];\n\n/** Resolve an explicit colour, else a tone, else the sequence position. */\nexport function resolveChartColor(color: string | undefined, tone: ChartTone | undefined, index = 0): string {\n if (color) return color;\n if (tone) return CHART_TONE[tone];\n return CHART_TONE[CHART_SEQUENCE[index % CHART_SEQUENCE.length]];\n}\n","import clsx from 'clsx';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type BarChartOrientation = 'vertical' | 'horizontal';\nexport type BarChartSize = 'sm' | 'md' | 'lg';\n\n/** Thickness of one bar / one group slot, and the label type step. */\nconst SIZE: Record<BarChartSize, { band: number; gap: number; label: string }> = {\n sm: { band: 14, gap: 6, label: 'text-body-tiny' },\n md: { band: 20, gap: 8, label: 'text-body-xs' },\n lg: { band: 28, gap: 10, label: 'text-body-xs' },\n};\n\nexport interface BarChartSeries {\n label: string;\n /** One value per category. */\n values: number[];\n tone?: ChartTone;\n color?: string;\n}\n\nexport interface BarChartProps {\n /** Category names — the axis labels. */\n categories: string[];\n series: BarChartSeries[];\n orientation?: BarChartOrientation;\n /** Stack series on top of each other instead of placing them side by side. */\n stacked?: boolean;\n size?: BarChartSize;\n /** Overall length of the value axis, in px. */\n length?: number;\n /** Show the category labels along the axis. */\n showLabels?: boolean;\n /** Print each bar's value at the end of the bar. Horizontal orientation only. */\n showValues?: boolean;\n radius?: number;\n label?: string;\n className?: string;\n}\n\n/**\n * Grouped or stacked bars, in either orientation.\n *\n * Horizontal is the orientation the library was missing and the one that actually suits\n * category data, because long category names get a full line of width rather than being\n * rotated or truncated under a vertical bar.\n *\n * Deliberately axis-light: one baseline, no gridlines, no ticks. For anything needing\n * real axes or interaction, this is the wrong component.\n */\nexport function BarChart({\n categories,\n series,\n orientation = 'horizontal',\n stacked = false,\n size = 'md',\n length = 240,\n showLabels = true,\n showValues = false,\n radius = 3,\n label,\n className,\n}: BarChartProps) {\n const { band, gap, label: labelClass } = SIZE[size];\n if (categories.length === 0 || series.length === 0) return null;\n\n // Stacked bars share one band per category; grouped bars split it between series.\n const perCategory = stacked ? band : band * series.length + gap * (series.length - 1);\n\n const categoryTotals = categories.map((_, ci) =>\n stacked\n ? series.reduce((sum, s) => sum + Math.max(0, s.values[ci] ?? 0), 0)\n : Math.max(...series.map((s) => Math.max(0, s.values[ci] ?? 0))),\n );\n const max = Math.max(...categoryTotals, 1);\n\n const horizontal = orientation === 'horizontal';\n\n return (\n <div\n className={clsx('flex w-full min-w-0', horizontal ? 'flex-col gap-2' : 'flex-row items-end gap-3', className)}\n role={label ? 'img' : undefined}\n aria-label={label}\n // Without a label the chart is decoration and its bars are noise in the a11y tree.\n // Every other chart in the family had this fallback; BarChart was the one that did\n // not, so an unlabelled one announced each bar's markup.\n aria-hidden={label ? undefined : true}\n >\n {categories.map((category, ci) => {\n const bars = series.map((s, si) => ({\n key: s.label,\n value: Math.max(0, s.values[ci] ?? 0),\n color: resolveChartColor(s.color, s.tone, si),\n }));\n\n return (\n <div\n key={category}\n className={clsx('flex min-w-0', horizontal ? 'flex-col gap-1' : 'h-full flex-col justify-end gap-1.5')}\n style={horizontal ? undefined : { width: perCategory }}\n >\n {showLabels && horizontal && (\n <span className={clsx('truncate text-default-secondary', labelClass)}>{category}</span>\n )}\n\n <div\n className={clsx('flex', horizontal ? 'items-center gap-2' : 'w-full flex-1 items-end justify-center')}\n style={horizontal ? undefined : { height: length }}\n >\n <div\n className={clsx('flex min-w-0', stacked ? 'gap-0' : '')}\n style={\n horizontal\n ? { width: length, flexDirection: stacked ? 'row' : 'column', gap: stacked ? 0 : gap }\n : {\n height: '100%',\n width: perCategory,\n flexDirection: stacked ? 'column-reverse' : 'row',\n alignItems: 'flex-end',\n gap: stacked ? 0 : gap,\n }\n }\n >\n {bars.map((bar) => {\n const extent = `${(bar.value / max) * 100}%`;\n return (\n <div\n key={bar.key}\n title={`${category} · ${bar.key}: ${bar.value}`}\n className=\"transition-all\"\n style={{\n backgroundColor: bar.color,\n borderRadius: radius,\n ...(horizontal\n ? { width: extent, height: stacked ? band : band }\n : { height: extent, width: stacked ? perCategory : band }),\n }}\n />\n );\n })}\n </div>\n {showValues && horizontal && (\n <span className={clsx('shrink-0 tabular-nums text-default-secondary', labelClass)}>\n {categoryTotals[ci]}\n </span>\n )}\n </div>\n\n {showLabels && !horizontal && (\n <span className={clsx('truncate text-center text-default-secondary', labelClass)}>{category}</span>\n )}\n </div>\n );\n })}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type DonutChartSize = 'sm' | 'md' | 'lg';\n\n/** Diameter and default ring thickness, in px. */\nconst SIZE: Record<DonutChartSize, { box: number; thickness: number }> = {\n sm: { box: 88, thickness: 10 },\n md: { box: 128, thickness: 14 },\n lg: { box: 180, thickness: 20 },\n};\n\nexport interface DonutSegment {\n label: string;\n value: number;\n /** Token-backed colour. Falls back to the segment's position in the chart sequence. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n}\n\nexport interface DonutChartProps {\n segments: DonutSegment[];\n size?: DonutChartSize;\n /** Ring thickness in px. Overrides the `size` preset. */\n thickness?: number;\n /** Large text at the centre — a total, a percentage. */\n centerValue?: ReactNode;\n /** Caption beneath `centerValue`. */\n centerLabel?: ReactNode;\n /** Gap between segments, in degrees. */\n gap?: number;\n /** Accessible description. */\n label?: string;\n className?: string;\n}\n\n/**\n * A proportional ring.\n *\n * Drawn with `stroke-dasharray` on circles rather than arc paths: one element per\n * segment, no trigonometry, and the segments stay crisp at any thickness.\n */\nexport function DonutChart({\n segments,\n size = 'md',\n thickness,\n centerValue,\n centerLabel,\n gap = 2,\n label,\n className,\n}: DonutChartProps) {\n const { box, thickness: presetThickness } = SIZE[size];\n const ring = thickness ?? presetThickness;\n const radius = (box - ring) / 2;\n const circumference = 2 * Math.PI * radius;\n const total = segments.reduce((sum, s) => sum + Math.max(0, s.value), 0);\n\n // A gap is only meaningful between two or more visible segments.\n const visible = segments.filter((s) => s.value > 0);\n const gapLength = visible.length > 1 ? (gap / 360) * circumference : 0;\n\n let offset = 0;\n\n return (\n <div className={clsx('relative inline-flex shrink-0 items-center justify-center', className)}>\n <svg\n width={box}\n height={box}\n viewBox={`0 0 ${box} ${box}`}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n // -90° so the first segment starts at twelve o'clock rather than three.\n className=\"block -rotate-90\"\n >\n <circle cx={box / 2} cy={box / 2} r={radius} fill=\"none\" stroke={CHART_TRACK} strokeWidth={ring} />\n {total > 0 &&\n segments.map((segment, i) => {\n const fraction = Math.max(0, segment.value) / total;\n const length = Math.max(0, fraction * circumference - gapLength);\n const dash = `${length} ${circumference - length}`;\n const thisOffset = offset;\n offset += fraction * circumference;\n if (segment.value <= 0) return null;\n return (\n <circle\n key={segment.label}\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={resolveChartColor(segment.color, segment.tone, i)}\n strokeWidth={ring}\n strokeDasharray={dash}\n strokeDashoffset={-thisOffset}\n strokeLinecap=\"butt\"\n />\n );\n })}\n </svg>\n {(centerValue != null || centerLabel != null) && (\n <div className=\"absolute inset-0 flex flex-col items-center justify-center text-center\">\n {centerValue != null && (\n <span className=\"text-subheading-sm font-bold leading-none text-default\">{centerValue}</span>\n )}\n {centerLabel != null && (\n <span className=\"mt-0.5 text-body-tiny text-default-secondary\">{centerLabel}</span>\n )}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type RadialGaugeSize = 'sm' | 'md' | 'lg';\n\nconst SIZE: Record<RadialGaugeSize, { box: number; thickness: number; value: string }> = {\n sm: { box: 72, thickness: 8, value: 'text-body-sm' },\n md: { box: 104, thickness: 11, value: 'text-subheading-sm' },\n lg: { box: 148, thickness: 15, value: 'text-subheading' },\n};\n\nexport interface RadialGaugeProps {\n value: number;\n /** Top of the scale. */\n max?: number;\n size?: RadialGaugeSize;\n tone?: ChartTone;\n color?: string;\n /** Ring thickness in px. Overrides the `size` preset. */\n thickness?: number;\n /**\n * Sweep in degrees. 360 is a full ring; 270 leaves a gap at the bottom, which reads\n * more like a dial than a pie.\n */\n sweep?: number;\n /** Centre content. Defaults to the value; pass `null` for an empty ring. */\n children?: ReactNode;\n /** Caption beneath the centre value. */\n centerLabel?: ReactNode;\n label?: string;\n className?: string;\n}\n\n/**\n * A single-value arc — a score ring, a utilisation dial, a completion meter.\n *\n * The shape the library had no form for: `ProgressBar` covers linear progress and\n * `DonutChart` compares parts of a whole, but neither draws \"one number against its\n * ceiling\" in a round frame.\n */\nexport function RadialGauge({\n value,\n max = 100,\n size = 'md',\n tone = 'brand',\n color,\n thickness,\n sweep = 270,\n children,\n centerLabel,\n label,\n className,\n}: RadialGaugeProps) {\n const preset = SIZE[size];\n const box = preset.box;\n const ring = thickness ?? preset.thickness;\n const radius = (box - ring) / 2;\n const circumference = 2 * Math.PI * radius;\n\n const clampedSweep = Math.min(360, Math.max(1, sweep));\n const arc = (clampedSweep / 360) * circumference;\n const fraction = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;\n const stroke = resolveChartColor(color, tone);\n\n // Rotate so the arc is centred on twelve o'clock: -90° puts the start at the top,\n // then half the unswept remainder brings it back round.\n const rotation = -90 + (360 - clampedSweep) / 2;\n\n return (\n <div className={clsx('relative inline-flex shrink-0 items-center justify-center', className)}>\n <svg\n width={box}\n height={box}\n viewBox={`0 0 ${box} ${box}`}\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className=\"block\"\n style={{ transform: `rotate(${rotation}deg)` }}\n >\n <circle\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={CHART_TRACK}\n strokeWidth={ring}\n strokeDasharray={`${arc} ${circumference - arc}`}\n strokeLinecap=\"round\"\n />\n <circle\n cx={box / 2}\n cy={box / 2}\n r={radius}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={ring}\n strokeDasharray={`${arc * fraction} ${circumference - arc * fraction}`}\n strokeLinecap=\"round\"\n className=\"transition-all\"\n />\n </svg>\n <div className=\"absolute inset-0 flex flex-col items-center justify-center text-center\">\n {children === undefined ? (\n <span className={clsx('font-bold leading-none text-default', preset.value)}>{value}</span>\n ) : (\n children\n )}\n {centerLabel != null && (\n <span className=\"mt-0.5 text-body-tiny text-default-secondary\">{centerLabel}</span>\n )}\n </div>\n </div>\n );\n}\n","import { useId } from 'react';\nimport clsx from 'clsx';\nimport { CHART_TONE, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type SparklineVariant = 'line' | 'area';\nexport type SparklineSize = 'sm' | 'md' | 'lg';\n\n/** Size presets, so callers stop passing bare pixel pairs. */\nconst SIZE: Record<SparklineSize, { width: number; height: number }> = {\n sm: { width: 80, height: 24 },\n md: { width: 120, height: 36 },\n lg: { width: 200, height: 56 },\n};\n\nexport interface SparklineProps {\n data: number[];\n variant?: SparklineVariant;\n /** Token-backed colour. Ignored when `color` is set. */\n tone?: ChartTone;\n /** Explicit colour, for series whose colour comes from the data. */\n color?: string;\n size?: SparklineSize;\n /** Overrides the `size` preset. */\n width?: number;\n height?: number;\n strokeWidth?: number;\n /** Dot on the final point — useful when the line is the \"current value\". */\n showEndDot?: boolean;\n /**\n * Stretch to fill the container instead of drawing at a fixed pixel size.\n *\n * The `size` preset still sets the viewBox, so it decides the sampling density; the SVG then\n * scales to the box it is given. Stroke width is held constant with `non-scaling-stroke`,\n * without which a non-uniform stretch would thin the line on one axis and thicken it on the\n * other.\n */\n fill?: boolean;\n /** Accessible description. Omit to keep the chart decorative. */\n label?: string;\n className?: string;\n}\n\n/**\n * A compact trend line, with no axes and no interaction.\n *\n * `variant=\"area\"` adds the gradient fill beneath the line that 0.2.0 had no way to\n * draw, which is what makes a sparkline readable at `lg` where a bare 1.5px stroke\n * looks thin.\n */\nexport function Sparkline({\n data,\n variant = 'line',\n tone = 'brand',\n color,\n size = 'md',\n width,\n height,\n strokeWidth = 1.5,\n showEndDot = false,\n fill: stretch = false,\n label,\n className,\n}: SparklineProps) {\n const gradientId = useId();\n if (data.length < 2) return null;\n\n const w = width ?? SIZE[size].width;\n const h = height ?? SIZE[size].height;\n const stroke = resolveChartColor(color, tone);\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n const pad = strokeWidth;\n const innerH = h - pad * 2;\n const innerW = w - pad * 2;\n\n const coords = data.map((v, i) => ({\n x: pad + (i / (data.length - 1)) * innerW,\n y: pad + innerH - ((v - min) / range) * innerH,\n }));\n const points = coords.map((p) => `${p.x.toFixed(2)},${p.y.toFixed(2)}`).join(' ');\n // Close the path down to the baseline so the fill has something to fill.\n const areaPath = `M ${points.split(' ').join(' L ')} L ${coords[coords.length - 1].x.toFixed(2)},${h} L ${coords[0].x.toFixed(2)},${h} Z`;\n const last = coords[coords.length - 1];\n\n return (\n <svg\n width={stretch ? undefined : w}\n height={stretch ? undefined : h}\n viewBox={`0 0 ${w} ${h}`}\n preserveAspectRatio={stretch ? 'none' : undefined}\n fill=\"none\"\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={clsx('block', stretch ? 'h-full w-full' : 'shrink-0', className)}\n >\n {variant === 'area' && (\n <>\n <defs>\n <linearGradient id={gradientId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={stroke} stopOpacity={0.24} />\n <stop offset=\"100%\" stopColor={stroke} stopOpacity={0} />\n </linearGradient>\n </defs>\n <path d={areaPath} fill={`url(#${gradientId})`} />\n </>\n )}\n <polyline\n points={points}\n stroke={stroke}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n // Holds the line at `strokeWidth` under a non-uniform stretch. Harmless when not\n // stretching, since the scale is 1:1 there.\n vectorEffect={stretch ? 'non-scaling-stroke' : undefined}\n fill=\"none\"\n />\n {showEndDot && (\n <circle\n cx={last.x}\n cy={last.y}\n // A stretched circle would become an ellipse, so the dot is drawn in viewBox units\n // and sized from the smaller axis to stay visually round enough at either extreme.\n r={strokeWidth * 1.6}\n fill={stroke}\n stroke={CHART_TONE.neutral}\n strokeWidth={0}\n />\n )}\n </svg>\n );\n}\n","import clsx from 'clsx';\nimport { CHART_TRACK, resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type MiniBarChartSize = 'sm' | 'md' | 'lg';\nexport type MiniBarChartOrientation = 'vertical' | 'horizontal';\n\nconst SIZE: Record<MiniBarChartSize, { width: number; height: number; gap: number }> = {\n sm: { width: 80, height: 32, gap: 2 },\n md: { width: 120, height: 48, gap: 3 },\n lg: { width: 200, height: 72, gap: 4 },\n};\n\nexport interface MiniBarChartProps {\n bars: number[];\n /** Colour of the highlighted bars. */\n tone?: ChartTone;\n color?: string;\n /** Colour of the un-highlighted bars. Defaults to the muted track token. */\n restColor?: string;\n /**\n * Which bars are highlighted. A number or list of indices; negatives count from the\n * end, so `-1` is the last bar. Pass `[]` to highlight none.\n *\n * Replaces 0.2.0's `highlightLastBar` boolean, which could only ever mean `-1`.\n */\n highlight?: number | number[];\n size?: MiniBarChartSize;\n /** Overrides the `size` preset. */\n width?: number;\n height?: number;\n gap?: number;\n orientation?: MiniBarChartOrientation;\n radius?: number;\n /**\n * Stretch to fill the container instead of drawing at a fixed pixel size.\n *\n * The `size` preset still sets the viewBox, so it decides the bar-to-gap proportions; the\n * SVG then scales to whatever box it is given. Without this a widget body could only hold a\n * chart at a hardcoded width, which stops being the right width as soon as the widget\n * reflows.\n */\n fill?: boolean;\n label?: string;\n className?: string;\n}\n\n/** A compact bar series with no axes — a distribution or a per-period count. */\nexport function MiniBarChart({\n bars,\n tone = 'brand',\n color,\n restColor = CHART_TRACK,\n highlight = -1,\n size = 'md',\n width,\n height,\n gap,\n orientation = 'vertical',\n radius = 2,\n fill: stretch = false,\n label,\n className,\n}: MiniBarChartProps) {\n if (bars.length === 0) return null;\n\n const preset = SIZE[size];\n const w = width ?? preset.width;\n const h = height ?? preset.height;\n const g = gap ?? preset.gap;\n const fill = resolveChartColor(color, tone);\n\n const highlighted = new Set(\n (Array.isArray(highlight) ? highlight : [highlight]).map((i) => (i < 0 ? bars.length + i : i)),\n );\n\n const max = Math.max(...bars) || 1;\n const vertical = orientation === 'vertical';\n // The cross-axis is divided between bars; the value axis carries the magnitude.\n const span = vertical ? w : h;\n const extent = vertical ? h : w;\n const barThickness = (span - g * (bars.length - 1)) / bars.length;\n\n return (\n <svg\n width={stretch ? undefined : w}\n height={stretch ? undefined : h}\n viewBox={`0 0 ${w} ${h}`}\n // `none` so the bars fill the box on both axes rather than letterboxing inside it —\n // there is no geometry here whose aspect ratio has to be preserved, only rectangles.\n preserveAspectRatio={stretch ? 'none' : undefined}\n fill=\"none\"\n role={label ? 'img' : undefined}\n aria-label={label}\n aria-hidden={label ? undefined : true}\n className={clsx('block', stretch ? 'h-full w-full' : 'shrink-0', className)}\n >\n {bars.map((v, i) => {\n const magnitude = Math.max(2, (v / max) * extent);\n const offset = i * (barThickness + g);\n return (\n <rect\n key={i}\n x={(vertical ? offset : 0).toFixed(2)}\n // Vertical bars grow up from the baseline; horizontal ones out from the left.\n y={(vertical ? extent - magnitude : offset).toFixed(2)}\n width={(vertical ? barThickness : magnitude).toFixed(2)}\n height={(vertical ? magnitude : barThickness).toFixed(2)}\n fill={highlighted.has(i) ? fill : restColor}\n rx={radius}\n />\n );\n })}\n </svg>\n );\n}\n","import clsx from 'clsx';\nimport { LegendDot, type LegendDotShape, type LegendDotSize } from './legend-dot';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type ChartLegendOrientation = 'vertical' | 'horizontal';\n\nexport interface ChartLegendItem {\n label: string;\n /** Trailing value. Omit for a legend that only names the series. */\n count?: number | string;\n /** Token-backed colour. Falls back to the item's position in the chart sequence. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n}\n\nexport interface ChartLegendProps {\n items: ChartLegendItem[];\n /**\n * `vertical` spreads each row to fill its container, so the counts align in a column\n * beside a donut. `horizontal` wraps inline, for a legend under a bar chart.\n */\n orientation?: ChartLegendOrientation;\n size?: LegendDotSize;\n shape?: LegendDotShape;\n className?: string;\n}\n\n/** Series names, swatches and optional values. */\nexport function ChartLegend({\n items,\n orientation = 'vertical',\n size = 'md',\n shape = 'dot',\n className,\n}: ChartLegendProps) {\n const horizontal = orientation === 'horizontal';\n\n return (\n <div\n className={clsx(\n horizontal ? 'flex flex-wrap items-center gap-x-4 gap-y-2' : 'flex flex-col gap-3',\n className,\n )}\n >\n {items.map((item, i) => (\n <div\n key={item.label}\n className={clsx('flex items-center gap-2', horizontal ? 'min-w-0' : 'justify-between')}\n >\n <div className=\"flex min-w-0 items-center gap-2\">\n {/* Resolved here, not in LegendDot, so the sequence fallback can use the\n item's position — matching how DonutChart colours its segments. */}\n <LegendDot color={resolveChartColor(item.color, item.tone, i)} size={size} shape={shape} />\n <span className=\"truncate text-body-xs text-default-secondary\">{item.label}</span>\n </div>\n {item.count != null && (\n <span className=\"shrink-0 text-body-xs font-semibold tabular-nums text-default\">{item.count}</span>\n )}\n </div>\n ))}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { resolveChartColor, type ChartTone } from './chart-tone';\n\nexport type LegendDotSize = 'sm' | 'md';\n/** `line` is the swatch for a line series; `dot` and `square` for areas and bars. */\nexport type LegendDotShape = 'dot' | 'square' | 'line';\n\nconst SHAPE: Record<LegendDotShape, Record<LegendDotSize, string>> = {\n dot: { sm: 'size-1.5 rounded-full', md: 'size-2 rounded-full' },\n square: { sm: 'size-1.5 rounded-[2px]', md: 'size-2 rounded-[3px]' },\n line: { sm: 'h-0.5 w-3 rounded-full', md: 'h-0.5 w-4 rounded-full' },\n};\n\nexport interface LegendDotProps {\n /** Token-backed colour. Ignored when `color` is set. */\n tone?: ChartTone;\n /** Explicit colour, for data-driven series. */\n color?: string;\n size?: LegendDotSize;\n shape?: LegendDotShape;\n className?: string;\n}\n\n/** The colour swatch beside a series name. */\nexport function LegendDot({ tone, color, size = 'md', shape = 'dot', className }: LegendDotProps) {\n return (\n <span\n className={clsx('inline-block shrink-0', SHAPE[shape][size], className)}\n style={{ backgroundColor: resolveChartColor(color, tone) }}\n aria-hidden\n />\n );\n}\n","import clsx from 'clsx';\nimport { LuTrendingDown, LuTrendingUp } from 'react-icons/lu';\n\nexport type TrendLabelWeight = 'semibold' | 'bold';\nexport type TrendLabelSize = 'sm' | 'md' | 'lg';\n/**\n * Which direction is the good one.\n *\n * A delta component cannot infer this: +4% on-time delivery is good, +4% unit cost is\n * not. 0.2.0 had no such prop, so the only way to render a \"rising is bad\" delta was to\n * pass a raw hex — which is exactly what the deleted `BenchmarkCard` did, inverting its\n * own `positiveColor` default to red to compensate.\n */\nexport type TrendDirection = 'up-is-good' | 'up-is-bad';\n\nconst SIZE: Record<TrendLabelSize, string> = {\n sm: 'text-body-xs',\n md: 'text-body-sm',\n lg: 'text-subheading-sm',\n};\n\nconst ICON_SIZE: Record<TrendLabelSize, string> = {\n sm: 'size-3',\n md: 'size-3.5',\n lg: 'size-4',\n};\n\nconst weightBySize: Record<TrendLabelSize, TrendLabelWeight> = {\n sm: 'semibold',\n md: 'semibold',\n lg: 'bold',\n};\n\nconst WEIGHT: Record<TrendLabelWeight, string> = {\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nexport interface TrendLabelProps {\n value: number;\n suffix?: string;\n size?: TrendLabelSize;\n weight?: TrendLabelWeight;\n direction?: TrendDirection;\n /** Trend arrow. On by default — the docs described one long before there was one. */\n showArrow?: boolean;\n /** Explicit colour, for the rare data-driven case. Overrides the direction logic. */\n color?: string;\n className?: string;\n}\n\n/** A signed delta with a direction arrow, toned by whether the movement is good news. */\nexport function TrendLabel({\n value,\n suffix = '%',\n size = 'md',\n weight,\n direction = 'up-is-good',\n showArrow = true,\n color,\n className,\n}: TrendLabelProps) {\n const rising = value > 0;\n // Zero is neither good nor bad. 0.2.0 rendered it as a green \"+0%\".\n const flat = value === 0;\n const good = direction === 'up-is-good' ? rising : !rising;\n const Arrow = rising ? LuTrendingUp : LuTrendingDown;\n\n return (\n <span\n className={clsx(\n 'inline-flex items-center gap-1 whitespace-nowrap',\n SIZE[size],\n WEIGHT[weight ?? weightBySize[size]],\n !color && (flat ? 'text-default-secondary' : good ? 'text-positive' : 'text-danger'),\n className,\n )}\n style={color ? { color } : undefined}\n >\n {showArrow && !flat && <Arrow className={clsx('shrink-0', ICON_SIZE[size])} aria-hidden />}\n {rising ? '+' : ''}\n {value}\n {suffix}\n </span>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type ListRowDensity = 'default' | 'compact';\nexport type ListRowDivider = 'none' | 'top' | 'bottom';\n\nconst DENSITY: Record<ListRowDensity, { pad: string; gap: string; title: string; description: string }> = {\n default: {\n pad: 'py-4',\n gap: 'gap-3',\n title: 'text-body-sm font-semibold text-default',\n description: 'text-body-xs text-default-secondary',\n },\n compact: {\n pad: 'py-2.5',\n gap: 'gap-2',\n title: 'text-body-xs font-semibold text-default',\n description: 'text-body-tiny text-default-secondary',\n },\n};\n\nconst DIVIDER: Record<ListRowDivider, string> = {\n none: '',\n top: 'border-t border-default',\n bottom: 'border-b border-default',\n};\n\nexport interface ListRowProps {\n /** Left of the title, on the title line — an icon badge, avatar, checkbox, file chip. */\n leading?: ReactNode;\n title?: ReactNode;\n /** Inline after the title — a Required/Optional chip, a count, a tag. */\n titleMeta?: ReactNode;\n /** Muted line under the title. */\n description?: ReactNode;\n /** Right end of the title line — a `StatusBadge`, a score, a timestamp. */\n meta?: ReactNode;\n /** Right-hand column spanning the whole row, vertically centred — actions, a `Toggle`. */\n trailing?: ReactNode;\n /** Full-width block below the title line — a `FileRow`, a `FileDropZone`, an alert, a nested list. */\n footer?: ReactNode;\n density?: ListRowDensity;\n divider?: ListRowDivider;\n /** Render an `<li>` instead of a `<div>` — use inside a `<ul>`/`<ol>`. */\n as?: 'div' | 'li';\n onClick?: () => void;\n /**\n * Accessible name for a clickable row. Strongly recommended whenever `onClick` is set:\n * without it the name is the concatenation of every slot's text.\n */\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * The generic list row: six slots and no opinion about what goes in them.\n *\n * Replaces `DocumentRow` and `DocumentChecklistRow`, which baked one product's\n * document-upload flow — its status vocabulary, its five raw-hex pills and its\n * unicode-glyph labels — into the library. Every feature of those rows is reachable by\n * composing this with `FileRow`, `FileDropZone` and `StatusBadge`; see the docs.\n */\nexport function ListRow({\n leading,\n title,\n titleMeta,\n description,\n meta,\n trailing,\n footer,\n density = 'default',\n divider = 'none',\n as: Tag = 'div',\n onClick,\n 'aria-label': ariaLabel,\n className,\n}: ListRowProps) {\n const d = DENSITY[density];\n const hasTitleLine = Boolean(leading || title != null || titleMeta || meta);\n\n return (\n <Tag\n className={clsx(\n 'flex w-full items-start',\n d.pad,\n DIVIDER[divider],\n onClick &&\n 'cursor-pointer rounded-lg transition-colors hover:bg-default-secondary/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand',\n className,\n )}\n onClick={onClick}\n // Unlike a <tr>, a div/li has no conflicting implicit role, so button is correct here.\n role={onClick ? 'button' : undefined}\n // Without this the row's accessible name is the concatenation of everything inside\n // it — title, meta, description, footer and the label of any nested control.\n aria-label={onClick ? ariaLabel : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className={clsx('flex min-w-0 flex-1 flex-col', d.gap)}>\n {hasTitleLine && (\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n {leading}\n {title != null && <span className={clsx('truncate', d.title)}>{title}</span>}\n {titleMeta && <span className=\"shrink-0\">{titleMeta}</span>}\n </div>\n {meta && <span className=\"shrink-0\">{meta}</span>}\n </div>\n )}\n {description && <p className={d.description}>{description}</p>}\n {/* Both slots stop click and key propagation when the row itself is clickable.\n The JSDoc on `trailing` and `footer` advertises putting a `Toggle` or a\n `Button` in them, and through 0.3.0 activating that control fired the nested\n handler *and* the row's `onClick` — so toggling a switch also navigated. */}\n {footer && (\n // These two wrappers are propagation barriers, not controls — they add no\n // behaviour of their own and must not be focusable or take a role.\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div onClick={stopIfInteractive} onKeyDown={stopIfInteractive}>\n {footer}\n </div>\n )}\n </div>\n {trailing && (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n className=\"ml-3 flex shrink-0 items-center self-center\"\n onClick={stopIfInteractive}\n onKeyDown={stopIfInteractive}\n >\n {trailing}\n </div>\n )}\n </Tag>\n );\n}\n\n/**\n * Keeps an interaction with a nested control from also triggering the row.\n *\n * Note the remaining limitation: a focusable descendant inside `role=\"button\"` is invalid\n * ARIA regardless of propagation, so a row that is *itself* clickable and *also* contains\n * controls is a compromise. Prefer either a clickable row with static content, or a static\n * row whose title is its own button.\n */\nfunction stopIfInteractive(event: { stopPropagation: () => void }) {\n event.stopPropagation();\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface FileRowProps {\n name: string;\n /** Muted second line — size, upload date, uploader. */\n detail?: ReactNode;\n /** Leading chip showing the file extension, e.g. `\"PDF\"`. Ignored when `leading` is set. */\n fileType?: string;\n /** Custom leading node — overrides `fileType`. */\n leading?: ReactNode;\n /** The canonical action. Renders a text link before `actions`. */\n onDownload?: () => void;\n downloadLabel?: string;\n /** Everything else on the right — `Button`s, a `DropdownMenu`. */\n actions?: ReactNode;\n className?: string;\n}\n\n/** The extension chip. Lifted unchanged from the deleted `DocumentRow`. */\nfunction FileTypeBadge({ type }: { type: string }) {\n return (\n <span className=\"flex size-[34px] shrink-0 items-center justify-center rounded-md bg-brand-tertiary text-body-tiny font-semibold text-brand\">\n {type}\n </span>\n );\n}\n\n/**\n * One attached file: name, optional detail line, and actions.\n *\n * This strip was hardcoded inline inside both `DocumentRow` and\n * `DocumentChecklistRow`. Nothing about it is document-specific — it is the same row\n * for a generated export, an invoice or an evidence attachment.\n */\nexport function FileRow({\n name,\n detail,\n fileType,\n leading,\n onDownload,\n downloadLabel = 'Download',\n actions,\n className,\n}: FileRowProps) {\n const lead = leading ?? (fileType ? <FileTypeBadge type={fileType} /> : null);\n\n return (\n <div\n className={clsx(\n 'flex items-center gap-3 rounded-lg border border-default bg-default px-3 py-2.5',\n className,\n )}\n >\n {lead}\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"truncate text-body-sm font-medium text-default\">{name}</span>\n {detail && <span className=\"text-body-xs text-default-secondary\">{detail}</span>}\n </div>\n {(onDownload || actions) && (\n <div className=\"flex shrink-0 items-center gap-3\">\n {onDownload && (\n <button\n type=\"button\"\n onClick={onDownload}\n className=\"text-body-xs font-medium text-brand hover:underline\"\n >\n {downloadLabel}\n </button>\n )}\n {actions}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type ScoredRowAlign = 'center' | 'end';\n/** 8 / 12 / 20 / 48px — the four gaps the source mockups actually used. */\nexport type ScoredRowGap = 'sm' | 'md' | 'lg' | 'xl';\n\nconst GAP: Record<ScoredRowGap, string> = {\n sm: 'gap-2',\n md: 'gap-3',\n lg: 'gap-5',\n xl: 'gap-12',\n};\n\nconst ALIGN: Record<ScoredRowAlign, string> = {\n center: 'items-center',\n end: 'items-end',\n};\n\nexport interface ScoredRowProps {\n /** Leading visual — an `EntityIconBadge`, an `Avatar`, a rank number, or nothing. */\n leading?: ReactNode;\n title: ReactNode;\n subtitle?: ReactNode;\n /** Fixed-width column between the title block and the meter. */\n aside?: ReactNode;\n /** The bar. Put a `<ProgressBar>` here — the row does not choose one for you. */\n meter?: ReactNode;\n /** Right-hand value — a `<ScoreValue>`, a `<TrendLabel>`, a `<Badge>`, a button. */\n trailing?: ReactNode;\n /** CSS width values. Omit one and that slot flexes instead. */\n titleWidth?: string;\n asideWidth?: string;\n meterWidth?: string;\n trailingWidth?: string;\n gap?: ScoredRowGap;\n /** Gap between `leading` and the title block. Defaults to `gap`. */\n leadingGap?: ScoredRowGap;\n align?: ScoredRowAlign;\n className?: string;\n}\n\n/**\n * A row with a title block, an optional bar and a right-hand value.\n *\n * Was `EntityRow`. The rename is the smaller half of the change: the old component\n * hardcoded `RiskScore`, `WidgetProgressBar`, `TrendLabel` and `getRiskTone`, which\n * locked it to one scoring domain and forced 32 props — including four raw\n * `CSSProperties` escape hatches and a magic `nameWidth = '133px'` — to make it fit\n * anything else. The score and the bar are now slots, so the caller decides.\n */\nexport function ScoredRow({\n leading,\n title,\n subtitle,\n aside,\n meter,\n trailing,\n titleWidth,\n asideWidth,\n meterWidth,\n trailingWidth,\n gap = 'md',\n leadingGap,\n align = 'center',\n className,\n}: ScoredRowProps) {\n return (\n <div className={clsx('flex w-full', ALIGN[align], GAP[gap], className)}>\n <div\n className={clsx(\n 'flex min-w-0',\n ALIGN[align],\n GAP[leadingGap ?? gap],\n titleWidth ? 'shrink-0' : 'flex-1',\n )}\n style={titleWidth ? { width: titleWidth } : undefined}\n >\n {leading}\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-body-sm font-medium leading-none text-default\">{title}</p>\n {subtitle && <p className=\"mt-0.5 truncate text-body-xs text-default-secondary\">{subtitle}</p>}\n </div>\n </div>\n\n {aside && (\n <div\n className={clsx('min-w-0', asideWidth ? 'shrink-0' : 'flex-1')}\n style={asideWidth ? { width: asideWidth } : undefined}\n >\n {aside}\n </div>\n )}\n\n {meter && (\n <div\n className={clsx('min-w-0', meterWidth ? 'shrink-0' : 'flex-1')}\n style={meterWidth ? { width: meterWidth } : undefined}\n >\n {meter}\n </div>\n )}\n\n {trailing && (\n <div className=\"shrink-0 text-right\" style={trailingWidth ? { width: trailingWidth } : undefined}>\n {trailing}\n </div>\n )}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { ProgressBar } from '../feedback/progress-bar';\nimport type { ProgressBarTone } from '../feedback/progress-bar';\nimport { ScoreValue, getScoreTone } from '../stats/score-value';\nimport type { ScoreDirection, ScoreValueSize, ScoreValueWeight } from '../stats/score-value';\n\nexport interface NumberedListItem {\n title: string;\n /** Second line under the title — a region, a category, an id. */\n subtitle?: string;\n score: number;\n /** Bar and value colour for this row. `auto` derives it from `score`. */\n tone?: ProgressBarTone | 'auto';\n}\n\nexport type NumberedListGap = 'sm' | 'md';\n\nexport interface NumberedListProps {\n items: NumberedListItem[];\n /** Which end of the scale is bad, for rows resolving `tone` automatically. */\n direction?: ScoreDirection;\n scoreSize?: ScoreValueSize;\n scoreWeight?: ScoreValueWeight;\n /** First ordinal. Set it to continue a list across a page boundary. */\n startAt?: number;\n gap?: NumberedListGap;\n className?: string;\n}\n\nconst GAP: Record<NumberedListGap, string> = {\n sm: 'gap-2',\n md: 'gap-3',\n};\n\n/**\n * A ranked leaderboard: ordinal, title, score, and a full-width bar under each row.\n *\n * Was `RankedRow`, which was one row and made the caller supply both the `<ol>` and every\n * `rank` by hand — so a filtered or re-sorted list silently kept stale numbers. Owning the\n * list means the ordinal is derived from position and cannot disagree with the order on\n * screen. It also puts it at the same granularity as `StepsList`, its neighbour.\n *\n * It still hardcodes `ProgressBar` and `ScoreValue`, and that is the point: a leaderboard\n * row *is* those three things. Where the pieces need to vary, reach for `ScoredRow`, whose\n * slots take arbitrary content.\n */\nexport function NumberedList({\n items,\n direction = 'higher-is-worse',\n scoreSize = 'md',\n scoreWeight = 'bold',\n startAt = 1,\n gap = 'md',\n className,\n}: NumberedListProps) {\n return (\n <ol className={clsx('flex list-none flex-col p-0', GAP[gap], className)}>\n {items.map((item, index) => {\n const tone =\n !item.tone || item.tone === 'auto'\n ? getScoreTone(item.score, { direction })\n : item.tone;\n\n return (\n <li key={`${item.title}-${index}`} className=\"flex w-full shrink-0 flex-col gap-1.5\">\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"flex min-w-0 items-center gap-2.5\">\n {/* Fixed width so the titles align whether the ordinal is 1 or 10. */}\n <span className=\"w-[14px] shrink-0 text-body-xs font-bold text-default-secondary\">\n {startAt + index}\n </span>\n <div className=\"flex min-w-0 flex-col gap-px\">\n <span className=\"truncate text-body-sm font-medium leading-none text-default\">\n {item.title}\n </span>\n {item.subtitle && (\n <span className=\"text-body-tiny text-default-tertiary\">{item.subtitle}</span>\n )}\n </div>\n </div>\n <ScoreValue\n value={item.score}\n size={scoreSize}\n weight={scoreWeight}\n tone={tone}\n className=\"ml-2 shrink-0\"\n />\n </div>\n <ProgressBar value={item.score} tone={tone} aria-label={`${item.title} score`} />\n </li>\n );\n })}\n </ol>\n );\n}\n","import { useId } from 'react';\nimport { cn } from '../../lib/cn';\n\nexport type ProgressBarTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';\nexport type ProgressBarSize = 'xs' | 'sm' | 'md' | 'lg';\n\n/** 4 / 6 / 8 / 12px. `sm` is 0.2.0's only height, and stays the default. */\nconst SIZE: Record<ProgressBarSize, string> = {\n xs: 'h-1',\n sm: 'h-1.5',\n md: 'h-2',\n lg: 'h-3',\n};\n\nconst FILL: Record<ProgressBarTone, string> = {\n brand: 'bg-brand',\n positive: 'bg-positive',\n warning: 'bg-warning',\n danger: 'bg-danger',\n neutral: 'bg-neutral',\n};\n\nexport interface ProgressBarProps {\n /** 0–100. Values outside the range are clamped. */\n value: number;\n tone?: ProgressBarTone;\n size?: ProgressBarSize;\n /** Caption above the bar. Also becomes the accessible name. */\n label?: string;\n /** Show the percentage at the right of the label row. */\n showValue?: boolean;\n /** CSS radius override, e.g. `'1px'` for a square-ended bar. Defaults to fully round. */\n radius?: string;\n /** Accessible name when there is no visible `label`. */\n 'aria-label'?: string;\n /**\n * Applied to the track. This is how you set a fixed width — `className=\"w-16\"`.\n * It genuinely overrides the base `w-full` because this file uses `cn`.\n */\n className?: string;\n}\n\n/**\n * A horizontal progress / proportion bar.\n *\n * Was `WidgetProgressBar` in 0.2.0, which fixed the height at 6px and lived under\n * `widgets/` despite being a general-purpose primitive — so `TableCellProgress`\n * hand-rolled a second copy rather than reuse it. It also had no ARIA at all.\n */\nexport function ProgressBar({\n value,\n tone = 'brand',\n size = 'sm',\n label,\n showValue = false,\n radius,\n 'aria-label': ariaLabel,\n className,\n}: ProgressBarProps) {\n const clamped = Math.min(100, Math.max(0, value));\n const rounded = radius ? undefined : 'rounded-full';\n const labelId = useId();\n\n const track = (\n <div\n role=\"progressbar\"\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n // The doc comment on `label` promised it \"also becomes the accessible name\", and\n // through 0.3.0 it did the opposite: setting `label` *suppressed* `aria-label` while\n // the caption rendered as an unlabelled sibling `<span>` with no id, so\n // `<ProgressBar label=\"Risk score\" />` produced a progressbar with no name at all.\n aria-labelledby={label ? labelId : undefined}\n aria-label={label ? undefined : ariaLabel}\n className={cn('w-full overflow-hidden bg-default-tertiary', SIZE[size], rounded, className)}\n style={radius ? { borderRadius: radius } : undefined}\n >\n <div\n className={cn('h-full transition-all', rounded, FILL[tone])}\n style={{ width: `${clamped}%`, ...(radius ? { borderRadius: radius } : undefined) }}\n />\n </div>\n );\n\n // No caption row means no wrapper — the bar must stay a direct child of whatever\n // laid it out, so a parent's `flex-1` or grid placement still applies to it.\n if (!label && !showValue) return track;\n\n return (\n <div>\n <div className=\"mb-1.5 flex items-center justify-between gap-2\">\n {label && (\n <span id={labelId} className=\"text-body-xs text-default-secondary\">\n {label}\n </span>\n )}\n {showValue && (\n <span className=\"ml-auto text-body-xs font-medium tabular-nums text-default\">\n {Math.round(clamped)}%\n </span>\n )}\n </div>\n {track}\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface IconTextRowProps {\n icon: ReactNode;\n title: string;\n detail: string;\n className?: string;\n}\n\n/**\n * A circular icon badge, a title, and one line of detail.\n *\n * Feature lists, empty-state explanations, onboarding intros, \"what happens next\"\n * steps. Was `FeatureRow`, which named it after the one screen it was extracted from.\n */\nexport function IconTextRow({ icon, title, detail, className }: IconTextRowProps) {\n return (\n <div className={clsx('flex items-start gap-3', className)}>\n <span className=\"flex size-9 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-brand\">\n {icon}\n </span>\n <div className=\"min-w-0\">\n <p className=\"text-body-sm font-semibold text-default\">{title}</p>\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{detail}</p>\n </div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuCheck } from 'react-icons/lu';\n\nexport type ChecklistRowState = 'done' | 'active' | 'pending';\n\nexport interface ChecklistRowProps {\n label: string;\n state: ChecklistRowState;\n className?: string;\n}\n\n/**\n * One step in a progress checklist: a done tick, a spinning active ring, or an empty\n * pending ring.\n *\n * Shared by the event-onboarding \"building your dashboard\" screen and the\n * intelligence page's processing checklist. Both drove the same three states; only\n * the onboarding copy had the animated ring, which is the better treatment and is\n * adopted for both.\n *\n * Renders an `<li>` — callers must wrap it in a list, which is what both sources did.\n */\nexport function ChecklistRow({ label, state, className }: ChecklistRowProps) {\n return (\n <li className={clsx('flex items-center gap-3', className)}>\n <span className=\"flex size-5 shrink-0 items-center justify-center\">\n {state === 'done' ? (\n <LuCheck className=\"size-4 text-positive\" strokeWidth={2.5} aria-hidden />\n ) : (\n <span\n className={clsx(\n 'size-3.5 rounded-full border-2',\n state === 'active'\n ? 'animate-pulse border-brand-emphasis border-t-transparent'\n : 'border-disabled',\n )}\n />\n )}\n </span>\n <span\n className={clsx(\n 'text-body-sm',\n state === 'pending' ? 'text-default-tertiary' : 'font-semibold text-default',\n )}\n >\n {label}\n </span>\n </li>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface StepsListProps {\n steps: ReactNode[];\n className?: string;\n}\n\n/**\n * Ordered list of instructions with small filled number bullets.\n *\n * Was `NumberedStepsList`. Renamed in 0.5.0 because `NumberedList` — the ranked\n * leaderboard — also numbers its rows, and two components whose names both led with\n * \"Numbered\" gave no hint which was which. The distinction is what the numbers *mean*:\n * here they are sequence (\"do this, then this\"), there they are rank.\n *\n * The bullet was `bg-[#e7edfb] text-[#1d4ed8]` — a pale blue pair that is not in the\n * token set. It now uses the brand-tertiary background and brand text, which is the\n * documented treatment for a subtle brand-tinted chip.\n */\nexport function StepsList({ steps, className }: StepsListProps) {\n return (\n <ol className={clsx('flex flex-col gap-1.5', className)}>\n {steps.map((step, i) => (\n // `text-[12px]` was off the type scale; 12 sits midway between Scale 01 (11) and\n // Scale 02 (13), so it rounds up to 13 like every other snap in this pass.\n <li key={i} className=\"flex items-start gap-2 text-body-xs text-default\">\n <span className=\"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-brand-tertiary text-[9px] font-bold text-brand\">\n {i + 1}\n </span>\n {step}\n </li>\n ))}\n </ol>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type DetailItemLayout = 'stacked' | 'inline';\nexport type DetailItemSpan = 1 | 2 | 'full';\n\nexport interface DetailItemProps {\n label: string;\n value: ReactNode;\n /** Optional second line under the value. */\n detail?: ReactNode;\n /**\n * `stacked` puts the label above the value (detail pages, review summaries).\n * `inline` puts a fixed-width label beside it (drawer detail rows).\n */\n layout?: DetailItemLayout;\n /**\n * Columns to occupy inside a `DetailGrid`. `full` spans the row — for a long value\n * such as an alias list or a legal name that would otherwise truncate.\n */\n span?: DetailItemSpan;\n /**\n * Label column width for the `inline` layout. A `min-w`/`max-w` pair rather than a\n * fixed `w-`, so a long label wraps instead of colliding with the value.\n */\n labelWidth?: string;\n className?: string;\n}\n\nconst SPAN: Record<DetailItemSpan, string> = {\n 1: '',\n 2: 'sm:col-span-2',\n full: 'col-span-full',\n};\n\n/**\n * A label/value pair.\n *\n * Was `MetaField` — an internal codename that said nothing about the shape. Consolidates\n * the same pair from six places: an entity-detail overview grid, a reviewer-detail metric\n * column, three `DetailRow` copies in drawers, and `ReviewMeta` in two onboarding wizards.\n *\n * An empty value renders an em dash, which is what every source copy did by hand. Note\n * that the check is for `null`/`undefined`/`''` only — `0` and `false` are real values and\n * render as themselves.\n */\nexport function DetailItem({\n label,\n value,\n detail,\n layout = 'stacked',\n span = 1,\n labelWidth = 'min-w-[96px] max-w-[140px]',\n className,\n}: DetailItemProps) {\n const shown = value === null || value === undefined || value === '' ? '—' : value;\n\n if (layout === 'inline') {\n return (\n <div className={clsx('flex gap-3 text-body-xs', SPAN[span], className)}>\n <span className={clsx('shrink-0 text-default-secondary', labelWidth)}>{label}</span>\n {/* `detail` used to be dropped silently in this branch. */}\n <span className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"text-default\">{shown}</span>\n {detail && <span className=\"text-default-secondary\">{detail}</span>}\n </span>\n </div>\n );\n }\n\n return (\n <div className={clsx('flex min-w-0 flex-col gap-0.5', SPAN[span], className)}>\n <p className=\"text-body-tiny font-medium text-default-secondary\">{label}</p>\n <p className=\"text-body-sm font-medium text-default\">{shown}</p>\n {detail && <p className=\"text-body-xs text-default-secondary\">{detail}</p>}\n </div>\n );\n}\n\nexport type DetailGridColumns = 2 | 3 | 4 | 'auto';\n\nexport interface DetailGridProps {\n children: ReactNode;\n columns?: DetailGridColumns;\n className?: string;\n}\n\nconst COLUMNS: Record<DetailGridColumns, string> = {\n // Fills the row whatever its width, and reflows to fewer columns as it narrows.\n auto: 'grid-cols-[repeat(auto-fit,minmax(180px,1fr))]',\n 2: 'grid-cols-1 sm:grid-cols-2',\n 3: 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3',\n 4: 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-4',\n};\n\n/**\n * Wrapper for a set of `DetailItem`s.\n *\n * A real grid, not the `flex flex-wrap` it was as `MetaFieldGrid`. Under flex-wrap every\n * item had to carry its own width (`sm:w-[262px]` was the documented idiom) and whatever\n * space was left over at the end of a row stayed empty — so a three-item row in a wide\n * card had a ragged gap on the right. `1fr` tracks divide the row exactly, and an item\n * that genuinely needs more room asks for it with `span` instead of a magic width.\n */\nexport function DetailGrid({ children, columns = 'auto', className }: DetailGridProps) {\n return (\n <div className={clsx('grid gap-x-4 gap-y-4', COLUMNS[columns], className)}>{children}</div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { LuCheck } from 'react-icons/lu';\n\nexport type CheckedGroupListColumns = 1 | 2 | 3;\n\n/** One labelled group of ticked items. */\nexport interface CheckedGroup {\n label: string;\n items: string[];\n}\n\nexport interface CheckedGroupListProps {\n groups: CheckedGroup[];\n columns?: CheckedGroupListColumns;\n /** Leading glyph for every item. Defaults to a check; pass `null` for none. */\n icon?: ReactNode | null;\n emptyLabel?: string;\n className?: string;\n}\n\nconst COLUMNS: Record<CheckedGroupListColumns, string> = {\n 1: 'columns-1',\n 2: 'columns-2',\n 3: 'columns-3',\n};\n\n/**\n * A read-only, grouped list of ticked items in a balanced multi-column flow.\n *\n * Was `PermissionGrid` — RBAC-specific naming for a generic shape, and not a grid\n * either: groups pack tightly down each column rather than aligning to shared row\n * heights, so a tall group beside a short one leaves no ragged gap.\n * `break-inside-avoid` keeps each group whole within a column.\n *\n * Granted permissions, included plan features, completed requirements, matched\n * criteria — anything that is \"these labels, grouped, all ticked\".\n */\nexport function CheckedGroupList({\n groups,\n columns = 2,\n icon,\n emptyLabel = 'None.',\n className,\n}: CheckedGroupListProps) {\n if (groups.length === 0) {\n return <p className={clsx('text-body-xs text-default-secondary', className)}>{emptyLabel}</p>;\n }\n\n // `undefined` means \"not passed\" → default check. `null` means \"explicitly none\".\n const glyph = icon === undefined ? <LuCheck className=\"size-3.5\" strokeWidth={2.5} aria-hidden /> : icon;\n\n return (\n <div className={clsx(COLUMNS[columns], 'gap-x-6', className)}>\n {groups.map((group) => (\n <div key={group.label} className=\"mb-5 break-inside-avoid last:mb-0\">\n <p className=\"mb-2 text-body-tiny font-semibold uppercase tracking-wide text-default-secondary\">\n {group.label}\n </p>\n <ul className=\"space-y-1.5\">\n {group.items.map((item) => (\n <li key={item} className=\"flex items-center gap-2 text-body-xs text-default\">\n {glyph && <span className=\"shrink-0\">{glyph}</span>}\n {item}\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n );\n}\n","import { forwardRef, type HTMLAttributes, type TdHTMLAttributes, type ThHTMLAttributes } from 'react';\nimport clsx from 'clsx';\nimport { LuChevronDown, LuChevronsUpDown, LuChevronUp } from 'react-icons/lu';\nimport { cn } from '../../lib/cn';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\n\nexport type TableDensity = 'default' | 'compact';\nexport type TableSortDirection = 'ascending' | 'descending';\n\n/**\n * The composable table primitive, matching Figma's `Table` and `Table cell`.\n *\n * `DataTable` is the config-driven form — you give it `columns` and `rows` and it renders\n * everything. It is the right tool most of the time, and it is not going away. But it\n * cannot express a grouped header, a footer row, a colspan, or a cell layout outside its\n * `render` signature, so anything unusual meant abandoning it for a hand-rolled `<table>`\n * with none of the semantics. These parts are that escape hatch with the semantics kept.\n *\n * Figma's `Table cell` has a 32-value `Style` axis (lead checkbox, lead avatar, badges\n * multiple, trend positive/negative, action icons, star ratings, payment method…). Those\n * are *compositions*, not variants of one component — each is an existing library\n * component dropped into a cell — so they are expressed here as `TableCell` plus whatever\n * goes inside it, rather than 32 props.\n */\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {\n /** Names the table. Required unless you render a `TableCaption`. */\n label?: string;\n density?: TableDensity;\n /** Equal-width columns driven by `<colgroup>`, matching `DataTable`. Default `false`. */\n fixed?: boolean;\n}\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { label, density = 'default', fixed = false, className, children, ...rest },\n ref,\n) {\n return (\n // The scroll container is separate from the table so the header stays inside the\n // scrolling region — a table that is its own scroll container cannot have a sticky\n // header.\n // The scroll wrapper is required for a <table>, which cannot itself scroll, so this\n // takes the scrollbar styling rather than ScrollArea.\n <div className={clsx('w-full overflow-x-auto', SCROLLBAR_CLASSES)}>\n <table\n ref={ref}\n aria-label={label}\n data-slot=\"table\"\n data-density={density}\n className={cn('w-full border-collapse', fixed && 'table-fixed', className)}\n {...rest}\n >\n {children}\n </table>\n </div>\n );\n});\n\nexport interface TableCaptionProps extends HTMLAttributes<HTMLTableCaptionElement> {}\n\n/**\n * A visible table title that also names the table. Prefer this over `label` when the\n * heading is on screen anyway — `DataTable` could not be named at all before 0.4.0.\n */\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, TableCaptionProps>(\n function TableCaption({ className, ...rest }, ref) {\n return (\n <caption\n ref={ref}\n className={cn('px-4 py-3 text-left text-body-sm text-default-secondary', className)}\n {...rest}\n />\n );\n },\n);\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableHeader({ className, ...rest }, ref) {\n return <thead ref={ref} className={cn('border-b border-default', className)} {...rest} />;\n },\n);\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableBody({ className, ...rest }, ref) {\n return <tbody ref={ref} className={className} {...rest} />;\n },\n);\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, HTMLAttributes<HTMLTableSectionElement>>(\n function TableFooter({ className, ...rest }, ref) {\n return (\n <tfoot\n ref={ref}\n className={cn('border-t border-default bg-default-secondary font-medium', className)}\n {...rest}\n />\n );\n },\n);\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n selected?: boolean;\n}\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow(\n { selected, className, ...rest },\n ref,\n) {\n return (\n <tr\n ref={ref}\n // `aria-selected` only when selection is actually in play — on a row that is not\n // part of a selectable set it is meaningless noise.\n aria-selected={selected}\n data-state={selected ? 'selected' : undefined}\n className={cn(\n 'border-b border-default last:border-b-0 transition-colors',\n selected ? 'bg-brand-tertiary' : 'hover:bg-default-secondary/50',\n className,\n )}\n {...rest}\n />\n );\n});\n\nexport interface TableHeadProps extends ThHTMLAttributes<HTMLTableCellElement> {\n /**\n * Makes the header a sort control. `false` means sortable but not currently sorted.\n *\n * `aria-sort` goes on the `<th>` and must be present on exactly one column at a time —\n * it is the only non-visual signal of sort state, and `DataTable` had none.\n */\n sort?: TableSortDirection | false;\n onSort?: () => void;\n align?: 'left' | 'center' | 'right';\n /** Keeps the header visible while the body scrolls. */\n sticky?: boolean;\n}\n\nconst ALIGN = { left: 'text-left', center: 'text-center', right: 'text-right' } as const;\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead(\n { sort, onSort, align = 'left', sticky = false, className, children, ...rest },\n ref,\n) {\n const sortable = sort !== undefined && onSort !== undefined;\n\n return (\n <th\n ref={ref}\n // `scope=\"col\"` is what ties every cell beneath to this header when a screen reader\n // reads a cell out of context.\n scope=\"col\"\n aria-sort={sort === undefined ? undefined : sort === false ? 'none' : sort}\n className={cn(\n 'px-4 py-3 text-body-xs font-semibold text-default-secondary',\n ALIGN[align],\n sticky && 'sticky top-0 z-raised bg-default',\n className,\n )}\n {...rest}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={onSort}\n className={clsx(\n 'inline-flex items-center gap-1.5 rounded transition-colors hover:text-default',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default',\n )}\n >\n {children}\n {sort === false ? (\n <LuChevronsUpDown aria-hidden className=\"size-3.5 opacity-50\" />\n ) : sort === 'ascending' ? (\n <LuChevronUp aria-hidden className=\"size-3.5\" />\n ) : (\n <LuChevronDown aria-hidden className=\"size-3.5\" />\n )}\n </button>\n ) : (\n children\n )}\n </th>\n );\n});\n\nexport interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {\n align?: 'left' | 'center' | 'right';\n /** Vertical rhythm. Matches `DataTable`'s `density`. */\n density?: TableDensity;\n /** Makes this the row's header cell — `scope=\"row\"`, for a table with row headers. */\n header?: boolean;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { align = 'left', density = 'default', header = false, className, ...rest },\n ref,\n) {\n const Tag = header ? 'th' : 'td';\n return (\n <Tag\n ref={ref as never}\n scope={header ? 'row' : undefined}\n className={cn(\n density === 'compact' ? 'px-4 py-2' : 'px-4 py-3',\n 'text-body-sm text-default',\n header && 'font-medium',\n ALIGN[align],\n className,\n )}\n {...rest}\n />\n );\n});\n","import clsx from 'clsx';\nimport type { Key, ReactNode } from 'react';\nimport { SCROLLBAR_CLASSES } from '../../lib/scrollbar';\nimport { ProgressBar } from '../feedback/progress-bar';\nimport type { ProgressBarTone } from '../feedback/progress-bar';\n\n// ── Column definition ──────────────────────────────────────────────────────────\n\nexport interface ColumnDef<T> {\n key: string;\n header: string;\n /**\n * CSS width value — e.g. `\"320px\"`, `\"10rem\"`. When `grow` is true this becomes the\n * column's floor: it counts toward the table's min-width, below which the wrapper\n * scrolls sideways rather than crushing the columns.\n */\n width: string;\n /**\n * When true the column absorbs the remaining table width.\n *\n * With no `grow` column, `table-fixed` distributes surplus width proportionally\n * across every column — the old flex layout left it blank on the right instead. Mark\n * whichever column should soak it up.\n */\n grow?: boolean;\n render: (row: T) => ReactNode;\n}\n\n// ── Density ────────────────────────────────────────────────────────────────────\n\nexport type DataTableDensity = 'default' | 'compact';\nexport type DataTableAlign = 'center' | 'top';\n\n/**\n * `default` is 0.2.0's spacing verbatim — ten call sites depend on it.\n *\n * `compact` is the audit / AI-widget density: an 11px semibold uppercase header over\n * 13px cells, which are `text-body-tiny` and `text-body-xs` exactly, so the type sizes\n * come across unchanged and only the padding really moves.\n */\nconst DENSITY: Record<DataTableDensity, { headerCell: string; headerText: string; bodyCell: string }> = {\n default: {\n headerCell: 'px-4 py-3',\n headerText: 'text-body-xs font-medium text-default-secondary whitespace-nowrap',\n bodyCell: 'px-4 py-[14px]',\n },\n compact: {\n headerCell: 'px-3 py-2',\n headerText:\n 'text-body-tiny font-semibold uppercase tracking-[0.4px] text-default-secondary whitespace-nowrap',\n bodyCell: 'px-3 py-2 text-body-xs text-default',\n },\n};\n\nconst ALIGN: Record<DataTableAlign, string> = {\n center: 'align-middle',\n top: 'align-top',\n};\n\n// ── DataTable ──────────────────────────────────────────────────────────────────\n\nexport interface DataTableProps<T> {\n columns: ColumnDef<T>[];\n rows: T[];\n getRowKey: (row: T, index: number) => Key;\n /** Row and header padding. `compact` also steps the header and cell type down. */\n density?: DataTableDensity;\n /** Vertical alignment of every body cell. Use `top` for multi-line or ragged cells. */\n align?: DataTableAlign;\n onRowClick?: (row: T) => void;\n /** Rendered as one full-width row when `rows` is empty. Omit to render nothing. */\n emptyLabel?: string;\n className?: string;\n}\n\n/**\n * A real `<table>` with `table-fixed` and a `<colgroup>`.\n *\n * 0.2.0 laid each row out as its own flex container sized `w-max`, so a `grow` column\n * sized itself per row and one long cell shunted that row's remaining columns out of\n * line with its neighbours. `table-fixed` resolves column widths once for the whole\n * table, which is the property the consuming app hand-rolled a separate audit table\n * to get.\n */\nexport function DataTable<T,>({\n columns,\n rows,\n getRowKey,\n density = 'default',\n align = 'center',\n onRowClick,\n emptyLabel,\n className,\n}: DataTableProps<T>) {\n const d = DENSITY[density];\n // Summed as a CSS expression rather than parsed as px, so any unit the caller used\n // (px, rem, ch) still yields a correct floor.\n const minWidth = columns.length ? `calc(${columns.map((c) => c.width).join(' + ')})` : undefined;\n\n return (\n <div className={clsx(// A wrapper element here is load-bearing for the table layout, and the rows are\n // focusable when clickable, so this takes the scrollbar styling rather than ScrollArea.\n clsx('overflow-x-auto rounded-xl border border-default bg-default', SCROLLBAR_CLASSES), className)}>\n <table className=\"w-full table-fixed border-collapse text-left\" style={{ minWidth }}>\n <colgroup>\n {columns.map((col) => (\n // A grow column gets no width, so table-fixed hands it the leftover space.\n // Its floor is already counted in the table's min-width.\n <col key={col.key} style={col.grow ? undefined : { width: col.width }} />\n ))}\n </colgroup>\n <thead>\n <tr className=\"bg-default-secondary\">\n {columns.map((col) => (\n <th key={col.key} scope=\"col\" className={clsx('overflow-hidden', d.headerCell, d.headerText)}>\n {col.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0\n ? emptyLabel && (\n <tr>\n <td\n colSpan={columns.length}\n className={clsx(d.bodyCell, 'text-center text-body-sm text-default-secondary')}\n >\n {emptyLabel}\n </td>\n </tr>\n )\n : rows.map((row, i) => (\n <tr\n key={getRowKey(row, i)}\n className={clsx(\n 'transition-colors hover:bg-default-secondary/50',\n i > 0 && 'border-t border-default',\n // outline, not ring: `ring-*` compiles to box-shadow, which browsers\n // do not paint on a <tr> under border-collapse: collapse.\n onRowClick &&\n 'cursor-pointer outline-none focus-visible:outline focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-brand',\n )}\n // Deliberately no role=\"button\" — it would override the implicit\n // role=\"row\" and detach every row from the table's accessibility\n // tree. The <th scope>/<td> markup supplies the real roles for free.\n tabIndex={onRowClick ? 0 : undefined}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n onKeyDown={\n onRowClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onRowClick(row);\n }\n }\n : undefined\n }\n >\n {columns.map((col) => (\n <td key={col.key} className={clsx('overflow-hidden', d.bodyCell, ALIGN[align])}>\n {col.render(row)}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\n// ── Cell components ────────────────────────────────────────────────────────────\n\n/**\n * Cell type scale.\n *\n * Named `size`, not `density`, and deliberately *not* inherited from the table: the two\n * real compact tables disagree about the mapping — the audit table wants default\n * padding with small cell text — so inheritance could not express it anyway, and it\n * would make these render one size inside a table and another outside one.\n */\nexport type TableCellSize = 'sm' | 'md';\n\nexport interface TableCellLeadTextProps {\n primary: string;\n secondary?: string;\n size?: TableCellSize;\n className?: string;\n}\n\n/** Primary text plus an optional muted subtitle — for lead entity/name cells. */\nexport function TableCellLeadText({ primary, secondary, size = 'md', className }: TableCellLeadTextProps) {\n return (\n <div className={clsx('flex flex-col gap-0.5', className)}>\n <span\n className={clsx(\n 'font-medium leading-snug text-default',\n size === 'sm' ? 'text-body-xs' : 'text-body-sm',\n )}\n >\n {primary}\n </span>\n {secondary && (\n <span\n className={clsx(\n 'font-normal leading-tight text-default-secondary',\n size === 'sm' ? 'text-body-tiny' : 'text-body-xs',\n )}\n >\n {secondary}\n </span>\n )}\n </div>\n );\n}\n\nexport interface TableCellTextProps {\n children: ReactNode;\n /** Muted (secondary) by default; pass false for the primary colour. */\n muted?: boolean;\n size?: TableCellSize;\n /** Ellipsise instead of wrapping, so every row keeps the same height. */\n truncate?: boolean;\n className?: string;\n}\n\n/** Plain text cell. */\nexport function TableCellText({\n children,\n muted = true,\n size = 'md',\n truncate = false,\n className,\n}: TableCellTextProps) {\n return (\n <span\n className={clsx(\n 'font-normal leading-snug',\n size === 'sm' ? 'text-body-tiny' : 'text-body-xs',\n truncate ? 'block truncate' : 'whitespace-nowrap',\n muted ? 'text-default-secondary' : 'text-default',\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\nexport interface TableCellBadgeProps {\n label: string;\n className?: string;\n}\n\n/** Small outlined chip — entity type labels, categories. */\nexport function TableCellBadge({ label, className }: TableCellBadgeProps) {\n return (\n <span\n className={clsx(\n 'inline-flex items-center rounded-md border border-default bg-default-secondary px-2 py-0.5 text-body-tiny font-medium text-default-secondary whitespace-nowrap',\n className,\n )}\n >\n {label}\n </span>\n );\n}\n\nexport interface TableCellProgressProps {\n percent: number;\n /**\n * Bar colour. `brand` is 0.2.0's default and byte-identical to it — `bg-brand`\n * resolves to the same `--prim-brand-900` the old raw-hex default hardcoded.\n */\n tone?: ProgressBarTone;\n size?: TableCellSize;\n className?: string;\n}\n\n/** Mini progress bar with a percentage label below. */\nexport function TableCellProgress({\n percent,\n tone = 'brand',\n size = 'md',\n className,\n}: TableCellProgressProps) {\n const clamped = Math.min(100, Math.max(0, percent));\n return (\n <div className={clsx('flex flex-col gap-1', className)}>\n {/* Delegates to ProgressBar rather than hand-rolling a second bar, which is what\n 0.2.0 did — the two then disagreed on the track colour. */}\n <ProgressBar\n value={clamped}\n tone={tone}\n size=\"sm\"\n // `size` used to drive the label's font size, which was `text-[10px]` — off the type\n // scale, whose smallest step is 11px. The label is now `text-body-tiny` at both\n // sizes, so `size` drives the bar's width instead: 48 / 64px, both on the Space ramp.\n className={size === 'sm' ? 'w-12' : 'w-16'}\n aria-label={`${clamped}%`}\n />\n <span className=\"text-body-tiny leading-none text-default-secondary\">\n {percent}%\n </span>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuCircleCheckBig, LuInfo, LuTriangleAlert } from 'react-icons/lu';\n\nexport type InlineAlertTone = 'info' | 'warning' | 'danger' | 'positive';\n\nexport interface InlineAlertProps {\n tone: InlineAlertTone;\n children: ReactNode;\n /** Overrides the per-tone default glyph. Pass `null` for no icon. */\n icon?: ReactNode | null;\n className?: string;\n}\n\nconst toneStyles: Record<InlineAlertTone, string> = {\n info: 'border-brand-tertiary bg-brand-tertiary text-brand',\n warning: 'border-warning-tertiary bg-warning-tertiary text-warning',\n danger: 'border-danger-tertiary bg-danger-tertiary text-danger',\n positive: 'border-positive-tertiary bg-positive-tertiary text-positive',\n};\n\nconst toneIcons: Record<InlineAlertTone, ReactNode> = {\n info: <LuInfo className=\"size-4\" />,\n warning: <LuTriangleAlert className=\"size-4\" />,\n danger: <LuTriangleAlert className=\"size-4\" />,\n positive: <LuCircleCheckBig className=\"size-4\" />,\n};\n\n/** Banner for inline messaging — form errors, destructive-action warnings, success confirmations.\n *\n * Replaces four byte-identical raw-`amber-*` callouts, five competing error-text styles and a\n * standalone `Banner` component. `danger` renders as `role=\"alert\"`; the rest as `role=\"status\"`. */\nexport function InlineAlert({ tone, children, icon, className }: InlineAlertProps) {\n const glyph = icon === undefined ? toneIcons[tone] : icon;\n\n return (\n <div\n role={tone === 'danger' ? 'alert' : 'status'}\n className={clsx(\n 'flex items-start gap-3 rounded-xl border p-4 text-body-xs',\n toneStyles[tone],\n className,\n )}\n >\n {/* The glyph restates the tone the text already carries, so it is decoration —\n `react-icons` adds no `aria-hidden` of its own (verified in its `iconBase`), so\n without this the SVG lands in the a11y tree of a `role=\"alert\"` region. */}\n {glyph && (\n <span aria-hidden className=\"mt-px shrink-0\">\n {glyph}\n </span>\n )}\n <div className=\"min-w-0\">{children}</div>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport type EmptyStateVariant = 'empty' | 'loading' | 'error';\nexport type EmptyStateSize = 'sm' | 'md' | 'lg';\n\n/**\n * Vertical padding. The eighteen source copies used `py-8`, with divergent siblings\n * at `py-10`, `py-12` and `py-16` — these three sizes absorb all four.\n */\nconst SIZES: Record<EmptyStateSize, string> = {\n sm: 'py-8',\n md: 'py-12',\n lg: 'py-16',\n};\n\nconst TONES: Record<EmptyStateVariant, string> = {\n empty: 'text-default-secondary',\n loading: 'text-default-secondary',\n error: 'text-danger',\n};\n\nexport interface EmptyStateProps {\n message: string;\n /** `error` is the only variant that changes colour; `loading` exists for intent. */\n variant?: EmptyStateVariant;\n size?: EmptyStateSize;\n icon?: ReactNode;\n /** A primary action, e.g. \"Add your first source\". */\n action?: ReactNode;\n className?: string;\n}\n\n/**\n * Centred placeholder for an empty list, a loading list, or a failed fetch.\n *\n * Replaces eighteen copies of `py-8 text-center text-body-sm\n * text-default-secondary` plus four divergent variants. Loading and empty were\n * always the same markup in this codebase, so they are one component with a\n * `variant` rather than two near-identical ones.\n *\n * `aria-live` is set for the loading and error variants so a screen reader announces\n * the state change instead of silently swapping list content.\n */\nexport function EmptyState({\n message,\n variant = 'empty',\n size = 'sm',\n icon,\n action,\n className,\n}: EmptyStateProps) {\n return (\n <div\n className={clsx(\n 'flex flex-col items-center justify-center gap-2 px-4 text-center text-body-sm',\n SIZES[size],\n TONES[variant],\n className,\n )}\n aria-live={variant === 'empty' ? undefined : 'polite'}\n >\n {icon && <span className=\"text-default-tertiary\">{icon}</span>}\n <p>{message}</p>\n {action}\n </div>\n );\n}\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport clsx from 'clsx';\n\nexport type SkeletonShape = 'line' | 'block' | 'circle';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n shape?: SkeletonShape;\n /** Number of stacked lines. Only meaningful for `line`. */\n lines?: number;\n}\n\nconst SHAPE: Record<SkeletonShape, string> = {\n line: 'h-4 rounded',\n block: 'h-full w-full rounded-lg',\n circle: 'aspect-square rounded-full',\n};\n\n/**\n * Loading placeholder.\n *\n * `aria-hidden` and no role: a skeleton is a picture of content that does not exist yet,\n * so announcing it produces a burst of meaningless nodes. The *region* it sits in should\n * carry the loading state — `EmptyState variant=\"loading\"` or `aria-busy` on the\n * container — which is a decision only the caller can make.\n *\n * The pulse is suppressed by the preset's `prefers-reduced-motion` rule, leaving a plain\n * tinted block.\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { shape = 'line', lines = 1, className, ...rest },\n ref,\n) {\n if (shape === 'line' && lines > 1) {\n return (\n <div ref={ref} aria-hidden data-slot=\"skeleton-group\" className=\"flex flex-col gap-2\" {...rest}>\n {Array.from({ length: lines }, (_, index) => (\n <div\n key={index}\n className={clsx(\n 'animate-pulse bg-default-tertiary',\n SHAPE.line,\n // A ragged last line reads as a paragraph rather than a solid slab.\n index === lines - 1 ? 'w-3/5' : 'w-full',\n className,\n )}\n />\n ))}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n aria-hidden\n data-slot=\"skeleton\"\n className={clsx('animate-pulse bg-default-tertiary', SHAPE[shape], className)}\n {...rest}\n />\n );\n});\n","import { forwardRef, useId, type HTMLAttributes, type ReactNode } from 'react';\nimport clsx from 'clsx';\nimport { LuCircleCheckBig, LuInfo, LuTriangleAlert, LuX } from 'react-icons/lu';\nimport { IconButton } from '../forms/icon-button';\nimport type { InlineAlertTone } from './inline-alert';\n\nexport type BannerVariant = 'message' | 'alert';\n\n// `title` is omitted from the base attributes because the HTML `title` attribute is a\n// string that renders a native tooltip — the same collision that made 0.2.0's\n// `Modal.title` become `Modal.label`. Here the prop is the more useful one, so the\n// attribute gives way.\nexport interface BannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Bold first line. Matches Figma's `Title`. */\n title: ReactNode;\n /** Supporting copy. Matches Figma's `Body`. */\n children?: ReactNode;\n /**\n * Matches Figma's `Variant` axis. `message` is informational; `alert` is urgent and is\n * announced immediately.\n */\n variant?: BannerVariant;\n tone?: InlineAlertTone;\n /** Replaces the tone glyph. Pass `null` to suppress it. Matches `Icon` / `Has Icon`. */\n icon?: ReactNode | null;\n /** Trailing action slot. Matches `Has Button`. */\n action?: ReactNode;\n /** Renders a dismiss button. Matches `Dismissible`. */\n onDismiss?: () => void;\n}\n\nconst TONE_STYLES: Record<InlineAlertTone, string> = {\n info: 'border-brand-tertiary bg-brand-tertiary text-default',\n positive: 'border-positive-tertiary bg-positive-tertiary text-default',\n warning: 'border-warning-tertiary bg-warning-tertiary text-default',\n danger: 'border-danger-tertiary bg-danger-tertiary text-default',\n};\n\nconst TONE_ICON_COLOR: Record<InlineAlertTone, string> = {\n info: 'text-icon-brand',\n positive: 'text-icon-positive',\n warning: 'text-icon-warning',\n danger: 'text-icon-danger',\n};\n\nconst TONE_ICON: Record<InlineAlertTone, ReactNode> = {\n info: <LuInfo aria-hidden className=\"size-5\" />,\n positive: <LuCircleCheckBig aria-hidden className=\"size-5\" />,\n warning: <LuTriangleAlert aria-hidden className=\"size-5\" />,\n danger: <LuTriangleAlert aria-hidden className=\"size-5\" />,\n};\n\n/**\n * A page- or section-level banner with a title, body, optional action and optional dismiss.\n *\n * This is Figma's `Notification` set (`Variant: Message | Alert`, with `Title`, `Body`,\n * `Has Icon`, `Has Button` and `Dismissible`). Worth being precise about the name: its\n * Figma keywords are \"message, alert, feedback, callout, banner\" — it is a *persistent,\n * in-flow* notice, **not** a toast. A toast is transient, stacked, and announced from a\n * live region that already exists; that is `Toast`, and it is a different component.\n *\n * `InlineAlert` remains the compact single-line form for use inside a form or a card.\n * `Banner` is the one with a heading and an action.\n *\n * `variant` drives the announcement, not just the styling: `alert` is `role=\"alert\"`\n * (interrupts), `message` is `role=\"status\"` (waits its turn).\n */\nexport const Banner = forwardRef<HTMLDivElement, BannerProps>(function Banner(\n {\n title,\n children,\n variant = 'message',\n tone = 'info',\n icon,\n action,\n onDismiss,\n className,\n ...rest\n },\n ref,\n) {\n const titleId = useId();\n const glyph = icon === undefined ? TONE_ICON[tone] : icon;\n\n return (\n <div\n ref={ref}\n role={variant === 'alert' ? 'alert' : 'status'}\n aria-labelledby={titleId}\n data-slot=\"banner\"\n className={clsx(\n 'flex w-full items-start gap-3 rounded-xl border p-4',\n TONE_STYLES[tone],\n className,\n )}\n {...rest}\n >\n {glyph && (\n <span aria-hidden className={clsx('mt-px shrink-0', TONE_ICON_COLOR[tone])}>\n {glyph}\n </span>\n )}\n <div className=\"min-w-0 flex-1\">\n <p id={titleId} className=\"text-body-sm font-semibold text-default\">\n {title}\n </p>\n {children && <div className=\"mt-1 text-body-xs text-default-secondary\">{children}</div>}\n {action && <div className=\"mt-3 flex items-center gap-2\">{action}</div>}\n </div>\n {onDismiss && (\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n // Named with the title, so several stacked banners do not all announce\n // \"Dismiss\" identically.\n aria-label={typeof title === 'string' ? `Dismiss: ${title}` : 'Dismiss'}\n onClick={onDismiss}\n className=\"-mr-1 -mt-1 shrink-0\"\n >\n <LuX aria-hidden size={16} />\n </IconButton>\n )}\n </div>\n );\n});\n","import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react';\nimport clsx from 'clsx';\nimport { LuCircleCheckBig, LuInfo, LuTriangleAlert, LuX } from 'react-icons/lu';\nimport { IconButton } from '../forms/icon-button';\nimport { Portal } from '../overlays/portal';\nimport type { InlineAlertTone } from './inline-alert';\n\nexport type ToastTone = InlineAlertTone;\nexport type ToasterPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\nexport interface ToastOptions {\n title: ReactNode;\n description?: ReactNode;\n tone?: ToastTone;\n /** Milliseconds before auto-dismiss. `0` keeps it until dismissed. Default `5000`. */\n duration?: number;\n action?: ReactNode;\n}\n\nexport interface ToastRecord extends ToastOptions {\n id: string;\n}\n\ninterface ToastContextValue {\n toast: (options: ToastOptions) => string;\n dismiss: (id: string) => void;\n dismissAll: () => void;\n}\n\nconst ToastContext = createContext<ToastContextValue | null>(null);\n\n/**\n * Queue a toast. Must be called under a `<Toaster>`.\n *\n * Returns the toast's id so a long-running action can dismiss its own \"Saving…\" toast when\n * it finishes.\n */\nexport function useToast(): ToastContextValue {\n const context = useContext(ToastContext);\n if (!context) throw new Error('useToast() must be used inside <Toaster>');\n return context;\n}\n\nconst TONE_ICON: Record<ToastTone, ReactNode> = {\n info: <LuInfo aria-hidden className=\"size-4\" />,\n positive: <LuCircleCheckBig aria-hidden className=\"size-4\" />,\n warning: <LuTriangleAlert aria-hidden className=\"size-4\" />,\n danger: <LuTriangleAlert aria-hidden className=\"size-4\" />,\n};\n\nconst TONE_ICON_COLOR: Record<ToastTone, string> = {\n info: 'text-icon-brand',\n positive: 'text-icon-positive',\n warning: 'text-icon-warning',\n danger: 'text-icon-danger',\n};\n\nconst POSITION: Record<ToasterPosition, string> = {\n 'top-left': 'top-4 left-4 items-start',\n 'top-center': 'top-4 left-1/2 -translate-x-1/2 items-center',\n 'top-right': 'top-4 right-4 items-end',\n 'bottom-left': 'bottom-4 left-4 items-start',\n 'bottom-center': 'bottom-4 left-1/2 -translate-x-1/2 items-center',\n 'bottom-right': 'bottom-4 right-4 items-end',\n};\n\nexport interface ToasterProps {\n children: ReactNode;\n position?: ToasterPosition;\n /** Maximum simultaneous toasts. Oldest are dropped first. Default `4`. */\n max?: number;\n /** Default auto-dismiss for toasts that do not set their own. Default `5000`. */\n duration?: number;\n}\n\n/**\n * Provider plus the region toasts render into. Mount once, near the app root.\n *\n * The library had no toast and — more importantly — **no persistent live region at all**,\n * so nothing could announce an event that happened away from focus. The distinction that\n * matters here: a live region must already exist in the DOM before content is put into it.\n * A region that mounts at the same moment as its message is frequently not announced,\n * which is why the wrapper below renders unconditionally and only its children come and go.\n *\n * `aria-live=\"polite\"` on the container, and `role=\"alert\"` on individual `danger` toasts\n * so a failure interrupts rather than queueing behind a success message.\n */\nexport function Toaster({\n children,\n position = 'bottom-right',\n max = 4,\n duration = 5000,\n}: ToasterProps) {\n const [toasts, setToasts] = useState<ToastRecord[]>([]);\n const timers = useRef(new Map<string, ReturnType<typeof setTimeout>>());\n const counter = useRef(0);\n\n const dismiss = useCallback((id: string) => {\n const timer = timers.current.get(id);\n if (timer) {\n clearTimeout(timer);\n timers.current.delete(id);\n }\n setToasts((current) => current.filter((entry) => entry.id !== id));\n }, []);\n\n const dismissAll = useCallback(() => {\n for (const timer of timers.current.values()) clearTimeout(timer);\n timers.current.clear();\n setToasts([]);\n }, []);\n\n const toast = useCallback(\n (options: ToastOptions) => {\n // A monotonic counter rather than a random id: `Math.random()` in a render-adjacent\n // path is a hydration hazard, and the value only has to be unique within the session.\n counter.current += 1;\n const id = `toast-${counter.current}`;\n const record: ToastRecord = { tone: 'info', duration, ...options, id };\n\n setToasts((current) => [...current, record].slice(-max));\n\n if (record.duration && record.duration > 0) {\n timers.current.set(\n id,\n setTimeout(() => dismiss(id), record.duration),\n );\n }\n return id;\n },\n [duration, max, dismiss],\n );\n\n useEffect(() => {\n const map = timers.current;\n return () => {\n for (const timer of map.values()) clearTimeout(timer);\n map.clear();\n };\n }, []);\n\n const context = useMemo(() => ({ toast, dismiss, dismissAll }), [toast, dismiss, dismissAll]);\n\n return (\n <ToastContext.Provider value={context}>\n {children}\n <Portal>\n <div\n // Unconditionally rendered, and empty most of the time. See the note above: a\n // live region has to pre-exist its content to be announced reliably.\n aria-live=\"polite\"\n aria-atomic=\"false\"\n className={clsx(\n 'pointer-events-none fixed z-toast flex w-full max-w-[380px] flex-col gap-2',\n POSITION[position],\n )}\n >\n {toasts.map((entry) => (\n <ToastItem key={entry.id} toast={entry} onDismiss={() => dismiss(entry.id)} />\n ))}\n </div>\n </Portal>\n </ToastContext.Provider>\n );\n}\n\nfunction ToastItem({ toast, onDismiss }: { toast: ToastRecord; onDismiss: () => void }) {\n const tone = toast.tone ?? 'info';\n\n return (\n <div\n // The container is polite; a danger toast escalates to assertive so a failure is not\n // read out after two successes.\n role={tone === 'danger' ? 'alert' : 'status'}\n // Re-enabled per toast — the container is pointer-events-none so it never blocks\n // clicks on the page behind an empty region.\n className={clsx(\n 'pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-default',\n 'bg-default p-4 shadow-400',\n )}\n >\n <span aria-hidden className={clsx('mt-px shrink-0', TONE_ICON_COLOR[tone])}>\n {TONE_ICON[tone]}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-body-sm font-semibold text-default\">{toast.title}</p>\n {toast.description && (\n <p className=\"mt-0.5 text-body-xs text-default-secondary\">{toast.description}</p>\n )}\n {toast.action && <div className=\"mt-2 flex items-center gap-2\">{toast.action}</div>}\n </div>\n <IconButton\n variant=\"subtle\"\n size=\"sm\"\n aria-label={typeof toast.title === 'string' ? `Dismiss: ${toast.title}` : 'Dismiss'}\n onClick={onDismiss}\n className=\"-mr-1 -mt-1 shrink-0\"\n >\n <LuX aria-hidden size={14} />\n </IconButton>\n </div>\n );\n}\n","import { forwardRef, useState } from 'react';\nimport { LuEye, LuEyeOff } from 'react-icons/lu';\n\nimport { Input, type InputProps } from './input';\n\nexport type PasswordInputProps = Omit<InputProps, 'type' | 'trailingIcon' | 'trailingAction'>;\n\n/** Password field with a show/hide visibility toggle. */\nexport const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(function PasswordInput(props, ref) {\n const [visible, setVisible] = useState(false);\n\n return (\n <Input\n ref={ref}\n {...props}\n type={visible ? 'text' : 'password'}\n trailingAction={\n <button\n type=\"button\"\n aria-label={visible ? 'Hide password' : 'Show password'}\n onClick={() => setVisible((v) => !v)}\n className=\"flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand\"\n >\n {visible ? (\n <LuEyeOff aria-hidden className=\"size-4\" />\n ) : (\n <LuEye aria-hidden className=\"size-4\" />\n )}\n </button>\n }\n />\n );\n});\n","import clsx from 'clsx';\nimport { LuArrowRight, LuSearch } from 'react-icons/lu';\n\nexport interface AIChatBarProps {\n placeholder?: string;\n className?: string;\n}\n\nexport function AIChatBar({\n placeholder = 'Ask Intelligence about any entity, supplier, or risk…',\n className,\n}: AIChatBarProps) {\n return (\n <div\n className={clsx(\n 'flex h-16 items-center gap-3 rounded-2xl border border-default bg-default px-6 shadow-panel',\n className,\n )}\n >\n <span aria-hidden className=\"shrink-0 text-icon-default-secondary\">\n <LuSearch className=\"size-4\" />\n </span>\n <p className=\"flex-1 text-body-sm text-default-tertiary truncate\">{placeholder}</p>\n <button\n type=\"button\"\n className=\"inline-flex shrink-0 items-center gap-2 rounded-xl bg-brand px-4 py-3 text-body-sm font-semibold text-brand-on-brand hover:bg-brand-hover transition-colors\"\n >\n Ask\n <LuArrowRight aria-hidden className=\"size-4\" />\n </button>\n </div>\n );\n}\n","import clsx from 'clsx';\nimport { LuArrowRight, LuCpu } from 'react-icons/lu';\n\nexport interface AISuggestionChipProps {\n prompt: string;\n onClick?: () => void;\n className?: string;\n}\n\nexport function AISuggestionChip({ prompt, onClick, className }: AISuggestionChipProps) {\n return (\n <button\n type=\"button\"\n onClick={onClick}\n className={clsx(\n 'flex h-12 w-full items-center gap-3 rounded-xl border border-default bg-default px-3 text-left hover:bg-default-hover transition-colors',\n className,\n )}\n >\n <span aria-hidden className=\"shrink-0 text-icon-brand\">\n <LuCpu className=\"size-4\" />\n </span>\n <span className=\"flex-1 text-body-sm text-default truncate\">{prompt}</span>\n <span aria-hidden className=\"shrink-0 text-icon-default-secondary\">\n <LuArrowRight className=\"size-3.5\" strokeWidth={2.5} />\n </span>\n </button>\n );\n}\n","import clsx from 'clsx';\nimport { TagPill } from '../status/tag-pill';\n\nexport interface QuickAction {\n label: string;\n value: string;\n}\n\nexport interface QuickActionsBarProps {\n actions: QuickAction[];\n active?: string;\n onSelect?: (value: string) => void;\n className?: string;\n}\n\nexport function QuickActionsBar({ actions, active, onSelect, className }: QuickActionsBarProps) {\n return (\n <div className={clsx('flex flex-wrap items-center gap-3', className)}>\n {actions.map((action) => {\n const isActive = active === action.value;\n return (\n <button\n key={action.value}\n type=\"button\"\n // `aria-pressed` because these are toggles, not navigation — through 0.3.0 the\n // `active` prop was conveyed by the pill's fill colour only.\n aria-pressed={isActive}\n onClick={() => onSelect?.(action.value)}\n // Was `focus:outline-none` with no replacement — the UA indicator removed and\n // nothing put back, a straight WCAG 2.4.7 failure.\n className=\"rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default\"\n >\n <TagPill label={action.label} tone={isActive ? 'brand' : 'default'} />\n </button>\n );\n })}\n </div>\n );\n}\n","/** Soft aurora atmosphere used by the public-facing screens (auth, event\n * onboarding) — mirrors AuroraBackground in pages/intelligence. Blobs are\n * corner-anchored so the effect scales from phones to kiosk displays.\n * Render inside a `relative overflow-hidden` container; content goes on top\n * with `relative`. */\nexport function AuroraBackdrop() {\n return (\n <div className=\"pointer-events-none absolute inset-0\" aria-hidden>\n <div className=\"absolute -left-24 -top-28\" style={{ width: 380, height: 380, background: 'radial-gradient(ellipse, rgba(249,133,133,0.45) 0%, transparent 70%)' }} />\n <div className=\"absolute -top-24 right-[-4%]\" style={{ width: 320, height: 320, background: 'radial-gradient(ellipse, rgba(254,160,160,0.4) 0%, transparent 70%)' }} />\n <div className=\"absolute bottom-[-10%] right-[14%]\" style={{ width: 420, height: 420, background: 'radial-gradient(ellipse, rgba(196,181,253,0.3) 0%, transparent 70%)' }} />\n <div className=\"absolute bottom-[-6%] left-[4%]\" style={{ width: 280, height: 280, background: 'radial-gradient(ellipse, rgba(147,197,253,0.25) 0%, transparent 70%)' }} />\n <div className=\"absolute left-[20%] top-[30%]\" style={{ width: 240, height: 240, background: 'radial-gradient(ellipse, rgba(173,216,255,0.18) 0%, transparent 70%)' }} />\n </div>\n );\n}\n"],"mappings":";AAAC,SAAS,cAAAA,mBAA6D;AACvE,OAAOC,WAAU;;;ACDjB;AAAA,EACE;AAAA,EACA;AAAA,EACA;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AA;AAFG,SAAS,iBAAiB;AAC/B,SACE,gBAAAA,OAAC,SAAI,WAAU,wCAAuC,eAAW,MAC/D;AAAA,oBAAAD,OAAC,SAAI,WAAU,6BAA4B,OAAO,EAAE,OAAO,KAAK,QAAQ,KAAK,YAAY,uEAAuE,GAAG;AAAA,IACnK,gBAAAA,OAAC,SAAI,WAAU,gCAA+B,OAAO,EAAE,OAAO,KAAK,QAAQ,KAAK,YAAY,sEAAsE,GAAG;AAAA,IACrK,gBAAAA,OAAC,SAAI,WAAU,sCAAqC,OAAO,EAAE,OAAO,KAAK,QAAQ,KAAK,YAAY,sEAAsE,GAAG;AAAA,IAC3K,gBAAAA,OAAC,SAAI,WAAU,mCAAkC,OAAO,EAAE,OAAO,KAAK,QAAQ,KAAK,YAAY,uEAAuE,GAAG;AAAA,IACzK,gBAAAA,OAAC,SAAI,WAAU,iCAAgC,OAAO,EAAE,OAAO,KAAK,QAAQ,KAAK,YAAY,uEAAuE,GAAG;AAAA,KACzK;AAEJ;","names":["forwardRef","clsx","Slot","forwardRef","clsx","Spinner","size","jsx","size","jsx","clsx","forwardRef","Button","size","forwardRef","clsx","jsx","variantStyles","clsx","sizeStyles","forwardRef","IconButton","size","clsx","jsx","jsxs","size","clsx","jsx","sizeStyles","size","clsx","jsxs","clsx","jsx","jsxs","createContext","useContext","clsx","jsx","createContext","useContext","size","forwardRef","clsx","jsx","jsxs","size","clsx","forwardRef","Input","InputControl","forwardRef","clsx","jsx","jsxs","forwardRef","Textarea","size","TextareaControl","clsx","forwardRef","useEffect","useId","useRef","useState","clsx","useCallback","useRef","useState","useRef","clsx","clsx","clsx","useEffect","useRef","useEffect","useRef","useState","lockScroll","useRef","useEffect","useEffect","useState","Fragment","jsx","jsxs","forwardRef","SelectControl","size","useState","useId","useRef","useEffect","clsx","Select","forwardRef","clsx","jsx","jsxs","inputBase","iconWrap","forwardRef","DatePicker","size","clsx","DateInput","clsx","LuCheck","jsx","jsxs","SIZE","size","clsx","LuCheck","clsx","LuCheck","jsx","jsxs","SIZE","size","forwardRef","useId","clsx","jsx","jsxs","SIZE","forwardRef","Switch","size","useId","clsx","createContext","forwardRef","useContext","useRef","clsx","jsx","SIZE","forwardRef","Toggle","size","useContext","clsx","createContext","useRef","ToggleGroupItem","forwardRef","useId","useRef","useState","clsx","jsx","jsxs","forwardRef","InputOTP","useRef","useState","useId","clsx","useRef","useState","clsx","Fragment","jsx","jsxs","clsx","jsx","jsxs","clsx","clsx","jsx","jsxs","size","clsx","jsx","size","useCallback","useEffect","useId","useMemo","useRef","useState","clsx","LuCheck","LuChevronDown","Fragment","jsx","jsxs","size","useState","useId","useRef","useMemo","useCallback","useEffect","clsx","LuChevronDown","LuCheck","Fragment","jsx","jsxs","size","useEffect","useId","useMemo","useRef","useState","clsx","jsx","jsxs","useState","useId","useRef","useMemo","useEffect","clsx","clsx","jsx","jsxs","TONE_STYLES","size","clsx","jsx","clsx","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","clsx","jsx","clsx","jsx","jsxs","jsx","clsx","LuCheck","LuX","jsx","clsx","jsx","sizeStyles","toneStyles","size","forwardRef","useEffect","useId","useRef","clsx","clsx","LuCheck","LuMinus","jsx","size","jsx","jsxs","LABEL_TEXT","forwardRef","Checkbox","size","useRef","useId","useEffect","clsx","createContext","forwardRef","useContext","useId","clsx","jsx","jsxs","createContext","forwardRef","RadioGroup","size","useId","clsx","LABEL_TEXT","Radio","useContext","clsx","jsx","clsx","forwardRef","useId","clsx","jsx","jsxs","Slider","forwardRef","clsx","jsx","SIZE","forwardRef","Label","size","clsx","useCallback","useEffect","useId","useMemo","useRef","useState","clsx","LuChevronRight","jsx","jsxs","offset","useMemo","useId","useState","useRef","useCallback","useEffect","clsx","LuChevronRight","forwardRef","clsx","LuSearch","LuX","jsx","jsxs","HEIGHT","forwardRef","InputGroup","size","clsx","InputGroupInput","InputGroupAddon","InputGroupText","SearchInput","LuSearch","LuX","createContext","useContext","useEffect","useId","useRef","useState","LuX","jsx","jsxs","SIZE","createContext","size","useRef","useId","useState","LuX","useContext","useEffect","cloneElement","isValidElement","useCallback","useEffect","useId","useRef","useState","clsx","Fragment","jsx","jsxs","useId","useState","useRef","useCallback","useEffect","isValidElement","cloneElement","clsx","createContext","useContext","useEffect","useId","useMemo","useRef","useState","clsx","jsx","createContext","useContext","useId","useState","useMemo","useRef","useEffect","clsx","cloneElement","isValidElement","useCallback","useEffect","useId","useRef","useState","clsx","Fragment","jsx","jsxs","useId","useState","useRef","useCallback","useEffect","isValidElement","cloneElement","clsx","createContext","useContext","useEffect","useMemo","useRef","useState","clsx","createContext","useCallback","useContext","useId","useMemo","useRef","clsx","LuCheck","jsx","jsxs","createContext","useContext","useId","useRef","useCallback","useMemo","clsx","LuCheck","jsx","createContext","useContext","useState","useMemo","useRef","useEffect","offset","clsx","createContext","useContext","useEffect","useId","useMemo","useRef","useState","clsx","jsx","createContext","useContext","useId","useState","useRef","useMemo","clsx","useEffect","useRef","clsx","LuX","forwardRef","useEffect","useRef","useState","clsx","jsx","forwardRef","ScrollArea","useRef","useState","useEffect","clsx","jsx","jsxs","useRef","clsx","LuX","jsx","jsxs","size","useState","jsx","jsxs","size","useState","createContext","useContext","useEffect","useMemo","useRef","useState","clsx","jsx","createContext","useContext","useState","useMemo","useRef","useEffect","clsx","createContext","useContext","jsx","FOOTER_ALIGN","createContext","size","useContext","createContext","useCallback","useContext","useId","useMemo","useRef","clsx","LuChevronDown","jsx","jsxs","createContext","useContext","useId","useRef","useCallback","useMemo","clsx","Heading","LuChevronDown","createContext","useContext","useId","jsx","createContext","useContext","useId","forwardRef","clsx","jsx","AspectRatio","createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","clsx","LuChevronLeft","LuChevronRight","jsx","jsxs","createContext","useContext","useId","useRef","useState","useMemo","useEffect","clsx","useCallback","LuChevronLeft","LuChevronRight","createContext","useCallback","useContext","useEffect","useId","useMemo","useRef","useState","clsx","jsx","jsxs","createContext","useContext","size","useRef","useId","useState","useMemo","clsx","useCallback","useEffect","clsx","jsx","jsxs","size","clsx","jsx","SIZE","size","clsx","jsx","jsxs","GAP","size","clsx","useId","clsx","jsx","jsxs","SIZE","size","useId","clsx","clsx","Fragment","jsx","jsxs","SIZE","VARIANT","clsx","size","clsx","jsx","forwardRef","clsx","jsx","Separator","forwardRef","clsx","jsx","SIZE","Kbd","size","forwardRef","clsx","LuChevronRight","jsx","jsxs","forwardRef","Breadcrumb","clsx","BreadcrumbItem","LuChevronRight","BreadcrumbEllipsis","forwardRef","clsx","LuChevronLeft","LuChevronRight","jsx","jsxs","GAP","Pagination","forwardRef","clsx","Fragment","jsx","jsxs","forwardRef","NavigationMenu","clsx","NavigationMenuItem","forwardRef","clsx","jsx","forwardRef","clsx","TextLink","TextList","TextListItem","clsx","clsx","jsx","sizeStyles","size","jsx","jsxs","clsx","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","sizeStyles","size","clsx","jsx","jsxs","SIZE","TONE","size","clsx","jsx","clsx","jsx","jsxs","SIZE","size","labelClass","clsx","clsx","jsx","jsxs","SIZE","size","offset","clsx","clsx","jsx","jsxs","SIZE","size","clsx","useId","clsx","Fragment","jsx","jsxs","SIZE","size","useId","clsx","clsx","jsx","SIZE","size","clsx","offset","clsx","clsx","jsx","size","clsx","jsx","jsxs","size","clsx","clsx","jsx","jsxs","SIZE","WEIGHT","size","clsx","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","GAP","clsx","useId","jsx","jsxs","SIZE","size","useId","jsx","jsxs","GAP","clsx","clsx","jsx","jsxs","clsx","LuCheck","jsx","jsxs","clsx","jsx","jsxs","clsx","jsx","jsxs","COLUMNS","clsx","LuCheck","jsx","jsxs","COLUMNS","forwardRef","clsx","LuChevronDown","jsx","jsxs","forwardRef","Table","clsx","TableCaption","TableHeader","TableBody","TableFooter","TableRow","ALIGN","TableHead","LuChevronDown","TableCell","clsx","jsx","jsxs","DENSITY","ALIGN","clsx","size","clsx","LuCircleCheckBig","LuInfo","LuTriangleAlert","jsx","jsxs","toneStyles","clsx","jsx","jsxs","size","forwardRef","clsx","jsx","SHAPE","Skeleton","forwardRef","useId","clsx","LuCircleCheckBig","LuInfo","LuTriangleAlert","LuX","jsx","jsxs","TONE_STYLES","TONE_ICON","LuInfo","LuCircleCheckBig","LuTriangleAlert","forwardRef","Banner","useId","clsx","LuX","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","clsx","LuCircleCheckBig","LuInfo","LuTriangleAlert","LuX","jsx","jsxs","createContext","useContext","TONE_ICON","LuInfo","LuCircleCheckBig","LuTriangleAlert","TONE_ICON_COLOR","useState","useRef","useCallback","useEffect","useMemo","clsx","LuX","forwardRef","useState","jsx","forwardRef","PasswordInput","useState","clsx","LuArrowRight","LuSearch","jsx","jsxs","clsx","LuArrowRight","jsx","jsxs","clsx","jsx","clsx","jsx","jsxs"]}
|