@platned/ui 0.10.4 → 1.0.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/README.md +42 -98
- package/dist/blocks-charts.cjs +459 -0
- package/dist/blocks-charts.cjs.map +1 -0
- package/dist/blocks-charts.d.cts +64 -0
- package/dist/blocks-charts.d.ts +64 -0
- package/dist/blocks-charts.js +440 -0
- package/dist/blocks-charts.js.map +1 -0
- package/dist/blocks.cjs +8007 -0
- package/dist/blocks.cjs.map +1 -0
- package/dist/blocks.d.cts +3082 -0
- package/dist/blocks.d.ts +3082 -0
- package/dist/blocks.js +8223 -0
- package/dist/blocks.js.map +1 -0
- package/dist/chart.cjs +226 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.ts +66 -0
- package/dist/chart.js +183 -0
- package/dist/chart.js.map +1 -0
- package/dist/chunk-2L5XAYNK.js +11 -0
- package/dist/chunk-2L5XAYNK.js.map +1 -0
- package/dist/chunk-327NSKZW.js +3176 -0
- package/dist/chunk-327NSKZW.js.map +1 -0
- package/dist/chunk-GJJWRZ4B.js +200 -0
- package/dist/chunk-GJJWRZ4B.js.map +1 -0
- package/dist/chunk-WGCAQEZ4.js +178 -0
- package/dist/chunk-WGCAQEZ4.js.map +1 -0
- package/dist/code-block-BgEiLXpO.d.ts +111 -0
- package/dist/code-block-highlight.cjs +489 -0
- package/dist/code-block-highlight.cjs.map +1 -0
- package/dist/code-block-highlight.d.ts +28 -0
- package/dist/code-block-highlight.js +120 -0
- package/dist/code-block-highlight.js.map +1 -0
- package/dist/data-table-Dec6t8NO.d.ts +729 -0
- package/dist/data-table.cjs +3506 -2219
- package/dist/data-table.cjs.map +1 -1
- package/dist/data-table.d.ts +2 -1
- package/dist/data-table.js +1396 -246
- package/dist/data-table.js.map +1 -1
- package/dist/index.cjs +8934 -11994
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2524 -5312
- package/dist/index.js +4678 -9574
- package/dist/index.js.map +1 -1
- package/dist/map.cjs +432 -0
- package/dist/map.cjs.map +1 -0
- package/dist/map.d.cts +294 -0
- package/dist/map.d.ts +294 -0
- package/dist/map.js +422 -0
- package/dist/map.js.map +1 -0
- package/dist/theme.css +1897 -0
- package/package.json +65 -24
- package/dist/chunk-OVIRTNT4.js +0 -2787
- package/dist/chunk-OVIRTNT4.js.map +0 -1
- package/dist/data-table-JX-vnL0F.d.ts +0 -464
- package/dist/sidebar.cjs +0 -108
- package/dist/sidebar.cjs.map +0 -1
- package/dist/sidebar.d.cts +0 -257
- package/dist/sidebar.d.ts +0 -257
- package/dist/sidebar.js +0 -70
- package/dist/sidebar.js.map +0 -1
- package/dist/styles.css +0 -1
- package/dist/tokens.css +0 -1
- package/tailwind-preset.cjs +0 -446
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/avatar/avatar.tsx","../src/components/chrome/separator.tsx","../src/components/forms/label.tsx","../src/components/forms/field.tsx","../src/components/forms/textarea.tsx","../src/components/forms/input-group.tsx","../src/components/forms/input.tsx","../src/components/forms/select.tsx","../src/components/overlays/portal.tsx","../src/components/overlays/popover.tsx","../src/components/overlays/overlay-stack.ts","../src/components/forms/toggle.tsx","../src/components/status/badge.tsx","../src/components/overlays/dialog.tsx","../src/components/overlays/toaster-guard.ts","../src/components/forms/command.tsx","../src/lib/use-controllable-state.ts","../src/components/forms/checkbox.tsx","../src/lib/scrollbar.ts","../src/components/overlays/dropdown-menu.tsx","../src/lib/compose-event-handlers.ts","../src/components/overlays/menu-core.tsx","../src/lib/focus-ring.ts","../src/components/chrome/tabs.tsx","../src/components/feedback/skeleton.tsx","../src/lib/format.tsx","../src/lib/dev-warn.ts","../src/components/lists/value.tsx","../src/components/lists/value-parts.tsx","../src/components/lists/table.tsx","../src/components/feedback/progress.tsx","../src/components/lists/data-table-cells.tsx","../src/lib/use-element-width.ts","../src/components/feedback/empty.tsx"],"sourcesContent":["import { forwardRef, type ComponentPropsWithoutRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { Avatar as AvatarPrimitive } from 'radix-ui';\nimport { cn } from '../../lib/cn';\n\n/**\n * Avatar: an image element with a fallback for representing the user.\n *\n * Two ways to write one:\n * - Shorthand: `<Avatar src={url} alt=\"Dennis Issac\" fallback=\"DI\" />`. Either prop is optional.\n * - Composition: `AvatarImage`, `AvatarFallback` and `AvatarBadge` as children.\n *\n * Built on Radix Avatar: the image renders once it has loaded, and the fallback shows until then\n * (or for good, when there is no image or it fails). Sizes `sm` (24px), `default` (32px) and `lg`\n * (40px). `shape=\"square\"` is a Platned addition for organisation logos. Every part carries\n * `data-slot`.\n */\n\nexport type AvatarSize = 'default' | 'sm' | 'lg';\nexport type AvatarShape = 'circle' | 'square';\n\nexport interface AvatarProps extends ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {\n /** Default `default` (32px). */\n size?: AvatarSize;\n /** Platned addition: a rounded square instead of a circle, e.g. for organisation logos. */\n shape?: AvatarShape;\n /** Shorthand: the image URL. */\n src?: string;\n /** Shorthand: the image's alt text. */\n alt?: string;\n /** Shorthand: shown until the image loads, or instead of it (initials, an icon). */\n fallback?: ReactNode;\n}\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { className, size = 'default', shape = 'circle', src, alt, fallback, children, ...props },\n ref,\n) {\n return (\n <AvatarPrimitive.Root\n ref={ref}\n data-slot=\"avatar\"\n data-size={size}\n data-shape={shape}\n className={cn(\n 'group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten',\n 'data-[shape=square]:rounded-lg data-[shape=square]:after:rounded-lg data-[shape=square]:data-[size=sm]:rounded-md data-[shape=square]:data-[size=sm]:after:rounded-md',\n className,\n )}\n {...props}\n >\n {src !== undefined && <AvatarImage src={src} alt={alt ?? ''} />}\n {fallback !== undefined && <AvatarFallback>{fallback}</AvatarFallback>}\n {children}\n </AvatarPrimitive.Root>\n );\n});\n\n/** Rounding that follows the root's shape. */\nconst SHAPED =\n 'rounded-full group-data-[shape=square]/avatar:rounded-lg group-data-[shape=square]/avatar:group-data-[size=sm]/avatar:rounded-md';\n\nexport type AvatarImageProps = ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>;\n\nexport const AvatarImage = forwardRef<HTMLImageElement, AvatarImageProps>(function AvatarImage({ className, ...props }, ref) {\n return (\n <AvatarPrimitive.Image\n ref={ref}\n data-slot=\"avatar-image\"\n className={cn('aspect-square size-full object-cover', SHAPED, className)}\n {...props}\n />\n );\n});\n\nexport type AvatarFallbackProps = ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>;\n\nexport const AvatarFallback = forwardRef<HTMLSpanElement, AvatarFallbackProps>(function AvatarFallback(\n { className, ...props },\n ref,\n) {\n return (\n <AvatarPrimitive.Fallback\n ref={ref}\n data-slot=\"avatar-fallback\"\n className={cn(\n 'flex size-full items-center justify-center bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',\n SHAPED,\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type AvatarBadgeProps = HTMLAttributes<HTMLSpanElement>;\n\n/** A status dot (or a small icon) at the bottom right. */\nexport const AvatarBadge = forwardRef<HTMLSpanElement, AvatarBadgeProps>(function AvatarBadge({ className, ...props }, ref) {\n return (\n <span\n ref={ref}\n data-slot=\"avatar-badge\"\n className={cn(\n 'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary bg-blend-color text-primary-foreground ring-2 ring-background select-none',\n 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',\n 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',\n 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',\n className,\n )}\n {...props}\n />\n );\n});\n\nexport interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** Platned addition (shorthand): renders an `AvatarGroupCount` with `+{overflow}` at the end. */\n overflow?: number;\n}\n\n/** Overlapping avatars, each ringed in the background colour. */\nexport const AvatarGroup = forwardRef<HTMLDivElement, AvatarGroupProps>(function AvatarGroup(\n { className, overflow, children, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"avatar-group\"\n className={cn(\n 'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',\n className,\n )}\n {...props}\n >\n {children}\n {overflow !== undefined && <AvatarGroupCount>+{overflow}</AvatarGroupCount>}\n </div>\n );\n});\n\nexport type AvatarGroupCountProps = HTMLAttributes<HTMLDivElement>;\n\n/** The \"+3\" (or an icon) at the end of a group. Takes the group's avatar size. */\nexport const AvatarGroupCount = forwardRef<HTMLDivElement, AvatarGroupCountProps>(function AvatarGroupCount(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"avatar-group-count\"\n className={cn(\n 'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background',\n 'group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6',\n '[&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',\n className,\n )}\n {...props}\n />\n );\n});\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';\nimport { Separator as SeparatorPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\n\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\nexport type SeparatorProps = ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>;\n\n/**\n * Separator: visually or semantically separates content.\n *\n * Built on Radix Separator: a 1px `bg-border` rule, full width when horizontal and stretched to\n * its row when vertical. `decorative` (the default) keeps it out of the accessibility tree; set\n * `decorative={false}` for a `role=\"separator\"` that announces a break between groups.\n */\nexport const Separator = forwardRef<ElementRef<typeof SeparatorPrimitive.Root>, SeparatorProps>(function Separator(\n { className, orientation = 'horizontal', decorative = true, ...props },\n ref,\n) {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',\n className,\n )}\n {...props}\n />\n );\n});\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\nimport { useFieldContext } from './field';\n\n/**\n * Label: the name of a control, `<Label htmlFor=\"email\">Your email address</Label>`.\n *\n * Built on Radix Label, which keeps a double-click on the label from selecting its text. It dims\n * when the control after it (`peer`) or its `Field` is disabled.\n *\n * Inside a `Field`, use `FieldLabel` (built on this): it also takes the Field's label id. A\n * `Label` inside a Field still points at the Field's control when it has no `htmlFor`.\n */\nexport type LabelProps = ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nexport const Label = forwardRef<ElementRef<typeof LabelPrimitive.Root>, LabelProps>(function Label(\n { className, htmlFor, ...props },\n ref,\n) {\n const field = useFieldContext();\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-slot=\"label\"\n htmlFor={htmlFor ?? field?.controlId}\n className={cn(\n 'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',\n className,\n )}\n {...props}\n />\n );\n});\n","import {\n Children,\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cn } from '../../lib/cn';\nimport { Separator } from '../chrome/separator';\nimport { Label, type LabelProps } from './label';\n\n/**\n * The label / description / error / control wiring, in one place.\n *\n * This exists because of the single largest defect the 0.3.0 audit found. `Input`,\n * `Textarea`, `Select` and `DatePicker` all accepted `label`, `description`, `error` and\n * `hint`, rendered them, and then connected **none** of them:\n *\n * - `<label htmlFor={id}>` used the caller's `id` with no fallback. Omit `id` — the\n * common case — and `htmlFor` was `undefined`, so the label pointed at nothing.\n * Clicking it did nothing and assistive tech announced an unlabelled field.\n * - `description`, `error` and `hint` were bare `<p>` elements with no `id`, and no\n * control ever referenced them. A consumer could not fix this from outside either:\n * passing `aria-describedby` had nothing to point at.\n * - `error` drove the border colour and nothing else. No `aria-invalid`, no `role`, no\n * live region — so an async validation failure was completely silent.\n *\n * `Field` generates the ids and hands them down through context, so a control only has to\n * spread `useFieldControl()` onto its input element. It is also usable directly for\n * controls the library does not wrap, which is why the parts are exported.\n */\n\nexport interface FieldContextValue {\n controlId: string;\n /**\n * Id of the `FieldLabel`, for controls whose accessible name cannot come from a\n * `<label for>` association. A `<button>` is named by its own contents, so the Select\n * trigger has to point `aria-labelledby` at the label explicitly or it announces only\n * the chosen value.\n */\n labelId: string;\n descriptionId: string;\n errorId: string;\n /** Whether a `FieldDescription` / `FieldError` is showing. The parts report it. */\n hasDescription: boolean;\n hasError: boolean;\n invalid: boolean;\n required: boolean;\n disabled: boolean;\n /** Used by the text parts to tell the field they are showing. Returns the unregister. */\n register: (part: FieldPart) => () => void;\n}\n\nexport type FieldPart = 'description' | 'error';\n\nconst FieldContext = createContext<FieldContextValue | null>(null);\n\nexport function useFieldContext(): FieldContextValue | null {\n return useContext(FieldContext);\n}\n\n/** `useLayoutEffect` in the browser, so a part is registered before the field paints; `useEffect` on the server, where neither runs. */\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n/** Tells the enclosing field that `part` is showing, while `showing` is true. */\nfunction useRegisterPart(field: FieldContextValue | null, part: FieldPart, showing: boolean) {\n const register = field?.register;\n useIsomorphicLayoutEffect(() => {\n if (!register || !showing) return;\n return register(part);\n }, [register, part, showing]);\n}\n\n/** True when a text part has something to show: `{error}` may be `undefined`, `''`, `null` or `false`. */\nfunction hasContent(children: ReactNode): boolean {\n return Children.toArray(children).some((child) => child !== '');\n}\n\n/**\n * Props for the control itself. Spread onto the `<input>`/`<select>`/`<textarea>`.\n *\n * `aria-describedby` lists description *and* error: a field can carry both persistent\n * guidance and a transient error, and a screen reader should read both rather than have the\n * error replace the instruction that explains the format.\n */\nexport function useFieldControl(): {\n id: string | undefined;\n 'aria-describedby': string | undefined;\n 'aria-invalid': true | undefined;\n 'aria-required': true | undefined;\n disabled: boolean | undefined;\n} {\n const field = useFieldContext();\n if (!field) {\n return {\n id: undefined,\n 'aria-describedby': undefined,\n 'aria-invalid': undefined,\n 'aria-required': undefined,\n disabled: undefined,\n };\n }\n\n const describedBy = [field.hasDescription && field.descriptionId, field.hasError && field.errorId]\n .filter(Boolean)\n .join(' ');\n\n return {\n id: field.controlId,\n 'aria-describedby': describedBy || undefined,\n 'aria-invalid': field.invalid || undefined,\n 'aria-required': field.required || undefined,\n disabled: field.disabled || undefined,\n };\n}\n\n// ── Field ──────────────────────────────────────────────────────────────────────\n\nexport type FieldOrientation = 'vertical' | 'horizontal' | 'responsive';\n\nconst ORIENTATION: Record<FieldOrientation, string> = {\n vertical: 'flex-col *:w-full [&>.sr-only]:w-auto',\n horizontal:\n 'flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n responsive:\n 'flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',\n};\n\nexport interface FieldProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /** Supply to control the id yourself; otherwise one is generated. */\n id?: string;\n /** Marks the control invalid without a message. A `FieldError` with a message does this by itself. */\n invalid?: boolean;\n /** Sets `aria-required` on the control. */\n required?: boolean;\n disabled?: boolean;\n /**\n * `vertical` stacks label, control and text; `horizontal` puts the control beside the label\n * (switches, checkboxes); `responsive` is vertical until its `FieldGroup` is `md` wide.\n */\n orientation?: FieldOrientation;\n /**\n * Shorthand: the label. With `label`, `description` or `error`, the field renders its own\n * parts around the control (the children).\n */\n label?: ReactNode;\n /** Shorthand: helper text for the control. */\n description?: ReactNode;\n /** Shorthand: the validation message; empty renders nothing. */\n error?: ReactNode;\n}\n\n/**\n * One form field: a label, a control and its text, wired for assistive tech.\n *\n * The controls (`Input`, `Textarea`, `Select`, `NativeSelect`, `TagInput`, `DatePicker`) are\n * bare; a form composes them inside a Field, which generates the ids and hands them down:\n *\n * ```tsx\n * <Field required>\n * <FieldLabel>Email</FieldLabel>\n * <Input type=\"email\" value={email} onChange={…} />\n * <FieldDescription>We send the invite here.</FieldDescription>\n * <FieldError>{error}</FieldError>\n * </Field>\n * ```\n *\n * Shorthand: `<Field label=\"Email\" description=\"…\" error={error}><Input /></Field>`.\n *\n * The parts report themselves, so there are no flags to keep in step: a `FieldError` with a\n * message marks the control `aria-invalid` and describes it, and an empty one renders nothing.\n */\nexport function Field({\n children,\n id,\n invalid = false,\n required = false,\n disabled = false,\n orientation = 'vertical',\n label,\n description,\n error,\n className,\n ...rest\n}: FieldProps) {\n const generated = useId();\n const controlId = id ?? generated;\n // How many of each part are showing. Counts, not booleans, so two parts can't unset each other.\n const [parts, setParts] = useState<Record<FieldPart, number>>({ description: 0, error: 0 });\n const register = useCallback((part: FieldPart) => {\n setParts((p) => ({ ...p, [part]: p[part] + 1 }));\n return () => setParts((p) => ({ ...p, [part]: p[part] - 1 }));\n }, []);\n const hasError = parts.error > 0;\n const isInvalid = invalid || hasError;\n\n const value = useMemo<FieldContextValue>(\n () => ({\n controlId,\n labelId: `${controlId}-label`,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n hasDescription: parts.description > 0,\n hasError,\n invalid: isInvalid,\n required,\n disabled,\n register,\n }),\n [controlId, parts, hasError, isInvalid, required, disabled, register],\n );\n\n let content: ReactNode = children;\n if (label !== undefined || description !== undefined || error !== undefined) {\n const labelPart = label !== undefined ? <FieldLabel>{label}</FieldLabel> : null;\n const descriptionPart = description !== undefined ? <FieldDescription>{description}</FieldDescription> : null;\n content =\n orientation === 'vertical' ? (\n <>\n {labelPart}\n {children}\n {descriptionPart}\n <FieldError>{error}</FieldError>\n </>\n ) : (\n // Beside the control, label and description share a column, as in the reference layout.\n <>\n {children}\n {descriptionPart ? (\n <FieldContent>\n {labelPart}\n {descriptionPart}\n </FieldContent>\n ) : (\n labelPart\n )}\n <FieldError>{error}</FieldError>\n </>\n );\n }\n\n return (\n <FieldContext.Provider value={value}>\n <div\n // role=\"group\" so the label of a fieldset-like cluster is inherited by the controls inside it.\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n data-invalid={isInvalid || undefined}\n data-disabled={disabled || undefined}\n className={cn(\n 'group/field flex w-full gap-2 data-[invalid=true]:text-destructive',\n ORIENTATION[orientation],\n className,\n )}\n {...rest}\n >\n {content}\n </div>\n </FieldContext.Provider>\n );\n}\n\n// ── FieldLabel ─────────────────────────────────────────────────────────────────\n\n/**\n * A FieldLabel wrapping a whole Field is a choice card: bordered, the row padded, tinted while its\n * checkbox or radio is checked, with the focus ring on the card. Scoped to that shape, so a plain\n * label is unchanged. Shared with the controls' `card` shorthand.\n */\nexport const CHOICE_CARD =\n 'group/field-label peer/field-label has-[>[data-slot=field]]:flex has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border has-[>[data-slot=field]]:has-data-checked:border-primary/30 has-[>[data-slot=field]]:has-data-checked:bg-primary/5 has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2.5 dark:has-[>[data-slot=field]]:has-data-checked:border-primary/20 dark:has-[>[data-slot=field]]:has-data-checked:bg-primary/10';\n\nexport type FieldLabelProps = LabelProps;\n\nexport const FieldLabel = forwardRef<HTMLLabelElement, FieldLabelProps>(function FieldLabel(\n { className, htmlFor, ...rest },\n ref,\n) {\n const field = useFieldContext();\n\n return (\n <Label\n ref={ref}\n id={field?.labelId}\n htmlFor={htmlFor ?? field?.controlId}\n data-slot=\"field-label\"\n className={cn(\n 'w-fit leading-snug group-data-[disabled=true]/field:opacity-50',\n // A FieldLabel wrapping a whole Field is a choice card; see CHOICE_CARD.\n CHOICE_CARD,\n className,\n )}\n {...rest}\n />\n );\n});\n\n// ── FieldContent / FieldTitle ──────────────────────────────────────────────────\n\n/** The label-and-description column beside a control in a horizontal field. */\nexport function FieldContent({ className, ...rest }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn('group/field-content flex flex-1 flex-col gap-0.5 leading-snug', className)}\n {...rest}\n />\n );\n}\n\n/**\n * The title of a choice card (a `FieldLabel` wrapping a `Field`), where the card itself is the\n * label: styled like a label, but a `div`, since a label cannot hold another.\n */\nexport function FieldTitle({ className, ...rest }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',\n className,\n )}\n {...rest}\n />\n );\n}\n\n// ── FieldDescription / FieldError ──────────────────────────────────────────────\n\nexport interface FieldTextProps extends HTMLAttributes<HTMLParagraphElement> {\n children?: ReactNode;\n}\n\n/** Helper text, above or below the control, announced with it. Renders nothing when empty. */\nexport function FieldDescription({ children, className, ...rest }: FieldTextProps) {\n const field = useFieldContext();\n const showing = hasContent(children);\n useRegisterPart(field, 'description', showing);\n if (!showing) return null;\n return (\n <p\n id={field?.descriptionId}\n data-slot=\"field-description\"\n className={cn(\n 'text-start text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5',\n 'last:mt-0 nth-last-2:-mt-1',\n '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className,\n )}\n {...rest}\n >\n {children}\n </p>\n );\n}\n\nexport interface FieldErrorProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n /**\n * Messages from a form library (react-hook-form's `errors.x`, a Standard Schema `issues`\n * array). Duplicates are dropped; several render as a list. Children win when both are set.\n */\n errors?: Array<{ message?: string } | undefined>;\n}\n\n/** The messages to show for `errors`: one as text, several as a list, none as `null`. */\nfunction errorContent(errors: FieldErrorProps['errors']): ReactNode {\n if (!errors?.length) return null;\n const unique = [...new Map(errors.map((e) => [e?.message, e])).values()].filter((e) => e?.message);\n if (unique.length === 0) return null;\n if (unique.length === 1) return unique[0]?.message;\n return (\n <ul className=\"ms-4 flex list-disc flex-col gap-1\">\n {unique.map((e, index) => (\n <li key={index}>{e?.message}</li>\n ))}\n </ul>\n );\n}\n\n/**\n * Validation message. Renders nothing when empty, so `<FieldError>{error}</FieldError>` can\n * always be rendered; with a message it marks the control invalid and describes it.\n * `role=\"alert\"` because an error that appears after submit — asynchronously, without focus\n * moving — is otherwise never announced at all.\n */\nexport function FieldError({ children, errors, className, ...rest }: FieldErrorProps) {\n const field = useFieldContext();\n const content = hasContent(children) ? children : errorContent(errors);\n const showing = content != null && content !== '';\n useRegisterPart(field, 'error', showing);\n if (!showing) return null;\n return (\n <div\n id={field?.errorId}\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn('text-sm font-normal text-destructive', className)}\n {...rest}\n >\n {content}\n </div>\n );\n}\n\n// ── Grouping ───────────────────────────────────────────────────────────────────\n\nexport interface FieldGroupProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\n/** Stacks several `Field`s; a container, so `orientation=\"responsive\"` fields switch at its width. */\nexport function FieldGroup({ children, className, ...rest }: FieldGroupProps) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n 'group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4',\n className,\n )}\n {...rest}\n >\n {children}\n </div>\n );\n}\n\nexport interface FieldSetProps extends HTMLAttributes<HTMLFieldSetElement> {\n children?: ReactNode;\n}\n\n/**\n * A real `<fieldset>`. Required for radio groups and checkbox groups: the group needs a\n * name of its own, and only `<legend>` gives it one that is announced before each option.\n */\nexport const FieldSet = forwardRef<HTMLFieldSetElement, FieldSetProps>(function FieldSet(\n { children, className, ...rest },\n ref,\n) {\n return (\n <fieldset\n ref={ref}\n data-slot=\"field-set\"\n className={cn(\n 'flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',\n className,\n )}\n {...rest}\n >\n {children}\n </fieldset>\n );\n});\n\nexport interface FieldLegendProps extends HTMLAttributes<HTMLLegendElement> {\n children?: ReactNode;\n /** `label` matches a field label's size, for a nested `FieldSet`; `legend` is the section heading. */\n variant?: 'legend' | 'label';\n}\n\nexport function FieldLegend({ children, variant = 'legend', className, ...rest }: FieldLegendProps) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn('mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', className)}\n {...rest}\n >\n {children}\n </legend>\n );\n}\n\nexport interface FieldSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Optional text on the rule, e.g. \"Or continue with\". */\n children?: ReactNode;\n}\n\nexport function FieldSeparator({ children, className, ...rest }: FieldSeparatorProps) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}\n {...rest}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n data-slot=\"field-separator-content\"\n className=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n","import { forwardRef, type TextareaHTMLAttributes } from 'react';\nimport { cn } from '../../lib/cn';\nimport { useFieldControl } from './field';\n\nexport type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;\n\n/**\n * A multi-line text input that grows with its content (`field-sizing: content`). Put it in a\n * `Field` with a `FieldLabel`, or give it an `aria-label`; inside a `Field` it takes the id,\n * `aria-describedby`, `aria-invalid`, `disabled` and `required` from it.\n */\nexport const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(function Textarea(\n { className, ...props },\n ref,\n) {\n const field = useFieldControl();\n return (\n <textarea\n ref={ref}\n data-slot=\"textarea\"\n {...field}\n required={field['aria-required']}\n className={cn(\n 'flex field-sizing-content min-h-16 w-full outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-3 aria-invalid:ring-3 md:text-sm',\n className,\n )}\n {...props}\n />\n );\n});\n","import { forwardRef, type HTMLAttributes } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Button, type ButtonProps } from './button';\nimport { InputBase, type InputBaseProps } from './input';\nimport { Textarea, type TextareaProps } from './textarea';\n\nexport type InputGroupAlign = 'inline-start' | 'inline-end' | 'block-start' | 'block-end';\n\nexport type InputGroupProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * A bordered shell that holds an input (or textarea) with addons: an icon, text, a button,\n * a keyboard hint. The border, focus ring, invalid and disabled looks belong to the group and\n * follow its control (`aria-invalid`, `disabled`), so the group takes no state props.\n */\nexport const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function InputGroup(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(\n 'group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-3 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5',\n className,\n )}\n {...props}\n />\n );\n});\n\nconst ADDON_ALIGN: Record<InputGroupAlign, string> = {\n 'inline-start': 'pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first',\n 'inline-end': 'pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last',\n 'block-start':\n 'px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start',\n 'block-end': 'px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start',\n};\n\nexport interface InputGroupAddonProps extends HTMLAttributes<HTMLDivElement> {\n /** Where the addon sits. The DOM order doesn't matter: put the control first. Default `inline-start`. */\n align?: InputGroupAlign;\n}\n\n/** An icon, text, button or keyboard hint beside the control. Clicking it (not a button in it) focuses the input. */\nexport const InputGroupAddon = forwardRef<HTMLDivElement, InputGroupAddonProps>(function InputGroupAddon(\n { className, align = 'inline-start', onClick, ...props },\n ref,\n) {\n return (\n // The click only moves focus to the input for a pointer user; a keyboard user tabs to the\n // input directly, and any control inside the addon is a real button with its own keys.\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(\n \"flex cursor-text items-center justify-center select-none text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4\",\n ADDON_ALIGN[align],\n className,\n )}\n onClick={(event) => {\n onClick?.(event);\n if ((event.target as HTMLElement).closest('button')) return;\n event.currentTarget.parentElement?.querySelector('input')?.focus();\n }}\n {...props}\n />\n );\n});\n\nexport type InputGroupButtonSize = 'xs' | 'sm' | 'icon-xs' | 'icon-sm';\n\nconst BUTTON_SIZE: Record<InputGroupButtonSize, string> = {\n xs: \"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5\",\n sm: '',\n 'icon-xs': 'size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0',\n 'icon-sm': 'size-8 p-0 has-[>svg]:p-0',\n};\n\nexport interface InputGroupButtonProps extends Omit<ButtonProps, 'size'> {\n /** Default `xs`. */\n size?: InputGroupButtonSize;\n}\n\n/** A Button sized to sit inside an addon. Ghost by default. */\nexport const InputGroupButton = forwardRef<HTMLButtonElement, InputGroupButtonProps>(function InputGroupButton(\n { className, type = 'button', variant = 'ghost', size = 'xs', ...props },\n ref,\n) {\n return (\n <Button\n ref={ref}\n type={type}\n size=\"default\"\n data-size={size}\n variant={variant}\n className={cn('flex items-center shadow-none gap-2 text-sm', BUTTON_SIZE[size], className)}\n {...props}\n />\n );\n});\n\nexport type InputGroupTextProps = HTMLAttributes<HTMLSpanElement>;\n\n/** Static text in an addon: a currency symbol, a domain suffix, a unit. */\nexport const InputGroupText = forwardRef<HTMLSpanElement, InputGroupTextProps>(function InputGroupText(\n { className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n className={cn(\n \"flex items-center [&_svg]:pointer-events-none text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type InputGroupInputProps = InputBaseProps;\n\n/** The input inside an `InputGroup`: no border, background or ring of its own; the group draws them. */\nexport const InputGroupInput = forwardRef<HTMLInputElement, InputGroupInputProps>(function InputGroupInput(\n { className, ...props },\n ref,\n) {\n return (\n <InputBase\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n 'flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type InputGroupTextareaProps = TextareaProps;\n\n/** The textarea inside an `InputGroup`, for a composer with a toolbar above or below. */\nexport const InputGroupTextarea = forwardRef<HTMLTextAreaElement, InputGroupTextareaProps>(function InputGroupTextarea(\n { className, ...props },\n ref,\n) {\n return (\n <Textarea\n ref={ref}\n data-slot=\"input-group-control\"\n className={cn(\n 'flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent',\n className,\n )}\n {...props}\n />\n );\n});\n","import { forwardRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\nimport { useFieldControl } from './field';\nimport { InputGroup, InputGroupAddon, InputGroupInput } from './input-group';\n\nexport const INPUT_CLASSES =\n 'w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm';\n\nexport type InputBaseProps = InputHTMLAttributes<HTMLInputElement>;\n\n/**\n * The bare `<input>` with the Field wiring: inside a `Field` it takes the control id,\n * `aria-describedby`, `aria-invalid`, `disabled` and `required` from it. An explicit prop wins.\n * `Input` and `InputGroupInput` render it.\n */\nexport const InputBase = forwardRef<HTMLInputElement, InputBaseProps>(function InputBase(\n { className, type, ...props },\n ref,\n) {\n const field = useFieldControl();\n return (\n <input\n ref={ref}\n type={type}\n data-slot=\"input\"\n {...field}\n required={field['aria-required']}\n className={cn(INPUT_CLASSES, className)}\n {...props}\n />\n );\n});\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /** Shorthand: an icon before the text, as an `InputGroupAddon`. */\n leadingIcon?: ReactNode;\n /** Shorthand: an icon after the text, as an `InputGroupAddon align=\"inline-end\"`. */\n trailingIcon?: ReactNode;\n /** Shorthand: a control after the text (e.g. an `InputGroupButton`), in an inline-end addon. */\n trailingAction?: ReactNode;\n}\n\n/**\n * A text input. Put it in a `Field` with a `FieldLabel`, or give it an `aria-label`; set\n * `aria-invalid` (a `Field` with an error does it for you) for the invalid look.\n *\n * With `leadingIcon`, `trailingIcon` or `trailingAction` it renders an `InputGroup` around the\n * input, and `className` goes to the group.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { leadingIcon, trailingIcon, trailingAction, className, ...props },\n ref,\n) {\n if (!leadingIcon && !trailingIcon && !trailingAction) {\n return <InputBase ref={ref} className={className} {...props} />;\n }\n return (\n <InputGroup className={className}>\n <InputGroupInput ref={ref} {...props} />\n {leadingIcon && <InputGroupAddon>{leadingIcon}</InputGroupAddon>}\n {(trailingIcon || trailingAction) && (\n <InputGroupAddon align=\"inline-end\">\n {trailingIcon}\n {trailingAction}\n </InputGroupAddon>\n )}\n </InputGroup>\n );\n});\n","import { Fragment, forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\n\nimport { cn } from '../../lib/cn';\n\n/**\n * Select: displays a list of options for the user to pick from, triggered by a button.\n *\n * Built on Radix Select. While open it is modal (page scroll locks and the rest of the page is\n * hidden from assistive tech), and by default the selected item opens over the trigger\n * (`position=\"item-aligned\"`); `position=\"popper\"` opens the list below it. `name` and `required`\n * submit and validate with a form through a native select Radix renders alongside.\n *\n * Two ways to write one:\n * - Shorthand: `<Select options={[…]} placeholder=\"Theme\" aria-label=\"Theme\" />` renders the\n * trigger, value and items; groups (`{ label, options }`) render with labels and separators.\n * - Composition: `SelectTrigger` (`SelectValue`) and `SelectContent` with `SelectGroup`,\n * `SelectLabel`, `SelectItem` and `SelectSeparator`.\n *\n * Label the trigger with a `FieldLabel htmlFor` pointing at its `id`, or an `aria-label`. Mark an\n * error with `aria-invalid` on the trigger. Opening one in jsdom calls `hasPointerCapture` and\n * `scrollIntoView`, so tests that open a Select need those stubbed.\n */\n\nexport interface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface SelectOptionGroup {\n label: string;\n options: readonly SelectOption[];\n}\n\nexport type SelectSize = 'default' | 'sm';\n\nfunction isGroup(entry: SelectOption | SelectOptionGroup): entry is SelectOptionGroup {\n return 'options' in entry;\n}\n\nexport interface SelectProps extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, 'value'> {\n /** `null` or `''` shows the placeholder. */\n value?: string | null;\n /** Shorthand: the items as data, flat or in labelled groups. */\n options?: readonly (SelectOption | SelectOptionGroup)[];\n /** Shorthand: shown on the trigger while nothing is selected. */\n placeholder?: string;\n /** Shorthand: the trigger's size. */\n size?: SelectSize;\n /** Shorthand: the trigger's `className` (layout: width, margin). */\n className?: string;\n /** Shorthand: the trigger's `id`, for a `FieldLabel htmlFor`. */\n id?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n 'aria-invalid'?: boolean | 'true' | 'false';\n 'aria-busy'?: boolean;\n /** Shorthand: where the list opens. */\n position?: 'item-aligned' | 'popper';\n}\n\nexport function Select({\n value,\n options,\n placeholder,\n size,\n className,\n id,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-busy': ariaBusy,\n position,\n children,\n ...props\n}: SelectProps) {\n return (\n <SelectPrimitive.Root data-slot=\"select\" value={value === null ? '' : value} {...props}>\n {options ? (\n <>\n <SelectTrigger\n id={id}\n size={size}\n className={className}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n aria-busy={ariaBusy}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent position={position}>\n {options.map((entry, index) =>\n isGroup(entry) ? (\n <Fragment key={entry.label}>\n {index > 0 && <SelectSeparator />}\n <SelectGroup>\n <SelectLabel>{entry.label}</SelectLabel>\n {entry.options.map((option) => (\n <SelectItem key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </SelectItem>\n ))}\n </SelectGroup>\n </Fragment>\n ) : (\n <SelectItem key={entry.value} value={entry.value} disabled={entry.disabled}>\n {entry.label}\n </SelectItem>\n ),\n )}\n </SelectContent>\n </>\n ) : (\n children\n )}\n </SelectPrimitive.Root>\n );\n}\n\nexport const SelectGroup = forwardRef<\n ElementRef<typeof SelectPrimitive.Group>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(function SelectGroup({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Group ref={ref} data-slot=\"select-group\" className={cn('scroll-my-1 p-1', className)} {...props} />\n );\n});\n\nexport const SelectValue = forwardRef<\n ElementRef<typeof SelectPrimitive.Value>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Value>\n>(function SelectValue(props, ref) {\n return <SelectPrimitive.Value ref={ref} data-slot=\"select-value\" {...props} />;\n});\n\nexport interface SelectTriggerProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {\n size?: SelectSize;\n}\n\nexport const SelectTrigger = forwardRef<ElementRef<typeof SelectPrimitive.Trigger>, SelectTriggerProps>(\n function SelectTrigger({ className, size = 'default', children, ...props }, ref) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n 'flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-muted-foreground',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n },\n);\n\nexport const SelectContent = forwardRef<\n ElementRef<typeof SelectPrimitive.Content>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(function SelectContent({ className, children, position = 'item-aligned', align = 'center', ...props }, ref) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n data-slot=\"select-content\"\n data-align-trigger={position === 'item-aligned'}\n className={cn(\n 'relative z-popover max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto scrollbar-thin rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100',\n 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[align-trigger=true]:animate-none',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',\n className,\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n data-position={position}\n className=\"data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)\"\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\n\nexport const SelectLabel = forwardRef<\n ElementRef<typeof SelectPrimitive.Label>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(function SelectLabel({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Label\n ref={ref}\n data-slot=\"select-label\"\n className={cn('px-1.5 py-1 text-xs text-muted-foreground', className)}\n {...props}\n />\n );\n});\n\nexport const SelectItem = forwardRef<\n ElementRef<typeof SelectPrimitive.Item>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(function SelectItem({ className, children, ...props }, ref) {\n return (\n <SelectPrimitive.Item\n ref={ref}\n data-slot=\"select-item\"\n className={cn(\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n});\n\nexport const SelectSeparator = forwardRef<\n ElementRef<typeof SelectPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(function SelectSeparator({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Separator\n ref={ref}\n data-slot=\"select-separator\"\n className={cn('pointer-events-none -mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n});\n\nexport const SelectScrollUpButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollUpButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(function SelectScrollUpButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpButton>\n );\n});\n\nexport const SelectScrollDownButton = forwardRef<\n ElementRef<typeof SelectPrimitive.ScrollDownButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(function SelectScrollDownButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownButton>\n );\n});\n","import { createContext, useContext, useEffect, useState, type ReactNode } from 'react';\nimport { createPortal } from 'react-dom';\n\nexport interface PortalProps {\n children: ReactNode;\n /**\n * Where to mount. Defaults to the nearest `PortalContainerProvider`, else `document.body`.\n *\n * Pass a container when the app renders inside a shadow root or a scoped theme\n * wrapper — the portal must stay inside whatever element the design tokens are\n * declared on, or every theme token (`var(--primary)` …) resolves to nothing.\n */\n container?: HTMLElement | null;\n}\n\n/**\n * The default mount point for every `Portal` beneath it.\n *\n * A Radix modal (`Dialog`, `Drawer`) traps focus inside its content, hides everything else\n * from assistive tech and treats a press anywhere else as \"outside\". A floating panel that\n * is not itself built on Radix, such as `Combobox`'s listbox or a `DatePicker` calendar,\n * would portal to `document.body` and land in exactly that \"everything else\": focus would be\n * pulled back out of it, and choosing an option would close the dialog. So each Radix modal\n * provides its own content node here, and those panels portal inside the dialog instead.\n * They position with `strategy: 'fixed'`, so the dialog's scroll container does not clip them.\n */\nconst PortalContainerContext = createContext<HTMLElement | null>(null);\n\nexport function PortalContainerProvider({\n container,\n children,\n}: {\n container: HTMLElement | null;\n children: ReactNode;\n}) {\n return (\n <PortalContainerContext.Provider value={container}>{children}</PortalContainerContext.Provider>\n );\n}\n\n/** The container a `Portal` here would mount into, for Radix parts that take `container`. */\nexport function usePortalContainer(): HTMLElement | null {\n return useContext(PortalContainerContext);\n}\n\n/**\n * Renders `children` outside the parent DOM hierarchy.\n *\n * Until 0.4.0 this library never called `createPortal` — `Modal`, `Drawer`,\n * `DropdownMenu`, `RoleComboBox` and the sidebar menu all rendered inline. Two concrete\n * failures came out of that:\n *\n * - `DropdownMenu` was positioned `absolute` inside a `relative` wrapper, so it was\n * clipped by `Card`'s `overflow-hidden` and by `DataTable`'s `overflow-x-auto` — the\n * two places its own doc comment said it was for.\n * - `position: fixed` resolves against the nearest ancestor with `transform`, `filter`,\n * `backdrop-filter`, `perspective`, `will-change` or `contain`, so a `Dialog` opened\n * from inside any transformed ancestor was positioned against that ancestor rather\n * than the viewport, and `z-50` was scoped to a stacking context it did not control.\n *\n * Mounting is deferred to an effect so the server render and the first client render\n * agree — reaching for `document` during render breaks SSR and hydration.\n */\nexport function Portal({ children, container }: PortalProps) {\n const [mounted, setMounted] = useState(false);\n const contextContainer = useContext(PortalContainerContext);\n\n useEffect(() => setMounted(true), []);\n\n if (!mounted) return null;\n\n const target =\n container ?? contextContainer ?? (typeof document === 'undefined' ? null : document.body);\n if (!target) return null;\n\n return createPortal(children, target);\n}\n","import {\n createContext,\n forwardRef,\n useContext,\n useId,\n useMemo,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport { Popover as PopoverPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\nimport { composeRefs } from '../../lib/slot';\nimport type { FloatingAlign, FloatingSide } from './floating';\nimport { deferEscapeToInnerPopup } from './overlay-stack';\nimport { usePortalContainer } from './portal';\n\n/** Shares the trigger's element, so the panel can be labelled by whatever id it really has. */\nconst PopoverTriggerNode = createContext<{\n node: HTMLElement | null;\n setNode: (node: HTMLElement | null) => void;\n modal: boolean;\n} | null>(null);\n\nexport interface PopoverProps {\n /** The parts (`PopoverTrigger`, `PopoverContent`); with the shorthand, the trigger element itself. */\n children: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /**\n * Trap focus, lock scroll and hide the rest of the page from assistive tech. Default\n * `false`.\n *\n * A popover is normally non-modal: the page behind stays usable, and Tab moves out of the\n * panel and on through the document. Set `modal` when the panel is a small form whose\n * background must not be touched until it is dismissed.\n */\n modal?: boolean;\n /** Shorthand: the panel's body. The children become the trigger. */\n content?: ReactNode;\n /** Shorthand: a `PopoverTitle` in a `PopoverHeader` above the content. */\n title?: ReactNode;\n /** Shorthand: a `PopoverDescription` under the title. */\n description?: ReactNode;\n /** Shorthand: where the panel opens. */\n side?: FloatingSide;\n align?: FloatingAlign;\n /** Shorthand: classes for the panel. */\n className?: string;\n}\n\n/**\n * Popover: a floating panel anchored to a trigger, for **interactive** content.\n *\n * Two ways to write one:\n * - Shorthand: `<Popover title=\"Dimensions\" description=\"...\" content={form}>{trigger}</Popover>`.\n * - Composition: `Popover` > `PopoverTrigger` + `PopoverContent` (optionally a `PopoverHeader`\n * with `PopoverTitle` and `PopoverDescription`).\n *\n * The distinction from `Tooltip` is not visual and it matters: a tooltip cannot be hovered\n * into or focused, so anything interactive inside one is unreachable. If the panel holds a\n * link, a button or a field, it has to be a popover — which means a real trigger with\n * `aria-expanded`/`aria-controls`, focus moving into the panel on open, and focus returning\n * to the trigger on close.\n *\n * Built on Radix Popover. Escape and outside press act on the topmost layer only, so a popover\n * inside a `Dialog` closes without taking the modal with it. Ours on top: the panel is named by\n * its trigger unless it has an `aria-label`, and says `aria-modal` when `modal`.\n */\nexport function Popover({\n children,\n open,\n defaultOpen,\n onOpenChange,\n modal = false,\n content,\n title,\n description,\n side,\n align,\n className,\n}: PopoverProps) {\n const [node, setNode] = useState<HTMLElement | null>(null);\n const trigger = useMemo(() => ({ node, setNode, modal }), [node, modal]);\n const shorthand = content !== undefined || title !== undefined || description !== undefined;\n\n return (\n <PopoverPrimitive.Root\n data-slot=\"popover\"\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n modal={modal}\n >\n <PopoverTriggerNode.Provider value={trigger}>\n {shorthand ? (\n <>\n <PopoverTrigger asChild>{children as ReactElement}</PopoverTrigger>\n <PopoverContent side={side} align={align} className={className}>\n {(title !== undefined || description !== undefined) && (\n <PopoverHeader>\n {title !== undefined && <PopoverTitle>{title}</PopoverTitle>}\n {description !== undefined && <PopoverDescription>{description}</PopoverDescription>}\n </PopoverHeader>\n )}\n {content}\n </PopoverContent>\n </>\n ) : (\n children\n )}\n </PopoverTriggerNode.Provider>\n </PopoverPrimitive.Root>\n );\n}\n\nexport interface PopoverTriggerProps extends HTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n /** Render onto the single child (e.g. a `Button`) instead of a bare `<button>`. */\n asChild?: boolean;\n}\n\n/**\n * Toggles the popover. Radix sets `aria-haspopup=\"dialog\"`, `aria-expanded`,\n * `aria-controls` and `data-state`, and composes your handlers with its own rather than\n * replacing them (0.6's `onClick` overrode the toggle).\n */\nexport const PopoverTrigger = forwardRef<HTMLButtonElement, PopoverTriggerProps>(function PopoverTrigger(props, ref) {\n const trigger = useContext(PopoverTriggerNode);\n const fallbackId = useId();\n return (\n <PopoverPrimitive.Trigger\n ref={composeRefs(ref, trigger?.setNode)}\n // An id to label the panel by. An `asChild` child's own `id` wins, and the panel\n // reads the real one off the node, so either way the reference resolves.\n id={props.id ?? fallbackId}\n data-slot=\"popover-trigger\"\n {...props}\n />\n );\n});\n\nexport interface PopoverContentProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n sideOffset?: number;\n /** Offset along the align axis, in px. */\n alignOffset?: number;\n /** Where to portal the panel. Defaults to the enclosing dialog, else `document.body`. */\n container?: HTMLElement | null;\n /** Radix's open auto-focus hook: `preventDefault()` and focus something else, e.g. a calendar's selected day. */\n onOpenAutoFocus?: (event: Event) => void;\n}\n\nexport const PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(function PopoverContent(\n {\n children,\n side = 'bottom',\n align = 'center',\n sideOffset = 4,\n alignOffset,\n container,\n className,\n onOpenAutoFocus,\n ...rest\n },\n ref,\n) {\n const trigger = useContext(PopoverTriggerNode);\n const inherited = usePortalContainer();\n const named = Boolean(rest['aria-label'] || rest['aria-labelledby']);\n\n return (\n <PopoverPrimitive.Portal container={container ?? inherited ?? undefined}>\n <PopoverPrimitive.Content\n ref={ref}\n data-slot=\"popover-content\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n collisionPadding={8}\n onOpenAutoFocus={onOpenAutoFocus}\n onEscapeKeyDown={(event) => void deferEscapeToInnerPopup(event)}\n // Radix traps focus and hides the page for a modal popover but does not say so.\n aria-modal={trigger?.modal || undefined}\n // Named by the trigger unless the caller names it.\n aria-labelledby={named ? undefined : trigger?.node?.id || undefined}\n className={cn(\n 'z-popover flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100',\n 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...rest}\n >\n {children}\n </PopoverPrimitive.Content>\n </PopoverPrimitive.Portal>\n );\n});\n\n/** Groups a `PopoverTitle` and `PopoverDescription` at the top of the panel. */\nexport const PopoverHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function PopoverHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div ref={ref} data-slot=\"popover-header\" className={cn('flex flex-col gap-0.5 text-sm', className)} {...props} />\n );\n});\n\nexport const PopoverTitle = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function PopoverTitle(\n { className, ...props },\n ref,\n) {\n return <div ref={ref} data-slot=\"popover-title\" className={cn('font-medium', className)} {...props} />;\n});\n\nexport const PopoverDescription = forwardRef<HTMLParagraphElement, HTMLAttributes<HTMLParagraphElement>>(\n function PopoverDescription({ className, ...props }, ref) {\n return (\n <p ref={ref} data-slot=\"popover-description\" className={cn('text-muted-foreground', className)} {...props} />\n );\n },\n);\n\n/** Closes the enclosing popover, e.g. an \"Apply\" or \"Cancel\" button. New in 0.7.0. */\nexport const PopoverClose = forwardRef<HTMLButtonElement, HTMLAttributes<HTMLButtonElement> & { asChild?: boolean }>(\n function PopoverClose(props, ref) {\n return <PopoverPrimitive.Close ref={ref} data-slot=\"popover-close\" {...props} />;\n },\n);\n\n/** Positions the panel against an element other than the trigger. New in 0.7.0. */\nexport const PopoverAnchor = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement> & { asChild?: boolean }>(\n function PopoverAnchor(props, ref) {\n return <PopoverPrimitive.Anchor ref={ref} data-slot=\"popover-anchor\" {...props} />;\n },\n);\n","import { useEffect, useRef, useState, type RefObject } from 'react';\n\n/**\n * A process-wide stack of the overlays currently mounted, plus the two document-level\n * side effects that belong to \"there is a dialog open\": scroll lock and an inert\n * background.\n *\n * Why a stack rather than per-overlay listeners. Before 0.4.0 every overlay attached its\n * own `keydown` handler to `document`. `useOverlayDismiss` called `e.stopPropagation()`\n * on Escape, which stops propagation *to other nodes* — it does not stop the other\n * listeners already registered on the same node. All of them were on `document`. So a\n * `DropdownMenu` open inside a `Modal` closed both on one Escape, and two stacked modals\n * closed together. Ordering has to be decided centrally, by asking \"am I topmost?\",\n * which is what this module answers.\n */\n\ntype Layer = { id: symbol };\n\nconst layers: Layer[] = [];\nconst listeners = new Set<() => void>();\n\nfunction notify() {\n for (const listener of listeners) listener();\n}\n\nfunction topmost(): symbol | undefined {\n return layers[layers.length - 1]?.id;\n}\n\n// ── Escape inside a Radix surface ─────────────────────────────────────────────\n\nconst deferredEscapes = new WeakSet<Event>();\n\n/**\n * For a Radix surface's `onEscapeKeyDown`: returns `true` and vetoes Radix's dismissal when the\n * Escape belongs to a popup open inside the surface instead.\n *\n * Radix layers listen for Escape on `document` in the capture phase, so they hear it before\n * anything inside them. A Select or Combobox open in a Dialog lost the key to the Dialog: one\n * Escape closed the dialog, and the Select's list stayed open over the page. The Escape is\n * claimed when a custom layer (Select's list) is open, or when it was pressed on an expanded\n * combobox, whose own key handler closes its list.\n *\n * Vetoing means `preventDefault()`, the only signal Radix reads, so the event is also recorded:\n * {@link isEscapeDeferred} lets `useOverlayDismiss` tell this veto apart from a real one.\n */\nexport function deferEscapeToInnerPopup(event: KeyboardEvent): boolean {\n const target = event.target;\n const fromOpenCombobox =\n target instanceof Element && target.closest('[role=\"combobox\"][aria-expanded=\"true\"]') !== null;\n if (layers.length === 0 && !fromOpenCombobox) return false;\n deferredEscapes.add(event);\n event.preventDefault();\n return true;\n}\n\n/** Whether a Radix surface passed this Escape on with {@link deferEscapeToInnerPopup}. */\nexport function isEscapeDeferred(event: Event): boolean {\n return deferredEscapes.has(event);\n}\n\n// ── Scroll lock ────────────────────────────────────────────────────────────────\n\nlet scrollLocks = 0;\nlet restoreBody: (() => void) | null = null;\n\nfunction lockScroll() {\n scrollLocks += 1;\n if (scrollLocks > 1 || typeof document === 'undefined') return;\n\n const { body, documentElement } = document;\n const previousOverflow = body.style.overflow;\n const previousPaddingRight = body.style.paddingRight;\n\n // Removing the scrollbar reflows the page a few pixels narrower, which reads as the\n // whole layout twitching sideways as the dialog appears. Pad by exactly the width the\n // scrollbar occupied to hold everything still.\n const scrollbarWidth = window.innerWidth - documentElement.clientWidth;\n if (scrollbarWidth > 0) {\n const current = parseFloat(window.getComputedStyle(body).paddingRight) || 0;\n body.style.paddingRight = `${current + scrollbarWidth}px`;\n }\n body.style.overflow = 'hidden';\n\n restoreBody = () => {\n body.style.overflow = previousOverflow;\n body.style.paddingRight = previousPaddingRight;\n };\n}\n\nfunction unlockScroll() {\n scrollLocks = Math.max(0, scrollLocks - 1);\n if (scrollLocks === 0 && restoreBody) {\n restoreBody();\n restoreBody = null;\n }\n}\n\n// ── Inert background ───────────────────────────────────────────────────────────\n\nconst inerted = new Set<HTMLElement>();\n\n/**\n * Marks every top-level sibling of the overlay's own subtree `inert`, which removes it\n * from the accessibility tree *and* from the tab sequence in one attribute.\n *\n * `aria-modal=\"true\"` alone — all this library had before — is honoured by modern screen\n * readers for virtual-cursor browsing but does nothing about focus, and older AT ignores\n * it entirely. `inert` is the actual guarantee.\n */\nfunction applyInert(node: HTMLElement | null) {\n if (typeof document === 'undefined' || !node) return;\n\n // Walk up to whichever direct child of <body> contains this overlay, so the overlay's\n // own portal container is the one subtree left interactive.\n let root: HTMLElement = node;\n while (root.parentElement && root.parentElement !== document.body) {\n root = root.parentElement;\n }\n\n for (const child of Array.from(document.body.children)) {\n if (child === root || !(child instanceof HTMLElement)) continue;\n if (child.hasAttribute('inert')) continue;\n child.setAttribute('inert', '');\n inerted.add(child);\n }\n}\n\nfunction releaseInert() {\n for (const el of inerted) el.removeAttribute('inert');\n inerted.clear();\n}\n\n// ── Hook ───────────────────────────────────────────────────────────────────────\n\nexport interface UseOverlayLayerOptions {\n /** Prevent the page behind from scrolling. Default `true`. */\n lockScroll?: boolean;\n /**\n * Mark sibling content `inert`. Default `true`. Turn it off for non-modal surfaces —\n * a tooltip or a popover must leave the rest of the page usable.\n */\n inertBackground?: boolean;\n /**\n * Ref to the panel element, used to work out which subtree to leave interactive.\n *\n * Deliberately the ref object rather than the node: a node read during render is\n * always `null` on the first pass, and nothing re-renders the consumer once the ref\n * is attached, so the inert pass would never run. Effects read `.current` after the\n * DOM is committed, where it is populated.\n */\n panelRef?: RefObject<HTMLElement | null>;\n}\n\n/**\n * Registers a mounted overlay with the stack.\n *\n * Returns `isTopmost`, which every dismissal handler must gate on so only the frontmost\n * layer reacts to Escape or an outside pointer press.\n */\nexport function useOverlayLayer(\n active: boolean,\n {\n lockScroll: shouldLockScroll = true,\n inertBackground = true,\n panelRef,\n }: UseOverlayLayerOptions = {},\n): { isTopmost: boolean } {\n const id = useRef<symbol | undefined>(undefined);\n if (!id.current) id.current = Symbol('overlay-layer');\n\n const [isTopmost, setIsTopmost] = useState(false);\n\n useEffect(() => {\n if (!active) return;\n const self = id.current!;\n\n layers.push({ id: self });\n\n const sync = () => setIsTopmost(topmost() === self);\n listeners.add(sync);\n sync();\n notify();\n\n if (shouldLockScroll) lockScroll();\n\n return () => {\n const index = layers.findIndex((layer) => layer.id === self);\n if (index !== -1) layers.splice(index, 1);\n listeners.delete(sync);\n notify();\n if (shouldLockScroll) unlockScroll();\n };\n }, [active, shouldLockScroll]);\n\n useEffect(() => {\n if (!active || !inertBackground) return;\n // Only the bottom-most modal layer needs to set this: it already hides everything\n // outside the overlay tree, and every overlay above it portals into the same root.\n if (inerted.size === 0) applyInert(panelRef?.current ?? null);\n return () => {\n if (layers.length <= 1) releaseInert();\n };\n }, [active, inertBackground, panelRef]);\n\n return { isTopmost };\n}\n","import {\n createContext,\n forwardRef,\n useContext,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type ElementRef,\n type ReactNode,\n} from 'react';\nimport { Toggle as TogglePrimitive, ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\n\n/**\n * Toggle: a two-state button that can be either on or off (`aria-pressed`): bold in a text\n * toolbar, a filter that stays applied. A setting that takes effect at once is a `Switch`.\n *\n * ToggleGroup: a set of two-state buttons that can be toggled on or off. `type=\"single\"` allows\n * none or one; `type=\"multiple\"` none or many. The group is one tab stop with arrow keys inside,\n * and passes its `variant` and `size` to its items. `spacing={0}` joins them into one bar.\n *\n * Shorthand: `<ToggleGroup type=\"single\" options={[{ value, label, 'aria-label'?, disabled? }]} />`\n * renders the items. An icon-only toggle needs an `aria-label`.\n */\n\nexport type ToggleVariant = 'default' | 'outline';\nexport type ToggleSize = 'default' | 'sm' | 'lg';\n\nconst VARIANT: Record<ToggleVariant, string> = {\n default: 'bg-transparent',\n outline: 'border border-input bg-transparent hover:bg-muted',\n};\n\nconst SIZE: Record<ToggleSize, string> = {\n default: 'h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n sm: \"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: 'h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',\n};\n\nexport function toggleVariants({\n variant = 'default',\n size = 'default',\n}: { variant?: ToggleVariant; size?: ToggleSize } = {}) {\n return cn(\n 'group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground',\n 'focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n VARIANT[variant],\n SIZE[size],\n );\n}\n\nexport interface ToggleProps extends ComponentPropsWithoutRef<typeof TogglePrimitive.Root> {\n variant?: ToggleVariant;\n size?: ToggleSize;\n}\n\nexport const Toggle = forwardRef<ElementRef<typeof TogglePrimitive.Root>, ToggleProps>(function Toggle(\n { className, variant = 'default', size = 'default', ...props },\n ref,\n) {\n return (\n <TogglePrimitive.Root\n ref={ref}\n data-slot=\"toggle\"\n className={cn(toggleVariants({ variant, size }), className)}\n {...props}\n />\n );\n});\n\n// ── ToggleGroup ────────────────────────────────────────────────────────────────\n\ninterface ToggleGroupContextValue {\n variant?: ToggleVariant;\n size?: ToggleSize;\n spacing: number;\n orientation: 'horizontal' | 'vertical';\n}\n\nconst ToggleGroupContext = createContext<ToggleGroupContextValue>({\n variant: 'default',\n size: 'default',\n spacing: 2,\n orientation: 'horizontal',\n});\n\n/** One toggle as data, for the `options` shorthand. */\nexport interface ToggleGroupOption {\n value: string;\n /** Text or an icon. */\n label: ReactNode;\n /** Required when `label` is an icon: there is no visible text to name the toggle. */\n 'aria-label'?: string;\n disabled?: boolean;\n}\n\nexport type ToggleGroupProps = ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & {\n variant?: ToggleVariant;\n size?: ToggleSize;\n /** Gap between the items, in spacing units. `0` joins them into one bar. Default `2`. */\n spacing?: number;\n orientation?: 'horizontal' | 'vertical';\n /** Shorthand: the toggles as data. */\n options?: readonly ToggleGroupOption[];\n};\n\nexport const ToggleGroup = forwardRef<ElementRef<typeof ToggleGroupPrimitive.Root>, ToggleGroupProps>(\n function ToggleGroup(\n { className, variant, size, spacing = 2, orientation = 'horizontal', options, children, style, ...props },\n ref,\n ) {\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n data-spacing={spacing}\n data-orientation={orientation}\n orientation={orientation}\n style={{ '--gap': spacing, ...style } as CSSProperties}\n className={cn(\n 'group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch',\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size, spacing, orientation }}>\n {options\n ? options.map((option) => (\n <ToggleGroupItem\n key={option.value}\n value={option.value}\n aria-label={option['aria-label']}\n disabled={option.disabled}\n >\n {option.label}\n </ToggleGroupItem>\n ))\n : children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n },\n);\n\nexport interface ToggleGroupItemProps extends ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> {\n variant?: ToggleVariant;\n size?: ToggleSize;\n}\n\nexport const ToggleGroupItem = forwardRef<ElementRef<typeof ToggleGroupPrimitive.Item>, ToggleGroupItemProps>(\n function ToggleGroupItem({ className, variant = 'default', size = 'default', ...props }, ref) {\n const context = useContext(ToggleGroupContext);\n const itemVariant = context.variant || variant;\n const itemSize = context.size || size;\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n data-slot=\"toggle-group-item\"\n data-variant={itemVariant}\n data-size={itemSize}\n data-spacing={context.spacing}\n className={cn(\n toggleVariants({ variant: itemVariant, size: itemSize }),\n 'shrink-0 focus:z-10 focus-visible:z-10',\n 'group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5',\n 'group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg',\n 'group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t',\n className,\n )}\n {...props}\n />\n );\n },\n);\n","import { cloneElement, forwardRef, isValidElement, type HTMLAttributes, type ReactElement, type ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\nimport { Slot } from '../../lib/slot';\n\n/**\n * Badge: displays a badge or a component that looks like a badge.\n *\n * Content is children. An icon is a child too: give it `data-icon=\"inline-start\"` or\n * `\"inline-end\"` and the badge tightens its padding on that side. `asChild` renders a link (or\n * any element) as the badge.\n *\n * `variant` sets the look: `default`, `secondary`, `destructive`, `outline`, `ghost`, `link`.\n * `color` picks from the categorical palette (`BADGE_COLORS`): a tinted fill with `default`, a\n * coloured border and text with `outline`.\n *\n * Shorthand: `icon` adds a leading icon (the same as an icon child with\n * `data-icon=\"inline-start\"`), and `indicator` a leading dot in the text colour.\n */\n\nexport type BadgeVariant = 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' | 'link';\nexport type BadgeColor =\n | 'gray'\n | 'red'\n | 'orange'\n | 'yellow'\n | 'lime'\n | 'green'\n | 'teal'\n | 'blue'\n | 'pink'\n | 'slate'\n | 'violet';\n\n/**\n * Every `BadgeColor`, in a stable order: the library's categorical palette. Index it to give\n * data a colour of its own, e.g. a company's tile `BADGE_COLORS[hash % BADGE_COLORS.length]`,\n * instead of keeping a list of hex values in the app.\n */\nexport const BADGE_COLORS: readonly BadgeColor[] = ['blue', 'green', 'violet', 'yellow', 'teal', 'pink', 'lime', 'red', 'slate', 'gray', 'orange'];\n\nconst BASE =\n 'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!';\n\nconst VARIANT: Record<BadgeVariant, string> = {\n default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',\n secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',\n destructive:\n 'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',\n outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',\n ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',\n link: 'text-primary underline-offset-4 hover:underline',\n};\n\nconst FILL: Record<BadgeColor, string> = {\n gray: 'bg-badge-gray text-badge-gray',\n red: 'bg-badge-red text-badge-red',\n orange: 'bg-badge-orange text-badge-orange',\n yellow: 'bg-badge-yellow text-badge-yellow',\n lime: 'bg-badge-lime text-badge-lime',\n green: 'bg-badge-green text-badge-green',\n teal: 'bg-badge-teal text-badge-teal',\n blue: 'bg-badge-blue text-badge-blue',\n pink: 'bg-badge-pink text-badge-pink',\n slate: 'bg-badge-slate text-badge-slate',\n violet: 'bg-badge-violet text-badge-violet',\n};\n\nconst OUTLINE: Record<BadgeColor, string> = {\n gray: 'border-badge-gray text-badge-gray',\n red: 'border-badge-red text-badge-red',\n orange: 'border-badge-orange text-badge-orange',\n yellow: 'border-badge-yellow text-badge-yellow',\n lime: 'border-badge-lime text-badge-lime',\n green: 'border-badge-green text-badge-green',\n teal: 'border-badge-teal text-badge-teal',\n blue: 'border-badge-blue text-badge-blue',\n pink: 'border-badge-pink text-badge-pink',\n slate: 'border-badge-slate text-badge-slate',\n violet: 'border-badge-violet text-badge-violet',\n};\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Default `default`. */\n variant?: BadgeVariant;\n /** A palette colour: a tinted fill with `default`, a coloured border and text with `outline`. */\n color?: BadgeColor;\n /** Render the child element as the badge, e.g. a link. */\n asChild?: boolean;\n /** Shorthand: a leading icon, decorative (hidden from assistive tech). */\n icon?: ReactNode;\n /** Shorthand: a leading dot in the text colour. */\n indicator?: boolean;\n}\n\n/** The icon shorthand, rendered exactly as an icon child: `data-icon=\"inline-start\"`, decorative. */\nfunction leadingIcon(icon: ReactNode) {\n if (isValidElement(icon)) {\n return cloneElement(icon as ReactElement<Record<string, unknown>>, { 'data-icon': 'inline-start', 'aria-hidden': true });\n }\n return (\n <span data-icon=\"inline-start\" aria-hidden className=\"inline-flex size-3 shrink-0 [&>svg]:size-full\">\n {icon}\n </span>\n );\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { className, variant = 'default', color, asChild = false, icon, indicator = false, children, ...props },\n ref,\n) {\n const Comp = asChild ? Slot : 'span';\n const tint = color ? (variant === 'default' ? FILL[color] : variant === 'outline' ? OUTLINE[color] : '') : '';\n return (\n <Comp\n ref={ref}\n data-slot=\"badge\"\n data-variant={variant}\n data-color={color}\n className={cn(BASE, VARIANT[variant], tint, className)}\n {...props}\n >\n {asChild ? (\n children\n ) : (\n <>\n {indicator && <span data-icon=\"inline-start\" aria-hidden className=\"size-1.5 shrink-0 rounded-full bg-current\" />}\n {icon !== undefined && icon !== null && leadingIcon(icon)}\n {children}\n </>\n )}\n </Comp>\n );\n});\n","import {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useState,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type ReactNode,\n type RefObject,\n} from 'react';\nimport { Dialog as DialogPrimitive } from 'radix-ui';\nimport { XIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { composeRefs } from '../../lib/slot';\nimport { Button } from '../forms/button';\nimport { deferEscapeToInnerPopup } from './overlay-stack';\nimport { PortalContainerProvider, usePortalContainer } from './portal';\nimport { isInsideToaster } from './toaster-guard';\n\n/**\n * Dialog: a window overlaid on the primary window (or another dialog), rendering the content\n * underneath inert.\n *\n * Two ways to write one:\n * - Shorthand: `<Dialog trigger title description footer>{body}</Dialog>` renders the content,\n * header and footer for you.\n * - Composition: `Dialog` > `DialogTrigger` + `DialogContent` > `DialogHeader` (`DialogTitle`,\n * `DialogDescription`) + body + `DialogFooter`.\n *\n * Built on Radix Dialog: focus trap, focus return, Escape and outside press scoped to the\n * topmost layer, scroll lock, and the page behind hidden from assistive tech. On top of that:\n * - Focus returns to whatever held it on open, so a controlled dialog opened by an ordinary\n * button (not a `DialogTrigger`) still hands focus back.\n * - Escape closes an open popup inside the dialog (a Select, a Combobox list) before the dialog.\n * - Pressing a toast is not an outside press.\n * - Popups inside the dialog that are not Radix parts portal into it.\n * For a yes/no confirm, use `AlertDialog`; for a panel from the edge, `Drawer`.\n */\n\n// ── Naming ──────────────────────────────────────────────────────────────────────\n\n/**\n * Lets the content know which naming parts are rendered: without a `DialogTitle`, `label`\n * becomes a visually hidden title; without a `DialogDescription`, `aria-describedby` is left\n * off instead of pointing at an id that is not in the document.\n */\ninterface DialogNamingContext {\n registerTitle: (present: boolean) => void;\n registerDescription: (present: boolean) => void;\n}\n\nconst DialogNaming = createContext<DialogNamingContext | null>(null);\n\n// ── Parts ───────────────────────────────────────────────────────────────────────\n\nexport const DialogTrigger = forwardRef<HTMLButtonElement, ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>>(\n function DialogTrigger(props, ref) {\n return <DialogPrimitive.Trigger ref={ref} data-slot=\"dialog-trigger\" {...props} />;\n },\n);\n\nexport function DialogPortal({ container, ...props }: ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>) {\n const provided = usePortalContainer();\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" container={container ?? provided ?? undefined} {...props} />;\n}\n\nexport const DialogClose = forwardRef<HTMLButtonElement, ComponentPropsWithoutRef<typeof DialogPrimitive.Close>>(\n function DialogClose(props, ref) {\n return <DialogPrimitive.Close ref={ref} data-slot=\"dialog-close\" {...props} />;\n },\n);\n\nexport const DialogOverlay = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>>(\n function DialogOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n data-slot=\"dialog-overlay\"\n className={cn(\n 'fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nexport interface DialogContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {\n /** The × button in the top corner. Default `true`. */\n showCloseButton?: boolean;\n /** Accessible name when the dialog renders no `DialogTitle` (a visually hidden title). */\n label?: string;\n /** Focus this on open instead of the first tabbable element. */\n initialFocus?: RefObject<HTMLElement | null>;\n /** Where to portal the dialog. Default: the enclosing dialog, else `document.body`. */\n container?: HTMLElement | null;\n}\n\nexport const DialogContent = forwardRef<HTMLDivElement, DialogContentProps>(function DialogContent(\n { container, ...props },\n ref,\n) {\n return (\n <DialogPortal container={container ?? undefined}>\n <DialogOverlay />\n <DialogPanel ref={ref} {...props} />\n </DialogPortal>\n );\n});\n\n/**\n * The panel itself. A separate component inside the portal, so it mounts only while the dialog\n * is open: the element to return focus to is read on open, not when the closed dialog first\n * rendered.\n */\nconst DialogPanel = forwardRef<HTMLDivElement, Omit<DialogContentProps, 'container'>>(function DialogPanel(\n {\n className,\n children,\n showCloseButton = true,\n label,\n initialFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n ...props\n },\n ref,\n) {\n const [hasTitle, setHasTitle] = useState(false);\n const [hasDescription, setHasDescription] = useState(false);\n const [contentNode, setContentNode] = useState<HTMLDivElement | null>(null);\n // Read during the first render, before Radix moves focus into the panel.\n const [returnFocusTo] = useState(() =>\n typeof document === 'undefined' ? null : (document.activeElement as HTMLElement | null),\n );\n\n return (\n <DialogPrimitive.Content\n ref={composeRefs(ref, setContentNode)}\n data-slot=\"dialog-content\"\n // Only point at a description that exists.\n {...(hasDescription ? {} : { 'aria-describedby': undefined })}\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm',\n 'data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n onOpenAutoFocus={(event) => {\n onOpenAutoFocus?.(event);\n const target = initialFocus?.current;\n if (target && !event.defaultPrevented) {\n event.preventDefault();\n target.focus();\n }\n }}\n onCloseAutoFocus={(event) => {\n onCloseAutoFocus?.(event);\n if (event.defaultPrevented) return;\n // Radix returns focus only to its own DialogTrigger; a controlled dialog opened by an\n // ordinary button would drop focus to <body>.\n if (returnFocusTo?.isConnected && returnFocusTo !== document.body) {\n event.preventDefault();\n returnFocusTo.focus();\n }\n }}\n onEscapeKeyDown={(event) => {\n if (!deferEscapeToInnerPopup(event)) onEscapeKeyDown?.(event);\n }}\n onPointerDownOutside={(event) => {\n if (isInsideToaster(event.target)) {\n event.preventDefault();\n return;\n }\n onPointerDownOutside?.(event);\n }}\n {...props}\n >\n {!hasTitle && label && <DialogPrimitive.Title className=\"sr-only\">{label}</DialogPrimitive.Title>}\n <DialogNaming.Provider\n value={{\n registerTitle: setHasTitle,\n registerDescription: setHasDescription,\n }}\n >\n <PortalContainerProvider container={contentNode}>{children}</PortalContainerProvider>\n </DialogNaming.Provider>\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button variant=\"ghost\" size=\"icon-sm\" className=\"absolute end-2 top-2\">\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n );\n});\n\nexport const DialogHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function DialogHeader(\n { className, ...props },\n ref,\n) {\n return <div ref={ref} data-slot=\"dialog-header\" className={cn('flex flex-col gap-2', className)} {...props} />;\n});\n\nexport interface DialogFooterProps extends HTMLAttributes<HTMLDivElement> {\n /** Adds an outline \"Close\" button. Default `false`. */\n showCloseButton?: boolean;\n}\n\nexport const DialogFooter = forwardRef<HTMLDivElement, DialogFooterProps>(function DialogFooter(\n { className, showCloseButton = false, children, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"dialog-footer\"\n className={cn(\n '-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n );\n});\n\nexport const DialogTitle = forwardRef<HTMLHeadingElement, ComponentPropsWithoutRef<typeof DialogPrimitive.Title>>(\n function DialogTitle({ className, ...props }, ref) {\n const naming = useContext(DialogNaming);\n useEffect(() => {\n naming?.registerTitle(true);\n return () => naming?.registerTitle(false);\n }, [naming]);\n return (\n <DialogPrimitive.Title\n ref={ref}\n data-slot=\"dialog-title\"\n className={cn('text-base leading-none font-medium', className)}\n {...props}\n />\n );\n },\n);\n\nexport const DialogDescription = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function DialogDescription({ className, ...props }, ref) {\n const naming = useContext(DialogNaming);\n useEffect(() => {\n naming?.registerDescription(true);\n return () => naming?.registerDescription(false);\n }, [naming]);\n return (\n <DialogPrimitive.Description\n ref={ref}\n data-slot=\"dialog-description\"\n className={cn(\n 'text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground',\n className,\n )}\n {...props}\n />\n );\n});\n\n// ── Root (with the shorthand) ───────────────────────────────────────────────────\n\nexport interface DialogProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Root> {\n /** Shorthand: an element that opens the dialog (rendered as the trigger, `asChild`). */\n trigger?: ReactNode;\n /** Shorthand: the title. With it, the dialog renders its own content, header and footer. */\n title?: ReactNode;\n /** Shorthand: the description under the title. */\n description?: ReactNode;\n /** Shorthand: the footer's content, usually the buttons. */\n footer?: ReactNode;\n /** Shorthand: the × button. Default `true`. */\n showCloseButton?: boolean;\n /** Shorthand: classes for the content panel, e.g. a width (`sm:max-w-md`). */\n className?: string;\n /** Shorthand: props for the content panel (`initialFocus`, `onEscapeKeyDown`, …). */\n contentProps?: Omit<DialogContentProps, 'children' | 'className' | 'showCloseButton'>;\n}\n\nexport function Dialog({\n trigger,\n title,\n description,\n footer,\n showCloseButton,\n className,\n contentProps,\n children,\n ...props\n}: DialogProps) {\n if (title === undefined) {\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props}>\n {trigger && <DialogTrigger asChild>{trigger}</DialogTrigger>}\n {children}\n </DialogPrimitive.Root>\n );\n }\n\n return (\n <DialogPrimitive.Root data-slot=\"dialog\" {...props}>\n {trigger && <DialogTrigger asChild>{trigger}</DialogTrigger>}\n <DialogContent className={className} showCloseButton={showCloseButton} {...contentProps}>\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description !== undefined && <DialogDescription>{description}</DialogDescription>}\n </DialogHeader>\n {children}\n {footer !== undefined && <DialogFooter>{footer}</DialogFooter>}\n </DialogContent>\n </DialogPrimitive.Root>\n );\n}\n","/**\n * Tells a press on a toast apart from a press outside a modal overlay.\n *\n * A toast fired from inside a Dialog (e.g. \"Saved\") renders in the toast region (Sonner's\n * `[data-sonner-toaster]`), a sibling of the dialog in `document.body`. Radix dismisses a modal on\n * any pointer-down outside its content, so without this check, pressing the toast's action or\n * close button would also close the dialog the user was still working in.\n */\nexport function isInsideToaster(target: EventTarget | null): boolean {\n return target instanceof Element && target.closest('[data-sonner-toaster], [data-sonner-toast]') !== null;\n}\n","import {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { CheckIcon, SearchIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../overlays/dialog';\nimport { InputGroup, InputGroupAddon } from './input-group';\n\n/**\n * A command menu: a filter input over a list of actions, with groups, shortcuts and keyboard\n * navigation. Its own engine, shaped like cmdk: the same parts and the same data attributes\n * (`cmdk-item`, `data-selected`, `cmdk-group-heading`). Focus stays in the input and\n * `aria-activedescendant` carries the highlight. Nothing here needs ResizeObserver or\n * `scrollIntoView` (used only when present), so it runs in a bare jsdom.\n */\n\ntype Filter = (value: string, search: string, keywords?: string[]) => number;\n\nconst defaultFilter: Filter = (value, search, keywords) => {\n const q = search.trim().toLowerCase();\n if (!q) return 1;\n if (value.toLowerCase().includes(q)) return 1;\n return keywords?.some((keyword) => keyword.toLowerCase().includes(q)) ? 1 : 0;\n};\n\ninterface CommandContextValue {\n search: string;\n setSearch: (search: string) => void;\n selected: string | undefined;\n setSelected: (value: string | undefined) => void;\n matches: (value: string, keywords?: string[]) => boolean;\n register: (id: string) => () => void;\n count: number;\n listId: string;\n label: string;\n onKeyNav: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n activeId: string | undefined;\n rootRef: React.RefObject<HTMLDivElement | null>;\n}\n\nconst CommandContext = createContext<CommandContextValue | null>(null);\n\nfunction useCommand(part: string) {\n const ctx = useContext(CommandContext);\n if (!ctx) throw new Error(`${part} must be used inside <Command>.`);\n return ctx;\n}\n\n/** The plain text of a React node, for an item's default value. */\nfunction textOf(node: ReactNode): string {\n if (node === null || node === undefined || typeof node === 'boolean') return '';\n if (typeof node === 'string' || typeof node === 'number') return String(node);\n if (Array.isArray(node)) return node.map(textOf).join('');\n if (isValidElement<{ children?: ReactNode }>(node)) return textOf(node.props.children);\n return Children.toArray(node).map(textOf).join('');\n}\n\nconst itemsIn = (root: HTMLElement | null) =>\n root ? Array.from(root.querySelectorAll<HTMLElement>('[cmdk-item]:not([data-disabled=\"true\"])')) : [];\n\n// ── Shorthand ──────────────────────────────────────────────────────────────────\n\nexport interface CommandItemDef {\n id: string;\n label: string;\n description?: string;\n /** Items with the same `group` are listed under that heading, in order of first appearance. */\n group?: string;\n icon?: ReactNode;\n shortcut?: ReactNode;\n /** Extra words the filter matches, e.g. \"logout\" for \"Sign out\". */\n keywords?: string[];\n disabled?: boolean;\n onSelect: () => void;\n}\n\nexport interface CommandProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {\n /** Shorthand: the commands, rendered as an input, a list, groups and items. Leave out to compose. */\n items?: CommandItemDef[];\n /** Shorthand: the input's placeholder. */\n placeholder?: string;\n /** Shorthand: shown when nothing matches. Default `No results found.` */\n empty?: ReactNode;\n /** Shorthand: called after an item's `onSelect`, e.g. to close a dialog. */\n onAfterSelect?: () => void;\n /** Shorthand: focus the input on mount, for a palette opened by a shortcut. Default `false`. */\n autoFocus?: boolean;\n /** Accessible name of the input and the list. Default `Command menu`. */\n label?: string;\n /** The highlighted item's value. */\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n /** Filter and sort-free scoring: return > 0 to show an item. Default: value or keywords contain the search. */\n filter?: Filter;\n /** Set `false` to show every item whatever the search (filter them yourself). Default `true`. */\n shouldFilter?: boolean;\n /** Arrow keys wrap from the last item to the first. Default `false`. */\n loop?: boolean;\n}\n\nexport const Command = forwardRef<HTMLDivElement, CommandProps>(function Command(\n {\n items,\n placeholder = 'Type a command or search...',\n empty = 'No results found.',\n onAfterSelect,\n autoFocus = false,\n label = 'Command menu',\n value,\n defaultValue,\n onValueChange,\n filter = defaultFilter,\n shouldFilter = true,\n loop = false,\n className,\n children,\n ...props\n },\n ref,\n) {\n const [search, setSearch] = useState('');\n const [selected, setSelectedState] = useControllableState<string | undefined>({\n value,\n defaultValue,\n onChange: onValueChange as ((next: string | undefined) => void) | undefined,\n });\n const [ids, setIds] = useState<string[]>([]);\n const rootRef = useRef<HTMLDivElement | null>(null);\n const baseId = useId();\n const listId = `${baseId}-list`;\n\n const register = useCallback((id: string) => {\n setIds((current) => [...current, id]);\n return () => setIds((current) => current.filter((x) => x !== id));\n }, []);\n\n const matches = useCallback(\n (itemValue: string, keywords?: string[]) => !shouldFilter || filter(itemValue, search, keywords) > 0,\n [filter, search, shouldFilter],\n );\n\n const setSelected = useCallback((next: string | undefined) => setSelectedState(next), [setSelectedState]);\n\n // Highlight the first item whenever the search or the visible items change, and keep a\n // highlight that is still visible.\n useLayoutEffect(() => {\n const list = itemsIn(rootRef.current);\n if (list.some((node) => node.dataset.value === selected)) return;\n setSelectedState(list[0]?.dataset.value);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [search, ids.length]);\n\n const activeNode = rootRef.current?.querySelector<HTMLElement>(\n `[cmdk-item][data-value=\"${CSS.escape(selected ?? '')}\"]`,\n );\n const activeId = selected === undefined ? undefined : activeNode?.id;\n\n useEffect(() => {\n if (activeNode && typeof activeNode.scrollIntoView === 'function') activeNode.scrollIntoView({ block: 'nearest' });\n }, [activeNode]);\n\n const onKeyNav = (event: React.KeyboardEvent<HTMLInputElement>) => {\n const list = itemsIn(rootRef.current);\n if (list.length === 0) return;\n const index = list.findIndex((node) => node.dataset.value === selected);\n const go = (next: number) => {\n event.preventDefault();\n const target = loop ? (next + list.length) % list.length : Math.min(Math.max(next, 0), list.length - 1);\n setSelectedState(list[target]?.dataset.value);\n };\n switch (event.key) {\n case 'ArrowDown':\n go(index + 1);\n break;\n case 'ArrowUp':\n go(index - 1);\n break;\n case 'Home':\n go(0);\n break;\n case 'End':\n go(list.length - 1);\n break;\n case 'Enter':\n if (index >= 0) {\n event.preventDefault();\n list[index].click();\n }\n break;\n default:\n break;\n }\n };\n\n const ctx: CommandContextValue = {\n search,\n setSearch,\n selected,\n setSelected,\n matches,\n register,\n count: ids.length,\n listId,\n label,\n onKeyNav,\n activeId,\n rootRef,\n };\n\n const groups = useMemo(() => {\n if (!items) return [];\n const order: (string | undefined)[] = [];\n for (const item of items) if (!order.includes(item.group)) order.push(item.group);\n return order.map((group) => ({ group, items: items.filter((item) => item.group === group) }));\n }, [items]);\n\n return (\n <CommandContext.Provider value={ctx}>\n <div\n ref={(node) => {\n rootRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n }}\n cmdk-root=\"\"\n data-slot=\"command\"\n className={cn('relative flex size-full flex-col overflow-hidden bg-popover text-popover-foreground rounded-xl! p-1', className)}\n {...props}\n >\n {items ? (\n <>\n {/* Opened by an explicit gesture (⌘K) whose purpose is to type; off by default. */}\n {/* eslint-disable-next-line jsx-a11y/no-autofocus */}\n <CommandInput placeholder={placeholder} autoFocus={autoFocus} />\n <CommandList>\n <CommandEmpty>{empty}</CommandEmpty>\n {groups.map(({ group, items: groupItems }, index) => (\n <CommandShorthandGroup\n key={group ?? `__ungrouped-${index}`}\n heading={group}\n separator={index > 0}\n items={groupItems}\n onAfterSelect={onAfterSelect}\n />\n ))}\n </CommandList>\n </>\n ) : (\n children\n )}\n {/* Typing filters the list silently otherwise: a screen reader hears the count. */}\n <span aria-live=\"polite\" className=\"sr-only\">\n {`${ids.length} ${ids.length === 1 ? 'result' : 'results'}`}\n </span>\n </div>\n </CommandContext.Provider>\n );\n});\n\nfunction CommandShorthandGroup({\n heading,\n separator,\n items,\n onAfterSelect,\n}: {\n heading?: string;\n separator: boolean;\n items: CommandItemDef[];\n onAfterSelect?: () => void;\n}) {\n return (\n <>\n {separator && <CommandSeparator />}\n <CommandGroup heading={heading}>\n {items.map((item) => (\n <CommandItem\n key={item.id}\n value={item.label}\n keywords={item.keywords}\n disabled={item.disabled}\n onSelect={() => {\n item.onSelect();\n onAfterSelect?.();\n }}\n >\n {item.icon}\n {item.description ? (\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"truncate\">{item.label}</span>\n <span className=\"truncate text-xs text-muted-foreground\">{item.description}</span>\n </span>\n ) : (\n <span>{item.label}</span>\n )}\n {item.shortcut && <CommandShortcut>{item.shortcut}</CommandShortcut>}\n </CommandItem>\n ))}\n </CommandGroup>\n </>\n );\n}\n\n// ── Parts ──────────────────────────────────────────────────────────────────────\n\nexport interface CommandDialogProps {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** The dialog's accessible name. Default `Command Palette`. */\n title?: string;\n /** Read to screen readers. Default `Search for a command to run...` */\n description?: string;\n /** The close button. Default `false`. */\n showCloseButton?: boolean;\n className?: string;\n children: ReactNode;\n}\n\n/**\n * A `Command` in a dialog a third of the way down the screen: the ⌘K palette, built on the\n * `Dialog` parts. Its title and description are visually hidden.\n */\nexport function CommandDialog({\n title = 'Command Palette',\n description = 'Search for a command to run...',\n showCloseButton = false,\n className,\n children,\n ...props\n}: CommandDialogProps) {\n return (\n <Dialog {...props}>\n <DialogContent\n className={cn('top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0', className)}\n showCloseButton={showCloseButton}\n >\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\nexport interface CommandInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> {\n /** Controlled search. */\n value?: string;\n onValueChange?: (search: string) => void;\n}\n\nexport const CommandInput = forwardRef<HTMLInputElement, CommandInputProps>(function CommandInput(\n { className, value, onValueChange, ...props },\n ref,\n) {\n const ctx = useCommand('CommandInput');\n const search = value ?? ctx.search;\n return (\n <div data-slot=\"command-input-wrapper\" className=\"p-1 pb-0\">\n <InputGroup className=\"bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!\">\n <input\n ref={ref}\n cmdk-input=\"\"\n data-slot=\"command-input\"\n role=\"combobox\"\n type=\"text\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n spellCheck={false}\n aria-autocomplete=\"list\"\n aria-expanded\n aria-controls={ctx.listId}\n aria-activedescendant={ctx.activeId}\n aria-label={ctx.label}\n value={search}\n onChange={(event) => {\n ctx.setSearch(event.target.value);\n onValueChange?.(event.target.value);\n }}\n onKeyDown={(event) => {\n props.onKeyDown?.(event);\n if (!event.defaultPrevented) ctx.onKeyNav(event);\n }}\n className={cn(\n 'w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50 bg-transparent placeholder:text-muted-foreground',\n className,\n )}\n {...props}\n />\n <InputGroupAddon>\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n </InputGroupAddon>\n </InputGroup>\n </div>\n );\n});\n\nexport const CommandList = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CommandList(\n { className, ...props },\n ref,\n) {\n const ctx = useCommand('CommandList');\n return (\n <div\n ref={ref}\n cmdk-list=\"\"\n data-slot=\"command-list\"\n id={ctx.listId}\n role=\"listbox\"\n aria-label={ctx.label}\n tabIndex={-1}\n className={cn('no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto', className)}\n {...props}\n />\n );\n});\n\nexport const CommandEmpty = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(function CommandEmpty(\n { className, ...props },\n ref,\n) {\n const ctx = useCommand('CommandEmpty');\n if (ctx.count > 0) return null;\n return (\n <div\n ref={ref}\n cmdk-empty=\"\"\n data-slot=\"command-empty\"\n role=\"presentation\"\n className={cn('py-6 text-center text-sm', className)}\n {...props}\n />\n );\n});\n\nexport interface CommandGroupProps extends HTMLAttributes<HTMLDivElement> {\n heading?: ReactNode;\n}\n\n/** Items under a heading. Hidden while none of its items match. */\nexport const CommandGroup = forwardRef<HTMLDivElement, CommandGroupProps>(function CommandGroup(\n { className, heading, children, ...props },\n ref,\n) {\n const headingId = useId();\n return (\n <div\n ref={ref}\n cmdk-group=\"\"\n data-slot=\"command-group\"\n role=\"presentation\"\n className={cn(\n 'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium not-has-[[cmdk-item]]:hidden',\n className,\n )}\n {...props}\n >\n {heading && (\n <div cmdk-group-heading=\"\" aria-hidden id={headingId}>\n {heading}\n </div>\n )}\n <div cmdk-group-items=\"\" role=\"group\" aria-labelledby={heading ? headingId : undefined}>\n {children}\n </div>\n </div>\n );\n});\n\nexport interface CommandSeparatorProps extends HTMLAttributes<HTMLDivElement> {\n /** Keep it while searching. Default `false`: separators hide when a search is typed. */\n alwaysRender?: boolean;\n}\n\nexport const CommandSeparator = forwardRef<HTMLDivElement, CommandSeparatorProps>(function CommandSeparator(\n { className, alwaysRender = false, ...props },\n ref,\n) {\n const ctx = useCommand('CommandSeparator');\n if (ctx.search && !alwaysRender) return null;\n return (\n <div\n ref={ref}\n cmdk-separator=\"\"\n data-slot=\"command-separator\"\n // Visual only: a listbox may hold only options and groups.\n aria-hidden\n className={cn('bg-border -mx-1 h-px', className)}\n {...props}\n />\n );\n});\n\nexport interface CommandItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n /** What the filter matches and the highlight tracks. Default: the item's text. */\n value?: string;\n /** Extra words the filter matches. */\n keywords?: string[];\n disabled?: boolean;\n /** Runs on click or Enter, with the item's value. */\n onSelect?: (value: string) => void;\n /** Keep it whatever the search. */\n forceMount?: boolean;\n}\n\nexport const CommandItem = forwardRef<HTMLDivElement, CommandItemProps>(function CommandItem(\n { className, children, value: valueProp, keywords, disabled = false, onSelect, forceMount = false, ...props },\n ref,\n) {\n const ctx = useCommand('CommandItem');\n const id = useId();\n const value = (valueProp ?? textOf(children)).trim();\n const visible = forceMount || ctx.matches(value, keywords);\n const { register } = ctx;\n\n useLayoutEffect(() => {\n if (!visible) return undefined;\n return register(id);\n }, [visible, register, id]);\n\n if (!visible) return null;\n const isSelected = ctx.selected === value;\n return (\n // Focus stays in the input; the list highlight is aria-activedescendant. Enter on the\n // input clicks the highlighted item, so the click handler is the keyboard path too.\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/interactive-supports-focus\n <div\n ref={ref}\n id={id}\n cmdk-item=\"\"\n data-slot=\"command-item\"\n role=\"option\"\n aria-selected={isSelected}\n aria-disabled={disabled || undefined}\n data-selected={isSelected}\n data-disabled={disabled}\n data-value={value}\n onPointerMove={() => {\n if (!disabled && !isSelected) ctx.setSelected(value);\n }}\n onClick={() => {\n if (!disabled) onSelect?.(value);\n }}\n className={cn(\n \"group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <CheckIcon className=\"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n </div>\n );\n});\n\nexport const CommandShortcut = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(function CommandShortcut(\n { className, ...props },\n ref,\n) {\n return (\n <span\n ref={ref}\n data-slot=\"command-shortcut\"\n className={cn('text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n});\n","import { useCallback, useRef, useState } from 'react';\n\nexport interface UseControllableStateOptions<T> {\n /** The controlled value. Passing anything other than `undefined` takes control. */\n value?: T;\n /** Initial value when uncontrolled. */\n defaultValue: T;\n /** Fired on every change, controlled or not. */\n onChange?: (value: T) => void;\n}\n\n/**\n * One state value that works controlled or uncontrolled, the way every Radix\n * control does.\n *\n * Before 0.4.0 nothing in this library supported an uncontrolled mode — `Checkbox`,\n * `Toggle`, `Tabs`, `SegmentedControl`, `ButtonGroup` and `MultiSelectCard` all *required*\n * a value plus a change handler, so the simplest possible use site still needed a\n * `useState` in the consumer. `DropdownMenu` had the opposite problem: its open state was\n * entirely internal, so a caller could neither open it programmatically nor observe it.\n *\n * Control is decided per render by whether `value` is `undefined`. A component that\n * starts controlled and later passes `undefined` will fall back to its internal value —\n * the same caveat React itself has with inputs, and for the same reason.\n */\nexport function useControllableState<T>({\n value,\n defaultValue,\n onChange,\n}: UseControllableStateOptions<T>): [T, (next: T | ((prev: T) => T)) => void] {\n const [internal, setInternal] = useState<T>(defaultValue);\n\n const isControlled = value !== undefined;\n const current = isControlled ? value : internal;\n\n // Kept in a ref so `setValue` stays referentially stable across renders. Without this\n // every consumer that puts it in a dependency array re-subscribes on each render.\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const currentRef = useRef(current);\n currentRef.current = current;\n\n const isControlledRef = useRef(isControlled);\n isControlledRef.current = isControlled;\n\n const setValue = useCallback((next: T | ((prev: T) => T)) => {\n const resolved =\n typeof next === 'function' ? (next as (prev: T) => T)(currentRef.current) : next;\n\n if (resolved === currentRef.current) return;\n\n // A controlled component must not move its own value — the parent owns it and will\n // pass the new one back down. Only the notification goes out.\n if (!isControlledRef.current) setInternal(resolved);\n onChangeRef.current?.(resolved);\n }, []);\n\n return [current, setValue];\n}\n","import { forwardRef, useEffect, useId, useRef, type InputHTMLAttributes, type ReactNode } from 'react';\nimport { CheckIcon, MinusIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { composeRefs } from '../../lib/slot';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { CHOICE_CARD } from './field';\n\n/**\n * Checkbox: a control that allows the user to toggle between checked and not checked.\n *\n * A real `<input type=\"checkbox\">` drawn as the 16px box, so forms, `required`, `name` / `value`\n * and `register()` work natively (and nothing in it needs browser APIs a test environment lacks).\n * `checked` / `defaultChecked` take `true`, `false` or `\"indeterminate\"`; `onCheckedChange`\n * gets the new boolean. Mark an error with `aria-invalid`. The input carries `data-slot=\"checkbox\"`\n * and `data-state` (`checked` / `unchecked` / `indeterminate`).\n *\n * Shorthand: `label` (and `description`) render the horizontal field around the box; `card` makes\n * that field a choice card (the whole card is the label). Without them, compose with `Field` /\n * `FieldLabel` and give the box an `id`, or an `aria-label`.\n */\n\nexport type CheckedState = boolean | 'indeterminate';\n\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'onChange' | 'checked' | 'defaultChecked' | 'size'> {\n /** Controlled. Omit and pass `defaultChecked` for uncontrolled. */\n checked?: CheckedState;\n defaultChecked?: CheckedState;\n /**\n * The new state after a click: always `true` or `false` (a click on an indeterminate box checks\n * it), so a `useState<boolean>` setter can be passed directly.\n */\n onCheckedChange?: (checked: boolean) => void;\n /** Shorthand: the label beside the box. */\n label?: ReactNode;\n /** Shorthand: a second line under the label. */\n description?: ReactNode;\n /** Shorthand: render the labelled field as a choice card. Needs `label`. */\n card?: boolean;\n}\n\nconst BOX =\n 'peer relative size-4 shrink-0 cursor-pointer appearance-none rounded-[4px] border border-input bg-transparent outline-none transition-colors after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-checked:border-primary data-checked:bg-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary aria-invalid:data-checked:border-primary group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input group-has-[:focus-visible]/field-label:data-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-checked:bg-primary';\n\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { checked: checkedProp, defaultChecked = false, onCheckedChange, label, description, card = false, id, className, disabled, ...props },\n ref,\n) {\n const [checked, setChecked] = useControllableState<CheckedState>({\n value: checkedProp,\n defaultValue: defaultChecked,\n // Only clicks change it, and a click always yields a boolean.\n onChange: onCheckedChange as ((next: CheckedState) => void) | undefined,\n });\n const inputRef = useRef<HTMLInputElement>(null);\n const generatedId = useId();\n const controlId = id ?? (label != null ? generatedId : undefined);\n const descriptionId = `${controlId ?? generatedId}-description`;\n const indeterminate = checked === 'indeterminate';\n const state = indeterminate ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n\n // `indeterminate` is a DOM property with no attribute, so it is set imperatively; it gives the\n // input the \"mixed\" state assistive tech announces.\n useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const box = (\n <span className={cn('relative inline-flex size-4 shrink-0', label == null && className)}>\n <input\n ref={composeRefs<HTMLInputElement>(inputRef, ref)}\n id={controlId}\n type=\"checkbox\"\n data-slot=\"checkbox\"\n data-state={state}\n checked={checked === true}\n disabled={disabled}\n aria-describedby={description != null && !card ? descriptionId : undefined}\n onChange={(event) => setChecked(event.target.checked)}\n className={BOX}\n {...props}\n />\n <span\n aria-hidden\n data-slot=\"checkbox-indicator\"\n className=\"pointer-events-none absolute inset-0 grid place-content-center text-primary-foreground transition-none [&>svg]:size-3.5\"\n >\n {indeterminate ? <MinusIcon /> : checked ? <CheckIcon /> : null}\n </span>\n </span>\n );\n\n if (label == null) return box;\n\n // In a card the title is a div (FieldTitle): the card is the label, and labels do not nest.\n const labelElement = card ? (\n <div\n data-slot=\"field-label\"\n className=\"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\"\n >\n {label}\n </div>\n ) : (\n <label\n htmlFor={controlId}\n data-slot=\"field-label\"\n className=\"group/field-label peer/field-label flex w-fit items-center gap-2 text-sm leading-snug font-medium select-none group-data-[disabled=true]/field:opacity-50\"\n >\n {label}\n </label>\n );\n\n const field = (\n <div\n // Not a group inside a card: a group between a label and its input hides the label text\n // from accessible-name checks, and the card already is the label.\n role={card ? undefined : 'group'}\n data-slot=\"field\"\n data-orientation=\"horizontal\"\n data-disabled={disabled || undefined}\n className={cn(\n 'group/field flex w-full flex-row items-center gap-2 has-[>[data-slot=field-content]]:items-start data-[invalid=true]:text-destructive has-[>[data-slot=field-content]]:[&>span:first-child]:mt-px *:data-[slot=field-label]:flex-auto',\n !card && className,\n )}\n >\n {box}\n {description != null ? (\n <div data-slot=\"field-content\" className=\"group/field-content flex flex-1 flex-col gap-0.5 leading-snug\">\n {labelElement}\n <p\n id={descriptionId}\n data-slot=\"field-description\"\n className=\"text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance\"\n >\n {description}\n </p>\n </div>\n ) : (\n labelElement\n )}\n </div>\n );\n\n if (!card) return field;\n return (\n <label data-slot=\"field-label\" className={cn('group/field-label peer/field-label text-sm', CHOICE_CARD, className)}>\n {field}\n </label>\n );\n});\n","import clsx from 'clsx';\n\n/**\n * Styled native scrollbars, for the components that must own their own overflow and so\n * cannot delegate to `ScrollArea`.\n *\n * Two kinds qualify. A table wrapper, a tab strip or a stepper, where inserting another\n * element would break the layout or the `<table>` element relationship; and a floating panel\n * that is already its own scroll container. Both hold focusable children, so a keyboard user\n * can already reach and scroll them — which is the one thing `ScrollArea` adds beyond these\n * classes, and the one thing they do not need.\n *\n * Prefer `ScrollArea` for a scrolling *region* of content. Reach for this only when a wrapper\n * element is not an option, and say why at the call site.\n *\n * A plain string module rather than an export from `scroll-area.tsx`, so using the class list\n * does not pull the component into the bundle graph.\n */\nexport const SCROLLBAR_CLASSES = clsx('scrollbar-thin');\n","import {\n createContext,\n forwardRef,\n useContext,\n useMemo,\n useRef,\n type ComponentProps,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactNode,\n} from 'react';\nimport { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';\nimport { EllipsisIcon } from 'lucide-react';\n\nimport { cn } from '../../lib/cn';\nimport { composeEventHandlers } from '../../lib/compose-event-handlers';\nimport { useControllableState } from '../../lib/use-controllable-state';\nimport { Button } from '../forms/button';\nimport type { FloatingAlign, FloatingSide } from './floating';\nimport { createMenuParts, type MenuClasses, focusMenuEdge, stopToAncestors, type MenuItemDef } from './menu-core';\nimport { usePortalContainer } from './portal';\n\nconst DROPDOWN_MENU_CLASSES: MenuClasses = {\n item: \"group/dropdown-menu-item focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4\",\n checkboxItem:\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4\",\n radioItem:\n \"focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pe-8 ps-1.5 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4\",\n indicator: 'absolute end-2 flex items-center justify-center',\n label: 'text-muted-foreground px-1.5 py-1 text-xs font-medium data-inset:ps-7',\n separator: 'bg-border -mx-1 my-1 h-px',\n shortcut:\n 'text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ms-auto text-xs tracking-widest',\n subTrigger:\n \"focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:ps-7 [&_svg:not([class*='size-'])]:size-4\",\n subContent:\n 'z-popover origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-[96px] rounded-lg p-1 shadow-lg ring-1 duration-100',\n};\n\nconst CONTENT_CLASSES =\n 'z-popover max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto scrollbar-thin data-[state=closed]:overflow-hidden data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100';\n\n/**\n * Overflow / row-actions menu.\n *\n * 0.4.0 rebuilt it to the WAI-ARIA menu contract after a version that declared the roles\n * and implemented none of the keys. 0.7.0 moves that contract onto Radix DropdownMenu, which\n * also brings submenus (`DropdownMenuSub`), the one thing 0.4.0 deliberately left out because\n * a half-built safe-travel path is worse than none.\n *\n * Kept from ours, on top of Radix:\n * - **ArrowUp on the trigger opens on the last item**, as the APG describes.\n * - **Tab closes the menu** so focus moves on through the page; Radix keeps Tab inside.\n * - **It works inside a clickable table row.** Presses on the trigger and in the panel stop\n * short of the row, the behaviour 0.2.0's `RowMenu` existed for.\n *\n * Shorthand: `<DropdownMenu items={…} trigger={…} label=\"…\" />` renders the trigger and the\n * panel from data; without `trigger` it is the `⋯` icon button, named by `label`.\n */\n\nexport interface DropdownMenuProps {\n /** The parts: `DropdownMenuTrigger` and `DropdownMenuContent`. Omit when passing `items`. */\n children?: ReactNode;\n /**\n * The menu as data, rendered through the parts. New in 0.8.0. Use it or `children`, not both.\n * The same `MenuItemDef` shape as `ContextMenu` and `Menubar`.\n */\n items?: readonly MenuItemDef[];\n /** With `items`: the element that opens the menu (rendered `asChild`). Default the `⋯` icon button. */\n trigger?: ReactNode;\n /** With `items` and the default `⋯` trigger: its accessible name. Default \"Open menu\". */\n label?: string;\n /** With `items`: where the panel opens. Defaults as `DropdownMenuContent`. */\n side?: FloatingSide;\n align?: FloatingAlign;\n /** Controlled open state. Omit for uncontrolled. */\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Make the page behind inert while the menu is open. Default `true`. */\n modal?: boolean;\n}\n\ninterface DropdownMenuState {\n setOpen: (open: boolean) => void;\n /** Which end to land on when the menu opens; ArrowUp on the trigger means \"last item\". */\n pendingEdge: { current: 'start' | 'end' };\n}\n\nconst DropdownMenuStateContext = createContext<DropdownMenuState | null>(null);\n\nfunction useDropdownMenuState(part: string): DropdownMenuState {\n const value = useContext(DropdownMenuStateContext);\n if (!value) throw new Error(`<${part}> must be used inside <DropdownMenu>`);\n return value;\n}\n\nexport function DropdownMenu({\n children,\n items,\n trigger,\n label,\n side,\n align,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n modal = true,\n}: DropdownMenuProps) {\n const [open, setOpen] = useControllableState({\n value: openProp,\n defaultValue: defaultOpen,\n onChange: onOpenChange,\n });\n const pendingEdge = useRef<'start' | 'end'>('start');\n const state = useMemo(() => ({ setOpen, pendingEdge }), [setOpen]);\n\n return (\n <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" open={open} onOpenChange={setOpen} modal={modal}>\n <DropdownMenuStateContext.Provider value={state}>\n {items ? (\n <>\n <DropdownMenuTrigger asChild>\n {trigger ?? (\n <Button variant=\"outline\" size=\"icon-xs\" aria-label={label ?? 'Open menu'}>\n <EllipsisIcon aria-hidden />\n </Button>\n )}\n </DropdownMenuTrigger>\n {/* Sized to its labels, never narrower than the trigger: the default trigger is a\n 24px icon, and matching its width wrapped every label. */}\n <DropdownMenuContent\n side={side}\n align={align}\n className=\"w-max min-w-[max(8rem,var(--radix-dropdown-menu-trigger-width))]\"\n >\n <DropdownMenuItems items={items} />\n </DropdownMenuContent>\n </>\n ) : (\n children\n )}\n </DropdownMenuStateContext.Provider>\n </DropdownMenuPrimitive.Root>\n );\n}\n\n// ── Trigger ────────────────────────────────────────────────────────────────────\n\nexport interface DropdownMenuTriggerProps extends ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger> {}\n\nexport const DropdownMenuTrigger = forwardRef<HTMLButtonElement, DropdownMenuTriggerProps>(function DropdownMenuTrigger(\n { onClick, onPointerDown, onMouseDown, onKeyDown, ...rest },\n ref,\n) {\n const state = useDropdownMenuState('DropdownMenuTrigger');\n\n // Radix runs these first and then its own handler, so stopping propagation here keeps a\n // surrounding row from reacting without stopping the menu from opening.\n const handlers = {\n onClick: (event: ReactMouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n stopToAncestors(event);\n },\n onPointerDown: (event: ReactPointerEvent<HTMLButtonElement>) => {\n onPointerDown?.(event);\n event.stopPropagation();\n },\n onMouseDown: (event: ReactMouseEvent<HTMLButtonElement>) => {\n onMouseDown?.(event);\n stopToAncestors(event);\n },\n onKeyDown: (event: ReactKeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented) return;\n if (event.key === 'ArrowUp') {\n // Radix opens on ArrowDown only.\n event.preventDefault();\n state.pendingEdge.current = 'end';\n state.setOpen(true);\n }\n // Enter on the trigger must not also activate the row it sits in.\n if (event.key === 'Enter' || event.key === ' ') stopToAncestors(event);\n },\n };\n\n return <DropdownMenuPrimitive.Trigger ref={ref} data-slot=\"dropdown-menu-trigger\" {...rest} {...handlers} />;\n});\n\n/** Portals its children; `DropdownMenuContent` already renders one. */\nexport function DropdownMenuPortal({ container, ...props }: ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n const inherited = usePortalContainer();\n return (\n <DropdownMenuPrimitive.Portal\n data-slot=\"dropdown-menu-portal\"\n container={container ?? inherited ?? undefined}\n {...props}\n />\n );\n}\n\n// ── Content ────────────────────────────────────────────────────────────────────\n\nexport interface DropdownMenuContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n side?: FloatingSide;\n align?: FloatingAlign;\n sideOffset?: number;\n /** Where to portal the menu. Defaults to the enclosing dialog, else `document.body`. */\n container?: HTMLElement | null;\n /** Called when focus returns on close. Call `preventDefault()` to stop it moving to the trigger. */\n onCloseAutoFocus?: (event: Event) => void;\n}\n\nexport const DropdownMenuContent = forwardRef<HTMLDivElement, DropdownMenuContentProps>(function DropdownMenuContent(\n {\n children,\n side = 'bottom',\n align = 'start',\n sideOffset = 4,\n container,\n className,\n onClick,\n onKeyDown,\n onFocus,\n onCloseAutoFocus,\n ...rest\n },\n ref,\n) {\n const state = useDropdownMenuState('DropdownMenuContent');\n const inherited = usePortalContainer();\n\n return (\n <DropdownMenuPrimitive.Portal container={container ?? inherited ?? undefined}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n side={side}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={8}\n // Arrow keys wrap from the last item to the first and back, as they did in 0.6.\n loop\n className={cn(CONTENT_CLASSES, className)}\n onCloseAutoFocus={composeEventHandlers(onCloseAutoFocus, () => {\n state.pendingEdge.current = 'start';\n })}\n onFocus={composeEventHandlers(onFocus, (event) => {\n const edge = state.pendingEdge.current;\n state.pendingEdge.current = 'start';\n focusMenuEdge(event, edge);\n })}\n onClick={(event) => {\n onClick?.(event);\n stopToAncestors(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n stopToAncestors(event);\n // Tab leaves the menu rather than walking it: close, and Radix hands focus back\n // to the trigger, from where the browser carries on.\n if (event.key === 'Tab') state.setOpen(false);\n }}\n {...rest}\n >\n {children}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n});\n\n// ── Items ──────────────────────────────────────────────────────────────────────\n\nconst parts = createMenuParts(DropdownMenuPrimitive, 'dropdown-menu', DROPDOWN_MENU_CLASSES);\n\n/** Renders `MenuItemDef[]` inside your own `DropdownMenuContent`. New in 0.8.0. */\nexport const DropdownMenuItems = parts.Items;\nexport const DropdownMenuItem = parts.Item;\nexport const DropdownMenuCheckboxItem = parts.CheckboxItem;\nexport const DropdownMenuRadioGroup = parts.RadioGroup;\nexport const DropdownMenuRadioItem = parts.RadioItem;\nexport const DropdownMenuGroup = parts.Group;\nexport const DropdownMenuLabel = parts.Label;\nexport const DropdownMenuSeparator = parts.Separator;\nexport const DropdownMenuShortcut = parts.Shortcut;\nexport const DropdownMenuSub = parts.Sub;\nexport const DropdownMenuSubTrigger = parts.SubTrigger;\nexport const DropdownMenuSubContent = parts.SubContent;\n\nexport type {\n MenuItemDef,\n MenuItemProps as DropdownMenuItemProps,\n MenuItemVariant as DropdownMenuItemVariant,\n MenuCheckboxItemProps as DropdownMenuCheckboxItemProps,\n MenuRadioGroupProps as DropdownMenuRadioGroupProps,\n MenuRadioItemProps as DropdownMenuRadioItemProps,\n MenuGroupProps as DropdownMenuGroupProps,\n MenuLabelProps as DropdownMenuLabelProps,\n MenuSeparatorProps as DropdownMenuSeparatorProps,\n MenuShortcutProps as DropdownMenuShortcutProps,\n MenuSubProps as DropdownMenuSubProps,\n MenuSubTriggerProps as DropdownMenuSubTriggerProps,\n MenuSubContentProps as DropdownMenuSubContentProps,\n} from './menu-core';\n","/**\n * Runs a consumer's event handler, then the component's own, unless the consumer called\n * `preventDefault()`. The same contract Radix uses, so behaviour is uniform across the\n * library.\n *\n * Use it wherever a component has its own handler for an event that consumers may also pass.\n * The bug it exists for appeared in five 0.6 components: the built-in handler was written as\n * a JSX attribute and `{...rest}` was spread after it, so a consumer's `onClick` or `onKeyDown`\n * silently replaced the toggle, the arrow keys or the roving focus.\n */\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n theirs: ((event: E) => void) | undefined,\n ours: (event: E) => void,\n): (event: E) => void {\n return (event) => {\n theirs?.(event);\n if (!event.defaultPrevented) ours(event);\n };\n}\n","import {\n Fragment,\n forwardRef,\n useId,\n type ComponentType,\n type ForwardRefExoticComponent,\n type HTMLAttributes,\n type KeyboardEvent as ReactKeyboardEvent,\n type MouseEvent as ReactMouseEvent,\n type ReactNode,\n type RefAttributes,\n} from 'react';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { usePortalContainer } from './portal';\n\n/**\n * The shared item set behind `DropdownMenu`, `ContextMenu` and `Menubar`.\n *\n * All three are the same WAI-ARIA menu: identical items, keyboard contract and ARIA. Only how\n * they *open* differs: a trigger button, a right-click at the pointer, or a bar of triggers.\n * Radix supplies the contract (roving focus, typeahead, Home/End, submenus with a safe pointer\n * path, Escape through the shared layer stack); this module supplies the look and our props.\n *\n * Radix scopes each item to its own root (`DropdownMenu.Item` will not work inside a\n * `ContextMenu`), so `createMenuParts` builds one set per primitive, each with its own\n * `data-slot` names and its own classes (`MenuClasses`, written out in full in each menu file\n * so Tailwind sees them).\n */\n\n/** The classes of one menu's parts. */\nexport interface MenuClasses {\n item: string;\n checkboxItem: string;\n radioItem: string;\n /** The checkbox / radio indicator's wrapper. */\n indicator: string;\n label: string;\n separator: string;\n shortcut: string;\n subTrigger: string;\n subContent: string;\n}\n\n/** Item parts share this base; the per-menu classes add the look. */\nconst ITEM_RESET =\n 'relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0';\n\nexport type MenuItemVariant = 'default' | 'destructive';\n\n/** Keeps a press inside a portalled menu from reaching a clickable ancestor, e.g. a table row. */\nexport function stopToAncestors(event: ReactMouseEvent | ReactKeyboardEvent) {\n event.stopPropagation();\n}\n\n/**\n * Lands on an item when a menu opens, whatever opened it.\n *\n * Radix focuses the panel on open and moves on to the first item only after a keyboard\n * open. The APG menu button puts focus on an item either way, and on the *last* one after\n * ArrowUp. Wire it to the content's `onFocus`. It is deferred a microtask so it runs after\n * Radix's own entry focus rather than being undone by it.\n */\nexport function focusMenuEdge(\n event: { target: EventTarget; currentTarget: HTMLElement },\n edge: 'start' | 'end',\n) {\n if (event.target !== event.currentTarget) return;\n const panel = event.currentTarget;\n queueMicrotask(() => {\n const items = panel.querySelectorAll<HTMLElement>('[role^=\"menuitem\"]:not([data-disabled])');\n if (edge === 'end') items[items.length - 1]?.focus();\n else if (document.activeElement === panel) items[0]?.focus();\n });\n}\n\n// ── Prop types (one set, shared by all three menus) ───────────────────────────\n\nexport interface MenuItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n children: ReactNode;\n /** Called on activation. Call `event.preventDefault()` to keep the menu open. */\n onSelect?: (event: Event) => void;\n /** `destructive` for a delete or other irreversible action. Default `default`. */\n variant?: MenuItemVariant;\n /** Indents the item to line up with items that have an icon or indicator. */\n inset?: boolean;\n disabled?: boolean;\n /** Render your own element (e.g. a router link) as the item. */\n asChild?: boolean;\n /** Shorthand: a leading glyph. */\n icon?: ReactNode;\n /** Shorthand: a second line under the label. */\n description?: ReactNode;\n /** Shorthand: a trailing keyboard hint (rendered as the menu's Shortcut). */\n shortcut?: ReactNode;\n /** Typeahead match text, when `children` is not a plain string. */\n textValue?: string;\n}\n\nexport interface MenuCheckboxItemProps\n extends Omit<MenuItemProps, 'icon' | 'description' | 'variant' | 'asChild'> {\n checked?: boolean | 'indeterminate';\n onCheckedChange?: (checked: boolean) => void;\n}\n\nexport interface MenuRadioGroupProps {\n children: ReactNode;\n value?: string;\n onValueChange?: (value: string) => void;\n}\n\nexport interface MenuRadioItemProps\n extends Omit<MenuItemProps, 'icon' | 'description' | 'variant' | 'asChild'> {\n value: string;\n}\n\nexport interface MenuGroupProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n /** Shorthand: names the group with a label above it. */\n label?: string;\n}\n\nexport interface MenuLabelProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n inset?: boolean;\n}\n\nexport interface MenuSeparatorProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport interface MenuShortcutProps extends HTMLAttributes<HTMLSpanElement> {\n children: ReactNode;\n}\n\nexport interface MenuSubProps {\n children: ReactNode;\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport interface MenuSubTriggerProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n inset?: boolean;\n /** Shorthand: a leading glyph. */\n icon?: ReactNode;\n disabled?: boolean;\n textValue?: string;\n}\n\nexport interface MenuSubContentProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n}\n\n// ── Items as data (0.8.0) ──────────────────────────────────────────────────────\n\ninterface MenuItemDefBase {\n /** Stable key. */\n id: string;\n /** Leave the entry out, e.g. `hidden: !can('delete')`. Separators left dangling are dropped. */\n hidden?: boolean;\n}\n\n/**\n * One menu entry as data: the same shape for `DropdownMenu`, `ContextMenu` and `Menubar`.\n * Each `type` renders through the matching part, so the keyboard contract and styling are the\n * parts' own. Omit `type` for a plain action.\n */\nexport type MenuItemDef =\n | (MenuItemDefBase & {\n type?: 'item';\n label: ReactNode;\n onSelect?: (event: Event) => void;\n variant?: MenuItemVariant;\n inset?: boolean;\n disabled?: boolean;\n icon?: ReactNode;\n description?: ReactNode;\n shortcut?: ReactNode;\n textValue?: string;\n })\n | (MenuItemDefBase & {\n type: 'checkbox';\n label: ReactNode;\n checked: boolean;\n onCheckedChange?: (checked: boolean) => void;\n disabled?: boolean;\n shortcut?: ReactNode;\n textValue?: string;\n })\n | (MenuItemDefBase & {\n type: 'radio';\n value?: string;\n onValueChange?: (value: string) => void;\n options: { value: string; label: ReactNode; disabled?: boolean }[];\n })\n | (MenuItemDefBase & { type: 'group'; label?: string; items: MenuItemDef[] })\n | (MenuItemDefBase & {\n type: 'submenu';\n label: ReactNode;\n icon?: ReactNode;\n disabled?: boolean;\n items: MenuItemDef[];\n })\n | (MenuItemDefBase & { type: 'label'; label: ReactNode })\n | (MenuItemDefBase & { type: 'separator' })\n /** Escape hatch: render a part yourself, e.g. an item with `asChild` around a router link. */\n | (MenuItemDefBase & { type: 'custom'; render: () => ReactNode });\n\n/**\n * Drops hidden entries, groups and submenus left empty, and separators that no longer sit\n * between two entries, so a permission-filtered menu never starts, ends or doubles up on a line.\n */\nexport function visibleMenuItems(items: readonly MenuItemDef[]): MenuItemDef[] {\n const kept = items.filter((item) => {\n if (item.hidden) return false;\n if (item.type === 'group' || item.type === 'submenu') return visibleMenuItems(item.items).length > 0;\n return true;\n });\n return kept.filter((item, i) => {\n if (item.type !== 'separator') return true;\n const prev = kept[i - 1];\n return i > 0 && i < kept.length - 1 && prev.type !== 'separator';\n });\n}\n\n// ── The primitive shape all three Radix menus share ────────────────────────────\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Part = ForwardRefExoticComponent<any & RefAttributes<HTMLDivElement>>;\n\nexport interface RadixMenuPrimitive {\n Item: Part;\n CheckboxItem: Part;\n RadioGroup: Part;\n RadioItem: Part;\n ItemIndicator: Part;\n Group: Part;\n Label: Part;\n Separator: Part;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Sub: ComponentType<any>;\n SubTrigger: Part;\n SubContent: Part;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Portal: ComponentType<any>;\n}\n\n/**\n * Builds one menu's parts. `slot` names them (`context-menu-item`…); `classes` gives them the\n * menu's look.\n */\nexport function createMenuParts(P: RadixMenuPrimitive, slot: string, classes: MenuClasses) {\n const Shortcut = forwardRef<HTMLSpanElement, MenuShortcutProps>(function MenuShortcut(\n { className, ...rest },\n ref,\n ) {\n return <span ref={ref} data-slot={`${slot}-shortcut`} className={cn(classes.shortcut, className)} {...rest} />;\n });\n\n const Item = forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n { children, variant = 'default', inset, icon, description, shortcut, className, ...rest },\n ref,\n ) {\n const descriptionId = useId();\n const shorthand = icon !== undefined || description !== undefined || shortcut !== undefined;\n return (\n <P.Item\n ref={ref}\n data-slot={`${slot}-item`}\n data-inset={inset}\n data-variant={variant}\n aria-describedby={description ? descriptionId : undefined}\n className={cn(ITEM_RESET, classes.item, className)}\n {...rest}\n >\n {shorthand ? (\n <>\n {icon}\n {description ? (\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"truncate\">{children}</span>\n <span id={descriptionId} className=\"text-xs text-muted-foreground\">\n {description}\n </span>\n </span>\n ) : (\n children\n )}\n {shortcut && <Shortcut>{shortcut}</Shortcut>}\n </>\n ) : (\n children\n )}\n </P.Item>\n );\n });\n\n const CheckboxItem = forwardRef<HTMLDivElement, MenuCheckboxItemProps>(function MenuCheckboxItem(\n { children, checked, onCheckedChange, inset, shortcut, className, ...rest },\n ref,\n ) {\n return (\n <P.CheckboxItem\n ref={ref}\n data-slot={`${slot}-checkbox-item`}\n data-inset={inset}\n checked={checked}\n onCheckedChange={onCheckedChange ? (next: boolean | 'indeterminate') => onCheckedChange(next === true) : undefined}\n className={cn(ITEM_RESET, classes.checkboxItem, className)}\n {...rest}\n >\n <span className={cn('pointer-events-none', classes.indicator)}>\n <P.ItemIndicator>\n <CheckIcon />\n </P.ItemIndicator>\n </span>\n {children}\n {shortcut && <Shortcut>{shortcut}</Shortcut>}\n </P.CheckboxItem>\n );\n });\n\n function RadioGroup({ children, value, onValueChange }: MenuRadioGroupProps) {\n return (\n <P.RadioGroup data-slot={`${slot}-radio-group`} value={value} onValueChange={onValueChange}>\n {children}\n </P.RadioGroup>\n );\n }\n\n const RadioItem = forwardRef<HTMLDivElement, MenuRadioItemProps>(function MenuRadioItem(\n { children, inset, shortcut, className, ...rest },\n ref,\n ) {\n return (\n <P.RadioItem\n ref={ref}\n data-slot={`${slot}-radio-item`}\n data-inset={inset}\n className={cn(ITEM_RESET, classes.radioItem, className)}\n {...rest}\n >\n <span className={cn('pointer-events-none', classes.indicator)}>\n <P.ItemIndicator>\n <CheckIcon />\n </P.ItemIndicator>\n </span>\n {children}\n {shortcut && <Shortcut>{shortcut}</Shortcut>}\n </P.RadioItem>\n );\n });\n\n /** A non-interactive heading inside the menu. */\n const Label = forwardRef<HTMLDivElement, MenuLabelProps>(function MenuLabel(\n { className, inset, ...rest },\n ref,\n ) {\n return (\n <P.Label\n ref={ref}\n data-slot={`${slot}-label`}\n data-inset={inset}\n className={cn(classes.label, className)}\n {...rest}\n />\n );\n });\n\n const Group = forwardRef<HTMLDivElement, MenuGroupProps>(function MenuGroup(\n { children, label, className, ...rest },\n ref,\n ) {\n const labelId = useId();\n return (\n <P.Group\n ref={ref}\n data-slot={`${slot}-group`}\n aria-labelledby={label ? labelId : undefined}\n className={className}\n {...rest}\n >\n {label && <Label id={labelId}>{label}</Label>}\n {children}\n </P.Group>\n );\n });\n\n const Separator = forwardRef<HTMLDivElement, MenuSeparatorProps>(function MenuSeparator(\n { className, ...rest },\n ref,\n ) {\n return <P.Separator ref={ref} data-slot={`${slot}-separator`} className={cn(classes.separator, className)} {...rest} />;\n });\n\n /** A nested menu: Radix supplies the hover intent and safe pointer path. */\n function Sub({ children, open, defaultOpen, onOpenChange }: MenuSubProps) {\n return (\n <P.Sub data-slot={`${slot}-sub`} open={open} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {children}\n </P.Sub>\n );\n }\n\n /** The item that opens a `*Sub`. ArrowRight opens it, ArrowLeft closes it. */\n const SubTrigger = forwardRef<HTMLDivElement, MenuSubTriggerProps>(function MenuSubTrigger(\n { children, inset, icon, className, ...rest },\n ref,\n ) {\n return (\n <P.SubTrigger\n ref={ref}\n data-slot={`${slot}-sub-trigger`}\n data-inset={inset}\n className={cn(\n 'flex cursor-default items-center outline-hidden select-none [&_svg]:pointer-events-none [&_svg]:shrink-0',\n classes.subTrigger,\n className,\n )}\n {...rest}\n >\n {icon}\n {children}\n <ChevronRightIcon className=\"ms-auto rtl:rotate-180\" />\n </P.SubTrigger>\n );\n });\n\n const SubContent = forwardRef<HTMLDivElement, MenuSubContentProps>(function MenuSubContent(\n { className, onClick, onKeyDown, ...rest },\n ref,\n ) {\n const container = usePortalContainer();\n return (\n <P.Portal container={container ?? undefined}>\n <P.SubContent\n ref={ref}\n data-slot={`${slot}-sub-content`}\n className={cn(classes.subContent, className)}\n onClick={(event: ReactMouseEvent<HTMLDivElement>) => {\n onClick?.(event);\n stopToAncestors(event);\n }}\n onKeyDown={(event: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(event);\n stopToAncestors(event);\n }}\n {...rest}\n />\n </P.Portal>\n );\n });\n\n /**\n * Renders `MenuItemDef[]` through the parts above. The menus' `items` prop uses it, and it is\n * exported per menu (`DropdownMenuItems`…) for a custom trigger or content.\n */\n function Items({ items }: { items: readonly MenuItemDef[] }) {\n return <>{visibleMenuItems(items).map(renderItem)}</>;\n }\n\n function renderItem(item: MenuItemDef): ReactNode {\n switch (item.type) {\n case 'checkbox':\n return (\n <CheckboxItem\n key={item.id}\n checked={item.checked}\n onCheckedChange={item.onCheckedChange}\n disabled={item.disabled}\n shortcut={item.shortcut}\n textValue={item.textValue}\n >\n {item.label}\n </CheckboxItem>\n );\n case 'radio':\n return (\n <RadioGroup key={item.id} value={item.value} onValueChange={item.onValueChange}>\n {item.options.map((option) => (\n <RadioItem key={option.value} value={option.value} disabled={option.disabled}>\n {option.label}\n </RadioItem>\n ))}\n </RadioGroup>\n );\n case 'group':\n return (\n <Group key={item.id} label={item.label}>\n <Items items={item.items} />\n </Group>\n );\n case 'submenu':\n return (\n <Sub key={item.id}>\n <SubTrigger icon={item.icon} disabled={item.disabled}>\n {item.label}\n </SubTrigger>\n <SubContent>\n <Items items={item.items} />\n </SubContent>\n </Sub>\n );\n case 'label':\n return <Label key={item.id}>{item.label}</Label>;\n case 'separator':\n return <Separator key={item.id} />;\n case 'custom':\n return <Fragment key={item.id}>{item.render()}</Fragment>;\n default:\n return (\n <Item\n key={item.id}\n onSelect={item.onSelect}\n variant={item.variant}\n inset={item.inset}\n disabled={item.disabled}\n icon={item.icon}\n description={item.description}\n shortcut={item.shortcut}\n textValue={item.textValue}\n >\n {item.label}\n </Item>\n );\n }\n }\n\n return {\n Items,\n Item,\n CheckboxItem,\n RadioGroup,\n RadioItem,\n Group,\n Label,\n Separator,\n Shortcut,\n Sub,\n SubTrigger,\n SubContent,\n };\n}\n","/**\n * The keyboard focus ring, as one string, so every control draws the same one.\n *\n * Before 0.7.0 this exact class list was written out by hand in 18 places, with six\n * near-misses beside it (a missing offset colour, `ring-offset-2`). Use it in new and migrated\n * components rather than re-typing it.\n *\n * `FOCUS_RING` sits outside the element and needs room around it. Inside a scrolling or\n * `overflow-hidden` panel, such as a menu, a listbox or a table cell, the offset ring is clipped,\n * so items there use `FOCUS_RING_INSET`, which draws inside the element's own box.\n *\n * Highlight is not focus: menu and option items also tint their background when highlighted\n * (by pointer or by keyboard), but the tint alone does not meet WCAG 2.4.7 next to a hovered\n * sibling with the same tint. The ring is what marks the keyboard position.\n */\nexport const FOCUS_RING =\n 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50';\n\nexport const FOCUS_RING_INSET =\n 'focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/50';\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } from 'react';\nimport { Tabs as TabsPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\n\n/**\n * Tabs: a set of layered sections of content, known as tab panels, that are displayed one at a\n * time.\n *\n * Built on Radix Tabs: arrow keys move between triggers, Home/End jump to the ends, and each\n * trigger controls its panel. `TabsList` takes `variant` `default` (a muted track with a raised\n * active tab) or `line` (an underline under the active tab). `orientation=\"vertical\"` stacks the\n * list beside the panels.\n *\n * Two ways to write one:\n * - Shorthand: `<Tabs items={[{ value, label, icon?, disabled?, content? }]} variant=\"line\" />`\n * renders the list, the triggers and a panel for each item that has `content`.\n * - Composition: `Tabs` > `TabsList` > `TabsTrigger`s, and `TabsContent`s.\n */\n\nexport type TabsVariant = 'default' | 'line';\n\nexport interface TabItem {\n value: string;\n label: ReactNode;\n icon?: ReactNode;\n disabled?: boolean;\n /** The panel. Items without one render a trigger only. */\n content?: ReactNode;\n}\n\nexport interface TabsProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {\n /** Shorthand: the tabs as data; renders the list, triggers and panels. */\n items?: readonly TabItem[];\n /** Shorthand: the list's variant. */\n variant?: TabsVariant;\n /** Shorthand: names the tab list. */\n 'aria-label'?: string;\n}\n\nexport const Tabs = forwardRef<ElementRef<typeof TabsPrimitive.Root>, TabsProps>(function Tabs(\n { className, orientation = 'horizontal', items, variant, 'aria-label': ariaLabel, children, ...props },\n ref,\n) {\n return (\n <TabsPrimitive.Root\n ref={ref}\n data-slot=\"tabs\"\n data-orientation={orientation}\n orientation={orientation}\n className={cn('group/tabs flex gap-2 data-horizontal:flex-col', className)}\n aria-label={items ? undefined : ariaLabel}\n {...props}\n >\n {items ? (\n <>\n <TabsList variant={variant} aria-label={ariaLabel}>\n {items.map((item) => (\n <TabsTrigger key={item.value} value={item.value} disabled={item.disabled}>\n {item.icon}\n {item.label}\n </TabsTrigger>\n ))}\n </TabsList>\n {items\n .filter((item) => item.content !== undefined)\n .map((item) => (\n <TabsContent key={item.value} value={item.value}>\n {item.content}\n </TabsContent>\n ))}\n </>\n ) : (\n children\n )}\n </TabsPrimitive.Root>\n );\n});\n\nconst LIST_VARIANT: Record<TabsVariant, string> = {\n default: 'bg-muted',\n line: 'gap-1 bg-transparent',\n};\n\nexport interface TabsListProps extends ComponentPropsWithoutRef<typeof TabsPrimitive.List> {\n variant?: TabsVariant;\n}\n\nexport const TabsList = forwardRef<ElementRef<typeof TabsPrimitive.List>, TabsListProps>(function TabsList(\n { className, variant = 'default', ...props },\n ref,\n) {\n return (\n <TabsPrimitive.List\n ref={ref}\n data-slot=\"tabs-list\"\n data-variant={variant}\n className={cn(\n 'group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none',\n LIST_VARIANT[variant],\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;\n\nexport const TabsTrigger = forwardRef<ElementRef<typeof TabsPrimitive.Trigger>, TabsTriggerProps>(\n function TabsTrigger({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n data-slot=\"tabs-trigger\"\n className={cn(\n 'relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\"size-\"])]:size-4',\n 'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent group-data-[variant=line]/tabs-list:data-active:shadow-none dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent',\n 'data-active:bg-background data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground',\n 'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100',\n className,\n )}\n {...props}\n />\n );\n },\n);\n\nexport type TabsContentProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Content>;\n\nexport const TabsContent = forwardRef<ElementRef<typeof TabsPrimitive.Content>, TabsContentProps>(\n function TabsContent({ className, ...props }, ref) {\n return (\n <TabsPrimitive.Content\n ref={ref}\n data-slot=\"tabs-content\"\n className={cn('flex-1 text-sm outline-none', className)}\n {...props}\n />\n );\n },\n);\n","import { forwardRef, type HTMLAttributes } from 'react';\n\nimport { cn } from '../../lib/cn';\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n /** Shorthand: a stacked paragraph of this many `h-4` lines, the last one shorter. */\n lines?: number;\n}\n\nconst BASE = 'rounded-md bg-muted motion-safe:animate-pulse';\n\n/**\n * Skeleton: use to show a placeholder while content is loading. Size it with `className`\n * (`h-4 w-[250px]`, `size-12 rounded-full`).\n *\n * `aria-hidden`: a skeleton is a picture of content that does not exist yet, so announcing it\n * produces a burst of meaningless nodes. The region it sits in should carry the loading state\n * (`aria-busy`, or a `Spinner`). The pulse stops under `prefers-reduced-motion`.\n */\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { lines, className, ...props },\n ref,\n) {\n if (lines && lines > 1) {\n return (\n <div ref={ref} aria-hidden data-slot=\"skeleton-group\" className={cn('flex flex-col gap-2', className)} {...props}>\n {Array.from({ length: lines }, (_, index) => (\n // A ragged last line reads as a paragraph rather than a solid slab.\n <div key={index} data-slot=\"skeleton\" className={cn(BASE, 'h-4', index === lines - 1 ? 'w-3/5' : 'w-full')} />\n ))}\n </div>\n );\n }\n return <div ref={ref} aria-hidden data-slot=\"skeleton\" className={cn(BASE, className)} {...props} />;\n});\n","import { createContext, useContext, useMemo, type ReactNode } from 'react';\n\nimport type { BadgeColor } from '../components/status/badge';\nimport { devWarn } from './dev-warn';\n\n/**\n * Value types: what a value *is*, said as data, so a table column, a details row, a kanban card\n * and a form field show it the same way without the caller choosing a component or a class.\n *\n * `formatValue` turns a value into plain text (for search, sorting, export and accessible\n * names); `Value` (components/lists/value.tsx) renders it. Locale, currency and time zone come\n * from the nearest `FormatProvider`, else the browser, and any descriptor can override them.\n */\n\n// ── Formatting context ─────────────────────────────────────────────────────────\n\nexport interface FormatOptions {\n /** BCP 47 locale, e.g. `en-GB`. Default: the browser's. */\n locale?: string;\n /** ISO 4217 code for `currency` values without their own, e.g. `EUR`. */\n currency?: string;\n /** IANA time zone for dates, e.g. `Europe/Oslo`. Default: the browser's. */\n timeZone?: string;\n /** Date style for `date` and `datetime` values. Default `medium`. */\n dateStyle?: 'short' | 'medium' | 'long';\n /** \"Now\" for `relative` values. Default: the current time. Pin it for tests and server rendering. */\n now?: Date | number;\n /** Accessible text for an empty value (shown as —). Default `Empty`. */\n emptyLabel?: string;\n}\n\nconst FormatContext = createContext<FormatOptions>({});\n\nexport interface FormatProviderProps extends FormatOptions {\n children?: ReactNode;\n}\n\n/**\n * Sets how values are formatted for everything inside it. Mount one at the app root; nest one to\n * change a part of the page. Unset options fall through to the provider above, then the browser.\n */\nexport function FormatProvider({ children, ...options }: FormatProviderProps) {\n const parent = useContext(FormatContext);\n const { locale, currency, timeZone, dateStyle, now, emptyLabel } = options;\n const value = useMemo(\n () => ({\n ...parent,\n ...Object.fromEntries(\n Object.entries({ locale, currency, timeZone, dateStyle, now, emptyLabel }).filter(([, v]) => v !== undefined),\n ),\n }),\n [parent, locale, currency, timeZone, dateStyle, now, emptyLabel],\n );\n return <FormatContext.Provider value={value}>{children}</FormatContext.Provider>;\n}\n\n/** The formatting options in effect here. */\nexport function useFormat(): FormatOptions {\n return useContext(FormatContext);\n}\n\n// ── Descriptors ────────────────────────────────────────────────────────────────\n\ntype Primitive = string | number | boolean | bigint | Date | null | undefined;\ntype Depth = [never, 0, 1, 2];\n\n/**\n * A key of `T`, or a dot path into a nested object (`customer.name`), up to three levels. With an\n * untyped row (`Record<string, unknown>`) any string is accepted.\n */\nexport type FieldPath<T, D extends number = 3> = [D] extends [never]\n ? never\n : T extends Primitive | readonly unknown[]\n ? never\n : {\n [K in keyof T & string]: NonNullable<T[K]> extends Primitive | readonly unknown[]\n ? K\n : K | `${K}.${FieldPath<NonNullable<T[K]>, Depth[D]>}`;\n }[keyof T & string];\n\nexport type ValueType =\n | 'text'\n | 'number'\n | 'currency'\n | 'percent'\n | 'date'\n | 'datetime'\n | 'relative'\n | 'boolean'\n | 'status'\n | 'badge'\n | 'avatar'\n | 'email'\n | 'phone'\n | 'link';\n\n/** How to show a value, without saying where it comes from. Every option is plain JSON. */\nexport type ValueFormat<T = Record<string, unknown>> =\n | { type?: 'text' }\n | {\n type: 'number';\n /** Fixed decimals. Default: as needed, up to 3. */\n decimals?: number;\n /** Short form: 1.2K, 3.4M. */\n compact?: boolean;\n /** A unit Intl knows (`hour`, `kilogram`, `kilometer`…): 7.5 → \"7.5h\". */\n unit?: string;\n /** How the unit is written. Default `narrow` (\"7.5h\"); `short` is \"7.5 hr\", `long` \"7.5 hours\". */\n unitDisplay?: 'narrow' | 'short' | 'long';\n }\n | {\n type: 'currency';\n /** ISO 4217 code. Default: the provider's `currency`. */\n currency?: string;\n decimals?: number;\n compact?: boolean;\n }\n | {\n type: 'percent';\n decimals?: number;\n /** `fraction`: 0.42 is 42% (default). `whole`: 42 is 42%. */\n scale?: 'fraction' | 'whole';\n }\n | {\n type: 'date' | 'datetime';\n dateStyle?: 'short' | 'medium' | 'long';\n }\n | { type: 'relative' }\n | {\n type: 'boolean';\n /** Text for true / false. Default: a check or a dash, read as Yes / No. */\n trueLabel?: string;\n falseLabel?: string;\n }\n | {\n type: 'status';\n /** Value → badge colour. Values not listed are `gray`. */\n colors?: Record<string, BadgeColor>;\n /** Value → label. Identifier-like values not listed are humanised: `in_progress` → \"In progress\". */\n labels?: Record<string, string>;\n }\n | {\n type: 'badge';\n /** Value → label. Values not listed show as they are. */\n labels?: Record<string, string>;\n }\n | {\n type: 'avatar';\n /** Key of the image URL. Without one, or when it fails, the initials show. */\n image?: FieldPath<T>;\n /** Key of a second line, such as the email. */\n description?: FieldPath<T>;\n }\n | {\n type: 'email';\n /** A copy button after the address. Default `true`. */\n copy?: boolean;\n }\n | { type: 'phone' }\n | {\n type: 'link';\n /**\n * Key of the URL, or a template filled from the record (`/companies/{companyId}`); the value\n * is the link text. Default: the value is the URL.\n */\n href?: FieldPath<T> | HrefTemplate;\n };\n\n/** A URL with `{key}` placeholders filled from a record, e.g. `/customers/{id}/edit`. */\nexport type HrefTemplate = `${string}{${string}}${string}`;\n\n/** A value of a record: where it is (`key`), what it is called (`label`) and how to show it. */\nexport type ValueField<T = Record<string, unknown>> = ValueFormat<T> & {\n /** Key or dot path of the value in the record. */\n key: FieldPath<T>;\n /** Visible label. Default: the key, humanised. */\n label?: string;\n};\n\n// ── Reading values ─────────────────────────────────────────────────────────────\n\n/** The value at a key or dot path (`customer.name`) of a record. */\nexport function getValueAt(record: unknown, path: string): unknown {\n if (record == null) return undefined;\n if (typeof record === 'object' && path in (record as object)) return (record as Record<string, unknown>)[path];\n let current: unknown = record;\n for (const part of path.split('.')) {\n if (current == null || typeof current !== 'object') return undefined;\n current = (current as Record<string, unknown>)[part];\n }\n return current;\n}\n\n/**\n * Fills a template's `{key}` placeholders (keys or dot paths) from a record, URL-encoded:\n * `fillTemplate('/customers/{id}', { id: 'c 1' })` → `/customers/c%201`.\n */\nexport function fillTemplate(template: string, record: unknown): string {\n return template.replace(/\\{([^{}]+)\\}/g, (_, path: string) => {\n const value = getValueAt(record, path.trim());\n return value == null ? '' : encodeURIComponent(String(value));\n });\n}\n\n/** True for `null`, `undefined`, `''` and `[]`, which show as an empty value. */\nexport function isEmptyValue(value: unknown): boolean {\n return value == null || value === '' || (Array.isArray(value) && value.length === 0);\n}\n\n/** `in_progress`, `inProgress`, `in-progress` → \"In progress\". */\nexport function humanize(text: string): string {\n const words = text\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/[_-]+/g, ' ')\n .trim()\n .toLowerCase();\n return words.charAt(0).toUpperCase() + words.slice(1);\n}\n\n/** A date from a `Date`, an epoch in ms, or an ISO string; `null` when it is not one. */\nexport function toDate(value: unknown): Date | null {\n const date =\n value instanceof Date ? value : typeof value === 'number' || typeof value === 'string' ? new Date(value) : null;\n return date && !Number.isNaN(date.getTime()) ? date : null;\n}\n\nfunction toNumber(value: unknown): number | null {\n const n = typeof value === 'number' ? value : typeof value === 'string' && value.trim() !== '' ? Number(value) : NaN;\n return Number.isFinite(n) ? n : null;\n}\n\n/** Numeric types read right-aligned in a column, so digits line up. */\nexport function isNumericType(type: ValueType | undefined): boolean {\n return type === 'number' || type === 'currency' || type === 'percent';\n}\n\n// ── Formatting ─────────────────────────────────────────────────────────────────\n\nconst RELATIVE_UNITS: [Intl.RelativeTimeFormatUnit, number][] = [\n ['year', 365 * 24 * 3600],\n ['month', 30 * 24 * 3600],\n ['week', 7 * 24 * 3600],\n ['day', 24 * 3600],\n ['hour', 3600],\n ['minute', 60],\n ['second', 1],\n];\n\n/** \"3 days ago\", \"in 2 hours\", \"now\". */\nexport function formatRelative(date: Date, options: FormatOptions = {}): string {\n const now = options.now === undefined ? Date.now() : new Date(options.now).getTime();\n const seconds = Math.round((date.getTime() - now) / 1000);\n const format = new Intl.RelativeTimeFormat(options.locale, { numeric: 'auto' });\n for (const [unit, size] of RELATIVE_UNITS) {\n if (Math.abs(seconds) >= size || unit === 'second') return format.format(Math.round(seconds / size), unit);\n }\n return format.format(0, 'second');\n}\n\n/** A date as text in the provider's locale and time zone. */\nexport function formatDate(\n date: Date,\n withTime: boolean,\n options: FormatOptions & { dateStyle?: FormatOptions['dateStyle'] } = {},\n) {\n return new Intl.DateTimeFormat(options.locale, {\n dateStyle: options.dateStyle ?? 'medium',\n ...(withTime ? { timeStyle: 'short' as const } : {}),\n timeZone: options.timeZone,\n }).format(date);\n}\n\n/**\n * The label of a `status` value: from `labels`, else humanised when it reads as an identifier\n * (`in_progress`, `inProgress`, `active`), else as it is (`EU`, `On hold`).\n */\nexport function valueLabel(value: unknown, labels?: Record<string, string>): string {\n const text = String(value);\n if (labels?.[text] !== undefined) return labels[text];\n return /[_-]|^[a-z]/.test(text) ? humanize(text) : text;\n}\n\n/**\n * A value as plain text, the way `Value` shows it: for search, sorting by text, export and\n * accessible names. Empty values return `''`.\n */\nexport function formatValue<T>(value: unknown, format: ValueFormat<T> = {}, options: FormatOptions = {}): string {\n if (isEmptyValue(value)) return '';\n switch (format.type) {\n case 'number':\n case 'currency': {\n const n = toNumber(value);\n if (n === null) return String(value);\n const currency = format.type === 'currency' ? (format.currency ?? options.currency) : undefined;\n if (format.type === 'currency' && !currency)\n devWarn('A currency value has no currency: set `currency` on the field or a FormatProvider.');\n const unit = format.type === 'number' ? format.unit : undefined;\n return new Intl.NumberFormat(options.locale, {\n style: currency ? 'currency' : unit ? 'unit' : 'decimal',\n currency,\n unit,\n unitDisplay: unit && format.type === 'number' ? (format.unitDisplay ?? 'narrow') : undefined,\n notation: format.compact ? 'compact' : undefined,\n minimumFractionDigits: format.decimals,\n maximumFractionDigits: format.decimals ?? (currency || format.compact ? undefined : 3),\n }).format(n);\n }\n case 'percent': {\n const n = toNumber(value);\n if (n === null) return String(value);\n return new Intl.NumberFormat(options.locale, {\n style: 'percent',\n minimumFractionDigits: format.decimals,\n maximumFractionDigits: format.decimals ?? 1,\n }).format(format.scale === 'whole' ? n / 100 : n);\n }\n case 'date':\n case 'datetime': {\n const date = toDate(value);\n return date\n ? formatDate(date, format.type === 'datetime', { ...options, dateStyle: format.dateStyle ?? options.dateStyle })\n : String(value);\n }\n case 'relative': {\n const date = toDate(value);\n return date ? formatRelative(date, options) : String(value);\n }\n case 'boolean':\n return value ? (format.trueLabel ?? 'Yes') : (format.falseLabel ?? 'No');\n case 'status':\n return valueLabel(value, format.labels);\n case 'badge':\n return (Array.isArray(value) ? value : [value]).map((v) => format.labels?.[String(v)] ?? String(v)).join(', ');\n default:\n return Array.isArray(value) ? value.join(', ') : String(value);\n }\n}\n","/**\n * A console warning in development builds only, once per message.\n *\n * Used where a component can render but not correctly, such as a table with no accessible\n * name. Read through `globalThis` so the library needs no Node typings and does not throw\n * where `process` does not exist. Every bundler the consumers use (Vite, Next, webpack)\n * replaces `process.env.NODE_ENV`, so production builds drop the check.\n */\nconst seen = new Set<string>();\n\nexport function devWarn(message: string): void {\n const env = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env?.NODE_ENV;\n if (env === 'production' || seen.has(message)) return;\n seen.add(message);\n console.warn(`[@platned/ui] ${message}`);\n}\n","import type { ReactNode } from 'react';\nimport { ArrowUpRightIcon, CheckIcon, MinusIcon } from 'lucide-react';\n\nimport { cn } from '../../lib/cn';\nimport {\n formatDate,\n formatRelative,\n fillTemplate,\n formatValue,\n getValueAt,\n isEmptyValue,\n isNumericType,\n toDate,\n useFormat,\n valueLabel,\n type FormatOptions,\n type ValueField,\n type ValueFormat,\n} from '../../lib/format';\nimport { Avatar } from '../avatar/avatar';\nimport { Badge } from '../status/badge';\nimport { CopyButton, EmailText } from './value-parts';\n\n/**\n * Value: one value of a record, shown by what it is. The descriptor is plain JSON\n * (`{ type: 'currency', currency: 'EUR' }`), and the type picks the component and style, so a\n * column, a details row and a card show the same value the same way.\n *\n * Two ways to write one:\n * - From a record: `<Value row={user} field={{ key: 'status', type: 'status', colors: { active: 'green' } }} />`.\n * - A loose value: `<Value value={1200} type=\"currency\" currency=\"EUR\" />`.\n *\n * Empty values (`null`, `undefined`, `''`, `[]`) show a muted dash, read as \"Empty\".\n */\n\ntype LooseProps<T> = ValueFormat<T> & {\n value: unknown;\n /** The record, for types that read other keys (`avatar` image and description, `link` href). */\n row?: T;\n field?: never;\n className?: string;\n};\n\ntype FieldProps<T> = {\n row: T;\n field: ValueField<T>;\n value?: never;\n className?: string;\n};\n\nexport type ValueProps<T = Record<string, unknown>> = LooseProps<T> | FieldProps<T>;\n\nexport function Value<T = Record<string, unknown>>(props: ValueProps<T>) {\n const options = useFormat();\n let value: unknown;\n let format: ValueFormat<T>;\n if (props.field) {\n const { key, label: _label, ...rest } = props.field;\n value = getValueAt(props.row, key);\n format = rest as ValueFormat<T>;\n } else {\n const { value: loose, row: _row, className: _className, ...rest } = props;\n value = loose;\n format = rest as ValueFormat<T>;\n }\n return (\n <span\n data-slot=\"value\"\n data-type={format.type ?? 'text'}\n className={cn('min-w-0', isNumericType(format.type) && 'tabular-nums', props.className)}\n >\n {renderValue(value, format, props.row, options)}\n </span>\n );\n}\n\nfunction Empty({ label }: { label?: string }) {\n return (\n <span className=\"text-muted-foreground\">\n <span aria-hidden=\"true\">—</span>\n <span className=\"sr-only\">{label ?? 'Empty'}</span>\n </span>\n );\n}\n\nfunction initials(name: string) {\n const parts = name.trim().split(/\\s+/).filter(Boolean);\n return ((parts[0]?.[0] ?? '') + (parts.length > 1 ? (parts[parts.length - 1][0] ?? '') : '')).toUpperCase();\n}\n\nfunction isExternal(href: string) {\n if (!/^https?:\\/\\//i.test(href)) return false;\n return typeof window === 'undefined' || new URL(href).origin !== window.location.origin;\n}\n\nconst LINK =\n 'rounded-sm text-foreground underline underline-offset-4 decoration-1 hover:text-primary outline-none focus-visible:ring-3 focus-visible:ring-ring/50';\n\n/** The element for a value, without the wrapper. Exported for blocks that lay values out themselves. */\nexport function renderValue<T>(\n value: unknown,\n format: ValueFormat<T>,\n row: T | undefined,\n options: FormatOptions,\n): ReactNode {\n if (isEmptyValue(value)) return <Empty label={options.emptyLabel} />;\n switch (format.type) {\n case 'date':\n case 'datetime':\n case 'relative': {\n const date = toDate(value);\n if (!date) return String(value);\n const full = formatDate(date, true, { ...options, dateStyle: 'long' });\n return (\n <time dateTime={date.toISOString()} title={full}>\n {format.type === 'relative' ? formatRelative(date, options) : formatValue(value, format, options)}\n </time>\n );\n }\n case 'boolean': {\n const label = value ? format.trueLabel : format.falseLabel;\n if (label) return label;\n return value ? (\n <>\n <CheckIcon aria-hidden=\"true\" className=\"inline size-4\" />\n <span className=\"sr-only\">Yes</span>\n </>\n ) : (\n <>\n <MinusIcon aria-hidden=\"true\" className=\"inline size-4 text-muted-foreground\" />\n <span className=\"sr-only\">No</span>\n </>\n );\n }\n case 'status':\n return (\n <Badge variant=\"outline\" color={format.colors?.[String(value)] ?? 'gray'} indicator>\n {valueLabel(value, format.labels)}\n </Badge>\n );\n case 'badge': {\n const items = Array.isArray(value) ? value : [value];\n return (\n <span className=\"inline-flex flex-wrap gap-1\">\n {items.map((item, index) => (\n <Badge key={`${String(item)}-${index}`} variant=\"outline\">\n {format.labels?.[String(item)] ?? String(item)}\n </Badge>\n ))}\n </span>\n );\n }\n case 'avatar': {\n const name = String(value);\n const image = format.image ? getValueAt(row, format.image) : undefined;\n const description = format.description ? getValueAt(row, format.description) : undefined;\n return (\n <span className=\"flex min-w-0 items-center gap-2\">\n <Avatar src={typeof image === 'string' && image ? image : undefined} alt=\"\" fallback={initials(name)} />\n <span className=\"flex min-w-0 flex-col\">\n {/* Explicit ellipsis classes, not `truncate`: DataTable's card layout un-truncates\n `.truncate` and would break an address mid-word. */}\n <span className=\"overflow-hidden font-medium text-ellipsis whitespace-nowrap text-foreground\">{name}</span>\n {!isEmptyValue(description) && (\n <span className=\"overflow-hidden text-xs text-ellipsis whitespace-nowrap text-muted-foreground\">\n {String(description)}\n </span>\n )}\n </span>\n </span>\n );\n }\n case 'email': {\n const email = String(value);\n return (\n <span className=\"flex min-w-0 items-center gap-1\">\n {/* aria-label: the two truncating spans would otherwise be read as \"ada @example.com\". */}\n <a href={`mailto:${email}`} aria-label={email} className={cn(LINK, 'min-w-0')}>\n <EmailText email={email} />\n </a>\n {format.copy !== false && <CopyButton value={email} label={`Copy ${email}`} />}\n </span>\n );\n }\n case 'phone': {\n const phone = String(value);\n return (\n <a href={`tel:${phone.replace(/[^\\d+]/g, '')}`} className={LINK}>\n {phone}\n </a>\n );\n }\n case 'link': {\n const text = String(value);\n const hrefValue = format.href\n ? format.href.includes('{')\n ? fillTemplate(format.href, row)\n : getValueAt(row, format.href)\n : value;\n const href = typeof hrefValue === 'string' ? hrefValue : text;\n const external = isExternal(href);\n return (\n <a\n href={href}\n className={cn(LINK, 'inline-flex max-w-full items-center gap-0.5')}\n {...(external ? { target: '_blank', rel: 'noreferrer' } : {})}\n >\n <span className=\"truncate\">{text}</span>\n {external && (\n <>\n <ArrowUpRightIcon aria-hidden=\"true\" className=\"size-3.5 shrink-0\" />\n <span className=\"sr-only\"> (opens in a new tab)</span>\n </>\n )}\n </a>\n );\n }\n default:\n return formatValue(value, format, options);\n }\n}\n","import { useEffect, useState } from 'react';\nimport { CheckIcon, CopyIcon } from 'lucide-react';\nimport { cn } from '../../lib/cn';\nimport { Button } from '../forms/button';\n\n/* Parts of the value types (`value.tsx`): not exported from the package. */\n\nexport interface CopyButtonProps {\n /** The text to copy. */\n value: string;\n /** The button's accessible name, e.g. \"Copy email\". */\n label: string;\n /** Announced after a copy. Default \"Copied\". */\n copiedLabel?: string;\n className?: string;\n}\n\n/**\n * An icon button that copies `value` to the clipboard, shows a tick for two seconds, and\n * announces the copy in a polite live region. Used by the `email` value type.\n */\nexport function CopyButton({ value, label, copiedLabel = 'Copied', className }: CopyButtonProps) {\n const [copied, setCopied] = useState(false);\n\n useEffect(() => {\n if (!copied) return;\n const timer = window.setTimeout(() => setCopied(false), 2000);\n return () => window.clearTimeout(timer);\n }, [copied]);\n\n return (\n // relative: keeps the sr-only status (absolutely positioned) inside a scrolling container.\n <span className=\"relative inline-flex\">\n <Button\n variant=\"ghost\"\n size=\"icon-xs\"\n aria-label={label}\n data-state={copied ? 'copied' : undefined}\n className={cn('-my-0.5 touch-hit', className)}\n onClick={() => {\n void navigator.clipboard?.writeText(value).then(\n () => setCopied(true),\n () => undefined,\n );\n }}\n >\n {copied ? <CheckIcon aria-hidden /> : <CopyIcon aria-hidden />}\n </Button>\n <span role=\"status\" className=\"sr-only\">\n {copied ? copiedLabel : ''}\n </span>\n </span>\n );\n}\n\n/**\n * A one-line email that truncates the local part and keeps the domain:\n * `alexandra.konstan…@example.com`. The full address stays in the DOM (screen readers and copy\n * get all of it) and in `title`. The `email` value type pairs it with a CopyButton, so touch users,\n * who cannot hover, can still get the address.\n *\n * An email never wraps. It ellipsises through explicit overflow classes rather than the\n * `truncate` utility, because containers that un-truncate for touch target `.truncate`.\n * `DataTable`'s card layout does that, and through 0.9.0 it broke an address mid-word\n * (\"alex.reviewer@example.tes / t\").\n */\nexport function EmailText({ email, className }: { email: string; className?: string }) {\n const at = email.lastIndexOf('@');\n const local = at > 0 ? email.slice(0, at) : email;\n const domain = at > 0 ? email.slice(at) : '';\n return (\n <span title={email} data-slot=\"email-text\" className={cn('flex min-w-0 max-w-full', className)}>\n <span className=\"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap\">{local}</span>\n {/* Near-zero shrink: the local part gives up its width first. */}\n {domain && (\n <span className=\"min-w-0 overflow-hidden text-ellipsis whitespace-nowrap [flex-shrink:0.001]\">{domain}</span>\n )}\n </span>\n );\n}\n","import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\n\n/**\n * A responsive table: the native table elements with the standard look. The container scrolls\n * sideways when the table is wider than its parent. For sorting, filtering, pagination and row\n * selection, see `DataTable` (`@platned/ui/data-table`).\n */\n\n/** One column of the `Table` shorthand. */\nexport interface TableColumn<Row = Record<string, unknown>> {\n /** The row field shown, and the column's React key. */\n key: string;\n header: ReactNode;\n /** Classes for the column's cells and header, e.g. `text-right`, `w-[100px]`, `font-medium`. */\n className?: string;\n /** Classes for the header cell only. */\n headerClassName?: string;\n /** Renders the cell. Default: `row[key]`. */\n cell?: (row: Row, index: number) => ReactNode;\n}\n\nexport interface TableProps<Row = Record<string, unknown>> extends ComponentPropsWithoutRef<'table'> {\n /** Shorthand: the columns. With `rows`, renders the header, body, footer and caption for you. */\n columns?: TableColumn<Row>[];\n /** Shorthand: one body row per item. */\n rows?: Row[];\n /** Shorthand: a stable key per row. Default: the index. */\n getRowKey?: (row: Row, index: number) => string | number;\n /** Shorthand: a caption, shown below the table. */\n caption?: ReactNode;\n /** Shorthand: one footer cell per column. */\n footer?: ReactNode[];\n}\n\nfunction renderShorthand<Row>({\n columns,\n rows = [],\n getRowKey,\n caption,\n footer,\n}: Pick<TableProps<Row>, 'columns' | 'rows' | 'getRowKey' | 'caption' | 'footer'>) {\n const cols = columns ?? [];\n return (\n <>\n {caption !== undefined && <TableCaption>{caption}</TableCaption>}\n <TableHeader>\n <TableRow>\n {cols.map((column) => (\n <TableHead key={column.key} className={cn(column.className, column.headerClassName)}>\n {column.header}\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {rows.map((row, index) => (\n <TableRow key={getRowKey ? getRowKey(row, index) : index}>\n {cols.map((column) => (\n <TableCell key={column.key} className={column.className}>\n {column.cell ? column.cell(row, index) : ((row as Record<string, unknown>)[column.key] as ReactNode)}\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n {footer && (\n <TableFooter>\n <TableRow>\n {cols.map((column, index) => (\n <TableCell key={column.key} className={column.className}>\n {footer[index]}\n </TableCell>\n ))}\n </TableRow>\n </TableFooter>\n )}\n </>\n );\n}\n\nconst TableRoot = forwardRef<HTMLTableElement, TableProps>(function Table(\n { className, columns, rows, getRowKey, caption, footer, children, ...props },\n ref,\n) {\n return (\n <div data-slot=\"table-container\" className=\"relative w-full scrollbar-thin overflow-x-auto\">\n <table ref={ref} data-slot=\"table\" className={cn('w-full caption-bottom text-sm', className)} {...props}>\n {columns ? renderShorthand({ columns, rows, getRowKey, caption, footer }) : children}\n </table>\n </div>\n );\n});\n\n/**\n * Compose the parts, or pass `columns` and `rows` for the shorthand (plus `caption`, `footer`,\n * `getRowKey`). The shorthand renders the same parts; for sorting or pagination use `DataTable`.\n */\nexport const Table = TableRoot as <Row = Record<string, unknown>>(\n props: TableProps<Row> & { ref?: React.Ref<HTMLTableElement> },\n) => ReturnType<typeof TableRoot>;\n\nexport type TableHeaderProps = ComponentPropsWithoutRef<'thead'>;\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(function TableHeader(\n { className, ...props },\n ref,\n) {\n return <thead ref={ref} data-slot=\"table-header\" className={cn('[&_tr]:border-b', className)} {...props} />;\n});\n\nexport type TableBodyProps = ComponentPropsWithoutRef<'tbody'>;\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(function TableBody(\n { className, ...props },\n ref,\n) {\n return <tbody ref={ref} data-slot=\"table-body\" className={cn('[&_tr:last-child]:border-0', className)} {...props} />;\n});\n\nexport type TableFooterProps = ComponentPropsWithoutRef<'tfoot'>;\n\nexport const TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(function TableFooter(\n { className, ...props },\n ref,\n) {\n return (\n <tfoot\n ref={ref}\n data-slot=\"table-footer\"\n className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}\n {...props}\n />\n );\n});\n\nexport type TableRowProps = ComponentPropsWithoutRef<'tr'>;\n\n/** Set `data-state=\"selected\"` for the selected look. */\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(function TableRow({ className, ...props }, ref) {\n return (\n <tr\n ref={ref}\n data-slot=\"table-row\"\n className={cn(\n 'has-aria-expanded:bg-muted/50 hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors',\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type TableHeadProps = ComponentPropsWithoutRef<'th'>;\n\nexport const TableHead = forwardRef<HTMLTableCellElement, TableHeadProps>(function TableHead(\n { className, ...props },\n ref,\n) {\n return (\n <th\n ref={ref}\n data-slot=\"table-head\"\n className={cn(\n 'text-foreground h-10 px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0',\n className,\n )}\n {...props}\n />\n );\n});\n\nexport type TableCellProps = ComponentPropsWithoutRef<'td'>;\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(function TableCell(\n { className, ...props },\n ref,\n) {\n return (\n <td\n ref={ref}\n data-slot=\"table-cell\"\n className={cn('p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0', className)}\n {...props}\n />\n );\n});\n\nexport type TableCaptionProps = ComponentPropsWithoutRef<'caption'>;\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, TableCaptionProps>(function TableCaption(\n { className, ...props },\n ref,\n) {\n return (\n <caption ref={ref} data-slot=\"table-caption\" className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />\n );\n});\n","import { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';\nimport { Progress as ProgressPrimitive } from 'radix-ui';\n\nimport { cn } from '../../lib/cn';\n\n/**\n * Progress: how far a task has got, as a bar. `<Progress value={33} />`.\n *\n * Built on Radix Progress: a `progressbar` with `aria-valuenow`, `aria-valuemax` and a value\n * label. Name it with `aria-label`, or put it in a `Field` with a `FieldLabel` pointing at its\n * `id`. Set the thickness with `className` (`h-2`).\n *\n * `tone` colours the fill for a status — a score, a risk, a quota running out. It is the one\n * Platned addition; the default is the primary fill.\n */\n\nexport type ProgressTone = 'brand' | 'positive' | 'warning' | 'danger' | 'neutral';\n\nconst FILL: Record<ProgressTone, string> = {\n brand: 'bg-primary',\n positive: 'bg-success',\n warning: 'bg-warning',\n danger: 'bg-destructive',\n neutral: 'bg-muted-foreground',\n};\n\nexport interface ProgressProps extends ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {\n /** The fill colour. Default `brand` (primary). */\n tone?: ProgressTone;\n}\n\nexport const Progress = forwardRef<ElementRef<typeof ProgressPrimitive.Root>, ProgressProps>(function Progress(\n { className, value, max = 100, tone = 'brand', ...props },\n ref,\n) {\n // Clamped, so a value past the ends draws a full or empty bar rather than an error.\n const clamped = value == null ? value : Math.min(max, Math.max(0, value));\n const percent = clamped == null ? 0 : (clamped / max) * 100;\n return (\n <ProgressPrimitive.Root\n ref={ref}\n data-slot=\"progress\"\n data-tone={tone}\n value={clamped}\n max={max}\n // Mirrored in right-to-left text, so the bar fills from the start side.\n className={cn(\n 'relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted rtl:rotate-180',\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className={cn('size-full flex-1 transition-all motion-reduce:transition-none', FILL[tone])}\n style={{ transform: `translateX(-${100 - percent}%)` }}\n />\n </ProgressPrimitive.Root>\n );\n});\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport { Progress } from '../feedback/progress';\nimport type { ProgressTone } from '../feedback/progress';\n\n/**\n * Cell renderers for `DataTable` (and the `Table` parts). Unchanged in 0.7.0; moved out of\n * `data-table.tsx` when the table itself was rebuilt on TanStack Table.\n */\n\n// ── Cell components ────────────────────────────────────────────────────────────\n\n/**\n * Cell type scale.\n *\n * Named `size`, not `density`, and deliberately *not* inherited from the table: the two\n * real compact tables disagree about the mapping — the audit table wants default\n * padding with small cell text — so inheritance could not express it anyway, and it\n * would make these render one size inside a table and another outside one.\n */\nexport type TableCellSize = 'sm' | 'md';\n\nexport interface TableCellLeadTextProps {\n primary: string;\n /**\n * The muted second line. A string ellipsises with a `title`. From 0.9.1 it can also be an\n * element, such as an email value, which manages its own overflow: an email\n * should truncate before the `@`, never wrap mid-word.\n */\n secondary?: ReactNode;\n size?: TableCellSize;\n className?: string;\n}\n\n/**\n * `title` needs a string, but cells are passed numbers and small fragments of them. Anything\n * richer (an element) has no reliable text form, so it gets no tooltip.\n */\nfunction textFromNode(node: ReactNode): string | undefined {\n if (typeof node === 'string') return node;\n if (typeof node === 'number') return String(node);\n if (Array.isArray(node)) {\n const parts = node.map(textFromNode);\n return parts.every((part) => part !== undefined) ? parts.join('') : undefined;\n }\n return undefined;\n}\n\n/**\n * Primary text plus an optional muted subtitle — for lead entity/name cells.\n *\n * Both lines ellipsise, with the full text as a `title`, so a long name can't stretch the row.\n * `min-w-0` on the root is load-bearing: callers put this next to an Avatar in a flex row, and a\n * flex item doesn't shrink below its content width without it, so `truncate` would never fire.\n */\nexport function TableCellLeadText({ primary, secondary, size = 'md', className }: TableCellLeadTextProps) {\n return (\n <div className={clsx('flex min-w-0 flex-col gap-0.5', className)}>\n <span\n title={primary}\n className={clsx(\n 'block truncate font-medium leading-snug text-foreground',\n size === 'sm' ? 'text-xs' : 'text-sm',\n )}\n >\n {primary}\n </span>\n {secondary &&\n (typeof secondary === 'string' || typeof secondary === 'number' ? (\n <span\n title={String(secondary)}\n className={clsx(\n 'block truncate font-normal leading-tight text-muted-foreground',\n size === 'sm' ? 'text-xs' : 'text-xs',\n )}\n >\n {secondary}\n </span>\n ) : (\n // An element brings its own overflow handling, so it gets no `truncate` here,\n // which a card layout's touch un-truncation would otherwise turn into wrapping.\n <span\n className={clsx(\n 'block min-w-0 font-normal leading-tight text-muted-foreground',\n size === 'sm' ? 'text-xs' : 'text-xs',\n )}\n >\n {secondary}\n </span>\n ))}\n </div>\n );\n}\n\nexport interface TableCellTextProps {\n children: ReactNode;\n /** Muted (secondary) by default; pass false for the primary colour. */\n muted?: boolean;\n size?: TableCellSize;\n /**\n * Ellipsise with the full text as a `title` (default). `false` keeps the text on one line at\n * its full width instead, for a column that is sized to fit its content.\n *\n * Defaulted on in 0.8.3. Until then the default was a bare `whitespace-nowrap`, which in a\n * column narrower than the text clipped it mid-glyph with no ellipsis and no way to read the\n * rest.\n */\n truncate?: boolean;\n className?: string;\n}\n\n/** Plain one-line text cell. */\nexport function TableCellText({ children, muted = true, size = 'md', truncate = true, className }: TableCellTextProps) {\n return (\n <span\n title={truncate ? textFromNode(children) : undefined}\n className={clsx(\n 'font-normal leading-snug',\n size === 'sm' ? 'text-xs' : 'text-xs',\n truncate ? 'block min-w-0 truncate' : 'whitespace-nowrap',\n muted ? 'text-muted-foreground' : 'text-foreground',\n className,\n )}\n >\n {children}\n </span>\n );\n}\n\nexport interface TableCellBadgeProps {\n label: string;\n className?: string;\n}\n\n/**\n * Small outlined chip — entity type labels, categories. A label longer than the column\n * ellipsises inside the chip, with the full text as a `title`, rather than overflowing it.\n */\nexport function TableCellBadge({ label, className }: TableCellBadgeProps) {\n return (\n <span\n title={label}\n className={clsx(\n 'inline-flex max-w-full items-center rounded-md border border-border bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground',\n className,\n )}\n >\n <span className=\"truncate\">{label}</span>\n </span>\n );\n}\n\nexport interface TableCellProgressProps {\n percent: number;\n /**\n * Bar colour. `brand` is 0.2.0's default and byte-identical to it — `bg-primary`\n * resolves to the same `--prim-brand-900` the old raw-hex default hardcoded.\n */\n tone?: ProgressTone;\n size?: TableCellSize;\n /**\n * What the bar measures, e.g. \"Risk score\" — the bar's accessible name, with the value\n * announced by the progressbar role. Without it the bar is named by its percentage alone.\n */\n label?: string;\n className?: string;\n}\n\n/**\n * Mini progress bar with its percentage at the end. The bar fills whatever width the cell gives\n * it, as Ant Design's line Progress and MUI's LinearProgress do:\n * through 0.7.0 it was a fixed 48 / 64px, which left most of a wide column, or of a card field in\n * the responsive layout, empty. `size` now sets the bar's thickness (4 / 6px).\n */\nexport function TableCellProgress({ percent, tone = 'brand', size = 'md', label, className }: TableCellProgressProps) {\n // Rounded as well as clamped: the printed value is the one the bar shows. Through 0.8.2 the\n // raw `percent` was printed, so 150 drew a full bar labelled \"150%\" and 33.333 printed\n // every digit.\n const clamped = Math.round(Math.min(100, Math.max(0, percent)));\n return (\n <div className={clsx('flex w-full min-w-0 items-center gap-2', className)}>\n {/* Delegates to Progress rather than hand-rolling a second bar, which is what\n 0.2.0 did — the two then disagreed on the track colour. */}\n <Progress\n value={clamped}\n tone={tone}\n className={clsx('min-w-12 flex-1', size === 'sm' ? 'h-1' : 'h-1.5')}\n aria-label={label ?? `${clamped}%`}\n />\n <span className=\"shrink-0 text-xs leading-none tabular-nums text-muted-foreground\">{clamped}%</span>\n </div>\n );\n}\n","import { useEffect, useLayoutEffect, useState } from 'react';\n\n/** `useLayoutEffect` in the browser, `useEffect` during a server render (which has no layout). */\nconst useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;\n\n/**\n * Tracks an element's rendered content-box width. New in 0.7.0, from SCIC.\n *\n * Use this when a component must switch *structure*, not just styling, based on the space it\n * actually has, e.g. `DataTable` swapping table rows for cards. Viewport breakpoints lie there:\n * a docked drawer or a one-third-width detail panel shrinks a component without the viewport\n * changing.\n *\n * Returns `[ref, width]`. `width` is `undefined` until the first measurement, which happens in\n * a layout effect so the first paint already uses it. Attach `ref` to a node whose width does\n * NOT depend on the structure you switch (typically the component's outer wrapper), or the\n * switch becomes a feedback loop.\n */\nexport function useElementWidth<T extends HTMLElement = HTMLElement>(): [\n (node: T | null) => void,\n number | undefined,\n] {\n // State rather than a ref so the observer is re-attached if React swaps the node.\n const [node, setNode] = useState<T | null>(null);\n const [width, setWidth] = useState<number | undefined>(undefined);\n\n useIsomorphicLayoutEffect(() => {\n if (!node) return;\n const apply = (next: number) => {\n // A hidden subtree (a display:none tab panel) measures 0. Keep the last width rather\n // than flipping layouts while invisible.\n if (next <= 0) return;\n setWidth((prev) => (prev !== undefined && Math.abs(prev - next) < 1 ? prev : next));\n };\n apply(node.getBoundingClientRect().width);\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) apply(entry.contentRect.width);\n });\n observer.observe(node);\n return () => observer.disconnect();\n }, [node]);\n\n return [setNode, width];\n}\n","import { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '../../lib/cn';\n\n/**\n * Empty: what to show when there is nothing to show (no results, no data yet, nothing\n * selected), with an optional way forward.\n *\n * Two ways to write one:\n * - Shorthand: `<Empty icon={<Icon />} title=\"No data\" description=\"…\">{actions}</Empty>`\n * renders the header and puts the children in `EmptyContent`.\n * - Composition: `Empty` > `EmptyHeader` (`EmptyMedia`, `EmptyTitle`, `EmptyDescription`) +\n * `EmptyContent`.\n *\n * `border` on `Empty` draws a dashed outline. For a loading state put a `Spinner` in\n * `EmptyMedia`; for a failure use `Alert`.\n */\n\nexport type EmptyMediaVariant = 'default' | 'icon';\n\nconst MEDIA: Record<EmptyMediaVariant, string> = {\n default: 'bg-transparent',\n icon: \"flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4\",\n};\n\nexport interface EmptyHeaderProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport const EmptyHeader = forwardRef<HTMLDivElement, EmptyHeaderProps>(function EmptyHeader(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-header\"\n className={cn('flex max-w-sm flex-col items-center gap-2', className)}\n {...props}\n />\n );\n});\n\nexport interface EmptyMediaProps extends HTMLAttributes<HTMLDivElement> {\n /** `icon` puts the icon on a small muted tile. Default `default`. */\n variant?: EmptyMediaVariant;\n}\n\nexport const EmptyMedia = forwardRef<HTMLDivElement, EmptyMediaProps>(function EmptyMedia(\n { className, variant = 'default', ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(\n 'mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0',\n MEDIA[variant],\n className,\n )}\n {...props}\n />\n );\n});\n\nexport interface EmptyTitleProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport const EmptyTitle = forwardRef<HTMLDivElement, EmptyTitleProps>(function EmptyTitle(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-title\"\n className={cn('text-sm font-medium tracking-tight', className)}\n {...props}\n />\n );\n});\n\nexport interface EmptyDescriptionProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport const EmptyDescription = forwardRef<HTMLDivElement, EmptyDescriptionProps>(function EmptyDescription(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-description\"\n className={cn(\n 'text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n className,\n )}\n {...props}\n />\n );\n});\n\nexport interface EmptyContentProps extends HTMLAttributes<HTMLDivElement> {}\n\nexport const EmptyContent = forwardRef<HTMLDivElement, EmptyContentProps>(function EmptyContent(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n data-slot=\"empty-content\"\n className={cn('flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance', className)}\n {...props}\n />\n );\n});\n\nexport interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n /** Shorthand: an icon, shown on a muted tile (`EmptyMedia variant=\"icon\"`). */\n icon?: ReactNode;\n /** Shorthand: the title. With `title`, `description` or `icon`, the children go in `EmptyContent`. */\n title?: ReactNode;\n /** Shorthand: the line under the title. */\n description?: ReactNode;\n}\n\nexport const Empty = forwardRef<HTMLDivElement, EmptyProps>(function Empty(\n { className, icon, title, description, children, ...props },\n ref,\n) {\n const shorthand = icon !== undefined || title !== undefined || description !== undefined;\n return (\n <div\n ref={ref}\n data-slot=\"empty\"\n className={cn(\n 'flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance',\n className,\n )}\n {...props}\n >\n {shorthand ? (\n <>\n <EmptyHeader>\n {icon !== undefined && <EmptyMedia variant=\"icon\">{icon}</EmptyMedia>}\n {title !== undefined && <EmptyTitle>{title}</EmptyTitle>}\n {description !== undefined && <EmptyDescription>{description}</EmptyDescription>}\n </EmptyHeader>\n {children !== undefined && children !== null && <EmptyContent>{children}</EmptyContent>}\n </>\n ) : (\n children\n )}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;AAAC,SAAS,kBAAsF;AAChG,SAAS,UAAU,uBAAuB;AAqCtC,SAYwB,KAZxB;AALG,IAAM,SAAS,WAAyC,SAASA,QACtE,EAAE,WAAW,OAAO,WAAW,QAAQ,UAAU,KAAK,KAAK,UAAU,UAAU,GAAG,MAAM,GACxF,KACA;AACA,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,aAAW;AAAA,MACX,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,gBAAQ,UAAa,oBAAC,eAAY,KAAU,KAAK,OAAO,IAAI;AAAA,QAC5D,aAAa,UAAa,oBAAC,kBAAgB,oBAAS;AAAA,QACpD;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;AAGD,IAAM,SACJ;AAIK,IAAM,cAAc,WAA+C,SAASC,aAAY,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK;AAC3H,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW,GAAG,wCAAwC,QAAQ,SAAS;AAAA,MACtE,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAIM,IAAM,iBAAiB,WAAiD,SAASC,gBACtF,EAAE,WAAW,GAAG,MAAM,GACtB,KACA;AACA,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACA,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAKM,IAAM,cAAc,WAA8C,SAASC,aAAY,EAAE,WAAW,GAAG,MAAM,GAAG,KAA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","names":["Avatar","AvatarImage","AvatarFallback","AvatarBadge","AvatarGroup","AvatarGroupCount","forwardRef","jsx","forwardRef","Separator","forwardRef","forwardRef","jsx","jsxs","parts","forwardRef","FieldLabel","FieldSet","jsx","forwardRef","Label","forwardRef","jsx","forwardRef","Textarea","forwardRef","forwardRef","jsx","jsxs","forwardRef","InputBase","Input","leadingIcon","jsx","forwardRef","InputGroup","InputGroupAddon","InputGroupButton","InputGroupText","InputGroupInput","InputGroupTextarea","Fragment","forwardRef","Fragment","jsx","jsxs","forwardRef","SelectGroup","SelectValue","SelectTrigger","SelectContent","SelectLabel","SelectItem","SelectSeparator","SelectScrollUpButton","SelectScrollDownButton","createContext","useContext","useEffect","useState","jsx","createContext","forwardRef","useContext","useId","useMemo","useState","useEffect","useState","Fragment","jsx","jsxs","createContext","useState","useMemo","forwardRef","PopoverTrigger","useContext","useId","PopoverContent","PopoverHeader","PopoverTitle","PopoverDescription","PopoverClose","PopoverAnchor","createContext","forwardRef","useContext","jsx","forwardRef","Toggle","createContext","ToggleGroup","ToggleGroupItem","useContext","forwardRef","Fragment","jsx","jsxs","VARIANT","forwardRef","Badge","createContext","forwardRef","useContext","useEffect","useState","jsx","jsxs","createContext","forwardRef","DialogTrigger","DialogClose","DialogOverlay","DialogContent","DialogPanel","useState","DialogHeader","DialogFooter","DialogTitle","useContext","useEffect","DialogDescription","Children","createContext","forwardRef","isValidElement","useCallback","useContext","useEffect","useId","useLayoutEffect","useMemo","useRef","useState","CheckIcon","useCallback","useRef","useState","Fragment","jsx","jsxs","createContext","useContext","isValidElement","Children","forwardRef","Command","useState","useRef","useId","useCallback","useLayoutEffect","useEffect","useMemo","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CheckIcon","CommandShortcut","forwardRef","useEffect","useId","useRef","CheckIcon","jsx","jsxs","forwardRef","Checkbox","useRef","useId","useEffect","CheckIcon","createContext","forwardRef","useContext","useMemo","useRef","Fragment","forwardRef","useId","CheckIcon","Fragment","jsx","jsxs","forwardRef","useId","CheckIcon","Label","Separator","Fragment","jsx","jsxs","createContext","useContext","useRef","useMemo","forwardRef","DropdownMenuTrigger","DropdownMenuContent","forwardRef","Fragment","jsx","jsxs","forwardRef","Tabs","TabsList","TabsTrigger","TabsContent","forwardRef","jsx","BASE","forwardRef","Skeleton","createContext","useContext","useMemo","jsx","createContext","useContext","useMemo","CheckIcon","MinusIcon","useEffect","useState","CheckIcon","jsx","jsxs","useState","useEffect","CheckIcon","Fragment","jsx","jsxs","parts","CheckIcon","MinusIcon","forwardRef","Fragment","jsx","jsxs","forwardRef","Table","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption","forwardRef","jsx","FILL","forwardRef","Progress","clsx","jsx","jsxs","parts","clsx","useEffect","useLayoutEffect","useState","useIsomorphicLayoutEffect","forwardRef","Fragment","jsx","jsxs","forwardRef","EmptyHeader","EmptyMedia","EmptyTitle","EmptyDescription","EmptyContent","Empty"]}
|