@dinofront/design_system 1.2.0 → 1.2.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/dist/components/DatePicker/DatePicker.types.d.ts +12 -0
- package/dist/components/FormField/FormField.types.d.ts +8 -1
- package/dist/components/Radio/Radio.types.d.ts +1 -0
- package/dist/components/Select/Select.types.d.ts +17 -0
- package/dist/components/Upload/Upload.types.d.ts +5 -1
- package/dist/index.js +1128 -1006
- package/dist/index.js.map +1 -1
- package/dist/styles.css +20 -0
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/lib/cn.ts","../src/components/Divider/Divider.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Badge/Badge.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Button/Button.tsx","../src/components/ButtonGroup/ButtonGroup.tsx","../src/components/Card/Card.tsx","../src/components/CardGroup/CardGroup.tsx","../src/components/Checkbox/Checkbox.tsx","../src/lib/mergeRefs.ts","../src/lib/useFloatingPosition.ts","../src/components/Popover/Popover.tsx","../src/components/Copy/Copy.tsx","../src/components/Input/Input.tsx","../src/components/Counter/Counter.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/DistributionBar/DistributionBar.tsx","../src/lib/motion.ts","../src/lib/useMountTransition.ts","../src/components/Drawer/Drawer.tsx","../src/lib/useAnchoredPosition.ts","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/IconTile/IconTile.tsx","../src/components/Text/Text.tsx","../src/components/Empty/Empty.tsx","../src/components/Filter/Filter.tsx","../src/lib/FormContext.ts","../src/components/FormContainer/FormContainer.tsx","../src/components/FormField/FormField.tsx","../src/components/InfoField/InfoField.tsx","../src/components/InlineAlert/InlineAlert.tsx","../src/components/Link/Link.tsx","../src/components/Modal/Modal.tsx","../src/components/MultiSelect/MultiSelect.tsx","../src/components/NotificationBadge/NotificationBadge.tsx","../src/components/Pagination/Pagination.tsx","../src/components/PersonCard/PersonCard.tsx","../src/components/Progress/Progress.tsx","../src/components/Radio/Radio.tsx","../src/components/ReadMore/ReadMore.tsx","../src/components/Select/Select.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Snackbar/Snackbar.tsx","../src/components/Status/Status.tsx","../src/components/StepIndicator/StepIndicator.tsx","../src/components/Switch/Switch.tsx","../src/components/Table/Table.tsx","../src/components/Tabs/Tabs.tsx","../src/components/TextArea/TextArea.tsx","../src/components/ThemeSwitch/ThemeSwitch.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/UnderConstruction/UnderConstruction.tsx","../src/components/Upload/Upload.tsx","../src/hooks/useStepper.ts","../src/hooks/useOnOutsideClick.ts","../src/hooks/useEscapeKey.ts","../src/hooks/useHideBodyScroll.ts","../src/hooks/useIsMobile.ts","../src/hooks/useFormContext.ts","../src/hooks/useFormProps.ts","../src/tokens/colors.ts","../src/tokens/typography.ts","../src/tokens/spacing.ts","../src/tokens/radius.ts","../src/tokens/shadows.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n/**\n * The custom font-size scale declared in `src/styles/tokens.css`'s `@theme`\n * block (`--text-h-xl`, `--text-p-sm`, `--text-label-md`, ...). Mirrored\n * here by hand — same two-parallel-representations discipline as the token\n * pipeline itself — because tailwind-merge ships its own hardcoded default\n * theme and has no way to read this project's actual `@theme` CSS.\n *\n * Without this, tailwind-merge's default config only recognizes Tailwind's\n * built-in font-size keywords (`xs`, `sm`, `lg`, ...) as font sizes; any\n * `text-*` suffix it doesn't recognize as a font size instead falls through\n * to the *color* class group, whose theme scale is deliberately `isAny`\n * (Tailwind v4 allows arbitrary custom theme colors). That misclassifies\n * every `text-p-*`/`text-h-*`/`text-label-*` utility as a text color, so it\n * gets silently dropped as a \"conflict\" whenever it appears alongside an\n * actual `text-{color}` class in the same `cn()` call — which is nearly\n * every real usage, since components pair a typography variant with a\n * semantic text color.\n */\nconst FONT_SIZE_TOKENS = [\n 'h-xl',\n 'h-lg',\n 'h-md',\n 'h-std',\n 'h-sm',\n 'h-xs',\n 'p-lg',\n 'p-md',\n 'p-std',\n 'p-sm',\n 'p-xs',\n 'label-lg',\n 'label-md',\n 'label-std',\n 'label-sm',\n 'label-xs',\n 'label-xxs',\n];\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: FONT_SIZE_TOKENS,\n },\n },\n});\n\n/**\n * Merges class names, resolving conflicting Tailwind utilities in favor of\n * the last one specified (e.g. `cn('px-2', 'px-4')` -> `'px-4'`). This is\n * what lets consumers pass a `className` prop that overrides a component's\n * defaults instead of just appending to them.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type {\n DividerColor,\n DividerOrientation,\n DividerProps,\n DividerVariant,\n} from './Divider.types';\n\nconst orientationStyles: Record<DividerOrientation, string> = {\n horizontal: 'h-0 w-full border-t',\n vertical: 'w-0 h-full self-stretch border-l',\n};\n\nconst variantStyles: Record<DividerVariant, string> = {\n solid: 'border-solid',\n dashed: 'border-dashed',\n};\n\nconst colorStyles: Record<DividerColor, string> = {\n default: 'border-border-default',\n subtle: 'border-border-subtle',\n strong: 'border-border-strong',\n brand: 'border-border-brand',\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(function Divider(\n { orientation = 'horizontal', variant = 'solid', color = 'default', className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"separator\"\n aria-orientation={orientation}\n data-test-id={dataTestId}\n className={cn(\n 'shrink-0',\n orientationStyles[orientation],\n variantStyles[variant],\n colorStyles[color],\n className,\n )}\n {...rest}\n />\n );\n});\n","import { createContext, forwardRef, useContext, useId, useState } from 'react';\nimport { ChevronDown } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Divider } from '../Divider';\nimport type { AccordionItemProps, AccordionProps } from './Accordion.types';\n\ninterface AccordionContextValue {\n openValues: string[];\n toggle: (value: string) => void;\n animated: boolean;\n showDivider: boolean;\n}\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nfunction useAccordion() {\n const ctx = useContext(AccordionContext);\n if (!ctx) throw new Error('AccordionItem must be used inside <Accordion>');\n return ctx;\n}\n\nfunction normalize(value: string | string[] | undefined): string[] {\n return value === undefined ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n {\n type = 'single',\n defaultValue,\n value,\n onValueChange,\n animated = true,\n showDivider = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(() => normalize(defaultValue));\n const isControlled = value !== undefined;\n const openValues = isControlled ? normalize(value) : internal;\n\n const toggle = (val: string) => {\n let next: string[];\n if (type === 'single') {\n next = openValues.includes(val) ? [] : [val];\n } else {\n next = openValues.includes(val) ? openValues.filter((v) => v !== val) : [...openValues, val];\n }\n if (!isControlled) setInternal(next);\n onValueChange?.(type === 'single' ? (next[0] ?? '') : next);\n };\n\n return (\n <AccordionContext.Provider value={{ openValues, toggle, animated, showDivider }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col divide-y divide-border-default border border-border-default rounded-lg overflow-hidden bg-bg-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </AccordionContext.Provider>\n );\n});\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { value, title, icon, disabled, className, children, dataTestId, ...rest },\n ref,\n) {\n const { openValues, toggle, animated, showDivider } = useAccordion();\n const isOpen = openValues.includes(value);\n const panelId = useId();\n const triggerId = useId();\n const panelContent = (\n <>\n {showDivider && <Divider className=\"mb-4\" />}\n {children}\n </>\n );\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n data-state={isOpen ? 'open' : 'closed'}\n className={cn('group', className)}\n {...rest}\n >\n <h3>\n <button\n id={triggerId}\n type=\"button\"\n onClick={() => toggle(value)}\n disabled={disabled}\n aria-expanded={isOpen}\n aria-controls={panelId}\n className={cn(\n 'flex w-full items-center justify-between gap-3 px-5 py-4 text-left',\n 'text-p-md font-medium text-fg-default',\n 'hover:bg-bg-container transition-colors',\n 'focus-visible:outline-none focus-visible:bg-bg-container',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n )}\n >\n <span className=\"inline-flex items-center gap-3\">\n {icon && <span className=\"inline-flex text-fg-secondary\">{icon}</span>}\n {title}\n </span>\n <ChevronDown\n className={cn(\n 'h-5 w-5 shrink-0 text-fg-secondary transition-transform duration-200',\n isOpen && 'rotate-180',\n )}\n aria-hidden\n />\n </button>\n </h3>\n {animated ? (\n <div\n className={cn(\n 'grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none',\n isOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',\n )}\n >\n <div className=\"overflow-hidden min-h-0\">\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n inert={!isOpen || undefined}\n className=\"px-5 pb-4 text-p-std text-fg-secondary\"\n >\n {panelContent}\n </div>\n </div>\n </div>\n ) : (\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n hidden={!isOpen}\n className=\"px-5 pb-4 text-p-std text-fg-secondary\"\n >\n {panelContent}\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef, useState, type ReactNode } from 'react';\nimport { User } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { AvatarGroupProps, AvatarProps, AvatarSize, AvatarStatus } from './Avatar.types';\n\nconst sizeStyles: Record<AvatarSize, string> = {\n xs: 'h-6 w-6 text-p-xs',\n sm: 'h-8 w-8 text-p-sm',\n md: 'h-10 w-10 text-p-std',\n lg: 'h-12 w-12 text-p-md',\n xl: 'h-16 w-16 text-h-xs',\n '2xl': 'h-20 w-20 text-h-xs',\n};\n\nconst statusSize: Record<AvatarSize, string> = {\n xs: 'h-1.5 w-1.5',\n sm: 'h-2 w-2',\n md: 'h-2.5 w-2.5',\n lg: 'h-3 w-3',\n xl: 'h-3.5 w-3.5',\n '2xl': 'h-4 w-4',\n};\n\nconst statusColor: Record<AvatarStatus, string> = {\n online: 'bg-green-500',\n offline: 'bg-gray-400 dark:bg-gray-500',\n away: 'bg-yellow-600',\n busy: 'bg-red-600',\n};\n\nconst overlap: Record<AvatarSize, string> = {\n xs: '-ml-1.5',\n sm: '-ml-2',\n md: '-ml-2.5',\n lg: '-ml-3',\n xl: '-ml-4',\n '2xl': '-ml-5',\n};\n\nfunction getInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n if (parts.length === 0) return '';\n if (parts.length === 1) return parts[0]!.slice(0, 2).toUpperCase();\n return (parts[0]![0]! + parts[parts.length - 1]![0]!).toUpperCase();\n}\n\nfunction colorFromName(name: string): string {\n const palette = ['bg-brand-500', 'bg-blue-600', 'bg-purple-500', 'bg-pink-500', 'bg-yellow-600', 'bg-green-500'];\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash << 5) - hash + name.charCodeAt(i);\n hash |= 0;\n }\n return palette[Math.abs(hash) % palette.length]!;\n}\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { src, alt, name, size = 'md', status, shape = 'circle', fallback, className, dataTestId, ...rest },\n ref,\n) {\n const [errored, setErrored] = useState(false);\n const showImage = !!src && !errored;\n const initials = name ? getInitials(name) : '';\n const bgColor = name ? colorFromName(name) : 'bg-gray-300 dark:bg-gray-600';\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn('relative inline-flex shrink-0', className)}\n {...rest}\n >\n <span\n className={cn(\n 'inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none',\n sizeStyles[size],\n shape === 'circle' ? 'rounded-full' : 'rounded-md',\n !showImage && bgColor,\n )}\n >\n {showImage ? (\n <img\n src={src}\n alt={alt ?? name ?? ''}\n onError={() => setErrored(true)}\n className=\"h-full w-full object-cover\"\n />\n ) : name ? (\n initials\n ) : (\n (fallback ?? <User className=\"h-1/2 w-1/2 text-white/90\" />)\n )}\n </span>\n {status && (\n <span\n aria-label={status}\n className={cn(\n 'absolute right-0 bottom-0 rounded-full ring-2 ring-white',\n statusSize[size],\n statusColor[status],\n )}\n />\n )}\n </span>\n );\n});\n\nexport const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(function AvatarGroup(\n { size = 'md', max, children, className, dataTestId, ...rest },\n ref,\n) {\n const items = Array.isArray(children) ? children : ([children] as ReactNode[]);\n const shown = max !== undefined ? items.slice(0, max) : items;\n const extra = max !== undefined ? items.length - max : 0;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('inline-flex items-center', className)}\n {...rest}\n >\n {shown.map((child, i) => (\n <div\n key={i}\n className={cn('rounded-full ring-2 ring-white', i > 0 && overlap[size])}\n style={{ zIndex: shown.length - i }}\n >\n {child}\n </div>\n ))}\n {extra > 0 && (\n <div className={cn('rounded-full ring-2 ring-white', overlap[size])}>\n <Avatar size={size} name={`+${extra}`} />\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef, type KeyboardEvent, type MouseEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { BadgeProps, BadgeSize, BadgeStyle, BadgeVariant } from './Badge.types';\n\nconst sizeStyles: Record<BadgeSize, string> = {\n lg: 'h-7 px-2.5 text-p-std gap-1.5',\n md: 'h-6 px-2 text-p-sm gap-1',\n sm: 'h-5 px-1.5 text-p-sm gap-1',\n xs: 'h-4 px-1 text-p-xs gap-0.5',\n};\n\nconst radiusStyles: Record<BadgeSize, string> = {\n lg: 'rounded-md',\n md: 'rounded-md',\n sm: 'rounded',\n xs: 'rounded',\n};\n\nconst dotSizeStyles: Record<BadgeSize, string> = {\n lg: 'size-2.5',\n md: 'size-2',\n sm: 'size-1.5',\n xs: 'size-1',\n};\n\nconst iconOnlyStyles: Record<BadgeSize, string> = {\n lg: 'min-w-7 px-0 justify-center',\n md: 'min-w-6 px-0 justify-center',\n sm: 'min-w-5 px-0 justify-center',\n xs: 'min-w-4 px-0 justify-center',\n};\n\nconst filledStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-bg-subtle text-fg-default border border-border-default',\n brand: 'bg-brand-20 text-brand-800 border border-brand-100',\n success: 'bg-green-50 text-green-800 border border-green-100',\n warning: 'bg-yellow-50 text-yellow-900 border border-yellow-100',\n danger: 'bg-red-50 text-red-800 border border-red-100',\n info: 'bg-blue-50 text-blue-800 border border-blue-100',\n privacy: 'bg-purple-50 text-purple-800 border border-purple-100',\n};\n\nconst outlineStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-transparent text-fg-default border border-border-strong',\n brand: 'bg-transparent text-brand-700 border border-brand-500',\n success: 'bg-transparent text-green-700 border border-green-500',\n warning: 'bg-transparent text-yellow-800 border border-yellow-600',\n danger: 'bg-transparent text-red-700 border border-red-500',\n info: 'bg-transparent text-blue-700 border border-blue-500',\n privacy: 'bg-transparent text-purple-700 border border-purple-500',\n};\n\nconst accentStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-fg-default text-bg-default',\n brand: 'bg-brand-500 text-white',\n success: 'bg-green-600 text-white',\n warning: 'bg-yellow-600 text-gray-900 dark:text-gray-900',\n danger: 'bg-red-700 text-white',\n info: 'bg-blue-600 text-white',\n privacy: 'bg-purple-500 text-white',\n};\n\n// Uniform per-appearance hover/active treatment rather than a 21-entry\n// (appearance x variant) table — brightness/neutral-tint reads consistently\n// across every color without hand-tuning a \"one shade darker\" value per\n// variant.\nconst interactiveStyles: Record<BadgeStyle, string> = {\n filled: 'hover:brightness-95 active:brightness-90',\n outline: 'hover:bg-bg-subtle active:bg-bg-container',\n accent: 'hover:brightness-90 active:brightness-80',\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n {\n variant = 'neutral',\n appearance = 'filled',\n size = 'md',\n shape = 'rounded',\n leftIcon,\n rightIcon,\n onDismiss,\n dot = false,\n withDot = false,\n disabled = false,\n interactive = false,\n className,\n children,\n dataTestId,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const palette =\n appearance === 'filled'\n ? filledStyles[variant]\n : appearance === 'outline'\n ? outlineStyles[variant]\n : accentStyles[variant];\n\n if (dot) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n aria-hidden={rest['aria-label'] ? undefined : true}\n onClick={disabled ? undefined : onClick}\n className={cn(\n 'inline-block shrink-0 rounded-full',\n dotSizeStyles[size],\n accentStyles[variant],\n disabled && 'opacity-50',\n className,\n )}\n {...rest}\n />\n );\n }\n\n const isIconOnly = children == null && !withDot && !!(leftIcon || rightIcon);\n const radius = shape === 'pill' ? 'rounded-full' : radiusStyles[size];\n\n const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n onKeyDown?.(event);\n if (disabled || !onClick) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onClick(event as unknown as MouseEvent<HTMLSpanElement>);\n }\n };\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled ? 0 : undefined}\n aria-disabled={interactive && disabled ? true : undefined}\n onClick={disabled ? undefined : onClick}\n onKeyDown={interactive ? handleKeyDown : onKeyDown}\n className={cn(\n 'inline-flex items-center font-medium whitespace-nowrap select-none',\n sizeStyles[size],\n radius,\n palette,\n isIconOnly && iconOnlyStyles[size],\n interactive &&\n !disabled &&\n cn(\n 'cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n interactiveStyles[appearance],\n ),\n disabled && 'opacity-50 cursor-not-allowed pointer-events-none',\n className,\n )}\n {...rest}\n >\n {withDot ? (\n <span\n className={cn('inline-block shrink-0 rounded-full', dotSizeStyles[size], accentStyles[variant])}\n aria-hidden\n />\n ) : (\n leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>\n )}\n {children}\n {rightIcon && !onDismiss && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n disabled={disabled}\n aria-label=\"Dismiss\"\n className=\"inline-flex shrink-0 -mr-0.5 rounded-full p-0.5 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </span>\n );\n});\n","import { forwardRef, Fragment } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { BreadcrumbProps, BreadcrumbSize } from './Breadcrumb.types';\n\nconst sizeStyles: Record<BreadcrumbSize, string> = {\n md: 'text-p-sm',\n sm: 'text-p-xs',\n};\n\nconst crumbLinkClass =\n 'rounded-sm text-fg-tertiary transition-colors hover:text-fg-secondary outline-none focus-visible:ring-2 focus-visible:ring-brand-300';\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(function Breadcrumb(\n { items, currentValue, onSelect, separator = '/', size = 'md', className, dataTestId, ...rest },\n ref,\n) {\n const current = currentValue ?? items[items.length - 1]?.value;\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumb\"\n data-test-id={dataTestId}\n className={cn(sizeStyles[size], className)}\n {...rest}\n >\n <ol className=\"flex items-center\">\n {items.map((item, index) => {\n const isCurrent = item.value === current;\n return (\n <Fragment key={item.value}>\n {index > 0 && (\n <li aria-hidden=\"true\" className=\"px-1.5 text-fg-tertiary\">\n {separator}\n </li>\n )}\n <li className=\"flex items-center\">\n {isCurrent ? (\n <span aria-current=\"page\" className=\"font-medium text-fg-default\">\n {item.label}\n </span>\n ) : item.disabled ? (\n <span className=\"cursor-not-allowed text-fg-disabled\">{item.label}</span>\n ) : item.href ? (\n <a href={item.href} onClick={() => onSelect?.(item.value)} className={crumbLinkClass}>\n {item.label}\n </a>\n ) : (\n <button type=\"button\" onClick={() => onSelect?.(item.value)} className={crumbLinkClass}>\n {item.label}\n </button>\n )}\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n});\n","import { forwardRef } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { ButtonProps, ButtonSize, ButtonVariant } from './Button.types';\n\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-5 text-p-md gap-2 rounded-lg',\n md: 'h-10 px-4 text-p-std gap-2 rounded-lg',\n sm: 'h-8 px-3 text-p-sm gap-1.5 rounded-md',\n};\n\nconst iconOnlySize: Record<ButtonSize, string> = {\n lg: 'h-12 w-12 rounded-lg',\n md: 'h-10 w-10 rounded-lg',\n sm: 'h-8 w-8 rounded-md',\n};\n\nconst variantStyles: Record<ButtonVariant, string> = {\n primary: [\n 'bg-brand-500 text-white border border-transparent',\n 'hover:bg-brand-600 active:bg-brand-700',\n 'disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n secondary: [\n 'bg-bg-default text-fg-default border border-border-default',\n 'hover:bg-bg-container active:bg-bg-subtle',\n 'disabled:bg-bg-container disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n tertiary: [\n 'bg-transparent text-fg-default border border-transparent',\n 'hover:bg-bg-subtle active:bg-bg-subtle',\n 'disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n danger: [\n 'bg-red-700 text-white border border-transparent',\n 'hover:bg-red-800 active:bg-red-900',\n 'disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2',\n ].join(' '),\n};\n\n// Same shade each variant already uses for `active:`, applied persistently\n// while `pressed` is true instead of only during the mousedown instant.\nconst pressedStyles: Record<ButtonVariant, string> = {\n primary: 'bg-brand-700',\n secondary: 'bg-bg-subtle',\n tertiary: 'bg-bg-subtle',\n danger: 'bg-red-900',\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'primary',\n size = 'md',\n leftIcon,\n rightIcon,\n loading = false,\n iconOnly = false,\n fullWidth = false,\n pressed = false,\n disabled,\n className,\n children,\n onClick,\n dataTestId,\n ...rest\n },\n ref,\n) {\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n aria-pressed={pressed}\n data-test-id={dataTestId}\n onClick={(event) => {\n if (pressed || disabled || loading) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }}\n className={cn(\n 'inline-flex items-center justify-center font-medium transition-colors outline-none',\n iconOnly ? iconOnlySize[size] : sizeStyles[size],\n variantStyles[variant],\n pressed && pressedStyles[variant],\n fullWidth && 'w-full',\n className,\n )}\n {...rest}\n >\n {loading ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" aria-hidden />\n ) : (\n <>\n {leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </>\n )}\n </button>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { ButtonGroupOrientation, ButtonGroupProps } from './ButtonGroup.types';\n\nconst orientationStyles: Record<ButtonGroupOrientation, string> = {\n horizontal:\n 'flex-row [&>*]:rounded-none [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px',\n vertical:\n 'flex-col [&>*]:rounded-none [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px',\n};\n\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { orientation = 'horizontal', className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"group\"\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex isolate',\n orientationStyles[orientation],\n '[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { CardProps, CardPadding, CardVariant } from './Card.types';\n\nconst variantStyles: Record<CardVariant, string> = {\n elevated: 'bg-bg-default border border-border-default shadow-z1',\n outlined: 'bg-bg-default border border-border-default',\n filled: 'bg-bg-container border border-transparent',\n};\n\nconst paddingStyles: Record<CardPadding, string> = {\n none: 'p-0',\n sm: 'p-4',\n md: 'p-5',\n lg: 'p-6',\n};\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n variant = 'outlined',\n padding = 'md',\n header,\n footer,\n interactive = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const hasSlots = header || footer;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'rounded-xl overflow-hidden',\n variantStyles[variant],\n interactive && 'transition-all hover:border-brand-500 hover:shadow-z2',\n // If header/footer used, padding is applied per-region, not on the wrapper.\n !hasSlots && paddingStyles[padding],\n className,\n )}\n {...rest}\n >\n {header && (\n <div className={cn('border-b border-border-subtle', paddingStyles[padding])}>\n {header}\n </div>\n )}\n {hasSlots ? <div className={paddingStyles[padding]}>{children}</div> : children}\n {footer && (\n <div className={cn('border-t border-border-subtle', paddingStyles[padding])}>\n {footer}\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Card } from '../Card';\nimport type { CardGroupProps, CardGroupTitleColor } from './CardGroup.types';\n\n// Semantic \"lighter\" aliases where one exists; purple/pink fall back to raw\n// scale shades with explicit dark: variants, same precedent as IconTile's\n// tones (no semantic alias exists for those two yet).\nconst titleColorStyles: Record<CardGroupTitleColor, string> = {\n brand: 'bg-bg-brand-lighter text-brand-800',\n blue: 'bg-bg-info-lighter text-blue-800',\n purple: 'bg-purple-50 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200',\n pink: 'bg-pink-50 text-pink-800 dark:bg-pink-900/30 dark:text-pink-200',\n yellow: 'bg-bg-warning-lighter text-yellow-900',\n gray: 'bg-bg-subtle text-fg-secondary',\n};\n\nexport const CardGroup = forwardRef<HTMLDivElement, CardGroupProps>(function CardGroup(\n { title, header, children, noDivider = false, className, dataTestId, ...rest },\n ref,\n) {\n const placement = title?.placement ?? 'left';\n const isVertical = !!title && placement !== 'top';\n\n const titleRail = title && (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-center text-label-md font-bold',\n isVertical\n ? cn('px-2 [writing-mode:vertical-rl]', placement === 'left' && 'rotate-180')\n : 'px-4 py-2',\n titleColorStyles[title.color ?? 'gray'],\n )}\n >\n {title.text}\n </div>\n );\n\n return (\n <Card\n ref={ref}\n dataTestId={dataTestId}\n variant=\"outlined\"\n padding=\"none\"\n className={className}\n {...rest}\n >\n <div className={cn('flex', isVertical ? (placement === 'right' ? 'flex-row-reverse' : 'flex-row') : 'flex-col')}>\n {titleRail}\n <div\n className={cn(\n 'min-w-0 flex-1',\n !noDivider && '[&>*:not(:last-child)]:border-b [&>*:not(:last-child)]:border-border-default',\n )}\n >\n {header}\n {children}\n </div>\n </div>\n </Card>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { Check, Minus } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { CheckboxProps, CheckboxSize } from './Checkbox.types';\n\nconst boxSize: Record<CheckboxSize, string> = {\n md: 'h-5 w-5 rounded-sm',\n sm: 'h-4 w-4 rounded-sm',\n};\n\nconst iconSize: Record<CheckboxSize, string> = {\n md: 'h-3.5 w-3.5',\n sm: 'h-3 w-3',\n};\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n size = 'md',\n label,\n description,\n indeterminate = false,\n error = false,\n id,\n disabled,\n checked,\n defaultChecked,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-2.5 group/checkbox',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0 items-center justify-center mt-0.5\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className=\"peer sr-only\"\n aria-invalid={error || undefined}\n aria-checked={indeterminate ? 'mixed' : undefined}\n {...rest}\n />\n <span\n className={cn(\n 'flex items-center justify-center border transition-colors',\n boxSize[size],\n // base (not checked, not indeterminate)\n !indeterminate && 'bg-bg-default',\n // border color\n error ? 'border-red-600' : indeterminate ? 'border-brand-500' : 'border-border-strong',\n // hover\n !disabled &&\n !indeterminate &&\n (error ? 'peer-hover:border-red-700' : 'peer-hover:border-fg-tertiary'),\n // focus ring\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1',\n // checked (controlled or uncontrolled via peer)\n !indeterminate && 'peer-checked:bg-brand-500 peer-checked:border-brand-500',\n // indeterminate wins\n indeterminate && 'bg-brand-500',\n // disabled overrides\n disabled &&\n !indeterminate &&\n 'peer-checked:bg-bg-subtle peer-checked:border-border-strong',\n // SVG visibility — toggled via peer-checked on the sibling native input.\n !indeterminate &&\n '[&_svg]:opacity-0 peer-checked:[&_svg]:opacity-100 [&_svg]:transition-opacity',\n )}\n >\n {indeterminate ? (\n <Minus className={cn(iconSize[size], 'text-white')} strokeWidth={3} aria-hidden />\n ) : (\n <Check className={cn(iconSize[size], 'text-white')} strokeWidth={3} aria-hidden />\n )}\n </span>\n </span>\n {(label || description) && (\n <span className=\"flex flex-col gap-0.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>\n )}\n {description && (\n <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>\n )}\n </span>\n )}\n </label>\n );\n});\n","import type { Ref } from 'react';\n\n/** Combines multiple refs (a forwarded consumer ref, an internal ref) into a\n * single callback ref so they all point at the same DOM node. */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): (node: T | null) => void {\n return (node) => {\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 { useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nexport type FloatingSide = 'top' | 'bottom' | 'left' | 'right';\nexport type FloatingAlign = 'start' | 'center' | 'end';\n\nexport interface UseFloatingPositionOptions {\n /** A ref pointing at the anchor element, read fresh on every recompute. */\n anchor: RefObject<HTMLElement | null> | null | undefined;\n panel: HTMLElement | null;\n open: boolean;\n side?: FloatingSide;\n align?: FloatingAlign;\n offset?: number;\n /** Flips to the opposite side on the same axis (top<->bottom, left<->right) when there isn't room. */\n flip?: boolean;\n /** Clamps the cross-axis position so the panel stays inside the viewport. */\n shift?: boolean;\n}\n\nexport interface FloatingPosition {\n style: CSSProperties;\n /** Positions the arrow at the anchor's center on the cross axis, relative to the panel's own box — apply on top of the arrow's own border/rotation classes, which are keyed off `resolvedSide` by the caller. */\n arrowStyle: CSSProperties;\n /** The side actually used, after flipping. */\n resolvedSide: FloatingSide;\n}\n\nconst VIEWPORT_MARGIN = 8;\nconst ARROW_SIZE = 8; // px — matches the `size-2` arrow element in Popover.tsx\nconst ARROW_MARGIN = 10; // keep the arrow off the panel's rounded corners\n\n/** Computes `position: fixed` coordinates (+ a matching arrow offset) for a\n * panel anchored to a trigger element on any of 4 sides x 3 alignments,\n * so the panel can portal to `document.body` without being clipped by an\n * `overflow: hidden` ancestor. Recomputes on open, resize, and any\n * ancestor scroll. */\nexport function useFloatingPosition({\n anchor,\n panel,\n open,\n side = 'top',\n align = 'center',\n offset = 8,\n flip = true,\n shift = true,\n}: UseFloatingPositionOptions): FloatingPosition {\n const [position, setPosition] = useState<FloatingPosition>({\n style: { position: 'fixed', top: 0, left: 0, visibility: 'hidden' },\n arrowStyle: {},\n resolvedSide: side,\n });\n\n useLayoutEffect(() => {\n if (!open || !panel) return;\n\n const compute = () => {\n const anchorEl = anchor?.current;\n if (!anchorEl) return;\n const anchorRect = anchorEl.getBoundingClientRect();\n const panelRect = panel.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const isVertical = side === 'top' || side === 'bottom';\n let resolvedSide = side;\n\n if (flip) {\n if (isVertical) {\n const spaceAbove = anchorRect.top;\n const spaceBelow = viewportHeight - anchorRect.bottom;\n if (side === 'top' && spaceAbove < panelRect.height + offset && spaceBelow > spaceAbove) {\n resolvedSide = 'bottom';\n } else if (side === 'bottom' && spaceBelow < panelRect.height + offset && spaceAbove > spaceBelow) {\n resolvedSide = 'top';\n }\n } else {\n const spaceLeft = anchorRect.left;\n const spaceRight = viewportWidth - anchorRect.right;\n if (side === 'left' && spaceLeft < panelRect.width + offset && spaceRight > spaceLeft) {\n resolvedSide = 'right';\n } else if (side === 'right' && spaceRight < panelRect.width + offset && spaceLeft > spaceRight) {\n resolvedSide = 'left';\n }\n }\n }\n\n const resolvedIsVertical = resolvedSide === 'top' || resolvedSide === 'bottom';\n let top: number;\n let left: number;\n\n if (resolvedIsVertical) {\n top = resolvedSide === 'bottom' ? anchorRect.bottom + offset : anchorRect.top - panelRect.height - offset;\n left =\n align === 'start'\n ? anchorRect.left\n : align === 'end'\n ? anchorRect.right - panelRect.width\n : anchorRect.left + anchorRect.width / 2 - panelRect.width / 2;\n } else {\n left = resolvedSide === 'right' ? anchorRect.right + offset : anchorRect.left - panelRect.width - offset;\n top =\n align === 'start'\n ? anchorRect.top\n : align === 'end'\n ? anchorRect.bottom - panelRect.height\n : anchorRect.top + anchorRect.height / 2 - panelRect.height / 2;\n }\n\n if (shift) {\n if (resolvedIsVertical) {\n left = Math.min(Math.max(left, VIEWPORT_MARGIN), viewportWidth - panelRect.width - VIEWPORT_MARGIN);\n } else {\n top = Math.min(Math.max(top, VIEWPORT_MARGIN), viewportHeight - panelRect.height - VIEWPORT_MARGIN);\n }\n }\n\n let arrowStyle: CSSProperties;\n if (resolvedIsVertical) {\n const anchorCenterX = anchorRect.left + anchorRect.width / 2;\n const arrowLeft = Math.min(Math.max(anchorCenterX - left, ARROW_MARGIN), panelRect.width - ARROW_MARGIN);\n arrowStyle = {\n left: arrowLeft,\n [resolvedSide === 'bottom' ? 'top' : 'bottom']: -ARROW_SIZE / 2,\n };\n } else {\n const anchorCenterY = anchorRect.top + anchorRect.height / 2;\n const arrowTop = Math.min(Math.max(anchorCenterY - top, ARROW_MARGIN), panelRect.height - ARROW_MARGIN);\n arrowStyle = {\n top: arrowTop,\n [resolvedSide === 'right' ? 'left' : 'right']: -ARROW_SIZE / 2,\n };\n }\n\n setPosition({ style: { position: 'fixed', top, left }, arrowStyle, resolvedSide });\n };\n\n compute();\n window.addEventListener('resize', compute);\n document.addEventListener('scroll', compute, { capture: true, passive: true });\n return () => {\n window.removeEventListener('resize', compute);\n document.removeEventListener('scroll', compute, { capture: true });\n };\n }, [open, anchor, panel, side, align, offset, flip, shift]);\n\n return position;\n}\n","import {\n cloneElement,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type MouseEvent as ReactMouseEvent,\n type Ref,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { useFloatingPosition, type FloatingSide } from '../../lib/useFloatingPosition';\nimport type { PopoverProps } from './Popover.types';\n\n// Rotated-square arrow technique (not Tooltip's CSS-triangle, which only\n// works because Tooltip's bubble is borderless): after a 45deg rotation,\n// each corner of the square points toward one of the four cardinal\n// directions, carried by its two adjacent (now-bordered) edges. Keyed by\n// resolvedSide because the arrow always points *back toward the anchor*,\n// i.e. the opposite direction from where the panel sits.\nconst arrowBorderStyles: Record<FloatingSide, string> = {\n bottom: 'border-l border-t', // panel below anchor -> arrow tip points up\n top: 'border-b border-r', // panel above anchor -> arrow tip points down\n left: 'border-t border-r', // panel left of anchor -> arrow tip points right\n right: 'border-b border-l', // panel right of anchor -> arrow tip points left\n};\n\nexport function Popover({\n content,\n children,\n side = 'top',\n align = 'center',\n offset = 8,\n open,\n defaultOpen = false,\n onOpenChange,\n flip = true,\n showArrow = true,\n closeOnScroll = true,\n autoFocus = false,\n container,\n className,\n dataTestId,\n}: PopoverProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = open !== undefined;\n const isOpen = isControlled ? open : internalOpen;\n const triggerRef = useRef<HTMLElement | null>(null);\n const [panelEl, setPanelEl] = useState<HTMLDivElement | null>(null);\n const contentId = useId();\n\n const setOpen = (value: boolean) => {\n if (!isControlled) setInternalOpen(value);\n onOpenChange?.(value);\n };\n\n const { style, arrowStyle, resolvedSide } = useFloatingPosition({\n anchor: triggerRef,\n panel: panelEl,\n open: isOpen,\n side,\n align,\n offset,\n flip,\n });\n\n useEffect(() => {\n if (!isOpen) return;\n const onDoc = (event: MouseEvent) => {\n const target = event.target as Node;\n if (panelEl?.contains(target)) return;\n if (triggerRef.current?.contains(target)) return;\n setOpen(false);\n };\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('mousedown', onDoc);\n document.removeEventListener('keydown', onKey);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, panelEl]);\n\n useEffect(() => {\n if (!isOpen || !closeOnScroll) return;\n const onScroll = () => setOpen(false);\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n return () => document.removeEventListener('scroll', onScroll, { capture: true });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, closeOnScroll]);\n\n useEffect(() => {\n if (!isOpen || !autoFocus || !panelEl) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n const focusable = panelEl.querySelector<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n );\n (focusable ?? panelEl).focus();\n return () => prevFocus?.focus?.();\n }, [isOpen, autoFocus, panelEl]);\n\n if (!isValidElement(children)) return children;\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n // Preserve whatever ref the consumer already attached to their trigger\n // element (e.g. a component forwarding its own ref through) by merging\n // it with the ref Popover needs internally for position measurement,\n // rather than clobbering it.\n const existingRef = (children as unknown as { ref?: Ref<HTMLElement> }).ref;\n\n const trigger = cloneElement(children, {\n // eslint-disable-next-line react-hooks/refs -- passes the ref objects themselves (React attaches them during commit, not a `.current` read during render)\n ref: mergeRefs(triggerRef, existingRef),\n onClick: (event: ReactMouseEvent) => {\n (childProps.onClick as ((e: ReactMouseEvent) => void) | undefined)?.(event);\n if (!event.defaultPrevented) setOpen(!isOpen);\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n } as Record<string, unknown>);\n\n const portalTarget = container ?? (typeof document !== 'undefined' ? document.body : null);\n\n return (\n <>\n {trigger}\n {isOpen &&\n portalTarget &&\n createPortal(\n <div\n ref={mergeRefs(setPanelEl)}\n id={contentId}\n role=\"dialog\"\n aria-label={typeof content === 'string' ? content : undefined}\n tabIndex={-1}\n data-side={resolvedSide}\n data-test-id={dataTestId}\n style={style}\n className={cn(\n 'fixed z-50 max-w-60 max-h-54 overflow-auto rounded-lg border border-border-default bg-bg-default p-3 text-fg-default shadow-z4',\n className,\n )}\n >\n {content}\n {showArrow && (\n <span\n aria-hidden\n style={arrowStyle}\n className={cn(\n 'absolute size-2 rotate-45 bg-bg-default',\n arrowBorderStyles[resolvedSide],\n )}\n />\n )}\n </div>,\n portalTarget,\n )}\n </>\n );\n}\n","import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Check, Copy as CopyIcon } from 'lucide-react';\nimport { Button } from '../Button';\nimport { Popover } from '../Popover';\nimport type { CopyProps } from './Copy.types';\n\nexport const Copy = forwardRef<HTMLButtonElement, CopyProps>(function Copy(\n {\n text,\n copiedLabel = 'Copied',\n label = 'Copy to clipboard',\n timeout = 1500,\n icon,\n onCopy,\n onError,\n disabled,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const canCopy = typeof navigator !== 'undefined' && typeof navigator.clipboard?.writeText === 'function';\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n const handleClick = () => {\n if (!canCopy) return;\n navigator.clipboard.writeText(text).then(\n () => {\n onCopy?.(text);\n setCopied(true);\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setCopied(false), timeout);\n },\n (err) => onError?.(err),\n );\n };\n\n return (\n <>\n <Popover open={copied} content={copiedLabel} side=\"top\" align=\"center\">\n <Button\n ref={ref}\n type=\"button\"\n variant=\"tertiary\"\n iconOnly\n size=\"sm\"\n disabled={disabled || !canCopy}\n onClick={handleClick}\n aria-label={label}\n dataTestId={dataTestId}\n {...rest}\n >\n {copied ? <Check className=\"size-4\" /> : icon ?? <CopyIcon className=\"size-4\" />}\n </Button>\n </Popover>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {copied ? copiedLabel : ''}\n </span>\n </>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { InputProps, InputSize } from './Input.types';\n\nconst sizeStyles: Record<InputSize, string> = {\n lg: 'h-12 text-p-md',\n md: 'h-10 text-p-std',\n sm: 'h-8 text-p-sm',\n};\n\nconst sidePaddingByIcon: Record<InputSize, string> = {\n lg: 'pl-10',\n md: 'pl-9',\n sm: 'pl-8',\n};\n\nconst sidePaddingByRightIcon: Record<InputSize, string> = {\n lg: 'pr-10',\n md: 'pr-9',\n sm: 'pr-8',\n};\n\nconst iconSlotSize: Record<InputSize, string> = {\n lg: 'w-10',\n md: 'w-9',\n sm: 'w-8',\n};\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n label,\n labelAddons,\n helperText,\n errorText,\n size = 'md',\n leftIcon,\n rightIcon,\n leftAddon,\n rightAddon,\n error = false,\n id,\n disabled,\n className,\n wrapperClassName,\n required,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const describedBy = errorText ? `${inputId}-error` : helperText ? `${inputId}-help` : undefined;\n const hasError = error || !!errorText;\n\n return (\n <div className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)} data-test-id={dataTestId}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <div\n className={cn(\n 'flex items-stretch w-full rounded-lg bg-bg-default transition-colors',\n 'border',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus-within:ring-2 focus-within:ring-offset-0',\n hasError\n ? 'focus-within:ring-red-300 focus-within:border-red-600'\n : 'focus-within:ring-brand-300 focus-within:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed',\n sizeStyles[size],\n )}\n >\n {leftAddon && (\n <span className=\"inline-flex items-center px-3 text-fg-secondary bg-bg-container border-r border-border-default rounded-l-lg whitespace-nowrap\">\n {leftAddon}\n </span>\n )}\n <div className=\"relative flex-1 min-w-0\">\n {leftIcon && (\n <span\n aria-hidden\n className={cn(\n 'absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none',\n iconSlotSize[size],\n )}\n >\n {leftIcon}\n </span>\n )}\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n required={required}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n className={cn(\n 'w-full h-full bg-transparent outline-none',\n 'placeholder:text-fg-tertiary text-fg-default',\n 'disabled:cursor-not-allowed disabled:text-fg-disabled',\n leftIcon ? sidePaddingByIcon[size] : 'pl-3',\n rightIcon || hasError ? sidePaddingByRightIcon[size] : 'pr-3',\n className,\n )}\n {...rest}\n />\n {(rightIcon || hasError) && (\n <span\n aria-hidden\n className={cn(\n 'absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none',\n iconSlotSize[size],\n hasError ? 'text-red-600' : 'text-fg-secondary',\n )}\n >\n {hasError ? <AlertCircle className=\"h-4 w-4\" /> : rightIcon}\n </span>\n )}\n </div>\n {rightAddon && (\n <span className=\"inline-flex items-center px-3 text-fg-secondary bg-bg-container border-l border-border-default rounded-r-lg whitespace-nowrap\">\n {rightAddon}\n </span>\n )}\n </div>\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { forwardRef, useEffect, useState, type ChangeEvent } from 'react';\nimport { Minus, Plus } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Input } from '../Input';\nimport type { CounterProps } from './Counter.types';\n\nconst addonButtonClass =\n 'inline-flex items-center justify-center text-fg-secondary transition-colors hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none';\n\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(function Counter(\n {\n value,\n defaultValue = 0,\n onValueChange,\n min = 0,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n size = 'md',\n label,\n helperText,\n errorText,\n error,\n disabled,\n className,\n wrapperClassName,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const committedValue = isControlled ? value : internalValue;\n\n // A plain string draft, separate from the committed numeric value — so\n // clearing the field doesn't immediately snap back to a number, and an\n // in-progress keystroke (e.g. a lone \"-\") isn't clobbered by clamping on\n // every change. Clamping happens once, on blur.\n const [draft, setDraft] = useState(String(committedValue));\n\n useEffect(() => {\n setDraft(String(committedValue));\n }, [committedValue]);\n\n const commit = (next: number) => {\n const clamped = Math.min(max, Math.max(min, next));\n if (!isControlled) setInternalValue(clamped);\n onValueChange?.(clamped);\n return clamped;\n };\n\n const increase = () => commit(committedValue + step);\n const decrease = () => commit(committedValue - step);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setDraft(event.target.value);\n };\n\n const handleBlur = () => {\n const parsed = Number.parseInt(draft, 10);\n if (Number.isNaN(parsed)) {\n setDraft(String(committedValue));\n return;\n }\n setDraft(String(commit(parsed)));\n };\n\n return (\n <Input\n ref={ref}\n type=\"number\"\n min={min}\n max={max}\n step={step}\n size={size}\n label={label}\n helperText={helperText}\n errorText={errorText}\n error={error}\n disabled={disabled}\n dataTestId={dataTestId}\n wrapperClassName={cn('max-w-[140px]', wrapperClassName)}\n value={draft}\n onChange={handleChange}\n onBlur={handleBlur}\n leftAddon={\n <button\n type=\"button\"\n disabled={disabled || committedValue <= min}\n onClick={decrease}\n aria-label=\"Decrease\"\n className={addonButtonClass}\n >\n <Minus className=\"size-4\" />\n </button>\n }\n rightAddon={\n <button\n type=\"button\"\n disabled={disabled || committedValue >= max}\n onClick={increase}\n aria-label=\"Increase\"\n className={addonButtonClass}\n >\n <Plus className=\"size-4\" />\n </button>\n }\n className={cn(\n 'text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n className,\n )}\n {...rest}\n />\n );\n});\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Calendar, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { DatePickerProps, DatePickerSize } from './DatePicker.types';\n\n// Heights, text sizes and horizontal padding mirror Input/Select exactly so a\n// DatePicker lines up with the other fields in a form grid.\nconst sizeStyles: Record<DatePickerSize, string> = {\n lg: 'h-12 text-p-md px-3.5',\n md: 'h-10 text-p-std px-3',\n sm: 'h-8 text-p-sm px-2.5',\n};\n\nconst MONTH_NAMES = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nconst DAY_NAMES = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];\n\nfunction startOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), 1);\n}\n\nfunction sameDay(a: Date | null, b: Date | null) {\n return (\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()\n );\n}\n\nfunction formatShort(date: Date) {\n return `${String(date.getDate()).padStart(2, '0')}.${String(date.getMonth() + 1).padStart(2, '0')}.${date.getFullYear()}`;\n}\n\nfunction buildGrid(view: Date) {\n const first = startOfMonth(view);\n const offset = (first.getDay() + 6) % 7; // Mon-first\n const daysInMonth = new Date(view.getFullYear(), view.getMonth() + 1, 0).getDate();\n const cells: (Date | null)[] = [];\n for (let i = 0; i < offset; i++) cells.push(null);\n for (let i = 1; i <= daysInMonth; i++) cells.push(new Date(view.getFullYear(), view.getMonth(), i));\n while (cells.length % 7 !== 0) cells.push(null);\n return cells;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(function DatePicker(\n {\n value,\n onChange,\n range = false,\n rangeValue,\n onChangeRange,\n size = 'md',\n label,\n placeholder = 'Select date',\n fullWidth = false,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const triggerId = id ?? reactId;\n const [open, setOpen] = useState(false);\n const [view, setView] = useState<Date>(value ?? rangeValue?.start ?? new Date());\n const [hoverEnd, setHoverEnd] = useState<Date | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onClick = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onClick);\n return () => document.removeEventListener('mousedown', onClick);\n }, [open]);\n\n const display = range\n ? rangeValue?.start\n ? `${formatShort(rangeValue.start)}${rangeValue.end ? ` – ${formatShort(rangeValue.end)}` : ''}`\n : ''\n : value\n ? formatShort(value)\n : '';\n\n function pick(date: Date) {\n if (!range) {\n onChange?.(date);\n setOpen(false);\n return;\n }\n const current = rangeValue ?? { start: null, end: null };\n if (!current.start || (current.start && current.end)) {\n onChangeRange?.({ start: date, end: null });\n return;\n }\n if (date < current.start) {\n onChangeRange?.({ start: date, end: current.start });\n return;\n }\n onChangeRange?.({ start: current.start, end: date });\n setOpen(false);\n }\n\n const cells = buildGrid(view);\n const currentRange = rangeValue ?? { start: null, end: null };\n const rangeEnd = currentRange.end ?? hoverEnd;\n\n return (\n <div\n ref={containerRef}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-1.5', fullWidth && 'w-full', wrapperClassName)}\n >\n {label && (\n <label htmlFor={triggerId} className=\"text-p-std font-medium text-fg-default inline-flex\">\n {label}\n </label>\n )}\n <div className=\"relative\">\n <button\n ref={ref}\n id={triggerId}\n type=\"button\"\n onClick={() => setOpen((v) => !v)}\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-default text-left transition-colors hover:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:border-brand-500',\n fullWidth ? 'w-full min-w-0' : 'min-w-[260px]',\n sizeStyles[size],\n className,\n )}\n >\n <span className={cn('flex-1 text-left truncate', display ? 'text-fg-default' : 'text-fg-tertiary')}>\n {display || placeholder}\n </span>\n <Calendar className=\"w-4 h-4 text-fg-secondary\" />\n </button>\n\n {open && (\n <div className=\"absolute z-50 mt-1 left-0 rounded-xl border border-border-default bg-bg-default shadow-z3 p-3 w-[300px]\">\n <div className=\"flex items-center justify-between mb-2\">\n <button\n type=\"button\"\n className=\"w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary\"\n onClick={() => setView(new Date(view.getFullYear(), view.getMonth() - 1, 1))}\n aria-label=\"Previous month\"\n >\n <ChevronLeft className=\"w-4 h-4\" />\n </button>\n <div className=\"text-p-md font-semibold text-fg-default\">\n {MONTH_NAMES[view.getMonth()]} {view.getFullYear()}\n </div>\n <button\n type=\"button\"\n className=\"w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary\"\n onClick={() => setView(new Date(view.getFullYear(), view.getMonth() + 1, 1))}\n aria-label=\"Next month\"\n >\n <ChevronRight className=\"w-4 h-4\" />\n </button>\n </div>\n <div className=\"grid grid-cols-7 gap-1 text-center\">\n {DAY_NAMES.map((day) => (\n <div key={day} className=\"text-p-xs text-fg-tertiary py-1\">\n {day}\n </div>\n ))}\n {cells.map((date, index) => {\n if (!date) return <div key={index} />;\n const isSelected = !range && sameDay(date, value ?? null);\n const isStart = range && sameDay(date, currentRange.start);\n const isEnd = range && sameDay(date, rangeEnd);\n const isInRange = range && !!currentRange.start && !!rangeEnd && date > currentRange.start && date < rangeEnd;\n const stateClassName =\n isSelected || isStart || isEnd\n ? 'bg-brand-500 text-white'\n : isInRange\n ? 'bg-bg-brand-lighter text-brand-700'\n : 'text-fg-default hover:bg-bg-container';\n return (\n <button\n key={index}\n type=\"button\"\n onMouseEnter={() => range && currentRange.start && !currentRange.end && setHoverEnd(date)}\n onClick={() => pick(date)}\n className={cn('h-8 rounded-md text-p-sm font-medium', stateClassName)}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { DistributionBarProps, DistributionBarSize, DistributionColor } from './DistributionBar.types';\n\nconst colorStyles: Record<DistributionColor, string> = {\n brand: 'bg-brand-500',\n blue: 'bg-blue-500',\n purple: 'bg-purple-500',\n pink: 'bg-pink-500',\n yellow: 'bg-yellow-500',\n red: 'bg-red-500',\n gray: 'bg-gray-400',\n};\n\nconst sizeStyles: Record<DistributionBarSize, string> = {\n sm: 'h-1',\n lg: 'h-2',\n};\n\nconst defaultFormatValue = (value: number) => new Intl.NumberFormat().format(value);\n\nexport const DistributionBar = forwardRef<HTMLDivElement, DistributionBarProps>(function DistributionBar(\n {\n segments,\n hideLegend = false,\n formatValue = defaultFormatValue,\n size = 'lg',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const total = segments.reduce((sum, segment) => sum + segment.value, 0);\n\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-3', className)} {...rest}>\n <div className={cn('flex w-full overflow-hidden rounded-full bg-bg-subtle', sizeStyles[size])}>\n {segments.map((segment, index) => {\n const percent = total > 0 ? (segment.value / total) * 100 : 0;\n return (\n <div\n key={index}\n style={{ flexBasis: `${percent}%` }}\n className={cn('transition-[flex-basis] duration-700 ease-out', colorStyles[segment.color])}\n />\n );\n })}\n </div>\n {!hideLegend && (\n <ul className=\"flex flex-col [&>li:not(:last-child)]:border-b [&>li:not(:last-child)]:border-border-default\">\n {segments\n .filter((segment) => !segment.hideFromLegend)\n .map((segment, index) => (\n <li key={index} className=\"flex items-center justify-between gap-3 py-1.5\">\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className={cn('size-2 shrink-0 rounded-full', colorStyles[segment.color])} />\n <span className=\"truncate text-p-sm text-fg-tertiary\">{segment.label}</span>\n </span>\n <span className=\"shrink-0 text-p-sm text-fg-default tabular-nums\">\n {formatValue(segment.value)}\n {segment.unit ? ` ${segment.unit}` : ''}\n </span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n});\n","/** Durations in ms for JS-driven transition timing (mount/unmount\n * orchestration). Kept in sync by hand with the Tailwind `duration-*`\n * utilities used alongside them in component classes — same\n * two-parallel-representations discipline as the token pipeline. */\nexport const MOTION_DURATION = {\n fast: 150,\n base: 200,\n slow: 300,\n} as const;\n\n/** True when the user has asked for reduced motion. SSR-safe. */\nexport function prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { prefersReducedMotion } from './motion';\n\nexport type TransitionState = 'closed' | 'entering' | 'entered' | 'exiting';\n\n/** Keeps a node mounted through its exit transition instead of unmounting\n * the instant `open` goes false.\n * - `open` false -> true: `mounted` becomes `true` immediately, `state`\n * is `'entering'`, then flips to `'entered'` after *two* animation\n * frames — a single `requestAnimationFrame` fires before the browser\n * has actually painted the `'entering'` styles (React's commit, this\n * effect, and that one callback can all still land inside the same\n * frame), so the flip to `'entered'` can end up coalesced into the\n * same paint and never visibly transition. Waiting a full frame first\n * guarantees the browser paints the from-state at least once before\n * the to-state is applied, which is what makes a CSS transition\n * actually animate instead of jumping straight to its end value.\n * - `open` true -> false: `state` becomes `'exiting'`; `mounted` stays\n * `true` for `durationMs`, then both flip to `'closed'`/`false`.\n * - Honors `prefers-reduced-motion` by collapsing `durationMs` to `0`, so\n * a reduced-motion user never waits on an invisible mounted node. */\nexport function useMountTransition(\n open: boolean,\n durationMs: number,\n): { mounted: boolean; state: TransitionState } {\n const [mounted, setMounted] = useState(open);\n const [state, setState] = useState<TransitionState>(open ? 'entered' : 'closed');\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n\n const applyOpen = () => {\n setMounted(true);\n setState('entering');\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => setState('entered'));\n });\n };\n\n const applyClosed = () => {\n setState((prev) => (prev === 'closed' ? 'closed' : 'exiting'));\n const duration = prefersReducedMotion() ? 0 : durationMs;\n if (duration === 0) {\n setMounted(false);\n setState('closed');\n } else {\n timeoutRef.current = setTimeout(() => {\n setMounted(false);\n setState('closed');\n }, duration);\n }\n };\n\n if (open) {\n applyOpen();\n } else {\n applyClosed();\n }\n }, [open, durationMs]);\n\n useEffect(\n () => () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n },\n [],\n );\n\n return { mounted, state };\n}\n","import { forwardRef, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { MOTION_DURATION } from '../../lib/motion';\nimport { useMountTransition } from '../../lib/useMountTransition';\nimport type { DrawerProps, DrawerSide, DrawerSize } from './Drawer.types';\n\nconst horizontalSize: Record<DrawerSize, string> = {\n sm: 'w-[320px]',\n md: 'w-[420px]',\n lg: 'w-[560px]',\n xl: 'w-[720px]',\n};\n\nconst verticalSize: Record<DrawerSize, string> = {\n sm: 'h-[240px]',\n md: 'h-[360px]',\n lg: 'h-[480px]',\n xl: 'h-[600px]',\n};\n\nconst sideClasses: Record<DrawerSide, string> = {\n right: 'inset-y-0 right-0 border-l',\n left: 'inset-y-0 left-0 border-r',\n top: 'inset-x-0 top-0 border-b',\n bottom: 'inset-x-0 bottom-0 border-t',\n};\n\nconst offscreenClasses: Record<DrawerSide, string> = {\n right: 'translate-x-full',\n left: '-translate-x-full',\n top: '-translate-y-full',\n bottom: 'translate-y-full',\n};\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n open,\n onClose,\n side = 'right',\n size = 'md',\n title,\n description,\n children,\n footer,\n closeOnOverlayClick = true,\n showClose = true,\n animated = true,\n headerActions,\n className,\n dataTestId,\n },\n ref,\n) {\n const panelRef = useRef<HTMLDivElement>(null);\n const { mounted, state } = useMountTransition(open, animated ? MOTION_DURATION.slow : 0);\n const shown = state === 'entered';\n\n // Scroll lock spans the full mounted window (including the exit\n // animation) so the page doesn't jump before the drawer finishes\n // sliding away. Focus restore fires as soon as `open` goes false,\n // instead — otherwise the user's focus would sit on a drawer that's\n // already sliding off-screen for the length of the exit transition.\n useEffect(() => {\n if (!mounted) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n };\n document.addEventListener('keydown', onKey);\n const prev = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = prev;\n };\n }, [mounted, onClose]);\n\n useEffect(() => {\n if (!open) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n panelRef.current?.focus();\n return () => prevFocus?.focus?.();\n }, [open]);\n\n if (!mounted) return null;\n\n const isHorizontal = side === 'left' || side === 'right';\n const sizeCls = isHorizontal ? horizontalSize[size] : verticalSize[size];\n\n const content = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={state === 'exiting' || undefined}\n aria-labelledby={title ? 'drawer-title' : undefined}\n aria-describedby={description ? 'drawer-desc' : undefined}\n className=\"fixed inset-0 z-50\"\n data-test-id={dataTestId}\n >\n <div\n className={cn(\n 'absolute inset-0 bg-black/50',\n animated && 'transition-opacity duration-200 motion-reduce:transition-none',\n shown ? 'opacity-100' : 'opacity-0',\n )}\n onClick={() => closeOnOverlayClick && onClose()}\n aria-hidden\n />\n <div\n ref={mergeRefs(ref, panelRef)}\n tabIndex={-1}\n className={cn(\n 'absolute bg-bg-default shadow-z5 outline-none flex flex-col',\n sideClasses[side],\n isHorizontal ? `${sizeCls} h-full max-w-full` : `${sizeCls} w-full max-h-full`,\n 'border-border-default',\n animated && 'transition-transform duration-300 ease-out motion-reduce:transition-none will-change-transform',\n shown ? 'translate-x-0 translate-y-0' : offscreenClasses[side],\n className,\n )}\n >\n {(title || showClose || headerActions) && (\n <div className=\"flex items-start justify-between gap-4 px-6 pt-6 pb-4 border-b border-border-default\">\n <div className=\"flex-1 min-w-0\">\n {title && (\n <h2 id=\"drawer-title\" className=\"text-h-xs font-semibold text-fg-default\">\n {title}\n </h2>\n )}\n {description && (\n <p id=\"drawer-desc\" className=\"mt-1 text-p-std text-fg-secondary\">\n {description}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1 shrink-0 -mr-2 -mt-2\">\n {headerActions}\n {showClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-5 w-5\" />\n </button>\n )}\n </div>\n </div>\n )}\n {children && <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>}\n {footer && (\n <div className=\"flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n});\n","import { useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nexport type AnchoredSide = 'bottom' | 'top';\nexport type AnchoredAlign = 'start' | 'end';\n\nexport interface UseAnchoredPositionOptions {\n /** A ref pointing at the anchor element, read fresh on every recompute —\n * never dereferenced by the caller, so the caller never has to read\n * `.current` during render or copy it into its own state. */\n anchor: RefObject<HTMLElement | null> | null | undefined;\n panel: HTMLElement | null;\n open: boolean;\n /** Preferred side. Flips to the opposite side when there isn't room, unless `flip` is false. */\n side?: AnchoredSide;\n align?: AnchoredAlign;\n offset?: number;\n flip?: boolean;\n /** Clamp the panel horizontally so it stays inside the viewport. */\n shift?: boolean;\n matchAnchorWidth?: boolean;\n}\n\nexport interface AnchoredPosition {\n style: CSSProperties;\n /** The side actually used, after flipping — for `data-side` and animation origin. */\n resolvedSide: AnchoredSide;\n}\n\nconst VIEWPORT_MARGIN = 8;\n\n/** Computes `position: fixed` coordinates for a panel anchored to a trigger\n * element, so the panel can portal to `document.body` without being\n * clipped by an `overflow: hidden` ancestor. Recomputes on open, resize,\n * and any ancestor scroll (capture-phase, since `position: fixed`\n * coordinates are viewport-relative and unaffected by scroll offset\n * themselves — but the anchor's rect moves when something scrolls). */\nexport function useAnchoredPosition({\n anchor,\n panel,\n open,\n side = 'bottom',\n align = 'start',\n offset = 4,\n flip = true,\n shift = true,\n matchAnchorWidth = false,\n}: UseAnchoredPositionOptions): AnchoredPosition {\n const [position, setPosition] = useState<AnchoredPosition>({\n style: { position: 'fixed', top: 0, left: 0, visibility: 'hidden' },\n resolvedSide: side,\n });\n\n useLayoutEffect(() => {\n if (!open || !panel) return;\n\n const compute = () => {\n const anchorEl = anchor?.current;\n if (!anchorEl) return;\n const anchorRect = anchorEl.getBoundingClientRect();\n const panelRect = panel.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n let resolvedSide = side;\n if (flip) {\n const spaceBelow = viewportHeight - anchorRect.bottom;\n const spaceAbove = anchorRect.top;\n if (side === 'bottom' && spaceBelow < panelRect.height + offset && spaceAbove > spaceBelow) {\n resolvedSide = 'top';\n } else if (side === 'top' && spaceAbove < panelRect.height + offset && spaceBelow > spaceAbove) {\n resolvedSide = 'bottom';\n }\n }\n\n const top =\n resolvedSide === 'bottom' ? anchorRect.bottom + offset : anchorRect.top - panelRect.height - offset;\n\n let left = align === 'end' ? anchorRect.right - panelRect.width : anchorRect.left;\n if (shift) {\n left = Math.min(Math.max(left, VIEWPORT_MARGIN), viewportWidth - panelRect.width - VIEWPORT_MARGIN);\n }\n\n setPosition({\n style: {\n position: 'fixed',\n top,\n left,\n minWidth: matchAnchorWidth ? anchorRect.width : undefined,\n },\n resolvedSide,\n });\n };\n\n compute();\n window.addEventListener('resize', compute);\n document.addEventListener('scroll', compute, { capture: true, passive: true });\n return () => {\n window.removeEventListener('resize', compute);\n document.removeEventListener('scroll', compute, { capture: true });\n };\n }, [open, anchor, panel, side, align, offset, flip, shift, matchAnchorWidth]);\n\n return position;\n}\n","import {\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type RefObject,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { Check } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { useAnchoredPosition } from '../../lib/useAnchoredPosition';\nimport type {\n DropdownContentProps,\n DropdownItemProps,\n DropdownLabelProps,\n DropdownMenuProps,\n DropdownSeparatorProps,\n DropdownTriggerProps,\n} from './DropdownMenu.types';\n\ninterface DropdownCtx {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n anchorRef?: RefObject<HTMLElement | null>;\n}\n\nconst DropdownContext = createContext<DropdownCtx | null>(null);\n\nfunction useDropdown() {\n const ctx = useContext(DropdownContext);\n if (!ctx) throw new Error('Dropdown parts must be used inside <DropdownMenu>');\n return ctx;\n}\n\nexport const DropdownMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function DropdownMenu(\n { children, defaultOpen = false, open, onOpenChange, anchorRef, className, dataTestId, ...rest },\n ref,\n) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : internalOpen;\n const triggerRef = useRef<HTMLElement | null>(null);\n\n const setOpen = (value: boolean) => {\n if (!isControlled) setInternalOpen(value);\n onOpenChange?.(value);\n };\n\n useEffect(() => {\n if (!current) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current]);\n\n return (\n <DropdownContext.Provider value={{ open: current, setOpen, triggerRef, anchorRef }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('relative inline-block', className)}\n {...rest}\n >\n {children}\n </div>\n </DropdownContext.Provider>\n );\n});\n\nexport function DropdownTrigger({ children }: DropdownTriggerProps) {\n const { open, setOpen, triggerRef } = useDropdown();\n if (!isValidElement(children)) return children;\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n\n return cloneElement(children, {\n ref: triggerRef,\n onClick: (e: ReactMouseEvent) => {\n const orig = childProps.onClick as ((e: ReactMouseEvent) => void) | undefined;\n orig?.(e);\n if (!e.defaultPrevented) setOpen(!open);\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n } as Record<string, unknown>);\n}\n\nconst panelBaseClass =\n 'min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1';\n\nexport const DropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(\n function DropdownContent(\n {\n children,\n align = 'start',\n strategy = 'fixed',\n side = 'bottom',\n sideOffset = 4,\n flip = true,\n shift = true,\n matchTriggerWidth = false,\n closeOnScroll = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) {\n const { open, setOpen, triggerRef, anchorRef } = useDropdown();\n const contentRef = useRef<HTMLDivElement>(null);\n const [panelEl, setPanelEl] = useState<HTMLDivElement | null>(null);\n // Picking which ref object to measure from — not reading `.current` —\n // so this stays a plain render-time choice, not a ref access.\n const positionAnchorRef = anchorRef ?? triggerRef;\n\n const { style, resolvedSide } = useAnchoredPosition({\n anchor: positionAnchorRef,\n panel: panelEl,\n open: open && strategy === 'fixed',\n side,\n align,\n offset: sideOffset,\n flip,\n shift,\n matchAnchorWidth: matchTriggerWidth,\n });\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n const target = e.target as Node;\n if (contentRef.current?.contains(target)) return;\n if (triggerRef.current?.contains(target)) return;\n if (anchorRef?.current?.contains(target)) return;\n setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open, setOpen, triggerRef, anchorRef]);\n\n useEffect(() => {\n if (!open || !closeOnScroll) return;\n const onScroll = () => setOpen(false);\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n return () => document.removeEventListener('scroll', onScroll, { capture: true });\n }, [open, closeOnScroll, setOpen]);\n\n useEffect(() => {\n if (!open) return;\n const raf = requestAnimationFrame(() => {\n const first = contentRef.current?.querySelector<HTMLElement>('[role=\"menuitem\"]:not(:disabled)');\n first?.focus();\n });\n return () => cancelAnimationFrame(raf);\n }, [open]);\n\n if (!open) return null;\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const items = Array.from(\n contentRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]:not(:disabled)') ?? [],\n );\n if (!items.length) return;\n const currentIndex = items.indexOf(document.activeElement as HTMLElement);\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n items[(currentIndex + 1 + items.length) % items.length]?.focus();\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n items[(currentIndex - 1 + items.length) % items.length]?.focus();\n } else if (event.key === 'Home') {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === 'End') {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const panel = (\n <div\n ref={mergeRefs(ref, contentRef, strategy === 'fixed' ? setPanelEl : undefined)}\n role=\"menu\"\n data-test-id={dataTestId}\n data-side={strategy === 'fixed' ? resolvedSide : undefined}\n data-align={align}\n onKeyDown={handleKeyDown}\n style={strategy === 'fixed' ? style : undefined}\n className={cn(\n panelBaseClass,\n strategy === 'absolute' && cn('absolute top-full mt-1', align === 'end' ? 'right-0' : 'left-0'),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n\n return strategy === 'fixed' ? createPortal(panel, document.body) : panel;\n },\n);\n\nexport const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(function DropdownItem(\n {\n children,\n onSelect,\n disabled,\n icon,\n shortcut,\n destructive,\n checked,\n meta,\n className,\n dataTestId,\n onClick,\n ...rest\n },\n ref,\n) {\n const { setOpen } = useDropdown();\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={disabled}\n data-test-id={dataTestId}\n onClick={(event) => {\n onClick?.(event);\n onSelect?.();\n setOpen(false);\n }}\n className={cn(\n 'flex w-full gap-2 px-3 py-2 text-left text-p-std text-fg-default',\n meta ? 'items-start' : 'items-center',\n 'hover:bg-bg-subtle focus-visible:outline-none focus-visible:bg-bg-subtle',\n disabled && 'opacity-50 cursor-not-allowed hover:bg-transparent',\n destructive && 'text-red-700 hover:bg-red-50',\n className,\n )}\n {...rest}\n >\n {checked !== undefined && (\n <span className=\"w-4 shrink-0\">{checked && <Check className=\"h-4 w-4 text-brand-500\" />}</span>\n )}\n {icon && <span className=\"inline-flex shrink-0 text-fg-secondary\">{icon}</span>}\n <span className=\"flex-1 min-w-0 text-left\">\n <span className=\"block truncate\">{children}</span>\n {meta && <span className=\"block truncate text-p-sm text-fg-tertiary\">{meta}</span>}\n </span>\n {shortcut && <span className=\"text-p-sm text-fg-tertiary shrink-0 tabular-nums\">{shortcut}</span>}\n </button>\n );\n});\n\nexport const DropdownSeparator = forwardRef<HTMLDivElement, DropdownSeparatorProps>(\n function DropdownSeparator({ className, dataTestId, ...rest }, ref) {\n return (\n <div\n ref={ref}\n role=\"separator\"\n data-test-id={dataTestId}\n className={cn('my-1 h-px bg-border-default', className)}\n {...rest}\n />\n );\n },\n);\n\nexport const DropdownLabel = forwardRef<HTMLDivElement, DropdownLabelProps>(function DropdownLabel(\n { children, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'px-3 py-1.5 text-p-xs font-semibold uppercase tracking-wider text-fg-tertiary',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { IconTileProps, IconTileSize, IconTileTone } from './IconTile.types';\n\n/* Background + icon-color pairs, legible on both light and dark surfaces.\n * Uses semantic bg-*-lighter aliases where available (they flip in dark\n * mode automatically via theme.css's `.dark` block). Purple and pink have\n * no semantic \"lighter\" alias yet, so they fall back to raw scale shades\n * with explicit `dark:` variants, same as the source design system.\n */\nconst toneStyles: Record<IconTileTone, { bg: string; icon: string }> = {\n brand: { bg: 'bg-bg-brand-lighter', icon: 'text-brand-700' },\n info: { bg: 'bg-bg-info-lighter', icon: 'text-blue-700' },\n gray: { bg: 'bg-bg-subtle', icon: 'text-fg-tertiary' },\n purple: { bg: 'bg-purple-50 dark:bg-purple-900/30', icon: 'text-purple-700 dark:text-purple-300' },\n pink: { bg: 'bg-pink-50 dark:bg-pink-900/30', icon: 'text-pink-700 dark:text-pink-300' },\n yellow: { bg: 'bg-bg-warning-lighter', icon: 'text-yellow-800' },\n success: { bg: 'bg-bg-success-lighter', icon: 'text-green-600' },\n warning: { bg: 'bg-bg-warning-lighter', icon: 'text-yellow-800' },\n danger: { bg: 'bg-bg-danger-lighter', icon: 'text-red-700' },\n};\n\n// Dimensions/icon size per step, plus the radius used for the `rounded`\n// shape. The `circle` shape reuses the same box/icon sizing and just swaps\n// in `rounded-full` instead — see the className below.\nconst sizeStyles: Record<IconTileSize, { box: string; icon: string; radius: string }> = {\n sm: { box: 'h-8 w-8', icon: 'h-4 w-4', radius: 'rounded-md' },\n md: { box: 'h-10 w-10', icon: 'h-5 w-5', radius: 'rounded-lg' },\n lg: { box: 'h-12 w-12', icon: 'h-6 w-6', radius: 'rounded-lg' },\n xl: { box: 'h-14 w-14', icon: 'h-7 w-7', radius: 'rounded-xl' },\n};\n\nexport const IconTile = forwardRef<HTMLDivElement, IconTileProps>(function IconTile(\n {\n icon: Icon,\n tone = 'gray',\n size = 'md',\n shape = 'rounded',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const t = toneStyles[tone];\n const s = sizeStyles[size];\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n aria-hidden={rest['aria-label'] ? undefined : true}\n className={cn(\n 'inline-flex items-center justify-center shrink-0',\n s.box,\n shape === 'circle' ? 'rounded-full' : s.radius,\n t.bg,\n className,\n )}\n {...rest}\n >\n <Icon className={cn(s.icon, t.icon)} />\n </div>\n );\n});\n","import { createElement, forwardRef, type ElementType } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TextProps, TextVariant, TextWeight, TextColor } from './Text.types';\n\nconst variantClass: Record<TextVariant, string> = {\n 'h-xl': 'text-h-xl',\n 'h-lg': 'text-h-lg',\n 'h-md': 'text-h-md',\n 'h-std': 'text-h-std',\n 'h-sm': 'text-h-sm',\n 'h-xs': 'text-h-xs',\n 'p-lg': 'text-p-lg',\n 'p-md': 'text-p-md',\n 'p-std': 'text-p-std',\n 'p-sm': 'text-p-sm',\n 'p-xs': 'text-p-xs',\n 'label-lg': 'text-label-lg',\n 'label-md': 'text-label-md',\n 'label-std': 'text-label-std',\n 'label-sm': 'text-label-sm',\n 'label-xs': 'text-label-xs',\n 'label-xxs': 'text-label-xxs',\n};\n\nconst weightClass: Record<TextWeight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nconst colorClass: Record<TextColor, string> = {\n default: 'text-fg-default',\n secondary: 'text-fg-secondary',\n tertiary: 'text-fg-tertiary',\n disabled: 'text-fg-disabled',\n inverse: 'text-fg-inverse',\n brand: 'text-fg-brand',\n info: 'text-fg-info',\n success: 'text-fg-success',\n warning: 'text-fg-warning',\n danger: 'text-fg-danger',\n};\n\n/** Sensible default element for each variant (can be overridden with `as`). */\nconst defaultAs: Record<TextVariant, ElementType> = {\n 'h-xl': 'h1',\n 'h-lg': 'h1',\n 'h-md': 'h2',\n 'h-std': 'h3',\n 'h-sm': 'h4',\n 'h-xs': 'h5',\n 'p-lg': 'p',\n 'p-md': 'p',\n 'p-std': 'p',\n 'p-sm': 'p',\n 'p-xs': 'p',\n 'label-lg': 'span',\n 'label-md': 'span',\n 'label-std': 'span',\n 'label-sm': 'span',\n 'label-xs': 'span',\n 'label-xxs': 'span',\n};\n\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n { variant = 'p-std', weight, color = 'default', as, truncate, clamp, style, className, children, dataTestId, ...rest },\n ref,\n) {\n const Component = as ?? defaultAs[variant];\n return createElement(\n Component,\n {\n ref,\n 'data-test-id': dataTestId,\n className: cn(\n variantClass[variant],\n weight && weightClass[weight],\n colorClass[color],\n truncate && 'truncate',\n clamp && !truncate && 'overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]',\n className,\n ),\n style: clamp && !truncate ? { ...style, WebkitLineClamp: clamp } : style,\n ...rest,\n },\n children,\n );\n});\n","import { forwardRef } from 'react';\nimport { SearchX } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { IconTile } from '../IconTile';\nimport { Text } from '../Text';\nimport type { EmptyProps, EmptySize } from './Empty.types';\n\nconst containerStyles: Record<EmptySize, string> = {\n lg: 'py-20 px-6 gap-2',\n sm: 'py-10 px-4 gap-1',\n};\n\nconst illustrationSize: Record<EmptySize, 'lg' | 'xl'> = {\n lg: 'xl',\n sm: 'lg',\n};\n\nexport const Empty = forwardRef<HTMLDivElement, EmptyProps>(function Empty(\n { size = 'lg', title, description, illustration, action, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex flex-col items-center justify-center text-center', containerStyles[size], className)}\n {...rest}\n >\n {illustration ?? <IconTile icon={SearchX} tone=\"gray\" shape=\"circle\" size={illustrationSize[size]} />}\n {title && (\n <Text as=\"h3\" variant={size === 'lg' ? 'h-sm' : 'h-xs'} weight=\"semibold\" className=\"mt-2\">\n {title}\n </Text>\n )}\n {description && (\n <Text variant={size === 'lg' ? 'p-sm' : 'p-xs'} color=\"secondary\" className=\"max-w-sm\">\n {description}\n </Text>\n )}\n {action && <div className=\"mt-4\">{action}</div>}\n </div>\n );\n});\n","import { forwardRef, useEffect, useRef, useState, type Ref } from 'react';\nimport { ChevronDown, X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { FilterProps, FilterSize } from './Filter.types';\n\nconst sizeStyles: Record<FilterSize, string> = {\n lg: 'h-10 px-3 text-p-std gap-2',\n md: 'h-9 px-2.5 text-p-std gap-1.5',\n sm: 'h-8 px-2 text-p-sm gap-1.5',\n};\n\n// No shared ref-merge helper exists in the library yet; this keeps the\n// forwarded consumer ref and the internal outside-click ref pointing at the\n// same wrapper node without adding a new dependency.\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (node: T | null) => void {\n return (node) => {\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\nexport const Filter = forwardRef<HTMLDivElement, FilterProps>(function Filter(\n {\n label,\n value,\n active = false,\n size = 'md',\n disabled,\n onClear,\n children,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n if (!wrapperRef.current?.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open]);\n\n const isActive = active || value !== undefined;\n\n return (\n <div\n ref={mergeRefs(ref, wrapperRef)}\n data-test-id={dataTestId}\n className={cn('relative inline-flex', className)}\n {...rest}\n >\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={cn(\n 'inline-flex items-center rounded-full border transition-colors outline-none',\n sizeStyles[size],\n isActive\n ? 'bg-brand-20 text-brand-800 border-brand-500'\n : 'bg-bg-default text-fg-default border-border-default',\n !disabled && 'hover:border-border-strong',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n disabled && 'bg-bg-container text-fg-disabled cursor-not-allowed',\n )}\n >\n <span className=\"font-medium\">{label}</span>\n {value !== undefined && (\n <>\n <span className=\"mx-0.5 text-fg-tertiary\" aria-hidden>\n •\n </span>\n <span className=\"font-semibold truncate max-w-[140px]\">{value}</span>\n </>\n )}\n {isActive && onClear ? (\n <span\n role=\"button\"\n tabIndex={0}\n aria-label=\"Clear filter\"\n onClick={(e) => {\n e.stopPropagation();\n onClear();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n onClear();\n }\n }}\n className=\"inline-flex items-center justify-center rounded-full p-0.5 hover:bg-black/10\"\n >\n <X className=\"h-3 w-3\" />\n </span>\n ) : (\n <ChevronDown\n className={cn('h-4 w-4 text-fg-secondary transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n )}\n </button>\n {open && children && (\n <div className=\"absolute left-0 top-full mt-1 min-w-[220px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 p-3\">\n {children}\n </div>\n )}\n </div>\n );\n});\n","import { createContext } from 'react';\nimport type {\n Control,\n FieldErrors,\n FieldValues,\n UseFormClearErrors,\n UseFormGetFieldState,\n UseFormGetValues,\n UseFormRegister,\n UseFormReset,\n UseFormSetError,\n UseFormSetValue,\n UseFormTrigger,\n UseFormUnregister,\n UseFormWatch,\n} from 'react-hook-form';\n\nexport interface FormContextValue {\n control: Control<FieldValues>;\n register: UseFormRegister<FieldValues>;\n errors: FieldErrors<FieldValues>;\n setValue: UseFormSetValue<FieldValues>;\n getValues: UseFormGetValues<FieldValues>;\n watch: UseFormWatch<FieldValues>;\n reset: UseFormReset<FieldValues>;\n trigger: UseFormTrigger<FieldValues>;\n clearErrors: UseFormClearErrors<FieldValues>;\n setError: UseFormSetError<FieldValues>;\n getFieldState: UseFormGetFieldState<FieldValues>;\n unregister: UseFormUnregister<FieldValues>;\n isDirty: boolean;\n isSubmitted: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n dirtyFields: Partial<Readonly<Record<string, boolean>>>;\n submit: () => void;\n}\n\nexport const FormContext = createContext<FormContextValue | null>(null);\n","import { forwardRef } from 'react';\nimport { useForm, type FieldValues } from 'react-hook-form';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport { cn } from '../../lib/cn';\nimport { FormContext, type FormContextValue } from '../../lib/FormContext';\nimport { Button } from '../Button';\nimport type { FormContainerProps } from './FormContainer.types';\n\nexport const FormContainer = forwardRef<HTMLFormElement, FormContainerProps>(function FormContainer(\n {\n children,\n className,\n validationSchema,\n defaultValues,\n buttons,\n mode = 'onBlur',\n shouldUnregister,\n shouldFocusError = true,\n formId,\n onSubmit,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const {\n handleSubmit,\n register,\n setValue,\n control,\n formState,\n getValues,\n watch,\n reset,\n clearErrors,\n setError,\n trigger,\n getFieldState,\n unregister,\n } = useForm<FieldValues>({\n mode,\n resolver: yupResolver(validationSchema),\n defaultValues,\n shouldFocusError,\n shouldUnregister,\n });\n\n const { errors, isDirty, isSubmitted, isSubmitting, dirtyFields, isValid } = formState;\n\n const submit = handleSubmit((data) => {\n onSubmit?.(data, formState);\n });\n\n const contextValue: FormContextValue = {\n control,\n register,\n errors,\n setValue,\n getValues,\n watch,\n reset,\n trigger,\n clearErrors,\n setError,\n getFieldState,\n unregister,\n isDirty,\n isSubmitted,\n isSubmitting,\n isValid,\n dirtyFields,\n submit,\n };\n\n return (\n <form\n ref={ref}\n id={formId}\n onSubmit={submit}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-4', className)}\n {...rest}\n >\n <FormContext.Provider value={contextValue}>\n {children}\n {buttons && buttons.length > 0 && (\n <div className=\"flex items-center gap-3\" data-test-id={dataTestId ? `${dataTestId}-buttons` : undefined}>\n {buttons.map((buttonProps, index) => (\n <Button key={index} {...buttonProps} />\n ))}\n </div>\n )}\n </FormContext.Provider>\n </form>\n );\n});\n","import { forwardRef, useContext } from 'react';\nimport { Controller } from 'react-hook-form';\nimport { cn } from '../../lib/cn';\nimport { FormContext } from '../../lib/FormContext';\nimport type { FormFieldProps } from './FormField.types';\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n { name, defaultValue, render, className, dataTestId, ...rest },\n ref,\n) {\n const context = useContext(FormContext);\n\n if (!context) {\n throw new Error('FormField must be rendered inside a FormContainer.');\n }\n\n return (\n <div ref={ref} className={cn(className)} data-test-id={dataTestId} {...rest}>\n <Controller\n control={context.control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) =>\n render({\n ...field,\n error: !!fieldState.error,\n errorText: fieldState.error?.message,\n dataTestId,\n })\n }\n />\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport { IconTile } from '../IconTile';\nimport type { InfoFieldProps } from './InfoField.types';\n\n/* Labeled value row with a leading tinted icon, uppercase label, value,\n * and an optional action slot on the right. The General Information block\n * on the Profile page uses this primitive; settings / contact / payroll\n * detail pages reach for the same shape. */\n\nexport const InfoField = forwardRef<HTMLDivElement, InfoFieldProps>(function InfoField(\n { icon, iconTone = 'brand', label, value, action, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex items-start gap-3', className)} {...rest}>\n <IconTile icon={icon} tone={iconTone} size=\"md\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-p-xs font-medium uppercase tracking-widest text-fg-tertiary\">{label}</div>\n <div className=\"text-p-std font-semibold text-fg-default mt-1 break-words\">{value}</div>\n </div>\n {action && <div className=\"shrink-0 flex items-center\">{action}</div>}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { CheckCircle2, AlertTriangle, XCircle, Info, Sparkles, X, type LucideIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { InlineAlertProps, InlineAlertVariant } from './InlineAlert.types';\n\nconst variantStyles: Record<\n InlineAlertVariant,\n { container: string; iconColor: string; DefaultIcon: LucideIcon }\n> = {\n success: {\n container: 'bg-green-50 border-green-200',\n iconColor: 'text-green-600',\n DefaultIcon: CheckCircle2,\n },\n warning: {\n container: 'bg-yellow-50 border-yellow-200',\n iconColor: 'text-yellow-800',\n DefaultIcon: AlertTriangle,\n },\n danger: {\n container: 'bg-red-50 border-red-200',\n iconColor: 'text-red-700',\n DefaultIcon: XCircle,\n },\n info: {\n container: 'bg-blue-50 border-blue-200',\n iconColor: 'text-blue-700',\n DefaultIcon: Info,\n },\n discovery: {\n container: 'bg-purple-50 border-purple-200',\n iconColor: 'text-purple-700',\n DefaultIcon: Sparkles,\n },\n};\n\nexport const InlineAlert = forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { variant = 'info', title, description, onDismiss, actions, icon, className, dataTestId, ...rest },\n ref,\n) {\n const { container, iconColor, DefaultIcon } = variantStyles[variant];\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-test-id={dataTestId}\n className={cn('flex gap-3 p-4 border rounded-lg', container, className)}\n {...rest}\n >\n <div className={cn('flex-shrink-0 mt-0.5', iconColor)}>\n {icon ?? <DefaultIcon className=\"h-5 w-5\" aria-hidden />}\n </div>\n <div className=\"flex-1 min-w-0\">\n {title && <div className=\"text-p-std font-semibold text-fg-default mb-0.5\">{title}</div>}\n {description && <div className=\"text-p-std text-fg-secondary\">{description}</div>}\n {actions && <div className=\"mt-3 flex flex-wrap items-center gap-2\">{actions}</div>}\n </div>\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n className=\"flex-shrink-0 -mr-1 -mt-1 p-1 rounded-md text-fg-secondary hover:text-fg-default hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n );\n});\n","import { forwardRef, type Ref } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Text } from '../Text';\nimport type { LinkProps } from './Link.types';\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n {\n variant = 'p-std',\n weight,\n color = 'brand',\n underline = 'hover',\n leftIcon,\n rightIcon,\n truncate,\n className,\n children,\n dataTestId,\n target,\n rel,\n ...rest\n },\n ref,\n) {\n const anchorRest = {\n ...rest,\n target,\n rel: rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined),\n };\n\n return (\n <Text\n as=\"a\"\n ref={ref as Ref<HTMLElement>}\n variant={variant}\n weight={weight}\n color={color}\n truncate={truncate}\n dataTestId={dataTestId}\n className={cn(\n 'inline-flex items-center gap-1 rounded-sm outline-none transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n underline === 'always' && 'underline',\n underline === 'hover' && 'hover:underline',\n className,\n )}\n {...anchorRest}\n >\n {leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </Text>\n );\n});\n","import { forwardRef, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport type { ModalProps, ModalSize } from './Modal.types';\n\nconst sizeStyles: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-md',\n lg: 'max-w-lg',\n xl: 'max-w-2xl',\n '2xl': 'max-w-4xl',\n};\n\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n title,\n description,\n children,\n footer,\n size = 'md',\n closeOnOverlayClick = true,\n showClose = true,\n className,\n dataTestId,\n },\n ref,\n) {\n const panelRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') onClose();\n };\n document.addEventListener('keydown', onKey);\n const prevOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = prevOverflow;\n };\n }, [open, onClose]);\n\n useEffect(() => {\n if (!open) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n panelRef.current?.focus();\n return () => prevFocus?.focus?.();\n }, [open]);\n\n if (!open) return null;\n\n const content = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? 'modal-title' : undefined}\n aria-describedby={description ? 'modal-desc' : undefined}\n className=\"fixed inset-0 z-50 flex items-center justify-center p-4\"\n >\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={() => closeOnOverlayClick && onClose()}\n aria-hidden\n />\n <div\n ref={mergeRefs(panelRef, ref)}\n tabIndex={-1}\n data-test-id={dataTestId}\n className={cn(\n 'relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]',\n sizeStyles[size],\n className,\n )}\n >\n {(title || showClose) && (\n <div className=\"flex items-start justify-between gap-4 px-6 pt-6 pb-4\">\n <div className=\"flex-1 min-w-0\">\n {title && (\n <h2 id=\"modal-title\" className=\"text-h-xs font-semibold text-fg-default\">\n {title}\n </h2>\n )}\n {description && (\n <p id=\"modal-desc\" className=\"mt-1 text-p-std text-fg-secondary\">\n {description}\n </p>\n )}\n </div>\n {showClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"-mr-2 -mt-2 p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-5 w-5\" />\n </button>\n )}\n </div>\n )}\n {children && <div className=\"px-6 pb-6 overflow-y-auto\">{children}</div>}\n {footer && (\n <div className=\"flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container rounded-b-xl\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n});\n","import { forwardRef, useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type MutableRefObject } from 'react';\nimport { X, Search, Users } from 'lucide-react';\nimport { Avatar } from '../Avatar';\nimport { cn } from '../../lib/cn';\nimport type { MultiSelectOption, MultiSelectProps, MultiSelectSize } from './MultiSelect.types';\n\n/* =============================================================================\n * MultiSelect — a chip/token multi-select combobox.\n *\n * The multi-value cousin of `Select`: chosen options render as removable chips\n * inline with a type-to-filter input; a dropdown lists the remaining options.\n * Options can carry an avatar, a description line and a chip badge, so it covers\n * both a plain tag input and a rich people picker with one API.\n *\n * Fully controlled (`value` + `onChange`). Keyboard: up/down move the active\n * option, Enter selects it, Backspace on an empty field removes the last\n * removable chip, Esc closes. Data-agnostic — feed it any options.\n * =========================================================================== */\n\nconst SIZES: Record<\n MultiSelectSize,\n { box: string; chip: string; chipText: string; input: string; avatar: 'xs' | 'sm' }\n> = {\n sm: { box: 'px-1.5 py-1.5 gap-1', chip: 'h-6 pl-0.5 pr-1.5', chipText: 'text-p-xs', input: 'h-6 text-p-sm min-w-[100px]', avatar: 'xs' },\n md: { box: 'px-2 py-2 gap-1.5', chip: 'h-7 pl-1 pr-2', chipText: 'text-p-sm', input: 'h-7 text-p-std min-w-[120px]', avatar: 'xs' },\n lg: { box: 'px-2.5 py-2.5 gap-2', chip: 'h-8 pl-1 pr-2.5', chipText: 'text-p-std', input: 'h-8 text-p-md min-w-[140px]', avatar: 'sm' },\n};\n\nexport const MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(function MultiSelect(\n {\n options,\n value,\n onChange,\n onAdd,\n onRemove,\n size = 'md',\n placeholder = 'Select…',\n addMorePlaceholder = 'Add another…',\n disabled = false,\n error = false,\n label,\n labelAddons,\n helperText,\n errorText,\n required = false,\n lockedValues = [],\n max,\n searchable = true,\n suggestionsLabel = 'Suggestions',\n emptyText = 'No matches. Try a different search.',\n showAvatars = false,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const listId = `${inputId}-listbox`;\n const hasError = error || !!errorText;\n\n const [query, setQuery] = useState('');\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const wrapRef = useRef<HTMLDivElement>(null);\n const innerInputRef = useRef<HTMLInputElement>(null);\n const setInputRef = (node: HTMLInputElement | null) => {\n innerInputRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLInputElement | null>).current = node;\n };\n\n const byValue = useMemo(() => new Map(options.map((o) => [o.value, o])), [options]);\n const selected = useMemo(\n () => value.map((v) => byValue.get(v)).filter((o): o is MultiSelectOption => !!o),\n [value, byValue],\n );\n\n const matches = useMemo(() => {\n const q = query.trim().toLowerCase();\n return options.filter(\n (o) =>\n !value.includes(o.value) &&\n (q === '' ||\n o.label.toLowerCase().includes(q) ||\n (o.description ?? '').toLowerCase().includes(q)),\n );\n }, [options, value, query]);\n\n const reached = max !== undefined && value.length >= max;\n\n /* Close on outside click + Esc. */\n useEffect(() => {\n if (!open) return;\n const onDown = (e: MouseEvent) => {\n if (wrapRef.current && !wrapRef.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDown);\n return () => document.removeEventListener('mousedown', onDown);\n }, [open]);\n\n /* Keep the active index in range as the list changes. */\n useEffect(() => {\n setActive((a) => Math.min(a, Math.max(0, matches.length - 1)));\n }, [matches.length]);\n\n const add = (v: string) => {\n const opt = byValue.get(v);\n if (disabled || reached || !opt || opt.disabled) return;\n onChange([...value, v]);\n onAdd?.(opt);\n setQuery('');\n setActive(0);\n innerInputRef.current?.focus();\n };\n\n const remove = (v: string) => {\n if (disabled || lockedValues.includes(v)) return;\n onChange(value.filter((x) => x !== v));\n onRemove?.(v);\n };\n\n const moveActive = (dir: 1 | -1) => {\n if (!matches.length) return;\n let next = active;\n for (let i = 0; i < matches.length; i++) {\n next = (next + dir + matches.length) % matches.length;\n if (!matches[next]?.disabled) break;\n }\n setActive(next);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n if (!open) setOpen(true);\n else moveActive(1);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n moveActive(-1);\n } else if (e.key === 'Enter') {\n if (open && matches[active] && !matches[active].disabled) {\n e.preventDefault();\n add(matches[active].value);\n }\n } else if (e.key === 'Escape') {\n setOpen(false);\n } else if (e.key === 'Backspace' && query === '' && selected.length > 0) {\n const last = [...selected].reverse().find((o) => !lockedValues.includes(o.value));\n if (last) remove(last.value);\n }\n };\n\n const describedBy = errorText\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-help`\n : undefined;\n\n return (\n <div data-test-id={dataTestId} className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n\n <div ref={wrapRef} className=\"relative\">\n {/* Chips + input row */}\n <div\n className={cn(\n 'flex flex-wrap items-center rounded-lg border bg-bg-default transition-colors',\n SIZES[size].box,\n disabled\n ? 'opacity-60 cursor-not-allowed border-border-default'\n : hasError\n ? 'border-red-500 focus-within:ring-2 focus-within:ring-red-300 focus-within:ring-offset-1 cursor-text'\n : 'border-border-default hover:border-border-strong focus-within:border-fg-tertiary focus-within:ring-2 focus-within:ring-brand-300 focus-within:ring-offset-1 cursor-text',\n className,\n )}\n onClick={() => !disabled && innerInputRef.current?.focus()}\n >\n {selected.map((o) => {\n const locked = lockedValues.includes(o.value);\n return (\n <span\n key={o.value}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full text-fg-default bg-bg-subtle',\n SIZES[size].chip,\n SIZES[size].chipText,\n )}\n title={o.description}\n >\n {(showAvatars || o.avatarSrc) && (\n <Avatar src={o.avatarSrc} name={o.label} size={SIZES[size].avatar} />\n )}\n <span className=\"font-medium\">{o.label}</span>\n {o.badge && (\n <span className=\"text-label-xxs uppercase tracking-wider opacity-70\">{o.badge}</span>\n )}\n {!locked && !disabled && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n remove(o.value);\n }}\n aria-label={`Remove ${o.label}`}\n className=\"-mr-0.5 ml-0.5 text-fg-tertiary hover:text-fg-default p-0.5 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"w-3 h-3\" />\n </button>\n )}\n </span>\n );\n })}\n\n <input\n ref={setInputRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open && matches[active] ? `${listId}-opt-${active}` : undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n value={query}\n readOnly={!searchable}\n disabled={disabled || reached}\n onChange={(e) => {\n setQuery(e.target.value);\n setOpen(true);\n }}\n onFocus={() => setOpen(true)}\n onKeyDown={onKeyDown}\n placeholder={selected.length === 0 ? placeholder : reached ? `Limit ${max} reached` : addMorePlaceholder}\n className={cn(\n 'flex-1 bg-transparent outline-none text-fg-default placeholder:text-fg-tertiary disabled:cursor-not-allowed',\n !searchable && 'cursor-pointer',\n SIZES[size].input,\n )}\n />\n </div>\n\n {/* Dropdown */}\n {open && !disabled && !reached && (\n <div className=\"absolute top-full left-0 right-0 mt-1 z-20 max-h-80 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4\">\n <div className=\"px-3 py-2 border-b border-border-subtle flex items-center gap-2 text-p-sm text-fg-tertiary\">\n <Search className=\"w-3.5 h-3.5 shrink-0\" />\n <span className=\"truncate\">{query ? `Matches for \"${query}\"` : suggestionsLabel}</span>\n </div>\n {matches.length === 0 ? (\n <div className=\"px-3 py-6 text-center\">\n <Users className=\"w-5 h-5 mx-auto text-fg-tertiary mb-2\" />\n <span className=\"text-p-sm text-fg-secondary\">{emptyText}</span>\n </div>\n ) : (\n <ul role=\"listbox\" id={listId} className=\"py-1\">\n {matches.map((o, i) => (\n <li key={o.value} role=\"option\" id={`${listId}-opt-${i}`} aria-selected={i === active} aria-disabled={o.disabled || undefined}>\n <button\n type=\"button\"\n disabled={o.disabled}\n onMouseEnter={() => setActive(i)}\n onMouseDown={(e) => {\n e.preventDefault();\n add(o.value);\n }}\n className={cn(\n 'w-full px-3 py-2 flex items-center gap-3 text-left transition',\n o.disabled\n ? 'opacity-50 cursor-not-allowed'\n : i === active\n ? 'bg-bg-subtle'\n : 'hover:bg-bg-subtle',\n )}\n >\n {(showAvatars || o.avatarSrc) && <Avatar src={o.avatarSrc} name={o.label} size=\"sm\" />}\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-p-std font-medium text-fg-default truncate\">{o.label}</span>\n {o.description && (\n <span className=\"block text-p-sm text-fg-secondary truncate\">{o.description}</span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </div>\n\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type {\n NotificationBadgeProps,\n NotificationBadgeSize,\n NotificationBadgeVariant,\n} from './NotificationBadge.types';\n\nconst variantStyles: Record<NotificationBadgeVariant, string> = {\n brand: 'bg-brand-500 text-white',\n danger: 'bg-red-600 text-white',\n success: 'bg-green-600 text-white',\n warning: 'bg-yellow-600 text-gray-900 dark:text-gray-900',\n info: 'bg-blue-600 text-white',\n};\n\nconst countSize: Record<NotificationBadgeSize, string> = {\n lg: 'min-w-[18px] h-[18px] px-1 text-[11px]',\n sm: 'min-w-[14px] h-[14px] px-0.5 text-[10px]',\n};\n\nconst dotSize: Record<NotificationBadgeSize, string> = {\n lg: 'h-2.5 w-2.5',\n sm: 'h-1.5 w-1.5',\n};\n\nfunction formatCount(count: number, max: number): string {\n if (count > max) return `${max}+`;\n if (count >= 1000) return `${(count / 1000).toFixed(0)}K`;\n return String(count);\n}\n\n// The badge <span> itself carries the ref/data-test-id/className/rest props —\n// it's the component's real root, whether rendered standalone or overlaid on\n// `children`. The wrapper <span> used in the overlay case is internal\n// positioning plumbing only.\nexport const NotificationBadge = forwardRef<HTMLSpanElement, NotificationBadgeProps>(\n function NotificationBadge(\n {\n count = 0,\n max = 99,\n kind = 'count',\n size = 'lg',\n variant = 'danger',\n children,\n showZero = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) {\n const show = kind === 'dot' ? true : count > 0 || showZero;\n const hasChild = children !== undefined && children !== null && children !== false;\n\n const badge = !show ? null : (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white',\n variantStyles[variant],\n kind === 'count' ? countSize[size] : dotSize[size],\n hasChild ? 'absolute -top-1 -right-1' : 'static',\n className,\n )}\n {...rest}\n >\n {kind === 'count' && formatCount(count, max)}\n </span>\n );\n\n if (!hasChild) return badge;\n\n return (\n <span className=\"relative inline-flex\">\n {children}\n {badge}\n </span>\n );\n },\n);\n","import { forwardRef } from 'react';\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { PaginationProps } from './Pagination.types';\n\ntype Item = number | 'ellipsis-left' | 'ellipsis-right';\n\nfunction buildRange(\n page: number,\n pageCount: number,\n siblingCount: number,\n boundaryCount: number,\n): Item[] {\n const totalNumbers = siblingCount * 2 + 3 + boundaryCount * 2;\n if (pageCount <= totalNumbers) {\n return Array.from({ length: pageCount }, (_, i) => i + 1);\n }\n\n const leftSibling = Math.max(page - siblingCount, boundaryCount + 2);\n const rightSibling = Math.min(page + siblingCount, pageCount - boundaryCount - 1);\n\n const showLeftEllipsis = leftSibling > boundaryCount + 2;\n const showRightEllipsis = rightSibling < pageCount - boundaryCount - 1;\n\n const head = Array.from({ length: boundaryCount }, (_, i) => i + 1);\n const tail = Array.from({ length: boundaryCount }, (_, i) => pageCount - boundaryCount + 1 + i);\n\n const middle: Item[] = [];\n if (!showLeftEllipsis) {\n for (let i = boundaryCount + 1; i <= rightSibling; i++) middle.push(i);\n } else {\n middle.push('ellipsis-left');\n for (let i = leftSibling; i <= rightSibling; i++) middle.push(i);\n }\n if (showRightEllipsis) middle.push('ellipsis-right');\n else {\n for (let i = rightSibling + 1; i <= pageCount - boundaryCount; i++) middle.push(i);\n }\n\n return [...head, ...middle, ...tail];\n}\n\nconst itemBase =\n 'inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300';\n\nconst navButtonStyles =\n 'text-fg-default hover:bg-bg-subtle disabled:text-fg-disabled disabled:hover:bg-transparent disabled:cursor-not-allowed';\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n page,\n pageCount,\n onPageChange,\n siblingCount = 1,\n boundaryCount = 1,\n className,\n dataTestId,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n) {\n const items = buildRange(page, pageCount, siblingCount, boundaryCount);\n const prevDisabled = page <= 1;\n const nextDisabled = page >= pageCount;\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel ?? 'Pagination'}\n data-test-id={dataTestId}\n className={cn('inline-flex items-center gap-1', className)}\n {...rest}\n >\n <button\n type=\"button\"\n onClick={() => !prevDisabled && onPageChange(page - 1)}\n disabled={prevDisabled}\n aria-label=\"Previous page\"\n className={cn(itemBase, navButtonStyles)}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </button>\n\n {items.map((item, i) => {\n if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n return (\n <span\n key={`${item}-${i}`}\n aria-hidden\n className=\"inline-flex items-center justify-center w-9 h-9 text-fg-tertiary\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </span>\n );\n }\n const isActive = item === page;\n return (\n <button\n key={item}\n type=\"button\"\n onClick={() => onPageChange(item)}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n itemBase,\n isActive\n ? 'bg-brand-500 text-white font-semibold hover:bg-brand-600'\n : 'text-fg-default hover:bg-bg-subtle',\n )}\n >\n {item}\n </button>\n );\n })}\n\n <button\n type=\"button\"\n onClick={() => !nextDisabled && onPageChange(page + 1)}\n disabled={nextDisabled}\n aria-label=\"Next page\"\n className={cn(itemBase, navButtonStyles)}\n >\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </nav>\n );\n});\n","import { forwardRef, type Ref } from 'react';\nimport { Avatar, type AvatarSize } from '../Avatar';\nimport { cn } from '../../lib/cn';\nimport type { PersonCardProps, PersonCardSize, PersonCardVariant } from './PersonCard.types';\n\n/* Compact person tile — avatar + name + role inside a rounded card.\n * Used as nodes in the org chart on Profile, but the shape (small chip\n * with face + identity) shows up everywhere people are listed: directory\n * search, mention picker, team callouts. Centralising avoids the same\n * markup being rewritten in each context. */\n\nconst sizeStyles: Record<PersonCardSize, { padding: string; avatar: AvatarSize; gap: string }> = {\n sm: { padding: 'px-3 py-2', avatar: 'sm', gap: 'gap-2.5' },\n md: { padding: 'px-3.5 py-2.5', avatar: 'md', gap: 'gap-3' },\n};\n\nconst variantStyles: Record<PersonCardVariant, string> = {\n default: 'border-border-default bg-bg-default hover:border-fg-tertiary/40',\n highlight: 'border-brand-500 bg-brand-200/15 dark:bg-brand-500/10 ring-1 ring-brand-500/40',\n warning: 'border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20',\n};\n\nexport const PersonCard = forwardRef<HTMLDivElement, PersonCardProps>(function PersonCard(\n {\n name,\n role,\n avatar,\n variant = 'default',\n size = 'md',\n badge,\n onClick,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const s = sizeStyles[size];\n const v = variantStyles[variant];\n\n const inner = (\n <>\n <Avatar src={avatar} name={name} size={s.avatar} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-p-std font-semibold text-fg-default truncate leading-tight\">{name}</div>\n {role && (\n <div className=\"text-p-sm text-fg-secondary truncate mt-0.5 leading-tight\">{role}</div>\n )}\n </div>\n {badge && <span className=\"shrink-0 self-center\">{badge}</span>}\n </>\n );\n\n const base = cn(\n 'relative inline-flex items-center rounded-xl border transition',\n s.padding,\n s.gap,\n v,\n onClick && 'cursor-pointer hover:shadow-z1',\n className,\n );\n\n if (onClick) {\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={onClick}\n data-test-id={dataTestId}\n className={cn(base, 'text-left')}\n {...(rest as object)}\n >\n {inner}\n </button>\n );\n }\n return (\n <div ref={ref} data-test-id={dataTestId} className={base} {...rest}>\n {inner}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { ProgressProps, ProgressSize } from './Progress.types';\n\nconst circleDimension: Record<ProgressSize, number> = {\n sm: 29,\n lg: 45,\n};\n\nconst circleStrokeWidth: Record<ProgressSize, number> = {\n sm: 2,\n lg: 4,\n};\n\nconst linearTrackHeight: Record<ProgressSize, string> = {\n sm: 'h-1',\n lg: 'h-2',\n};\n\nconst labelTextSize: Record<ProgressSize, string> = {\n sm: 'text-p-xs',\n lg: 'text-p-sm',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n variant = 'linear',\n size = 'lg',\n percent = 0,\n stepCount,\n currentStep,\n hideLabel = false,\n dimension,\n loop = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const rawPercent = stepCount && currentStep ? (currentStep / stepCount) * 100 : percent;\n const clampedPercent = Math.min(100, Math.max(0, rawPercent));\n const label = stepCount ? `${currentStep}/${stepCount}` : `${Math.round(clampedPercent)}%`;\n\n if (variant === 'circular') {\n const dim = dimension ?? circleDimension[size];\n const r = dim - 5;\n const circumference = 2 * r * Math.PI;\n const strokeWidth = circleStrokeWidth[size];\n\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loop ? undefined : clampedPercent}\n aria-valuetext={loop ? undefined : label}\n data-test-id={dataTestId}\n className={cn('relative inline-flex items-center justify-center', className)}\n style={{ width: dim * 2, height: dim * 2 }}\n {...rest}\n >\n <svg\n width={dim * 2}\n height={dim * 2}\n viewBox={`0 0 ${dim * 2} ${dim * 2}`}\n className={cn('-rotate-90', loop && 'animate-spin')}\n >\n <circle cx={dim} cy={dim} r={r} strokeWidth={strokeWidth} className=\"fill-none stroke-bg-subtle\" />\n <circle\n cx={dim}\n cy={dim}\n r={r}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n className=\"fill-none stroke-brand-500 transition-[stroke-dashoffset] duration-300 ease-linear\"\n style={{\n strokeDasharray: `${circumference}px`,\n strokeDashoffset: loop\n ? `${circumference * 0.75}px`\n : `${circumference - (circumference * clampedPercent) / 100}px`,\n }}\n />\n </svg>\n {!hideLabel && !loop && (\n <span\n className={cn('absolute text-fg-secondary', labelTextSize[size])}\n data-test-id={dataTestId ? `${dataTestId}-text` : undefined}\n >\n {label}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={clampedPercent}\n aria-valuetext={label}\n data-test-id={dataTestId}\n className={cn('flex w-full items-center gap-2', className)}\n {...rest}\n >\n <div className={cn('w-full overflow-hidden rounded-full bg-bg-subtle', linearTrackHeight[size])}>\n <div\n className=\"h-full rounded-full bg-brand-500 transition-all duration-300 ease-linear\"\n style={{ width: `${clampedPercent}%` }}\n />\n </div>\n {!hideLabel && (\n <span\n className={cn('shrink-0 text-fg-secondary', labelTextSize[size])}\n data-test-id={dataTestId ? `${dataTestId}-text` : undefined}\n >\n {label}\n </span>\n )}\n </div>\n );\n});\n","import { createContext, forwardRef, useContext, useId, type ChangeEvent } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { RadioGroupProps, RadioProps, RadioSize } from './Radio.types';\n\ninterface RadioGroupContextValue {\n name: string;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n size: RadioSize;\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n name,\n value,\n defaultValue,\n onChange,\n disabled,\n size = 'md',\n orientation = 'vertical',\n children,\n className,\n dataTestId,\n },\n ref,\n) {\n const reactName = useId();\n const groupName = name ?? reactName;\n\n return (\n <RadioGroupContext.Provider\n value={{ name: groupName, value, defaultValue, onChange, disabled, size }}\n >\n <div\n ref={ref}\n role=\"radiogroup\"\n data-test-id={dataTestId}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap items-center gap-4',\n className,\n )}\n >\n {children}\n </div>\n </RadioGroupContext.Provider>\n );\n});\n\nconst outerSize: Record<RadioSize, string> = {\n md: 'h-5 w-5',\n sm: 'h-4 w-4',\n};\n\nconst innerSize: Record<RadioSize, string> = {\n md: 'h-2 w-2',\n sm: 'h-1.5 w-1.5',\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n size,\n label,\n description,\n error = false,\n id,\n disabled,\n checked,\n defaultChecked,\n onChange,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const group = useContext(RadioGroupContext);\n const reactId = useId();\n const inputId = id ?? reactId;\n const effectiveSize = size ?? group?.size ?? 'md';\n const effectiveDisabled = disabled ?? group?.disabled;\n\n const inGroup = group !== null;\n const groupChecked = inGroup && group.value !== undefined ? group.value === value : undefined;\n const groupDefaultChecked =\n inGroup && group.defaultValue !== undefined ? group.defaultValue === value : undefined;\n\n const isChecked = inGroup ? groupChecked : checked;\n const isDefaultChecked = inGroup ? groupDefaultChecked : defaultChecked;\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n group?.onChange?.(value);\n onChange?.(e);\n };\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-2.5',\n effectiveDisabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0 items-center justify-center mt-0.5\">\n <input\n ref={ref}\n id={inputId}\n type=\"radio\"\n name={group?.name}\n value={value}\n checked={isChecked}\n defaultChecked={isDefaultChecked}\n disabled={effectiveDisabled}\n onChange={handleChange}\n className=\"peer sr-only\"\n aria-invalid={error || undefined}\n {...rest}\n />\n <span\n className={cn(\n 'flex items-center justify-center rounded-full border bg-bg-default transition-colors',\n outerSize[effectiveSize],\n error ? 'border-red-600' : 'border-border-strong',\n !effectiveDisabled && !error && 'peer-hover:border-fg-tertiary',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1',\n 'peer-checked:border-brand-500',\n effectiveDisabled && '!bg-bg-subtle !border-border-default',\n '[&>span]:opacity-0 peer-checked:[&>span]:opacity-100',\n )}\n >\n <span\n className={cn(\n 'rounded-full bg-brand-500 transition-opacity',\n innerSize[effectiveSize],\n effectiveDisabled && '!bg-fg-disabled',\n )}\n />\n </span>\n </span>\n {(label || description) && (\n <span className=\"flex flex-col gap-0.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>\n )}\n {description && (\n <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>\n )}\n </span>\n )}\n </label>\n );\n});\n","import { forwardRef, useId, useState } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Text } from '../Text';\nimport type { ReadMoreProps } from './ReadMore.types';\n\nexport const ReadMore = forwardRef<HTMLDivElement, ReadMoreProps>(function ReadMore(\n {\n children,\n clamp = 3,\n collapsedContent,\n expandLabel = 'Show more',\n collapseLabel = 'Show less',\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n textProps,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isControlled = expanded !== undefined;\n const isExpanded = isControlled ? expanded : internalExpanded;\n const contentId = useId();\n\n const toggle = () => {\n const next = !isExpanded;\n if (!isControlled) setInternalExpanded(next);\n onExpandedChange?.(next);\n };\n\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-1', className)} {...rest}>\n <Text id={contentId} clamp={isExpanded ? undefined : clamp} {...textProps}>\n {isExpanded ? children : collapsedContent ?? children}\n </Text>\n <button\n type=\"button\"\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n className=\"self-start rounded-sm text-p-sm font-medium text-fg-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n </button>\n </div>\n );\n});\n","import { forwardRef, useEffect, useId, useRef, useState, type KeyboardEvent } from 'react';\nimport { ChevronDown, Check } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { SelectProps, SelectSize } from './Select.types';\n\nconst sizeStyles: Record<SelectSize, string> = {\n lg: 'h-12 text-p-md px-3.5',\n md: 'h-10 text-p-std px-3',\n sm: 'h-8 text-p-sm px-2.5',\n};\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onChange,\n placeholder = 'Select…',\n label,\n labelAddons,\n helperText,\n errorText,\n error = false,\n size = 'md',\n disabled,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const triggerId = id ?? reactId;\n const [open, setOpen] = useState(false);\n const [internal, setInternal] = useState<string | undefined>(defaultValue);\n const isControlled = value !== undefined;\n const selected = isControlled ? value : internal;\n const containerRef = useRef<HTMLDivElement>(null);\n const [activeIndex, setActiveIndex] = useState(-1);\n const hasError = error || !!errorText;\n\n const selectedOption = options.find((o) => o.value === selected);\n\n const pick = (val: string) => {\n if (!isControlled) setInternal(val);\n onChange?.(val);\n setOpen(false);\n };\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n if (!containerRef.current?.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open]);\n\n useEffect(() => {\n if (open) {\n const idx = options.findIndex((o) => o.value === selected);\n setActiveIndex(idx >= 0 ? idx : 0);\n } else {\n setActiveIndex(-1);\n }\n }, [open, selected, options]);\n\n const onKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n if (disabled) return;\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (!open) {\n setOpen(true);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n const opt = options[activeIndex];\n if (opt && !opt.disabled) pick(opt.value);\n return;\n }\n const dir = e.key === 'ArrowDown' ? 1 : -1;\n let next = activeIndex;\n for (let i = 0; i < options.length; i++) {\n next = (next + dir + options.length) % options.length;\n if (!options[next]?.disabled) break;\n }\n setActiveIndex(next);\n } else if (e.key === 'Escape') {\n setOpen(false);\n }\n };\n\n return (\n <div\n ref={containerRef}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-1.5 w-full relative', wrapperClassName)}\n >\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label htmlFor={triggerId} className=\"text-p-std font-medium text-fg-default inline-flex\">\n {label}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <button\n ref={ref}\n id={triggerId}\n type=\"button\"\n disabled={disabled}\n onClick={() => setOpen((o) => !o)}\n onKeyDown={onKeyDown}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-invalid={hasError || undefined}\n className={cn(\n 'inline-flex items-center justify-between w-full rounded-lg border bg-bg-default transition-colors outline-none',\n 'text-left',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus-visible:ring-2',\n hasError\n ? 'focus-visible:ring-red-300 focus-visible:border-red-600'\n : 'focus-visible:ring-brand-300 focus-visible:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed text-fg-disabled',\n sizeStyles[size],\n className,\n )}\n >\n <span className={cn('truncate', !selectedOption && 'text-fg-tertiary')}>\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n <ChevronDown\n className={cn('h-4 w-4 ml-2 shrink-0 text-fg-secondary transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n </button>\n {open && (\n <ul\n role=\"listbox\"\n className=\"absolute left-0 right-0 top-full mt-1 max-h-60 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1\"\n >\n {options.map((opt, i) => {\n const isSel = opt.value === selected;\n const isActive = i === activeIndex;\n return (\n <li\n key={opt.value}\n role=\"option\"\n aria-selected={isSel}\n aria-disabled={opt.disabled || undefined}\n onMouseEnter={() => !opt.disabled && setActiveIndex(i)}\n onClick={() => !opt.disabled && pick(opt.value)}\n className={cn(\n 'flex items-center justify-between gap-2 px-3 py-2 text-p-std cursor-pointer select-none',\n opt.disabled && 'opacity-50 cursor-not-allowed',\n isActive && !opt.disabled && 'bg-bg-subtle',\n isSel && 'font-medium',\n )}\n >\n <span className=\"truncate\">{opt.label}</span>\n {isSel && <Check className=\"h-4 w-4 text-brand-500 shrink-0\" />}\n </li>\n );\n })}\n </ul>\n )}\n {errorText ? (\n <p className=\"text-p-sm text-red-700\">{errorText}</p>\n ) : helperText ? (\n <p className=\"text-p-sm text-fg-secondary\">{helperText}</p>\n ) : null}\n </div>\n );\n});\n","import { createContext, forwardRef, useContext, useState, type Ref } from 'react';\nimport { ChevronRight, Menu as MenuIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { SidebarItemProps, SidebarProps } from './Sidebar.types';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\nfunction useSidebar(): SidebarContextValue {\n return useContext(SidebarContext) ?? { collapsed: false, toggle: () => {} };\n}\n\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed,\n onCollapsedChange,\n children,\n className,\n logo,\n title,\n subtitle,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultCollapsed);\n const isControlled = collapsed !== undefined;\n const current = isControlled ? collapsed : internal;\n\n const toggle = () => {\n const next = !current;\n if (!isControlled) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed: current, toggle }}>\n <aside\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col bg-bg-default border-r border-border-default transition-all duration-200',\n current ? 'w-16' : 'w-64',\n className,\n )}\n {...rest}\n >\n <div\n className={cn(\n 'flex items-center gap-3 px-4 py-4 border-b border-border-default',\n current && 'justify-center px-2',\n )}\n >\n {logo && <div className=\"shrink-0\">{logo}</div>}\n {!current && (\n <div className=\"flex flex-col min-w-0\">\n {title && (\n <div className=\"text-p-md font-semibold text-fg-default truncate\">{title}</div>\n )}\n {subtitle && <div className=\"text-p-sm text-fg-secondary truncate\">{subtitle}</div>}\n </div>\n )}\n <button\n type=\"button\"\n onClick={toggle}\n aria-label={current ? 'Expand sidebar' : 'Collapse sidebar'}\n className={cn(\n 'ml-auto inline-flex items-center justify-center h-8 w-8 rounded-md text-fg-secondary hover:bg-bg-subtle hover:text-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300',\n current && 'ml-0',\n )}\n >\n <MenuIcon className=\"h-4 w-4\" />\n </button>\n </div>\n <nav className=\"flex-1 overflow-y-auto p-2 flex flex-col gap-0.5\">{children}</nav>\n </aside>\n </SidebarContext.Provider>\n );\n});\n\nexport const SidebarItem = forwardRef<HTMLAnchorElement | HTMLButtonElement, SidebarItemProps>(\n function SidebarItem(\n { icon, label, active, badge, children, onClick, href, className, dataTestId, ...rest },\n ref,\n ) {\n const { collapsed } = useSidebar();\n const [open, setOpen] = useState(active ?? false);\n const hasChildren = !!children;\n\n const content = (\n <>\n {icon && <span className=\"inline-flex shrink-0\">{icon}</span>}\n {!collapsed && (\n <>\n <span className=\"flex-1 truncate text-left\">{label}</span>\n {badge && <span className=\"shrink-0\">{badge}</span>}\n {hasChildren && (\n <ChevronRight\n className={cn(\n 'h-4 w-4 shrink-0 text-fg-tertiary transition-transform',\n open && 'rotate-90',\n )}\n aria-hidden\n />\n )}\n </>\n )}\n </>\n );\n\n const handleClick = () => {\n if (hasChildren) setOpen((o) => !o);\n onClick?.();\n };\n\n const itemCls = cn(\n 'group relative flex items-center gap-3 rounded-md px-3 py-2 text-p-std font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300',\n collapsed && 'px-2 justify-center',\n active\n ? 'bg-brand-20 text-brand-800 before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:h-5 before:w-0.5 before:rounded-r before:bg-brand-500'\n : 'text-fg-default hover:bg-bg-container',\n className,\n );\n\n return (\n <>\n {href ? (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n onClick={handleClick}\n data-test-id={dataTestId}\n className={itemCls}\n {...rest}\n >\n {content}\n </a>\n ) : (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={handleClick}\n data-test-id={dataTestId}\n className={cn(itemCls, 'w-full')}\n {...rest}\n >\n {content}\n </button>\n )}\n {hasChildren && open && !collapsed && (\n <div className=\"flex flex-col gap-0.5 pl-8\">{children}</div>\n )}\n </>\n );\n },\n);\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { SkeletonAnimation, SkeletonProps, SkeletonVariant } from './Skeleton.types';\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: 'h-[1em] mb-[0.4em] origin-[0%_55%] scale-y-[0.6] rounded-sm',\n circular: 'size-10 rounded-full',\n rectangular: 'h-4 w-full',\n rounded: 'h-4 w-full rounded-md',\n};\n\nconst animationStyles: Record<SkeletonAnimation, string> = {\n pulse: 'animate-pulse',\n wave: [\n 'relative overflow-hidden',\n \"after:absolute after:inset-0 after:content-[''] after:-translate-x-full\",\n 'after:bg-gradient-to-r after:from-transparent after:via-white/60 after:to-transparent',\n 'after:animate-skeleton-wave dark:after:via-white/10',\n ].join(' '),\n none: '',\n};\n\nfunction toCssSize(value?: number | string): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n {\n variant = 'text',\n animation = 'pulse',\n width,\n height,\n count = 1,\n children,\n style,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const hasChildren = children != null;\n const safeCount = Math.max(1, count);\n\n const inlineStyle = {\n ...(width !== undefined ? { width: toCssSize(width) } : null),\n ...(height !== undefined ? { height: toCssSize(height) } : null),\n ...style,\n };\n\n const itemClassName = cn('block bg-bg-subtle leading-none', variantStyles[variant], animationStyles[animation]);\n\n if (hasChildren) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(itemClassName, 'inline-block h-auto w-auto scale-100', className)}\n style={inlineStyle}\n {...rest}\n >\n <span className=\"invisible inline-block\" aria-hidden>\n {children}\n </span>\n </span>\n );\n }\n\n if (safeCount === 1) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(itemClassName, className)}\n style={inlineStyle}\n role=\"status\"\n aria-label=\"Loading\"\n {...rest}\n />\n );\n }\n\n return (\n <span ref={ref} data-test-id={dataTestId} className={cn('block', className)} {...rest}>\n {Array.from({ length: safeCount }, (_, index) => (\n <span\n key={index}\n className={itemClassName}\n style={inlineStyle}\n aria-hidden={index === 0 ? undefined : true}\n role={index === 0 ? 'status' : undefined}\n aria-label={index === 0 ? 'Loading' : undefined}\n />\n ))}\n </span>\n );\n});\n","import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { CheckCircle2, AlertTriangle, XCircle, Info, X, type LucideIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n SnackbarContextValue,\n SnackbarItem,\n SnackbarProviderProps,\n SnackbarVariant,\n} from './Snackbar.types';\n\nconst variantStyles: Record<SnackbarVariant, { container: string; icon: LucideIcon }> = {\n success: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: CheckCircle2 },\n warning: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: AlertTriangle },\n danger: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: XCircle },\n info: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: Info },\n neutral: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: Info },\n};\n\nconst iconColor: Record<SnackbarVariant, string> = {\n success: 'text-green-400',\n warning: 'text-yellow-300',\n danger: 'text-red-400',\n info: 'text-blue-400',\n neutral: 'text-white/70',\n};\n\nconst SnackbarContext = createContext<SnackbarContextValue | null>(null);\n\nexport function useSnackbar(): SnackbarContextValue {\n const ctx = useContext(SnackbarContext);\n if (!ctx) throw new Error('useSnackbar must be used inside <SnackbarProvider>');\n return ctx;\n}\n\nexport function SnackbarProvider({ children, dataTestId }: SnackbarProviderProps) {\n const [items, setItems] = useState<SnackbarItem[]>([]);\n const timers = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());\n\n const dismiss = useCallback((id: string) => {\n setItems((list) => list.filter((i) => i.id !== id));\n const t = timers.current.get(id);\n if (t) {\n clearTimeout(t);\n timers.current.delete(id);\n }\n }, []);\n\n const show = useCallback(\n (s: Omit<SnackbarItem, 'id'> & { id?: string }) => {\n const id = s.id ?? Math.random().toString(36).slice(2);\n const item: SnackbarItem = {\n duration: 5000,\n variant: 'neutral',\n ...s,\n id,\n };\n setItems((list) => [...list, item]);\n if (item.duration && item.duration > 0) {\n const t = setTimeout(() => dismiss(id), item.duration);\n timers.current.set(id, t);\n }\n return id;\n },\n [dismiss],\n );\n\n useEffect(() => {\n const timerMap = timers.current;\n return () => {\n timerMap.forEach(clearTimeout);\n timerMap.clear();\n };\n }, []);\n\n return (\n <SnackbarContext.Provider value={{ show, dismiss }}>\n {children}\n {createPortal(\n <div\n data-test-id={dataTestId}\n className=\"fixed left-1/2 -translate-x-1/2 bottom-6 z-[100] flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none\"\n >\n {items.map((i) => {\n const { container, icon: Icon } = variantStyles[i.variant ?? 'neutral'];\n return (\n <div\n key={i.id}\n role=\"status\"\n data-test-id={i.dataTestId}\n className={cn(\n 'pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-lg shadow-z4',\n container,\n )}\n >\n <Icon\n className={cn('h-5 w-5 shrink-0', iconColor[i.variant ?? 'neutral'])}\n aria-hidden\n />\n <p className=\"flex-1 text-p-std\">{i.message}</p>\n {i.action && (\n <button\n type=\"button\"\n onClick={() => {\n i.action?.onClick();\n dismiss(i.id);\n }}\n className=\"text-p-std font-semibold text-brand-400 hover:text-brand-300 px-1\"\n >\n {i.action.label}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => dismiss(i.id)}\n aria-label=\"Close\"\n className=\"shrink-0 p-1 rounded-md text-white/70 hover:text-white hover:bg-white/10\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n );\n })}\n </div>,\n document.body,\n )}\n </SnackbarContext.Provider>\n );\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { StatusProps, StatusSize, StatusVariant } from './Status.types';\n\nconst sizeStyles: Record<StatusSize, string> = {\n lg: 'h-7 px-2.5 text-p-std gap-1.5',\n md: 'h-6 px-2 text-p-sm gap-1.5',\n sm: 'h-5 px-1.5 text-p-sm gap-1',\n};\n\nconst dotDim: Record<StatusSize, string> = {\n lg: 'h-2 w-2',\n md: 'h-1.5 w-1.5',\n sm: 'h-1.5 w-1.5',\n};\n\nconst variantStyles: Record<StatusVariant, { container: string; dot: string }> = {\n general: { container: 'bg-bg-subtle text-fg-default dark:text-fg-default', dot: 'bg-gray-600 dark:bg-gray-400' },\n info: { container: 'bg-bg-info-lighter text-blue-800 dark:text-blue-300', dot: 'bg-blue-600' },\n brand: { container: 'bg-bg-brand-lighter text-brand-800 dark:text-brand-500', dot: 'bg-brand-500' },\n danger: { container: 'bg-bg-danger-lighter text-red-800 dark:text-red-300', dot: 'bg-red-600' },\n warning: { container: 'bg-bg-warning-lighter text-yellow-900 dark:text-yellow-300', dot: 'bg-yellow-600' },\n success: { container: 'bg-bg-success-lighter text-green-800 dark:text-green-300', dot: 'bg-green-600' },\n discovery: {\n container: 'bg-purple-50 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300',\n dot: 'bg-purple-500',\n },\n disabled: { container: 'bg-bg-subtle text-fg-disabled', dot: 'bg-border-strong' },\n};\n\nexport const Status = forwardRef<HTMLSpanElement, StatusProps>(function Status(\n {\n variant = 'general',\n size = 'md',\n leftIcon,\n rightIcon,\n dot = true,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const { container, dot: dotColor } = variantStyles[variant];\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center rounded-full font-medium whitespace-nowrap select-none',\n sizeStyles[size],\n container,\n className,\n )}\n {...rest}\n >\n {leftIcon ? (\n <span className=\"inline-flex shrink-0\">{leftIcon}</span>\n ) : dot ? (\n <span className={cn('inline-block shrink-0 rounded-full', dotDim[size], dotColor)} aria-hidden />\n ) : null}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </span>\n );\n});\n","import { forwardRef } from 'react';\nimport { CircleCheck, CircleX } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n StepIndicatorItem,\n StepIndicatorMarker,\n StepIndicatorProps,\n StepIndicatorSize,\n StepIndicatorStatus,\n} from './StepIndicator.types';\n\nconst markerBoxSize: Record<StepIndicatorSize, string> = {\n lg: 'size-9',\n sm: 'size-6',\n};\n\nconst markerRowHeight: Record<StepIndicatorSize, string> = {\n lg: 'h-9',\n sm: 'h-6',\n};\n\nconst markerBorderWidth: Record<StepIndicatorSize, string> = {\n lg: 'border-2',\n sm: 'border',\n};\n\nconst markerTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-std',\n sm: 'text-p-xs',\n};\n\nconst markerIconSize: Record<StepIndicatorSize, string> = {\n lg: 'size-5',\n sm: 'size-3.5',\n};\n\nconst dotSize: Record<StepIndicatorSize, string> = {\n lg: 'size-3',\n sm: 'size-2',\n};\n\nconst labelTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-std',\n sm: 'text-p-sm',\n};\n\nconst descriptionTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-sm',\n sm: 'text-p-xs',\n};\n\nconst markerStatusStyles: Record<StepIndicatorStatus, string> = {\n upcoming: 'bg-bg-default border-border-strong text-fg-tertiary',\n active: 'bg-bg-default border-brand-500 text-brand-700',\n completed: 'bg-brand-500 border-brand-500 text-fg-inverse',\n rejected: 'bg-red-700 border-red-800 text-fg-inverse',\n};\n\n// The halo is exactly `ring-4 ring-brand-40/80` — a token-exact match for\n// the source's `rgba(202,231,185,.8)` (= --color-brand-40: #cae7b9). The\n// danger halo's source value (#FFB5AB) has no matching token; ring-red-100\n// is the closest (~1 shade off).\nconst haloStyles: Record<StepIndicatorStatus, string> = {\n upcoming: 'ring-4 ring-gray-100/80',\n active: 'ring-4 ring-brand-40/80',\n completed: 'ring-4 ring-brand-40/80',\n rejected: 'ring-4 ring-red-100/80',\n};\n\nfunction renderMarkerContent(\n marker: StepIndicatorMarker,\n status: StepIndicatorStatus,\n index: number,\n size: StepIndicatorSize,\n) {\n if (status === 'completed') return <CircleCheck className={markerIconSize[size]} />;\n if (status === 'rejected') return <CircleX className={markerIconSize[size]} />;\n if (marker === 'number') return index + 1;\n if (marker === 'dot') {\n return (\n <span\n className={cn('rounded-full', dotSize[size], status === 'active' ? 'bg-brand-500' : 'bg-transparent')}\n />\n );\n }\n return null;\n}\n\nexport const StepIndicator = forwardRef<HTMLOListElement, StepIndicatorProps>(function StepIndicator(\n {\n steps,\n activeValue,\n onStepSelect,\n marker = 'number',\n orientation = 'horizontal',\n size = 'lg',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const isVertical = orientation === 'vertical';\n\n const isCompleted = (step: StepIndicatorItem | undefined) => (step?.status ?? 'upcoming') === 'completed';\n\n return (\n <ol\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex', isVertical ? 'flex-col' : 'w-full items-start', className)}\n {...rest}\n >\n {steps.map((step, index) => {\n const status = step.status ?? 'upcoming';\n const isFirst = index === 0;\n const isLast = index === steps.length - 1;\n const leadingColored = !isFirst && isCompleted(steps[index - 1]);\n const trailingColored = !isLast && isCompleted(step);\n\n const markerNode = (\n <span\n className={cn(\n 'relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-semibold transition-colors',\n markerBoxSize[size],\n markerBorderWidth[size],\n markerTextSize[size],\n markerStatusStyles[status],\n step.highlighted && haloStyles[status],\n )}\n >\n {renderMarkerContent(marker, status, index, size)}\n </span>\n );\n\n const content = (\n <div\n className={cn(\n 'flex flex-col',\n isVertical ? 'gap-0.5 pb-6' : 'mt-2 items-center gap-0.5 text-center',\n )}\n >\n <span className={cn('font-medium text-fg-default', labelTextSize[size])}>{step.label}</span>\n {step.description && (\n <span className={cn('text-fg-secondary', descriptionTextSize[size])}>{step.description}</span>\n )}\n </div>\n );\n\n return (\n <li\n key={step.value}\n aria-current={step.value === activeValue ? 'step' : undefined}\n className={cn('relative flex', isVertical ? 'flex-row gap-3' : 'flex-1 basis-0 min-w-0 flex-col')}\n >\n <div\n className={cn(\n 'relative flex shrink-0',\n isVertical\n ? 'w-9 flex-col items-center justify-center'\n : cn('w-full items-center justify-center', markerRowHeight[size]),\n )}\n >\n {!isFirst && (\n <span\n aria-hidden\n className={cn(\n 'absolute',\n isVertical\n ? 'left-1/2 top-0 bottom-1/2 w-0.5 -translate-x-1/2'\n : 'left-0 right-1/2 top-1/2 h-0.5 -translate-y-1/2',\n leadingColored ? 'bg-brand-500' : 'bg-border-default',\n )}\n />\n )}\n {!isLast && (\n <span\n aria-hidden\n className={cn(\n 'absolute',\n isVertical\n ? 'left-1/2 top-1/2 bottom-0 w-0.5 -translate-x-1/2'\n : 'left-1/2 right-0 top-1/2 h-0.5 -translate-y-1/2',\n trailingColored ? 'bg-brand-500' : 'bg-border-default',\n )}\n />\n )}\n {onStepSelect ? (\n <button\n type=\"button\"\n onClick={() => onStepSelect(step.value)}\n aria-label={typeof step.label === 'string' ? step.label : undefined}\n className=\"relative z-10 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2\"\n >\n {markerNode}\n </button>\n ) : (\n markerNode\n )}\n </div>\n {content}\n </li>\n );\n })}\n </ol>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { SwitchProps, SwitchSize } from './Switch.types';\n\nconst trackSize: Record<SwitchSize, string> = {\n md: 'h-6 w-11',\n sm: 'h-5 w-9',\n};\n\nconst thumbSize: Record<SwitchSize, string> = {\n md: 'h-5 w-5 peer-checked:translate-x-5',\n sm: 'h-4 w-4 peer-checked:translate-x-4',\n};\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n {\n size = 'md',\n label,\n description,\n labelPosition = 'right',\n id,\n disabled,\n checked,\n defaultChecked,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n const control = (\n <span className=\"relative inline-flex shrink-0\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n role=\"switch\"\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className=\"peer sr-only\"\n {...rest}\n />\n <span\n className={cn(\n 'rounded-full bg-gray-300 dark:bg-gray-700 transition-colors',\n trackSize[size],\n 'peer-checked:bg-brand-500 dark:peer-checked:bg-brand-500',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2',\n disabled && '!bg-bg-subtle',\n )}\n />\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform',\n thumbSize[size],\n )}\n />\n </span>\n );\n\n if (!label && !description) {\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn('inline-flex', disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', className)}\n >\n {control}\n </label>\n );\n }\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-3',\n labelPosition === 'left' && 'flex-row-reverse justify-end',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n {control}\n <span className=\"flex flex-col gap-0.5\">\n {label && <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>}\n {description && <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>}\n </span>\n </label>\n );\n});\n","import { forwardRef } from 'react';\nimport { ArrowUp, ArrowDown, ChevronsUpDown } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n TableProps,\n THeadProps,\n TBodyProps,\n TRProps,\n THProps,\n TDProps,\n TableAlign,\n DataTableProps,\n} from './Table.types';\n\nconst densityStyles: Record<NonNullable<TableProps['density']>, string> = {\n comfortable: '[&_td]:py-3 [&_th]:py-3',\n compact: '[&_td]:py-2 [&_th]:py-2',\n};\n\nconst alignStyles: Record<TableAlign, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n};\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n {\n density = 'comfortable',\n striped = false,\n hoverable = true,\n stickyHeader = false,\n wrapperClassName,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n return (\n <div\n data-test-id={dataTestId}\n className={cn(\n 'w-full overflow-x-auto rounded-lg border border-border-default bg-bg-default',\n wrapperClassName,\n )}\n >\n <table\n ref={ref}\n className={cn(\n 'w-full border-collapse text-p-std text-fg-default',\n densityStyles[density],\n className,\n )}\n data-striped={striped || undefined}\n data-hoverable={hoverable || undefined}\n data-sticky={stickyHeader || undefined}\n {...rest}\n >\n {children}\n </table>\n </div>\n );\n});\n\nexport const THead = forwardRef<HTMLTableSectionElement, THeadProps>(function THead(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <thead\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'bg-bg-container text-p-sm font-semibold text-fg-secondary uppercase tracking-wider',\n '[[data-sticky]_&]:sticky [[data-sticky]_&]:top-0 [[data-sticky]_&]:z-10',\n className,\n )}\n {...rest}\n >\n {children}\n </thead>\n );\n});\n\nexport const TBody = forwardRef<HTMLTableSectionElement, TBodyProps>(function TBody(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <tbody\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n '[&>tr]:border-t [&>tr]:border-border-default',\n '[[data-striped]_&>tr:nth-child(even)]:bg-bg-container',\n '[[data-hoverable]_&>tr:hover]:bg-bg-container',\n className,\n )}\n {...rest}\n >\n {children}\n </tbody>\n );\n});\n\nexport const TR = forwardRef<HTMLTableRowElement, TRProps>(function TR(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <tr ref={ref} data-test-id={dataTestId} className={className} {...rest}>\n {children}\n </tr>\n );\n});\n\nexport const TH = forwardRef<HTMLTableCellElement, THProps>(function TH(\n {\n sortable = false,\n sortDir = null,\n onSortChange,\n align = 'left',\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const content = (\n <>\n {children}\n {sortable && (\n <span className=\"inline-flex ml-1 align-middle text-fg-tertiary\">\n {sortDir === 'asc' ? (\n <ArrowUp className=\"h-3.5 w-3.5\" />\n ) : sortDir === 'desc' ? (\n <ArrowDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronsUpDown className=\"h-3.5 w-3.5\" />\n )}\n </span>\n )}\n </>\n );\n\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-test-id={dataTestId}\n className={cn('px-4 whitespace-nowrap', alignStyles[align], className)}\n aria-sort={sortDir === 'asc' ? 'ascending' : sortDir === 'desc' ? 'descending' : undefined}\n {...rest}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={() => {\n const next = sortDir === 'asc' ? 'desc' : sortDir === 'desc' ? null : 'asc';\n onSortChange?.(next);\n }}\n className=\"inline-flex items-center hover:text-fg-default focus-visible:outline-none\"\n >\n {content}\n </button>\n ) : (\n content\n )}\n </th>\n );\n});\n\nexport const TD = forwardRef<HTMLTableCellElement, TDProps>(function TD(\n { align = 'left', className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-test-id={dataTestId}\n className={cn('px-4', alignStyles[align], className)}\n {...rest}\n >\n {children}\n </td>\n );\n});\n\nexport function DataTable<T>({\n columns,\n rows,\n rowKey,\n empty = 'No results',\n density,\n striped,\n hoverable,\n sortKey,\n sortDir = null,\n onSortChange,\n onRowClick,\n className,\n dataTestId,\n}: DataTableProps<T>) {\n return (\n <Table\n density={density}\n striped={striped}\n hoverable={hoverable}\n className={className}\n dataTestId={dataTestId}\n >\n <THead>\n <TR>\n {columns.map((col) => (\n <TH\n key={col.key}\n align={col.align}\n sortable={col.sortable}\n sortDir={sortKey === col.key ? sortDir : null}\n onSortChange={(d) => onSortChange?.(col.key, d)}\n >\n {col.header}\n </TH>\n ))}\n </TR>\n </THead>\n <TBody>\n {rows.length === 0 ? (\n <TR>\n <TD colSpan={columns.length} className=\"text-center text-fg-tertiary py-10\" align=\"center\">\n {empty}\n </TD>\n </TR>\n ) : (\n rows.map((row, i) => (\n <TR\n key={rowKey(row, i)}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={onRowClick ? 'cursor-pointer' : undefined}\n >\n {columns.map((col) => (\n <TD key={col.key} align={col.align}>\n {col.render ? col.render(row) : col.accessor ? col.accessor(row) : null}\n </TD>\n ))}\n </TR>\n ))\n )}\n </TBody>\n </Table>\n );\n}\n","import {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useId,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { Badge } from '../Badge';\nimport type {\n TabListProps,\n TabPanelProps,\n TabProps,\n TabsProps,\n TabsSize,\n TabsVariant,\n} from './Tabs.types';\n\ninterface TabsContextValue {\n value: string;\n setValue: (v: string) => void;\n variant: TabsVariant;\n size: TabsSize;\n tabsId: string;\n disabled: boolean;\n}\n\nconst TabsContext = createContext<TabsContextValue | null>(null);\n\nfunction useTabs() {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('Tab components must be used inside <Tabs>');\n return ctx;\n}\n\n/** Walks `children` for a `<TabList>` and returns its first `<Tab>`'s value, used\n * as the default active tab when `Tabs` is uncontrolled and no `defaultValue` is given. */\nfunction findFirstValue(children: ReactNode): string {\n const items: ReactElement[] = [];\n Children.forEach(children, (child) => {\n if (isValidElement(child)) items.push(child);\n });\n const list = items.find(\n (child) => (child.type as { displayName?: string })?.displayName === 'TabList',\n );\n if (!isValidElement(list)) return '';\n const listChildren = Children.toArray((list.props as { children?: ReactNode }).children);\n for (const child of listChildren) {\n if (isValidElement(child)) {\n const value = (child.props as { value?: string }).value;\n if (value !== undefined) return value;\n }\n }\n return '';\n}\n\nexport const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(\n {\n defaultValue,\n value,\n onValueChange,\n variant = 'underline',\n size = 'md',\n disabled = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string>(() => defaultValue ?? findFirstValue(children));\n const controlled = value !== undefined;\n const current = controlled ? value : internal;\n const tabsId = useId();\n\n const setValue = (v: string) => {\n if (!controlled) setInternal(v);\n onValueChange?.(v);\n };\n\n return (\n <TabsContext.Provider value={{ value: current, setValue, variant, size, tabsId, disabled }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-4', className)}\n {...rest}\n >\n {children}\n </div>\n </TabsContext.Provider>\n );\n});\n\nexport const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabList(\n { children, scrollable = false, className, dataTestId, onKeyDown, ...rest },\n ref,\n) {\n const { variant } = useTabs();\n const listRef = useRef<HTMLDivElement>(null);\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n const tabs = Array.from(\n listRef.current?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not(:disabled)') ?? [],\n );\n if (!tabs.length) return;\n const currentIndex = tabs.indexOf(document.activeElement as HTMLElement);\n\n let nextIndex: number | null = null;\n if (event.key === 'ArrowRight') nextIndex = (currentIndex + 1 + tabs.length) % tabs.length;\n else if (event.key === 'ArrowLeft') nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = tabs.length - 1;\n if (nextIndex === null) return;\n\n const next = tabs[nextIndex];\n if (!next) return;\n event.preventDefault();\n next.focus();\n next.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n // WAI-ARIA \"automatic activation\": moving focus activates the tab.\n next.click();\n };\n\n return (\n <div\n ref={mergeRefs(ref, listRef)}\n role=\"tablist\"\n onKeyDown={handleKeyDown}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex',\n variant === 'underline' && 'border-b border-border-default gap-1 w-full',\n variant === 'pills' && 'gap-1 p-1 rounded-full bg-bg-container',\n variant === 'boxed' &&\n 'gap-0 rounded-lg border border-border-default overflow-hidden bg-bg-container',\n scrollable &&\n cn(\n 'overflow-x-auto flex-nowrap scroll-smooth [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-16px),transparent)]',\n ),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\nTabList.displayName = 'TabList';\n\nconst sizeStyles: Record<TabsSize, string> = {\n lg: 'h-11 px-4 text-p-md',\n md: 'h-10 px-3 text-p-std',\n sm: 'h-8 px-2.5 text-p-sm',\n};\n\n/** Count/indicator pill rendered after the label. Recolours with the tab's\n * active state so the active tab's count reads as the primary one. */\nconst badgeStyles: Record<TabsVariant, { on: string; off: string }> = {\n underline: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n pills: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n boxed: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n};\n\nexport const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n {\n value,\n children,\n disabled: tabDisabled,\n icon,\n badge,\n badgeProps,\n rightIcon,\n onRightIconClick,\n rightIconLabel,\n className,\n dataTestId,\n onClick,\n id,\n ...rest\n },\n ref,\n) {\n const { value: current, setValue, variant, size, tabsId, disabled: barDisabled } = useTabs();\n const active = current === value;\n const disabled = barDisabled || tabDisabled;\n const hasBadge = badge !== undefined && badge !== null && badge !== false;\n const tabId = id ?? `${tabsId}-tab-${value}`;\n const panelId = `${tabsId}-panel-${value}`;\n\n const base = cn(\n 'group relative inline-flex items-center justify-center gap-2 font-medium outline-none transition-colors',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1 focus-visible:rounded-md',\n sizeStyles[size],\n disabled && 'opacity-50 cursor-not-allowed',\n );\n\n const variantCls = (() => {\n if (variant === 'underline') {\n return cn(\n 'rounded-t-lg',\n active ? 'text-fg-default' : 'text-fg-secondary hover:text-fg-default hover:bg-bg-subtle/60',\n );\n }\n if (variant === 'pills') {\n return cn(\n 'rounded-full',\n active\n ? 'bg-bg-default text-fg-default shadow-z1'\n : 'bg-transparent text-fg-secondary hover:text-fg-default',\n );\n }\n return cn(\n 'border-r border-border-default last:border-r-0',\n active ? 'bg-bg-default text-fg-default' : 'bg-transparent text-fg-secondary hover:bg-bg-subtle',\n );\n })();\n\n const tabButton = (\n <button\n ref={ref}\n id={tabId}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-controls={panelId}\n tabIndex={active ? 0 : -1}\n disabled={disabled}\n data-test-id={dataTestId}\n onClick={(event) => {\n if (disabled) return;\n setValue(value);\n onClick?.(event);\n }}\n className={cn(base, variantCls, rightIcon && 'pr-9', className)}\n {...rest}\n >\n {icon && <span className=\"inline-flex shrink-0\">{icon}</span>}\n <span className=\"truncate\">{children}</span>\n {hasBadge &&\n (badgeProps ? (\n <Badge size=\"xs\" {...badgeProps}>\n {badge}\n </Badge>\n ) : (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-full px-1.5 h-5 min-w-[1.25rem]',\n 'text-label-xs font-semibold tabular-nums leading-none transition-colors',\n active ? badgeStyles[variant].on : badgeStyles[variant].off,\n )}\n >\n {badge}\n </span>\n ))}\n {variant === 'underline' && (\n <span\n aria-hidden\n className={cn(\n 'pointer-events-none absolute inset-x-0 -bottom-px h-[2px] rounded-full bg-brand-500 transition-opacity duration-150',\n active ? 'opacity-100' : 'opacity-0',\n )}\n />\n )}\n </button>\n );\n\n if (!rightIcon) return tabButton;\n\n return (\n <span className=\"relative inline-flex\">\n {tabButton}\n <button\n type=\"button\"\n aria-label={rightIconLabel}\n disabled={disabled}\n onClick={(event) => {\n event.stopPropagation();\n if (!disabled) onRightIconClick?.(value);\n }}\n className=\"absolute right-1.5 top-1/2 -translate-y-1/2 inline-flex items-center justify-center size-5 rounded text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {rightIcon}\n </button>\n </span>\n );\n});\n\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel(\n { value, children, className, dataTestId, id, keepMounted = false, ...rest },\n ref,\n) {\n const { value: current, tabsId } = useTabs();\n const active = current === value;\n if (!active && !keepMounted) return null;\n const panelId = id ?? `${tabsId}-panel-${value}`;\n const tabId = `${tabsId}-tab-${value}`;\n return (\n <div\n ref={ref}\n id={panelId}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n hidden={!active}\n data-test-id={dataTestId}\n className={className}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef, useId, useState, type ChangeEvent } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n {\n label,\n labelAddons,\n helperText,\n errorText,\n error = false,\n id,\n disabled,\n required,\n maxLength,\n showCount = false,\n className,\n wrapperClassName,\n value,\n defaultValue,\n rows = 4,\n dataTestId,\n onChange,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const hasError = error || !!errorText;\n const describedBy = errorText ? `${inputId}-error` : helperText ? `${inputId}-help` : undefined;\n\n const isControlled = value !== undefined;\n const countsEnabled = showCount && !!maxLength;\n // Uncontrolled length has to be tracked in state and updated on every\n // keystroke — deriving it from `defaultValue` (as before) only reflects\n // the initial render and never moves after that.\n const [uncontrolledLength, setUncontrolledLength] = useState(() => String(defaultValue ?? '').length);\n const currentLength = isControlled ? String(value).length : uncontrolledLength;\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled && countsEnabled) setUncontrolledLength(event.target.value.length);\n onChange?.(event);\n };\n\n return (\n <div className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)} data-test-id={dataTestId}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <textarea\n ref={ref}\n id={inputId}\n disabled={disabled}\n required={required}\n maxLength={maxLength}\n rows={rows}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n className={cn(\n 'w-full px-3 py-2.5 rounded-lg border bg-bg-default text-p-std text-fg-default placeholder:text-fg-tertiary outline-none transition-colors resize-y',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus:ring-2',\n hasError ? 'focus:ring-red-300 focus:border-red-600' : 'focus:ring-brand-300 focus:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed',\n className,\n )}\n {...rest}\n />\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n {countsEnabled && (\n <p className=\"text-p-sm text-fg-tertiary tabular-nums shrink-0\">\n {currentLength}/{maxLength}\n </p>\n )}\n </div>\n </div>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { Moon, Sun } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { ThemeSwitchProps } from './ThemeSwitch.types';\n\nexport const ThemeSwitch = forwardRef<HTMLInputElement, ThemeSwitchProps>(function ThemeSwitch(\n { checked, label, id, disabled, className, dataTestId, ...rest },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center gap-3',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n role=\"switch\"\n checked={checked}\n disabled={disabled}\n aria-label={label ? undefined : 'Dark mode'}\n className=\"peer sr-only\"\n {...rest}\n />\n <span\n className={cn(\n 'inline-flex h-8 w-16 items-center justify-between rounded-full px-2 transition-colors',\n 'bg-gray-200 peer-checked:bg-gray-700 dark:bg-gray-700 dark:peer-checked:bg-gray-900',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2',\n )}\n >\n <Sun className=\"size-4 text-yellow-500\" aria-hidden />\n <Moon className=\"size-4 text-gray-400\" aria-hidden />\n </span>\n <span\n aria-hidden\n className=\"absolute left-1 top-1 size-6 rounded-full bg-white shadow-z1 transition-transform peer-checked:translate-x-8\"\n />\n </span>\n {label && <span className=\"text-p-std font-medium text-fg-default\">{label}</span>}\n </label>\n );\n});\n","import { cloneElement, forwardRef, isValidElement, useId, useRef, useState } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TooltipProps, TooltipSide, TooltipSize } from './Tooltip.types';\n\nconst sizeStyles: Record<TooltipSize, string> = {\n lg: 'px-3 py-2 text-p-std',\n sm: 'px-2 py-1 text-p-sm',\n};\n\nconst sidePosition: Record<TooltipSide, string> = {\n top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',\n bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',\n left: 'right-full top-1/2 -translate-y-1/2 mr-2',\n right: 'left-full top-1/2 -translate-y-1/2 ml-2',\n};\n\nconst arrowPosition: Record<TooltipSide, string> = {\n top: 'top-full left-1/2 -translate-x-1/2 border-t-fg-default border-x-transparent border-b-transparent',\n bottom: 'bottom-full left-1/2 -translate-x-1/2 border-b-fg-default border-x-transparent border-t-transparent',\n left: 'left-full top-1/2 -translate-y-1/2 border-l-fg-default border-y-transparent border-r-transparent',\n right: 'right-full top-1/2 -translate-y-1/2 border-r-fg-default border-y-transparent border-l-transparent',\n};\n\nexport const Tooltip = forwardRef<HTMLSpanElement, TooltipProps>(function Tooltip(\n { content, children, side = 'top', size = 'sm', delay = 150, className, dataTestId },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const tooltipId = useId();\n\n const show = () => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(true), delay);\n };\n const hide = () => {\n if (timer.current) clearTimeout(timer.current);\n setOpen(false);\n };\n\n if (!isValidElement(children)) return children;\n\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n const trigger = cloneElement(children, {\n onMouseEnter: show,\n onMouseLeave: hide,\n onFocus: show,\n onBlur: hide,\n 'aria-describedby': open ? tooltipId : childProps['aria-describedby'],\n } as Record<string, unknown>);\n\n return (\n <span ref={ref} data-test-id={dataTestId} className=\"relative inline-flex\">\n {trigger}\n {open && (\n <span\n role=\"tooltip\"\n id={tooltipId}\n className={cn(\n 'absolute z-50 whitespace-nowrap rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none',\n sizeStyles[size],\n sidePosition[side],\n className,\n )}\n >\n {content}\n <span aria-hidden className={cn('absolute h-0 w-0 border-4', arrowPosition[side])} />\n </span>\n )}\n </span>\n );\n});\n","import { forwardRef } from 'react';\nimport { Construction } from 'lucide-react';\nimport { Empty } from '../Empty';\nimport { IconTile } from '../IconTile';\nimport type { UnderConstructionProps, UnderConstructionSize } from './UnderConstruction.types';\n\nconst DEFAULT_TITLE = \"We'll be back soon\";\nconst DEFAULT_DESCRIPTION =\n \"We're currently performing scheduled maintenance to make your experience even better. Please check back shortly.\";\n\nconst illustrationSize: Record<UnderConstructionSize, 'lg' | 'xl'> = {\n lg: 'xl',\n sm: 'lg',\n};\n\nexport const UnderConstruction = forwardRef<HTMLDivElement, UnderConstructionProps>(function UnderConstruction(\n { size = 'lg', title, description, illustration, ...rest },\n ref,\n) {\n return (\n <Empty\n ref={ref}\n size={size}\n title={title ?? DEFAULT_TITLE}\n description={description ?? DEFAULT_DESCRIPTION}\n illustration={\n illustration ?? <IconTile icon={Construction} tone=\"brand\" shape=\"circle\" size={illustrationSize[size]} />\n }\n {...rest}\n />\n );\n});\n","import { forwardRef, useRef, useState, type DragEvent, type KeyboardEvent } from 'react';\nimport {\n UploadCloud,\n File as FileIcon,\n Trash2,\n X,\n CheckCircle2,\n AlertCircle,\n Paperclip,\n Pencil,\n} from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Button } from '../Button';\nimport type { UploadItemProps, UploadItemStatus, UploadProps, UploadRejection } from './Upload.types';\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const patterns = accept\n .split(',')\n .map((pattern) => pattern.trim().toLowerCase())\n .filter(Boolean);\n if (!patterns.length) return true;\n\n const fileName = file.name.toLowerCase();\n const fileType = file.type.toLowerCase();\n\n return patterns.some((pattern) => {\n if (pattern.endsWith('/*')) return fileType.startsWith(pattern.slice(0, -1));\n if (pattern.startsWith('.')) return fileName.endsWith(pattern);\n return fileType === pattern;\n });\n}\n\nexport const Upload = forwardRef<HTMLDivElement, UploadProps>(function Upload(\n {\n accept,\n multiple = false,\n maxSizeMB,\n hint,\n onFiles,\n disabled,\n validateFiles = false,\n maxFiles,\n dedupe = validateFiles,\n currentFiles = [],\n onReject,\n mode = 'dropzone',\n triggerLabel,\n triggerIcon,\n label,\n required,\n labelAddons,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [dragOver, setDragOver] = useState(false);\n // `dragleave` bubbles from any child the pointer crosses, so a naive\n // `setDragOver(false)` on every dragleave flickers the highlight off and\n // on as the user drags across the inner icon/text. Track nesting depth\n // instead and only clear once the pointer has left every descendant too.\n const dragDepth = useRef(0);\n\n const processFiles = (incoming: File[]) => {\n if (!incoming.length) return;\n\n if (!validateFiles) {\n onFiles?.(incoming);\n return;\n }\n\n const accepted: File[] = [];\n const rejections: UploadRejection[] = [];\n const seen = [...currentFiles];\n let remainingSlots = maxFiles !== undefined ? Math.max(0, maxFiles - currentFiles.length) : Infinity;\n\n for (const file of incoming) {\n if (dedupe && seen.some((existing) => existing.name === file.name && existing.size === file.size)) {\n rejections.push({ file, reason: 'duplicate' });\n continue;\n }\n if (accept && !matchesAccept(file, accept)) {\n rejections.push({ file, reason: 'type' });\n continue;\n }\n if (maxSizeMB !== undefined && file.size > maxSizeMB * 1024 * 1024) {\n rejections.push({ file, reason: 'size' });\n continue;\n }\n if (remainingSlots <= 0) {\n rejections.push({ file, reason: 'maxFiles' });\n continue;\n }\n accepted.push(file);\n seen.push(file);\n remainingSlots -= 1;\n }\n\n if (accepted.length) onFiles?.(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n const onDrop = (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n dragDepth.current = 0;\n setDragOver(false);\n if (disabled) return;\n processFiles(Array.from(event.dataTransfer.files ?? []));\n };\n\n const hintText =\n hint ??\n `${accept ? accept.toUpperCase().replace(/\\./g, '') : 'Any file'}${\n maxSizeMB ? `, up to ${maxSizeMB} MB` : ''\n }`;\n\n const fileInput = (\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={(event) => {\n processFiles(Array.from(event.target.files ?? []));\n event.target.value = '';\n }}\n className=\"sr-only\"\n />\n );\n\n const labelRow = (label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\">\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </span>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n );\n\n if (mode !== 'dropzone') {\n const isIcon = mode === 'icon';\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-1.5', className)} {...rest}>\n {labelRow}\n <Button\n type=\"button\"\n variant=\"secondary\"\n iconOnly={isIcon}\n disabled={disabled}\n onClick={() => inputRef.current?.click()}\n leftIcon={isIcon ? undefined : triggerIcon ?? <Paperclip className=\"h-4 w-4\" />}\n aria-label={isIcon ? 'Upload file' : undefined}\n >\n {isIcon ? triggerIcon ?? <Pencil className=\"h-4 w-4\" /> : (triggerLabel ?? 'Choose a file')}\n </Button>\n {fileInput}\n </div>\n );\n }\n\n const dropzone = (\n <div\n ref={ref}\n onDragEnter={() => {\n dragDepth.current += 1;\n if (!disabled) setDragOver(true);\n }}\n onDragOver={(event) => event.preventDefault()}\n onDragLeave={() => {\n dragDepth.current = Math.max(0, dragDepth.current - 1);\n if (dragDepth.current === 0) setDragOver(false);\n }}\n onDrop={onDrop}\n onClick={() => !disabled && inputRef.current?.click()}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(event: KeyboardEvent<HTMLDivElement>) => {\n if ((event.key === 'Enter' || event.key === ' ') && !disabled) {\n event.preventDefault();\n inputRef.current?.click();\n }\n }}\n aria-disabled={disabled || undefined}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col items-center justify-center text-center gap-2 px-6 py-8 rounded-lg border-2 border-dashed cursor-pointer transition-colors outline-none',\n dragOver ? 'border-brand-500 bg-brand-20' : 'border-border-default bg-bg-container hover:bg-bg-subtle',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n disabled && 'opacity-50 cursor-not-allowed',\n className,\n )}\n {...rest}\n >\n <div className=\"h-10 w-10 rounded-full bg-bg-default flex items-center justify-center text-fg-secondary shadow-z1\">\n <UploadCloud className=\"h-5 w-5\" />\n </div>\n <div className=\"flex flex-col gap-0.5\">\n <p className=\"text-p-std text-fg-default\">\n <span className=\"font-semibold text-brand-700\">Choose a file</span> or drag & drop it here.\n </p>\n <p className=\"text-p-sm text-fg-tertiary\">{hintText}</p>\n </div>\n {fileInput}\n </div>\n );\n\n if (!labelRow) return dropzone;\n\n return (\n <div className=\"flex flex-col gap-1.5\">\n {labelRow}\n {dropzone}\n </div>\n );\n});\n\nconst statusStyles: Record<UploadItemStatus, string> = {\n processing: 'border-border-default bg-bg-default',\n completed: 'border-border-default bg-bg-default',\n error: 'border-red-300 bg-bg-danger-lighter',\n};\n\nexport const UploadItem = forwardRef<HTMLDivElement, UploadItemProps>(function UploadItem(\n {\n name,\n meta,\n status = 'processing',\n progress = 0,\n errorText,\n onRetry,\n onRemove,\n previewSrc,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [previewFailed, setPreviewFailed] = useState(false);\n const showPreview = !!previewSrc && !previewFailed;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex items-start gap-3 px-3 py-2.5 rounded-lg border', statusStyles[status], className)}\n {...rest}\n >\n <div\n className={cn(\n 'shrink-0 flex items-center justify-center h-9 w-9 rounded-md overflow-hidden',\n !showPreview && (status === 'error' ? 'bg-red-100 dark:bg-red-900/30 text-red-700' : 'bg-bg-subtle text-fg-secondary'),\n )}\n >\n {showPreview ? (\n <img\n src={previewSrc}\n alt=\"\"\n className=\"h-full w-full object-cover\"\n onError={() => setPreviewFailed(true)}\n />\n ) : (\n <FileIcon className=\"h-4 w-4\" />\n )}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-baseline justify-between gap-2\">\n <p className=\"truncate text-p-std font-medium text-fg-default\">{name}</p>\n <div className=\"flex items-center gap-1 shrink-0\">\n {status === 'completed' && (\n <CheckCircle2 className=\"h-4 w-4 text-green-600\" aria-label=\"Completed\" />\n )}\n {status === 'error' && <AlertCircle className=\"h-4 w-4 text-red-600\" aria-label=\"Failed\" />}\n </div>\n </div>\n {meta && <p className=\"text-p-sm text-fg-tertiary mt-0.5\">{meta}</p>}\n {status === 'processing' && (\n <div className=\"mt-2 h-1 w-full rounded-full bg-bg-subtle overflow-hidden\">\n <div\n className=\"h-full bg-brand-500 transition-[width] duration-200\"\n style={{ width: `${Math.min(100, Math.max(0, progress))}%` }}\n />\n </div>\n )}\n {status === 'error' && errorText && (\n <p className=\"text-p-sm text-red-700 mt-1\">\n {errorText}\n {onRetry && (\n <button type=\"button\" onClick={onRetry} className=\"ml-2 underline font-medium hover:no-underline\">\n Try again\n </button>\n )}\n </p>\n )}\n </div>\n {onRemove && (\n <button\n type=\"button\"\n onClick={onRemove}\n aria-label=\"Remove\"\n className=\"shrink-0 p-1 rounded-md text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {status === 'completed' ? <Trash2 className=\"h-4 w-4\" /> : <X className=\"h-4 w-4\" />}\n </button>\n )}\n </div>\n );\n});\n","import { useState } from 'react';\n\nexport interface UseStepperOptions {\n /** Total number of steps. */\n count: number;\n /** Uncontrolled initial step index. Default `0`. */\n initialStep?: number;\n /** Controlled step index. Pass alongside `onStepChange` to fully control the step. */\n step?: number;\n onStepChange?: (step: number) => void;\n /** Wraps `next`/`prev` past the last/first step instead of clamping. Default `false`. */\n loop?: boolean;\n}\n\nexport interface UseStepperResult {\n step: number;\n count: number;\n isFirst: boolean;\n isLast: boolean;\n next: () => void;\n prev: () => void;\n goTo: (step: number) => void;\n reset: () => void;\n}\n\nfunction clampStep(value: number, count: number): number {\n if (count <= 0) return 0;\n return Math.min(Math.max(value, 0), count - 1);\n}\n\n/** Drives a multi-step flow's current index — the logic half of a wizard,\n * with no rendering of its own; render `list[step]` (or similar) yourself.\n * Supports both controlled (`step` + `onStepChange`) and uncontrolled\n * (`initialStep`) usage, the same shape as a controlled/uncontrolled form\n * input. */\nexport function useStepper({\n count,\n initialStep = 0,\n step: controlledStep,\n onStepChange,\n loop = false,\n}: UseStepperOptions): UseStepperResult {\n const [internalStep, setInternalStep] = useState(() => clampStep(initialStep, count));\n const isControlled = controlledStep !== undefined;\n const step = isControlled ? clampStep(controlledStep, count) : internalStep;\n\n const setStep = (next: number) => {\n const clamped = clampStep(next, count);\n if (!isControlled) setInternalStep(clamped);\n onStepChange?.(clamped);\n };\n\n const next = () => {\n if (step >= count - 1) {\n if (loop) setStep(0);\n return;\n }\n setStep(step + 1);\n };\n\n const prev = () => {\n if (step <= 0) {\n if (loop) setStep(count - 1);\n return;\n }\n setStep(step - 1);\n };\n\n return {\n step,\n count,\n isFirst: step === 0,\n isLast: step === count - 1,\n next,\n prev,\n goTo: setStep,\n reset: () => setStep(initialStep),\n };\n}\n","import { useEffect, type RefObject } from 'react';\n\n/** Fires `handler` on any `mousedown`/`touchstart` outside `ref.current`.\n * No effect while `ref.current` is null or `enabled` is false — callers\n * don't need to guard call sites where the ref isn't attached yet (e.g.\n * before a portal mounts). */\nexport function useOnOutsideClick(\n ref: RefObject<HTMLElement | null> | null | undefined,\n handler: (event: MouseEvent | TouchEvent) => void,\n enabled = true,\n): void {\n useEffect(() => {\n if (!enabled) return;\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref?.current;\n if (!el || el.contains(event.target as Node)) return;\n handler(event);\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler, enabled]);\n}\n","import { useEffect } from 'react';\n\n/** Fires `onEscape` when the user presses `Escape`, anywhere in the\n * document — not scoped to a container, matching how dismissible\n * overlays (menus, drawers, popovers) listen for it today. */\nexport function useEscapeKey(onEscape: () => void, enabled = true): void {\n useEffect(() => {\n if (!enabled) return;\n\n const listener = (event: KeyboardEvent) => {\n if (event.key === 'Escape') onEscape();\n };\n\n document.addEventListener('keydown', listener);\n return () => document.removeEventListener('keydown', listener);\n }, [onEscape, enabled]);\n}\n","import { useEffect } from 'react';\n\nlet lockCount = 0;\nlet previousOverflow = '';\n\n/** Locks `document.body` scrolling while `active`, restoring whatever\n * `overflow` value was set before the first lock once the last active\n * caller deactivates. Reference-counted across concurrent callers (e.g.\n * a drawer opened from within a modal) so one overlay closing early\n * never clobbers another's lock. */\nexport function useHideBodyScroll(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n\n if (lockCount === 0) {\n previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n lockCount += 1;\n\n return () => {\n lockCount -= 1;\n if (lockCount === 0) {\n document.body.style.overflow = previousOverflow;\n }\n };\n }, [active]);\n}\n","import { useEffect, useState } from 'react';\n\nconst DEFAULT_BREAKPOINT = 768;\n\n/** True when the viewport is at or below `breakpoint` (default 768px).\n * Returns `false` during SSR and during the very first client render —\n * the effect computes and syncs the real value right after mount, so\n * the server-rendered markup and the client's first render always\n * agree (no hydration mismatch), at the cost of one extra render after\n * mount when the viewport actually is narrow. Subscribes to the media\n * query's `change` event rather than `window.resize`, so it only\n * re-renders when the mobile/desktop boundary is actually crossed. */\nexport function useIsMobile(breakpoint: number = DEFAULT_BREAKPOINT): boolean {\n const [isMobile, setIsMobile] = useState(false);\n\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n const mediaQuery = window.matchMedia(`(max-width: ${breakpoint}px)`);\n const listener = () => setIsMobile(mediaQuery.matches);\n\n listener();\n mediaQuery.addEventListener('change', listener);\n return () => mediaQuery.removeEventListener('change', listener);\n }, [breakpoint]);\n\n return isMobile;\n}\n","import { useContext } from 'react';\nimport { FormContext, type FormContextValue } from '../lib/FormContext';\n\n/** Reads the ambient form state provided by the nearest `FormContainer`.\n * Throws outside one, matching `FormField`'s existing null-check — the\n * same failure whether a consumer uses `FormField` or this hook\n * directly. */\nexport function useFormContext(): FormContextValue {\n const context = useContext(FormContext);\n if (!context) {\n throw new Error('useFormContext must be used inside a FormContainer.');\n }\n return context;\n}\n","import { useContext } from 'react';\nimport { FormContext, type FormContextValue } from '../lib/FormContext';\n\nconst noop = (() => undefined) as any;\n\nconst DEFAULT_FORM_CONTEXT: FormContextValue = {\n control: noop,\n register: noop,\n errors: {},\n setValue: noop,\n getValues: noop,\n watch: noop,\n reset: noop,\n trigger: noop,\n clearErrors: noop,\n setError: noop,\n getFieldState: noop,\n unregister: noop,\n isDirty: false,\n isSubmitted: false,\n isSubmitting: false,\n isValid: false,\n dirtyFields: {},\n submit: noop,\n};\n\n/** Reads the ambient form state provided by the nearest `FormContainer` —\n * the same context `useFormContext` reads — but never throws outside\n * one. Returns an inert default context instead, so call sites migrated\n * from an existing `useFormProps()` (e.g. an app's own hrm_ui_lib-shaped\n * shim) keep working without adding a null check. Prefer\n * `useFormContext` in new code, where a missing `FormContainer` is\n * usually a programmer error you want to surface immediately. */\nexport function useFormProps(): FormContextValue {\n const context = useContext(FormContext);\n return context ?? DEFAULT_FORM_CONTEXT;\n}\n","/**\n * Color primitives and semantic theme tokens.\n *\n * Ported from the People Space design system\n * (packages/design-system/src/tokens/colors.css + aliases.css) — this is\n * the source of truth for the design system's color palette. Values are\n * mirrored (by hand) into `src/styles/tokens.css` and `src/styles/theme.css`\n * as CSS custom properties, since the library ships a real Tailwind theme\n * rather than a JS-only token system.\n */\n\nexport const brand = {\n 900: '#31531C',\n 800: '#416E26',\n 700: '#518A2F',\n 600: '#61A539',\n 500: '#72BF44',\n 400: '#80C557',\n 300: '#8ECC69',\n 200: '#9CD27C',\n 100: '#AAD98F',\n 50: '#B8DFA2',\n 40: '#CAE7B9',\n 30: '#DBEFD1',\n 20: '#EDF7E8',\n} as const;\n\nexport const gray = {\n 900: '#0e121b',\n 800: '#222530',\n 700: '#2b303b',\n 600: '#525866',\n 500: '#717784',\n 400: '#99a0ae',\n 300: '#cacfd8',\n 200: '#e1e4ea',\n 100: '#f2f5f8',\n 50: '#f5f7fa',\n 20: '#f7f9fc',\n} as const;\n\nexport const white = '#FEFEFE';\n\nexport const green = {\n 900: '#0b4627',\n 800: '#0f5c33',\n 700: '#3D8B46',\n 600: '#199754',\n 500: '#1fc16b',\n 400: '#5ed495',\n 300: '#83dfae',\n 200: '#aeeacb',\n 100: '#d0f5e1',\n 50: '#e0faec',\n} as const;\n\nexport const blue = {\n 900: '#2443B8',\n 800: '#2E63D6',\n 700: '#3475E8',\n 600: '#3C88F7',\n 500: '#4396F7',\n 400: '#54A6F8',\n 300: '#71B6F9',\n 200: '#9ACAFA',\n 100: '#C1DEFC',\n 50: '#E6F2FE',\n} as const;\n\nexport const purple = {\n 900: '#081FA6',\n 800: '#0E2AB2',\n 700: '#2431B9',\n 600: '#3838C1',\n 500: '#453DC7',\n 400: '#6559D0',\n 300: '#8377D7',\n 200: '#A89DE2',\n 100: '#CBC4ED',\n 50: '#EAE7F7',\n 20: '#F5F3FB',\n} as const;\n\nexport const pink = {\n 900: '#4A0A20',\n 800: '#79012F',\n 700: '#A2023F',\n 600: '#AD0244',\n 500: '#CA024F',\n 400: '#F50260',\n 300: '#FD2779',\n 200: '#FE7DAF',\n 100: '#FEA8C9',\n 50: '#FFD4E4',\n} as const;\n\nexport const red = {\n 900: '#8b1822',\n 800: '#ad1f2b',\n 700: '#d02533',\n 600: '#e93544',\n 500: '#fb3748',\n 400: '#ff6875',\n 300: '#ff97a0',\n 200: '#ffc0c5',\n 100: '#ffd5d8',\n 50: '#ffebec',\n 20: '#fff4f4',\n} as const;\n\nexport const yellow = {\n 900: '#EB7520',\n 800: '#ED912A',\n 700: '#EEA02F',\n 600: '#F0B134',\n 500: '#F1BE39',\n 400: '#F2C74A',\n 300: '#F4D264',\n 200: '#F7DE8E',\n 100: '#FAEBB9',\n 50: '#FDF7E4',\n} as const;\n\nexport const colorPrimitives = { brand, gray, green, blue, purple, pink, red, yellow } as const;\n\nexport type ColorScale = typeof gray;\nexport type ColorPrimitives = typeof colorPrimitives;\n\n/**\n * Semantic aliases — components and consumer apps reference these, never\n * the raw scales above directly. Mirrors src/styles/theme.css.\n */\nexport const lightTheme = {\n bgDefault: white,\n bgContainer: gray[50],\n bgSubtle: gray[100],\n bgBrandLighter: brand[20],\n bgInfoLighter: blue[50],\n bgSuccessLighter: green[50],\n bgWarningLighter: yellow[50],\n bgDangerLighter: red[50],\n\n fgDefault: gray[900],\n fgSecondary: gray[600],\n fgTertiary: gray[500],\n fgDisabled: gray[400],\n fgInverse: white,\n fgBrand: brand[500],\n fgInfo: blue[600],\n fgSuccess: green[600],\n fgWarning: yellow[800],\n fgDanger: red[800],\n\n borderDefault: gray[200],\n borderSubtle: gray[100],\n borderStrong: gray[300],\n borderBrand: brand[500],\n\n iconPrimary: gray[900],\n iconSecondary: gray[600],\n iconInverse: white,\n iconBrand: brand[500],\n iconInfo: blue[600],\n iconDanger: red[800],\n iconWarning: yellow[800],\n} as const;\n\nexport const darkTheme = {\n ...lightTheme,\n bgDefault: '#0B1120',\n bgContainer: '#0F172A',\n bgSubtle: '#121C30',\n bgBrandLighter: 'rgba(114, 191, 68, 0.15)',\n bgInfoLighter: 'rgba(67, 150, 247, 0.15)',\n bgSuccessLighter: 'rgba(31, 193, 107, 0.15)',\n bgWarningLighter: 'rgba(237, 145, 42, 0.15)',\n bgDangerLighter: 'rgba(230, 27, 0, 0.15)',\n\n fgDefault: white,\n fgSecondary: gray[400],\n fgTertiary: gray[500],\n fgDisabled: gray[600],\n\n borderDefault: 'rgba(255, 255, 255, 0.05)',\n borderSubtle: 'rgba(255, 255, 255, 0.03)',\n borderStrong: 'rgba(255, 255, 255, 0.10)',\n\n iconPrimary: white,\n iconSecondary: gray[400],\n} as const;\n\nexport type SemanticTheme = typeof lightTheme;\n","/**\n * Typography tokens, mirrored as `--text-*` / `--font-*` in\n * src/styles/tokens.css. Ported from the People Space design system\n * (packages/design-system/src/tokens/typography.css). Sizes are paired\n * with their line-height; weight is composed separately via Tailwind's\n * default `font-*` utilities.\n */\nexport const fontFamily = {\n ps: ['Noto Sans Armenian', 'Noto Sans', 'ui-sans-serif', 'system-ui', 'sans-serif'],\n sans: ['Noto Sans Armenian', 'Noto Sans', 'ui-sans-serif', 'system-ui', 'sans-serif'],\n} as const;\n\nexport const headline = {\n xl: { fontSize: '64px', lineHeight: '72px' },\n lg: { fontSize: '48px', lineHeight: '56px' },\n md: { fontSize: '40px', lineHeight: '48px' },\n std: { fontSize: '36px', lineHeight: '44px' },\n sm: { fontSize: '32px', lineHeight: '40px' },\n xs: { fontSize: '24px', lineHeight: '32px' },\n} as const;\n\nexport const paragraph = {\n lg: { fontSize: '20px', lineHeight: '28px' },\n md: { fontSize: '16px', lineHeight: '24px' },\n std: { fontSize: '14px', lineHeight: '20px' },\n sm: { fontSize: '12px', lineHeight: '16px' },\n xs: { fontSize: '10px', lineHeight: '14px' },\n} as const;\n\nexport const label = {\n lg: { fontSize: '20px', lineHeight: '28px' },\n md: { fontSize: '16px', lineHeight: '24px' },\n std: { fontSize: '14px', lineHeight: '20px' },\n sm: { fontSize: '12px', lineHeight: '16px' },\n xs: { fontSize: '10px', lineHeight: '14px' },\n xxs: { fontSize: '6px', lineHeight: '6px' },\n} as const;\n\nexport const typography = { headline, paragraph, label } as const;\n","/**\n * Component-level sizing tokens (control heights, icon sizes).\n * General layout spacing intentionally reuses Tailwind's default 4px scale\n * rather than redefining it here — same convention as the People Space\n * design system (packages/design-system/src/tokens/spacing.css), which\n * documents an 8px rhythm (p-2, p-4, p-6, p-8...) on top of that scale\n * without overriding any token.\n */\nexport const controlHeight = {\n sm: '2rem',\n md: '2.5rem',\n lg: '3rem',\n} as const;\n\nexport const iconSize = {\n sm: '0.875rem',\n md: '1rem',\n lg: '1.25rem',\n} as const;\n","/**\n * Border radii, mirrored as `--radius-*` in src/styles/tokens.css. Ported\n * from the People Space design system (packages/design-system/src/tokens/radii.css)\n * as a fixed step scale rather than a single calc()-derived base value.\n */\nexport const radius = {\n xs: '2px',\n sm: '4px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '20px',\n '3xl': '24px',\n full: '9999px',\n} as const;\n","/**\n * Elevation scale, mirrored as `--shadow-z*` in src/styles/tokens.css.\n * Ported from the People Space design system\n * (packages/design-system/src/tokens/shadows.css) — z4 verified from\n * Figma, others interpolated.\n */\nexport const shadows = {\n z1: '0 1px 2px 0 rgba(0, 0, 0, 0.06)',\n z2: '0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04)',\n z3: '0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.04)',\n z4: '0 1px 4px 0 rgba(0, 0, 0, 0.12), 0 12px 16px 0 rgba(0, 0, 0, 0.10), 0 3px 5px 0 rgba(0, 0, 0, 0.12)',\n z5: '0 8px 16px 0 rgba(0, 0, 0, 0.12), 0 24px 32px 0 rgba(0, 0, 0, 0.12)',\n} as const;\n"],"mappings":";;;;;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AQ,YAAY;CAAO;CAC3C,IAAI;EAAE,UAAU;EAAQ,YAAY;CAAO;CAC3C,KAAK;EAAE,UAAU;EAAO,YAAY;CAAM;AAC5C,GAEa,KAAa;CAAE;CAAU;CAAW;AAAM,GC9B1C,KAAgB;CAC3B,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GAEa,KAAW;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN,GCba,KAAS;CACpB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;AACR,GCRa,KAAU;CACrB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACN"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/lib/cn.ts","../src/components/Divider/Divider.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Badge/Badge.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Button/Button.tsx","../src/components/ButtonGroup/ButtonGroup.tsx","../src/components/Card/Card.tsx","../src/components/CardGroup/CardGroup.tsx","../src/components/Checkbox/Checkbox.tsx","../src/lib/mergeRefs.ts","../src/lib/useFloatingPosition.ts","../src/components/Popover/Popover.tsx","../src/components/Copy/Copy.tsx","../src/components/Input/Input.tsx","../src/components/Counter/Counter.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/DistributionBar/DistributionBar.tsx","../src/lib/motion.ts","../src/lib/useMountTransition.ts","../src/components/Drawer/Drawer.tsx","../src/lib/useAnchoredPosition.ts","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/IconTile/IconTile.tsx","../src/components/Text/Text.tsx","../src/components/Empty/Empty.tsx","../src/components/Filter/Filter.tsx","../src/lib/FormContext.ts","../src/components/FormContainer/FormContainer.tsx","../src/components/FormField/FormField.tsx","../src/components/InfoField/InfoField.tsx","../src/components/InlineAlert/InlineAlert.tsx","../src/components/Link/Link.tsx","../src/components/Modal/Modal.tsx","../src/components/MultiSelect/MultiSelect.tsx","../src/components/NotificationBadge/NotificationBadge.tsx","../src/components/Pagination/Pagination.tsx","../src/components/PersonCard/PersonCard.tsx","../src/components/Progress/Progress.tsx","../src/components/Radio/Radio.tsx","../src/components/ReadMore/ReadMore.tsx","../src/components/Select/Select.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Snackbar/Snackbar.tsx","../src/components/Status/Status.tsx","../src/components/StepIndicator/StepIndicator.tsx","../src/components/Switch/Switch.tsx","../src/components/Table/Table.tsx","../src/components/Tabs/Tabs.tsx","../src/components/TextArea/TextArea.tsx","../src/components/ThemeSwitch/ThemeSwitch.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/UnderConstruction/UnderConstruction.tsx","../src/components/Upload/Upload.tsx","../src/hooks/useStepper.ts","../src/hooks/useOnOutsideClick.ts","../src/hooks/useEscapeKey.ts","../src/hooks/useHideBodyScroll.ts","../src/hooks/useIsMobile.ts","../src/hooks/useFormContext.ts","../src/hooks/useFormProps.ts","../src/tokens/colors.ts","../src/tokens/typography.ts","../src/tokens/spacing.ts","../src/tokens/radius.ts","../src/tokens/shadows.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\n/**\n * The custom font-size scale declared in `src/styles/tokens.css`'s `@theme`\n * block (`--text-h-xl`, `--text-p-sm`, `--text-label-md`, ...). Mirrored\n * here by hand — same two-parallel-representations discipline as the token\n * pipeline itself — because tailwind-merge ships its own hardcoded default\n * theme and has no way to read this project's actual `@theme` CSS.\n *\n * Without this, tailwind-merge's default config only recognizes Tailwind's\n * built-in font-size keywords (`xs`, `sm`, `lg`, ...) as font sizes; any\n * `text-*` suffix it doesn't recognize as a font size instead falls through\n * to the *color* class group, whose theme scale is deliberately `isAny`\n * (Tailwind v4 allows arbitrary custom theme colors). That misclassifies\n * every `text-p-*`/`text-h-*`/`text-label-*` utility as a text color, so it\n * gets silently dropped as a \"conflict\" whenever it appears alongside an\n * actual `text-{color}` class in the same `cn()` call — which is nearly\n * every real usage, since components pair a typography variant with a\n * semantic text color.\n */\nconst FONT_SIZE_TOKENS = [\n 'h-xl',\n 'h-lg',\n 'h-md',\n 'h-std',\n 'h-sm',\n 'h-xs',\n 'p-lg',\n 'p-md',\n 'p-std',\n 'p-sm',\n 'p-xs',\n 'label-lg',\n 'label-md',\n 'label-std',\n 'label-sm',\n 'label-xs',\n 'label-xxs',\n];\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: FONT_SIZE_TOKENS,\n },\n },\n});\n\n/**\n * Merges class names, resolving conflicting Tailwind utilities in favor of\n * the last one specified (e.g. `cn('px-2', 'px-4')` -> `'px-4'`). This is\n * what lets consumers pass a `className` prop that overrides a component's\n * defaults instead of just appending to them.\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type {\n DividerColor,\n DividerOrientation,\n DividerProps,\n DividerVariant,\n} from './Divider.types';\n\nconst orientationStyles: Record<DividerOrientation, string> = {\n horizontal: 'h-0 w-full border-t',\n vertical: 'w-0 h-full self-stretch border-l',\n};\n\nconst variantStyles: Record<DividerVariant, string> = {\n solid: 'border-solid',\n dashed: 'border-dashed',\n};\n\nconst colorStyles: Record<DividerColor, string> = {\n default: 'border-border-default',\n subtle: 'border-border-subtle',\n strong: 'border-border-strong',\n brand: 'border-border-brand',\n};\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(function Divider(\n { orientation = 'horizontal', variant = 'solid', color = 'default', className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"separator\"\n aria-orientation={orientation}\n data-test-id={dataTestId}\n className={cn(\n 'shrink-0',\n orientationStyles[orientation],\n variantStyles[variant],\n colorStyles[color],\n className,\n )}\n {...rest}\n />\n );\n});\n","import { createContext, forwardRef, useContext, useId, useState } from 'react';\nimport { ChevronDown } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Divider } from '../Divider';\nimport type { AccordionItemProps, AccordionProps } from './Accordion.types';\n\ninterface AccordionContextValue {\n openValues: string[];\n toggle: (value: string) => void;\n animated: boolean;\n showDivider: boolean;\n}\n\nconst AccordionContext = createContext<AccordionContextValue | null>(null);\n\nfunction useAccordion() {\n const ctx = useContext(AccordionContext);\n if (!ctx) throw new Error('AccordionItem must be used inside <Accordion>');\n return ctx;\n}\n\nfunction normalize(value: string | string[] | undefined): string[] {\n return value === undefined ? [] : Array.isArray(value) ? value : [value];\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n {\n type = 'single',\n defaultValue,\n value,\n onValueChange,\n animated = true,\n showDivider = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string[]>(() => normalize(defaultValue));\n const isControlled = value !== undefined;\n const openValues = isControlled ? normalize(value) : internal;\n\n const toggle = (val: string) => {\n let next: string[];\n if (type === 'single') {\n next = openValues.includes(val) ? [] : [val];\n } else {\n next = openValues.includes(val) ? openValues.filter((v) => v !== val) : [...openValues, val];\n }\n if (!isControlled) setInternal(next);\n onValueChange?.(type === 'single' ? (next[0] ?? '') : next);\n };\n\n return (\n <AccordionContext.Provider value={{ openValues, toggle, animated, showDivider }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col divide-y divide-border-default border border-border-default rounded-lg overflow-hidden bg-bg-default',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n </AccordionContext.Provider>\n );\n});\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { value, title, icon, disabled, className, children, dataTestId, ...rest },\n ref,\n) {\n const { openValues, toggle, animated, showDivider } = useAccordion();\n const isOpen = openValues.includes(value);\n const panelId = useId();\n const triggerId = useId();\n const panelContent = (\n <>\n {showDivider && <Divider className=\"mb-4\" />}\n {children}\n </>\n );\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n data-state={isOpen ? 'open' : 'closed'}\n className={cn('group', className)}\n {...rest}\n >\n <h3>\n <button\n id={triggerId}\n type=\"button\"\n onClick={() => toggle(value)}\n disabled={disabled}\n aria-expanded={isOpen}\n aria-controls={panelId}\n className={cn(\n 'flex w-full items-center justify-between gap-3 px-5 py-4 text-left',\n 'text-p-md font-medium text-fg-default',\n 'hover:bg-bg-container transition-colors',\n 'focus-visible:outline-none focus-visible:bg-bg-container',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\n )}\n >\n <span className=\"inline-flex items-center gap-3\">\n {icon && <span className=\"inline-flex text-fg-secondary\">{icon}</span>}\n {title}\n </span>\n <ChevronDown\n className={cn(\n 'h-5 w-5 shrink-0 text-fg-secondary transition-transform duration-200',\n isOpen && 'rotate-180',\n )}\n aria-hidden\n />\n </button>\n </h3>\n {animated ? (\n <div\n className={cn(\n 'grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none',\n isOpen ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',\n )}\n >\n <div className=\"overflow-hidden min-h-0\">\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n inert={!isOpen || undefined}\n className=\"px-5 pb-4 text-p-std text-fg-secondary\"\n >\n {panelContent}\n </div>\n </div>\n </div>\n ) : (\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n hidden={!isOpen}\n className=\"px-5 pb-4 text-p-std text-fg-secondary\"\n >\n {panelContent}\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef, useState, type ReactNode } from 'react';\nimport { User } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { AvatarGroupProps, AvatarProps, AvatarSize, AvatarStatus } from './Avatar.types';\n\nconst sizeStyles: Record<AvatarSize, string> = {\n xs: 'h-6 w-6 text-p-xs',\n sm: 'h-8 w-8 text-p-sm',\n md: 'h-10 w-10 text-p-std',\n lg: 'h-12 w-12 text-p-md',\n xl: 'h-16 w-16 text-h-xs',\n '2xl': 'h-20 w-20 text-h-xs',\n};\n\nconst statusSize: Record<AvatarSize, string> = {\n xs: 'h-1.5 w-1.5',\n sm: 'h-2 w-2',\n md: 'h-2.5 w-2.5',\n lg: 'h-3 w-3',\n xl: 'h-3.5 w-3.5',\n '2xl': 'h-4 w-4',\n};\n\nconst statusColor: Record<AvatarStatus, string> = {\n online: 'bg-green-500',\n offline: 'bg-gray-400 dark:bg-gray-500',\n away: 'bg-yellow-600',\n busy: 'bg-red-600',\n};\n\nconst overlap: Record<AvatarSize, string> = {\n xs: '-ml-1.5',\n sm: '-ml-2',\n md: '-ml-2.5',\n lg: '-ml-3',\n xl: '-ml-4',\n '2xl': '-ml-5',\n};\n\nfunction getInitials(name: string): string {\n const parts = name.trim().split(/\\s+/);\n if (parts.length === 0) return '';\n if (parts.length === 1) return parts[0]!.slice(0, 2).toUpperCase();\n return (parts[0]![0]! + parts[parts.length - 1]![0]!).toUpperCase();\n}\n\nfunction colorFromName(name: string): string {\n const palette = ['bg-brand-500', 'bg-blue-600', 'bg-purple-500', 'bg-pink-500', 'bg-yellow-600', 'bg-green-500'];\n let hash = 0;\n for (let i = 0; i < name.length; i++) {\n hash = (hash << 5) - hash + name.charCodeAt(i);\n hash |= 0;\n }\n return palette[Math.abs(hash) % palette.length]!;\n}\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { src, alt, name, size = 'md', status, shape = 'circle', fallback, className, dataTestId, ...rest },\n ref,\n) {\n const [errored, setErrored] = useState(false);\n const showImage = !!src && !errored;\n const initials = name ? getInitials(name) : '';\n const bgColor = name ? colorFromName(name) : 'bg-gray-300 dark:bg-gray-600';\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn('relative inline-flex shrink-0', className)}\n {...rest}\n >\n <span\n className={cn(\n 'inline-flex items-center justify-center overflow-hidden font-semibold text-white select-none',\n sizeStyles[size],\n shape === 'circle' ? 'rounded-full' : 'rounded-md',\n !showImage && bgColor,\n )}\n >\n {showImage ? (\n <img\n src={src}\n alt={alt ?? name ?? ''}\n onError={() => setErrored(true)}\n className=\"h-full w-full object-cover\"\n />\n ) : name ? (\n initials\n ) : (\n (fallback ?? <User className=\"h-1/2 w-1/2 text-white/90\" />)\n )}\n </span>\n {status && (\n <span\n aria-label={status}\n className={cn(\n 'absolute right-0 bottom-0 rounded-full ring-2 ring-white',\n statusSize[size],\n statusColor[status],\n )}\n />\n )}\n </span>\n );\n});\n\nexport const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(function AvatarGroup(\n { size = 'md', max, children, className, dataTestId, ...rest },\n ref,\n) {\n const items = Array.isArray(children) ? children : ([children] as ReactNode[]);\n const shown = max !== undefined ? items.slice(0, max) : items;\n const extra = max !== undefined ? items.length - max : 0;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('inline-flex items-center', className)}\n {...rest}\n >\n {shown.map((child, i) => (\n <div\n key={i}\n className={cn('rounded-full ring-2 ring-white', i > 0 && overlap[size])}\n style={{ zIndex: shown.length - i }}\n >\n {child}\n </div>\n ))}\n {extra > 0 && (\n <div className={cn('rounded-full ring-2 ring-white', overlap[size])}>\n <Avatar size={size} name={`+${extra}`} />\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef, type KeyboardEvent, type MouseEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { BadgeProps, BadgeSize, BadgeStyle, BadgeVariant } from './Badge.types';\n\nconst sizeStyles: Record<BadgeSize, string> = {\n lg: 'h-7 px-2.5 text-p-std gap-1.5',\n md: 'h-6 px-2 text-p-sm gap-1',\n sm: 'h-5 px-1.5 text-p-sm gap-1',\n xs: 'h-4 px-1 text-p-xs gap-0.5',\n};\n\nconst radiusStyles: Record<BadgeSize, string> = {\n lg: 'rounded-md',\n md: 'rounded-md',\n sm: 'rounded',\n xs: 'rounded',\n};\n\nconst dotSizeStyles: Record<BadgeSize, string> = {\n lg: 'size-2.5',\n md: 'size-2',\n sm: 'size-1.5',\n xs: 'size-1',\n};\n\nconst iconOnlyStyles: Record<BadgeSize, string> = {\n lg: 'min-w-7 px-0 justify-center',\n md: 'min-w-6 px-0 justify-center',\n sm: 'min-w-5 px-0 justify-center',\n xs: 'min-w-4 px-0 justify-center',\n};\n\nconst filledStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-bg-subtle text-fg-default border border-border-default',\n brand: 'bg-brand-20 text-brand-800 border border-brand-100',\n success: 'bg-green-50 text-green-800 border border-green-100',\n warning: 'bg-yellow-50 text-yellow-900 border border-yellow-100',\n danger: 'bg-red-50 text-red-800 border border-red-100',\n info: 'bg-blue-50 text-blue-800 border border-blue-100',\n privacy: 'bg-purple-50 text-purple-800 border border-purple-100',\n};\n\nconst outlineStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-transparent text-fg-default border border-border-strong',\n brand: 'bg-transparent text-brand-700 border border-brand-500',\n success: 'bg-transparent text-green-700 border border-green-500',\n warning: 'bg-transparent text-yellow-800 border border-yellow-600',\n danger: 'bg-transparent text-red-700 border border-red-500',\n info: 'bg-transparent text-blue-700 border border-blue-500',\n privacy: 'bg-transparent text-purple-700 border border-purple-500',\n};\n\nconst accentStyles: Record<BadgeVariant, string> = {\n neutral: 'bg-fg-default text-bg-default',\n brand: 'bg-brand-500 text-white',\n success: 'bg-green-600 text-white',\n warning: 'bg-yellow-600 text-gray-900 dark:text-gray-900',\n danger: 'bg-red-700 text-white',\n info: 'bg-blue-600 text-white',\n privacy: 'bg-purple-500 text-white',\n};\n\n// Uniform per-appearance hover/active treatment rather than a 21-entry\n// (appearance x variant) table — brightness/neutral-tint reads consistently\n// across every color without hand-tuning a \"one shade darker\" value per\n// variant.\nconst interactiveStyles: Record<BadgeStyle, string> = {\n filled: 'hover:brightness-95 active:brightness-90',\n outline: 'hover:bg-bg-subtle active:bg-bg-container',\n accent: 'hover:brightness-90 active:brightness-80',\n};\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n {\n variant = 'neutral',\n appearance = 'filled',\n size = 'md',\n shape = 'rounded',\n leftIcon,\n rightIcon,\n onDismiss,\n dot = false,\n withDot = false,\n disabled = false,\n interactive = false,\n className,\n children,\n dataTestId,\n onClick,\n onKeyDown,\n ...rest\n },\n ref,\n) {\n const palette =\n appearance === 'filled'\n ? filledStyles[variant]\n : appearance === 'outline'\n ? outlineStyles[variant]\n : accentStyles[variant];\n\n if (dot) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n aria-hidden={rest['aria-label'] ? undefined : true}\n onClick={disabled ? undefined : onClick}\n className={cn(\n 'inline-block shrink-0 rounded-full',\n dotSizeStyles[size],\n accentStyles[variant],\n disabled && 'opacity-50',\n className,\n )}\n {...rest}\n />\n );\n }\n\n const isIconOnly = children == null && !withDot && !!(leftIcon || rightIcon);\n const radius = shape === 'pill' ? 'rounded-full' : radiusStyles[size];\n\n const handleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {\n onKeyDown?.(event);\n if (disabled || !onClick) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n onClick(event as unknown as MouseEvent<HTMLSpanElement>);\n }\n };\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive && !disabled ? 0 : undefined}\n aria-disabled={interactive && disabled ? true : undefined}\n onClick={disabled ? undefined : onClick}\n onKeyDown={interactive ? handleKeyDown : onKeyDown}\n className={cn(\n 'inline-flex items-center font-medium whitespace-nowrap select-none',\n sizeStyles[size],\n radius,\n palette,\n isIconOnly && iconOnlyStyles[size],\n interactive &&\n !disabled &&\n cn(\n 'cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n interactiveStyles[appearance],\n ),\n disabled && 'opacity-50 cursor-not-allowed pointer-events-none',\n className,\n )}\n {...rest}\n >\n {withDot ? (\n <span\n className={cn('inline-block shrink-0 rounded-full', dotSizeStyles[size], accentStyles[variant])}\n aria-hidden\n />\n ) : (\n leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>\n )}\n {children}\n {rightIcon && !onDismiss && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n disabled={disabled}\n aria-label=\"Dismiss\"\n className=\"inline-flex shrink-0 -mr-0.5 rounded-full p-0.5 hover:bg-black/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </span>\n );\n});\n","import { forwardRef, Fragment } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { BreadcrumbProps, BreadcrumbSize } from './Breadcrumb.types';\n\nconst sizeStyles: Record<BreadcrumbSize, string> = {\n md: 'text-p-sm',\n sm: 'text-p-xs',\n};\n\nconst crumbLinkClass =\n 'rounded-sm text-fg-tertiary transition-colors hover:text-fg-secondary outline-none focus-visible:ring-2 focus-visible:ring-brand-300';\n\nexport const Breadcrumb = forwardRef<HTMLElement, BreadcrumbProps>(function Breadcrumb(\n { items, currentValue, onSelect, separator = '/', size = 'md', className, dataTestId, ...rest },\n ref,\n) {\n const current = currentValue ?? items[items.length - 1]?.value;\n\n return (\n <nav\n ref={ref}\n aria-label=\"Breadcrumb\"\n data-test-id={dataTestId}\n className={cn(sizeStyles[size], className)}\n {...rest}\n >\n <ol className=\"flex items-center\">\n {items.map((item, index) => {\n const isCurrent = item.value === current;\n return (\n <Fragment key={item.value}>\n {index > 0 && (\n <li aria-hidden=\"true\" className=\"px-1.5 text-fg-tertiary\">\n {separator}\n </li>\n )}\n <li className=\"flex items-center\">\n {isCurrent ? (\n <span aria-current=\"page\" className=\"font-medium text-fg-default\">\n {item.label}\n </span>\n ) : item.disabled ? (\n <span className=\"cursor-not-allowed text-fg-disabled\">{item.label}</span>\n ) : item.href ? (\n <a href={item.href} onClick={() => onSelect?.(item.value)} className={crumbLinkClass}>\n {item.label}\n </a>\n ) : (\n <button type=\"button\" onClick={() => onSelect?.(item.value)} className={crumbLinkClass}>\n {item.label}\n </button>\n )}\n </li>\n </Fragment>\n );\n })}\n </ol>\n </nav>\n );\n});\n","import { forwardRef } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { ButtonProps, ButtonSize, ButtonVariant } from './Button.types';\n\nconst sizeStyles: Record<ButtonSize, string> = {\n lg: 'h-12 px-5 text-p-md gap-2 rounded-lg',\n md: 'h-10 px-4 text-p-std gap-2 rounded-lg',\n sm: 'h-8 px-3 text-p-sm gap-1.5 rounded-md',\n};\n\nconst iconOnlySize: Record<ButtonSize, string> = {\n lg: 'h-12 w-12 rounded-lg',\n md: 'h-10 w-10 rounded-lg',\n sm: 'h-8 w-8 rounded-md',\n};\n\nconst variantStyles: Record<ButtonVariant, string> = {\n primary: [\n 'bg-brand-500 text-white border border-transparent',\n 'hover:bg-brand-600 active:bg-brand-700',\n 'disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n secondary: [\n 'bg-bg-default text-fg-default border border-border-default',\n 'hover:bg-bg-container active:bg-bg-subtle',\n 'disabled:bg-bg-container disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n tertiary: [\n 'bg-transparent text-fg-default border border-transparent',\n 'hover:bg-bg-subtle active:bg-bg-subtle',\n 'disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2',\n ].join(' '),\n danger: [\n 'bg-red-700 text-white border border-transparent',\n 'hover:bg-red-800 active:bg-red-900',\n 'disabled:bg-bg-subtle disabled:text-fg-disabled disabled:cursor-not-allowed',\n 'focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2',\n ].join(' '),\n};\n\n// Same shade each variant already uses for `active:`, applied persistently\n// while `pressed` is true instead of only during the mousedown instant.\nconst pressedStyles: Record<ButtonVariant, string> = {\n primary: 'bg-brand-700',\n secondary: 'bg-bg-subtle',\n tertiary: 'bg-bg-subtle',\n danger: 'bg-red-900',\n};\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'primary',\n size = 'md',\n leftIcon,\n rightIcon,\n loading = false,\n iconOnly = false,\n fullWidth = false,\n pressed = false,\n disabled,\n className,\n children,\n onClick,\n dataTestId,\n ...rest\n },\n ref,\n) {\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n aria-pressed={pressed}\n data-test-id={dataTestId}\n onClick={(event) => {\n if (pressed || disabled || loading) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }}\n className={cn(\n 'inline-flex items-center justify-center font-medium transition-colors outline-none',\n iconOnly ? iconOnlySize[size] : sizeStyles[size],\n variantStyles[variant],\n pressed && pressedStyles[variant],\n fullWidth && 'w-full',\n className,\n )}\n {...rest}\n >\n {loading ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" aria-hidden />\n ) : (\n <>\n {leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </>\n )}\n </button>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { ButtonGroupOrientation, ButtonGroupProps } from './ButtonGroup.types';\n\nconst orientationStyles: Record<ButtonGroupOrientation, string> = {\n horizontal:\n 'flex-row [&>*]:rounded-none [&>*:first-child]:rounded-l-lg [&>*:last-child]:rounded-r-lg [&>*:not(:first-child)]:-ml-px',\n vertical:\n 'flex-col [&>*]:rounded-none [&>*:first-child]:rounded-t-lg [&>*:last-child]:rounded-b-lg [&>*:not(:first-child)]:-mt-px',\n};\n\nexport const ButtonGroup = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { orientation = 'horizontal', className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n role=\"group\"\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex isolate',\n orientationStyles[orientation],\n '[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { CardProps, CardPadding, CardVariant } from './Card.types';\n\nconst variantStyles: Record<CardVariant, string> = {\n elevated: 'bg-bg-default border border-border-default shadow-z1',\n outlined: 'bg-bg-default border border-border-default',\n filled: 'bg-bg-container border border-transparent',\n};\n\nconst paddingStyles: Record<CardPadding, string> = {\n none: 'p-0',\n sm: 'p-4',\n md: 'p-5',\n lg: 'p-6',\n};\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n {\n variant = 'outlined',\n padding = 'md',\n header,\n footer,\n interactive = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const hasSlots = header || footer;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'rounded-xl overflow-hidden',\n variantStyles[variant],\n interactive && 'transition-all hover:border-brand-500 hover:shadow-z2',\n // If header/footer used, padding is applied per-region, not on the wrapper.\n !hasSlots && paddingStyles[padding],\n className,\n )}\n {...rest}\n >\n {header && (\n <div className={cn('border-b border-border-subtle', paddingStyles[padding])}>\n {header}\n </div>\n )}\n {hasSlots ? <div className={paddingStyles[padding]}>{children}</div> : children}\n {footer && (\n <div className={cn('border-t border-border-subtle', paddingStyles[padding])}>\n {footer}\n </div>\n )}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Card } from '../Card';\nimport type { CardGroupProps, CardGroupTitleColor } from './CardGroup.types';\n\n// Semantic \"lighter\" aliases where one exists; purple/pink fall back to raw\n// scale shades with explicit dark: variants, same precedent as IconTile's\n// tones (no semantic alias exists for those two yet).\nconst titleColorStyles: Record<CardGroupTitleColor, string> = {\n brand: 'bg-bg-brand-lighter text-brand-800',\n blue: 'bg-bg-info-lighter text-blue-800',\n purple: 'bg-purple-50 text-purple-800 dark:bg-purple-900/30 dark:text-purple-200',\n pink: 'bg-pink-50 text-pink-800 dark:bg-pink-900/30 dark:text-pink-200',\n yellow: 'bg-bg-warning-lighter text-yellow-900',\n gray: 'bg-bg-subtle text-fg-secondary',\n};\n\nexport const CardGroup = forwardRef<HTMLDivElement, CardGroupProps>(function CardGroup(\n { title, header, children, noDivider = false, className, dataTestId, ...rest },\n ref,\n) {\n const placement = title?.placement ?? 'left';\n const isVertical = !!title && placement !== 'top';\n\n const titleRail = title && (\n <div\n className={cn(\n 'flex shrink-0 items-center justify-center text-center text-label-md font-bold',\n isVertical\n ? cn('px-2 [writing-mode:vertical-rl]', placement === 'left' && 'rotate-180')\n : 'px-4 py-2',\n titleColorStyles[title.color ?? 'gray'],\n )}\n >\n {title.text}\n </div>\n );\n\n return (\n <Card\n ref={ref}\n dataTestId={dataTestId}\n variant=\"outlined\"\n padding=\"none\"\n className={className}\n {...rest}\n >\n <div className={cn('flex', isVertical ? (placement === 'right' ? 'flex-row-reverse' : 'flex-row') : 'flex-col')}>\n {titleRail}\n <div\n className={cn(\n 'min-w-0 flex-1',\n !noDivider && '[&>*:not(:last-child)]:border-b [&>*:not(:last-child)]:border-border-default',\n )}\n >\n {header}\n {children}\n </div>\n </div>\n </Card>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { Check, Minus } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { CheckboxProps, CheckboxSize } from './Checkbox.types';\n\nconst boxSize: Record<CheckboxSize, string> = {\n md: 'h-5 w-5 rounded-sm',\n sm: 'h-4 w-4 rounded-sm',\n};\n\nconst iconSize: Record<CheckboxSize, string> = {\n md: 'h-3.5 w-3.5',\n sm: 'h-3 w-3',\n};\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n {\n size = 'md',\n label,\n description,\n indeterminate = false,\n error = false,\n id,\n disabled,\n checked,\n defaultChecked,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-2.5 group/checkbox',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0 items-center justify-center mt-0.5\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className=\"peer sr-only\"\n aria-invalid={error || undefined}\n aria-checked={indeterminate ? 'mixed' : undefined}\n {...rest}\n />\n <span\n className={cn(\n 'flex items-center justify-center border transition-colors',\n boxSize[size],\n // base (not checked, not indeterminate)\n !indeterminate && 'bg-bg-default',\n // border color\n error ? 'border-red-600' : indeterminate ? 'border-brand-500' : 'border-border-strong',\n // hover\n !disabled &&\n !indeterminate &&\n (error ? 'peer-hover:border-red-700' : 'peer-hover:border-fg-tertiary'),\n // focus ring\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1',\n // checked (controlled or uncontrolled via peer)\n !indeterminate && 'peer-checked:bg-brand-500 peer-checked:border-brand-500',\n // indeterminate wins\n indeterminate && 'bg-brand-500',\n // disabled overrides\n disabled &&\n !indeterminate &&\n 'peer-checked:bg-bg-subtle peer-checked:border-border-strong',\n // SVG visibility — toggled via peer-checked on the sibling native input.\n !indeterminate &&\n '[&_svg]:opacity-0 peer-checked:[&_svg]:opacity-100 [&_svg]:transition-opacity',\n )}\n >\n {indeterminate ? (\n <Minus className={cn(iconSize[size], 'text-white')} strokeWidth={3} aria-hidden />\n ) : (\n <Check className={cn(iconSize[size], 'text-white')} strokeWidth={3} aria-hidden />\n )}\n </span>\n </span>\n {(label || description) && (\n <span className=\"flex flex-col gap-0.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>\n )}\n {description && (\n <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>\n )}\n </span>\n )}\n </label>\n );\n});\n","import type { Ref } from 'react';\n\n/** Combines multiple refs (a forwarded consumer ref, an internal ref) into a\n * single callback ref so they all point at the same DOM node. */\nexport function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): (node: T | null) => void {\n return (node) => {\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 { useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nexport type FloatingSide = 'top' | 'bottom' | 'left' | 'right';\nexport type FloatingAlign = 'start' | 'center' | 'end';\n\nexport interface UseFloatingPositionOptions {\n /** A ref pointing at the anchor element, read fresh on every recompute. */\n anchor: RefObject<HTMLElement | null> | null | undefined;\n panel: HTMLElement | null;\n open: boolean;\n side?: FloatingSide;\n align?: FloatingAlign;\n offset?: number;\n /** Flips to the opposite side on the same axis (top<->bottom, left<->right) when there isn't room. */\n flip?: boolean;\n /** Clamps the cross-axis position so the panel stays inside the viewport. */\n shift?: boolean;\n}\n\nexport interface FloatingPosition {\n style: CSSProperties;\n /** Positions the arrow at the anchor's center on the cross axis, relative to the panel's own box — apply on top of the arrow's own border/rotation classes, which are keyed off `resolvedSide` by the caller. */\n arrowStyle: CSSProperties;\n /** The side actually used, after flipping. */\n resolvedSide: FloatingSide;\n}\n\nconst VIEWPORT_MARGIN = 8;\nconst ARROW_SIZE = 8; // px — matches the `size-2` arrow element in Popover.tsx\nconst ARROW_MARGIN = 10; // keep the arrow off the panel's rounded corners\n\n/** Computes `position: fixed` coordinates (+ a matching arrow offset) for a\n * panel anchored to a trigger element on any of 4 sides x 3 alignments,\n * so the panel can portal to `document.body` without being clipped by an\n * `overflow: hidden` ancestor. Recomputes on open, resize, and any\n * ancestor scroll. */\nexport function useFloatingPosition({\n anchor,\n panel,\n open,\n side = 'top',\n align = 'center',\n offset = 8,\n flip = true,\n shift = true,\n}: UseFloatingPositionOptions): FloatingPosition {\n const [position, setPosition] = useState<FloatingPosition>({\n style: { position: 'fixed', top: 0, left: 0, visibility: 'hidden' },\n arrowStyle: {},\n resolvedSide: side,\n });\n\n useLayoutEffect(() => {\n if (!open || !panel) return;\n\n const compute = () => {\n const anchorEl = anchor?.current;\n if (!anchorEl) return;\n const anchorRect = anchorEl.getBoundingClientRect();\n const panelRect = panel.getBoundingClientRect();\n const viewportWidth = window.innerWidth;\n const viewportHeight = window.innerHeight;\n\n const isVertical = side === 'top' || side === 'bottom';\n let resolvedSide = side;\n\n if (flip) {\n if (isVertical) {\n const spaceAbove = anchorRect.top;\n const spaceBelow = viewportHeight - anchorRect.bottom;\n if (side === 'top' && spaceAbove < panelRect.height + offset && spaceBelow > spaceAbove) {\n resolvedSide = 'bottom';\n } else if (side === 'bottom' && spaceBelow < panelRect.height + offset && spaceAbove > spaceBelow) {\n resolvedSide = 'top';\n }\n } else {\n const spaceLeft = anchorRect.left;\n const spaceRight = viewportWidth - anchorRect.right;\n if (side === 'left' && spaceLeft < panelRect.width + offset && spaceRight > spaceLeft) {\n resolvedSide = 'right';\n } else if (side === 'right' && spaceRight < panelRect.width + offset && spaceLeft > spaceRight) {\n resolvedSide = 'left';\n }\n }\n }\n\n const resolvedIsVertical = resolvedSide === 'top' || resolvedSide === 'bottom';\n let top: number;\n let left: number;\n\n if (resolvedIsVertical) {\n top = resolvedSide === 'bottom' ? anchorRect.bottom + offset : anchorRect.top - panelRect.height - offset;\n left =\n align === 'start'\n ? anchorRect.left\n : align === 'end'\n ? anchorRect.right - panelRect.width\n : anchorRect.left + anchorRect.width / 2 - panelRect.width / 2;\n } else {\n left = resolvedSide === 'right' ? anchorRect.right + offset : anchorRect.left - panelRect.width - offset;\n top =\n align === 'start'\n ? anchorRect.top\n : align === 'end'\n ? anchorRect.bottom - panelRect.height\n : anchorRect.top + anchorRect.height / 2 - panelRect.height / 2;\n }\n\n if (shift) {\n if (resolvedIsVertical) {\n left = Math.min(Math.max(left, VIEWPORT_MARGIN), viewportWidth - panelRect.width - VIEWPORT_MARGIN);\n } else {\n top = Math.min(Math.max(top, VIEWPORT_MARGIN), viewportHeight - panelRect.height - VIEWPORT_MARGIN);\n }\n }\n\n let arrowStyle: CSSProperties;\n if (resolvedIsVertical) {\n const anchorCenterX = anchorRect.left + anchorRect.width / 2;\n const arrowLeft = Math.min(Math.max(anchorCenterX - left, ARROW_MARGIN), panelRect.width - ARROW_MARGIN);\n arrowStyle = {\n left: arrowLeft,\n [resolvedSide === 'bottom' ? 'top' : 'bottom']: -ARROW_SIZE / 2,\n };\n } else {\n const anchorCenterY = anchorRect.top + anchorRect.height / 2;\n const arrowTop = Math.min(Math.max(anchorCenterY - top, ARROW_MARGIN), panelRect.height - ARROW_MARGIN);\n arrowStyle = {\n top: arrowTop,\n [resolvedSide === 'right' ? 'left' : 'right']: -ARROW_SIZE / 2,\n };\n }\n\n setPosition({ style: { position: 'fixed', top, left }, arrowStyle, resolvedSide });\n };\n\n compute();\n window.addEventListener('resize', compute);\n document.addEventListener('scroll', compute, { capture: true, passive: true });\n return () => {\n window.removeEventListener('resize', compute);\n document.removeEventListener('scroll', compute, { capture: true });\n };\n }, [open, anchor, panel, side, align, offset, flip, shift]);\n\n return position;\n}\n","import {\n cloneElement,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type MouseEvent as ReactMouseEvent,\n type Ref,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { useFloatingPosition, type FloatingSide } from '../../lib/useFloatingPosition';\nimport type { PopoverProps } from './Popover.types';\n\n// Rotated-square arrow technique (not Tooltip's CSS-triangle, which only\n// works because Tooltip's bubble is borderless): after a 45deg rotation,\n// each corner of the square points toward one of the four cardinal\n// directions, carried by its two adjacent (now-bordered) edges. Keyed by\n// resolvedSide because the arrow always points *back toward the anchor*,\n// i.e. the opposite direction from where the panel sits.\nconst arrowBorderStyles: Record<FloatingSide, string> = {\n bottom: 'border-l border-t', // panel below anchor -> arrow tip points up\n top: 'border-b border-r', // panel above anchor -> arrow tip points down\n left: 'border-t border-r', // panel left of anchor -> arrow tip points right\n right: 'border-b border-l', // panel right of anchor -> arrow tip points left\n};\n\nexport function Popover({\n content,\n children,\n side = 'top',\n align = 'center',\n offset = 8,\n open,\n defaultOpen = false,\n onOpenChange,\n flip = true,\n showArrow = true,\n closeOnScroll = true,\n autoFocus = false,\n container,\n className,\n dataTestId,\n}: PopoverProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = open !== undefined;\n const isOpen = isControlled ? open : internalOpen;\n const triggerRef = useRef<HTMLElement | null>(null);\n const [panelEl, setPanelEl] = useState<HTMLDivElement | null>(null);\n const contentId = useId();\n\n const setOpen = (value: boolean) => {\n if (!isControlled) setInternalOpen(value);\n onOpenChange?.(value);\n };\n\n const { style, arrowStyle, resolvedSide } = useFloatingPosition({\n anchor: triggerRef,\n panel: panelEl,\n open: isOpen,\n side,\n align,\n offset,\n flip,\n });\n\n useEffect(() => {\n if (!isOpen) return;\n const onDoc = (event: MouseEvent) => {\n const target = event.target as Node;\n if (panelEl?.contains(target)) return;\n if (triggerRef.current?.contains(target)) return;\n setOpen(false);\n };\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n document.addEventListener('keydown', onKey);\n return () => {\n document.removeEventListener('mousedown', onDoc);\n document.removeEventListener('keydown', onKey);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, panelEl]);\n\n useEffect(() => {\n if (!isOpen || !closeOnScroll) return;\n const onScroll = () => setOpen(false);\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n return () => document.removeEventListener('scroll', onScroll, { capture: true });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, closeOnScroll]);\n\n useEffect(() => {\n if (!isOpen || !autoFocus || !panelEl) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n const focusable = panelEl.querySelector<HTMLElement>(\n 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])',\n );\n (focusable ?? panelEl).focus();\n return () => prevFocus?.focus?.();\n }, [isOpen, autoFocus, panelEl]);\n\n if (!isValidElement(children)) return children;\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n // Preserve whatever ref the consumer already attached to their trigger\n // element (e.g. a component forwarding its own ref through) by merging\n // it with the ref Popover needs internally for position measurement,\n // rather than clobbering it.\n const existingRef = (children as unknown as { ref?: Ref<HTMLElement> }).ref;\n\n const trigger = cloneElement(children, {\n // eslint-disable-next-line react-hooks/refs -- passes the ref objects themselves (React attaches them during commit, not a `.current` read during render)\n ref: mergeRefs(triggerRef, existingRef),\n onClick: (event: ReactMouseEvent) => {\n (childProps.onClick as ((e: ReactMouseEvent) => void) | undefined)?.(event);\n if (!event.defaultPrevented) setOpen(!isOpen);\n },\n 'aria-haspopup': 'dialog',\n 'aria-expanded': isOpen,\n } as Record<string, unknown>);\n\n const portalTarget = container ?? (typeof document !== 'undefined' ? document.body : null);\n\n return (\n <>\n {trigger}\n {isOpen &&\n portalTarget &&\n createPortal(\n <div\n ref={mergeRefs(setPanelEl)}\n id={contentId}\n role=\"dialog\"\n aria-label={typeof content === 'string' ? content : undefined}\n tabIndex={-1}\n data-side={resolvedSide}\n data-test-id={dataTestId}\n style={style}\n className={cn(\n 'fixed z-50 max-w-60 max-h-54 overflow-auto rounded-lg border border-border-default bg-bg-default p-3 text-fg-default shadow-z4',\n className,\n )}\n >\n {content}\n {showArrow && (\n <span\n aria-hidden\n style={arrowStyle}\n className={cn(\n 'absolute size-2 rotate-45 bg-bg-default',\n arrowBorderStyles[resolvedSide],\n )}\n />\n )}\n </div>,\n portalTarget,\n )}\n </>\n );\n}\n","import { forwardRef, useEffect, useRef, useState } from 'react';\nimport { Check, Copy as CopyIcon } from 'lucide-react';\nimport { Button } from '../Button';\nimport { Popover } from '../Popover';\nimport type { CopyProps } from './Copy.types';\n\nexport const Copy = forwardRef<HTMLButtonElement, CopyProps>(function Copy(\n {\n text,\n copiedLabel = 'Copied',\n label = 'Copy to clipboard',\n timeout = 1500,\n icon,\n onCopy,\n onError,\n disabled,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [copied, setCopied] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const canCopy = typeof navigator !== 'undefined' && typeof navigator.clipboard?.writeText === 'function';\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, []);\n\n const handleClick = () => {\n if (!canCopy) return;\n navigator.clipboard.writeText(text).then(\n () => {\n onCopy?.(text);\n setCopied(true);\n if (timerRef.current) clearTimeout(timerRef.current);\n timerRef.current = setTimeout(() => setCopied(false), timeout);\n },\n (err) => onError?.(err),\n );\n };\n\n return (\n <>\n <Popover open={copied} content={copiedLabel} side=\"top\" align=\"center\">\n <Button\n ref={ref}\n type=\"button\"\n variant=\"tertiary\"\n iconOnly\n size=\"sm\"\n disabled={disabled || !canCopy}\n onClick={handleClick}\n aria-label={label}\n dataTestId={dataTestId}\n {...rest}\n >\n {copied ? <Check className=\"size-4\" /> : icon ?? <CopyIcon className=\"size-4\" />}\n </Button>\n </Popover>\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {copied ? copiedLabel : ''}\n </span>\n </>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { InputProps, InputSize } from './Input.types';\n\nconst sizeStyles: Record<InputSize, string> = {\n lg: 'h-12 text-p-md',\n md: 'h-10 text-p-std',\n sm: 'h-8 text-p-sm',\n};\n\nconst sidePaddingByIcon: Record<InputSize, string> = {\n lg: 'pl-10',\n md: 'pl-9',\n sm: 'pl-8',\n};\n\nconst sidePaddingByRightIcon: Record<InputSize, string> = {\n lg: 'pr-10',\n md: 'pr-9',\n sm: 'pr-8',\n};\n\nconst iconSlotSize: Record<InputSize, string> = {\n lg: 'w-10',\n md: 'w-9',\n sm: 'w-8',\n};\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n {\n label,\n labelAddons,\n helperText,\n errorText,\n size = 'md',\n leftIcon,\n rightIcon,\n leftAddon,\n rightAddon,\n error = false,\n id,\n disabled,\n className,\n wrapperClassName,\n required,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const describedBy = errorText ? `${inputId}-error` : helperText ? `${inputId}-help` : undefined;\n const hasError = error || !!errorText;\n\n return (\n <div className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)} data-test-id={dataTestId}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <div\n className={cn(\n 'flex items-stretch w-full rounded-lg bg-bg-default transition-colors',\n 'border',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus-within:ring-2 focus-within:ring-offset-0',\n hasError\n ? 'focus-within:ring-red-300 focus-within:border-red-600'\n : 'focus-within:ring-brand-300 focus-within:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed',\n sizeStyles[size],\n )}\n >\n {leftAddon && (\n <span className=\"inline-flex items-center px-3 text-fg-secondary bg-bg-container border-r border-border-default rounded-l-lg whitespace-nowrap\">\n {leftAddon}\n </span>\n )}\n <div className=\"relative flex-1 min-w-0\">\n {leftIcon && (\n <span\n aria-hidden\n className={cn(\n 'absolute inset-y-0 left-0 flex items-center justify-center text-fg-secondary pointer-events-none',\n iconSlotSize[size],\n )}\n >\n {leftIcon}\n </span>\n )}\n <input\n ref={ref}\n id={inputId}\n disabled={disabled}\n required={required}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n className={cn(\n 'w-full h-full bg-transparent outline-none',\n 'placeholder:text-fg-tertiary text-fg-default',\n 'disabled:cursor-not-allowed disabled:text-fg-disabled',\n leftIcon ? sidePaddingByIcon[size] : 'pl-3',\n rightIcon || hasError ? sidePaddingByRightIcon[size] : 'pr-3',\n className,\n )}\n {...rest}\n />\n {(rightIcon || hasError) && (\n <span\n aria-hidden\n className={cn(\n 'absolute inset-y-0 right-0 flex items-center justify-center pointer-events-none',\n iconSlotSize[size],\n hasError ? 'text-red-600' : 'text-fg-secondary',\n )}\n >\n {hasError ? <AlertCircle className=\"h-4 w-4\" /> : rightIcon}\n </span>\n )}\n </div>\n {rightAddon && (\n <span className=\"inline-flex items-center px-3 text-fg-secondary bg-bg-container border-l border-border-default rounded-r-lg whitespace-nowrap\">\n {rightAddon}\n </span>\n )}\n </div>\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { forwardRef, useEffect, useState, type ChangeEvent } from 'react';\nimport { Minus, Plus } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Input } from '../Input';\nimport type { CounterProps } from './Counter.types';\n\nconst addonButtonClass =\n 'inline-flex items-center justify-center text-fg-secondary transition-colors hover:text-fg-default disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none';\n\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(function Counter(\n {\n value,\n defaultValue = 0,\n onValueChange,\n min = 0,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n size = 'md',\n label,\n helperText,\n errorText,\n error,\n disabled,\n className,\n wrapperClassName,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const isControlled = value !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const committedValue = isControlled ? value : internalValue;\n\n // A plain string draft, separate from the committed numeric value — so\n // clearing the field doesn't immediately snap back to a number, and an\n // in-progress keystroke (e.g. a lone \"-\") isn't clobbered by clamping on\n // every change. Clamping happens once, on blur.\n const [draft, setDraft] = useState(String(committedValue));\n\n useEffect(() => {\n setDraft(String(committedValue));\n }, [committedValue]);\n\n const commit = (next: number) => {\n const clamped = Math.min(max, Math.max(min, next));\n if (!isControlled) setInternalValue(clamped);\n onValueChange?.(clamped);\n return clamped;\n };\n\n const increase = () => commit(committedValue + step);\n const decrease = () => commit(committedValue - step);\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n setDraft(event.target.value);\n };\n\n const handleBlur = () => {\n const parsed = Number.parseInt(draft, 10);\n if (Number.isNaN(parsed)) {\n setDraft(String(committedValue));\n return;\n }\n setDraft(String(commit(parsed)));\n };\n\n return (\n <Input\n ref={ref}\n type=\"number\"\n min={min}\n max={max}\n step={step}\n size={size}\n label={label}\n helperText={helperText}\n errorText={errorText}\n error={error}\n disabled={disabled}\n dataTestId={dataTestId}\n wrapperClassName={cn('max-w-[140px]', wrapperClassName)}\n value={draft}\n onChange={handleChange}\n onBlur={handleBlur}\n leftAddon={\n <button\n type=\"button\"\n disabled={disabled || committedValue <= min}\n onClick={decrease}\n aria-label=\"Decrease\"\n className={addonButtonClass}\n >\n <Minus className=\"size-4\" />\n </button>\n }\n rightAddon={\n <button\n type=\"button\"\n disabled={disabled || committedValue >= max}\n onClick={increase}\n aria-label=\"Increase\"\n className={addonButtonClass}\n >\n <Plus className=\"size-4\" />\n </button>\n }\n className={cn(\n 'text-center [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n className,\n )}\n {...rest}\n />\n );\n});\n","import { forwardRef, useEffect, useId, useRef, useState } from 'react';\nimport { Calendar, ChevronLeft, ChevronRight } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { DatePickerProps, DatePickerSize } from './DatePicker.types';\n\n// Heights, text sizes and horizontal padding mirror Input/Select exactly so a\n// DatePicker lines up with the other fields in a form grid.\nconst sizeStyles: Record<DatePickerSize, string> = {\n lg: 'h-12 text-p-md px-3.5',\n md: 'h-10 text-p-std px-3',\n sm: 'h-8 text-p-sm px-2.5',\n};\n\nconst MONTH_NAMES = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nconst DAY_NAMES = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'];\n\nfunction startOfMonth(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), 1);\n}\n\nfunction sameDay(a: Date | null, b: Date | null) {\n return (\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate()\n );\n}\n\nfunction startOfDay(date: Date) {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\n// Normalizing both sides to local midnight makes the comparison day-granular\n// in both directions without a separate `endOfDay` boundary — a `minDate`\n// carrying today's wall-clock time (e.g. `new Date()`) still leaves today\n// itself selectable, since today's grid cell is also midnight.\nfunction isDayDisabled(date: Date, minDate?: Date, maxDate?: Date, excludeDates?: Date[]) {\n const time = startOfDay(date).getTime();\n if (minDate && time < startOfDay(minDate).getTime()) return true;\n if (maxDate && time > startOfDay(maxDate).getTime()) return true;\n return !!excludeDates?.some((excluded) => sameDay(excluded, date));\n}\n\nfunction formatShort(date: Date) {\n return `${String(date.getDate()).padStart(2, '0')}.${String(date.getMonth() + 1).padStart(2, '0')}.${date.getFullYear()}`;\n}\n\nfunction buildGrid(view: Date) {\n const first = startOfMonth(view);\n const offset = (first.getDay() + 6) % 7; // Mon-first\n const daysInMonth = new Date(view.getFullYear(), view.getMonth() + 1, 0).getDate();\n const cells: (Date | null)[] = [];\n for (let i = 0; i < offset; i++) cells.push(null);\n for (let i = 1; i <= daysInMonth; i++) cells.push(new Date(view.getFullYear(), view.getMonth(), i));\n while (cells.length % 7 !== 0) cells.push(null);\n return cells;\n}\n\nexport const DatePicker = forwardRef<HTMLButtonElement, DatePickerProps>(function DatePicker(\n {\n value,\n onChange,\n range = false,\n rangeValue,\n onChangeRange,\n size = 'md',\n label,\n placeholder = 'Select date',\n fullWidth = false,\n disabled = false,\n minDate,\n maxDate,\n excludeDates,\n error = false,\n errorText,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const triggerId = id ?? reactId;\n const [open, setOpen] = useState(false);\n const [view, setView] = useState<Date>(value ?? rangeValue?.start ?? new Date());\n const [hoverEnd, setHoverEnd] = useState<Date | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const hasError = error || !!errorText;\n const describedBy = errorText ? `${triggerId}-error` : undefined;\n\n useEffect(() => {\n if (disabled) setOpen(false);\n }, [disabled]);\n\n useEffect(() => {\n if (!open) return;\n const onClick = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onClick);\n return () => document.removeEventListener('mousedown', onClick);\n }, [open]);\n\n const display = range\n ? rangeValue?.start\n ? `${formatShort(rangeValue.start)}${rangeValue.end ? ` – ${formatShort(rangeValue.end)}` : ''}`\n : ''\n : value\n ? formatShort(value)\n : '';\n\n function pick(date: Date) {\n if (!range) {\n onChange?.(date);\n setOpen(false);\n return;\n }\n const current = rangeValue ?? { start: null, end: null };\n if (!current.start || (current.start && current.end)) {\n onChangeRange?.({ start: date, end: null });\n return;\n }\n if (date < current.start) {\n onChangeRange?.({ start: date, end: current.start });\n return;\n }\n onChangeRange?.({ start: current.start, end: date });\n setOpen(false);\n }\n\n const cells = buildGrid(view);\n const currentRange = rangeValue ?? { start: null, end: null };\n const rangeEnd = currentRange.end ?? hoverEnd;\n\n return (\n <div\n ref={containerRef}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-1.5', fullWidth && 'w-full', wrapperClassName)}\n >\n {label && (\n <label htmlFor={triggerId} className=\"text-p-std font-medium text-fg-default inline-flex\">\n {label}\n </label>\n )}\n <div className=\"relative\">\n <button\n ref={ref}\n id={triggerId}\n type=\"button\"\n disabled={disabled}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n onClick={() => setOpen((v) => !v)}\n className={cn(\n 'inline-flex items-center gap-2 rounded-lg border bg-bg-default text-left transition-colors focus-visible:outline-none focus-visible:ring-2',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n hasError\n ? 'focus-visible:ring-red-300 focus-visible:border-red-600'\n : 'focus-visible:ring-brand-300 focus-visible:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed text-fg-disabled',\n fullWidth ? 'w-full min-w-0' : 'min-w-[260px]',\n sizeStyles[size],\n className,\n )}\n >\n <span\n className={cn(\n 'flex-1 text-left truncate',\n disabled ? 'text-fg-disabled' : display ? 'text-fg-default' : 'text-fg-tertiary',\n )}\n >\n {display || placeholder}\n </span>\n <Calendar className={cn('w-4 h-4', disabled ? 'text-fg-disabled' : 'text-fg-secondary')} />\n </button>\n\n {open && (\n <div className=\"absolute z-50 mt-1 left-0 rounded-xl border border-border-default bg-bg-default shadow-z3 p-3 w-[300px]\">\n <div className=\"flex items-center justify-between mb-2\">\n <button\n type=\"button\"\n className=\"w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary\"\n onClick={() => setView(new Date(view.getFullYear(), view.getMonth() - 1, 1))}\n aria-label=\"Previous month\"\n >\n <ChevronLeft className=\"w-4 h-4\" />\n </button>\n <div className=\"text-p-md font-semibold text-fg-default\">\n {MONTH_NAMES[view.getMonth()]} {view.getFullYear()}\n </div>\n <button\n type=\"button\"\n className=\"w-8 h-8 rounded-md hover:bg-bg-container flex items-center justify-center text-fg-secondary\"\n onClick={() => setView(new Date(view.getFullYear(), view.getMonth() + 1, 1))}\n aria-label=\"Next month\"\n >\n <ChevronRight className=\"w-4 h-4\" />\n </button>\n </div>\n <div className=\"grid grid-cols-7 gap-1 text-center\">\n {DAY_NAMES.map((day) => (\n <div key={day} className=\"text-p-xs text-fg-tertiary py-1\">\n {day}\n </div>\n ))}\n {cells.map((date, index) => {\n if (!date) return <div key={index} />;\n const dayDisabled = isDayDisabled(date, minDate, maxDate, excludeDates);\n const isSelected = !range && sameDay(date, value ?? null);\n const isStart = range && sameDay(date, currentRange.start);\n const isEnd = range && sameDay(date, rangeEnd);\n const isInRange =\n range && !!currentRange.start && !!rangeEnd && date > currentRange.start && date < rangeEnd;\n const stateClassName = dayDisabled\n ? 'text-fg-disabled cursor-not-allowed'\n : isSelected || isStart || isEnd\n ? 'bg-brand-500 text-white'\n : isInRange\n ? 'bg-bg-brand-lighter text-brand-700'\n : 'text-fg-default hover:bg-bg-container';\n return (\n <button\n key={index}\n type=\"button\"\n disabled={dayDisabled}\n aria-disabled={dayDisabled || undefined}\n onMouseEnter={() =>\n !dayDisabled && range && currentRange.start && !currentRange.end && setHoverEnd(date)\n }\n onClick={() => !dayDisabled && pick(date)}\n className={cn('h-8 rounded-md text-p-sm font-medium', stateClassName)}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n </div>\n )}\n </div>\n {errorText ? (\n <p id={`${triggerId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { DistributionBarProps, DistributionBarSize, DistributionColor } from './DistributionBar.types';\n\nconst colorStyles: Record<DistributionColor, string> = {\n brand: 'bg-brand-500',\n blue: 'bg-blue-500',\n purple: 'bg-purple-500',\n pink: 'bg-pink-500',\n yellow: 'bg-yellow-500',\n red: 'bg-red-500',\n gray: 'bg-gray-400',\n};\n\nconst sizeStyles: Record<DistributionBarSize, string> = {\n sm: 'h-1',\n lg: 'h-2',\n};\n\nconst defaultFormatValue = (value: number) => new Intl.NumberFormat().format(value);\n\nexport const DistributionBar = forwardRef<HTMLDivElement, DistributionBarProps>(function DistributionBar(\n {\n segments,\n hideLegend = false,\n formatValue = defaultFormatValue,\n size = 'lg',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const total = segments.reduce((sum, segment) => sum + segment.value, 0);\n\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-3', className)} {...rest}>\n <div className={cn('flex w-full overflow-hidden rounded-full bg-bg-subtle', sizeStyles[size])}>\n {segments.map((segment, index) => {\n const percent = total > 0 ? (segment.value / total) * 100 : 0;\n return (\n <div\n key={index}\n style={{ flexBasis: `${percent}%` }}\n className={cn('transition-[flex-basis] duration-700 ease-out', colorStyles[segment.color])}\n />\n );\n })}\n </div>\n {!hideLegend && (\n <ul className=\"flex flex-col [&>li:not(:last-child)]:border-b [&>li:not(:last-child)]:border-border-default\">\n {segments\n .filter((segment) => !segment.hideFromLegend)\n .map((segment, index) => (\n <li key={index} className=\"flex items-center justify-between gap-3 py-1.5\">\n <span className=\"flex min-w-0 items-center gap-2\">\n <span className={cn('size-2 shrink-0 rounded-full', colorStyles[segment.color])} />\n <span className=\"truncate text-p-sm text-fg-tertiary\">{segment.label}</span>\n </span>\n <span className=\"shrink-0 text-p-sm text-fg-default tabular-nums\">\n {formatValue(segment.value)}\n {segment.unit ? ` ${segment.unit}` : ''}\n </span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n});\n","/** Durations in ms for JS-driven transition timing (mount/unmount\n * orchestration). Kept in sync by hand with the Tailwind `duration-*`\n * utilities used alongside them in component classes — same\n * two-parallel-representations discipline as the token pipeline. */\nexport const MOTION_DURATION = {\n fast: 150,\n base: 200,\n slow: 300,\n} as const;\n\n/** True when the user has asked for reduced motion. SSR-safe. */\nexport function prefersReducedMotion(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches\n );\n}\n","import { useEffect, useRef, useState } from 'react';\nimport { prefersReducedMotion } from './motion';\n\nexport type TransitionState = 'closed' | 'entering' | 'entered' | 'exiting';\n\n/** Keeps a node mounted through its exit transition instead of unmounting\n * the instant `open` goes false.\n * - `open` false -> true: `mounted` becomes `true` immediately, `state`\n * is `'entering'`, then flips to `'entered'` after *two* animation\n * frames — a single `requestAnimationFrame` fires before the browser\n * has actually painted the `'entering'` styles (React's commit, this\n * effect, and that one callback can all still land inside the same\n * frame), so the flip to `'entered'` can end up coalesced into the\n * same paint and never visibly transition. Waiting a full frame first\n * guarantees the browser paints the from-state at least once before\n * the to-state is applied, which is what makes a CSS transition\n * actually animate instead of jumping straight to its end value.\n * - `open` true -> false: `state` becomes `'exiting'`; `mounted` stays\n * `true` for `durationMs`, then both flip to `'closed'`/`false`.\n * - Honors `prefers-reduced-motion` by collapsing `durationMs` to `0`, so\n * a reduced-motion user never waits on an invisible mounted node. */\nexport function useMountTransition(\n open: boolean,\n durationMs: number,\n): { mounted: boolean; state: TransitionState } {\n const [mounted, setMounted] = useState(open);\n const [state, setState] = useState<TransitionState>(open ? 'entered' : 'closed');\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const rafRef = useRef<number | null>(null);\n\n useEffect(() => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n\n const applyOpen = () => {\n setMounted(true);\n setState('entering');\n rafRef.current = requestAnimationFrame(() => {\n rafRef.current = requestAnimationFrame(() => setState('entered'));\n });\n };\n\n const applyClosed = () => {\n setState((prev) => (prev === 'closed' ? 'closed' : 'exiting'));\n const duration = prefersReducedMotion() ? 0 : durationMs;\n if (duration === 0) {\n setMounted(false);\n setState('closed');\n } else {\n timeoutRef.current = setTimeout(() => {\n setMounted(false);\n setState('closed');\n }, duration);\n }\n };\n\n if (open) {\n applyOpen();\n } else {\n applyClosed();\n }\n }, [open, durationMs]);\n\n useEffect(\n () => () => {\n if (timeoutRef.current) clearTimeout(timeoutRef.current);\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n },\n [],\n );\n\n return { mounted, state };\n}\n","import { forwardRef, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { MOTION_DURATION } from '../../lib/motion';\nimport { useMountTransition } from '../../lib/useMountTransition';\nimport type { DrawerProps, DrawerSide, DrawerSize } from './Drawer.types';\n\nconst horizontalSize: Record<DrawerSize, string> = {\n sm: 'w-[320px]',\n md: 'w-[420px]',\n lg: 'w-[560px]',\n xl: 'w-[720px]',\n};\n\nconst verticalSize: Record<DrawerSize, string> = {\n sm: 'h-[240px]',\n md: 'h-[360px]',\n lg: 'h-[480px]',\n xl: 'h-[600px]',\n};\n\nconst sideClasses: Record<DrawerSide, string> = {\n right: 'inset-y-0 right-0 border-l',\n left: 'inset-y-0 left-0 border-r',\n top: 'inset-x-0 top-0 border-b',\n bottom: 'inset-x-0 bottom-0 border-t',\n};\n\nconst offscreenClasses: Record<DrawerSide, string> = {\n right: 'translate-x-full',\n left: '-translate-x-full',\n top: '-translate-y-full',\n bottom: 'translate-y-full',\n};\n\nexport const Drawer = forwardRef<HTMLDivElement, DrawerProps>(function Drawer(\n {\n open,\n onClose,\n side = 'right',\n size = 'md',\n title,\n description,\n children,\n footer,\n closeOnOverlayClick = true,\n showClose = true,\n animated = true,\n headerActions,\n className,\n dataTestId,\n },\n ref,\n) {\n const panelRef = useRef<HTMLDivElement>(null);\n const { mounted, state } = useMountTransition(open, animated ? MOTION_DURATION.slow : 0);\n const shown = state === 'entered';\n\n // Scroll lock spans the full mounted window (including the exit\n // animation) so the page doesn't jump before the drawer finishes\n // sliding away. Focus restore fires as soon as `open` goes false,\n // instead — otherwise the user's focus would sit on a drawer that's\n // already sliding off-screen for the length of the exit transition.\n useEffect(() => {\n if (!mounted) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose();\n };\n document.addEventListener('keydown', onKey);\n const prev = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = prev;\n };\n }, [mounted, onClose]);\n\n useEffect(() => {\n if (!open) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n panelRef.current?.focus();\n return () => prevFocus?.focus?.();\n }, [open]);\n\n if (!mounted) return null;\n\n const isHorizontal = side === 'left' || side === 'right';\n const sizeCls = isHorizontal ? horizontalSize[size] : verticalSize[size];\n\n const content = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-hidden={state === 'exiting' || undefined}\n aria-labelledby={title ? 'drawer-title' : undefined}\n aria-describedby={description ? 'drawer-desc' : undefined}\n className=\"fixed inset-0 z-50\"\n data-test-id={dataTestId}\n >\n <div\n className={cn(\n 'absolute inset-0 bg-black/50',\n animated && 'transition-opacity duration-200 motion-reduce:transition-none',\n shown ? 'opacity-100' : 'opacity-0',\n )}\n onClick={() => closeOnOverlayClick && onClose()}\n aria-hidden\n />\n <div\n ref={mergeRefs(ref, panelRef)}\n tabIndex={-1}\n className={cn(\n 'absolute bg-bg-default shadow-z5 outline-none flex flex-col',\n sideClasses[side],\n isHorizontal ? `${sizeCls} h-full max-w-full` : `${sizeCls} w-full max-h-full`,\n 'border-border-default',\n animated && 'transition-transform duration-300 ease-out motion-reduce:transition-none will-change-transform',\n shown ? 'translate-x-0 translate-y-0' : offscreenClasses[side],\n className,\n )}\n >\n {(title || showClose || headerActions) && (\n <div className=\"flex items-start justify-between gap-4 px-6 pt-6 pb-4 border-b border-border-default\">\n <div className=\"flex-1 min-w-0\">\n {title && (\n <h2 id=\"drawer-title\" className=\"text-h-xs font-semibold text-fg-default\">\n {title}\n </h2>\n )}\n {description && (\n <p id=\"drawer-desc\" className=\"mt-1 text-p-std text-fg-secondary\">\n {description}\n </p>\n )}\n </div>\n <div className=\"flex items-center gap-1 shrink-0 -mr-2 -mt-2\">\n {headerActions}\n {showClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-5 w-5\" />\n </button>\n )}\n </div>\n </div>\n )}\n {children && <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>}\n {footer && (\n <div className=\"flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n});\n","import { useLayoutEffect, useState, type CSSProperties, type RefObject } from 'react';\n\nexport type AnchoredSide = 'bottom' | 'top';\nexport type AnchoredAlign = 'start' | 'end';\n\nexport interface UseAnchoredPositionOptions {\n /** A ref pointing at the anchor element, read fresh on every recompute —\n * never dereferenced by the caller, so the caller never has to read\n * `.current` during render or copy it into its own state. */\n anchor: RefObject<HTMLElement | null> | null | undefined;\n panel: HTMLElement | null;\n open: boolean;\n /** Preferred side. Flips to the opposite side when there isn't room, unless `flip` is false. */\n side?: AnchoredSide;\n align?: AnchoredAlign;\n offset?: number;\n flip?: boolean;\n /** Clamp the panel horizontally so it stays inside the viewport. */\n shift?: boolean;\n matchAnchorWidth?: boolean;\n}\n\nexport interface AnchoredPosition {\n style: CSSProperties;\n /** The side actually used, after flipping — for `data-side` and animation origin. */\n resolvedSide: AnchoredSide;\n}\n\nconst VIEWPORT_MARGIN = 8;\n\n/** Computes `position: fixed` coordinates for a panel anchored to a trigger\n * element, so the panel can portal to `document.body` without being\n * clipped by an `overflow: hidden` ancestor. Recomputes on open, resize,\n * and any ancestor scroll (capture-phase, since `position: fixed`\n * coordinates are viewport-relative and unaffected by scroll offset\n * themselves — but the anchor's rect moves when something scrolls). */\nexport function useAnchoredPosition({\n anchor,\n panel,\n open,\n side = 'bottom',\n align = 'start',\n offset = 4,\n flip = true,\n shift = true,\n matchAnchorWidth = false,\n}: UseAnchoredPositionOptions): AnchoredPosition {\n const [position, setPosition] = useState<AnchoredPosition>({\n style: { position: 'fixed', top: 0, left: 0, visibility: 'hidden' },\n resolvedSide: side,\n });\n\n useLayoutEffect(() => {\n if (!open || !panel) return;\n\n const compute = () => {\n const anchorEl = anchor?.current;\n if (!anchorEl) return;\n const anchorRect = anchorEl.getBoundingClientRect();\n const panelRect = panel.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n let resolvedSide = side;\n if (flip) {\n const spaceBelow = viewportHeight - anchorRect.bottom;\n const spaceAbove = anchorRect.top;\n if (side === 'bottom' && spaceBelow < panelRect.height + offset && spaceAbove > spaceBelow) {\n resolvedSide = 'top';\n } else if (side === 'top' && spaceAbove < panelRect.height + offset && spaceBelow > spaceAbove) {\n resolvedSide = 'bottom';\n }\n }\n\n const top =\n resolvedSide === 'bottom' ? anchorRect.bottom + offset : anchorRect.top - panelRect.height - offset;\n\n let left = align === 'end' ? anchorRect.right - panelRect.width : anchorRect.left;\n if (shift) {\n left = Math.min(Math.max(left, VIEWPORT_MARGIN), viewportWidth - panelRect.width - VIEWPORT_MARGIN);\n }\n\n setPosition({\n style: {\n position: 'fixed',\n top,\n left,\n minWidth: matchAnchorWidth ? anchorRect.width : undefined,\n },\n resolvedSide,\n });\n };\n\n compute();\n window.addEventListener('resize', compute);\n document.addEventListener('scroll', compute, { capture: true, passive: true });\n return () => {\n window.removeEventListener('resize', compute);\n document.removeEventListener('scroll', compute, { capture: true });\n };\n }, [open, anchor, panel, side, align, offset, flip, shift, matchAnchorWidth]);\n\n return position;\n}\n","import {\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useEffect,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type RefObject,\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport { Check } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { useAnchoredPosition } from '../../lib/useAnchoredPosition';\nimport type {\n DropdownContentProps,\n DropdownItemProps,\n DropdownLabelProps,\n DropdownMenuProps,\n DropdownSeparatorProps,\n DropdownTriggerProps,\n} from './DropdownMenu.types';\n\ninterface DropdownCtx {\n open: boolean;\n setOpen: (open: boolean) => void;\n triggerRef: RefObject<HTMLElement | null>;\n anchorRef?: RefObject<HTMLElement | null>;\n}\n\nconst DropdownContext = createContext<DropdownCtx | null>(null);\n\nfunction useDropdown() {\n const ctx = useContext(DropdownContext);\n if (!ctx) throw new Error('Dropdown parts must be used inside <DropdownMenu>');\n return ctx;\n}\n\nexport const DropdownMenu = forwardRef<HTMLDivElement, DropdownMenuProps>(function DropdownMenu(\n { children, defaultOpen = false, open, onOpenChange, anchorRef, className, dataTestId, ...rest },\n ref,\n) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const isControlled = open !== undefined;\n const current = isControlled ? open : internalOpen;\n const triggerRef = useRef<HTMLElement | null>(null);\n\n const setOpen = (value: boolean) => {\n if (!isControlled) setInternalOpen(value);\n onOpenChange?.(value);\n };\n\n useEffect(() => {\n if (!current) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key === 'Escape') setOpen(false);\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current]);\n\n return (\n <DropdownContext.Provider value={{ open: current, setOpen, triggerRef, anchorRef }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('relative inline-block', className)}\n {...rest}\n >\n {children}\n </div>\n </DropdownContext.Provider>\n );\n});\n\nexport function DropdownTrigger({ children }: DropdownTriggerProps) {\n const { open, setOpen, triggerRef } = useDropdown();\n if (!isValidElement(children)) return children;\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n\n return cloneElement(children, {\n ref: triggerRef,\n onClick: (e: ReactMouseEvent) => {\n const orig = childProps.onClick as ((e: ReactMouseEvent) => void) | undefined;\n orig?.(e);\n if (!e.defaultPrevented) setOpen(!open);\n },\n 'aria-haspopup': 'menu',\n 'aria-expanded': open,\n } as Record<string, unknown>);\n}\n\nconst panelBaseClass =\n 'min-w-[200px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 py-1';\n\nexport const DropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(\n function DropdownContent(\n {\n children,\n align = 'start',\n strategy = 'fixed',\n side = 'bottom',\n sideOffset = 4,\n flip = true,\n shift = true,\n matchTriggerWidth = false,\n closeOnScroll = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) {\n const { open, setOpen, triggerRef, anchorRef } = useDropdown();\n const contentRef = useRef<HTMLDivElement>(null);\n const [panelEl, setPanelEl] = useState<HTMLDivElement | null>(null);\n // Picking which ref object to measure from — not reading `.current` —\n // so this stays a plain render-time choice, not a ref access.\n const positionAnchorRef = anchorRef ?? triggerRef;\n\n const { style, resolvedSide } = useAnchoredPosition({\n anchor: positionAnchorRef,\n panel: panelEl,\n open: open && strategy === 'fixed',\n side,\n align,\n offset: sideOffset,\n flip,\n shift,\n matchAnchorWidth: matchTriggerWidth,\n });\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n const target = e.target as Node;\n if (contentRef.current?.contains(target)) return;\n if (triggerRef.current?.contains(target)) return;\n if (anchorRef?.current?.contains(target)) return;\n setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open, setOpen, triggerRef, anchorRef]);\n\n useEffect(() => {\n if (!open || !closeOnScroll) return;\n const onScroll = () => setOpen(false);\n document.addEventListener('scroll', onScroll, { capture: true, passive: true });\n return () => document.removeEventListener('scroll', onScroll, { capture: true });\n }, [open, closeOnScroll, setOpen]);\n\n useEffect(() => {\n if (!open) return;\n const raf = requestAnimationFrame(() => {\n const first = contentRef.current?.querySelector<HTMLElement>('[role=\"menuitem\"]:not(:disabled)');\n first?.focus();\n });\n return () => cancelAnimationFrame(raf);\n }, [open]);\n\n if (!open) return null;\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const items = Array.from(\n contentRef.current?.querySelectorAll<HTMLElement>('[role=\"menuitem\"]:not(:disabled)') ?? [],\n );\n if (!items.length) return;\n const currentIndex = items.indexOf(document.activeElement as HTMLElement);\n\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n items[(currentIndex + 1 + items.length) % items.length]?.focus();\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n items[(currentIndex - 1 + items.length) % items.length]?.focus();\n } else if (event.key === 'Home') {\n event.preventDefault();\n items[0]?.focus();\n } else if (event.key === 'End') {\n event.preventDefault();\n items[items.length - 1]?.focus();\n }\n };\n\n const panel = (\n <div\n ref={mergeRefs(ref, contentRef, strategy === 'fixed' ? setPanelEl : undefined)}\n role=\"menu\"\n data-test-id={dataTestId}\n data-side={strategy === 'fixed' ? resolvedSide : undefined}\n data-align={align}\n onKeyDown={handleKeyDown}\n style={strategy === 'fixed' ? style : undefined}\n className={cn(\n panelBaseClass,\n strategy === 'absolute' && cn('absolute top-full mt-1', align === 'end' ? 'right-0' : 'left-0'),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n\n return strategy === 'fixed' ? createPortal(panel, document.body) : panel;\n },\n);\n\nexport const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(function DropdownItem(\n {\n children,\n onSelect,\n disabled,\n icon,\n shortcut,\n destructive,\n checked,\n meta,\n className,\n dataTestId,\n onClick,\n ...rest\n },\n ref,\n) {\n const { setOpen } = useDropdown();\n return (\n <button\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={disabled}\n data-test-id={dataTestId}\n onClick={(event) => {\n onClick?.(event);\n onSelect?.();\n setOpen(false);\n }}\n className={cn(\n 'flex w-full gap-2 px-3 py-2 text-left text-p-std text-fg-default',\n meta ? 'items-start' : 'items-center',\n 'hover:bg-bg-subtle focus-visible:outline-none focus-visible:bg-bg-subtle',\n disabled && 'opacity-50 cursor-not-allowed hover:bg-transparent',\n destructive && 'text-red-700 hover:bg-red-50',\n className,\n )}\n {...rest}\n >\n {checked !== undefined && (\n <span className=\"w-4 shrink-0\">{checked && <Check className=\"h-4 w-4 text-brand-500\" />}</span>\n )}\n {icon && <span className=\"inline-flex shrink-0 text-fg-secondary\">{icon}</span>}\n <span className=\"flex-1 min-w-0 text-left\">\n <span className=\"block truncate\">{children}</span>\n {meta && <span className=\"block truncate text-p-sm text-fg-tertiary\">{meta}</span>}\n </span>\n {shortcut && <span className=\"text-p-sm text-fg-tertiary shrink-0 tabular-nums\">{shortcut}</span>}\n </button>\n );\n});\n\nexport const DropdownSeparator = forwardRef<HTMLDivElement, DropdownSeparatorProps>(\n function DropdownSeparator({ className, dataTestId, ...rest }, ref) {\n return (\n <div\n ref={ref}\n role=\"separator\"\n data-test-id={dataTestId}\n className={cn('my-1 h-px bg-border-default', className)}\n {...rest}\n />\n );\n },\n);\n\nexport const DropdownLabel = forwardRef<HTMLDivElement, DropdownLabelProps>(function DropdownLabel(\n { children, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'px-3 py-1.5 text-p-xs font-semibold uppercase tracking-wider text-fg-tertiary',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { IconTileProps, IconTileSize, IconTileTone } from './IconTile.types';\n\n/* Background + icon-color pairs, legible on both light and dark surfaces.\n * Uses semantic bg-*-lighter aliases where available (they flip in dark\n * mode automatically via theme.css's `.dark` block). Purple and pink have\n * no semantic \"lighter\" alias yet, so they fall back to raw scale shades\n * with explicit `dark:` variants, same as the source design system.\n */\nconst toneStyles: Record<IconTileTone, { bg: string; icon: string }> = {\n brand: { bg: 'bg-bg-brand-lighter', icon: 'text-brand-700' },\n info: { bg: 'bg-bg-info-lighter', icon: 'text-blue-700' },\n gray: { bg: 'bg-bg-subtle', icon: 'text-fg-tertiary' },\n purple: { bg: 'bg-purple-50 dark:bg-purple-900/30', icon: 'text-purple-700 dark:text-purple-300' },\n pink: { bg: 'bg-pink-50 dark:bg-pink-900/30', icon: 'text-pink-700 dark:text-pink-300' },\n yellow: { bg: 'bg-bg-warning-lighter', icon: 'text-yellow-800' },\n success: { bg: 'bg-bg-success-lighter', icon: 'text-green-600' },\n warning: { bg: 'bg-bg-warning-lighter', icon: 'text-yellow-800' },\n danger: { bg: 'bg-bg-danger-lighter', icon: 'text-red-700' },\n};\n\n// Dimensions/icon size per step, plus the radius used for the `rounded`\n// shape. The `circle` shape reuses the same box/icon sizing and just swaps\n// in `rounded-full` instead — see the className below.\nconst sizeStyles: Record<IconTileSize, { box: string; icon: string; radius: string }> = {\n sm: { box: 'h-8 w-8', icon: 'h-4 w-4', radius: 'rounded-md' },\n md: { box: 'h-10 w-10', icon: 'h-5 w-5', radius: 'rounded-lg' },\n lg: { box: 'h-12 w-12', icon: 'h-6 w-6', radius: 'rounded-lg' },\n xl: { box: 'h-14 w-14', icon: 'h-7 w-7', radius: 'rounded-xl' },\n};\n\nexport const IconTile = forwardRef<HTMLDivElement, IconTileProps>(function IconTile(\n {\n icon: Icon,\n tone = 'gray',\n size = 'md',\n shape = 'rounded',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const t = toneStyles[tone];\n const s = sizeStyles[size];\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n aria-hidden={rest['aria-label'] ? undefined : true}\n className={cn(\n 'inline-flex items-center justify-center shrink-0',\n s.box,\n shape === 'circle' ? 'rounded-full' : s.radius,\n t.bg,\n className,\n )}\n {...rest}\n >\n <Icon className={cn(s.icon, t.icon)} />\n </div>\n );\n});\n","import { createElement, forwardRef, type ElementType } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TextProps, TextVariant, TextWeight, TextColor } from './Text.types';\n\nconst variantClass: Record<TextVariant, string> = {\n 'h-xl': 'text-h-xl',\n 'h-lg': 'text-h-lg',\n 'h-md': 'text-h-md',\n 'h-std': 'text-h-std',\n 'h-sm': 'text-h-sm',\n 'h-xs': 'text-h-xs',\n 'p-lg': 'text-p-lg',\n 'p-md': 'text-p-md',\n 'p-std': 'text-p-std',\n 'p-sm': 'text-p-sm',\n 'p-xs': 'text-p-xs',\n 'label-lg': 'text-label-lg',\n 'label-md': 'text-label-md',\n 'label-std': 'text-label-std',\n 'label-sm': 'text-label-sm',\n 'label-xs': 'text-label-xs',\n 'label-xxs': 'text-label-xxs',\n};\n\nconst weightClass: Record<TextWeight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n bold: 'font-bold',\n};\n\nconst colorClass: Record<TextColor, string> = {\n default: 'text-fg-default',\n secondary: 'text-fg-secondary',\n tertiary: 'text-fg-tertiary',\n disabled: 'text-fg-disabled',\n inverse: 'text-fg-inverse',\n brand: 'text-fg-brand',\n info: 'text-fg-info',\n success: 'text-fg-success',\n warning: 'text-fg-warning',\n danger: 'text-fg-danger',\n};\n\n/** Sensible default element for each variant (can be overridden with `as`). */\nconst defaultAs: Record<TextVariant, ElementType> = {\n 'h-xl': 'h1',\n 'h-lg': 'h1',\n 'h-md': 'h2',\n 'h-std': 'h3',\n 'h-sm': 'h4',\n 'h-xs': 'h5',\n 'p-lg': 'p',\n 'p-md': 'p',\n 'p-std': 'p',\n 'p-sm': 'p',\n 'p-xs': 'p',\n 'label-lg': 'span',\n 'label-md': 'span',\n 'label-std': 'span',\n 'label-sm': 'span',\n 'label-xs': 'span',\n 'label-xxs': 'span',\n};\n\nexport const Text = forwardRef<HTMLElement, TextProps>(function Text(\n { variant = 'p-std', weight, color = 'default', as, truncate, clamp, style, className, children, dataTestId, ...rest },\n ref,\n) {\n const Component = as ?? defaultAs[variant];\n return createElement(\n Component,\n {\n ref,\n 'data-test-id': dataTestId,\n className: cn(\n variantClass[variant],\n weight && weightClass[weight],\n colorClass[color],\n truncate && 'truncate',\n clamp && !truncate && 'overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical]',\n className,\n ),\n style: clamp && !truncate ? { ...style, WebkitLineClamp: clamp } : style,\n ...rest,\n },\n children,\n );\n});\n","import { forwardRef } from 'react';\nimport { SearchX } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { IconTile } from '../IconTile';\nimport { Text } from '../Text';\nimport type { EmptyProps, EmptySize } from './Empty.types';\n\nconst containerStyles: Record<EmptySize, string> = {\n lg: 'py-20 px-6 gap-2',\n sm: 'py-10 px-4 gap-1',\n};\n\nconst illustrationSize: Record<EmptySize, 'lg' | 'xl'> = {\n lg: 'xl',\n sm: 'lg',\n};\n\nexport const Empty = forwardRef<HTMLDivElement, EmptyProps>(function Empty(\n { size = 'lg', title, description, illustration, action, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex flex-col items-center justify-center text-center', containerStyles[size], className)}\n {...rest}\n >\n {illustration ?? <IconTile icon={SearchX} tone=\"gray\" shape=\"circle\" size={illustrationSize[size]} />}\n {title && (\n <Text as=\"h3\" variant={size === 'lg' ? 'h-sm' : 'h-xs'} weight=\"semibold\" className=\"mt-2\">\n {title}\n </Text>\n )}\n {description && (\n <Text variant={size === 'lg' ? 'p-sm' : 'p-xs'} color=\"secondary\" className=\"max-w-sm\">\n {description}\n </Text>\n )}\n {action && <div className=\"mt-4\">{action}</div>}\n </div>\n );\n});\n","import { forwardRef, useEffect, useRef, useState, type Ref } from 'react';\nimport { ChevronDown, X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { FilterProps, FilterSize } from './Filter.types';\n\nconst sizeStyles: Record<FilterSize, string> = {\n lg: 'h-10 px-3 text-p-std gap-2',\n md: 'h-9 px-2.5 text-p-std gap-1.5',\n sm: 'h-8 px-2 text-p-sm gap-1.5',\n};\n\n// No shared ref-merge helper exists in the library yet; this keeps the\n// forwarded consumer ref and the internal outside-click ref pointing at the\n// same wrapper node without adding a new dependency.\nfunction mergeRefs<T>(...refs: (Ref<T> | undefined)[]): (node: T | null) => void {\n return (node) => {\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\nexport const Filter = forwardRef<HTMLDivElement, FilterProps>(function Filter(\n {\n label,\n value,\n active = false,\n size = 'md',\n disabled,\n onClear,\n children,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n if (!wrapperRef.current?.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open]);\n\n const isActive = active || value !== undefined;\n\n return (\n <div\n ref={mergeRefs(ref, wrapperRef)}\n data-test-id={dataTestId}\n className={cn('relative inline-flex', className)}\n {...rest}\n >\n <button\n type=\"button\"\n disabled={disabled}\n onClick={() => setOpen((o) => !o)}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n className={cn(\n 'inline-flex items-center rounded-full border transition-colors outline-none',\n sizeStyles[size],\n isActive\n ? 'bg-brand-20 text-brand-800 border-brand-500'\n : 'bg-bg-default text-fg-default border-border-default',\n !disabled && 'hover:border-border-strong',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n disabled && 'bg-bg-container text-fg-disabled cursor-not-allowed',\n )}\n >\n <span className=\"font-medium\">{label}</span>\n {value !== undefined && (\n <>\n <span className=\"mx-0.5 text-fg-tertiary\" aria-hidden>\n •\n </span>\n <span className=\"font-semibold truncate max-w-[140px]\">{value}</span>\n </>\n )}\n {isActive && onClear ? (\n <span\n role=\"button\"\n tabIndex={0}\n aria-label=\"Clear filter\"\n onClick={(e) => {\n e.stopPropagation();\n onClear();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n onClear();\n }\n }}\n className=\"inline-flex items-center justify-center rounded-full p-0.5 hover:bg-black/10\"\n >\n <X className=\"h-3 w-3\" />\n </span>\n ) : (\n <ChevronDown\n className={cn('h-4 w-4 text-fg-secondary transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n )}\n </button>\n {open && children && (\n <div className=\"absolute left-0 top-full mt-1 min-w-[220px] rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 p-3\">\n {children}\n </div>\n )}\n </div>\n );\n});\n","import { createContext } from 'react';\nimport type {\n Control,\n FieldErrors,\n FieldValues,\n UseFormClearErrors,\n UseFormGetFieldState,\n UseFormGetValues,\n UseFormRegister,\n UseFormReset,\n UseFormSetError,\n UseFormSetValue,\n UseFormTrigger,\n UseFormUnregister,\n UseFormWatch,\n} from 'react-hook-form';\n\nexport interface FormContextValue {\n control: Control<FieldValues>;\n register: UseFormRegister<FieldValues>;\n errors: FieldErrors<FieldValues>;\n setValue: UseFormSetValue<FieldValues>;\n getValues: UseFormGetValues<FieldValues>;\n watch: UseFormWatch<FieldValues>;\n reset: UseFormReset<FieldValues>;\n trigger: UseFormTrigger<FieldValues>;\n clearErrors: UseFormClearErrors<FieldValues>;\n setError: UseFormSetError<FieldValues>;\n getFieldState: UseFormGetFieldState<FieldValues>;\n unregister: UseFormUnregister<FieldValues>;\n isDirty: boolean;\n isSubmitted: boolean;\n isSubmitting: boolean;\n isValid: boolean;\n dirtyFields: Partial<Readonly<Record<string, boolean>>>;\n submit: () => void;\n}\n\nexport const FormContext = createContext<FormContextValue | null>(null);\n","import { forwardRef } from 'react';\nimport { useForm, type FieldValues } from 'react-hook-form';\nimport { yupResolver } from '@hookform/resolvers/yup';\nimport { cn } from '../../lib/cn';\nimport { FormContext, type FormContextValue } from '../../lib/FormContext';\nimport { Button } from '../Button';\nimport type { FormContainerProps } from './FormContainer.types';\n\nexport const FormContainer = forwardRef<HTMLFormElement, FormContainerProps>(function FormContainer(\n {\n children,\n className,\n validationSchema,\n defaultValues,\n buttons,\n mode = 'onBlur',\n shouldUnregister,\n shouldFocusError = true,\n formId,\n onSubmit,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const {\n handleSubmit,\n register,\n setValue,\n control,\n formState,\n getValues,\n watch,\n reset,\n clearErrors,\n setError,\n trigger,\n getFieldState,\n unregister,\n } = useForm<FieldValues>({\n mode,\n resolver: yupResolver(validationSchema),\n defaultValues,\n shouldFocusError,\n shouldUnregister,\n });\n\n const { errors, isDirty, isSubmitted, isSubmitting, dirtyFields, isValid } = formState;\n\n const submit = handleSubmit((data) => {\n onSubmit?.(data, formState);\n });\n\n const contextValue: FormContextValue = {\n control,\n register,\n errors,\n setValue,\n getValues,\n watch,\n reset,\n trigger,\n clearErrors,\n setError,\n getFieldState,\n unregister,\n isDirty,\n isSubmitted,\n isSubmitting,\n isValid,\n dirtyFields,\n submit,\n };\n\n return (\n <form\n ref={ref}\n id={formId}\n onSubmit={submit}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-4', className)}\n {...rest}\n >\n <FormContext.Provider value={contextValue}>\n {children}\n {buttons && buttons.length > 0 && (\n <div className=\"flex items-center gap-3\" data-test-id={dataTestId ? `${dataTestId}-buttons` : undefined}>\n {buttons.map((buttonProps, index) => (\n <Button key={index} {...buttonProps} />\n ))}\n </div>\n )}\n </FormContext.Provider>\n </form>\n );\n});\n","import { forwardRef, useContext } from 'react';\nimport { Controller } from 'react-hook-form';\nimport { cn } from '../../lib/cn';\nimport { FormContext } from '../../lib/FormContext';\nimport type { FormFieldProps } from './FormField.types';\n\nexport const FormField = forwardRef<HTMLDivElement, FormFieldProps>(function FormField(\n { name, defaultValue, render, className, dataTestId, ...rest },\n ref,\n) {\n const context = useContext(FormContext);\n\n if (!context) {\n throw new Error('FormField must be rendered inside a FormContainer.');\n }\n\n return (\n <div ref={ref} className={cn(className)} data-test-id={dataTestId} {...rest}>\n <Controller\n control={context.control}\n name={name}\n defaultValue={defaultValue}\n render={({ field, fieldState }) =>\n render({\n ...field,\n error: !!fieldState.error,\n errorText: fieldState.error?.message,\n dataTestId,\n setFieldValue: (value, options) =>\n context.setValue(name, value, {\n shouldValidate: true,\n shouldDirty: true,\n shouldTouch: true,\n ...options,\n }),\n isValid: fieldState.isTouched && fieldState.isDirty && !fieldState.invalid,\n })\n }\n />\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport { IconTile } from '../IconTile';\nimport type { InfoFieldProps } from './InfoField.types';\n\n/* Labeled value row with a leading tinted icon, uppercase label, value,\n * and an optional action slot on the right. The General Information block\n * on the Profile page uses this primitive; settings / contact / payroll\n * detail pages reach for the same shape. */\n\nexport const InfoField = forwardRef<HTMLDivElement, InfoFieldProps>(function InfoField(\n { icon, iconTone = 'brand', label, value, action, className, dataTestId, ...rest },\n ref,\n) {\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex items-start gap-3', className)} {...rest}>\n <IconTile icon={icon} tone={iconTone} size=\"md\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-p-xs font-medium uppercase tracking-widest text-fg-tertiary\">{label}</div>\n <div className=\"text-p-std font-semibold text-fg-default mt-1 break-words\">{value}</div>\n </div>\n {action && <div className=\"shrink-0 flex items-center\">{action}</div>}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { CheckCircle2, AlertTriangle, XCircle, Info, Sparkles, X, type LucideIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { InlineAlertProps, InlineAlertVariant } from './InlineAlert.types';\n\nconst variantStyles: Record<\n InlineAlertVariant,\n { container: string; iconColor: string; DefaultIcon: LucideIcon }\n> = {\n success: {\n container: 'bg-green-50 border-green-200',\n iconColor: 'text-green-600',\n DefaultIcon: CheckCircle2,\n },\n warning: {\n container: 'bg-yellow-50 border-yellow-200',\n iconColor: 'text-yellow-800',\n DefaultIcon: AlertTriangle,\n },\n danger: {\n container: 'bg-red-50 border-red-200',\n iconColor: 'text-red-700',\n DefaultIcon: XCircle,\n },\n info: {\n container: 'bg-blue-50 border-blue-200',\n iconColor: 'text-blue-700',\n DefaultIcon: Info,\n },\n discovery: {\n container: 'bg-purple-50 border-purple-200',\n iconColor: 'text-purple-700',\n DefaultIcon: Sparkles,\n },\n};\n\nexport const InlineAlert = forwardRef<HTMLDivElement, InlineAlertProps>(function InlineAlert(\n { variant = 'info', title, description, onDismiss, actions, icon, className, dataTestId, ...rest },\n ref,\n) {\n const { container, iconColor, DefaultIcon } = variantStyles[variant];\n\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-test-id={dataTestId}\n className={cn('flex gap-3 p-4 border rounded-lg', container, className)}\n {...rest}\n >\n <div className={cn('flex-shrink-0 mt-0.5', iconColor)}>\n {icon ?? <DefaultIcon className=\"h-5 w-5\" aria-hidden />}\n </div>\n <div className=\"flex-1 min-w-0\">\n {title && <div className=\"text-p-std font-semibold text-fg-default mb-0.5\">{title}</div>}\n {description && <div className=\"text-p-std text-fg-secondary\">{description}</div>}\n {actions && <div className=\"mt-3 flex flex-wrap items-center gap-2\">{actions}</div>}\n </div>\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label=\"Dismiss\"\n className=\"flex-shrink-0 -mr-1 -mt-1 p-1 rounded-md text-fg-secondary hover:text-fg-default hover:bg-black/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n )}\n </div>\n );\n});\n","import { forwardRef, type Ref } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Text } from '../Text';\nimport type { LinkProps } from './Link.types';\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n {\n variant = 'p-std',\n weight,\n color = 'brand',\n underline = 'hover',\n leftIcon,\n rightIcon,\n truncate,\n className,\n children,\n dataTestId,\n target,\n rel,\n ...rest\n },\n ref,\n) {\n const anchorRest = {\n ...rest,\n target,\n rel: rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined),\n };\n\n return (\n <Text\n as=\"a\"\n ref={ref as Ref<HTMLElement>}\n variant={variant}\n weight={weight}\n color={color}\n truncate={truncate}\n dataTestId={dataTestId}\n className={cn(\n 'inline-flex items-center gap-1 rounded-sm outline-none transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n underline === 'always' && 'underline',\n underline === 'hover' && 'hover:underline',\n className,\n )}\n {...anchorRest}\n >\n {leftIcon && <span className=\"inline-flex shrink-0\">{leftIcon}</span>}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </Text>\n );\n});\n","import { forwardRef, useEffect, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { X } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport type { ModalProps, ModalSize } from './Modal.types';\n\nconst sizeStyles: Record<ModalSize, string> = {\n sm: 'max-w-sm',\n md: 'max-w-md',\n lg: 'max-w-lg',\n xl: 'max-w-2xl',\n '2xl': 'max-w-4xl',\n};\n\nexport const Modal = forwardRef<HTMLDivElement, ModalProps>(function Modal(\n {\n open,\n onClose,\n title,\n description,\n children,\n footer,\n size = 'md',\n closeOnOverlayClick = true,\n showClose = true,\n className,\n dataTestId,\n },\n ref,\n) {\n const panelRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!open) return;\n const onKey = (event: KeyboardEvent) => {\n if (event.key === 'Escape') onClose();\n };\n document.addEventListener('keydown', onKey);\n const prevOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n return () => {\n document.removeEventListener('keydown', onKey);\n document.body.style.overflow = prevOverflow;\n };\n }, [open, onClose]);\n\n useEffect(() => {\n if (!open) return;\n const prevFocus = document.activeElement as HTMLElement | null;\n panelRef.current?.focus();\n return () => prevFocus?.focus?.();\n }, [open]);\n\n if (!open) return null;\n\n const content = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={title ? 'modal-title' : undefined}\n aria-describedby={description ? 'modal-desc' : undefined}\n className=\"fixed inset-0 z-50 flex items-center justify-center p-4\"\n >\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={() => closeOnOverlayClick && onClose()}\n aria-hidden\n />\n <div\n ref={mergeRefs(panelRef, ref)}\n tabIndex={-1}\n data-test-id={dataTestId}\n className={cn(\n 'relative w-full bg-bg-default rounded-xl shadow-z5 outline-none flex flex-col max-h-[90vh]',\n sizeStyles[size],\n className,\n )}\n >\n {(title || showClose) && (\n <div className=\"flex items-start justify-between gap-4 px-6 pt-6 pb-4\">\n <div className=\"flex-1 min-w-0\">\n {title && (\n <h2 id=\"modal-title\" className=\"text-h-xs font-semibold text-fg-default\">\n {title}\n </h2>\n )}\n {description && (\n <p id=\"modal-desc\" className=\"mt-1 text-p-std text-fg-secondary\">\n {description}\n </p>\n )}\n </div>\n {showClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label=\"Close\"\n className=\"-mr-2 -mt-2 p-2 rounded-md text-fg-secondary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"h-5 w-5\" />\n </button>\n )}\n </div>\n )}\n {children && <div className=\"px-6 pb-6 overflow-y-auto\">{children}</div>}\n {footer && (\n <div className=\"flex items-center justify-end gap-2 px-6 py-4 border-t border-border-default bg-bg-container rounded-b-xl\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n});\n","import { forwardRef, useEffect, useId, useMemo, useRef, useState, type KeyboardEvent, type MutableRefObject } from 'react';\nimport { X, Search, Users } from 'lucide-react';\nimport { Avatar } from '../Avatar';\nimport { cn } from '../../lib/cn';\nimport type { MultiSelectOption, MultiSelectProps, MultiSelectSize } from './MultiSelect.types';\n\n/* =============================================================================\n * MultiSelect — a chip/token multi-select combobox.\n *\n * The multi-value cousin of `Select`: chosen options render as removable chips\n * inline with a type-to-filter input; a dropdown lists the remaining options.\n * Options can carry an avatar, a description line and a chip badge, so it covers\n * both a plain tag input and a rich people picker with one API.\n *\n * Fully controlled (`value` + `onChange`). Keyboard: up/down move the active\n * option, Enter selects it, Backspace on an empty field removes the last\n * removable chip, Esc closes. Data-agnostic — feed it any options.\n * =========================================================================== */\n\nconst SIZES: Record<\n MultiSelectSize,\n { box: string; chip: string; chipText: string; input: string; avatar: 'xs' | 'sm' }\n> = {\n sm: { box: 'px-1.5 py-1.5 gap-1', chip: 'h-6 pl-0.5 pr-1.5', chipText: 'text-p-xs', input: 'h-6 text-p-sm min-w-[100px]', avatar: 'xs' },\n md: { box: 'px-2 py-2 gap-1.5', chip: 'h-7 pl-1 pr-2', chipText: 'text-p-sm', input: 'h-7 text-p-std min-w-[120px]', avatar: 'xs' },\n lg: { box: 'px-2.5 py-2.5 gap-2', chip: 'h-8 pl-1 pr-2.5', chipText: 'text-p-std', input: 'h-8 text-p-md min-w-[140px]', avatar: 'sm' },\n};\n\nexport const MultiSelect = forwardRef<HTMLInputElement, MultiSelectProps>(function MultiSelect(\n {\n options,\n value,\n onChange,\n onAdd,\n onRemove,\n size = 'md',\n placeholder = 'Select…',\n addMorePlaceholder = 'Add another…',\n disabled = false,\n error = false,\n label,\n labelAddons,\n helperText,\n errorText,\n required = false,\n lockedValues = [],\n max,\n searchable = true,\n suggestionsLabel = 'Suggestions',\n emptyText = 'No matches. Try a different search.',\n showAvatars = false,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const listId = `${inputId}-listbox`;\n const hasError = error || !!errorText;\n\n const [query, setQuery] = useState('');\n const [open, setOpen] = useState(false);\n const [active, setActive] = useState(0);\n const wrapRef = useRef<HTMLDivElement>(null);\n const innerInputRef = useRef<HTMLInputElement>(null);\n const setInputRef = (node: HTMLInputElement | null) => {\n innerInputRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) (ref as MutableRefObject<HTMLInputElement | null>).current = node;\n };\n\n const byValue = useMemo(() => new Map(options.map((o) => [o.value, o])), [options]);\n const selected = useMemo(\n () => value.map((v) => byValue.get(v)).filter((o): o is MultiSelectOption => !!o),\n [value, byValue],\n );\n\n const matches = useMemo(() => {\n const q = query.trim().toLowerCase();\n return options.filter(\n (o) =>\n !value.includes(o.value) &&\n (q === '' ||\n o.label.toLowerCase().includes(q) ||\n (o.description ?? '').toLowerCase().includes(q)),\n );\n }, [options, value, query]);\n\n const reached = max !== undefined && value.length >= max;\n\n /* Close on outside click + Esc. */\n useEffect(() => {\n if (!open) return;\n const onDown = (e: MouseEvent) => {\n if (wrapRef.current && !wrapRef.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDown);\n return () => document.removeEventListener('mousedown', onDown);\n }, [open]);\n\n /* Keep the active index in range as the list changes. */\n useEffect(() => {\n setActive((a) => Math.min(a, Math.max(0, matches.length - 1)));\n }, [matches.length]);\n\n const add = (v: string) => {\n const opt = byValue.get(v);\n if (disabled || reached || !opt || opt.disabled) return;\n onChange([...value, v]);\n onAdd?.(opt);\n setQuery('');\n setActive(0);\n innerInputRef.current?.focus();\n };\n\n const remove = (v: string) => {\n if (disabled || lockedValues.includes(v)) return;\n onChange(value.filter((x) => x !== v));\n onRemove?.(v);\n };\n\n const moveActive = (dir: 1 | -1) => {\n if (!matches.length) return;\n let next = active;\n for (let i = 0; i < matches.length; i++) {\n next = (next + dir + matches.length) % matches.length;\n if (!matches[next]?.disabled) break;\n }\n setActive(next);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n if (!open) setOpen(true);\n else moveActive(1);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n moveActive(-1);\n } else if (e.key === 'Enter') {\n if (open && matches[active] && !matches[active].disabled) {\n e.preventDefault();\n add(matches[active].value);\n }\n } else if (e.key === 'Escape') {\n setOpen(false);\n } else if (e.key === 'Backspace' && query === '' && selected.length > 0) {\n const last = [...selected].reverse().find((o) => !lockedValues.includes(o.value));\n if (last) remove(last.value);\n }\n };\n\n const describedBy = errorText\n ? `${inputId}-error`\n : helperText\n ? `${inputId}-help`\n : undefined;\n\n return (\n <div data-test-id={dataTestId} className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n\n <div ref={wrapRef} className=\"relative\">\n {/* Chips + input row */}\n <div\n className={cn(\n 'flex flex-wrap items-center rounded-lg border bg-bg-default transition-colors',\n SIZES[size].box,\n disabled\n ? 'opacity-60 cursor-not-allowed border-border-default'\n : hasError\n ? 'border-red-500 focus-within:ring-2 focus-within:ring-red-300 focus-within:ring-offset-1 cursor-text'\n : 'border-border-default hover:border-border-strong focus-within:border-fg-tertiary focus-within:ring-2 focus-within:ring-brand-300 focus-within:ring-offset-1 cursor-text',\n className,\n )}\n onClick={() => !disabled && innerInputRef.current?.focus()}\n >\n {selected.map((o) => {\n const locked = lockedValues.includes(o.value);\n return (\n <span\n key={o.value}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full text-fg-default bg-bg-subtle',\n SIZES[size].chip,\n SIZES[size].chipText,\n )}\n title={o.description}\n >\n {(showAvatars || o.avatarSrc) && (\n <Avatar src={o.avatarSrc} name={o.label} size={SIZES[size].avatar} />\n )}\n <span className=\"font-medium\">{o.label}</span>\n {o.badge && (\n <span className=\"text-label-xxs uppercase tracking-wider opacity-70\">{o.badge}</span>\n )}\n {!locked && !disabled && (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation();\n remove(o.value);\n }}\n aria-label={`Remove ${o.label}`}\n className=\"-mr-0.5 ml-0.5 text-fg-tertiary hover:text-fg-default p-0.5 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n <X className=\"w-3 h-3\" />\n </button>\n )}\n </span>\n );\n })}\n\n <input\n ref={setInputRef}\n id={inputId}\n type=\"text\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={open && matches[active] ? `${listId}-opt-${active}` : undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n value={query}\n readOnly={!searchable}\n disabled={disabled || reached}\n onChange={(e) => {\n setQuery(e.target.value);\n setOpen(true);\n }}\n onFocus={() => setOpen(true)}\n onKeyDown={onKeyDown}\n placeholder={selected.length === 0 ? placeholder : reached ? `Limit ${max} reached` : addMorePlaceholder}\n className={cn(\n 'flex-1 bg-transparent outline-none text-fg-default placeholder:text-fg-tertiary disabled:cursor-not-allowed',\n !searchable && 'cursor-pointer',\n SIZES[size].input,\n )}\n />\n </div>\n\n {/* Dropdown */}\n {open && !disabled && !reached && (\n <div className=\"absolute top-full left-0 right-0 mt-1 z-20 max-h-80 overflow-y-auto rounded-lg border border-border-default bg-bg-default shadow-z4\">\n <div className=\"px-3 py-2 border-b border-border-subtle flex items-center gap-2 text-p-sm text-fg-tertiary\">\n <Search className=\"w-3.5 h-3.5 shrink-0\" />\n <span className=\"truncate\">{query ? `Matches for \"${query}\"` : suggestionsLabel}</span>\n </div>\n {matches.length === 0 ? (\n <div className=\"px-3 py-6 text-center\">\n <Users className=\"w-5 h-5 mx-auto text-fg-tertiary mb-2\" />\n <span className=\"text-p-sm text-fg-secondary\">{emptyText}</span>\n </div>\n ) : (\n <ul role=\"listbox\" id={listId} className=\"py-1\">\n {matches.map((o, i) => (\n <li key={o.value} role=\"option\" id={`${listId}-opt-${i}`} aria-selected={i === active} aria-disabled={o.disabled || undefined}>\n <button\n type=\"button\"\n disabled={o.disabled}\n onMouseEnter={() => setActive(i)}\n onMouseDown={(e) => {\n e.preventDefault();\n add(o.value);\n }}\n className={cn(\n 'w-full px-3 py-2 flex items-center gap-3 text-left transition',\n o.disabled\n ? 'opacity-50 cursor-not-allowed'\n : i === active\n ? 'bg-bg-subtle'\n : 'hover:bg-bg-subtle',\n )}\n >\n {(showAvatars || o.avatarSrc) && <Avatar src={o.avatarSrc} name={o.label} size=\"sm\" />}\n <span className=\"flex-1 min-w-0\">\n <span className=\"block text-p-std font-medium text-fg-default truncate\">{o.label}</span>\n {o.description && (\n <span className=\"block text-p-sm text-fg-secondary truncate\">{o.description}</span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n </div>\n )}\n </div>\n\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type {\n NotificationBadgeProps,\n NotificationBadgeSize,\n NotificationBadgeVariant,\n} from './NotificationBadge.types';\n\nconst variantStyles: Record<NotificationBadgeVariant, string> = {\n brand: 'bg-brand-500 text-white',\n danger: 'bg-red-600 text-white',\n success: 'bg-green-600 text-white',\n warning: 'bg-yellow-600 text-gray-900 dark:text-gray-900',\n info: 'bg-blue-600 text-white',\n};\n\nconst countSize: Record<NotificationBadgeSize, string> = {\n lg: 'min-w-[18px] h-[18px] px-1 text-[11px]',\n sm: 'min-w-[14px] h-[14px] px-0.5 text-[10px]',\n};\n\nconst dotSize: Record<NotificationBadgeSize, string> = {\n lg: 'h-2.5 w-2.5',\n sm: 'h-1.5 w-1.5',\n};\n\nfunction formatCount(count: number, max: number): string {\n if (count > max) return `${max}+`;\n if (count >= 1000) return `${(count / 1000).toFixed(0)}K`;\n return String(count);\n}\n\n// The badge <span> itself carries the ref/data-test-id/className/rest props —\n// it's the component's real root, whether rendered standalone or overlaid on\n// `children`. The wrapper <span> used in the overlay case is internal\n// positioning plumbing only.\nexport const NotificationBadge = forwardRef<HTMLSpanElement, NotificationBadgeProps>(\n function NotificationBadge(\n {\n count = 0,\n max = 99,\n kind = 'count',\n size = 'lg',\n variant = 'danger',\n children,\n showZero = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n ) {\n const show = kind === 'dot' ? true : count > 0 || showZero;\n const hasChild = children !== undefined && children !== null && children !== false;\n\n const badge = !show ? null : (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center justify-center rounded-full font-semibold ring-2 ring-white',\n variantStyles[variant],\n kind === 'count' ? countSize[size] : dotSize[size],\n hasChild ? 'absolute -top-1 -right-1' : 'static',\n className,\n )}\n {...rest}\n >\n {kind === 'count' && formatCount(count, max)}\n </span>\n );\n\n if (!hasChild) return badge;\n\n return (\n <span className=\"relative inline-flex\">\n {children}\n {badge}\n </span>\n );\n },\n);\n","import { forwardRef } from 'react';\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { PaginationProps } from './Pagination.types';\n\ntype Item = number | 'ellipsis-left' | 'ellipsis-right';\n\nfunction buildRange(\n page: number,\n pageCount: number,\n siblingCount: number,\n boundaryCount: number,\n): Item[] {\n const totalNumbers = siblingCount * 2 + 3 + boundaryCount * 2;\n if (pageCount <= totalNumbers) {\n return Array.from({ length: pageCount }, (_, i) => i + 1);\n }\n\n const leftSibling = Math.max(page - siblingCount, boundaryCount + 2);\n const rightSibling = Math.min(page + siblingCount, pageCount - boundaryCount - 1);\n\n const showLeftEllipsis = leftSibling > boundaryCount + 2;\n const showRightEllipsis = rightSibling < pageCount - boundaryCount - 1;\n\n const head = Array.from({ length: boundaryCount }, (_, i) => i + 1);\n const tail = Array.from({ length: boundaryCount }, (_, i) => pageCount - boundaryCount + 1 + i);\n\n const middle: Item[] = [];\n if (!showLeftEllipsis) {\n for (let i = boundaryCount + 1; i <= rightSibling; i++) middle.push(i);\n } else {\n middle.push('ellipsis-left');\n for (let i = leftSibling; i <= rightSibling; i++) middle.push(i);\n }\n if (showRightEllipsis) middle.push('ellipsis-right');\n else {\n for (let i = rightSibling + 1; i <= pageCount - boundaryCount; i++) middle.push(i);\n }\n\n return [...head, ...middle, ...tail];\n}\n\nconst itemBase =\n 'inline-flex items-center justify-center min-w-9 h-9 px-2 text-p-std rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300';\n\nconst navButtonStyles =\n 'text-fg-default hover:bg-bg-subtle disabled:text-fg-disabled disabled:hover:bg-transparent disabled:cursor-not-allowed';\n\nexport const Pagination = forwardRef<HTMLElement, PaginationProps>(function Pagination(\n {\n page,\n pageCount,\n onPageChange,\n siblingCount = 1,\n boundaryCount = 1,\n className,\n dataTestId,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n) {\n const items = buildRange(page, pageCount, siblingCount, boundaryCount);\n const prevDisabled = page <= 1;\n const nextDisabled = page >= pageCount;\n\n return (\n <nav\n ref={ref}\n aria-label={ariaLabel ?? 'Pagination'}\n data-test-id={dataTestId}\n className={cn('inline-flex items-center gap-1', className)}\n {...rest}\n >\n <button\n type=\"button\"\n onClick={() => !prevDisabled && onPageChange(page - 1)}\n disabled={prevDisabled}\n aria-label=\"Previous page\"\n className={cn(itemBase, navButtonStyles)}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </button>\n\n {items.map((item, i) => {\n if (item === 'ellipsis-left' || item === 'ellipsis-right') {\n return (\n <span\n key={`${item}-${i}`}\n aria-hidden\n className=\"inline-flex items-center justify-center w-9 h-9 text-fg-tertiary\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </span>\n );\n }\n const isActive = item === page;\n return (\n <button\n key={item}\n type=\"button\"\n onClick={() => onPageChange(item)}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n itemBase,\n isActive\n ? 'bg-brand-500 text-white font-semibold hover:bg-brand-600'\n : 'text-fg-default hover:bg-bg-subtle',\n )}\n >\n {item}\n </button>\n );\n })}\n\n <button\n type=\"button\"\n onClick={() => !nextDisabled && onPageChange(page + 1)}\n disabled={nextDisabled}\n aria-label=\"Next page\"\n className={cn(itemBase, navButtonStyles)}\n >\n <ChevronRight className=\"h-4 w-4\" />\n </button>\n </nav>\n );\n});\n","import { forwardRef, type Ref } from 'react';\nimport { Avatar, type AvatarSize } from '../Avatar';\nimport { cn } from '../../lib/cn';\nimport type { PersonCardProps, PersonCardSize, PersonCardVariant } from './PersonCard.types';\n\n/* Compact person tile — avatar + name + role inside a rounded card.\n * Used as nodes in the org chart on Profile, but the shape (small chip\n * with face + identity) shows up everywhere people are listed: directory\n * search, mention picker, team callouts. Centralising avoids the same\n * markup being rewritten in each context. */\n\nconst sizeStyles: Record<PersonCardSize, { padding: string; avatar: AvatarSize; gap: string }> = {\n sm: { padding: 'px-3 py-2', avatar: 'sm', gap: 'gap-2.5' },\n md: { padding: 'px-3.5 py-2.5', avatar: 'md', gap: 'gap-3' },\n};\n\nconst variantStyles: Record<PersonCardVariant, string> = {\n default: 'border-border-default bg-bg-default hover:border-fg-tertiary/40',\n highlight: 'border-brand-500 bg-brand-200/15 dark:bg-brand-500/10 ring-1 ring-brand-500/40',\n warning: 'border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20',\n};\n\nexport const PersonCard = forwardRef<HTMLDivElement, PersonCardProps>(function PersonCard(\n {\n name,\n role,\n avatar,\n variant = 'default',\n size = 'md',\n badge,\n onClick,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const s = sizeStyles[size];\n const v = variantStyles[variant];\n\n const inner = (\n <>\n <Avatar src={avatar} name={name} size={s.avatar} />\n <div className=\"min-w-0 flex-1\">\n <div className=\"text-p-std font-semibold text-fg-default truncate leading-tight\">{name}</div>\n {role && (\n <div className=\"text-p-sm text-fg-secondary truncate mt-0.5 leading-tight\">{role}</div>\n )}\n </div>\n {badge && <span className=\"shrink-0 self-center\">{badge}</span>}\n </>\n );\n\n const base = cn(\n 'relative inline-flex items-center rounded-xl border transition',\n s.padding,\n s.gap,\n v,\n onClick && 'cursor-pointer hover:shadow-z1',\n className,\n );\n\n if (onClick) {\n return (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={onClick}\n data-test-id={dataTestId}\n className={cn(base, 'text-left')}\n {...(rest as object)}\n >\n {inner}\n </button>\n );\n }\n return (\n <div ref={ref} data-test-id={dataTestId} className={base} {...rest}>\n {inner}\n </div>\n );\n});\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { ProgressProps, ProgressSize } from './Progress.types';\n\nconst circleDimension: Record<ProgressSize, number> = {\n sm: 29,\n lg: 45,\n};\n\nconst circleStrokeWidth: Record<ProgressSize, number> = {\n sm: 2,\n lg: 4,\n};\n\nconst linearTrackHeight: Record<ProgressSize, string> = {\n sm: 'h-1',\n lg: 'h-2',\n};\n\nconst labelTextSize: Record<ProgressSize, string> = {\n sm: 'text-p-xs',\n lg: 'text-p-sm',\n};\n\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n variant = 'linear',\n size = 'lg',\n percent = 0,\n stepCount,\n currentStep,\n hideLabel = false,\n dimension,\n loop = false,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const rawPercent = stepCount && currentStep ? (currentStep / stepCount) * 100 : percent;\n const clampedPercent = Math.min(100, Math.max(0, rawPercent));\n const label = stepCount ? `${currentStep}/${stepCount}` : `${Math.round(clampedPercent)}%`;\n\n if (variant === 'circular') {\n const dim = dimension ?? circleDimension[size];\n const r = dim - 5;\n const circumference = 2 * r * Math.PI;\n const strokeWidth = circleStrokeWidth[size];\n\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={loop ? undefined : clampedPercent}\n aria-valuetext={loop ? undefined : label}\n data-test-id={dataTestId}\n className={cn('relative inline-flex items-center justify-center', className)}\n style={{ width: dim * 2, height: dim * 2 }}\n {...rest}\n >\n <svg\n width={dim * 2}\n height={dim * 2}\n viewBox={`0 0 ${dim * 2} ${dim * 2}`}\n className={cn('-rotate-90', loop && 'animate-spin')}\n >\n <circle cx={dim} cy={dim} r={r} strokeWidth={strokeWidth} className=\"fill-none stroke-bg-subtle\" />\n <circle\n cx={dim}\n cy={dim}\n r={r}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n className=\"fill-none stroke-brand-500 transition-[stroke-dashoffset] duration-300 ease-linear\"\n style={{\n strokeDasharray: `${circumference}px`,\n strokeDashoffset: loop\n ? `${circumference * 0.75}px`\n : `${circumference - (circumference * clampedPercent) / 100}px`,\n }}\n />\n </svg>\n {!hideLabel && !loop && (\n <span\n className={cn('absolute text-fg-secondary', labelTextSize[size])}\n data-test-id={dataTestId ? `${dataTestId}-text` : undefined}\n >\n {label}\n </span>\n )}\n </div>\n );\n }\n\n return (\n <div\n ref={ref}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={clampedPercent}\n aria-valuetext={label}\n data-test-id={dataTestId}\n className={cn('flex w-full items-center gap-2', className)}\n {...rest}\n >\n <div className={cn('w-full overflow-hidden rounded-full bg-bg-subtle', linearTrackHeight[size])}>\n <div\n className=\"h-full rounded-full bg-brand-500 transition-all duration-300 ease-linear\"\n style={{ width: `${clampedPercent}%` }}\n />\n </div>\n {!hideLabel && (\n <span\n className={cn('shrink-0 text-fg-secondary', labelTextSize[size])}\n data-test-id={dataTestId ? `${dataTestId}-text` : undefined}\n >\n {label}\n </span>\n )}\n </div>\n );\n});\n","import { createContext, forwardRef, useContext, useId, type ChangeEvent } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { RadioGroupProps, RadioProps, RadioSize } from './Radio.types';\n\ninterface RadioGroupContextValue {\n name: string;\n value?: string;\n defaultValue?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n size: RadioSize;\n}\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(function RadioGroup(\n {\n name,\n label,\n value,\n defaultValue,\n onChange,\n disabled,\n size = 'md',\n orientation = 'vertical',\n children,\n className,\n dataTestId,\n },\n ref,\n) {\n const reactName = useId();\n const groupName = name ?? reactName;\n const labelId = `${reactName}-label`;\n\n const groupEl = (\n <div\n ref={ref}\n role=\"radiogroup\"\n aria-labelledby={label ? labelId : undefined}\n data-test-id={dataTestId}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap items-center gap-4',\n className,\n )}\n >\n {children}\n </div>\n );\n\n return (\n <RadioGroupContext.Provider value={{ name: groupName, value, defaultValue, onChange, disabled, size }}>\n {label ? (\n <div className=\"flex flex-col gap-1.5\">\n <span id={labelId} className=\"text-p-std font-medium text-fg-default inline-flex\">\n {label}\n </span>\n {groupEl}\n </div>\n ) : (\n groupEl\n )}\n </RadioGroupContext.Provider>\n );\n});\n\nconst outerSize: Record<RadioSize, string> = {\n md: 'h-5 w-5',\n sm: 'h-4 w-4',\n};\n\nconst innerSize: Record<RadioSize, string> = {\n md: 'h-2 w-2',\n sm: 'h-1.5 w-1.5',\n};\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n {\n value,\n size,\n label,\n description,\n error = false,\n id,\n disabled,\n checked,\n defaultChecked,\n onChange,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const group = useContext(RadioGroupContext);\n const reactId = useId();\n const inputId = id ?? reactId;\n const effectiveSize = size ?? group?.size ?? 'md';\n const effectiveDisabled = disabled ?? group?.disabled;\n\n const inGroup = group !== null;\n const groupChecked = inGroup && group.value !== undefined ? group.value === value : undefined;\n const groupDefaultChecked =\n inGroup && group.defaultValue !== undefined ? group.defaultValue === value : undefined;\n\n const isChecked = inGroup ? groupChecked : checked;\n const isDefaultChecked = inGroup ? groupDefaultChecked : defaultChecked;\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n group?.onChange?.(value);\n onChange?.(e);\n };\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-2.5',\n effectiveDisabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0 items-center justify-center mt-0.5\">\n <input\n ref={ref}\n id={inputId}\n type=\"radio\"\n name={group?.name}\n value={value}\n checked={isChecked}\n defaultChecked={isDefaultChecked}\n disabled={effectiveDisabled}\n onChange={handleChange}\n className=\"peer sr-only\"\n aria-invalid={error || undefined}\n {...rest}\n />\n <span\n className={cn(\n 'flex items-center justify-center rounded-full border bg-bg-default transition-colors',\n outerSize[effectiveSize],\n error ? 'border-red-600' : 'border-border-strong',\n !effectiveDisabled && !error && 'peer-hover:border-fg-tertiary',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-1',\n 'peer-checked:border-brand-500',\n effectiveDisabled && '!bg-bg-subtle !border-border-default',\n '[&>span]:opacity-0 peer-checked:[&>span]:opacity-100',\n )}\n >\n <span\n className={cn(\n 'rounded-full bg-brand-500 transition-opacity',\n innerSize[effectiveSize],\n effectiveDisabled && '!bg-fg-disabled',\n )}\n />\n </span>\n </span>\n {(label || description) && (\n <span className=\"flex flex-col gap-0.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>\n )}\n {description && (\n <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>\n )}\n </span>\n )}\n </label>\n );\n});\n","import { forwardRef, useId, useState } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Text } from '../Text';\nimport type { ReadMoreProps } from './ReadMore.types';\n\nexport const ReadMore = forwardRef<HTMLDivElement, ReadMoreProps>(function ReadMore(\n {\n children,\n clamp = 3,\n collapsedContent,\n expandLabel = 'Show more',\n collapseLabel = 'Show less',\n defaultExpanded = false,\n expanded,\n onExpandedChange,\n textProps,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded);\n const isControlled = expanded !== undefined;\n const isExpanded = isControlled ? expanded : internalExpanded;\n const contentId = useId();\n\n const toggle = () => {\n const next = !isExpanded;\n if (!isControlled) setInternalExpanded(next);\n onExpandedChange?.(next);\n };\n\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-1', className)} {...rest}>\n <Text id={contentId} clamp={isExpanded ? undefined : clamp} {...textProps}>\n {isExpanded ? children : collapsedContent ?? children}\n </Text>\n <button\n type=\"button\"\n onClick={(event) => {\n event.stopPropagation();\n toggle();\n }}\n aria-expanded={isExpanded}\n aria-controls={contentId}\n className=\"self-start rounded-sm text-p-sm font-medium text-fg-brand outline-none hover:underline focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {isExpanded ? collapseLabel : expandLabel}\n </button>\n </div>\n );\n});\n","import { forwardRef, useEffect, useId, useMemo, useRef, useState, Fragment, type KeyboardEvent } from 'react';\nimport { ChevronDown, Check, Loader2, Search } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport type { SelectOption, SelectProps, SelectSize } from './Select.types';\n\nconst sizeStyles: Record<SelectSize, string> = {\n lg: 'h-12 text-p-md px-3.5',\n md: 'h-10 text-p-std px-3',\n sm: 'h-8 text-p-sm px-2.5',\n};\n\nfunction firstEnabledIndex(list: SelectOption[]) {\n return list.findIndex((o) => !o.disabled);\n}\n\nexport const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select(\n {\n options,\n value,\n defaultValue,\n onChange,\n placeholder = 'Select…',\n label,\n labelAddons,\n helperText,\n errorText,\n error = false,\n required = false,\n loading = false,\n searchable = false,\n searchPlaceholder = 'Search…',\n emptyText = 'No results',\n size = 'md',\n disabled,\n id,\n className,\n wrapperClassName,\n dataTestId,\n },\n ref,\n) {\n const reactId = useId();\n const triggerId = id ?? reactId;\n const listId = `${triggerId}-listbox`;\n const [open, setOpen] = useState(false);\n const [internal, setInternal] = useState<string | undefined>(defaultValue);\n const isControlled = value !== undefined;\n const selected = isControlled ? value : internal;\n const containerRef = useRef<HTMLDivElement>(null);\n const buttonRef = useRef<HTMLButtonElement>(null);\n const searchRef = useRef<HTMLInputElement>(null);\n const [activeIndex, setActiveIndex] = useState(-1);\n const [query, setQuery] = useState('');\n const hasError = error || !!errorText;\n const describedBy = errorText ? `${triggerId}-error` : helperText ? `${triggerId}-help` : undefined;\n\n const selectedOption = options.find((o) => o.value === selected);\n\n const visibleOptions = useMemo(() => {\n const q = searchable ? query.trim().toLowerCase() : '';\n if (!q) return options;\n return options.filter((o) => {\n const haystack = o.searchText ?? (typeof o.label === 'string' ? o.label : undefined) ?? o.value;\n return haystack.toLowerCase().includes(q);\n });\n }, [options, query, searchable]);\n\n const pick = (val: string) => {\n if (!isControlled) setInternal(val);\n onChange?.(val);\n setOpen(false);\n if (searchable) buttonRef.current?.focus();\n };\n\n useEffect(() => {\n if (!open) return;\n const onDoc = (e: MouseEvent) => {\n if (!containerRef.current?.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', onDoc);\n return () => document.removeEventListener('mousedown', onDoc);\n }, [open]);\n\n useEffect(() => {\n if (!open) {\n setActiveIndex(-1);\n setQuery('');\n return;\n }\n const selIdx = visibleOptions.findIndex((o) => o.value === selected);\n setActiveIndex(selIdx >= 0 && !visibleOptions[selIdx]?.disabled ? selIdx : firstEnabledIndex(visibleOptions));\n }, [open, selected, visibleOptions]);\n\n useEffect(() => {\n if (open && searchable) searchRef.current?.focus();\n }, [open, searchable]);\n\n useEffect(() => {\n if (loading) setOpen(false);\n }, [loading]);\n\n const moveActive = (dir: 1 | -1) => {\n const n = visibleOptions.length;\n if (n === 0) return;\n let next = activeIndex < 0 ? (dir === 1 ? -1 : 0) : activeIndex;\n for (let i = 0; i < n; i++) {\n next = (next + dir + n) % n;\n if (!visibleOptions[next]?.disabled) break;\n }\n setActiveIndex(next);\n };\n\n const commitActive = () => {\n const opt = visibleOptions[activeIndex];\n if (opt && !opt.disabled) pick(opt.value);\n };\n\n const onKeyDown = (e: KeyboardEvent<HTMLButtonElement>) => {\n if (disabled || loading) return;\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n if (!open) {\n setOpen(true);\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n commitActive();\n return;\n }\n moveActive(e.key === 'ArrowDown' ? 1 : -1);\n } else if (e.key === 'Escape') {\n setOpen(false);\n }\n };\n\n const onSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n moveActive(e.key === 'ArrowDown' ? 1 : -1);\n } else if (e.key === 'Enter') {\n e.preventDefault();\n commitActive();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n setOpen(false);\n buttonRef.current?.focus();\n } else if (e.key === 'Tab') {\n buttonRef.current?.focus();\n setOpen(false);\n }\n };\n\n return (\n <div\n ref={containerRef}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-1.5 w-full relative', wrapperClassName)}\n >\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={triggerId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <button\n ref={mergeRefs(ref, buttonRef)}\n id={triggerId}\n type=\"button\"\n disabled={disabled}\n onClick={() => {\n if (disabled || loading) return;\n setOpen((o) => !o);\n }}\n onKeyDown={onKeyDown}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-invalid={hasError || undefined}\n aria-required={required || undefined}\n aria-busy={loading || undefined}\n aria-disabled={loading || undefined}\n aria-describedby={describedBy}\n aria-controls={open && visibleOptions.length > 0 ? listId : undefined}\n className={cn(\n 'inline-flex items-center justify-between w-full rounded-lg border bg-bg-default transition-colors outline-none',\n 'text-left',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus-visible:ring-2',\n hasError\n ? 'focus-visible:ring-red-300 focus-visible:border-red-600'\n : 'focus-visible:ring-brand-300 focus-visible:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed text-fg-disabled',\n loading && 'cursor-wait',\n sizeStyles[size],\n className,\n )}\n >\n <span className={cn('truncate', !selectedOption && 'text-fg-tertiary')}>\n {selectedOption ? selectedOption.label : placeholder}\n </span>\n {loading ? (\n <Loader2 className=\"h-4 w-4 ml-2 shrink-0 text-fg-secondary animate-spin\" aria-hidden />\n ) : (\n <ChevronDown\n className={cn('h-4 w-4 ml-2 shrink-0 text-fg-secondary transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n )}\n </button>\n {open && (\n <div className=\"absolute left-0 right-0 top-full mt-1 rounded-lg border border-border-default bg-bg-default shadow-z4 z-50 overflow-hidden\">\n {searchable && (\n <div className=\"flex items-center gap-2 px-3 py-2 border-b border-border-default\">\n <Search className=\"h-3.5 w-3.5 shrink-0 text-fg-tertiary\" aria-hidden />\n <input\n ref={searchRef}\n type=\"text\"\n role=\"combobox\"\n aria-expanded\n aria-controls={visibleOptions.length > 0 ? listId : undefined}\n aria-autocomplete=\"list\"\n aria-activedescendant={activeIndex >= 0 ? `${listId}-opt-${activeIndex}` : undefined}\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={onSearchKeyDown}\n placeholder={searchPlaceholder}\n className=\"w-full bg-transparent outline-none text-p-std text-fg-default placeholder:text-fg-tertiary\"\n />\n </div>\n )}\n {visibleOptions.length === 0 ? (\n <p className=\"px-3 py-6 text-center text-p-sm text-fg-secondary\">{emptyText}</p>\n ) : (\n <ul id={listId} role=\"listbox\" className=\"max-h-60 overflow-y-auto py-1\">\n {visibleOptions.map((opt, i) => {\n const isSel = opt.value === selected;\n const isActive = i === activeIndex;\n const showGroupHeader = !!opt.group && opt.group !== visibleOptions[i - 1]?.group;\n return (\n <Fragment key={opt.value}>\n {showGroupHeader && (\n <li\n role=\"presentation\"\n className=\"px-3 pt-2 pb-1 text-label-sm font-medium uppercase tracking-wide text-fg-tertiary select-none\"\n >\n {opt.group}\n </li>\n )}\n <li\n id={`${listId}-opt-${i}`}\n role=\"option\"\n aria-selected={isSel}\n aria-disabled={opt.disabled || undefined}\n onMouseEnter={() => !opt.disabled && setActiveIndex(i)}\n onClick={() => !opt.disabled && pick(opt.value)}\n className={cn(\n 'flex items-center justify-between gap-2 px-3 py-2 text-p-std cursor-pointer select-none',\n opt.disabled && 'opacity-50 cursor-not-allowed',\n isActive && !opt.disabled && 'bg-bg-subtle',\n isSel && 'font-medium',\n )}\n >\n <span className=\"truncate\">{opt.label}</span>\n {isSel && <Check className=\"h-4 w-4 text-brand-500 shrink-0\" />}\n </li>\n </Fragment>\n );\n })}\n </ul>\n )}\n </div>\n )}\n {errorText ? (\n <p id={`${triggerId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${triggerId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n );\n});\n","import { createContext, forwardRef, useContext, useState, type Ref } from 'react';\nimport { ChevronRight, Menu as MenuIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { SidebarItemProps, SidebarProps } from './Sidebar.types';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n toggle: () => void;\n}\n\nconst SidebarContext = createContext<SidebarContextValue | null>(null);\n\nfunction useSidebar(): SidebarContextValue {\n return useContext(SidebarContext) ?? { collapsed: false, toggle: () => {} };\n}\n\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed,\n onCollapsedChange,\n children,\n className,\n logo,\n title,\n subtitle,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState(defaultCollapsed);\n const isControlled = collapsed !== undefined;\n const current = isControlled ? collapsed : internal;\n\n const toggle = () => {\n const next = !current;\n if (!isControlled) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed: current, toggle }}>\n <aside\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col bg-bg-default border-r border-border-default transition-all duration-200',\n current ? 'w-16' : 'w-64',\n className,\n )}\n {...rest}\n >\n <div\n className={cn(\n 'flex items-center gap-3 px-4 py-4 border-b border-border-default',\n current && 'justify-center px-2',\n )}\n >\n {logo && <div className=\"shrink-0\">{logo}</div>}\n {!current && (\n <div className=\"flex flex-col min-w-0\">\n {title && (\n <div className=\"text-p-md font-semibold text-fg-default truncate\">{title}</div>\n )}\n {subtitle && <div className=\"text-p-sm text-fg-secondary truncate\">{subtitle}</div>}\n </div>\n )}\n <button\n type=\"button\"\n onClick={toggle}\n aria-label={current ? 'Expand sidebar' : 'Collapse sidebar'}\n className={cn(\n 'ml-auto inline-flex items-center justify-center h-8 w-8 rounded-md text-fg-secondary hover:bg-bg-subtle hover:text-fg-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300',\n current && 'ml-0',\n )}\n >\n <MenuIcon className=\"h-4 w-4\" />\n </button>\n </div>\n <nav className=\"flex-1 overflow-y-auto p-2 flex flex-col gap-0.5\">{children}</nav>\n </aside>\n </SidebarContext.Provider>\n );\n});\n\nexport const SidebarItem = forwardRef<HTMLAnchorElement | HTMLButtonElement, SidebarItemProps>(\n function SidebarItem(\n { icon, label, active, badge, children, onClick, href, className, dataTestId, ...rest },\n ref,\n ) {\n const { collapsed } = useSidebar();\n const [open, setOpen] = useState(active ?? false);\n const hasChildren = !!children;\n\n const content = (\n <>\n {icon && <span className=\"inline-flex shrink-0\">{icon}</span>}\n {!collapsed && (\n <>\n <span className=\"flex-1 truncate text-left\">{label}</span>\n {badge && <span className=\"shrink-0\">{badge}</span>}\n {hasChildren && (\n <ChevronRight\n className={cn(\n 'h-4 w-4 shrink-0 text-fg-tertiary transition-transform',\n open && 'rotate-90',\n )}\n aria-hidden\n />\n )}\n </>\n )}\n </>\n );\n\n const handleClick = () => {\n if (hasChildren) setOpen((o) => !o);\n onClick?.();\n };\n\n const itemCls = cn(\n 'group relative flex items-center gap-3 rounded-md px-3 py-2 text-p-std font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300',\n collapsed && 'px-2 justify-center',\n active\n ? 'bg-brand-20 text-brand-800 before:absolute before:left-0 before:top-1/2 before:-translate-y-1/2 before:h-5 before:w-0.5 before:rounded-r before:bg-brand-500'\n : 'text-fg-default hover:bg-bg-container',\n className,\n );\n\n return (\n <>\n {href ? (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n onClick={handleClick}\n data-test-id={dataTestId}\n className={itemCls}\n {...rest}\n >\n {content}\n </a>\n ) : (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type=\"button\"\n onClick={handleClick}\n data-test-id={dataTestId}\n className={cn(itemCls, 'w-full')}\n {...rest}\n >\n {content}\n </button>\n )}\n {hasChildren && open && !collapsed && (\n <div className=\"flex flex-col gap-0.5 pl-8\">{children}</div>\n )}\n </>\n );\n },\n);\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { SkeletonAnimation, SkeletonProps, SkeletonVariant } from './Skeleton.types';\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: 'h-[1em] mb-[0.4em] origin-[0%_55%] scale-y-[0.6] rounded-sm',\n circular: 'size-10 rounded-full',\n rectangular: 'h-4 w-full',\n rounded: 'h-4 w-full rounded-md',\n};\n\nconst animationStyles: Record<SkeletonAnimation, string> = {\n pulse: 'animate-pulse',\n wave: [\n 'relative overflow-hidden',\n \"after:absolute after:inset-0 after:content-[''] after:-translate-x-full\",\n 'after:bg-gradient-to-r after:from-transparent after:via-white/60 after:to-transparent',\n 'after:animate-skeleton-wave dark:after:via-white/10',\n ].join(' '),\n none: '',\n};\n\nfunction toCssSize(value?: number | string): string | undefined {\n if (value === undefined) {\n return undefined;\n }\n return typeof value === 'number' ? `${value}px` : value;\n}\n\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(function Skeleton(\n {\n variant = 'text',\n animation = 'pulse',\n width,\n height,\n count = 1,\n children,\n style,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const hasChildren = children != null;\n const safeCount = Math.max(1, count);\n\n const inlineStyle = {\n ...(width !== undefined ? { width: toCssSize(width) } : null),\n ...(height !== undefined ? { height: toCssSize(height) } : null),\n ...style,\n };\n\n const itemClassName = cn('block bg-bg-subtle leading-none', variantStyles[variant], animationStyles[animation]);\n\n if (hasChildren) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(itemClassName, 'inline-block h-auto w-auto scale-100', className)}\n style={inlineStyle}\n {...rest}\n >\n <span className=\"invisible inline-block\" aria-hidden>\n {children}\n </span>\n </span>\n );\n }\n\n if (safeCount === 1) {\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(itemClassName, className)}\n style={inlineStyle}\n role=\"status\"\n aria-label=\"Loading\"\n {...rest}\n />\n );\n }\n\n return (\n <span ref={ref} data-test-id={dataTestId} className={cn('block', className)} {...rest}>\n {Array.from({ length: safeCount }, (_, index) => (\n <span\n key={index}\n className={itemClassName}\n style={inlineStyle}\n aria-hidden={index === 0 ? undefined : true}\n role={index === 0 ? 'status' : undefined}\n aria-label={index === 0 ? 'Loading' : undefined}\n />\n ))}\n </span>\n );\n});\n","import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\nimport { CheckCircle2, AlertTriangle, XCircle, Info, X, type LucideIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n SnackbarContextValue,\n SnackbarItem,\n SnackbarProviderProps,\n SnackbarVariant,\n} from './Snackbar.types';\n\nconst variantStyles: Record<SnackbarVariant, { container: string; icon: LucideIcon }> = {\n success: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: CheckCircle2 },\n warning: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: AlertTriangle },\n danger: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: XCircle },\n info: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: Info },\n neutral: { container: 'bg-gray-900 dark:bg-gray-700 text-white', icon: Info },\n};\n\nconst iconColor: Record<SnackbarVariant, string> = {\n success: 'text-green-400',\n warning: 'text-yellow-300',\n danger: 'text-red-400',\n info: 'text-blue-400',\n neutral: 'text-white/70',\n};\n\nconst SnackbarContext = createContext<SnackbarContextValue | null>(null);\n\nexport function useSnackbar(): SnackbarContextValue {\n const ctx = useContext(SnackbarContext);\n if (!ctx) throw new Error('useSnackbar must be used inside <SnackbarProvider>');\n return ctx;\n}\n\nexport function SnackbarProvider({ children, dataTestId }: SnackbarProviderProps) {\n const [items, setItems] = useState<SnackbarItem[]>([]);\n const timers = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());\n\n const dismiss = useCallback((id: string) => {\n setItems((list) => list.filter((i) => i.id !== id));\n const t = timers.current.get(id);\n if (t) {\n clearTimeout(t);\n timers.current.delete(id);\n }\n }, []);\n\n const show = useCallback(\n (s: Omit<SnackbarItem, 'id'> & { id?: string }) => {\n const id = s.id ?? Math.random().toString(36).slice(2);\n const item: SnackbarItem = {\n duration: 5000,\n variant: 'neutral',\n ...s,\n id,\n };\n setItems((list) => [...list, item]);\n if (item.duration && item.duration > 0) {\n const t = setTimeout(() => dismiss(id), item.duration);\n timers.current.set(id, t);\n }\n return id;\n },\n [dismiss],\n );\n\n useEffect(() => {\n const timerMap = timers.current;\n return () => {\n timerMap.forEach(clearTimeout);\n timerMap.clear();\n };\n }, []);\n\n return (\n <SnackbarContext.Provider value={{ show, dismiss }}>\n {children}\n {createPortal(\n <div\n data-test-id={dataTestId}\n className=\"fixed left-1/2 -translate-x-1/2 bottom-6 z-[100] flex flex-col gap-2 w-[min(400px,calc(100vw-2rem))] pointer-events-none\"\n >\n {items.map((i) => {\n const { container, icon: Icon } = variantStyles[i.variant ?? 'neutral'];\n return (\n <div\n key={i.id}\n role=\"status\"\n data-test-id={i.dataTestId}\n className={cn(\n 'pointer-events-auto flex items-center gap-3 px-4 py-3 rounded-lg shadow-z4',\n container,\n )}\n >\n <Icon\n className={cn('h-5 w-5 shrink-0', iconColor[i.variant ?? 'neutral'])}\n aria-hidden\n />\n <p className=\"flex-1 text-p-std\">{i.message}</p>\n {i.action && (\n <button\n type=\"button\"\n onClick={() => {\n i.action?.onClick();\n dismiss(i.id);\n }}\n className=\"text-p-std font-semibold text-brand-400 hover:text-brand-300 px-1\"\n >\n {i.action.label}\n </button>\n )}\n <button\n type=\"button\"\n onClick={() => dismiss(i.id)}\n aria-label=\"Close\"\n className=\"shrink-0 p-1 rounded-md text-white/70 hover:text-white hover:bg-white/10\"\n >\n <X className=\"h-4 w-4\" />\n </button>\n </div>\n );\n })}\n </div>,\n document.body,\n )}\n </SnackbarContext.Provider>\n );\n}\n","import { forwardRef } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { StatusProps, StatusSize, StatusVariant } from './Status.types';\n\nconst sizeStyles: Record<StatusSize, string> = {\n lg: 'h-7 px-2.5 text-p-std gap-1.5',\n md: 'h-6 px-2 text-p-sm gap-1.5',\n sm: 'h-5 px-1.5 text-p-sm gap-1',\n};\n\nconst dotDim: Record<StatusSize, string> = {\n lg: 'h-2 w-2',\n md: 'h-1.5 w-1.5',\n sm: 'h-1.5 w-1.5',\n};\n\nconst variantStyles: Record<StatusVariant, { container: string; dot: string }> = {\n general: { container: 'bg-bg-subtle text-fg-default dark:text-fg-default', dot: 'bg-gray-600 dark:bg-gray-400' },\n info: { container: 'bg-bg-info-lighter text-blue-800 dark:text-blue-300', dot: 'bg-blue-600' },\n brand: { container: 'bg-bg-brand-lighter text-brand-800 dark:text-brand-500', dot: 'bg-brand-500' },\n danger: { container: 'bg-bg-danger-lighter text-red-800 dark:text-red-300', dot: 'bg-red-600' },\n warning: { container: 'bg-bg-warning-lighter text-yellow-900 dark:text-yellow-300', dot: 'bg-yellow-600' },\n success: { container: 'bg-bg-success-lighter text-green-800 dark:text-green-300', dot: 'bg-green-600' },\n discovery: {\n container: 'bg-purple-50 dark:bg-purple-900/30 text-purple-800 dark:text-purple-300',\n dot: 'bg-purple-500',\n },\n disabled: { container: 'bg-bg-subtle text-fg-disabled', dot: 'bg-border-strong' },\n};\n\nexport const Status = forwardRef<HTMLSpanElement, StatusProps>(function Status(\n {\n variant = 'general',\n size = 'md',\n leftIcon,\n rightIcon,\n dot = true,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const { container, dot: dotColor } = variantStyles[variant];\n\n return (\n <span\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center rounded-full font-medium whitespace-nowrap select-none',\n sizeStyles[size],\n container,\n className,\n )}\n {...rest}\n >\n {leftIcon ? (\n <span className=\"inline-flex shrink-0\">{leftIcon}</span>\n ) : dot ? (\n <span className={cn('inline-block shrink-0 rounded-full', dotDim[size], dotColor)} aria-hidden />\n ) : null}\n {children}\n {rightIcon && <span className=\"inline-flex shrink-0\">{rightIcon}</span>}\n </span>\n );\n});\n","import { forwardRef } from 'react';\nimport { CircleCheck, CircleX } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n StepIndicatorItem,\n StepIndicatorMarker,\n StepIndicatorProps,\n StepIndicatorSize,\n StepIndicatorStatus,\n} from './StepIndicator.types';\n\nconst markerBoxSize: Record<StepIndicatorSize, string> = {\n lg: 'size-9',\n sm: 'size-6',\n};\n\nconst markerRowHeight: Record<StepIndicatorSize, string> = {\n lg: 'h-9',\n sm: 'h-6',\n};\n\nconst markerBorderWidth: Record<StepIndicatorSize, string> = {\n lg: 'border-2',\n sm: 'border',\n};\n\nconst markerTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-std',\n sm: 'text-p-xs',\n};\n\nconst markerIconSize: Record<StepIndicatorSize, string> = {\n lg: 'size-5',\n sm: 'size-3.5',\n};\n\nconst dotSize: Record<StepIndicatorSize, string> = {\n lg: 'size-3',\n sm: 'size-2',\n};\n\nconst labelTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-std',\n sm: 'text-p-sm',\n};\n\nconst descriptionTextSize: Record<StepIndicatorSize, string> = {\n lg: 'text-p-sm',\n sm: 'text-p-xs',\n};\n\nconst markerStatusStyles: Record<StepIndicatorStatus, string> = {\n upcoming: 'bg-bg-default border-border-strong text-fg-tertiary',\n active: 'bg-bg-default border-brand-500 text-brand-700',\n completed: 'bg-brand-500 border-brand-500 text-fg-inverse',\n rejected: 'bg-red-700 border-red-800 text-fg-inverse',\n};\n\n// The halo is exactly `ring-4 ring-brand-40/80` — a token-exact match for\n// the source's `rgba(202,231,185,.8)` (= --color-brand-40: #cae7b9). The\n// danger halo's source value (#FFB5AB) has no matching token; ring-red-100\n// is the closest (~1 shade off).\nconst haloStyles: Record<StepIndicatorStatus, string> = {\n upcoming: 'ring-4 ring-gray-100/80',\n active: 'ring-4 ring-brand-40/80',\n completed: 'ring-4 ring-brand-40/80',\n rejected: 'ring-4 ring-red-100/80',\n};\n\nfunction renderMarkerContent(\n marker: StepIndicatorMarker,\n status: StepIndicatorStatus,\n index: number,\n size: StepIndicatorSize,\n) {\n if (status === 'completed') return <CircleCheck className={markerIconSize[size]} />;\n if (status === 'rejected') return <CircleX className={markerIconSize[size]} />;\n if (marker === 'number') return index + 1;\n if (marker === 'dot') {\n return (\n <span\n className={cn('rounded-full', dotSize[size], status === 'active' ? 'bg-brand-500' : 'bg-transparent')}\n />\n );\n }\n return null;\n}\n\nexport const StepIndicator = forwardRef<HTMLOListElement, StepIndicatorProps>(function StepIndicator(\n {\n steps,\n activeValue,\n onStepSelect,\n marker = 'number',\n orientation = 'horizontal',\n size = 'lg',\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const isVertical = orientation === 'vertical';\n\n const isCompleted = (step: StepIndicatorItem | undefined) => (step?.status ?? 'upcoming') === 'completed';\n\n return (\n <ol\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex', isVertical ? 'flex-col' : 'w-full items-start', className)}\n {...rest}\n >\n {steps.map((step, index) => {\n const status = step.status ?? 'upcoming';\n const isFirst = index === 0;\n const isLast = index === steps.length - 1;\n const leadingColored = !isFirst && isCompleted(steps[index - 1]);\n const trailingColored = !isLast && isCompleted(step);\n\n const markerNode = (\n <span\n className={cn(\n 'relative z-10 inline-flex shrink-0 items-center justify-center rounded-full font-semibold transition-colors',\n markerBoxSize[size],\n markerBorderWidth[size],\n markerTextSize[size],\n markerStatusStyles[status],\n step.highlighted && haloStyles[status],\n )}\n >\n {renderMarkerContent(marker, status, index, size)}\n </span>\n );\n\n const content = (\n <div\n className={cn(\n 'flex flex-col',\n isVertical ? 'gap-0.5 pb-6' : 'mt-2 items-center gap-0.5 text-center',\n )}\n >\n <span className={cn('font-medium text-fg-default', labelTextSize[size])}>{step.label}</span>\n {step.description && (\n <span className={cn('text-fg-secondary', descriptionTextSize[size])}>{step.description}</span>\n )}\n </div>\n );\n\n return (\n <li\n key={step.value}\n aria-current={step.value === activeValue ? 'step' : undefined}\n className={cn('relative flex', isVertical ? 'flex-row gap-3' : 'flex-1 basis-0 min-w-0 flex-col')}\n >\n <div\n className={cn(\n 'relative flex shrink-0',\n isVertical\n ? 'w-9 flex-col items-center justify-center'\n : cn('w-full items-center justify-center', markerRowHeight[size]),\n )}\n >\n {!isFirst && (\n <span\n aria-hidden\n className={cn(\n 'absolute',\n isVertical\n ? 'left-1/2 top-0 bottom-1/2 w-0.5 -translate-x-1/2'\n : 'left-0 right-1/2 top-1/2 h-0.5 -translate-y-1/2',\n leadingColored ? 'bg-brand-500' : 'bg-border-default',\n )}\n />\n )}\n {!isLast && (\n <span\n aria-hidden\n className={cn(\n 'absolute',\n isVertical\n ? 'left-1/2 top-1/2 bottom-0 w-0.5 -translate-x-1/2'\n : 'left-1/2 right-0 top-1/2 h-0.5 -translate-y-1/2',\n trailingColored ? 'bg-brand-500' : 'bg-border-default',\n )}\n />\n )}\n {onStepSelect ? (\n <button\n type=\"button\"\n onClick={() => onStepSelect(step.value)}\n aria-label={typeof step.label === 'string' ? step.label : undefined}\n className=\"relative z-10 rounded-full outline-none focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-2\"\n >\n {markerNode}\n </button>\n ) : (\n markerNode\n )}\n </div>\n {content}\n </li>\n );\n })}\n </ol>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { SwitchProps, SwitchSize } from './Switch.types';\n\nconst trackSize: Record<SwitchSize, string> = {\n md: 'h-6 w-11',\n sm: 'h-5 w-9',\n};\n\nconst thumbSize: Record<SwitchSize, string> = {\n md: 'h-5 w-5 peer-checked:translate-x-5',\n sm: 'h-4 w-4 peer-checked:translate-x-4',\n};\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n {\n size = 'md',\n label,\n description,\n labelPosition = 'right',\n id,\n disabled,\n checked,\n defaultChecked,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n const control = (\n <span className=\"relative inline-flex shrink-0\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n role=\"switch\"\n checked={checked}\n defaultChecked={defaultChecked}\n disabled={disabled}\n className=\"peer sr-only\"\n {...rest}\n />\n <span\n className={cn(\n 'rounded-full bg-gray-300 dark:bg-gray-700 transition-colors',\n trackSize[size],\n 'peer-checked:bg-brand-500 dark:peer-checked:bg-brand-500',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2',\n disabled && '!bg-bg-subtle',\n )}\n />\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 rounded-full bg-white dark:bg-white shadow-z1 transition-transform',\n thumbSize[size],\n )}\n />\n </span>\n );\n\n if (!label && !description) {\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn('inline-flex', disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer', className)}\n >\n {control}\n </label>\n );\n }\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-start gap-3',\n labelPosition === 'left' && 'flex-row-reverse justify-end',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n {control}\n <span className=\"flex flex-col gap-0.5\">\n {label && <span className=\"text-p-std font-medium text-fg-default leading-tight\">{label}</span>}\n {description && <span className=\"text-p-sm text-fg-secondary leading-snug\">{description}</span>}\n </span>\n </label>\n );\n});\n","import { forwardRef } from 'react';\nimport { ArrowUp, ArrowDown, ChevronsUpDown } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type {\n TableProps,\n THeadProps,\n TBodyProps,\n TRProps,\n THProps,\n TDProps,\n TableAlign,\n DataTableProps,\n} from './Table.types';\n\nconst densityStyles: Record<NonNullable<TableProps['density']>, string> = {\n comfortable: '[&_td]:py-3 [&_th]:py-3',\n compact: '[&_td]:py-2 [&_th]:py-2',\n};\n\nconst alignStyles: Record<TableAlign, string> = {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n};\n\nexport const Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n {\n density = 'comfortable',\n striped = false,\n hoverable = true,\n stickyHeader = false,\n wrapperClassName,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n return (\n <div\n data-test-id={dataTestId}\n className={cn(\n 'w-full overflow-x-auto rounded-lg border border-border-default bg-bg-default',\n wrapperClassName,\n )}\n >\n <table\n ref={ref}\n className={cn(\n 'w-full border-collapse text-p-std text-fg-default',\n densityStyles[density],\n className,\n )}\n data-striped={striped || undefined}\n data-hoverable={hoverable || undefined}\n data-sticky={stickyHeader || undefined}\n {...rest}\n >\n {children}\n </table>\n </div>\n );\n});\n\nexport const THead = forwardRef<HTMLTableSectionElement, THeadProps>(function THead(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <thead\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n 'bg-bg-container text-p-sm font-semibold text-fg-secondary uppercase tracking-wider',\n '[[data-sticky]_&]:sticky [[data-sticky]_&]:top-0 [[data-sticky]_&]:z-10',\n className,\n )}\n {...rest}\n >\n {children}\n </thead>\n );\n});\n\nexport const TBody = forwardRef<HTMLTableSectionElement, TBodyProps>(function TBody(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <tbody\n ref={ref}\n data-test-id={dataTestId}\n className={cn(\n '[&>tr]:border-t [&>tr]:border-border-default',\n '[[data-striped]_&>tr:nth-child(even)]:bg-bg-container',\n '[[data-hoverable]_&>tr:hover]:bg-bg-container',\n className,\n )}\n {...rest}\n >\n {children}\n </tbody>\n );\n});\n\nexport const TR = forwardRef<HTMLTableRowElement, TRProps>(function TR(\n { className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <tr ref={ref} data-test-id={dataTestId} className={className} {...rest}>\n {children}\n </tr>\n );\n});\n\nexport const TH = forwardRef<HTMLTableCellElement, THProps>(function TH(\n {\n sortable = false,\n sortDir = null,\n onSortChange,\n align = 'left',\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const content = (\n <>\n {children}\n {sortable && (\n <span className=\"inline-flex ml-1 align-middle text-fg-tertiary\">\n {sortDir === 'asc' ? (\n <ArrowUp className=\"h-3.5 w-3.5\" />\n ) : sortDir === 'desc' ? (\n <ArrowDown className=\"h-3.5 w-3.5\" />\n ) : (\n <ChevronsUpDown className=\"h-3.5 w-3.5\" />\n )}\n </span>\n )}\n </>\n );\n\n return (\n <th\n ref={ref}\n scope=\"col\"\n data-test-id={dataTestId}\n className={cn('px-4 whitespace-nowrap', alignStyles[align], className)}\n aria-sort={sortDir === 'asc' ? 'ascending' : sortDir === 'desc' ? 'descending' : undefined}\n {...rest}\n >\n {sortable ? (\n <button\n type=\"button\"\n onClick={() => {\n const next = sortDir === 'asc' ? 'desc' : sortDir === 'desc' ? null : 'asc';\n onSortChange?.(next);\n }}\n className=\"inline-flex items-center hover:text-fg-default focus-visible:outline-none\"\n >\n {content}\n </button>\n ) : (\n content\n )}\n </th>\n );\n});\n\nexport const TD = forwardRef<HTMLTableCellElement, TDProps>(function TD(\n { align = 'left', className, children, dataTestId, ...rest },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-test-id={dataTestId}\n className={cn('px-4', alignStyles[align], className)}\n {...rest}\n >\n {children}\n </td>\n );\n});\n\nexport function DataTable<T>({\n columns,\n rows,\n rowKey,\n empty = 'No results',\n density,\n striped,\n hoverable,\n sortKey,\n sortDir = null,\n onSortChange,\n onRowClick,\n className,\n dataTestId,\n}: DataTableProps<T>) {\n return (\n <Table\n density={density}\n striped={striped}\n hoverable={hoverable}\n className={className}\n dataTestId={dataTestId}\n >\n <THead>\n <TR>\n {columns.map((col) => (\n <TH\n key={col.key}\n align={col.align}\n sortable={col.sortable}\n sortDir={sortKey === col.key ? sortDir : null}\n onSortChange={(d) => onSortChange?.(col.key, d)}\n >\n {col.header}\n </TH>\n ))}\n </TR>\n </THead>\n <TBody>\n {rows.length === 0 ? (\n <TR>\n <TD colSpan={columns.length} className=\"text-center text-fg-tertiary py-10\" align=\"center\">\n {empty}\n </TD>\n </TR>\n ) : (\n rows.map((row, i) => (\n <TR\n key={rowKey(row, i)}\n onClick={onRowClick ? () => onRowClick(row) : undefined}\n className={onRowClick ? 'cursor-pointer' : undefined}\n >\n {columns.map((col) => (\n <TD key={col.key} align={col.align}>\n {col.render ? col.render(row) : col.accessor ? col.accessor(row) : null}\n </TD>\n ))}\n </TR>\n ))\n )}\n </TBody>\n </Table>\n );\n}\n","import {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useId,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../lib/cn';\nimport { mergeRefs } from '../../lib/mergeRefs';\nimport { Badge } from '../Badge';\nimport type {\n TabListProps,\n TabPanelProps,\n TabProps,\n TabsProps,\n TabsSize,\n TabsVariant,\n} from './Tabs.types';\n\ninterface TabsContextValue {\n value: string;\n setValue: (v: string) => void;\n variant: TabsVariant;\n size: TabsSize;\n tabsId: string;\n disabled: boolean;\n}\n\nconst TabsContext = createContext<TabsContextValue | null>(null);\n\nfunction useTabs() {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('Tab components must be used inside <Tabs>');\n return ctx;\n}\n\n/** Walks `children` for a `<TabList>` and returns its first `<Tab>`'s value, used\n * as the default active tab when `Tabs` is uncontrolled and no `defaultValue` is given. */\nfunction findFirstValue(children: ReactNode): string {\n const items: ReactElement[] = [];\n Children.forEach(children, (child) => {\n if (isValidElement(child)) items.push(child);\n });\n const list = items.find(\n (child) => (child.type as { displayName?: string })?.displayName === 'TabList',\n );\n if (!isValidElement(list)) return '';\n const listChildren = Children.toArray((list.props as { children?: ReactNode }).children);\n for (const child of listChildren) {\n if (isValidElement(child)) {\n const value = (child.props as { value?: string }).value;\n if (value !== undefined) return value;\n }\n }\n return '';\n}\n\nexport const Tabs = forwardRef<HTMLDivElement, TabsProps>(function Tabs(\n {\n defaultValue,\n value,\n onValueChange,\n variant = 'underline',\n size = 'md',\n disabled = false,\n className,\n children,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [internal, setInternal] = useState<string>(() => defaultValue ?? findFirstValue(children));\n const controlled = value !== undefined;\n const current = controlled ? value : internal;\n const tabsId = useId();\n\n const setValue = (v: string) => {\n if (!controlled) setInternal(v);\n onValueChange?.(v);\n };\n\n return (\n <TabsContext.Provider value={{ value: current, setValue, variant, size, tabsId, disabled }}>\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex flex-col gap-4', className)}\n {...rest}\n >\n {children}\n </div>\n </TabsContext.Provider>\n );\n});\n\nexport const TabList = forwardRef<HTMLDivElement, TabListProps>(function TabList(\n { children, scrollable = false, className, dataTestId, onKeyDown, ...rest },\n ref,\n) {\n const { variant } = useTabs();\n const listRef = useRef<HTMLDivElement>(null);\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n const tabs = Array.from(\n listRef.current?.querySelectorAll<HTMLElement>('[role=\"tab\"]:not(:disabled)') ?? [],\n );\n if (!tabs.length) return;\n const currentIndex = tabs.indexOf(document.activeElement as HTMLElement);\n\n let nextIndex: number | null = null;\n if (event.key === 'ArrowRight') nextIndex = (currentIndex + 1 + tabs.length) % tabs.length;\n else if (event.key === 'ArrowLeft') nextIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n else if (event.key === 'Home') nextIndex = 0;\n else if (event.key === 'End') nextIndex = tabs.length - 1;\n if (nextIndex === null) return;\n\n const next = tabs[nextIndex];\n if (!next) return;\n event.preventDefault();\n next.focus();\n next.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n // WAI-ARIA \"automatic activation\": moving focus activates the tab.\n next.click();\n };\n\n return (\n <div\n ref={mergeRefs(ref, listRef)}\n role=\"tablist\"\n onKeyDown={handleKeyDown}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex',\n variant === 'underline' && 'border-b border-border-default gap-1 w-full',\n variant === 'pills' && 'gap-1 p-1 rounded-full bg-bg-container',\n variant === 'boxed' &&\n 'gap-0 rounded-lg border border-border-default overflow-hidden bg-bg-container',\n scrollable &&\n cn(\n 'overflow-x-auto flex-nowrap scroll-smooth [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n '[mask-image:linear-gradient(to_right,transparent,black_16px,black_calc(100%-16px),transparent)]',\n ),\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n});\nTabList.displayName = 'TabList';\n\nconst sizeStyles: Record<TabsSize, string> = {\n lg: 'h-11 px-4 text-p-md',\n md: 'h-10 px-3 text-p-std',\n sm: 'h-8 px-2.5 text-p-sm',\n};\n\n/** Count/indicator pill rendered after the label. Recolours with the tab's\n * active state so the active tab's count reads as the primary one. */\nconst badgeStyles: Record<TabsVariant, { on: string; off: string }> = {\n underline: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n pills: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n boxed: { on: 'bg-brand-500 text-white', off: 'bg-bg-subtle text-fg-secondary' },\n};\n\nexport const Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n {\n value,\n children,\n disabled: tabDisabled,\n icon,\n badge,\n badgeProps,\n rightIcon,\n onRightIconClick,\n rightIconLabel,\n className,\n dataTestId,\n onClick,\n id,\n ...rest\n },\n ref,\n) {\n const { value: current, setValue, variant, size, tabsId, disabled: barDisabled } = useTabs();\n const active = current === value;\n const disabled = barDisabled || tabDisabled;\n const hasBadge = badge !== undefined && badge !== null && badge !== false;\n const tabId = id ?? `${tabsId}-tab-${value}`;\n const panelId = `${tabsId}-panel-${value}`;\n\n const base = cn(\n 'group relative inline-flex items-center justify-center gap-2 font-medium outline-none transition-colors',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1 focus-visible:rounded-md',\n sizeStyles[size],\n disabled && 'opacity-50 cursor-not-allowed',\n );\n\n const variantCls = (() => {\n if (variant === 'underline') {\n return cn(\n 'rounded-t-lg',\n active ? 'text-fg-default' : 'text-fg-secondary hover:text-fg-default hover:bg-bg-subtle/60',\n );\n }\n if (variant === 'pills') {\n return cn(\n 'rounded-full',\n active\n ? 'bg-bg-default text-fg-default shadow-z1'\n : 'bg-transparent text-fg-secondary hover:text-fg-default',\n );\n }\n return cn(\n 'border-r border-border-default last:border-r-0',\n active ? 'bg-bg-default text-fg-default' : 'bg-transparent text-fg-secondary hover:bg-bg-subtle',\n );\n })();\n\n const tabButton = (\n <button\n ref={ref}\n id={tabId}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-controls={panelId}\n tabIndex={active ? 0 : -1}\n disabled={disabled}\n data-test-id={dataTestId}\n onClick={(event) => {\n if (disabled) return;\n setValue(value);\n onClick?.(event);\n }}\n className={cn(base, variantCls, rightIcon && 'pr-9', className)}\n {...rest}\n >\n {icon && <span className=\"inline-flex shrink-0\">{icon}</span>}\n <span className=\"truncate\">{children}</span>\n {hasBadge &&\n (badgeProps ? (\n <Badge size=\"xs\" {...badgeProps}>\n {badge}\n </Badge>\n ) : (\n <span\n className={cn(\n 'inline-flex items-center justify-center shrink-0 rounded-full px-1.5 h-5 min-w-[1.25rem]',\n 'text-label-xs font-semibold tabular-nums leading-none transition-colors',\n active ? badgeStyles[variant].on : badgeStyles[variant].off,\n )}\n >\n {badge}\n </span>\n ))}\n {variant === 'underline' && (\n <span\n aria-hidden\n className={cn(\n 'pointer-events-none absolute inset-x-0 -bottom-px h-[2px] rounded-full bg-brand-500 transition-opacity duration-150',\n active ? 'opacity-100' : 'opacity-0',\n )}\n />\n )}\n </button>\n );\n\n if (!rightIcon) return tabButton;\n\n return (\n <span className=\"relative inline-flex\">\n {tabButton}\n <button\n type=\"button\"\n aria-label={rightIconLabel}\n disabled={disabled}\n onClick={(event) => {\n event.stopPropagation();\n if (!disabled) onRightIconClick?.(value);\n }}\n className=\"absolute right-1.5 top-1/2 -translate-y-1/2 inline-flex items-center justify-center size-5 rounded text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {rightIcon}\n </button>\n </span>\n );\n});\n\nexport const TabPanel = forwardRef<HTMLDivElement, TabPanelProps>(function TabPanel(\n { value, children, className, dataTestId, id, keepMounted = false, ...rest },\n ref,\n) {\n const { value: current, tabsId } = useTabs();\n const active = current === value;\n if (!active && !keepMounted) return null;\n const panelId = id ?? `${tabsId}-panel-${value}`;\n const tabId = `${tabsId}-tab-${value}`;\n return (\n <div\n ref={ref}\n id={panelId}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n hidden={!active}\n data-test-id={dataTestId}\n className={className}\n {...rest}\n >\n {children}\n </div>\n );\n});\n","import { forwardRef, useId, useState, type ChangeEvent } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TextAreaProps } from './TextArea.types';\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function TextArea(\n {\n label,\n labelAddons,\n helperText,\n errorText,\n error = false,\n id,\n disabled,\n required,\n maxLength,\n showCount = false,\n className,\n wrapperClassName,\n value,\n defaultValue,\n rows = 4,\n dataTestId,\n onChange,\n ...rest\n },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n const hasError = error || !!errorText;\n const describedBy = errorText ? `${inputId}-error` : helperText ? `${inputId}-help` : undefined;\n\n const isControlled = value !== undefined;\n const countsEnabled = showCount && !!maxLength;\n // Uncontrolled length has to be tracked in state and updated on every\n // keystroke — deriving it from `defaultValue` (as before) only reflects\n // the initial render and never moves after that.\n const [uncontrolledLength, setUncontrolledLength] = useState(() => String(defaultValue ?? '').length);\n const currentLength = isControlled ? String(value).length : uncontrolledLength;\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n if (!isControlled && countsEnabled) setUncontrolledLength(event.target.value.length);\n onChange?.(event);\n };\n\n return (\n <div className={cn('flex flex-col gap-1.5 w-full', wrapperClassName)} data-test-id={dataTestId}>\n {(label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <label\n htmlFor={inputId}\n className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\"\n >\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </label>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n )}\n <textarea\n ref={ref}\n id={inputId}\n disabled={disabled}\n required={required}\n maxLength={maxLength}\n rows={rows}\n value={value}\n defaultValue={defaultValue}\n onChange={handleChange}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n className={cn(\n 'w-full px-3 py-2.5 rounded-lg border bg-bg-default text-p-std text-fg-default placeholder:text-fg-tertiary outline-none transition-colors resize-y',\n hasError ? 'border-red-600' : 'border-border-default',\n !disabled && !hasError && 'hover:border-border-strong',\n 'focus:ring-2',\n hasError ? 'focus:ring-red-300 focus:border-red-600' : 'focus:ring-brand-300 focus:border-brand-500',\n disabled && 'bg-bg-container border-border-default cursor-not-allowed',\n className,\n )}\n {...rest}\n />\n <div className=\"flex items-start justify-between gap-2\">\n <div className=\"flex-1 min-w-0\">\n {errorText ? (\n <p id={`${inputId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : helperText ? (\n <p id={`${inputId}-help`} className=\"text-p-sm text-fg-secondary\">\n {helperText}\n </p>\n ) : null}\n </div>\n {countsEnabled && (\n <p className=\"text-p-sm text-fg-tertiary tabular-nums shrink-0\">\n {currentLength}/{maxLength}\n </p>\n )}\n </div>\n </div>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport { Moon, Sun } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport type { ThemeSwitchProps } from './ThemeSwitch.types';\n\nexport const ThemeSwitch = forwardRef<HTMLInputElement, ThemeSwitchProps>(function ThemeSwitch(\n { checked, label, id, disabled, className, dataTestId, ...rest },\n ref,\n) {\n const reactId = useId();\n const inputId = id ?? reactId;\n\n return (\n <label\n htmlFor={inputId}\n data-test-id={dataTestId}\n className={cn(\n 'inline-flex items-center gap-3',\n disabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer',\n className,\n )}\n >\n <span className=\"relative inline-flex shrink-0\">\n <input\n ref={ref}\n id={inputId}\n type=\"checkbox\"\n role=\"switch\"\n checked={checked}\n disabled={disabled}\n aria-label={label ? undefined : 'Dark mode'}\n className=\"peer sr-only\"\n {...rest}\n />\n <span\n className={cn(\n 'inline-flex h-8 w-16 items-center justify-between rounded-full px-2 transition-colors',\n 'bg-gray-200 peer-checked:bg-gray-700 dark:bg-gray-700 dark:peer-checked:bg-gray-900',\n 'peer-focus-visible:ring-2 peer-focus-visible:ring-brand-300 peer-focus-visible:ring-offset-2',\n )}\n >\n <Sun className=\"size-4 text-yellow-500 z-1\" aria-hidden />\n <Moon className=\"size-4 text-gray-400 z-1\" aria-hidden />\n </span>\n <span\n aria-hidden\n className=\"absolute left-1 top-1 size-6 rounded-full bg-white shadow-z1 transition-transform peer-checked:translate-x-8 peer-checked:bg-gray-600\"\n />\n </span>\n {label && <span className=\"text-p-std font-medium text-fg-default\">{label}</span>}\n </label>\n );\n});\n","import { cloneElement, forwardRef, isValidElement, useId, useRef, useState } from 'react';\nimport { cn } from '../../lib/cn';\nimport type { TooltipProps, TooltipSide, TooltipSize } from './Tooltip.types';\n\nconst sizeStyles: Record<TooltipSize, string> = {\n lg: 'px-3 py-2 text-p-std',\n sm: 'px-2 py-1 text-p-sm',\n};\n\nconst sidePosition: Record<TooltipSide, string> = {\n top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',\n bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',\n left: 'right-full top-1/2 -translate-y-1/2 mr-2',\n right: 'left-full top-1/2 -translate-y-1/2 ml-2',\n};\n\nconst arrowPosition: Record<TooltipSide, string> = {\n top: 'top-full left-1/2 -translate-x-1/2 border-t-fg-default border-x-transparent border-b-transparent',\n bottom: 'bottom-full left-1/2 -translate-x-1/2 border-b-fg-default border-x-transparent border-t-transparent',\n left: 'left-full top-1/2 -translate-y-1/2 border-l-fg-default border-y-transparent border-r-transparent',\n right: 'right-full top-1/2 -translate-y-1/2 border-r-fg-default border-y-transparent border-l-transparent',\n};\n\nexport const Tooltip = forwardRef<HTMLSpanElement, TooltipProps>(function Tooltip(\n { content, children, side = 'top', size = 'sm', delay = 150, className, dataTestId },\n ref,\n) {\n const [open, setOpen] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const tooltipId = useId();\n\n const show = () => {\n if (timer.current) clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(true), delay);\n };\n const hide = () => {\n if (timer.current) clearTimeout(timer.current);\n setOpen(false);\n };\n\n if (!isValidElement(children)) return children;\n\n const childProps = (children.props ?? {}) as Record<string, unknown>;\n const trigger = cloneElement(children, {\n onMouseEnter: show,\n onMouseLeave: hide,\n onFocus: show,\n onBlur: hide,\n 'aria-describedby': open ? tooltipId : childProps['aria-describedby'],\n } as Record<string, unknown>);\n\n return (\n <span ref={ref} data-test-id={dataTestId} className=\"relative inline-flex\">\n {trigger}\n {open && (\n <span\n role=\"tooltip\"\n id={tooltipId}\n className={cn(\n 'absolute z-50 whitespace-nowrap rounded-md bg-fg-default text-bg-default shadow-z3 pointer-events-none select-none',\n sizeStyles[size],\n sidePosition[side],\n className,\n )}\n >\n {content}\n <span aria-hidden className={cn('absolute h-0 w-0 border-4', arrowPosition[side])} />\n </span>\n )}\n </span>\n );\n});\n","import { forwardRef } from 'react';\nimport { Construction } from 'lucide-react';\nimport { Empty } from '../Empty';\nimport { IconTile } from '../IconTile';\nimport type { UnderConstructionProps, UnderConstructionSize } from './UnderConstruction.types';\n\nconst DEFAULT_TITLE = \"We'll be back soon\";\nconst DEFAULT_DESCRIPTION =\n \"We're currently performing scheduled maintenance to make your experience even better. Please check back shortly.\";\n\nconst illustrationSize: Record<UnderConstructionSize, 'lg' | 'xl'> = {\n lg: 'xl',\n sm: 'lg',\n};\n\nexport const UnderConstruction = forwardRef<HTMLDivElement, UnderConstructionProps>(function UnderConstruction(\n { size = 'lg', title, description, illustration, ...rest },\n ref,\n) {\n return (\n <Empty\n ref={ref}\n size={size}\n title={title ?? DEFAULT_TITLE}\n description={description ?? DEFAULT_DESCRIPTION}\n illustration={\n illustration ?? <IconTile icon={Construction} tone=\"brand\" shape=\"circle\" size={illustrationSize[size]} />\n }\n {...rest}\n />\n );\n});\n","import { forwardRef, useId, useRef, useState, type DragEvent, type KeyboardEvent } from 'react';\nimport {\n UploadCloud,\n File as FileIcon,\n Trash2,\n X,\n CheckCircle2,\n AlertCircle,\n Paperclip,\n Pencil,\n} from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Button } from '../Button';\nimport type { UploadItemProps, UploadItemStatus, UploadProps, UploadRejection } from './Upload.types';\n\nfunction matchesAccept(file: File, accept: string): boolean {\n const patterns = accept\n .split(',')\n .map((pattern) => pattern.trim().toLowerCase())\n .filter(Boolean);\n if (!patterns.length) return true;\n\n const fileName = file.name.toLowerCase();\n const fileType = file.type.toLowerCase();\n\n return patterns.some((pattern) => {\n if (pattern.endsWith('/*')) return fileType.startsWith(pattern.slice(0, -1));\n if (pattern.startsWith('.')) return fileName.endsWith(pattern);\n return fileType === pattern;\n });\n}\n\nexport const Upload = forwardRef<HTMLDivElement, UploadProps>(function Upload(\n {\n accept,\n multiple = false,\n maxSizeMB,\n hint,\n onFiles,\n disabled,\n validateFiles = false,\n maxFiles,\n dedupe = validateFiles,\n currentFiles = [],\n onReject,\n mode = 'dropzone',\n triggerLabel,\n triggerIcon,\n label,\n required,\n error = false,\n errorText,\n labelAddons,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [dragOver, setDragOver] = useState(false);\n // `dragleave` bubbles from any child the pointer crosses, so a naive\n // `setDragOver(false)` on every dragleave flickers the highlight off and\n // on as the user drags across the inner icon/text. Track nesting depth\n // instead and only clear once the pointer has left every descendant too.\n const dragDepth = useRef(0);\n const hasError = error || !!errorText;\n const reactId = useId();\n const describedBy = errorText ? `${reactId}-error` : undefined;\n\n const processFiles = (incoming: File[]) => {\n if (!incoming.length) return;\n\n if (!validateFiles) {\n onFiles?.(incoming);\n return;\n }\n\n const accepted: File[] = [];\n const rejections: UploadRejection[] = [];\n const seen = [...currentFiles];\n let remainingSlots = maxFiles !== undefined ? Math.max(0, maxFiles - currentFiles.length) : Infinity;\n\n for (const file of incoming) {\n if (dedupe && seen.some((existing) => existing.name === file.name && existing.size === file.size)) {\n rejections.push({ file, reason: 'duplicate' });\n continue;\n }\n if (accept && !matchesAccept(file, accept)) {\n rejections.push({ file, reason: 'type' });\n continue;\n }\n if (maxSizeMB !== undefined && file.size > maxSizeMB * 1024 * 1024) {\n rejections.push({ file, reason: 'size' });\n continue;\n }\n if (remainingSlots <= 0) {\n rejections.push({ file, reason: 'maxFiles' });\n continue;\n }\n accepted.push(file);\n seen.push(file);\n remainingSlots -= 1;\n }\n\n if (accepted.length) onFiles?.(accepted);\n if (rejections.length) onReject?.(rejections);\n };\n\n const onDrop = (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n dragDepth.current = 0;\n setDragOver(false);\n if (disabled) return;\n processFiles(Array.from(event.dataTransfer.files ?? []));\n };\n\n const hintText =\n hint ??\n `${accept ? accept.toUpperCase().replace(/\\./g, '') : 'Any file'}${\n maxSizeMB ? `, up to ${maxSizeMB} MB` : ''\n }`;\n\n const fileInput = (\n <input\n ref={inputRef}\n type=\"file\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n onChange={(event) => {\n processFiles(Array.from(event.target.files ?? []));\n event.target.value = '';\n }}\n className=\"sr-only\"\n />\n );\n\n const labelRow = (label || labelAddons) && (\n <div className=\"flex items-center gap-1.5\">\n {label && (\n <span className=\"text-p-std font-medium text-fg-default inline-flex items-center gap-1\">\n {label}\n {required && (\n <span className=\"text-red-600\" aria-hidden>\n *\n </span>\n )}\n </span>\n )}\n {labelAddons && <span className=\"inline-flex items-center gap-1\">{labelAddons}</span>}\n </div>\n );\n\n const errorRow = errorText ? (\n <p id={`${reactId}-error`} className=\"text-p-sm text-red-700\">\n {errorText}\n </p>\n ) : null;\n\n if (mode !== 'dropzone') {\n const isIcon = mode === 'icon';\n return (\n <div ref={ref} data-test-id={dataTestId} className={cn('flex flex-col gap-1.5', className)} {...rest}>\n {labelRow}\n <Button\n type=\"button\"\n variant=\"secondary\"\n iconOnly={isIcon}\n disabled={disabled}\n onClick={() => inputRef.current?.click()}\n leftIcon={isIcon ? undefined : triggerIcon ?? <Paperclip className=\"h-4 w-4\" />}\n aria-label={isIcon ? 'Upload file' : undefined}\n >\n {isIcon ? triggerIcon ?? <Pencil className=\"h-4 w-4\" /> : (triggerLabel ?? 'Choose a file')}\n </Button>\n {fileInput}\n {errorRow}\n </div>\n );\n }\n\n const dropzone = (\n <div\n ref={ref}\n onDragEnter={() => {\n dragDepth.current += 1;\n if (!disabled) setDragOver(true);\n }}\n onDragOver={(event) => event.preventDefault()}\n onDragLeave={() => {\n dragDepth.current = Math.max(0, dragDepth.current - 1);\n if (dragDepth.current === 0) setDragOver(false);\n }}\n onDrop={onDrop}\n onClick={() => !disabled && inputRef.current?.click()}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(event: KeyboardEvent<HTMLDivElement>) => {\n if ((event.key === 'Enter' || event.key === ' ') && !disabled) {\n event.preventDefault();\n inputRef.current?.click();\n }\n }}\n aria-disabled={disabled || undefined}\n aria-invalid={hasError || undefined}\n aria-describedby={describedBy}\n data-test-id={dataTestId}\n className={cn(\n 'flex flex-col items-center justify-center text-center gap-2 px-6 py-8 rounded-lg border-2 border-dashed cursor-pointer transition-colors outline-none',\n hasError\n ? 'border-red-300 bg-bg-danger-lighter'\n : dragOver\n ? 'border-brand-500 bg-brand-20'\n : 'border-border-default bg-bg-container hover:bg-bg-subtle',\n 'focus-visible:ring-2 focus-visible:ring-brand-300 focus-visible:ring-offset-1',\n disabled && 'opacity-50 cursor-not-allowed',\n className,\n )}\n {...rest}\n >\n <div className=\"h-10 w-10 rounded-full bg-bg-default flex items-center justify-center text-fg-secondary shadow-z1\">\n <UploadCloud className=\"h-5 w-5\" />\n </div>\n <div className=\"flex flex-col gap-0.5\">\n <p className=\"text-p-std text-fg-default\">\n <span className=\"font-semibold text-brand-700\">Choose a file</span> or drag & drop it here.\n </p>\n <p className=\"text-p-sm text-fg-tertiary\">{hintText}</p>\n </div>\n {fileInput}\n </div>\n );\n\n if (!labelRow && !errorRow) return dropzone;\n\n return (\n <div className=\"flex flex-col gap-1.5\">\n {labelRow}\n {dropzone}\n {errorRow}\n </div>\n );\n});\n\nconst statusStyles: Record<UploadItemStatus, string> = {\n processing: 'border-border-default bg-bg-default',\n completed: 'border-border-default bg-bg-default',\n error: 'border-red-300 bg-bg-danger-lighter',\n};\n\nexport const UploadItem = forwardRef<HTMLDivElement, UploadItemProps>(function UploadItem(\n {\n name,\n meta,\n status = 'processing',\n progress = 0,\n errorText,\n onRetry,\n onRemove,\n previewSrc,\n className,\n dataTestId,\n ...rest\n },\n ref,\n) {\n const [previewFailed, setPreviewFailed] = useState(false);\n const showPreview = !!previewSrc && !previewFailed;\n\n return (\n <div\n ref={ref}\n data-test-id={dataTestId}\n className={cn('flex items-start gap-3 px-3 py-2.5 rounded-lg border', statusStyles[status], className)}\n {...rest}\n >\n <div\n className={cn(\n 'shrink-0 flex items-center justify-center h-9 w-9 rounded-md overflow-hidden',\n !showPreview && (status === 'error' ? 'bg-red-100 dark:bg-red-900/30 text-red-700' : 'bg-bg-subtle text-fg-secondary'),\n )}\n >\n {showPreview ? (\n <img\n src={previewSrc}\n alt=\"\"\n className=\"h-full w-full object-cover\"\n onError={() => setPreviewFailed(true)}\n />\n ) : (\n <FileIcon className=\"h-4 w-4\" />\n )}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-baseline justify-between gap-2\">\n <p className=\"truncate text-p-std font-medium text-fg-default\">{name}</p>\n <div className=\"flex items-center gap-1 shrink-0\">\n {status === 'completed' && (\n <CheckCircle2 className=\"h-4 w-4 text-green-600\" aria-label=\"Completed\" />\n )}\n {status === 'error' && <AlertCircle className=\"h-4 w-4 text-red-600\" aria-label=\"Failed\" />}\n </div>\n </div>\n {meta && <p className=\"text-p-sm text-fg-tertiary mt-0.5\">{meta}</p>}\n {status === 'processing' && (\n <div className=\"mt-2 h-1 w-full rounded-full bg-bg-subtle overflow-hidden\">\n <div\n className=\"h-full bg-brand-500 transition-[width] duration-200\"\n style={{ width: `${Math.min(100, Math.max(0, progress))}%` }}\n />\n </div>\n )}\n {status === 'error' && errorText && (\n <p className=\"text-p-sm text-red-700 mt-1\">\n {errorText}\n {onRetry && (\n <button type=\"button\" onClick={onRetry} className=\"ml-2 underline font-medium hover:no-underline\">\n Try again\n </button>\n )}\n </p>\n )}\n </div>\n {onRemove && (\n <button\n type=\"button\"\n onClick={onRemove}\n aria-label=\"Remove\"\n className=\"shrink-0 p-1 rounded-md text-fg-tertiary hover:text-fg-default hover:bg-bg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-300\"\n >\n {status === 'completed' ? <Trash2 className=\"h-4 w-4\" /> : <X className=\"h-4 w-4\" />}\n </button>\n )}\n </div>\n );\n});\n","import { useState } from 'react';\n\nexport interface UseStepperOptions {\n /** Total number of steps. */\n count: number;\n /** Uncontrolled initial step index. Default `0`. */\n initialStep?: number;\n /** Controlled step index. Pass alongside `onStepChange` to fully control the step. */\n step?: number;\n onStepChange?: (step: number) => void;\n /** Wraps `next`/`prev` past the last/first step instead of clamping. Default `false`. */\n loop?: boolean;\n}\n\nexport interface UseStepperResult {\n step: number;\n count: number;\n isFirst: boolean;\n isLast: boolean;\n next: () => void;\n prev: () => void;\n goTo: (step: number) => void;\n reset: () => void;\n}\n\nfunction clampStep(value: number, count: number): number {\n if (count <= 0) return 0;\n return Math.min(Math.max(value, 0), count - 1);\n}\n\n/** Drives a multi-step flow's current index — the logic half of a wizard,\n * with no rendering of its own; render `list[step]` (or similar) yourself.\n * Supports both controlled (`step` + `onStepChange`) and uncontrolled\n * (`initialStep`) usage, the same shape as a controlled/uncontrolled form\n * input. */\nexport function useStepper({\n count,\n initialStep = 0,\n step: controlledStep,\n onStepChange,\n loop = false,\n}: UseStepperOptions): UseStepperResult {\n const [internalStep, setInternalStep] = useState(() => clampStep(initialStep, count));\n const isControlled = controlledStep !== undefined;\n const step = isControlled ? clampStep(controlledStep, count) : internalStep;\n\n const setStep = (next: number) => {\n const clamped = clampStep(next, count);\n if (!isControlled) setInternalStep(clamped);\n onStepChange?.(clamped);\n };\n\n const next = () => {\n if (step >= count - 1) {\n if (loop) setStep(0);\n return;\n }\n setStep(step + 1);\n };\n\n const prev = () => {\n if (step <= 0) {\n if (loop) setStep(count - 1);\n return;\n }\n setStep(step - 1);\n };\n\n return {\n step,\n count,\n isFirst: step === 0,\n isLast: step === count - 1,\n next,\n prev,\n goTo: setStep,\n reset: () => setStep(initialStep),\n };\n}\n","import { useEffect, type RefObject } from 'react';\n\n/** Fires `handler` on any `mousedown`/`touchstart` outside `ref.current`.\n * No effect while `ref.current` is null or `enabled` is false — callers\n * don't need to guard call sites where the ref isn't attached yet (e.g.\n * before a portal mounts). */\nexport function useOnOutsideClick(\n ref: RefObject<HTMLElement | null> | null | undefined,\n handler: (event: MouseEvent | TouchEvent) => void,\n enabled = true,\n): void {\n useEffect(() => {\n if (!enabled) return;\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref?.current;\n if (!el || el.contains(event.target as Node)) return;\n handler(event);\n };\n\n document.addEventListener('mousedown', listener);\n document.addEventListener('touchstart', listener);\n return () => {\n document.removeEventListener('mousedown', listener);\n document.removeEventListener('touchstart', listener);\n };\n }, [ref, handler, enabled]);\n}\n","import { useEffect } from 'react';\n\n/** Fires `onEscape` when the user presses `Escape`, anywhere in the\n * document — not scoped to a container, matching how dismissible\n * overlays (menus, drawers, popovers) listen for it today. */\nexport function useEscapeKey(onEscape: () => void, enabled = true): void {\n useEffect(() => {\n if (!enabled) return;\n\n const listener = (event: KeyboardEvent) => {\n if (event.key === 'Escape') onEscape();\n };\n\n document.addEventListener('keydown', listener);\n return () => document.removeEventListener('keydown', listener);\n }, [onEscape, enabled]);\n}\n","import { useEffect } from 'react';\n\nlet lockCount = 0;\nlet previousOverflow = '';\n\n/** Locks `document.body` scrolling while `active`, restoring whatever\n * `overflow` value was set before the first lock once the last active\n * caller deactivates. Reference-counted across concurrent callers (e.g.\n * a drawer opened from within a modal) so one overlay closing early\n * never clobbers another's lock. */\nexport function useHideBodyScroll(active: boolean): void {\n useEffect(() => {\n if (!active) return;\n\n if (lockCount === 0) {\n previousOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n lockCount += 1;\n\n return () => {\n lockCount -= 1;\n if (lockCount === 0) {\n document.body.style.overflow = previousOverflow;\n }\n };\n }, [active]);\n}\n","import { useEffect, useState } from 'react';\n\nconst DEFAULT_BREAKPOINT = 768;\n\n/** True when the viewport is at or below `breakpoint` (default 768px).\n * Returns `false` during SSR and during the very first client render —\n * the effect computes and syncs the real value right after mount, so\n * the server-rendered markup and the client's first render always\n * agree (no hydration mismatch), at the cost of one extra render after\n * mount when the viewport actually is narrow. Subscribes to the media\n * query's `change` event rather than `window.resize`, so it only\n * re-renders when the mobile/desktop boundary is actually crossed. */\nexport function useIsMobile(breakpoint: number = DEFAULT_BREAKPOINT): boolean {\n const [isMobile, setIsMobile] = useState(false);\n\n useEffect(() => {\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n const mediaQuery = window.matchMedia(`(max-width: ${breakpoint}px)`);\n const listener = () => setIsMobile(mediaQuery.matches);\n\n listener();\n mediaQuery.addEventListener('change', listener);\n return () => mediaQuery.removeEventListener('change', listener);\n }, [breakpoint]);\n\n return isMobile;\n}\n","import { useContext } from 'react';\nimport { FormContext, type FormContextValue } from '../lib/FormContext';\n\n/** Reads the ambient form state provided by the nearest `FormContainer`.\n * Throws outside one, matching `FormField`'s existing null-check — the\n * same failure whether a consumer uses `FormField` or this hook\n * directly. */\nexport function useFormContext(): FormContextValue {\n const context = useContext(FormContext);\n if (!context) {\n throw new Error('useFormContext must be used inside a FormContainer.');\n }\n return context;\n}\n","import { useContext } from 'react';\nimport { FormContext, type FormContextValue } from '../lib/FormContext';\n\nconst noop = (() => undefined) as any;\n\nconst DEFAULT_FORM_CONTEXT: FormContextValue = {\n control: noop,\n register: noop,\n errors: {},\n setValue: noop,\n getValues: noop,\n watch: noop,\n reset: noop,\n trigger: noop,\n clearErrors: noop,\n setError: noop,\n getFieldState: noop,\n unregister: noop,\n isDirty: false,\n isSubmitted: false,\n isSubmitting: false,\n isValid: false,\n dirtyFields: {},\n submit: noop,\n};\n\n/** Reads the ambient form state provided by the nearest `FormContainer` —\n * the same context `useFormContext` reads — but never throws outside\n * one. Returns an inert default context instead, so call sites migrated\n * from an existing `useFormProps()` (e.g. an app's own hrm_ui_lib-shaped\n * shim) keep working without adding a null check. Prefer\n * `useFormContext` in new code, where a missing `FormContainer` is\n * usually a programmer error you want to surface immediately. */\nexport function useFormProps(): FormContextValue {\n const context = useContext(FormContext);\n return context ?? DEFAULT_FORM_CONTEXT;\n}\n","/**\n * Color primitives and semantic theme tokens.\n *\n * Ported from the People Space design system\n * (packages/design-system/src/tokens/colors.css + aliases.css) — this is\n * the source of truth for the design system's color palette. Values are\n * mirrored (by hand) into `src/styles/tokens.css` and `src/styles/theme.css`\n * as CSS custom properties, since the library ships a real Tailwind theme\n * rather than a JS-only token system.\n */\n\nexport const brand = {\n 900: '#31531C',\n 800: '#416E26',\n 700: '#518A2F',\n 600: '#61A539',\n 500: '#72BF44',\n 400: '#80C557',\n 300: '#8ECC69',\n 200: '#9CD27C',\n 100: '#AAD98F',\n 50: '#B8DFA2',\n 40: '#CAE7B9',\n 30: '#DBEFD1',\n 20: '#EDF7E8',\n} as const;\n\nexport const gray = {\n 900: '#0e121b',\n 800: '#222530',\n 700: '#2b303b',\n 600: '#525866',\n 500: '#717784',\n 400: '#99a0ae',\n 300: '#cacfd8',\n 200: '#e1e4ea',\n 100: '#f2f5f8',\n 50: '#f5f7fa',\n 20: '#f7f9fc',\n} as const;\n\nexport const white = '#FEFEFE';\n\nexport const green = {\n 900: '#0b4627',\n 800: '#0f5c33',\n 700: '#3D8B46',\n 600: '#199754',\n 500: '#1fc16b',\n 400: '#5ed495',\n 300: '#83dfae',\n 200: '#aeeacb',\n 100: '#d0f5e1',\n 50: '#e0faec',\n} as const;\n\nexport const blue = {\n 900: '#2443B8',\n 800: '#2E63D6',\n 700: '#3475E8',\n 600: '#3C88F7',\n 500: '#4396F7',\n 400: '#54A6F8',\n 300: '#71B6F9',\n 200: '#9ACAFA',\n 100: '#C1DEFC',\n 50: '#E6F2FE',\n} as const;\n\nexport const purple = {\n 900: '#081FA6',\n 800: '#0E2AB2',\n 700: '#2431B9',\n 600: '#3838C1',\n 500: '#453DC7',\n 400: '#6559D0',\n 300: '#8377D7',\n 200: '#A89DE2',\n 100: '#CBC4ED',\n 50: '#EAE7F7',\n 20: '#F5F3FB',\n} as const;\n\nexport const pink = {\n 900: '#4A0A20',\n 800: '#79012F',\n 700: '#A2023F',\n 600: '#AD0244',\n 500: '#CA024F',\n 400: '#F50260',\n 300: '#FD2779',\n 200: '#FE7DAF',\n 100: '#FEA8C9',\n 50: '#FFD4E4',\n} as const;\n\nexport const red = {\n 900: '#8b1822',\n 800: '#ad1f2b',\n 700: '#d02533',\n 600: '#e93544',\n 500: '#fb3748',\n 400: '#ff6875',\n 300: '#ff97a0',\n 200: '#ffc0c5',\n 100: '#ffd5d8',\n 50: '#ffebec',\n 20: '#fff4f4',\n} as const;\n\nexport const yellow = {\n 900: '#EB7520',\n 800: '#ED912A',\n 700: '#EEA02F',\n 600: '#F0B134',\n 500: '#F1BE39',\n 400: '#F2C74A',\n 300: '#F4D264',\n 200: '#F7DE8E',\n 100: '#FAEBB9',\n 50: '#FDF7E4',\n} as const;\n\nexport const colorPrimitives = { brand, gray, green, blue, purple, pink, red, yellow } as const;\n\nexport type ColorScale = typeof gray;\nexport type ColorPrimitives = typeof colorPrimitives;\n\n/**\n * Semantic aliases — components and consumer apps reference these, never\n * the raw scales above directly. Mirrors src/styles/theme.css.\n */\nexport const lightTheme = {\n bgDefault: white,\n bgContainer: gray[50],\n bgSubtle: gray[100],\n bgBrandLighter: brand[20],\n bgInfoLighter: blue[50],\n bgSuccessLighter: green[50],\n bgWarningLighter: yellow[50],\n bgDangerLighter: red[50],\n\n fgDefault: gray[900],\n fgSecondary: gray[600],\n fgTertiary: gray[500],\n fgDisabled: gray[400],\n fgInverse: white,\n fgBrand: brand[500],\n fgInfo: blue[600],\n fgSuccess: green[600],\n fgWarning: yellow[800],\n fgDanger: red[800],\n\n borderDefault: gray[200],\n borderSubtle: gray[100],\n borderStrong: gray[300],\n borderBrand: brand[500],\n\n iconPrimary: gray[900],\n iconSecondary: gray[600],\n iconInverse: white,\n iconBrand: brand[500],\n iconInfo: blue[600],\n iconDanger: red[800],\n iconWarning: yellow[800],\n} as const;\n\nexport const darkTheme = {\n ...lightTheme,\n bgDefault: '#0B1120',\n bgContainer: '#0F172A',\n bgSubtle: '#121C30',\n bgBrandLighter: 'rgba(114, 191, 68, 0.15)',\n bgInfoLighter: 'rgba(67, 150, 247, 0.15)',\n bgSuccessLighter: 'rgba(31, 193, 107, 0.15)',\n bgWarningLighter: 'rgba(237, 145, 42, 0.15)',\n bgDangerLighter: 'rgba(230, 27, 0, 0.15)',\n\n fgDefault: white,\n fgSecondary: gray[400],\n fgTertiary: gray[500],\n fgDisabled: gray[600],\n\n borderDefault: 'rgba(255, 255, 255, 0.05)',\n borderSubtle: 'rgba(255, 255, 255, 0.03)',\n borderStrong: 'rgba(255, 255, 255, 0.10)',\n\n iconPrimary: white,\n iconSecondary: gray[400],\n} as const;\n\nexport type SemanticTheme = typeof lightTheme;\n","/**\n * Typography tokens, mirrored as `--text-*` / `--font-*` in\n * src/styles/tokens.css. Ported from the People Space design system\n * (packages/design-system/src/tokens/typography.css). Sizes are paired\n * with their line-height; weight is composed separately via Tailwind's\n * default `font-*` utilities.\n */\nexport const fontFamily = {\n ps: ['Noto Sans Armenian', 'Noto Sans', 'ui-sans-serif', 'system-ui', 'sans-serif'],\n sans: ['Noto Sans Armenian', 'Noto Sans', 'ui-sans-serif', 'system-ui', 'sans-serif'],\n} as const;\n\nexport const headline = {\n xl: { fontSize: '64px', lineHeight: '72px' },\n lg: { fontSize: '48px', lineHeight: '56px' },\n md: { fontSize: '40px', lineHeight: '48px' },\n std: { fontSize: '36px', lineHeight: '44px' },\n sm: { fontSize: '32px', lineHeight: '40px' },\n xs: { fontSize: '24px', lineHeight: '32px' },\n} as const;\n\nexport const paragraph = {\n lg: { fontSize: '20px', lineHeight: '28px' },\n md: { fontSize: '16px', lineHeight: '24px' },\n std: { fontSize: '14px', lineHeight: '20px' },\n sm: { fontSize: '12px', lineHeight: '16px' },\n xs: { fontSize: '10px', lineHeight: '14px' },\n} as const;\n\nexport const label = {\n lg: { fontSize: '20px', lineHeight: '28px' },\n md: { fontSize: '16px', lineHeight: '24px' },\n std: { fontSize: '14px', lineHeight: '20px' },\n sm: { fontSize: '12px', lineHeight: '16px' },\n xs: { fontSize: '10px', lineHeight: '14px' },\n xxs: { fontSize: '6px', lineHeight: '6px' },\n} as const;\n\nexport const typography = { headline, paragraph, label } as const;\n","/**\n * Component-level sizing tokens (control heights, icon sizes).\n * General layout spacing intentionally reuses Tailwind's default 4px scale\n * rather than redefining it here — same convention as the People Space\n * design system (packages/design-system/src/tokens/spacing.css), which\n * documents an 8px rhythm (p-2, p-4, p-6, p-8...) on top of that scale\n * without overriding any token.\n */\nexport const controlHeight = {\n sm: '2rem',\n md: '2.5rem',\n lg: '3rem',\n} as const;\n\nexport const iconSize = {\n sm: '0.875rem',\n md: '1rem',\n lg: '1.25rem',\n} as const;\n","/**\n * Border radii, mirrored as `--radius-*` in src/styles/tokens.css. Ported\n * from the People Space design system (packages/design-system/src/tokens/radii.css)\n * as a fixed step scale rather than a single calc()-derived base value.\n */\nexport const radius = {\n xs: '2px',\n sm: '4px',\n md: '8px',\n lg: '12px',\n xl: '16px',\n '2xl': '20px',\n '3xl': '24px',\n full: '9999px',\n} as const;\n","/**\n * Elevation scale, mirrored as `--shadow-z*` in src/styles/tokens.css.\n * Ported from the People Space design system\n * (packages/design-system/src/tokens/shadows.css) — z4 verified from\n * Figma, others interpolated.\n */\nexport const shadows = {\n z1: '0 1px 2px 0 rgba(0, 0, 0, 0.06)',\n z2: '0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px 0 rgba(0, 0, 0, 0.04)',\n z3: '0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 2px 4px 0 rgba(0, 0, 0, 0.04)',\n z4: '0 1px 4px 0 rgba(0, 0, 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