@dev-dga/react 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +5 -5
- package/dist/index.cjs +1364 -100
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +403 -15
- package/dist/index.d.ts +403 -15
- package/dist/index.js +1356 -133
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/Button/Button.tsx","../src/utils/cn.ts","../src/components/Spinner/Spinner.tsx","../src/components/Input/Input.tsx","../src/field/use-field-a11y.ts","../src/field/FieldMessage.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Checkbox/Checkbox.tsx","../src/internal/icons/index.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Select/Select.tsx","../src/providers/DgaContext.ts","../src/components/Card/Card.tsx","../src/components/Badge/Badge.tsx","../src/components/Divider/Divider.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Alert/Alert.tsx","../src/components/Modal/Modal.tsx","../src/components/Toast/Toast.tsx","../src/components/Toast/toast-store.ts","../src/components/Tabs/Tabs.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Pagination/Pagination.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Steps/Steps.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Progress/Progress.tsx","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/Drawer/Drawer.tsx","../src/components/Combobox/Combobox.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/FileUpload/FileUpload.tsx","../src/components/Slider/Slider.tsx","../src/components/NumberInput/NumberInput.tsx","../src/components/Rating/Rating.tsx","../src/components/Toggle/Toggle.tsx","../src/components/DescriptionList/DescriptionList.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Stat/Stat.tsx","../src/components/Stat/StatGroup.tsx","../src/components/Popover/Popover.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/Sidebar/SidebarContext.ts","../src/components/Sidebar/useIsMobile.ts","../src/components/Sidebar/SidebarGroup.tsx","../src/components/Sidebar/SidebarMenu.tsx","../src/hooks/useDir.ts","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Menubar/Menubar.tsx","../src/components/Timeline/Timeline.tsx","../src/providers/DgaProvider.tsx"],"sourcesContent":["export { Button, buttonVariants, type ButtonProps } from './components/Button';\nexport { Input, inputVariants, type InputProps } from './components/Input';\nexport { Textarea, textareaVariants, type TextareaProps } from './components/Textarea';\nexport { Checkbox, checkboxVariants, type CheckboxProps } from './components/Checkbox';\nexport {\n RadioGroup,\n Radio,\n radioGroupVariants,\n radioVariants,\n type RadioGroupProps,\n type RadioProps,\n} from './components/Radio';\nexport { Switch, switchVariants, type SwitchProps } from './components/Switch';\nexport {\n Select,\n SelectItem,\n selectTriggerVariants,\n type SelectProps,\n type SelectItemProps,\n} from './components/Select';\nexport {\n Card,\n CardImage,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n type CardProps,\n type CardImageProps,\n type CardSectionProps,\n type CardTitleProps,\n type CardDescriptionProps,\n} from './components/Card';\nexport { Badge, badgeVariants, type BadgeProps } from './components/Badge';\nexport { Divider, dividerVariants, type DividerProps } from './components/Divider';\nexport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n AvatarGroup,\n avatarVariants,\n type AvatarProps,\n type AvatarImageProps,\n type AvatarFallbackProps,\n type AvatarGroupProps,\n type AvatarStatus,\n} from './components/Avatar';\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n tooltipContentVariants,\n type TooltipProps,\n type TooltipTriggerProps,\n type TooltipContentProps,\n} from './components/Tooltip';\nexport {\n Alert,\n AlertTitle,\n AlertDescription,\n alertVariants,\n type AlertProps,\n type AlertTitleProps,\n type AlertDescriptionProps,\n type AlertSectionProps,\n} from './components/Alert';\nexport {\n Modal,\n ModalTrigger,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n type ModalProps,\n type ModalTriggerProps,\n type ModalContentProps,\n type ModalSectionProps,\n type ModalTitleProps,\n type ModalDescriptionProps,\n type ModalCloseProps,\n} from './components/Modal';\nexport {\n Toaster,\n toast,\n toastStore,\n createToast,\n createToastStore,\n toastVariants,\n toastViewportVariants,\n type ToasterProps,\n type ToastPosition,\n type ToastVariant,\n type ToastData,\n type ToastOptions,\n type ToastAction,\n type ToastStore,\n} from './components/Toast';\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n tabsVariants,\n tabsListVariants,\n type TabsProps,\n type TabsListProps,\n type TabsTriggerProps,\n type TabsContentProps,\n} from './components/Tabs';\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n breadcrumbVariants,\n type BreadcrumbProps,\n type BreadcrumbListProps,\n type BreadcrumbItemProps,\n type BreadcrumbLinkProps,\n type BreadcrumbPageProps,\n type BreadcrumbSeparatorProps,\n type BreadcrumbEllipsisProps,\n} from './components/Breadcrumb';\nexport {\n Pagination,\n PaginationContent,\n PaginationItem,\n PaginationLink,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n paginationVariants,\n paginationLinkVariants,\n type PaginationProps,\n type PaginationContentProps,\n type PaginationItemProps,\n type PaginationLinkProps,\n type PaginationPreviousProps,\n type PaginationNextProps,\n type PaginationEllipsisProps,\n} from './components/Pagination';\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n accordionVariants,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n} from './components/Accordion';\nexport {\n Steps,\n Step,\n StepIndicator,\n StepTitle,\n StepDescription,\n stepsVariants,\n stepVariants,\n type StepsProps,\n type StepProps,\n type StepIndicatorProps,\n type StepTitleProps,\n type StepDescriptionProps,\n type StepState,\n} from './components/Steps';\nexport { Spinner, spinnerVariants, type SpinnerProps } from './components/Spinner';\nexport { Skeleton, skeletonVariants, type SkeletonProps } from './components/Skeleton';\nexport {\n Progress,\n CircularProgress,\n progressVariants,\n circularProgressVariants,\n type ProgressProps,\n type CircularProgressProps,\n} from './components/Progress';\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n dropdownMenuVariants,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioGroupProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuSubContentProps,\n} from './components/DropdownMenu';\nexport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n DrawerDescription,\n DrawerBody,\n DrawerFooter,\n DrawerClose,\n drawerVariants,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerContentProps,\n type DrawerSectionProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n type DrawerCloseProps,\n} from './components/Drawer';\nexport {\n Combobox,\n ComboboxItem,\n ComboboxGroup,\n ComboboxSeparator,\n comboboxTriggerVariants,\n comboboxVariants,\n type ComboboxProps,\n type ComboboxItemProps,\n type ComboboxGroupProps,\n type ComboboxSeparatorProps,\n} from './components/Combobox';\nexport { DatePicker, datePickerVariants, type DatePickerProps } from './components/DatePicker';\nexport {\n FileUpload,\n type FileUploadProps,\n type UploadFile,\n type FileRejection,\n type FileStatus,\n type RejectionCode,\n} from './components/FileUpload';\nexport { Slider, sliderVariants, type SliderProps, type SliderValue } from './components/Slider';\nexport { NumberInput, numberInputVariants, type NumberInputProps } from './components/NumberInput';\nexport { Rating, ratingVariants, type RatingProps } from './components/Rating';\nexport {\n Toggle,\n ToggleGroup,\n ToggleGroupItem,\n toggleVariants,\n toggleGroupVariants,\n type ToggleProps,\n type ToggleGroupProps,\n type ToggleGroupItemProps,\n} from './components/Toggle';\nexport {\n DescriptionList,\n DescriptionItem,\n DescriptionTerm,\n DescriptionDetails,\n descriptionListVariants,\n type DescriptionListProps,\n type DescriptionItemProps,\n type DescriptionTermProps,\n type DescriptionDetailsProps,\n} from './components/DescriptionList';\nexport {\n EmptyState,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n emptyStateVariants,\n type EmptyStateProps,\n type EmptyStateMediaProps,\n type EmptyStateTitleProps,\n type EmptyStateDescriptionProps,\n type EmptyStateActionsProps,\n} from './components/EmptyState';\nexport {\n Stat,\n StatLabel,\n StatValue,\n StatChange,\n StatGroup,\n statVariants,\n statGroupVariants,\n type StatProps,\n type StatLabelProps,\n type StatValueProps,\n type StatChangeProps,\n type StatGroupProps,\n} from './components/Stat';\nexport {\n Popover,\n PopoverTrigger,\n PopoverAnchor,\n PopoverContent,\n PopoverClose,\n popoverContentVariants,\n type PopoverProps,\n type PopoverTriggerProps,\n type PopoverAnchorProps,\n type PopoverContentProps,\n type PopoverCloseProps,\n} from './components/Popover';\nexport {\n SidebarProvider,\n Sidebar,\n SidebarTrigger,\n SidebarRail,\n SidebarInset,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarSeparator,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarMenuSubButton,\n useSidebar,\n useIsMobile,\n sidebarMenuButtonVariants,\n sidebarMenuSubButtonVariants,\n type SidebarProviderProps,\n type SidebarProps,\n type SidebarTriggerProps,\n type SidebarInsetProps,\n type SidebarSectionProps,\n type SidebarContextValue,\n type SidebarGroupDivProps,\n type SidebarGroupActionProps,\n type SidebarMenuButtonProps,\n type SidebarMenuActionProps,\n type SidebarMenuSkeletonProps,\n type SidebarMenuSubButtonProps,\n} from './components/Sidebar';\nexport {\n ScrollArea,\n scrollAreaVariants,\n type ScrollAreaProps,\n type ScrollAreaOrientation,\n} from './components/ScrollArea';\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarGroup,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n menubarContentVariants,\n menubarTriggerVariants,\n type MenubarProps,\n type MenubarMenuProps,\n type MenubarTriggerProps,\n type MenubarContentProps,\n type MenubarItemProps,\n type MenubarCheckboxItemProps,\n type MenubarRadioGroupProps,\n type MenubarRadioItemProps,\n type MenubarLabelProps,\n type MenubarSeparatorProps,\n type MenubarGroupProps,\n type MenubarSubProps,\n type MenubarSubTriggerProps,\n type MenubarSubContentProps,\n} from './components/Menubar';\nexport {\n Timeline,\n TimelineItem,\n TimelineMarker,\n TimelineContent,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n timelineVariants,\n timelineMarkerVariants,\n type TimelineProps,\n type TimelineItemProps,\n type TimelineMarkerProps,\n type TimelineContentProps,\n type TimelineTitleProps,\n type TimelineDescriptionProps,\n type TimelineTimeProps,\n type TimelineStatus,\n} from './components/Timeline';\nexport { DgaProvider, type DgaProviderProps } from './providers/DgaProvider';\nexport { useDga } from './providers/DgaContext';\nexport { useDir } from './hooks/useDir';\nexport type { DgaTheme, PaletteName, ThemeColor } from '@dev-dga/tokens';\nexport {\n useFieldA11y,\n FieldMessage,\n type UseFieldA11yOptions,\n type FieldA11y,\n type FieldMessageProps,\n} from './field';\nexport { cn } from './utils/cn';\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\n\n// ─── 1. Variants (cva) ─── //\n\nconst buttonVariants = cva('ddga-button', {\n variants: {\n variant: {\n primary: 'ddga-button--primary',\n secondary: 'ddga-button--secondary',\n outline: 'ddga-button--outline',\n ghost: 'ddga-button--ghost',\n destructive: 'ddga-button--destructive',\n // Destructive sub-variants — match the DGA library's full destructive\n // family (des-primary maps to plain `destructive` above).\n 'destructive-outline': 'ddga-button--destructive-outline',\n 'destructive-subtle': 'ddga-button--destructive-subtle',\n 'destructive-ghost': 'ddga-button--destructive-ghost',\n },\n size: {\n sm: 'ddga-button--sm',\n md: 'ddga-button--md',\n lg: 'ddga-button--lg',\n icon: 'ddga-button--icon',\n 'icon-sm': 'ddga-button--icon-sm',\n },\n fullWidth: {\n true: 'ddga-button--full-width',\n },\n /**\n * Use on dark / branded colored backgrounds. Visually inverts non-filled\n * variants (`outline`, `ghost`, destructive's outline/ghost forms) so\n * text + border stay visible against the surface. Filled variants\n * (`primary`, `secondary`, `destructive`, `destructive-subtle`) ignore\n * it — they already carry their own background contrast.\n */\n inverted: {\n true: 'ddga-button--inverted',\n },\n },\n compoundVariants: [],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface ButtonProps extends React.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n /** Flip start/end icons horizontally in RTL (for chevrons, arrows, etc.) */\n iconFlip?: boolean;\n /**\n * Render as the single child element instead of a `<button>`. Lets consumers\n * compose Button with router links (`<Button asChild><Link href=\"…\">…</Link></Button>`)\n * without `<button><a>` invalid nesting.\n *\n * The `type` and native `disabled` attributes are dropped in this mode\n * (they're meaningless on non-button elements) , the disabled visual + a11y\n * state still works via `aria-disabled` + `tabIndex={-1}`. button.css\n * matches on `[aria-disabled='true']` alongside `:disabled` so the styling\n * applies on any element.\n *\n * Consumer remains responsible for preventing the underlying action when\n * disabled (e.g., calling `e.preventDefault()` in the Link's onClick),\n * since native `disabled` doesn't gate clicks on non-form-controls.\n */\n asChild?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Button({\n variant,\n size,\n fullWidth,\n inverted,\n loading,\n disabled,\n startIcon,\n endIcon,\n iconFlip,\n asChild,\n className,\n children,\n type = 'button',\n ...props\n}: ButtonProps) {\n // Dev-only: warn if icon-only button has no accessible name\n if (process.env.NODE_ENV === 'development' && (size === 'icon' || size === 'icon-sm')) {\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] Button with an icon-only size (size=\"icon\" or ' +\n '\"icon-sm\") requires an aria-label or aria-labelledby attribute ' +\n 'for screen reader accessibility.',\n );\n }\n }\n\n const isDisabled = disabled || loading;\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n return (\n <Comp\n // `type` and native `disabled` only apply to <button>. In asChild mode\n // the Slot's child could be <a>, <Link>, etc. , skip both attrs there\n // and lean on aria-disabled + tabIndex for the disabled state.\n {...(asChild ? {} : { type, disabled: isDisabled })}\n {...(asChild && isDisabled ? { tabIndex: -1 } : {})}\n // Both `disabled` and `aria-disabled` are set in button mode (native +\n // explicit ARIA signal). In asChild mode, `aria-disabled` is the only\n // disabled signal a11y consumers can read on a non-form-control.\n aria-disabled={isDisabled || undefined}\n aria-busy={loading || undefined}\n data-slot=\"button\"\n className={cn(\n buttonVariants({ variant, size, fullWidth, inverted }),\n loading && 'ddga-button--loading',\n className,\n )}\n {...props}\n >\n {loading && <Spinner aria-hidden=\"true\" />}\n {!loading && startIcon && (\n <span className={cn('ddga-button__icon', iconFlip && 'ddga-icon-flip')} aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {asChild ? (\n // children IS the consumer's single element (e.g. <Link>). Slottable\n // marks where THAT element's original children should land , without\n // it the icons would replace the link text entirely.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children != null && children !== '' && <span className=\"ddga-button__text\">{children}</span>\n )}\n {!loading && endIcon && (\n <span className={cn('ddga-button__icon', iconFlip && 'ddga-icon-flip')} aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","import { clsx, type ClassValue } from 'clsx';\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst spinnerVariants = cva('ddga-spinner', {\n variants: {\n size: {\n sm: 'ddga-spinner--sm',\n md: 'ddga-spinner--md',\n lg: 'ddga-spinner--lg',\n },\n },\n});\n\ntype SpinnerProps = Omit<React.SVGProps<SVGSVGElement>, 'children'> &\n VariantProps<typeof spinnerVariants> & {\n /**\n * Accessible label announced by screen readers. Defaults to \"Loading\".\n * Pass `aria-hidden=\"true\"` (e.g. inside a Button that already has its\n * own label) to suppress.\n */\n 'aria-label'?: string;\n };\n\nfunction Spinner({ size, className, 'aria-label': ariaLabel, ...props }: SpinnerProps) {\n const hidden = props['aria-hidden'] === true || props['aria-hidden'] === 'true';\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={hidden ? undefined : 'status'}\n aria-label={hidden ? undefined : (ariaLabel ?? 'Loading')}\n data-slot=\"spinner\"\n className={cn(spinnerVariants({ size }), className)}\n {...props}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\nexport { Spinner, spinnerVariants };\nexport type { SpinnerProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the *control* (the bordered box), not the raw <input>. The\n// control owns the border, sizing, focus ring and disabled/error styling\n// so leading/trailing adornments sit inside the field.\nconst inputVariants = cva('ddga-input', {\n variants: {\n size: {\n sm: 'ddga-input--sm',\n md: 'ddga-input--md',\n lg: 'ddga-input--lg',\n },\n error: {\n true: 'ddga-input--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// `Omit<…, 'size'>`: the native HTML `size` attribute (visible character\n// width, a number) collides with our design-system `size` variant. The\n// variant is far more useful; drop the rarely-used native attribute.\ninterface InputProps\n extends Omit<React.ComponentProps<'input'>, 'size'>, VariantProps<typeof inputVariants> {\n /** Visible field label, auto-associated to the input via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n /**\n * Content rendered inside the field, before the input (icon or short text,\n * e.g. a search glyph or `https://`). May be interactive , it is NOT\n * `aria-hidden`. Mark purely-decorative icons `aria-hidden` yourself.\n */\n startAdornment?: ReactNode;\n /**\n * Content rendered inside the field, after the input. Compose a clear\n * button or password-reveal toggle here with `<Button size=\"icon-sm\">`\n * , the 28px in-field icon size that fits the field without overflow.\n */\n endAdornment?: ReactNode;\n}\n\n// ─── 3. Component ─── //\n\nfunction Input({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n startAdornment,\n endAdornment,\n className,\n ...props\n}: InputProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Input',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"input-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-input__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-input__required\">\n *\n </span>\n )}\n </label>\n )}\n <div\n data-slot=\"input-control\"\n className={cn(inputVariants({ size, error: hasError }), className)}\n >\n {startAdornment != null && startAdornment !== '' && (\n <span\n data-slot=\"input-adornment\"\n className=\"ddga-input__adornment ddga-input__adornment--start\"\n >\n {startAdornment}\n </span>\n )}\n <input\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"input\"\n required={required}\n className=\"ddga-input__field\"\n />\n {endAdornment != null && endAdornment !== '' && (\n <span\n data-slot=\"input-adornment\"\n className=\"ddga-input__adornment ddga-input__adornment--end\"\n >\n {endAdornment}\n </span>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Input, inputVariants };\nexport type { InputProps };\n","import { useId, type ReactNode } from 'react';\n\n// Public field-primitive hook. Owns id generation, error/helper precedence,\n// control ARIA wiring, and the dev-time a11y warning so library form\n// controls (Input / Textarea / Checkbox / future Radio / Switch / Select)\n// and consumer-built custom fields share one source of truth.\n\nexport interface UseFieldA11yOptions {\n /** Component name used in the dev warning, e.g. `'Input'`. */\n name: string;\n /** Caller-supplied id; falls back to a stable generated one. */\n id?: string;\n label?: ReactNode;\n error?: boolean;\n errorMessage?: ReactNode;\n helperText?: ReactNode;\n /** From the consumer's props , used to suppress the no-label warning. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface FieldA11y {\n fieldId: string;\n helperId: string;\n errorId: string;\n hasError: boolean;\n hasErrorMessage: boolean;\n hasHelper: boolean;\n /** Spread onto the control element (input / textarea / Radix root). */\n controlProps: {\n id: string;\n 'aria-invalid': true | undefined;\n 'aria-describedby': string | undefined;\n };\n}\n\nfunction isPresent(value: ReactNode): boolean {\n return value != null && value !== '';\n}\n\nexport function useFieldA11y(options: UseFieldA11yOptions): FieldA11y {\n // useId() is SSR-safe , stable across server/client, no hydration mismatch.\n const generatedId = useId();\n const fieldId = options.id ?? generatedId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n\n // A present errorMessage implies an invalid field. Gating on `error: true`\n // alone made `errorMessage=\"…\"` a silent no-op , a footgun. `error` is\n // still useful for the message-less invalid case (form-level validation\n // marking the field invalid without per-field copy).\n const hasError = !!options.error || isPresent(options.errorMessage);\n const hasErrorMessage = hasError && isPresent(options.errorMessage);\n // An error message replaces helper text (one description at a time).\n const hasHelper = !hasErrorMessage && isPresent(options.helperText);\n\n // Dev-only: warn if the field has no accessible name. This library makes\n // the accessible path the default across every form control.\n if (process.env.NODE_ENV === 'development' && !options.label) {\n if (!options['aria-label'] && !options['aria-labelledby']) {\n console.warn(\n `[@dev-dga/react] ${options.name} requires a \\`label\\`, or an ` +\n 'aria-label / aria-labelledby attribute, for screen reader accessibility.',\n );\n }\n }\n\n return {\n fieldId,\n helperId,\n errorId,\n hasError,\n hasErrorMessage,\n hasHelper,\n controlProps: {\n id: fieldId,\n 'aria-invalid': hasError || undefined,\n 'aria-describedby': hasErrorMessage ? errorId : hasHelper ? helperId : undefined,\n },\n };\n}\n","import type { ReactNode } from 'react';\n\n// Public field-primitive component. The helper / error line below a form\n// control. Identical markup and styling across Input / Textarea / Checkbox,\n// and available to consumers composing custom fields on top of useFieldA11y.\n// No 'use client': pure markup, no hooks or client APIs.\n\nexport interface FieldMessageProps {\n id: string;\n /** `error` announces politely; `helper` is static. */\n variant: 'error' | 'helper';\n children: ReactNode;\n}\n\nexport function FieldMessage({ id, variant, children }: FieldMessageProps) {\n return (\n <p\n id={id}\n data-slot={`field-${variant}`}\n className={`ddga-field__message ddga-field__message--${variant}`}\n // Polite (not assertive): an assertive error interrupts the user\n // mid-interaction, the wrong UX for field-level validation.\n aria-live={variant === 'error' ? 'polite' : undefined}\n >\n {children}\n </p>\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the <textarea> directly: unlike Input there are no adornments,\n// so the field owns its own border / focus ring / state styling , no\n// control wrapper needed.\nconst textareaVariants = cva('ddga-textarea', {\n variants: {\n size: {\n sm: 'ddga-textarea--sm',\n md: 'ddga-textarea--md',\n lg: 'ddga-textarea--lg',\n },\n error: {\n true: 'ddga-textarea--error',\n },\n // Horizontal/both resize breaks form layout (same reason it's not the\n // default) , only vertical or locked are offered.\n resize: {\n vertical: 'ddga-textarea--resize-vertical',\n none: 'ddga-textarea--resize-none',\n },\n },\n defaultVariants: {\n size: 'md',\n resize: 'vertical',\n },\n});\n\n// ─── 2. Types ─── //\n\n// `<textarea>` has no native `size` attribute (unlike `<input>`), so the\n// cva `size` variant doesn't collide , no `Omit` needed.\ninterface TextareaProps\n extends React.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {\n /** Visible field label, auto-associated to the textarea via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Textarea({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n resize,\n required,\n rows = 3,\n className,\n ...props\n}: TextareaProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Textarea',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"textarea-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-textarea__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-textarea__required\">\n *\n </span>\n )}\n </label>\n )}\n <textarea\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"textarea\"\n rows={rows}\n required={required}\n className={cn(textareaVariants({ size, error: hasError, resize }), className)}\n />\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Textarea, textareaVariants };\nexport type { TextareaProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, Minus } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Root (the role=checkbox button). Two sizes only ,\n// a \"lg\" checkbox is unusual; keep the surface honest.\nconst checkboxVariants = cva('ddga-checkbox', {\n variants: {\n size: {\n sm: 'ddga-checkbox--sm',\n md: 'ddga-checkbox--md',\n },\n error: {\n true: 'ddga-checkbox--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the state model (checked / defaultChecked / onCheckedChange /\n// indeterminate via checked=\"indeterminate\" / disabled / required / name /\n// value). We add the composed label + helper/error + a11y wiring. `children`\n// is omitted , the indicator is rendered internally.\ninterface CheckboxProps\n extends\n Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, 'children'>,\n VariantProps<typeof checkboxVariants> {\n /** Visible label, sits beside the box, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the row. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the row when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Checkbox({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n className,\n ...props\n}: CheckboxProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Checkbox',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"checkbox-field\" className=\"ddga-field\">\n <div className=\"ddga-checkbox-row\">\n <CheckboxPrimitive.Root\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"checkbox\"\n required={required}\n className={cn(checkboxVariants({ size, error: hasError }), className)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"ddga-checkbox__indicator\"\n >\n {/* Both render inside the indicator (which only mounts when\n checked or indeterminate); CSS picks one via Root data-state. */}\n <Check className=\"ddga-checkbox__check\" aria-hidden=\"true\" />\n <Minus className=\"ddga-checkbox__minus\" aria-hidden=\"true\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-checkbox__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-checkbox__required\">\n *\n </span>\n )}\n </label>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Checkbox, checkboxVariants };\nexport type { CheckboxProps };\n","'use client';\n\n/**\n * Internal checkmark icon , used by Checkbox (checked state).\n * Not exported from the public API.\n */\nexport function Check(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/**\n * Internal minus/dash icon , used by Checkbox (indeterminate state).\n * Not exported from the public API.\n */\nexport function Minus(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/**\n * Internal info circle icon — used by Alert (info/default variant).\n * Not exported from the public API.\n */\nexport function Info(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/**\n * Internal warning triangle icon — used by Alert (warning variant).\n * Not exported from the public API.\n */\nexport function AlertTriangle(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/**\n * Internal alert circle icon — used by Alert (destructive variant).\n * Not exported from the public API.\n */\nexport function AlertCircle(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/**\n * Internal close (X) icon — used by Alert (dismissible).\n * Not exported from the public API.\n */\nexport function Close(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-down icon , used by Select (trigger affordance).\n * Not exported from the public API.\n */\nexport function ChevronDown(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-right icon — used by Breadcrumb (default separator).\n * Points inline-end-ward; the consumer-facing component flips it via CSS in\n * RTL (`[dir='rtl'] .ddga-breadcrumb__separator { transform: scaleX(-1); }`).\n * Not exported from the public API.\n */\nexport function ChevronRight(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-left icon — used by DatePicker (previous-month nav).\n * The Calendar's prev/next buttons are positional (react-aria handles the\n * RTL swap via slot), so this points left in both LTR and RTL.\n * Not exported from the public API.\n */\nexport function ChevronLeft(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal calendar icon — used by DatePicker (popover trigger).\n * Not exported from the public API.\n */\nexport function CalendarIcon(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" />\n <line x1=\"16\" x2=\"16\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"6\" />\n <line x1=\"3\" x2=\"21\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}\n\n/**\n * Internal more-horizontal (•••) icon — used by Breadcrumb (ellipsis).\n * Not exported from the public API.\n */\nexport function MoreHorizontal(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <circle cx=\"5\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"19\" cy=\"12\" r=\"1.5\" />\n </svg>\n );\n}\n\n/**\n * Internal plus icon — used by NumberInput (increment stepper).\n * Not exported from the public API.\n */\nexport function Plus(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M12 5v14\" />\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/**\n * Internal solid star icon — used by Rating (filled + empty stars share the\n * shape; color differs). Not exported from the public API.\n */\nexport function Star(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" />\n </svg>\n );\n}\n\n/**\n * Internal upload (cloud-up / tray-with-arrow) icon — used by FileUpload\n * (drop-zone affordance). Not exported from the public API.\n */\nexport function Upload(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"M17 8l-5-5-5 5\" />\n <path d=\"M12 3v12\" />\n </svg>\n );\n}\n\n/**\n * Internal inbox/tray icon — used by EmptyState (default variant).\n * Not exported from the public API.\n */\nexport function Inbox(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M22 12h-6l-2 3h-4l-2-3H2\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/**\n * Internal search/magnifier icon — used by EmptyState (search variant).\n * Not exported from the public API.\n */\nexport function Search(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/**\n * Internal solid up-triangle — used by Stat (upward trend). RTL-neutral\n * (vertical semantics, no horizontal mirroring). Not exported from the public API.\n */\nexport function CaretUp(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 8-6 8h12z\" />\n </svg>\n );\n}\n\n/**\n * Internal solid down-triangle — used by Stat (downward trend). RTL-neutral.\n * Not exported from the public API.\n */\nexport function CaretDown(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 16 6-8H6z\" />\n </svg>\n );\n}\n\n/**\n * Internal home icon — used by Sidebar stories (navigation example).\n * RTL-neutral (a symmetric house glyph). Not exported from the public API.\n */\nexport function Home(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n <path d=\"M9 22V12h6v10\" />\n </svg>\n );\n}\n\n/**\n * Internal panel-left icon — used by SidebarTrigger (toggle affordance).\n * Depicts a two-panel layout with the left panel highlighted.\n * Not exported from the public API.\n */\nexport function PanelLeft(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n","'use client';\n\nimport { useId, type ReactNode } from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix RadioGroup.Root (role=radiogroup). Owns size,\n// orientation, and the error class , child <Radio>s pick up size + error\n// via CSS cascade from `.ddga-radio-group--sm` / `.ddga-radio-group--error`\n// (one source of truth on the group, not threaded through items).\nconst radioGroupVariants = cva('ddga-radio-group', {\n variants: {\n size: {\n sm: 'ddga-radio-group--sm',\n md: 'ddga-radio-group--md',\n },\n orientation: {\n vertical: 'ddga-radio-group--vertical',\n horizontal: 'ddga-radio-group--horizontal',\n },\n error: {\n true: 'ddga-radio-group--error',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'vertical',\n },\n});\n\n// Applied to the Radix RadioGroup.Item (role=radio). No variants here ,\n// size / error cascade from the group; per-item disabled is native.\nconst radioVariants = cva('ddga-radio');\n\n// ─── 2. Types ─── //\n\n// Group: omit Radix's `orientation` so we can re-narrow it to our two\n// supported values (Radix accepts a wider set we don't need exposed).\ninterface RadioGroupProps\n extends\n Omit<React.ComponentProps<typeof RadioGroupPrimitive.Root>, 'children' | 'orientation'>,\n Pick<VariantProps<typeof radioGroupVariants>, 'size' | 'orientation'> {\n /** Group label, sits above the rows. Associated to the group via aria-labelledby. */\n label?: ReactNode;\n /** Hint shown below the group. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the group when `error` is true (or when only `errorMessage` is set). */\n errorMessage?: ReactNode;\n /** Marks the group invalid: sets aria-invalid and applies error styling. */\n error?: boolean;\n /** `<Radio>` children. */\n children: ReactNode;\n}\n\n// Item: omit children (the indicator is internal).\ninterface RadioProps extends Omit<\n React.ComponentProps<typeof RadioGroupPrimitive.Item>,\n 'children'\n> {\n /** Visible label for this radio, sits beside the circle, associated via htmlFor/id. */\n label?: ReactNode;\n}\n\n// ─── 3. Components ─── //\n\nfunction RadioGroup({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n orientation,\n required,\n className,\n children,\n ...props\n}: RadioGroupProps) {\n const { errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps, fieldId } =\n useFieldA11y({\n name: 'RadioGroup',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n // The group itself isn't a focusable form control , consumers don't need\n // `id` on the role=radiogroup, and `htmlFor`/`<label>` doesn't apply.\n // Associate the visible label via aria-labelledby instead.\n const labelId = `${fieldId}-label`;\n\n return (\n <div data-slot=\"radio-group-field\" className=\"ddga-field\">\n {label && (\n <span id={labelId} className=\"ddga-radio-group__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-radio-group__required\">\n *\n </span>\n )}\n </span>\n )}\n <RadioGroupPrimitive.Root\n {...props}\n aria-invalid={controlProps['aria-invalid']}\n aria-describedby={controlProps['aria-describedby']}\n aria-labelledby={label ? labelId : props['aria-labelledby']}\n orientation={orientation === 'horizontal' ? 'horizontal' : 'vertical'}\n required={required}\n data-slot=\"radio-group\"\n className={cn(radioGroupVariants({ size, orientation, error: hasError }), className)}\n >\n {children}\n </RadioGroupPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\nfunction Radio({ id: externalId, label, className, ...props }: RadioProps) {\n // useId() is SSR-safe; pair the Item id with its <label htmlFor>.\n const generatedId = useId();\n const itemId = externalId ?? generatedId;\n return (\n <div className=\"ddga-radio-row\">\n <RadioGroupPrimitive.Item\n // Spread props first, then our id last so a consumer can't clobber\n // the label/control association by accident.\n {...props}\n id={itemId}\n data-slot=\"radio\"\n className={cn(radioVariants(), className)}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-indicator\"\n className=\"ddga-radio__indicator\"\n >\n <span className=\"ddga-radio__dot\" aria-hidden=\"true\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n {label && (\n <label htmlFor={itemId} className=\"ddga-radio__label\">\n {label}\n </label>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { RadioGroup, Radio, radioGroupVariants, radioVariants };\nexport type { RadioGroupProps, RadioProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Switch.Root (role=switch). Two sizes only , a \"lg\"\n// switch is unusual; keep the surface honest. Matches Checkbox / Radio.\nconst switchVariants = cva('ddga-switch', {\n variants: {\n size: {\n sm: 'ddga-switch--sm',\n md: 'ddga-switch--md',\n },\n error: {\n true: 'ddga-switch--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the state model (checked / defaultChecked / onCheckedChange /\n// disabled / required / name / value). We add the composed label +\n// helper/error + a11y wiring. `children` is omitted , the thumb is rendered\n// internally.\ninterface SwitchProps\n extends\n Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, 'children'>,\n VariantProps<typeof switchVariants> {\n /** Visible label, sits beside the track, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the row. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the row when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Switch({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n className,\n ...props\n}: SwitchProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Switch',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"switch-field\" className=\"ddga-field\">\n <div className=\"ddga-switch-row\">\n <SwitchPrimitive.Root\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"switch\"\n required={required}\n className={cn(switchVariants({ size, error: hasError }), className)}\n >\n <SwitchPrimitive.Thumb data-slot=\"switch-thumb\" className=\"ddga-switch__thumb\" />\n </SwitchPrimitive.Root>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-switch__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-switch__required\">\n *\n </span>\n )}\n </label>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Switch, switchVariants };\nexport type { SwitchProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronDown } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Select.Trigger (the focusable button). Heights match\n// Input (32/36) so triggers and text inputs line up in a form row.\nconst selectTriggerVariants = cva('ddga-select-trigger', {\n variants: {\n size: {\n sm: 'ddga-select-trigger--sm',\n md: 'ddga-select-trigger--md',\n },\n error: {\n true: 'ddga-select-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// We expose a closed shape (Trigger + Portal + Content + Viewport are\n// rendered internally) , consumers compose with `<SelectItem>` children.\n// Power-user use cases (custom trigger, grouped options, separators) get\n// added when there's a real need; YAGNI for v1.\n//\n// Radix owns the state model (`value` / `defaultValue` / `onValueChange` /\n// `open` / `onOpenChange` / `name` / `disabled` / `required` / `form`)\n// via SelectPrimitive.Root. `dir` is intentionally omitted , the wrapping\n// `Direction.Provider` in <DgaProvider> propagates direction to the portal.\ninterface SelectProps\n extends\n Omit<React.ComponentProps<typeof SelectPrimitive.Root>, 'children' | 'dir'>,\n VariantProps<typeof selectTriggerVariants> {\n /** Visible label above the trigger, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the trigger. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n /** Placeholder shown in the trigger when no value is selected. */\n placeholder?: ReactNode;\n /** `<SelectItem>` children, rendered inside the dropdown panel. */\n children: ReactNode;\n /** Caller-supplied id for the trigger; falls back to a generated one. */\n id?: string;\n /** Forwarded to the trigger (the focusable control). */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\ninterface SelectItemProps extends React.ComponentProps<typeof SelectPrimitive.Item> {\n /** The visible label for this item. */\n children: ReactNode;\n}\n\n// ─── 3. Components ─── //\n\nfunction Select({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n placeholder,\n className,\n children,\n ...rootProps\n}: SelectProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Select',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': rootProps['aria-label'],\n 'aria-labelledby': rootProps['aria-labelledby'],\n });\n\n // Portal escape hatch: Radix mounts Select.Content under <body> by default,\n // which lives ABOVE DgaProvider's root in the DOM tree , so `data-theme`,\n // custom theme vars, and `.ddga-theme-*` classes set on that root never\n // reach the dropdown. Re-anchor the portal inside the root so CSS variable\n // inheritance just works (dark mode, theming, consumer overrides).\n // Falls back to <body> when used standalone (no provider).\n const ctx = useContext(DgaContext);\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <div data-slot=\"select-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-select__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-select__required\">\n *\n </span>\n )}\n </label>\n )}\n <SelectPrimitive.Root required={required} {...rootProps}>\n <SelectPrimitive.Trigger\n // Spread Trigger-only ARIA after the field a11y contract so the\n // describedby/invalid wiring isn't clobbered.\n {...controlProps}\n data-slot=\"select-trigger\"\n className={cn(selectTriggerVariants({ size, error: hasError }), className)}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild className=\"ddga-select__icon\">\n <ChevronDown aria-hidden=\"true\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className=\"ddga-select-content\"\n // popper positioning keeps the panel next to the trigger and\n // exposes --radix-select-trigger-width for size matching in CSS.\n position=\"popper\"\n sideOffset={4}\n >\n <SelectPrimitive.Viewport className=\"ddga-select-viewport\">\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n {...props}\n data-slot=\"select-item\"\n className={cn('ddga-select-item', className)}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator className=\"ddga-select-item__indicator\">\n <Check className=\"ddga-select-item__check\" aria-hidden=\"true\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Select, SelectItem, selectTriggerVariants };\nexport type { SelectProps, SelectItemProps };\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\nexport interface DgaContextValue {\n dir: 'ltr' | 'rtl';\n locale: string;\n mode: 'light' | 'dark';\n /**\n * The DgaProvider's rendered root element. Exposed for non-portaled\n * descendants that need to read theme attributes (e.g., layout decorators).\n *\n * **For overlay portals, prefer `portalEl`** — `rootEl` lives inside the\n * consumer's normal DOM tree and inherits any `overflow: hidden` /\n * `transform` ancestors. Inside Storybook's autodocs preview block (or any\n * scoped wrapper a consumer might wrap us in), portaling into `rootEl`\n * makes the overlay get clipped by the wrapper and breaks `position: fixed`\n * positioning (a `transform` ancestor establishes a new containing block).\n *\n * State (not ref) so subscribers re-render when the element mounts; a\n * useRef update wouldn't fire a render and `defaultOpen` portals would\n * race to the wrong target on first commit.\n */\n rootEl: HTMLElement | null;\n /**\n * Body-mounted portal container that mirrors this provider's theme\n * attributes (`data-theme`, `dir`) and CSS custom properties. Overlay\n * components (Modal / Drawer / DropdownMenu / Combobox / Select / Tooltip\n * / DatePicker) should portal into this so:\n *\n * 1. They escape any clipping (`overflow: hidden`) or transform ancestor\n * the consumer wraps the provider in.\n * 2. `position: fixed` semantics survive (no `transform` ancestor breaks\n * the viewport containing block).\n * 3. Theme inheritance still works — the container carries `data-theme`,\n * `dir`, and the same CSS variables as the provider's root, so\n * `var(--ddga-color-*)` lookups inside the portal resolve correctly.\n *\n * `null` until the DOM mount effect runs (e.g., during SSR or the very\n * first commit on the client). Components should fall back to `rootEl`\n * (and finally `document.body`) when this is null.\n */\n portalEl: HTMLElement | null;\n}\n\nexport const DgaContext = createContext<DgaContextValue | null>(null);\n\nexport function useDga(): DgaContextValue {\n const ctx = useContext(DgaContext);\n if (!ctx) {\n throw new Error('useDga must be used within a <DgaProvider>');\n }\n return ctx;\n}\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst cardVariants = cva('ddga-card', {\n variants: {\n variant: {\n default: 'ddga-card--default',\n outline: 'ddga-card--outline',\n elevated: 'ddga-card--elevated',\n filled: 'ddga-card--filled',\n gradient: 'ddga-card--gradient',\n ghost: 'ddga-card--ghost',\n },\n padding: {\n sm: 'ddga-card--padding-sm',\n md: 'ddga-card--padding-md',\n lg: 'ddga-card--padding-lg',\n },\n orientation: {\n vertical: 'ddga-card--vertical',\n horizontal: 'ddga-card--horizontal',\n },\n interactive: {\n true: 'ddga-card--interactive',\n },\n },\n defaultVariants: {\n variant: 'default',\n padding: 'md',\n orientation: 'vertical',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {\n /** Render as the single child element instead of a `<div>` (see Button). */\n asChild?: boolean;\n}\n\ntype CardSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface CardTitleProps extends React.ComponentProps<'h3'> {\n /** Override the heading element (e.g. render an `<h2>` or `<a>`). */\n asChild?: boolean;\n}\n\ntype CardDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\n\ninterface CardImageProps extends React.ComponentProps<'img'> {\n /**\n * Aspect ratio of the image in vertical orientation (e.g. `'16/9'`, `'4/3'`,\n * `'1/1'`). Default `'16/9'`. Ignored in horizontal orientation — the image\n * fills the card's full height there.\n */\n aspectRatio?: string;\n}\n\n// ─── 3. Components ─── //\n\nfunction Card({\n variant,\n padding,\n orientation,\n interactive,\n asChild,\n className,\n ...props\n}: CardProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"card\"\n data-orientation={orientation ?? 'vertical'}\n className={cn(cardVariants({ variant, padding, orientation, interactive }), className)}\n {...props}\n />\n );\n}\n\nfunction CardImage({ aspectRatio = '16/9', className, style, ...props }: CardImageProps) {\n return (\n <img\n data-slot=\"card-image\"\n className={cn('ddga-card__image', className)}\n style={\n {\n '--ddga-card-image-aspect': aspectRatio,\n ...style,\n } as React.CSSProperties\n }\n {...props}\n />\n );\n}\n\nfunction CardHeader({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"card-header\" className={cn('ddga-card__header', className)} {...props} />;\n}\n\nfunction CardTitle({ asChild, className, ...props }: CardTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h3';\n return <Comp data-slot=\"card-title\" className={cn('ddga-card__title', className)} {...props} />;\n}\n\nfunction CardDescription({ asChild, className, ...props }: CardDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"card-description\"\n className={cn('ddga-card__description', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"card-content\" className={cn('ddga-card__content', className)} {...props} />\n );\n}\n\nfunction CardFooter({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"card-footer\" className={cn('ddga-card__footer', className)} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Card,\n CardImage,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n};\nexport type { CardProps, CardImageProps, CardSectionProps, CardTitleProps, CardDescriptionProps };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\n// Two visual families:\n// - solid: filled background, white-on-color (high contrast, draws the eye)\n// - subtle: tinted background (color-100) + dark-color text (color-700/800)\n// - outline: bordered, transparent\n// Subtle is the right default for table cells / dense UI where solid would be\n// visually loud. Solid is the right default for hero badges / single status pills.\nconst badgeVariants = cva('ddga-badge', {\n variants: {\n variant: {\n // Solid family\n default: 'ddga-badge--default',\n primary: 'ddga-badge--primary',\n secondary: 'ddga-badge--secondary',\n destructive: 'ddga-badge--destructive',\n success: 'ddga-badge--success',\n warning: 'ddga-badge--warning',\n info: 'ddga-badge--info',\n // Subtle family (tonal)\n 'primary-subtle': 'ddga-badge--primary-subtle',\n 'secondary-subtle': 'ddga-badge--secondary-subtle',\n 'destructive-subtle': 'ddga-badge--destructive-subtle',\n 'success-subtle': 'ddga-badge--success-subtle',\n 'warning-subtle': 'ddga-badge--warning-subtle',\n 'info-subtle': 'ddga-badge--info-subtle',\n // Outline\n outline: 'ddga-badge--outline',\n },\n size: {\n sm: 'ddga-badge--sm',\n md: 'ddga-badge--md',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface BadgeProps extends React.ComponentProps<'span'>, VariantProps<typeof badgeVariants> {\n /** Render as the single child element instead of a `<span>` (see Button). */\n asChild?: boolean;\n /**\n * Render a leading status dot. The dot inherits its color from `currentColor`\n * so it tracks the badge's tone (subtle variants get a dark dot, solid get a\n * white dot). Pair with `*-subtle` variants for the classic status pill.\n * Coexists with `startIcon` — the dot lands first.\n */\n dot?: boolean;\n /** Icon rendered before the badge text. Sized to the badge font (0.875em). */\n startIcon?: ReactNode;\n /** Icon rendered after the badge text. Sized to the badge font (0.875em). */\n endIcon?: ReactNode;\n /**\n * Render a trailing close button — turns the badge into the DGA \"tag/chip\"\n * pattern. Uncontrolled by default: the badge hides itself when the close\n * button is clicked. Pass `open` to control visibility yourself.\n *\n * Not combinable with `asChild` — the consumer's slotted element (usually an\n * `<a>`) would end up with an interactive `<button>` inside it, which is\n * invalid HTML. In that combo the close button is suppressed and a dev\n * warning is logged.\n */\n dismissible?: boolean;\n /** Controlled visibility. When provided, `onDismiss` becomes the only signal. */\n open?: boolean;\n /** Fires when the close button is clicked, in both controlled and uncontrolled mode. */\n onDismiss?: () => void;\n /** Accessible label on the close button. Defaults to `\"Dismiss\"`. Override for i18n. */\n closeLabel?: string;\n}\n\n// ─── 3. Component ─── //\n\nfunction Badge({\n variant,\n size,\n asChild,\n dot,\n startIcon,\n endIcon,\n dismissible,\n open,\n onDismiss,\n closeLabel = 'Dismiss',\n className,\n children,\n ...props\n}: BadgeProps) {\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(true);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n if (process.env.NODE_ENV !== 'production' && asChild && dismissible) {\n console.warn(\n \"[Badge] `dismissible` is not supported with `asChild` because it would nest an interactive close button inside the consumer's element (invalid HTML). The close button will not render.\",\n );\n }\n\n if (!isOpen) return null;\n\n const Comp = asChild ? SlotPrimitive.Slot : 'span';\n const showClose = dismissible && !asChild;\n\n const handleDismiss = () => {\n if (!isControlled) setUncontrolledOpen(false);\n onDismiss?.();\n };\n\n return (\n <Comp data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props}>\n {dot ? <span className=\"ddga-badge__dot\" aria-hidden=\"true\" /> : null}\n {startIcon ? (\n <span className=\"ddga-badge__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n {asChild ? (\n // children IS the consumer's single element (e.g. <a>). Slottable marks\n // where THAT element's original children should land — without it the\n // dot/icons would replace the link text.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children\n )}\n {endIcon ? (\n <span className=\"ddga-badge__icon\" aria-hidden=\"true\">\n {endIcon}\n </span>\n ) : null}\n {showClose ? (\n <button\n type=\"button\"\n className=\"ddga-badge__close\"\n aria-label={closeLabel}\n onClick={handleDismiss}\n data-slot=\"badge-close\"\n >\n <Close aria-hidden=\"true\" />\n </button>\n ) : null}\n </Comp>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Badge, badgeVariants };\nexport type { BadgeProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst dividerVariants = cva('ddga-divider', {\n variants: {\n orientation: {\n horizontal: 'ddga-divider--horizontal',\n vertical: 'ddga-divider--vertical',\n },\n variant: {\n solid: 'ddga-divider--solid',\n dashed: 'ddga-divider--dashed',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n variant: 'solid',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface DividerProps\n extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof dividerVariants> {\n /**\n * Optional label rendered inside a horizontal divider. Ignored when\n * `orientation=\"vertical\"`. When set, the divider renders as a three-part\n * flex (line — label — line) instead of a single bar.\n */\n children?: React.ReactNode;\n /**\n * Where to place the label along the divider. Defaults to `center`. Ignored\n * when no label is provided. `start` and `end` are logical (LTR/RTL aware).\n */\n labelPosition?: 'start' | 'center' | 'end';\n /**\n * If `true`, the divider is treated as purely decorative and removed from\n * the accessibility tree (`role=\"none\"`). Defaults to `false`.\n */\n decorative?: boolean;\n}\n\n// ─── 3. Component ─── //\n//\n// Note: no `asChild`. A separator is either a plain bar (no children, nothing\n// to slot into) or a labeled bar (the label is its own slotted child, not the\n// root). The `asChild` escape hatch doesn't carry meaning for either shape.\n\nfunction Divider({\n orientation = 'horizontal',\n variant = 'solid',\n labelPosition = 'center',\n decorative = false,\n className,\n children,\n ...props\n}: DividerProps) {\n const isLabeled =\n orientation === 'horizontal' && children !== undefined && children !== null && children !== '';\n\n // WAI-ARIA: `separator` default orientation is horizontal, so only emit\n // `aria-orientation` when vertical. Decorative dividers drop role + aria entirely.\n const a11yProps = decorative\n ? { role: 'none' as const }\n : {\n role: 'separator' as const,\n ...(orientation === 'vertical' ? { 'aria-orientation': 'vertical' as const } : {}),\n };\n\n return (\n <div\n data-slot=\"divider\"\n data-orientation={orientation}\n className={cn(\n dividerVariants({ orientation, variant }),\n isLabeled && 'ddga-divider--labeled',\n isLabeled && `ddga-divider--label-${labelPosition}`,\n className,\n )}\n {...a11yProps}\n {...props}\n >\n {isLabeled ? <span className=\"ddga-divider__label\">{children}</span> : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Divider, dividerVariants };\nexport type { DividerProps };\n","'use client';\n\nimport { Children, isValidElement, cloneElement, type ReactElement } from 'react';\nimport { Avatar as AvatarPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst avatarVariants = cva('ddga-avatar', {\n variants: {\n size: {\n xs: 'ddga-avatar--xs',\n sm: 'ddga-avatar--sm',\n md: 'ddga-avatar--md',\n lg: 'ddga-avatar--lg',\n xl: 'ddga-avatar--xl',\n },\n shape: {\n circle: 'ddga-avatar--circle',\n square: 'ddga-avatar--square',\n },\n },\n defaultVariants: {\n size: 'md',\n shape: 'circle',\n },\n});\n\nconst fallbackVariants = cva('ddga-avatar__fallback', {\n variants: {\n colorScheme: {\n default: 'ddga-avatar__fallback--default',\n primary: 'ddga-avatar__fallback--primary',\n secondary: 'ddga-avatar__fallback--secondary',\n success: 'ddga-avatar__fallback--success',\n warning: 'ddga-avatar__fallback--warning',\n destructive: 'ddga-avatar__fallback--destructive',\n info: 'ddga-avatar__fallback--info',\n },\n },\n defaultVariants: {\n colorScheme: 'default',\n },\n});\n\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n\n// ─── 2. Types ─── //\n\ninterface AvatarProps\n extends React.ComponentProps<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {\n /**\n * Presence indicator rendered in the bottom-{end} corner. The color tracks\n * the status (online → success, busy → destructive, away → warning,\n * offline → muted). Position flips in RTL automatically via logical props.\n */\n status?: AvatarStatus;\n /**\n * Accessible label for the status indicator. Defaults to the status value\n * (e.g. \"online\"). Pass a localized string for non-English UIs.\n */\n statusLabel?: string;\n}\n\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ninterface AvatarFallbackProps\n extends\n React.ComponentProps<typeof AvatarPrimitive.Fallback>,\n VariantProps<typeof fallbackVariants> {}\n\ninterface AvatarGroupProps extends React.ComponentProps<'div'> {\n /**\n * Cap the number of visible Avatars. Excess children are collapsed into a\n * trailing \"+N\" chip. When unset, every child is rendered.\n */\n max?: number;\n /** Size cascaded to each child Avatar that doesn't already set its own size. */\n size?: VariantProps<typeof avatarVariants>['size'];\n /** Shape cascaded to each child Avatar that doesn't already set its own shape. */\n shape?: VariantProps<typeof avatarVariants>['shape'];\n}\n\n// ─── 3. Components ─── //\n\nfunction Avatar({ size, shape, status, statusLabel, className, children, ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-status={status}\n className={cn(avatarVariants({ size, shape }), className)}\n {...props}\n >\n {children}\n {status ? (\n <span\n className={cn('ddga-avatar__status', `ddga-avatar__status--${status}`)}\n role=\"status\"\n aria-label={statusLabel ?? status}\n />\n ) : null}\n </AvatarPrimitive.Root>\n );\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('ddga-avatar__image', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({ colorScheme, className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n data-color-scheme={colorScheme ?? 'default'}\n className={cn(fallbackVariants({ colorScheme }), className)}\n {...props}\n />\n );\n}\n\nfunction AvatarGroup({ max, size, shape, className, children, ...props }: AvatarGroupProps) {\n const all = Children.toArray(children).filter(isValidElement) as ReactElement<AvatarProps>[];\n const visible = max !== undefined && all.length > max ? all.slice(0, max) : all;\n const overflow = max !== undefined ? Math.max(0, all.length - max) : 0;\n\n // Cascade size/shape onto children that haven't set their own (parity with\n // RadioGroup → Radio). Don't clobber explicit child overrides.\n const cascaded = visible.map((child, i) =>\n cloneElement(child, {\n key: child.key ?? i,\n size: child.props.size ?? size,\n shape: child.props.shape ?? shape,\n }),\n );\n\n return (\n <div data-slot=\"avatar-group\" className={cn('ddga-avatar-group', className)} {...props}>\n {cascaded}\n {overflow > 0 ? (\n <Avatar size={size} shape={shape} aria-label={`${overflow} more`}>\n <AvatarFallback>+{overflow}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarGroup, avatarVariants, fallbackVariants };\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarGroupProps, AvatarStatus };\n","'use client';\n\nimport { useContext } from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\nconst tooltipContentVariants = cva('ddga-tooltip', {\n variants: {\n size: {\n sm: 'ddga-tooltip--sm',\n md: 'ddga-tooltip--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// We expose a closed compound shape that hides Radix's Provider/Portal/Arrow\n// details. `TooltipProvider` is already nested in `DgaProvider`, so consumers\n// don't need to add their own. The Portal container is wired from\n// `DgaContext.rootEl` (see DgaContext.ts) so the tooltip inherits `data-theme`\n// + custom theme classes set on the provider — without it, the tooltip would\n// silently mount under <body> and miss dark mode.\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>;\n\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;\n\ninterface TooltipContentProps\n extends\n Omit<React.ComponentProps<typeof TooltipPrimitive.Content>, 'asChild'>,\n VariantProps<typeof tooltipContentVariants> {\n /** Show a small arrow pointing at the trigger. Defaults to true. */\n arrow?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Tooltip(props: TooltipProps) {\n return <TooltipPrimitive.Root {...props} />;\n}\n\nfunction TooltipTrigger({ className, ...props }: TooltipTriggerProps) {\n // Radix Trigger already supports asChild natively — pass through.\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" className={className} {...props} />;\n}\n\nfunction TooltipContent({\n size,\n arrow = true,\n sideOffset = 6,\n className,\n children,\n ...props\n}: TooltipContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container.\n // Theme + dark mode inherit through mirrored data-theme/dir/CSS vars on\n // the portal element; using it (rather than the in-tree `rootEl`) keeps\n // the tooltip from being clipped by ancestor overflow or trapped by an\n // ancestor `transform`. Falls back to <body> if used outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(tooltipContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {arrow ? <TooltipPrimitive.Arrow className=\"ddga-tooltip__arrow\" /> : null}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Tooltip, TooltipTrigger, TooltipContent, tooltipContentVariants };\nexport type { TooltipProps, TooltipTriggerProps, TooltipContentProps };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Info, Check, AlertTriangle, AlertCircle, Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst alertVariants = cva('ddga-alert', {\n variants: {\n variant: {\n info: 'ddga-alert--info',\n success: 'ddga-alert--success',\n warning: 'ddga-alert--warning',\n destructive: 'ddga-alert--destructive',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n});\n\nconst DEFAULT_ICONS: Record<\n NonNullable<VariantProps<typeof alertVariants>['variant']>,\n ReactNode\n> = {\n info: <Info aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n warning: <AlertTriangle aria-hidden=\"true\" />,\n destructive: <AlertCircle aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ninterface AlertProps\n extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof alertVariants> {\n /** Render as the single child element instead of a `<div>`. */\n asChild?: boolean;\n /**\n * Custom leading icon. Pass `false` to hide the icon entirely. Defaults to\n * a variant-appropriate icon (Info / Check / AlertTriangle / AlertCircle).\n */\n icon?: ReactNode | false;\n /**\n * Show a trailing close button. The alert manages its own visibility — pass\n * `onDismiss` to be notified, or set `open` to control visibility yourself.\n */\n dismissible?: boolean;\n /** Controlled visibility. Pair with `onDismiss` to react. */\n open?: boolean;\n /** Fires when the user clicks the close button. */\n onDismiss?: () => void;\n /**\n * Wire the alert into the a11y tree as a live region. `polite` announces on\n * the next graceful opportunity (use for success/info banners). `assertive`\n * interrupts the user (reserve for destructive/error states that block the\n * task). Omit for static / decorative banners.\n */\n live?: 'polite' | 'assertive';\n /** Localized label for the close button. Defaults to `\"Dismiss\"`. */\n closeLabel?: string;\n}\n\ntype AlertSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface AlertTitleProps extends React.ComponentProps<'h5'> {\n /** Override the heading element (e.g. render an `<h3>`). */\n asChild?: boolean;\n}\n\ntype AlertDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\n\n// ─── 3. Components ─── //\n\nfunction Alert({\n variant,\n asChild,\n icon,\n dismissible,\n open: controlledOpen,\n onDismiss,\n live,\n closeLabel = 'Dismiss',\n className,\n children,\n ...props\n}: AlertProps) {\n const [internalOpen, setInternalOpen] = useState(true);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n if (!open) return null;\n\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n\n const resolvedIcon =\n icon === false ? null : icon !== undefined ? icon : DEFAULT_ICONS[variant ?? 'info'];\n\n // Live-region semantics. `role=\"alert\"` is implicit when aria-live=assertive,\n // but Radix-style explicitness reads better in tests + DOM inspection.\n const liveProps =\n live === 'assertive'\n ? { role: 'alert' as const, 'aria-live': 'assertive' as const }\n : live === 'polite'\n ? { role: 'status' as const, 'aria-live': 'polite' as const }\n : {};\n\n function handleDismiss() {\n if (!isControlled) setInternalOpen(false);\n onDismiss?.();\n }\n\n return (\n <Comp\n data-slot=\"alert\"\n data-variant={variant ?? 'info'}\n className={cn(alertVariants({ variant }), className)}\n {...liveProps}\n {...props}\n >\n {resolvedIcon ? <span className=\"ddga-alert__icon\">{resolvedIcon}</span> : null}\n {asChild ? (\n // Slot mode: the consumer's element receives the children body.\n // Title/description are nested by the consumer.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n <div className=\"ddga-alert__body\">{children}</div>\n )}\n {dismissible ? (\n <button\n type=\"button\"\n className=\"ddga-alert__close\"\n aria-label={closeLabel}\n onClick={handleDismiss}\n >\n <Close aria-hidden=\"true\" />\n </button>\n ) : null}\n </Comp>\n );\n}\n\nfunction AlertTitle({ asChild, className, ...props }: AlertTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h5';\n return <Comp data-slot=\"alert-title\" className={cn('ddga-alert__title', className)} {...props} />;\n}\n\nfunction AlertDescription({ asChild, className, ...props }: AlertDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"alert-description\"\n className={cn('ddga-alert__description', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\nexport type { AlertProps, AlertTitleProps, AlertDescriptionProps, AlertSectionProps };\n","'use client';\n\nimport { useContext } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst modalContentVariants = cva('ddga-modal', {\n variants: {\n size: {\n sm: 'ddga-modal--sm',\n md: 'ddga-modal--md',\n lg: 'ddga-modal--lg',\n xl: 'ddga-modal--xl',\n full: 'ddga-modal--full',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Closed compound shape that hides Radix's Portal/Overlay plumbing. The Portal\n// is anchored to `DgaContext.rootEl` so `data-theme` + custom theme classes\n// set on the provider inherit into the modal — without it, the modal would\n// silently mount under <body> and miss dark mode / palette switches.\n\ntype ModalProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype ModalTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype ModalCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface ModalContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof modalContentVariants> {\n /**\n * Render a corner X close button. Defaults to `true`. Set `false` for\n * action-forcing dialogs (e.g. \"Are you sure?\") where the user must pick\n * one of the explicit footer buttons.\n */\n showCloseButton?: boolean;\n /** Localized label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ntype ModalSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface ModalTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n /** Override the heading element (e.g. render an `<h3>` instead of the default `<h2>`). */\n asChild?: boolean;\n}\n\ninterface ModalDescriptionProps extends React.ComponentProps<typeof DialogPrimitive.Description> {\n /** Override the element (e.g. render a `<div>` for richer markup). */\n asChild?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Modal(props: ModalProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction ModalTrigger({ className, ...props }: ModalTriggerProps) {\n // Radix Trigger supports asChild natively — pass through.\n return <DialogPrimitive.Trigger data-slot=\"modal-trigger\" className={className} {...props} />;\n}\n\nfunction ModalContent({\n size,\n showCloseButton = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: ModalContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container.\n // Pattern documented in DgaContext.ts; regression test in Modal.test.tsx\n // mirrors Select/Tooltip. The portal container mirrors data-theme + dir +\n // CSS vars from the provider so theming still flows; using it (rather\n // than the in-tree `rootEl`) keeps the modal's `position: fixed` overlay\n // from being trapped by an ancestor `transform` or `overflow: hidden`\n // (Storybook autodocs is the motivating case).\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay className=\"ddga-modal__overlay\" data-slot=\"modal-overlay\" />\n <DialogPrimitive.Content\n data-slot=\"modal-content\"\n className={cn(modalContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {showCloseButton ? (\n <DialogPrimitive.Close\n className=\"ddga-modal__close\"\n aria-label={closeLabel}\n data-slot=\"modal-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction ModalHeader({ asChild, className, ...props }: ModalSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"modal-header\" className={cn('ddga-modal__header', className)} {...props} />\n );\n}\n\nfunction ModalTitle({ asChild, className, ...props }: ModalTitleProps) {\n // Dialog.Title wires aria-labelledby on the parent Content. We pass asChild\n // through so consumers can swap heading level (h2 → h1/h3) without losing\n // the labelling link.\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"modal-title\"\n className={cn('ddga-modal__title', className)}\n {...props}\n />\n );\n}\n\nfunction ModalDescription({ asChild, className, ...props }: ModalDescriptionProps) {\n // Dialog.Description wires aria-describedby on the parent Content. asChild\n // lets consumers swap the element if they need richer markup.\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"modal-description\"\n className={cn('ddga-modal__description', className)}\n {...props}\n />\n );\n}\n\nfunction ModalFooter({ asChild, className, ...props }: ModalSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"modal-footer\" className={cn('ddga-modal__footer', className)} {...props} />\n );\n}\n\nfunction ModalClose({ className, ...props }: ModalCloseProps) {\n // Consumer-level close trigger for footer buttons etc. Radix Close supports\n // asChild natively — pass through so consumers can wrap a <Button>.\n return <DialogPrimitive.Close data-slot=\"modal-close\" className={className} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Modal,\n ModalTrigger,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n};\nexport type {\n ModalProps,\n ModalTriggerProps,\n ModalContentProps,\n ModalSectionProps,\n ModalTitleProps,\n ModalDescriptionProps,\n ModalCloseProps,\n};\n","'use client';\n\nimport { useSyncExternalStore, type ReactNode } from 'react';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Info, Check, AlertTriangle, AlertCircle, Close } from '../../internal/icons';\nimport {\n toastStore as defaultStore,\n type ToastData,\n type ToastStore,\n type ToastVariant,\n} from './toast-store';\n\n// ─── 1. Variants (cva) ─── //\n\nconst toastVariants = cva('ddga-toast', {\n variants: {\n variant: {\n default: 'ddga-toast--default',\n info: 'ddga-toast--info',\n success: 'ddga-toast--success',\n warning: 'ddga-toast--warning',\n destructive: 'ddga-toast--destructive',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nconst toastViewportVariants = cva('ddga-toast-viewport', {\n variants: {\n position: {\n 'top-start': 'ddga-toast-viewport--top-start',\n 'top-center': 'ddga-toast-viewport--top-center',\n 'top-end': 'ddga-toast-viewport--top-end',\n 'bottom-start': 'ddga-toast-viewport--bottom-start',\n 'bottom-center': 'ddga-toast-viewport--bottom-center',\n 'bottom-end': 'ddga-toast-viewport--bottom-end',\n },\n containerized: {\n true: 'ddga-toast-viewport--containerized',\n },\n },\n defaultVariants: {\n position: 'bottom-end',\n },\n});\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n default: null,\n info: <Info aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n warning: <AlertTriangle aria-hidden=\"true\" />,\n destructive: <AlertCircle aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ntype ToastPosition = NonNullable<VariantProps<typeof toastViewportVariants>['position']>;\n\ninterface ToasterProps {\n /** Where toasts stack. Logical: start/end flip in RTL. Default `bottom-end`. */\n position?: ToastPosition;\n /**\n * Pin the viewport to a positioned ancestor (via `position: absolute`)\n * instead of the browser viewport (`position: fixed`). Set this for\n * Storybook stories, embedded widgets, and any layout where the Toaster\n * should stay within a parent box. Caller is responsible for placing the\n * Toaster inside an element with `position: relative` (or other positioned\n * containing block).\n */\n containerized?: boolean;\n /** ms; default 4000. Set 0 (or Infinity) to disable auto-dismiss globally. */\n duration?: number;\n /** Show a close (X) button on each toast. Defaults to true. */\n closeButton?: boolean;\n /** Localized label for the close button. Default `\"Dismiss\"`. */\n closeLabel?: string;\n /** Hide the default leading icon per variant. */\n hideIcon?: boolean;\n /** Extra class on the Radix Viewport. */\n className?: string;\n /** Override swipe direction. Defaults based on `position`. */\n swipeDirection?: 'up' | 'down' | 'left' | 'right';\n /**\n * The toast store this Toaster subscribes to. Defaults to the module-level\n * singleton so the bare `toast()` API works without setup. Pass an isolated\n * store (created via `createToastStore()` + `createToast(store)`) when you\n * need multiple independent Toasters on the same page — common in\n * Storybook, docs sites, and embedded widgets.\n */\n store?: ToastStore;\n}\n\n// ─── 3. Components ─── //\n\nfunction Toaster({\n position = 'bottom-end',\n containerized = false,\n duration = 4000,\n closeButton = true,\n closeLabel = 'Dismiss',\n hideIcon = false,\n className,\n swipeDirection,\n store = defaultStore,\n}: ToasterProps) {\n // Subscribe to the store. Using getSnapshot for both client + server is\n // fine — toasts always start empty on hydration and adding only happens\n // after client mount.\n const toasts = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n // Map position → swipe direction. Top toasts swipe up; bottom toasts\n // swipe down. Caller can override.\n const resolvedSwipe: 'up' | 'down' | 'left' | 'right' =\n swipeDirection ?? (position.startsWith('top') ? 'up' : 'down');\n\n return (\n <ToastPrimitive.Provider duration={duration} swipeDirection={resolvedSwipe}>\n {toasts.map((t) => (\n <ToastItem\n key={t.id}\n toast={t}\n store={store}\n closeButton={closeButton}\n closeLabel={closeLabel}\n hideIcon={hideIcon}\n />\n ))}\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n data-position={position}\n className={cn(toastViewportVariants({ position, containerized }), className)}\n />\n </ToastPrimitive.Provider>\n );\n}\n\ninterface ToastItemProps {\n toast: ToastData;\n store: ToastStore;\n closeButton: boolean;\n closeLabel: string;\n hideIcon: boolean;\n}\n\nfunction ToastItem({ toast: t, store, closeButton, closeLabel, hideIcon }: ToastItemProps) {\n // For destructive variant, mark as `foreground` so assistive tech announces\n // it more urgently (Radix routes foreground toasts through a hidden\n // assertive live region; background goes through a polite one).\n const radixType: 'foreground' | 'background' =\n t.variant === 'destructive' ? 'foreground' : 'background';\n\n const icon = hideIcon ? null : DEFAULT_ICONS[t.variant];\n\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n data-variant={t.variant}\n className={toastVariants({ variant: t.variant })}\n open={t.open}\n type={radixType}\n duration={t.duration}\n onOpenChange={(open) => {\n if (!open) {\n // Route close-button / swipe / auto-duration dismissal through the\n // store. The store schedules the hard-remove after the exit anim,\n // so programmatic + UI dismissal land on the same path.\n store.dismiss(t.id);\n }\n }}\n >\n {icon ? <span className=\"ddga-toast__icon\">{icon}</span> : null}\n {/*\n Body owns the title + description + action stack so multi-line content\n and a trailing action button compose cleanly. Action lives INSIDE the\n body (not as a sibling of body) so it doesn't fight body's height when\n a description is present — sonner/shadcn pattern.\n */}\n <div className=\"ddga-toast__body\">\n {t.title ? (\n <ToastPrimitive.Title className=\"ddga-toast__title\">{t.title}</ToastPrimitive.Title>\n ) : null}\n {t.description ? (\n <ToastPrimitive.Description className=\"ddga-toast__description\">\n {t.description}\n </ToastPrimitive.Description>\n ) : null}\n {t.action ? (\n <ToastPrimitive.Action\n className=\"ddga-toast__action\"\n altText={\n t.action.altText ?? (typeof t.action.label === 'string' ? t.action.label : 'Action')\n }\n onClick={() => {\n t.action?.onClick();\n // Auto-dismiss after the action — store handles exit-anim timing.\n store.dismiss(t.id);\n }}\n >\n {t.action.label}\n </ToastPrimitive.Action>\n ) : null}\n </div>\n {closeButton ? (\n <ToastPrimitive.Close className=\"ddga-toast__close\" aria-label={closeLabel}>\n <Close aria-hidden=\"true\" />\n </ToastPrimitive.Close>\n ) : null}\n </ToastPrimitive.Root>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Toaster, toastVariants, toastViewportVariants };\nexport { toast, toastStore, createToast, createToastStore } from './toast-store';\nexport type { ToasterProps, ToastPosition };\nexport type { ToastVariant, ToastData, ToastOptions, ToastAction, ToastStore } from './toast-store';\n","'use client';\n\nimport { type ReactNode } from 'react';\n\n// ─── Types ─── //\n\nexport type ToastVariant = 'default' | 'info' | 'success' | 'warning' | 'destructive';\n\nexport interface ToastAction {\n /** Visible label on the action button. */\n label: ReactNode;\n /** Required by Radix Toast for screen-reader announcement when the action\n * isn't a simple string label. Falls back to `label` when it's a string. */\n altText?: string;\n /** Fired when the action button is pressed. Toast auto-dismisses after. */\n onClick: () => void;\n}\n\nexport interface ToastData {\n /** Auto-generated unless caller provides one (useful for de-dup / updates). */\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n variant: ToastVariant;\n /** ms; `0` (or `Infinity`) means no auto-dismiss. Defaults handled by Toaster. */\n duration?: number;\n action?: ToastAction;\n /** Controlled by Radix Toast (true while visible; false plays exit anim). */\n open: boolean;\n /** Fires when the toast leaves the DOM (after exit anim). */\n onDismiss?: () => void;\n}\n\nexport interface ToastOptions {\n id?: string;\n title?: ReactNode;\n description?: ReactNode;\n duration?: number;\n action?: ToastAction;\n onDismiss?: () => void;\n}\n\ntype Listener = () => void;\n\n/** Public store shape. `<Toaster store={…} />` accepts this, and\n * `createToast(store)` returns a scoped `toast()` bound to it. */\nexport interface ToastStore {\n subscribe(listener: Listener): () => void;\n getSnapshot(): ToastData[];\n add(variant: ToastVariant, message: ReactNode, options?: ToastOptions): string;\n dismiss(id?: string): void;\n remove(id: string): void;\n /** Test-only / story-only: hard reset. */\n __reset(): void;\n}\n\n/** Approximate Radix Toast exit-animation duration (ms). After this we hard-\n * remove the entry from the store so the DOM unmounts cleanly. */\nconst EXIT_ANIM_MS = 200;\n\n// ─── Factory ─── //\n//\n// Each call returns an isolated store. The default module-level instance\n// powers the singleton `toast()` API (Sonner pattern: one Toaster at app\n// root). Advanced consumers — including the Storybook stories below this\n// component — call `createToastStore()` to get an independent store so\n// multiple Toasters on one page don't share state.\n\nexport function createToastStore(): ToastStore {\n let toasts: ToastData[] = [];\n const listeners = new Set<Listener>();\n let counter = 0;\n\n function emit() {\n for (const l of listeners) l();\n }\n\n function subscribe(listener: Listener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n\n function getSnapshot(): ToastData[] {\n return toasts;\n }\n\n function nextId(): string {\n counter += 1;\n return `t${counter}`;\n }\n\n function add(variant: ToastVariant, message: ReactNode, options: ToastOptions = {}): string {\n const id = options.id ?? nextId();\n const existing = toasts.findIndex((t) => t.id === id);\n const data: ToastData = {\n id,\n variant,\n open: true,\n title: message,\n description: options.description,\n duration: options.duration,\n action: options.action,\n onDismiss: options.onDismiss,\n };\n if (existing >= 0) {\n // Update in place (caller passed the same id — useful for \"loading → success\"\n // patterns or de-duped error messages).\n toasts = toasts.map((t, i) => (i === existing ? data : t));\n } else {\n toasts = [...toasts, data];\n }\n emit();\n return id;\n }\n\n /** Flip `open` to false → Radix plays exit anim → `remove` after.\n * Routes both programmatic dismiss + UI dismiss through the same path. */\n function dismiss(id?: string): void {\n if (id === undefined) {\n const ids = toasts.map((t) => t.id);\n toasts = toasts.map((t) => ({ ...t, open: false }));\n emit();\n setTimeout(() => {\n ids.forEach((id) => remove(id));\n }, EXIT_ANIM_MS);\n } else {\n toasts = toasts.map((t) => (t.id === id ? { ...t, open: false } : t));\n emit();\n setTimeout(() => remove(id), EXIT_ANIM_MS);\n }\n }\n\n function remove(id: string): void {\n const target = toasts.find((t) => t.id === id);\n toasts = toasts.filter((t) => t.id !== id);\n emit();\n target?.onDismiss?.();\n }\n\n function __reset(): void {\n toasts = [];\n counter = 0;\n emit();\n }\n\n return { subscribe, getSnapshot, add, dismiss, remove, __reset };\n}\n\n// ─── Default singleton ─── //\n// 90%-case API: one Toaster at app root, call `toast()` anywhere.\n\nexport const toastStore: ToastStore = createToastStore();\n\n// ─── createToast(store) ─── //\n\ninterface ToastFn {\n (message: ReactNode, options?: ToastOptions): string;\n default: (message: ReactNode, options?: ToastOptions) => string;\n info: (message: ReactNode, options?: ToastOptions) => string;\n success: (message: ReactNode, options?: ToastOptions) => string;\n warning: (message: ReactNode, options?: ToastOptions) => string;\n error: (message: ReactNode, options?: ToastOptions) => string;\n /** Alias for `error` — matches the variant name used everywhere else in the library. */\n destructive: (message: ReactNode, options?: ToastOptions) => string;\n /** Dismiss a specific toast by id, or all when called with no args. */\n dismiss: (id?: string) => void;\n}\n\n/** Bind an imperative `toast()` callable to a specific store. */\nexport function createToast(store: ToastStore): ToastFn {\n const fn: ToastFn = ((message, options) => store.add('default', message, options)) as ToastFn;\n fn.default = (message, options) => store.add('default', message, options);\n fn.info = (message, options) => store.add('info', message, options);\n fn.success = (message, options) => store.add('success', message, options);\n fn.warning = (message, options) => store.add('warning', message, options);\n fn.error = (message, options) => store.add('destructive', message, options);\n fn.destructive = fn.error;\n fn.dismiss = (id) => store.dismiss(id);\n return fn;\n}\n\n/** Default singleton `toast()` — bound to the module-level `toastStore`. */\nexport const toast: ToastFn = createToast(toastStore);\n","'use client';\n\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual variant + size live on the root. The CSS cascades through\n// descendant selectors (`.ddga-tabs--line .ddga-tabs__trigger`) so the source\n// of truth stays on one element per Tabs instance — no need to thread props\n// into every TabsList/TabsTrigger. Same pattern as RadioGroup.\n\nconst tabsVariants = cva('ddga-tabs', {\n variants: {\n variant: {\n line: 'ddga-tabs--line',\n pill: 'ddga-tabs--pill',\n },\n size: {\n sm: 'ddga-tabs--sm',\n md: 'ddga-tabs--md',\n },\n },\n defaultVariants: {\n variant: 'line',\n size: 'md',\n },\n});\n\nconst tabsListVariants = cva('ddga-tabs__list', {\n variants: {\n fullWidth: {\n true: 'ddga-tabs__list--full-width',\n },\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface TabsProps\n extends React.ComponentProps<typeof TabsPrimitive.Root>, VariantProps<typeof tabsVariants> {}\n\ninterface TabsListProps\n extends React.ComponentProps<typeof TabsPrimitive.List>, VariantProps<typeof tabsListVariants> {}\n\ntype TabsTriggerProps = React.ComponentProps<typeof TabsPrimitive.Trigger>;\ntype TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content>;\n\n// ─── 3. Components ─── //\n\nfunction Tabs({ variant, size, className, ...props }: TabsProps) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(tabsVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({ fullWidth, className, ...props }: TabsListProps) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(tabsListVariants({ fullWidth }), className)}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({ className, ...props }: TabsTriggerProps) {\n // Radix Trigger supports asChild natively — pass through. Disabled state is\n // native too (Radix sets `[data-disabled]` and the rendered button gets\n // `disabled`); CSS targets both `[data-disabled]` and `[aria-disabled='true']`\n // so the visual state applies whether the consumer uses `disabled` or\n // composes via `asChild` + `aria-disabled`.\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn('ddga-tabs__trigger', className)}\n {...props}\n />\n );\n}\n\nfunction TabsContent({ className, ...props }: TabsContentProps) {\n // Radix Content supports asChild natively. Mount/unmount and the\n // aria-labelledby ↔ TabsTrigger wiring is handled by Radix.\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('ddga-tabs__content', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent, tabsVariants, tabsListVariants };\nexport type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps };\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronRight, MoreHorizontal } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root; per-part visuals cascade through descendant\n// selectors (`.ddga-breadcrumb--sm .ddga-breadcrumb__link`). Same pattern\n// as Tabs/RadioGroup — one source of truth on the nav element.\n\nconst breadcrumbVariants = cva('ddga-breadcrumb', {\n variants: {\n size: {\n sm: 'ddga-breadcrumb--sm',\n md: 'ddga-breadcrumb--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface BreadcrumbProps\n extends React.ComponentProps<'nav'>, VariantProps<typeof breadcrumbVariants> {}\n\ntype BreadcrumbListProps = React.ComponentProps<'ol'>;\ntype BreadcrumbItemProps = React.ComponentProps<'li'>;\n\ninterface BreadcrumbLinkProps extends React.ComponentProps<'a'> {\n /** Render as the consumer element (e.g., a router Link) via Radix Slot. */\n asChild?: boolean;\n}\n\ninterface BreadcrumbPageProps extends React.ComponentProps<'span'> {\n /** Render as the consumer element (e.g., a heading) via Radix Slot. */\n asChild?: boolean;\n}\n\ninterface BreadcrumbSeparatorProps extends React.ComponentProps<'li'> {\n /**\n * Override the default ChevronRight icon with custom content (e.g., `/`, `·`,\n * or your own SVG). The wrapper itself stays `aria-hidden` since separators\n * are decorative — the visited-state structure is conveyed via the `<ol>`\n * + `aria-current` semantics, not the separator glyph.\n */\n children?: React.ReactNode;\n}\n\ntype BreadcrumbEllipsisProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Breadcrumb({ size, className, ...props }: BreadcrumbProps) {\n // Default the accessible name to \"Breadcrumb\" so consumers don't have to\n // wire it themselves; spread `aria-label` after so they can override it\n // (e.g., for non-English UIs the consumer passes their own translation).\n return (\n <nav\n aria-label=\"Breadcrumb\"\n data-slot=\"breadcrumb\"\n className={cn(breadcrumbVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol data-slot=\"breadcrumb-list\" className={cn('ddga-breadcrumb__list', className)} {...props} />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return (\n <li data-slot=\"breadcrumb-item\" className={cn('ddga-breadcrumb__item', className)} {...props} />\n );\n}\n\nfunction BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n data-slot=\"breadcrumb-link\"\n className={cn('ddga-breadcrumb__link', className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbPage({ asChild, className, ...props }: BreadcrumbPageProps) {\n // `aria-current=\"page\"` marks the current location for assistive tech.\n // The element is not focusable (consumers shouldn't link to the current\n // page); spread props last so consumers can swap if a different\n // aria-current value is needed (e.g., `step` in a wizard).\n const Comp = asChild ? SlotPrimitive.Slot : 'span';\n return (\n <Comp\n aria-current=\"page\"\n data-slot=\"breadcrumb-page\"\n className={cn('ddga-breadcrumb__page', className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n // Decorative — the `<ol>` + `aria-current` semantics already convey order\n // and current page. `aria-hidden` keeps screen readers from announcing\n // the glyph between every item.\n return (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"breadcrumb-separator\"\n className={cn('ddga-breadcrumb__separator', className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n );\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n // Visual truncation marker. Decorative by itself — if the consumer wants\n // an interactive \"show collapsed items\" affordance, they should compose\n // a real button (e.g., a DropdownMenu trigger) inside a BreadcrumbItem\n // instead of this component.\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"breadcrumb-ellipsis\"\n className={cn('ddga-breadcrumb__ellipsis', className)}\n {...props}\n >\n <MoreHorizontal />\n </span>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n breadcrumbVariants,\n};\nexport type {\n BreadcrumbProps,\n BreadcrumbListProps,\n BreadcrumbItemProps,\n BreadcrumbLinkProps,\n BreadcrumbPageProps,\n BreadcrumbSeparatorProps,\n BreadcrumbEllipsisProps,\n};\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronRight, MoreHorizontal } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root and cascades via descendants — same pattern as\n// Breadcrumb / Tabs. `PaginationLink` carries the active/inactive visual\n// state via `isActive` (which is also what stamps `aria-current=\"page\"`),\n// so the active style stays bound to the a11y mark and can't drift.\n\nconst paginationVariants = cva('ddga-pagination', {\n variants: {\n size: {\n sm: 'ddga-pagination--sm',\n md: 'ddga-pagination--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst paginationLinkVariants = cva('ddga-pagination__link', {\n variants: {\n isActive: {\n true: 'ddga-pagination__link--active',\n },\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface PaginationProps\n extends React.ComponentProps<'nav'>, VariantProps<typeof paginationVariants> {}\n\ntype PaginationContentProps = React.ComponentProps<'ul'>;\ntype PaginationItemProps = React.ComponentProps<'li'>;\n\ninterface PaginationLinkProps\n extends\n Omit<React.ComponentProps<'a'>, 'aria-current'>,\n VariantProps<typeof paginationLinkVariants> {\n /** Render as the consumer element (e.g., router Link) via Radix Slot. */\n asChild?: boolean;\n}\n\ntype PaginationPreviousProps = Omit<PaginationLinkProps, 'isActive'> & {\n /**\n * Visible + accessible label for the previous-page link. Defaults to\n * `\"Previous\"`. Pass a translated string for non-English UIs — the value is\n * also used for `aria-label`, so a localized string is required for a11y.\n * Ignored when `asChild` + consumer-provided `children` are used.\n */\n label?: string;\n};\n\ntype PaginationNextProps = Omit<PaginationLinkProps, 'isActive'> & {\n /**\n * Visible + accessible label for the next-page link. Defaults to `\"Next\"`.\n * Pass a translated string for non-English UIs — the value is also used\n * for `aria-label`, so a localized string is required for a11y. Ignored\n * when `asChild` + consumer-provided `children` are used.\n */\n label?: string;\n};\n\ntype PaginationEllipsisProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Pagination({ size, className, ...props }: PaginationProps) {\n // Default the accessible name to \"pagination\" (lowercase per the\n // ARIA Authoring Practices Guide). Spread `aria-label` last so consumers\n // can override for non-English UIs.\n return (\n <nav\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(paginationVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: PaginationContentProps) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn('ddga-pagination__content', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ className, ...props }: PaginationItemProps) {\n return (\n <li data-slot=\"pagination-item\" className={cn('ddga-pagination__item', className)} {...props} />\n );\n}\n\nfunction PaginationLink({ asChild, isActive, className, ...props }: PaginationLinkProps) {\n // `isActive` is the single source of truth for both the visual state and\n // the `aria-current=\"page\"` mark — they can't drift apart.\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive ? '' : undefined}\n className={cn(paginationLinkVariants({ isActive }), className)}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n label = 'Previous',\n className,\n children,\n asChild,\n ...props\n}: PaginationPreviousProps) {\n // In asChild + children-provided mode the consumer owns the rendered\n // content; we still wire the accessible label so screen reader users hear\n // \"Previous\" even if the consumer's text is something custom.\n return (\n <PaginationLink\n asChild={asChild}\n aria-label={label}\n data-slot=\"pagination-previous\"\n className={cn('ddga-pagination__nav', 'ddga-pagination__nav--previous', className)}\n {...props}\n >\n {children ?? (\n <>\n <ChevronRight className=\"ddga-pagination__nav-icon ddga-pagination__nav-icon--previous\" />\n <span>{label}</span>\n </>\n )}\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n label = 'Next',\n className,\n children,\n asChild,\n ...props\n}: PaginationNextProps) {\n return (\n <PaginationLink\n asChild={asChild}\n aria-label={label}\n data-slot=\"pagination-next\"\n className={cn('ddga-pagination__nav', 'ddga-pagination__nav--next', className)}\n {...props}\n >\n {children ?? (\n <>\n <span>{label}</span>\n <ChevronRight className=\"ddga-pagination__nav-icon ddga-pagination__nav-icon--next\" />\n </>\n )}\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: PaginationEllipsisProps) {\n // Decorative — collapsed-range marker. Consumer is expected to make the\n // surrounding links cover the real navigation surface (first/last/numbers).\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"pagination-ellipsis\"\n className={cn('ddga-pagination__ellipsis', className)}\n {...props}\n >\n <MoreHorizontal />\n </span>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Pagination,\n PaginationContent,\n PaginationItem,\n PaginationLink,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n paginationVariants,\n paginationLinkVariants,\n};\nexport type {\n PaginationProps,\n PaginationContentProps,\n PaginationItemProps,\n PaginationLinkProps,\n PaginationPreviousProps,\n PaginationNextProps,\n PaginationEllipsisProps,\n};\n","'use client';\n\nimport { Accordion as AccordionPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronDown } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root. Per-part visuals cascade via descendant selectors,\n// same pattern as Tabs/Breadcrumb. Radix handles disclosure state (open /\n// closed via `data-state`), keyboard nav (Arrow + Home/End), and mounting\n// of content with built-in animation hooks (`data-state` + CSS variables\n// `--radix-accordion-content-height`).\n\nconst accordionVariants = cva('ddga-accordion', {\n variants: {\n size: {\n sm: 'ddga-accordion--sm',\n md: 'ddga-accordion--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Radix's Root has two prop shapes depending on `type` (single vs multiple\n// expanded). We mirror that via discriminated union from Radix's own types.\n\ntype AccordionRootProps = React.ComponentProps<typeof AccordionPrimitive.Root>;\ntype AccordionProps = AccordionRootProps & VariantProps<typeof accordionVariants>;\n\ntype AccordionItemProps = React.ComponentProps<typeof AccordionPrimitive.Item>;\ntype AccordionTriggerProps = React.ComponentProps<typeof AccordionPrimitive.Trigger>;\ntype AccordionContentProps = React.ComponentProps<typeof AccordionPrimitive.Content>;\n\n// ─── 3. Components ─── //\n\nfunction Accordion({ size, className, ...props }: AccordionProps) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={cn(accordionVariants({ size }), className)}\n {...(props as AccordionRootProps)}\n />\n );\n}\n\nfunction AccordionItem({ className, ...props }: AccordionItemProps) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('ddga-accordion__item', className)}\n {...props}\n />\n );\n}\n\nfunction AccordionTrigger({ className, children, ...props }: AccordionTriggerProps) {\n // Radix wraps the trigger in a Header (`<h3>` by default). We render the\n // Header inline so consumers get the heading-level semantics for free; the\n // visible chevron is decorative (aria-hidden) and rotates via `data-state`.\n return (\n <AccordionPrimitive.Header className=\"ddga-accordion__header\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn('ddga-accordion__trigger', className)}\n {...props}\n >\n {children}\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ddga-accordion__chevron\"\n data-slot=\"accordion-chevron\"\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nfunction AccordionContent({ className, children, ...props }: AccordionContentProps) {\n // Radix sets `--radix-accordion-content-height` on the element when open\n // so we can animate from 0 → content-height. The inner div carries the\n // padding so the animated container can clip without padding \"popping\".\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className={cn('ddga-accordion__content', className)}\n {...props}\n >\n <div className=\"ddga-accordion__content-inner\">{children}</div>\n </AccordionPrimitive.Content>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent, accordionVariants };\nexport type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual-only stepper. Each `Step` carries a `state` (completed / current /\n// upcoming) which drives the indicator color + ARIA marks. Separators are\n// CSS-drawn via pseudo-elements between siblings — no `StepSeparator`\n// component needed (and one fewer thing for consumers to get wrong).\n\nconst stepsVariants = cva('ddga-steps', {\n variants: {\n size: {\n sm: 'ddga-steps--sm',\n md: 'ddga-steps--md',\n },\n orientation: {\n horizontal: 'ddga-steps--horizontal',\n vertical: 'ddga-steps--vertical',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'horizontal',\n },\n});\n\ntype StepState = 'completed' | 'current' | 'upcoming';\n\nconst stepVariants = cva('ddga-steps__step', {\n variants: {\n state: {\n completed: 'ddga-steps__step--completed',\n current: 'ddga-steps__step--current',\n upcoming: 'ddga-steps__step--upcoming',\n },\n },\n defaultVariants: {\n state: 'upcoming',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface StepsProps extends React.ComponentProps<'ol'>, VariantProps<typeof stepsVariants> {}\n\ninterface StepProps\n extends Omit<React.ComponentProps<'li'>, 'aria-current'>, VariantProps<typeof stepVariants> {}\n\ninterface StepIndicatorProps extends React.ComponentProps<'span'> {\n /**\n * The 1-based step number to render when the step is `current` or\n * `upcoming`. Ignored when the step is `completed` — the indicator shows\n * a check icon instead.\n */\n step?: number | string;\n}\n\ntype StepTitleProps = React.ComponentProps<'span'>;\ntype StepDescriptionProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Steps({ size, orientation, className, ...props }: StepsProps) {\n // `<ol>` is the right semantic for an ordered list of steps; the implicit\n // listitem role on children makes the count assistive-tech-readable.\n return (\n <ol\n data-slot=\"steps\"\n data-orientation={orientation ?? 'horizontal'}\n className={cn(stepsVariants({ size, orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction Step({ state, className, ...props }: StepProps) {\n // `aria-current=\"step\"` on the current step. State drives both the ARIA\n // mark and the visual class so they can't drift apart. Step always\n // renders an `<li>` because the parent `<ol>` is only allowed to contain\n // `<li>` children — consumers who need clickable steps put an `<a>` (or\n // a router primitive) inside Step's children, not as the step element\n // itself.\n return (\n <li\n aria-current={state === 'current' ? 'step' : undefined}\n data-slot=\"step\"\n data-state={state ?? 'upcoming'}\n className={cn(stepVariants({ state }), className)}\n {...props}\n />\n );\n}\n\nfunction StepIndicator({ step, className, ...props }: StepIndicatorProps) {\n // Decorative — assistive tech reads the step title/description, not the\n // number-in-a-circle. The check icon for completed steps is purely\n // visual; the parent's `data-state=\"completed\"` is what conveys meaning.\n return (\n <span\n aria-hidden=\"true\"\n data-slot=\"step-indicator\"\n className={cn('ddga-steps__indicator', className)}\n {...props}\n >\n <Check className=\"ddga-steps__indicator-check\" />\n <span className=\"ddga-steps__indicator-number\">{step}</span>\n </span>\n );\n}\n\nfunction StepTitle({ className, ...props }: StepTitleProps) {\n return <span data-slot=\"step-title\" className={cn('ddga-steps__title', className)} {...props} />;\n}\n\nfunction StepDescription({ className, ...props }: StepDescriptionProps) {\n return (\n <span\n data-slot=\"step-description\"\n className={cn('ddga-steps__description', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Steps, Step, StepIndicator, StepTitle, StepDescription, stepsVariants, stepVariants };\nexport type {\n StepsProps,\n StepProps,\n StepIndicatorProps,\n StepTitleProps,\n StepDescriptionProps,\n StepState,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst skeletonVariants = cva('ddga-skeleton', {\n variants: {\n shape: {\n text: 'ddga-skeleton--text',\n circle: 'ddga-skeleton--circle',\n rectangle: 'ddga-skeleton--rectangle',\n },\n animation: {\n pulse: 'ddga-skeleton--pulse',\n wave: 'ddga-skeleton--wave',\n none: 'ddga-skeleton--none',\n },\n },\n defaultVariants: {\n shape: 'text',\n animation: 'pulse',\n },\n});\n\ninterface SkeletonProps extends React.ComponentProps<'div'>, VariantProps<typeof skeletonVariants> {\n /**\n * Inline width override (any valid CSS length, e.g. `\"60%\"`, `200`, `\"4rem\"`).\n * Defaults: `text` → `100%`, `circle`/`rectangle` → `40px` (CSS-controlled).\n */\n width?: number | string;\n /**\n * Inline height override. Defaults: `text` → `1em` so it tracks the surrounding\n * line height; `rectangle` → `40px`; `circle` → matches `width` to stay round.\n */\n height?: number | string;\n}\n\nfunction Skeleton({ shape, animation, width, height, className, style, ...props }: SkeletonProps) {\n const sizeStyle: React.CSSProperties = {\n ...(width !== undefined ? { width: typeof width === 'number' ? `${width}px` : width } : null),\n ...(height !== undefined\n ? { height: typeof height === 'number' ? `${height}px` : height }\n : null),\n ...style,\n };\n\n return (\n <div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n className={cn(skeletonVariants({ shape, animation }), className)}\n style={sizeStyle}\n {...props}\n />\n );\n}\n\nexport { Skeleton, skeletonVariants };\nexport type { SkeletonProps };\n","'use client';\n\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants ─── //\n\nconst progressVariants = cva('ddga-progress', {\n variants: {\n size: {\n sm: 'ddga-progress--sm',\n md: 'ddga-progress--md',\n lg: 'ddga-progress--lg',\n },\n color: {\n primary: 'ddga-progress--primary',\n success: 'ddga-progress--success',\n warning: 'ddga-progress--warning',\n destructive: 'ddga-progress--destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n },\n});\n\nconst circularProgressVariants = cva('ddga-circular-progress', {\n variants: {\n size: {\n sm: 'ddga-circular-progress--sm',\n md: 'ddga-circular-progress--md',\n lg: 'ddga-circular-progress--lg',\n },\n color: {\n primary: 'ddga-circular-progress--primary',\n success: 'ddga-circular-progress--success',\n warning: 'ddga-circular-progress--warning',\n destructive: 'ddga-circular-progress--destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n },\n});\n\n// ─── 2. Linear Progress (Radix) ─── //\n\ntype ProgressOwnProps = VariantProps<typeof progressVariants> & {\n /**\n * Current progress. `null` (or omitted) renders the indeterminate animation.\n * Otherwise clamp yourself to `[0, max]` — Radix Progress assumes the value\n * is in range.\n */\n value?: number | null;\n /** Maximum value. Defaults to 100. */\n max?: number;\n /**\n * Accessible label for the progressbar. Required for assistive tech —\n * Radix logs a warning if neither `aria-label` nor `aria-labelledby` is set.\n */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\ntype ProgressProps = ProgressOwnProps &\n Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, keyof ProgressOwnProps>;\n\nfunction Progress({ value = null, max = 100, size, color, className, ...props }: ProgressProps) {\n const isIndeterminate = value === null;\n const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n value={value}\n max={max}\n className={cn(progressVariants({ size, color }), className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"ddga-progress__indicator\"\n style={isIndeterminate ? undefined : { transform: `translateX(${pct - 100}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\n// ─── 3. Circular Progress (custom SVG) ─── //\n\ntype CircularProgressOwnProps = VariantProps<typeof circularProgressVariants> & {\n value?: number | null;\n max?: number;\n /** Stroke width in px. Defaults to 4 (sm) / 5 (md) / 6 (lg). */\n thickness?: number;\n /** Render the percentage label inside the ring. */\n showLabel?: boolean;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\ntype CircularProgressProps = CircularProgressOwnProps &\n Omit<React.ComponentProps<'div'>, keyof CircularProgressOwnProps>;\n\nconst CIRCULAR_SIZES = { sm: 32, md: 48, lg: 72 } as const;\nconst CIRCULAR_DEFAULT_THICKNESS = { sm: 4, md: 5, lg: 6 } as const;\n\nfunction CircularProgress({\n value = null,\n max = 100,\n size,\n color,\n thickness,\n showLabel = false,\n className,\n ...props\n}: CircularProgressProps) {\n const isIndeterminate = value === null;\n const sizeKey = size ?? 'md';\n const diameter = CIRCULAR_SIZES[sizeKey];\n const strokeWidth = thickness ?? CIRCULAR_DEFAULT_THICKNESS[sizeKey];\n const radius = (diameter - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n\n const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n const dashOffset = isIndeterminate ? circumference * 0.75 : circumference * (1 - pct / 100);\n\n // Mirror Radix Progress's data-state vocabulary so CSS can use a single\n // selector across linear + circular.\n const state = isIndeterminate ? 'indeterminate' : value >= max ? 'complete' : 'loading';\n\n return (\n <div\n data-slot=\"circular-progress\"\n data-state={state}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={isIndeterminate ? undefined : value}\n className={cn(circularProgressVariants({ size, color }), className)}\n style={{ inlineSize: diameter, blockSize: diameter }}\n {...props}\n >\n <svg\n className=\"ddga-circular-progress__svg\"\n viewBox={`0 0 ${diameter} ${diameter}`}\n width={diameter}\n height={diameter}\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <circle\n className=\"ddga-circular-progress__track\"\n cx={diameter / 2}\n cy={diameter / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n />\n <circle\n className=\"ddga-circular-progress__indicator\"\n cx={diameter / 2}\n cy={diameter / 2}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n transform={`rotate(-90 ${diameter / 2} ${diameter / 2})`}\n />\n </svg>\n {showLabel && !isIndeterminate ? (\n <span className=\"ddga-circular-progress__label\" aria-hidden=\"true\">\n {Math.round(pct)}%\n </span>\n ) : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Progress, CircularProgress, progressVariants, circularProgressVariants };\nexport type { ProgressProps, CircularProgressProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\nconst dropdownMenuVariants = cva('ddga-dropdown-menu', {\n variants: {\n size: {\n sm: 'ddga-dropdown-menu--sm',\n md: 'ddga-dropdown-menu--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Root + Trigger (Radix pass-throughs) ─── //\n\ntype DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\n\nfunction DropdownMenu(props: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root {...props} />;\n}\n\ntype DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;\n\nfunction DropdownMenuTrigger(props: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n// ─── 3. Content (portal-anchored) ─── //\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content> &\n VariantProps<typeof dropdownMenuVariants>;\n\nfunction DropdownMenuContent({\n size,\n className,\n sideOffset = 6,\n ...props\n}: DropdownMenuContentProps) {\n // Radix Portal defaults to <body>, which doesn't inherit DgaProvider's\n // data-theme / CSS vars. Re-anchor at the provider's body-level portal\n // container (mirrors data-theme + dir + theme vars from the provider) so\n // dropdown inherits theme AND escapes any clipping or transform ancestor\n // that would trap an in-tree portal. Falls back to <body> when used\n // outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(dropdownMenuVariants({ size }), className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n// ─── 4. Item + variants ─── //\n\ntype DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /** Style as a destructive action (red text, red hover). */\n destructive?: boolean;\n /** Icon rendered before the label. Sized to 1em. */\n startIcon?: ReactNode;\n /** Trailing text shown muted, e.g. a keyboard shortcut hint (\"⌘K\"). */\n shortcut?: ReactNode;\n};\n\nfunction DropdownMenuItem({\n className,\n destructive,\n startIcon,\n shortcut,\n children,\n ...props\n}: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-destructive={destructive ? '' : undefined}\n className={cn('ddga-dropdown-menu__item', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-dropdown-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n {shortcut ? (\n <span className=\"ddga-dropdown-menu__shortcut\" aria-hidden=\"true\">\n {shortcut}\n </span>\n ) : null}\n </DropdownMenuPrimitive.Item>\n );\n}\n\n// ─── 5. CheckboxItem + RadioItem ─── //\n\ntype DropdownMenuCheckboxItemProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n onSelect,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n // Default UX: keep the menu open across toggles so consumers can flip\n // multiple checkboxes in one pass. If a consumer passes their own onSelect,\n // they own the behavior (call `event.preventDefault()` to keep this default).\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-dropdown-menu__indicator\" aria-hidden=\"true\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"ddga-dropdown-menu__indicator-icon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\ntype DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;\n\nfunction DropdownMenuRadioGroup(props: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\ntype DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n onSelect,\n ...props\n}: DropdownMenuRadioItemProps) {\n // Same default-open behavior as CheckboxItem — selecting a radio without\n // the menu visually confirming the new state is a frustrating dead-feel.\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-dropdown-menu__indicator\" aria-hidden=\"true\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"ddga-dropdown-menu__radio-dot\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n// ─── 6. Label + Separator + Group ─── //\n\ntype DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label>;\n\nfunction DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('ddga-dropdown-menu__group-label', className)}\n {...props}\n />\n );\n}\n\ntype DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('ddga-dropdown-menu__separator', className)}\n {...props}\n />\n );\n}\n\ntype DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;\n\nfunction DropdownMenuGroup(props: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n// ─── 7. Submenu (Sub + SubTrigger + SubContent) ─── //\n\ntype DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;\n\nfunction DropdownMenuSub(props: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub {...props} />;\n}\n\ntype DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n startIcon?: ReactNode;\n};\n\nfunction DropdownMenuSubTrigger({\n className,\n startIcon,\n children,\n ...props\n}: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--sub', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-dropdown-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n <ChevronRight className=\"ddga-dropdown-menu__sub-chevron\" aria-hidden=\"true\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent> &\n VariantProps<typeof dropdownMenuVariants>;\n\nfunction DropdownMenuSubContent({ size, className, ...props }: DropdownMenuSubContentProps) {\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(dropdownMenuVariants({ size }), className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n// ─── 8. Exports ─── //\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n dropdownMenuVariants,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuLabelProps,\n DropdownMenuSeparatorProps,\n DropdownMenuGroupProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n","'use client';\n\nimport { useContext } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants ─── //\n//\n// Drawer reuses Radix Dialog under the hood (same focus trap + scroll lock +\n// ESC contract as Modal), but slides in from an edge instead of centering.\n// `side` uses logical names — `start`/`end` flip with `dir`, so the same\n// markup works for both LTR and RTL without the consumer doing anything.\n\nconst drawerVariants = cva('ddga-drawer', {\n variants: {\n side: {\n start: 'ddga-drawer--start',\n end: 'ddga-drawer--end',\n top: 'ddga-drawer--top',\n bottom: 'ddga-drawer--bottom',\n },\n size: {\n sm: 'ddga-drawer--sm',\n md: 'ddga-drawer--md',\n lg: 'ddga-drawer--lg',\n full: 'ddga-drawer--full',\n },\n },\n defaultVariants: {\n side: 'end',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ntype DrawerProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype DrawerTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype DrawerCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface DrawerContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n /** Show the corner X close button. Defaults to `true`. */\n showCloseButton?: boolean;\n /** Localized aria-label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ntype DrawerSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface DrawerTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n asChild?: boolean;\n}\n\ninterface DrawerDescriptionProps extends React.ComponentProps<typeof DialogPrimitive.Description> {\n asChild?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Drawer(props: DrawerProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction DrawerTrigger({ className, ...props }: DrawerTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"drawer-trigger\" className={className} {...props} />;\n}\n\nfunction DrawerContent({\n side,\n size,\n showCloseButton = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: DrawerContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container so\n // theming + dark mode inherit AND `position: fixed` stays anchored to the\n // viewport (any `transform` ancestor would otherwise reparent the\n // containing block and clip the drawer). Regression test mirrors\n // Select/Modal/DropdownMenu.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay className=\"ddga-drawer__overlay\" data-slot=\"drawer-overlay\" />\n <DialogPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerVariants({ side, size }), className)}\n {...props}\n >\n {children}\n {showCloseButton ? (\n <DialogPrimitive.Close\n className=\"ddga-drawer__close\"\n aria-label={closeLabel}\n data-slot=\"drawer-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction DrawerHeader({ asChild, className, ...props }: DrawerSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"drawer-header\" className={cn('ddga-drawer__header', className)} {...props} />\n );\n}\n\nfunction DrawerTitle({ asChild, className, ...props }: DrawerTitleProps) {\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"drawer-title\"\n className={cn('ddga-drawer__title', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({ asChild, className, ...props }: DrawerDescriptionProps) {\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"drawer-description\"\n className={cn('ddga-drawer__description', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerBody({ asChild, className, ...props }: DrawerSectionProps) {\n // Scrollable middle region — keeps Header/Footer pinned while the body\n // overflows. Separate from Header/Footer so consumers can opt in.\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"drawer-body\" className={cn('ddga-drawer__body', className)} {...props} />;\n}\n\nfunction DrawerFooter({ asChild, className, ...props }: DrawerSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"drawer-footer\" className={cn('ddga-drawer__footer', className)} {...props} />\n );\n}\n\nfunction DrawerClose({ className, ...props }: DrawerCloseProps) {\n return <DialogPrimitive.Close data-slot=\"drawer-close\" className={className} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n DrawerDescription,\n DrawerBody,\n DrawerFooter,\n DrawerClose,\n drawerVariants,\n};\nexport type {\n DrawerProps,\n DrawerTriggerProps,\n DrawerContentProps,\n DrawerSectionProps,\n DrawerTitleProps,\n DrawerDescriptionProps,\n DrawerCloseProps,\n};\n","'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\nimport { Command } from 'cmdk';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronDown } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Trigger height matches Input/Select so a Combobox lines up in a form row.\nconst comboboxTriggerVariants = cva('ddga-combobox-trigger', {\n variants: {\n size: {\n sm: 'ddga-combobox-trigger--sm',\n md: 'ddga-combobox-trigger--md',\n },\n error: {\n true: 'ddga-combobox-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Keep a no-op `comboboxVariants` for parity with the project's barrel\n// convention (every component re-exports a *Variants from its barrel).\nconst comboboxVariants = comboboxTriggerVariants;\n\n// ─── 2. Context (bridges Root state to Items + label lookup) ─── //\n//\n// Items register `value → label` on mount so the trigger can render the\n// selected option's human-readable label without consumers having to thread\n// a separate `displayValue` function in the common case. Async-loaded\n// options can still override via `<Combobox getLabel={...}>` below.\n\ninterface ComboboxContextValue {\n value?: string;\n select: (value: string) => void;\n}\n\nconst ComboboxContext = createContext<ComboboxContextValue | null>(null);\n\nfunction useComboboxContext(component: string): ComboboxContextValue {\n const ctx = useContext(ComboboxContext);\n if (!ctx) {\n throw new Error(`<${component}> must be rendered inside <Combobox>.`);\n }\n return ctx;\n}\n\n// ─── 3. Types ─── //\n\ninterface ComboboxProps extends VariantProps<typeof comboboxTriggerVariants> {\n /** Currently selected option value (controlled). */\n value?: string;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /** Fires whenever the selection changes (controlled or uncontrolled). */\n onValueChange?: (value: string) => void;\n /** Controlled popover open state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Visible label above the trigger. */\n label?: ReactNode;\n /** Hint shown below the trigger when there's no error. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid — sets `aria-invalid` and the error border. */\n error?: boolean;\n /** Marks the field required — adds the asterisk + `aria-required`. */\n required?: boolean;\n /** Disables the trigger entirely. */\n disabled?: boolean;\n /** Placeholder shown in the trigger when no value is selected. */\n placeholder?: ReactNode;\n /** Placeholder for the search input inside the panel. Defaults to `\"Search…\"`. */\n searchPlaceholder?: string;\n /** Shown when no item matches the search query. Defaults to `\"No results.\"`. */\n emptyMessage?: ReactNode;\n /**\n * Override the trigger label resolver — useful when items are loaded async\n * after the value is set, or when the trigger should show a richer label\n * than the item's rendered children. Receives the current value, returns\n * the node to display. Falls back to the registered item's label.\n */\n getLabel?: (value: string) => ReactNode;\n /** Caller-supplied id for the trigger; falls back to a generated one. */\n id?: string;\n /** Forwarded to the trigger (the focusable button). */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `<ComboboxItem>` (+ optional Group / Separator) children. */\n children: ReactNode;\n}\n\ninterface ComboboxItemProps extends Omit<\n React.ComponentProps<typeof Command.Item>,\n 'value' | 'onSelect'\n> {\n /** Stable value for filtering + selection. */\n value: string;\n /** Extra search terms cmdk should match against the input. */\n keywords?: string[];\n /** Disable this item from selection. */\n disabled?: boolean;\n /** Optional select handler — fires alongside the root's `onValueChange`. */\n onSelect?: (value: string) => void;\n}\n\ninterface ComboboxGroupProps extends React.ComponentProps<typeof Command.Group> {\n /** Group heading rendered above its items. */\n heading?: ReactNode;\n}\n\ntype ComboboxSeparatorProps = React.ComponentProps<typeof Command.Separator>;\n\n// ─── 4. Root ─── //\n\nfunction Combobox({\n value: controlledValue,\n defaultValue,\n onValueChange,\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n size,\n placeholder,\n searchPlaceholder = 'Search…',\n emptyMessage = 'No results.',\n getLabel,\n id: externalId,\n className,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}: ComboboxProps) {\n // Uncontrolled fallbacks.\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue);\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n const isOpenControlled = controlledOpen !== undefined;\n const open = isOpenControlled ? controlledOpen : internalOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const select = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [isControlled, onValueChange, setOpen],\n );\n\n const ctx = useMemo<ComboboxContextValue>(() => ({ value, select }), [value, select]);\n\n // Walk `children` once to build a value → label map. Synchronous so the\n // trigger shows the right label on first render — registration via\n // useEffect would only fire when items mount, and items don't mount until\n // the popover opens (Radix Portal lazy-mounts). Recurses through\n // `ComboboxGroup` so grouped items still resolve. Bare children only —\n // doesn't dive into arbitrary nested DOM.\n const itemLabels = useMemo<Map<string, ReactNode>>(() => {\n const map = new Map<string, ReactNode>();\n const visit = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (!isValidElement(child)) return;\n const childProps = child.props as { value?: unknown; children?: ReactNode };\n if (typeof childProps.value === 'string') {\n map.set(childProps.value, childProps.children);\n } else if (childProps.children) {\n visit(childProps.children);\n }\n });\n };\n visit(children);\n return map;\n }, [children]);\n\n // Field a11y wiring — same primitive as Select.\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Combobox',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n });\n\n // Portal anchored to DgaProvider root (mirrors Select/Modal/DropdownMenu).\n const providerCtx = useContext(DgaContext);\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = providerCtx?.portalEl ?? providerCtx?.rootEl ?? undefined;\n\n // Trigger label — explicit override wins; otherwise look up from the\n // children-derived map; otherwise fall back to the placeholder.\n const triggerLabel = useMemo<ReactNode>(() => {\n if (value === undefined) return null;\n if (getLabel) return getLabel(value);\n return itemLabels.get(value) ?? null;\n }, [value, getLabel, itemLabels]);\n\n const searchId = useId();\n\n return (\n <ComboboxContext.Provider value={ctx}>\n <div data-slot=\"combobox-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-combobox__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-combobox__required\">\n *\n </span>\n )}\n </label>\n )}\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n type=\"button\"\n {...controlProps}\n // Trigger stays a plain button — Radix Popover.Trigger sets\n // aria-haspopup + aria-expanded + aria-controls so AT users\n // hear \"Pick a fruit, button, has popup\". We declared role=\"combobox\"\n // earlier but it requires aria-controls pointing to the listbox,\n // which Radix wires for dialog semantics — axe flagged the mismatch.\n aria-required={required || undefined}\n disabled={disabled}\n data-slot=\"combobox-trigger\"\n className={cn(comboboxTriggerVariants({ size, error: hasError }), className)}\n >\n <span className=\"ddga-combobox__value\">\n {triggerLabel ?? <span className=\"ddga-combobox__placeholder\">{placeholder}</span>}\n </span>\n <ChevronDown aria-hidden=\"true\" className=\"ddga-combobox__icon\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n data-slot=\"combobox-content\"\n className=\"ddga-combobox-content\"\n sideOffset={4}\n align=\"start\"\n // Popover.Content is role=\"dialog\" → axe requires an accessible\n // name. Use the field label when it's a string; otherwise fall\n // back to a generic \"Options\" so a11y stays valid even when the\n // consumer composes a rich React node as the label.\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : 'Options')}\n aria-labelledby={ariaLabelledBy}\n // Match trigger width so the panel doesn't visually float over.\n style={{ inlineSize: 'var(--radix-popover-trigger-width)' }}\n onOpenAutoFocus={(event) => {\n // cmdk handles its own focus management (Input gets focused on\n // mount via autoFocus below). Prevent Radix from also moving\n // focus or we lose the search input as the auto-focus target.\n event.preventDefault();\n }}\n >\n <Command\n id={searchId}\n data-slot=\"combobox-command\"\n className=\"ddga-combobox-command\"\n // cmdk's default filter matches if the input is a substring of\n // the item value OR any keyword — fine for our v1 use case.\n >\n <Command.Input\n autoFocus\n placeholder={searchPlaceholder}\n data-slot=\"combobox-input\"\n className=\"ddga-combobox-input\"\n />\n <Command.List data-slot=\"combobox-list\" className=\"ddga-combobox-list\">\n <Command.Empty data-slot=\"combobox-empty\" className=\"ddga-combobox-empty\">\n {emptyMessage}\n </Command.Empty>\n {children}\n </Command.List>\n </Command>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n </ComboboxContext.Provider>\n );\n}\n\n// ─── 5. Item ─── //\n\nfunction ComboboxItem({\n value,\n keywords,\n disabled,\n onSelect,\n className,\n children,\n ...props\n}: ComboboxItemProps) {\n const { value: selectedValue, select } = useComboboxContext('ComboboxItem');\n\n const isSelected = selectedValue === value;\n\n return (\n <Command.Item\n value={value}\n keywords={keywords}\n disabled={disabled}\n onSelect={(v) => {\n onSelect?.(v);\n select(v);\n }}\n data-slot=\"combobox-item\"\n // cmdk owns `data-selected` for keyboard highlight — use a separate\n // attribute for the chosen value so the two don't collide.\n data-active={isSelected ? '' : undefined}\n className={cn('ddga-combobox-item', className)}\n {...props}\n >\n <span className=\"ddga-combobox-item__check\" aria-hidden=\"true\">\n {isSelected ? <Check /> : null}\n </span>\n <span className=\"ddga-combobox-item__label\">{children}</span>\n </Command.Item>\n );\n}\n\n// ─── 6. Group + Separator (cmdk passthroughs) ─── //\n\nfunction ComboboxGroup({ className, heading, ...props }: ComboboxGroupProps) {\n return (\n <Command.Group\n heading={heading}\n data-slot=\"combobox-group\"\n className={cn('ddga-combobox-group', className)}\n {...props}\n />\n );\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <Command.Separator\n data-slot=\"combobox-separator\"\n className={cn('ddga-combobox-separator', className)}\n {...props}\n />\n );\n}\n\n// ─── 7. Exports ─── //\n\nexport {\n Combobox,\n ComboboxItem,\n ComboboxGroup,\n ComboboxSeparator,\n comboboxTriggerVariants,\n comboboxVariants,\n};\nexport type { ComboboxProps, ComboboxItemProps, ComboboxGroupProps, ComboboxSeparatorProps };\n","'use client';\n\nimport { useCallback, useContext, useMemo, useState, type ReactNode } from 'react';\nimport {\n Button as AriaButton,\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarStateContext as AriaCalendarStateContext,\n DateInput as AriaDateInput,\n DatePicker as AriaDatePicker,\n DateSegment as AriaDateSegment,\n Dialog as AriaDialog,\n FieldError as AriaFieldError,\n Group as AriaGroup,\n I18nProvider,\n Label as AriaLabel,\n Popover as AriaPopover,\n Text as AriaText,\n} from 'react-aria-components';\nimport {\n CalendarDate,\n GregorianCalendar,\n IslamicUmalquraCalendar,\n toCalendar,\n type DateValue,\n} from '@internationalized/date';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { CalendarIcon, ChevronLeft, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Applied to the Group (the trigger row). Heights match Input/Select sm/md so\n// a DatePicker lines up with other fields in a form row.\nconst datePickerTriggerVariants = cva('ddga-date-picker-trigger', {\n variants: {\n size: {\n sm: 'ddga-date-picker-trigger--sm',\n md: 'ddga-date-picker-trigger--md',\n },\n error: {\n true: 'ddga-date-picker-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Passthrough alias so the barrel `*Variants` convention holds across\n// components. Same value, different name.\nconst datePickerVariants = datePickerTriggerVariants;\n\n// ─── 2. Date ↔ CalendarDate (Gregorian) normalization ─── //\n\n// Public API is `Date | null` so consumers don't take a dep on\n// `@internationalized/date`. Internally we round-trip through a Gregorian\n// `CalendarDate` so the Hijri toggle is purely a *display* concern — the\n// stored value is always the same absolute day, regardless of which calendar\n// the user was looking at when they picked it.\n\nfunction dateToCalendarDate(date: Date | null | undefined): CalendarDate | null {\n if (!date) return null;\n // Extract LOCAL Y/M/D, not UTC. The contract is date-only; converting\n // through UTC would shift the day across timezone boundaries.\n return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());\n}\n\nfunction calendarDateToDate(value: DateValue | null | undefined): Date | null {\n if (!value) return null;\n // Defensive: if a future feature ever passes a non-Gregorian CalendarDate\n // as value, convert. Today the contract is Gregorian-only.\n const greg =\n value.calendar.identifier === 'gregory' ? value : toCalendar(value, new GregorianCalendar());\n return new Date(greg.year, greg.month - 1, greg.day);\n}\n\n// ─── 3. Locale composition (DGA locale + optional calendar override) ─── //\n\ntype CalendarSystem = 'gregorian' | 'hijri';\n\nfunction composeLocale(dgaLocale: string, calendar: CalendarSystem): string {\n // Promote a bare 'ar'/'en' from DgaProvider to a regional tag so react-aria\n // picks the right defaults (week start, weekday names). 'ar-SA' matches the\n // DGA target audience; 'en-US' is the conventional English default.\n const base = dgaLocale === 'ar' ? 'ar-SA' : dgaLocale === 'en' ? 'en-US' : dgaLocale;\n // DGA convention: Latin digits (0–9) at all times, regardless of calendar\n // or UI language. Without this, `ar-*` locales default to Arabic-Indic\n // numerals (٠–٩) on segments + calendar cells, which makes month/year\n // dropdowns and cross-calendar comparisons harder to read. The Unicode\n // `-u-` extension carries both calendar and numbering-system keys when\n // both apply, separated by single `-`.\n const isArabic = base.startsWith('ar');\n if (calendar === 'hijri') {\n return isArabic ? `${base}-u-ca-islamic-umalqura-nu-latn` : `${base}-u-ca-islamic-umalqura`;\n }\n return isArabic ? `${base}-u-nu-latn` : base;\n}\n\n// ─── 4. Types ─── //\n\ninterface CalendarLabels {\n gregorian: string;\n hijri: string;\n}\n\ninterface DatePickerProps extends VariantProps<typeof datePickerTriggerVariants> {\n /** Currently selected date (controlled). Local Y/M/D. */\n value?: Date | null;\n /** Initial value when uncontrolled. */\n defaultValue?: Date | null;\n /** Fires whenever the user picks a day. `null` when cleared. */\n onChange?: (value: Date | null) => void;\n /** Earliest pickable date (inclusive). */\n minValue?: Date;\n /** Latest pickable date (inclusive). */\n maxValue?: Date;\n /** Visible label above the trigger. */\n label?: ReactNode;\n /** Hint shown below the trigger. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid — sets `aria-invalid` and error styling. */\n error?: boolean;\n /** Marks the field required — adds the asterisk + `aria-required`. */\n required?: boolean;\n /** Disables the trigger entirely. */\n disabled?: boolean;\n /** Caller-supplied id for the field. */\n id?: string;\n /** Forwarded to the Group (the trigger row), matching Input/Select. */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /**\n * Calendar system (controlled). Omit to let the user toggle freely with\n * the in-popover switch.\n */\n calendar?: CalendarSystem;\n /** Initial calendar system when uncontrolled. Defaults to `'gregorian'`. */\n defaultCalendar?: CalendarSystem;\n /** Fires whenever the calendar system toggles. */\n onCalendarChange?: (calendar: CalendarSystem) => void;\n /**\n * Show the Gregorian↔Hijri toggle inside the popover. Defaults to `true`,\n * but is forced off when `calendar` is controlled — a toggle that ignores\n * its click is a worse footgun than no toggle.\n */\n showCalendarToggle?: boolean;\n /** Override the toggle labels. Defaults are locale-aware (English / Arabic). */\n calendarLabels?: CalendarLabels;\n /**\n * When `true`, each day cell also shows the *other* calendar's day number\n * as small secondary text (e.g., Hijri active → Gregorian day shown small\n * underneath). Helps users cross-reference dates between calendar systems\n * without round-tripping the toggle. Defaults to `false`.\n */\n showSecondaryCalendar?: boolean;\n}\n\n// ─── 4b. Secondary-calendar helpers ─── //\n\n// Lazily-instantiated calendar objects — react-aria's calendar instances are\n// stateless and cheap to keep around at module scope.\nconst GREGORIAN = new GregorianCalendar();\nconst ISLAMIC_UMALQURA = new IslamicUmalquraCalendar();\n\nfunction secondaryDayNumber(date: DateValue, mainCalendar: CalendarSystem): number {\n const other = mainCalendar === 'hijri' ? GREGORIAN : ISLAMIC_UMALQURA;\n return toCalendar(date, other).day;\n}\n\n// ─── 4c. Calendar nav header (month + year dropdowns) ─── //\n\n// Sub-component rendered inside <Calendar> so it can consume\n// `CalendarStateContext`. The Calendar state owns `focusedDate` (which month\n// is visible) and `setFocusedDate` — by hooking into it directly we avoid\n// duplicating state in the outer DatePicker, and the dropdowns stay in sync\n// with the prev/next buttons and keyboard navigation automatically.\nfunction CalendarNavHeader({ locale, monthLabel, yearLabel }: CalendarNavHeaderProps) {\n const state = useContext(AriaCalendarStateContext);\n\n // Pull state fields with safe fallbacks so the hook calls below stay\n // unconditional (rules-of-hooks). Rendering still bails when state is\n // null — `<CalendarNavHeader>` is meant to live inside `<Calendar>`.\n const focusedDate = state?.focusedDate ?? null;\n const focusedYear = focusedDate?.year ?? 0;\n const focusedCalendar = focusedDate?.calendar ?? GREGORIAN;\n const minValue = state?.minValue ?? null;\n const maxValue = state?.maxValue ?? null;\n\n // Localized month names in the active calendar. Hijri month 1 (\"Muharram\")\n // through 12 (\"Dhu al-Hijjah\") translate correctly because the locale\n // string carries `-u-ca-islamic-umalqura`; for Gregorian it's plain\n // January–December (or يناير–ديسمبر under Arabic).\n const monthNames = useMemo(() => {\n if (!focusedDate) return [];\n const fmt = new Intl.DateTimeFormat(locale, { month: 'long' });\n return Array.from({ length: 12 }, (_, i) => {\n // Build a date in the same calendar as focusedDate, month i+1, day 1.\n // Day 1 is always valid; year stays the focused year so month names in\n // calendars whose names vary by year (rare, but possible) stay\n // accurate.\n const cd = new CalendarDate(focusedCalendar, focusedYear, i + 1, 1);\n // Intl.DateTimeFormat needs a JS Date; convert via Gregorian.\n const greg = toCalendar(cd, GREGORIAN);\n const js = new Date(greg.year, greg.month - 1, greg.day);\n return fmt.format(js);\n });\n }, [locale, focusedDate, focusedCalendar, focusedYear]);\n\n // Year range. minValue / maxValue from CalendarState are in whatever\n // calendar the consumer passed (Gregorian in our case); convert to the\n // focused calendar's year. Defaults span 100 years back to 30 forward —\n // covers birth-year picking plus near-future scheduling without being\n // overwhelming. Consumers needing wider ranges should set min/maxValue.\n const yearOptions = useMemo(() => {\n if (!focusedDate) return [];\n const minY = minValue ? toCalendar(minValue, focusedCalendar).year : focusedYear - 100;\n const maxY = maxValue ? toCalendar(maxValue, focusedCalendar).year : focusedYear + 30;\n // Ensure the currently focused year is always present (e.g., if the\n // consumer sets a tight min/max but focusedDate somehow lands outside).\n const start = Math.min(minY, focusedYear);\n const end = Math.max(maxY, focusedYear);\n return Array.from({ length: end - start + 1 }, (_, i) => start + i);\n }, [focusedDate, focusedCalendar, focusedYear, minValue, maxValue]);\n\n if (!state || !focusedDate) return null;\n\n return (\n <div className=\"ddga-date-picker-calendar__nav-selects\" data-slot=\"date-picker-calendar-nav\">\n <select\n aria-label={monthLabel}\n className=\"ddga-date-picker-calendar__select ddga-date-picker-calendar__month-select\"\n data-slot=\"date-picker-month-select\"\n value={focusedDate.month}\n onChange={(e) => state.setFocusedDate(focusedDate.set({ month: Number(e.target.value) }))}\n >\n {monthNames.map((name, i) => (\n <option key={i + 1} value={i + 1}>\n {name}\n </option>\n ))}\n </select>\n <select\n aria-label={yearLabel}\n className=\"ddga-date-picker-calendar__select ddga-date-picker-calendar__year-select\"\n data-slot=\"date-picker-year-select\"\n value={focusedDate.year}\n onChange={(e) => state.setFocusedDate(focusedDate.set({ year: Number(e.target.value) }))}\n >\n {yearOptions.map((y) => (\n <option key={y} value={y}>\n {y}\n </option>\n ))}\n </select>\n </div>\n );\n}\n\ninterface CalendarNavHeaderProps {\n locale: string;\n monthLabel: string;\n yearLabel: string;\n}\n\n// ─── 4d. Outside-month cell wrapper ─── //\n\n// react-aria marks outside-month cells as disabled by design — the standard\n// Calendar UX uses arrows / dropdowns / keyboard for cross-month navigation.\n// But many DGA flows want one-click selection of an adjacent month's day, so\n// we render a parallel <button> for those cells that bypasses the disabled\n// state, drives `setFocusedDate` + `selectDate` manually, and preserves the\n// rest of react-aria's a11y wiring for inside-month cells.\nfunction CalendarDayCell({ date, showSecondary, calendarSystem }: CalendarDayCellProps) {\n const state = useContext(AriaCalendarStateContext);\n\n // Visible range start tells us the \"current\" month being shown. Anything\n // with a different (year, month) pair is outside-month.\n const start = state?.visibleRange.start;\n const isOutside = !!start && (date.year !== start.year || date.month !== start.month);\n\n // For outside-month cells, also confirm they're inside min/max bounds —\n // otherwise they should genuinely render disabled. `state.isInvalid` is\n // bounds-only (min/max); `isCellDisabled` also marks outside-month as\n // disabled internally, which would block our wrapper from activating.\n const isOutOfBounds = state ? state.isInvalid(date) : false;\n\n if (state && isOutside && !isOutOfBounds) {\n const selected = state.value;\n const isSelected =\n !!selected &&\n selected.year === date.year &&\n selected.month === date.month &&\n selected.day === date.day;\n\n const handleSelect = () => {\n // Update focused-month first so the visible page jumps, then commit the\n // selection. React batches these into one re-render — the popover\n // closes via `shouldCloseOnSelect`, and the next time the user opens\n // it, the now-selected month is on screen.\n state.setFocusedDate(date);\n state.selectDate(date);\n };\n\n return (\n <td role=\"gridcell\">\n <button\n type=\"button\"\n // Outside the keyboard nav chain (react-aria's inside-month cells\n // own that). Mouse users get the shortcut; keyboard users still\n // navigate via arrows or the month/year dropdowns.\n tabIndex={-1}\n className=\"ddga-date-picker-calendar__cell\"\n data-outside-month=\"\"\n data-selected={isSelected ? '' : undefined}\n data-slot=\"date-picker-day-cell\"\n onClick={handleSelect}\n >\n {showSecondary ? (\n <>\n <span className=\"ddga-date-picker-calendar__cell-primary\">{date.day}</span>\n <span aria-hidden=\"true\" className=\"ddga-date-picker-calendar__cell-secondary\">\n {secondaryDayNumber(date, calendarSystem)}\n </span>\n </>\n ) : (\n String(date.day)\n )}\n </button>\n </td>\n );\n }\n\n return (\n <AriaCalendarCell date={date} className=\"ddga-date-picker-calendar__cell\">\n {({ formattedDate }) =>\n showSecondary ? (\n <>\n <span className=\"ddga-date-picker-calendar__cell-primary\">{formattedDate}</span>\n <span aria-hidden=\"true\" className=\"ddga-date-picker-calendar__cell-secondary\">\n {secondaryDayNumber(date, calendarSystem)}\n </span>\n </>\n ) : (\n formattedDate\n )\n }\n </AriaCalendarCell>\n );\n}\n\ninterface CalendarDayCellProps {\n date: CalendarDate;\n showSecondary: boolean;\n calendarSystem: CalendarSystem;\n}\n\n// ─── 5. Component ─── //\n\nfunction DatePicker({\n value: controlledValue,\n defaultValue,\n onChange,\n minValue,\n maxValue,\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n size,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n calendar: controlledCalendar,\n defaultCalendar = 'gregorian',\n onCalendarChange,\n showCalendarToggle = true,\n calendarLabels,\n showSecondaryCalendar = false,\n}: DatePickerProps) {\n // ─ value: controlled or uncontrolled, always Gregorian internally ─\n const isValueControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState<CalendarDate | null>(() =>\n dateToCalendarDate(defaultValue),\n );\n const value = isValueControlled ? dateToCalendarDate(controlledValue) : internalValue;\n\n const handleAriaChange = useCallback(\n (next: DateValue | null) => {\n const nextCD = next ? new CalendarDate(next.year, next.month, next.day) : null;\n if (!isValueControlled) setInternalValue(nextCD);\n onChange?.(calendarDateToDate(nextCD));\n },\n [isValueControlled, onChange],\n );\n\n // ─ calendar system: controlled or uncontrolled ─\n const isCalendarControlled = controlledCalendar !== undefined;\n const [internalCalendar, setInternalCalendar] = useState<CalendarSystem>(defaultCalendar);\n const calendarSystem = isCalendarControlled ? controlledCalendar : internalCalendar;\n\n const setCalendar = useCallback(\n (next: CalendarSystem) => {\n if (!isCalendarControlled) setInternalCalendar(next);\n onCalendarChange?.(next);\n },\n [isCalendarControlled, onCalendarChange],\n );\n\n // ─ Locale composition ─\n const dgaCtx = useContext(DgaContext);\n const dgaLocale = dgaCtx?.locale ?? 'en';\n const ariaLocale = useMemo(\n () => composeLocale(dgaLocale, calendarSystem),\n [dgaLocale, calendarSystem],\n );\n\n // ─ Portal container (theming + dark-mode inheritance) ─\n // react-aria's Popover renders to a portal under <body> by default — same\n // problem Radix has. UNSTABLE_portalContainer (typed as Element) lets us\n // re-anchor under DgaProvider's root so data-theme, theme vars, and\n // .ddga-theme-* classes inherit into the calendar dropdown. Falls back to\n // <body> when used standalone (no provider).\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = (dgaCtx?.portalEl ?? dgaCtx?.rootEl ?? undefined) as Element | undefined;\n\n // ─ Prev/next nav icons — swap by direction ─\n // In RTL, \"previous\" sits visually on the right and should point right;\n // \"next\" sits on the left and points left. Swapping the icon components\n // (rather than CSS-flipping via [dir='rtl']) is more robust because it\n // doesn't depend on the portal inheriting the dir attribute correctly.\n const dgaDir = dgaCtx?.dir ?? 'ltr';\n const PrevChevron = dgaDir === 'rtl' ? ChevronRight : ChevronLeft;\n const NextChevron = dgaDir === 'rtl' ? ChevronLeft : ChevronRight;\n\n // ─ Toggle labels: locale-aware default ─\n const resolvedLabels = useMemo<CalendarLabels>(() => {\n if (calendarLabels) return calendarLabels;\n const isArabic = dgaLocale.startsWith('ar');\n return isArabic\n ? { gregorian: 'ميلادي', hijri: 'هجري' }\n : { gregorian: 'Gregorian', hijri: 'Hijri' };\n }, [calendarLabels, dgaLocale]);\n\n // ─ Calendar nav labels (aria-labels for the month/year selects) ─\n const navLabels = useMemo(\n () =>\n dgaLocale.startsWith('ar')\n ? { month: 'الشهر', year: 'السنة' }\n : { month: 'Month', year: 'Year' },\n [dgaLocale],\n );\n\n // ─ Bounds ─\n const ariaMinValue = useMemo(() => dateToCalendarDate(minValue) ?? undefined, [minValue]);\n const ariaMaxValue = useMemo(() => dateToCalendarDate(maxValue) ?? undefined, [maxValue]);\n\n // ─ Popover aria-label fallback ─\n // Dialog requires an accessible name; derive from the field label when\n // possible (string-only), else fall back to a generic so a11y stays valid\n // even when consumers compose a rich label node.\n const dialogAriaLabel =\n ariaLabel ?? (typeof label === 'string' ? label : ariaLabelledBy ? undefined : 'Date');\n\n // ─ Toggle visibility ─\n const showToggle = showCalendarToggle && !isCalendarControlled;\n\n // ─ Derived field-message visibility (mirrors useFieldA11y rules) ─\n const hasError = !!error;\n const hasErrorMessage = hasError && errorMessage != null && errorMessage !== '';\n const hasHelper = !hasErrorMessage && helperText != null && helperText !== '';\n\n return (\n <I18nProvider locale={ariaLocale}>\n <AriaDatePicker\n value={value}\n onChange={handleAriaChange}\n minValue={ariaMinValue}\n maxValue={ariaMaxValue}\n isRequired={required}\n isDisabled={disabled}\n isInvalid={hasError}\n shouldCloseOnSelect\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className=\"ddga-field\"\n data-slot=\"date-picker-field\"\n >\n {label && (\n <AriaLabel className=\"ddga-date-picker__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-date-picker__required\">\n *\n </span>\n )}\n </AriaLabel>\n )}\n <AriaGroup\n data-slot=\"date-picker-trigger\"\n className={cn(datePickerTriggerVariants({ size, error: hasError }), className)}\n >\n <AriaDateInput className=\"ddga-date-picker__input\" data-slot=\"date-picker-input\">\n {(segment) => (\n <AriaDateSegment\n segment={segment}\n className=\"ddga-date-picker__segment\"\n data-slot=\"date-picker-segment\"\n />\n )}\n </AriaDateInput>\n <AriaButton\n className=\"ddga-date-picker__icon-button\"\n aria-label=\"Open calendar\"\n data-slot=\"date-picker-trigger-button\"\n >\n <CalendarIcon aria-hidden=\"true\" className=\"ddga-date-picker__icon\" />\n </AriaButton>\n </AriaGroup>\n {hasHelper && (\n <AriaText\n slot=\"description\"\n className=\"ddga-field__message ddga-field__message--helper\"\n data-slot=\"field-helper\"\n >\n {helperText}\n </AriaText>\n )}\n {hasErrorMessage && (\n <AriaFieldError\n className=\"ddga-field__message ddga-field__message--error\"\n data-slot=\"field-error\"\n >\n {errorMessage}\n </AriaFieldError>\n )}\n <AriaPopover\n UNSTABLE_portalContainer={portalContainer}\n className=\"ddga-date-picker-popover\"\n data-slot=\"date-picker-popover\"\n offset={6}\n // Keep some breathing room from the viewport edge so the popover\n // doesn't butt up against the bottom of the iframe in short\n // containers (the Storybook canvas case). Combined with the inner\n // Dialog's overflow:auto, the calendar will scroll if it can't fit.\n containerPadding={12}\n >\n <AriaDialog\n className=\"ddga-date-picker-dialog\"\n data-slot=\"date-picker-dialog\"\n aria-label={dialogAriaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {showToggle && (\n <div\n role=\"tablist\"\n aria-label=\"Calendar system\"\n className=\"ddga-date-picker-toggle\"\n data-slot=\"date-picker-toggle\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={calendarSystem === 'gregorian'}\n className=\"ddga-date-picker-toggle__button\"\n data-active={calendarSystem === 'gregorian' ? '' : undefined}\n onClick={() => setCalendar('gregorian')}\n >\n {resolvedLabels.gregorian}\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={calendarSystem === 'hijri'}\n className=\"ddga-date-picker-toggle__button\"\n data-active={calendarSystem === 'hijri' ? '' : undefined}\n onClick={() => setCalendar('hijri')}\n >\n {resolvedLabels.hijri}\n </button>\n </div>\n )}\n <AriaCalendar className=\"ddga-date-picker-calendar\" data-slot=\"date-picker-calendar\">\n <header className=\"ddga-date-picker-calendar__header\">\n <AriaButton\n slot=\"previous\"\n className=\"ddga-date-picker-calendar__nav\"\n data-slot=\"date-picker-calendar-prev\"\n >\n <PrevChevron aria-hidden=\"true\" />\n </AriaButton>\n <CalendarNavHeader\n locale={ariaLocale}\n monthLabel={navLabels.month}\n yearLabel={navLabels.year}\n />\n <AriaButton\n slot=\"next\"\n className=\"ddga-date-picker-calendar__nav\"\n data-slot=\"date-picker-calendar-next\"\n >\n <NextChevron aria-hidden=\"true\" />\n </AriaButton>\n </header>\n <AriaCalendarGrid className=\"ddga-date-picker-calendar__grid\">\n <AriaCalendarGridHeader>\n {(day) => (\n <AriaCalendarHeaderCell className=\"ddga-date-picker-calendar__weekday\">\n {day}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <CalendarDayCell\n date={date}\n showSecondary={showSecondaryCalendar}\n calendarSystem={calendarSystem}\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n </AriaCalendar>\n </AriaDialog>\n </AriaPopover>\n </AriaDatePicker>\n </I18nProvider>\n );\n}\n\n// ─── 6. Exports ─── //\n\nexport { DatePicker, datePickerTriggerVariants, datePickerVariants };\nexport type { DatePickerProps, CalendarSystem, CalendarLabels };\n","'use client';\n\nimport { useRef, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Button } from '../Button';\nimport { Progress } from '../Progress';\nimport { Upload, Check, AlertCircle, Close } from '../../internal/icons';\n\n// ─── 1. Types ─── //\n\ntype FileStatus = 'pending' | 'uploading' | 'success' | 'error';\n\n/** Reason codes attached to a rejected file. */\ntype RejectionCode = 'file-too-large' | 'file-invalid-type' | 'too-many-files';\n\n/**\n * A controlled file entry. The consumer owns this array and is responsible for\n * performing the actual upload, updating `status`/`progress`, and assigning a\n * stable `id` (used as the React key and the `onRemove` target).\n */\ninterface UploadFile {\n /** Stable, consumer-assigned id. Used as the React key and remove target. */\n id: string;\n /** The native File. */\n file: File;\n /** Defaults to `'pending'`. Drives the per-row affordance. */\n status?: FileStatus;\n /** 0–100. Rendered as a {@link Progress} bar while `status === 'uploading'`. */\n progress?: number;\n /** Shown inline (red) while `status === 'error'`. */\n error?: string;\n}\n\ninterface FileRejection {\n file: File;\n errors: RejectionCode[];\n}\n\ninterface FileUploadProps {\n /** Controlled list of files to render. The consumer is the source of truth. */\n files: UploadFile[];\n /** Called with the files that passed validation. The consumer wraps each in\n * an {@link UploadFile} (assigning an `id`) and starts the upload. */\n onFilesAdded: (accepted: File[]) => void;\n /** Called with files that failed validation. Never enter `files`. */\n onFilesRejected?: (rejections: FileRejection[]) => void;\n /** Per-row remove handler. Omit to hide the remove button. */\n onRemove?: (id: string) => void;\n\n /** Native `accept` string (e.g. `'image/*,.pdf'`). Also drives validation. */\n accept?: string;\n /** Maximum size per file, in bytes. */\n maxSize?: number;\n /** Maximum total files (existing + incoming). When `multiple` is false this\n * is forced to 1. */\n maxFiles?: number;\n /** Allow selecting/dropping more than one file. Defaults to true. */\n multiple?: boolean;\n /** Disables the drop zone and the picker. */\n disabled?: boolean;\n /** Marks the field required: renders the asterisk and sets the input's\n * `required` attribute. */\n required?: boolean;\n\n /** Visible field label, auto-associated to the input. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Drop-zone instructional copy. Defaults to a bilingual-friendly EN string. */\n hint?: ReactNode;\n /** Accessible label for the per-row remove button. Defaults to `'Remove'`. */\n removeLabel?: string;\n\n id?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n// ─── 2. Validation helpers (local — no shared util until a 2nd use case) ─── //\n\nfunction matchesAccept(file: File, accept?: string): boolean {\n if (!accept) return true;\n const tokens = accept\n .split(',')\n .map((t) => t.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) return true;\n\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n\n return tokens.some((token) => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return type.startsWith(token.slice(0, token.indexOf('/') + 1));\n return type === token;\n });\n}\n\ninterface ValidationConfig {\n accept?: string;\n maxSize?: number;\n maxFiles?: number;\n /** Files already in the list — counts against `maxFiles`. */\n currentCount: number;\n}\n\nfunction splitFiles(incoming: File[], config: ValidationConfig) {\n const { accept, maxSize, maxFiles, currentCount } = config;\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n\n for (const file of incoming) {\n const errors: RejectionCode[] = [];\n if (!matchesAccept(file, accept)) errors.push('file-invalid-type');\n if (maxSize != null && file.size > maxSize) errors.push('file-too-large');\n\n if (errors.length > 0) {\n rejections.push({ file, errors });\n continue;\n }\n // Count check last, and only for otherwise-valid files: a slot is consumed\n // only by a file that would actually be accepted.\n if (maxFiles != null && currentCount + accepted.length >= maxFiles) {\n rejections.push({ file, errors: ['too-many-files'] });\n continue;\n }\n accepted.push(file);\n }\n\n return { accepted, rejections };\n}\n\nconst UNITS = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n const exponent = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), UNITS.length - 1);\n const value = bytes / 1024 ** exponent;\n // Whole numbers for bytes; one decimal for KB+.\n return `${exponent === 0 ? value : value.toFixed(1)} ${UNITS[exponent]}`;\n}\n\n// ─── 3. Component ─── //\n\nfunction FileUpload({\n files,\n onFilesAdded,\n onFilesRejected,\n onRemove,\n accept,\n maxSize,\n maxFiles,\n multiple = true,\n disabled = false,\n required,\n label,\n helperText,\n errorMessage,\n error,\n hint = 'Drag files here, or click to browse',\n removeLabel = 'Remove',\n id: externalId,\n className,\n ...props\n}: FileUploadProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'FileUpload',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n // Single-select forces a hard cap of 1, regardless of maxFiles.\n const effectiveMaxFiles = multiple ? maxFiles : 1;\n\n function process(incoming: File[]) {\n if (disabled || incoming.length === 0) return;\n const { accepted, rejections } = splitFiles(incoming, {\n accept,\n maxSize,\n maxFiles: effectiveMaxFiles,\n currentCount: files.length,\n });\n if (accepted.length > 0) onFilesAdded(accepted);\n if (rejections.length > 0) onFilesRejected?.(rejections);\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n process(Array.from(event.target.files ?? []));\n // Reset so selecting the same file again re-fires `change`.\n event.target.value = '';\n }\n\n function handleDrop(event: React.DragEvent<HTMLDivElement>) {\n event.preventDefault();\n setIsDragging(false);\n if (disabled) return;\n process(Array.from(event.dataTransfer.files));\n }\n\n function handleDragOver(event: React.DragEvent<HTMLDivElement>) {\n event.preventDefault();\n if (!disabled) setIsDragging(true);\n }\n\n function handleDragLeave(event: React.DragEvent<HTMLDivElement>) {\n // Ignore dragleave events bubbling up from descendants.\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setIsDragging(false);\n }\n }\n\n return (\n <div data-slot=\"file-upload-field\" className={cn('ddga-field', 'ddga-file-upload', className)}>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-file-upload__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-file-upload__required\">\n *\n </span>\n )}\n </label>\n )}\n\n {/* The drop zone is a click target that proxies to the hidden input.\n The input itself stays focusable (keyboard users tab to it and press\n Space/Enter to open the picker); drag-and-drop is a mouse-only\n enhancement layered on top. */}\n <div\n data-slot=\"file-upload-dropzone\"\n className={cn(\n 'ddga-file-upload__dropzone',\n hasError && 'ddga-file-upload__dropzone--error',\n )}\n data-dragging={isDragging || undefined}\n data-disabled={disabled || undefined}\n aria-disabled={disabled || undefined}\n onClick={() => {\n if (!disabled) inputRef.current?.click();\n }}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n <Upload className=\"ddga-file-upload__icon\" aria-hidden=\"true\" />\n <span className=\"ddga-file-upload__hint\">{hint}</span>\n <input\n {...controlProps}\n ref={inputRef}\n type=\"file\"\n className=\"ddga-file-upload__input\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n required={required}\n onChange={handleInputChange}\n // The dropzone's onClick calls inputRef.click(); without stopping\n // propagation, that programmatic click bubbles back to the dropzone\n // and re-triggers it — infinite recursion. Native label/keyboard\n // activation of the input is unaffected.\n onClick={(event) => event.stopPropagation()}\n data-slot=\"file-upload-input\"\n />\n </div>\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n\n {files.length > 0 && (\n <ul data-slot=\"file-upload-list\" className=\"ddga-file-upload__list\">\n {files.map((item) => {\n const status = item.status ?? 'pending';\n return (\n <li\n key={item.id}\n data-slot=\"file-upload-item\"\n data-status={status}\n className=\"ddga-file-upload__item\"\n >\n <span className=\"ddga-file-upload__item-icon\" aria-hidden=\"true\">\n {status === 'success' ? (\n <Check />\n ) : status === 'error' ? (\n <AlertCircle />\n ) : (\n <Upload />\n )}\n </span>\n\n <div className=\"ddga-file-upload__item-main\">\n <div className=\"ddga-file-upload__item-head\">\n <span className=\"ddga-file-upload__item-name\" title={item.file.name}>\n {item.file.name}\n </span>\n <span className=\"ddga-file-upload__item-meta\">\n {formatBytes(item.file.size)}\n </span>\n </div>\n\n {status === 'uploading' && (\n <Progress\n size=\"sm\"\n value={item.progress ?? 0}\n aria-label={`Uploading ${item.file.name}`}\n className=\"ddga-file-upload__item-progress\"\n />\n )}\n\n {status === 'error' && item.error && (\n <span role=\"alert\" className=\"ddga-file-upload__item-error\">\n {item.error}\n </span>\n )}\n </div>\n\n {onRemove && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={`${removeLabel}: ${item.file.name}`}\n onClick={() => onRemove(item.id)}\n className=\"ddga-file-upload__item-remove\"\n >\n <Close aria-hidden=\"true\" />\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { FileUpload };\nexport type { FileUploadProps, UploadFile, FileRejection, FileStatus, RejectionCode };\n","'use client';\n\nimport { useId, type ReactNode } from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\nconst sliderVariants = cva('ddga-slider', {\n variants: {\n size: {\n sm: 'ddga-slider--sm',\n md: 'ddga-slider--md',\n },\n error: {\n true: 'ddga-slider--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the slider state model, but always as `number[]`. We expose a\n// cleaner API: a single `number` for one thumb, `number[]` for a range. The\n// emitted value mirrors the shape that was passed in.\ntype SliderValue = number | number[];\n\ninterface SliderProps\n extends\n Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommit' | 'asChild'\n >,\n VariantProps<typeof sliderVariants> {\n /** Controlled value. `number` → single thumb, `number[]` → one thumb each. */\n value?: SliderValue;\n /** Uncontrolled initial value. Defaults to a single thumb at `min`. */\n defaultValue?: SliderValue;\n /** Fires continuously while dragging. Shape mirrors `value`/`defaultValue`. */\n onValueChange?: (value: SliderValue) => void;\n /** Fires once on release (pointer up / keyboard commit). */\n onValueCommit?: (value: SliderValue) => void;\n\n /** Visible field label, associated to the thumb(s) via `aria-labelledby`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Render the current value(s) as text beside the label. */\n showValue?: boolean;\n /** Formats each value for `showValue` and the thumb's `aria-valuetext`\n * (e.g. percentages or currency). */\n formatValue?: (value: number) => string;\n /** Accessible names for the two range thumbs. Ignored for single thumbs.\n * Defaults to `['Minimum', 'Maximum']`. */\n thumbLabels?: [string, string];\n}\n\n// ─── 3. Helpers ─── //\n\nconst DEFAULT_THUMB_LABELS: [string, string] = ['Minimum', 'Maximum'];\n\nfunction toArray(value: SliderValue | undefined): number[] | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value : [value];\n}\n\n// ─── 4. Component ─── //\n\nfunction Slider({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n min = 0,\n max = 100,\n size,\n label,\n helperText,\n errorMessage,\n error,\n showValue = false,\n formatValue,\n thumbLabels = DEFAULT_THUMB_LABELS,\n className,\n ...props\n}: SliderProps) {\n const labelId = useId();\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Slider',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'] ?? (label ? labelId : undefined),\n });\n\n // Single vs range is determined by the controlled/uncontrolled shape the\n // consumer chose; fall back to single when neither is provided.\n const isRange = Array.isArray(value ?? defaultValue);\n\n const valueArray = toArray(value);\n const defaultArray = toArray(defaultValue) ?? [min];\n\n // Re-wrap Radix's `number[]` back into the consumer's shape.\n const wrap = (next: number[]): SliderValue => (isRange ? next : next[0]);\n\n // Each thumb needs an accessible name. A single thumb borrows the field\n // label; range thumbs get distinct min/max labels.\n const currentForRender = valueArray ?? defaultArray;\n const fmt = (n: number) => (formatValue ? formatValue(n) : String(n));\n\n return (\n <div data-slot=\"slider-field\" className=\"ddga-field\">\n {(label || showValue) && (\n <div className=\"ddga-slider__header\">\n {label && (\n <span id={labelId} className=\"ddga-slider__label\">\n {label}\n </span>\n )}\n {showValue && (\n <span className=\"ddga-slider__value\" aria-hidden=\"true\">\n {currentForRender.map(fmt).join(' – ')}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n // Spread props first, then the a11y/state contract so consumers\n // cannot clobber the wiring.\n {...props}\n id={fieldId}\n min={min}\n max={max}\n value={valueArray}\n defaultValue={value === undefined ? defaultArray : undefined}\n onValueChange={onValueChange ? (next) => onValueChange(wrap(next)) : undefined}\n onValueCommit={onValueCommit ? (next) => onValueCommit(wrap(next)) : undefined}\n aria-invalid={controlProps['aria-invalid']}\n data-slot=\"slider\"\n className={cn(sliderVariants({ size, error: hasError }), className)}\n >\n <SliderPrimitive.Track data-slot=\"slider-track\" className=\"ddga-slider__track\">\n <SliderPrimitive.Range data-slot=\"slider-range\" className=\"ddga-slider__range\" />\n </SliderPrimitive.Track>\n {currentForRender.map((thumbValue, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n className=\"ddga-slider__thumb\"\n aria-label={isRange ? thumbLabels[index] : undefined}\n aria-labelledby={!isRange && label ? labelId : undefined}\n aria-valuetext={formatValue ? fmt(thumbValue) : undefined}\n aria-describedby={controlProps['aria-describedby']}\n />\n ))}\n </SliderPrimitive.Root>\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { Slider, sliderVariants };\nexport type { SliderProps, SliderValue };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Plus, Minus } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the *control* (the bordered box housing the − button, the field,\n// and the + button), mirroring Input's structure.\nconst numberInputVariants = cva('ddga-number-input', {\n variants: {\n size: {\n sm: 'ddga-number-input--sm',\n md: 'ddga-number-input--md',\n lg: 'ddga-number-input--lg',\n },\n error: {\n true: 'ddga-number-input--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface NumberInputProps\n extends\n Omit<\n React.ComponentProps<'input'>,\n 'value' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'min' | 'max' | 'step'\n >,\n VariantProps<typeof numberInputVariants> {\n /** Controlled value. `null` represents an empty field. */\n value?: number | null;\n /** Uncontrolled initial value. */\n defaultValue?: number | null;\n /** Fires with the parsed value, or `null` when the field is cleared. */\n onValueChange?: (value: number | null) => void;\n\n /** Lower bound. Clamped on blur and at the stepper buttons. */\n min?: number;\n /** Upper bound. Clamped on blur and at the stepper buttons. */\n max?: number;\n /** Stepper / ArrowUp-Down increment. Defaults to 1. */\n step?: number;\n\n /** Hide the − / + buttons (keyboard + typing only). */\n hideControls?: boolean;\n /** Accessible label for the decrement button. Defaults to `'Decrease'`. */\n decrementLabel?: string;\n /** Accessible label for the increment button. Defaults to `'Increase'`. */\n incrementLabel?: string;\n\n /** Visible field label, auto-associated to the input via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Helpers ─── //\n\nfunction clamp(value: number, min: number | undefined, max: number | undefined): number {\n let next = value;\n if (min != null) next = Math.max(min, next);\n if (max != null) next = Math.min(max, next);\n return next;\n}\n\n// `String(n)` switches to exponential notation for very small/large magnitudes\n// (e.g. `String(2e-7)` → \"2e-7\"), which looks broken in a form field and\n// contradicts our input filter (which rejects \"e\"). Format to a plain decimal\n// instead. Note: values still round to float64 precision (~15–17 sig digits)\n// — arbitrary-precision input is out of scope.\nfunction formatNumber(value: number): string {\n if (!Number.isFinite(value)) return '';\n return value.toLocaleString('en-US', { useGrouping: false, maximumFractionDigits: 20 });\n}\n\n// ─── 4. Component ─── //\n\nfunction NumberInput({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n min,\n max,\n step = 1,\n size,\n hideControls = false,\n decrementLabel = 'Decrease',\n incrementLabel = 'Increase',\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n className,\n onBlur,\n onKeyDown,\n ...props\n}: NumberInputProps) {\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<number | null>(defaultValue ?? null);\n const numericValue = isControlled ? value : internal;\n\n // While focused we keep the raw text so partial input (\"-\", \"1.\") survives a\n // re-render; `null` means \"show the canonical numeric value\".\n const [draft, setDraft] = useState<string | null>(null);\n\n const allowDecimal = !Number.isInteger(step);\n const allowNegative = min == null || min < 0;\n const displayValue = draft ?? (numericValue == null ? '' : formatNumber(numericValue));\n\n // Accepts only valid (possibly partial) numeric input: an optional leading\n // minus (when negatives are in range), digits, and one decimal point (when\n // the step is fractional). Allows transient partials like \"\", \"-\", \"1.\".\n const allowedPattern = new RegExp(\n `^${allowNegative ? '-?' : ''}\\\\d*${allowDecimal ? '(\\\\.\\\\d*)?' : ''}$`,\n );\n\n function commit(next: number | null) {\n if (!isControlled) setInternal(next);\n onValueChange?.(next);\n }\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'NumberInput',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const raw = event.target.value;\n // Reject anything that isn't valid numeric input (letters, extra dots,\n // misplaced signs, pasted junk). Returning without a state update reverts\n // the controlled input to its prior value — the keystroke never lands.\n if (!allowedPattern.test(raw)) return;\n setDraft(raw);\n if (raw.trim() === '') {\n commit(null);\n return;\n }\n const parsed = Number(raw);\n // Emit only on a complete, finite number — partials (\"-\", \"1.\") keep the\n // draft but don't push a misleading value to the consumer.\n if (Number.isFinite(parsed)) commit(parsed);\n }\n\n function handleBlur(event: React.FocusEvent<HTMLInputElement>) {\n // Normalize: clamp to bounds, then resync the display to the canonical\n // number (drops trailing dots, leading zeros, etc.).\n if (numericValue != null) commit(clamp(numericValue, min, max));\n setDraft(null);\n onBlur?.(event);\n }\n\n function stepBy(direction: 1 | -1) {\n const base = numericValue ?? (direction > 0 ? (min ?? 0) : (max ?? 0));\n const next = clamp(base + direction * step, min, max);\n // Avoid floating-point dust from repeated decimal steps (0.1 + 0.2…).\n const rounded = allowDecimal ? Number(next.toFixed(10)) : next;\n commit(rounded);\n setDraft(null);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (!disabled) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n stepBy(1);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n stepBy(-1);\n }\n }\n onKeyDown?.(event);\n }\n\n const atMin = min != null && numericValue != null && numericValue <= min;\n const atMax = max != null && numericValue != null && numericValue >= max;\n\n return (\n <div data-slot=\"number-input-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-number-input__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-number-input__required\">\n *\n </span>\n )}\n </label>\n )}\n <div\n data-slot=\"number-input-control\"\n className={cn(numberInputVariants({ size, error: hasError }), className)}\n >\n {!hideControls && (\n <button\n type=\"button\"\n data-slot=\"number-input-decrement\"\n className=\"ddga-number-input__step ddga-number-input__step--decrement\"\n aria-label={decrementLabel}\n onClick={() => stepBy(-1)}\n disabled={disabled || atMin}\n tabIndex={-1}\n >\n <Minus aria-hidden=\"true\" />\n </button>\n )}\n <input\n {...props}\n {...controlProps}\n // type=text (not number): we own the steppers and keep digits Latin\n // + LTR regardless of locale, sidestepping the native spinner and\n // browser numeral-locale quirks.\n type=\"text\"\n inputMode={allowDecimal ? 'decimal' : 'numeric'}\n value={displayValue}\n required={required}\n disabled={disabled}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n data-slot=\"number-input\"\n className=\"ddga-number-input__field\"\n />\n {!hideControls && (\n <button\n type=\"button\"\n data-slot=\"number-input-increment\"\n className=\"ddga-number-input__step ddga-number-input__step--increment\"\n aria-label={incrementLabel}\n onClick={() => stepBy(1)}\n disabled={disabled || atMax}\n tabIndex={-1}\n >\n <Plus aria-hidden=\"true\" />\n </button>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { NumberInput, numberInputVariants };\nexport type { NumberInputProps };\n","'use client';\n\nimport { useRef, useState, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Star } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst ratingVariants = cva('ddga-rating', {\n variants: {\n size: {\n sm: 'ddga-rating--sm',\n md: 'ddga-rating--md',\n lg: 'ddga-rating--lg',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface RatingProps extends VariantProps<typeof ratingVariants> {\n /** Controlled value (0…max). `.5` increments are allowed when `allowHalf`. */\n value?: number;\n /** Uncontrolled initial value. Defaults to 0. */\n defaultValue?: number;\n /** Fires with the chosen rating. */\n onValueChange?: (value: number) => void;\n\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Allow half-star (`.5`) precision. */\n allowHalf?: boolean;\n /** Display only — no interaction, exposed as `role=\"img\"`. */\n readOnly?: boolean;\n /** Non-interactive and dimmed. */\n disabled?: boolean;\n\n /** Visible field label. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Builds the accessible value text / read-only label. Defaults to\n * `\"{value} out of {max} stars\"`. Override for localization. */\n formatValueText?: (value: number, max: number) => string;\n\n id?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n// ─── 3. Helpers ─── //\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\nfunction defaultValueText(value: number, max: number): string {\n return `${value} out of ${max} stars`;\n}\n\n/** Fill level for the star at 0-based `index` given the current value. */\nfunction fillFor(index: number, value: number, allowHalf: boolean): 'full' | 'half' | 'empty' {\n if (value >= index + 1) return 'full';\n if (allowHalf && value >= index + 0.5) return 'half';\n return 'empty';\n}\n\n// ─── 4. Component ─── //\n\nfunction Rating({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n max = 5,\n allowHalf = false,\n readOnly = false,\n disabled = false,\n size,\n label,\n helperText,\n errorMessage,\n error,\n formatValueText = defaultValueText,\n className,\n ...props\n}: RatingProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<number>(defaultValue ?? 0);\n const currentValue = isControlled ? value : internal;\n\n const [hover, setHover] = useState<number | null>(null);\n const interactive = !readOnly && !disabled;\n const stepSize = allowHalf ? 0.5 : 1;\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Rating',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n // role=slider / role=img always have an accessible name (label or the\n // value text), so suppress the no-label dev warning.\n 'aria-label': props['aria-label'] ?? formatValueText(currentValue, max),\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n // The value driving the visual fill: hover preview wins while interacting.\n const displayValue = hover ?? currentValue;\n\n function commit(next: number) {\n if (!isControlled) setInternal(next);\n onValueChange?.(next);\n }\n\n function readDir(): 'ltr' | 'rtl' {\n const el = rootRef.current;\n if (!el || typeof getComputedStyle !== 'function') return 'ltr';\n return getComputedStyle(el).direction === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Value implied by the pointer position over star `index`. */\n function pointerValue(event: React.PointerEvent | React.MouseEvent, index: number): number {\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n let fraction = rect.width ? (event.clientX - rect.left) / rect.width : 1;\n if (readDir() === 'rtl') fraction = 1 - fraction;\n if (allowHalf) return index + (fraction <= 0.5 ? 0.5 : 1);\n return index + 1;\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (!interactive) return;\n const rtl = readDir() === 'rtl';\n let next: number | null = null;\n switch (event.key) {\n case 'ArrowUp':\n next = currentValue + stepSize;\n break;\n case 'ArrowDown':\n next = currentValue - stepSize;\n break;\n case 'ArrowRight':\n next = currentValue + (rtl ? -stepSize : stepSize);\n break;\n case 'ArrowLeft':\n next = currentValue + (rtl ? stepSize : -stepSize);\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = max;\n break;\n default:\n return;\n }\n event.preventDefault();\n commit(clamp(next, 0, max));\n }\n\n const stars = Array.from({ length: max }, (_, index) => {\n const level = fillFor(index, displayValue, allowHalf);\n return (\n <span\n key={index}\n data-slot=\"rating-star\"\n data-fill={level}\n className=\"ddga-rating__star\"\n onPointerMove={interactive ? (event) => setHover(pointerValue(event, index)) : undefined}\n onClick={interactive ? (event) => commit(pointerValue(event, index)) : undefined}\n >\n <Star className=\"ddga-rating__star-bg\" aria-hidden=\"true\" />\n <span className=\"ddga-rating__star-fill\" aria-hidden=\"true\">\n <Star className=\"ddga-rating__star-fg\" aria-hidden=\"true\" />\n </span>\n </span>\n );\n });\n\n const sharedProps = {\n ref: rootRef,\n 'data-slot': 'rating',\n 'data-disabled': disabled || undefined,\n className: cn(ratingVariants({ size }), hasError && 'ddga-rating--error', className),\n onPointerLeave: interactive ? () => setHover(null) : undefined,\n };\n\n // Accessible name for the slider: prefer the visible label, then a consumer\n // aria-labelledby/aria-label, falling back to a generic name.\n const labelledBy = label ? `${fieldId}-label` : props['aria-labelledby'];\n const ariaLabel = labelledBy ? undefined : (props['aria-label'] ?? 'Rating');\n\n return (\n <div data-slot=\"rating-field\" className=\"ddga-field\">\n {label && (\n <span id={`${fieldId}-label`} className=\"ddga-rating__label\">\n {label}\n </span>\n )}\n\n {readOnly ? (\n <div {...sharedProps} role=\"img\" aria-label={formatValueText(currentValue, max)}>\n {stars}\n </div>\n ) : (\n <div\n {...sharedProps}\n role=\"slider\"\n id={fieldId}\n tabIndex={disabled ? -1 : 0}\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={currentValue}\n aria-valuetext={formatValueText(currentValue, max)}\n aria-labelledby={labelledBy}\n aria-label={ariaLabel}\n aria-invalid={controlProps['aria-invalid']}\n aria-describedby={controlProps['aria-describedby']}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n >\n {stars}\n </div>\n )}\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","'use client';\n\nimport { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Standalone Toggle carries its own variant/size. Inside a ToggleGroup the\n// item visuals cascade from the group's classes via descendant selectors\n// (same pattern as Accordion/Tabs), so ToggleGroupItem needs no variant prop.\n\nconst toggleVariants = cva('ddga-toggle', {\n variants: {\n variant: {\n default: 'ddga-toggle--default',\n outline: 'ddga-toggle--outline',\n },\n size: {\n sm: 'ddga-toggle--sm',\n md: 'ddga-toggle--md',\n lg: 'ddga-toggle--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\nconst toggleGroupVariants = cva('ddga-toggle-group', {\n variants: {\n variant: {\n default: 'ddga-toggle-group--default',\n outline: 'ddga-toggle-group--outline',\n },\n size: {\n sm: 'ddga-toggle-group--sm',\n md: 'ddga-toggle-group--md',\n lg: 'ddga-toggle-group--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ntype ToggleProps = React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>;\n\n// Radix's Root is a discriminated union on `type` ('single' | 'multiple');\n// mirror it via Radix's own types (same approach as Accordion).\ntype ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroupPrimitive.Root>;\ntype ToggleGroupProps = ToggleGroupRootProps & VariantProps<typeof toggleGroupVariants>;\n\ntype ToggleGroupItemProps = React.ComponentProps<typeof ToggleGroupPrimitive.Item>;\n\n// ─── 3. Components ─── //\n\n// A standalone two-state button (role=button + aria-pressed, via Radix). For\n// icon-only toggles, pass an `aria-label`.\nfunction Toggle({ variant, size, className, ...props }: ToggleProps) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n\nfunction ToggleGroup({ variant, size, className, ...props }: ToggleGroupProps) {\n if (process.env.NODE_ENV === 'development' && !props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] ToggleGroup should have an `aria-label` or `aria-labelledby` ' +\n 'so the button group has an accessible name.',\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n className={cn(toggleGroupVariants({ variant, size }), className)}\n {...(props as ToggleGroupRootProps)}\n />\n );\n}\n\nfunction ToggleGroupItem({ className, ...props }: ToggleGroupItemProps) {\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n className={cn('ddga-toggle-group__item', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Toggle, ToggleGroup, ToggleGroupItem, toggleVariants, toggleGroupVariants };\nexport type { ToggleProps, ToggleGroupProps, ToggleGroupItemProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Semantic <dl>/<dt>/<dd> key–value list for review / summary screens. Layout\n// cascades from the list root via descendant selectors (Accordion/Tabs\n// pattern), so the row/term/details parts need no variant props.\n\nconst descriptionListVariants = cva('ddga-description-list', {\n variants: {\n orientation: {\n horizontal: 'ddga-description-list--horizontal',\n vertical: 'ddga-description-list--vertical',\n },\n divided: {\n true: 'ddga-description-list--divided',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface DescriptionListProps\n extends React.ComponentProps<'dl'>, VariantProps<typeof descriptionListVariants> {}\n\ntype DescriptionItemProps = React.ComponentProps<'div'>;\ntype DescriptionTermProps = React.ComponentProps<'dt'>;\ntype DescriptionDetailsProps = React.ComponentProps<'dd'>;\n\n// ─── 3. Components ─── //\n\nfunction DescriptionList({ orientation, divided, className, ...props }: DescriptionListProps) {\n return (\n <dl\n data-slot=\"description-list\"\n className={cn(descriptionListVariants({ orientation, divided }), className)}\n {...props}\n />\n );\n}\n\n// Row wrapper grouping one term with its detail(s). A <div> inside <dl> is\n// valid HTML5 and gives each pair a layout/divider boundary.\nfunction DescriptionItem({ className, ...props }: DescriptionItemProps) {\n return (\n <div\n data-slot=\"description-item\"\n className={cn('ddga-description-list__item', className)}\n {...props}\n />\n );\n}\n\nfunction DescriptionTerm({ className, ...props }: DescriptionTermProps) {\n return (\n <dt\n data-slot=\"description-term\"\n className={cn('ddga-description-list__term', className)}\n {...props}\n />\n );\n}\n\nfunction DescriptionDetails({ className, ...props }: DescriptionDetailsProps) {\n return (\n <dd\n data-slot=\"description-details\"\n className={cn('ddga-description-list__details', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n DescriptionList,\n DescriptionItem,\n DescriptionTerm,\n DescriptionDetails,\n descriptionListVariants,\n};\nexport type {\n DescriptionListProps,\n DescriptionItemProps,\n DescriptionTermProps,\n DescriptionDetailsProps,\n};\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Inbox, Search, AlertCircle, Check } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst emptyStateVariants = cva('ddga-empty-state', {\n variants: {\n variant: {\n default: 'ddga-empty-state--default',\n search: 'ddga-empty-state--search',\n error: 'ddga-empty-state--error',\n success: 'ddga-empty-state--success',\n },\n size: {\n sm: 'ddga-empty-state--sm',\n md: 'ddga-empty-state--md',\n lg: 'ddga-empty-state--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// Variant → default media icon. Mirrors the Alert.tsx DEFAULT_ICONS pattern.\nconst DEFAULT_ICONS: Record<\n NonNullable<VariantProps<typeof emptyStateVariants>['variant']>,\n ReactNode\n> = {\n default: <Inbox aria-hidden=\"true\" />,\n search: <Search aria-hidden=\"true\" />,\n error: <AlertCircle aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ninterface EmptyStateProps\n extends Omit<React.ComponentProps<'div'>, 'title'>, VariantProps<typeof emptyStateVariants> {\n /**\n * Leading media (icon or illustration). Pass `false` to hide the media.\n * Defaults to a variant-appropriate icon. Ignored when `children` is set.\n */\n icon?: ReactNode | false;\n /** Title. Ignored when `children` is set. */\n title?: ReactNode;\n /** Supporting description below the title. Ignored when `children` is set. */\n description?: ReactNode;\n /** Primary action, e.g. a `<Button>`. Ignored when `children` is set. */\n action?: ReactNode;\n /** Secondary action beside the primary one. Ignored when `children` is set. */\n secondaryAction?: ReactNode;\n}\n\ntype EmptyStateMediaProps = React.ComponentProps<'div'>;\n\ninterface EmptyStateTitleProps extends React.ComponentProps<'h3'> {\n /** Override the heading element (e.g. render an `<h2>` on full-page states). */\n asChild?: boolean;\n}\n\ntype EmptyStateDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\ntype EmptyStateActionsProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\n// ─── 3. Components ─── //\n\nfunction EmptyState({\n variant,\n size,\n icon,\n title,\n description,\n action,\n secondaryAction,\n className,\n children,\n ...props\n}: EmptyStateProps) {\n // `children`, when present, fully replaces the props-driven body.\n const resolvedIcon =\n icon === false ? null : icon !== undefined ? icon : DEFAULT_ICONS[variant ?? 'default'];\n\n return (\n <div\n data-slot=\"empty-state\"\n data-variant={variant ?? 'default'}\n data-size={size ?? 'md'}\n className={cn(emptyStateVariants({ variant, size }), className)}\n {...props}\n >\n {children ?? (\n <>\n {resolvedIcon ? <EmptyStateMedia>{resolvedIcon}</EmptyStateMedia> : null}\n {title ? <EmptyStateTitle>{title}</EmptyStateTitle> : null}\n {description ? <EmptyStateDescription>{description}</EmptyStateDescription> : null}\n {action || secondaryAction ? (\n <EmptyStateActions>\n {action}\n {secondaryAction}\n </EmptyStateActions>\n ) : null}\n </>\n )}\n </div>\n );\n}\n\n// Decorative circular badge wrapping the icon. aria-hidden so the icon is never\n// announced; consumers can override via props if they pass meaningful media.\nfunction EmptyStateMedia({ className, ...props }: EmptyStateMediaProps) {\n return (\n <div\n data-slot=\"empty-state-media\"\n aria-hidden=\"true\"\n className={cn('ddga-empty-state__media', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateTitle({ asChild, className, ...props }: EmptyStateTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h3';\n return (\n <Comp\n data-slot=\"empty-state-title\"\n className={cn('ddga-empty-state__title', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateDescription({ asChild, className, ...props }: EmptyStateDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"empty-state-description\"\n className={cn('ddga-empty-state__description', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateActions({ asChild, className, ...props }: EmptyStateActionsProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"empty-state-actions\"\n className={cn('ddga-empty-state__actions', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n EmptyState,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n emptyStateVariants,\n};\nexport type {\n EmptyStateProps,\n EmptyStateMediaProps,\n EmptyStateTitleProps,\n EmptyStateDescriptionProps,\n EmptyStateActionsProps,\n};\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { CaretUp, CaretDown, Minus } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst statVariants = cva('ddga-stat', {\n variants: {\n variant: {\n flat: 'ddga-stat--flat',\n elevated: 'ddga-stat--elevated',\n accent: 'ddga-stat--accent',\n },\n size: {\n sm: 'ddga-stat--sm',\n md: 'ddga-stat--md',\n lg: 'ddga-stat--lg',\n },\n },\n defaultVariants: {\n variant: 'flat',\n size: 'md',\n },\n});\n\ntype Trend = 'up' | 'down' | 'flat';\ntype Sentiment = 'positive' | 'negative' | 'neutral';\n\n// trend → caret icon (carried aria-hidden; carets are RTL-neutral).\nconst TREND_ICONS: Record<Trend, ReactNode> = {\n up: <CaretUp aria-hidden=\"true\" />,\n down: <CaretDown aria-hidden=\"true\" />,\n flat: <Minus aria-hidden=\"true\" />,\n};\n\n// Default sentiment when none is given explicitly.\nconst TREND_SENTIMENT: Record<Trend, Sentiment> = {\n up: 'positive',\n down: 'negative',\n flat: 'neutral',\n};\n\n// Explicit sentiment wins; else derive from trend; else undefined (no color).\nfunction resolveSentiment(trend?: Trend, sentiment?: Sentiment): Sentiment | undefined {\n if (sentiment) return sentiment;\n if (trend) return TREND_SENTIMENT[trend];\n return undefined;\n}\n\n// ─── 2. Types ─── //\n\ninterface StatProps extends React.ComponentProps<'div'>, VariantProps<typeof statVariants> {\n /** Small, muted label above the value. */\n label?: ReactNode;\n /** The metric, pre-formatted by the consumer (e.g. \"3,204\", \"SAR 1.2M\"). */\n value?: ReactNode;\n /** Change text — include the sign (e.g. \"+12.5%\") so AT conveys direction. */\n change?: ReactNode;\n /** Muted context beside the change (e.g. \"vs last month\"). */\n changeLabel?: ReactNode;\n /** Arrow direction: up → CaretUp, down → CaretDown, flat → Minus. */\n trend?: Trend;\n /** Change color. Omitted → derived from `trend`. Explicit always wins. */\n sentiment?: Sentiment;\n /** Optional icon at the inline-end of the label row (decorative). */\n icon?: ReactNode;\n}\n\ntype StatLabelProps = React.ComponentProps<'div'>;\ntype StatValueProps = React.ComponentProps<'div'>;\ninterface StatChangeProps extends React.ComponentProps<'div'> {\n trend?: Trend;\n sentiment?: Sentiment;\n}\n\n// ─── 3. Components ─── //\n\nfunction Stat({\n variant,\n size,\n label,\n value,\n change,\n changeLabel,\n trend,\n sentiment,\n icon,\n className,\n children,\n ...props\n}: StatProps) {\n const resolvedSentiment = resolveSentiment(trend, sentiment);\n return (\n <div\n data-slot=\"stat\"\n data-variant={variant ?? 'flat'}\n data-trend={trend}\n data-sentiment={resolvedSentiment}\n className={cn(statVariants({ variant, size }), className)}\n {...props}\n >\n {label || icon ? (\n <div className=\"ddga-stat__label-row\">\n {label ? <StatLabel>{label}</StatLabel> : null}\n {icon ? (\n <span className=\"ddga-stat__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n </div>\n ) : null}\n {value ? <StatValue>{value}</StatValue> : null}\n {change || changeLabel ? (\n <div className=\"ddga-stat__change-row\">\n {change ? (\n <StatChange trend={trend} sentiment={sentiment}>\n {change}\n </StatChange>\n ) : null}\n {changeLabel ? <span className=\"ddga-stat__change-label\">{changeLabel}</span> : null}\n </div>\n ) : null}\n {children}\n </div>\n );\n}\n\nfunction StatLabel({ className, ...props }: StatLabelProps) {\n return <div data-slot=\"stat-label\" className={cn('ddga-stat__label', className)} {...props} />;\n}\n\nfunction StatValue({ className, ...props }: StatValueProps) {\n return <div data-slot=\"stat-value\" className={cn('ddga-stat__value', className)} {...props} />;\n}\n\nfunction StatChange({ trend, sentiment, className, children, ...props }: StatChangeProps) {\n const resolvedSentiment = resolveSentiment(trend, sentiment);\n return (\n <div\n data-slot=\"stat-change\"\n data-trend={trend}\n data-sentiment={resolvedSentiment}\n className={cn(\n 'ddga-stat__change',\n resolvedSentiment ? `ddga-stat__change--${resolvedSentiment}` : null,\n className,\n )}\n {...props}\n >\n {trend ? <span className=\"ddga-stat__change-icon\">{TREND_ICONS[trend]}</span> : null}\n {children}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Stat, StatLabel, StatValue, StatChange, statVariants };\nexport type { StatProps, StatLabelProps, StatValueProps, StatChangeProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst statGroupVariants = cva('ddga-stat-group', {\n variants: {\n orientation: {\n horizontal: 'ddga-stat-group--horizontal',\n vertical: 'ddga-stat-group--vertical',\n },\n gap: {\n sm: 'ddga-stat-group--gap-sm',\n md: 'ddga-stat-group--gap-md',\n lg: 'ddga-stat-group--gap-lg',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n gap: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface StatGroupProps\n extends React.ComponentProps<'div'>, VariantProps<typeof statGroupVariants> {\n /**\n * Fixed column count for the horizontal grid (collapses to one column on\n * narrow screens). Omit for an auto-fit responsive grid.\n */\n columns?: number;\n}\n\n// ─── 3. Component ─── //\n\n// Pure layout container for Stat tiles. Each Stat keeps its own surface; inside\n// a group the tile's max-inline-size is released so it fills its grid/flex slot\n// (see stat.css). `columns` is passed as a CSS custom property and consumed by\n// the `--cols` rule, so a media query can still collapse it without !important.\nfunction StatGroup({ orientation, gap, columns, className, style, ...props }: StatGroupProps) {\n return (\n <div\n data-slot=\"stat-group\"\n className={cn(\n statGroupVariants({ orientation, gap }),\n columns != null && 'ddga-stat-group--cols',\n className,\n )}\n style={\n columns != null\n ? ({ '--ddga-stat-group-columns': columns, ...style } as React.CSSProperties)\n : style\n }\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { StatGroup, statGroupVariants };\nexport type { StatGroupProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Close } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\nconst popoverContentVariants = cva('ddga-popover', {\n variants: {\n size: {\n sm: 'ddga-popover--sm',\n md: 'ddga-popover--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Closed compound shape that hides Radix's Portal/Arrow plumbing — mirrors\n// Tooltip/DropdownMenu. `Popover` (Root) passes through `open`/`onOpenChange`/\n// `defaultOpen`/`modal`. The Portal container is wired from `DgaContext` so the\n// panel inherits `data-theme` + theme vars and escapes clipping/transform\n// ancestors; falls back to <body> outside a provider.\n\ntype PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>;\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger>;\n\ntype PopoverAnchorProps = React.ComponentProps<typeof PopoverPrimitive.Anchor>;\n\ninterface PopoverContentProps\n extends\n Omit<React.ComponentProps<typeof PopoverPrimitive.Content>, 'asChild'>,\n VariantProps<typeof popoverContentVariants> {\n /** Show a small arrow pointing at the trigger. Defaults to false. */\n arrow?: boolean;\n}\n\ninterface PopoverCloseProps extends React.ComponentProps<typeof PopoverPrimitive.Close> {\n /**\n * Localized label for the default corner-X button. Only used when no\n * `children` (and no `asChild`) are provided. Defaults to `\"Close\"`.\n */\n closeLabel?: string;\n}\n\n// ─── 3. Components ─── //\n\nfunction Popover(props: PopoverProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\nfunction PopoverTrigger({ className, ...props }: PopoverTriggerProps) {\n // Radix Trigger supports asChild natively — pass through.\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" className={className} {...props} />;\n}\n\nfunction PopoverAnchor(props: PopoverAnchorProps) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverContent({\n size,\n arrow = false,\n sideOffset = 6,\n className,\n children,\n ...props\n}: PopoverContentProps) {\n // Radix Popover.Content renders role=\"dialog\", which needs an accessible\n // name. Unlike Modal there's no built-in Title primitive wiring\n // aria-labelledby, so warn (dev only) when the consumer gives neither.\n if (process.env.NODE_ENV === 'development' && !props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] PopoverContent renders role=\"dialog\" and should have an ' +\n '`aria-label` or `aria-labelledby` so the panel has an accessible name.',\n );\n }\n\n // Anchor the Portal to the DgaProvider's body-level portal container so the\n // panel inherits theme + dark mode and isn't clipped by an ancestor's\n // overflow/transform. Falls back to <body> outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n sideOffset={sideOffset}\n className={cn(popoverContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {arrow ? (\n <PopoverPrimitive.Arrow className=\"ddga-popover__arrow\" width={16} height={8} />\n ) : null}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverClose({\n className,\n children,\n closeLabel = 'Close',\n asChild,\n ...props\n}: PopoverCloseProps) {\n // With renderable children (or asChild), behave as a transparent close\n // wrapper so consumers fully own the element. With neither, render the styled\n // corner-X (mirrors Modal's close button) — the common dismiss affordance.\n // Guard against `null`/`false` so a conditional child (`flag && <X/>`) that\n // evaluates falsy still falls through to the default X instead of rendering\n // an empty, unlabelled button.\n const hasRenderableChildren = children != null && children !== false;\n if (asChild || hasRenderableChildren) {\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n asChild={asChild}\n className={className}\n {...props}\n >\n {children as ReactNode}\n </PopoverPrimitive.Close>\n );\n }\n\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n aria-label={closeLabel}\n className={cn('ddga-popover__close', className)}\n {...props}\n >\n <Close aria-hidden=\"true\" />\n </PopoverPrimitive.Close>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Popover,\n PopoverTrigger,\n PopoverAnchor,\n PopoverContent,\n PopoverClose,\n popoverContentVariants,\n};\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverAnchorProps,\n PopoverContentProps,\n PopoverCloseProps,\n};\n","'use client';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cn } from '../../utils/cn';\nimport { Drawer, DrawerContent } from '../Drawer';\nimport { PanelLeft } from '../../internal/icons';\nimport { SidebarContext, useSidebar, type SidebarContextValue } from './SidebarContext';\nimport { useIsMobile } from './useIsMobile';\n\n// ─── SidebarProvider ─── //\n\ninterface SidebarProviderProps extends React.ComponentProps<'div'> {\n /** Uncontrolled initial desktop state. Default true (expanded). */\n defaultOpen?: boolean;\n /** Controlled desktop open state. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Viewport width (px) below which the mobile Drawer engages. Default 768. */\n mobileBreakpoint?: number;\n /** Register Cmd/Ctrl+B to toggle. Default true. */\n keyboardShortcut?: boolean;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange,\n mobileBreakpoint = 768,\n keyboardShortcut = true,\n className,\n style,\n children,\n ...props\n}: SidebarProviderProps) {\n const isMobile = useIsMobile(mobileBreakpoint);\n const [openMobile, setOpenMobile] = useState(false);\n\n const isControlled = openProp !== undefined;\n const [openInternal, setOpenInternal] = useState(defaultOpen);\n const open = isControlled ? (openProp as boolean) : openInternal;\n\n const setOpen = useCallback(\n (value: boolean) => {\n if (!isControlled) setOpenInternal(value);\n onOpenChange?.(value);\n },\n [isControlled, onOpenChange],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) {\n setOpenMobile((v) => !v);\n return;\n }\n if (isControlled) {\n onOpenChange?.(!open);\n } else {\n setOpenInternal((v) => !v);\n }\n }, [isMobile, isControlled, onOpenChange, open]);\n\n useEffect(() => {\n if (!keyboardShortcut) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key.toLowerCase() === 'b' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener('keydown', onKeyDown);\n return () => window.removeEventListener('keydown', onKeyDown);\n }, [keyboardShortcut, toggleSidebar]);\n\n const state: 'expanded' | 'collapsed' = open ? 'expanded' : 'collapsed';\n\n const value = useMemo<SidebarContextValue>(\n () => ({ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }),\n [state, open, setOpen, openMobile, isMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={value}>\n <div\n data-slot=\"sidebar-wrapper\"\n className={cn('ddga-sidebar-wrapper', className)}\n style={style}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n}\n\n// ─── Sidebar (container) ─── //\n\ninterface SidebarProps extends React.ComponentProps<'div'> {\n variant?: 'sidebar' | 'floating' | 'inset';\n collapsible?: 'icon' | 'offcanvas' | 'none';\n /** Logical side; flips with dir. Default 'start'. */\n side?: 'start' | 'end';\n}\n\nfunction Sidebar({\n variant = 'sidebar',\n collapsible = 'icon',\n side = 'start',\n className,\n children,\n 'aria-label': ariaLabel = 'Sidebar',\n ...props\n}: SidebarProps) {\n const { isMobile, openMobile, setOpenMobile, state } = useSidebar();\n\n if (isMobile) {\n return (\n <Drawer open={openMobile} onOpenChange={setOpenMobile}>\n <DrawerContent\n side={side}\n size=\"sm\"\n aria-label={ariaLabel}\n data-mobile=\"true\"\n data-variant={variant}\n data-side={side}\n className={cn('ddga-sidebar', 'ddga-sidebar--mobile', className)}\n >\n {children}\n </DrawerContent>\n </Drawer>\n );\n }\n\n return (\n <aside\n data-slot=\"sidebar\"\n aria-label={ariaLabel}\n data-state={state}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n className={cn('ddga-sidebar', className)}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\n// ─── Trigger / Rail / Inset ─── //\n\ninterface SidebarTriggerProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nfunction SidebarTrigger({\n asChild,\n className,\n onClick,\n children,\n 'aria-label': ariaLabel = 'Toggle sidebar',\n ...props\n}: SidebarTriggerProps) {\n const { toggleSidebar, open, openMobile, isMobile } = useSidebar();\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-trigger\"\n // Don't override the child element's accessible name when asChild.\n aria-label={asChild ? undefined : ariaLabel}\n aria-haspopup={isMobile ? 'dialog' : undefined}\n aria-expanded={isMobile ? openMobile : open}\n className={cn('ddga-sidebar__trigger', className)}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n toggleSidebar();\n }}\n {...props}\n >\n {children ?? <PanelLeft aria-hidden=\"true\" />}\n </Comp>\n );\n}\n\nfunction SidebarRail({\n className,\n 'aria-label': ariaLabel = 'Toggle sidebar',\n ...props\n}: React.ComponentProps<'button'>) {\n const { toggleSidebar } = useSidebar();\n return (\n <button\n type=\"button\"\n data-slot=\"sidebar-rail\"\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={-1}\n className={cn('ddga-sidebar__rail', className)}\n onClick={toggleSidebar}\n {...props}\n />\n );\n}\n\ninterface SidebarInsetProps extends React.ComponentProps<'main'> {\n asChild?: boolean;\n}\n\nfunction SidebarInset({ asChild, className, ...props }: SidebarInsetProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'main';\n return (\n <Comp data-slot=\"sidebar-inset\" className={cn('ddga-sidebar-inset', className)} {...props} />\n );\n}\n\n// ─── Structure ─── //\n\ntype SidebarSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\nfunction SidebarHeader({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"sidebar-header\" className={cn('ddga-sidebar__header', className)} {...props} />\n );\n}\n\nfunction SidebarContent({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-content\"\n className={cn('ddga-sidebar__content', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"sidebar-footer\" className={cn('ddga-sidebar__footer', className)} {...props} />\n );\n}\n\nfunction SidebarSeparator({ className, ...props }: React.ComponentProps<'hr'>) {\n return (\n <hr\n data-slot=\"sidebar-separator\"\n className={cn('ddga-sidebar__separator', className)}\n {...props}\n />\n );\n}\n\n// ─── Exports ─── //\n\nexport { SidebarProvider };\nexport type { SidebarProviderProps };\n\nexport { Sidebar };\nexport type { SidebarProps };\n\nexport { SidebarTrigger, SidebarRail, SidebarInset };\nexport type { SidebarTriggerProps, SidebarInsetProps };\n\nexport { SidebarHeader, SidebarContent, SidebarFooter, SidebarSeparator };\nexport type { SidebarSectionProps };\n\nexport { useSidebar };\nexport type { SidebarContextValue };\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\nexport interface SidebarContextValue {\n /** Desktop collapse state, derived from `open`. */\n state: 'expanded' | 'collapsed';\n /** Desktop expanded (true) / collapsed-to-rail (false). */\n open: boolean;\n setOpen: (open: boolean) => void;\n /** Mobile off-canvas drawer open state. */\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n /** True below the provider's `mobileBreakpoint`. */\n isMobile: boolean;\n /** Toggles `openMobile` on mobile, else `open`. */\n toggleSidebar: () => void;\n}\n\nexport const SidebarContext = createContext<SidebarContextValue | null>(null);\n\nexport function useSidebar(): SidebarContextValue {\n const ctx = useContext(SidebarContext);\n if (!ctx) {\n throw new Error('useSidebar must be used within a <SidebarProvider>');\n }\n return ctx;\n}\n","'use client';\n\nimport { useEffect, useState } from 'react';\n\n/**\n * True when the viewport is narrower than `breakpoint`. SSR-safe: returns\n * `false` until the mount effect runs, so the desktop layout renders first\n * and the mobile Drawer (a client-only overlay) only engages after hydration.\n */\nexport function useIsMobile(breakpoint = 768): boolean {\n const [isMobile, setIsMobile] = useState(false);\n\n useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);\n const onChange = () => setIsMobile(mql.matches);\n onChange();\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [breakpoint]);\n\n return isMobile;\n}\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cn } from '../../utils/cn';\n\ntype SidebarGroupDivProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\nfunction SidebarGroup({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group\"\n role=\"group\"\n className={cn('ddga-sidebar__group', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n className={cn('ddga-sidebar__group-label', className)}\n {...props}\n />\n );\n}\n\ninterface SidebarGroupActionProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nfunction SidebarGroupAction({ asChild, className, ...props }: SidebarGroupActionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-group-action\"\n className={cn('ddga-sidebar__group-action', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group-content\"\n className={cn('ddga-sidebar__group-content', className)}\n {...props}\n />\n );\n}\n\nexport { SidebarGroup, SidebarGroupLabel, SidebarGroupAction, SidebarGroupContent };\nexport type { SidebarGroupDivProps, SidebarGroupActionProps };\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useDir } from '../../hooks/useDir';\nimport { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip';\nimport { Skeleton } from '../Skeleton';\nimport { useSidebar } from './SidebarContext';\n\n// ─── Menu / MenuItem ─── //\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"sidebar-menu\" className={cn('ddga-sidebar__menu', className)} {...props} />;\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n className={cn('ddga-sidebar__menu-item', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuButton ─── //\n\nconst sidebarMenuButtonVariants = cva('ddga-sidebar__menu-button', {\n variants: {\n size: {\n sm: 'ddga-sidebar__menu-button--sm',\n md: 'ddga-sidebar__menu-button--md',\n lg: 'ddga-sidebar__menu-button--lg',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\ninterface SidebarMenuButtonProps\n extends React.ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n /** Tooltip content shown only when the rail is collapsed (desktop). */\n tooltip?: React.ReactNode;\n}\n\nfunction SidebarMenuButton({\n asChild,\n isActive,\n size,\n tooltip,\n className,\n ...props\n}: SidebarMenuButtonProps) {\n const { state, isMobile } = useSidebar();\n const dir = useDir();\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n const button = (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-menu-button\"\n data-active={isActive || undefined}\n data-size={size ?? 'md'}\n aria-current={isActive ? 'page' : undefined}\n className={cn(sidebarMenuButtonVariants({ size }), className)}\n {...props}\n />\n );\n\n if (!tooltip || state !== 'collapsed' || isMobile) {\n return button;\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span data-slot=\"tooltip-trigger\" style={{ display: 'contents' }}>\n {button}\n </span>\n </TooltipTrigger>\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n}\n\n// ─── MenuAction ─── //\n\ninterface SidebarMenuActionProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n /** Reveal the action only on row hover/focus (CSS-driven). */\n showOnHover?: boolean;\n}\n\nfunction SidebarMenuAction({ asChild, showOnHover, className, ...props }: SidebarMenuActionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-menu-action\"\n data-show-on-hover={showOnHover || undefined}\n className={cn('ddga-sidebar__menu-action', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuBadge ─── //\n\nfunction SidebarMenuBadge({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"sidebar-menu-badge\"\n className={cn('ddga-sidebar__menu-badge', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuSkeleton ─── //\n\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<'div'> {\n showIcon?: boolean;\n}\n\nfunction SidebarMenuSkeleton({ showIcon, className, ...props }: SidebarMenuSkeletonProps) {\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n className={cn('ddga-sidebar__menu-skeleton', className)}\n {...props}\n >\n {showIcon ? <Skeleton shape=\"circle\" width=\"1rem\" height=\"1rem\" /> : null}\n <Skeleton shape=\"text\" className=\"ddga-sidebar__menu-skeleton-text\" />\n </div>\n );\n}\n\n// ─── MenuSub / MenuSubItem / MenuSubButton ─── //\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n className={cn('ddga-sidebar__menu-sub', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n className={cn('ddga-sidebar__menu-sub-item', className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuSubButtonVariants = cva('ddga-sidebar__menu-sub-button', {\n variants: {\n size: {\n sm: 'ddga-sidebar__menu-sub-button--sm',\n md: 'ddga-sidebar__menu-sub-button--md',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\ninterface SidebarMenuSubButtonProps\n extends React.ComponentProps<'a'>, VariantProps<typeof sidebarMenuSubButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n}\n\nfunction SidebarMenuSubButton({\n asChild,\n isActive,\n size,\n className,\n ...props\n}: SidebarMenuSubButtonProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-active={isActive || undefined}\n data-size={size ?? 'md'}\n aria-current={isActive ? 'page' : undefined}\n className={cn(sidebarMenuSubButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\n// ─── Exports ─── //\n\nexport {\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n sidebarMenuButtonVariants,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarMenuSubButton,\n sidebarMenuSubButtonVariants,\n};\nexport type {\n SidebarMenuButtonProps,\n SidebarMenuActionProps,\n SidebarMenuSkeletonProps,\n SidebarMenuSubButtonProps,\n};\n","'use client';\n\nimport { useDga } from '../providers/DgaContext';\n\n/**\n * Returns the current writing direction from the nearest `<DgaProvider>`.\n *\n * Prefer this over `useDga().dir` when a component only needs direction\n * (clearer intent, smaller dependency footprint at the call site).\n *\n * Throws if called outside a `<DgaProvider>` (matches `useDga`).\n */\nexport function useDir(): 'ltr' | 'rtl' {\n return useDga().dir;\n}\n","'use client';\n\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst scrollAreaVariants = cva('ddga-scroll-area', {\n variants: {\n orientation: {\n vertical: 'ddga-scroll-area--vertical',\n horizontal: 'ddga-scroll-area--horizontal',\n both: 'ddga-scroll-area--both',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction warnMissingLabel(ariaLabel?: string, ariaLabelledby?: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (ariaLabel || ariaLabelledby) return;\n // Warn on every render (dev only) — mirrors the Popover sibling's a11y warning.\n console.warn(\n '[dga/ScrollArea] <ScrollArea> has no accessible name. The scroll viewport is ' +\n 'keyboard-focusable; pass `aria-label` or `aria-labelledby` so screen-reader users ' +\n 'know what region they are scrolling. If the content is itself focusable (e.g. a list ' +\n 'of links) and you do not want a labelled region, pass `viewportProps={{ tabIndex: -1 }}`.',\n );\n}\n\ntype ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';\n\nexport interface ScrollAreaProps\n extends\n Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Root>, 'asChild' | 'orientation'>,\n Omit<VariantProps<typeof scrollAreaVariants>, 'orientation'> {\n /** Which scrollbar(s) to render. Default `'vertical'`. */\n orientation?: ScrollAreaOrientation;\n /** Ref to the scrollable viewport — use for programmatic scrolling. */\n viewportRef?: React.Ref<HTMLDivElement>;\n /**\n * Extra props forwarded to the viewport element (use `viewportRef` for the ref).\n * To drop the extra tab stop when the scrolled content is itself fully focusable\n * (e.g. a list of links), pass `viewportProps={{ tabIndex: -1 }}`.\n */\n viewportProps?: Omit<React.ComponentProps<'div'>, 'ref'>;\n /** Names the scroll region. Warns (dev only) if neither this nor `aria-labelledby` is set. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n/**\n * Cross-browser, design-system-styled scroll container (wraps Radix ScrollArea).\n *\n * Set the bounding size (height / max-height) on the element via `className` /\n * `style` — without a bounded size nothing scrolls, exactly like native overflow.\n * The viewport is keyboard-focusable (`tabIndex={0}`) so keyboard users can scroll\n * with the arrow / Page keys; pass `aria-label` to name the region.\n *\n * Does not support `asChild`: it is a structural wrapper composing several Radix\n * parts, and the meaningful node — the viewport — is exposed via `viewportRef`.\n */\nexport function ScrollArea({\n className,\n orientation = 'vertical',\n type = 'hover',\n scrollHideDelay = 600,\n viewportRef,\n viewportProps,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n}: ScrollAreaProps) {\n warnMissingLabel(ariaLabel, ariaLabelledby);\n\n const hasLabel = Boolean(ariaLabel || ariaLabelledby);\n const showVertical = orientation === 'vertical' || orientation === 'both';\n const showHorizontal = orientation === 'horizontal' || orientation === 'both';\n\n const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n type={type}\n scrollHideDelay={scrollHideDelay}\n className={cn(scrollAreaVariants({ orientation }), className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className={cn('ddga-scroll-area__viewport', viewportClassName)}\n ref={viewportRef}\n tabIndex={0}\n role={hasLabel ? 'region' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n {...restViewportProps}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n {showVertical ? (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation=\"vertical\"\n className=\"ddga-scroll-area__scrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"ddga-scroll-area__thumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n {showHorizontal ? (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation=\"horizontal\"\n className=\"ddga-scroll-area__scrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"ddga-scroll-area__thumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n {orientation === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"ddga-scroll-area__corner\" />\n ) : null}\n </ScrollAreaPrimitive.Root>\n );\n}\n\nexport { scrollAreaVariants };\nexport type { ScrollAreaOrientation };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Menubar as MenubarPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Size lives on the dropdown panel (Content / SubContent), mirroring\n// DropdownMenu. The bar itself is a single size, so it carries no cva.\nconst menubarContentVariants = cva('ddga-menubar-menu', {\n variants: {\n size: {\n sm: 'ddga-menubar-menu--sm',\n md: 'ddga-menubar-menu--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Trigger look. `default` = flat menu-bar idiom (text + SA-green open underline);\n// `outline` = bordered button-style chip. Apply the same variant to every\n// trigger in a bar for a consistent look.\nconst menubarTriggerVariants = cva('ddga-menubar__trigger', {\n variants: {\n variant: {\n default: 'ddga-menubar__trigger--default',\n outline: 'ddga-menubar__trigger--outline',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\n// ─── 2. Bar (Root + Menu + Trigger) ─── //\n\ntype MenubarProps = React.ComponentProps<typeof MenubarPrimitive.Root>;\n\nfunction Menubar({ className, ...props }: MenubarProps) {\n return (\n <MenubarPrimitive.Root\n data-slot=\"menubar\"\n className={cn('ddga-menubar', className)}\n {...props}\n />\n );\n}\n\ntype MenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;\n\nfunction MenubarMenu(props: MenubarMenuProps) {\n return <MenubarPrimitive.Menu {...props} />;\n}\n\ntype MenubarTriggerProps = React.ComponentProps<typeof MenubarPrimitive.Trigger> &\n VariantProps<typeof menubarTriggerVariants>;\n\nfunction MenubarTrigger({ variant, className, ...props }: MenubarTriggerProps) {\n return (\n <MenubarPrimitive.Trigger\n data-slot=\"menubar-trigger\"\n data-variant={variant ?? 'default'}\n className={cn(menubarTriggerVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\n// ─── 3. Content (portal-anchored) ─── //\n\ntype MenubarContentProps = React.ComponentProps<typeof MenubarPrimitive.Content> &\n VariantProps<typeof menubarContentVariants>;\n\nfunction MenubarContent({ size, className, sideOffset = 6, ...props }: MenubarContentProps) {\n // Radix Portal defaults to <body>, which doesn't inherit DgaProvider's\n // data-theme / CSS vars. Re-anchor at the provider's body-level portal\n // container (mirrors data-theme + dir + theme vars) so the menu inherits\n // theme AND escapes any clipping or transform ancestor. Falls back to\n // <body> when used outside a provider. (Same pattern as DropdownMenu.)\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <MenubarPrimitive.Portal container={portalContainer}>\n <MenubarPrimitive.Content\n data-slot=\"menubar-content\"\n sideOffset={sideOffset}\n className={cn(menubarContentVariants({ size }), className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n );\n}\n\n// ─── 4. Item + variants ─── //\n\ntype MenubarItemProps = React.ComponentProps<typeof MenubarPrimitive.Item> & {\n /** Style as a destructive action (red text, red hover). */\n destructive?: boolean;\n /** Icon rendered before the label. Sized to 1em. */\n startIcon?: ReactNode;\n /** Trailing text shown muted, e.g. a keyboard shortcut hint (\"⌘K\"). */\n shortcut?: ReactNode;\n};\n\nfunction MenubarItem({\n className,\n destructive,\n startIcon,\n shortcut,\n children,\n ...props\n}: MenubarItemProps) {\n return (\n <MenubarPrimitive.Item\n data-slot=\"menubar-item\"\n data-destructive={destructive ? '' : undefined}\n className={cn('ddga-menubar-menu__item', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-menubar-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n {shortcut ? (\n <span className=\"ddga-menubar-menu__shortcut\" aria-hidden=\"true\">\n {shortcut}\n </span>\n ) : null}\n </MenubarPrimitive.Item>\n );\n}\n\n// ─── 5. CheckboxItem + RadioItem ─── //\n\ntype MenubarCheckboxItemProps = React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>;\n\nfunction MenubarCheckboxItem({\n className,\n children,\n onSelect,\n ...props\n}: MenubarCheckboxItemProps) {\n // Default UX: keep the menu open across toggles so consumers can flip\n // multiple checkboxes in one pass. If a consumer passes their own onSelect,\n // they own the behavior (call `event.preventDefault()` to keep this default).\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <MenubarPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-menubar-menu__indicator\" aria-hidden=\"true\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"ddga-menubar-menu__indicator-icon\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n </MenubarPrimitive.CheckboxItem>\n );\n}\n\ntype MenubarRadioGroupProps = React.ComponentProps<typeof MenubarPrimitive.RadioGroup>;\n\nfunction MenubarRadioGroup(props: MenubarRadioGroupProps) {\n return <MenubarPrimitive.RadioGroup data-slot=\"menubar-radio-group\" {...props} />;\n}\n\ntype MenubarRadioItemProps = React.ComponentProps<typeof MenubarPrimitive.RadioItem>;\n\nfunction MenubarRadioItem({ className, children, onSelect, ...props }: MenubarRadioItemProps) {\n // Same default-open behavior as CheckboxItem — selecting a radio without\n // the menu visually confirming the new state is a frustrating dead-feel.\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <MenubarPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-menubar-menu__indicator\" aria-hidden=\"true\">\n <MenubarPrimitive.ItemIndicator>\n <span className=\"ddga-menubar-menu__radio-dot\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n </MenubarPrimitive.RadioItem>\n );\n}\n\n// ─── 6. Label + Separator + Group ─── //\n\ntype MenubarLabelProps = React.ComponentProps<typeof MenubarPrimitive.Label>;\n\nfunction MenubarLabel({ className, ...props }: MenubarLabelProps) {\n return (\n <MenubarPrimitive.Label\n data-slot=\"menubar-label\"\n className={cn('ddga-menubar-menu__group-label', className)}\n {...props}\n />\n );\n}\n\ntype MenubarSeparatorProps = React.ComponentProps<typeof MenubarPrimitive.Separator>;\n\nfunction MenubarSeparator({ className, ...props }: MenubarSeparatorProps) {\n return (\n <MenubarPrimitive.Separator\n data-slot=\"menubar-separator\"\n className={cn('ddga-menubar-menu__separator', className)}\n {...props}\n />\n );\n}\n\ntype MenubarGroupProps = React.ComponentProps<typeof MenubarPrimitive.Group>;\n\nfunction MenubarGroup(props: MenubarGroupProps) {\n return <MenubarPrimitive.Group data-slot=\"menubar-group\" {...props} />;\n}\n\n// ─── 7. Submenu (Sub + SubTrigger + SubContent) ─── //\n\ntype MenubarSubProps = React.ComponentProps<typeof MenubarPrimitive.Sub>;\n\nfunction MenubarSub(props: MenubarSubProps) {\n return <MenubarPrimitive.Sub {...props} />;\n}\n\ntype MenubarSubTriggerProps = React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {\n startIcon?: ReactNode;\n};\n\nfunction MenubarSubTrigger({ className, startIcon, children, ...props }: MenubarSubTriggerProps) {\n return (\n <MenubarPrimitive.SubTrigger\n data-slot=\"menubar-sub-trigger\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--sub', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-menubar-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n <ChevronRight className=\"ddga-menubar-menu__sub-chevron\" aria-hidden=\"true\" />\n </MenubarPrimitive.SubTrigger>\n );\n}\n\ntype MenubarSubContentProps = React.ComponentProps<typeof MenubarPrimitive.SubContent> &\n VariantProps<typeof menubarContentVariants>;\n\nfunction MenubarSubContent({ size, className, ...props }: MenubarSubContentProps) {\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <MenubarPrimitive.Portal container={portalContainer}>\n <MenubarPrimitive.SubContent\n data-slot=\"menubar-sub-content\"\n className={cn(menubarContentVariants({ size }), className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n );\n}\n\n// ─── 8. Exports ─── //\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarGroup,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n menubarContentVariants,\n menubarTriggerVariants,\n};\nexport type {\n MenubarProps,\n MenubarMenuProps,\n MenubarTriggerProps,\n MenubarContentProps,\n MenubarItemProps,\n MenubarCheckboxItemProps,\n MenubarRadioGroupProps,\n MenubarRadioItemProps,\n MenubarLabelProps,\n MenubarSeparatorProps,\n MenubarGroupProps,\n MenubarSubProps,\n MenubarSubTriggerProps,\n MenubarSubContentProps,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual-only chronological compound. Semantic `<ol>`/`<li>` so the event\n// count + order are assistive-tech-readable. The connector line is CSS-drawn\n// via a pseudo-element between siblings (the `Steps` technique) — no separator\n// component for consumers to misuse. Markers carry a `status` that tints the\n// node via the semantic `--ddga-color-*` palette; the status is PURELY VISUAL,\n// so the meaning (\"Failed\") must live in the content text — never rely on the\n// dot colour alone. \"Activity feed\" is a composition of this primitive\n// (Timeline + Avatar + text in the content slot), not a separate component.\n\nconst timelineVariants = cva('ddga-timeline', {\n variants: {\n size: {\n sm: 'ddga-timeline--sm',\n md: 'ddga-timeline--md',\n },\n orientation: {\n vertical: 'ddga-timeline--vertical',\n horizontal: 'ddga-timeline--horizontal',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'vertical',\n },\n});\n\ntype TimelineStatus = 'default' | 'success' | 'error' | 'warning' | 'info';\n\nconst timelineMarkerVariants = cva('ddga-timeline__marker', {\n variants: {\n status: {\n default: 'ddga-timeline__marker--default',\n success: 'ddga-timeline__marker--success',\n error: 'ddga-timeline__marker--error',\n warning: 'ddga-timeline__marker--warning',\n info: 'ddga-timeline__marker--info',\n },\n },\n defaultVariants: {\n status: 'default',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface TimelineProps extends React.ComponentProps<'ol'>, VariantProps<typeof timelineVariants> {}\n\ntype TimelineItemProps = React.ComponentProps<'li'>;\n\ninterface TimelineMarkerProps\n extends React.ComponentProps<'span'>, VariantProps<typeof timelineMarkerVariants> {}\n\ntype TimelineContentProps = React.ComponentProps<'div'>;\ntype TimelineTitleProps = React.ComponentProps<'span'>;\ntype TimelineDescriptionProps = React.ComponentProps<'span'>;\ntype TimelineTimeProps = React.ComponentProps<'time'>;\n\n// ─── 3. Components ─── //\n\nfunction Timeline({ size, orientation, className, ...props }: TimelineProps) {\n // `<ol>` is the right semantic for an ordered sequence of events; the\n // implicit listitem role on children makes the count assistive-tech-readable.\n return (\n <ol\n data-slot=\"timeline\"\n data-orientation={orientation ?? 'vertical'}\n className={cn(timelineVariants({ size, orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction TimelineItem({ className, ...props }: TimelineItemProps) {\n // Always an `<li>` — the parent `<ol>` may only contain `<li>` children, so\n // consumers needing a clickable event put an `<a>` (or router primitive)\n // INSIDE the content, never as the item element itself. This is why no part\n // ships `asChild` (mirrors `Steps`). The item owns the CSS connector segment\n // to the next sibling.\n return (\n <li data-slot=\"timeline-item\" className={cn('ddga-timeline__item', className)} {...props} />\n );\n}\n\nfunction TimelineMarker({ status, className, children, ...props }: TimelineMarkerProps) {\n // Decorative — assistive tech reads the content, not the node. When children\n // are provided they render as a custom icon; otherwise a plain dot is drawn.\n // The `data-status` carries the visual intent for CSS keying.\n const resolved = status ?? 'default';\n // `data-reached` marks a non-default (completed/active) node. The connector\n // line uses it as a CSS sibling gate so a segment fills with the PREVIOUS\n // node's colour ONLY when the NEXT node is also reached — a completed→pending\n // transition stays neutral (the Steps progress-fill semantics).\n const reached = resolved !== 'default';\n return (\n <span\n aria-hidden=\"true\"\n data-slot=\"timeline-marker\"\n data-status={resolved}\n data-reached={reached ? '' : undefined}\n className={cn(timelineMarkerVariants({ status }), className)}\n {...props}\n >\n {children ?? <span className=\"ddga-timeline__dot\" />}\n </span>\n );\n}\n\nfunction TimelineContent({ className, ...props }: TimelineContentProps) {\n return (\n <div\n data-slot=\"timeline-content\"\n className={cn('ddga-timeline__content', className)}\n {...props}\n />\n );\n}\n\nfunction TimelineTitle({ className, ...props }: TimelineTitleProps) {\n return (\n <span data-slot=\"timeline-title\" className={cn('ddga-timeline__title', className)} {...props} />\n );\n}\n\nfunction TimelineDescription({ className, ...props }: TimelineDescriptionProps) {\n return (\n <span\n data-slot=\"timeline-description\"\n className={cn('ddga-timeline__description', className)}\n {...props}\n />\n );\n}\n\nfunction TimelineTime({ className, ...props }: TimelineTimeProps) {\n // Renders a real `<time>`; consumers pass `dateTime` for the machine-readable\n // timestamp while the children carry the human-readable label (\"2h ago\").\n return (\n <time data-slot=\"timeline-time\" className={cn('ddga-timeline__time', className)} {...props} />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Timeline,\n TimelineItem,\n TimelineMarker,\n TimelineContent,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n timelineVariants,\n timelineMarkerVariants,\n};\nexport type {\n TimelineProps,\n TimelineItemProps,\n TimelineMarkerProps,\n TimelineContentProps,\n TimelineTitleProps,\n TimelineDescriptionProps,\n TimelineTimeProps,\n TimelineStatus,\n};\n","'use client';\n\nimport { useState, useMemo, useContext, useEffect, useRef } from 'react';\nimport { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { buildTheme, type DgaTheme } from '@dev-dga/tokens';\nimport { DgaContext, type DgaContextValue } from './DgaContext';\n\ntype DgaRootElement =\n | 'div'\n | 'main'\n | 'nav'\n | 'section'\n | 'article'\n | 'aside'\n | 'header'\n | 'footer';\n\nexport interface DgaProviderProps {\n dir?: 'ltr' | 'rtl';\n locale?: string;\n mode?: 'light' | 'dark';\n /**\n * Brand theme. `theme.primary` accepts a palette name (`'lavender'`),\n * any CSS color string (`'#7C3AED'` , hover/active auto-derived via\n * `color-mix()`), or an explicit `{ base, hover, active, foreground? }`\n * triplet. The override-object pattern (`style={{ '--ddga-color-primary':\n * '...' }}`) still works , `style` wins over `theme`.\n */\n theme?: DgaTheme;\n as?: DgaRootElement;\n className?: string;\n style?: React.CSSProperties;\n children: React.ReactNode;\n}\n\nexport function DgaProvider({\n dir = 'ltr',\n locale,\n mode = 'light',\n theme,\n as: Component = 'div',\n className,\n style: consumerStyle,\n children,\n}: DgaProviderProps) {\n const parentCtx = useContext(DgaContext);\n const isNested = parentCtx !== null;\n // Callback ref + state so context subscribers (e.g. Select's portal\n // container) re-render when the element actually mounts. With useRef\n // the .current update wouldn't trigger a render and a defaultOpen\n // portal would race to <body> before the ref populated.\n const [rootEl, setRootEl] = useState<HTMLElement | null>(null);\n // The portal element is held in a ref (we directly mutate its attributes\n // + inline CSS variables, which the react-hooks/immutability lint rule\n // forbids on state values). A parallel `portalEl` state mirrors the ref\n // so context subscribers re-render once the element mounts.\n const portalRef = useRef<HTMLDivElement | null>(null);\n const [portalEl, setPortalEl] = useState<HTMLElement | null>(null);\n const resolvedLocale = locale ?? (dir === 'rtl' ? 'ar' : 'en');\n\n // Memoize by reference. Stable palette-name themes (`{ primary: 'lavender' }`\n // declared at module scope) never recompute; consumers passing an inline\n // object accept a per-render `buildTheme` call (cheap , small switch\n // statement over a single string).\n const themeVars = useMemo(() => (theme ? buildTheme(theme) : null), [theme]);\n\n // ─── Body-level portal container ─── //\n //\n // Create a sibling-of-body div that mirrors this provider's theme\n // attributes. Overlay portals (Modal, Drawer, DropdownMenu, etc.) anchor\n // here instead of `rootEl` so:\n //\n // - They escape `overflow: hidden` / `transform` ancestors the consumer\n // might wrap us in (Storybook's docs-story preview block is the\n // motivating case — a `transform` ancestor breaks `position: fixed`\n // descendants, clipping modals to the preview rect).\n // - Theme variables, dark mode, RTL still resolve because we copy\n // `data-theme`, `dir`, and inline CSS vars from this provider onto\n // the portal element.\n //\n // One container per DgaProvider instance — cleaned up on unmount. SSR-safe\n // (effects only run client-side; consumers see `portalEl: null` and the\n // overlays fall back to `rootEl`).\n useEffect(() => {\n if (typeof document === 'undefined') return;\n const el = document.createElement('div');\n el.setAttribute('data-slot', 'dga-portal');\n // Position relative for any child popper computing offset against\n // nearest positioned ancestor; z-index so the portal sits above the\n // main content stack.\n el.style.position = 'relative';\n el.style.zIndex = '50';\n document.body.appendChild(el);\n portalRef.current = el;\n // The setState here exposes the freshly-mounted DOM element to context\n // subscribers (overlay components) so they re-render and target the\n // portal on first commit. Single call on mount + single on unmount;\n // not the cascading-render footgun the lint rule guards against.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setPortalEl(el);\n return () => {\n el.remove();\n portalRef.current = null;\n\n setPortalEl(null);\n };\n }, []);\n\n // Mirror theme attributes onto the portal element so its descendants\n // resolve `var(--ddga-*)` and respect dark mode / RTL the same way as\n // descendants of `rootEl`. We mutate via the ref (not the state) so the\n // react-hooks/immutability rule stays happy — and run this on every prop\n // change that affects appearance.\n useEffect(() => {\n const el = portalRef.current;\n if (!el) return;\n el.setAttribute('data-theme', mode);\n el.setAttribute('dir', dir);\n el.style.colorScheme = mode;\n if (themeVars) {\n for (const [k, v] of Object.entries(themeVars)) {\n el.style.setProperty(k, String(v));\n }\n }\n }, [mode, dir, themeVars, portalEl]);\n\n const ctxValue = useMemo<DgaContextValue>(\n () => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),\n [dir, resolvedLocale, mode, rootEl, portalEl],\n );\n\n // Radix's Direction.Provider propagates `dir` to portal-rendered content\n // (Tooltip/Select/Toast/Modal) that would otherwise inherit body dir,\n // not the dir on this wrapper element. Nested providers reuse the parent\n // direction via their own Direction.Provider, so this is safe to repeat.\n const inner = <DirectionPrimitive.Provider dir={dir}>{children}</DirectionPrimitive.Provider>;\n\n return (\n <DgaContext.Provider value={ctxValue}>\n <Component\n ref={setRootEl}\n dir={dir}\n lang={resolvedLocale}\n data-slot=\"dga-root\"\n data-theme={mode}\n className={className}\n // Order: colorScheme → theme vars → consumer style. A manually-\n // supplied `style` overrides `theme` (escape hatch preserved per\n // THEMING-PLAN.md: every `--ddga-*` remains plain-CSS overridable).\n style={{ colorScheme: mode, ...(themeVars ?? {}), ...consumerStyle }}\n >\n {isNested ? (\n inner\n ) : (\n <TooltipPrimitive.Provider delayDuration={300} skipDelayDuration={100}>\n {inner}\n </TooltipPrimitive.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kBAAY,IAAI;AAAA,IAClB;AAAA,EACF,GAAG,CAAC,CAAC;AAOL,gCAAU,MAAM;AACd,UAAM,KAAK,UAAU;AACrB,QAAI,CAAC,GAAI;AACT,OAAG,aAAa,cAAc,IAAI;AAClC,OAAG,aAAa,OAAO,GAAG;AAC1B,OAAG,MAAM,cAAc;AACvB,QAAI,WAAW;AACb,iBAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,SAAS,GAAG;AAC9C,WAAG,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC;AAAA,MACnC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,MAAM,KAAK,WAAW,QAAQ,CAAC;AAEnC,QAAM,eAAW;AAAA,IACf,OAAO,EAAE,KAAK,QAAQ,gBAAgB,MAAM,QAAQ,SAAS;AAAA,IAC7D,CAAC,KAAK,gBAAgB,MAAM,QAAQ,QAAQ;AAAA,EAC9C;AAMA,QAAM,QAAQ,8CAAC,kBAAAC,UAAmB,UAAnB,EAA4B,KAAW,UAAS;AAE/D,SACE,8CAAC,WAAW,UAAX,EAAoB,OAAO,UAC1B;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,MAAM;AAAA,MACN,aAAU;AAAA,MACV,cAAY;AAAA,MACZ;AAAA,MAIA,OAAO,EAAE,aAAa,MAAM,GAAI,aAAa,CAAC,GAAI,GAAG,cAAc;AAAA,MAElE,qBACC,QAEA,8CAAC,kBAAAC,QAAiB,UAAjB,EAA0B,eAAe,KAAK,mBAAmB,KAC/D,iBACH;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":["import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_class_variance_authority","import_react","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_radix_ui","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","CheckboxPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","RadioGroupPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SwitchPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_react","import_jsx_runtime","SelectPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","AvatarPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TooltipPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DialogPrimitive","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_react","id","import_jsx_runtime","DEFAULT_ICONS","ToastPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TabsPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","AccordionPrimitive","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_radix_ui","import_class_variance_authority","import_jsx_runtime","ProgressPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DropdownMenuPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DialogPrimitive","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","PopoverPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","AriaCalendarStateContext","AriaCalendarCell","AriaDatePicker","AriaLabel","AriaGroup","AriaDateInput","AriaDateSegment","AriaButton","AriaText","AriaFieldError","AriaPopover","AriaDialog","AriaCalendar","AriaCalendarGrid","AriaCalendarGridHeader","AriaCalendarHeaderCell","AriaCalendarGridBody","import_react","import_jsx_runtime","process","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SliderPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","import_react","import_class_variance_authority","import_jsx_runtime","clamp","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TogglePrimitive","ToggleGroupPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DEFAULT_ICONS","SlotPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","PopoverPrimitive","import_react","import_radix_ui","import_react","import_react","import_jsx_runtime","value","SlotPrimitive","import_radix_ui","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","ScrollAreaPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","MenubarPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_jsx_runtime","DirectionPrimitive","TooltipPrimitive"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/Button/Button.tsx","../src/utils/cn.ts","../src/components/Spinner/Spinner.tsx","../src/components/Input/Input.tsx","../src/field/use-field-a11y.ts","../src/field/FieldMessage.tsx","../src/components/Textarea/Textarea.tsx","../src/components/Checkbox/Checkbox.tsx","../src/internal/icons/index.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Select/Select.tsx","../src/providers/DgaContext.ts","../src/components/Card/Card.tsx","../src/components/Badge/Badge.tsx","../src/components/Divider/Divider.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Alert/Alert.tsx","../src/components/Modal/Modal.tsx","../src/components/Toast/Toast.tsx","../src/components/Toast/toast-store.ts","../src/components/Tabs/Tabs.tsx","../src/components/Breadcrumb/Breadcrumb.tsx","../src/components/Pagination/Pagination.tsx","../src/components/Accordion/Accordion.tsx","../src/components/Steps/Steps.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Progress/Progress.tsx","../src/components/DropdownMenu/DropdownMenu.tsx","../src/components/Drawer/Drawer.tsx","../src/components/Combobox/Combobox.tsx","../src/components/DatePicker/DatePicker.tsx","../src/components/FileUpload/FileUpload.tsx","../src/components/Slider/Slider.tsx","../src/components/NumberInput/NumberInput.tsx","../src/components/Rating/Rating.tsx","../src/components/Toggle/Toggle.tsx","../src/components/DescriptionList/DescriptionList.tsx","../src/components/EmptyState/EmptyState.tsx","../src/components/Stat/Stat.tsx","../src/components/Stat/StatGroup.tsx","../src/components/Popover/Popover.tsx","../src/components/Sidebar/Sidebar.tsx","../src/components/Sidebar/SidebarContext.ts","../src/components/Sidebar/useIsMobile.ts","../src/components/Sidebar/SidebarGroup.tsx","../src/components/Sidebar/SidebarMenu.tsx","../src/hooks/useDir.ts","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Menubar/Menubar.tsx","../src/components/Timeline/Timeline.tsx","../src/components/Command/Command.tsx","../src/components/Table/Table.tsx","../src/components/InputOTP/InputOTP.tsx","../src/components/Link/Link.tsx","../src/components/SearchBox/SearchBox.tsx","../src/components/List/List.tsx","../src/components/Quote/Quote.tsx","../src/components/Collapsible/Collapsible.tsx","../src/components/TagInput/TagInput.tsx","../src/providers/DgaProvider.tsx"],"sourcesContent":["export { Button, buttonVariants, type ButtonProps } from './components/Button';\nexport { Input, inputVariants, type InputProps } from './components/Input';\nexport { Textarea, textareaVariants, type TextareaProps } from './components/Textarea';\nexport { Checkbox, checkboxVariants, type CheckboxProps } from './components/Checkbox';\nexport {\n RadioGroup,\n Radio,\n radioGroupVariants,\n radioVariants,\n type RadioGroupProps,\n type RadioProps,\n} from './components/Radio';\nexport { Switch, switchVariants, type SwitchProps } from './components/Switch';\nexport {\n Select,\n SelectItem,\n selectTriggerVariants,\n type SelectProps,\n type SelectItemProps,\n} from './components/Select';\nexport {\n Card,\n CardImage,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n type CardProps,\n type CardImageProps,\n type CardSectionProps,\n type CardTitleProps,\n type CardDescriptionProps,\n} from './components/Card';\nexport { Badge, badgeVariants, type BadgeProps } from './components/Badge';\nexport { Divider, dividerVariants, type DividerProps } from './components/Divider';\nexport {\n Avatar,\n AvatarImage,\n AvatarFallback,\n AvatarGroup,\n avatarVariants,\n type AvatarProps,\n type AvatarImageProps,\n type AvatarFallbackProps,\n type AvatarGroupProps,\n type AvatarStatus,\n} from './components/Avatar';\nexport {\n Tooltip,\n TooltipTrigger,\n TooltipContent,\n tooltipContentVariants,\n type TooltipProps,\n type TooltipTriggerProps,\n type TooltipContentProps,\n} from './components/Tooltip';\nexport {\n Alert,\n AlertTitle,\n AlertDescription,\n alertVariants,\n type AlertProps,\n type AlertTitleProps,\n type AlertDescriptionProps,\n type AlertSectionProps,\n} from './components/Alert';\nexport {\n Modal,\n ModalTrigger,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n type ModalProps,\n type ModalTriggerProps,\n type ModalContentProps,\n type ModalSectionProps,\n type ModalTitleProps,\n type ModalDescriptionProps,\n type ModalCloseProps,\n} from './components/Modal';\nexport {\n Toaster,\n toast,\n toastStore,\n createToast,\n createToastStore,\n toastVariants,\n toastViewportVariants,\n type ToasterProps,\n type ToastPosition,\n type ToastVariant,\n type ToastData,\n type ToastOptions,\n type ToastAction,\n type ToastStore,\n} from './components/Toast';\nexport {\n Tabs,\n TabsList,\n TabsTrigger,\n TabsContent,\n tabsVariants,\n tabsListVariants,\n type TabsProps,\n type TabsListProps,\n type TabsTriggerProps,\n type TabsContentProps,\n} from './components/Tabs';\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n breadcrumbVariants,\n type BreadcrumbProps,\n type BreadcrumbListProps,\n type BreadcrumbItemProps,\n type BreadcrumbLinkProps,\n type BreadcrumbPageProps,\n type BreadcrumbSeparatorProps,\n type BreadcrumbEllipsisProps,\n} from './components/Breadcrumb';\nexport {\n Pagination,\n PaginationContent,\n PaginationItem,\n PaginationLink,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n paginationVariants,\n paginationLinkVariants,\n type PaginationProps,\n type PaginationContentProps,\n type PaginationItemProps,\n type PaginationLinkProps,\n type PaginationPreviousProps,\n type PaginationNextProps,\n type PaginationEllipsisProps,\n} from './components/Pagination';\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionContent,\n accordionVariants,\n type AccordionProps,\n type AccordionItemProps,\n type AccordionTriggerProps,\n type AccordionContentProps,\n} from './components/Accordion';\nexport {\n Steps,\n Step,\n StepIndicator,\n StepTitle,\n StepDescription,\n stepsVariants,\n stepVariants,\n type StepsProps,\n type StepProps,\n type StepIndicatorProps,\n type StepTitleProps,\n type StepDescriptionProps,\n type StepState,\n} from './components/Steps';\nexport { Spinner, spinnerVariants, type SpinnerProps } from './components/Spinner';\nexport { Skeleton, skeletonVariants, type SkeletonProps } from './components/Skeleton';\nexport {\n Progress,\n CircularProgress,\n progressVariants,\n circularProgressVariants,\n type ProgressProps,\n type CircularProgressProps,\n} from './components/Progress';\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n dropdownMenuVariants,\n type DropdownMenuProps,\n type DropdownMenuTriggerProps,\n type DropdownMenuContentProps,\n type DropdownMenuItemProps,\n type DropdownMenuCheckboxItemProps,\n type DropdownMenuRadioGroupProps,\n type DropdownMenuRadioItemProps,\n type DropdownMenuLabelProps,\n type DropdownMenuSeparatorProps,\n type DropdownMenuGroupProps,\n type DropdownMenuSubProps,\n type DropdownMenuSubTriggerProps,\n type DropdownMenuSubContentProps,\n} from './components/DropdownMenu';\nexport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n DrawerDescription,\n DrawerBody,\n DrawerFooter,\n DrawerClose,\n drawerVariants,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerContentProps,\n type DrawerSectionProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n type DrawerCloseProps,\n} from './components/Drawer';\nexport {\n Combobox,\n ComboboxItem,\n ComboboxGroup,\n ComboboxSeparator,\n comboboxTriggerVariants,\n comboboxVariants,\n type ComboboxProps,\n type ComboboxItemProps,\n type ComboboxGroupProps,\n type ComboboxSeparatorProps,\n} from './components/Combobox';\nexport { DatePicker, datePickerVariants, type DatePickerProps } from './components/DatePicker';\nexport {\n FileUpload,\n type FileUploadProps,\n type UploadFile,\n type FileRejection,\n type FileStatus,\n type RejectionCode,\n} from './components/FileUpload';\nexport { Slider, sliderVariants, type SliderProps, type SliderValue } from './components/Slider';\nexport { NumberInput, numberInputVariants, type NumberInputProps } from './components/NumberInput';\nexport { Rating, ratingVariants, type RatingProps } from './components/Rating';\nexport {\n Toggle,\n ToggleGroup,\n ToggleGroupItem,\n toggleVariants,\n toggleGroupVariants,\n type ToggleProps,\n type ToggleGroupProps,\n type ToggleGroupItemProps,\n} from './components/Toggle';\nexport {\n DescriptionList,\n DescriptionItem,\n DescriptionTerm,\n DescriptionDetails,\n descriptionListVariants,\n type DescriptionListProps,\n type DescriptionItemProps,\n type DescriptionTermProps,\n type DescriptionDetailsProps,\n} from './components/DescriptionList';\nexport {\n EmptyState,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n emptyStateVariants,\n type EmptyStateProps,\n type EmptyStateMediaProps,\n type EmptyStateTitleProps,\n type EmptyStateDescriptionProps,\n type EmptyStateActionsProps,\n} from './components/EmptyState';\nexport {\n Stat,\n StatLabel,\n StatValue,\n StatChart,\n StatChange,\n StatGroup,\n statVariants,\n statGroupVariants,\n type StatProps,\n type StatLabelProps,\n type StatValueProps,\n type StatChartProps,\n type StatChangeProps,\n type StatGroupProps,\n} from './components/Stat';\nexport {\n Popover,\n PopoverTrigger,\n PopoverAnchor,\n PopoverContent,\n PopoverClose,\n popoverContentVariants,\n type PopoverProps,\n type PopoverTriggerProps,\n type PopoverAnchorProps,\n type PopoverContentProps,\n type PopoverCloseProps,\n} from './components/Popover';\nexport {\n SidebarProvider,\n Sidebar,\n SidebarTrigger,\n SidebarRail,\n SidebarInset,\n SidebarHeader,\n SidebarContent,\n SidebarFooter,\n SidebarSeparator,\n SidebarGroup,\n SidebarGroupLabel,\n SidebarGroupAction,\n SidebarGroupContent,\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarMenuSubButton,\n useSidebar,\n useIsMobile,\n sidebarMenuButtonVariants,\n sidebarMenuSubButtonVariants,\n type SidebarProviderProps,\n type SidebarProps,\n type SidebarTriggerProps,\n type SidebarInsetProps,\n type SidebarSectionProps,\n type SidebarContextValue,\n type SidebarGroupDivProps,\n type SidebarGroupActionProps,\n type SidebarMenuButtonProps,\n type SidebarMenuActionProps,\n type SidebarMenuSkeletonProps,\n type SidebarMenuSubButtonProps,\n} from './components/Sidebar';\nexport {\n ScrollArea,\n scrollAreaVariants,\n type ScrollAreaProps,\n type ScrollAreaOrientation,\n} from './components/ScrollArea';\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarGroup,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n menubarContentVariants,\n menubarTriggerVariants,\n type MenubarProps,\n type MenubarMenuProps,\n type MenubarTriggerProps,\n type MenubarContentProps,\n type MenubarItemProps,\n type MenubarCheckboxItemProps,\n type MenubarRadioGroupProps,\n type MenubarRadioItemProps,\n type MenubarLabelProps,\n type MenubarSeparatorProps,\n type MenubarGroupProps,\n type MenubarSubProps,\n type MenubarSubTriggerProps,\n type MenubarSubContentProps,\n} from './components/Menubar';\nexport {\n Timeline,\n TimelineItem,\n TimelineMarker,\n TimelineContent,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n timelineVariants,\n timelineMarkerVariants,\n type TimelineProps,\n type TimelineItemProps,\n type TimelineMarkerProps,\n type TimelineContentProps,\n type TimelineTitleProps,\n type TimelineDescriptionProps,\n type TimelineTimeProps,\n type TimelineStatus,\n} from './components/Timeline';\n\nexport {\n Command,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandDialog,\n commandVariants,\n type CommandProps,\n type CommandInputProps,\n type CommandListProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandSeparatorProps,\n type CommandItemProps,\n type CommandDialogProps,\n} from './components/Command';\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableHead,\n TableCell,\n TableCaption,\n tableVariants,\n type TableProps,\n type TableRowProps,\n type TableHeadProps,\n type TableCellProps,\n} from './components/Table';\nexport { InputOTP, inputOTPVariants, type InputOTPProps } from './components/InputOTP';\nexport { Link, linkVariants, type LinkProps } from './components/Link';\nexport { SearchBox, type SearchBoxProps } from './components/SearchBox';\nexport {\n List,\n ListItem,\n ListItemIcon,\n ListItemContent,\n ListItemAction,\n listVariants,\n type ListProps,\n type ListItemProps,\n type ListItemIconProps,\n type ListItemContentProps,\n type ListItemActionProps,\n} from './components/List';\nexport {\n Quote,\n QuoteContent,\n QuoteCaption,\n QuoteAuthor,\n QuoteSource,\n quoteVariants,\n type QuoteProps,\n type QuoteContentProps,\n type QuoteCaptionProps,\n type QuoteAuthorProps,\n type QuoteSourceProps,\n} from './components/Quote';\nexport {\n Collapsible,\n CollapsibleTrigger,\n CollapsibleContent,\n type CollapsibleProps,\n type CollapsibleTriggerProps,\n type CollapsibleContentProps,\n} from './components/Collapsible';\nexport { TagInput, tagInputVariants, type TagInputProps } from './components/TagInput';\n\nexport { DgaProvider, type DgaProviderProps } from './providers/DgaProvider';\nexport { useDga } from './providers/DgaContext';\nexport { useDir } from './hooks/useDir';\nexport type { DgaTheme, PaletteName, ThemeColor } from '@dev-dga/tokens';\nexport {\n useFieldA11y,\n FieldMessage,\n type UseFieldA11yOptions,\n type FieldA11y,\n type FieldMessageProps,\n} from './field';\nexport { cn } from './utils/cn';\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Spinner } from '../Spinner';\n\n// ─── 1. Variants (cva) ─── //\n\nconst buttonVariants = cva('ddga-button', {\n variants: {\n variant: {\n primary: 'ddga-button--primary',\n secondary: 'ddga-button--secondary',\n outline: 'ddga-button--outline',\n ghost: 'ddga-button--ghost',\n destructive: 'ddga-button--destructive',\n // Destructive sub-variants — match the DGA library's full destructive\n // family (des-primary maps to plain `destructive` above).\n 'destructive-outline': 'ddga-button--destructive-outline',\n 'destructive-subtle': 'ddga-button--destructive-subtle',\n 'destructive-ghost': 'ddga-button--destructive-ghost',\n },\n size: {\n sm: 'ddga-button--sm',\n md: 'ddga-button--md',\n lg: 'ddga-button--lg',\n icon: 'ddga-button--icon',\n 'icon-sm': 'ddga-button--icon-sm',\n },\n fullWidth: {\n true: 'ddga-button--full-width',\n },\n /**\n * Use on dark / branded colored backgrounds. Visually inverts non-filled\n * variants (`outline`, `ghost`, destructive's outline/ghost forms) so\n * text + border stay visible against the surface. Filled variants\n * (`primary`, `secondary`, `destructive`, `destructive-subtle`) ignore\n * it — they already carry their own background contrast.\n */\n inverted: {\n true: 'ddga-button--inverted',\n },\n /**\n * Floating action button: fully-rounded + elevated. Orthogonal to `variant`\n * (color) and `size` — pair with `size=\"icon\"` for a circular FAB, or a text\n * size for an extended pill FAB. Positioning (`position: fixed`, safe-area\n * insets) is the consumer's responsibility — see the placement recipe in the\n * stories. Keep it a modifier, not a `Fab` wrapper component.\n */\n fab: {\n true: 'ddga-button--fab',\n },\n },\n compoundVariants: [],\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface ButtonProps extends React.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n /** Flip start/end icons horizontally in RTL (for chevrons, arrows, etc.) */\n iconFlip?: boolean;\n /**\n * Render as the single child element instead of a `<button>`. Lets consumers\n * compose Button with router links (`<Button asChild><Link href=\"…\">…</Link></Button>`)\n * without `<button><a>` invalid nesting.\n *\n * The `type` and native `disabled` attributes are dropped in this mode\n * (they're meaningless on non-button elements) , the disabled visual + a11y\n * state still works via `aria-disabled` + `tabIndex={-1}`. button.css\n * matches on `[aria-disabled='true']` alongside `:disabled` so the styling\n * applies on any element.\n *\n * Consumer remains responsible for preventing the underlying action when\n * disabled (e.g., calling `e.preventDefault()` in the Link's onClick),\n * since native `disabled` doesn't gate clicks on non-form-controls.\n */\n asChild?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Button({\n variant,\n size,\n fullWidth,\n inverted,\n fab,\n loading,\n disabled,\n startIcon,\n endIcon,\n iconFlip,\n asChild,\n className,\n children,\n type = 'button',\n ...props\n}: ButtonProps) {\n // Dev-only: warn if icon-only button has no accessible name\n if (process.env.NODE_ENV === 'development' && (size === 'icon' || size === 'icon-sm')) {\n if (!props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] Button with an icon-only size (size=\"icon\" or ' +\n '\"icon-sm\") requires an aria-label or aria-labelledby attribute ' +\n 'for screen reader accessibility.',\n );\n }\n }\n\n const isDisabled = disabled || loading;\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n return (\n <Comp\n // `type` and native `disabled` only apply to <button>. In asChild mode\n // the Slot's child could be <a>, <Link>, etc. , skip both attrs there\n // and lean on aria-disabled + tabIndex for the disabled state.\n {...(asChild ? {} : { type, disabled: isDisabled })}\n {...(asChild && isDisabled ? { tabIndex: -1 } : {})}\n // Both `disabled` and `aria-disabled` are set in button mode (native +\n // explicit ARIA signal). In asChild mode, `aria-disabled` is the only\n // disabled signal a11y consumers can read on a non-form-control.\n aria-disabled={isDisabled || undefined}\n aria-busy={loading || undefined}\n data-slot=\"button\"\n className={cn(\n buttonVariants({ variant, size, fullWidth, inverted, fab }),\n loading && 'ddga-button--loading',\n className,\n )}\n {...props}\n >\n {loading && <Spinner aria-hidden=\"true\" />}\n {!loading && startIcon && (\n <span className={cn('ddga-button__icon', iconFlip && 'ddga-icon-flip')} aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {asChild ? (\n // children IS the consumer's single element (e.g. <Link>). Slottable\n // marks where THAT element's original children should land , without\n // it the icons would replace the link text entirely.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children != null && children !== '' && <span className=\"ddga-button__text\">{children}</span>\n )}\n {!loading && endIcon && (\n <span className={cn('ddga-button__icon', iconFlip && 'ddga-icon-flip')} aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","import { clsx, type ClassValue } from 'clsx';\n\nexport function cn(...inputs: ClassValue[]) {\n return clsx(inputs);\n}\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst spinnerVariants = cva('ddga-spinner', {\n variants: {\n size: {\n sm: 'ddga-spinner--sm',\n md: 'ddga-spinner--md',\n lg: 'ddga-spinner--lg',\n },\n },\n});\n\ntype SpinnerProps = Omit<React.SVGProps<SVGSVGElement>, 'children'> &\n VariantProps<typeof spinnerVariants> & {\n /**\n * Accessible label announced by screen readers. Defaults to \"Loading\".\n * Pass `aria-hidden=\"true\"` (e.g. inside a Button that already has its\n * own label) to suppress.\n */\n 'aria-label'?: string;\n };\n\nfunction Spinner({ size, className, 'aria-label': ariaLabel, ...props }: SpinnerProps) {\n const hidden = props['aria-hidden'] === true || props['aria-hidden'] === 'true';\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={hidden ? undefined : 'status'}\n aria-label={hidden ? undefined : (ariaLabel ?? 'Loading')}\n data-slot=\"spinner\"\n className={cn(spinnerVariants({ size }), className)}\n {...props}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n\nexport { Spinner, spinnerVariants };\nexport type { SpinnerProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the *control* (the bordered box), not the raw <input>. The\n// control owns the border, sizing, focus ring and disabled/error styling\n// so leading/trailing adornments sit inside the field.\nconst inputVariants = cva('ddga-input', {\n variants: {\n size: {\n sm: 'ddga-input--sm',\n md: 'ddga-input--md',\n lg: 'ddga-input--lg',\n },\n error: {\n true: 'ddga-input--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// `Omit<…, 'size'>`: the native HTML `size` attribute (visible character\n// width, a number) collides with our design-system `size` variant. The\n// variant is far more useful; drop the rarely-used native attribute.\ninterface InputProps\n extends Omit<React.ComponentProps<'input'>, 'size'>, VariantProps<typeof inputVariants> {\n /** Visible field label, auto-associated to the input via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n /**\n * Content rendered inside the field, before the input (icon or short text,\n * e.g. a search glyph or `https://`). May be interactive , it is NOT\n * `aria-hidden`. Mark purely-decorative icons `aria-hidden` yourself.\n */\n startAdornment?: ReactNode;\n /**\n * Content rendered inside the field, after the input. Compose a clear\n * button or password-reveal toggle here with `<Button size=\"icon-sm\">`\n * , the 28px in-field icon size that fits the field without overflow.\n */\n endAdornment?: ReactNode;\n}\n\n// ─── 3. Component ─── //\n\nfunction Input({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n startAdornment,\n endAdornment,\n className,\n ...props\n}: InputProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Input',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"input-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-input__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-input__required\">\n *\n </span>\n )}\n </label>\n )}\n <div\n data-slot=\"input-control\"\n className={cn(inputVariants({ size, error: hasError }), className)}\n >\n {startAdornment != null && startAdornment !== '' && (\n <span\n data-slot=\"input-adornment\"\n className=\"ddga-input__adornment ddga-input__adornment--start\"\n >\n {startAdornment}\n </span>\n )}\n <input\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"input\"\n required={required}\n className=\"ddga-input__field\"\n />\n {endAdornment != null && endAdornment !== '' && (\n <span\n data-slot=\"input-adornment\"\n className=\"ddga-input__adornment ddga-input__adornment--end\"\n >\n {endAdornment}\n </span>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Input, inputVariants };\nexport type { InputProps };\n","import { useId, type ReactNode } from 'react';\n\n// Public field-primitive hook. Owns id generation, error/helper precedence,\n// control ARIA wiring, and the dev-time a11y warning so library form\n// controls (Input / Textarea / Checkbox / future Radio / Switch / Select)\n// and consumer-built custom fields share one source of truth.\n\nexport interface UseFieldA11yOptions {\n /** Component name used in the dev warning, e.g. `'Input'`. */\n name: string;\n /** Caller-supplied id; falls back to a stable generated one. */\n id?: string;\n label?: ReactNode;\n error?: boolean;\n errorMessage?: ReactNode;\n helperText?: ReactNode;\n /** From the consumer's props , used to suppress the no-label warning. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\nexport interface FieldA11y {\n fieldId: string;\n helperId: string;\n errorId: string;\n hasError: boolean;\n hasErrorMessage: boolean;\n hasHelper: boolean;\n /** Spread onto the control element (input / textarea / Radix root). */\n controlProps: {\n id: string;\n 'aria-invalid': true | undefined;\n 'aria-describedby': string | undefined;\n };\n}\n\nfunction isPresent(value: ReactNode): boolean {\n return value != null && value !== '';\n}\n\nexport function useFieldA11y(options: UseFieldA11yOptions): FieldA11y {\n // useId() is SSR-safe , stable across server/client, no hydration mismatch.\n const generatedId = useId();\n const fieldId = options.id ?? generatedId;\n const helperId = `${fieldId}-helper`;\n const errorId = `${fieldId}-error`;\n\n // A present errorMessage implies an invalid field. Gating on `error: true`\n // alone made `errorMessage=\"…\"` a silent no-op , a footgun. `error` is\n // still useful for the message-less invalid case (form-level validation\n // marking the field invalid without per-field copy).\n const hasError = !!options.error || isPresent(options.errorMessage);\n const hasErrorMessage = hasError && isPresent(options.errorMessage);\n // An error message replaces helper text (one description at a time).\n const hasHelper = !hasErrorMessage && isPresent(options.helperText);\n\n // Dev-only: warn if the field has no accessible name. This library makes\n // the accessible path the default across every form control.\n if (process.env.NODE_ENV === 'development' && !options.label) {\n if (!options['aria-label'] && !options['aria-labelledby']) {\n console.warn(\n `[@dev-dga/react] ${options.name} requires a \\`label\\`, or an ` +\n 'aria-label / aria-labelledby attribute, for screen reader accessibility.',\n );\n }\n }\n\n return {\n fieldId,\n helperId,\n errorId,\n hasError,\n hasErrorMessage,\n hasHelper,\n controlProps: {\n id: fieldId,\n 'aria-invalid': hasError || undefined,\n 'aria-describedby': hasErrorMessage ? errorId : hasHelper ? helperId : undefined,\n },\n };\n}\n","import type { ReactNode } from 'react';\n\n// Public field-primitive component. The helper / error line below a form\n// control. Identical markup and styling across Input / Textarea / Checkbox,\n// and available to consumers composing custom fields on top of useFieldA11y.\n// No 'use client': pure markup, no hooks or client APIs.\n\nexport interface FieldMessageProps {\n id: string;\n /** `error` announces politely; `helper` is static. */\n variant: 'error' | 'helper';\n children: ReactNode;\n}\n\nexport function FieldMessage({ id, variant, children }: FieldMessageProps) {\n return (\n <p\n id={id}\n data-slot={`field-${variant}`}\n className={`ddga-field__message ddga-field__message--${variant}`}\n // Polite (not assertive): an assertive error interrupts the user\n // mid-interaction, the wrong UX for field-level validation.\n aria-live={variant === 'error' ? 'polite' : undefined}\n >\n {children}\n </p>\n );\n}\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the <textarea> directly: unlike Input there are no adornments,\n// so the field owns its own border / focus ring / state styling , no\n// control wrapper needed.\nconst textareaVariants = cva('ddga-textarea', {\n variants: {\n size: {\n sm: 'ddga-textarea--sm',\n md: 'ddga-textarea--md',\n lg: 'ddga-textarea--lg',\n },\n error: {\n true: 'ddga-textarea--error',\n },\n // Horizontal/both resize breaks form layout (same reason it's not the\n // default) , only vertical or locked are offered.\n resize: {\n vertical: 'ddga-textarea--resize-vertical',\n none: 'ddga-textarea--resize-none',\n },\n },\n defaultVariants: {\n size: 'md',\n resize: 'vertical',\n },\n});\n\n// ─── 2. Types ─── //\n\n// `<textarea>` has no native `size` attribute (unlike `<input>`), so the\n// cva `size` variant doesn't collide , no `Omit` needed.\ninterface TextareaProps\n extends React.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {\n /** Visible field label, auto-associated to the textarea via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Textarea({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n resize,\n required,\n rows = 3,\n className,\n ...props\n}: TextareaProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Textarea',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"textarea-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-textarea__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-textarea__required\">\n *\n </span>\n )}\n </label>\n )}\n <textarea\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"textarea\"\n rows={rows}\n required={required}\n className={cn(textareaVariants({ size, error: hasError, resize }), className)}\n />\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Textarea, textareaVariants };\nexport type { TextareaProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { Checkbox as CheckboxPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, Minus } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Root (the role=checkbox button). Two sizes only ,\n// a \"lg\" checkbox is unusual; keep the surface honest.\nconst checkboxVariants = cva('ddga-checkbox', {\n variants: {\n size: {\n sm: 'ddga-checkbox--sm',\n md: 'ddga-checkbox--md',\n },\n error: {\n true: 'ddga-checkbox--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the state model (checked / defaultChecked / onCheckedChange /\n// indeterminate via checked=\"indeterminate\" / disabled / required / name /\n// value). We add the composed label + helper/error + a11y wiring. `children`\n// is omitted , the indicator is rendered internally.\ninterface CheckboxProps\n extends\n Omit<React.ComponentProps<typeof CheckboxPrimitive.Root>, 'children'>,\n VariantProps<typeof checkboxVariants> {\n /** Visible label, sits beside the box, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the row. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the row when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Checkbox({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n className,\n ...props\n}: CheckboxProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Checkbox',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"checkbox-field\" className=\"ddga-field\">\n <div className=\"ddga-checkbox-row\">\n <CheckboxPrimitive.Root\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"checkbox\"\n required={required}\n className={cn(checkboxVariants({ size, error: hasError }), className)}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"ddga-checkbox__indicator\"\n >\n {/* Both render inside the indicator (which only mounts when\n checked or indeterminate); CSS picks one via Root data-state. */}\n <Check className=\"ddga-checkbox__check\" aria-hidden=\"true\" />\n <Minus className=\"ddga-checkbox__minus\" aria-hidden=\"true\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-checkbox__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-checkbox__required\">\n *\n </span>\n )}\n </label>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Checkbox, checkboxVariants };\nexport type { CheckboxProps };\n","'use client';\n\n/**\n * Internal checkmark icon , used by Checkbox (checked state).\n * Not exported from the public API.\n */\nexport function Check(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\n/**\n * Internal minus/dash icon , used by Checkbox (indeterminate state).\n * Not exported from the public API.\n */\nexport function Minus(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/**\n * Internal info circle icon — used by Alert (info/default variant).\n * Not exported from the public API.\n */\nexport function Info(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n\n/**\n * Internal warning triangle icon — used by Alert (warning variant).\n * Not exported from the public API.\n */\nexport function AlertTriangle(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n\n/**\n * Internal alert circle icon — used by Alert (destructive variant).\n * Not exported from the public API.\n */\nexport function AlertCircle(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n\n/**\n * Internal close (X) icon — used by Alert (dismissible).\n * Not exported from the public API.\n */\nexport function Close(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-down icon , used by Select (trigger affordance).\n * Not exported from the public API.\n */\nexport function ChevronDown(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-right icon — used by Breadcrumb (default separator).\n * Points inline-end-ward; the consumer-facing component flips it via CSS in\n * RTL (`[dir='rtl'] .ddga-breadcrumb__separator { transform: scaleX(-1); }`).\n * Not exported from the public API.\n */\nexport function ChevronRight(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal chevron-left icon — used by DatePicker (previous-month nav).\n * The Calendar's prev/next buttons are positional (react-aria handles the\n * RTL swap via slot), so this points left in both LTR and RTL.\n * Not exported from the public API.\n */\nexport function ChevronLeft(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m15 18-6-6 6-6\" />\n </svg>\n );\n}\n\n/**\n * Internal calendar icon — used by DatePicker (popover trigger).\n * Not exported from the public API.\n */\nexport function CalendarIcon(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\" ry=\"2\" />\n <line x1=\"16\" x2=\"16\" y1=\"2\" y2=\"6\" />\n <line x1=\"8\" x2=\"8\" y1=\"2\" y2=\"6\" />\n <line x1=\"3\" x2=\"21\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}\n\n/**\n * Internal more-horizontal (•••) icon — used by Breadcrumb (ellipsis).\n * Not exported from the public API.\n */\nexport function MoreHorizontal(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <circle cx=\"5\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"19\" cy=\"12\" r=\"1.5\" />\n </svg>\n );\n}\n\n/**\n * Internal plus icon — used by NumberInput (increment stepper).\n * Not exported from the public API.\n */\nexport function Plus(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M12 5v14\" />\n <path d=\"M5 12h14\" />\n </svg>\n );\n}\n\n/**\n * Internal solid star icon — used by Rating (filled + empty stars share the\n * shape; color differs). Not exported from the public API.\n */\nexport function Star(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z\" />\n </svg>\n );\n}\n\n/**\n * Internal upload (cloud-up / tray-with-arrow) icon — used by FileUpload\n * (drop-zone affordance). Not exported from the public API.\n */\nexport function Upload(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <path d=\"M17 8l-5-5-5 5\" />\n <path d=\"M12 3v12\" />\n </svg>\n );\n}\n\n/**\n * Internal inbox/tray icon — used by EmptyState (default variant).\n * Not exported from the public API.\n */\nexport function Inbox(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M22 12h-6l-2 3h-4l-2-3H2\" />\n <path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\" />\n </svg>\n );\n}\n\n/**\n * Internal search/magnifier icon — used by EmptyState (search variant).\n * Not exported from the public API.\n */\nexport function Search(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n );\n}\n\n/**\n * Internal solid up-triangle — used by Stat (upward trend). RTL-neutral\n * (vertical semantics, no horizontal mirroring). Not exported from the public API.\n */\nexport function CaretUp(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 8-6 8h12z\" />\n </svg>\n );\n}\n\n/**\n * Internal solid down-triangle — used by Stat (downward trend). RTL-neutral.\n * Not exported from the public API.\n */\nexport function CaretDown(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"m12 16 6-8H6z\" />\n </svg>\n );\n}\n\n/**\n * Internal home icon — used by Sidebar stories (navigation example).\n * RTL-neutral (a symmetric house glyph). Not exported from the public API.\n */\nexport function Home(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\" />\n <path d=\"M9 22V12h6v10\" />\n </svg>\n );\n}\n\n/**\n * Internal external-link icon (arrow leaving a box) — used by Link (external\n * prop). A symbolic \"leaves the site\" cue: RTL-neutral, NOT mirrored in RTL\n * (mirrors the convention used for Stat's directional carets).\n * Not exported from the public API.\n */\nexport function ExternalLink(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M15 3h6v6\" />\n <path d=\"M10 14 21 3\" />\n <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />\n </svg>\n );\n}\n\n/**\n * Internal opening double-quotation-mark glyph — used by Quote (decorative\n * `quoteMark`). A solid \"66\" pair. Decorative only (always rendered\n * `aria-hidden`); the consumer-facing component flips it in RTL via CSS\n * (`[dir='rtl'] .ddga-quote__mark { transform: scaleX(-1); }`) so the curl\n * faces the text. Not exported from the public API.\n */\nexport function QuoteMark(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"none\"\n {...props}\n >\n <path d=\"M7 7C4.8 7 3 8.8 3 11s1.8 4 4 4c.2 0 .4 0 .6-.1C7.2 16.4 6 17.5 4.2 17.7L4 17.7V20c3.6-.3 6-3.2 6-7v-1.2C10 8.7 8.4 7 7 7zM18 7c-2.2 0-4 1.8-4 4s1.8 4 4 4c.2 0 .4 0 .6-.1-.4 1.5-1.6 2.6-3.4 2.8l-.2 0V20c3.6-.3 6-3.2 6-7v-1.2C21 8.7 19.4 7 18 7z\" />\n </svg>\n );\n}\n\n/**\n * Internal panel-left icon — used by SidebarTrigger (toggle affordance).\n * Depicts a two-panel layout with the left panel highlighted.\n * Not exported from the public API.\n */\nexport function PanelLeft(props: React.SVGProps<SVGSVGElement>) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" />\n <path d=\"M9 3v18\" />\n </svg>\n );\n}\n","'use client';\n\nimport { useId, type ReactNode } from 'react';\nimport { RadioGroup as RadioGroupPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix RadioGroup.Root (role=radiogroup). Owns size,\n// orientation, and the error class , child <Radio>s pick up size + error\n// via CSS cascade from `.ddga-radio-group--sm` / `.ddga-radio-group--error`\n// (one source of truth on the group, not threaded through items).\nconst radioGroupVariants = cva('ddga-radio-group', {\n variants: {\n size: {\n sm: 'ddga-radio-group--sm',\n md: 'ddga-radio-group--md',\n },\n orientation: {\n vertical: 'ddga-radio-group--vertical',\n horizontal: 'ddga-radio-group--horizontal',\n },\n error: {\n true: 'ddga-radio-group--error',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'vertical',\n },\n});\n\n// Applied to the Radix RadioGroup.Item (role=radio). No variants here ,\n// size / error cascade from the group; per-item disabled is native.\nconst radioVariants = cva('ddga-radio');\n\n// ─── 2. Types ─── //\n\n// Group: omit Radix's `orientation` so we can re-narrow it to our two\n// supported values (Radix accepts a wider set we don't need exposed).\ninterface RadioGroupProps\n extends\n Omit<React.ComponentProps<typeof RadioGroupPrimitive.Root>, 'children' | 'orientation'>,\n Pick<VariantProps<typeof radioGroupVariants>, 'size' | 'orientation'> {\n /** Group label, sits above the rows. Associated to the group via aria-labelledby. */\n label?: ReactNode;\n /** Hint shown below the group. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the group when `error` is true (or when only `errorMessage` is set). */\n errorMessage?: ReactNode;\n /** Marks the group invalid: sets aria-invalid and applies error styling. */\n error?: boolean;\n /** `<Radio>` children. */\n children: ReactNode;\n}\n\n// Item: omit children (the indicator is internal).\ninterface RadioProps extends Omit<\n React.ComponentProps<typeof RadioGroupPrimitive.Item>,\n 'children'\n> {\n /** Visible label for this radio, sits beside the circle, associated via htmlFor/id. */\n label?: ReactNode;\n}\n\n// ─── 3. Components ─── //\n\nfunction RadioGroup({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n orientation,\n required,\n className,\n children,\n ...props\n}: RadioGroupProps) {\n const { errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps, fieldId } =\n useFieldA11y({\n name: 'RadioGroup',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n // The group itself isn't a focusable form control , consumers don't need\n // `id` on the role=radiogroup, and `htmlFor`/`<label>` doesn't apply.\n // Associate the visible label via aria-labelledby instead.\n const labelId = `${fieldId}-label`;\n\n return (\n <div data-slot=\"radio-group-field\" className=\"ddga-field\">\n {label && (\n <span id={labelId} className=\"ddga-radio-group__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-radio-group__required\">\n *\n </span>\n )}\n </span>\n )}\n <RadioGroupPrimitive.Root\n {...props}\n aria-invalid={controlProps['aria-invalid']}\n aria-describedby={controlProps['aria-describedby']}\n aria-labelledby={label ? labelId : props['aria-labelledby']}\n orientation={orientation === 'horizontal' ? 'horizontal' : 'vertical'}\n required={required}\n data-slot=\"radio-group\"\n className={cn(radioGroupVariants({ size, orientation, error: hasError }), className)}\n >\n {children}\n </RadioGroupPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\nfunction Radio({ id: externalId, label, className, ...props }: RadioProps) {\n // useId() is SSR-safe; pair the Item id with its <label htmlFor>.\n const generatedId = useId();\n const itemId = externalId ?? generatedId;\n return (\n <div className=\"ddga-radio-row\">\n <RadioGroupPrimitive.Item\n // Spread props first, then our id last so a consumer can't clobber\n // the label/control association by accident.\n {...props}\n id={itemId}\n data-slot=\"radio\"\n className={cn(radioVariants(), className)}\n >\n <RadioGroupPrimitive.Indicator\n data-slot=\"radio-indicator\"\n className=\"ddga-radio__indicator\"\n >\n <span className=\"ddga-radio__dot\" aria-hidden=\"true\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n {label && (\n <label htmlFor={itemId} className=\"ddga-radio__label\">\n {label}\n </label>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { RadioGroup, Radio, radioGroupVariants, radioVariants };\nexport type { RadioGroupProps, RadioProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { Switch as SwitchPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Switch.Root (role=switch). Two sizes only , a \"lg\"\n// switch is unusual; keep the surface honest. Matches Checkbox / Radio.\nconst switchVariants = cva('ddga-switch', {\n variants: {\n size: {\n sm: 'ddga-switch--sm',\n md: 'ddga-switch--md',\n },\n error: {\n true: 'ddga-switch--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the state model (checked / defaultChecked / onCheckedChange /\n// disabled / required / name / value). We add the composed label +\n// helper/error + a11y wiring. `children` is omitted , the thumb is rendered\n// internally.\ninterface SwitchProps\n extends\n Omit<React.ComponentProps<typeof SwitchPrimitive.Root>, 'children'>,\n VariantProps<typeof switchVariants> {\n /** Visible label, sits beside the track, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the row. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the row when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Switch({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n className,\n ...props\n}: SwitchProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Switch',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n return (\n <div data-slot=\"switch-field\" className=\"ddga-field\">\n <div className=\"ddga-switch-row\">\n <SwitchPrimitive.Root\n // Spread props first, then the a11y contract (controlProps) so a\n // consumer cannot accidentally clobber the wiring.\n {...props}\n {...controlProps}\n data-slot=\"switch\"\n required={required}\n className={cn(switchVariants({ size, error: hasError }), className)}\n >\n <SwitchPrimitive.Thumb data-slot=\"switch-thumb\" className=\"ddga-switch__thumb\" />\n </SwitchPrimitive.Root>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-switch__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-switch__required\">\n *\n </span>\n )}\n </label>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Switch, switchVariants };\nexport type { SwitchProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronDown } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the Radix Select.Trigger (the focusable button). Heights match\n// Input (32/36) so triggers and text inputs line up in a form row.\nconst selectTriggerVariants = cva('ddga-select-trigger', {\n variants: {\n size: {\n sm: 'ddga-select-trigger--sm',\n md: 'ddga-select-trigger--md',\n },\n error: {\n true: 'ddga-select-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// We expose a closed shape (Trigger + Portal + Content + Viewport are\n// rendered internally) , consumers compose with `<SelectItem>` children.\n// Power-user use cases (custom trigger, grouped options, separators) get\n// added when there's a real need; YAGNI for v1.\n//\n// Radix owns the state model (`value` / `defaultValue` / `onValueChange` /\n// `open` / `onOpenChange` / `name` / `disabled` / `required` / `form`)\n// via SelectPrimitive.Root. `dir` is intentionally omitted , the wrapping\n// `Direction.Provider` in <DgaProvider> propagates direction to the portal.\ninterface SelectProps\n extends\n Omit<React.ComponentProps<typeof SelectPrimitive.Root>, 'children' | 'dir'>,\n VariantProps<typeof selectTriggerVariants> {\n /** Visible label above the trigger, associated via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the trigger. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n /** Placeholder shown in the trigger when no value is selected. */\n placeholder?: ReactNode;\n /** `<SelectItem>` children, rendered inside the dropdown panel. */\n children: ReactNode;\n /** Caller-supplied id for the trigger; falls back to a generated one. */\n id?: string;\n /** Forwarded to the trigger (the focusable control). */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\ninterface SelectItemProps extends React.ComponentProps<typeof SelectPrimitive.Item> {\n /** The visible label for this item. */\n children: ReactNode;\n}\n\n// ─── 3. Components ─── //\n\nfunction Select({\n id: externalId,\n label,\n helperText,\n errorMessage,\n error,\n size,\n required,\n placeholder,\n className,\n children,\n ...rootProps\n}: SelectProps) {\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Select',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': rootProps['aria-label'],\n 'aria-labelledby': rootProps['aria-labelledby'],\n });\n\n // Portal escape hatch: Radix mounts Select.Content under <body> by default,\n // which lives ABOVE DgaProvider's root in the DOM tree , so `data-theme`,\n // custom theme vars, and `.ddga-theme-*` classes set on that root never\n // reach the dropdown. Re-anchor the portal inside the root so CSS variable\n // inheritance just works (dark mode, theming, consumer overrides).\n // Falls back to <body> when used standalone (no provider).\n const ctx = useContext(DgaContext);\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <div data-slot=\"select-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-select__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-select__required\">\n *\n </span>\n )}\n </label>\n )}\n <SelectPrimitive.Root required={required} {...rootProps}>\n <SelectPrimitive.Trigger\n // Spread Trigger-only ARIA after the field a11y contract so the\n // describedby/invalid wiring isn't clobbered.\n {...controlProps}\n data-slot=\"select-trigger\"\n className={cn(selectTriggerVariants({ size, error: hasError }), className)}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild className=\"ddga-select__icon\">\n <ChevronDown aria-hidden=\"true\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n <SelectPrimitive.Portal container={portalContainer}>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className=\"ddga-select-content\"\n // popper positioning keeps the panel next to the trigger and\n // exposes --radix-select-trigger-width for size matching in CSS.\n position=\"popper\"\n sideOffset={4}\n >\n <SelectPrimitive.Viewport className=\"ddga-select-viewport\">\n {children}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n {...props}\n data-slot=\"select-item\"\n className={cn('ddga-select-item', className)}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator className=\"ddga-select-item__indicator\">\n <Check className=\"ddga-select-item__check\" aria-hidden=\"true\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Select, SelectItem, selectTriggerVariants };\nexport type { SelectProps, SelectItemProps };\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\nexport interface DgaContextValue {\n dir: 'ltr' | 'rtl';\n locale: string;\n mode: 'light' | 'dark';\n /**\n * The DgaProvider's rendered root element. Exposed for non-portaled\n * descendants that need to read theme attributes (e.g., layout decorators).\n *\n * **For overlay portals, prefer `portalEl`** — `rootEl` lives inside the\n * consumer's normal DOM tree and inherits any `overflow: hidden` /\n * `transform` ancestors. Inside Storybook's autodocs preview block (or any\n * scoped wrapper a consumer might wrap us in), portaling into `rootEl`\n * makes the overlay get clipped by the wrapper and breaks `position: fixed`\n * positioning (a `transform` ancestor establishes a new containing block).\n *\n * State (not ref) so subscribers re-render when the element mounts; a\n * useRef update wouldn't fire a render and `defaultOpen` portals would\n * race to the wrong target on first commit.\n */\n rootEl: HTMLElement | null;\n /**\n * Body-mounted portal container that mirrors this provider's theme\n * attributes (`data-theme`, `dir`) and CSS custom properties. Overlay\n * components (Modal / Drawer / DropdownMenu / Combobox / Select / Tooltip\n * / DatePicker) should portal into this so:\n *\n * 1. They escape any clipping (`overflow: hidden`) or transform ancestor\n * the consumer wraps the provider in.\n * 2. `position: fixed` semantics survive (no `transform` ancestor breaks\n * the viewport containing block).\n * 3. Theme inheritance still works — the container carries `data-theme`,\n * `dir`, and the same CSS variables as the provider's root, so\n * `var(--ddga-color-*)` lookups inside the portal resolve correctly.\n *\n * `null` until the DOM mount effect runs (e.g., during SSR or the very\n * first commit on the client). Components should fall back to `rootEl`\n * (and finally `document.body`) when this is null.\n */\n portalEl: HTMLElement | null;\n}\n\nexport const DgaContext = createContext<DgaContextValue | null>(null);\n\nexport function useDga(): DgaContextValue {\n const ctx = useContext(DgaContext);\n if (!ctx) {\n throw new Error('useDga must be used within a <DgaProvider>');\n }\n return ctx;\n}\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst cardVariants = cva('ddga-card', {\n variants: {\n variant: {\n default: 'ddga-card--default',\n outline: 'ddga-card--outline',\n elevated: 'ddga-card--elevated',\n filled: 'ddga-card--filled',\n gradient: 'ddga-card--gradient',\n ghost: 'ddga-card--ghost',\n },\n padding: {\n sm: 'ddga-card--padding-sm',\n md: 'ddga-card--padding-md',\n lg: 'ddga-card--padding-lg',\n },\n orientation: {\n vertical: 'ddga-card--vertical',\n horizontal: 'ddga-card--horizontal',\n },\n interactive: {\n true: 'ddga-card--interactive',\n },\n },\n defaultVariants: {\n variant: 'default',\n padding: 'md',\n orientation: 'vertical',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface CardProps extends React.ComponentProps<'div'>, VariantProps<typeof cardVariants> {\n /** Render as the single child element instead of a `<div>` (see Button). */\n asChild?: boolean;\n}\n\ntype CardSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface CardTitleProps extends React.ComponentProps<'h3'> {\n /** Override the heading element (e.g. render an `<h2>` or `<a>`). */\n asChild?: boolean;\n}\n\ntype CardDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\n\ninterface CardImageProps extends React.ComponentProps<'img'> {\n /**\n * Aspect ratio of the image in vertical orientation (e.g. `'16/9'`, `'4/3'`,\n * `'1/1'`). Default `'16/9'`. Ignored in horizontal orientation — the image\n * fills the card's full height there.\n */\n aspectRatio?: string;\n}\n\n// ─── 3. Components ─── //\n\nfunction Card({\n variant,\n padding,\n orientation,\n interactive,\n asChild,\n className,\n ...props\n}: CardProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"card\"\n data-orientation={orientation ?? 'vertical'}\n className={cn(cardVariants({ variant, padding, orientation, interactive }), className)}\n {...props}\n />\n );\n}\n\nfunction CardImage({ aspectRatio = '16/9', className, style, ...props }: CardImageProps) {\n return (\n <img\n data-slot=\"card-image\"\n className={cn('ddga-card__image', className)}\n style={\n {\n '--ddga-card-image-aspect': aspectRatio,\n ...style,\n } as React.CSSProperties\n }\n {...props}\n />\n );\n}\n\nfunction CardHeader({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"card-header\" className={cn('ddga-card__header', className)} {...props} />;\n}\n\nfunction CardTitle({ asChild, className, ...props }: CardTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h3';\n return <Comp data-slot=\"card-title\" className={cn('ddga-card__title', className)} {...props} />;\n}\n\nfunction CardDescription({ asChild, className, ...props }: CardDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"card-description\"\n className={cn('ddga-card__description', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"card-content\" className={cn('ddga-card__content', className)} {...props} />\n );\n}\n\nfunction CardFooter({ asChild, className, ...props }: CardSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"card-footer\" className={cn('ddga-card__footer', className)} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Card,\n CardImage,\n CardHeader,\n CardTitle,\n CardDescription,\n CardContent,\n CardFooter,\n cardVariants,\n};\nexport type { CardProps, CardImageProps, CardSectionProps, CardTitleProps, CardDescriptionProps };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\n// Two visual families:\n// - solid: filled background, white-on-color (high contrast, draws the eye)\n// - subtle: tinted background (color-100) + dark-color text (color-700/800)\n// - outline: bordered, transparent\n// Subtle is the right default for table cells / dense UI where solid would be\n// visually loud. Solid is the right default for hero badges / single status pills.\nconst badgeVariants = cva('ddga-badge', {\n variants: {\n variant: {\n // Solid family\n default: 'ddga-badge--default',\n primary: 'ddga-badge--primary',\n secondary: 'ddga-badge--secondary',\n destructive: 'ddga-badge--destructive',\n success: 'ddga-badge--success',\n warning: 'ddga-badge--warning',\n info: 'ddga-badge--info',\n // Subtle family (tonal)\n 'primary-subtle': 'ddga-badge--primary-subtle',\n 'secondary-subtle': 'ddga-badge--secondary-subtle',\n 'destructive-subtle': 'ddga-badge--destructive-subtle',\n 'success-subtle': 'ddga-badge--success-subtle',\n 'warning-subtle': 'ddga-badge--warning-subtle',\n 'info-subtle': 'ddga-badge--info-subtle',\n // Outline\n outline: 'ddga-badge--outline',\n },\n size: {\n sm: 'ddga-badge--sm',\n md: 'ddga-badge--md',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface BadgeProps extends React.ComponentProps<'span'>, VariantProps<typeof badgeVariants> {\n /** Render as the single child element instead of a `<span>` (see Button). */\n asChild?: boolean;\n /**\n * Render a leading status dot. The dot inherits its color from `currentColor`\n * so it tracks the badge's tone (subtle variants get a dark dot, solid get a\n * white dot). Pair with `*-subtle` variants for the classic status pill.\n * Coexists with `startIcon` — the dot lands first.\n */\n dot?: boolean;\n /** Icon rendered before the badge text. Sized to the badge font (0.875em). */\n startIcon?: ReactNode;\n /** Icon rendered after the badge text. Sized to the badge font (0.875em). */\n endIcon?: ReactNode;\n /**\n * Render a trailing close button — turns the badge into the DGA \"tag/chip\"\n * pattern. Uncontrolled by default: the badge hides itself when the close\n * button is clicked. Pass `open` to control visibility yourself.\n *\n * Not combinable with `asChild` — the consumer's slotted element (usually an\n * `<a>`) would end up with an interactive `<button>` inside it, which is\n * invalid HTML. In that combo the close button is suppressed and a dev\n * warning is logged.\n */\n dismissible?: boolean;\n /** Controlled visibility. When provided, `onDismiss` becomes the only signal. */\n open?: boolean;\n /** Fires when the close button is clicked, in both controlled and uncontrolled mode. */\n onDismiss?: () => void;\n /** Accessible label on the close button. Defaults to `\"Dismiss\"`. Override for i18n. */\n closeLabel?: string;\n}\n\n// ─── 3. Component ─── //\n\nfunction Badge({\n variant,\n size,\n asChild,\n dot,\n startIcon,\n endIcon,\n dismissible,\n open,\n onDismiss,\n closeLabel = 'Dismiss',\n className,\n children,\n ...props\n}: BadgeProps) {\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(true);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n if (process.env.NODE_ENV !== 'production' && asChild && dismissible) {\n console.warn(\n \"[Badge] `dismissible` is not supported with `asChild` because it would nest an interactive close button inside the consumer's element (invalid HTML). The close button will not render.\",\n );\n }\n\n if (!isOpen) return null;\n\n const Comp = asChild ? SlotPrimitive.Slot : 'span';\n const showClose = dismissible && !asChild;\n\n const handleDismiss = () => {\n if (!isControlled) setUncontrolledOpen(false);\n onDismiss?.();\n };\n\n return (\n <Comp data-slot=\"badge\" className={cn(badgeVariants({ variant, size }), className)} {...props}>\n {dot ? <span className=\"ddga-badge__dot\" aria-hidden=\"true\" /> : null}\n {startIcon ? (\n <span className=\"ddga-badge__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n {asChild ? (\n // children IS the consumer's single element (e.g. <a>). Slottable marks\n // where THAT element's original children should land — without it the\n // dot/icons would replace the link text.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n children\n )}\n {endIcon ? (\n <span className=\"ddga-badge__icon\" aria-hidden=\"true\">\n {endIcon}\n </span>\n ) : null}\n {showClose ? (\n <button\n type=\"button\"\n className=\"ddga-badge__close\"\n aria-label={closeLabel}\n onClick={handleDismiss}\n data-slot=\"badge-close\"\n >\n <Close aria-hidden=\"true\" />\n </button>\n ) : null}\n </Comp>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Badge, badgeVariants };\nexport type { BadgeProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst dividerVariants = cva('ddga-divider', {\n variants: {\n orientation: {\n horizontal: 'ddga-divider--horizontal',\n vertical: 'ddga-divider--vertical',\n },\n variant: {\n solid: 'ddga-divider--solid',\n dashed: 'ddga-divider--dashed',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n variant: 'solid',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface DividerProps\n extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof dividerVariants> {\n /**\n * Optional label rendered inside a horizontal divider. Ignored when\n * `orientation=\"vertical\"`. When set, the divider renders as a three-part\n * flex (line — label — line) instead of a single bar.\n */\n children?: React.ReactNode;\n /**\n * Where to place the label along the divider. Defaults to `center`. Ignored\n * when no label is provided. `start` and `end` are logical (LTR/RTL aware).\n */\n labelPosition?: 'start' | 'center' | 'end';\n /**\n * If `true`, the divider is treated as purely decorative and removed from\n * the accessibility tree (`role=\"none\"`). Defaults to `false`.\n */\n decorative?: boolean;\n}\n\n// ─── 3. Component ─── //\n//\n// Note: no `asChild`. A separator is either a plain bar (no children, nothing\n// to slot into) or a labeled bar (the label is its own slotted child, not the\n// root). The `asChild` escape hatch doesn't carry meaning for either shape.\n\nfunction Divider({\n orientation = 'horizontal',\n variant = 'solid',\n labelPosition = 'center',\n decorative = false,\n className,\n children,\n ...props\n}: DividerProps) {\n const isLabeled =\n orientation === 'horizontal' && children !== undefined && children !== null && children !== '';\n\n // WAI-ARIA: `separator` default orientation is horizontal, so only emit\n // `aria-orientation` when vertical. Decorative dividers drop role + aria entirely.\n const a11yProps = decorative\n ? { role: 'none' as const }\n : {\n role: 'separator' as const,\n ...(orientation === 'vertical' ? { 'aria-orientation': 'vertical' as const } : {}),\n };\n\n return (\n <div\n data-slot=\"divider\"\n data-orientation={orientation}\n className={cn(\n dividerVariants({ orientation, variant }),\n isLabeled && 'ddga-divider--labeled',\n isLabeled && `ddga-divider--label-${labelPosition}`,\n className,\n )}\n {...a11yProps}\n {...props}\n >\n {isLabeled ? <span className=\"ddga-divider__label\">{children}</span> : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Divider, dividerVariants };\nexport type { DividerProps };\n","'use client';\n\nimport { Children, isValidElement, cloneElement, type ReactElement } from 'react';\nimport { Avatar as AvatarPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst avatarVariants = cva('ddga-avatar', {\n variants: {\n size: {\n xs: 'ddga-avatar--xs',\n sm: 'ddga-avatar--sm',\n md: 'ddga-avatar--md',\n lg: 'ddga-avatar--lg',\n xl: 'ddga-avatar--xl',\n },\n shape: {\n circle: 'ddga-avatar--circle',\n square: 'ddga-avatar--square',\n },\n },\n defaultVariants: {\n size: 'md',\n shape: 'circle',\n },\n});\n\nconst fallbackVariants = cva('ddga-avatar__fallback', {\n variants: {\n colorScheme: {\n default: 'ddga-avatar__fallback--default',\n primary: 'ddga-avatar__fallback--primary',\n secondary: 'ddga-avatar__fallback--secondary',\n success: 'ddga-avatar__fallback--success',\n warning: 'ddga-avatar__fallback--warning',\n destructive: 'ddga-avatar__fallback--destructive',\n info: 'ddga-avatar__fallback--info',\n },\n },\n defaultVariants: {\n colorScheme: 'default',\n },\n});\n\ntype AvatarStatus = 'online' | 'offline' | 'busy' | 'away';\n\n// ─── 2. Types ─── //\n\ninterface AvatarProps\n extends React.ComponentProps<typeof AvatarPrimitive.Root>, VariantProps<typeof avatarVariants> {\n /**\n * Presence indicator rendered in the bottom-{end} corner. The color tracks\n * the status (online → success, busy → destructive, away → warning,\n * offline → muted). Position flips in RTL automatically via logical props.\n */\n status?: AvatarStatus;\n /**\n * Accessible label for the status indicator. Defaults to the status value\n * (e.g. \"online\"). Pass a localized string for non-English UIs.\n */\n statusLabel?: string;\n}\n\ntype AvatarImageProps = React.ComponentProps<typeof AvatarPrimitive.Image>;\n\ninterface AvatarFallbackProps\n extends\n React.ComponentProps<typeof AvatarPrimitive.Fallback>,\n VariantProps<typeof fallbackVariants> {}\n\ninterface AvatarGroupProps extends React.ComponentProps<'div'> {\n /**\n * Cap the number of visible Avatars. Excess children are collapsed into a\n * trailing \"+N\" chip. When unset, every child is rendered.\n */\n max?: number;\n /** Size cascaded to each child Avatar that doesn't already set its own size. */\n size?: VariantProps<typeof avatarVariants>['size'];\n /** Shape cascaded to each child Avatar that doesn't already set its own shape. */\n shape?: VariantProps<typeof avatarVariants>['shape'];\n}\n\n// ─── 3. Components ─── //\n\nfunction Avatar({ size, shape, status, statusLabel, className, children, ...props }: AvatarProps) {\n return (\n <AvatarPrimitive.Root\n data-slot=\"avatar\"\n data-status={status}\n className={cn(avatarVariants({ size, shape }), className)}\n {...props}\n >\n {children}\n {status ? (\n <span\n className={cn('ddga-avatar__status', `ddga-avatar__status--${status}`)}\n role=\"status\"\n aria-label={statusLabel ?? status}\n />\n ) : null}\n </AvatarPrimitive.Root>\n );\n}\n\nfunction AvatarImage({ className, ...props }: AvatarImageProps) {\n return (\n <AvatarPrimitive.Image\n data-slot=\"avatar-image\"\n className={cn('ddga-avatar__image', className)}\n {...props}\n />\n );\n}\n\nfunction AvatarFallback({ colorScheme, className, ...props }: AvatarFallbackProps) {\n return (\n <AvatarPrimitive.Fallback\n data-slot=\"avatar-fallback\"\n data-color-scheme={colorScheme ?? 'default'}\n className={cn(fallbackVariants({ colorScheme }), className)}\n {...props}\n />\n );\n}\n\nfunction AvatarGroup({ max, size, shape, className, children, ...props }: AvatarGroupProps) {\n const all = Children.toArray(children).filter(isValidElement) as ReactElement<AvatarProps>[];\n const visible = max !== undefined && all.length > max ? all.slice(0, max) : all;\n const overflow = max !== undefined ? Math.max(0, all.length - max) : 0;\n\n // Cascade size/shape onto children that haven't set their own (parity with\n // RadioGroup → Radio). Don't clobber explicit child overrides.\n const cascaded = visible.map((child, i) =>\n cloneElement(child, {\n key: child.key ?? i,\n size: child.props.size ?? size,\n shape: child.props.shape ?? shape,\n }),\n );\n\n return (\n <div data-slot=\"avatar-group\" className={cn('ddga-avatar-group', className)} {...props}>\n {cascaded}\n {overflow > 0 ? (\n <Avatar size={size} shape={shape} aria-label={`${overflow} more`}>\n <AvatarFallback>+{overflow}</AvatarFallback>\n </Avatar>\n ) : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Avatar, AvatarImage, AvatarFallback, AvatarGroup, avatarVariants, fallbackVariants };\nexport type { AvatarProps, AvatarImageProps, AvatarFallbackProps, AvatarGroupProps, AvatarStatus };\n","'use client';\n\nimport { useContext } from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\nconst tooltipContentVariants = cva('ddga-tooltip', {\n variants: {\n size: {\n sm: 'ddga-tooltip--sm',\n md: 'ddga-tooltip--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// We expose a closed compound shape that hides Radix's Provider/Portal/Arrow\n// details. `TooltipProvider` is already nested in `DgaProvider`, so consumers\n// don't need to add their own. The Portal container is wired from\n// `DgaContext.rootEl` (see DgaContext.ts) so the tooltip inherits `data-theme`\n// + custom theme classes set on the provider — without it, the tooltip would\n// silently mount under <body> and miss dark mode.\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root>;\n\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;\n\ninterface TooltipContentProps\n extends\n Omit<React.ComponentProps<typeof TooltipPrimitive.Content>, 'asChild'>,\n VariantProps<typeof tooltipContentVariants> {\n /** Show a small arrow pointing at the trigger. Defaults to true. */\n arrow?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Tooltip(props: TooltipProps) {\n return <TooltipPrimitive.Root {...props} />;\n}\n\nfunction TooltipTrigger({ className, ...props }: TooltipTriggerProps) {\n // Radix Trigger already supports asChild natively — pass through.\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" className={className} {...props} />;\n}\n\nfunction TooltipContent({\n size,\n arrow = true,\n sideOffset = 6,\n className,\n children,\n ...props\n}: TooltipContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container.\n // Theme + dark mode inherit through mirrored data-theme/dir/CSS vars on\n // the portal element; using it (rather than the in-tree `rootEl`) keeps\n // the tooltip from being clipped by ancestor overflow or trapped by an\n // ancestor `transform`. Falls back to <body> if used outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(tooltipContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {arrow ? <TooltipPrimitive.Arrow className=\"ddga-tooltip__arrow\" /> : null}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Tooltip, TooltipTrigger, TooltipContent, tooltipContentVariants };\nexport type { TooltipProps, TooltipTriggerProps, TooltipContentProps };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Info, Check, AlertTriangle, AlertCircle, Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst alertVariants = cva('ddga-alert', {\n variants: {\n variant: {\n info: 'ddga-alert--info',\n success: 'ddga-alert--success',\n warning: 'ddga-alert--warning',\n destructive: 'ddga-alert--destructive',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n});\n\nconst DEFAULT_ICONS: Record<\n NonNullable<VariantProps<typeof alertVariants>['variant']>,\n ReactNode\n> = {\n info: <Info aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n warning: <AlertTriangle aria-hidden=\"true\" />,\n destructive: <AlertCircle aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ninterface AlertProps\n extends Omit<React.ComponentProps<'div'>, 'role'>, VariantProps<typeof alertVariants> {\n /** Render as the single child element instead of a `<div>`. */\n asChild?: boolean;\n /**\n * Custom leading icon. Pass `false` to hide the icon entirely. Defaults to\n * a variant-appropriate icon (Info / Check / AlertTriangle / AlertCircle).\n */\n icon?: ReactNode | false;\n /**\n * Show a trailing close button. The alert manages its own visibility — pass\n * `onDismiss` to be notified, or set `open` to control visibility yourself.\n */\n dismissible?: boolean;\n /** Controlled visibility. Pair with `onDismiss` to react. */\n open?: boolean;\n /** Fires when the user clicks the close button. */\n onDismiss?: () => void;\n /**\n * Wire the alert into the a11y tree as a live region. `polite` announces on\n * the next graceful opportunity (use for success/info banners). `assertive`\n * interrupts the user (reserve for destructive/error states that block the\n * task). Omit for static / decorative banners.\n */\n live?: 'polite' | 'assertive';\n /** Localized label for the close button. Defaults to `\"Dismiss\"`. */\n closeLabel?: string;\n}\n\ntype AlertSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface AlertTitleProps extends React.ComponentProps<'h5'> {\n /** Override the heading element (e.g. render an `<h3>`). */\n asChild?: boolean;\n}\n\ntype AlertDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\n\n// ─── 3. Components ─── //\n\nfunction Alert({\n variant,\n asChild,\n icon,\n dismissible,\n open: controlledOpen,\n onDismiss,\n live,\n closeLabel = 'Dismiss',\n className,\n children,\n ...props\n}: AlertProps) {\n const [internalOpen, setInternalOpen] = useState(true);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n if (!open) return null;\n\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n\n const resolvedIcon =\n icon === false ? null : icon !== undefined ? icon : DEFAULT_ICONS[variant ?? 'info'];\n\n // Live-region semantics. `role=\"alert\"` is implicit when aria-live=assertive,\n // but Radix-style explicitness reads better in tests + DOM inspection.\n const liveProps =\n live === 'assertive'\n ? { role: 'alert' as const, 'aria-live': 'assertive' as const }\n : live === 'polite'\n ? { role: 'status' as const, 'aria-live': 'polite' as const }\n : {};\n\n function handleDismiss() {\n if (!isControlled) setInternalOpen(false);\n onDismiss?.();\n }\n\n return (\n <Comp\n data-slot=\"alert\"\n data-variant={variant ?? 'info'}\n className={cn(alertVariants({ variant }), className)}\n {...liveProps}\n {...props}\n >\n {resolvedIcon ? <span className=\"ddga-alert__icon\">{resolvedIcon}</span> : null}\n {asChild ? (\n // Slot mode: the consumer's element receives the children body.\n // Title/description are nested by the consumer.\n <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable>\n ) : (\n <div className=\"ddga-alert__body\">{children}</div>\n )}\n {dismissible ? (\n <button\n type=\"button\"\n className=\"ddga-alert__close\"\n aria-label={closeLabel}\n onClick={handleDismiss}\n >\n <Close aria-hidden=\"true\" />\n </button>\n ) : null}\n </Comp>\n );\n}\n\nfunction AlertTitle({ asChild, className, ...props }: AlertTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h5';\n return <Comp data-slot=\"alert-title\" className={cn('ddga-alert__title', className)} {...props} />;\n}\n\nfunction AlertDescription({ asChild, className, ...props }: AlertDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"alert-description\"\n className={cn('ddga-alert__description', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Alert, AlertTitle, AlertDescription, alertVariants };\nexport type { AlertProps, AlertTitleProps, AlertDescriptionProps, AlertSectionProps };\n","'use client';\n\nimport { useContext } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst modalContentVariants = cva('ddga-modal', {\n variants: {\n size: {\n sm: 'ddga-modal--sm',\n md: 'ddga-modal--md',\n lg: 'ddga-modal--lg',\n xl: 'ddga-modal--xl',\n full: 'ddga-modal--full',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Closed compound shape that hides Radix's Portal/Overlay plumbing. The Portal\n// is anchored to `DgaContext.rootEl` so `data-theme` + custom theme classes\n// set on the provider inherit into the modal — without it, the modal would\n// silently mount under <body> and miss dark mode / palette switches.\n\ntype ModalProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype ModalTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype ModalCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface ModalContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof modalContentVariants> {\n /**\n * Render a corner X close button. Defaults to `true`. Set `false` for\n * action-forcing dialogs (e.g. \"Are you sure?\") where the user must pick\n * one of the explicit footer buttons.\n */\n showCloseButton?: boolean;\n /** Localized label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ntype ModalSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface ModalTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n /** Override the heading element (e.g. render an `<h3>` instead of the default `<h2>`). */\n asChild?: boolean;\n}\n\ninterface ModalDescriptionProps extends React.ComponentProps<typeof DialogPrimitive.Description> {\n /** Override the element (e.g. render a `<div>` for richer markup). */\n asChild?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Modal(props: ModalProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction ModalTrigger({ className, ...props }: ModalTriggerProps) {\n // Radix Trigger supports asChild natively — pass through.\n return <DialogPrimitive.Trigger data-slot=\"modal-trigger\" className={className} {...props} />;\n}\n\nfunction ModalContent({\n size,\n showCloseButton = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: ModalContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container.\n // Pattern documented in DgaContext.ts; regression test in Modal.test.tsx\n // mirrors Select/Tooltip. The portal container mirrors data-theme + dir +\n // CSS vars from the provider so theming still flows; using it (rather\n // than the in-tree `rootEl`) keeps the modal's `position: fixed` overlay\n // from being trapped by an ancestor `transform` or `overflow: hidden`\n // (Storybook autodocs is the motivating case).\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay className=\"ddga-modal__overlay\" data-slot=\"modal-overlay\" />\n <DialogPrimitive.Content\n data-slot=\"modal-content\"\n className={cn(modalContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {showCloseButton ? (\n <DialogPrimitive.Close\n className=\"ddga-modal__close\"\n aria-label={closeLabel}\n data-slot=\"modal-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction ModalHeader({ asChild, className, ...props }: ModalSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"modal-header\" className={cn('ddga-modal__header', className)} {...props} />\n );\n}\n\nfunction ModalTitle({ asChild, className, ...props }: ModalTitleProps) {\n // Dialog.Title wires aria-labelledby on the parent Content. We pass asChild\n // through so consumers can swap heading level (h2 → h1/h3) without losing\n // the labelling link.\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"modal-title\"\n className={cn('ddga-modal__title', className)}\n {...props}\n />\n );\n}\n\nfunction ModalDescription({ asChild, className, ...props }: ModalDescriptionProps) {\n // Dialog.Description wires aria-describedby on the parent Content. asChild\n // lets consumers swap the element if they need richer markup.\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"modal-description\"\n className={cn('ddga-modal__description', className)}\n {...props}\n />\n );\n}\n\nfunction ModalFooter({ asChild, className, ...props }: ModalSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"modal-footer\" className={cn('ddga-modal__footer', className)} {...props} />\n );\n}\n\nfunction ModalClose({ className, ...props }: ModalCloseProps) {\n // Consumer-level close trigger for footer buttons etc. Radix Close supports\n // asChild natively — pass through so consumers can wrap a <Button>.\n return <DialogPrimitive.Close data-slot=\"modal-close\" className={className} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Modal,\n ModalTrigger,\n ModalContent,\n ModalHeader,\n ModalTitle,\n ModalDescription,\n ModalFooter,\n ModalClose,\n modalContentVariants,\n};\nexport type {\n ModalProps,\n ModalTriggerProps,\n ModalContentProps,\n ModalSectionProps,\n ModalTitleProps,\n ModalDescriptionProps,\n ModalCloseProps,\n};\n","'use client';\n\nimport { useSyncExternalStore, type ReactNode } from 'react';\nimport { Toast as ToastPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Info, Check, AlertTriangle, AlertCircle, Close } from '../../internal/icons';\nimport {\n toastStore as defaultStore,\n type ToastData,\n type ToastStore,\n type ToastVariant,\n} from './toast-store';\n\n// ─── 1. Variants (cva) ─── //\n\nconst toastVariants = cva('ddga-toast', {\n variants: {\n variant: {\n default: 'ddga-toast--default',\n info: 'ddga-toast--info',\n success: 'ddga-toast--success',\n warning: 'ddga-toast--warning',\n destructive: 'ddga-toast--destructive',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nconst toastViewportVariants = cva('ddga-toast-viewport', {\n variants: {\n position: {\n 'top-start': 'ddga-toast-viewport--top-start',\n 'top-center': 'ddga-toast-viewport--top-center',\n 'top-end': 'ddga-toast-viewport--top-end',\n 'bottom-start': 'ddga-toast-viewport--bottom-start',\n 'bottom-center': 'ddga-toast-viewport--bottom-center',\n 'bottom-end': 'ddga-toast-viewport--bottom-end',\n },\n containerized: {\n true: 'ddga-toast-viewport--containerized',\n },\n },\n defaultVariants: {\n position: 'bottom-end',\n },\n});\n\nconst DEFAULT_ICONS: Record<ToastVariant, ReactNode> = {\n default: null,\n info: <Info aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n warning: <AlertTriangle aria-hidden=\"true\" />,\n destructive: <AlertCircle aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ntype ToastPosition = NonNullable<VariantProps<typeof toastViewportVariants>['position']>;\n\ninterface ToasterProps {\n /** Where toasts stack. Logical: start/end flip in RTL. Default `bottom-end`. */\n position?: ToastPosition;\n /**\n * Pin the viewport to a positioned ancestor (via `position: absolute`)\n * instead of the browser viewport (`position: fixed`). Set this for\n * Storybook stories, embedded widgets, and any layout where the Toaster\n * should stay within a parent box. Caller is responsible for placing the\n * Toaster inside an element with `position: relative` (or other positioned\n * containing block).\n */\n containerized?: boolean;\n /** ms; default 4000. Set 0 (or Infinity) to disable auto-dismiss globally. */\n duration?: number;\n /** Show a close (X) button on each toast. Defaults to true. */\n closeButton?: boolean;\n /** Localized label for the close button. Default `\"Dismiss\"`. */\n closeLabel?: string;\n /** Hide the default leading icon per variant. */\n hideIcon?: boolean;\n /** Extra class on the Radix Viewport. */\n className?: string;\n /** Override swipe direction. Defaults based on `position`. */\n swipeDirection?: 'up' | 'down' | 'left' | 'right';\n /**\n * The toast store this Toaster subscribes to. Defaults to the module-level\n * singleton so the bare `toast()` API works without setup. Pass an isolated\n * store (created via `createToastStore()` + `createToast(store)`) when you\n * need multiple independent Toasters on the same page — common in\n * Storybook, docs sites, and embedded widgets.\n */\n store?: ToastStore;\n}\n\n// ─── 3. Components ─── //\n\nfunction Toaster({\n position = 'bottom-end',\n containerized = false,\n duration = 4000,\n closeButton = true,\n closeLabel = 'Dismiss',\n hideIcon = false,\n className,\n swipeDirection,\n store = defaultStore,\n}: ToasterProps) {\n // Subscribe to the store. Using getSnapshot for both client + server is\n // fine — toasts always start empty on hydration and adding only happens\n // after client mount.\n const toasts = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);\n\n // Map position → swipe direction. Top toasts swipe up; bottom toasts\n // swipe down. Caller can override.\n const resolvedSwipe: 'up' | 'down' | 'left' | 'right' =\n swipeDirection ?? (position.startsWith('top') ? 'up' : 'down');\n\n return (\n <ToastPrimitive.Provider duration={duration} swipeDirection={resolvedSwipe}>\n {toasts.map((t) => (\n <ToastItem\n key={t.id}\n toast={t}\n store={store}\n closeButton={closeButton}\n closeLabel={closeLabel}\n hideIcon={hideIcon}\n />\n ))}\n <ToastPrimitive.Viewport\n data-slot=\"toast-viewport\"\n data-position={position}\n className={cn(toastViewportVariants({ position, containerized }), className)}\n />\n </ToastPrimitive.Provider>\n );\n}\n\ninterface ToastItemProps {\n toast: ToastData;\n store: ToastStore;\n closeButton: boolean;\n closeLabel: string;\n hideIcon: boolean;\n}\n\nfunction ToastItem({ toast: t, store, closeButton, closeLabel, hideIcon }: ToastItemProps) {\n // For destructive variant, mark as `foreground` so assistive tech announces\n // it more urgently (Radix routes foreground toasts through a hidden\n // assertive live region; background goes through a polite one).\n const radixType: 'foreground' | 'background' =\n t.variant === 'destructive' ? 'foreground' : 'background';\n\n const icon = hideIcon ? null : DEFAULT_ICONS[t.variant];\n\n return (\n <ToastPrimitive.Root\n data-slot=\"toast\"\n data-variant={t.variant}\n className={toastVariants({ variant: t.variant })}\n open={t.open}\n type={radixType}\n duration={t.duration}\n onOpenChange={(open) => {\n if (!open) {\n // Route close-button / swipe / auto-duration dismissal through the\n // store. The store schedules the hard-remove after the exit anim,\n // so programmatic + UI dismissal land on the same path.\n store.dismiss(t.id);\n }\n }}\n >\n {icon ? <span className=\"ddga-toast__icon\">{icon}</span> : null}\n {/*\n Body owns the title + description + action stack so multi-line content\n and a trailing action button compose cleanly. Action lives INSIDE the\n body (not as a sibling of body) so it doesn't fight body's height when\n a description is present — sonner/shadcn pattern.\n */}\n <div className=\"ddga-toast__body\">\n {t.title ? (\n <ToastPrimitive.Title className=\"ddga-toast__title\">{t.title}</ToastPrimitive.Title>\n ) : null}\n {t.description ? (\n <ToastPrimitive.Description className=\"ddga-toast__description\">\n {t.description}\n </ToastPrimitive.Description>\n ) : null}\n {t.action ? (\n <ToastPrimitive.Action\n className=\"ddga-toast__action\"\n altText={\n t.action.altText ?? (typeof t.action.label === 'string' ? t.action.label : 'Action')\n }\n onClick={() => {\n t.action?.onClick();\n // Auto-dismiss after the action — store handles exit-anim timing.\n store.dismiss(t.id);\n }}\n >\n {t.action.label}\n </ToastPrimitive.Action>\n ) : null}\n </div>\n {closeButton ? (\n <ToastPrimitive.Close className=\"ddga-toast__close\" aria-label={closeLabel}>\n <Close aria-hidden=\"true\" />\n </ToastPrimitive.Close>\n ) : null}\n </ToastPrimitive.Root>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Toaster, toastVariants, toastViewportVariants };\nexport { toast, toastStore, createToast, createToastStore } from './toast-store';\nexport type { ToasterProps, ToastPosition };\nexport type { ToastVariant, ToastData, ToastOptions, ToastAction, ToastStore } from './toast-store';\n","'use client';\n\nimport { type ReactNode } from 'react';\n\n// ─── Types ─── //\n\nexport type ToastVariant = 'default' | 'info' | 'success' | 'warning' | 'destructive';\n\nexport interface ToastAction {\n /** Visible label on the action button. */\n label: ReactNode;\n /** Required by Radix Toast for screen-reader announcement when the action\n * isn't a simple string label. Falls back to `label` when it's a string. */\n altText?: string;\n /** Fired when the action button is pressed. Toast auto-dismisses after. */\n onClick: () => void;\n}\n\nexport interface ToastData {\n /** Auto-generated unless caller provides one (useful for de-dup / updates). */\n id: string;\n title?: ReactNode;\n description?: ReactNode;\n variant: ToastVariant;\n /** ms; `0` (or `Infinity`) means no auto-dismiss. Defaults handled by Toaster. */\n duration?: number;\n action?: ToastAction;\n /** Controlled by Radix Toast (true while visible; false plays exit anim). */\n open: boolean;\n /** Fires when the toast leaves the DOM (after exit anim). */\n onDismiss?: () => void;\n}\n\nexport interface ToastOptions {\n id?: string;\n title?: ReactNode;\n description?: ReactNode;\n duration?: number;\n action?: ToastAction;\n onDismiss?: () => void;\n}\n\ntype Listener = () => void;\n\n/** Public store shape. `<Toaster store={…} />` accepts this, and\n * `createToast(store)` returns a scoped `toast()` bound to it. */\nexport interface ToastStore {\n subscribe(listener: Listener): () => void;\n getSnapshot(): ToastData[];\n add(variant: ToastVariant, message: ReactNode, options?: ToastOptions): string;\n dismiss(id?: string): void;\n remove(id: string): void;\n /** Test-only / story-only: hard reset. */\n __reset(): void;\n}\n\n/** Approximate Radix Toast exit-animation duration (ms). After this we hard-\n * remove the entry from the store so the DOM unmounts cleanly. */\nconst EXIT_ANIM_MS = 200;\n\n// ─── Factory ─── //\n//\n// Each call returns an isolated store. The default module-level instance\n// powers the singleton `toast()` API (Sonner pattern: one Toaster at app\n// root). Advanced consumers — including the Storybook stories below this\n// component — call `createToastStore()` to get an independent store so\n// multiple Toasters on one page don't share state.\n\nexport function createToastStore(): ToastStore {\n let toasts: ToastData[] = [];\n const listeners = new Set<Listener>();\n let counter = 0;\n\n function emit() {\n for (const l of listeners) l();\n }\n\n function subscribe(listener: Listener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n }\n\n function getSnapshot(): ToastData[] {\n return toasts;\n }\n\n function nextId(): string {\n counter += 1;\n return `t${counter}`;\n }\n\n function add(variant: ToastVariant, message: ReactNode, options: ToastOptions = {}): string {\n const id = options.id ?? nextId();\n const existing = toasts.findIndex((t) => t.id === id);\n const data: ToastData = {\n id,\n variant,\n open: true,\n title: message,\n description: options.description,\n duration: options.duration,\n action: options.action,\n onDismiss: options.onDismiss,\n };\n if (existing >= 0) {\n // Update in place (caller passed the same id — useful for \"loading → success\"\n // patterns or de-duped error messages).\n toasts = toasts.map((t, i) => (i === existing ? data : t));\n } else {\n toasts = [...toasts, data];\n }\n emit();\n return id;\n }\n\n /** Flip `open` to false → Radix plays exit anim → `remove` after.\n * Routes both programmatic dismiss + UI dismiss through the same path. */\n function dismiss(id?: string): void {\n if (id === undefined) {\n const ids = toasts.map((t) => t.id);\n toasts = toasts.map((t) => ({ ...t, open: false }));\n emit();\n setTimeout(() => {\n ids.forEach((id) => remove(id));\n }, EXIT_ANIM_MS);\n } else {\n toasts = toasts.map((t) => (t.id === id ? { ...t, open: false } : t));\n emit();\n setTimeout(() => remove(id), EXIT_ANIM_MS);\n }\n }\n\n function remove(id: string): void {\n const target = toasts.find((t) => t.id === id);\n toasts = toasts.filter((t) => t.id !== id);\n emit();\n target?.onDismiss?.();\n }\n\n function __reset(): void {\n toasts = [];\n counter = 0;\n emit();\n }\n\n return { subscribe, getSnapshot, add, dismiss, remove, __reset };\n}\n\n// ─── Default singleton ─── //\n// 90%-case API: one Toaster at app root, call `toast()` anywhere.\n\nexport const toastStore: ToastStore = createToastStore();\n\n// ─── createToast(store) ─── //\n\ninterface ToastFn {\n (message: ReactNode, options?: ToastOptions): string;\n default: (message: ReactNode, options?: ToastOptions) => string;\n info: (message: ReactNode, options?: ToastOptions) => string;\n success: (message: ReactNode, options?: ToastOptions) => string;\n warning: (message: ReactNode, options?: ToastOptions) => string;\n error: (message: ReactNode, options?: ToastOptions) => string;\n /** Alias for `error` — matches the variant name used everywhere else in the library. */\n destructive: (message: ReactNode, options?: ToastOptions) => string;\n /** Dismiss a specific toast by id, or all when called with no args. */\n dismiss: (id?: string) => void;\n}\n\n/** Bind an imperative `toast()` callable to a specific store. */\nexport function createToast(store: ToastStore): ToastFn {\n const fn: ToastFn = ((message, options) => store.add('default', message, options)) as ToastFn;\n fn.default = (message, options) => store.add('default', message, options);\n fn.info = (message, options) => store.add('info', message, options);\n fn.success = (message, options) => store.add('success', message, options);\n fn.warning = (message, options) => store.add('warning', message, options);\n fn.error = (message, options) => store.add('destructive', message, options);\n fn.destructive = fn.error;\n fn.dismiss = (id) => store.dismiss(id);\n return fn;\n}\n\n/** Default singleton `toast()` — bound to the module-level `toastStore`. */\nexport const toast: ToastFn = createToast(toastStore);\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual variant + size live on the root. The CSS cascades through\n// descendant selectors (`.ddga-tabs--line .ddga-tabs__trigger`) so the source\n// of truth stays on one element per Tabs instance — no need to thread props\n// into every TabsList/TabsTrigger. Same pattern as RadioGroup.\n\nconst tabsVariants = cva('ddga-tabs', {\n variants: {\n variant: {\n line: 'ddga-tabs--line',\n pill: 'ddga-tabs--pill',\n },\n size: {\n sm: 'ddga-tabs--sm',\n md: 'ddga-tabs--md',\n },\n },\n defaultVariants: {\n variant: 'line',\n size: 'md',\n },\n});\n\nconst tabsListVariants = cva('ddga-tabs__list', {\n variants: {\n fullWidth: {\n true: 'ddga-tabs__list--full-width',\n },\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface TabsProps\n extends React.ComponentProps<typeof TabsPrimitive.Root>, VariantProps<typeof tabsVariants> {}\n\ninterface TabsListProps\n extends React.ComponentProps<typeof TabsPrimitive.List>, VariantProps<typeof tabsListVariants> {}\n\ninterface TabsTriggerProps extends React.ComponentProps<typeof TabsPrimitive.Trigger> {\n /**\n * Leading icon, rendered before the label in a decorative (`aria-hidden`)\n * wrapper. Ignored when `asChild` is set — compose icons inside your own\n * element in that mode.\n */\n startIcon?: ReactNode;\n /** Trailing icon (e.g. a count/badge glyph). Same rules as `startIcon`. */\n endIcon?: ReactNode;\n}\ntype TabsContentProps = React.ComponentProps<typeof TabsPrimitive.Content>;\n\n// ─── 3. Components ─── //\n\nfunction Tabs({ variant, size, className, ...props }: TabsProps) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(tabsVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({ fullWidth, className, ...props }: TabsListProps) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(tabsListVariants({ fullWidth }), className)}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n startIcon,\n endIcon,\n children,\n asChild,\n ...props\n}: TabsTriggerProps) {\n // Radix Trigger supports asChild natively. In that mode the consumer supplies\n // the single child element (Slot), so our icon spans can't be injected\n // alongside it — the consumer composes any icons inside their own element.\n const hasIcon = startIcon != null || endIcon != null;\n // React renders nothing for null/undefined/booleans/'' — those don't count as\n // a visible text label, so `{cond && 'Label'}` resolving to `false` correctly\n // reads as icon-only (squares padding + triggers the a11y warning). A numeric\n // child like `0` does render, so it stays \"has text\".\n const hasText = children != null && children !== '' && typeof children !== 'boolean';\n // Icon-only = an icon and no text label. Squares the padding (see tabs.css)\n // and requires an accessible name, mirroring Button's icon-only contract.\n const isIconOnly = !asChild && hasIcon && !hasText;\n\n if (process.env.NODE_ENV === 'development') {\n if (isIconOnly && !props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] An icon-only TabsTrigger (icon with no text label) ' +\n 'requires an aria-label or aria-labelledby for screen reader accessibility.',\n );\n }\n if (asChild && hasIcon) {\n console.warn(\n '[@dev-dga/react] TabsTrigger `startIcon`/`endIcon` are ignored when ' +\n '`asChild` is set — render the icons inside your child element instead.',\n );\n }\n }\n\n // Disabled state is native (Radix sets `[data-disabled]` + the rendered\n // button gets `disabled`); CSS targets both `[data-disabled]` and\n // `[aria-disabled='true']` so it applies to `disabled` and asChild +\n // `aria-disabled` alike.\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n asChild={asChild}\n className={cn('ddga-tabs__trigger', isIconOnly && 'ddga-tabs__trigger--icon-only', className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {startIcon && (\n <span\n className=\"ddga-tabs__icon\"\n data-slot=\"tabs-trigger-start-icon\"\n aria-hidden=\"true\"\n >\n {startIcon}\n </span>\n )}\n {children}\n {endIcon && (\n <span className=\"ddga-tabs__icon\" data-slot=\"tabs-trigger-end-icon\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </>\n )}\n </TabsPrimitive.Trigger>\n );\n}\n\nfunction TabsContent({ className, ...props }: TabsContentProps) {\n // Radix Content supports asChild natively. Mount/unmount and the\n // aria-labelledby ↔ TabsTrigger wiring is handled by Radix.\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('ddga-tabs__content', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent, tabsVariants, tabsListVariants };\nexport type { TabsProps, TabsListProps, TabsTriggerProps, TabsContentProps };\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronRight, MoreHorizontal } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root; per-part visuals cascade through descendant\n// selectors (`.ddga-breadcrumb--sm .ddga-breadcrumb__link`). Same pattern\n// as Tabs/RadioGroup — one source of truth on the nav element.\n\nconst breadcrumbVariants = cva('ddga-breadcrumb', {\n variants: {\n size: {\n sm: 'ddga-breadcrumb--sm',\n md: 'ddga-breadcrumb--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface BreadcrumbProps\n extends React.ComponentProps<'nav'>, VariantProps<typeof breadcrumbVariants> {}\n\ntype BreadcrumbListProps = React.ComponentProps<'ol'>;\ntype BreadcrumbItemProps = React.ComponentProps<'li'>;\n\ninterface BreadcrumbLinkProps extends React.ComponentProps<'a'> {\n /** Render as the consumer element (e.g., a router Link) via Radix Slot. */\n asChild?: boolean;\n}\n\ninterface BreadcrumbPageProps extends React.ComponentProps<'span'> {\n /** Render as the consumer element (e.g., a heading) via Radix Slot. */\n asChild?: boolean;\n}\n\ninterface BreadcrumbSeparatorProps extends React.ComponentProps<'li'> {\n /**\n * Override the default ChevronRight icon with custom content (e.g., `/`, `·`,\n * or your own SVG). The wrapper itself stays `aria-hidden` since separators\n * are decorative — the visited-state structure is conveyed via the `<ol>`\n * + `aria-current` semantics, not the separator glyph.\n */\n children?: React.ReactNode;\n}\n\ntype BreadcrumbEllipsisProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Breadcrumb({ size, className, ...props }: BreadcrumbProps) {\n // Default the accessible name to \"Breadcrumb\" so consumers don't have to\n // wire it themselves; spread `aria-label` after so they can override it\n // (e.g., for non-English UIs the consumer passes their own translation).\n return (\n <nav\n aria-label=\"Breadcrumb\"\n data-slot=\"breadcrumb\"\n className={cn(breadcrumbVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbList({ className, ...props }: BreadcrumbListProps) {\n return (\n <ol data-slot=\"breadcrumb-list\" className={cn('ddga-breadcrumb__list', className)} {...props} />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: BreadcrumbItemProps) {\n return (\n <li data-slot=\"breadcrumb-item\" className={cn('ddga-breadcrumb__item', className)} {...props} />\n );\n}\n\nfunction BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n data-slot=\"breadcrumb-link\"\n className={cn('ddga-breadcrumb__link', className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbPage({ asChild, className, ...props }: BreadcrumbPageProps) {\n // `aria-current=\"page\"` marks the current location for assistive tech.\n // The element is not focusable (consumers shouldn't link to the current\n // page); spread props last so consumers can swap if a different\n // aria-current value is needed (e.g., `step` in a wizard).\n const Comp = asChild ? SlotPrimitive.Slot : 'span';\n return (\n <Comp\n aria-current=\"page\"\n data-slot=\"breadcrumb-page\"\n className={cn('ddga-breadcrumb__page', className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps) {\n // Decorative — the `<ol>` + `aria-current` semantics already convey order\n // and current page. `aria-hidden` keeps screen readers from announcing\n // the glyph between every item.\n return (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"breadcrumb-separator\"\n className={cn('ddga-breadcrumb__separator', className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n );\n}\n\nfunction BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps) {\n // Visual truncation marker. Decorative by itself — if the consumer wants\n // an interactive \"show collapsed items\" affordance, they should compose\n // a real button (e.g., a DropdownMenu trigger) inside a BreadcrumbItem\n // instead of this component.\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"breadcrumb-ellipsis\"\n className={cn('ddga-breadcrumb__ellipsis', className)}\n {...props}\n >\n <MoreHorizontal />\n </span>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n breadcrumbVariants,\n};\nexport type {\n BreadcrumbProps,\n BreadcrumbListProps,\n BreadcrumbItemProps,\n BreadcrumbLinkProps,\n BreadcrumbPageProps,\n BreadcrumbSeparatorProps,\n BreadcrumbEllipsisProps,\n};\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronRight, MoreHorizontal } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root and cascades via descendants — same pattern as\n// Breadcrumb / Tabs. `PaginationLink` carries the active/inactive visual\n// state via `isActive` (which is also what stamps `aria-current=\"page\"`),\n// so the active style stays bound to the a11y mark and can't drift.\n\nconst paginationVariants = cva('ddga-pagination', {\n variants: {\n size: {\n sm: 'ddga-pagination--sm',\n md: 'ddga-pagination--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst paginationLinkVariants = cva('ddga-pagination__link', {\n variants: {\n isActive: {\n true: 'ddga-pagination__link--active',\n },\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface PaginationProps\n extends React.ComponentProps<'nav'>, VariantProps<typeof paginationVariants> {}\n\ntype PaginationContentProps = React.ComponentProps<'ul'>;\ntype PaginationItemProps = React.ComponentProps<'li'>;\n\ninterface PaginationLinkProps\n extends\n Omit<React.ComponentProps<'a'>, 'aria-current'>,\n VariantProps<typeof paginationLinkVariants> {\n /** Render as the consumer element (e.g., router Link) via Radix Slot. */\n asChild?: boolean;\n}\n\ntype PaginationPreviousProps = Omit<PaginationLinkProps, 'isActive'> & {\n /**\n * Visible + accessible label for the previous-page link. Defaults to\n * `\"Previous\"`. Pass a translated string for non-English UIs — the value is\n * also used for `aria-label`, so a localized string is required for a11y.\n * Ignored when `asChild` + consumer-provided `children` are used.\n */\n label?: string;\n};\n\ntype PaginationNextProps = Omit<PaginationLinkProps, 'isActive'> & {\n /**\n * Visible + accessible label for the next-page link. Defaults to `\"Next\"`.\n * Pass a translated string for non-English UIs — the value is also used\n * for `aria-label`, so a localized string is required for a11y. Ignored\n * when `asChild` + consumer-provided `children` are used.\n */\n label?: string;\n};\n\ntype PaginationEllipsisProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Pagination({ size, className, ...props }: PaginationProps) {\n // Default the accessible name to \"pagination\" (lowercase per the\n // ARIA Authoring Practices Guide). Spread `aria-label` last so consumers\n // can override for non-English UIs.\n return (\n <nav\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(paginationVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({ className, ...props }: PaginationContentProps) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn('ddga-pagination__content', className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ className, ...props }: PaginationItemProps) {\n return (\n <li data-slot=\"pagination-item\" className={cn('ddga-pagination__item', className)} {...props} />\n );\n}\n\nfunction PaginationLink({ asChild, isActive, className, ...props }: PaginationLinkProps) {\n // `isActive` is the single source of truth for both the visual state and\n // the `aria-current=\"page\"` mark — they can't drift apart.\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n aria-current={isActive ? 'page' : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive ? '' : undefined}\n className={cn(paginationLinkVariants({ isActive }), className)}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n label = 'Previous',\n className,\n children,\n asChild,\n ...props\n}: PaginationPreviousProps) {\n // In asChild + children-provided mode the consumer owns the rendered\n // content; we still wire the accessible label so screen reader users hear\n // \"Previous\" even if the consumer's text is something custom.\n return (\n <PaginationLink\n asChild={asChild}\n aria-label={label}\n data-slot=\"pagination-previous\"\n className={cn('ddga-pagination__nav', 'ddga-pagination__nav--previous', className)}\n {...props}\n >\n {children ?? (\n <>\n <ChevronRight className=\"ddga-pagination__nav-icon ddga-pagination__nav-icon--previous\" />\n <span>{label}</span>\n </>\n )}\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n label = 'Next',\n className,\n children,\n asChild,\n ...props\n}: PaginationNextProps) {\n return (\n <PaginationLink\n asChild={asChild}\n aria-label={label}\n data-slot=\"pagination-next\"\n className={cn('ddga-pagination__nav', 'ddga-pagination__nav--next', className)}\n {...props}\n >\n {children ?? (\n <>\n <span>{label}</span>\n <ChevronRight className=\"ddga-pagination__nav-icon ddga-pagination__nav-icon--next\" />\n </>\n )}\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({ className, ...props }: PaginationEllipsisProps) {\n // Decorative — collapsed-range marker. Consumer is expected to make the\n // surrounding links cover the real navigation surface (first/last/numbers).\n return (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n data-slot=\"pagination-ellipsis\"\n className={cn('ddga-pagination__ellipsis', className)}\n {...props}\n >\n <MoreHorizontal />\n </span>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Pagination,\n PaginationContent,\n PaginationItem,\n PaginationLink,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n paginationVariants,\n paginationLinkVariants,\n};\nexport type {\n PaginationProps,\n PaginationContentProps,\n PaginationItemProps,\n PaginationLinkProps,\n PaginationPreviousProps,\n PaginationNextProps,\n PaginationEllipsisProps,\n};\n","'use client';\n\nimport { Accordion as AccordionPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ChevronDown } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Size lives on the root. Per-part visuals cascade via descendant selectors,\n// same pattern as Tabs/Breadcrumb. Radix handles disclosure state (open /\n// closed via `data-state`), keyboard nav (Arrow + Home/End), and mounting\n// of content with built-in animation hooks (`data-state` + CSS variables\n// `--radix-accordion-content-height`).\n\nconst accordionVariants = cva('ddga-accordion', {\n variants: {\n size: {\n sm: 'ddga-accordion--sm',\n md: 'ddga-accordion--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Radix's Root has two prop shapes depending on `type` (single vs multiple\n// expanded). We mirror that via discriminated union from Radix's own types.\n\ntype AccordionRootProps = React.ComponentProps<typeof AccordionPrimitive.Root>;\ntype AccordionProps = AccordionRootProps & VariantProps<typeof accordionVariants>;\n\ntype AccordionItemProps = React.ComponentProps<typeof AccordionPrimitive.Item>;\ntype AccordionTriggerProps = React.ComponentProps<typeof AccordionPrimitive.Trigger>;\ntype AccordionContentProps = React.ComponentProps<typeof AccordionPrimitive.Content>;\n\n// ─── 3. Components ─── //\n\nfunction Accordion({ size, className, ...props }: AccordionProps) {\n return (\n <AccordionPrimitive.Root\n data-slot=\"accordion\"\n className={cn(accordionVariants({ size }), className)}\n {...(props as AccordionRootProps)}\n />\n );\n}\n\nfunction AccordionItem({ className, ...props }: AccordionItemProps) {\n return (\n <AccordionPrimitive.Item\n data-slot=\"accordion-item\"\n className={cn('ddga-accordion__item', className)}\n {...props}\n />\n );\n}\n\nfunction AccordionTrigger({ className, children, ...props }: AccordionTriggerProps) {\n // Radix wraps the trigger in a Header (`<h3>` by default). We render the\n // Header inline so consumers get the heading-level semantics for free; the\n // visible chevron is decorative (aria-hidden) and rotates via `data-state`.\n return (\n <AccordionPrimitive.Header className=\"ddga-accordion__header\">\n <AccordionPrimitive.Trigger\n data-slot=\"accordion-trigger\"\n className={cn('ddga-accordion__trigger', className)}\n {...props}\n >\n {children}\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ddga-accordion__chevron\"\n data-slot=\"accordion-chevron\"\n />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n );\n}\n\nfunction AccordionContent({ className, children, ...props }: AccordionContentProps) {\n // Radix sets `--radix-accordion-content-height` on the element when open\n // so we can animate from 0 → content-height. The inner div carries the\n // padding so the animated container can clip without padding \"popping\".\n return (\n <AccordionPrimitive.Content\n data-slot=\"accordion-content\"\n className={cn('ddga-accordion__content', className)}\n {...props}\n >\n <div className=\"ddga-accordion__content-inner\">{children}</div>\n </AccordionPrimitive.Content>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent, accordionVariants };\nexport type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual-only stepper. Each `Step` carries a `state` (completed / current /\n// upcoming) which drives the indicator color + ARIA marks. Separators are\n// CSS-drawn via pseudo-elements between siblings — no `StepSeparator`\n// component needed (and one fewer thing for consumers to get wrong).\n\nconst stepsVariants = cva('ddga-steps', {\n variants: {\n size: {\n sm: 'ddga-steps--sm',\n md: 'ddga-steps--md',\n },\n orientation: {\n horizontal: 'ddga-steps--horizontal',\n vertical: 'ddga-steps--vertical',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'horizontal',\n },\n});\n\ntype StepState = 'completed' | 'current' | 'upcoming';\n\nconst stepVariants = cva('ddga-steps__step', {\n variants: {\n state: {\n completed: 'ddga-steps__step--completed',\n current: 'ddga-steps__step--current',\n upcoming: 'ddga-steps__step--upcoming',\n },\n },\n defaultVariants: {\n state: 'upcoming',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface StepsProps extends React.ComponentProps<'ol'>, VariantProps<typeof stepsVariants> {}\n\ninterface StepProps\n extends Omit<React.ComponentProps<'li'>, 'aria-current'>, VariantProps<typeof stepVariants> {}\n\ninterface StepIndicatorProps extends React.ComponentProps<'span'> {\n /**\n * The 1-based step number to render when the step is `current` or\n * `upcoming`. Ignored when the step is `completed` — the indicator shows\n * a check icon instead.\n */\n step?: number | string;\n}\n\ntype StepTitleProps = React.ComponentProps<'span'>;\ntype StepDescriptionProps = React.ComponentProps<'span'>;\n\n// ─── 3. Components ─── //\n\nfunction Steps({ size, orientation, className, ...props }: StepsProps) {\n // `<ol>` is the right semantic for an ordered list of steps; the implicit\n // listitem role on children makes the count assistive-tech-readable.\n return (\n <ol\n data-slot=\"steps\"\n data-orientation={orientation ?? 'horizontal'}\n className={cn(stepsVariants({ size, orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction Step({ state, className, ...props }: StepProps) {\n // `aria-current=\"step\"` on the current step. State drives both the ARIA\n // mark and the visual class so they can't drift apart. Step always\n // renders an `<li>` because the parent `<ol>` is only allowed to contain\n // `<li>` children — consumers who need clickable steps put an `<a>` (or\n // a router primitive) inside Step's children, not as the step element\n // itself.\n return (\n <li\n aria-current={state === 'current' ? 'step' : undefined}\n data-slot=\"step\"\n data-state={state ?? 'upcoming'}\n className={cn(stepVariants({ state }), className)}\n {...props}\n />\n );\n}\n\nfunction StepIndicator({ step, className, ...props }: StepIndicatorProps) {\n // Decorative — assistive tech reads the step title/description, not the\n // number-in-a-circle. The check icon for completed steps is purely\n // visual; the parent's `data-state=\"completed\"` is what conveys meaning.\n return (\n <span\n aria-hidden=\"true\"\n data-slot=\"step-indicator\"\n className={cn('ddga-steps__indicator', className)}\n {...props}\n >\n <Check className=\"ddga-steps__indicator-check\" />\n <span className=\"ddga-steps__indicator-number\">{step}</span>\n </span>\n );\n}\n\nfunction StepTitle({ className, ...props }: StepTitleProps) {\n return <span data-slot=\"step-title\" className={cn('ddga-steps__title', className)} {...props} />;\n}\n\nfunction StepDescription({ className, ...props }: StepDescriptionProps) {\n return (\n <span\n data-slot=\"step-description\"\n className={cn('ddga-steps__description', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Steps, Step, StepIndicator, StepTitle, StepDescription, stepsVariants, stepVariants };\nexport type {\n StepsProps,\n StepProps,\n StepIndicatorProps,\n StepTitleProps,\n StepDescriptionProps,\n StepState,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst skeletonVariants = cva('ddga-skeleton', {\n variants: {\n shape: {\n text: 'ddga-skeleton--text',\n circle: 'ddga-skeleton--circle',\n rectangle: 'ddga-skeleton--rectangle',\n },\n animation: {\n pulse: 'ddga-skeleton--pulse',\n wave: 'ddga-skeleton--wave',\n none: 'ddga-skeleton--none',\n },\n },\n defaultVariants: {\n shape: 'text',\n animation: 'pulse',\n },\n});\n\ninterface SkeletonProps extends React.ComponentProps<'div'>, VariantProps<typeof skeletonVariants> {\n /**\n * Inline width override (any valid CSS length, e.g. `\"60%\"`, `200`, `\"4rem\"`).\n * Defaults: `text` → `100%`, `circle`/`rectangle` → `40px` (CSS-controlled).\n */\n width?: number | string;\n /**\n * Inline height override. Defaults: `text` → `1em` so it tracks the surrounding\n * line height; `rectangle` → `40px`; `circle` → matches `width` to stay round.\n */\n height?: number | string;\n}\n\nfunction Skeleton({ shape, animation, width, height, className, style, ...props }: SkeletonProps) {\n const sizeStyle: React.CSSProperties = {\n ...(width !== undefined ? { width: typeof width === 'number' ? `${width}px` : width } : null),\n ...(height !== undefined\n ? { height: typeof height === 'number' ? `${height}px` : height }\n : null),\n ...style,\n };\n\n return (\n <div\n data-slot=\"skeleton\"\n aria-hidden=\"true\"\n className={cn(skeletonVariants({ shape, animation }), className)}\n style={sizeStyle}\n {...props}\n />\n );\n}\n\nexport { Skeleton, skeletonVariants };\nexport type { SkeletonProps };\n","'use client';\n\nimport { Progress as ProgressPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants ─── //\n\nconst progressVariants = cva('ddga-progress', {\n variants: {\n size: {\n sm: 'ddga-progress--sm',\n md: 'ddga-progress--md',\n lg: 'ddga-progress--lg',\n },\n color: {\n primary: 'ddga-progress--primary',\n success: 'ddga-progress--success',\n warning: 'ddga-progress--warning',\n destructive: 'ddga-progress--destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n },\n});\n\nconst circularProgressVariants = cva('ddga-circular-progress', {\n variants: {\n size: {\n sm: 'ddga-circular-progress--sm',\n md: 'ddga-circular-progress--md',\n lg: 'ddga-circular-progress--lg',\n },\n color: {\n primary: 'ddga-circular-progress--primary',\n success: 'ddga-circular-progress--success',\n warning: 'ddga-circular-progress--warning',\n destructive: 'ddga-circular-progress--destructive',\n },\n },\n defaultVariants: {\n size: 'md',\n color: 'primary',\n },\n});\n\n// ─── 2. Linear Progress (Radix) ─── //\n\ntype ProgressOwnProps = VariantProps<typeof progressVariants> & {\n /**\n * Current progress. `null` (or omitted) renders the indeterminate animation.\n * Otherwise clamp yourself to `[0, max]` — Radix Progress assumes the value\n * is in range.\n */\n value?: number | null;\n /** Maximum value. Defaults to 100. */\n max?: number;\n /**\n * Accessible label for the progressbar. Required for assistive tech —\n * Radix logs a warning if neither `aria-label` nor `aria-labelledby` is set.\n */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\ntype ProgressProps = ProgressOwnProps &\n Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, keyof ProgressOwnProps>;\n\nfunction Progress({ value = null, max = 100, size, color, className, ...props }: ProgressProps) {\n const isIndeterminate = value === null;\n const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n\n return (\n <ProgressPrimitive.Root\n data-slot=\"progress\"\n value={value}\n max={max}\n className={cn(progressVariants({ size, color }), className)}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"ddga-progress__indicator\"\n style={isIndeterminate ? undefined : { transform: `translateX(${pct - 100}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n}\n\n// ─── 3. Circular Progress (custom SVG) ─── //\n\ntype CircularProgressOwnProps = VariantProps<typeof circularProgressVariants> & {\n value?: number | null;\n max?: number;\n /** Stroke width in px. Defaults to 4 (sm) / 5 (md) / 6 (lg). */\n thickness?: number;\n /**\n * Render the ring as `segments` discrete arcs (a radial stepper) instead of a\n * continuous arc. Pass an integer `>= 2`; values below that fall back to the\n * continuous ring. The number of filled segments is `round(pct × segments)`,\n * so `value={3} max={5} segments={5}` fills 3. Segmented mode is determinate —\n * a `null` value renders 0 filled (no spinner).\n */\n segments?: number;\n /** Render the label inside the ring (`%`, or `filled/segments` when segmented). */\n showLabel?: boolean;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n};\n\ntype CircularProgressProps = CircularProgressOwnProps &\n Omit<React.ComponentProps<'div'>, keyof CircularProgressOwnProps>;\n\nconst CIRCULAR_SIZES = { sm: 32, md: 48, lg: 72 } as const;\nconst CIRCULAR_DEFAULT_THICKNESS = { sm: 4, md: 5, lg: 6 } as const;\n// Fraction of each segment's angular slot left as the gap between segments.\nconst SEGMENT_GAP_FRACTION = 0.16;\n\nfunction CircularProgress({\n value = null,\n max = 100,\n size,\n color,\n thickness,\n segments,\n showLabel = false,\n className,\n ...props\n}: CircularProgressProps) {\n const isIndeterminate = value === null;\n const isSegmented = typeof segments === 'number' && segments >= 2;\n const sizeKey = size ?? 'md';\n const diameter = CIRCULAR_SIZES[sizeKey];\n const strokeWidth = thickness ?? CIRCULAR_DEFAULT_THICKNESS[sizeKey];\n const radius = (diameter - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const center = diameter / 2;\n\n const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, (value / max) * 100));\n const dashOffset = isIndeterminate ? circumference * 0.75 : circumference * (1 - pct / 100);\n\n // Mirror Radix Progress's data-state vocabulary so CSS can use a single\n // selector across linear + circular.\n const state = isIndeterminate ? 'indeterminate' : value >= max ? 'complete' : 'loading';\n\n // Segmented (radial-stepper) geometry: split the ring into `segments` arcs\n // with gaps. Each segment is a single dash of `segLen`, rotated into its slot;\n // the gap is centered so segments stay evenly spaced. Determinate-only.\n const segmentEls =\n isSegmented && segments\n ? (() => {\n const filled = isIndeterminate ? 0 : Math.round((pct / 100) * segments);\n const segAngle = 360 / segments;\n const gapAngle = segAngle * SEGMENT_GAP_FRACTION;\n const segLen = circumference * ((1 - SEGMENT_GAP_FRACTION) / segments);\n return Array.from({ length: segments }, (_, i) => (\n <circle\n key={i}\n className={cn(\n 'ddga-circular-progress__segment',\n i < filled && 'ddga-circular-progress__segment--filled',\n )}\n cx={center}\n cy={center}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n // Butt caps, not round: round caps extend strokeWidth/2 past each\n // arc end and would swallow the gap (overlapping at small sizes).\n strokeLinecap=\"butt\"\n strokeDasharray={`${segLen} ${circumference}`}\n transform={`rotate(${-90 + i * segAngle + gapAngle / 2} ${center} ${center})`}\n />\n ));\n })()\n : null;\n\n const labelText = isSegmented\n ? `${segments ? Math.round((pct / 100) * segments) : 0}/${segments}`\n : `${Math.round(pct)}%`;\n\n return (\n <div\n data-slot=\"circular-progress\"\n data-state={state}\n data-segmented={isSegmented ? '' : undefined}\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={isIndeterminate ? undefined : value}\n className={cn(circularProgressVariants({ size, color }), className)}\n style={{ inlineSize: diameter, blockSize: diameter }}\n {...props}\n >\n <svg\n className=\"ddga-circular-progress__svg\"\n viewBox={`0 0 ${diameter} ${diameter}`}\n width={diameter}\n height={diameter}\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n {isSegmented ? (\n segmentEls\n ) : (\n <>\n <circle\n className=\"ddga-circular-progress__track\"\n cx={center}\n cy={center}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n />\n <circle\n className=\"ddga-circular-progress__indicator\"\n cx={center}\n cy={center}\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={dashOffset}\n transform={`rotate(-90 ${center} ${center})`}\n />\n </>\n )}\n </svg>\n {showLabel && !isIndeterminate ? (\n <span className=\"ddga-circular-progress__label\" aria-hidden=\"true\">\n {labelText}\n </span>\n ) : null}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Progress, CircularProgress, progressVariants, circularProgressVariants };\nexport type { ProgressProps, CircularProgressProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\nconst dropdownMenuVariants = cva('ddga-dropdown-menu', {\n variants: {\n size: {\n sm: 'ddga-dropdown-menu--sm',\n md: 'ddga-dropdown-menu--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Root + Trigger (Radix pass-throughs) ─── //\n\ntype DropdownMenuProps = React.ComponentProps<typeof DropdownMenuPrimitive.Root>;\n\nfunction DropdownMenu(props: DropdownMenuProps) {\n return <DropdownMenuPrimitive.Root {...props} />;\n}\n\ntype DropdownMenuTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>;\n\nfunction DropdownMenuTrigger(props: DropdownMenuTriggerProps) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\n// ─── 3. Content (portal-anchored) ─── //\n\ntype DropdownMenuContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.Content> &\n VariantProps<typeof dropdownMenuVariants>;\n\nfunction DropdownMenuContent({\n size,\n className,\n sideOffset = 6,\n ...props\n}: DropdownMenuContentProps) {\n // Radix Portal defaults to <body>, which doesn't inherit DgaProvider's\n // data-theme / CSS vars. Re-anchor at the provider's body-level portal\n // container (mirrors data-theme + dir + theme vars from the provider) so\n // dropdown inherits theme AND escapes any clipping or transform ancestor\n // that would trap an in-tree portal. Falls back to <body> when used\n // outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(dropdownMenuVariants({ size }), className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n// ─── 4. Item + variants ─── //\n\ntype DropdownMenuItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /** Style as a destructive action (red text, red hover). */\n destructive?: boolean;\n /** Icon rendered before the label. Sized to 1em. */\n startIcon?: ReactNode;\n /** Trailing text shown muted, e.g. a keyboard shortcut hint (\"⌘K\"). */\n shortcut?: ReactNode;\n};\n\nfunction DropdownMenuItem({\n className,\n destructive,\n startIcon,\n shortcut,\n children,\n ...props\n}: DropdownMenuItemProps) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-destructive={destructive ? '' : undefined}\n className={cn('ddga-dropdown-menu__item', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-dropdown-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n {shortcut ? (\n <span className=\"ddga-dropdown-menu__shortcut\" aria-hidden=\"true\">\n {shortcut}\n </span>\n ) : null}\n </DropdownMenuPrimitive.Item>\n );\n}\n\n// ─── 5. CheckboxItem + RadioItem ─── //\n\ntype DropdownMenuCheckboxItemProps = React.ComponentProps<\n typeof DropdownMenuPrimitive.CheckboxItem\n>;\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n onSelect,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n // Default UX: keep the menu open across toggles so consumers can flip\n // multiple checkboxes in one pass. If a consumer passes their own onSelect,\n // they own the behavior (call `event.preventDefault()` to keep this default).\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-dropdown-menu__indicator\" aria-hidden=\"true\">\n <DropdownMenuPrimitive.ItemIndicator>\n <Check className=\"ddga-dropdown-menu__indicator-icon\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\ntype DropdownMenuRadioGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>;\n\nfunction DropdownMenuRadioGroup(props: DropdownMenuRadioGroupProps) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\ntype DropdownMenuRadioItemProps = React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>;\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n onSelect,\n ...props\n}: DropdownMenuRadioItemProps) {\n // Same default-open behavior as CheckboxItem — selecting a radio without\n // the menu visually confirming the new state is a frustrating dead-feel.\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-dropdown-menu__indicator\" aria-hidden=\"true\">\n <DropdownMenuPrimitive.ItemIndicator>\n <span className=\"ddga-dropdown-menu__radio-dot\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\n// ─── 6. Label + Separator + Group ─── //\n\ntype DropdownMenuLabelProps = React.ComponentProps<typeof DropdownMenuPrimitive.Label>;\n\nfunction DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n className={cn('ddga-dropdown-menu__group-label', className)}\n {...props}\n />\n );\n}\n\ntype DropdownMenuSeparatorProps = React.ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nfunction DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('ddga-dropdown-menu__separator', className)}\n {...props}\n />\n );\n}\n\ntype DropdownMenuGroupProps = React.ComponentProps<typeof DropdownMenuPrimitive.Group>;\n\nfunction DropdownMenuGroup(props: DropdownMenuGroupProps) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\n// ─── 7. Submenu (Sub + SubTrigger + SubContent) ─── //\n\ntype DropdownMenuSubProps = React.ComponentProps<typeof DropdownMenuPrimitive.Sub>;\n\nfunction DropdownMenuSub(props: DropdownMenuSubProps) {\n return <DropdownMenuPrimitive.Sub {...props} />;\n}\n\ntype DropdownMenuSubTriggerProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n startIcon?: ReactNode;\n};\n\nfunction DropdownMenuSubTrigger({\n className,\n startIcon,\n children,\n ...props\n}: DropdownMenuSubTriggerProps) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn('ddga-dropdown-menu__item', 'ddga-dropdown-menu__item--sub', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-dropdown-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-dropdown-menu__label\">{children}</span>\n <ChevronRight className=\"ddga-dropdown-menu__sub-chevron\" aria-hidden=\"true\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\ntype DropdownMenuSubContentProps = React.ComponentProps<typeof DropdownMenuPrimitive.SubContent> &\n VariantProps<typeof dropdownMenuVariants>;\n\nfunction DropdownMenuSubContent({ size, className, ...props }: DropdownMenuSubContentProps) {\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DropdownMenuPrimitive.Portal container={portalContainer}>\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(dropdownMenuVariants({ size }), className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\n// ─── 8. Exports ─── //\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n dropdownMenuVariants,\n};\nexport type {\n DropdownMenuProps,\n DropdownMenuTriggerProps,\n DropdownMenuContentProps,\n DropdownMenuItemProps,\n DropdownMenuCheckboxItemProps,\n DropdownMenuRadioGroupProps,\n DropdownMenuRadioItemProps,\n DropdownMenuLabelProps,\n DropdownMenuSeparatorProps,\n DropdownMenuGroupProps,\n DropdownMenuSubProps,\n DropdownMenuSubTriggerProps,\n DropdownMenuSubContentProps,\n};\n","'use client';\n\nimport { useContext } from 'react';\nimport { Dialog as DialogPrimitive, Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { DgaContext } from '../../providers/DgaContext';\nimport { Close } from '../../internal/icons';\n\n// ─── 1. Variants ─── //\n//\n// Drawer reuses Radix Dialog under the hood (same focus trap + scroll lock +\n// ESC contract as Modal), but slides in from an edge instead of centering.\n// `side` uses logical names — `start`/`end` flip with `dir`, so the same\n// markup works for both LTR and RTL without the consumer doing anything.\n\nconst drawerVariants = cva('ddga-drawer', {\n variants: {\n side: {\n start: 'ddga-drawer--start',\n end: 'ddga-drawer--end',\n top: 'ddga-drawer--top',\n bottom: 'ddga-drawer--bottom',\n },\n size: {\n sm: 'ddga-drawer--sm',\n md: 'ddga-drawer--md',\n lg: 'ddga-drawer--lg',\n full: 'ddga-drawer--full',\n },\n },\n defaultVariants: {\n side: 'end',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ntype DrawerProps = React.ComponentProps<typeof DialogPrimitive.Root>;\ntype DrawerTriggerProps = React.ComponentProps<typeof DialogPrimitive.Trigger>;\ntype DrawerCloseProps = React.ComponentProps<typeof DialogPrimitive.Close>;\n\ninterface DrawerContentProps\n extends\n React.ComponentProps<typeof DialogPrimitive.Content>,\n VariantProps<typeof drawerVariants> {\n /** Show the corner X close button. Defaults to `true`. */\n showCloseButton?: boolean;\n /** Localized aria-label for the close button. Defaults to `\"Close\"`. */\n closeLabel?: string;\n}\n\ntype DrawerSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\ninterface DrawerTitleProps extends React.ComponentProps<typeof DialogPrimitive.Title> {\n asChild?: boolean;\n}\n\ninterface DrawerDescriptionProps extends React.ComponentProps<typeof DialogPrimitive.Description> {\n asChild?: boolean;\n}\n\n// ─── 3. Components ─── //\n\nfunction Drawer(props: DrawerProps) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction DrawerTrigger({ className, ...props }: DrawerTriggerProps) {\n return <DialogPrimitive.Trigger data-slot=\"drawer-trigger\" className={className} {...props} />;\n}\n\nfunction DrawerContent({\n side,\n size,\n showCloseButton = true,\n closeLabel = 'Close',\n className,\n children,\n ...props\n}: DrawerContentProps) {\n // Anchor the Portal to the DgaProvider's body-level portal container so\n // theming + dark mode inherit AND `position: fixed` stays anchored to the\n // viewport (any `transform` ancestor would otherwise reparent the\n // containing block and clip the drawer). Regression test mirrors\n // Select/Modal/DropdownMenu.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay className=\"ddga-drawer__overlay\" data-slot=\"drawer-overlay\" />\n <DialogPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(drawerVariants({ side, size }), className)}\n {...props}\n >\n {children}\n {showCloseButton ? (\n <DialogPrimitive.Close\n className=\"ddga-drawer__close\"\n aria-label={closeLabel}\n data-slot=\"drawer-close-x\"\n >\n <Close aria-hidden=\"true\" />\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n );\n}\n\nfunction DrawerHeader({ asChild, className, ...props }: DrawerSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"drawer-header\" className={cn('ddga-drawer__header', className)} {...props} />\n );\n}\n\nfunction DrawerTitle({ asChild, className, ...props }: DrawerTitleProps) {\n return (\n <DialogPrimitive.Title\n asChild={asChild}\n data-slot=\"drawer-title\"\n className={cn('ddga-drawer__title', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({ asChild, className, ...props }: DrawerDescriptionProps) {\n return (\n <DialogPrimitive.Description\n asChild={asChild}\n data-slot=\"drawer-description\"\n className={cn('ddga-drawer__description', className)}\n {...props}\n />\n );\n}\n\nfunction DrawerBody({ asChild, className, ...props }: DrawerSectionProps) {\n // Scrollable middle region — keeps Header/Footer pinned while the body\n // overflows. Separate from Header/Footer so consumers can opt in.\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return <Comp data-slot=\"drawer-body\" className={cn('ddga-drawer__body', className)} {...props} />;\n}\n\nfunction DrawerFooter({ asChild, className, ...props }: DrawerSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"drawer-footer\" className={cn('ddga-drawer__footer', className)} {...props} />\n );\n}\n\nfunction DrawerClose({ className, ...props }: DrawerCloseProps) {\n return <DialogPrimitive.Close data-slot=\"drawer-close\" className={className} {...props} />;\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerContent,\n DrawerHeader,\n DrawerTitle,\n DrawerDescription,\n DrawerBody,\n DrawerFooter,\n DrawerClose,\n drawerVariants,\n};\nexport type {\n DrawerProps,\n DrawerTriggerProps,\n DrawerContentProps,\n DrawerSectionProps,\n DrawerTitleProps,\n DrawerDescriptionProps,\n DrawerCloseProps,\n};\n","'use client';\n\nimport {\n Children,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useId,\n useMemo,\n useState,\n type ReactNode,\n} from 'react';\nimport { Command } from 'cmdk';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronDown } from '../../internal/icons';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Trigger height matches Input/Select so a Combobox lines up in a form row.\nconst comboboxTriggerVariants = cva('ddga-combobox-trigger', {\n variants: {\n size: {\n sm: 'ddga-combobox-trigger--sm',\n md: 'ddga-combobox-trigger--md',\n },\n error: {\n true: 'ddga-combobox-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Keep a no-op `comboboxVariants` for parity with the project's barrel\n// convention (every component re-exports a *Variants from its barrel).\nconst comboboxVariants = comboboxTriggerVariants;\n\n// ─── 2. Context (bridges Root state to Items + label lookup) ─── //\n//\n// Items register `value → label` on mount so the trigger can render the\n// selected option's human-readable label without consumers having to thread\n// a separate `displayValue` function in the common case. Async-loaded\n// options can still override via `<Combobox getLabel={...}>` below.\n\ninterface ComboboxContextValue {\n value?: string;\n select: (value: string) => void;\n}\n\nconst ComboboxContext = createContext<ComboboxContextValue | null>(null);\n\nfunction useComboboxContext(component: string): ComboboxContextValue {\n const ctx = useContext(ComboboxContext);\n if (!ctx) {\n throw new Error(`<${component}> must be rendered inside <Combobox>.`);\n }\n return ctx;\n}\n\n// ─── 3. Types ─── //\n\ninterface ComboboxProps extends VariantProps<typeof comboboxTriggerVariants> {\n /** Currently selected option value (controlled). */\n value?: string;\n /** Initial value when uncontrolled. */\n defaultValue?: string;\n /** Fires whenever the selection changes (controlled or uncontrolled). */\n onValueChange?: (value: string) => void;\n /** Controlled popover open state. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Visible label above the trigger. */\n label?: ReactNode;\n /** Hint shown below the trigger when there's no error. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid — sets `aria-invalid` and the error border. */\n error?: boolean;\n /** Marks the field required — adds the asterisk + `aria-required`. */\n required?: boolean;\n /** Disables the trigger entirely. */\n disabled?: boolean;\n /** Placeholder shown in the trigger when no value is selected. */\n placeholder?: ReactNode;\n /** Placeholder for the search input inside the panel. Defaults to `\"Search…\"`. */\n searchPlaceholder?: string;\n /** Shown when no item matches the search query. Defaults to `\"No results.\"`. */\n emptyMessage?: ReactNode;\n /**\n * Override the trigger label resolver — useful when items are loaded async\n * after the value is set, or when the trigger should show a richer label\n * than the item's rendered children. Receives the current value, returns\n * the node to display. Falls back to the registered item's label.\n */\n getLabel?: (value: string) => ReactNode;\n /** Caller-supplied id for the trigger; falls back to a generated one. */\n id?: string;\n /** Forwarded to the trigger (the focusable button). */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /** `<ComboboxItem>` (+ optional Group / Separator) children. */\n children: ReactNode;\n}\n\ninterface ComboboxItemProps extends Omit<\n React.ComponentProps<typeof Command.Item>,\n 'value' | 'onSelect'\n> {\n /** Stable value for filtering + selection. */\n value: string;\n /** Extra search terms cmdk should match against the input. */\n keywords?: string[];\n /** Disable this item from selection. */\n disabled?: boolean;\n /** Optional select handler — fires alongside the root's `onValueChange`. */\n onSelect?: (value: string) => void;\n}\n\ninterface ComboboxGroupProps extends React.ComponentProps<typeof Command.Group> {\n /** Group heading rendered above its items. */\n heading?: ReactNode;\n}\n\ntype ComboboxSeparatorProps = React.ComponentProps<typeof Command.Separator>;\n\n// ─── 4. Root ─── //\n\nfunction Combobox({\n value: controlledValue,\n defaultValue,\n onValueChange,\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n size,\n placeholder,\n searchPlaceholder = 'Search…',\n emptyMessage = 'No results.',\n getLabel,\n id: externalId,\n className,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n}: ComboboxProps) {\n // Uncontrolled fallbacks.\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue);\n const isControlled = controlledValue !== undefined;\n const value = isControlled ? controlledValue : internalValue;\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n const isOpenControlled = controlledOpen !== undefined;\n const open = isOpenControlled ? controlledOpen : internalOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isOpenControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isOpenControlled, onOpenChange],\n );\n\n const select = useCallback(\n (next: string) => {\n if (!isControlled) setInternalValue(next);\n onValueChange?.(next);\n setOpen(false);\n },\n [isControlled, onValueChange, setOpen],\n );\n\n const ctx = useMemo<ComboboxContextValue>(() => ({ value, select }), [value, select]);\n\n // Walk `children` once to build a value → label map. Synchronous so the\n // trigger shows the right label on first render — registration via\n // useEffect would only fire when items mount, and items don't mount until\n // the popover opens (Radix Portal lazy-mounts). Recurses through\n // `ComboboxGroup` so grouped items still resolve. Bare children only —\n // doesn't dive into arbitrary nested DOM.\n const itemLabels = useMemo<Map<string, ReactNode>>(() => {\n const map = new Map<string, ReactNode>();\n const visit = (nodes: ReactNode): void => {\n Children.forEach(nodes, (child) => {\n if (!isValidElement(child)) return;\n const childProps = child.props as { value?: unknown; children?: ReactNode };\n if (typeof childProps.value === 'string') {\n map.set(childProps.value, childProps.children);\n } else if (childProps.children) {\n visit(childProps.children);\n }\n });\n };\n visit(children);\n return map;\n }, [children]);\n\n // Field a11y wiring — same primitive as Select.\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Combobox',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n });\n\n // Portal anchored to DgaProvider root (mirrors Select/Modal/DropdownMenu).\n const providerCtx = useContext(DgaContext);\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = providerCtx?.portalEl ?? providerCtx?.rootEl ?? undefined;\n\n // Trigger label — explicit override wins; otherwise look up from the\n // children-derived map; otherwise fall back to the placeholder.\n const triggerLabel = useMemo<ReactNode>(() => {\n if (value === undefined) return null;\n if (getLabel) return getLabel(value);\n return itemLabels.get(value) ?? null;\n }, [value, getLabel, itemLabels]);\n\n const searchId = useId();\n\n return (\n <ComboboxContext.Provider value={ctx}>\n <div data-slot=\"combobox-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-combobox__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-combobox__required\">\n *\n </span>\n )}\n </label>\n )}\n <PopoverPrimitive.Root open={open} onOpenChange={setOpen}>\n <PopoverPrimitive.Trigger asChild>\n <button\n type=\"button\"\n {...controlProps}\n // Trigger stays a plain button — Radix Popover.Trigger sets\n // aria-haspopup + aria-expanded + aria-controls so AT users\n // hear \"Pick a fruit, button, has popup\". We declared role=\"combobox\"\n // earlier but it requires aria-controls pointing to the listbox,\n // which Radix wires for dialog semantics — axe flagged the mismatch.\n aria-required={required || undefined}\n disabled={disabled}\n data-slot=\"combobox-trigger\"\n className={cn(comboboxTriggerVariants({ size, error: hasError }), className)}\n >\n <span className=\"ddga-combobox__value\">\n {triggerLabel ?? <span className=\"ddga-combobox__placeholder\">{placeholder}</span>}\n </span>\n <ChevronDown aria-hidden=\"true\" className=\"ddga-combobox__icon\" />\n </button>\n </PopoverPrimitive.Trigger>\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n data-slot=\"combobox-content\"\n className=\"ddga-combobox-content\"\n sideOffset={4}\n align=\"start\"\n // Popover.Content is role=\"dialog\" → axe requires an accessible\n // name. Use the field label when it's a string; otherwise fall\n // back to a generic \"Options\" so a11y stays valid even when the\n // consumer composes a rich React node as the label.\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : 'Options')}\n aria-labelledby={ariaLabelledBy}\n // Match trigger width so the panel doesn't visually float over.\n style={{ inlineSize: 'var(--radix-popover-trigger-width)' }}\n onOpenAutoFocus={(event) => {\n // cmdk handles its own focus management (Input gets focused on\n // mount via autoFocus below). Prevent Radix from also moving\n // focus or we lose the search input as the auto-focus target.\n event.preventDefault();\n }}\n >\n <Command\n id={searchId}\n data-slot=\"combobox-command\"\n className=\"ddga-combobox-command\"\n // cmdk's default filter matches if the input is a substring of\n // the item value OR any keyword — fine for our v1 use case.\n >\n <Command.Input\n autoFocus\n placeholder={searchPlaceholder}\n data-slot=\"combobox-input\"\n className=\"ddga-combobox-input\"\n />\n <Command.List data-slot=\"combobox-list\" className=\"ddga-combobox-list\">\n <Command.Empty data-slot=\"combobox-empty\" className=\"ddga-combobox-empty\">\n {emptyMessage}\n </Command.Empty>\n {children}\n </Command.List>\n </Command>\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n </PopoverPrimitive.Root>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n </ComboboxContext.Provider>\n );\n}\n\n// ─── 5. Item ─── //\n\nfunction ComboboxItem({\n value,\n keywords,\n disabled,\n onSelect,\n className,\n children,\n ...props\n}: ComboboxItemProps) {\n const { value: selectedValue, select } = useComboboxContext('ComboboxItem');\n\n const isSelected = selectedValue === value;\n\n return (\n <Command.Item\n value={value}\n keywords={keywords}\n disabled={disabled}\n onSelect={(v) => {\n onSelect?.(v);\n select(v);\n }}\n data-slot=\"combobox-item\"\n // cmdk owns `data-selected` for keyboard highlight — use a separate\n // attribute for the chosen value so the two don't collide.\n data-active={isSelected ? '' : undefined}\n className={cn('ddga-combobox-item', className)}\n {...props}\n >\n <span className=\"ddga-combobox-item__check\" aria-hidden=\"true\">\n {isSelected ? <Check /> : null}\n </span>\n <span className=\"ddga-combobox-item__label\">{children}</span>\n </Command.Item>\n );\n}\n\n// ─── 6. Group + Separator (cmdk passthroughs) ─── //\n\nfunction ComboboxGroup({ className, heading, ...props }: ComboboxGroupProps) {\n return (\n <Command.Group\n heading={heading}\n data-slot=\"combobox-group\"\n className={cn('ddga-combobox-group', className)}\n {...props}\n />\n );\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps) {\n return (\n <Command.Separator\n data-slot=\"combobox-separator\"\n className={cn('ddga-combobox-separator', className)}\n {...props}\n />\n );\n}\n\n// ─── 7. Exports ─── //\n\nexport {\n Combobox,\n ComboboxItem,\n ComboboxGroup,\n ComboboxSeparator,\n comboboxTriggerVariants,\n comboboxVariants,\n};\nexport type { ComboboxProps, ComboboxItemProps, ComboboxGroupProps, ComboboxSeparatorProps };\n","'use client';\n\nimport { useCallback, useContext, useMemo, useState, type ReactNode } from 'react';\nimport {\n Button as AriaButton,\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarStateContext as AriaCalendarStateContext,\n DateInput as AriaDateInput,\n DatePicker as AriaDatePicker,\n DateSegment as AriaDateSegment,\n Dialog as AriaDialog,\n FieldError as AriaFieldError,\n Group as AriaGroup,\n I18nProvider,\n Label as AriaLabel,\n Popover as AriaPopover,\n Text as AriaText,\n} from 'react-aria-components';\nimport {\n CalendarDate,\n GregorianCalendar,\n IslamicUmalquraCalendar,\n toCalendar,\n type DateValue,\n} from '@internationalized/date';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { CalendarIcon, ChevronLeft, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Applied to the Group (the trigger row). Heights match Input/Select sm/md so\n// a DatePicker lines up with other fields in a form row.\nconst datePickerTriggerVariants = cva('ddga-date-picker-trigger', {\n variants: {\n size: {\n sm: 'ddga-date-picker-trigger--sm',\n md: 'ddga-date-picker-trigger--md',\n },\n error: {\n true: 'ddga-date-picker-trigger--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Passthrough alias so the barrel `*Variants` convention holds across\n// components. Same value, different name.\nconst datePickerVariants = datePickerTriggerVariants;\n\n// ─── 2. Date ↔ CalendarDate (Gregorian) normalization ─── //\n\n// Public API is `Date | null` so consumers don't take a dep on\n// `@internationalized/date`. Internally we round-trip through a Gregorian\n// `CalendarDate` so the Hijri toggle is purely a *display* concern — the\n// stored value is always the same absolute day, regardless of which calendar\n// the user was looking at when they picked it.\n\nfunction dateToCalendarDate(date: Date | null | undefined): CalendarDate | null {\n if (!date) return null;\n // Extract LOCAL Y/M/D, not UTC. The contract is date-only; converting\n // through UTC would shift the day across timezone boundaries.\n return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());\n}\n\nfunction calendarDateToDate(value: DateValue | null | undefined): Date | null {\n if (!value) return null;\n // Defensive: if a future feature ever passes a non-Gregorian CalendarDate\n // as value, convert. Today the contract is Gregorian-only.\n const greg =\n value.calendar.identifier === 'gregory' ? value : toCalendar(value, new GregorianCalendar());\n return new Date(greg.year, greg.month - 1, greg.day);\n}\n\n// ─── 3. Locale composition (DGA locale + optional calendar override) ─── //\n\ntype CalendarSystem = 'gregorian' | 'hijri';\n\nfunction composeLocale(dgaLocale: string, calendar: CalendarSystem): string {\n // Promote a bare 'ar'/'en' from DgaProvider to a regional tag so react-aria\n // picks the right defaults (week start, weekday names). 'ar-SA' matches the\n // DGA target audience; 'en-US' is the conventional English default.\n const base = dgaLocale === 'ar' ? 'ar-SA' : dgaLocale === 'en' ? 'en-US' : dgaLocale;\n // DGA convention: Latin digits (0–9) at all times, regardless of calendar\n // or UI language. Without this, `ar-*` locales default to Arabic-Indic\n // numerals (٠–٩) on segments + calendar cells, which makes month/year\n // dropdowns and cross-calendar comparisons harder to read. The Unicode\n // `-u-` extension carries both calendar and numbering-system keys when\n // both apply, separated by single `-`.\n const isArabic = base.startsWith('ar');\n if (calendar === 'hijri') {\n return isArabic ? `${base}-u-ca-islamic-umalqura-nu-latn` : `${base}-u-ca-islamic-umalqura`;\n }\n return isArabic ? `${base}-u-nu-latn` : base;\n}\n\n// ─── 4. Types ─── //\n\ninterface CalendarLabels {\n gregorian: string;\n hijri: string;\n}\n\ninterface DatePickerProps extends VariantProps<typeof datePickerTriggerVariants> {\n /** Currently selected date (controlled). Local Y/M/D. */\n value?: Date | null;\n /** Initial value when uncontrolled. */\n defaultValue?: Date | null;\n /** Fires whenever the user picks a day. `null` when cleared. */\n onChange?: (value: Date | null) => void;\n /** Earliest pickable date (inclusive). */\n minValue?: Date;\n /** Latest pickable date (inclusive). */\n maxValue?: Date;\n /** Visible label above the trigger. */\n label?: ReactNode;\n /** Hint shown below the trigger. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the trigger when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid — sets `aria-invalid` and error styling. */\n error?: boolean;\n /** Marks the field required — adds the asterisk + `aria-required`. */\n required?: boolean;\n /** Disables the trigger entirely. */\n disabled?: boolean;\n /** Caller-supplied id for the field. */\n id?: string;\n /** Forwarded to the Group (the trigger row), matching Input/Select. */\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n /**\n * Calendar system (controlled). Omit to let the user toggle freely with\n * the in-popover switch.\n */\n calendar?: CalendarSystem;\n /** Initial calendar system when uncontrolled. Defaults to `'gregorian'`. */\n defaultCalendar?: CalendarSystem;\n /** Fires whenever the calendar system toggles. */\n onCalendarChange?: (calendar: CalendarSystem) => void;\n /**\n * Show the Gregorian↔Hijri toggle inside the popover. Defaults to `true`,\n * but is forced off when `calendar` is controlled — a toggle that ignores\n * its click is a worse footgun than no toggle.\n */\n showCalendarToggle?: boolean;\n /** Override the toggle labels. Defaults are locale-aware (English / Arabic). */\n calendarLabels?: CalendarLabels;\n /**\n * When `true`, each day cell also shows the *other* calendar's day number\n * as small secondary text (e.g., Hijri active → Gregorian day shown small\n * underneath). Helps users cross-reference dates between calendar systems\n * without round-tripping the toggle. Defaults to `false`.\n */\n showSecondaryCalendar?: boolean;\n}\n\n// ─── 4b. Secondary-calendar helpers ─── //\n\n// Lazily-instantiated calendar objects — react-aria's calendar instances are\n// stateless and cheap to keep around at module scope.\nconst GREGORIAN = new GregorianCalendar();\nconst ISLAMIC_UMALQURA = new IslamicUmalquraCalendar();\n\nfunction secondaryDayNumber(date: DateValue, mainCalendar: CalendarSystem): number {\n const other = mainCalendar === 'hijri' ? GREGORIAN : ISLAMIC_UMALQURA;\n return toCalendar(date, other).day;\n}\n\n// ─── 4c. Calendar nav header (month + year dropdowns) ─── //\n\n// Sub-component rendered inside <Calendar> so it can consume\n// `CalendarStateContext`. The Calendar state owns `focusedDate` (which month\n// is visible) and `setFocusedDate` — by hooking into it directly we avoid\n// duplicating state in the outer DatePicker, and the dropdowns stay in sync\n// with the prev/next buttons and keyboard navigation automatically.\nfunction CalendarNavHeader({ locale, monthLabel, yearLabel }: CalendarNavHeaderProps) {\n const state = useContext(AriaCalendarStateContext);\n\n // Pull state fields with safe fallbacks so the hook calls below stay\n // unconditional (rules-of-hooks). Rendering still bails when state is\n // null — `<CalendarNavHeader>` is meant to live inside `<Calendar>`.\n const focusedDate = state?.focusedDate ?? null;\n const focusedYear = focusedDate?.year ?? 0;\n const focusedCalendar = focusedDate?.calendar ?? GREGORIAN;\n const minValue = state?.minValue ?? null;\n const maxValue = state?.maxValue ?? null;\n\n // Localized month names in the active calendar. Hijri month 1 (\"Muharram\")\n // through 12 (\"Dhu al-Hijjah\") translate correctly because the locale\n // string carries `-u-ca-islamic-umalqura`; for Gregorian it's plain\n // January–December (or يناير–ديسمبر under Arabic).\n const monthNames = useMemo(() => {\n if (!focusedDate) return [];\n const fmt = new Intl.DateTimeFormat(locale, { month: 'long' });\n return Array.from({ length: 12 }, (_, i) => {\n // Build a date in the same calendar as focusedDate, month i+1, day 1.\n // Day 1 is always valid; year stays the focused year so month names in\n // calendars whose names vary by year (rare, but possible) stay\n // accurate.\n const cd = new CalendarDate(focusedCalendar, focusedYear, i + 1, 1);\n // Intl.DateTimeFormat needs a JS Date; convert via Gregorian.\n const greg = toCalendar(cd, GREGORIAN);\n const js = new Date(greg.year, greg.month - 1, greg.day);\n return fmt.format(js);\n });\n }, [locale, focusedDate, focusedCalendar, focusedYear]);\n\n // Year range. minValue / maxValue from CalendarState are in whatever\n // calendar the consumer passed (Gregorian in our case); convert to the\n // focused calendar's year. Defaults span 100 years back to 30 forward —\n // covers birth-year picking plus near-future scheduling without being\n // overwhelming. Consumers needing wider ranges should set min/maxValue.\n const yearOptions = useMemo(() => {\n if (!focusedDate) return [];\n const minY = minValue ? toCalendar(minValue, focusedCalendar).year : focusedYear - 100;\n const maxY = maxValue ? toCalendar(maxValue, focusedCalendar).year : focusedYear + 30;\n // Ensure the currently focused year is always present (e.g., if the\n // consumer sets a tight min/max but focusedDate somehow lands outside).\n const start = Math.min(minY, focusedYear);\n const end = Math.max(maxY, focusedYear);\n return Array.from({ length: end - start + 1 }, (_, i) => start + i);\n }, [focusedDate, focusedCalendar, focusedYear, minValue, maxValue]);\n\n if (!state || !focusedDate) return null;\n\n return (\n <div className=\"ddga-date-picker-calendar__nav-selects\" data-slot=\"date-picker-calendar-nav\">\n <select\n aria-label={monthLabel}\n className=\"ddga-date-picker-calendar__select ddga-date-picker-calendar__month-select\"\n data-slot=\"date-picker-month-select\"\n value={focusedDate.month}\n onChange={(e) => state.setFocusedDate(focusedDate.set({ month: Number(e.target.value) }))}\n >\n {monthNames.map((name, i) => (\n <option key={i + 1} value={i + 1}>\n {name}\n </option>\n ))}\n </select>\n <select\n aria-label={yearLabel}\n className=\"ddga-date-picker-calendar__select ddga-date-picker-calendar__year-select\"\n data-slot=\"date-picker-year-select\"\n value={focusedDate.year}\n onChange={(e) => state.setFocusedDate(focusedDate.set({ year: Number(e.target.value) }))}\n >\n {yearOptions.map((y) => (\n <option key={y} value={y}>\n {y}\n </option>\n ))}\n </select>\n </div>\n );\n}\n\ninterface CalendarNavHeaderProps {\n locale: string;\n monthLabel: string;\n yearLabel: string;\n}\n\n// ─── 4d. Outside-month cell wrapper ─── //\n\n// react-aria marks outside-month cells as disabled by design — the standard\n// Calendar UX uses arrows / dropdowns / keyboard for cross-month navigation.\n// But many DGA flows want one-click selection of an adjacent month's day, so\n// we render a parallel <button> for those cells that bypasses the disabled\n// state, drives `setFocusedDate` + `selectDate` manually, and preserves the\n// rest of react-aria's a11y wiring for inside-month cells.\nfunction CalendarDayCell({ date, showSecondary, calendarSystem }: CalendarDayCellProps) {\n const state = useContext(AriaCalendarStateContext);\n\n // Visible range start tells us the \"current\" month being shown. Anything\n // with a different (year, month) pair is outside-month.\n const start = state?.visibleRange.start;\n const isOutside = !!start && (date.year !== start.year || date.month !== start.month);\n\n // For outside-month cells, also confirm they're inside min/max bounds —\n // otherwise they should genuinely render disabled. `state.isInvalid` is\n // bounds-only (min/max); `isCellDisabled` also marks outside-month as\n // disabled internally, which would block our wrapper from activating.\n const isOutOfBounds = state ? state.isInvalid(date) : false;\n\n if (state && isOutside && !isOutOfBounds) {\n const selected = state.value;\n const isSelected =\n !!selected &&\n selected.year === date.year &&\n selected.month === date.month &&\n selected.day === date.day;\n\n const handleSelect = () => {\n // Update focused-month first so the visible page jumps, then commit the\n // selection. React batches these into one re-render — the popover\n // closes via `shouldCloseOnSelect`, and the next time the user opens\n // it, the now-selected month is on screen.\n state.setFocusedDate(date);\n state.selectDate(date);\n };\n\n return (\n <td role=\"gridcell\">\n <button\n type=\"button\"\n // Outside the keyboard nav chain (react-aria's inside-month cells\n // own that). Mouse users get the shortcut; keyboard users still\n // navigate via arrows or the month/year dropdowns.\n tabIndex={-1}\n className=\"ddga-date-picker-calendar__cell\"\n data-outside-month=\"\"\n data-selected={isSelected ? '' : undefined}\n data-slot=\"date-picker-day-cell\"\n onClick={handleSelect}\n >\n {showSecondary ? (\n <>\n <span className=\"ddga-date-picker-calendar__cell-primary\">{date.day}</span>\n <span aria-hidden=\"true\" className=\"ddga-date-picker-calendar__cell-secondary\">\n {secondaryDayNumber(date, calendarSystem)}\n </span>\n </>\n ) : (\n String(date.day)\n )}\n </button>\n </td>\n );\n }\n\n return (\n <AriaCalendarCell date={date} className=\"ddga-date-picker-calendar__cell\">\n {({ formattedDate }) =>\n showSecondary ? (\n <>\n <span className=\"ddga-date-picker-calendar__cell-primary\">{formattedDate}</span>\n <span aria-hidden=\"true\" className=\"ddga-date-picker-calendar__cell-secondary\">\n {secondaryDayNumber(date, calendarSystem)}\n </span>\n </>\n ) : (\n formattedDate\n )\n }\n </AriaCalendarCell>\n );\n}\n\ninterface CalendarDayCellProps {\n date: CalendarDate;\n showSecondary: boolean;\n calendarSystem: CalendarSystem;\n}\n\n// ─── 5. Component ─── //\n\nfunction DatePicker({\n value: controlledValue,\n defaultValue,\n onChange,\n minValue,\n maxValue,\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n size,\n id,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n calendar: controlledCalendar,\n defaultCalendar = 'gregorian',\n onCalendarChange,\n showCalendarToggle = true,\n calendarLabels,\n showSecondaryCalendar = false,\n}: DatePickerProps) {\n // ─ value: controlled or uncontrolled, always Gregorian internally ─\n const isValueControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState<CalendarDate | null>(() =>\n dateToCalendarDate(defaultValue),\n );\n const value = isValueControlled ? dateToCalendarDate(controlledValue) : internalValue;\n\n const handleAriaChange = useCallback(\n (next: DateValue | null) => {\n const nextCD = next ? new CalendarDate(next.year, next.month, next.day) : null;\n if (!isValueControlled) setInternalValue(nextCD);\n onChange?.(calendarDateToDate(nextCD));\n },\n [isValueControlled, onChange],\n );\n\n // ─ calendar system: controlled or uncontrolled ─\n const isCalendarControlled = controlledCalendar !== undefined;\n const [internalCalendar, setInternalCalendar] = useState<CalendarSystem>(defaultCalendar);\n const calendarSystem = isCalendarControlled ? controlledCalendar : internalCalendar;\n\n const setCalendar = useCallback(\n (next: CalendarSystem) => {\n if (!isCalendarControlled) setInternalCalendar(next);\n onCalendarChange?.(next);\n },\n [isCalendarControlled, onCalendarChange],\n );\n\n // ─ Locale composition ─\n const dgaCtx = useContext(DgaContext);\n const dgaLocale = dgaCtx?.locale ?? 'en';\n const ariaLocale = useMemo(\n () => composeLocale(dgaLocale, calendarSystem),\n [dgaLocale, calendarSystem],\n );\n\n // ─ Portal container (theming + dark-mode inheritance) ─\n // react-aria's Popover renders to a portal under <body> by default — same\n // problem Radix has. UNSTABLE_portalContainer (typed as Element) lets us\n // re-anchor under DgaProvider's root so data-theme, theme vars, and\n // .ddga-theme-* classes inherit into the calendar dropdown. Falls back to\n // <body> when used standalone (no provider).\n // Body-mounted portal target (see DgaProvider) — escapes ancestor\n // clipping while keeping theme inheritance via mirrored data-theme/vars.\n const portalContainer = (dgaCtx?.portalEl ?? dgaCtx?.rootEl ?? undefined) as Element | undefined;\n\n // ─ Prev/next nav icons — swap by direction ─\n // In RTL, \"previous\" sits visually on the right and should point right;\n // \"next\" sits on the left and points left. Swapping the icon components\n // (rather than CSS-flipping via [dir='rtl']) is more robust because it\n // doesn't depend on the portal inheriting the dir attribute correctly.\n const dgaDir = dgaCtx?.dir ?? 'ltr';\n const PrevChevron = dgaDir === 'rtl' ? ChevronRight : ChevronLeft;\n const NextChevron = dgaDir === 'rtl' ? ChevronLeft : ChevronRight;\n\n // ─ Toggle labels: locale-aware default ─\n const resolvedLabels = useMemo<CalendarLabels>(() => {\n if (calendarLabels) return calendarLabels;\n const isArabic = dgaLocale.startsWith('ar');\n return isArabic\n ? { gregorian: 'ميلادي', hijri: 'هجري' }\n : { gregorian: 'Gregorian', hijri: 'Hijri' };\n }, [calendarLabels, dgaLocale]);\n\n // ─ Calendar nav labels (aria-labels for the month/year selects) ─\n const navLabels = useMemo(\n () =>\n dgaLocale.startsWith('ar')\n ? { month: 'الشهر', year: 'السنة' }\n : { month: 'Month', year: 'Year' },\n [dgaLocale],\n );\n\n // ─ Bounds ─\n const ariaMinValue = useMemo(() => dateToCalendarDate(minValue) ?? undefined, [minValue]);\n const ariaMaxValue = useMemo(() => dateToCalendarDate(maxValue) ?? undefined, [maxValue]);\n\n // ─ Popover aria-label fallback ─\n // Dialog requires an accessible name; derive from the field label when\n // possible (string-only), else fall back to a generic so a11y stays valid\n // even when consumers compose a rich label node.\n const dialogAriaLabel =\n ariaLabel ?? (typeof label === 'string' ? label : ariaLabelledBy ? undefined : 'Date');\n\n // ─ Toggle visibility ─\n const showToggle = showCalendarToggle && !isCalendarControlled;\n\n // ─ Derived field-message visibility (mirrors useFieldA11y rules) ─\n const hasError = !!error;\n const hasErrorMessage = hasError && errorMessage != null && errorMessage !== '';\n const hasHelper = !hasErrorMessage && helperText != null && helperText !== '';\n\n return (\n <I18nProvider locale={ariaLocale}>\n <AriaDatePicker\n value={value}\n onChange={handleAriaChange}\n minValue={ariaMinValue}\n maxValue={ariaMaxValue}\n isRequired={required}\n isDisabled={disabled}\n isInvalid={hasError}\n shouldCloseOnSelect\n id={id}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className=\"ddga-field\"\n data-slot=\"date-picker-field\"\n >\n {label && (\n <AriaLabel className=\"ddga-date-picker__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-date-picker__required\">\n *\n </span>\n )}\n </AriaLabel>\n )}\n <AriaGroup\n data-slot=\"date-picker-trigger\"\n className={cn(datePickerTriggerVariants({ size, error: hasError }), className)}\n >\n <AriaDateInput className=\"ddga-date-picker__input\" data-slot=\"date-picker-input\">\n {(segment) => (\n <AriaDateSegment\n segment={segment}\n className=\"ddga-date-picker__segment\"\n data-slot=\"date-picker-segment\"\n />\n )}\n </AriaDateInput>\n <AriaButton\n className=\"ddga-date-picker__icon-button\"\n aria-label=\"Open calendar\"\n data-slot=\"date-picker-trigger-button\"\n >\n <CalendarIcon aria-hidden=\"true\" className=\"ddga-date-picker__icon\" />\n </AriaButton>\n </AriaGroup>\n {hasHelper && (\n <AriaText\n slot=\"description\"\n className=\"ddga-field__message ddga-field__message--helper\"\n data-slot=\"field-helper\"\n >\n {helperText}\n </AriaText>\n )}\n {hasErrorMessage && (\n <AriaFieldError\n className=\"ddga-field__message ddga-field__message--error\"\n data-slot=\"field-error\"\n >\n {errorMessage}\n </AriaFieldError>\n )}\n <AriaPopover\n UNSTABLE_portalContainer={portalContainer}\n className=\"ddga-date-picker-popover\"\n data-slot=\"date-picker-popover\"\n offset={6}\n // Keep some breathing room from the viewport edge so the popover\n // doesn't butt up against the bottom of the iframe in short\n // containers (the Storybook canvas case). Combined with the inner\n // Dialog's overflow:auto, the calendar will scroll if it can't fit.\n containerPadding={12}\n >\n <AriaDialog\n className=\"ddga-date-picker-dialog\"\n data-slot=\"date-picker-dialog\"\n aria-label={dialogAriaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {showToggle && (\n <div\n role=\"tablist\"\n aria-label=\"Calendar system\"\n className=\"ddga-date-picker-toggle\"\n data-slot=\"date-picker-toggle\"\n >\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={calendarSystem === 'gregorian'}\n className=\"ddga-date-picker-toggle__button\"\n data-active={calendarSystem === 'gregorian' ? '' : undefined}\n onClick={() => setCalendar('gregorian')}\n >\n {resolvedLabels.gregorian}\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n aria-selected={calendarSystem === 'hijri'}\n className=\"ddga-date-picker-toggle__button\"\n data-active={calendarSystem === 'hijri' ? '' : undefined}\n onClick={() => setCalendar('hijri')}\n >\n {resolvedLabels.hijri}\n </button>\n </div>\n )}\n <AriaCalendar className=\"ddga-date-picker-calendar\" data-slot=\"date-picker-calendar\">\n <header className=\"ddga-date-picker-calendar__header\">\n <AriaButton\n slot=\"previous\"\n className=\"ddga-date-picker-calendar__nav\"\n data-slot=\"date-picker-calendar-prev\"\n >\n <PrevChevron aria-hidden=\"true\" />\n </AriaButton>\n <CalendarNavHeader\n locale={ariaLocale}\n monthLabel={navLabels.month}\n yearLabel={navLabels.year}\n />\n <AriaButton\n slot=\"next\"\n className=\"ddga-date-picker-calendar__nav\"\n data-slot=\"date-picker-calendar-next\"\n >\n <NextChevron aria-hidden=\"true\" />\n </AriaButton>\n </header>\n <AriaCalendarGrid className=\"ddga-date-picker-calendar__grid\">\n <AriaCalendarGridHeader>\n {(day) => (\n <AriaCalendarHeaderCell className=\"ddga-date-picker-calendar__weekday\">\n {day}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <CalendarDayCell\n date={date}\n showSecondary={showSecondaryCalendar}\n calendarSystem={calendarSystem}\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n </AriaCalendar>\n </AriaDialog>\n </AriaPopover>\n </AriaDatePicker>\n </I18nProvider>\n );\n}\n\n// ─── 6. Exports ─── //\n\nexport { DatePicker, datePickerTriggerVariants, datePickerVariants };\nexport type { DatePickerProps, CalendarSystem, CalendarLabels };\n","'use client';\n\nimport { useRef, useState, type ReactNode } from 'react';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Button } from '../Button';\nimport { Progress } from '../Progress';\nimport { Upload, Check, AlertCircle, Close } from '../../internal/icons';\n\n// ─── 1. Types ─── //\n\ntype FileStatus = 'pending' | 'uploading' | 'success' | 'error';\n\n/** Reason codes attached to a rejected file. */\ntype RejectionCode = 'file-too-large' | 'file-invalid-type' | 'too-many-files';\n\n/**\n * A controlled file entry. The consumer owns this array and is responsible for\n * performing the actual upload, updating `status`/`progress`, and assigning a\n * stable `id` (used as the React key and the `onRemove` target).\n */\ninterface UploadFile {\n /** Stable, consumer-assigned id. Used as the React key and remove target. */\n id: string;\n /** The native File. */\n file: File;\n /** Defaults to `'pending'`. Drives the per-row affordance. */\n status?: FileStatus;\n /** 0–100. Rendered as a {@link Progress} bar while `status === 'uploading'`. */\n progress?: number;\n /** Shown inline (red) while `status === 'error'`. */\n error?: string;\n}\n\ninterface FileRejection {\n file: File;\n errors: RejectionCode[];\n}\n\ninterface FileUploadProps {\n /** Controlled list of files to render. The consumer is the source of truth. */\n files: UploadFile[];\n /** Called with the files that passed validation. The consumer wraps each in\n * an {@link UploadFile} (assigning an `id`) and starts the upload. */\n onFilesAdded: (accepted: File[]) => void;\n /** Called with files that failed validation. Never enter `files`. */\n onFilesRejected?: (rejections: FileRejection[]) => void;\n /** Per-row remove handler. Omit to hide the remove button. */\n onRemove?: (id: string) => void;\n\n /** Native `accept` string (e.g. `'image/*,.pdf'`). Also drives validation. */\n accept?: string;\n /** Maximum size per file, in bytes. */\n maxSize?: number;\n /** Maximum total files (existing + incoming). When `multiple` is false this\n * is forced to 1. */\n maxFiles?: number;\n /** Allow selecting/dropping more than one file. Defaults to true. */\n multiple?: boolean;\n /** Disables the drop zone and the picker. */\n disabled?: boolean;\n /** Marks the field required: renders the asterisk and sets the input's\n * `required` attribute. */\n required?: boolean;\n\n /** Visible field label, auto-associated to the input. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Drop-zone instructional copy. Defaults to a bilingual-friendly EN string. */\n hint?: ReactNode;\n /** Accessible label for the per-row remove button. Defaults to `'Remove'`. */\n removeLabel?: string;\n\n id?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n// ─── 2. Validation helpers (local — no shared util until a 2nd use case) ─── //\n\nfunction matchesAccept(file: File, accept?: string): boolean {\n if (!accept) return true;\n const tokens = accept\n .split(',')\n .map((t) => t.trim().toLowerCase())\n .filter(Boolean);\n if (tokens.length === 0) return true;\n\n const name = file.name.toLowerCase();\n const type = file.type.toLowerCase();\n\n return tokens.some((token) => {\n if (token.startsWith('.')) return name.endsWith(token);\n if (token.endsWith('/*')) return type.startsWith(token.slice(0, token.indexOf('/') + 1));\n return type === token;\n });\n}\n\ninterface ValidationConfig {\n accept?: string;\n maxSize?: number;\n maxFiles?: number;\n /** Files already in the list — counts against `maxFiles`. */\n currentCount: number;\n}\n\nfunction splitFiles(incoming: File[], config: ValidationConfig) {\n const { accept, maxSize, maxFiles, currentCount } = config;\n const accepted: File[] = [];\n const rejections: FileRejection[] = [];\n\n for (const file of incoming) {\n const errors: RejectionCode[] = [];\n if (!matchesAccept(file, accept)) errors.push('file-invalid-type');\n if (maxSize != null && file.size > maxSize) errors.push('file-too-large');\n\n if (errors.length > 0) {\n rejections.push({ file, errors });\n continue;\n }\n // Count check last, and only for otherwise-valid files: a slot is consumed\n // only by a file that would actually be accepted.\n if (maxFiles != null && currentCount + accepted.length >= maxFiles) {\n rejections.push({ file, errors: ['too-many-files'] });\n continue;\n }\n accepted.push(file);\n }\n\n return { accepted, rejections };\n}\n\nconst UNITS = ['B', 'KB', 'MB', 'GB', 'TB'] as const;\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n const exponent = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), UNITS.length - 1);\n const value = bytes / 1024 ** exponent;\n // Whole numbers for bytes; one decimal for KB+.\n return `${exponent === 0 ? value : value.toFixed(1)} ${UNITS[exponent]}`;\n}\n\n// ─── 3. Component ─── //\n\nfunction FileUpload({\n files,\n onFilesAdded,\n onFilesRejected,\n onRemove,\n accept,\n maxSize,\n maxFiles,\n multiple = true,\n disabled = false,\n required,\n label,\n helperText,\n errorMessage,\n error,\n hint = 'Drag files here, or click to browse',\n removeLabel = 'Remove',\n id: externalId,\n className,\n ...props\n}: FileUploadProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [isDragging, setIsDragging] = useState(false);\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'FileUpload',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n // Single-select forces a hard cap of 1, regardless of maxFiles.\n const effectiveMaxFiles = multiple ? maxFiles : 1;\n\n function process(incoming: File[]) {\n if (disabled || incoming.length === 0) return;\n const { accepted, rejections } = splitFiles(incoming, {\n accept,\n maxSize,\n maxFiles: effectiveMaxFiles,\n currentCount: files.length,\n });\n if (accepted.length > 0) onFilesAdded(accepted);\n if (rejections.length > 0) onFilesRejected?.(rejections);\n }\n\n function handleInputChange(event: React.ChangeEvent<HTMLInputElement>) {\n process(Array.from(event.target.files ?? []));\n // Reset so selecting the same file again re-fires `change`.\n event.target.value = '';\n }\n\n function handleDrop(event: React.DragEvent<HTMLDivElement>) {\n event.preventDefault();\n setIsDragging(false);\n if (disabled) return;\n process(Array.from(event.dataTransfer.files));\n }\n\n function handleDragOver(event: React.DragEvent<HTMLDivElement>) {\n event.preventDefault();\n if (!disabled) setIsDragging(true);\n }\n\n function handleDragLeave(event: React.DragEvent<HTMLDivElement>) {\n // Ignore dragleave events bubbling up from descendants.\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setIsDragging(false);\n }\n }\n\n return (\n <div data-slot=\"file-upload-field\" className={cn('ddga-field', 'ddga-file-upload', className)}>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-file-upload__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-file-upload__required\">\n *\n </span>\n )}\n </label>\n )}\n\n {/* The drop zone is a click target that proxies to the hidden input.\n The input itself stays focusable (keyboard users tab to it and press\n Space/Enter to open the picker); drag-and-drop is a mouse-only\n enhancement layered on top. */}\n <div\n data-slot=\"file-upload-dropzone\"\n className={cn(\n 'ddga-file-upload__dropzone',\n hasError && 'ddga-file-upload__dropzone--error',\n )}\n data-dragging={isDragging || undefined}\n data-disabled={disabled || undefined}\n aria-disabled={disabled || undefined}\n onClick={() => {\n if (!disabled) inputRef.current?.click();\n }}\n onDragOver={handleDragOver}\n onDragLeave={handleDragLeave}\n onDrop={handleDrop}\n >\n <Upload className=\"ddga-file-upload__icon\" aria-hidden=\"true\" />\n <span className=\"ddga-file-upload__hint\">{hint}</span>\n <input\n {...controlProps}\n ref={inputRef}\n type=\"file\"\n className=\"ddga-file-upload__input\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n required={required}\n onChange={handleInputChange}\n // The dropzone's onClick calls inputRef.click(); without stopping\n // propagation, that programmatic click bubbles back to the dropzone\n // and re-triggers it — infinite recursion. Native label/keyboard\n // activation of the input is unaffected.\n onClick={(event) => event.stopPropagation()}\n data-slot=\"file-upload-input\"\n />\n </div>\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n\n {files.length > 0 && (\n <ul data-slot=\"file-upload-list\" className=\"ddga-file-upload__list\">\n {files.map((item) => {\n const status = item.status ?? 'pending';\n return (\n <li\n key={item.id}\n data-slot=\"file-upload-item\"\n data-status={status}\n className=\"ddga-file-upload__item\"\n >\n <span className=\"ddga-file-upload__item-icon\" aria-hidden=\"true\">\n {status === 'success' ? (\n <Check />\n ) : status === 'error' ? (\n <AlertCircle />\n ) : (\n <Upload />\n )}\n </span>\n\n <div className=\"ddga-file-upload__item-main\">\n <div className=\"ddga-file-upload__item-head\">\n <span className=\"ddga-file-upload__item-name\" title={item.file.name}>\n {item.file.name}\n </span>\n <span className=\"ddga-file-upload__item-meta\">\n {formatBytes(item.file.size)}\n </span>\n </div>\n\n {status === 'uploading' && (\n <Progress\n size=\"sm\"\n value={item.progress ?? 0}\n aria-label={`Uploading ${item.file.name}`}\n className=\"ddga-file-upload__item-progress\"\n />\n )}\n\n {status === 'error' && item.error && (\n <span role=\"alert\" className=\"ddga-file-upload__item-error\">\n {item.error}\n </span>\n )}\n </div>\n\n {onRemove && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={`${removeLabel}: ${item.file.name}`}\n onClick={() => onRemove(item.id)}\n className=\"ddga-file-upload__item-remove\"\n >\n <Close aria-hidden=\"true\" />\n </Button>\n )}\n </li>\n );\n })}\n </ul>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { FileUpload };\nexport type { FileUploadProps, UploadFile, FileRejection, FileStatus, RejectionCode };\n","'use client';\n\nimport { useId, type ReactNode } from 'react';\nimport { Slider as SliderPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// ─── 1. Variants (cva) ─── //\n\nconst sliderVariants = cva('ddga-slider', {\n variants: {\n size: {\n sm: 'ddga-slider--sm',\n md: 'ddga-slider--md',\n },\n error: {\n true: 'ddga-slider--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Radix owns the slider state model, but always as `number[]`. We expose a\n// cleaner API: a single `number` for one thumb, `number[]` for a range. The\n// emitted value mirrors the shape that was passed in.\ntype SliderValue = number | number[];\n\ninterface SliderProps\n extends\n Omit<\n React.ComponentProps<typeof SliderPrimitive.Root>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onValueCommit' | 'asChild'\n >,\n VariantProps<typeof sliderVariants> {\n /** Controlled value. `number` → single thumb, `number[]` → one thumb each. */\n value?: SliderValue;\n /** Uncontrolled initial value. Defaults to a single thumb at `min`. */\n defaultValue?: SliderValue;\n /** Fires continuously while dragging. Shape mirrors `value`/`defaultValue`. */\n onValueChange?: (value: SliderValue) => void;\n /** Fires once on release (pointer up / keyboard commit). */\n onValueCommit?: (value: SliderValue) => void;\n\n /** Visible field label, associated to the thumb(s) via `aria-labelledby`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Render the current value(s) as text beside the label. */\n showValue?: boolean;\n /** Formats each value for `showValue` and the thumb's `aria-valuetext`\n * (e.g. percentages or currency). */\n formatValue?: (value: number) => string;\n /** Accessible names for the two range thumbs. Ignored for single thumbs.\n * Defaults to `['Minimum', 'Maximum']`. */\n thumbLabels?: [string, string];\n}\n\n// ─── 3. Helpers ─── //\n\nconst DEFAULT_THUMB_LABELS: [string, string] = ['Minimum', 'Maximum'];\n\nfunction toArray(value: SliderValue | undefined): number[] | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value : [value];\n}\n\n// ─── 4. Component ─── //\n\nfunction Slider({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n onValueCommit,\n min = 0,\n max = 100,\n size,\n label,\n helperText,\n errorMessage,\n error,\n showValue = false,\n formatValue,\n thumbLabels = DEFAULT_THUMB_LABELS,\n className,\n ...props\n}: SliderProps) {\n const labelId = useId();\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Slider',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'] ?? (label ? labelId : undefined),\n });\n\n // Single vs range is determined by the controlled/uncontrolled shape the\n // consumer chose; fall back to single when neither is provided.\n const isRange = Array.isArray(value ?? defaultValue);\n\n const valueArray = toArray(value);\n const defaultArray = toArray(defaultValue) ?? [min];\n\n // Re-wrap Radix's `number[]` back into the consumer's shape.\n const wrap = (next: number[]): SliderValue => (isRange ? next : next[0]);\n\n // Each thumb needs an accessible name. A single thumb borrows the field\n // label; range thumbs get distinct min/max labels.\n const currentForRender = valueArray ?? defaultArray;\n const fmt = (n: number) => (formatValue ? formatValue(n) : String(n));\n\n return (\n <div data-slot=\"slider-field\" className=\"ddga-field\">\n {(label || showValue) && (\n <div className=\"ddga-slider__header\">\n {label && (\n <span id={labelId} className=\"ddga-slider__label\">\n {label}\n </span>\n )}\n {showValue && (\n <span className=\"ddga-slider__value\" aria-hidden=\"true\">\n {currentForRender.map(fmt).join(' – ')}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n // Spread props first, then the a11y/state contract so consumers\n // cannot clobber the wiring.\n {...props}\n id={fieldId}\n min={min}\n max={max}\n value={valueArray}\n defaultValue={value === undefined ? defaultArray : undefined}\n onValueChange={onValueChange ? (next) => onValueChange(wrap(next)) : undefined}\n onValueCommit={onValueCommit ? (next) => onValueCommit(wrap(next)) : undefined}\n aria-invalid={controlProps['aria-invalid']}\n data-slot=\"slider\"\n className={cn(sliderVariants({ size, error: hasError }), className)}\n >\n <SliderPrimitive.Track data-slot=\"slider-track\" className=\"ddga-slider__track\">\n <SliderPrimitive.Range data-slot=\"slider-range\" className=\"ddga-slider__range\" />\n </SliderPrimitive.Track>\n {currentForRender.map((thumbValue, index) => (\n <SliderPrimitive.Thumb\n key={index}\n data-slot=\"slider-thumb\"\n className=\"ddga-slider__thumb\"\n aria-label={isRange ? thumbLabels[index] : undefined}\n aria-labelledby={!isRange && label ? labelId : undefined}\n aria-valuetext={formatValue ? fmt(thumbValue) : undefined}\n aria-describedby={controlProps['aria-describedby']}\n />\n ))}\n </SliderPrimitive.Root>\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { Slider, sliderVariants };\nexport type { SliderProps, SliderValue };\n","'use client';\n\nimport { useState, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Plus, Minus } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the *control* (the bordered box housing the − button, the field,\n// and the + button), mirroring Input's structure.\nconst numberInputVariants = cva('ddga-number-input', {\n variants: {\n size: {\n sm: 'ddga-number-input--sm',\n md: 'ddga-number-input--md',\n lg: 'ddga-number-input--lg',\n },\n error: {\n true: 'ddga-number-input--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface NumberInputProps\n extends\n Omit<\n React.ComponentProps<'input'>,\n 'value' | 'defaultValue' | 'onChange' | 'size' | 'type' | 'min' | 'max' | 'step'\n >,\n VariantProps<typeof numberInputVariants> {\n /** Controlled value. `null` represents an empty field. */\n value?: number | null;\n /** Uncontrolled initial value. */\n defaultValue?: number | null;\n /** Fires with the parsed value, or `null` when the field is cleared. */\n onValueChange?: (value: number | null) => void;\n\n /** Lower bound. Clamped on blur and at the stepper buttons. */\n min?: number;\n /** Upper bound. Clamped on blur and at the stepper buttons. */\n max?: number;\n /** Stepper / ArrowUp-Down increment. Defaults to 1. */\n step?: number;\n\n /** Hide the − / + buttons (keyboard + typing only). */\n hideControls?: boolean;\n /** Accessible label for the decrement button. Defaults to `'Decrease'`. */\n decrementLabel?: string;\n /** Accessible label for the increment button. Defaults to `'Increase'`. */\n incrementLabel?: string;\n\n /** Visible field label, auto-associated to the input via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Helpers ─── //\n\nfunction clamp(value: number, min: number | undefined, max: number | undefined): number {\n let next = value;\n if (min != null) next = Math.max(min, next);\n if (max != null) next = Math.min(max, next);\n return next;\n}\n\n// `String(n)` switches to exponential notation for very small/large magnitudes\n// (e.g. `String(2e-7)` → \"2e-7\"), which looks broken in a form field and\n// contradicts our input filter (which rejects \"e\"). Format to a plain decimal\n// instead. Note: values still round to float64 precision (~15–17 sig digits)\n// — arbitrary-precision input is out of scope.\nfunction formatNumber(value: number): string {\n if (!Number.isFinite(value)) return '';\n return value.toLocaleString('en-US', { useGrouping: false, maximumFractionDigits: 20 });\n}\n\n// ─── 4. Component ─── //\n\nfunction NumberInput({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n min,\n max,\n step = 1,\n size,\n hideControls = false,\n decrementLabel = 'Decrease',\n incrementLabel = 'Increase',\n label,\n helperText,\n errorMessage,\n error,\n required,\n disabled,\n className,\n onBlur,\n onKeyDown,\n ...props\n}: NumberInputProps) {\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<number | null>(defaultValue ?? null);\n const numericValue = isControlled ? value : internal;\n\n // While focused we keep the raw text so partial input (\"-\", \"1.\") survives a\n // re-render; `null` means \"show the canonical numeric value\".\n const [draft, setDraft] = useState<string | null>(null);\n\n const allowDecimal = !Number.isInteger(step);\n const allowNegative = min == null || min < 0;\n const displayValue = draft ?? (numericValue == null ? '' : formatNumber(numericValue));\n\n // Accepts only valid (possibly partial) numeric input: an optional leading\n // minus (when negatives are in range), digits, and one decimal point (when\n // the step is fractional). Allows transient partials like \"\", \"-\", \"1.\".\n const allowedPattern = new RegExp(\n `^${allowNegative ? '-?' : ''}\\\\d*${allowDecimal ? '(\\\\.\\\\d*)?' : ''}$`,\n );\n\n function commit(next: number | null) {\n if (!isControlled) setInternal(next);\n onValueChange?.(next);\n }\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'NumberInput',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const raw = event.target.value;\n // Reject anything that isn't valid numeric input (letters, extra dots,\n // misplaced signs, pasted junk). Returning without a state update reverts\n // the controlled input to its prior value — the keystroke never lands.\n if (!allowedPattern.test(raw)) return;\n setDraft(raw);\n if (raw.trim() === '') {\n commit(null);\n return;\n }\n const parsed = Number(raw);\n // Emit only on a complete, finite number — partials (\"-\", \"1.\") keep the\n // draft but don't push a misleading value to the consumer.\n if (Number.isFinite(parsed)) commit(parsed);\n }\n\n function handleBlur(event: React.FocusEvent<HTMLInputElement>) {\n // Normalize: clamp to bounds, then resync the display to the canonical\n // number (drops trailing dots, leading zeros, etc.).\n if (numericValue != null) commit(clamp(numericValue, min, max));\n setDraft(null);\n onBlur?.(event);\n }\n\n function stepBy(direction: 1 | -1) {\n const base = numericValue ?? (direction > 0 ? (min ?? 0) : (max ?? 0));\n const next = clamp(base + direction * step, min, max);\n // Avoid floating-point dust from repeated decimal steps (0.1 + 0.2…).\n const rounded = allowDecimal ? Number(next.toFixed(10)) : next;\n commit(rounded);\n setDraft(null);\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (!disabled) {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n stepBy(1);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n stepBy(-1);\n }\n }\n onKeyDown?.(event);\n }\n\n const atMin = min != null && numericValue != null && numericValue <= min;\n const atMax = max != null && numericValue != null && numericValue >= max;\n\n return (\n <div data-slot=\"number-input-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-number-input__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-number-input__required\">\n *\n </span>\n )}\n </label>\n )}\n <div\n data-slot=\"number-input-control\"\n className={cn(numberInputVariants({ size, error: hasError }), className)}\n >\n {!hideControls && (\n <button\n type=\"button\"\n data-slot=\"number-input-decrement\"\n className=\"ddga-number-input__step ddga-number-input__step--decrement\"\n aria-label={decrementLabel}\n onClick={() => stepBy(-1)}\n disabled={disabled || atMin}\n tabIndex={-1}\n >\n <Minus aria-hidden=\"true\" />\n </button>\n )}\n <input\n {...props}\n {...controlProps}\n // type=text (not number): we own the steppers and keep digits Latin\n // + LTR regardless of locale, sidestepping the native spinner and\n // browser numeral-locale quirks.\n type=\"text\"\n inputMode={allowDecimal ? 'decimal' : 'numeric'}\n value={displayValue}\n required={required}\n disabled={disabled}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n data-slot=\"number-input\"\n className=\"ddga-number-input__field\"\n />\n {!hideControls && (\n <button\n type=\"button\"\n data-slot=\"number-input-increment\"\n className=\"ddga-number-input__step ddga-number-input__step--increment\"\n aria-label={incrementLabel}\n onClick={() => stepBy(1)}\n disabled={disabled || atMax}\n tabIndex={-1}\n >\n <Plus aria-hidden=\"true\" />\n </button>\n )}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { NumberInput, numberInputVariants };\nexport type { NumberInputProps };\n","'use client';\n\nimport { useRef, useState, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Star } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst ratingVariants = cva('ddga-rating', {\n variants: {\n size: {\n sm: 'ddga-rating--sm',\n md: 'ddga-rating--md',\n lg: 'ddga-rating--lg',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface RatingProps extends VariantProps<typeof ratingVariants> {\n /** Controlled value (0…max). `.5` increments are allowed when `allowHalf`. */\n value?: number;\n /** Uncontrolled initial value. Defaults to 0. */\n defaultValue?: number;\n /** Fires with the chosen rating. */\n onValueChange?: (value: number) => void;\n\n /** Number of stars. Defaults to 5. */\n max?: number;\n /** Allow half-star (`.5`) precision. */\n allowHalf?: boolean;\n /** Display only — no interaction, exposed as `role=\"img\"`. */\n readOnly?: boolean;\n /** Non-interactive and dimmed. */\n disabled?: boolean;\n\n /** Visible field label. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when `error` is true. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n\n /** Builds the accessible value text / read-only label. Defaults to\n * `\"{value} out of {max} stars\"`. Override for localization. */\n formatValueText?: (value: number, max: number) => string;\n\n id?: string;\n className?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n// ─── 3. Helpers ─── //\n\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n\nfunction defaultValueText(value: number, max: number): string {\n return `${value} out of ${max} stars`;\n}\n\n/** Fill level for the star at 0-based `index` given the current value. */\nfunction fillFor(index: number, value: number, allowHalf: boolean): 'full' | 'half' | 'empty' {\n if (value >= index + 1) return 'full';\n if (allowHalf && value >= index + 0.5) return 'half';\n return 'empty';\n}\n\n// ─── 4. Component ─── //\n\nfunction Rating({\n id: externalId,\n value,\n defaultValue,\n onValueChange,\n max = 5,\n allowHalf = false,\n readOnly = false,\n disabled = false,\n size,\n label,\n helperText,\n errorMessage,\n error,\n formatValueText = defaultValueText,\n className,\n ...props\n}: RatingProps) {\n const rootRef = useRef<HTMLDivElement>(null);\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<number>(defaultValue ?? 0);\n const currentValue = isControlled ? value : internal;\n\n const [hover, setHover] = useState<number | null>(null);\n const interactive = !readOnly && !disabled;\n const stepSize = allowHalf ? 0.5 : 1;\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'Rating',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n // role=slider / role=img always have an accessible name (label or the\n // value text), so suppress the no-label dev warning.\n 'aria-label': props['aria-label'] ?? formatValueText(currentValue, max),\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n // The value driving the visual fill: hover preview wins while interacting.\n const displayValue = hover ?? currentValue;\n\n function commit(next: number) {\n if (!isControlled) setInternal(next);\n onValueChange?.(next);\n }\n\n function readDir(): 'ltr' | 'rtl' {\n const el = rootRef.current;\n if (!el || typeof getComputedStyle !== 'function') return 'ltr';\n return getComputedStyle(el).direction === 'rtl' ? 'rtl' : 'ltr';\n }\n\n /** Value implied by the pointer position over star `index`. */\n function pointerValue(event: React.PointerEvent | React.MouseEvent, index: number): number {\n const rect = (event.currentTarget as HTMLElement).getBoundingClientRect();\n let fraction = rect.width ? (event.clientX - rect.left) / rect.width : 1;\n if (readDir() === 'rtl') fraction = 1 - fraction;\n if (allowHalf) return index + (fraction <= 0.5 ? 0.5 : 1);\n return index + 1;\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {\n if (!interactive) return;\n const rtl = readDir() === 'rtl';\n let next: number | null = null;\n switch (event.key) {\n case 'ArrowUp':\n next = currentValue + stepSize;\n break;\n case 'ArrowDown':\n next = currentValue - stepSize;\n break;\n case 'ArrowRight':\n next = currentValue + (rtl ? -stepSize : stepSize);\n break;\n case 'ArrowLeft':\n next = currentValue + (rtl ? stepSize : -stepSize);\n break;\n case 'Home':\n next = 0;\n break;\n case 'End':\n next = max;\n break;\n default:\n return;\n }\n event.preventDefault();\n commit(clamp(next, 0, max));\n }\n\n const stars = Array.from({ length: max }, (_, index) => {\n const level = fillFor(index, displayValue, allowHalf);\n return (\n <span\n key={index}\n data-slot=\"rating-star\"\n data-fill={level}\n className=\"ddga-rating__star\"\n onPointerMove={interactive ? (event) => setHover(pointerValue(event, index)) : undefined}\n onClick={interactive ? (event) => commit(pointerValue(event, index)) : undefined}\n >\n <Star className=\"ddga-rating__star-bg\" aria-hidden=\"true\" />\n <span className=\"ddga-rating__star-fill\" aria-hidden=\"true\">\n <Star className=\"ddga-rating__star-fg\" aria-hidden=\"true\" />\n </span>\n </span>\n );\n });\n\n const sharedProps = {\n ref: rootRef,\n 'data-slot': 'rating',\n 'data-disabled': disabled || undefined,\n className: cn(ratingVariants({ size }), hasError && 'ddga-rating--error', className),\n onPointerLeave: interactive ? () => setHover(null) : undefined,\n };\n\n // Accessible name for the slider: prefer the visible label, then a consumer\n // aria-labelledby/aria-label, falling back to a generic name.\n const labelledBy = label ? `${fieldId}-label` : props['aria-labelledby'];\n const ariaLabel = labelledBy ? undefined : (props['aria-label'] ?? 'Rating');\n\n return (\n <div data-slot=\"rating-field\" className=\"ddga-field\">\n {label && (\n <span id={`${fieldId}-label`} className=\"ddga-rating__label\">\n {label}\n </span>\n )}\n\n {readOnly ? (\n <div {...sharedProps} role=\"img\" aria-label={formatValueText(currentValue, max)}>\n {stars}\n </div>\n ) : (\n <div\n {...sharedProps}\n role=\"slider\"\n id={fieldId}\n tabIndex={disabled ? -1 : 0}\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={currentValue}\n aria-valuetext={formatValueText(currentValue, max)}\n aria-labelledby={labelledBy}\n aria-label={ariaLabel}\n aria-invalid={controlProps['aria-invalid']}\n aria-describedby={controlProps['aria-describedby']}\n aria-disabled={disabled || undefined}\n onKeyDown={handleKeyDown}\n >\n {stars}\n </div>\n )}\n\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { Rating, ratingVariants };\nexport type { RatingProps };\n","'use client';\n\nimport { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Standalone Toggle carries its own variant/size. Inside a ToggleGroup the\n// item visuals cascade from the group's classes via descendant selectors\n// (same pattern as Accordion/Tabs), so ToggleGroupItem needs no variant prop.\n\nconst toggleVariants = cva('ddga-toggle', {\n variants: {\n variant: {\n default: 'ddga-toggle--default',\n outline: 'ddga-toggle--outline',\n },\n size: {\n sm: 'ddga-toggle--sm',\n md: 'ddga-toggle--md',\n lg: 'ddga-toggle--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\nconst toggleGroupVariants = cva('ddga-toggle-group', {\n variants: {\n variant: {\n default: 'ddga-toggle-group--default',\n outline: 'ddga-toggle-group--outline',\n },\n size: {\n sm: 'ddga-toggle-group--sm',\n md: 'ddga-toggle-group--md',\n lg: 'ddga-toggle-group--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ntype ToggleProps = React.ComponentProps<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>;\n\n// Radix's Root is a discriminated union on `type` ('single' | 'multiple');\n// mirror it via Radix's own types (same approach as Accordion).\ntype ToggleGroupRootProps = React.ComponentProps<typeof ToggleGroupPrimitive.Root>;\ntype ToggleGroupProps = ToggleGroupRootProps & VariantProps<typeof toggleGroupVariants>;\n\ntype ToggleGroupItemProps = React.ComponentProps<typeof ToggleGroupPrimitive.Item>;\n\n// ─── 3. Components ─── //\n\n// A standalone two-state button (role=button + aria-pressed, via Radix). For\n// icon-only toggles, pass an `aria-label`.\nfunction Toggle({ variant, size, className, ...props }: ToggleProps) {\n return (\n <TogglePrimitive.Root\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n\nfunction ToggleGroup({ variant, size, className, ...props }: ToggleGroupProps) {\n if (process.env.NODE_ENV === 'development' && !props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] ToggleGroup should have an `aria-label` or `aria-labelledby` ' +\n 'so the button group has an accessible name.',\n );\n }\n\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n className={cn(toggleGroupVariants({ variant, size }), className)}\n {...(props as ToggleGroupRootProps)}\n />\n );\n}\n\nfunction ToggleGroupItem({ className, ...props }: ToggleGroupItemProps) {\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n className={cn('ddga-toggle-group__item', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Toggle, ToggleGroup, ToggleGroupItem, toggleVariants, toggleGroupVariants };\nexport type { ToggleProps, ToggleGroupProps, ToggleGroupItemProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Semantic <dl>/<dt>/<dd> key–value list for review / summary screens. Layout\n// cascades from the list root via descendant selectors (Accordion/Tabs\n// pattern), so the row/term/details parts need no variant props.\n\nconst descriptionListVariants = cva('ddga-description-list', {\n variants: {\n orientation: {\n horizontal: 'ddga-description-list--horizontal',\n vertical: 'ddga-description-list--vertical',\n },\n divided: {\n true: 'ddga-description-list--divided',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface DescriptionListProps\n extends React.ComponentProps<'dl'>, VariantProps<typeof descriptionListVariants> {}\n\ntype DescriptionItemProps = React.ComponentProps<'div'>;\ntype DescriptionTermProps = React.ComponentProps<'dt'>;\ntype DescriptionDetailsProps = React.ComponentProps<'dd'>;\n\n// ─── 3. Components ─── //\n\nfunction DescriptionList({ orientation, divided, className, ...props }: DescriptionListProps) {\n return (\n <dl\n data-slot=\"description-list\"\n className={cn(descriptionListVariants({ orientation, divided }), className)}\n {...props}\n />\n );\n}\n\n// Row wrapper grouping one term with its detail(s). A <div> inside <dl> is\n// valid HTML5 and gives each pair a layout/divider boundary.\nfunction DescriptionItem({ className, ...props }: DescriptionItemProps) {\n return (\n <div\n data-slot=\"description-item\"\n className={cn('ddga-description-list__item', className)}\n {...props}\n />\n );\n}\n\nfunction DescriptionTerm({ className, ...props }: DescriptionTermProps) {\n return (\n <dt\n data-slot=\"description-term\"\n className={cn('ddga-description-list__term', className)}\n {...props}\n />\n );\n}\n\nfunction DescriptionDetails({ className, ...props }: DescriptionDetailsProps) {\n return (\n <dd\n data-slot=\"description-details\"\n className={cn('ddga-description-list__details', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n DescriptionList,\n DescriptionItem,\n DescriptionTerm,\n DescriptionDetails,\n descriptionListVariants,\n};\nexport type {\n DescriptionListProps,\n DescriptionItemProps,\n DescriptionTermProps,\n DescriptionDetailsProps,\n};\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Inbox, Search, AlertCircle, Check } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst emptyStateVariants = cva('ddga-empty-state', {\n variants: {\n variant: {\n default: 'ddga-empty-state--default',\n search: 'ddga-empty-state--search',\n error: 'ddga-empty-state--error',\n success: 'ddga-empty-state--success',\n },\n size: {\n sm: 'ddga-empty-state--sm',\n md: 'ddga-empty-state--md',\n lg: 'ddga-empty-state--lg',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\n// Variant → default media icon. Mirrors the Alert.tsx DEFAULT_ICONS pattern.\nconst DEFAULT_ICONS: Record<\n NonNullable<VariantProps<typeof emptyStateVariants>['variant']>,\n ReactNode\n> = {\n default: <Inbox aria-hidden=\"true\" />,\n search: <Search aria-hidden=\"true\" />,\n error: <AlertCircle aria-hidden=\"true\" />,\n success: <Check aria-hidden=\"true\" />,\n};\n\n// ─── 2. Types ─── //\n\ninterface EmptyStateProps\n extends Omit<React.ComponentProps<'div'>, 'title'>, VariantProps<typeof emptyStateVariants> {\n /**\n * Leading media (icon or illustration). Pass `false` to hide the media.\n * Defaults to a variant-appropriate icon. Ignored when `children` is set.\n */\n icon?: ReactNode | false;\n /** Title. Ignored when `children` is set. */\n title?: ReactNode;\n /** Supporting description below the title. Ignored when `children` is set. */\n description?: ReactNode;\n /** Primary action, e.g. a `<Button>`. Ignored when `children` is set. */\n action?: ReactNode;\n /** Secondary action beside the primary one. Ignored when `children` is set. */\n secondaryAction?: ReactNode;\n}\n\ntype EmptyStateMediaProps = React.ComponentProps<'div'>;\n\ninterface EmptyStateTitleProps extends React.ComponentProps<'h3'> {\n /** Override the heading element (e.g. render an `<h2>` on full-page states). */\n asChild?: boolean;\n}\n\ntype EmptyStateDescriptionProps = React.ComponentProps<'p'> & { asChild?: boolean };\ntype EmptyStateActionsProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\n// ─── 3. Components ─── //\n\nfunction EmptyState({\n variant,\n size,\n icon,\n title,\n description,\n action,\n secondaryAction,\n className,\n children,\n ...props\n}: EmptyStateProps) {\n // `children`, when present, fully replaces the props-driven body.\n const resolvedIcon =\n icon === false ? null : icon !== undefined ? icon : DEFAULT_ICONS[variant ?? 'default'];\n\n return (\n <div\n data-slot=\"empty-state\"\n data-variant={variant ?? 'default'}\n data-size={size ?? 'md'}\n className={cn(emptyStateVariants({ variant, size }), className)}\n {...props}\n >\n {children ?? (\n <>\n {resolvedIcon ? <EmptyStateMedia>{resolvedIcon}</EmptyStateMedia> : null}\n {title ? <EmptyStateTitle>{title}</EmptyStateTitle> : null}\n {description ? <EmptyStateDescription>{description}</EmptyStateDescription> : null}\n {action || secondaryAction ? (\n <EmptyStateActions>\n {action}\n {secondaryAction}\n </EmptyStateActions>\n ) : null}\n </>\n )}\n </div>\n );\n}\n\n// Decorative circular badge wrapping the icon. aria-hidden so the icon is never\n// announced; consumers can override via props if they pass meaningful media.\nfunction EmptyStateMedia({ className, ...props }: EmptyStateMediaProps) {\n return (\n <div\n data-slot=\"empty-state-media\"\n aria-hidden=\"true\"\n className={cn('ddga-empty-state__media', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateTitle({ asChild, className, ...props }: EmptyStateTitleProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'h3';\n return (\n <Comp\n data-slot=\"empty-state-title\"\n className={cn('ddga-empty-state__title', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateDescription({ asChild, className, ...props }: EmptyStateDescriptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'p';\n return (\n <Comp\n data-slot=\"empty-state-description\"\n className={cn('ddga-empty-state__description', className)}\n {...props}\n />\n );\n}\n\nfunction EmptyStateActions({ asChild, className, ...props }: EmptyStateActionsProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"empty-state-actions\"\n className={cn('ddga-empty-state__actions', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n EmptyState,\n EmptyStateMedia,\n EmptyStateTitle,\n EmptyStateDescription,\n EmptyStateActions,\n emptyStateVariants,\n};\nexport type {\n EmptyStateProps,\n EmptyStateMediaProps,\n EmptyStateTitleProps,\n EmptyStateDescriptionProps,\n EmptyStateActionsProps,\n};\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { CaretUp, CaretDown, Minus } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst statVariants = cva('ddga-stat', {\n variants: {\n variant: {\n flat: 'ddga-stat--flat',\n elevated: 'ddga-stat--elevated',\n accent: 'ddga-stat--accent',\n // Soft sentiment-tinted gradient surface (reuses the accent tint vars).\n gradient: 'ddga-stat--gradient',\n },\n size: {\n sm: 'ddga-stat--sm',\n md: 'ddga-stat--md',\n lg: 'ddga-stat--lg',\n // Hero/display size for headline KPIs (display-scale value).\n xl: 'ddga-stat--xl',\n },\n },\n defaultVariants: {\n variant: 'flat',\n size: 'md',\n },\n});\n\ntype ChangeVariant = 'text' | 'chip';\n\ntype Trend = 'up' | 'down' | 'flat';\ntype Sentiment = 'positive' | 'negative' | 'neutral';\n\n// trend → caret icon (carried aria-hidden; carets are RTL-neutral).\nconst TREND_ICONS: Record<Trend, ReactNode> = {\n up: <CaretUp aria-hidden=\"true\" />,\n down: <CaretDown aria-hidden=\"true\" />,\n flat: <Minus aria-hidden=\"true\" />,\n};\n\n// Default sentiment when none is given explicitly.\nconst TREND_SENTIMENT: Record<Trend, Sentiment> = {\n up: 'positive',\n down: 'negative',\n flat: 'neutral',\n};\n\n// Explicit sentiment wins; else derive from trend; else undefined (no color).\nfunction resolveSentiment(trend?: Trend, sentiment?: Sentiment): Sentiment | undefined {\n if (sentiment) return sentiment;\n if (trend) return TREND_SENTIMENT[trend];\n return undefined;\n}\n\n// ─── 2. Types ─── //\n\ninterface StatProps extends React.ComponentProps<'div'>, VariantProps<typeof statVariants> {\n /** Small, muted label above the value. */\n label?: ReactNode;\n /** The metric, pre-formatted by the consumer (e.g. \"3,204\", \"SAR 1.2M\"). */\n value?: ReactNode;\n /** Change text — include the sign (e.g. \"+12.5%\") so AT conveys direction. */\n change?: ReactNode;\n /** Muted context beside the change (e.g. \"vs last month\"). */\n changeLabel?: ReactNode;\n /** Arrow direction: up → CaretUp, down → CaretDown, flat → Minus. */\n trend?: Trend;\n /** Change color. Omitted → derived from `trend`. Explicit always wins. */\n sentiment?: Sentiment;\n /**\n * How the change renders: `'text'` (default — colored text + caret) or\n * `'chip'` (the same, wrapped in a sentiment-tinted pill). Threaded to the\n * inner `StatChange`.\n */\n changeVariant?: ChangeVariant;\n /** Optional icon at the inline-end of the label row (decorative). */\n icon?: ReactNode;\n}\n\ntype StatLabelProps = React.ComponentProps<'div'>;\ntype StatValueProps = React.ComponentProps<'div'>;\ntype StatChartProps = React.ComponentProps<'div'>;\ninterface StatChangeProps extends React.ComponentProps<'div'> {\n trend?: Trend;\n sentiment?: Sentiment;\n /** `'chip'` wraps the change in a sentiment-tinted pill. Defaults to `'text'`. */\n variant?: ChangeVariant;\n}\n\n// ─── 3. Components ─── //\n\nfunction Stat({\n variant,\n size,\n label,\n value,\n change,\n changeLabel,\n trend,\n sentiment,\n changeVariant,\n icon,\n className,\n children,\n ...props\n}: StatProps) {\n const resolvedSentiment = resolveSentiment(trend, sentiment);\n return (\n <div\n data-slot=\"stat\"\n data-variant={variant ?? 'flat'}\n data-trend={trend}\n data-sentiment={resolvedSentiment}\n className={cn(statVariants({ variant, size }), className)}\n {...props}\n >\n {label || icon ? (\n <div className=\"ddga-stat__label-row\">\n {label ? <StatLabel>{label}</StatLabel> : null}\n {icon ? (\n <span className=\"ddga-stat__icon\" aria-hidden=\"true\">\n {icon}\n </span>\n ) : null}\n </div>\n ) : null}\n {value ? <StatValue>{value}</StatValue> : null}\n {change || changeLabel ? (\n <div className=\"ddga-stat__change-row\">\n {change ? (\n <StatChange trend={trend} sentiment={sentiment} variant={changeVariant}>\n {change}\n </StatChange>\n ) : null}\n {changeLabel ? <span className=\"ddga-stat__change-label\">{changeLabel}</span> : null}\n </div>\n ) : null}\n {children}\n </div>\n );\n}\n\nfunction StatLabel({ className, ...props }: StatLabelProps) {\n return <div data-slot=\"stat-label\" className={cn('ddga-stat__label', className)} {...props} />;\n}\n\nfunction StatValue({ className, ...props }: StatValueProps) {\n return <div data-slot=\"stat-value\" className={cn('ddga-stat__value', className)} {...props} />;\n}\n\n/**\n * Styled slot for a consumer-supplied sparkline / mini-chart. The library ships\n * no charting dependency — drop your own `<svg>`/chart in here and it gets a\n * consistent height + spacing, stretched to the tile width.\n */\nfunction StatChart({ className, ...props }: StatChartProps) {\n return <div data-slot=\"stat-chart\" className={cn('ddga-stat__chart', className)} {...props} />;\n}\n\nfunction StatChange({ trend, sentiment, variant, className, children, ...props }: StatChangeProps) {\n const resolvedSentiment = resolveSentiment(trend, sentiment);\n return (\n <div\n data-slot=\"stat-change\"\n data-trend={trend}\n data-sentiment={resolvedSentiment}\n className={cn(\n 'ddga-stat__change',\n resolvedSentiment ? `ddga-stat__change--${resolvedSentiment}` : null,\n variant === 'chip' && 'ddga-stat__change--chip',\n className,\n )}\n {...props}\n >\n {trend ? <span className=\"ddga-stat__change-icon\">{TREND_ICONS[trend]}</span> : null}\n {children}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Stat, StatLabel, StatValue, StatChart, StatChange, statVariants };\nexport type { StatProps, StatLabelProps, StatValueProps, StatChartProps, StatChangeProps };\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n\nconst statGroupVariants = cva('ddga-stat-group', {\n variants: {\n orientation: {\n horizontal: 'ddga-stat-group--horizontal',\n vertical: 'ddga-stat-group--vertical',\n },\n gap: {\n sm: 'ddga-stat-group--gap-sm',\n md: 'ddga-stat-group--gap-md',\n lg: 'ddga-stat-group--gap-lg',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n gap: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface StatGroupProps\n extends React.ComponentProps<'div'>, VariantProps<typeof statGroupVariants> {\n /**\n * Fixed column count for the horizontal grid (collapses to one column on\n * narrow screens). Omit for an auto-fit responsive grid.\n */\n columns?: number;\n}\n\n// ─── 3. Component ─── //\n\n// Pure layout container for Stat tiles. Each Stat keeps its own surface; inside\n// a group the tile's max-inline-size is released so it fills its grid/flex slot\n// (see stat.css). `columns` is passed as a CSS custom property and consumed by\n// the `--cols` rule, so a media query can still collapse it without !important.\nfunction StatGroup({ orientation, gap, columns, className, style, ...props }: StatGroupProps) {\n return (\n <div\n data-slot=\"stat-group\"\n className={cn(\n statGroupVariants({ orientation, gap }),\n columns != null && 'ddga-stat-group--cols',\n className,\n )}\n style={\n columns != null\n ? ({ '--ddga-stat-group-columns': columns, ...style } as React.CSSProperties)\n : style\n }\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { StatGroup, statGroupVariants };\nexport type { StatGroupProps };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Close } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n\nconst popoverContentVariants = cva('ddga-popover', {\n variants: {\n size: {\n sm: 'ddga-popover--sm',\n md: 'ddga-popover--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n//\n// Closed compound shape that hides Radix's Portal/Arrow plumbing — mirrors\n// Tooltip/DropdownMenu. `Popover` (Root) passes through `open`/`onOpenChange`/\n// `defaultOpen`/`modal`. The Portal container is wired from `DgaContext` so the\n// panel inherits `data-theme` + theme vars and escapes clipping/transform\n// ancestors; falls back to <body> outside a provider.\n\ntype PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>;\n\ntype PopoverTriggerProps = React.ComponentProps<typeof PopoverPrimitive.Trigger>;\n\ntype PopoverAnchorProps = React.ComponentProps<typeof PopoverPrimitive.Anchor>;\n\ninterface PopoverContentProps\n extends\n Omit<React.ComponentProps<typeof PopoverPrimitive.Content>, 'asChild'>,\n VariantProps<typeof popoverContentVariants> {\n /** Show a small arrow pointing at the trigger. Defaults to false. */\n arrow?: boolean;\n}\n\ninterface PopoverCloseProps extends React.ComponentProps<typeof PopoverPrimitive.Close> {\n /**\n * Localized label for the default corner-X button. Only used when no\n * `children` (and no `asChild`) are provided. Defaults to `\"Close\"`.\n */\n closeLabel?: string;\n}\n\n// ─── 3. Components ─── //\n\nfunction Popover(props: PopoverProps) {\n return <PopoverPrimitive.Root {...props} />;\n}\n\nfunction PopoverTrigger({ className, ...props }: PopoverTriggerProps) {\n // Radix Trigger supports asChild natively — pass through.\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" className={className} {...props} />;\n}\n\nfunction PopoverAnchor(props: PopoverAnchorProps) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nfunction PopoverContent({\n size,\n arrow = false,\n sideOffset = 6,\n className,\n children,\n ...props\n}: PopoverContentProps) {\n // Radix Popover.Content renders role=\"dialog\", which needs an accessible\n // name. Unlike Modal there's no built-in Title primitive wiring\n // aria-labelledby, so warn (dev only) when the consumer gives neither.\n if (process.env.NODE_ENV === 'development' && !props['aria-label'] && !props['aria-labelledby']) {\n console.warn(\n '[@dev-dga/react] PopoverContent renders role=\"dialog\" and should have an ' +\n '`aria-label` or `aria-labelledby` so the panel has an accessible name.',\n );\n }\n\n // Anchor the Portal to the DgaProvider's body-level portal container so the\n // panel inherits theme + dark mode and isn't clipped by an ancestor's\n // overflow/transform. Falls back to <body> outside a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <PopoverPrimitive.Portal container={portalContainer}>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n sideOffset={sideOffset}\n className={cn(popoverContentVariants({ size }), className)}\n {...props}\n >\n {children}\n {arrow ? (\n <PopoverPrimitive.Arrow className=\"ddga-popover__arrow\" width={16} height={8} />\n ) : null}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverClose({\n className,\n children,\n closeLabel = 'Close',\n asChild,\n ...props\n}: PopoverCloseProps) {\n // With renderable children (or asChild), behave as a transparent close\n // wrapper so consumers fully own the element. With neither, render the styled\n // corner-X (mirrors Modal's close button) — the common dismiss affordance.\n // Guard against `null`/`false` so a conditional child (`flag && <X/>`) that\n // evaluates falsy still falls through to the default X instead of rendering\n // an empty, unlabelled button.\n const hasRenderableChildren = children != null && children !== false;\n if (asChild || hasRenderableChildren) {\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n asChild={asChild}\n className={className}\n {...props}\n >\n {children as ReactNode}\n </PopoverPrimitive.Close>\n );\n }\n\n return (\n <PopoverPrimitive.Close\n data-slot=\"popover-close\"\n aria-label={closeLabel}\n className={cn('ddga-popover__close', className)}\n {...props}\n >\n <Close aria-hidden=\"true\" />\n </PopoverPrimitive.Close>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Popover,\n PopoverTrigger,\n PopoverAnchor,\n PopoverContent,\n PopoverClose,\n popoverContentVariants,\n};\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverAnchorProps,\n PopoverContentProps,\n PopoverCloseProps,\n};\n","'use client';\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cn } from '../../utils/cn';\nimport { Drawer, DrawerContent } from '../Drawer';\nimport { PanelLeft } from '../../internal/icons';\nimport { SidebarContext, useSidebar, type SidebarContextValue } from './SidebarContext';\nimport { useIsMobile } from './useIsMobile';\n\n// ─── SidebarProvider ─── //\n\ninterface SidebarProviderProps extends React.ComponentProps<'div'> {\n /** Uncontrolled initial desktop state. Default true (expanded). */\n defaultOpen?: boolean;\n /** Controlled desktop open state. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Viewport width (px) below which the mobile Drawer engages. Default 768. */\n mobileBreakpoint?: number;\n /** Register Cmd/Ctrl+B to toggle. Default true. */\n keyboardShortcut?: boolean;\n}\n\nfunction SidebarProvider({\n defaultOpen = true,\n open: openProp,\n onOpenChange,\n mobileBreakpoint = 768,\n keyboardShortcut = true,\n className,\n style,\n children,\n ...props\n}: SidebarProviderProps) {\n const isMobile = useIsMobile(mobileBreakpoint);\n const [openMobile, setOpenMobile] = useState(false);\n\n const isControlled = openProp !== undefined;\n const [openInternal, setOpenInternal] = useState(defaultOpen);\n const open = isControlled ? (openProp as boolean) : openInternal;\n\n const setOpen = useCallback(\n (value: boolean) => {\n if (!isControlled) setOpenInternal(value);\n onOpenChange?.(value);\n },\n [isControlled, onOpenChange],\n );\n\n const toggleSidebar = useCallback(() => {\n if (isMobile) {\n setOpenMobile((v) => !v);\n return;\n }\n if (isControlled) {\n onOpenChange?.(!open);\n } else {\n setOpenInternal((v) => !v);\n }\n }, [isMobile, isControlled, onOpenChange, open]);\n\n useEffect(() => {\n if (!keyboardShortcut) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key.toLowerCase() === 'b' && (e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n toggleSidebar();\n }\n };\n window.addEventListener('keydown', onKeyDown);\n return () => window.removeEventListener('keydown', onKeyDown);\n }, [keyboardShortcut, toggleSidebar]);\n\n const state: 'expanded' | 'collapsed' = open ? 'expanded' : 'collapsed';\n\n const value = useMemo<SidebarContextValue>(\n () => ({ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar }),\n [state, open, setOpen, openMobile, isMobile, toggleSidebar],\n );\n\n return (\n <SidebarContext.Provider value={value}>\n <div\n data-slot=\"sidebar-wrapper\"\n className={cn('ddga-sidebar-wrapper', className)}\n style={style}\n {...props}\n >\n {children}\n </div>\n </SidebarContext.Provider>\n );\n}\n\n// ─── Sidebar (container) ─── //\n\ninterface SidebarProps extends React.ComponentProps<'div'> {\n variant?: 'sidebar' | 'floating' | 'inset';\n collapsible?: 'icon' | 'offcanvas' | 'none';\n /** Logical side; flips with dir. Default 'start'. */\n side?: 'start' | 'end';\n}\n\nfunction Sidebar({\n variant = 'sidebar',\n collapsible = 'icon',\n side = 'start',\n className,\n children,\n 'aria-label': ariaLabel = 'Sidebar',\n ...props\n}: SidebarProps) {\n const { isMobile, openMobile, setOpenMobile, state } = useSidebar();\n\n if (isMobile) {\n return (\n <Drawer open={openMobile} onOpenChange={setOpenMobile}>\n <DrawerContent\n side={side}\n size=\"sm\"\n aria-label={ariaLabel}\n data-mobile=\"true\"\n data-variant={variant}\n data-side={side}\n className={cn('ddga-sidebar', 'ddga-sidebar--mobile', className)}\n >\n {children}\n </DrawerContent>\n </Drawer>\n );\n }\n\n return (\n <aside\n data-slot=\"sidebar\"\n aria-label={ariaLabel}\n data-state={state}\n data-collapsible={collapsible}\n data-variant={variant}\n data-side={side}\n className={cn('ddga-sidebar', className)}\n {...props}\n >\n {children}\n </aside>\n );\n}\n\n// ─── Trigger / Rail / Inset ─── //\n\ninterface SidebarTriggerProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nfunction SidebarTrigger({\n asChild,\n className,\n onClick,\n children,\n 'aria-label': ariaLabel = 'Toggle sidebar',\n ...props\n}: SidebarTriggerProps) {\n const { toggleSidebar, open, openMobile, isMobile } = useSidebar();\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-trigger\"\n // Don't override the child element's accessible name when asChild.\n aria-label={asChild ? undefined : ariaLabel}\n aria-haspopup={isMobile ? 'dialog' : undefined}\n aria-expanded={isMobile ? openMobile : open}\n className={cn('ddga-sidebar__trigger', className)}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e);\n toggleSidebar();\n }}\n {...props}\n >\n {children ?? <PanelLeft aria-hidden=\"true\" />}\n </Comp>\n );\n}\n\nfunction SidebarRail({\n className,\n 'aria-label': ariaLabel = 'Toggle sidebar',\n ...props\n}: React.ComponentProps<'button'>) {\n const { toggleSidebar } = useSidebar();\n return (\n <button\n type=\"button\"\n data-slot=\"sidebar-rail\"\n aria-label={ariaLabel}\n title={ariaLabel}\n tabIndex={-1}\n className={cn('ddga-sidebar__rail', className)}\n onClick={toggleSidebar}\n {...props}\n />\n );\n}\n\ninterface SidebarInsetProps extends React.ComponentProps<'main'> {\n asChild?: boolean;\n}\n\nfunction SidebarInset({ asChild, className, ...props }: SidebarInsetProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'main';\n return (\n <Comp data-slot=\"sidebar-inset\" className={cn('ddga-sidebar-inset', className)} {...props} />\n );\n}\n\n// ─── Structure ─── //\n\ntype SidebarSectionProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\nfunction SidebarHeader({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"sidebar-header\" className={cn('ddga-sidebar__header', className)} {...props} />\n );\n}\n\nfunction SidebarContent({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-content\"\n className={cn('ddga-sidebar__content', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarFooter({ asChild, className, ...props }: SidebarSectionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"sidebar-footer\" className={cn('ddga-sidebar__footer', className)} {...props} />\n );\n}\n\nfunction SidebarSeparator({ className, ...props }: React.ComponentProps<'hr'>) {\n return (\n <hr\n data-slot=\"sidebar-separator\"\n className={cn('ddga-sidebar__separator', className)}\n {...props}\n />\n );\n}\n\n// ─── Exports ─── //\n\nexport { SidebarProvider };\nexport type { SidebarProviderProps };\n\nexport { Sidebar };\nexport type { SidebarProps };\n\nexport { SidebarTrigger, SidebarRail, SidebarInset };\nexport type { SidebarTriggerProps, SidebarInsetProps };\n\nexport { SidebarHeader, SidebarContent, SidebarFooter, SidebarSeparator };\nexport type { SidebarSectionProps };\n\nexport { useSidebar };\nexport type { SidebarContextValue };\n","'use client';\n\nimport { createContext, useContext } from 'react';\n\nexport interface SidebarContextValue {\n /** Desktop collapse state, derived from `open`. */\n state: 'expanded' | 'collapsed';\n /** Desktop expanded (true) / collapsed-to-rail (false). */\n open: boolean;\n setOpen: (open: boolean) => void;\n /** Mobile off-canvas drawer open state. */\n openMobile: boolean;\n setOpenMobile: (open: boolean) => void;\n /** True below the provider's `mobileBreakpoint`. */\n isMobile: boolean;\n /** Toggles `openMobile` on mobile, else `open`. */\n toggleSidebar: () => void;\n}\n\nexport const SidebarContext = createContext<SidebarContextValue | null>(null);\n\nexport function useSidebar(): SidebarContextValue {\n const ctx = useContext(SidebarContext);\n if (!ctx) {\n throw new Error('useSidebar must be used within a <SidebarProvider>');\n }\n return ctx;\n}\n","'use client';\n\nimport { useEffect, useState } from 'react';\n\n/**\n * True when the viewport is narrower than `breakpoint`. SSR-safe: returns\n * `false` until the mount effect runs, so the desktop layout renders first\n * and the mobile Drawer (a client-only overlay) only engages after hydration.\n */\nexport function useIsMobile(breakpoint = 768): boolean {\n const [isMobile, setIsMobile] = useState(false);\n\n useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);\n const onChange = () => setIsMobile(mql.matches);\n onChange();\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [breakpoint]);\n\n return isMobile;\n}\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cn } from '../../utils/cn';\n\ntype SidebarGroupDivProps = React.ComponentProps<'div'> & { asChild?: boolean };\n\nfunction SidebarGroup({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group\"\n role=\"group\"\n className={cn('ddga-sidebar__group', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupLabel({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group-label\"\n className={cn('ddga-sidebar__group-label', className)}\n {...props}\n />\n );\n}\n\ninterface SidebarGroupActionProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n}\n\nfunction SidebarGroupAction({ asChild, className, ...props }: SidebarGroupActionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-group-action\"\n className={cn('ddga-sidebar__group-action', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarGroupContent({ asChild, className, ...props }: SidebarGroupDivProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp\n data-slot=\"sidebar-group-content\"\n className={cn('ddga-sidebar__group-content', className)}\n {...props}\n />\n );\n}\n\nexport { SidebarGroup, SidebarGroupLabel, SidebarGroupAction, SidebarGroupContent };\nexport type { SidebarGroupDivProps, SidebarGroupActionProps };\n","'use client';\n\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useDir } from '../../hooks/useDir';\nimport { Tooltip, TooltipTrigger, TooltipContent } from '../Tooltip';\nimport { Skeleton } from '../Skeleton';\nimport { useSidebar } from './SidebarContext';\n\n// ─── Menu / MenuItem ─── //\n\nfunction SidebarMenu({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"sidebar-menu\" className={cn('ddga-sidebar__menu', className)} {...props} />;\n}\n\nfunction SidebarMenuItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-item\"\n className={cn('ddga-sidebar__menu-item', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuButton ─── //\n\nconst sidebarMenuButtonVariants = cva('ddga-sidebar__menu-button', {\n variants: {\n size: {\n sm: 'ddga-sidebar__menu-button--sm',\n md: 'ddga-sidebar__menu-button--md',\n lg: 'ddga-sidebar__menu-button--lg',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\ninterface SidebarMenuButtonProps\n extends React.ComponentProps<'button'>, VariantProps<typeof sidebarMenuButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n /** Tooltip content shown only when the rail is collapsed (desktop). */\n tooltip?: React.ReactNode;\n}\n\nfunction SidebarMenuButton({\n asChild,\n isActive,\n size,\n tooltip,\n className,\n ...props\n}: SidebarMenuButtonProps) {\n const { state, isMobile } = useSidebar();\n const dir = useDir();\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n const button = (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-menu-button\"\n data-active={isActive || undefined}\n data-size={size ?? 'md'}\n aria-current={isActive ? 'page' : undefined}\n className={cn(sidebarMenuButtonVariants({ size }), className)}\n {...props}\n />\n );\n\n if (!tooltip || state !== 'collapsed' || isMobile) {\n return button;\n }\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span data-slot=\"tooltip-trigger\" style={{ display: 'contents' }}>\n {button}\n </span>\n </TooltipTrigger>\n <TooltipContent side={dir === 'rtl' ? 'left' : 'right'}>{tooltip}</TooltipContent>\n </Tooltip>\n );\n}\n\n// ─── MenuAction ─── //\n\ninterface SidebarMenuActionProps extends React.ComponentProps<'button'> {\n asChild?: boolean;\n /** Reveal the action only on row hover/focus (CSS-driven). */\n showOnHover?: boolean;\n}\n\nfunction SidebarMenuAction({ asChild, showOnHover, className, ...props }: SidebarMenuActionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n return (\n <Comp\n type={asChild ? undefined : 'button'}\n data-slot=\"sidebar-menu-action\"\n data-show-on-hover={showOnHover || undefined}\n className={cn('ddga-sidebar__menu-action', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuBadge ─── //\n\nfunction SidebarMenuBadge({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"sidebar-menu-badge\"\n className={cn('ddga-sidebar__menu-badge', className)}\n {...props}\n />\n );\n}\n\n// ─── MenuSkeleton ─── //\n\ninterface SidebarMenuSkeletonProps extends React.ComponentProps<'div'> {\n showIcon?: boolean;\n}\n\nfunction SidebarMenuSkeleton({ showIcon, className, ...props }: SidebarMenuSkeletonProps) {\n return (\n <div\n data-slot=\"sidebar-menu-skeleton\"\n className={cn('ddga-sidebar__menu-skeleton', className)}\n {...props}\n >\n {showIcon ? <Skeleton shape=\"circle\" width=\"1rem\" height=\"1rem\" /> : null}\n <Skeleton shape=\"text\" className=\"ddga-sidebar__menu-skeleton-text\" />\n </div>\n );\n}\n\n// ─── MenuSub / MenuSubItem / MenuSubButton ─── //\n\nfunction SidebarMenuSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-slot=\"sidebar-menu-sub\"\n className={cn('ddga-sidebar__menu-sub', className)}\n {...props}\n />\n );\n}\n\nfunction SidebarMenuSubItem({ className, ...props }: React.ComponentProps<'li'>) {\n return (\n <li\n data-slot=\"sidebar-menu-sub-item\"\n className={cn('ddga-sidebar__menu-sub-item', className)}\n {...props}\n />\n );\n}\n\nconst sidebarMenuSubButtonVariants = cva('ddga-sidebar__menu-sub-button', {\n variants: {\n size: {\n sm: 'ddga-sidebar__menu-sub-button--sm',\n md: 'ddga-sidebar__menu-sub-button--md',\n },\n },\n defaultVariants: { size: 'md' },\n});\n\ninterface SidebarMenuSubButtonProps\n extends React.ComponentProps<'a'>, VariantProps<typeof sidebarMenuSubButtonVariants> {\n asChild?: boolean;\n isActive?: boolean;\n}\n\nfunction SidebarMenuSubButton({\n asChild,\n isActive,\n size,\n className,\n ...props\n}: SidebarMenuSubButtonProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n return (\n <Comp\n data-slot=\"sidebar-menu-sub-button\"\n data-active={isActive || undefined}\n data-size={size ?? 'md'}\n aria-current={isActive ? 'page' : undefined}\n className={cn(sidebarMenuSubButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\n// ─── Exports ─── //\n\nexport {\n SidebarMenu,\n SidebarMenuItem,\n SidebarMenuButton,\n sidebarMenuButtonVariants,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubItem,\n SidebarMenuSubButton,\n sidebarMenuSubButtonVariants,\n};\nexport type {\n SidebarMenuButtonProps,\n SidebarMenuActionProps,\n SidebarMenuSkeletonProps,\n SidebarMenuSubButtonProps,\n};\n","'use client';\n\nimport { useDga } from '../providers/DgaContext';\n\n/**\n * Returns the current writing direction from the nearest `<DgaProvider>`.\n *\n * Prefer this over `useDga().dir` when a component only needs direction\n * (clearer intent, smaller dependency footprint at the call site).\n *\n * Throws if called outside a `<DgaProvider>` (matches `useDga`).\n */\nexport function useDir(): 'ltr' | 'rtl' {\n return useDga().dir;\n}\n","'use client';\n\nimport { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst scrollAreaVariants = cva('ddga-scroll-area', {\n variants: {\n orientation: {\n vertical: 'ddga-scroll-area--vertical',\n horizontal: 'ddga-scroll-area--horizontal',\n both: 'ddga-scroll-area--both',\n },\n },\n defaultVariants: {\n orientation: 'vertical',\n },\n});\n\nfunction warnMissingLabel(ariaLabel?: string, ariaLabelledby?: string) {\n if (process.env.NODE_ENV === 'production') return;\n if (ariaLabel || ariaLabelledby) return;\n // Warn on every render (dev only) — mirrors the Popover sibling's a11y warning.\n console.warn(\n '[dga/ScrollArea] <ScrollArea> has no accessible name. The scroll viewport is ' +\n 'keyboard-focusable; pass `aria-label` or `aria-labelledby` so screen-reader users ' +\n 'know what region they are scrolling. If the content is itself focusable (e.g. a list ' +\n 'of links) and you do not want a labelled region, pass `viewportProps={{ tabIndex: -1 }}`.',\n );\n}\n\ntype ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both';\n\nexport interface ScrollAreaProps\n extends\n Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Root>, 'asChild' | 'orientation'>,\n Omit<VariantProps<typeof scrollAreaVariants>, 'orientation'> {\n /** Which scrollbar(s) to render. Default `'vertical'`. */\n orientation?: ScrollAreaOrientation;\n /** Ref to the scrollable viewport — use for programmatic scrolling. */\n viewportRef?: React.Ref<HTMLDivElement>;\n /**\n * Extra props forwarded to the viewport element (use `viewportRef` for the ref).\n * To drop the extra tab stop when the scrolled content is itself fully focusable\n * (e.g. a list of links), pass `viewportProps={{ tabIndex: -1 }}`.\n */\n viewportProps?: Omit<React.ComponentProps<'div'>, 'ref'>;\n /** Names the scroll region. Warns (dev only) if neither this nor `aria-labelledby` is set. */\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n}\n\n/**\n * Cross-browser, design-system-styled scroll container (wraps Radix ScrollArea).\n *\n * Set the bounding size (height / max-height) on the element via `className` /\n * `style` — without a bounded size nothing scrolls, exactly like native overflow.\n * The viewport is keyboard-focusable (`tabIndex={0}`) so keyboard users can scroll\n * with the arrow / Page keys; pass `aria-label` to name the region.\n *\n * Does not support `asChild`: it is a structural wrapper composing several Radix\n * parts, and the meaningful node — the viewport — is exposed via `viewportRef`.\n */\nexport function ScrollArea({\n className,\n orientation = 'vertical',\n type = 'hover',\n scrollHideDelay = 600,\n viewportRef,\n viewportProps,\n children,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n}: ScrollAreaProps) {\n warnMissingLabel(ariaLabel, ariaLabelledby);\n\n const hasLabel = Boolean(ariaLabel || ariaLabelledby);\n const showVertical = orientation === 'vertical' || orientation === 'both';\n const showHorizontal = orientation === 'horizontal' || orientation === 'both';\n\n const { className: viewportClassName, ...restViewportProps } = viewportProps ?? {};\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n type={type}\n scrollHideDelay={scrollHideDelay}\n className={cn(scrollAreaVariants({ orientation }), className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className={cn('ddga-scroll-area__viewport', viewportClassName)}\n ref={viewportRef}\n tabIndex={0}\n role={hasLabel ? 'region' : undefined}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n {...restViewportProps}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n {showVertical ? (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation=\"vertical\"\n className=\"ddga-scroll-area__scrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"ddga-scroll-area__thumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n {showHorizontal ? (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation=\"horizontal\"\n className=\"ddga-scroll-area__scrollbar\"\n >\n <ScrollAreaPrimitive.Thumb className=\"ddga-scroll-area__thumb\" />\n </ScrollAreaPrimitive.Scrollbar>\n ) : null}\n {orientation === 'both' ? (\n <ScrollAreaPrimitive.Corner className=\"ddga-scroll-area__corner\" />\n ) : null}\n </ScrollAreaPrimitive.Root>\n );\n}\n\nexport { scrollAreaVariants };\nexport type { ScrollAreaOrientation };\n","'use client';\n\nimport { useContext, type ReactNode } from 'react';\nimport { Menubar as MenubarPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Check, ChevronRight } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants ─── //\n\n// Size lives on the dropdown panel (Content / SubContent), mirroring\n// DropdownMenu. The bar itself is a single size, so it carries no cva.\nconst menubarContentVariants = cva('ddga-menubar-menu', {\n variants: {\n size: {\n sm: 'ddga-menubar-menu--sm',\n md: 'ddga-menubar-menu--md',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// Trigger look. `default` = flat menu-bar idiom (text + SA-green open underline);\n// `outline` = bordered button-style chip. Apply the same variant to every\n// trigger in a bar for a consistent look.\nconst menubarTriggerVariants = cva('ddga-menubar__trigger', {\n variants: {\n variant: {\n default: 'ddga-menubar__trigger--default',\n outline: 'ddga-menubar__trigger--outline',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\n// ─── 2. Bar (Root + Menu + Trigger) ─── //\n\ntype MenubarProps = React.ComponentProps<typeof MenubarPrimitive.Root>;\n\nfunction Menubar({ className, ...props }: MenubarProps) {\n return (\n <MenubarPrimitive.Root\n data-slot=\"menubar\"\n className={cn('ddga-menubar', className)}\n {...props}\n />\n );\n}\n\ntype MenubarMenuProps = React.ComponentProps<typeof MenubarPrimitive.Menu>;\n\nfunction MenubarMenu(props: MenubarMenuProps) {\n return <MenubarPrimitive.Menu {...props} />;\n}\n\ntype MenubarTriggerProps = React.ComponentProps<typeof MenubarPrimitive.Trigger> &\n VariantProps<typeof menubarTriggerVariants>;\n\nfunction MenubarTrigger({ variant, className, ...props }: MenubarTriggerProps) {\n return (\n <MenubarPrimitive.Trigger\n data-slot=\"menubar-trigger\"\n data-variant={variant ?? 'default'}\n className={cn(menubarTriggerVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\n// ─── 3. Content (portal-anchored) ─── //\n\ntype MenubarContentProps = React.ComponentProps<typeof MenubarPrimitive.Content> &\n VariantProps<typeof menubarContentVariants>;\n\nfunction MenubarContent({ size, className, sideOffset = 6, ...props }: MenubarContentProps) {\n // Radix Portal defaults to <body>, which doesn't inherit DgaProvider's\n // data-theme / CSS vars. Re-anchor at the provider's body-level portal\n // container (mirrors data-theme + dir + theme vars) so the menu inherits\n // theme AND escapes any clipping or transform ancestor. Falls back to\n // <body> when used outside a provider. (Same pattern as DropdownMenu.)\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <MenubarPrimitive.Portal container={portalContainer}>\n <MenubarPrimitive.Content\n data-slot=\"menubar-content\"\n sideOffset={sideOffset}\n className={cn(menubarContentVariants({ size }), className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n );\n}\n\n// ─── 4. Item + variants ─── //\n\ntype MenubarItemProps = React.ComponentProps<typeof MenubarPrimitive.Item> & {\n /** Style as a destructive action (red text, red hover). */\n destructive?: boolean;\n /** Icon rendered before the label. Sized to 1em. */\n startIcon?: ReactNode;\n /** Trailing text shown muted, e.g. a keyboard shortcut hint (\"⌘K\"). */\n shortcut?: ReactNode;\n};\n\nfunction MenubarItem({\n className,\n destructive,\n startIcon,\n shortcut,\n children,\n ...props\n}: MenubarItemProps) {\n return (\n <MenubarPrimitive.Item\n data-slot=\"menubar-item\"\n data-destructive={destructive ? '' : undefined}\n className={cn('ddga-menubar-menu__item', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-menubar-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n {shortcut ? (\n <span className=\"ddga-menubar-menu__shortcut\" aria-hidden=\"true\">\n {shortcut}\n </span>\n ) : null}\n </MenubarPrimitive.Item>\n );\n}\n\n// ─── 5. CheckboxItem + RadioItem ─── //\n\ntype MenubarCheckboxItemProps = React.ComponentProps<typeof MenubarPrimitive.CheckboxItem>;\n\nfunction MenubarCheckboxItem({\n className,\n children,\n onSelect,\n ...props\n}: MenubarCheckboxItemProps) {\n // Default UX: keep the menu open across toggles so consumers can flip\n // multiple checkboxes in one pass. If a consumer passes their own onSelect,\n // they own the behavior (call `event.preventDefault()` to keep this default).\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <MenubarPrimitive.CheckboxItem\n data-slot=\"menubar-checkbox-item\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-menubar-menu__indicator\" aria-hidden=\"true\">\n <MenubarPrimitive.ItemIndicator>\n <Check className=\"ddga-menubar-menu__indicator-icon\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n </MenubarPrimitive.CheckboxItem>\n );\n}\n\ntype MenubarRadioGroupProps = React.ComponentProps<typeof MenubarPrimitive.RadioGroup>;\n\nfunction MenubarRadioGroup(props: MenubarRadioGroupProps) {\n return <MenubarPrimitive.RadioGroup data-slot=\"menubar-radio-group\" {...props} />;\n}\n\ntype MenubarRadioItemProps = React.ComponentProps<typeof MenubarPrimitive.RadioItem>;\n\nfunction MenubarRadioItem({ className, children, onSelect, ...props }: MenubarRadioItemProps) {\n // Same default-open behavior as CheckboxItem — selecting a radio without\n // the menu visually confirming the new state is a frustrating dead-feel.\n const handleSelect =\n onSelect ??\n ((event: Event) => {\n event.preventDefault();\n });\n return (\n <MenubarPrimitive.RadioItem\n data-slot=\"menubar-radio-item\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--checkable', className)}\n onSelect={handleSelect}\n {...props}\n >\n <span className=\"ddga-menubar-menu__indicator\" aria-hidden=\"true\">\n <MenubarPrimitive.ItemIndicator>\n <span className=\"ddga-menubar-menu__radio-dot\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n </MenubarPrimitive.RadioItem>\n );\n}\n\n// ─── 6. Label + Separator + Group ─── //\n\ntype MenubarLabelProps = React.ComponentProps<typeof MenubarPrimitive.Label>;\n\nfunction MenubarLabel({ className, ...props }: MenubarLabelProps) {\n return (\n <MenubarPrimitive.Label\n data-slot=\"menubar-label\"\n className={cn('ddga-menubar-menu__group-label', className)}\n {...props}\n />\n );\n}\n\ntype MenubarSeparatorProps = React.ComponentProps<typeof MenubarPrimitive.Separator>;\n\nfunction MenubarSeparator({ className, ...props }: MenubarSeparatorProps) {\n return (\n <MenubarPrimitive.Separator\n data-slot=\"menubar-separator\"\n className={cn('ddga-menubar-menu__separator', className)}\n {...props}\n />\n );\n}\n\ntype MenubarGroupProps = React.ComponentProps<typeof MenubarPrimitive.Group>;\n\nfunction MenubarGroup(props: MenubarGroupProps) {\n return <MenubarPrimitive.Group data-slot=\"menubar-group\" {...props} />;\n}\n\n// ─── 7. Submenu (Sub + SubTrigger + SubContent) ─── //\n\ntype MenubarSubProps = React.ComponentProps<typeof MenubarPrimitive.Sub>;\n\nfunction MenubarSub(props: MenubarSubProps) {\n return <MenubarPrimitive.Sub {...props} />;\n}\n\ntype MenubarSubTriggerProps = React.ComponentProps<typeof MenubarPrimitive.SubTrigger> & {\n startIcon?: ReactNode;\n};\n\nfunction MenubarSubTrigger({ className, startIcon, children, ...props }: MenubarSubTriggerProps) {\n return (\n <MenubarPrimitive.SubTrigger\n data-slot=\"menubar-sub-trigger\"\n className={cn('ddga-menubar-menu__item', 'ddga-menubar-menu__item--sub', className)}\n {...props}\n >\n {startIcon ? (\n <span className=\"ddga-menubar-menu__icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n ) : null}\n <span className=\"ddga-menubar-menu__label\">{children}</span>\n <ChevronRight className=\"ddga-menubar-menu__sub-chevron\" aria-hidden=\"true\" />\n </MenubarPrimitive.SubTrigger>\n );\n}\n\ntype MenubarSubContentProps = React.ComponentProps<typeof MenubarPrimitive.SubContent> &\n VariantProps<typeof menubarContentVariants>;\n\nfunction MenubarSubContent({ size, className, ...props }: MenubarSubContentProps) {\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <MenubarPrimitive.Portal container={portalContainer}>\n <MenubarPrimitive.SubContent\n data-slot=\"menubar-sub-content\"\n className={cn(menubarContentVariants({ size }), className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n );\n}\n\n// ─── 8. Exports ─── //\n\nexport {\n Menubar,\n MenubarMenu,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarGroup,\n MenubarSub,\n MenubarSubTrigger,\n MenubarSubContent,\n menubarContentVariants,\n menubarTriggerVariants,\n};\nexport type {\n MenubarProps,\n MenubarMenuProps,\n MenubarTriggerProps,\n MenubarContentProps,\n MenubarItemProps,\n MenubarCheckboxItemProps,\n MenubarRadioGroupProps,\n MenubarRadioItemProps,\n MenubarLabelProps,\n MenubarSeparatorProps,\n MenubarGroupProps,\n MenubarSubProps,\n MenubarSubTriggerProps,\n MenubarSubContentProps,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Visual-only chronological compound. Semantic `<ol>`/`<li>` so the event\n// count + order are assistive-tech-readable. The connector line is CSS-drawn\n// via a pseudo-element between siblings (the `Steps` technique) — no separator\n// component for consumers to misuse. Markers carry a `status` that tints the\n// node via the semantic `--ddga-color-*` palette; the status is PURELY VISUAL,\n// so the meaning (\"Failed\") must live in the content text — never rely on the\n// dot colour alone. \"Activity feed\" is a composition of this primitive\n// (Timeline + Avatar + text in the content slot), not a separate component.\n\nconst timelineVariants = cva('ddga-timeline', {\n variants: {\n size: {\n sm: 'ddga-timeline--sm',\n md: 'ddga-timeline--md',\n },\n orientation: {\n vertical: 'ddga-timeline--vertical',\n horizontal: 'ddga-timeline--horizontal',\n },\n },\n defaultVariants: {\n size: 'md',\n orientation: 'vertical',\n },\n});\n\ntype TimelineStatus = 'default' | 'success' | 'error' | 'warning' | 'info';\n\nconst timelineMarkerVariants = cva('ddga-timeline__marker', {\n variants: {\n status: {\n default: 'ddga-timeline__marker--default',\n success: 'ddga-timeline__marker--success',\n error: 'ddga-timeline__marker--error',\n warning: 'ddga-timeline__marker--warning',\n info: 'ddga-timeline__marker--info',\n },\n },\n defaultVariants: {\n status: 'default',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface TimelineProps extends React.ComponentProps<'ol'>, VariantProps<typeof timelineVariants> {}\n\ntype TimelineItemProps = React.ComponentProps<'li'>;\n\ninterface TimelineMarkerProps\n extends React.ComponentProps<'span'>, VariantProps<typeof timelineMarkerVariants> {}\n\ntype TimelineContentProps = React.ComponentProps<'div'>;\ntype TimelineTitleProps = React.ComponentProps<'span'>;\ntype TimelineDescriptionProps = React.ComponentProps<'span'>;\ntype TimelineTimeProps = React.ComponentProps<'time'>;\n\n// ─── 3. Components ─── //\n\nfunction Timeline({ size, orientation, className, ...props }: TimelineProps) {\n // `<ol>` is the right semantic for an ordered sequence of events; the\n // implicit listitem role on children makes the count assistive-tech-readable.\n return (\n <ol\n data-slot=\"timeline\"\n data-orientation={orientation ?? 'vertical'}\n className={cn(timelineVariants({ size, orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction TimelineItem({ className, ...props }: TimelineItemProps) {\n // Always an `<li>` — the parent `<ol>` may only contain `<li>` children, so\n // consumers needing a clickable event put an `<a>` (or router primitive)\n // INSIDE the content, never as the item element itself. This is why no part\n // ships `asChild` (mirrors `Steps`). The item owns the CSS connector segment\n // to the next sibling.\n return (\n <li data-slot=\"timeline-item\" className={cn('ddga-timeline__item', className)} {...props} />\n );\n}\n\nfunction TimelineMarker({ status, className, children, ...props }: TimelineMarkerProps) {\n // Decorative — assistive tech reads the content, not the node. When children\n // are provided they render as a custom icon; otherwise a plain dot is drawn.\n // The `data-status` carries the visual intent for CSS keying.\n const resolved = status ?? 'default';\n // `data-reached` marks a non-default (completed/active) node. The connector\n // line uses it as a CSS sibling gate so a segment fills with the PREVIOUS\n // node's colour ONLY when the NEXT node is also reached — a completed→pending\n // transition stays neutral (the Steps progress-fill semantics).\n const reached = resolved !== 'default';\n return (\n <span\n aria-hidden=\"true\"\n data-slot=\"timeline-marker\"\n data-status={resolved}\n data-reached={reached ? '' : undefined}\n className={cn(timelineMarkerVariants({ status }), className)}\n {...props}\n >\n {children ?? <span className=\"ddga-timeline__dot\" />}\n </span>\n );\n}\n\nfunction TimelineContent({ className, ...props }: TimelineContentProps) {\n return (\n <div\n data-slot=\"timeline-content\"\n className={cn('ddga-timeline__content', className)}\n {...props}\n />\n );\n}\n\nfunction TimelineTitle({ className, ...props }: TimelineTitleProps) {\n return (\n <span data-slot=\"timeline-title\" className={cn('ddga-timeline__title', className)} {...props} />\n );\n}\n\nfunction TimelineDescription({ className, ...props }: TimelineDescriptionProps) {\n return (\n <span\n data-slot=\"timeline-description\"\n className={cn('ddga-timeline__description', className)}\n {...props}\n />\n );\n}\n\nfunction TimelineTime({ className, ...props }: TimelineTimeProps) {\n // Renders a real `<time>`; consumers pass `dateTime` for the machine-readable\n // timestamp while the children carry the human-readable label (\"2h ago\").\n return (\n <time data-slot=\"timeline-time\" className={cn('ddga-timeline__time', className)} {...props} />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Timeline,\n TimelineItem,\n TimelineMarker,\n TimelineContent,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n timelineVariants,\n timelineMarkerVariants,\n};\nexport type {\n TimelineProps,\n TimelineItemProps,\n TimelineMarkerProps,\n TimelineContentProps,\n TimelineTitleProps,\n TimelineDescriptionProps,\n TimelineTimeProps,\n TimelineStatus,\n};\n","'use client';\n\nimport { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { Dialog as DialogPrimitive, VisuallyHidden } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { Search } from '../../internal/icons';\nimport { DgaContext } from '../../providers/DgaContext';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Single structural class — no size/variant axes (a palette is one shape).\n// Kept as cva for barrel parity with the rest of the library + an override\n// seam if variants are ever added.\nconst commandVariants = cva('ddga-command');\n\n// ─── 2. Types ─── //\n\ntype CommandProps = React.ComponentProps<typeof CommandPrimitive> &\n VariantProps<typeof commandVariants>;\ntype CommandInputProps = React.ComponentProps<typeof CommandPrimitive.Input>;\ntype CommandListProps = React.ComponentProps<typeof CommandPrimitive.List>;\ntype CommandEmptyProps = React.ComponentProps<typeof CommandPrimitive.Empty>;\ntype CommandGroupProps = React.ComponentProps<typeof CommandPrimitive.Group>;\ntype CommandSeparatorProps = React.ComponentProps<typeof CommandPrimitive.Separator>;\n\ninterface CommandItemProps extends Omit<\n React.ComponentProps<typeof CommandPrimitive.Item>,\n 'onSelect' | 'value'\n> {\n /**\n * Stable value for filtering + the `onSelect` payload. Required: cmdk would\n * otherwise derive it from the rendered text, so a label / translation /\n * icon change would silently change what `onSelect` receives.\n */\n value: string;\n /** Leading icon — mirrors Menubar / DropdownMenu item icons. */\n startIcon?: React.ReactNode;\n /** Right-aligned keyboard hint, e.g. `\"⌘P\"` — mirrors Menubar / DropdownMenu. */\n shortcut?: React.ReactNode;\n /**\n * Fires when the item is chosen (click / Enter). Receives the item's\n * `value` (cmdk defaults it to the text content when `value` is omitted).\n *\n * Action-oriented: items run a command and don't track selection. Inside\n * `CommandDialog` the consumer closes the dialog here, e.g.\n * `onSelect={() => { setOpen(false); run(); }}`.\n */\n onSelect?: (value: string) => void;\n}\n\ninterface CommandDialogProps extends Pick<\n React.ComponentProps<typeof CommandPrimitive>,\n 'filter' | 'shouldFilter' | 'loop'\n> {\n /** Controlled open state. */\n open?: boolean;\n /** Initial open state when uncontrolled. */\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Key for the built-in document shortcut (with Cmd on macOS / Ctrl elsewhere).\n * Defaults to `'k'` (⌘K / Ctrl+K). Pass `false` to bind no listener and wire\n * your own. The modifier is fixed; only the key is configurable.\n */\n shortcut?: string | false;\n /** Accessible name → visually-hidden `DialogTitle`. Defaults to `\"Command palette\"`. */\n label?: React.ReactNode;\n /** Optional visually-hidden `DialogDescription`. */\n description?: React.ReactNode;\n className?: string;\n /** `CommandInput` + `CommandList` + groups / items. */\n children: React.ReactNode;\n}\n\n// ─── 3. Inline compound (cmdk passthroughs) ─── //\n\n/**\n * Inline command palette (cmdk root). Pass cmdk's `label` to give the search\n * input + listbox their accessible name — cmdk wires it via `aria-labelledby`,\n * which wins over any `aria-label` on `CommandInput`. `CommandDialog` sets this\n * for you from its `label`.\n */\nfunction Command({ className, ...props }: CommandProps) {\n return (\n <CommandPrimitive data-slot=\"command\" className={cn(commandVariants(), className)} {...props} />\n );\n}\n\nfunction CommandInput({\n className,\n placeholder,\n 'aria-label': ariaLabel,\n ...props\n}: CommandInputProps) {\n return (\n <div className=\"ddga-command__input-wrapper\" data-slot=\"command-input-wrapper\">\n <Search className=\"ddga-command__search-icon\" aria-hidden=\"true\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn('ddga-command__input', className)}\n placeholder={placeholder}\n // role=\"combobox\" needs an accessible name. Fall back to the placeholder\n // string so the input is named without forcing a separate label.\n aria-label={ariaLabel ?? (typeof placeholder === 'string' ? placeholder : undefined)}\n {...props}\n />\n </div>\n );\n}\n\nfunction CommandList({ className, ...props }: CommandListProps) {\n // Native overflow scroll — cmdk manages scroll-into-view against this\n // container; wrapping it in ScrollArea would fight that math.\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn('ddga-command__list', className)}\n {...props}\n />\n );\n}\n\nfunction CommandEmpty({ className, ...props }: CommandEmptyProps) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className={cn('ddga-command__empty', className)}\n {...props}\n />\n );\n}\n\nfunction CommandGroup({ className, ...props }: CommandGroupProps) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn('ddga-command__group', className)}\n {...props}\n />\n );\n}\n\nfunction CommandSeparator({\n className,\n 'aria-hidden': ariaHidden = true,\n ...props\n}: CommandSeparatorProps) {\n // cmdk hardcodes role=\"separator\"; a separator is an invalid child of the\n // list's role=\"listbox\" (aria-required-children). It's purely decorative —\n // groups carry the semantics via their headings — so hide it from the a11y\n // tree. cmdk spreads our props before its own attrs, so aria-hidden survives.\n return (\n <CommandPrimitive.Separator\n aria-hidden={ariaHidden}\n data-slot=\"command-separator\"\n className={cn('ddga-command__separator', className)}\n {...props}\n />\n );\n}\n\nfunction CommandItem({\n startIcon,\n shortcut,\n className,\n children,\n keywords,\n ...props\n}: CommandItemProps) {\n // Make the visible label searchable. cmdk filters against `value` + `keywords`,\n // never the rendered text — so with a stable Latin `value` the label (e.g.\n // Arabic) would be unmatchable. When the label is a plain string (our common\n // case; icon/shortcut are separate props), fold it into keywords so typing the\n // label works in any language. `value` stays the stable `onSelect` id.\n const labelText = typeof children === 'string' ? children : undefined;\n const mergedKeywords =\n labelText && !keywords?.includes(labelText) ? [...(keywords ?? []), labelText] : keywords;\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn('ddga-command__item', className)}\n keywords={mergedKeywords}\n {...props}\n >\n {startIcon != null && (\n <span className=\"ddga-command__item-icon\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n <span className=\"ddga-command__item-label\">{children}</span>\n {shortcut != null && <span className=\"ddga-command__item-shortcut\">{shortcut}</span>}\n </CommandPrimitive.Item>\n );\n}\n\n// ─── 4. Dialog surface (Radix Dialog + Command) ─── //\n\nfunction CommandDialog({\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n shortcut = 'k',\n label = 'Command palette',\n description,\n className,\n filter,\n shouldFilter,\n loop,\n children,\n}: CommandDialogProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n const isControlled = controlledOpen !== undefined;\n const open = isControlled ? controlledOpen : internalOpen;\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n // Built-in ⌘K / Ctrl+K toggle (opt-out via `shortcut={false}`). Mirrors\n // Sidebar's Cmd/Ctrl+B. Bind the listener once (per shortcut) and read the\n // live open state through a ref so it isn't torn down on every toggle; goes\n // through `setOpen` so controlled + uncontrolled both work.\n const openRef = useRef(open);\n useEffect(() => {\n openRef.current = open;\n });\n useEffect(() => {\n if (typeof shortcut !== 'string') return;\n const key = shortcut.toLowerCase();\n const onKeyDown = (event: KeyboardEvent) => {\n if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === key) {\n event.preventDefault();\n setOpen(!openRef.current);\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [shortcut, setOpen]);\n\n // Anchor the Portal to the DgaProvider body-level container so data-theme /\n // dir / theme vars inherit and the fixed overlay escapes ancestor\n // transform / overflow:hidden. Mirrors Modal; regression test asserts\n // containment + dark data-theme.\n const ctx = useContext(DgaContext);\n const portalContainer = ctx?.portalEl ?? ctx?.rootEl ?? undefined;\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={setOpen}>\n <DialogPrimitive.Portal container={portalContainer}>\n <DialogPrimitive.Overlay className=\"ddga-command__overlay\" data-slot=\"command-overlay\" />\n <DialogPrimitive.Content\n data-slot=\"command-dialog\"\n className={cn('ddga-command-dialog', className)}\n // Named by the visually-hidden title below. With no description,\n // opt out of Radix's missing-description dev warning via its\n // documented escape hatch (explicit aria-describedby={undefined}).\n {...(description == null ? { 'aria-describedby': undefined } : {})}\n >\n <DialogPrimitive.Title asChild>\n <VisuallyHidden.Root>{label}</VisuallyHidden.Root>\n </DialogPrimitive.Title>\n {description != null && (\n <DialogPrimitive.Description asChild>\n <VisuallyHidden.Root>{description}</VisuallyHidden.Root>\n </DialogPrimitive.Description>\n )}\n <Command\n data-slot=\"command-dialog-command\"\n className=\"ddga-command--dialog\"\n // Name cmdk's listbox + input with the dialog label (cmdk's `label`\n // wins over our per-input aria-label via aria-labelledby).\n label={typeof label === 'string' ? label : 'Command palette'}\n filter={filter}\n shouldFilter={shouldFilter}\n loop={loop}\n >\n {children}\n </Command>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport {\n Command,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandSeparator,\n CommandDialog,\n commandVariants,\n};\nexport type {\n CommandProps,\n CommandInputProps,\n CommandListProps,\n CommandEmptyProps,\n CommandGroupProps,\n CommandSeparatorProps,\n CommandItemProps,\n CommandDialogProps,\n};\n","'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { CaretDown, CaretUp } from '../../internal/icons';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Semantic <table> compound. Layout/density cascade from the root to the leaf\n// parts via descendant selectors (DescriptionList/Accordion pattern), so the\n// row/head/cell parts carry no variant props beyond `align`/`selected`.\n\nconst tableVariants = cva('ddga-table', {\n variants: {\n size: {\n sm: 'ddga-table--sm',\n md: 'ddga-table--md',\n lg: 'ddga-table--lg',\n },\n striped: { true: 'ddga-table--striped' },\n divided: { true: 'ddga-table--divided' },\n bordered: { true: 'ddga-table--bordered' },\n stickyHeader: { true: 'ddga-table--sticky' },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype Align = 'start' | 'center' | 'end';\n\n// ─── 2. Types ─── //\n\ninterface TableProps extends React.ComponentProps<'table'>, VariantProps<typeof tableVariants> {\n /**\n * Accessible name for the **scroll region** wrapping the table. Strongly\n * recommended: a wide table scrolls horizontally, and a named, focusable\n * region lets keyboard and screen-reader users find and scroll it. When\n * provided, the wrapper becomes `role=\"region\"` `tabindex=\"0\"`; when omitted,\n * it degrades to a plain scroll container and a dev warning fires.\n * Note: this names the region, not the `<table>` — use `<TableCaption>` for\n * the table's own name.\n */\n 'aria-label'?: string;\n /** Accessible name for the scroll region, by id reference. See `aria-label`. */\n 'aria-labelledby'?: string;\n /**\n * Caps the scroll region's block-size (number → px) so the body scrolls\n * vertically within it. **Required for `stickyHeader` to engage** — sticky\n * needs a height-constrained, scrollable ancestor; without it the region\n * grows to content height and the header has nothing to stick to.\n */\n maxHeight?: number | string;\n}\n\ninterface TableRowProps extends React.ComponentProps<'tr'> {\n /** Visually highlights the row and sets `data-state=\"selected\"`. Selection\n * semantics for assistive tech come from a checkbox in the cell (see the\n * DataTable recipe), not from the row. */\n selected?: boolean;\n}\n\ninterface TableHeadProps extends Omit<React.ComponentProps<'th'>, 'align' | 'onClick'> {\n align?: Align;\n /** Renders the column as sortable: wraps content in a button and sets\n * `aria-sort`. Sort *logic* is the consumer's — wire `onClick`. */\n sortable?: boolean;\n /** Current sort direction, or `false` when unsorted. */\n sortDirection?: 'asc' | 'desc' | false;\n /** Click handler bound to the sort button (only rendered when `sortable`). */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * Visually-hidden, **caller-localized** cue appended to the sort button's\n * accessible name (e.g. \"activate to sort ascending\"). `aria-sort` already\n * conveys state, but a focused button otherwise announces only its column\n * label; this adds the action cue. Kept as a prop (not hard-coded text) so\n * the design system stays language-neutral — pass Arabic in RTL. Only used\n * when `sortable`. Typed `string` (not `ReactNode`) so interactive content\n * can't be hidden into a keyboard-reachable, invisible trap.\n */\n sortLabel?: string;\n}\n\ninterface TableCellProps extends Omit<React.ComponentProps<'td'>, 'align'> {\n align?: Align;\n}\n\n// ─── 3. Components ─── //\n\nfunction Table({\n size,\n striped,\n divided,\n bordered,\n stickyHeader,\n className,\n maxHeight,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n}: TableProps) {\n const named = Boolean(ariaLabel || ariaLabelledby);\n\n if (process.env.NODE_ENV !== 'production' && !named) {\n console.warn(\n '[ddga] <Table> wraps its table in a horizontally scrollable container. ' +\n 'Pass `aria-label` (or `aria-labelledby`) so keyboard and screen-reader ' +\n 'users can identify and scroll it. Without a name it degrades to a plain ' +\n 'scroll container with no landmark.',\n );\n }\n\n if (process.env.NODE_ENV !== 'production' && ariaLabel && ariaLabelledby) {\n console.warn(\n '[ddga] <Table> received both `aria-label` and `aria-labelledby`. ' +\n '`aria-labelledby` takes precedence; `aria-label` will be ignored by assistive technology.',\n );\n }\n\n return (\n <div\n data-slot=\"table-region\"\n className=\"ddga-table__region\"\n style={maxHeight != null ? { maxBlockSize: maxHeight, overflowY: 'auto' } : undefined}\n {...(named\n ? {\n role: 'region',\n tabIndex: 0,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n }\n : {})}\n >\n <table\n data-slot=\"table\"\n className={cn(tableVariants({ size, striped, divided, bordered, stickyHeader }), className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return (\n <thead data-slot=\"table-header\" className={cn('ddga-table__header', className)} {...props} />\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n return <tbody data-slot=\"table-body\" className={cn('ddga-table__body', className)} {...props} />;\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot data-slot=\"table-footer\" className={cn('ddga-table__footer', className)} {...props} />\n );\n}\n\nfunction TableRow({ className, selected, ...props }: TableRowProps) {\n return (\n <tr\n data-slot=\"table-row\"\n data-state={selected ? 'selected' : undefined}\n className={cn('ddga-table__row', className)}\n {...props}\n />\n );\n}\n\nfunction TableHead({\n className,\n align,\n sortable,\n sortDirection = false,\n sortLabel,\n onClick,\n children,\n ...props\n}: TableHeadProps) {\n const headClass = cn('ddga-table__head', align && `ddga-table__head--align-${align}`, className);\n\n if (process.env.NODE_ENV !== 'production' && sortable && !sortLabel) {\n console.warn(\n '[ddga] <TableHead sortable> has no `sortLabel`. `aria-sort` conveys the ' +\n 'sort state, but pass a localized cue (e.g. \"activate to sort\") so a focused ' +\n 'sort button announces its action to screen-reader users.',\n );\n }\n\n if (!sortable) {\n return (\n <th scope=\"col\" data-slot=\"table-head\" className={headClass} {...props}>\n {children}\n </th>\n );\n }\n\n const ariaSort =\n sortDirection === 'asc' ? 'ascending' : sortDirection === 'desc' ? 'descending' : 'none';\n\n return (\n <th scope=\"col\" data-slot=\"table-head\" aria-sort={ariaSort} className={headClass} {...props}>\n <button\n type=\"button\"\n data-slot=\"table-sort-button\"\n className=\"ddga-table__sort-button\"\n onClick={onClick}\n >\n {children}\n {sortLabel ? <span className=\"ddga-sr-only\">{sortLabel}</span> : null}\n <span className=\"ddga-table__sort-icon\" data-slot=\"table-sort-icon\" aria-hidden=\"true\">\n {sortDirection === 'asc' ? (\n <CaretUp />\n ) : sortDirection === 'desc' ? (\n <CaretDown />\n ) : (\n // Neutral affordance: stacked carets, dimmed via CSS.\n <>\n <CaretUp />\n <CaretDown />\n </>\n )}\n </span>\n </button>\n </th>\n );\n}\n\nfunction TableCell({ className, align, ...props }: TableCellProps) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn('ddga-table__cell', align && `ddga-table__cell--align-${align}`, className)}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('ddga-table__caption', className)}\n {...props}\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport {\n Table,\n TableHeader,\n TableBody,\n TableFooter,\n TableRow,\n TableHead,\n TableCell,\n TableCaption,\n tableVariants,\n};\nexport type { TableProps, TableRowProps, TableHeadProps, TableCellProps };\n","'use client';\n\nimport { useMemo, useRef, useState, Fragment, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\n\n// Default: digits-only, allows the empty string so clearing works. Consumers\n// can pass any full-string regex (e.g. '^[a-zA-Z0-9]+$' for alphanumeric).\nconst DEFAULT_PATTERN = '^[0-9]*$';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the container that overlays the (visually-hidden) input on top of\n// the decorative slot row, mirroring NumberInput's control box.\nconst inputOTPVariants = cva('ddga-input-otp', {\n variants: {\n size: {\n sm: 'ddga-input-otp--sm',\n md: 'ddga-input-otp--md',\n lg: 'ddga-input-otp--lg',\n },\n error: {\n true: 'ddga-input-otp--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface InputOTPProps\n extends\n Omit<React.ComponentProps<'div'>, 'onChange' | 'defaultValue' | 'children'>,\n VariantProps<typeof inputOTPVariants> {\n /** Number of slots. Defaults to 6 (Saudi SMS OTP length). */\n length?: number;\n /** Optional visual grouping; must sum to `length`. Default: one group. */\n groupSizes?: number[];\n /** Controlled value (the entered characters). */\n value?: string;\n /** Uncontrolled initial value. */\n defaultValue?: string;\n onChange?: (value: string) => void;\n /** Fires when all `length` slots are filled. */\n onComplete?: (value: string) => void;\n /** Full-string regex the entered value must match. Defaults to digits-only. */\n pattern?: string;\n /** Render dots instead of characters (PIN entry). */\n mask?: boolean;\n /** Override the divider rendered between groups. */\n separator?: ReactNode;\n disabled?: boolean;\n autoFocus?: boolean;\n name?: string;\n required?: boolean;\n /** Visible field label, auto-associated to the input via `htmlFor`/`id`. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when invalid. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n}\n\n// ─── 3. Helpers ─── //\n\n// Resolve the per-group slot counts. An absent/empty `groupSizes` is one group;\n// a mismatched sum is a caller bug, so dev-warn and fall back rather than render\n// a code whose layout doesn't match its length.\nfunction resolveGroups(length: number, groupSizes: number[] | undefined): number[] {\n if (!groupSizes || groupSizes.length === 0) return [length];\n const sum = groupSizes.reduce((total, n) => total + n, 0);\n if (sum !== length) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n `[@dev-dga/react] InputOTP: groupSizes must sum to length (${length}); ` +\n `got ${sum}. Falling back to a single group.`,\n );\n }\n return [length];\n }\n return groupSizes;\n}\n\nfunction Slot({\n char,\n active,\n caret,\n mask,\n}: {\n char: string | undefined;\n active: boolean;\n caret: boolean;\n mask: boolean;\n}) {\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={active || undefined}\n data-filled={char != null || undefined}\n className=\"ddga-input-otp__slot\"\n >\n {char != null ? (mask ? '•' : char) : null}\n {caret && (\n <div aria-hidden=\"true\" data-slot=\"input-otp-caret\" className=\"ddga-input-otp__caret\" />\n )}\n </div>\n );\n}\n\n// ─── 4. Component ─── //\n\nfunction InputOTP({\n id: externalId,\n length = 6,\n groupSizes,\n value,\n defaultValue,\n onChange,\n onComplete,\n pattern = DEFAULT_PATTERN,\n mask = false,\n separator,\n size,\n disabled,\n autoFocus,\n name,\n required,\n label,\n helperText,\n errorMessage,\n error,\n className,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n ...props\n}: InputOTPProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n const [focused, setFocused] = useState(false);\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState(defaultValue ?? '');\n const current = isControlled ? value : internal;\n\n // Compile the pattern once per change to `pattern`. A malformed regex is a\n // caller bug — dev-warn and fall back to digits-only rather than throw on\n // every keystroke (mirrors the groupSizes-mismatch handling).\n const compiledPattern = useMemo(() => {\n try {\n return new RegExp(pattern);\n } catch {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n `[@dev-dga/react] InputOTP: invalid \\`pattern\\` regex \"${pattern}\". ` +\n 'Falling back to digits-only.',\n );\n }\n return new RegExp(DEFAULT_PATTERN);\n }\n }, [pattern]);\n\n // Guards onComplete against firing more than once for the same full value\n // (IME / autofill can deliver the same value across repeated change events).\n const completedRef = useRef<string | null>(null);\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'InputOTP',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n });\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n // Strip whitespace + hyphens first, so a code pasted with display\n // separators (\"123 456\", \"123-456\") still fills — neither is ever a valid\n // OTP/PIN character. Then cap to `length`.\n const next = event.target.value.replace(/[\\s-]/g, '').slice(0, length);\n // Reject the whole (cleaned) candidate if it still doesn't match — the\n // keystroke/paste never lands (mirrors NumberInput). The default pattern\n // allows the empty string, so clearing always works.\n if (!compiledPattern.test(next)) return;\n if (!isControlled) setInternal(next);\n onChange?.(next);\n if (next.length === length) {\n if (completedRef.current !== next) {\n completedRef.current = next;\n onComplete?.(next);\n }\n } else {\n completedRef.current = null;\n }\n }\n\n // Keep the caret at the end so Backspace always removes the last entered char;\n // the visible caret is the fake one we draw on the active slot.\n function moveCaretToEnd() {\n const el = inputRef.current;\n if (el) el.setSelectionRange(el.value.length, el.value.length);\n }\n\n const groups = resolveGroups(length, groupSizes);\n const lastGroup = groups.length - 1;\n // The active slot is where the next character lands (clamped to the last slot\n // when the code is full). Only shown while focused.\n const activeIndex = focused ? Math.min(current.length, length - 1) : -1;\n const inputMode = pattern === DEFAULT_PATTERN ? 'numeric' : 'text';\n\n return (\n <div data-slot=\"input-otp-field\" className=\"ddga-field\" {...props}>\n {label && (\n <label htmlFor={fieldId} className=\"ddga-input-otp__label\">\n {label}\n {required && (\n <span aria-hidden=\"true\" className=\"ddga-input-otp__required\">\n *\n </span>\n )}\n </label>\n )}\n <div\n className={cn(inputOTPVariants({ size, error: hasError }), className)}\n data-slot=\"input-otp\"\n >\n {/* The real control — overlays the row, visually transparent. Paste,\n SMS autofill, typing, and Backspace all flow through its onChange. */}\n <input\n {...controlProps}\n ref={inputRef}\n type=\"text\"\n inputMode={inputMode}\n autoComplete=\"one-time-code\"\n // The slots are the visible UI, but the value itself never renders\n // here (the input is transparent), so masking is purely the slots'\n // concern — even password managers can't read a visually-empty field.\n value={current}\n maxLength={length}\n disabled={disabled}\n autoFocus={autoFocus}\n name={name}\n required={required}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n onChange={handleChange}\n onFocus={() => {\n setFocused(true);\n moveCaretToEnd();\n }}\n onBlur={() => setFocused(false)}\n onPointerUp={moveCaretToEnd}\n className=\"ddga-input-otp__input\"\n data-slot=\"input-otp-input\"\n />\n {/* Decorative slot row. Forced LTR so the code is always read/entered\n left-to-right even in an RTL form (DGA convention). */}\n <div dir=\"ltr\" aria-hidden=\"true\" data-slot=\"input-otp-row\" className=\"ddga-input-otp__row\">\n {groups.map((count, groupIndex) => {\n const start = groups.slice(0, groupIndex).reduce((total, n) => total + n, 0);\n return (\n <Fragment key={groupIndex}>\n <div data-slot=\"input-otp-group\" className=\"ddga-input-otp__group\">\n {Array.from({ length: count }, (_, offset) => {\n const index = start + offset;\n return (\n <Slot\n key={index}\n char={current[index]}\n active={index === activeIndex}\n caret={index === activeIndex && current.length < length}\n mask={mask}\n />\n );\n })}\n </div>\n {groupIndex < lastGroup && (\n <span\n aria-hidden=\"true\"\n data-slot=\"input-otp-separator\"\n className=\"ddga-input-otp__separator\"\n >\n {separator ?? <span className=\"ddga-input-otp__separator-dash\" />}\n </span>\n )}\n </Fragment>\n );\n })}\n </div>\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 5. Exports ─── //\n\nexport { InputOTP, inputOTPVariants };\nexport type { InputOTPProps };\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { ExternalLink } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst linkVariants = cva('ddga-link', {\n variants: {\n variant: {\n // Inline links in running prose. Underlined always — color alone fails\n // WCAG 1.4.1 when a link sits inside a block of text.\n default: 'ddga-link--default',\n // Links in UI chrome (footers, meta rows) where context makes them\n // obviously links: no underline until hover.\n subtle: 'ddga-link--subtle',\n // Block-level CTAs (\"Learn more →\"): inline-flex with gapped icons,\n // no underline. Not for mid-sentence use.\n standalone: 'ddga-link--standalone',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface LinkProps extends React.ComponentProps<'a'>, VariantProps<typeof linkVariants> {\n /**\n * External link: appends a decorative ↗ icon and sets\n * `rel=\"noopener noreferrer\"` (merged with any consumer `rel`). `target` is\n * left to the consumer — forcing `_blank` is an a11y opinion best owned by\n * the caller.\n */\n external?: boolean;\n /** Leading icon (standalone-friendly). Decorative — rendered `aria-hidden`. */\n startIcon?: ReactNode;\n /**\n * Trailing icon. Decorative. When both `external` and `endIcon` are set, the\n * consumer's `endIcon` wins (the auto ↗ is suppressed).\n */\n endIcon?: ReactNode;\n /**\n * Flip start/end icons horizontally in RTL (for directional arrows/chevrons).\n * Does NOT apply to the auto `external` icon, which is RTL-neutral by design\n * (a symbolic \"leaves the site\" cue, not a directional glyph).\n */\n iconFlip?: boolean;\n /**\n * Render as the single child element instead of an `<a>`. Lets consumers\n * compose with framework routers (`<Link asChild><RouterLink to=\"…\">…</RouterLink></Link>`).\n * `Slottable` marks where the child's own content lands so the icons render\n * around it. In this mode the href dev-warning is skipped — the consumer's\n * element owns its attributes.\n */\n asChild?: boolean;\n}\n\n// ─── 3. Component ─── //\n\nfunction Link({\n variant,\n external,\n startIcon,\n endIcon,\n iconFlip,\n asChild,\n className,\n children,\n rel,\n ...props\n}: LinkProps) {\n // Dev-only: a non-asChild Link without an href isn't a real link (no role,\n // not focusable). In asChild mode the consumer's element owns the href.\n if (process.env.NODE_ENV === 'development' && !asChild && props.href == null) {\n console.warn(\n '[@dev-dga/react] Link rendered without an `href`. A link needs an href ' +\n 'to be focusable and exposed as a link to assistive tech. Provide `href`, ' +\n 'use `asChild` to render your own element (e.g. a router Link), or use ' +\n '`Button variant=\"ghost\"` for an action that is not navigation.',\n );\n }\n\n const Comp = asChild ? SlotPrimitive.Slot : 'a';\n\n // Merge external rel tokens with any consumer-provided rel, de-duplicated.\n const relValue = external\n ? Array.from(\n new Set([...(rel ? rel.split(/\\s+/).filter(Boolean) : []), 'noopener', 'noreferrer']),\n ).join(' ')\n : rel;\n\n const showExternalIcon = external && !endIcon;\n\n return (\n <Comp\n data-slot=\"link\"\n className={cn(linkVariants({ variant }), className)}\n rel={relValue}\n {...props}\n >\n {startIcon && (\n <span\n className={cn('ddga-link__icon', iconFlip && 'ddga-icon-flip')}\n data-slot=\"link-start-icon\"\n aria-hidden=\"true\"\n >\n {startIcon}\n </span>\n )}\n {asChild ? <SlotPrimitive.Slottable>{children}</SlotPrimitive.Slottable> : children}\n {endIcon && (\n <span\n className={cn('ddga-link__icon', iconFlip && 'ddga-icon-flip')}\n data-slot=\"link-end-icon\"\n aria-hidden=\"true\"\n >\n {endIcon}\n </span>\n )}\n {showExternalIcon && (\n <span\n className=\"ddga-link__icon ddga-link__icon--external\"\n data-slot=\"link-external-icon\"\n aria-hidden=\"true\"\n >\n <ExternalLink />\n </span>\n )}\n </Comp>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Link, linkVariants };\nexport type { LinkProps };\n","'use client';\n\nimport { useRef, useState } from 'react';\nimport { cn } from '../../utils/cn';\nimport { Input, type InputProps } from '../Input';\nimport { Button } from '../Button';\nimport { Search, Close } from '../../internal/icons';\n\n// ─── 1. Types ─── //\n\n// SearchBox composes Input — it reuses Input's field a11y (label / helper /\n// error), sizing and adornment slots — and adds search behavior on top:\n// a leading magnifier, a clear (×) button, Escape-to-clear and `onSearch`.\n// It is a form control, so (like Input) it does NOT take `asChild`.\ninterface SearchBoxProps extends Omit<InputProps, 'startAdornment' | 'endAdornment' | 'type'> {\n /** Fires on Enter with the current query string. */\n onSearch?: (value: string) => void;\n /** Fires when the field is cleared (clear button or Escape). */\n onClear?: () => void;\n /** Show the clear (×) button while the field has a value. Default `true`. */\n clearable?: boolean;\n /** Accessible label for the clear button. Default `'Clear search'`. */\n clearLabel?: string;\n}\n\n// ─── 2. Helper ─── //\n\n// Set a React-controlled input's value imperatively and notify React, so the\n// clear action works identically in controlled and uncontrolled mode: the\n// native setter bypasses React's value tracker and the dispatched `input`\n// event drives the same `onChange` path a keystroke would. (Canonical\n// controlled-input clearing technique.)\nfunction setNativeInputValue(el: HTMLInputElement, value: string) {\n const setter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set;\n setter?.call(el, value);\n el.dispatchEvent(new Event('input', { bubbles: true }));\n}\n\n// ─── 3. Component ─── //\n\nfunction SearchBox({\n value,\n defaultValue,\n onChange,\n onKeyDown,\n onSearch,\n onClear,\n clearable = true,\n clearLabel = 'Clear search',\n className,\n ...rest\n}: SearchBoxProps) {\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Internally controlled: we always feed `value` to the inner input so the\n // clear button's visibility tracks the current text in both modes.\n const isControlled = value !== undefined;\n const [internal, setInternal] = useState<string>(\n defaultValue != null ? String(defaultValue) : '',\n );\n const currentValue = isControlled ? String(value ?? '') : internal;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (!isControlled) setInternal(event.target.value);\n onChange?.(event);\n };\n\n const clear = () => {\n const el = inputRef.current;\n if (!el) return;\n setNativeInputValue(el, '');\n el.focus();\n onClear?.();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n\n if (event.key === 'Enter') {\n onSearch?.(currentValue);\n } else if (event.key === 'Escape' && currentValue.length > 0) {\n // First Escape clears the query; stop it here so a parent overlay\n // (Modal/Popover) only closes on a second, now-empty Escape.\n event.preventDefault();\n event.stopPropagation();\n clear();\n }\n };\n\n const showClear = clearable && currentValue.length > 0;\n\n return (\n <Input\n {...rest}\n ref={inputRef}\n type=\"search\"\n value={currentValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n className={cn('ddga-search-box', className)}\n startAdornment={<Search data-slot=\"search-box-icon\" aria-hidden=\"true\" />}\n endAdornment={\n showClear ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={clearLabel}\n data-slot=\"search-box-clear\"\n onClick={clear}\n >\n <Close aria-hidden=\"true\" />\n </Button>\n ) : undefined\n }\n />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { SearchBox };\nexport type { SearchBoxProps };\n","'use client';\n\nimport type { ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\n// ─── 1. Variants (cva) ─── //\n//\n// Presentational content-list compound (sibling to Timeline / DescriptionList):\n// semantic <ul>/<ol> + <li>, layout cascading from the root variant via\n// descendant selectors. No `asChild` — a <ul>/<ol>/<li> structure can't be\n// Slot-substituted without breaking list semantics; for interactive rows\n// compose `Link` / `Button` inside an item (both already do `asChild`).\n//\n// `plain` = no markers, flex rows (icon / content / action). The marker\n// variants show the native ::marker and are **direction-localized** (the CSS\n// swaps the counter style under `[dir='rtl']`, the way the rest of the system\n// themes by `dir`):\n// • `bulleted` → disc (direction-neutral)\n// • `numbered` → decimal (LTR) / arabic-indic ١٢٣ (RTL)\n// • `lettered` → lower-alpha (LTR) / arabic-abjad أ‑ب‑ج (RTL)\n// `numbered` / `lettered` are ordered, so the root renders as <ol> and the\n// ordinals are real (and `start` / `reversed` are honored).\n\nconst listVariants = cva('ddga-list', {\n variants: {\n variant: {\n plain: 'ddga-list--plain',\n bulleted: 'ddga-list--bulleted',\n numbered: 'ddga-list--numbered',\n lettered: 'ddga-list--lettered',\n },\n divided: {\n true: 'ddga-list--divided',\n },\n },\n defaultVariants: {\n variant: 'plain',\n },\n});\n\n// ─── 2. Types ─── //\n\n// Drop the (deprecated, marker-shape) <ul> `type` attribute — markers are\n// driven by the variant + CSS, not this prop. The ordered-list `start` /\n// `reversed` attributes are surfaced explicitly for the `numbered` variant.\ninterface ListProps\n extends Omit<React.ComponentProps<'ul'>, 'type'>, VariantProps<typeof listVariants> {\n /** Ordered variants (`numbered` / `lettered`) only — the ordinal to start from. */\n start?: number;\n /** Ordered variants only — count the ordinals down instead of up. */\n reversed?: boolean;\n}\n\ntype ListItemProps = React.ComponentProps<'li'>;\ntype ListItemIconProps = React.ComponentProps<'span'>;\ntype ListItemActionProps = React.ComponentProps<'div'>;\n\ninterface ListItemContentProps extends React.ComponentProps<'div'> {\n /**\n * Primary line. Ignored if `children` is provided — `children` fully\n * replaces the primary/secondary rendering (use one or the other).\n */\n primary?: ReactNode;\n /** Secondary, de-emphasized line below the primary. Ignored if `children` is set. */\n secondary?: ReactNode;\n}\n\n// ─── 3. Components ─── //\n\nfunction List({ variant, divided, className, start, reversed, ...props }: ListProps) {\n const classes = cn(listVariants({ variant, divided }), className);\n // Ordered variants need a real <ol> so the ordinals are semantic and `start` /\n // `reversed` are honored; `plain` / `bulleted` are <ul>. Two branches keep\n // each element's prop+ref types correct (a single dynamic tag can't).\n const ordered = variant === 'numbered' || variant === 'lettered';\n if (ordered) {\n return (\n <ol\n data-slot=\"list\"\n data-variant={variant}\n className={classes}\n start={start}\n reversed={reversed}\n {...(props as React.ComponentProps<'ol'>)}\n />\n );\n }\n return <ul data-slot=\"list\" data-variant={variant ?? 'plain'} className={classes} {...props} />;\n}\n\nfunction ListItem({ className, ...props }: ListItemProps) {\n return <li data-slot=\"list-item\" className={cn('ddga-list__item', className)} {...props} />;\n}\n\n// Leading slot — an icon or Avatar container. Decorative by default; the\n// consumer marks the actual glyph `aria-hidden`. Note: the icon / content /\n// action slots only lay out as a row under `variant=\"plain\"`; bulleted /\n// numbered items are `display: list-item` (for the native marker) and stack.\nfunction ListItemIcon({ className, ...props }: ListItemIconProps) {\n return (\n <span data-slot=\"list-item-icon\" className={cn('ddga-list__icon', className)} {...props} />\n );\n}\n\nfunction ListItemContent({\n primary,\n secondary,\n className,\n children,\n ...props\n}: ListItemContentProps) {\n // Dev-only: `children` fully replaces the primary/secondary rendering, so\n // passing both silently drops `primary`/`secondary` — warn the consumer.\n if (\n process.env.NODE_ENV === 'development' &&\n children != null &&\n (primary != null || secondary != null)\n ) {\n console.warn(\n '[@dev-dga/react] ListItemContent: `children` overrides `primary`/' +\n '`secondary`. Pass one or the other, not both.',\n );\n }\n return (\n <div data-slot=\"list-item-content\" className={cn('ddga-list__content', className)} {...props}>\n {children ?? (\n <>\n {primary != null && primary !== '' && (\n <span data-slot=\"list-item-primary\" className=\"ddga-list__primary\">\n {primary}\n </span>\n )}\n {secondary != null && secondary !== '' && (\n <span data-slot=\"list-item-secondary\" className=\"ddga-list__secondary\">\n {secondary}\n </span>\n )}\n </>\n )}\n </div>\n );\n}\n\n// Trailing slot — meta text or an action control, pushed to the inline-end edge.\nfunction ListItemAction({ className, ...props }: ListItemActionProps) {\n return (\n <div data-slot=\"list-item-action\" className={cn('ddga-list__action', className)} {...props} />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { List, ListItem, ListItemIcon, ListItemContent, ListItemAction, listVariants };\nexport type {\n ListProps,\n ListItemProps,\n ListItemIconProps,\n ListItemContentProps,\n ListItemActionProps,\n};\n","'use client';\n\nimport { type ReactNode } from 'react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { QuoteMark } from '../../internal/icons';\n\n// ─── 1. Variants (cva) ─── //\n\nconst quoteVariants = cva('ddga-quote', {\n variants: {\n variant: {\n /** Inline-start accent border (SA Green). The everyday blockquote. */\n default: 'ddga-quote--default',\n /** Large editorial quote, centered, prominent mark — breaks up prose. */\n pullquote: 'ddga-quote--pullquote',\n /** Card surface (border + bg + shadow), sized for an avatar + attribution. */\n testimonial: 'ddga-quote--testimonial',\n /** Bare — no border, no surface. For inline / tightly-composed use. */\n plain: 'ddga-quote--plain',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\n// ─── 2. Types ─── //\n\ninterface QuoteProps\n // Base on the generic HTML attribute set: the root element varies (a <figure>\n // when captioned, else a bare <blockquote>), so element-specific props (and a\n // single ref type) don't apply. The native `role`/`cite` attributes are\n // forwarded via `...props` like any other HTML attribute.\n extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof quoteVariants> {\n /** The quote text. Rendered inside the `<blockquote>`. */\n children?: ReactNode;\n /** Show a decorative opening quotation mark (RTL-flipped). Defaults to `false`. */\n quoteMark?: boolean;\n /**\n * Attribution media (e.g. an `<Avatar />`), rendered at the inline-start of the\n * caption. Only shown alongside textual attribution (`author`/`byline`/`source`)\n * — an avatar with no name is decorative-only and would leave the\n * `<figcaption>` empty to assistive tech, so it is dropped on its own. Most\n * natural on `testimonial`. Quote renders whatever node you pass — it takes no\n * Avatar dependency.\n */\n avatar?: ReactNode;\n /** Attribution name (e.g. the person quoted). Rendered as plain text. */\n author?: ReactNode;\n /**\n * Secondary attribution line below the author — typically a job title or\n * affiliation (e.g. \"Product Manager, DGA\"). Named `byline` rather than `role`\n * so the native ARIA `role` attribute stays available on the root element.\n */\n byline?: ReactNode;\n /** Title of the work, rendered in a real `<cite>` element. */\n source?: ReactNode;\n /**\n * URL of the source document — set as the `cite=` **attribute** on the\n * `<blockquote>` (machine-readable, not visible). For a visible work title use\n * `source`.\n */\n cite?: string;\n}\n\ntype QuoteContentProps = React.ComponentProps<'div'> & { asChild?: boolean };\ntype QuoteCaptionProps = React.ComponentProps<'figcaption'> & { asChild?: boolean };\ntype QuoteAuthorProps = React.ComponentProps<'span'> & { asChild?: boolean };\ntype QuoteSourceProps = React.ComponentProps<'cite'> & { asChild?: boolean };\n\n// ─── 3. Components ─── //\n\n/**\n * Visual-only quote. Renders a `<blockquote>`; when textual attribution\n * (`author`/`byline`/`source`) is present it is wrapped in a `<figure>` with a\n * `<figcaption>` (a `<figcaption>` must not be empty, so a bare quote stays a\n * lone `<blockquote>`).\n *\n * No `asChild` on the root: the `figure`/`blockquote`/`figcaption` composite has\n * fixed semantics (documented carve-out, mirrors `EmptyState`/`Timeline`/`List`).\n * The exported sub-parts carry `asChild` for hand-assembled compositions.\n */\nfunction Quote({\n variant,\n quoteMark = false,\n avatar,\n author,\n byline,\n source,\n cite,\n className,\n children,\n ...props\n}: QuoteProps) {\n // Avatar alone is NOT attribution: it would leave the <figcaption> empty to\n // assistive tech (the avatar wrapper is aria-hidden). The figure path requires\n // at least one textual attribution field.\n const hasAttribution = author != null || byline != null || source != null;\n\n const mark = quoteMark ? <QuoteMark aria-hidden=\"true\" className=\"ddga-quote__mark\" /> : null;\n\n // No attribution → a bare <blockquote> is the root (an empty <figcaption>\n // would be invalid HTML). The figure-typed `...props` (global HTML attrs:\n // id/style/aria-*/data-*) are still forwarded — they apply to a <blockquote>\n // just the same.\n if (!hasAttribution) {\n return (\n <blockquote\n data-slot=\"quote\"\n data-variant={variant ?? 'default'}\n className={cn(quoteVariants({ variant }), className)}\n cite={cite}\n {...props}\n >\n {mark}\n <QuoteContent>{children}</QuoteContent>\n </blockquote>\n );\n }\n\n return (\n <figure\n data-slot=\"quote\"\n data-variant={variant ?? 'default'}\n className={cn(quoteVariants({ variant }), className)}\n {...props}\n >\n <blockquote data-slot=\"quote-blockquote\" className=\"ddga-quote__blockquote\" cite={cite}>\n {mark}\n <QuoteContent>{children}</QuoteContent>\n </blockquote>\n <QuoteCaption>\n {avatar != null ? (\n <span data-slot=\"quote-avatar\" aria-hidden=\"true\" className=\"ddga-quote__avatar\">\n {avatar}\n </span>\n ) : null}\n {/* At least one of these is non-null here (it's what gates the figure). */}\n <span className=\"ddga-quote__attribution\">\n {author != null ? <QuoteAuthor>{author}</QuoteAuthor> : null}\n {byline != null ? <span className=\"ddga-quote__byline\">{byline}</span> : null}\n {source != null ? <QuoteSource>{source}</QuoteSource> : null}\n </span>\n </QuoteCaption>\n </figure>\n );\n}\n\n/** Body wrapper inside the `<blockquote>`. */\nfunction QuoteContent({ asChild, className, ...props }: QuoteContentProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'div';\n return (\n <Comp data-slot=\"quote-content\" className={cn('ddga-quote__content', className)} {...props} />\n );\n}\n\n/** Caption (attribution) below the quote. Pair with a `<figure>` root. */\nfunction QuoteCaption({ asChild, className, ...props }: QuoteCaptionProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'figcaption';\n return (\n <Comp data-slot=\"quote-caption\" className={cn('ddga-quote__caption', className)} {...props} />\n );\n}\n\n/** Attribution name. */\nfunction QuoteAuthor({ asChild, className, ...props }: QuoteAuthorProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'span';\n return (\n <Comp data-slot=\"quote-author\" className={cn('ddga-quote__author', className)} {...props} />\n );\n}\n\n/** Title of the cited work — a real `<cite>` element. */\nfunction QuoteSource({ asChild, className, ...props }: QuoteSourceProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'cite';\n return (\n <Comp data-slot=\"quote-source\" className={cn('ddga-quote__source', className)} {...props} />\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { Quote, QuoteContent, QuoteCaption, QuoteAuthor, QuoteSource, quoteVariants };\nexport type {\n QuoteProps,\n QuoteContentProps,\n QuoteCaptionProps,\n QuoteAuthorProps,\n QuoteSourceProps,\n};\n","'use client';\n\nimport { Collapsible as CollapsiblePrimitive } from 'radix-ui';\nimport { cn } from '../../utils/cn';\n\n// ─── Collapsible ─── //\n//\n// The single-panel disclosure primitive — the building block Accordion is\n// built on. A thin, themed wrapper over Radix `Collapsible`: Root / Trigger /\n// Content. No size or variant `cva` — the consumer owns the trigger's look\n// (asChild-first), so there is nothing to vary; `cn()` only, like List/Quote\n// sub-parts.\n//\n// Radix handles all disclosure state (open / closed via `data-state`),\n// `aria-expanded` / `aria-controls` wiring, button semantics, and Enter/Space.\n// Content height-slides via `--radix-collapsible-content-height`, mirroring\n// the Accordion pattern; the inner wrapper carries the clip so the animation\n// stays clean (no opinionated padding — content is generic).\n\ntype CollapsibleProps = React.ComponentProps<typeof CollapsiblePrimitive.Root>;\ntype CollapsibleTriggerProps = React.ComponentProps<typeof CollapsiblePrimitive.Trigger>;\ntype CollapsibleContentProps = React.ComponentProps<typeof CollapsiblePrimitive.Content>;\n\nfunction Collapsible({ className, ...props }: CollapsibleProps) {\n return (\n <CollapsiblePrimitive.Root\n data-slot=\"collapsible\"\n className={cn('ddga-collapsible', className)}\n {...props}\n />\n );\n}\n\n// asChild is forwarded straight to the Radix primitive (which handles Slot\n// internally) — we don't re-add it. Same rule as our other Radix-primitive\n// wrappers. Bare trigger gets a minimal reset + focus ring; consumers usually\n// override it with their own button via `asChild`.\nfunction CollapsibleTrigger({ className, ...props }: CollapsibleTriggerProps) {\n return (\n <CollapsiblePrimitive.Trigger\n data-slot=\"collapsible-trigger\"\n className={cn('ddga-collapsible__trigger', className)}\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({ className, children, ...props }: CollapsibleContentProps) {\n return (\n <CollapsiblePrimitive.Content\n data-slot=\"collapsible-content\"\n className={cn('ddga-collapsible__content', className)}\n {...props}\n >\n <div className=\"ddga-collapsible__content-inner\">{children}</div>\n </CollapsiblePrimitive.Content>\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\nexport type { CollapsibleProps, CollapsibleTriggerProps, CollapsibleContentProps };\n","'use client';\n\nimport { useRef, useState, type ReactNode } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\nimport { useFieldA11y, FieldMessage } from '../../field';\nimport { Badge, type BadgeProps } from '../Badge';\n\n// ─── 1. Variants (cva) ─── //\n\n// Applied to the *control* (the bordered box), not the raw <input> — the box\n// owns the border, sizing, focus ring and disabled/error styling so the chips\n// and the text input wrap inside the field. Mirrors Input's box, but the box\n// grows vertically as chips wrap (min-block-size, not a fixed height).\nconst tagInputVariants = cva('ddga-tag-input', {\n variants: {\n size: {\n sm: 'ddga-tag-input--sm',\n md: 'ddga-tag-input--md',\n lg: 'ddga-tag-input--lg',\n },\n error: {\n true: 'ddga-tag-input--error',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\n// ─── 2. Types ─── //\n\n// We own `value` / `defaultValue` (string[] tags, not strings), `onChange`\n// (fires with the tag array), and the design-system `size` variant — so they\n// are stripped from the native input props the rest are spread onto.\ntype NativeInputProps = Omit<\n React.ComponentProps<'input'>,\n 'value' | 'defaultValue' | 'onChange' | 'size'\n>;\n\ninterface TagInputProps\n extends NativeInputProps, Omit<VariantProps<typeof tagInputVariants>, 'error'> {\n /** Controlled tag list. */\n value?: string[];\n /** Uncontrolled initial tag list. */\n defaultValue?: string[];\n /** Fires with the full accepted tag set after every add/remove. */\n onChange?: (tags: string[]) => void;\n /** Visible field label, associated to the text input. */\n label?: ReactNode;\n /** Hint shown below the field. Hidden while an error message is showing. */\n helperText?: ReactNode;\n /** Message shown below the field when invalid. */\n errorMessage?: ReactNode;\n /** Marks the field invalid: sets `aria-invalid` and error styling. */\n error?: boolean;\n /** Caps the number of tags. Adds beyond the cap are no-ops. */\n max?: number;\n /** Allow the same tag more than once. Off → duplicates are rejected. */\n allowDuplicates?: boolean;\n /** Make duplicate detection case-sensitive. Default: case-insensitive. */\n caseSensitive?: boolean;\n /** Consumer gate run on each candidate tag. Return false to reject (draft kept). */\n validate?: (tag: string, tags: string[]) => boolean;\n /** Characters that commit the draft and split a paste. Newline always splits a paste. */\n delimiters?: string[];\n /** Badge variant used for the chips. */\n chipVariant?: BadgeProps['variant'];\n /** Accessible name for each chip's remove button. */\n removeLabel?: (tag: string) => string;\n /** Live-region text announced on add/remove (screen readers). */\n formatAnnouncement?: (tag: string, action: 'add' | 'remove') => string;\n}\n\n// ─── 3. Component ─── //\n\nfunction TagInput({\n id: externalId,\n value,\n defaultValue,\n onChange,\n label,\n helperText,\n errorMessage,\n error,\n size,\n disabled,\n placeholder,\n max,\n allowDuplicates = false,\n caseSensitive = false,\n validate,\n delimiters = [','],\n chipVariant = 'secondary',\n removeLabel = (tag) => `Remove ${tag}`,\n formatAnnouncement = (tag, action) => `${tag} ${action === 'add' ? 'added' : 'removed'}`,\n className,\n ...props\n}: TagInputProps) {\n const isControlled = value !== undefined;\n const [uncontrolledTags, setUncontrolledTags] = useState<string[]>(defaultValue ?? []);\n const tags = isControlled ? value : uncontrolledTags;\n\n const [draft, setDraft] = useState('');\n const [announcement, setAnnouncement] = useState('');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const { fieldId, errorId, helperId, hasError, hasErrorMessage, hasHelper, controlProps } =\n useFieldA11y({\n name: 'TagInput',\n id: externalId,\n label,\n error,\n errorMessage,\n helperText,\n 'aria-label': props['aria-label'],\n 'aria-labelledby': props['aria-labelledby'],\n });\n\n const commit = (next: string[]) => {\n if (!isControlled) setUncontrolledTags(next);\n onChange?.(next);\n };\n\n const norm = (t: string) => (caseSensitive ? t : t.toLowerCase());\n\n // Run raw fragments through the full accept pipeline (trim → drop-empty →\n // max cap → dedup → validate), appending the survivors. Only ever appends,\n // so the accepted set is `next.slice(current.length)`.\n const accept = (raw: string[], current: string[]): string[] => {\n let next = current;\n for (const fragment of raw) {\n const trimmed = fragment.trim();\n if (!trimmed) continue;\n if (max !== undefined && next.length >= max) break;\n if (!allowDuplicates && next.some((t) => norm(t) === norm(trimmed))) continue;\n if (validate && !validate(trimmed, next)) continue;\n next = [...next, trimmed];\n }\n return next;\n };\n\n const announceAdded = (added: string[]) => {\n if (added.length > 0) {\n setAnnouncement(added.map((t) => formatAnnouncement(t, 'add')).join(', '));\n }\n };\n\n const commitDraft = () => {\n const next = accept([draft], tags);\n if (next.length > tags.length) {\n commit(next);\n announceAdded(next.slice(tags.length));\n setDraft('');\n }\n // Rejected (dup / max / validate / empty): keep the draft so it can be fixed.\n };\n\n // Build a paste splitter from the delimiter chars + newlines. `-` is escaped\n // too (trailing in the class) so a delimiter like `-` can't form an invalid\n // character-class range (e.g. `['|','-']` → `[|-…]` would throw).\n const splitPaste = (text: string): string[] => {\n const escaped = delimiters.map((d) => d.replace(/[.*+?^${}()|[\\]\\\\-]/g, '\\\\$&'));\n const pattern = new RegExp(`[${escaped.join('')}\\\\n\\\\r]`);\n return text.split(pattern);\n };\n\n const removeTag = (index: number) => {\n const removed = tags[index];\n commit(tags.filter((_, i) => i !== index));\n setAnnouncement(formatAnnouncement(removed, 'remove'));\n inputRef.current?.focus();\n };\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n if (event.key === 'Enter') {\n // Always swallow Enter so it adds a tag instead of submitting the form.\n event.preventDefault();\n if (draft.trim()) commitDraft();\n } else if (delimiters.includes(event.key)) {\n event.preventDefault();\n if (draft.trim()) commitDraft();\n } else if (event.key === 'Backspace' && draft === '' && tags.length > 0) {\n event.preventDefault();\n removeTag(tags.length - 1);\n }\n };\n\n const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n if (disabled) return;\n const text = event.clipboardData.getData('text');\n const fragments = splitPaste(text);\n // No delimiter in the pasted text → let it type normally into the draft.\n if (fragments.length <= 1) return;\n event.preventDefault();\n const next = accept(fragments, tags);\n if (next.length > tags.length) {\n commit(next);\n announceAdded(next.slice(tags.length));\n // Clear any in-progress draft so it isn't left stranded after the paste.\n setDraft('');\n }\n };\n\n // Clicking the box chrome (not a chip button or the input) focuses the input.\n const handleBoxMouseDown = (event: React.MouseEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n if (target === inputRef.current || target.closest('button')) return;\n event.preventDefault();\n inputRef.current?.focus();\n };\n\n const chipSize: BadgeProps['size'] = size === 'lg' ? 'md' : 'sm';\n\n return (\n <div data-slot=\"tag-input-field\" className=\"ddga-field\">\n {label && (\n <label htmlFor={fieldId} className=\"ddga-tag-input__label\">\n {label}\n </label>\n )}\n <div\n data-slot=\"tag-input-control\"\n className={cn(tagInputVariants({ size, error: hasError }), className)}\n data-disabled={disabled || undefined}\n onMouseDown={disabled ? undefined : handleBoxMouseDown}\n >\n {tags.length > 0 && (\n <ul data-slot=\"tag-input-list\" className=\"ddga-tag-input__list\" role=\"list\">\n {tags.map((tag, index) => (\n <li\n // Tags can repeat (allowDuplicates) so the value alone is not a\n // stable key; pair it with the index.\n key={`${tag}-${index}`}\n data-slot=\"tag-input-item\"\n className=\"ddga-tag-input__item\"\n // `display:contents` on the list/item can drop the implicit\n // list semantics in some engines; re-assert them explicitly.\n role=\"listitem\"\n >\n <Badge\n variant={chipVariant}\n size={chipSize}\n // Controlled-open: the chip never self-hides — removal flows\n // through onChange so controlled consumers stay the source of truth.\n open\n dismissible={!disabled}\n onDismiss={() => removeTag(index)}\n closeLabel={removeLabel(tag)}\n >\n {tag}\n </Badge>\n </li>\n ))}\n </ul>\n )}\n <input\n // Spread consumer props first, then our a11y contract + handlers so\n // they cannot be clobbered.\n {...props}\n {...controlProps}\n ref={inputRef}\n data-slot=\"tag-input\"\n className=\"ddga-tag-input__field\"\n type=\"text\"\n value={draft}\n disabled={disabled}\n placeholder={tags.length === 0 ? placeholder : undefined}\n onChange={(event) => setDraft(event.target.value)}\n onKeyDown={handleKeyDown}\n onPaste={handlePaste}\n />\n </div>\n <div data-slot=\"tag-input-live\" className=\"ddga-sr-only\" role=\"status\" aria-live=\"polite\">\n {announcement}\n </div>\n {hasErrorMessage && (\n <FieldMessage id={errorId} variant=\"error\">\n {errorMessage}\n </FieldMessage>\n )}\n {hasHelper && (\n <FieldMessage id={helperId} variant=\"helper\">\n {helperText}\n </FieldMessage>\n )}\n </div>\n );\n}\n\n// ─── 4. Exports ─── //\n\nexport { TagInput, tagInputVariants };\nexport type { TagInputProps };\n","'use client';\n\nimport { useState, useMemo, useContext, useEffect, useRef } from 'react';\nimport { Direction as DirectionPrimitive, Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { buildTheme, type DgaTheme } from '@dev-dga/tokens';\nimport { DgaContext, type DgaContextValue } from './DgaContext';\n\ntype DgaRootElement =\n | 'div'\n | 'main'\n | 'nav'\n | 'section'\n | 'article'\n | 'aside'\n | 'header'\n | 'footer';\n\nexport interface DgaProviderProps {\n dir?: 'ltr' | 'rtl';\n locale?: string;\n mode?: 'light' | 'dark';\n /**\n * Brand theme. `theme.primary` accepts a palette name (`'lavender'`),\n * any CSS color string (`'#7C3AED'` , hover/active auto-derived via\n * `color-mix()`), or an explicit `{ base, hover, active, foreground? }`\n * triplet. The override-object pattern (`style={{ '--ddga-color-primary':\n * '...' }}`) still works , `style` wins over `theme`.\n */\n theme?: DgaTheme;\n as?: DgaRootElement;\n className?: string;\n style?: React.CSSProperties;\n children: React.ReactNode;\n}\n\nexport function DgaProvider({\n dir = 'ltr',\n locale,\n mode = 'light',\n theme,\n as: Component = 'div',\n className,\n style: consumerStyle,\n children,\n}: DgaProviderProps) {\n const parentCtx = useContext(DgaContext);\n const isNested = parentCtx !== null;\n // Callback ref + state so context subscribers (e.g. Select's portal\n // container) re-render when the element actually mounts. With useRef\n // the .current update wouldn't trigger a render and a defaultOpen\n // portal would race to <body> before the ref populated.\n const [rootEl, setRootEl] = useState<HTMLElement | null>(null);\n // The portal element is held in a ref (we directly mutate its attributes\n // + inline CSS variables, which the react-hooks/immutability lint rule\n // forbids on state values). A parallel `portalEl` state mirrors the ref\n // so context subscribers re-render once the element mounts.\n const portalRef = useRef<HTMLDivElement | null>(null);\n const [portalEl, setPortalEl] = useState<HTMLElement | null>(null);\n const resolvedLocale = locale ?? (dir === 'rtl' ? 'ar' : 'en');\n\n // Memoize by reference. Stable palette-name themes (`{ primary: 'lavender' }`\n // declared at module scope) never recompute; consumers passing an inline\n // object accept a per-render `buildTheme` call (cheap , small switch\n // statement over a single string).\n const themeVars = useMemo(() => (theme ? buildTheme(theme) : null), [theme]);\n\n // ─── Body-level portal container ─── //\n //\n // Create a sibling-of-body div that mirrors this provider's theme\n // attributes. Overlay portals (Modal, Drawer, DropdownMenu, etc.) anchor\n // here instead of `rootEl` so:\n //\n // - They escape `overflow: hidden` / `transform` ancestors the consumer\n // might wrap us in (Storybook's docs-story preview block is the\n // motivating case — a `transform` ancestor breaks `position: fixed`\n // descendants, clipping modals to the preview rect).\n // - Theme variables, dark mode, RTL still resolve because we copy\n // `data-theme`, `dir`, and inline CSS vars from this provider onto\n // the portal element.\n //\n // One container per DgaProvider instance — cleaned up on unmount. SSR-safe\n // (effects only run client-side; consumers see `portalEl: null` and the\n // overlays fall back to `rootEl`).\n useEffect(() => {\n if (typeof document === 'undefined') return;\n const el = document.createElement('div');\n el.setAttribute('data-slot', 'dga-portal');\n // Position relative for any child popper computing offset against\n // nearest positioned ancestor; z-index so the portal sits above the\n // main content stack.\n el.style.position = 'relative';\n el.style.zIndex = '50';\n document.body.appendChild(el);\n portalRef.current = el;\n // The setState here exposes the freshly-mounted DOM element to context\n // subscribers (overlay components) so they re-render and target the\n // portal on first commit. Single call on mount + single on unmount;\n // not the cascading-render footgun the lint rule guards against.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setPortalEl(el);\n return () => {\n el.remove();\n portalRef.current = null;\n\n setPortalEl(null);\n };\n }, []);\n\n // Mirror theme attributes onto the portal element so its descendants\n // resolve `var(--ddga-*)` and respect dark mode / RTL the same way as\n // descendants of `rootEl`. We mutate via the ref (not the state) so the\n // react-hooks/immutability rule stays happy — and run this on every prop\n // change that affects appearance.\n useEffect(() => {\n const el = portalRef.current;\n if (!el) return;\n el.setAttribute('data-theme', mode);\n el.setAttribute('dir', dir);\n el.style.colorScheme = mode;\n if (themeVars) {\n for (const [k, v] of Object.entries(themeVars)) {\n el.style.setProperty(k, String(v));\n }\n }\n }, [mode, dir, themeVars, portalEl]);\n\n const ctxValue = useMemo<DgaContextValue>(\n () => ({ dir, locale: resolvedLocale, mode, rootEl, portalEl }),\n [dir, resolvedLocale, mode, rootEl, portalEl],\n );\n\n // Radix's Direction.Provider propagates `dir` to portal-rendered content\n // (Tooltip/Select/Toast/Modal) that would otherwise inherit body dir,\n // not the dir on this wrapper element. Nested providers reuse the parent\n // direction via their own Direction.Provider, so this is safe to repeat.\n const inner = <DirectionPrimitive.Provider dir={dir}>{children}</DirectionPrimitive.Provider>;\n\n return (\n <DgaContext.Provider value={ctxValue}>\n <Component\n ref={setRootEl}\n dir={dir}\n lang={resolvedLocale}\n data-slot=\"dga-root\"\n data-theme={mode}\n className={className}\n // Order: colorScheme → theme vars → consumer style. A manually-\n // supplied `style` overrides `theme` (escape hatch preserved per\n // THEMING-PLAN.md: every `--ddga-*` remains plain-CSS overridable).\n style={{ colorScheme: mode, ...(themeVars ?? {}), ...consumerStyle }}\n >\n {isNested ? (\n inner\n ) : (\n <TooltipPrimitive.Provider delayDuration={300} skipDelayDuration={100}>\n {inner}\n </TooltipPrimitive.Provider>\n )}\n </Component>\n </DgaContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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UAAX,EAAoB,OAAO,UAC1B;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA,MAAM;AAAA,MACN,aAAU;AAAA,MACV,cAAY;AAAA,MACZ;AAAA,MAIA,OAAO,EAAE,aAAa,MAAM,GAAI,aAAa,CAAC,GAAI,GAAG,cAAc;AAAA,MAElE,qBACC,QAEA,8CAAC,kBAAAC,QAAiB,UAAjB,EAA0B,eAAe,KAAK,mBAAmB,KAC/D,iBACH;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":["Command","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_class_variance_authority","import_react","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_radix_ui","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","CheckboxPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","RadioGroupPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SwitchPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_react","import_jsx_runtime","SelectPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","AvatarPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TooltipPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DialogPrimitive","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_react","id","import_jsx_runtime","DEFAULT_ICONS","ToastPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TabsPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","AccordionPrimitive","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_radix_ui","import_class_variance_authority","import_jsx_runtime","ProgressPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DropdownMenuPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DialogPrimitive","SlotPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","PopoverPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","AriaCalendarStateContext","AriaCalendarCell","AriaDatePicker","AriaLabel","AriaGroup","AriaDateInput","AriaDateSegment","AriaButton","AriaText","AriaFieldError","AriaPopover","AriaDialog","AriaCalendar","AriaCalendarGrid","AriaCalendarGridHeader","AriaCalendarHeaderCell","AriaCalendarGridBody","import_react","import_jsx_runtime","process","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SliderPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","import_react","import_class_variance_authority","import_jsx_runtime","clamp","import_radix_ui","import_class_variance_authority","import_jsx_runtime","TogglePrimitive","ToggleGroupPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","DEFAULT_ICONS","SlotPrimitive","import_react","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","PopoverPrimitive","import_react","import_radix_ui","import_react","import_react","import_jsx_runtime","value","SlotPrimitive","import_radix_ui","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_class_variance_authority","import_jsx_runtime","ScrollAreaPrimitive","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","MenubarPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_cmdk","import_radix_ui","import_class_variance_authority","import_jsx_runtime","Command","CommandPrimitive","DialogPrimitive","import_class_variance_authority","import_jsx_runtime","import_react","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_class_variance_authority","import_jsx_runtime","SlotPrimitive","import_radix_ui","import_jsx_runtime","CollapsiblePrimitive","import_react","import_class_variance_authority","import_jsx_runtime","import_react","import_radix_ui","import_jsx_runtime","DirectionPrimitive","TooltipPrimitive"]}
|