@dev-dga/react 0.4.0 → 0.5.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 +74 -0
- package/README.md +9 -1
- package/dist/index.cjs +2095 -399
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +690 -4
- package/dist/index.d.ts +690 -4
- package/dist/index.js +1993 -378
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Button/Button.tsx","../src/utils/cn.ts","../src/internal/icons/index.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/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Select/Select.tsx","../src/providers/DgaContext.ts","../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/providers/DgaProvider.tsx","../src/hooks/useDir.ts"],"sourcesContent":["'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 '../../internal/icons';\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 },\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 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 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 }),\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\n/**\n * Internal loading spinner icon.\n * Not exported from the public API , used only by Button and similar components.\n */\nexport function Spinner(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 className=\"ddga-spinner\"\n {...props}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\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","'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\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 const portalContainer = 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 root element. Portal-rendering components (Select, and\n * future Tooltip / Modal / Toast / Popover / DropdownMenu) MUST pass this\n * as their Radix `Portal container={…}` so that `data-theme`, custom\n * theme vars, and `.ddga-theme-*` classes set on the root inherit into\n * the portaled content. Without it, portals mount under <body> and\n * silently miss dark mode + custom themes.\n *\n * Exposed as state (not a ref) so consumers re-render once the element\n * mounts , a useRef wouldn't fire that update and the portal would\n * race to <body> on the first commit.\n */\n rootEl: 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 { 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 root so theme + dark mode inherit.\n // Pattern documented in DgaContext.ts; regression test in Tooltip.test.tsx\n // (\"mounts the tooltip inside the DgaProvider root\"). Falls back to <body>\n // (Radix's default) if the Tooltip is used outside a DgaProvider.\n const ctx = useContext(DgaContext);\n const portalContainer = 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 root. Pattern documented in\n // DgaContext.ts; regression test in Modal.test.tsx mirrors Select/Tooltip.\n const ctx = useContext(DgaContext);\n const portalContainer = 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 { useState, useMemo, useContext } 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 const resolvedLocale = locale ?? (dir === 'rtl' ? 'ar' : 'en');\n\n const ctxValue = useMemo<DgaContextValue>(\n () => ({ dir, locale: resolvedLocale, mode, rootEl }),\n [dir, resolvedLocale, mode, rootEl],\n );\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 // 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","'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"],"mappings":";AAEA,OAA+B;AAC/B,SAAS,QAAQ,qBAAqB;AACtC,SAAS,WAA8B;;;ACJvC,SAAS,YAA6B;AAE/B,SAAS,MAAM,QAAsB;AAC1C,SAAO,KAAK,MAAM;AACpB;;;ACiBM,cAyDF,YAzDE;AAfC,SAAS,QAAQ,OAAsC;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO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,YAAY;AAAA,EAChB;AAAA,EACA,OAAO;AAAA,EACP;AACF,GAAqB;AACnB,QAAM,YAAYC,YAAW,UAAU;AACvC,QAAM,WAAW,cAAc;AAK/B,QAAM,CAAC,QAAQ,SAAS,IAAIC,UAA6B,IAAI;AAC7D,QAAM,iBAAiB,WAAW,QAAQ,QAAQ,OAAO;AAEzD,QAAM,WAAW;AAAA,IACf,OAAO,EAAE,KAAK,QAAQ,gBAAgB,MAAM,OAAO;AAAA,IACnD,CAAC,KAAK,gBAAgB,MAAM,MAAM;AAAA,EACpC;AAMA,QAAM,YAAY,QAAQ,MAAO,QAAQ,WAAW,KAAK,IAAI,MAAO,CAAC,KAAK,CAAC;AAM3E,QAAM,QAAQ,gBAAAF,MAAC,mBAAmB,UAAnB,EAA4B,KAAW,UAAS;AAE/D,SACE,gBAAAA,MAAC,WAAW,UAAX,EAAoB,OAAO,UAC1B,0BAAAA;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,gBAAAA,MAACG,kBAAiB,UAAjB,EAA0B,eAAe,KAAK,mBAAmB,KAC/D,iBACH;AAAA;AAAA,EAEJ,GACF;AAEJ;;;ACnFO,SAAS,SAAwB;AACtC,SAAO,OAAO,EAAE;AAClB;","names":["jsx","jsxs","cva","jsx","jsx","jsxs","cva","cva","jsx","jsxs","cva","cva","jsx","jsxs","cva","useId","cva","jsx","jsxs","cva","useId","cva","jsx","jsxs","cva","useContext","cva","jsx","jsxs","cva","useContext","useContext","cva","jsx","jsxs","cva","useContext","SlotPrimitive","cva","jsx","jsxs","cva","SlotPrimitive","useContext","SlotPrimitive","cva","jsx","jsxs","cva","useContext","SlotPrimitive","cva","id","jsx","jsxs","cva","DEFAULT_ICONS","useState","useContext","TooltipPrimitive","jsx","useContext","useState","TooltipPrimitive"]}
|
|
1
|
+
{"version":3,"sources":["../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/providers/DgaProvider.tsx","../src/hooks/useDir.ts"],"sourcesContent":["'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 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","'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 const portalContainer = 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 root element. Portal-rendering components (Select, and\n * future Tooltip / Modal / Toast / Popover / DropdownMenu) MUST pass this\n * as their Radix `Portal container={…}` so that `data-theme`, custom\n * theme vars, and `.ddga-theme-*` classes set on the root inherit into\n * the portaled content. Without it, portals mount under <body> and\n * silently miss dark mode + custom themes.\n *\n * Exposed as state (not a ref) so consumers re-render once the element\n * mounts , a useRef wouldn't fire that update and the portal would\n * race to <body> on the first commit.\n */\n rootEl: 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 root so theme + dark mode inherit.\n // Pattern documented in DgaContext.ts; regression test in Tooltip.test.tsx\n // (\"mounts the tooltip inside the DgaProvider root\"). Falls back to <body>\n // (Radix's default) if the Tooltip is used outside a DgaProvider.\n const ctx = useContext(DgaContext);\n const portalContainer = 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 root. Pattern documented in\n // DgaContext.ts; regression test in Modal.test.tsx mirrors Select/Tooltip.\n const ctx = useContext(DgaContext);\n const portalContainer = 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 lives ABOVE DgaProvider's root —\n // so data-theme, theme CSS vars, and .ddga-theme-* classes never reach the\n // menu. Re-anchor inside the root so dropdown inherits the surrounding\n // theme/dark-mode state. Falls back to <body> when used without a provider.\n const ctx = useContext(DgaContext);\n const portalContainer = 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?.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 root so theming + dark mode inherit\n // (regression test mirrors Select/Modal/DropdownMenu).\n const ctx = useContext(DgaContext);\n const portalContainer = 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 const portalContainer = 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 { useState, useMemo, useContext } 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 const resolvedLocale = locale ?? (dir === 'rtl' ? 'ar' : 'en');\n\n const ctxValue = useMemo<DgaContextValue>(\n () => ({ dir, locale: resolvedLocale, mode, rootEl }),\n [dir, resolvedLocale, mode, rootEl],\n );\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 // 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","'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"],"mappings":";AAEA,OAA+B;AAC/B,SAAS,QAAQ,qBAAqB;AACtC,SAAS,OAAAA,YAA8B;;;ACJvC,SAAS,YAA6B;AAE/B,SAAS,MAAM,QAAsB;AAC1C,SAAO,KAAK,MAAM;AACpB;;;ACFA,SAAS,WAA8B;AA0CjC;AAvCN,IAAM,kBAAkB,IAAI,gBAAgB;AAAA,EAC1C,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IACN;AAAA,EACF;AACF,CAAC;AAYD,SAAS,QAAQ,EAAE,MAAM,WAAW,cAAc,WAAW,GAAG,MAAM,GAAiB;AACrF,QAAM,SAAS,MAAM,aAAa,MAAM,QAAQ,MAAM,aAAa,MAAM;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,MAAM,SAAS,SAAY;AAAA,MAC3B,cAAY,SAAS,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EzD,QAAM,WAAWC;AAAA,IACf,OAAO,EAAE,KAAK,QAAQ,gBAAgB,MAAM,OAAO;AAAA,IACnD,CAAC,KAAK,gBAAgB,MAAM,MAAM;AAAA,EACpC;AAMA,QAAM,YAAYA,SAAQ,MAAO,QAAQ,WAAW,KAAK,IAAI,MAAO,CAAC,KAAK,CAAC;AAM3E,QAAM,QAAQ,gBAAAH,MAAC,mBAAmB,UAAnB,EAA4B,KAAW,UAAS;AAE/D,SACE,gBAAAA,MAAC,WAAW,UAAX,EAAoB,OAAO,UAC1B,0BAAAA;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,gBAAAA,MAACI,kBAAiB,UAAjB,EAA0B,eAAe,KAAK,mBAAmB,KAC/D,iBACH;AAAA;AAAA,EAEJ,GACF;AAEJ;;;ACnFO,SAAS,SAAwB;AACtC,SAAO,OAAO,EAAE;AAClB;","names":["cva","jsx","cva","cva","jsx","jsx","jsxs","cva","cva","jsx","jsxs","cva","cva","jsx","jsxs","jsx","jsxs","cva","useId","cva","jsx","jsxs","cva","useId","cva","jsx","jsxs","cva","useContext","cva","jsx","jsxs","cva","useContext","SlotPrimitive","cva","jsx","cva","SlotPrimitive","SlotPrimitive","cva","jsx","jsxs","cva","SlotPrimitive","cva","jsx","cva","cva","jsx","jsxs","cva","useContext","cva","jsx","jsxs","cva","useContext","useState","SlotPrimitive","cva","jsx","jsxs","cva","useState","SlotPrimitive","useContext","SlotPrimitive","cva","jsx","jsxs","cva","useContext","SlotPrimitive","cva","id","jsx","jsxs","cva","DEFAULT_ICONS","cva","jsx","cva","SlotPrimitive","cva","jsx","cva","SlotPrimitive","SlotPrimitive","cva","jsx","jsxs","cva","SlotPrimitive","cva","jsx","jsxs","cva","cva","jsx","jsxs","cva","cva","jsx","cva","cva","jsx","jsxs","cva","useContext","cva","jsx","jsxs","cva","useContext","useContext","DialogPrimitive","SlotPrimitive","cva","jsx","jsxs","cva","DialogPrimitive","useContext","SlotPrimitive","Children","createContext","isValidElement","useContext","useId","useState","cva","jsx","jsxs","cva","createContext","useContext","useState","Children","isValidElement","useId","useState","useMemo","useContext","TooltipPrimitive","jsx","useContext","useState","useMemo","TooltipPrimitive"]}
|