@keboola/design 15.0.0 → 15.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/{AIKit-CaAW4GLx.js → AIKit-BR6jfsdI.js} +60 -21
- package/dist/AIKit-BR6jfsdI.js.map +1 -0
- package/dist/{AlertModal-D4AtpvLS.js → AlertModal-DMsn62JJ.js} +3 -3
- package/dist/AlertModal-DMsn62JJ.js.map +1 -0
- package/dist/{Badge-5GHIsgRS.js → Badge-CqlOE5A2.js} +10 -10
- package/dist/Badge-CqlOE5A2.js.map +1 -0
- package/dist/{BrandEditor-CTGtQUFZ.js → BrandEditor-D61pzWRq.js} +3 -3
- package/dist/{BrandEditor-CTGtQUFZ.js.map → BrandEditor-D61pzWRq.js.map} +1 -1
- package/dist/{Breadcrumb-B2YSNON4.js → Breadcrumb-DbqvDnYl.js} +2 -2
- package/dist/{Breadcrumb-B2YSNON4.js.map → Breadcrumb-DbqvDnYl.js.map} +1 -1
- package/dist/{ColorModeSwitch-B6UEzG0H.js → ColorModeSwitch-BlrH8jAi.js} +2 -2
- package/dist/{ColorModeSwitch-B6UEzG0H.js.map → ColorModeSwitch-BlrH8jAi.js.map} +1 -1
- package/dist/{Combobox-CaKqgstG.js → Combobox-BLqX-Tdh.js} +3 -3
- package/dist/Combobox-BLqX-Tdh.js.map +1 -0
- package/dist/{DateInput-BgbMDJkm.js → DateInput-duinbI9_.js} +2 -2
- package/dist/{DateInput-BgbMDJkm.js.map → DateInput-duinbI9_.js.map} +1 -1
- package/dist/{DatePicker-BXpDRo-R.js → DatePicker-Cg_aG_N4.js} +2 -2
- package/dist/{DatePicker-BXpDRo-R.js.map → DatePicker-Cg_aG_N4.js.map} +1 -1
- package/dist/{DateRangeInput-BW0-_jV0.js → DateRangeInput-BYVHf9zo.js} +2 -2
- package/dist/{DateRangeInput-BW0-_jV0.js.map → DateRangeInput-BYVHf9zo.js.map} +1 -1
- package/dist/{DateRangePicker-C4-DoWac.js → DateRangePicker-m47cSV1r.js} +3 -3
- package/dist/{DateRangePicker-C4-DoWac.js.map → DateRangePicker-m47cSV1r.js.map} +1 -1
- package/dist/{DropdownMenu-CcVbZ_5u.js → DropdownMenu-Bum99mVf.js} +2 -2
- package/dist/DropdownMenu-Bum99mVf.js.map +1 -0
- package/dist/{Form-CAofWyMI.js → Form-Dqbt_tIs.js} +2 -2
- package/dist/{Form-CAofWyMI.js.map → Form-Dqbt_tIs.js.map} +1 -1
- package/dist/HoverCard-Cf9iYyaW.js +26 -0
- package/dist/HoverCard-Cf9iYyaW.js.map +1 -0
- package/dist/{MermaidDiagram-Te-5gOCU.js → MermaidDiagram-2-EuNu1i.js} +2 -2
- package/dist/{MermaidDiagram-Te-5gOCU.js.map → MermaidDiagram-2-EuNu1i.js.map} +1 -1
- package/dist/{Modal-CbUz-5YH.js → Modal-DwuvuiUx.js} +3 -3
- package/dist/Modal-DwuvuiUx.js.map +1 -0
- package/dist/{ModalTitle-cy0Ht9VY.js → ModalTitle-RGWwIMU6.js} +2 -2
- package/dist/ModalTitle-RGWwIMU6.js.map +1 -0
- package/dist/{PageToolbar-DJ5tdYla.js → PageToolbar-LKP6PiP_.js} +3 -3
- package/dist/{PageToolbar-DJ5tdYla.js.map → PageToolbar-LKP6PiP_.js.map} +1 -1
- package/dist/{Popconfirm-DwLCYNaF.js → Popconfirm-p72DiagN.js} +2 -2
- package/dist/{Popconfirm-DwLCYNaF.js.map → Popconfirm-p72DiagN.js.map} +1 -1
- package/dist/{Popover-DtUDwUVO.js → Popover-DnBw5Uay.js} +2 -2
- package/dist/Popover-DnBw5Uay.js.map +1 -0
- package/dist/{SectionNav-tLK3iF6c.js → SectionNav-6hcIpZLO.js} +3 -3
- package/dist/{SectionNav-tLK3iF6c.js.map → SectionNav-6hcIpZLO.js.map} +1 -1
- package/dist/{Select-B22hB_-w.js → Select-C6zKeip5.js} +2 -2
- package/dist/Select-C6zKeip5.js.map +1 -0
- package/dist/{Sheet-0TWKTqid.js → Sheet-DKG20J7W.js} +3 -3
- package/dist/Sheet-DKG20J7W.js.map +1 -0
- package/dist/{Sidebar-C5hdANBU.js → Sidebar-BlYqasnX.js} +4 -4
- package/dist/{Sidebar-C5hdANBU.js.map → Sidebar-BlYqasnX.js.map} +1 -1
- package/dist/{TimePicker-CoRpiEM3.js → TimePicker-lk3NGqeK.js} +2 -2
- package/dist/{TimePicker-CoRpiEM3.js.map → TimePicker-lk3NGqeK.js.map} +1 -1
- package/dist/Workbench-CxgNCs3I.js.map +1 -1
- package/dist/{ZoomableSvg-DnFXo2L4.js → ZoomableSvg-CxXKanUR.js} +2 -2
- package/dist/{ZoomableSvg-DnFXo2L4.js.map → ZoomableSvg-CxXKanUR.js.map} +1 -1
- package/dist/flint.js +1 -1
- package/dist/index.d.ts +42 -8
- package/dist/index.js +26 -25
- package/dist/internal/blocks/AIKit.js +1 -1
- package/dist/internal/blocks/BrandEditor.js +1 -1
- package/dist/internal/blocks/ChipEditor.js +1 -1
- package/dist/internal/blocks/ColorModeSwitch.js +1 -1
- package/dist/internal/blocks/DateInput.js +1 -1
- package/dist/internal/blocks/DateRangeInput.js +1 -1
- package/dist/internal/blocks/ExportMenu.js +1 -1
- package/dist/internal/blocks/Form/connectors/ComboboxField.js +1 -1
- package/dist/internal/blocks/Form.js +1 -1
- package/dist/internal/blocks/MultiCombobox.js +1 -1
- package/dist/internal/blocks/PageToolbar.js +1 -1
- package/dist/internal/blocks/SectionNav.js +1 -1
- package/dist/internal/blocks/SplitButton.js +1 -1
- package/dist/internal/blocks/TimeInput.js +1 -1
- package/dist/internal/components/AlertModal.js +1 -1
- package/dist/internal/components/Badge.js +1 -1
- package/dist/internal/components/Breadcrumb.js +1 -1
- package/dist/internal/components/Combobox.js +1 -1
- package/dist/internal/components/DatePicker.js +1 -1
- package/dist/internal/components/DateRangePicker.js +1 -1
- package/dist/internal/components/DropdownMenu.js +1 -1
- package/dist/internal/components/HoverCard.js +1 -1
- package/dist/internal/components/Modal.js +1 -1
- package/dist/internal/components/Popconfirm.js +1 -1
- package/dist/internal/components/Popover.js +1 -1
- package/dist/internal/components/Select.js +1 -1
- package/dist/internal/components/Sheet.js +1 -1
- package/dist/internal/components/Sidebar.js +1 -1
- package/dist/internal/components/TimePicker.js +1 -1
- package/dist/internal/components/ZoomableSvg.js +1 -1
- package/dist/internal/hooks/useTimeout.js +19 -0
- package/dist/internal/hooks/useTimeout.js.map +1 -0
- package/dist/markdown-editor.js +3 -3
- package/dist/mermaid.js +1 -1
- package/dist/rjsf.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/utils-DwC9u0tM.js.map +1 -1
- package/package.json +1 -1
- package/src/theme.css +4 -0
- package/dist/AIKit-CaAW4GLx.js.map +0 -1
- package/dist/AlertModal-D4AtpvLS.js.map +0 -1
- package/dist/Badge-5GHIsgRS.js.map +0 -1
- package/dist/Combobox-CaKqgstG.js.map +0 -1
- package/dist/DropdownMenu-CcVbZ_5u.js.map +0 -1
- package/dist/HoverCard-Cv5rmvJq.js +0 -26
- package/dist/HoverCard-Cv5rmvJq.js.map +0 -1
- package/dist/Modal-CbUz-5YH.js.map +0 -1
- package/dist/ModalTitle-cy0Ht9VY.js.map +0 -1
- package/dist/Popover-DtUDwUVO.js.map +0 -1
- package/dist/Select-B22hB_-w.js.map +0 -1
- package/dist/Sheet-0TWKTqid.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertModal-D4AtpvLS.js","names":[],"sources":["../src/components/AlertModal/AlertModalDescription.tsx","../src/components/AlertModal/AlertModalFooter.tsx","../src/components/AlertModal/AlertModalHeader.tsx","../src/components/AlertModal/AlertModalIcon.tsx","../src/components/AlertModal/AlertModalOverlay.tsx","../src/components/AlertModal/AlertModalTitle.tsx","../src/components/AlertModal/context.ts","../src/components/AlertModal/AlertModalContent.tsx","../src/components/AlertModal/AlertModalTrigger.tsx","../src/components/AlertModal/AlertModal.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof AlertDialogPrimitive.Description>;\n\nexport const AlertModalDescription = ({ className, ...props }: Props) => (\n <AlertDialogPrimitive.Description\n className={cn(\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalFooter = ({ className, ...props }: Props) => (\n <div className={cn('tw:flex', 'tw:gap-2', 'tw:justify-end', className)} {...props} />\n);\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\nexport const AlertModalHeader = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr]',\n 'tw:items-start',\n 'tw:gap-y-1',\n 'tw:gap-x-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ReactNode } from 'react';\n\nimport { AlertTriangle, CircleCheck, Info } from '../../icons';\nimport { cn } from '../../utils';\n\nimport type { AlertModalVariant } from './variant';\n\nconst VARIANT_ICONS: Record<AlertModalVariant, ReactNode> = {\n info: <Info />,\n warning: <AlertTriangle />,\n danger: <AlertTriangle />,\n success: <CircleCheck />,\n};\n\ntype Props = {\n variant: AlertModalVariant;\n icon?: ReactNode;\n};\n\nexport const AlertModalIcon = ({ variant, icon }: Props) => {\n const glyph = icon ?? VARIANT_ICONS[variant];\n\n return (\n // Inline badge on the status token's tint.\n <span\n data-slot=\"alert-modal-icon\"\n className={cn(\n 'tw:inline-flex',\n // grid placement: column 1 of the first row, top-aligned with the first line of content\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded',\n 'tw:size-8',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n {\n 'tw:bg-info/10 tw:text-info': variant === 'info',\n 'tw:bg-warning/10 tw:text-warning': variant === 'warning',\n 'tw:bg-destructive/10 tw:text-destructive': variant === 'danger',\n 'tw:bg-success/10 tw:text-success': variant === 'success',\n },\n )}\n >\n {glyph}\n </span>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Overlay } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Overlay>;\n\nexport const AlertModalOverlay = ({ ref, className, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-scrim',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:animate-in',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:animate-out',\n\n className,\n )}\n />\n);\n","import type { ComponentPropsWithRef } from 'react';\nimport { Title } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<typeof Title>;\n\nexport const AlertModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n asChild\n className={cn('tw:font-medium', 'tw:text-foreground', 'tw:wrap-anywhere', className)}\n >\n <h3>{children}</h3>\n </Title>\n);\n","import { createContext, use } from 'react';\nimport type { MouseEvent } from 'react';\n\ntype AlertModalContextType = {\n isLoading: boolean;\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => void;\n onCancel: (event: MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst AlertModalContext = createContext<AlertModalContextType | null>(null);\n\nexport const AlertModalContextProvider = AlertModalContext.Provider;\n\nexport const useAlertModalContext = (): AlertModalContextType => {\n const context = use(AlertModalContext);\n if (context === null)\n throw new Error('AlertModal compound components must be rendered inside <AlertModal>.');\n return context;\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Action, Cancel, Content, Portal } from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\n\nimport { AlertModalDescription } from './AlertModalDescription';\nimport { AlertModalFooter } from './AlertModalFooter';\nimport { AlertModalHeader } from './AlertModalHeader';\nimport { AlertModalIcon } from './AlertModalIcon';\nimport { AlertModalOverlay } from './AlertModalOverlay';\nimport { AlertModalTitle } from './AlertModalTitle';\nimport { useAlertModalContext } from './context';\nimport type { AlertModalVariant } from './variant';\n\ntype Props = {\n variant?: AlertModalVariant;\n /** `false` draws no icon at all, and gives the title and body its column. */\n icon?: ReactNode | false;\n title?: ReactNode;\n cancelLabel?: ReactNode;\n confirmLabel?: ReactNode;\n /** Disables confirm only; cancel stays available. */\n confirmDisabled?: boolean;\n container?: ComponentProps<typeof Portal>['container'];\n} & Omit<ComponentProps<typeof Content>, 'title'>;\n\nexport const AlertModalContent = ({\n variant = 'info',\n icon,\n title,\n cancelLabel = 'Cancel',\n confirmLabel: actionLabel = 'Confirm',\n confirmDisabled = false,\n container,\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const { isLoading, onConfirm, onCancel } = useAlertModalContext();\n\n const handleEscapeKeyDown: ComponentProps<typeof Content>['onEscapeKeyDown'] = (event) => {\n // Keeps a parent Modal/Sheet open when this confirmation is nested.\n event.stopPropagation();\n if (isLoading) event.preventDefault();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal container={container}>\n <AlertModalOverlay\n // Portaled events still bubble to the host's React handlers; Escape passes so Radix can close.\n onClick={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key !== 'Escape') event.stopPropagation();\n }}\n >\n <Content\n // Silences Radix's missing-description warning when there are no children.\n {...(children ? {} : { 'aria-describedby': undefined })}\n onEscapeKeyDown={handleEscapeKeyDown}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:text-base',\n\n // positioning\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n 'tw:top-1/2',\n 'tw:-translate-y-1/2',\n\n // sizing\n 'tw:w-full',\n 'tw:max-w-[480px]',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n 'tw:overflow-y-auto',\n\n // layout\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n\n 'tw:rounded-modal',\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n 'tw:p-4',\n\n // animation: fade + zoom; no slide, it would stack on the `translate` centring\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=open]:zoom-in-95',\n 'tw:data-[state=closed]:zoom-out-95',\n\n className,\n )}\n {...props}\n >\n <AlertModalHeader>\n {icon !== false && <AlertModalIcon variant={variant} icon={icon} />}\n\n {title && (\n <AlertModalTitle\n className={cn(\n icon === false ? 'tw:col-start-1' : 'tw:col-start-2',\n 'tw:row-start-1 tw:self-center',\n )}\n >\n {title}\n </AlertModalTitle>\n )}\n\n {children && (\n <AlertModalDescription\n className={cn(\n icon === false ? 'tw:col-start-1' : 'tw:col-start-2',\n title ? 'tw:row-start-2' : 'tw:row-start-1 tw:self-center',\n )}\n >\n {children}\n </AlertModalDescription>\n )}\n </AlertModalHeader>\n\n <AlertModalFooter>\n <Cancel asChild>\n <Button type=\"button\" variant=\"outline\" disabled={isLoading} onClick={onCancel}>\n {cancelLabel}\n </Button>\n </Cancel>\n\n <Action asChild>\n <Button\n type=\"button\"\n variant={variant === 'danger' ? 'danger' : 'primary'}\n isLoading={isLoading}\n disabled={isLoading || confirmDisabled}\n onClick={onConfirm}\n >\n {actionLabel}\n </Button>\n </Action>\n </AlertModalFooter>\n </Content>\n </AlertModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\nimport { Trigger } from '@radix-ui/react-alert-dialog';\n\ntype Props = ComponentPropsWithRef<typeof Trigger>;\n\nexport const AlertModalTrigger = ({ ref, onClick, onKeyDown, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n onClick={(event) => {\n // The trigger sits in the normal DOM tree, often inside a clickable row/card. Stop the\n // open-click from bubbling to that ancestor's onClick. (Radix still opens the modal —\n // stopPropagation only blocks ancestors, not the open handler on the same element.)\n event.stopPropagation();\n onClick?.(event);\n }}\n onKeyDown={(event) => {\n // Only the activation keys open the modal and would leak; stop just those so Tab/arrows/etc.\n // still reach ancestor keyboard handlers. The button still activates (stopPropagation only\n // blocks ancestors).\n if (event.key === 'Enter' || event.key === ' ') event.stopPropagation();\n onKeyDown?.(event);\n }}\n />\n);\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type { ComponentProps, MouseEvent } from 'react';\nimport { Root } from '@radix-ui/react-alert-dialog';\n\nimport { AlertModalContent } from './AlertModalContent';\nimport { AlertModalTrigger } from './AlertModalTrigger';\nimport { AlertModalContextProvider } from './context';\n\nconst noop = () => undefined;\n\ntype ConfirmHandler = (event: MouseEvent<HTMLButtonElement>) => void | Promise<unknown>;\ntype CancelHandler = (event: MouseEvent<HTMLButtonElement>) => void;\n\ntype Props = {\n onConfirm?: ConfirmHandler;\n onCancel?: CancelHandler;\n skipAsyncWait?: boolean;\n /** Marks the confirm action busy from the outside, on top of the state inferred from a thenable `onConfirm`. */\n isLoading?: boolean;\n} & ComponentProps<typeof Root>;\n\nexport const AlertModal = ({\n children,\n onConfirm = noop,\n onCancel = noop,\n skipAsyncWait = false,\n isLoading = false,\n open,\n defaultOpen,\n onOpenChange,\n ...rest\n}: Props) => {\n const [isConfirming, setIsConfirming] = useState(false);\n\n // Controllable open state: when `open` is provided the parent owns it; otherwise we keep our own.\n const isControlled = open !== undefined;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen ?? false);\n const isOpen = isControlled ? open : uncontrolledOpen;\n\n const confirmRef = useRef(onConfirm);\n const cancelRef = useRef(onCancel);\n const onOpenChangeRef = useRef(onOpenChange);\n\n // Latest-ref pattern: keep the handlers out of `context`'s deps so its identity stays stable,\n // without writing to refs during render (synced in an effect, before any handler can fire).\n useEffect(() => {\n confirmRef.current = onConfirm;\n cancelRef.current = onCancel;\n onOpenChangeRef.current = onOpenChange;\n }, [onConfirm, onCancel, onOpenChange]);\n\n const setOpen = useCallback(\n (next: boolean) => {\n if (!isControlled) setUncontrolledOpen(next);\n onOpenChangeRef.current?.(next);\n },\n [isControlled],\n );\n\n const context = useMemo(\n () => ({\n // The two sources of \"the confirm action is running\" converge here, so every consumer\n // downstream reads one answer regardless of which way the host drives it.\n isLoading: isConfirming || isLoading,\n onConfirm: (event: MouseEvent<HTMLButtonElement>) => {\n const result = confirmRef.current(event);\n\n // Treat any thenable as async, not just native promises.\n const isThenable =\n result !== null && typeof result === 'object' && typeof result.then === 'function';\n if (!isThenable || skipAsyncWait) return;\n\n // The async confirm's outcome drives the modal.\n // - `preventDefault` stops the click closing it, so it stays up while the action runs.\n // - Resolved closes it; rejected leaves it up so the failure stays visible.\n // - The rejection is deliberately not caught — the host's global handler reports it.\n event.preventDefault();\n setIsConfirming(true);\n Promise.resolve(result)\n .then(() => setOpen(false))\n .finally(() => setIsConfirming(false));\n },\n onCancel: (event: MouseEvent<HTMLButtonElement>) => {\n cancelRef.current(event);\n },\n }),\n [isConfirming, isLoading, skipAsyncWait, setOpen],\n );\n\n return (\n <Root {...rest} open={isOpen} onOpenChange={setOpen}>\n <AlertModalContextProvider value={context}>{children}</AlertModalContextProvider>\n </Root>\n );\n};\n\nAlertModal.Trigger = AlertModalTrigger;\nAlertModal.Content = AlertModalContent;\n"],"mappings":";;;;;;;;AAOA,MAAa,yBAAyB,EAAE,WAAW,GAAG,YACpD,oBAAC,qBAAqB,aAAtB;CACE,WAAW,GACT,gBACA,sBACA,kBACA,4BACA,SACF;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gBAAgB;EAC3B,YAAY,UAAyC;GACnD,MAAM,SAAS,WAAW,QAAQ,KAAK;GAKvC,IAAI,EADF,WAAW,QAAQ,OAAO,WAAW,YAAY,OAAO,OAAO,SAAS,eACvD,eAAe;GAMlC,MAAM,eAAe;GACrB,gBAAgB,IAAI;GACpB,QAAQ,QAAQ,MAAM,CAAC,CACpB,WAAW,QAAQ,KAAK,CAAC,CAAC,CAC1B,cAAc,gBAAgB,KAAK,CAAC;EACzC;EACA,WAAW,UAAyC;GAClD,UAAU,QAAQ,KAAK;EACzB;CACF,IACA;EAAC;EAAc;EAAW;EAAe;CAAO,CAClD;CAEA,OACE,oBAAC,MAAD;EAAM,GAAI;EAAM,MAAM;EAAQ,cAAc;EAC1C,UAAA,oBAAC,2BAAD;GAA2B,OAAO;GAAU;EAAoC,CAAA;CAC5E,CAAA;AAEV;AAEA,WAAW,UAAU;AACrB,WAAW,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Badge-5GHIsgRS.js","names":[],"sources":["../src/components/Badge/BadgeAddon.tsx","../src/components/Badge/BadgeButton.tsx","../src/components/Badge/BadgeLabel.tsx","../src/components/Badge/styles.ts","../src/components/Badge/BadgeRoot.tsx","../src/components/Badge/Badge.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nconst addonVariants = cva(\n [\n 'tw:flex',\n 'tw:items-center',\n 'tw:shrink-0',\n 'tw:bg-inherit',\n 'tw:self-stretch',\n 'tw:px-1',\n 'tw:has-[button]:px-0',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n ],\n {\n defaultVariants: {\n align: 'inline-end',\n variant: 'inline',\n },\n variants: {\n align: {\n 'inline-start': ['tw:order-first'],\n 'inline-end': ['tw:order-last'],\n },\n variant: {\n inline: [],\n floating: [\n 'tw:hidden',\n 'tw:group-hover/badge:flex',\n\n 'tw:absolute',\n 'tw:top-0',\n 'tw:bottom-0',\n 'tw:focus-within:flex',\n ],\n },\n },\n compoundVariants: [\n { variant: 'floating', align: 'inline-end', className: ['tw:right-0'] },\n { variant: 'floating', align: 'inline-start', className: ['tw:left-0'] },\n ],\n },\n);\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof addonVariants>;\n\nexport const BadgeAddon = ({\n ref,\n align = 'inline-end',\n variant = 'inline',\n className,\n ...rest\n}: Props) => (\n <div\n {...rest}\n ref={ref}\n data-align={align}\n data-variant={variant}\n className={cn(addonVariants({ align, variant, className }))}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'button'>;\n\nexport const BadgeButton = ({ ref, className, type = 'button', children, ...rest }: Props) => (\n <button\n {...rest}\n ref={ref}\n type={type}\n className={cn(\n 'tailwindcss-preflight',\n\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:cursor-pointer',\n\n 'tw:bg-inherit',\n 'tw:text-inherit',\n\n 'tw:hover:brightness-95',\n 'tw:px-1',\n\n // The focus ring lives here rather than on `BadgeRoot`, whose own `focus-visible` block\n // sits on a `div` that never takes focus. Inset, because a badge root clips its overflow —\n // an outset ring on a nested button would be cut off.\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-inset',\n 'tw:focus-visible:ring-ring',\n // Default sizing for Lucide-icon children (which ship at 24×24); keeps\n // the visual baseline aligned with the previous FA-icon API and other\n // icon-wrapper components (ItemIcon, SidebarMenuIcon).\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n className,\n )}\n >\n {children}\n </button>\n);\n","import type { ComponentProps } from 'react';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'> & {\n asChild?: boolean;\n};\n\nexport const BadgeLabel = ({ ref, className, asChild = false, ...rest }: Props) => {\n const Comp = asChild ? Slot : 'span';\n return (\n <Comp\n {...rest}\n ref={ref}\n data-slot=\"badge-label\"\n className={cn(\n 'tw:max-w-56',\n 'tw:truncate',\n 'tw:px-2',\n 'tw:py-0.5',\n\n // Drop side padding only when an *inline* addon is present —\n // floating addons overlay the label without taking layout space,\n // so the label still needs full padding behind them.\n 'tw:group-has-[[data-align=inline-start][data-variant=inline]:not(:empty)]/badge:pl-0',\n 'tw:group-has-[[data-align=inline-end][data-variant=inline]:not(:empty)]/badge:pr-0',\n className,\n )}\n />\n );\n};\n","import { cva } from 'class-variance-authority';\n\n/**\n * Badge's `color` variants: fill, foreground, and a `decoration-*` matching the fill.\n *\n * - Hues (`green`, `blue-inverse`, …) are fixed palette steps, for categorical labels.\n * - Status colours (`success`, `warning-subtle`, …) read brand tokens; use them for a state.\n * - Tinted (`-inverse`, `-subtle`) variants follow `[data-theme=dark]`; measured by the contrast audit and stories.\n */\nexport const badgeColors = {\n gray: 'tw:bg-neutral-400 tw:text-white tw:decoration-neutral-400',\n 'gray-darker': 'tw:bg-neutral-500 tw:text-white tw:decoration-neutral-500',\n 'gray-inverse':\n 'tw:bg-neutral-100 tw:text-neutral-500 tw:decoration-neutral-100 tw:[[data-theme=dark]_&]:bg-neutral-700 tw:[[data-theme=dark]_&]:text-neutral-300 tw:[[data-theme=dark]_&]:decoration-neutral-700',\n green: 'tw:bg-green-500 tw:text-white tw:decoration-green-500',\n 'green-darker': 'tw:bg-green-600 tw:text-white tw:decoration-green-600',\n 'green-inverse':\n 'tw:bg-green-100 tw:text-green-900 tw:decoration-green-100 tw:[[data-theme=dark]_&]:bg-green-900 tw:[[data-theme=dark]_&]:text-green-200 tw:[[data-theme=dark]_&]:decoration-green-900',\n blue: 'tw:bg-blue-500 tw:text-white tw:decoration-blue-500',\n 'blue-inverse':\n 'tw:bg-blue-100 tw:text-blue-800 tw:decoration-blue-100 tw:[[data-theme=dark]_&]:bg-blue-900 tw:[[data-theme=dark]_&]:text-blue-200 tw:[[data-theme=dark]_&]:decoration-blue-900',\n red: 'tw:bg-error-500 tw:text-white tw:decoration-error-500',\n 'red-inverse':\n 'tw:bg-error-100 tw:text-error-800 tw:decoration-error-100 tw:[[data-theme=dark]_&]:bg-error-900 tw:[[data-theme=dark]_&]:text-error-200 tw:[[data-theme=dark]_&]:decoration-error-900',\n orange: 'tw:bg-warning-500 tw:text-white tw:decoration-warning-500',\n 'orange-inverse':\n 'tw:bg-warning-100 tw:text-warning-800 tw:decoration-warning-100 tw:[[data-theme=dark]_&]:bg-warning-900 tw:[[data-theme=dark]_&]:text-warning-200 tw:[[data-theme=dark]_&]:decoration-warning-900',\n amber: 'tw:bg-warning-300 tw:text-warning-800 tw:decoration-warning-300',\n // One rung deeper than `orange-inverse` so caution stays distinct from warning (same hue).\n 'amber-inverse':\n 'tw:bg-warning-200 tw:text-warning-800 tw:decoration-warning-200 tw:[[data-theme=dark]_&]:bg-warning-800 tw:[[data-theme=dark]_&]:text-warning-200 tw:[[data-theme=dark]_&]:decoration-warning-800',\n teal: 'tw:bg-teal-500 tw:text-white tw:decoration-teal-500',\n 'teal-inverse':\n 'tw:bg-teal-100 tw:text-teal-800 tw:decoration-teal-100 tw:[[data-theme=dark]_&]:bg-teal-900 tw:[[data-theme=dark]_&]:text-teal-200 tw:[[data-theme=dark]_&]:decoration-teal-900',\n purple: 'tw:bg-purple-500 tw:text-white tw:decoration-purple-500',\n 'purple-inverse':\n 'tw:bg-purple-100 tw:text-purple-800 tw:decoration-purple-100 tw:[[data-theme=dark]_&]:bg-purple-900 tw:[[data-theme=dark]_&]:text-purple-200 tw:[[data-theme=dark]_&]:decoration-purple-900',\n cyan: 'tw:bg-cyan-500 tw:text-white tw:decoration-cyan-500',\n 'cyan-inverse':\n 'tw:bg-cyan-100 tw:text-cyan-800 tw:decoration-cyan-100 tw:[[data-theme=dark]_&]:bg-cyan-900 tw:[[data-theme=dark]_&]:text-cyan-200 tw:[[data-theme=dark]_&]:decoration-cyan-900',\n 'sidebar-primary': 'tw:bg-sidebar-primary tw:text-white tw:decoration-sidebar-primary',\n white: 'tw:bg-white/90 tw:text-neutral-600 tw:decoration-white/90',\n // Dark mode lightens these tokens but keeps a white foreground, so solid fills take dark ink there.\n success:\n 'tw:bg-success tw:text-success-foreground tw:decoration-success tw:[[data-theme=dark]_&]:text-background',\n 'success-subtle':\n 'tw:bg-success-subtle tw:text-success-subtle-foreground tw:decoration-success-subtle',\n warning: 'tw:bg-warning tw:text-warning-foreground tw:decoration-warning',\n 'warning-subtle':\n 'tw:bg-warning-subtle tw:text-warning-subtle-foreground tw:decoration-warning-subtle',\n info: 'tw:bg-info tw:text-info-foreground tw:decoration-info tw:[[data-theme=dark]_&]:text-background',\n 'info-subtle': 'tw:bg-info-subtle tw:text-info-subtle-foreground tw:decoration-info-subtle',\n destructive:\n 'tw:bg-destructive tw:text-destructive-foreground tw:decoration-destructive tw:[[data-theme=dark]_&]:text-background',\n 'destructive-subtle':\n 'tw:bg-destructive-subtle tw:text-destructive-subtle-foreground tw:decoration-destructive-subtle',\n // `neutral` has no status token: solid paints `muted-foreground`.\n neutral: 'tw:bg-muted-foreground tw:text-background tw:decoration-muted-foreground',\n 'neutral-subtle':\n 'tw:bg-neutral-subtle tw:text-neutral-subtle-foreground tw:decoration-neutral-subtle',\n} as const;\n\n/** A `Badge` `color` value. */\nexport type BadgeColor = keyof typeof badgeColors;\n\n/** Tinted variants are held to WCAG-AA; solid fills are pinned, so only recorded. */\nexport const isTintedBadgeColor = (color: string): boolean =>\n color.endsWith('-inverse') || color.endsWith('-subtle');\n\nexport const badgeRootVariants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group/badge',\n\n // display\n 'tw:relative',\n 'tw:inline-flex',\n 'tw:justify-center',\n 'tw:items-center',\n 'tw:min-h-5',\n 'tw:h-fit',\n 'tw:shrink-0',\n 'tw:overflow-hidden',\n\n // text — weight/tracking are brand-overridable tokens\n 'tw:whitespace-pre-wrap',\n 'tw:break-normal',\n 'tw:text-xs',\n 'tw:font-medium',\n 'tw:tracking-chrome',\n 'tw:text-center',\n 'tw:underline',\n\n // content\n 'tw:border-none',\n 'tw:[&>svg]:self-center',\n 'tw:[button&]:cursor-pointer',\n\n // focus\n 'tw:focus-visible:outline-hidden',\n 'tw:focus-visible:ring-2',\n 'tw:focus-visible:ring-inset',\n 'tw:focus-visible:ring-ring',\n ],\n {\n defaultVariants: {\n color: 'gray',\n variant: 'default',\n },\n variants: {\n variant: {\n default: ['tw:rounded'],\n tag: ['tw:rounded tw:normal-case'],\n pill: ['tw:min-w-5 tw:rounded-full tw:normal-case tw:tracking-normal'],\n },\n color: badgeColors,\n },\n },\n);\n","import type { ComponentProps } from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nimport { badgeRootVariants } from './styles';\n\ntype Props = ComponentProps<'div'> & VariantProps<typeof badgeRootVariants>;\n\nexport const BadgeRoot = ({ ref, variant, color, className, children, ...rest }: Props) => (\n <div\n {...rest}\n ref={ref}\n data-slot=\"badge\"\n className={cn(badgeRootVariants({ variant, color, className }))}\n >\n {children}\n </div>\n);\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { BadgeAddon } from './BadgeAddon';\nimport { BadgeButton } from './BadgeButton';\nimport { BadgeLabel } from './BadgeLabel';\nimport { BadgeRoot } from './BadgeRoot';\n\ntype AddonVariant = ComponentProps<typeof BadgeAddon>['variant'];\ntype BadgeRootProps = ComponentProps<typeof BadgeRoot>;\ntype BadgeLabelProps = ComponentProps<typeof BadgeLabel>;\n\n/**\n * - `color` status values (`success`, `warning-subtle`, …) follow the brand; use them for a state.\n * - `color` hues (`green`, `purple`, …) stay fixed; use them for categorical labels.\n */\ntype Props = Pick<BadgeRootProps, 'variant' | 'color'> &\n Omit<BadgeLabelProps, 'prefix'> & {\n prefix?: ReactNode;\n prefixVariant?: AddonVariant;\n suffix?: ReactNode;\n suffixVariant?: AddonVariant;\n labelClassName?: string;\n };\n\n/**\n * Inline pill for a status, count or tag.\n *\n * - Not for actions (`Button` / `ButtonInline`) or banners (`Alert`).\n * - `Badge.Button` for a clickable badge.\n */\nconst BadgeInner = ({\n ref,\n variant = 'pill',\n color,\n prefix,\n prefixVariant = 'inline',\n suffix,\n suffixVariant = 'inline',\n className,\n labelClassName,\n ...labelProps\n}: Props) => (\n <BadgeRoot className={className} variant={variant} color={color}>\n {prefix && (\n <BadgeAddon align=\"inline-start\" variant={prefixVariant}>\n {prefix}\n </BadgeAddon>\n )}\n <BadgeLabel {...labelProps} ref={ref} className={labelClassName} />\n {suffix && (\n <BadgeAddon align=\"inline-end\" variant={suffixVariant}>\n {suffix}\n </BadgeAddon>\n )}\n </BadgeRoot>\n);\n\nexport const Badge = Object.assign(BadgeInner, {\n Root: BadgeRoot,\n Button: BadgeButton,\n Label: BadgeLabel,\n Addon: BadgeAddon,\n});\n"],"mappings":";;;;;AAKA,MAAM,gBAAgB,IACpB;CACE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;CACA,UAAU;EACR,OAAO;GACL,gBAAgB,CAAC,gBAAgB;GACjC,cAAc,CAAC,eAAe;EAChC;EACA,SAAS;GACP,QAAQ,CAAC;GACT,UAAU;IACR;IACA;IAEA;IACA;IACA;IACA;GACF;EACF;CACF;CACA,kBAAkB,CAChB;EAAE,SAAS;EAAY,OAAO;EAAc,WAAW,CAAC,YAAY;CAAE,GACtE;EAAE,SAAS;EAAY,OAAO;EAAgB,WAAW,CAAC,WAAW;CAAE,CACzE;AACF,CACF;AAIA,MAAa,cAAc,EACzB,KACA,QAAQ,cACR,UAAU,UACV,WACA,GAAG,WAEH,oBAAC,OAAD;CACE,GAAI;CACC;CACL,cAAY;CACZ,gBAAc;CACd,WAAW,GAAG,cAAc;EAAE;EAAO;EAAS;CAAU,CAAC,CAAC;AAC3D,CAAA;;;ACvDH,MAAa,eAAe,EAAE,KAAK,WAAW,OAAO,UAAU,UAAU,GAAG,WAC1E,oBAAC,UAAD;CACE,GAAI;CACC;CACC;CACN,WAAW,GACT,yBAEA,kBACA,mBACA,qBACA,qBAEA,iBACA,mBAEA,0BACA,WAKA,mCACA,2BACA,+BACA,8BAIA,gDACA,SACF;CAEC;AACK,CAAA;;;AC/BV,MAAa,cAAc,EAAE,KAAK,WAAW,UAAU,OAAO,GAAG,WAAkB;CAEjF,OACE,oBAFW,UAAU,OAAO,QAE5B;EACE,GAAI;EACC;EACL,aAAU;EACV,WAAW,GACT,eACA,eACA,WACA,aAKA,wFACA,sFACA,SACF;CACD,CAAA;AAEL;ACsCA,MAAa,oBAAoB,IAC/B;CACE;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;AACF,GACA;CACE,iBAAiB;EACf,OAAO;EACP,SAAS;CACX;CACA,UAAU;EACR,SAAS;GACP,SAAS,CAAC,YAAY;GACtB,KAAK,CAAC,2BAA2B;GACjC,MAAM,CAAC,8DAA8D;EACvE;EACA,OAAO;GAzGX,MAAM;GACN,eAAe;GACf,gBACE;GACF,OAAO;GACP,gBAAgB;GAChB,iBACE;GACF,MAAM;GACN,gBACE;GACF,KAAK;GACL,eACE;GACF,QAAQ;GACR,kBACE;GACF,OAAO;GAEP,iBACE;GACF,MAAM;GACN,gBACE;GACF,QAAQ;GACR,kBACE;GACF,MAAM;GACN,gBACE;GACF,mBAAmB;GACnB,OAAO;GAEP,SACE;GACF,kBACE;GACF,SAAS;GACT,kBACE;GACF,MAAM;GACN,eAAe;GACf,aACE;GACF,sBACE;GAEF,SAAS;GACT,kBACE;EAwDS;CACT;AACF,CACF;;;AC7GA,MAAa,aAAa,EAAE,KAAK,SAAS,OAAO,WAAW,UAAU,GAAG,WACvE,oBAAC,OAAD;CACE,GAAI;CACC;CACL,aAAU;CACV,WAAW,GAAG,kBAAkB;EAAE;EAAS;EAAO;CAAU,CAAC,CAAC;CAE7D;AACE,CAAA;;;;;;;;;ACaP,MAAM,cAAc,EAClB,KACA,UAAU,QACV,OACA,QACA,gBAAgB,UAChB,QACA,gBAAgB,UAChB,WACA,gBACA,GAAG,iBAEH,qBAAC,WAAD;CAAsB;CAAoB;CAAgB;CAA1D,UAAA;EACG,UACC,oBAAC,YAAD;GAAY,OAAM;GAAe,SAAS;GACvC,UAAA;EACS,CAAA;EAEd,oBAAC,YAAD;GAAY,GAAI;GAAiB;GAAK,WAAW;EAAiB,CAAA;EACjE,UACC,oBAAC,YAAD;GAAY,OAAM;GAAa,SAAS;GACrC,UAAA;EACS,CAAA;CAEL;;AAGb,MAAa,QAAQ,OAAO,OAAO,YAAY;CAC7C,MAAM;CACN,QAAQ;CACR,OAAO;CACP,OAAO;AACT,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Combobox-CaKqgstG.js","names":["BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","BaseCombobox","Combobox","BaseCombobox"],"sources":["../src/components/Combobox/blankValues.ts","../src/components/Combobox/ComboboxChip.tsx","../src/components/Combobox/utils.ts","../src/components/Combobox/ComboboxChips.tsx","../src/components/Combobox/ComboboxClearButton.tsx","../src/components/Combobox/ComboboxContent.tsx","../src/components/Combobox/ComboboxEmpty.tsx","../src/components/Combobox/ComboboxInput.tsx","../src/components/Combobox/ComboboxInputGroup.tsx","../src/components/Combobox/ComboboxItemIndicator.tsx","../src/components/Combobox/virtualList.ts","../src/components/Combobox/ComboboxItem.tsx","../src/components/Combobox/ComboboxList.tsx","../src/components/Combobox/ComboboxOpenButton.tsx","../src/components/Combobox/Group/ComboboxGroupHeader.tsx","../src/components/Combobox/Group/ComboboxGroup.tsx","../src/components/Combobox/Group/ComboboxGroupLabel.tsx","../src/components/Combobox/Group/ComboboxCollection.tsx","../src/components/Combobox/ComboboxFullList.tsx","../src/components/Combobox/ComboboxLoadingEmpty.tsx","../src/components/Combobox/ComboboxVirtualList.tsx","../src/components/Combobox/ComboboxOptions.tsx","../src/components/Combobox/ComboboxRoot.tsx","../src/components/Combobox/ComboboxSeparator.tsx","../src/components/Combobox/createdItems.ts","../src/components/Combobox/groupFlip.ts","../src/components/Combobox/groupHeaders.ts","../src/components/Combobox/query.ts","../src/components/Combobox/Combobox.tsx","../src/components/Combobox/matchByWords.ts"],"sourcesContent":["/**\n * The two blank strings a Storage filter predicates on, in list order.\n *\n * - Hand it to `items` where the blanks are the whole list — a value field whose other entries the\n * user types. {@link withBlankValues} is for offering them ahead of a list that already exists.\n */\nexport const BLANK_VALUES: readonly string[] = ['', ' '];\n\nconst BLANK_LABELS: Record<string, string> = {\n '': '[empty string]',\n ' ': '[space character]',\n};\n\n/**\n * A string as a row or a chip shows it — named when its text is blank, itself otherwise.\n *\n * - Exported so an `itemToLabel` / `itemToChipLabel` / `itemToSelectedLabel` / `renderChips`\n * override can keep the default naming instead of retyping the labels.\n * - The two blank values get their own labels; any other whitespace-only string (a tab, a run of\n * spaces) falls back to a generic one, so two different ones read alike.\n * - Identity is unaffected — `toLabel` keys items off the raw string.\n */\nexport const namedLabel = (text: string): string =>\n text.trim() === '' ? (BLANK_LABELS[text] ?? '[whitespace]') : text;\n\n/**\n * `values` with both blank values offered ahead of them, and duplicates collapsed.\n *\n * - The dedupe matters where the list is the distinct values of a Storage column: it can already\n * hold a blank, and two `Object.is`-equal rows both report `aria-selected` and toggle each other.\n * - First occurrence wins, so the order of the values is otherwise preserved.\n * - String items only — the seven Storage filters this serves are all string-valued.\n */\nexport const withBlankValues = (values: readonly string[]): string[] => [\n ...new Set([...BLANK_VALUES, ...values]),\n];\n","import { type ComponentProps, type KeyboardEvent, type ReactNode, useState } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { X } from '../../icons';\nimport { Badge } from '../Badge';\nimport { Tooltip, TooltipProvider } from '../Tooltip';\nimport { hasTruncationOverflow } from '../Truncated';\n\nexport type BadgeColor = ComponentProps<typeof Badge>['color'];\nexport type BadgeVariant = ComponentProps<typeof Badge>['variant'];\n\n/**\n * Keeps a chip's keyboard handling off its content's.\n *\n * - Base UI's chip `preventDefault`s Enter/Space, cancelling a nested link or button.\n * - Capture phase, so the chip's own bubble handler never runs.\n * - Target-guarded, so the chip's own keys (Backspace, Delete, arrows) still reach it.\n */\nconst stopNestedKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.target !== event.currentTarget) event.stopPropagation();\n};\n\ntype Props = {\n children: ReactNode;\n color?: BadgeColor;\n variant?: BadgeVariant;\n};\n\n/**\n * One removable chip in a `MultiCombobox`'s `renderChips` slot or `Combobox.Chips`.\n *\n * - Position is identity: Base UI removes by index, so render one per `value` entry, in order.\n * - A non-removable chip is a plain `Badge`: a chip would shift the removal index.\n * - A label cut off by the chip's width shows in full in a tooltip on hover.\n */\nexport const ComboboxChip = ({ children, color, variant }: Props) => {\n const [isTruncated, setIsTruncated] = useState(false);\n\n return (\n <BaseCombobox.Chip\n render={<Badge.Root color={color} variant={variant ?? 'pill'} className=\"tw:max-w-40\" />}\n onKeyDownCapture={stopNestedKeyDown}\n >\n <TooltipProvider>\n <Tooltip tooltip={children} forceHide={!isTruncated} placement=\"top\" triggerAsChild>\n {/* The trigger's `tailwindcss-preflight` sets `line-height: 1.5`; keep the badge's own. */}\n <Badge.Label\n className=\"tw:leading-[inherit]\"\n onMouseOver={(event) => setIsTruncated(hasTruncationOverflow(event.currentTarget))}\n >\n {children}\n </Badge.Label>\n </Tooltip>\n </TooltipProvider>\n <Badge.Addon variant=\"inline\" align=\"inline-end\">\n <BaseCombobox.ChipRemove\n render={\n <Badge.Button aria-label=\"Remove value\">\n <X className=\"tw:size-3\" />\n </Badge.Button>\n }\n />\n </Badge.Addon>\n </BaseCombobox.Chip>\n );\n};\n","import { isValidElement, type ReactNode, useMemo } from 'react';\n\nimport { namedLabel } from './blankValues';\nimport type {\n CreatableItem,\n Group,\n GroupHeaderItem,\n InternalItems,\n LabeledItem,\n SelectAllItem,\n} from './types';\n\nconst isPlainObject = (item: unknown): item is Record<string, unknown> =>\n item !== null && typeof item === 'object';\n\nconst isNumber = (item: unknown): item is number => typeof item === 'number';\nconst isString = (item: unknown): item is string => typeof item === 'string';\n\nconst isLabeledItem = (item: unknown): item is LabeledItem =>\n isPlainObject(item) && Reflect.has(item, 'label') && Reflect.has(item, 'value');\n\nexport const isInternalItem = (item: unknown): item is InternalItems =>\n isLabeledItem(item) && '__marker' in item;\n\nexport const isSelectAllItem = (item: unknown): item is SelectAllItem =>\n isInternalItem(item) && item.__marker === 'selectAll';\n\nexport const isCreatableItem = (item: unknown): item is CreatableItem => {\n return isInternalItem(item) && item.__marker === 'creatable';\n};\n\nexport const isGroupHeaderItem = (item: unknown): item is GroupHeaderItem =>\n isInternalItem(item) && item.__marker === 'groupHeader';\n\nexport const isGroupItem = <Item>(itemOrGroup: Item | Group<Item>): itemOrGroup is Group<Item> =>\n itemOrGroup !== null && typeof itemOrGroup === 'object' && Reflect.has(itemOrGroup, 'items');\n\nexport const isGroupItems = <Item, GroupShape extends Group<Item> = Group<Item>>(\n items: readonly (Item | GroupShape)[],\n): items is GroupShape[] => {\n if (!Array.isArray(items)) return false;\n if (items.length === 0) return false; // Base UI treats empty as non-grouped\n return isGroupItem(items[0]); // Base UI checks only the first item\n};\n\n/** The options of a list, its groups flattened. */\nexport const flatItems = <Value>(list: readonly (Value | Group<Value>)[]) => {\n const items: Value[] = [];\n for (const entry of list) {\n if (!isGroupItem(entry)) items.push(entry);\n // One push per item: spreading a large group would exceed the engine's argument limit.\n else for (const item of entry.items) items.push(item);\n }\n return items;\n};\n\n/** The create row and Select All: each is drawn outside any group, even in a grouped list. */\nexport const isLooseItem = (item: unknown): item is CreatableItem | SelectAllItem =>\n isCreatableItem(item) || isSelectAllItem(item);\n\n/**\n * `items` as entries of `list`: one group without a label in a grouped list, else themselves.\n *\n * - Base UI reads the first entry to tell a grouped list, so every entry has to match it.\n * - The group never reaches `groupToLabel`: {@link isEntriesGroup} tells it apart.\n */\nexport const toEntries = <Item>(list: readonly unknown[], items: readonly Item[]) =>\n isGroupItems(list) ? [{ __marker: 'entries' as const, items }] : items;\n\n/** A group {@link toEntries} made; Base UI's filter keeps the marker, as it spreads each group. */\nexport const isEntriesGroup = (entry: unknown) =>\n isGroupItem(entry) && Reflect.get(entry, '__marker') === 'entries';\n\n/**\n * Node a list row and a chip show for an item.\n *\n * - Names a blank string, so a row or chip never renders as nothing; {@link toLabel} does not.\n * - A non-string `label` (a JSX node) passes through.\n */\nexport const defaultItemToLabel = <Item>(item: Item) => {\n if (isNumber(item)) return item;\n if (isString(item)) return namedLabel(item);\n if (!isLabeledItem(item))\n throw new Error(\n 'Combobox: Item does not have a `label` field. Pass `itemToLabel` for custom item shapes.',\n );\n\n return isString(item.label) ? namedLabel(item.label) : item.label;\n};\n\n/**\n * The node a row or a chip shows for an item when the caller passes no `itemToLabel`.\n *\n * - Names a blank `itemToStringLabel` result, which would otherwise render as nothing.\n * - Falls back to the item's own string: Base UI reports the outgoing selection for one render\n * after `items` and `itemToStringLabel` change together.\n */\nexport const defaultRowLabel = <Item>(itemToStringLabel?: (item: Item) => string) =>\n itemToStringLabel\n ? (item: Item) => namedLabel(itemToStringLabel(item) ?? toLabel(item))\n : defaultItemToLabel;\n\n/**\n * Display string for an item — mirrors Base UI's default.\n *\n * - Also the default search text and the closed `Combobox`'s input value.\n * - Does not name blank strings: `''` may mean \"nothing selected\", and must keep the placeholder.\n * - A labelled item with neither a label nor a value reads as `''`, like the string item `''`.\n * - Naming lives in {@link defaultItemToLabel}, read only by rows and chips.\n */\nexport const toLabel = (item: unknown): string => {\n if (isString(item)) return item;\n if (isLabeledItem(item)) return item.label || item.value || '';\n return String(item);\n};\n\n/** Equality key for an item — prefers `.value`. */\nconst toValueKey = (item: unknown): string => {\n if (isString(item)) return item;\n if (isLabeledItem(item)) return item.value || item.label || '';\n return String(item);\n};\n\nexport const defaultItemToIcon = <Item>(item: Item) =>\n isLabeledItem(item) ? item.icon : undefined;\n\nexport const defaultItemToDisabled = <Item>(item: Item) =>\n isLabeledItem(item) ? (item.disabled ?? false) : false;\n\n/** A group's `label`, as `Select` renders it; one that is not a node reads as none. */\nexport const defaultGroupToLabel = (group: object): ReactNode => {\n const label: unknown = Reflect.get(group, 'label');\n return isString(label) || isNumber(label) || isValidElement(label) ? label : undefined;\n};\n\n// Internal markers: LabeledItem-shaped sentinels injected into Base UI's items.\n// - `__marker` keeps consumer items and callbacks from colliding with them.\n\nexport const selectAllItem: SelectAllItem = {\n __marker: 'selectAll',\n value: '__select_all__',\n label: 'Select All',\n};\n\n/** Row for the group at `index` — keyed by position, like its collapse state. */\nexport const createGroupHeaderItem = (index: number): GroupHeaderItem => ({\n __marker: 'groupHeader',\n value: `__group_${index}__`,\n label: '',\n});\n\nexport const createCreatableItem = (query: string): CreatableItem => ({\n __marker: 'creatable',\n value: query,\n label: query,\n});\n\n/**\n * Item-equality predicate for a Base UI combobox root.\n *\n * - A sentinel equals a sentinel by marker and value key (the create row is rebuilt per keystroke).\n * - A sentinel never equals a real item.\n * - Real items use the caller's predicate, else `Object.is`.\n */\nexport const toItemEquality =\n <Value>(isItemEqualToValue?: (a: Value, b: Value) => boolean) =>\n (a: Value, b: Value) => {\n if (isInternalItem(a) || isInternalItem(b)) {\n return (\n isInternalItem(a) &&\n isInternalItem(b) &&\n a.__marker === b.__marker &&\n toValueKey(a) === toValueKey(b)\n );\n }\n return isItemEqualToValue?.(a, b) ?? Object.is(a, b);\n };\n\n/**\n * {@link toItemEquality} with a stable identity.\n *\n * - Base UI lists the comparer in an effect's deps; a new one per render re-renders every row.\n */\nexport const useItemEquality = <Value>(isItemEqualToValue?: (a: Value, b: Value) => boolean) =>\n useMemo(() => toItemEquality(isItemEqualToValue), [isItemEqualToValue]);\n\n/** `itemToStringValue` that also reads the create row, whose value is its query. */\nexport const withCreatableStringValue = <Value>(\n itemToStringValue: ((item: Value) => string) | undefined,\n allowCreate: boolean | undefined,\n) =>\n !allowCreate || !itemToStringValue\n ? itemToStringValue\n : (item: Value) => (isCreatableItem(item) ? item.value : itemToStringValue(item));\n\n/** {@link withCreatableStringValue} with a stable identity. */\nexport const useCreatableStringValue = <Value>(\n itemToStringValue: ((item: Value) => string) | undefined,\n allowCreate: boolean | undefined,\n) =>\n useMemo(\n () => withCreatableStringValue(itemToStringValue, allowCreate),\n [itemToStringValue, allowCreate],\n );\n\nexport const defaultToCreateValue = <Value>(\n query: string,\n value: Value | undefined,\n queryToCreateValue?: (query: string) => Value,\n): Value => {\n if (queryToCreateValue) return queryToCreateValue(query);\n if (value === undefined) return query as Value;\n if (isString(value)) return query as Value;\n if (isLabeledItem(value)) return { value: query, label: query } as Value;\n throw new Error(\n 'Combobox: Cannot infer item shape for `allowCreate`. Pass `queryToCreateValue` for custom item shapes.',\n );\n};\n\nexport const defaultQueryToCreateLabel = (query: string) => `Create \"${query}\"`;\n","import type { ReactNode } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { Badge } from '../Badge';\n\nimport { type BadgeColor, type BadgeVariant, ComboboxChip } from './ComboboxChip';\nimport { defaultItemToLabel, isInternalItem } from './utils';\n\ntype Props<Value> = {\n maxVisible?: number;\n itemToChipLabel?: (item: Value) => ReactNode;\n itemToChipColor?: (item: Value) => BadgeColor;\n /**\n * Non-removable chips ahead of the values, outside `maxVisible` and absent from `value`.\n */\n pinnedChipLabels?: ReactNode[];\n variant?: BadgeVariant;\n /**\n * Renders the chip area in place of the default chips; every other prop is then unused.\n */\n children?: (values: Value[]) => ReactNode;\n};\n\nexport const ComboboxChips = <Value,>({\n maxVisible = 3,\n itemToChipLabel = defaultItemToLabel,\n itemToChipColor,\n pinnedChipLabels,\n variant = 'pill',\n children,\n}: Props<Value>) => (\n <BaseCombobox.Value>\n {(rawValues: Value[]) => {\n // Drop the Select All marker Base UI keeps in `value`: it gets no chip and never reaches\n // the caller's `itemToChipLabel` / `itemToChipColor`.\n const values = rawValues.filter((value) => !isInternalItem(value));\n\n if (children) return children(values);\n\n const visible = values.slice(0, maxVisible);\n const overflow = values.slice(maxVisible);\n\n return (\n <>\n {pinnedChipLabels?.map((label, index) => (\n // oxlint-disable-next-line react/no-array-index-key\n <Badge key={index} className=\"tw:max-w-40\" variant={variant}>\n {label}\n </Badge>\n ))}\n\n {visible.map((value: Value, index) => (\n <ComboboxChip\n // oxlint-disable-next-line react/no-array-index-key\n key={index}\n color={itemToChipColor?.(value)}\n variant={variant}\n >\n {itemToChipLabel(value)}\n </ComboboxChip>\n ))}\n\n {overflow.length > 0 && (\n <Badge.Root variant=\"pill\">\n <Badge.Label>+{overflow.length}</Badge.Label>\n </Badge.Root>\n )}\n </>\n );\n }}\n </BaseCombobox.Value>\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { X } from '../../icons';\nimport { InputGroup } from '../InputGroup';\n\ntype Props = {\n disabled?: boolean;\n};\n\n/** The button that clears the selection. */\nexport const ComboboxClearButton = ({ disabled }: Props) => (\n <InputGroup.Button asChild aria-label=\"Clear\" disabled={disabled}>\n <BaseCombobox.Clear>\n <X className=\"tw:size-4\" />\n </BaseCombobox.Clear>\n </InputGroup.Button>\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\n\nimport { cn } from '../../utils';\n\ntype PortalProps = ComponentProps<typeof BaseCombobox.Portal>;\ntype PositionerProps = ComponentProps<typeof BaseCombobox.Positioner>;\ntype PopupProps = Omit<ComponentProps<typeof BaseCombobox.Popup>, 'className'> & {\n className?: string;\n};\n\ntype Props = PopupProps &\n Pick<PositionerProps, 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'> &\n Pick<PortalProps, 'container'>;\n\nexport const ComboboxContent = ({\n ref,\n align = 'start',\n side = 'bottom',\n sideOffset = 4,\n alignOffset,\n anchor,\n container,\n className,\n children,\n ...popupProps\n}: Props) => {\n return (\n <BaseCombobox.Portal container={container}>\n {/*\n * Registers the popup in Radix's layer stack.\n *\n * - Base UI portals the popup out of the DOM, so a surrounding Radix `Modal` / `Sheet` /\n * `Popover` would otherwise still count itself as topmost and close on Escape. Radix reads\n * the key off a document capture listener, so being a higher layer is the only lever.\n * - No `onDismiss`: Base UI closes the popup itself, the layer only claims the keystroke.\n */}\n <DismissableLayer asChild>\n <BaseCombobox.Positioner\n align={align}\n side={side}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"tw:isolate tw:z-[1055] tailwindcss-preflight\"\n >\n <BaseCombobox.Popup\n ref={ref}\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n 'tw:!pointer-events-auto',\n 'tw:group/combobox-content',\n 'tw:relative',\n 'tw:flex tw:flex-col tw:overflow-hidden',\n\n // sizing\n 'tw:max-h-[var(--available-height)]',\n 'tw:w-[var(--anchor-width)]',\n 'tw:max-w-[var(--available-width)]',\n 'tw:origin-[var(--transform-origin)]',\n 'tw:data-[chips=true]:min-w-[var(--anchor-width)]',\n\n // appearance\n 'tw:rounded-lg',\n\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n 'tw:shadow-md',\n 'tw:ring-1',\n 'tw:ring-foreground/10',\n 'tw:duration-100',\n\n // open animation\n 'data-open:animate-in',\n 'data-open:fade-in-0',\n 'data-open:zoom-in-95',\n\n // closed animation\n 'data-closed:animate-out',\n 'data-closed:fade-out-0',\n 'data-closed:zoom-out-95',\n\n // position animations\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=inline-start]:slide-in-from-right-2',\n 'tw:data-[side=inline-end]:slide-in-from-left-2',\n className,\n )}\n {...popupProps}\n >\n {children}\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </DismissableLayer>\n </BaseCombobox.Portal>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Empty>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxEmpty = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n 'tw:hidden',\n 'tw:group-data-[empty]/combobox-content:flex',\n 'tw:justify-center',\n 'tw:items-center',\n 'tw:text-center',\n 'tw:px-2',\n 'tw:text-muted-foreground',\n 'tw:py-6',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport type { WithAccessibleName } from '../../utils/accessibleName';\nimport { InputGroup } from '../InputGroup';\n\n/** The input carries the `combobox` role, so the name is required here, not on the group. */\ntype Props = WithAccessibleName<Omit<ComponentProps<typeof BaseCombobox.Input>, 'render'>>;\n\nexport const ComboboxInput = ({ ref, ...props }: Props) => (\n <BaseCombobox.Input {...props} ref={ref} render={<InputGroup.Input />} />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { InputGroup } from '../InputGroup';\n\ntype InputGroupProps = Pick<ComponentProps<typeof InputGroup>, 'focusVariant' | 'state'>;\n\ntype Props = InputGroupProps &\n Omit<ComponentProps<typeof BaseCombobox.InputGroup>, 'render' | 'className'> & {\n className?: string;\n };\n\nexport const ComboboxInputGroup = ({ ref, state, focusVariant, className, ...props }: Props) => (\n <BaseCombobox.InputGroup\n {...props}\n ref={ref}\n render={<InputGroup state={state} focusVariant={focusVariant} className={className} />}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { Check } from '../../icons';\nimport { cn } from '../../utils';\n\ntype Variant = 'check' | 'checkbox';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.ItemIndicator>, 'className' | 'children'> & {\n className?: string;\n variant?: Variant;\n};\n\nexport const ComboboxItemIndicator = ({ ref, className, variant = 'check', ...props }: Props) => {\n if (variant === 'checkbox') {\n return (\n <BaseCombobox.ItemIndicator\n ref={ref}\n keepMounted\n className={cn(\n 'tw:group/combobox-item-indicator',\n\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:size-4',\n 'tw:shrink-0',\n\n 'tw:rounded',\n 'tw:border',\n 'tw:border-input',\n 'tw:bg-background',\n\n 'tw:data-[selected]:bg-primary',\n 'tw:data-[selected]:border-primary',\n className,\n )}\n {...props}\n >\n <Check\n className={cn(\n 'tw:hidden',\n 'tw:size-3',\n 'tw:stroke-[4px]',\n 'tw:!text-primary-foreground',\n 'tw:group-data-[selected]/combobox-item-indicator:block',\n )}\n />\n </BaseCombobox.ItemIndicator>\n );\n }\n\n return (\n <BaseCombobox.ItemIndicator\n {...props}\n ref={ref}\n className={cn(\n 'tw:pointer-events-none',\n 'tw:absolute',\n 'tw:right-2',\n\n // `render={<Check />}` makes the icon the indicator element itself (not a descendant), so a\n // `[&_svg]` rule never matches it — size it directly or Lucide renders at its 24px default.\n 'tw:size-4',\n 'tw:group-data-[highlighted]/combobox-item:text-hover-foreground',\n className,\n )}\n render={<Check />}\n />\n );\n};\n","import { createContext, useRef } from 'react';\n\nimport { isGroupItems } from './utils';\n\n/** Above this many options, `virtualized=\"auto\"` windows the list. */\nconst VIRTUALIZE_THRESHOLD = 30;\n\nexport type VirtualizedProps = {\n /** Puts only the rows in view into the DOM: `'auto'` past 30 options, grouped or not; `true` always. */\n virtualized?: boolean | 'auto';\n};\n\n/** Scrolls the option at Base UI's flat `index` into view, unless it is in view already. */\nexport type VirtualListHandle = { scrollToItem: (index: number) => void };\n\n/**\n * The position a windowed list gives each option it renders.\n *\n * - `index` is the option's place in Base UI's flat filtered list, which keyboard navigation counts.\n * - `aria-setsize` / `aria-posinset` keep the set's length known while most options are out of the DOM.\n * - `undefined` outside a windowed list, so a fully rendered list keeps its markup.\n */\nexport const VirtualRowContext = createContext<\n { index: number; 'aria-setsize': number; 'aria-posinset': number } | undefined\n>(undefined);\n\n/**\n * Whether a combobox windows its list, and what ties Base UI's highlight to the window.\n *\n * - `'auto'` counts options, not groups, so a list of a few large groups windows too.\n * - `onItemHighlighted` scrolls a row the keyboard reached into view; a pointer is over its row.\n * - `ref` goes to `ComboboxVirtualList`.\n */\nexport const useVirtualList = (\n items: readonly unknown[],\n virtualized: NonNullable<VirtualizedProps['virtualized']>,\n) => {\n const ref = useRef<VirtualListHandle>(null);\n const count = isGroupItems(items)\n ? items.reduce((sum, group) => sum + group.items.length, 0)\n : items.length;\n\n return {\n enabled: virtualized === 'auto' ? count > VIRTUALIZE_THRESHOLD : virtualized,\n ref,\n onItemHighlighted: ({ reason, index }: { reason: string; index: number }) => {\n if (reason !== 'pointer') ref.current?.scrollToItem(index);\n },\n };\n};\n","import { type ComponentProps, type ReactNode, use } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\nimport { ComboboxItemIndicator } from './ComboboxItemIndicator';\nimport { VirtualRowContext } from './virtualList';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Item>, 'className'> & {\n className?: string;\n icon?: ReactNode;\n /** `'none'` leaves the row without one — a row that draws its own state in `icon`. */\n indicator?: ComponentProps<typeof ComboboxItemIndicator>['variant'] | 'none';\n /** Looks disabled but still takes the highlight; the owning control ignores its presses. */\n locked?: boolean;\n};\n\nexport const ComboboxItem = ({\n ref,\n className,\n children,\n icon,\n indicator: variant = 'check',\n locked,\n ...props\n}: Props) => (\n <BaseCombobox.Item\n {...props}\n {...use(VirtualRowContext)}\n ref={ref}\n data-slot=\"combobox-item\"\n data-locked={locked || undefined}\n className={cn(\n 'tw:group/combobox-item',\n // layout\n 'tw:relative',\n 'tw:flex',\n 'tw:flex-1',\n 'tw:items-center',\n 'tw:gap-2',\n\n // spacing\n 'tw:py-2',\n 'tw:px-2',\n 'tw:rounded-lg',\n\n // typography\n 'tw:text-sm',\n 'tw:select-none',\n 'tw:cursor-default',\n 'tw:outline-hidden',\n\n // highlighted (keyboard / hover)\n 'tw:data-[highlighted]:bg-hover',\n 'tw:data-[highlighted]:text-hover-foreground',\n\n // disabled\n 'tw:data-disabled:pointer-events-none',\n 'tw:data-disabled:opacity-disabled',\n 'tw:data-locked:opacity-disabled',\n\n // child svg defaults\n 'tw:[&_svg]:pointer-events-none',\n 'tw:[&_svg]:shrink-0',\n 'tw:[&_svg]:text-muted-foreground',\n \"tw:[&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n >\n {variant !== 'none' && <ComboboxItemIndicator variant={variant} />}\n {icon}\n {/* Wraps rather than truncates; fills the row so a label can push content to its end. */}\n {/* `data-slot`: a host aligning the leading marks to the label's first line targets it. */}\n <span data-slot=\"combobox-item-label\" className=\"tw:min-w-0 tw:flex-1 tw:wrap-anywhere\">\n {children}\n </span>\n </BaseCombobox.Item>\n);\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.List>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxList = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.List\n ref={ref}\n className={cn(\n 'tw:no-scrollbar',\n 'tw:scroll-py-1',\n 'tw:overflow-y-auto',\n 'tw:overscroll-contain',\n 'tw:min-h-0',\n 'tw:flex-1',\n\n 'tw:p-2',\n 'tw:data-[empty]:p-0',\n className,\n )}\n {...props}\n />\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { ChevronDown, Loader2 } from '../../icons';\nimport { InputGroup } from '../InputGroup';\n\ntype Props = {\n disabled?: boolean;\n isLoading: boolean;\n};\n\n/**\n * The button that opens the popup: a chevron, or a spinner while the options are loading.\n *\n * - The spinner swaps in for the icon inside the one button, which costs the control no width, so\n * the input keeps its room whether or not a request is in flight.\n * - The button keeps opening the popup while loading, so a list that already has items stays\n * reachable.\n */\nexport const ComboboxOpenButton = ({ disabled, isLoading }: Props) => (\n <InputGroup.Button disabled={disabled} asChild aria-label=\"Open combobox\">\n <BaseCombobox.Trigger>\n {isLoading ? (\n <Loader2 className=\"tw:size-4 tw:animate-spin\" />\n ) : (\n <ChevronDown className=\"tw:size-4\" />\n )}\n </BaseCombobox.Trigger>\n </InputGroup.Button>\n);\n","import type { MouseEvent, ReactNode } from 'react';\n\nimport { Check, ChevronRight, Minus } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { isToggleAllClick } from '../../Tooltip/toggleAll';\nimport { ToggleAllTooltip } from '../../Tooltip/ToggleAllTooltip';\nimport { ComboboxItem } from '../ComboboxItem';\n\n/** Indent of a header's children (chevron + gap). */\nexport const GROUP_CHILD_INDENT = 'tw:pl-8';\n\ntype Props = {\n value: unknown;\n children: ReactNode;\n /** `undefined` for a group that does not collapse — no chevron. */\n expanded?: boolean;\n /** `all` for a Cmd-click (Ctrl elsewhere): fold or unfold every group; `from` is in the list. */\n onToggle: (all: boolean, from: Element) => void;\n /**\n * `'mixed'` for a partial selection; `undefined` for an unselectable row that toggles on press.\n * Drawn here: Base UI would put its indicator ahead of the chevron.\n */\n checked?: boolean | 'mixed';\n /** The children's indicator, mirrored by a `checked` row. */\n indicator?: 'check' | 'checkbox';\n disabled?: boolean;\n /** Every item it would pick is locked: looks disabled, still highlights. */\n locked?: boolean;\n};\n\n/**\n * A group's own row, standing for the whole group.\n *\n * - Keyboard-navigable like any other row.\n * - The chevron toggles by pointer, Cmd- or Ctrl-click toggles every group; its tooltip says so.\n * - `ArrowRight` / `ArrowLeft` are handled by the owning control.\n */\nexport const ComboboxGroupHeader = ({\n value,\n children,\n expanded,\n onToggle,\n checked,\n indicator = 'check',\n disabled,\n locked,\n}: Props) => {\n const toggleFromChevron = (event: MouseEvent) => {\n // Keep the chevron's click from selecting a selectable row.\n event.stopPropagation();\n onToggle(isToggleAllClick(event), event.currentTarget);\n };\n\n return (\n <ComboboxItem\n value={value}\n disabled={disabled}\n locked={locked}\n // An option allows no `aria-expanded`; screen readers read the description after the name.\n aria-description={expanded === undefined ? undefined : expanded ? 'Expanded' : 'Collapsed'}\n {...(checked !== undefined && { 'aria-selected': checked === true })}\n indicator=\"none\"\n className=\"tw:font-medium\"\n onClick={\n checked !== undefined\n ? undefined\n : (event) => {\n event.preventBaseUIHandler();\n onToggle(isToggleAllClick(event), event.currentTarget);\n }\n }\n icon={\n <>\n {expanded !== undefined && (\n <ToggleAllTooltip expanded={expanded}>\n <span\n aria-hidden\n data-slot=\"combobox-group-toggle\"\n // An icon button: its own hover, and it still folds a disabled row.\n className=\"tw:pointer-events-auto tw:-m-1 tw:inline-flex tw:shrink-0 tw:cursor-pointer tw:rounded tw:p-1 tw:transition-colors tw:hover:bg-foreground/10\"\n onClick={toggleFromChevron}\n >\n <ChevronRight\n className={cn('tw:transition-transform', expanded && 'tw:rotate-90')}\n />\n </span>\n </ToggleAllTooltip>\n )}\n {checked !== undefined && <GroupIndicator checked={checked} variant={indicator} />}\n </>\n }\n >\n {children}\n </ComboboxItem>\n );\n};\n\n/**\n * A group row's selection mark: all, some, or none.\n *\n * - Base UI's indicator is binary, so the row draws its own.\n * - `checkbox` matches the children's leading box; `check` their trailing mark.\n */\nconst GroupIndicator = ({\n checked,\n variant,\n}: {\n checked: boolean | 'mixed';\n variant: 'check' | 'checkbox';\n}) => {\n const Mark = checked === 'mixed' ? Minus : Check;\n\n if (variant === 'checkbox') {\n return (\n <span\n aria-hidden\n data-checked={checked}\n className={cn(\n 'tw:inline-flex tw:size-4 tw:shrink-0 tw:items-center tw:justify-center',\n 'tw:rounded tw:border tw:border-input tw:bg-background',\n checked !== false && 'tw:border-primary tw:bg-primary',\n )}\n >\n {checked !== false && (\n <Mark className=\"tw:size-3 tw:stroke-[4px] tw:!text-primary-foreground\" />\n )}\n </span>\n );\n }\n\n if (checked === false) return null;\n\n return (\n <Mark\n aria-hidden\n className={cn(\n 'tw:pointer-events-none tw:absolute tw:right-2 tw:size-4',\n 'tw:group-data-[highlighted]/combobox-item:text-hover-foreground',\n )}\n />\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Group>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxGroup = ({ ref, className, children, ...props }: Props) => (\n <BaseCombobox.Group\n ref={ref}\n className={cn('tw:flex tw:flex-col tw:gap-0.5', className)}\n {...props}\n >\n {children}\n </BaseCombobox.Group>\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../../utils';\n\ntype Props = Omit<BaseCombobox.GroupLabel.Props, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxGroupLabel = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.GroupLabel\n {...props}\n ref={ref}\n className={cn(\n // Soft grey section label.\n 'tw:px-2',\n 'tw:py-1.5',\n 'tw:text-xs',\n 'tw:font-medium',\n 'tw:leading-none',\n 'tw:text-muted-foreground',\n\n className,\n )}\n />\n);\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\ntype Props = BaseCombobox.Collection.Props;\n\nexport const ComboboxCollection = ({ ...props }: Props) => (\n <BaseCombobox.Collection data-slot=\"combobox-collection\" {...props} />\n);\n","import { Fragment, type ReactNode } from 'react';\n\nimport { ComboboxList } from './ComboboxList';\nimport { ComboboxCollection, ComboboxGroup, ComboboxGroupLabel } from './Group';\nimport type { Group, ListRenderProps } from './types';\nimport { isGroupItem, isLooseItem } from './utils';\n\n/** A Base UI collection child whose rows are keyed by position, as React matches unkeyed ones. */\nconst keyed =\n <Entry,>(render: (entry: Entry) => ReactNode) =>\n (entry: Entry, index: number) =>\n (\n // oxlint-disable-next-line react/no-array-index-key\n <Fragment key={index}>{render(entry)}</Fragment>\n );\n\n/** A combobox list that renders every row; `ComboboxVirtualList` renders only those in view. */\nexport const ComboboxFullList = <Value, GroupShape extends Group<Value> = Group<Value>>({\n renderItem,\n renderGroupItem,\n groupToLabel,\n}: ListRenderProps<Value, GroupShape>) => {\n const renderEntry = (entry: Value | GroupShape) => {\n if (!isGroupItem(entry)) return renderItem(entry);\n\n const [lead] = entry.items;\n if (isLooseItem(lead)) return renderItem(lead);\n\n const label = groupToLabel?.(entry);\n return (\n <ComboboxGroup items={entry.items}>\n {label && <ComboboxGroupLabel>{label}</ComboboxGroupLabel>}\n <ComboboxCollection>{keyed(renderGroupItem)}</ComboboxCollection>\n </ComboboxGroup>\n );\n };\n\n return <ComboboxList>{keyed(renderEntry)}</ComboboxList>;\n};\n","import { Loader2 } from '../../icons';\n\n/**\n * What the empty slot says while the options are loading, in place of the `empty` node.\n *\n * - `Combobox.Empty` is a polite live region, so the switch to this text and back to `empty` once\n * the request settles is announced.\n * - Base UI renders the slot only while the list has nothing to show, so a list that already has\n * items keeps showing them.\n */\nexport const ComboboxLoadingEmpty = () => (\n <span className=\"tw:inline-flex tw:items-center tw:gap-2\">\n <Loader2 className=\"tw:size-4 tw:animate-spin\" />\n Loading…\n </span>\n);\n","import {\n type CSSProperties,\n type ReactNode,\n type Ref,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\nimport {\n measureElement,\n observeElementRect,\n useVirtualizer,\n type VirtualItem,\n} from '@tanstack/react-virtual';\n\nimport { useElement } from '../../hooks/useElement';\n\nimport { ComboboxList } from './ComboboxList';\nimport { ComboboxGroup, ComboboxGroupLabel } from './Group';\nimport type { Group, ListRenderProps } from './types';\nimport { isGroupItem, isGroupItems, isLooseItem } from './utils';\nimport { type VirtualListHandle, VirtualRowContext } from './virtualList';\n\n/** Rows rendered past each edge of the viewport, so a fast scroll does not paint blank. */\nconst OVERSCAN = 12;\n\ntype ItemRow<Value> = {\n type: 'item';\n item: Value;\n /** Place in Base UI's flat filtered list. */\n index: number;\n setSize: number;\n posInSet: number;\n};\n\ntype Row<Value> = (ItemRow<Value> | { type: 'label' }) & {\n /** The group whose wrapper the row shares; `undefined` for a row outside any group. */\n group?: string;\n /** Spaced from the row above by the gap a fully rendered group puts between its children. */\n padded: boolean;\n};\n\n/** A group's last row is its own kind: a host may space groups apart inside it. */\ntype Kind = 'label' | 'padded' | 'plain' | 'padded-last' | 'plain-last';\nconst isGroupLast = (row: Row<unknown>) =>\n row.type === 'item' && row.group !== undefined && row.posInSet === row.setSize;\nconst kindOf = (row: Row<unknown>): Kind =>\n row.type === 'label'\n ? 'label'\n : `${row.padded ? 'padded' : 'plain'}${isGroupLast(row) ? '-last' : ''}`;\n\n/** A row's React key: its group and its place in it, so a fold leaves other rows mounted. */\nconst placeOf = (row: Row<unknown> | undefined, index: number) => {\n if (!row) return String(index);\n if (row.type === 'label') return `${row.group}:label`;\n return `${row.group ?? 'loose'}:${row.posInSet}`;\n};\n\n/**\n * A row's key for the virtualizer, which keeps measured heights by it.\n *\n * - Folding one group leaves every other row's height in place.\n * - A row that becomes its group's last is estimated afresh, its element kept.\n */\nconst keyOf = (row: Row<unknown> | undefined, index: number) =>\n `${placeOf(row, index)}${row && isGroupLast(row) ? ':last' : ''}`;\n\n/**\n * Base UI's filtered entries as one row per option or group label, in list order.\n *\n * - A group whose lone item is the create row or Select All stays outside any group, as the fully\n * rendered list draws it.\n * - `aria-setsize` counts the options sharing a parent, as a browser does for a rendered list.\n */\nconst toRows = <Value, GroupShape extends Group<Value>>(\n entries: readonly (Value | GroupShape)[],\n groupToLabel: ((group: GroupShape) => ReactNode) | undefined,\n) => {\n const rows: Row<Value>[] = [];\n const rowOfItem: number[] = [];\n const labels = new Map<string, ReactNode>();\n const push = (item: Value, row: Omit<Row<Value> & ItemRow<Value>, 'type' | 'item' | 'index'>) => {\n rows.push({ type: 'item', item, index: rowOfItem.length, ...row });\n rowOfItem.push(rows.length - 1);\n };\n\n if (!isGroupItems<Value, GroupShape>(entries)) {\n const items = entries.filter((entry): entry is Value => !isGroupItem(entry));\n items.forEach((item, i) =>\n push(item, { padded: false, setSize: items.length, posInSet: i + 1 }),\n );\n return { rows, rowOfItem, labels };\n }\n\n const isLoose = (group: GroupShape) => isLooseItem(group.items[0]);\n const looseCount = entries.filter(isLoose).length;\n let loosePosition = 0;\n\n entries.forEach((entry, groupIndex) => {\n if (isLoose(entry)) {\n for (const item of entry.items) {\n push(item, { padded: false, setSize: looseCount, posInSet: ++loosePosition });\n }\n return;\n }\n\n const group = `group-${groupIndex}`;\n const label = groupToLabel?.(entry);\n if (label) {\n labels.set(group, label);\n rows.push({ type: 'label', group, padded: false });\n }\n entry.items.forEach((item, i) =>\n push(item, {\n group,\n padded: Boolean(label) || i > 0,\n setSize: entry.items.length,\n posInSet: i + 1,\n }),\n );\n });\n\n return { rows, rowOfItem, labels };\n};\n\ntype Props<Value, GroupShape extends Group<Value>> = ListRenderProps<Value, GroupShape> & {\n ref?: Ref<VirtualListHandle>;\n};\n\n/**\n * A combobox list that puts only the rows in view into the DOM.\n *\n * - Lists what Base UI filtered, so search and keyboard navigation cover every option.\n * - A group keeps its `role=\"group\"` wrapper, and its name while its label row is out of view.\n * - Rows keep their own height; a row not yet rendered is estimated from those that were.\n */\nexport const ComboboxVirtualList = <Value, GroupShape extends Group<Value> = Group<Value>>({\n renderItem,\n renderGroupItem,\n groupToLabel,\n ref,\n}: Props<Value, GroupShape>) => {\n // State, not a ref: the list mounts with the popup, and its top padding — which the rows start\n // below — is read once it has.\n const [listElement, attachList] = useElement();\n const scrollMargin = useMemo(\n () => (listElement ? Number.parseFloat(getComputedStyle(listElement).paddingTop) || 0 : 0),\n [listElement],\n );\n const filteredItems = BaseCombobox.useFilteredItems<Value | GroupShape>();\n const { rows, rowOfItem, labels } = useMemo(\n () => toRows<Value, GroupShape>(filteredItems, groupToLabel),\n [filteredItems, groupToLabel],\n );\n\n // The smallest height each kind of row has rendered at; 1rem stands in until one has.\n const sizesRef = useRef<Partial<Record<Kind, number>>>({});\n const [rem] = useState(\n () => Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 0,\n );\n\n const virtualizer = useVirtualizer({\n count: rows.length,\n getItemKey: (index) => keyOf(rows[index], index),\n getScrollElement: () => listElement,\n estimateSize: (index) => {\n const row = rows[index];\n const measured = sizesRef.current;\n const kind = row && kindOf(row);\n const lastKinds = kind?.endsWith('-last')\n ? [measured['plain-last'], measured['padded-last']]\n : [];\n return (\n (kind && measured[kind]) ??\n lastKinds.find((size) => size !== undefined) ??\n measured.plain ??\n measured.padded ??\n rem\n );\n },\n measureElement: (element, entry, instance) => {\n const size = measureElement(element, entry, instance);\n const row = rows[instance.indexFromElement(element)];\n if (row) {\n const kind = kindOf(row);\n sizesRef.current[kind] = Math.min(sizesRef.current[kind] ?? size, size);\n }\n return size;\n },\n // The popup is unbounded until Base UI positions it, and never taller than the window once it\n // is — so the first reading would otherwise mount every row.\n observeElementRect: (instance, callback) =>\n observeElementRect(instance, (rect) =>\n callback({\n ...rect,\n height: Math.min(rect.height, instance.targetWindow?.innerHeight ?? rect.height),\n }),\n ),\n overscan: OVERSCAN,\n scrollMargin,\n });\n\n useImperativeHandle(ref, () => ({\n scrollToItem: (index) => {\n const row = rowOfItem[index];\n if (row !== undefined) virtualizer.scrollToIndex(row, { align: 'auto' });\n },\n }));\n\n // Consecutive rows of one group share its wrapper; a row outside any group stands alone.\n const segments: { group?: string; start: number; items: VirtualItem[] }[] = [];\n for (const virtualItem of virtualizer.getVirtualItems()) {\n const group = rows[virtualItem.index]?.group;\n const last = segments.at(-1);\n if (group !== undefined && last?.group === group) last.items.push(virtualItem);\n else segments.push({ group, start: virtualItem.start, items: [virtualItem] });\n }\n\n const placeAt = (start: number): CSSProperties => ({\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n transform: `translateY(${start - scrollMargin}px)`,\n });\n\n const renderRow = ({ index, start }: VirtualItem) => {\n const row = rows[index];\n if (!row) return null;\n return (\n <div\n key={placeOf(row, index)}\n data-index={index}\n ref={virtualizer.measureElement}\n className={row.padded ? 'tw:pt-0.5' : undefined}\n style={row.group === undefined ? placeAt(start) : undefined}\n // A group's last row, for a host that spaces groups apart inside the measured rows.\n data-group-last={isGroupLast(row) ? '' : undefined}\n >\n {row.type === 'label' ? (\n <ComboboxGroupLabel>{labels.get(row.group ?? '')}</ComboboxGroupLabel>\n ) : (\n <VirtualRowContext\n value={{\n index: row.index,\n 'aria-setsize': row.setSize,\n 'aria-posinset': row.posInSet,\n }}\n >\n {row.group === undefined ? renderItem(row.item) : renderGroupItem(row.item)}\n </VirtualRowContext>\n )}\n </div>\n );\n };\n\n return (\n <ComboboxList ref={attachList}>\n <div\n style={{ position: 'relative', width: '100%', height: `${virtualizer.getTotalSize()}px` }}\n >\n {segments.flatMap(({ group, start, items }) => {\n if (group === undefined) return items.map(renderRow);\n\n const label = labels.get(group);\n const labelInView = items.some((item) => rows[item.index]?.type === 'label');\n return (\n <ComboboxGroup key={group} className=\"tw:gap-0\" style={placeAt(start)}>\n {label && !labelInView && (\n <ComboboxGroupLabel className=\"tw:sr-only\">{label}</ComboboxGroupLabel>\n )}\n {items.map(renderRow)}\n </ComboboxGroup>\n );\n })}\n </div>\n </ComboboxList>\n );\n};\n","import { type ComponentProps, type ReactNode, type Ref, useCallback } from 'react';\n\nimport { Plus } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { ComboboxGroupHeader, GROUP_CHILD_INDENT } from './Group/ComboboxGroupHeader';\nimport { ComboboxEmpty } from './ComboboxEmpty';\nimport { ComboboxFullList } from './ComboboxFullList';\nimport { ComboboxItem } from './ComboboxItem';\nimport { ComboboxLoadingEmpty } from './ComboboxLoadingEmpty';\nimport { ComboboxVirtualList } from './ComboboxVirtualList';\nimport type { GroupHeaders } from './groupHeaders';\nimport type { Group } from './types';\nimport { isCreatableItem, isEntriesGroup, isSelectAllItem } from './utils';\nimport type { VirtualListHandle } from './virtualList';\n\ntype GroupHeaderProps = ComponentProps<typeof ComboboxGroupHeader>;\n\n/** A group's items fade and slide in as it unfolds and out as it folds; nothing under reduced motion. */\nconst ITEM_MOTION = {\n entering:\n 'tw:motion-safe:animate-in tw:motion-safe:fade-in-0 tw:motion-safe:slide-in-from-top-1 tw:motion-safe:duration-150 tw:motion-safe:ease-out',\n leaving:\n 'tw:motion-safe:animate-out tw:motion-safe:fade-out-0 tw:motion-safe:slide-out-to-top-1 tw:motion-safe:duration-100 tw:motion-safe:ease-in tw:motion-safe:fill-mode-forwards',\n} as const;\n\ntype Props<Value, GroupShape extends Group<Value>> = {\n isLoading: boolean;\n empty: ReactNode;\n /** Windows the list; `listRef` then reaches the windowed list. */\n virtualized: boolean;\n listRef: Ref<VirtualListHandle>;\n groupHeaders: GroupHeaders<Value, GroupShape>;\n groupToLabel: (group: GroupShape) => ReactNode;\n indicator?: GroupHeaderProps['indicator'];\n itemToLabel: (item: Value) => ReactNode;\n itemToIcon: (item: Value) => ReactNode;\n itemToDisabled: (item: Value) => boolean;\n /** A selected item the user can't remove: looks disabled, still highlights. */\n itemToLocked?: (item: Value) => boolean;\n /** The create row's text; receives the row's value. */\n createLabel: (value: string) => ReactNode;\n /** A selectable group row's mark and state; left unset, a group row only folds. */\n groupRowState?: (\n row: Value,\n ) => Required<Pick<GroupHeaderProps, 'checked' | 'disabled'>> & Pick<GroupHeaderProps, 'locked'>;\n};\n\n/**\n * What a combobox popup lists: every row, the empty slot, and the loading text in it.\n *\n * - The list is windowed while `virtualized`, fully rendered otherwise.\n */\nexport const ComboboxOptions = <Value, GroupShape extends Group<Value> = Group<Value>>({\n isLoading,\n empty,\n virtualized,\n listRef,\n groupHeaders,\n groupToLabel,\n indicator,\n itemToLabel,\n itemToIcon,\n itemToDisabled,\n itemToLocked,\n createLabel,\n groupRowState,\n}: Props<Value, GroupShape>) => {\n const renderItem = (item: Value, className?: string) => {\n if (isSelectAllItem(item)) {\n return (\n <ComboboxItem value={item} indicator=\"checkbox\">\n {item.label}\n </ComboboxItem>\n );\n }\n if (isCreatableItem(item)) {\n return (\n <ComboboxItem value={item} icon={<Plus />}>\n {createLabel(item.value)}\n </ComboboxItem>\n );\n }\n\n return (\n <ComboboxItem\n value={item}\n indicator={indicator}\n icon={itemToIcon(item)}\n disabled={itemToDisabled(item)}\n locked={itemToLocked?.(item)}\n className={className}\n >\n {itemToLabel(item)}\n </ComboboxItem>\n );\n };\n\n const renderGroupItem = (item: Value) => {\n const header = groupHeaders.headerOf(item);\n if (!header) {\n const motion = groupHeaders.motionOf(item);\n return renderItem(\n item,\n cn(groupHeaders.collapsible && GROUP_CHILD_INDENT, motion && ITEM_MOTION[motion]),\n );\n }\n\n const state = groupRowState?.(item);\n return (\n <ComboboxGroupHeader\n value={item}\n expanded={groupHeaders.collapsible ? !header.collapsed : undefined}\n onToggle={(all, from) =>\n all\n ? groupHeaders.setAllCollapsed(!header.collapsed, from)\n : groupHeaders.toggle(header.index, from)\n }\n checked={state?.checked}\n indicator={indicator}\n disabled={state?.disabled ?? false}\n locked={state?.locked}\n >\n {groupToLabel(header.group)}\n </ComboboxGroupHeader>\n );\n };\n\n // Skips the group `toEntries` made; stable, since the windowed list memoizes its rows on it.\n const labelOfGroup = useCallback(\n (group: GroupShape) => (isEntriesGroup(group) ? undefined : groupToLabel(group)),\n [groupToLabel],\n );\n\n const listProps = {\n renderItem,\n renderGroupItem,\n groupToLabel: groupHeaders.enabled ? undefined : labelOfGroup,\n };\n\n return (\n <>\n <ComboboxEmpty>{isLoading ? <ComboboxLoadingEmpty /> : empty}</ComboboxEmpty>\n {virtualized ? (\n <ComboboxVirtualList<Value, GroupShape> ref={listRef} {...listProps} />\n ) : (\n <ComboboxFullList<Value, GroupShape> {...listProps} />\n )}\n </>\n );\n};\n","import { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nexport const ComboboxRoot = <Value, Multiple extends boolean | undefined = false>(\n props: BaseCombobox.Root.Props<Value, Multiple>,\n) => <BaseCombobox.Root {...props} />;\n","import type { ComponentProps } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\n\ntype Props = Omit<ComponentProps<typeof BaseCombobox.Separator>, 'className'> & {\n className?: string;\n};\n\nexport const ComboboxSeparator = ({ ref, className, ...props }: Props) => (\n <BaseCombobox.Separator\n ref={ref}\n className={cn('tw:mx-2 tw:my-1 tw:h-px tw:bg-border', className)}\n {...props}\n />\n);\n","import { useMemo } from 'react';\n\nimport { toEntries } from './utils';\n\n/**\n * `list` followed by the values `allowCreate` minted, as entries of it; stable while both are.\n *\n * - Listed so a created value stays pickable: Base UI drops a value missing from `items`.\n */\nexport const useWithCreated = <Entry, Value>(list: readonly Entry[], created: readonly Value[]) =>\n useMemo(\n () => (created.length === 0 ? list : [...list, ...toEntries(list, created)]),\n [list, created],\n );\n","import { useLayoutEffect, useRef } from 'react';\n\n/** How long the groups under a fold take to slide to their new place. */\nconst SLIDE_MS = 150;\n/** A capture no commit moved anything for in this long is dropped. */\nconst STALE_MS = 500;\n\ntype Capture = { list: Element; tops: Map<Element, number>; at: number };\n\nconst listOf = (from: Element) =>\n from.closest('[role=listbox]') ??\n from.ownerDocument.getElementById(from.getAttribute('aria-controls') ?? '');\n\nconst topIn = (list: Element, element: Element) =>\n element.getBoundingClientRect().top - list.getBoundingClientRect().top + list.scrollTop;\n\n/**\n * Slides a list's groups from where they sat before a fold to where it puts them.\n *\n * - `capture` records each group's place; the next commit that moves one plays the slide.\n * - A group the windowed list only now renders slides by the move of the group above it.\n * - The caller skips `capture` under reduced motion; nothing plays without Web Animations.\n */\nexport const useGroupFlip = (enabled: boolean) => {\n const captureRef = useRef<Capture | null>(null);\n const slidesRef = useRef(new WeakMap<Element, { animation: Animation; shift: number }>());\n\n // Where a group sits without the slide it is still playing.\n const settledTop = (list: Element, group: Element) => {\n const slide = slidesRef.current.get(group);\n const progress = slide?.animation.effect?.getComputedTiming().progress;\n const offset = slide && typeof progress === 'number' ? slide.shift * (1 - progress) : 0;\n return topIn(list, group) - offset;\n };\n\n useLayoutEffect(() => {\n const capture = captureRef.current;\n if (!capture) return;\n if (performance.now() - capture.at > STALE_MS) {\n captureRef.current = null;\n return;\n }\n\n const groups = [...capture.list.querySelectorAll('[role=group]')];\n let lastShift = 0;\n const shifts = groups.map((group) => {\n const before = capture.tops.get(group);\n const shift = before === undefined ? lastShift : before - settledTop(capture.list, group);\n lastShift = shift;\n return shift;\n });\n if (shifts.every((shift) => Math.abs(shift) < 0.5)) return;\n\n captureRef.current = null;\n groups.forEach((group, index) => {\n const shift = shifts[index] ?? 0;\n slidesRef.current.get(group)?.animation.cancel();\n if (Math.abs(shift) < 0.5) return;\n const animation = group.animate(\n [{ transform: `translateY(${shift}px)` }, { transform: 'translateY(0)' }],\n { duration: SLIDE_MS, easing: 'ease-out', composite: 'add' },\n );\n slidesRef.current.set(group, { animation, shift });\n });\n });\n\n return {\n /** Records where the groups of the list `from` belongs to sit now. */\n capture: (from: Element | null | undefined) => {\n const list = from && listOf(from);\n if (!enabled || !list || typeof list.animate !== 'function') return;\n const tops = new Map<Element, number>();\n for (const group of list.querySelectorAll('[role=group]')) {\n tops.set(group, topIn(list, group));\n }\n captureRef.current = { list, tops, at: performance.now() };\n },\n };\n};\n","import { type KeyboardEvent, useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport type { BaseUIEvent } from '@base-ui/react/types';\n\nimport { useGroupFlip } from './groupFlip';\nimport type { Group } from './types';\nimport { createGroupHeaderItem, isGroupItems } from './utils';\n\ntype Header<Value, GroupShape extends Group<Value>> = {\n group: GroupShape;\n index: number;\n /** Whether the group hides its items — never while a query is active. */\n collapsed: boolean;\n /** Items matching the query — all of them without a query. */\n matching: readonly Value[];\n};\n\n/** How long a folding group's items fade out before they leave the list. */\nconst FOLD_MS = 100;\n/** How long an unfolding group's items animate in; their marker clears after it. */\nconst ENTER_MS = 150;\n\nconst NO_FOLDS: ReadonlySet<number> = new Set();\n\nconst hasMotion = () =>\n typeof window.matchMedia === 'function' &&\n !window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\ntype Options<Value, GroupShape extends Group<Value>> = {\n items: readonly (Value | GroupShape)[];\n collapsible: boolean;\n selectable: boolean;\n query: string;\n /** Only called while there is a query. */\n matches: (item: Value) => boolean;\n /** The value a group's row stands for (`Combobox`); unset, the row is a sentinel. */\n groupToValue?: (group: GroupShape) => Value;\n /** Also tells the sentinel rows apart. */\n isItemEqualToValue: (a: Value, b: Value) => boolean;\n /** Read each time the popup opens: a group it accepts starts folded. */\n startsCollapsed?: (group: GroupShape) => boolean;\n /** The popup mounts open, so `startsCollapsed` applies from the first render. */\n startsOpen?: boolean;\n};\n\n/**\n * Gives each group a row (rendered with `ComboboxGroupHeader`) and collapses groups on request.\n *\n * - The row is the group's first item, so Base UI navigates, filters and presses it.\n * - A collapsed group hands Base UI only its row: Base UI never filters an empty query.\n * - A query opens every group with a match; a fold made under it lasts until the query changes.\n * - A row shows only while its group matches.\n * - Collapse state is keyed by a group's position in `items`.\n */\nexport const useGroupHeaders = <Value, GroupShape extends Group<Value>>({\n items,\n collapsible,\n selectable,\n query,\n matches,\n groupToValue,\n isItemEqualToValue,\n startsCollapsed,\n startsOpen = false,\n}: Options<Value, GroupShape>) => {\n const [collapsedIndexes, setCollapsedIndexes] = useState<ReadonlySet<number>>(() =>\n startsOpen && collapsible && startsCollapsed && isGroupItems<Value, GroupShape>(items)\n ? new Set(items.flatMap((group, index) => (startsCollapsed(group) ? [index] : [])))\n : new Set(),\n );\n const [searchFolds, setSearchFolds] = useState<{ query: string; indexes: ReadonlySet<number> }>({\n query: '',\n indexes: new Set(),\n });\n /** The folds that apply now: those made without a query, or under this very query. */\n const folded: ReadonlySet<number> =\n query === '' ? collapsedIndexes : searchFolds.query === query ? searchFolds.indexes : NO_FOLDS;\n // The query on screen, for a fold that lands after it may have changed.\n const queryRef = useRef(query);\n useLayoutEffect(() => {\n queryRef.current = query;\n }, [query]);\n const highlightedRef = useRef<unknown>(undefined);\n /** The groups animating, and the query their fold belongs to. */\n const [motion, setMotion] = useState<{\n indexes: ReadonlySet<number>;\n folding: boolean;\n scope: string;\n } | null>(null);\n const foldTimerRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n useEffect(() => () => clearTimeout(foldTimerRef.current), []);\n const flip = useGroupFlip(collapsible);\n\n const enabled = (collapsible || selectable) && isGroupItems<Value, GroupShape>(items);\n const headers = new Map<unknown, Header<Value, GroupShape>>();\n\n const listItems = !enabled\n ? items\n : items.map((group, index) => {\n const collapsed = collapsible && folded.has(index);\n const matching = query === '' ? group.items : group.items.filter(matches);\n const row = groupToValue ? groupToValue(group) : createGroupHeaderItem(index);\n headers.set(row, { group, index, collapsed, matching });\n\n return { ...group, items: collapsed ? [row] : [row, ...group.items] };\n });\n\n /**\n * Folds or unfolds groups under `scope`, the query the toggle was made under.\n *\n * - A fold made without a query always lands.\n * - A fold made under a query the input no longer holds is dropped: it would never show.\n */\n const setCollapsed = (indexes: Iterable<number>, collapsed: boolean, scope = query) => {\n const apply = (prev: ReadonlySet<number>) => {\n const next = new Set(prev);\n for (const index of indexes) {\n if (collapsed) next.add(index);\n else next.delete(index);\n }\n return next.size === prev.size && [...next].every((index) => prev.has(index)) ? prev : next;\n };\n if (scope === '') setCollapsedIndexes(apply);\n else if (scope === queryRef.current) {\n setSearchFolds((prev) => {\n const base = prev.query === scope ? prev.indexes : NO_FOLDS;\n const next = apply(base);\n return next === base && prev.query === scope ? prev : { query: scope, indexes: next };\n });\n }\n };\n\n const endMotionAfter = (ms: number, then?: () => void) => {\n clearTimeout(foldTimerRef.current);\n foldTimerRef.current = setTimeout(() => {\n then?.();\n setMotion(null);\n }, ms);\n };\n\n const folding: ReadonlySet<number> = motion?.folding ? motion.indexes : new Set();\n /** A group still fading out counts as folded. */\n const isCollapsed = (index: number) => folded.has(index) || folding.has(index);\n\n /**\n * Unfolds groups with their items animating in, or fades them out, then folds them.\n *\n * - The groups under them slide to their new place.\n * - Folds still fading out finish at once, except those this call unfolds again.\n */\n const animate = (indexes: readonly number[], collapse: boolean, from?: Element | null) => {\n clearTimeout(foldTimerRef.current);\n const animated = hasMotion();\n const finishing = [...folding].filter((index) => collapse || !indexes.includes(index));\n const changing = indexes.filter((index) => isCollapsed(index) !== collapse);\n // Only a layout about to change is worth sliding from.\n if (animated && (finishing.length > 0 || changing.length > 0)) flip.capture(from);\n if (motion) setCollapsed(finishing, true, motion.scope);\n if (!animated || changing.length === 0) {\n setCollapsed(changing, collapse);\n setMotion(null);\n return;\n }\n const scope = query;\n setMotion({ indexes: new Set(changing), folding: collapse, scope });\n if (collapse) endMotionAfter(FOLD_MS, () => setCollapsed(changing, true, scope));\n else {\n setCollapsed(changing, false);\n endMotionAfter(ENTER_MS);\n }\n };\n\n /** Unfolds a folded group, folds an open one. */\n const toggle = (index: number, from?: Element | null) =>\n animate([index], !isCollapsed(index), from);\n\n /** Folds or unfolds every group. */\n const setAllCollapsed = (collapse: boolean, from?: Element | null) => {\n if (!isGroupItems<Value, GroupShape>(items)) return;\n animate(\n items.map((_, index) => index),\n collapse,\n from,\n );\n };\n\n const groupIndexOf = new Map<unknown, number>();\n if (motion && enabled && isGroupItems<Value, GroupShape>(items)) {\n for (const index of motion.indexes) {\n for (const item of items[index]?.items ?? []) groupIndexOf.set(item, index);\n }\n }\n\n const headerOf = (item: unknown) => headers.get(item);\n\n // Rows are rebuilt every render, so fall back to equality for the highlighted row.\n const highlightedHeader = () => {\n const item = highlightedRef.current;\n if (item === undefined) return undefined;\n const header = headers.get(item);\n if (header) return header;\n for (const [row, entry] of headers) {\n if (isItemEqualToValue(row as Value, item as Value)) return entry;\n }\n return undefined;\n };\n\n return {\n enabled,\n /** `items` with group rows added and collapsed groups' items removed. */\n items: listItems,\n collapsible,\n headerOf,\n toggle,\n setAllCollapsed,\n /** `entering` / `leaving` for an item of the group that last unfolded / is folding. */\n motionOf: (item: unknown) => {\n if (!motion || !groupIndexOf.has(item)) return undefined;\n return motion.folding ? 'leaving' : 'entering';\n },\n /** `filter` verdict for a group row (matches while its group does); `undefined` otherwise. */\n filterHeader: (item: unknown) => {\n const header = headerOf(item);\n return header ? header.matching.length > 0 : undefined;\n },\n /** For the root's `onItemHighlighted`: which row the keyboard would toggle. */\n onItemHighlighted: (item: unknown) => {\n highlightedRef.current = item;\n },\n /** For the root's `onOpenChange`: clears the highlight on close, folds `startsCollapsed` on open. */\n onOpenChange: (open: boolean) => {\n if (!open) highlightedRef.current = undefined;\n clearTimeout(foldTimerRef.current);\n if (motion?.folding) setCollapsed(motion.indexes, true, motion.scope);\n setMotion(null);\n if (open && collapsible && startsCollapsed && isGroupItems<Value, GroupShape>(items)) {\n setCollapsedIndexes(\n new Set(items.flatMap((group, index) => (startsCollapsed(group) ? [index] : []))),\n );\n }\n },\n /**\n * For the input's `onKeyDown`: `ArrowRight` / `ArrowLeft` expand / collapse the highlighted row.\n * Only without a query; also stops Base UI moving to the chips.\n */\n onInputKeyDown: (event: BaseUIEvent<KeyboardEvent<HTMLInputElement>>) => {\n if (!collapsible || query !== '') return;\n if (event.key !== 'ArrowRight' && event.key !== 'ArrowLeft') return;\n const header = highlightedHeader();\n if (!header) return;\n\n event.preventDefault();\n event.preventBaseUIHandler();\n if (isCollapsed(header.index) === (event.key === 'ArrowRight')) {\n toggle(header.index, event.currentTarget);\n }\n },\n };\n};\n\nexport type GroupHeaders<Value, GroupShape extends Group<Value>> = ReturnType<\n typeof useGroupHeaders<Value, GroupShape>\n>;\n","import { useEffect } from 'react';\n\nimport { useStableCallback } from '../../hooks/useStableCallback';\nimport { noop } from '../../utils';\n\n/**\n * The text a combobox's input takes, with `inputValueSanitizer` applied to what the user typed.\n *\n * - `input-change` is the only reason carrying typed text. Every other one carries text the\n * control itself put there — an item's label, or the empty string a clear leaves — which a\n * sanitizer aimed at typed characters would mangle.\n * - A sanitizer sees the whole text on every keystroke, so it has to rewrite rather than drop:\n * one calling `trim()` swallows the space before the next word.\n */\nexport const sanitizeTypedInput = (\n next: string,\n reason: string,\n sanitizer: ((input: string) => string) | undefined,\n) => (reason === 'input-change' ? (sanitizer?.(next) ?? next) : next);\n\n/**\n * Reports the query the list filters by to the control's owner.\n *\n * - Fires from an effect rather than the input handler because `query` is derived: in `Combobox`\n * a selection showing its own label empties it without a keystroke, so the handler never sees\n * every value it takes.\n * - The mount render reports too, so an owner fetching on the query needs no first fetch of its\n * own.\n */\nexport const useQueryReporter = (query: string, onQueryChange?: (query: string) => void) => {\n const report = useStableCallback(onQueryChange ?? noop);\n\n useEffect(() => {\n report(query);\n }, [query, report]);\n};\n","import { type ComponentProps, type ReactNode, useCallback, useMemo, useState } from 'react';\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox';\n\nimport { cn } from '../../utils';\nimport { forwardAccessibleName, type WithAccessibleName } from '../../utils/accessibleName';\nimport { InputGroup } from '../InputGroup';\n\nimport { ComboboxChip } from './ComboboxChip';\nimport { ComboboxChips } from './ComboboxChips';\nimport { ComboboxClearButton } from './ComboboxClearButton';\nimport { ComboboxContent } from './ComboboxContent';\nimport { ComboboxEmpty } from './ComboboxEmpty';\nimport { ComboboxInput } from './ComboboxInput';\nimport { ComboboxInputGroup } from './ComboboxInputGroup';\nimport { ComboboxItem } from './ComboboxItem';\nimport { ComboboxList } from './ComboboxList';\nimport { ComboboxOpenButton } from './ComboboxOpenButton';\nimport { ComboboxOptions } from './ComboboxOptions';\nimport { ComboboxRoot } from './ComboboxRoot';\nimport { ComboboxSeparator } from './ComboboxSeparator';\nimport { useWithCreated } from './createdItems';\nimport { ComboboxCollection, ComboboxGroup, ComboboxGroupLabel } from './Group';\nimport { useGroupHeaders } from './groupHeaders';\nimport { useQueryReporter } from './query';\nimport type { Group } from './types';\nimport {\n createCreatableItem,\n defaultGroupToLabel,\n defaultItemToDisabled,\n defaultItemToIcon,\n defaultQueryToCreateLabel,\n defaultRowLabel,\n defaultToCreateValue,\n flatItems,\n isCreatableItem,\n isGroupHeaderItem,\n toEntries,\n toLabel,\n useCreatableStringValue,\n useItemEquality,\n} from './utils';\nimport { useVirtualList, type VirtualizedProps } from './virtualList';\n\ntype ComboboxProps<Value> = BaseCombobox.Root.Props<Value, false>;\ntype ComboboxInputProps = ComponentProps<typeof ComboboxInput>;\ntype ComboboxInputGroupProps = ComponentProps<typeof ComboboxInputGroup>;\ntype ComboboxItemProps = ComponentProps<typeof ComboboxItem>;\n\ntype Indicator = Exclude<NonNullable<ComboboxItemProps['indicator']>, 'none'>;\n\n// Go to the input, which is the `combobox` role; on the group they reach nothing.\n// - The `aria-*` set links a form field's label, help and error text.\n// - `onBlur` is the gate `FieldItem` reveals errors on.\ntype PublicComboboxInputProps = Pick<\n ComboboxInputProps,\n | 'placeholder'\n | 'id'\n | 'name'\n | 'onBlur'\n | 'aria-label'\n | 'aria-labelledby'\n | 'aria-describedby'\n | 'aria-invalid'\n | 'aria-required'\n> &\n Pick<ComboboxInputGroupProps, 'focusVariant' | 'state' | 'className'>;\n\ntype PublicComboboxProps<Value> = Pick<\n ComboboxProps<Value>,\n | 'disabled'\n | 'inputRef'\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'itemToStringLabel'\n | 'itemToStringValue'\n | 'filter'\n | 'onOpenChangeComplete'\n | 'isItemEqualToValue'\n>;\n\ntype CreatableProps<Value> = {\n allowCreate?: boolean;\n queryToCreateLabel?: (query: string) => ReactNode;\n queryToCreateValue?: (query: string) => Value;\n /**\n * Gate on the typed query for `allowCreate`; `false` hides the create row.\n * - Called only for a non-empty query that matches no existing item.\n */\n canCreate?: (query: string) => boolean;\n};\n\ntype BaseProps<Value, GroupShape extends Group<Value> = Group<Value>> = PublicComboboxInputProps &\n PublicComboboxProps<Value> &\n CreatableProps<Value> &\n VirtualizedProps & {\n /** Read as immutable: pass a new array to change it; one mutated in place is not re-filtered. */\n items?: readonly (Value | GroupShape)[];\n\n /** `false` where clearing must be unreachable, e.g. a required field. */\n allowClear?: boolean;\n empty?: ReactNode;\n /**\n * The options are still arriving — a request for `items` is in flight.\n *\n * - Does not disable the control; pass `disabled` too where the user has to wait.\n */\n isLoading?: boolean;\n indicator?: Indicator;\n prefix?: ReactNode;\n\n /**\n * Rewrites typed text (not the selected label); filter and `allowCreate` see the result.\n * - Rewrite, don't drop: it sees the whole text per keystroke, so `trim()` eats word spaces.\n */\n inputValueSanitizer?: (input: string) => string;\n /**\n * Reports the sanitized query, also on mount; empty while the input shows the selection.\n * - Notification only: the control owns the input text; there is no controlled `inputValue`.\n */\n onQueryChange?: (query: string) => void;\n\n /** Row content, `itemToStringLabel` by default; pass `query` to `MarkedText` to mark a match. */\n itemToLabel?: (item: Value, query: string) => ReactNode;\n itemToIcon?: (item: Value) => ReactNode;\n itemToDisabled?: (item: Value) => boolean;\n /**\n * Selection node drawn over the transparent input while closed; typing dissolves it. Clipped.\n * - Decoration: the input keeps `itemToStringLabel` text for screen readers, unlike `prefix`.\n */\n itemToSelectedLabel?: (item: Value) => ReactNode;\n\n /** Defaults to the group's `label`, as `Select` shows it. */\n groupToLabel?: (group: GroupShape) => ReactNode;\n /**\n * Each group gets a toggle row; with `groupToValue`, only the chevron and ←/→ keys toggle it.\n * - A query shows all matches regardless of collapse and hides groups without one.\n */\n collapsibleGroups?: boolean;\n /**\n * Makes each group's row selectable as the returned value.\n * - `itemToStringLabel`, `itemToSelectedLabel` and `itemToDisabled` then receive it too.\n */\n groupToValue?: (group: GroupShape) => Value;\n };\n\ntype Props<Value, GroupShape extends Group<Value> = Group<Value>> = WithAccessibleName<\n BaseProps<Value, GroupShape>\n>;\n\nconst acceptAll = () => true;\nconst NO_ITEMS: readonly never[] = [];\n\nexport const Combobox = <Value, GroupShape extends Group<Value> = Group<Value>>({\n items: _itemsProp,\n value,\n defaultValue,\n onValueChange,\n itemToStringLabel: itemToStringLabelProp,\n itemToStringValue,\n disabled,\n filter,\n inputRef,\n onOpenChangeComplete,\n isItemEqualToValue: isItemEqualToValueProp,\n\n focusVariant,\n state,\n placeholder,\n allowClear = true,\n name,\n onBlur,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n 'aria-required': ariaRequired,\n className,\n\n empty = 'No items',\n isLoading = false,\n indicator,\n prefix,\n virtualized = false,\n\n inputValueSanitizer,\n onQueryChange,\n\n allowCreate,\n queryToCreateValue,\n queryToCreateLabel = defaultQueryToCreateLabel,\n canCreate,\n\n itemToDisabled = defaultItemToDisabled,\n itemToLabel: itemToLabelProp,\n itemToIcon = defaultItemToIcon,\n itemToSelectedLabel,\n groupToLabel = defaultGroupToLabel,\n collapsibleGroups = false,\n groupToValue,\n ...accessibleName\n}: Props<Value, GroupShape>) => {\n /** An item's string identity: input text, default search subject, accessible value. */\n const labelOf = useCallback(\n (item: Value) => itemToStringLabelProp?.(item) ?? toLabel(item),\n [itemToStringLabelProp],\n );\n const itemToLabel = itemToLabelProp ?? defaultRowLabel(itemToStringLabelProp);\n\n // What the user typed, or `null` while the control shows its selection.\n // - Input text and query both derive from it.\n // - Reset on close here: Base UI's sync-back skips text already equal to the label.\n const [typedText, setTypedText] = useState<string | null>(null);\n\n // The held item, controlled or not; mirrored from Base UI while uncontrolled.\n // - `null` is both \"nothing selected\" and the adder shape's pinned value.\n // - Read here, not via `BaseCombobox.Value`: the query gate and two classNames need it.\n const [uncontrolledValue, setUncontrolledValue] = useState<Value | null>(defaultValue ?? null);\n const selectedItem = value !== undefined ? value : uncontrolledValue;\n\n const selectedLabel = selectedItem == null ? null : labelOf(selectedItem);\n\n // Whether the on-screen text is the selection rather than a query.\n // - Compares with the label, not `null`: a query edited back to the label reads the same.\n const isShowingSelection =\n selectedLabel !== null && (typedText === null || typedText === selectedLabel);\n\n // The query, else the selection's label, which is what a screen reader reports.\n const inputValue = typedText ?? selectedLabel ?? '';\n // Shown only while the input's text is still the selection's label.\n const selectedNode =\n itemToSelectedLabel && selectedItem != null && isShowingSelection\n ? itemToSelectedLabel(selectedItem)\n : null;\n const query = (isShowingSelection ? '' : (typedText ?? '')).trim();\n const queryLower = query.toLowerCase();\n\n useQueryReporter(query, onQueryChange);\n\n // `aria-busy` for the input alone, absent rather than `false` while nothing is loading.\n //\n // - Not on the list: assistive tech may hold back a busy subtree, and the items already listed\n // stay pickable while loading. The empty slot's live region announces \"Loading…\" instead.\n const busy = isLoading || undefined;\n\n const itemsProp = _itemsProp ?? NO_ITEMS;\n const sampleItem = flatItems(itemsProp)[0];\n\n const isItemEqualToValue = useItemEquality(isItemEqualToValueProp);\n\n // The one value `allowCreate` minted, listed while it is the selection and `items` lacks it.\n // - An adder pinned to `null` lists none; `items` is scanned only when it or the value changes.\n const [createdItems, setCreatedItems] = useState<Value[]>([]);\n const [createdItem] = createdItems;\n const itemsHoldCreated = useMemo(\n () =>\n createdItem !== undefined &&\n flatItems(itemsProp).some((listed) => isItemEqualToValue(listed, createdItem)),\n [createdItem, itemsProp, isItemEqualToValue],\n );\n const created =\n createdItem !== undefined &&\n !itemsHoldCreated &&\n selectedItem != null &&\n isItemEqualToValue(createdItem, selectedItem)\n ? createdItems\n : NO_ITEMS;\n\n // Stable while the caller's accessor is: Base UI re-filters on every new identity.\n const itemToStringLabel = useCallback<NonNullable<ComboboxProps<Value>['itemToStringLabel']>>(\n (value) => {\n if (isCreatableItem(value)) return value.value;\n if (isGroupHeaderItem(value)) return value.label;\n return labelOf(value);\n },\n [labelOf],\n );\n\n const { contains } = BaseCombobox.useFilter();\n const itemFilter = filter ?? contains;\n const groupHeaders = useGroupHeaders<Value, GroupShape>({\n items: itemsProp,\n collapsible: collapsibleGroups,\n selectable: groupToValue !== undefined,\n query,\n matches: (item) => itemFilter(item, query, itemToStringLabel),\n groupToValue,\n isItemEqualToValue,\n });\n\n const allItems = useWithCreated(itemsProp, created);\n // What the list shows: `allItems` with each group's own row, once `groupHeaders` adds them.\n const listItems = useWithCreated(groupHeaders.items, created);\n\n const showCreateRow = (() => {\n if (!allowCreate || disabled || !query) return false;\n const exactMatch = flatItems(allItems).some(\n (item) => labelOf(item).toLowerCase() === queryLower,\n );\n return !exactMatch && (!canCreate || canCreate(query));\n })();\n\n const items = useMemo(\n () =>\n showCreateRow\n ? [...listItems, ...toEntries(listItems, [createCreatableItem(query)])]\n : listItems,\n [showCreateRow, listItems, query],\n );\n\n // Behind a selection the whole list stays browsable instead of narrowing to that item.\n // - Base UI's `shouldBypassFiltering` covers only a fresh open, not text edited back to the label.\n // - Creatable and group rows bypass the caller's `filter`; a group row matches while a child does.\n const filterHeader = groupHeaders.enabled ? groupHeaders.filterHeader : undefined;\n const queryFilter = useMemo<ComboboxProps<Value>['filter']>(() => {\n if (filterHeader) {\n return (item, query, itemToString) =>\n filterHeader(item) ?? (isCreatableItem(item) || itemFilter(item, query, itemToString));\n }\n if (!allowCreate || !filter) return filter;\n return (item, query, itemToString) =>\n isCreatableItem(item) || filter(item, query, itemToString);\n }, [filterHeader, allowCreate, filter, itemFilter]);\n const wrappedFilter = isShowingSelection ? acceptAll : queryFilter;\n\n const wrappedItemToStringValue = useCreatableStringValue(itemToStringValue, allowCreate);\n\n // Only user typing becomes `typedText` and passes through `inputValueSanitizer`.\n // - Every other reason (item press, clear, unmount sync-back) means \"show the selection\".\n // - The sync-back is never adopted: for a created item it stringifies the internal sentinel.\n const handleInputValueChange: NonNullable<ComboboxProps<Value>['onInputValueChange']> = (\n next,\n { reason },\n ) => {\n if (reason !== 'input-change') {\n setTypedText(null);\n return;\n }\n\n const typed = inputValueSanitizer?.(next) ?? next;\n // Whitespace-only text is dropped: Base UI won't open on it, so no close would discard it.\n // An empty input clears the selection, so it is adopted.\n setTypedText(typed === '' || typed.trim() !== '' ? typed : null);\n };\n\n // Discard the query as the popup starts closing, not after its transition.\n const handleOpenChange: NonNullable<ComboboxProps<Value>['onOpenChange']> = (open) => {\n if (!open) setTypedText(null);\n groupHeaders.onOpenChange(open);\n };\n\n const handleOnValueChange: ComboboxProps<Value>['onValueChange'] = (next, event) => {\n if (isCreatableItem(next)) {\n const newValue = defaultToCreateValue(next.value, sampleItem, queryToCreateValue) as Value;\n setCreatedItems([newValue]);\n setUncontrolledValue(newValue);\n onValueChange?.(newValue, event);\n return;\n }\n\n setUncontrolledValue(next);\n onValueChange?.(next, event);\n };\n\n // Decided on the real options rather than `items`, whose transient create row would switch\n // windowing on and off as the user types.\n const virtualList = useVirtualList(allItems, virtualized);\n\n const comboboxInput = (\n <ComboboxInput\n {...forwardAccessibleName(accessibleName)}\n name={name}\n onBlur={onBlur}\n aria-describedby={ariaDescribedBy}\n aria-invalid={ariaInvalid}\n aria-required={ariaRequired}\n aria-busy={busy}\n placeholder={placeholder}\n disabled={disabled}\n onKeyDown={groupHeaders.onInputKeyDown}\n // Text stays for screen readers and the caret; `selectedNode` is drawn over it.\n className={cn(\n selectedNode != null &&\n 'tw:text-transparent tw:caret-foreground tw:selection:bg-transparent',\n )}\n />\n );\n\n return (\n <BaseCombobox.Root<Value, false>\n items={items}\n // Otherwise Enter after typing drops the query; this commits the first match or create row.\n autoHighlight\n value={value}\n defaultValue={defaultValue}\n filter={wrappedFilter}\n onValueChange={handleOnValueChange}\n itemToStringLabel={itemToStringLabel}\n isItemEqualToValue={isItemEqualToValue}\n itemToStringValue={wrappedItemToStringValue}\n onOpenChange={handleOpenChange}\n onOpenChangeComplete={onOpenChangeComplete}\n disabled={disabled}\n inputRef={inputRef}\n inputValue={inputValue}\n onInputValueChange={handleInputValueChange}\n virtualized={virtualList.enabled}\n onItemHighlighted={(item, details) => {\n groupHeaders.onItemHighlighted(item);\n virtualList.onItemHighlighted(details);\n }}\n >\n <ComboboxInputGroup state={state} focusVariant={focusVariant} className={className}>\n {itemToSelectedLabel != null ? (\n // The addon overlays the input inside a `relative` wrapper; its `pl-4` and the input's\n // `px-4` share one origin.\n // - Branch on the prop, not `selectedNode`: swapping trees mid-typing drops input focus.\n <div className=\"tw:relative tw:flex tw:min-w-0 tw:flex-1\">\n {(prefix != null || selectedNode != null) && (\n <InputGroup.Addon\n align=\"inline-start\"\n className={cn(\n selectedNode != null &&\n 'tw:pointer-events-none tw:absolute tw:inset-y-0 tw:left-0 tw:max-w-full tw:overflow-hidden',\n )}\n >\n {prefix}\n {selectedNode}\n </InputGroup.Addon>\n )}\n {comboboxInput}\n </div>\n ) : (\n <>\n {prefix != null && <InputGroup.Addon align=\"inline-start\">{prefix}</InputGroup.Addon>}\n {comboboxInput}\n </>\n )}\n <InputGroup.Addon align=\"inline-end\">\n {allowClear && <ComboboxClearButton disabled={disabled} />}\n <ComboboxOpenButton disabled={disabled} isLoading={isLoading} />\n </InputGroup.Addon>\n </ComboboxInputGroup>\n <ComboboxContent>\n <ComboboxOptions<Value, GroupShape>\n isLoading={isLoading}\n empty={empty}\n virtualized={virtualList.enabled}\n listRef={virtualList.ref}\n groupHeaders={groupHeaders}\n groupToLabel={groupToLabel}\n indicator={indicator}\n itemToLabel={(item) => itemToLabel(item, query)}\n itemToIcon={itemToIcon}\n itemToDisabled={itemToDisabled}\n createLabel={queryToCreateLabel}\n groupRowState={\n groupToValue\n ? (row) => ({\n checked: selectedItem != null && isItemEqualToValue(row, selectedItem),\n disabled: itemToDisabled(row),\n })\n : undefined\n }\n />\n </ComboboxContent>\n </BaseCombobox.Root>\n );\n};\n\nCombobox.Root = ComboboxRoot;\nCombobox.InputGroup = ComboboxInputGroup;\nCombobox.Input = ComboboxInput;\nCombobox.Content = ComboboxContent;\nCombobox.List = ComboboxList;\nCombobox.Item = ComboboxItem;\nCombobox.Empty = ComboboxEmpty;\nCombobox.Value = BaseCombobox.Value;\nCombobox.Separator = ComboboxSeparator;\n\nCombobox.Group = ComboboxGroup;\nCombobox.GroupLabel = ComboboxGroupLabel;\nCombobox.GroupList = ComboboxCollection;\n\nCombobox.Chips = ComboboxChips;\nCombobox.Chip = ComboboxChip;\n","import { toLabel } from './utils';\n\n/** A single searchable text. `null` / `undefined` / `''` stand for \"this item has no such field\". */\ntype Text = string | number | null | undefined;\n\n// Lowercased words of a query.\n//\n// - Splits on whitespace runs, so no empty word matches every text.\n// - Plain `toLowerCase`: `foldCase` only matters for offsets, and none are reported here.\nconst toWords = (query: string) => query.toLowerCase().split(/\\s+/).filter(Boolean);\n\nconst isFilled = (text: Text): text is string | number =>\n text !== null && text !== undefined && text !== '';\n\nconst isTextList = (texts: Text | readonly Text[]): texts is readonly Text[] =>\n Array.isArray(texts);\n\n/**\n * Whether every word of `query` occurs in some of `texts`, ignoring case.\n *\n * - Words match by containment, across texts, in any order; an empty query matches everything.\n * - Plain lowercased `includes`, not `Intl.Collator`: `Muller` does not find `Müller`.\n * - Not interchangeable with kbc-ui's own `matchByWords` (single-space split, keeps empty texts).\n * - A `filter` for when the searchable text is not the label; else use {@link filterByWords}.\n */\nexport const matchByWords = (texts: Text | readonly Text[], query: string) => {\n const words = toWords(query);\n if (words.length === 0) return true;\n\n const haystacks = (isTextList(texts) ? texts : [texts])\n .filter(isFilled)\n .map((text) => String(text).toLowerCase());\n\n return words.every((word) => haystacks.some((haystack) => haystack.includes(word)));\n};\n\n/**\n * `filter` matching the item's displayed label word by word: `filter={filterByWords}`.\n *\n * - Generic, so it keeps the combobox's item type inference.\n * - Label: `itemToStringLabel` if passed, else the item's `label`, `value`, or string form.\n * - Only the label is searched, by design: never match what the user cannot see.\n * - Close over {@link matchByWords} to search other fields.\n */\nexport const filterByWords = <Item>(\n item: Item,\n query: string,\n itemToString?: (item: Item) => string,\n) => matchByWords(itemToString?.(item) ?? toLabel(item), query);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAMA,MAAa,eAAkC,CAAC,IAAI,GAAG;AAEvD,MAAM,eAAuC;CAC3C,IAAI;CACJ,KAAK;AACP;;;;;;;;;;AAWA,MAAa,cAAc,SACzB,KAAK,KAAK,MAAM,KAAM,aAAa,SAAS,iBAAkB;;;;;;;;;AAUhE,MAAa,mBAAmB,WAAwC,CACtE,mBAAG,IAAI,IAAI,CAAC,GAAG,cAAc,GAAG,MAAM,CAAC,CACzC;;;;;;;;;;ACjBA,MAAM,qBAAqB,UAAsC;CAC/D,IAAI,MAAM,WAAW,MAAM,eAAe,MAAM,gBAAgB;AAClE;;;;;;;;AAeA,MAAa,gBAAgB,EAAE,UAAU,OAAO,c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,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO;AAElF,MAAM,YAAY,SAChB,SAAS,QAAQ,SAAS,KAAA,KAAa,SAAS;AAElD,MAAM,cAAc,UAClB,MAAM,QAAQ,KAAK;;;;;;;;;AAUrB,MAAa,gBAAgB,OAA+B,UAAkB;CAC5E,MAAM,QAAQ,QAAQ,KAAK;CAC3B,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,MAAM,aAAa,WAAW,KAAK,IAAI,QAAQ,CAAC,KAAK,EAAA,CAClD,OAAO,QAAQ,CAAC,CAChB,KAAK,SAAS,OAAO,IAAI,CAAC,CAAC,YAAY,CAAC;CAE3C,OAAO,MAAM,OAAO,SAAS,UAAU,MAAM,aAAa,SAAS,SAAS,IAAI,CAAC,CAAC;AACpF;;;;;;;;;AAUA,MAAa,iBACX,MACA,OACA,iBACG,aAAa,eAAe,IAAI,KAAK,QAAQ,IAAI,GAAG,KAAK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu-CcVbZ_5u.js","names":["Root"],"sources":["../src/components/DropdownMenu/DropdownMenuItemIndicator.tsx","../src/components/DropdownMenu/ItemIcon.tsx","../src/components/DropdownMenu/styles.ts","../src/components/DropdownMenu/DropdownMenuCheckboxItem.tsx","../src/components/DropdownMenu/DropdownMenuContent.tsx","../src/components/DropdownMenu/DropdownMenuItem.tsx","../src/components/DropdownMenu/DropdownMenuItemDescription.tsx","../src/components/DropdownMenu/DropdownMenuLabel.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioGroup.tsx","../src/components/DropdownMenu/DropdownMenuRadioGroup/DropdownMenuRadioItem.tsx","../src/components/DropdownMenu/DropdownMenuSeparator.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSub.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubContent.tsx","../src/components/DropdownMenu/DropdownMenuSub/DropdownMenuSubTrigger.tsx","../src/components/DropdownMenu/DropdownMenuTrigger.tsx","../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { Check, Circle, ToggleRight } from '../../icons';\nimport { cn } from '../../utils';\nimport { radioCircleVariants, radioIndicatorVariants } from '../RadioGroup/styles';\n\nconst variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:pointer-events-none',\n\n // sizing\n 'tw:size-4',\n 'tw:aspect-square',\n 'tw:shrink-0',\n\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n ],\n {\n variants: {\n variant: {\n none: [],\n radio: ['tw:data-[state=unchecked]:[&_svg]:hidden'],\n check: ['tw:[&_svg:not([class*=\"tw:size-\"])]:size-3.5', 'tw:[&_svg]:text-primary'],\n checkbox: [\n 'tw:[&_svg]:text-primary-foreground',\n 'tw:border',\n 'tw:border-solid',\n 'tw:rounded',\n 'tw:border-input',\n\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-3',\n 'tw:data-[state=unchecked]:[&_svg]:hidden',\n 'tw:data-[state=checked]:border-primary',\n 'tw:data-[state=checked]:bg-primary',\n ],\n switch: [\n 'tw:size-5',\n // Lucide SVGs default to 24×24 — constrain the rendered ToggleRight\n // to the indicator slot so it doesn't overflow.\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n 'tw:text-muted-foreground',\n 'tw:data-[state=unchecked]:rotate-180',\n 'tw:data-[state=checked]:text-primary',\n ],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.ItemIndicator> &\n VariantProps<typeof variants>;\n\nexport const DropdownMenuItemIndicator = ({\n variant,\n className,\n forceMount: forceMountProp,\n ...rest\n}: Props) => {\n const isRadio = variant === 'radio';\n const IconComp = (() => {\n if (variant === 'switch') return ToggleRight;\n if (isRadio) return Circle;\n return Check;\n })();\n\n const forceMount = (() => {\n if (forceMountProp) return true;\n // All variants, except for check, require rendering at all times.\n return variant === 'check' ? undefined : true;\n })();\n\n if (variant === 'none') return null;\n\n return (\n <DropdownMenuPrimitive.ItemIndicator\n {...rest}\n forceMount={forceMount}\n className={cn(variants({ variant }), isRadio && radioCircleVariants(), className)}\n >\n <IconComp className={isRadio ? radioIndicatorVariants() : undefined} />\n </DropdownMenuPrimitive.ItemIndicator>\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'span'> & {\n children: ReactNode;\n};\n\nexport const ItemIcon = ({ className, children, ...props }: Props) => (\n <span\n {...props}\n className={cn(\n 'tw:inline-flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:aspect-square',\n // 20px container fits the 16px Lucide glyph plus 2px breathing room\n // each side — the previous tw:size-4 + tw:p-0.5 clipped the 16px child.\n 'tw:size-5',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n 'tw:text-primary',\n 'tw:group-aria-disabled:text-muted-foreground',\n className,\n )}\n >\n {children}\n </span>\n);\n","import { cn } from '../../utils';\n\nexport const itemVariants = cn(\n // reset\n 'tailwindcss-preflight',\n 'tw:outline-hidden',\n 'tw:group',\n 'tw:peer',\n 'tw:relative',\n\n // positioning\n 'tw:flex',\n 'tw:flex-1',\n 'tw:items-center',\n 'tw:gap-2',\n\n // An icon passed as `children` rather than via the `icon` prop misses `ItemIcon`,\n // so without this it falls back to Lucide's 24px default and towers over the\n // siblings this row is laid out for. The `:not()` keeps a call-site size winning.\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-4',\n\n 'tw:cursor-pointer',\n 'tw:select-none',\n 'tw:transition-colors',\n\n // spacing\n 'tw:p-2',\n\n // typography\n 'tw:font-sans',\n 'tw:text-sm',\n\n 'tw:aria-disabled:pointer-events-none',\n 'tw:aria-disabled:opacity-disabled',\n\n 'tw:focus-visible:outline-hidden',\n\n 'tw:rounded-md',\n 'tw:text-popover-foreground',\n // Hover and keyboard focus: the theme's `--hover` pair when set; unset, a `primary` tint.\n 'tw:focus:text-[var(--hover-foreground,rgb(var(--primary)))]',\n 'tw:focus:bg-[var(--hover,color-mix(in_oklab,rgb(var(--primary))_10%,transparent))]',\n 'tw:hover:text-[var(--hover-foreground,rgb(var(--primary)))]',\n 'tw:hover:bg-[var(--hover,color-mix(in_oklab,rgb(var(--primary))_10%,transparent))]',\n);\n\nexport const contentVariants = cn(\n 'tailwindcss-preflight',\n // Sit above Modal/Sheet (z-1051), matching the other floating overlays (Popover/Select z-1055)\n 'tw:z-[1055]',\n\n // positioning\n 'tw:flex',\n 'tw:flex-col',\n 'tw:origin-(--radix-dropdown-menu-content-transform-origin)',\n\n // sizing\n 'tw:max-h-[var(--radix-dropdown-menu-content-available-height)]',\n 'tw:min-w-32',\n\n // border\n 'tw:border',\n 'tw:border-border',\n 'tw:rounded-popover',\n 'tw:shadow-md',\n\n // surface — semantic tokens, so a portalled menu follows the brand and the scheme\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n // animations\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';\nimport { ItemIcon } from './ItemIcon';\nimport { itemVariants } from './styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {\n closeOnSelect?: boolean;\n indicator?: 'switch' | 'checkbox' | 'check';\n indicatorAlign?: 'start' | 'end';\n isLoading?: boolean;\n /** Leading Lucide icon, drawn like `DropdownMenu.Item`'s so mixed menus line up. */\n icon?: ReactNode;\n};\n\nexport const DropdownMenuCheckboxItem = ({\n className,\n children,\n checked,\n closeOnSelect = false,\n onSelect,\n indicatorAlign = 'start',\n indicator = 'checkbox',\n isLoading = false,\n icon,\n ...props\n}: Props) => {\n const isAtStart = indicatorAlign === 'start';\n const indicatorEle = isLoading ? (\n <ItemIcon className={isAtStart ? '' : 'tw:ml-auto'}>\n <Loader2 className=\"tw:animate-spin\" />\n </ItemIcon>\n ) : (\n <DropdownMenuItemIndicator variant={indicator} className={isAtStart ? '' : 'tw:ml-auto'} />\n );\n\n const handleSelect = (event: Event) => {\n if (!closeOnSelect) event.preventDefault();\n onSelect?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.CheckboxItem\n className={cn(itemVariants, className)}\n checked={checked}\n onSelect={handleSelect}\n {...props}\n >\n {isAtStart && indicatorEle}\n {icon && <ItemIcon>{icon}</ItemIcon>}\n {children}\n {!isAtStart && indicatorEle}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\nimport { ScrollArea } from '../ScrollArea';\n\nimport { contentVariants } from './styles';\n\ntype Props = Omit<\n ComponentProps<typeof DropdownMenuPrimitive.Content>,\n 'forceMount' | 'asChild'\n> & {\n forceMount?: boolean;\n /** Classes for the inner scroll area, not the popup. Set a width, not a `max-width` (clips rows). */\n className?: string;\n viewPortClassName?: string;\n container?: HTMLElement | null;\n};\n\nexport const DropdownMenuContent = ({\n className,\n sideOffset = 4,\n forceMount,\n children,\n viewPortClassName,\n container,\n ...props\n}: Props) => (\n <DropdownMenuPrimitive.Portal forceMount={forceMount || undefined} container={container}>\n <DropdownMenuPrimitive.Content {...props} sideOffset={sideOffset} className={contentVariants}>\n <ScrollArea\n className={className}\n viewPortClassName={cn(\n 'tw:p-2',\n 'tw:max-h-[var(--radix-dropdown-menu-content-available-height)]',\n viewPortClassName,\n )}\n scrollBarClassName=\"tw:w-1.5\"\n >\n {children}\n </ScrollArea>\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n);\n","import type { ComponentProps, PointerEventHandler, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { Root, Slottable } from '@radix-ui/react-slot';\n\nimport { Loader2 } from '../../icons';\nimport { cn } from '../../utils';\n\nimport { ItemIcon } from './ItemIcon';\nimport { itemVariants } from './styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n /**\n * Stops the closing item stealing focus from the modal it opens (breaks `autoFocus`).\n * https://github.com/radix-ui/primitives/issues/2193#issuecomment-2758461323\n */\n asModalTrigger?: boolean;\n /** Leading Lucide icon. */\n icon?: ReactNode;\n isLoading?: boolean;\n iconClassName?: string;\n};\n\nexport const DropdownMenuItem = ({\n ref,\n className,\n asModalTrigger = false,\n onSelect,\n onPointerLeave,\n onPointerMove,\n children,\n asChild,\n icon,\n iconClassName,\n isLoading = false,\n ...props\n}: Props) => {\n const Comp = asChild ? Root : 'div';\n const adornment = isLoading ? <Loader2 className=\"tw:animate-spin\" /> : icon;\n\n const handleOnSelect = (event: Event) => {\n // keeps the menu open so the modal is not unmounted\n if (asModalTrigger) event.preventDefault();\n onSelect?.(event);\n };\n\n const handlePointerLeave: PointerEventHandler<HTMLDivElement> = (event) => {\n // prevents focus stealing from modal\n if (asModalTrigger) event.preventDefault();\n onPointerLeave?.(event);\n };\n\n const handlePointerMove: PointerEventHandler<HTMLDivElement> = (event) => {\n // prevents focus stealing from modal\n if (asModalTrigger) event.preventDefault();\n onPointerMove?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.Item\n {...props}\n ref={ref}\n onSelect={handleOnSelect}\n onPointerLeave={handlePointerLeave}\n onPointerMove={handlePointerMove}\n className={cn(itemVariants, asChild && 'tw:text-inherit', className)}\n asChild\n >\n <Comp>\n {adornment && <ItemIcon className={iconClassName}>{adornment}</ItemIcon>}\n <Slottable>{children}</Slottable>\n </Comp>\n </DropdownMenuPrimitive.Item>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nconst descriptionVariants = cva(\n [\n 'tw:box-border',\n 'tw:ml-auto',\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-xs',\n 'tw:text-muted-foreground',\n ],\n {\n variants: {\n hideOnHover: {\n true: ['tw:group-focus-within:hidden', 'tw:group-hover:hidden'],\n false: [],\n },\n },\n defaultVariants: {},\n },\n);\n\ntype Props = ComponentProps<'span'> & {\n hideOnHover?: boolean;\n};\n\nexport const DropdownMenuItemDescription = ({\n className,\n children,\n hideOnHover = false,\n ...props\n}: Props) => {\n return (\n <span {...props} className={cn(descriptionVariants({ hideOnHover }), className)}>\n {children}\n </span>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Label>;\n\nexport const DropdownMenuLabel = ({ className, ...props }: Props) => {\n return (\n <DropdownMenuPrimitive.Label\n className={cn(\n 'tw:p-2',\n 'tw:font-medium',\n 'tw:text-xs',\n 'tw:text-muted-foreground',\n className,\n )}\n {...props}\n />\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\ntype Props<Value> = Omit<\n ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>,\n 'value' | 'onValueChange' | 'defaultValue'\n> & {\n value?: Value;\n defaultValue?: Value;\n onValueChange?: (value: Value) => void;\n};\n\nexport const DropdownMenuRadioGroup = <Value extends string = string>({\n value,\n defaultValue,\n onValueChange,\n ...props\n}: Props<Value>) => {\n const handleChange = (value: string) => {\n onValueChange?.(value as Value);\n };\n\n return (\n <DropdownMenuPrimitive.RadioGroup\n {...props}\n value={value}\n defaultValue={defaultValue}\n onValueChange={handleChange}\n />\n );\n};\n","import type { ComponentProps, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { Loader2 } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { DropdownMenuItemIndicator } from '../DropdownMenuItemIndicator';\nimport { ItemIcon } from '../ItemIcon';\nimport { itemVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {\n closeOnSelect?: boolean;\n indicatorAlign?: 'start' | 'end';\n indicator?: 'radio' | 'check' | 'none';\n icon?: ReactNode;\n iconClassName?: string;\n isLoading?: boolean;\n};\n\nexport const DropdownMenuRadioItem = ({\n className,\n children,\n closeOnSelect,\n onSelect,\n indicatorAlign = 'start',\n indicator = 'radio',\n icon,\n iconClassName,\n isLoading = false,\n ...props\n}: Props) => {\n const isAtStart = indicatorAlign === 'start';\n const indicatorEle = isLoading ? (\n <ItemIcon className={iconClassName}>\n <Loader2 className=\"tw:animate-spin\" />\n </ItemIcon>\n ) : (\n <DropdownMenuItemIndicator variant={indicator} />\n );\n\n const handleSelect = (event: Event) => {\n if (!closeOnSelect) event.preventDefault();\n onSelect?.(event);\n };\n\n return (\n <DropdownMenuPrimitive.RadioItem\n className={cn(\n itemVariants,\n 'tw:data-[state=checked]:cursor-default',\n {\n // The theme's `--selected` when set; unset, a `primary` tint.\n 'tw:data-[state=checked]:bg-[var(--selected,color-mix(in_oklab,rgb(var(--primary))_10%,transparent))]':\n indicator !== 'radio',\n },\n className,\n )}\n onSelect={handleSelect}\n {...props}\n >\n {isAtStart && indicatorEle}\n {icon && <ItemIcon className={iconClassName}>{icon}</ItemIcon>}\n <span className=\"tw:flex tw:min-w-0 tw:flex-1 tw:items-center tw:gap-2\">{children}</span>\n {!isAtStart && indicatorEle}\n </DropdownMenuPrimitive.RadioItem>\n );\n};\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.Separator>;\n\nexport const DropdownMenuSeparator = ({ className, ...props }: Props) => (\n <DropdownMenuPrimitive.Separator\n className={cn(\n 'tw:relative',\n 'tw:z-10',\n\n // layout\n 'tw:flex',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:w-full',\n\n // separator line\n 'tw:before:content-[\"\"]',\n 'tw:before:w-full',\n 'tw:before:h-px',\n 'tw:before:bg-border',\n 'tw:py-1',\n\n className,\n )}\n {...props}\n />\n);\n","import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nexport const DropdownMenuSub = DropdownMenuPrimitive.Sub;\n","import type { ComponentProps } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../../utils';\nimport { contentVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.SubContent>;\n\nexport const DropdownMenuSubContent = ({ className, ...props }: Props) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.SubContent\n className={cn(contentVariants, 'tw:p-2', className)}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\n\nimport { ChevronRight } from '../../../icons';\nimport { cn } from '../../../utils';\nimport { ItemIcon } from '../ItemIcon';\nimport { itemVariants } from '../styles';\n\ntype Props = ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n /** Leading Lucide icon, drawn like `DropdownMenu.Item`'s so the trigger lines up with items. */\n icon?: ReactNode;\n};\n\nexport const DropdownMenuSubTrigger = ({ className, children, icon, ...props }: Props) => {\n return (\n <DropdownMenuPrimitive.SubTrigger className={cn(itemVariants, className)} {...props}>\n {icon && <ItemIcon>{icon}</ItemIcon>}\n {children}\n <ChevronRight className=\"tw:ml-auto tw:size-5\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Trigger } from '@radix-ui/react-dropdown-menu';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Trigger>;\n\nexport const DropdownMenuTrigger = ({ ref, className, ...props }: Props) => (\n <Trigger\n {...props}\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n className={cn('tw:group/dropdown-menu-trigger', className)}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Group, Root } from '@radix-ui/react-dropdown-menu';\n\nimport { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';\nimport { DropdownMenuContent } from './DropdownMenuContent';\nimport { DropdownMenuItem } from './DropdownMenuItem';\nimport { DropdownMenuItemDescription } from './DropdownMenuItemDescription';\nimport { DropdownMenuLabel } from './DropdownMenuLabel';\nimport { DropdownMenuRadioGroup, DropdownMenuRadioItem } from './DropdownMenuRadioGroup';\nimport { DropdownMenuSeparator } from './DropdownMenuSeparator';\nimport { DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger } from './DropdownMenuSub';\nimport { DropdownMenuTrigger } from './DropdownMenuTrigger';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const DropdownMenu = ({\n // change a default value to false, for modal property, as it is not used in most cases\n modal = false,\n ...props\n}: Props) => <Root {...props} modal={modal} />;\n\n/**\n * Main Layout\n */\nDropdownMenu.Trigger = DropdownMenuTrigger;\nDropdownMenu.Content = DropdownMenuContent;\nDropdownMenu.Group = Group;\n\n/**\n * Sub Layout\n */\nDropdownMenu.Sub = DropdownMenuSub;\nDropdownMenu.SubContent = DropdownMenuSubContent;\nDropdownMenu.SubTrigger = DropdownMenuSubTrigger;\n\n/**\n * Items can be used either Sub ar Main Layout\n */\nDropdownMenu.Separator = DropdownMenuSeparator;\nDropdownMenu.Label = DropdownMenuLabel;\nDropdownMenu.Item = DropdownMenuItem;\nDropdownMenu.CheckboxItem = DropdownMenuCheckboxItem;\nDropdownMenu.RadioGroup = DropdownMenuRadioGroup;\nDropdownMenu.RadioItem = DropdownMenuRadioItem;\n\n// item content\nDropdownMenu.ItemDescription = DropdownMenuItemDescription;\n"],"mappings":";;;;;;;;;;AASA,MAAM,WAAW,IACf;CACE;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;AACF,GACA,EACE,UAAU,EACR,SAAS;CACP,MAAM,CAAC;CACP,OAAO,CAAC,0CAA0C;CAClD,OAAO,CAAC,kDAAgD,yBAAyB;CACjF,UAAU;EACR;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;CACF;CACA,QAAQ;EACN;EAGA;EACA;EACA;EACA;CACF;AACF,EACF,EACF,CACF;AAKA,MAAa,6BAA6B,EACxC,SACA,WACA,YAAY,gBACZ,GAAG,WACQ;CACX,MAAM,UAAU,YAAY;CAC5B,MAAM,kBAAkB;EACtB,IAAI,YAAY,UAAU,OAAO;EACjC,IAAI,SAAS,OAAO;EACpB,OAAO;CACT,EAAA,CAAG;CAEH,MAAM,oBAAoB;EACxB,IAAI,gBAAgB,OAAO;EAE3B,OAAO,YAAY,UAAU,KAAA,IAAY;CAC3C,EAAA,CAAG;CAEH,IAAI,YAAY,QAAQ,OAAO;CAE/B,OACE,oBAAC,sBAAsB,eAAvB;EACE,GAAI;EACQ;EACZ,WAAW,GAAG,SAAS,EAAE,QAAQ,CAAC,GAAG,WAAW,oBAAoB,GAAG,SAAS;EAEhF,UAAA,oBAAC,UAAD,EAAU,WAAW,UAAU,uBAAuB,IAAI,KAAA,EAAY,CAAA;CACnC,CAAA;AAEzC;;;ACjFA,MAAa,YAAY,EAAE,WAAW,UAAU,GAAG,YACjD,oBAAC,QAAD;CACE,GAAI;CACJ,WAAW,GACT,kBACA,mBACA,qBACA,oBAGA,aACA,gDACA,mBACA,gDACA,SACF;CAEC;AACG,CAAA;;;ACxBR,MAAa,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,GAAG,YACrD,oBAAC,sBAAsB,QAAvB,EAAA,UACE,oBAAC,sBAAsB,YAAvB;CACE,WAAW,GAAG,iBAAiB,UAAU,SAAS;CAClD,GAAI;AACL,CAAA,EAC2B,CAAA;;;ACDhC,MAAa,0BAA0B,EAAE,WAAW,UAAU,MAAM,GAAG,YAAmB;CACxF,OACE,qBAAC,sBAAsB,YAAvB;EAAkC,WAAW,GAAG,cAAc,SAAS;EAAG,GAAI;EAA9E,UAAA;GACG,QAAQ,oBAAC,UAAD,EAAA,UAAW,KAAe,CAAA;GAClC;GACD,oBAAC,cAAD,EAAc,WAAU,uBAAwB,CAAA;EAChB;;AAEtC;;;ACdA,MAAa,uBAAuB,EAAE,KAAK,WAAW,GAAG,YACvD,oBAAC,SAAD;CACE,GAAI;CACC;CACL,aAAU;CACV,WAAW,GAAG,kCAAkC,SAAS;AAC1D,CAAA;;;ACEH,MAAa,gBAAgB,EAE3B,QAAQ,OACR,GAAG,YACQ,oBAACA,QAAD;CAAM,GAAI;CAAc;AAAQ,CAAA;;;;AAK7C,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,QAAQ;;;;AAKrB,aAAa,MAAM;AACnB,aAAa,aAAa;AAC1B,aAAa,aAAa;;;;AAK1B,aAAa,YAAY;AACzB,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,aAAa,eAAe;AAC5B,aAAa,aAAa;AAC1B,aAAa,YAAY;AAGzB,aAAa,kBAAkB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { cn } from "./classNames-DcGnTh2N.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Content, Portal, Root, Trigger } from "@radix-ui/react-hover-card";
|
|
4
|
-
//#region src/components/HoverCard/HoverCardContent.tsx
|
|
5
|
-
const HoverCardContent = ({ ref, className, align = "center", sideOffset = 4, children, ...props }) => /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, {
|
|
6
|
-
ref,
|
|
7
|
-
align,
|
|
8
|
-
sideOffset,
|
|
9
|
-
"data-slot": "hover-card-content",
|
|
10
|
-
className: cn("tailwindcss-preflight", "tw:z-[1051]", "tw:box-border", "tw:border", "tw:rounded-popover", "tw:min-w-32", "tw:origin-(--radix-hover-card-content-transform-origin)", "tw:max-h-[var(--radix-hover-card-content-available-height)]", "tw:p-4", "tw:shadow-md", "tw:border-solid tw:border-border tw:bg-popover tw:text-popover-foreground", "tw:data-[side=bottom]:slide-in-from-top-2", "tw:data-[side=left]:slide-in-from-right-2", "tw:data-[side=right]:slide-in-from-left-2", "tw:data-[side=top]:slide-in-from-bottom-2", "tw:data-[state=open]:animate-in", "tw:data-[state=open]:fade-in-0", "tw:data-[state=open]:zoom-in-95", "tw:data-[state=closed]:animate-out", "tw:data-[state=closed]:fade-out-0", "tw:data-[state=closed]:zoom-out-95", "tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4", "tw:[&_svg]:shrink-0", className),
|
|
11
|
-
...props,
|
|
12
|
-
children
|
|
13
|
-
}) });
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/components/HoverCard/HoverCard.tsx
|
|
16
|
-
const HoverCard = ({ openDelay = 200, closeDelay = 200, ...rest }) => /* @__PURE__ */ jsx(Root, {
|
|
17
|
-
...rest,
|
|
18
|
-
openDelay,
|
|
19
|
-
closeDelay
|
|
20
|
-
});
|
|
21
|
-
HoverCard.Content = HoverCardContent;
|
|
22
|
-
HoverCard.Trigger = Trigger;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { HoverCard };
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=HoverCard-Cv5rmvJq.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard-Cv5rmvJq.js","names":[],"sources":["../src/components/HoverCard/HoverCardContent.tsx","../src/components/HoverCard/HoverCard.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-hover-card';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Content>;\n\nexport const HoverCardContent = ({\n ref,\n className,\n align = 'center',\n sideOffset = 4,\n children,\n ...props\n}: Props) => (\n <Portal>\n <Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n data-slot=\"hover-card-content\"\n className={cn(\n 'tailwindcss-preflight',\n 'tw:z-[1051]',\n\n // border\n 'tw:box-border',\n 'tw:border',\n 'tw:rounded-popover',\n\n // sizing\n 'tw:min-w-32',\n 'tw:origin-(--radix-hover-card-content-transform-origin)',\n 'tw:max-h-[var(--radix-hover-card-content-available-height)]',\n\n // padding + shared shadow\n 'tw:p-4',\n 'tw:shadow-md',\n\n // semantic floating-panel tokens\n 'tw:border-solid tw:border-border tw:bg-popover tw:text-popover-foreground',\n\n // directional animations\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n\n // animations\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n\n className,\n )}\n {...props}\n >\n {children}\n </Content>\n </Portal>\n);\n","import type { ComponentProps } from 'react';\nimport { Root, Trigger } from '@radix-ui/react-hover-card';\n\nimport { HoverCardContent } from './HoverCardContent';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const HoverCard = ({ openDelay = 200, closeDelay = 200, ...rest }: Props) => (\n <Root {...rest} openDelay={openDelay} closeDelay={closeDelay} />\n);\n\nHoverCard.Content = HoverCardContent;\nHoverCard.Trigger = Trigger;\n"],"mappings":";;;;AAOA,MAAa,oBAAoB,EAC/B,KACA,WACA,QAAQ,UACR,aAAa,GACb,UACA,GAAG,YAEH,oBAAC,QAAD,EAAA,UACE,oBAAC,SAAD;CACO;CACE;CACK;CACZ,aAAU;CACV,WAAW,GACT,yBACA,eAGA,iBACA,aACA,sBAGA,eACA,2DACA,+DAGA,UACA,gBAGA,6EAGA,6CACA,6CACA,6CACA,6CAGA,mCACA,kCACA,mCACA,sCACA,qCACA,sCAGA,qDACA,uBAEA,SACF;CACA,GAAI;CAEH;AACM,CAAA,EACH,CAAA;;;AC3DV,MAAa,aAAa,EAAE,YAAY,KAAK,aAAa,KAAK,GAAG,WAChE,oBAAC,MAAD;CAAM,GAAI;CAAiB;CAAuB;AAAa,CAAA;AAGjE,UAAU,UAAU;AACpB,UAAU,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal-CbUz-5YH.js","names":[],"sources":["../src/components/Modal/ModalBody.tsx","../src/components/Modal/ModalContent.tsx","../src/components/Modal/ModalFooter.tsx","../src/components/Modal/ModalActions.tsx","../src/components/Modal/ModalHeader.tsx","../src/components/Modal/ModalIcon.tsx","../src/components/Modal/ModalImage.tsx","../src/components/Modal/Modal.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\n/** Props for `Modal.Body`. Accepts all `<div>` attributes; `as=\"form\"` is reserved for future use. */\ntype Props = ComponentProps<'div'> & {\n as?: 'form';\n};\n\n/**\n * Scrollable body slot for `Modal`. Place form fields, content blocks, or detail panels here.\n * Takes available height inside `Modal.Content` and scrolls when content overflows.\n */\nexport const ModalBody = ({ className, ...props }: Props) => (\n <div\n data-slot=\"modal-body\"\n className={cn(\n // scrollable body - takes available space and scrolls when content overflows\n 'tw:flex-1',\n 'tw:overflow-y-auto',\n\n // soft top/bottom edge fade in place of header/footer separators (pure-CSS utility)\n 'tw:scroll-fade-y',\n\n // Own horizontal padding, matching Header/Footer so content edges align (ModalContent adds none)\n 'tw:px-4',\n 'tw:py-1',\n\n // normalize nested Lucide icon sizing, matching Popover/HoverCard/Alert content surfaces\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\nimport { ModalOverlay } from './ModalOverlay';\n\ntype Props = ComponentProps<typeof Content> & {\n size?: 'small' | 'medium' | 'large';\n /** `top` keeps a form that changes height in place; ignored by the legacy brand (always top-anchored). */\n align?: 'center' | 'top';\n};\n\nexport const ModalContent = ({\n size = 'medium',\n align = 'center',\n className,\n children,\n onEscapeKeyDown,\n ...props\n}: Props) => {\n const handleEscapeKeyDown: typeof onEscapeKeyDown = (event) => {\n // Keeps parent modals (e.g. FullScreenModal) open\n event.stopPropagation();\n onEscapeKeyDown?.(event);\n };\n\n return (\n <Portal>\n <ModalOverlay>\n <Content\n // props first so callers can't override the computed data-size\n {...props}\n data-size={size}\n data-align={align}\n className={cn(\n 'tailwindcss-preflight',\n 'tw:group/modal',\n\n 'tw:fixed',\n 'tw:left-1/2',\n 'tw:-translate-x-1/2',\n 'tw:z-[1051]',\n\n 'tw:top-1/2',\n 'tw:-translate-y-1/2',\n 'tw:data-[align=top]:top-20',\n 'tw:data-[align=top]:translate-y-0',\n\n 'tw:w-full',\n 'tw:max-w-2xl',\n 'tw:max-h-[calc(100vh-2*theme(spacing.20))]',\n\n 'tw:flex',\n 'tw:flex-col',\n 'tw:gap-4',\n 'tw:rounded-modal',\n 'tw:bg-card',\n 'tw:text-card-foreground',\n\n // Vertical padding here survives an omitted Header/Footer; horizontal is theirs, so the\n // Body scrollbar sits at the modal edge.\n 'tw:py-4',\n\n 'tw:duration-200',\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n\n // No -1/2 slide classes: centring uses `translate`, the animation `transform`; they\n // compose, so a -50% slide would stack to -100% and fly in from the top-left.\n 'tw:data-[state=open]:zoom-in-95',\n 'tw:data-[state=closed]:zoom-out-95',\n\n {\n 'tw:max-w-[480px]': size === 'small',\n 'tw:max-w-4xl': size === 'large',\n },\n\n className,\n )}\n onEscapeKeyDown={handleEscapeKeyDown}\n >\n {children}\n </Content>\n </ModalOverlay>\n </Portal>\n );\n};\n","import type { ComponentPropsWithRef } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentPropsWithRef<'div'>;\n\n/**\n * The modal's action row.\n *\n * - A child that should fill the row carries `tw:w-full` itself; the footer is already full width.\n * - tailwind-merge replaces only within a group: `tw:flex-col` keeps `items-center`, so add `tw:items-stretch`.\n */\nexport const ModalFooter = ({ className, ...props }: Props) => (\n <div\n {...props}\n className={cn('tw:flex', 'tw:items-center', 'tw:justify-end', 'tw:gap-2', 'tw:px-4', className)}\n />\n);\n","import type { ComponentProps } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<'div'>;\n\n/**\n * Container for the header's top-right controls — any `actions` passed to `Modal.Header` plus the\n * close icon. Sits in the header grid's last column, top-aligned. Mirrors `Alert`'s action slot.\n */\nexport const ModalActions = ({ className, ...props }: Props) => (\n <div\n className={cn(\n 'tw:col-start-3',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:flex',\n 'tw:items-center',\n 'tw:gap-1',\n // gutter from the title, carried here so the header grid needs no column gap\n 'tw:ml-3',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps, ReactNode } from 'react';\nimport { Close } from '@radix-ui/react-dialog';\n\nimport { X } from '../../icons';\nimport { cn } from '../../utils';\nimport { Button } from '../Button';\n\nimport { ModalActions } from './ModalActions';\nimport { ModalDescription } from './ModalDescription';\nimport { ModalTitle } from './ModalTitle';\n\ntype Props = {\n /** Status icon slot — `<Modal.Icon />` or `<Modal.Image />`. */\n icon?: ReactNode;\n /** Visible subtitle below the title (also fills `aria-describedby`). */\n description?: ReactNode;\n /** Screen-reader-only description; fills `aria-describedby` without rendering visibly. */\n 'aria-description'?: string;\n /** Controls rendered top-right, before the close icon. */\n actions?: ReactNode;\n /** Hide the top-right close icon. */\n hideCloseIcon?: boolean;\n} & ComponentProps<'div'>;\n\n/** Modal header: `[icon] | title (children) | actions + close` on row 1, `description` on row 2. */\nexport const ModalHeader = ({\n className,\n icon,\n description,\n 'aria-description': ariaDescription,\n actions,\n hideCloseIcon = false,\n children,\n ...props\n}: Props) => (\n <div\n {...props}\n data-slot=\"modal-header\"\n className={cn(\n 'tw:grid',\n 'tw:grid-cols-[auto_1fr_auto]',\n 'tw:items-center',\n 'tw:px-4',\n className,\n )}\n >\n {icon}\n\n {children && <ModalTitle className=\"tw:col-start-2 tw:row-start-1\">{children}</ModalTitle>}\n {(actions || !hideCloseIcon) && (\n <ModalActions>\n {actions}\n {!hideCloseIcon && (\n <Close asChild>\n <Button variant=\"invisible\" size=\"icon-sm\">\n <X />\n <span className=\"tw:sr-only\">Close</span>\n </Button>\n </Close>\n )}\n </ModalActions>\n )}\n {(description || ariaDescription) && (\n <ModalDescription\n className={cn(\n 'tw:col-start-1',\n 'tw:col-end-4',\n 'tw:row-start-2',\n description ? 'tw:mt-1' : 'tw:sr-only',\n )}\n >\n {description ?? ariaDescription}\n </ModalDescription>\n )}\n </div>\n);\n","import type { ReactNode } from 'react';\n\nimport { cn } from '../../utils';\n\ntype NamedColor = 'orange' | 'blue' | 'red' | 'green' | 'gray' | 'violet';\n\ntype Props = {\n color: NamedColor | (string & {});\n icon: ReactNode;\n};\n\nconst NAMED_COLORS = new Set<string>(['orange', 'blue', 'red', 'green', 'gray', 'violet']);\n\n/**\n * Status-coloured icon for `Modal`, authored inside `Modal.Header`; remote images use `Modal.Image`.\n *\n * - Soft-tinted inline badge in the header grid's first column, next to the title.\n * - `color` is categorical (`red` destructive … `violet` agent), fixed across brand themes.\n */\nexport const ModalIcon = ({ color, icon }: Props) => {\n const customColor = color && !NAMED_COLORS.has(color) ? color : undefined;\n\n return (\n <span\n data-slot=\"modal-icon\"\n className={cn(\n 'tw:flex',\n 'tw:shrink-0',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:[&_svg]:aspect-square',\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:mr-3',\n 'tw:size-8',\n 'tw:rounded',\n 'tw:overflow-hidden',\n 'tw:[&_svg:not([class*=\"tw:size-\"])]:size-5',\n\n {\n 'tw:bg-warning-100 tw:text-warning-500 tw:[[data-theme=dark]_&]:bg-warning-900 tw:[[data-theme=dark]_&]:text-warning-200':\n color === 'orange',\n 'tw:bg-blue-100 tw:text-blue-600 tw:[[data-theme=dark]_&]:bg-blue-900 tw:[[data-theme=dark]_&]:text-blue-200':\n color === 'blue',\n 'tw:bg-green-100 tw:text-green-900 tw:[[data-theme=dark]_&]:bg-green-900 tw:[[data-theme=dark]_&]:text-green-200':\n color === 'green',\n 'tw:bg-error-100 tw:text-error-500 tw:[[data-theme=dark]_&]:bg-error-900 tw:[[data-theme=dark]_&]:text-error-200':\n color === 'red',\n 'tw:bg-neutral-100 tw:text-neutral-500 tw:[[data-theme=dark]_&]:bg-neutral-700 tw:[[data-theme=dark]_&]:text-neutral-300':\n color === 'gray',\n 'tw:bg-purple-100 tw:text-purple-500 tw:[[data-theme=dark]_&]:bg-purple-900 tw:[[data-theme=dark]_&]:text-purple-200':\n color === 'violet',\n },\n\n // custom (non-named) colour\n { 'tw:text-white': !!customColor },\n )}\n style={customColor ? { backgroundColor: customColor } : undefined}\n >\n {icon}\n </span>\n );\n};\n","import { useEffect, useState } from 'react';\n\nimport { cn } from '../../utils';\n\ntype Props = {\n src: string;\n /** Accessible alt text. Defaults to `\"\"` (decorative) — provide it when the image carries meaning. */\n alt?: string;\n};\n\nexport const ModalImage = ({ src, alt = '' }: Props) => {\n const [hasImageError, setHasImageError] = useState(false);\n\n // Reset the error state when the source changes, so a reused badge (new logo, or a retry after a\n // transient failure) isn't permanently hidden by an earlier onError.\n useEffect(() => setHasImageError(false), [src]);\n\n if (hasImageError) return null;\n\n return (\n <span\n data-slot=\"modal-image\"\n className={cn(\n 'tw:shrink-0',\n 'tw:overflow-hidden',\n\n // inline badge in the header grid's first column\n 'tw:flex',\n 'tw:col-start-1',\n 'tw:row-start-1',\n 'tw:self-start',\n 'tw:mr-3',\n 'tw:items-center',\n 'tw:justify-center',\n 'tw:rounded',\n 'tw:size-8',\n )}\n >\n <img\n src={src}\n alt={alt}\n className=\"tw:size-full tw:object-contain\"\n onError={() => setHasImageError(true)}\n />\n </span>\n );\n};\n","import type { ComponentProps } from 'react';\nimport { Close, Root, Trigger } from '@radix-ui/react-dialog';\n\nimport { ModalBody } from './ModalBody';\nimport { ModalContent } from './ModalContent';\nimport { ModalFooter } from './ModalFooter';\nimport { ModalHeader } from './ModalHeader';\nimport { ModalIcon } from './ModalIcon';\nimport { ModalImage } from './ModalImage';\nimport { ModalOverlay } from './ModalOverlay';\n\ntype Props = ComponentProps<typeof Root>;\n\n/**\n * Blocking dialog the user must act on before continuing. Built on Radix Dialog.\n *\n * - Not for side editing (`Sheet`), anchored confirms (`Popconfirm`) or hover previews (`HoverCard`).\n * - `Modal.Content` wraps Header + Body + Footer; a form's `FormBody` goes in Body, its buttons in Footer.\n *\n * @see RECIPES.md#modal-form\n * @see RECIPES.md#confirm-dialog\n */\nexport const Modal = (props: Props) => <Root {...props} />;\n\nModal.Close = Close;\nModal.Trigger = Trigger;\n\nModal.Content = ModalContent;\nModal.Body = ModalBody;\nModal.Icon = ModalIcon;\nModal.Image = ModalImage;\nModal.Footer = ModalFooter;\nModal.Header = ModalHeader;\nModal.Overlay = ModalOverlay;\n"],"mappings":";;;;;;;;;;;;AAaA,MAAa,aAAa,EAAE,WAAW,GAAG,YACxC,oBAAC,OAAD;CACE,aAAU;CACV,WAAW,GAET,aACA,sBAGA,oBAGA,WACA,WAGA,qDACA,uBACA,SACF;CACA,GAAI;AACL,CAAA;;;ACrBH,MAAa,gBAAgB,EAC3B,OAAO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,MAAD,EAAM,GAAI,MAAQ,CAAA;AAEzD,MAAM,QAAQ;AACd,MAAM,UAAU;AAEhB,MAAM,UAAU;AAChB,MAAM,OAAO;AACb,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,SAAS;AACf,MAAM,SAAS;AACf,MAAM,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalTitle-cy0Ht9VY.js","names":[],"sources":["../src/components/Modal/ModalOverlay.tsx","../src/components/Modal/ModalDescription.tsx","../src/components/Modal/ModalTitle.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Overlay } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Overlay> & {\n disableTransition?: boolean;\n};\n\nexport const ModalOverlay = ({ ref, className, disableTransition = false, ...props }: Props) => (\n <Overlay\n {...props}\n ref={ref}\n className={cn(\n // positioning\n 'tw:fixed',\n 'tw:inset-0',\n 'tw:z-[1051]',\n\n // background\n 'tw:bg-scrim',\n\n // opening animation\n 'tw:data-[state=open]:duration-500',\n 'tw:data-[state=open]:fade-in-0',\n\n // closing animation\n 'tw:data-[state=closed]:duration-500',\n 'tw:data-[state=closed]:fade-out-0',\n {\n 'tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out': !disableTransition,\n },\n className,\n )}\n onClick={(event) => event.stopPropagation()}\n />\n);\n","import type { ComponentProps } from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof DialogPrimitive.Description>;\n\nexport const ModalDescription = ({ className, ...props }: Props) => (\n <DialogPrimitive.Description\n className={cn(\n // `wrap-anywhere` because the slot routinely carries an identifier — a Storage table id, a\n // fully-qualified name — which offers no break opportunity and paints outside the frame\n // without one. `ModalTitle` carries it for the same reason.\n 'tw:wrap-anywhere',\n 'tw:text-sm',\n 'tw:font-sans',\n 'tw:tracking-normal',\n 'tw:font-normal',\n 'tw:text-muted-foreground',\n className,\n )}\n {...props}\n />\n);\n","import type { ComponentProps } from 'react';\nimport { Title } from '@radix-ui/react-dialog';\n\nimport { cn } from '../../utils';\n\ntype Props = ComponentProps<typeof Title>;\n\nexport const ModalTitle = ({ children, className, ...props }: Props) => (\n <Title\n {...props}\n className={cn('tw:flex-1', 'tw:wrap-anywhere', 'tw:text-base', 'tw:font-semibold', className)}\n >\n {children}\n </Title>\n);\n"],"mappings":";;;;;AASA,MAAa,gBAAgB,EAAE,KAAK,WAAW,oBAAoB,OAAO,GAAG,YAC3E,oBAAC,SAAD;CACE,GAAI;CACC;CACL,WAAW,GAET,YACA,cACA,eAGA,eAGA,qCACA,kCAGA,uCACA,qCACA,EACE,sEAAsE,CAAC,kBACzE,GACA,SACF;CACA,UAAU,UAAU,MAAM,gBAAgB;AAC3C,CAAA;;;AC5BH,MAAa,oBAAoB,EAAE,WAAW,GAAG,YAC/C,oBAAC,gBAAgB,aAAjB;CACE,WAAW,GAIT,oBACA,cACA,gBACA,sBACA,kBACA,4BACA,SACF;CACA,GAAI;AACL,CAAA;;;ACfH,MAAa,cAAc,EAAE,UAAU,WAAW,GAAG,YACnD,oBAAC,OAAD;CACE,GAAI;CACJ,WAAW,GAAG,aAAa,oBAAoB,gBAAgB,oBAAoB,SAAS;CAE3F;AACI,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popover-DtUDwUVO.js","names":[],"sources":["../src/components/Popover/PopoverContent.tsx","../src/components/Popover/Popover.tsx"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport { Content, Portal } from '@radix-ui/react-popover';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cva } from 'class-variance-authority';\n\nimport { cn } from '../../utils';\n\nconst variants = cva(\n [\n 'tailwindcss-preflight',\n 'tw:group/popover-content',\n 'tw:z-[1055]',\n 'tw:focus-visible:outline-hidden',\n\n // An open Radix Dialog sets `pointer-events: none` on <body>, which this portalled panel\n // inherits; outside-click dismiss still works (it listens on document).\n 'tw:pointer-events-auto',\n\n // sizing\n 'tw:min-w-32',\n 'tw:max-h-[var(--radix-popover-content-available-height)]',\n 'tw:origin-(--radix-popover-content-transform-origin)',\n\n // layout\n 'tw:flex',\n 'tw:flex-col',\n 'tw:overflow-y-auto',\n\n // border\n 'tw:box-border',\n 'tw:border',\n 'tw:border-solid',\n 'tw:border-border',\n 'tw:rounded-popover',\n 'tw:shadow-lg',\n\n // surface — semantic tokens, so a portalled panel follows the brand and the scheme\n 'tw:bg-popover',\n 'tw:text-popover-foreground',\n\n // open animation\n 'tw:data-[state=open]:animate-in',\n 'tw:data-[state=open]:fade-in-0',\n 'tw:data-[state=open]:zoom-in-95',\n\n // closed animation\n 'tw:data-[state=closed]:animate-out',\n 'tw:data-[state=closed]:fade-out-0',\n 'tw:data-[state=closed]:zoom-out-95',\n\n // position animation\n 'tw:data-[side=bottom]:slide-in-from-top-2',\n 'tw:data-[side=left]:slide-in-from-right-2',\n 'tw:data-[side=right]:slide-in-from-left-2',\n 'tw:data-[side=top]:slide-in-from-bottom-2',\n\n // Default size for nested Lucide icons; callers can override on the icon.\n \"tw:[&_svg.lucide:not([class*='tw:size-'])]:size-4\",\n 'tw:[&_svg]:shrink-0',\n ],\n {\n defaultVariants: {\n matchTriggerWidth: false,\n },\n variants: {\n matchTriggerWidth: {\n true: ['tw:w-[var(--radix-popover-trigger-width)]'],\n false: [],\n },\n },\n },\n);\n\ntype Props = ComponentProps<typeof Content> &\n VariantProps<typeof variants> & {\n /**\n * Portal target, default `document.body`; pass a theme-scoped host so the panel takes its theme.\n */\n container?: ComponentProps<typeof Portal>['container'];\n };\n\nexport const PopoverContent = ({\n ref,\n className,\n align = 'center',\n sideOffset = 4,\n matchTriggerWidth = false,\n children,\n onEscapeKeyDown,\n container,\n ...props\n}: Props) => (\n <Portal container={container}>\n <Content\n ref={ref}\n align={matchTriggerWidth ? 'start' : align}\n sideOffset={sideOffset}\n className={cn(variants({ className, matchTriggerWidth }))}\n onEscapeKeyDown={(event) => {\n // Keeps parent modals (e.g. FullScreenModal) from closing.\n event.stopPropagation();\n onEscapeKeyDown?.(event);\n }}\n {...props}\n >\n {children}\n </Content>\n </Portal>\n);\n","import type { ComponentProps } from 'react';\nimport { Anchor, Close, Root, Trigger } from '@radix-ui/react-popover';\n\nimport { PopoverContent } from './PopoverContent';\n\ntype Props = ComponentProps<typeof Root>;\n\nexport const Popover = (props: Props) => <Root {...props} />;\n\n/**\n * Main Layout\n */\nPopover.Content = PopoverContent;\nPopover.Trigger = Trigger;\n// Positions a controlled popover against an element other than its trigger.\nPopover.Anchor = Anchor;\nPopover.Close = Close;\n"],"mappings":";;;;;AAOA,MAAM,WAAW,IACf;CACE;CACA;CACA;CACA;CAIA;CAGA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;AACF,GACA;CACE,iBAAiB,EACf,mBAAmB,MACrB;CACA,UAAU,EACR,mBAAmB;EACjB,MAAM,CAAC,2CAA2C;EAClD,OAAO,CAAC;CACV,EACF;AACF,CACF;AAUA,MAAa,kBAAkB,EAC7B,KACA,WACA,QAAQ,UACR,aAAa,GACb,oBAAoB,OACpB,UACA,iBACA,WACA,GAAG,YAEH,oBAAC,QAAD;CAAmB;CACjB,UAAA,oBAAC,SAAD;EACO;EACL,OAAO,oBAAoB,UAAU;EACzB;EACZ,WAAW,GAAG,SAAS;GAAE;GAAW;EAAkB,CAAC,CAAC;EACxD,kBAAkB,UAAU;GAE1B,MAAM,gBAAgB;GACtB,kBAAkB,KAAK;EACzB;EACA,GAAI;EAEH;CACM,CAAA;AACH,CAAA;;;ACpGV,MAAa,WAAW,UAAiB,oBAAC,MAAD,EAAM,GAAI,MAAQ,CAAA;;;;AAK3D,QAAQ,UAAU;AAClB,QAAQ,UAAU;AAElB,QAAQ,SAAS;AACjB,QAAQ,QAAQ"}
|