@px-ui/core 3.1.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Root","BaseDialog","Portal","Trigger","Close","Content","Header","Footer","Title","Description","Root","BasePopover","Trigger","Header","Title","Description","Content","entry","Root","Button","ButtonComponent","Input","List","React","Root","Content","useInfiniteScroll","Item","MultiItem","ItemIndicator","InputGroup.Root","InputGroup.Input","InputGroup.Addon","InputGroup.Button","Trigger","Value","React","Root","Content","List","Item","Trigger","Value","Root","Trigger","Content","Item","Separator","Group","RadioGroup","Root","Indicator","Label","Root","BaseRadioGroup","Item","React","Root","BaseTabs","Trigger","Content","BaseTooltip","Root","Trigger","BaseCheckbox","Group","BaseCheckboxGroup","Item","Header","Title","Description","Group","BaseRadioGroup","Item","BaseRadioGroup","Item","RadioGroupItemPrimitive","Root","BaseCollapsible","Trigger","props","className","React","TOAST_ICONS: Record<ToastVariants, any>","toast","Tooltip.Root","Tooltip.Trigger","Tooltip.Content","AvatarBase","Tooltip.BaseProvider","Tooltip.BaseRoot","Tooltip.Trigger","Tooltip.Content","Popover.Root","Popover.Trigger","Popover.Content","BaseSwitch","React","handleSelect: OnSelectHandler<Date>","Popover.Root","Popover.Trigger","format","Popover.Content","formatDate","uploadedFile: FileWithUploadStatus","failedFile: FileWithUploadStatus","results: FileWithUploadStatus[]","newErrors: string[]","validFiles: FileWithUploadStatus[]","React","contextValue: FileUploadContextValue","React"],"sources":["../src/utils/classnames.ts","../src/components/button.tsx","../src/icons/close-icon.tsx","../src/components/dialog.tsx","../src/components/popover.tsx","../src/hooks/use-intersection-observer.ts","../src/hooks/use-infinite-scroll.ts","../src/components/spinner.tsx","../src/tw-styles/dropdown.ts","../src/icons/clear-icon.tsx","../src/icons/chevron-down-icon.tsx","../src/icons/search-icon.tsx","../src/icons/check-icon.tsx","../src/components/input-group.tsx","../src/hooks/use-debounce.ts","../src/hooks/use-async-options.ts","../src/components/combobox.tsx","../src/components/select.tsx","../src/components/menu.tsx","../src/components/progress.tsx","../src/components/segmented-control.tsx","../src/components/tabs.tsx","../src/components/tooltip.tsx","../src/components/checkbox.tsx","../src/components/block-checkbox-group.tsx","../src/components/radio-group.tsx","../src/components/block-radio-group.tsx","../src/components/breadcrumbs.tsx","../src/components/collapsible.tsx","../src/components/calendar.tsx","../src/icons/circle-alert-icon.tsx","../src/icons/circle-check-icon.tsx","../src/icons/info-icon.tsx","../src/icons/triangle-alert-icon.tsx","../src/icons/spinner-icon.tsx","../src/components/toast.tsx","../src/providers/px-ui-provider.tsx","../src/components/label.tsx","../src/components/input.tsx","../src/components/textarea.tsx","../src/components/avatar.tsx","../src/components/avatar-group.tsx","../src/components/switch.tsx","../src/components/separator.tsx","../src/icons/calendar-icon.tsx","../src/components/date-picker.tsx","../src/icons/upload-cloud-icon.tsx","../src/icons/retry-icon.tsx","../src/icons/upload-icon.tsx","../src/hooks/use-file-upload.ts","../src/icons/file-icon.tsx","../src/components/file-upload.tsx","../src/hooks/use-mobile.ts","../src/index.ts"],"sourcesContent":["import classnames, { type ArgumentArray } from \"classnames\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n// Create a custom tailwind-merge instance that knows about our custom utilities\nconst customTwMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n \"font-size\": [\n // Add our custom text-ppx-* utilities to the font-size group instead of text-color\n {\n text: [\n \"ppx-h1\",\n \"ppx-h2\",\n \"ppx-h3\",\n \"ppx-h4\",\n \"ppx-base\",\n \"ppx-sm\",\n \"ppx-xs\",\n ],\n },\n ],\n // Add custom height utilities\n h: [{ h: [\"stretch-available\", \"input\", \"input-s\"] }],\n // Add custom min-height utilities\n \"min-h\": [{ \"min-h\": [\"input\", \"input-s\"] }],\n // Add custom min-width utilities\n \"min-w\": [{ \"min-w\": [\"input\"] }],\n // Add custom padding utilities\n p: [{ p: [\"input\"] }],\n // Add custom border radius utilities\n rounded: [\n {\n rounded: [\n \"ppx-xs\",\n \"ppx-s\",\n \"ppx-m\",\n \"ppx-l\",\n \"ppx-xl\",\n \"input\",\n \"input-s\",\n ],\n },\n ],\n // Add custom font family utilities\n \"font-family\": [{ font: [\"sans-light\", \"sans-sb\", \"sans-b\"] }],\n },\n },\n});\n\nexport function cn(...inputs: ArgumentArray) {\n return customTwMerge(classnames(inputs));\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-colors disabled:cursor-not-allowed shrink-0 [&_svg]:shrink-0 outline-none rounded-ppx-s font-medium focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30\",\n {\n variants: {\n variant: {\n default:\n \"bg-ppx-neutral-11 text-white shadow-xs not-disabled:hover:bg-ppx-neutral-10 not-disabled:active:bg-ppx-neutral-11 disabled:bg-ppx-neutral-6\",\n primary:\n \"bg-ppx-primary-5 text-white shadow-xs not-disabled:hover:bg-ppx-primary-4 not-disabled:active:bg-ppx-primary-5 disabled:bg-ppx-primary-2 disabled:text-ppx-neutral-8\",\n destructive:\n \"bg-ppx-red-5 text-white shadow-xs hover:bg-ppx-red-4 not-disabled:active:bg-ppx-red-5 disabled:bg-ppx-red-2 disabled:text-ppx-neutral-13\",\n outline:\n \"shadow-xs not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 disabled:border-ppx-neutral-7 border border-ppx-neutral-11 text-ppx-neutral-11 disabled:text-ppx-neutral-7\",\n \"primary-outline\":\n \"shadow-xs not-disabled:hover:bg-ppx-primary-1 not-disabled:active:bg-ppx-primary-2/50 disabled:text-ppx-primary-2 disabled:border-ppx-primary-2 border border-ppx-primary-5 text-ppx-primary-5\",\n ghost:\n \"not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 not-disabled:hover:text-black text-ppx-neutral-12 disabled:opacity-70\",\n link: \"text-ppx-neutral-12 underline-offset-4 underline cursor-pointer not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 disabled:opacity-70\",\n },\n size: {\n default: \"px-4 py-2 h-10 has-[>svg]:px-3 text-ppx-base\",\n sm: \"gap-1.5 px-3 has-[>svg]:px-2.5 h-8 text-ppx-sm\",\n lg: \"px-6 h-12 text-ppx-base font-sans-sb has-[>svg]:px-4\",\n \"icon-sm\": \"size-8\",\n icon: \"size-10 px-2\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface ButtonProps\n extends React.ComponentProps<\"button\">,\n VariantProps<typeof buttonVariants> {}\n\nfunction Button({ className, variant, size, ...props }: ButtonProps) {\n return (\n <button\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n","export default function CloseIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport CloseIcon from \"../icons/close-icon\";\n\nexport function Root({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Root>) {\n return <BaseDialog.Root data-slot=\"dialog\" {...props} />;\n}\n\nexport function Portal({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Portal>) {\n return <BaseDialog.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function Trigger({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Trigger>) {\n return <BaseDialog.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function Close({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Close>) {\n return <BaseDialog.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function Overlay({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n \"inset-0 bg-black/50 fixed transition-all duration-200 [&[data-ending-style]]:opacity-0 [&[data-starting-style]]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Content({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Popup>) {\n return (\n <Portal data-slot=\"dialog-portal\">\n <Overlay />\n <BaseDialog.Popup\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed z-50 grid w-full bg-ppx-background text-ppx-foreground ppx-sm:max-w-[calc(100%-2rem)]\",\n \"gap-8 p-6 shadow-lg ppx-sm:max-w-lg rounded-ppx-m rounded-b-none border border-ppx-neutral-5 duration-200 outline-none ppx-sm:scale-[calc(1-0.1*var(--nested-dialogs))] ppx-sm:rounded-b-ppx-m\",\n \"bottom-0 fixed w-full ppx-sm:top-[50%] ppx-sm:bottom-auto ppx-sm:left-[50%] ppx-sm:translate-x-[-50%] ppx-sm:translate-y-[-50%]\",\n \"duration-200\",\n \"data-[starting-style]:translate-y-full data-[starting-style]:opacity-0\",\n \"data-[ending-style]:translate-y-full data-[ending-style]:opacity-0\",\n \"data-[starting-style]:ppx-sm:translate-y-[-50%] data-[starting-style]:ppx-sm:scale-95\",\n \"data-[ending-style]:ppx-sm:translate-y-[-50%] data-[ending-style]:ppx-sm:scale-95\",\n className,\n )}\n {...props}\n >\n {children}\n <BaseDialog.Close\n className=\"top-4 right-4 absolute text-ppx-muted-foreground\"\n render={(closeProps) => (\n <Button {...closeProps} size=\"icon-sm\" variant=\"ghost\">\n <CloseIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n )}\n />\n </BaseDialog.Popup>\n </Portal>\n );\n}\n\nexport function Header({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"gap-3 flex\", className)}\n {...props}\n />\n );\n}\n\nexport function HeaderContent({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"gap-2 flex flex-col self-center\", className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function HeaderIcon({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"size-12 flex shrink-0 items-center justify-center rounded-full bg-ppx-neutral-2 text-ppx-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function Footer({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"gap-2 flex flex-col-reverse ppx-sm:flex-row ppx-sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Title({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n data-slot=\"dialog-title\"\n className={cn(\"font-sans-sb text-ppx-h4 leading-none\", className)}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-ppx-sm text-ppx-muted-foreground\", className)}\n {...props}\n />\n );\n}\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\n\nimport { cn } from \"../utils\";\nimport CloseIcon from \"../icons/close-icon\";\nimport { Button } from \"./button\";\n\nexport function Root(props: React.ComponentProps<typeof BasePopover.Root>) {\n return <BasePopover.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction Portal(props: React.ComponentProps<typeof BasePopover.Portal>) {\n return <BasePopover.Portal data-slot=\"popover-portal\" {...props} />;\n}\n\nexport function Trigger(\n props: React.ComponentProps<typeof BasePopover.Trigger>,\n) {\n return <BasePopover.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nexport function Close(props: React.ComponentProps<typeof BasePopover.Close>) {\n return <BasePopover.Close data-slot=\"popover-close\" {...props} />;\n}\n\nfunction Arrow(props: React.ComponentProps<typeof BasePopover.Arrow>) {\n return <BasePopover.Arrow data-slot=\"popover-arrow\" {...props} />;\n}\n\nfunction Positioner(\n props: React.ComponentProps<typeof BasePopover.Positioner>,\n) {\n return <BasePopover.Positioner data-slot=\"popover-positioner\" {...props} />;\n}\n\nexport function Header({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"gap-y-1 relative flex flex-col\", className)}\n {...props}\n />\n );\n}\n\nexport function Title({\n className,\n ...props\n}: React.ComponentProps<typeof BasePopover.Title>) {\n return (\n <BasePopover.Title\n data-slot=\"popover-title\"\n className={cn(\"font-sans-sb text-ppx-sm\", className)}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<typeof BasePopover.Description>) {\n return (\n <BasePopover.Description\n data-slot=\"popover-description\"\n className={cn(\"text-ppx-sm text-ppx-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nexport function Content({\n children,\n className,\n positionerProps = {},\n popupProps = {},\n arrow = true,\n}: { popupProps?: React.ComponentProps<typeof BasePopover.Popup> } & {\n positionerProps?: React.ComponentProps<typeof Positioner>;\n} & { children: React.ReactNode; arrow?: boolean; className?: string }) {\n return (\n <Portal>\n <Positioner\n sideOffset={8}\n align=\"center\"\n positionMethod=\"fixed\"\n side=\"bottom\"\n {...positionerProps}\n >\n <BasePopover.Popup\n data-slot=\"popover-content\"\n {...popupProps}\n className={cn(\n \"p-4 shadow-md z-50 min-w-input origin-[var(--transform-origin)] rounded-ppx-m bg-ppx-background text-ppx-foreground outline -outline-offset-1 outline-ppx-neutral-5 transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n popupProps.className,\n className,\n )}\n >\n {arrow && (\n <Arrow className=\"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V9H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-ppx-background\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-ppx-neutral-5\"\n />\n </svg>\n </Arrow>\n )}\n {children}\n </BasePopover.Popup>\n </Positioner>\n </Portal>\n );\n}\n\nexport function CloseIconButton({\n className,\n ...props\n}: React.ComponentProps<\"button\">) {\n return (\n <BasePopover.Close\n render={(closeProps) => (\n <Button\n aria-label=\"Close\"\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn(\n \"self-start text-ppx-muted-foreground transition-colors hover:text-ppx-foreground\",\n className,\n )}\n {...closeProps}\n {...props}\n >\n <CloseIcon className=\"size-5\" />\n </Button>\n )}\n />\n );\n}\n\nexport function Footer({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-footer\"\n className={cn(\n \"gap-2 flex flex-col-reverse ppx-sm:flex-row ppx-sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n","import React from \"react\";\n\nexport interface UseIntersectionObserverOptions {\n threshold?: number | number[];\n root?: Element | Document | null;\n rootMargin?: string;\n}\n\nexport type UseIntersectionObserverReturn = [\n (node: Element | null) => void,\n IntersectionObserverEntry | null,\n];\n\nexport function useIntersectionObserver(\n options: UseIntersectionObserverOptions = {},\n): UseIntersectionObserverReturn {\n const { threshold = 1, root = null, rootMargin = \"0px\" } = options;\n const [entry, setEntry] = React.useState<IntersectionObserverEntry | null>(\n null,\n );\n\n const previousObserver = React.useRef<IntersectionObserver | null>(null);\n\n const customRef = React.useCallback(\n (node: Element | null) => {\n if (previousObserver.current) {\n previousObserver.current.disconnect();\n previousObserver.current = null;\n }\n\n if (node?.nodeType === Node.ELEMENT_NODE) {\n const observer = new IntersectionObserver(\n ([entry]: IntersectionObserverEntry[]) => {\n setEntry(entry ?? null);\n },\n { threshold, root, rootMargin },\n );\n\n observer.observe(node);\n previousObserver.current = observer;\n }\n },\n [threshold, root, rootMargin],\n );\n\n return [customRef, entry] as const;\n}\n","import { useEffect, useEffectEvent } from \"react\";\nimport {\n useIntersectionObserver,\n type UseIntersectionObserverOptions,\n} from \"./use-intersection-observer\";\n\nconst DEFAULT_DELAY_IN_MS = 100;\n\nexport type UseInfiniteScrollHookArgs = Pick<\n UseIntersectionObserverOptions,\n \"rootMargin\" | \"threshold\"\n> & {\n isLoadingMore: boolean;\n // If the list has more items to load.\n hasMore: boolean;\n // The callback function to execute when the 'onLoadMore' is triggered.\n onLoadMore: () => unknown;\n // Flag to stop infinite scrolling. Can be used in case of an error etc too.\n disabled?: boolean;\n};\n\nfunction useInfiniteScroll({\n isLoadingMore,\n hasMore,\n onLoadMore,\n rootMargin,\n disabled,\n threshold,\n}: UseInfiniteScrollHookArgs) {\n const [ref, entry] = useIntersectionObserver({\n rootMargin,\n threshold,\n });\n const isVisible = Boolean(entry?.isIntersecting);\n\n const onLoadMoreEvent = useEffectEvent(() => {\n onLoadMore();\n });\n\n useEffect(() => {\n if (disabled) return;\n\n if (isVisible && hasMore && !isLoadingMore && !disabled) {\n // When we trigger 'onLoadMore' and new items are added to the list,\n // right before they become rendered on the screen, 'isLoadingMore' becomes false\n // and 'isVisible' can be true for a brief time, based on the scroll position.\n // So, it triggers 'onLoadMore' just after the first one is finished.\n // We use a small delay here to prevent this kind of situations.\n const timer = setTimeout(() => {\n onLoadMoreEvent();\n }, DEFAULT_DELAY_IN_MS);\n\n return () => {\n clearTimeout(timer);\n };\n }\n }, [isVisible, isLoadingMore, hasMore, disabled]);\n\n return [ref] as const;\n}\n\nexport default useInfiniteScroll;\n","import { cn } from \"../utils\";\n\ninterface SpinnerProps {\n size?: \"small\" | \"medium\" | \"large\";\n className?: string;\n}\n\nconst sizeClasses = {\n small: \"w-4 h-4\",\n medium: \"w-6 h-6\",\n large: \"w-8 h-8\",\n};\n\nexport function Spinner({ size = \"small\", className }: SpinnerProps) {\n const spinnerClasses = cn(\n \"animate-spin inline-block\",\n sizeClasses[size],\n className,\n );\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-label=\"Loading\"\n role=\"status\"\n className={spinnerClasses}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n","import { cva } from \"class-variance-authority\";\n\nexport const DROPDOWN_ITEM_CN =\n \"gap-2 py-2 pr-8 pl-4 text-ppx-sm flex cursor-default items-center outline-none select-none not-data-disabled:data-highlighted:bg-ppx-primary-b-1 data-selected:bg-ppx-primary-1! data-checked:bg-ppx-primary-1! text-ppx-foreground my-0.5 data-disabled:opacity-50\";\n\nexport const DROPDOWN_POPUP_CN =\n \"rounded-ppx-s shadow-xs max-h-[var(--available-height)] origin-[var(--transform-origin)] overflow-y-auto bg-ppx-background bg-clip-padding shadow-ppx-neutral-5 outline-1 outline-ppx-neutral-5 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[side=none]:data-[ending-style]:transition-none data-[starting-style]:scale-90 data-[starting-style]:opacity-0 data-[side=none]:data-[starting-style]:scale-100 data-[side=none]:data-[starting-style]:opacity-100 data-[side=none]:data-[starting-style]:transition-none group max-w-[var(--available-width)] text-ppx-foreground\";\n\nexport const DROPDOWN_POSITIONER_CN = \"z-10 outline-none\";\n\nexport const triggerVariants = cva(\n \"gap-2 text-ppx-sm bg-ppx-neutral-1 inline-flex items-center justify-between border border-ppx-neutral-5 aria-invalid:border-ppx-red-4 text-ppx-foreground outline-transparent p-input focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ppx-neutral-6 focus-visible:aria-invalid:outline-transparent data-disabled:cursor-not-allowed data-disabled:border-ppx-neutral-3 data-disabled:bg-ppx-neutral-3 data-disabled:text-ppx-neutral-11 data-popup-open:brightness-97\",\n {\n variants: {\n size: {\n default: \"rounded-input min-h-input h-input\",\n sm: \"rounded-input-s min-h-input-s h-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n fit: \"min-w-0 w-fit\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"enforced\",\n },\n },\n);\n","import { cn } from \"../utils\";\n\nexport default function ClearIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M18 6L6 18\" />\n <path d=\"M6 6l12 12\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function ChevronDownIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function SearchIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"shrink-0\", props.className)}\n >\n <path\n d=\"M15.9038 14.9625L11.2623 10.321C12.1404 9.24234 12.6723 7.85136 12.6723 6.33612C12.6723 2.83678 9.83548 0 6.33612 0C2.83677 0 0 2.83677 0 6.33612C0 9.83547 2.83677 12.6723 6.33612 12.6723C7.85133 12.6723 9.24233 12.1404 10.3326 11.2532L10.321 11.2623L14.9613 15.9026C15.0215 15.9628 15.1047 16 15.1966 16C15.2885 16 15.3717 15.9628 15.4319 15.9026L15.9026 15.4319C15.9628 15.3716 16 15.2884 16 15.1965C16 15.1053 15.9633 15.0226 15.9038 14.9624L15.9038 14.9625L15.9038 14.9625ZM6.34922 11.341C6.34886 11.341 6.34842 11.341 6.34798 11.341C3.59045 11.341 1.35503 9.10555 1.35503 6.34802C1.35503 3.59048 3.59045 1.35506 6.34798 1.35506C9.10552 1.35506 11.3409 3.59048 11.3409 6.34802C11.3409 6.34845 11.3409 6.34887 11.3409 6.34931V6.34925C11.3374 9.10469 9.10467 11.3375 6.34955 11.341H6.3492L6.34922 11.341Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function CheckIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"currentcolor\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M9.1603 1.12218C9.50684 1.34873 9.60427 1.81354 9.37792 2.16038L5.13603 8.66012C5.01614 8.8438 4.82192 8.96576 4.60451 8.99384C4.3871 9.02194 4.1683 8.95335 4.00574 8.80615L1.24664 6.30769C0.939709 6.02975 0.916013 5.55541 1.19372 5.24822C1.47142 4.94102 1.94536 4.91731 2.2523 5.19524L4.36085 7.10461L8.12299 1.33999C8.34934 0.993152 8.81376 0.895638 9.1603 1.12218Z\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils\";\nimport { Button as ButtonComponent } from \"./button\";\n\nconst inputGroupVariants = cva(\n \"group/input-group relative flex items-center border border-ppx-neutral-5 bg-ppx-neutral-1 outline-transparent has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-1 has-[[data-slot=input-group-control]:focus-visible]:bg-ppx-background has-[[data-slot=input-group-control]:focus-visible]:outline-ppx-primary-focus has-[[data-slot][aria-invalid=true]]:outline-ppx-red-4 has-[[data-slot][aria-invalid=true]]:outline has-[[data-slot][aria-invalid=true]]:-outline-offset-1 has-[[data-slot][aria-invalid=true]]:bg-ppx-red-1 has-[[data-slot=input-group-control]:disabled]:*:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:border-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:bg-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:text-ppx-neutral-11 has-[>[data-align=inline-start]]:[&>input]:pl-input has-[>[data-align=inline-end]]:[&>input]:pr-input\",\n {\n variants: {\n size: {\n default: \"h-input rounded-input\",\n sm: \"h-input-s rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n fit: \"min-w-0 w-fit\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\nexport function Root({\n className,\n size,\n disabled,\n widthVariant,\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof inputGroupVariants> & { disabled?: boolean }) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(inputGroupVariants({ size, widthVariant }), className)}\n data-disabled={disabled}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-ppx-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\": \"order-first pl-input\",\n \"inline-end\": \"order-last pr-input\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n },\n);\n\ninterface AddonProps\n extends React.ComponentProps<\"div\">,\n VariantProps<typeof inputGroupAddonVariants> {}\n\nexport function Addon({\n className,\n align = \"inline-start\",\n ...props\n}: AddonProps) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-ppx-sm shadow-none flex gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-input [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-input has-[>svg]:px-2.5\",\n \"icon-xs\": \"size-6 rounded-input p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n },\n);\n\nexport function Button({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof ButtonComponent>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <ButtonComponent\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nexport function Text({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center text-ppx-muted-foreground [&_svg]:pointer-events-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Input({\n className,\n invalid,\n ...props\n}: React.ComponentProps<\"input\"> & { invalid?: boolean }) {\n return (\n <input\n data-slot=\"input-group-control\"\n aria-invalid={invalid}\n className={cn(\n \"font-medium min-w-0 flex-1 rounded-none border-0 bg-transparent p-input text-ppx-sm text-ppx-foreground placeholder:font-sans-light placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:outline-none disabled:placeholder:text-ppx-neutral-11\",\n props.type === \"number\" && \"no-arrow-spin\",\n className,\n )}\n {...props}\n />\n );\n}\n","import { useEffect, useEffectEvent, useRef, useState } from \"react\";\n\nexport default function useDebounce<T>(\n callback: () => void,\n delay: number,\n deps: React.DependencyList,\n) {\n const timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n const cb = useEffectEvent(callback);\n\n useEffect(() => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n\n timeout.current = setTimeout(() => {\n cb();\n timeout.current = null;\n }, delay);\n\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n };\n }, [...deps, delay]);\n}\n","import { useRef, useState } from \"react\";\nimport { useInfiniteQuery, type QueryKey } from \"@tanstack/react-query\";\nimport useDebounce from \"./use-debounce\";\n\ntype LoadOptionsData<TData> = {\n options: TData[];\n hasMore: boolean;\n};\n\ntype LoadOptionsReturn<TData> = {\n data: LoadOptionsData<TData>;\n error: any;\n};\n\ntype LoadOptionsFn<TData> = (params: {\n search: string;\n page: number;\n signal: AbortSignal;\n}) => Promise<LoadOptionsReturn<TData>>;\n\nexport function useAsyncOptions<TData = any>(\n params: {\n /**\n * An unique key to identify the cache, used to cache the results.\n * This must be unique\n *\n * @example\n * ```ts\n * const userOptions = defineAsyncOptions({\n * cacheKey: [\"users\"],\n * loader: async ({ page, search }) => {\n * // Your async loading logic here\n * return {\n * data: { options: [], hasMore: false },\n * error: null,\n * };\n * },\n * }),\n * const userOptions = useAsyncOptions(userOptions);\n * ```\n * });\n */\n cacheKey: QueryKey;\n loader: LoadOptionsFn<TData>;\n },\n {\n isOpen,\n inputValue,\n }: {\n isOpen: boolean;\n inputValue: string;\n },\n) {\n const [debouncedSearch, setDebouncedSearch] = useState(inputValue);\n const isFetchedAfterMount = useRef(false);\n\n const query = useInfiniteQuery({\n queryKey: [...params.cacheKey, debouncedSearch],\n queryFn: async ({ pageParam, signal }) => {\n const { error, data } = await params.loader({\n search: debouncedSearch,\n page: pageParam,\n signal,\n });\n\n if (error) {\n throw new Error(error);\n }\n\n return data;\n },\n enabled: isOpen,\n initialPageParam: 1,\n staleTime: () => (isFetchedAfterMount.current ? Infinity : 0),\n getNextPageParam: (lastPage, allPages) =>\n lastPage.hasMore ? allPages.length + 1 : undefined,\n retry: false,\n });\n\n if (query.isFetchedAfterMount && !isFetchedAfterMount.current) {\n isFetchedAfterMount.current = true;\n }\n\n if (inputValue === \"\" && debouncedSearch !== \"\" && isOpen) {\n setDebouncedSearch(\"\");\n }\n\n useDebounce(\n () => {\n setDebouncedSearch(inputValue);\n },\n 300,\n [inputValue],\n );\n\n const items = query.data?.pages.flatMap((page) => page.options) ?? [];\n\n const handleLoadMore = () => {\n query.fetchNextPage();\n };\n\n return {\n items,\n isLoading: query.isLoading,\n isLoadingMore: query.isFetchingNextPage,\n hasMore: query.hasNextPage,\n isError: query.isError,\n onLoadMore: handleLoadMore,\n _query: query,\n };\n}\n\nexport type LoadOptionsConfig<TData> = {\n cacheKey: QueryKey;\n loader: LoadOptionsFn<TData>;\n};\n\nexport function defineLoadOptions<TData = any>(\n loadOptions: LoadOptionsConfig<TData>,\n) {\n return loadOptions;\n}\n\nexport type InferOption<T> =\n T extends LoadOptionsConfig<infer TData> ? TData : never;\nexport type InferOptions<T> =\n T extends LoadOptionsConfig<infer TData> ? TData[] : never;\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { cn } from \"../utils\";\nimport useInfiniteScroll from \"../hooks/use-infinite-scroll\";\nimport { Spinner } from \"./spinner\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport ClearIcon from \"../icons/clear-icon\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport SearchIcon from \"../icons/search-icon\";\nimport CheckIcon from \"../icons/check-icon\";\nimport CloseIcon from \"../icons/close-icon\";\nimport * as InputGroup from \"./input-group\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { useAsyncOptions } from \"../hooks/use-async-options\";\nimport { type LoadOptionsConfig } from \"../hooks/use-async-options\";\n\nconst SINGLE_TEXT_CONTENT_CN =\n \"px-4 py-2 text-ppx-sm min-h-11 flex items-center justify-center text-ppx-muted-foreground\";\n\nexport const List = Combobox.List;\n\ntype ComboboxContextValues = React.ComponentProps<\n typeof Combobox.Root<any, any>\n> & {\n chipsTriggerRef: React.RefObject<HTMLDivElement | null>;\n searchableTriggerRef: React.RefObject<HTMLDivElement | null>;\n invalid?: boolean;\n isLoading?: boolean;\n isLoadingMore?: boolean;\n isError?: boolean;\n hasMore?: boolean;\n onLoadMore?: () => void;\n};\n\nconst ComboboxContext = React.createContext<ComboboxContextValues>(\n {} as ComboboxContextValues,\n);\n\nexport function Root<ItemValue, Multiple extends boolean | undefined = false>({\n children,\n ...props\n}: React.ComponentProps<typeof Combobox.Root<ItemValue, Multiple>> &\n Pick<\n ComboboxContextValues,\n | \"isLoading\"\n | \"isLoadingMore\"\n | \"isError\"\n | \"onLoadMore\"\n | \"hasMore\"\n | \"invalid\"\n > & { loadOptions?: LoadOptionsConfig<ItemValue> }) {\n const chipsTriggerRef = React.useRef<HTMLDivElement>(null);\n const searchableTriggerRef = React.useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n const [inputValue, setInputValue] = React.useState(\"\");\n\n const fallbackProps = {\n open: isOpen,\n onOpenChange: setIsOpen,\n inputValue,\n onInputValueChange: setInputValue,\n };\n\n const mergedProps = {\n ...fallbackProps,\n ...props,\n };\n\n const asyncOptionsProps = props.loadOptions\n ? useAsyncOptions(props.loadOptions, {\n isOpen: mergedProps.open,\n inputValue: mergedProps.inputValue as string,\n })\n : {};\n\n const rootProps = {\n ...asyncOptionsProps,\n ...mergedProps,\n };\n\n const contextValues = {\n ...rootProps,\n chipsTriggerRef,\n searchableTriggerRef,\n };\n\n return (\n <ComboboxContext.Provider value={contextValues}>\n <Combobox.Root autoHighlight {...rootProps}>\n {children}\n </Combobox.Root>\n </ComboboxContext.Provider>\n );\n}\n\nexport function Content({\n empty = \"No options\",\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"trigger\",\n}: React.PropsWithChildren<{\n empty?: string;\n portalProps?: React.ComponentProps<typeof Combobox.Portal>;\n positionerProps?: React.ComponentProps<typeof Combobox.Positioner>;\n popupProps?: React.ComponentProps<typeof Combobox.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n const {\n chipsTriggerRef,\n searchableTriggerRef,\n isLoading,\n isError,\n isLoadingMore,\n hasMore,\n onLoadMore,\n } = useComboboxContext();\n const [infiniteScrollRef] = useInfiniteScroll({\n isLoadingMore: !!isLoadingMore,\n hasMore: !!hasMore,\n onLoadMore: () => onLoadMore?.(),\n disabled: isError,\n });\n\n return (\n <Combobox.Portal {...portalProps}>\n <Combobox.Positioner\n sideOffset={6}\n align=\"start\"\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n anchor={\n positionerProps?.anchor ??\n chipsTriggerRef.current ??\n searchableTriggerRef.current\n }\n >\n <Combobox.Popup\n className={cn(\n DROPDOWN_POPUP_CN,\n \"scroll-pb-2 scroll-pt-2 overscroll-contain\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n {...popupProps}\n >\n {children}\n\n {!isLoading && !isError && (\n <Combobox.Empty\n className={cn(SINGLE_TEXT_CONTENT_CN, \"empty:hidden\")}\n >\n {empty}\n </Combobox.Empty>\n )}\n\n {isLoading && (\n <Combobox.Status className={SINGLE_TEXT_CONTENT_CN}>\n Loading...\n </Combobox.Status>\n )}\n\n {isError && (\n <Combobox.Status className={SINGLE_TEXT_CONTENT_CN}>\n Error loading options\n </Combobox.Status>\n )}\n\n {hasMore && (\n <Combobox.Status\n ref={infiniteScrollRef}\n className=\"flex h-10 items-center justify-center\"\n aria-label=\"Loading more options\"\n >\n <Spinner className=\"stroke-ppx-neutral-10\" size=\"medium\" />\n </Combobox.Status>\n )}\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n );\n}\n\nexport function Item({\n className,\n ...props\n}: React.ComponentProps<typeof Combobox.Item>) {\n return (\n <Combobox.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n {props.children}\n </Combobox.Item>\n );\n}\n\nexport function MultiItem({\n className,\n ...props\n}: React.ComponentProps<typeof Combobox.Item>) {\n return (\n <Combobox.Item\n {...props}\n render={(itemProps, state) => (\n <div {...itemProps} className={cn(DROPDOWN_ITEM_CN, className)}>\n <ItemIndicator selected={state.selected} />\n {props.children}\n </div>\n )}\n ></Combobox.Item>\n );\n}\n\nfunction ItemIndicator(props: { selected: boolean }) {\n return (\n <div\n className={cn(\n \"border-ppx-neutral-10 bg-ppx-background peer flex size-4 shrink-0 items-center justify-center rounded-sm border outline-none transition-colors duration-150\",\n props.selected && \"border-ppx-primary-5 bg-ppx-primary-5 text-white\",\n )}\n >\n <Combobox.ItemIndicator>\n <CheckIcon />\n </Combobox.ItemIndicator>\n </div>\n );\n}\n\nexport function LoadingIndicator(props: { className?: string }) {\n return (\n <div className={cn(\"flex items-center justify-center\", props.className)}>\n <div className=\"flex space-x-1\">\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-40 [animation-delay:-0.3s] [animation-name:bounce-color]\"></div>\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-70 [animation-delay:-0.15s] [animation-name:bounce-color]\"></div>\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-100 [animation-name:bounce-color]\"></div>\n </div>\n </div>\n );\n}\n\nexport function SearchableTrigger(props: {\n placeholder?: string;\n size?: React.ComponentProps<typeof InputGroup.Root>[\"size\"];\n widthVariant?: React.ComponentProps<typeof InputGroup.Root>[\"widthVariant\"];\n className?: string;\n addons?: React.ReactNode;\n}) {\n const { invalid, disabled, searchableTriggerRef } = useComboboxContext();\n\n return (\n <InputGroup.Root {...props} disabled={disabled} ref={searchableTriggerRef}>\n <Combobox.Input\n render={(inputProps) => (\n <InputGroup.Input\n {...inputProps}\n invalid={invalid}\n placeholder={props.placeholder}\n />\n )}\n />\n\n {props.addons}\n <SearchableTriggerDropdownAddon />\n </InputGroup.Root>\n );\n}\n\nexport function SearchableTriggerDropdownAddon() {\n const { isLoading } = useComboboxContext();\n return (\n <InputGroup.Addon align=\"inline-end\" className=\"gap-0.5\">\n {isLoading && <LoadingIndicator className=\"mr-2\" />}\n {!isLoading && (\n <Combobox.Clear\n aria-label=\"Clear selection\"\n render={(clearProps) => (\n <InputGroup.Button size=\"icon-xs\" {...clearProps}>\n <ClearIcon className=\"size-4\" />\n </InputGroup.Button>\n )}\n />\n )}\n <Combobox.Trigger\n render={(triggerProps) => (\n <InputGroup.Button\n size=\"icon-xs\"\n aria-label=\"Open popup\"\n {...triggerProps}\n >\n <ChevronDownIcon />\n </InputGroup.Button>\n )}\n />\n </InputGroup.Addon>\n );\n}\n\ninterface TriggerProps\n extends Combobox.Trigger.Props,\n VariantProps<typeof triggerVariants> {}\n\nexport function Trigger({\n size,\n widthVariant,\n children,\n className,\n ...props\n}: TriggerProps) {\n const { isLoading, invalid } = useComboboxContext();\n return (\n <Combobox.Trigger\n aria-label=\"Open popup\"\n aria-invalid={invalid ?? undefined}\n className={cn(triggerVariants({ size, widthVariant }), className)}\n {...props}\n >\n {children}\n <div className=\"flex shrink-0 items-center gap-2\">\n {isLoading && <LoadingIndicator />}\n <ChevronDownIcon />\n </div>\n </Combobox.Trigger>\n );\n}\n\n/**\n * Renders the value, if `value` is a string or an object with `label` property in it,\n * then renders that value else you should provide a render function to render your custom value\n * **/\nexport function Value({\n children,\n className,\n placeholder,\n ...props\n}: {\n placeholder?: string;\n children?: React.ReactNode | ((selectedValue: any) => React.ReactNode);\n className?: string;\n}) {\n return (\n <span className={cn(\"text-ppx-sm truncate\", className)} {...props}>\n <Combobox.Value>\n {(value) => {\n if (value == null && placeholder) {\n return placeholder;\n }\n\n if (children) {\n return typeof children === \"function\" ? children(value) : children;\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return value.label;\n }\n\n return value;\n }}\n </Combobox.Value>\n </span>\n );\n}\n\nconst chipsTriggerVariants = cva(\n \"p-input text-ppx-sm bg-ppx-neutral-1 inline-flex items-center justify-between border border-ppx-neutral-5 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-ppx-primary-focus aria-invalid:border-ppx-red-4 focus-within:aria-invalid:outline-transparent has-data-disabled:border-ppx-neutral-3 has-data-disabled:bg-ppx-neutral-3 has-data-disabled:text-ppx-neutral-11 has-data-disabled:cursor-not-allowed\",\n {\n variants: {\n size: {\n default: \"rounded-input min-h-input\",\n sm: \"rounded-input-s min-h-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"enforced\",\n },\n },\n);\n\nexport function ChipsTrigger({\n size,\n widthVariant,\n ...props\n}: {\n children: React.ReactNode | ((selectedValue: any) => React.ReactNode);\n placeholder?: string;\n className?: string;\n} & VariantProps<typeof chipsTriggerVariants>) {\n const { chipsTriggerRef, isLoading, invalid } = useComboboxContext();\n return (\n <Combobox.Chips\n className={cn(\n chipsTriggerVariants({ size, widthVariant }),\n props.className,\n )}\n aria-invalid={invalid ?? undefined}\n ref={chipsTriggerRef}\n >\n <div className=\"flex flex-1 flex-wrap items-center gap-1\">\n <Combobox.Value>\n {(value: any[]) => (\n <>\n {value.map((item) => {\n return typeof props.children === \"function\"\n ? props.children(item)\n : props.children;\n })}\n <Combobox.Input\n placeholder={value.length > 0 ? \"\" : props.placeholder}\n className=\"text-ppx-sm text-ppx-foreground min-w-12 flex-1 border-0 outline-none\"\n />\n </>\n )}\n </Combobox.Value>\n </div>\n\n <div className=\"h-stretch-available text-ppx-muted-foreground flex items-center gap-2\">\n {isLoading && <LoadingIndicator />}\n <Combobox.Trigger className=\"h-full\">\n <ChevronDownIcon />\n </Combobox.Trigger>\n </div>\n </Combobox.Chips>\n );\n}\n\nexport function Chip(\n props: React.ComponentProps<typeof Combobox.Chip> & { key: React.Key },\n) {\n return (\n <Combobox.Chip\n {...props}\n className={cn(\n \"bg-ppx-neutral-3 text-ppx-foreground flex cursor-default items-center gap-1 rounded-full py-[0.2rem] pl-2 pr-1 text-sm outline-none\",\n props.className,\n )}\n >\n {props.children}\n <Combobox.ChipRemove\n className=\"hover:border-ppx-neutral-4 hover:bg-ppx-neutral-5 hover:text-ppx-background active:bg-ppx-neutral-6 flex size-5 shrink-0 items-center justify-center rounded-full border border-transparent text-inherit\"\n aria-label=\"Remove\"\n >\n <CloseIcon className=\"size-3\" />\n </Combobox.ChipRemove>\n </Combobox.Chip>\n );\n}\n\nexport function Search({\n placeholder = \"Search options\",\n ...props\n}: React.ComponentProps<typeof Combobox.Input>) {\n return (\n <div className=\"border-ppx-neutral-7 bg-ppx-background p-input sticky top-0 z-10 flex items-center justify-between gap-2 border-b-[0.75px]\">\n <Combobox.Input\n placeholder={placeholder}\n className=\"placeholder:text-ppx-neutral-7 flex-1 text-sm focus:outline-none\"\n data-popup-search\n {...props}\n />\n\n <SearchIcon className=\"text-ppx-neutral-10 size-3.5\" />\n </div>\n );\n}\n\nexport function useComboboxContext() {\n return React.useContext(ComboboxContext);\n}\n\nexport const BaseCombobox = Combobox;\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport { cn } from \"../utils\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport CheckIcon from \"../icons/check-icon\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\ntype SelectContextValues = {\n invalid?: boolean;\n};\n\nconst SelectContext = React.createContext<SelectContextValues>(\n {} as SelectContextValues,\n);\n\nfunction useSelectContext() {\n return React.useContext(SelectContext);\n}\n\nexport function Root<\n Value = any,\n Multiple extends boolean | undefined = false,\n>({\n children,\n invalid,\n ...props\n}: React.ComponentPropsWithoutRef<typeof Select.Root<Value, Multiple>> & {\n invalid?: boolean;\n}) {\n const value = React.useMemo(() => ({ invalid }), [invalid]);\n\n return (\n <SelectContext.Provider value={value}>\n <Select.Root {...props}>{children}</Select.Root>\n </SelectContext.Provider>\n );\n}\n\nexport function Content({\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"trigger\",\n}: React.PropsWithChildren<{\n portalProps?: React.ComponentProps<typeof Select.Portal>;\n positionerProps?: React.ComponentProps<typeof Select.Positioner>;\n popupProps?: React.ComponentProps<typeof Select.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n return (\n <Select.Portal {...portalProps}>\n <Select.Positioner\n sideOffset={6}\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n alignItemWithTrigger={false}\n >\n <Select.Popup\n className={cn(\n DROPDOWN_POPUP_CN,\n \"py-1\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n {...popupProps}\n >\n {children}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n );\n}\n\nexport const List = Select.List;\n\nexport function Item({\n className,\n ...props\n}: React.ComponentProps<typeof Select.Item>) {\n return (\n <Select.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n <Select.ItemText>{props.children}</Select.ItemText>\n </Select.Item>\n );\n}\n\nexport function MultiItem({\n className,\n ...props\n}: React.ComponentProps<typeof Select.Item>) {\n return (\n <Select.Item\n {...props}\n render={(itemProps, state) => (\n <div {...itemProps} className={cn(DROPDOWN_ITEM_CN, className)}>\n <ItemIndicator selected={state.selected} />\n <Select.ItemText>{props.children}</Select.ItemText>\n </div>\n )}\n ></Select.Item>\n );\n}\n\nfunction ItemIndicator(props: { selected: boolean }) {\n return (\n <div\n className={cn(\n \"border-ppx-neutral-10 peer flex size-4 shrink-0 items-center justify-center rounded-sm border bg-white outline-none transition-colors duration-150\",\n props.selected && \"border-ppx-primary-5 bg-ppx-primary-5 text-white\",\n )}\n >\n <Select.ItemIndicator>\n <CheckIcon />\n </Select.ItemIndicator>\n </div>\n );\n}\n\nexport interface TriggerProps\n extends Select.Trigger.Props,\n VariantProps<typeof triggerVariants> {}\n\nexport function Trigger({ size, widthVariant, ...props }: TriggerProps) {\n const { invalid } = useSelectContext();\n return (\n <Select.Trigger\n aria-label=\"Open popup\"\n className={cn(triggerVariants({ size, widthVariant }), props.className)}\n aria-invalid={invalid ?? undefined}\n >\n {props.children}\n\n <Select.Icon className=\"shrink-0\">\n <ChevronDownIcon />\n </Select.Icon>\n </Select.Trigger>\n );\n}\n\nexport function MultiSelectedValue({\n selectedValue,\n maxItems,\n}: {\n selectedValue: any;\n maxItems: number;\n}) {\n if (\n !selectedValue ||\n (Array.isArray(selectedValue) && selectedValue.length === 0)\n ) {\n return null;\n }\n return (\n <div className=\"flex items-center gap-1\">\n <span className=\"truncate\">\n {selectedValue.slice(0, maxItems).join(\", \")}\n </span>\n {selectedValue.length > maxItems && (\n <span className=\"truncate\">\n {`(+${selectedValue.length - maxItems})`}\n </span>\n )}\n </div>\n );\n}\n\n/**\n * Renders the value, if `value` is a string or an object with `label` property in it,\n * then renders that value else you should provide a render function to render your custom value\n * **/\nexport function Value({\n children,\n className,\n placeholder,\n ...props\n}: Select.Value.Props & { placeholder?: string }) {\n return (\n <Select.Value className={cn(\"text-ppx-sm truncate\", className)} {...props}>\n {(value) => {\n if (value == null && placeholder) {\n return placeholder;\n }\n\n if (children) {\n return typeof children === \"function\" ? children(value) : children;\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return value.label;\n }\n\n return value;\n }}\n </Select.Value>\n );\n}\n\nexport type SelectedValue<TValue> = TValue | null | undefined;\n\nexport const BaseSelect = Select;\n","import * as React from \"react\";\nimport { Menu } from \"@base-ui/react/menu\";\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport { type VariantProps } from \"class-variance-authority\";\n\nexport const Root = Menu.Root;\n\nexport function Trigger({\n className,\n children,\n size,\n widthVariant = \"fit\",\n ...props\n}: React.ComponentProps<typeof Menu.Trigger> &\n VariantProps<typeof triggerVariants>) {\n return (\n <Menu.Trigger\n className={cn(triggerVariants({ size, widthVariant }), className)}\n {...props}\n >\n {children}\n <DropdownIndicator />\n </Menu.Trigger>\n );\n}\n\nexport function Content({\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"fit\",\n}: React.PropsWithChildren<{\n portalProps?: React.ComponentProps<typeof Menu.Portal>;\n positionerProps?: React.ComponentProps<typeof Menu.Positioner>;\n popupProps?: React.ComponentProps<typeof Menu.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n return (\n <Menu.Portal {...portalProps}>\n <Menu.Positioner\n sideOffset={6}\n align=\"start\"\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n >\n <Menu.Popup\n {...popupProps}\n className={cn(\n DROPDOWN_POPUP_CN,\n \"py-1\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n >\n {children}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n );\n}\n\nexport function DropdownIndicator() {\n return <ChevronDownIcon className=\"data-popup-open:rotate-180\" />;\n}\n\nexport function Item({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof Menu.Item>) {\n return (\n <Menu.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n {children}\n </Menu.Item>\n );\n}\n\nexport function Separator({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.Separator>) {\n return (\n <Menu.Separator\n className={cn(\"bg-ppx-neutral-5 mx-2 my-1.5 h-px\", className)}\n {...props}\n />\n );\n}\n\nexport const Group = Menu.Group;\n\nexport function GroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.GroupLabel>) {\n return (\n <Menu.GroupLabel\n className={cn(\n \"font-sans-sb text-ppx-sm text-ppx-muted-foreground cursor-default select-none px-4 py-2 uppercase leading-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport const RadioGroup = Menu.RadioGroup;\n\nexport function RadioItem({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.RadioItem>) {\n return (\n <Menu.RadioItem\n className={cn(DROPDOWN_ITEM_CN, className)}\n closeOnClick\n {...props}\n />\n );\n}\n\nexport const BaseTrigger = Menu.Trigger;\n\nexport const BaseMenu = Menu;\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Progress } from \"@base-ui/react/progress\";\n\nconst progressTrackVariants = cva(\n \"relative h-2 w-full overflow-hidden rounded-full bg-ppx-neutral-3\",\n {\n variants: {\n size: {\n default: \"h-2\",\n sm: \"h-1.5\",\n lg: \"h-3\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\nexport const Root = Progress.Root;\n\nexport function Track({\n className,\n size,\n children,\n ...props\n}: React.ComponentProps<typeof Progress.Track> &\n VariantProps<typeof progressTrackVariants>) {\n return (\n <Progress.Track\n className={cn(progressTrackVariants({ size }), className)}\n {...props}\n >\n {children}\n </Progress.Track>\n );\n}\n\nexport function Indicator({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Indicator>) {\n return (\n <Progress.Indicator\n className={cn(\n \"bg-ppx-primary-b-5 h-full w-full flex-1 transition-all duration-300 ease-in-out\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Label({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Label>) {\n return (\n <Progress.Label\n className={cn(\"text-ppx-sm text-ppx-foreground font-medium\", className)}\n {...props}\n />\n );\n}\n\nexport function Value({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Value>) {\n return (\n <Progress.Value\n className={cn(\n \"text-ppx-h4 font-sans-b text-ppx-primary-b-5 flex-shrink-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport const BaseProgress = Progress;\n","import * as React from \"react\";\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst segmentedControlItemVariants = cva(\n \"relative flex items-center justify-center px-4 py-2 text-sm font-medium transition-all duration-200 ease-in-out cursor-pointer rounded-full whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ppx-primary-5 focus-visible:ring-offset-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"text-ppx-neutral-11 data-checked:bg-ppx-primary-5 data-checked:text-white data-checked:shadow-sm hover:text-ppx-neutral-12\",\n },\n size: {\n default: \"min-h-10 px-6\",\n sm: \"min-h-8 px-4 text-xs\",\n lg: \"min-h-12 px-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport function Root({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"segmented-control\"\n className={cn(\n \"bg-ppx-neutral-3 inline-flex items-center rounded-full p-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Item({\n children,\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof Radio.Root> &\n VariantProps<typeof segmentedControlItemVariants> & {\n children: React.ReactNode;\n }) {\n return (\n <Radio.Root\n data-slot=\"segmented-control-item\"\n className={cn(segmentedControlItemVariants({ variant, size, className }))}\n {...props}\n >\n {children}\n </Radio.Root>\n );\n}\n","import * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\n\nimport { cn } from \"../utils\";\n\ntype TabsVariant = \"underline\";\n\ntype TabsContext = {\n variant: TabsVariant;\n};\n\nconst TabsContext = React.createContext<TabsContext | null>(null);\n\nconst useTabs = () => {\n const context = React.useContext(TabsContext);\n\n if (!context) {\n throw new Error(\"useTabs must be used within a Tabs\");\n }\n\n return context;\n};\n\nexport function Root({\n variant = \"underline\",\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Root> & {\n variant?: TabsVariant;\n}) {\n return (\n <TabsContext.Provider value={{ variant }}>\n <BaseTabs.Root\n data-slot=\"tabs\"\n className={cn(\"gap-2 flex flex-col\", className)}\n {...props}\n />\n </TabsContext.Provider>\n );\n}\n\nexport function List({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof BaseTabs.List>) {\n return (\n <BaseTabs.List\n data-slot=\"tabs-list\"\n className={cn(\n \"text-muted-foreground h-9 gap-x-1 p-1 relative z-0 inline-flex w-fit items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n <Indicator />\n <div\n className={\n \"absolute top-[calc(100%-1px)] left-1/2 z-2 h-[2px] w-[calc(100%-8px)] -translate-x-1/2 bg-[#EFEFEF]\"\n }\n />\n </BaseTabs.List>\n );\n}\n\nexport function Trigger({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Tab>) {\n return (\n <BaseTabs.Tab\n data-slot=\"tabs-trigger\"\n className={cn(\n \"focus-visible:ring-ring/50 [&_svg:not([class*='size-'])] gap-1.5 px-2 py-1 text-sm font-medium z-[1] flex-1 items-center justify-center text-nowrap whitespace-nowrap text-ppx-neutral-18 not-data-selected:hover:text-ppx-neutral-12 focus-visible:ring-[3px] data-selected:text-ppx-primary-b-5 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Indicator({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Indicator>) {\n const { variant } = useTabs();\n\n return (\n <BaseTabs.Indicator\n data-slot=\"tab-indicator\"\n className={cn(\n \"left-0 ease-in-out absolute w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)] -translate-y-1/2 transition-all duration-300\",\n variant === \"underline\"\n ? \"top-full z-10 h-[2px] bg-ppx-primary-b-5\"\n : \"\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Content({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Panel>) {\n return (\n <BaseTabs.Panel\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n","import * as React from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\n\nimport { cn } from \"../utils\";\n\nfunction TooltipProvider(\n props: React.ComponentProps<typeof BaseTooltip.Provider>,\n) {\n return <BaseTooltip.Provider data-slot=\"tooltip-provider\" {...props} />;\n}\n\nfunction TooltipPortal({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Portal>) {\n return <BaseTooltip.Portal data-slot=\"tooltip-portal\" {...props} />;\n}\n\nfunction TooltipPositioner({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Positioner>) {\n return <BaseTooltip.Positioner data-slot=\"tooltip-positioner\" {...props} />;\n}\n\nfunction TooltipArrow({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Arrow>) {\n return <BaseTooltip.Arrow data-slot=\"tooltip-arrow\" {...props} />;\n}\n\nexport function Root({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Root>) {\n return (\n <TooltipProvider>\n <BaseTooltip.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nexport const BaseRoot = BaseTooltip.Root;\nexport const BaseProvider = BaseTooltip.Provider;\n\nexport function Trigger({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Trigger>) {\n return <BaseTooltip.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nexport function Content({\n className,\n align = \"center\",\n sideOffset = 8,\n side = \"top\",\n children,\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Popup> & {\n align?: BaseTooltip.Positioner.Props[\"align\"];\n side?: BaseTooltip.Positioner.Props[\"side\"];\n sideOffset?: BaseTooltip.Positioner.Props[\"sideOffset\"];\n}) {\n return (\n <TooltipPortal>\n <TooltipPositioner sideOffset={sideOffset} align={align} side={side}>\n <BaseTooltip.Popup\n data-slot=\"tooltip-content\"\n className={cn(\n \"bg-black text-white px-3 py-1.5 shadow-sm rounded-md z-50 w-fit origin-[var(--transform-origin)] text-ppx-sm text-balance transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n >\n {children}\n <TooltipArrow className=\"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V9H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-black\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-black\"\n />\n </svg>\n </TooltipArrow>\n </BaseTooltip.Popup>\n </TooltipPositioner>\n </TooltipPortal>\n );\n}\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\n\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst checkboxVariants = cva(\n \"peer aria-invalid:border-ppx-red-5 aria-invalid:text-shadow-ppx-red-5 flex items-center justify-center rounded-sm border transition-colors duration-150 outline-none focus-visible:ring-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-white data-checked:bg-ppx-primary-5 data-[indeterminate]:bg-ppx-primary-5 data-checked:text-white data-[indeterminate]:text-white border-ppx-neutral-10 data-checked:border-ppx-primary-5 data-[indeterminate]:border-ppx-primary-5\",\n },\n size: {\n default: \"size-5\",\n sm: \"size-4\",\n lg: \"size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface CheckboxProps\n extends React.ComponentProps<typeof BaseCheckbox.Root>,\n VariantProps<typeof checkboxVariants> {}\n\nfunction Checkbox({ className, ...props }: CheckboxProps) {\n return (\n <BaseCheckbox.Root\n data-slot=\"checkbox\"\n className={cn(\n checkboxVariants({\n variant: props.variant,\n size: props.size,\n }),\n className,\n )}\n {...props}\n >\n <BaseCheckbox.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"block data-[unchecked]:hidden\"\n >\n {props.indeterminate ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"size-3.5\"\n >\n <path d=\"M5 12h14\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"size-3.5\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n )}\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n}\n\nexport { Checkbox };\n","import { cn } from \"../utils\";\nimport { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { Checkbox } from \"./checkbox\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCheckboxGroup>) {\n return (\n <BaseCheckboxGroup className={cn(\"flex gap-4\", className)} {...props} />\n );\n}\n\nexport function Item({\n className,\n invalid,\n children,\n ...rest\n}: React.PropsWithChildren<React.ComponentProps<typeof Checkbox>> & {\n className?: string;\n invalid?: boolean;\n}) {\n return (\n <label\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300\",\n className,\n )}\n >\n <div className=\"flex-1\">{children}</div>\n <Checkbox\n {...rest}\n className={\"ml-auto shrink-0 self-start\"}\n size=\"lg\"\n aria-invalid={invalid}\n />\n </label>\n );\n}\n\nexport function Header(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div className={cn(\"mb-5 flex items-center gap-2\", props.className)}>\n {props.children}\n </div>\n );\n}\n\nexport function Title(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div\n className={cn(\n \"font-sans-sb text-ppx-base text-ppx-foreground\",\n props.className,\n )}\n >\n {props.children}\n </div>\n );\n}\n\nexport function Description(\n props: React.PropsWithChildren<{ className?: string }>,\n) {\n return (\n <p\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground mb-5\",\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n","import * as React from \"react\";\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\n\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"radio-group\"\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nconst radioVariants = cva(\n \"relative inline-flex bg-ppx-background aria-invalid:border-ppx-red-5 aspect-square shrink-0 rounded-full border border-ppx-neutral-10 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] data-disabled:cursor-not-allowed data-disabled:opacity-50 items-center justify-center\",\n {\n variants: {\n variant: {\n default: \"data-checked:border-ppx-primary-5 text-ppx-primary-5\",\n },\n size: {\n default: \"size-5\",\n sm: \"size-4\",\n lg: \"size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface RadioGroupItemProps\n extends React.ComponentProps<typeof Radio.Root>,\n VariantProps<typeof radioVariants> {}\n\nexport function Item({\n className,\n variant,\n size,\n ...props\n}: RadioGroupItemProps) {\n return (\n <Radio.Root\n data-slot=\"radio-group-item\"\n className={cn(radioVariants({ variant, size, className }))}\n {...props}\n >\n <Radio.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\n \"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\",\n size === \"sm\" && \"size-2\",\n size === undefined || size === \"default\" ? \"size-3\" : \"\",\n size === \"lg\" && \"size-3.5\",\n )}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </Radio.Indicator>\n </Radio.Root>\n );\n}\n","import { cn } from \"../utils\";\nimport { Item as RadioGroupItemPrimitive } from \"./radio-group\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"radio-group\"\n className={cn(\"flex gap-4\", className)}\n {...props}\n />\n );\n}\n\nexport function Item({\n className,\n invalid,\n children,\n ...rest\n}: React.PropsWithChildren<\n React.ComponentProps<typeof RadioGroupItemPrimitive>\n> & {\n className?: string;\n invalid?: boolean;\n}) {\n return (\n <label\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300\",\n className,\n )}\n >\n <div className=\"flex-1\">{children}</div>\n <RadioGroupItemPrimitive\n {...rest}\n className={\"ml-auto shrink-0 self-start\"}\n size=\"lg\"\n aria-invalid={invalid}\n />\n </label>\n );\n}\n\nexport function Header(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div className={cn(\"mb-5 flex items-center gap-2\", props.className)}>\n {props.children}\n </div>\n );\n}\n\nexport function Title(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div\n className={cn(\n \"font-sans-sb text-ppx-base text-ppx-foreground\",\n props.className,\n )}\n >\n {props.children}\n </div>\n );\n}\n\nexport function Description(\n props: React.PropsWithChildren<{ className?: string }>,\n) {\n return (\n <p\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground mb-5\",\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n","import * as React from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\n\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />;\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"gap-1.5 ppx-sm:gap-2.5 flex flex-wrap items-center text-ppx-xs break-words text-ppx-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"gap-1.5 inline-flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbLink({\n className,\n render,\n ...props\n}: React.ComponentProps<\"a\"> & useRender.ComponentProps<\"a\">) {\n const element = useRender({\n defaultTagName: \"a\",\n render,\n props: mergeProps<\"a\">(\n {\n className: cn(\n \"transition-colors hover:text-ppx-foreground hover:underline underline-offset-3\",\n className,\n ),\n },\n props,\n ),\n });\n\n return element;\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n <ChevronDownIcon className={cn(\"stroke-black rotate-270\", className)} />\n </li>\n );\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n};\n","import * as React from \"react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react\";\n\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nexport function Root({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCollapsible.Root>) {\n return (\n <BaseCollapsible.Root\n data-slot=\"collapsible\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n );\n}\n\nexport function Trigger(\n props: React.ComponentProps<typeof BaseCollapsible.Trigger>,\n) {\n return (\n <BaseCollapsible.Trigger\n data-slot=\"collapsible-trigger\"\n {...props}\n className={cn(\"group flex items-center gap-2\", props.className)}\n />\n );\n}\n\nexport function Panel({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCollapsible.Panel>) {\n return (\n <BaseCollapsible.Panel\n data-slot=\"collapsible-content\"\n className={cn(\n \"flex h-[var(--collapsible-panel-height)] w-full flex-col overflow-hidden transition-all duration-150 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0 [&[hidden]:not([hidden='until-found'])]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function ToggleIcon() {\n return (\n <ChevronDownIcon className=\"rotate-270 group-data-[panel-open]:rotate-360 transition-all ease-out\" />\n );\n}\n","import * as React from \"react\";\nimport {\n DayButton,\n DayPicker,\n getDefaultClassNames,\n type DayPickerProps,\n} from \"react-day-picker\";\n\nimport { cn } from \"../utils\";\nimport { Button, buttonVariants } from \"./button\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n formatters,\n components,\n ...props\n}: DayPickerProps) {\n const defaultClassNames = getDefaultClassNames();\n const buttonVariant = \"ghost\";\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-ppx-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit min-w-input\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col ppx-md:flex-row relative\",\n defaultClassNames.months,\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"w-full flex items-center text-ppx-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative border border-ppx-neutral-5 shadow-xs rounded-ppx-s\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\n \"absolute bg-white inset-0 opacity-0\",\n defaultClassNames.dropdown,\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-ppx-s pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-ppx-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label,\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-ppx-muted-foreground rounded-ppx-s flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-ppx-muted-foreground\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-ppx-s group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-ppx-s\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-ppx-s\",\n defaultClassNames.day,\n ),\n range_start: cn(\"rounded-l-ppx-s\", defaultClassNames.range_start),\n range_middle: cn(\n \"rounded-none bg-ppx-primary-b-1\",\n defaultClassNames.range_middle,\n ),\n range_end: cn(\"rounded-r-ppx-s\", defaultClassNames.range_end),\n today: cn(\n \"bg-ppx-primary-b-1 text-ppx-foreground rounded-ppx-s data-[selected=true]:rounded-none\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-ppx-muted-foreground aria-selected:text-ppx-muted-foreground\",\n defaultClassNames.outside,\n ),\n disabled: cn(\n \"text-ppx-muted-foreground opacity-50\",\n defaultClassNames.disabled,\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronDownIcon\n className={cn(\"rotate-90\", className)}\n {...props}\n />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronDownIcon\n className={cn(\"rotate-270\", className)}\n {...props}\n />\n );\n }\n\n return <ChevronDownIcon className={cn(className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"size-(--cell-size) flex items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"min-w-(--cell-size) flex aspect-square size-auto w-full flex-col gap-1 font-normal leading-none [&>span]:text-[0.75rem] [&>span]:opacity-70\",\n // Focus styles\n \"ring-ppx-neutral-3 group-data-[focused=true]/day:ring-ppx-primary-5/50 group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px]\",\n // Single date selection\n \"data-[selected-single=true]:bg-ppx-primary-5 data-[selected-single=true]:hover:bg-ppx-primary-5 data-[selected-single=true]:text-white data-[selected-single=true]:hover:text-white\",\n // Range start\n \"data-[range-start=true]:rounded-ppx-s data-[range-start=true]:rounded-l-ppx-s data-[range-start=true]:bg-ppx-primary-5 data-[range-start=true]:hover:bg-ppx-primary-5 data-[range-start=true]:text-white\",\n // Range end\n \"data-[range-end=true]:rounded-ppx-s data-[range-end=true]:rounded-r-ppx-s data-[range-end=true]:bg-ppx-primary-5 data-[range-end=true]:hover:bg-ppx-primary-5 data-[range-end=true]:text-white\",\n // Range middle\n \"data-[range-middle=true]:bg-ppx-primary-b-1 data-[range-middle=true]:text-ppx-foreground data-[range-middle=true]:hover:bg-ppx-primary-b-1 data-[range-middle=true]:rounded-none\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n","import { cn } from \"../utils\";\n\nexport default function CircleAlertIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function CircleCheckIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function InfoIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function TriangleAlertIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function SpinnerIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n","import { Toast } from \"@base-ui/react\";\nimport CircleAlertIcon from \"../icons/circle-alert-icon\";\nimport CircleCheckIcon from \"../icons/circle-check-icon\";\nimport InfoIcon from \"../icons/info-icon\";\nimport TriangleAlertIcon from \"../icons/triangle-alert-icon\";\nimport SpinnerIcon from \"../icons/spinner-icon\";\n\nimport { cn } from \"../utils\";\nimport { buttonVariants } from \"./button\";\nimport CloseIcon from \"../icons/close-icon\";\n\nconst toast = Toast.createToastManager();\nconst anchoredToast = Toast.createToastManager();\n\ntype ToastVariants =\n | \"success\"\n | \"info\"\n | \"loading\"\n | \"success\"\n | \"warning\"\n | \"error\";\n\nconst TOAST_ICONS: Record<ToastVariants, any> = {\n error: CircleAlertIcon,\n info: InfoIcon,\n loading: SpinnerIcon,\n success: CircleCheckIcon,\n warning: TriangleAlertIcon,\n} as const;\n\ntype ToastPosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\ninterface ToastProviderProps extends Toast.Provider.Props {\n position?: ToastPosition;\n}\n\nfunction ToastProvider({\n children,\n position = \"top-center\",\n ...props\n}: ToastProviderProps) {\n return (\n <Toast.Provider toastManager={toast} {...props}>\n {children}\n <Toasts position={position} />\n </Toast.Provider>\n );\n}\n\nfunction Toasts(props: { position: ToastPosition }) {\n const { position = \"top-center\" } = props;\n const { toasts } = Toast.useToastManager();\n\n const isTop = position.startsWith(\"top\");\n const hasLoadingToast = toasts.some((t) => t.type === \"loading\");\n\n return (\n <Toast.Portal data-slot=\"toast-portal\">\n {hasLoadingToast && (\n <div\n className=\"bg-ppx-foreground/20 fixed inset-0 z-40 transition-opacity\"\n data-slot=\"toast-backdrop\"\n />\n )}\n <Toast.Viewport\n className={cn(\n \"max-w-90 fixed z-50 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]\",\n // Vertical positioning\n \"data-[position*=top]:top-(--toast-inset)\",\n \"data-[position*=bottom]:bottom-(--toast-inset)\",\n // Horizontal positioning\n \"data-[position*=left]:left-(--toast-inset)\",\n \"data-[position*=right]:right-(--toast-inset)\",\n \"data-[position*=center]:left-1/2 data-[position*=center]:-translate-x-1/2\",\n )}\n data-position={position}\n data-slot=\"toast-viewport\"\n >\n {toasts.map((toast) => {\n const Icon = toast.type\n ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS]\n : null;\n\n return (\n <Toast.Root\n className={cn(\n \"h-(--toast-calc-height) bg-ppx-background text-ppx-foreground rounded-ppx-m border-ppx-neutral-4 absolute z-[calc(9999-var(--toast-index))] w-full select-none border bg-clip-padding shadow-lg [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-ppx-m)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)]\",\n // Base positioning using data-position\n \"data-[position*=right]:left-auto data-[position*=right]:right-0\",\n \"data-[position*=left]:left-0 data-[position*=left]:right-auto\",\n \"data-[position*=center]:left-0 data-[position*=center]:right-0\",\n \"data-[position*=top]:bottom-auto data-[position*=top]:top-0 data-[position*=top]:origin-top\",\n \"data-[position*=bottom]:bottom-0 data-[position*=bottom]:top-auto data-[position*=bottom]:origin-bottom\",\n // Gap fill for hover\n \"after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full\",\n \"data-[position*=top]:after:top-full\",\n \"data-[position*=bottom]:after:bottom-full\",\n // Define some variables\n \"[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]\",\n // Define offset-y variable\n \"data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]\",\n \"data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]\",\n // Default state transform\n \"data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]\",\n \"data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]\",\n // Limited state\n \"data-limited:opacity-0\",\n // Expanded state\n \"data-expanded:h-(--toast-height)\",\n \"data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]\",\n // Starting and ending animations\n \"data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]\",\n \"data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]\",\n \"data-ending-style:opacity-0\",\n // Ending animations (direction-aware)\n \"data-[position*=top]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(-100%-var(--toast-inset)))]\",\n \"data-[position*=bottom]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]\",\n \"data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]\",\n \"data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]\",\n // Ending animations (expanded)\n \"data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]\",\n toast.type === \"success\" && \"bg-ppx-green-1\",\n toast.type === \"info\" && \"bg-ppx-primary-b-1\",\n toast.type === \"warning\" && \"bg-ppx-yellow-1\",\n toast.type === \"error\" && \"bg-ppx-red-1\",\n )}\n data-position={position}\n key={toast.id}\n swipeDirection={\n position.includes(\"center\")\n ? [isTop ? \"up\" : \"down\"]\n : position.includes(\"left\")\n ? [\"left\", isTop ? \"up\" : \"down\"]\n : [\"right\", isTop ? \"up\" : \"down\"]\n }\n toast={toast}\n >\n <Toast.Content className=\"duration-250 data-behind:pointer-events-none data-behind:opacity-0 data-expanded:opacity-100 text-ppx-sm pointer-events-auto flex flex-col gap-2.5 overflow-hidden px-3.5 py-4 transition-opacity\">\n <div className=\"flex gap-2\">\n {Icon && (\n <div\n className=\"[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\"\n data-slot=\"toast-icon\"\n >\n <Icon className=\"in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80\" />\n </div>\n )}\n\n <div className=\"flex flex-col gap-1.5\">\n <Toast.Title\n className=\"text-ppx-base font-medium leading-none\"\n data-slot=\"toast-title\"\n />\n <Toast.Description\n className=\"text-ppx-muted-foreground\"\n data-slot=\"toast-description\"\n />\n\n {toast.type === \"loading\" ? null : (\n <Toast.Close\n className={buttonVariants({\n size: \"icon-sm\",\n variant: \"ghost\",\n className: \"absolute right-2 top-2 shrink-0\",\n })}\n aria-label=\"Close\"\n >\n <CloseIcon className=\"size-4\" />\n </Toast.Close>\n )}\n </div>\n </div>\n {toast.actionProps && (\n <Toast.Action\n className={buttonVariants({\n size: \"sm\",\n })}\n data-slot=\"toast-action\"\n >\n {toast.actionProps.children}\n </Toast.Action>\n )}\n </Toast.Content>\n </Toast.Root>\n );\n })}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n\nfunction AnchoredToastProvider({ children, ...props }: Toast.Provider.Props) {\n return (\n <Toast.Provider toastManager={anchoredToast} {...props}>\n {children}\n <AnchoredToasts />\n </Toast.Provider>\n );\n}\n\nfunction AnchoredToasts() {\n const { toasts } = Toast.useToastManager();\n\n return (\n <Toast.Portal data-slot=\"toast-portal-anchored\">\n <Toast.Viewport\n className=\"outline-none\"\n data-slot=\"toast-viewport-anchored\"\n >\n {toasts.map((toast) => {\n const Icon = toast.type\n ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS]\n : null;\n const tooltipStyle =\n (toast.data as { tooltipStyle?: boolean })?.tooltipStyle ?? false;\n const positionerProps = toast.positionerProps;\n\n if (!positionerProps?.anchor) {\n return null;\n }\n\n return (\n <Toast.Positioner\n className=\"z-50 max-w-[min(--spacing(64),var(--available-width))]\"\n data-slot=\"toast-positioner\"\n key={toast.id}\n sideOffset={positionerProps.sideOffset ?? 4}\n toast={toast}\n >\n <Toast.Root\n className={cn(\n \"bg-ppx-background text-ppx-foreground data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 text-ppx-sm relative text-balance border bg-clip-padding transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)]\",\n tooltipStyle\n ? \"rounded-ppx-m shadow-md shadow-black/5 before:rounded-[calc(var(--radius-ppx-s)-1px)]\"\n : \"rounded-ppx-l shadow-lg before:rounded-[calc(var(--radius-ppx-m)-1px)]\",\n toast.type === \"success\" && \"bg-ppx-green-1\",\n toast.type === \"info\" && \"bg-ppx-primary-b-1\",\n toast.type === \"warning\" && \"bg-ppx-yellow-1\",\n toast.type === \"error\" && \"bg-ppx-red-1\",\n )}\n data-slot=\"toast-popup\"\n toast={toast}\n >\n {tooltipStyle ? (\n <Toast.Content className=\"pointer-events-auto px-2 py-1\">\n <Toast.Title data-slot=\"toast-title\" />\n </Toast.Content>\n ) : (\n <Toast.Content className=\"text-ppx-sm pointer-events-auto relative flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3\">\n <div className=\"flex gap-2\">\n {Icon && (\n <div\n className=\"[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\"\n data-slot=\"toast-icon\"\n >\n <Icon className=\"in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80\" />\n </div>\n )}\n\n <div className=\"flex flex-col gap-0.5\">\n <Toast.Title\n className=\"text-ppx-base font-medium leading-none\"\n data-slot=\"toast-title\"\n />\n <Toast.Description\n className=\"text-ppx-muted-foreground\"\n data-slot=\"toast-description\"\n />\n </div>\n </div>\n {toast.actionProps && (\n <Toast.Action\n className={buttonVariants({ size: \"sm\" })}\n data-slot=\"toast-action\"\n >\n {toast.actionProps.children}\n </Toast.Action>\n )}\n </Toast.Content>\n )}\n </Toast.Root>\n </Toast.Positioner>\n );\n })}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n\nexport {\n ToastProvider,\n type ToastPosition,\n toast,\n AnchoredToastProvider,\n anchoredToast,\n};\n","import { createContext } from \"react\";\nimport { AnchoredToastProvider, ToastProvider } from \"../components/toast\";\n\nconst PXUIContext = createContext(null);\n\nexport function PXUIProvider(props: React.PropsWithChildren) {\n return (\n <PXUIContext.Provider value={null}>\n <ToastProvider>\n <AnchoredToastProvider>{props.children}</AnchoredToastProvider>\n </ToastProvider>\n </PXUIContext.Provider>\n );\n}\n","import { cn } from \"../utils\";\n\nfunction Label({ className, ...props }: React.ComponentProps<\"label\">) {\n return (\n <label\n data-slot=\"label\"\n className={cn(\n \"text-ppx-sm peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-50 group-data-disabled:pointer-events-none group-data-disabled:opacity-50 flex select-none items-center gap-2 font-medium leading-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst inputVariants = cva(\n \"font-medium shadow-xs inline-flex border-ppx-neutral-5 bg-ppx-neutral-1 text-ppx-sm text-ppx-foreground outline-transparent focus:-outline-offset-1 focus:outline-2 placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:not-aria-invalid:outline-ppx-primary-focus focus:not-aria-invalid:not-aria-disabled:bg-ppx-background focus:not-aria-invalid:bg-white disabled:cursor-not-allowed disabled:border-ppx-neutral-3 disabled:bg-ppx-neutral-3 disabled:text-ppx-neutral-11 disabled:placeholder:text-ppx-neutral-11 aria-invalid:outline-ppx-red-4 aria-invalid:bg-ppx-red-1 aria-invalid:outline aria-invalid:-outline-offset-1 placeholder:font-sans-light p-input border\",\n {\n variants: {\n size: {\n default: \"h-input rounded-input\",\n sm: \"h-input-s rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\ninterface InputProps\n extends Omit<React.ComponentProps<\"input\">, \"size\">,\n VariantProps<typeof inputVariants> {\n invalid?: boolean;\n}\n\nfunction Input({\n className,\n size,\n invalid,\n widthVariant,\n ...props\n}: InputProps) {\n return (\n <input\n data-slot=\"input\"\n className={cn(\n inputVariants({ size, widthVariant }),\n props.type === \"number\" && \"no-arrow-spin\",\n className,\n )}\n aria-invalid={invalid}\n {...props}\n />\n );\n}\n\nexport { Input };\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils\";\n\nconst textareaVariants = cva(\n \"font-medium shadow-xs border-ppx-neutral-5 bg-ppx-neutral-1 text-ppx-sm text-ppx-foreground outline-transparent focus:-outline-offset-1 focus:outline-2 placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:not-aria-invalid:outline-ppx-primary-focus focus:not-aria-invalid:bg-ppx-background disabled:cursor-not-allowed disabled:border-ppx-neutral-3 disabled:bg-ppx-neutral-3 disabled:text-ppx-neutral-11 disabled:placeholder:text-ppx-neutral-11 aria-invalid:outline-ppx-red-4 aria-invalid:bg-ppx-red-1 aria-invalid:outline aria-invalid:-outline-offset-1 placeholder:font-sans-light p-input border\",\n {\n variants: {\n size: {\n default: \"min-h-16 rounded-input\",\n sm: \"min-h-12 rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\nexport interface TextareaProps\n extends React.ComponentProps<\"textarea\">,\n VariantProps<typeof textareaVariants> {\n invalid?: boolean;\n}\n\nfunction Textarea({\n className,\n size,\n invalid,\n widthVariant,\n ...props\n}: TextareaProps) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(textareaVariants({ size, widthVariant }), className)}\n aria-invalid={invalid}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import { Avatar as AvatarBase } from \"@base-ui/react/avatar\";\nimport { cn } from \"../utils\";\nimport { useMemo } from \"react\";\nimport * as Tooltip from \"./tooltip\";\n\ntype AvatarVariant = \"squared\" | \"rounded\";\n\nconst COLORS_PALETTE = [\n \"#bdc3c7\",\n \"#6f7b87\",\n \"#2c3e50\",\n \"#2f3193\",\n \"#662d91\",\n \"#922790\",\n \"#ec2176\",\n \"#ed1c24\",\n \"#f36622\",\n \"#f8941e\",\n \"#fab70f\",\n \"#fdde00\",\n \"#d1d219\",\n \"#8ec73f\",\n \"#00a650\",\n \"#00aa9c\",\n \"#00adef\",\n \"#0081cd\",\n \"#005bab\",\n \"#012a4a\",\n \"#013a63\",\n \"#06d6a0\",\n \"#ef476f\",\n \"#ff5d8f\",\n \"#0496ff\",\n \"#c879ff\",\n];\n\nconst generateNameInitials = (name: string) => {\n if (!name.length) return \"\";\n const rgx = new RegExp(/(\\b\\w)/g);\n\n const initials = [...name.matchAll(rgx)];\n return (\n (initials.shift()?.[1] || \"\") + (initials.pop()?.[1] || \"\")\n ).toUpperCase();\n};\n\nconst getBgColorAndTextColor = (name: string | null | undefined) => {\n if (!name) return {};\n let index = name[0].toUpperCase().charCodeAt(0);\n\n const lastName = name.split(\" \")[1];\n\n if (lastName) {\n index = index + lastName[0].toUpperCase().charCodeAt(0);\n index = Math.floor(index / 2);\n }\n\n index = Math.abs(index - 65);\n\n return {\n backgroundColor: COLORS_PALETTE[index],\n color: \"#fff\",\n };\n};\n\nconst replaceSizeInUrl = (url: string, size: string) => {\n const numberSize = size.replace(\"px\", \"\");\n const newSize = `${numberSize}x${numberSize}`;\n return url.replace(\"/SIZE/\", `/${newSize}/`);\n};\n\ninterface AvatarProps {\n imgSrc: string | null | undefined;\n name: string | null | undefined;\n variant?: AvatarVariant;\n size?: `${number}px`;\n className?: string;\n children?: React.ReactNode;\n hideTooltip?: boolean;\n}\n\nexport function Avatar(props: AvatarProps) {\n return (\n <Tooltip.Root disabled={props.hideTooltip}>\n <Tooltip.Trigger\n render={(tooltipProps) => (\n <AvatarImpl {...props} avatarRootProps={tooltipProps} />\n )}\n />\n <Tooltip.Content>{props.name}</Tooltip.Content>\n </Tooltip.Root>\n );\n}\n\ntype AvatarImplProps = Omit<AvatarProps, \"hideTooltip\"> & {\n avatarRootProps?: React.ComponentProps<typeof AvatarBase.Root>;\n};\n\nexport function AvatarImpl(props: AvatarImplProps) {\n const { variant = \"squared\", size = \"100px\", avatarRootProps } = props;\n const name = props.name ?? \"\";\n const nameInitial = useMemo(() => generateNameInitials(name), [name]);\n const colorStyle = useMemo(() => getBgColorAndTextColor(name), [name]);\n const sizeReplacedUrl = useMemo(\n () => (props.imgSrc ? replaceSizeInUrl(props.imgSrc, size) : undefined),\n [props.imgSrc, size],\n );\n\n return (\n <AvatarBase.Root\n data-slot=\"avatar\"\n className={cn(\n \"@container relative flex shrink-0 overflow-hidden\",\n variant === \"rounded\" && \"rounded-full\",\n variant === \"squared\" && \"rounded-ppx-s\",\n props.className,\n )}\n style={{\n width: size,\n height: size,\n }}\n {...avatarRootProps}\n >\n <AvatarBase.Image\n data-slot=\"avatar-image\"\n className={\"size-full object-cover\"}\n src={sizeReplacedUrl}\n />\n\n <AvatarBase.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"font-medium flex size-full items-center justify-center text-[40cqw] select-none\",\n )}\n style={colorStyle}\n >\n {nameInitial}\n </AvatarBase.Fallback>\n\n {props.children}\n </AvatarBase.Root>\n );\n}\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Avatar, AvatarImpl } from \"./avatar\";\nimport * as Popover from \"./popover\";\nimport * as Tooltip from \"./tooltip\";\n\ninterface AvatarGroupProps {\n avatars: React.ComponentProps<typeof Avatar>[];\n max?: number;\n className?: string;\n}\n\nexport function AvatarGroup({ max = 4, avatars, className }: AvatarGroupProps) {\n const hasOverflow = avatars.length > max;\n const overflowAvatars = avatars.slice(max);\n\n return (\n <Tooltip.BaseProvider>\n <div\n className={cn(\"flex items-center\", className)}\n data-slot=\"avatar-group\"\n >\n {avatars.map((avatar, index) => (\n <React.Fragment key={avatar.name}>\n <Tooltip.BaseRoot>\n <Tooltip.Trigger\n render={(tooltipProps) => (\n <div\n className=\"relative\"\n style={{\n marginLeft:\n index > 0\n ? `-${parseInt(avatar.size ?? \"100px\") * 0.25}px`\n : \"0\",\n zIndex: avatars.length - index,\n }}\n {...tooltipProps}\n >\n <AvatarImpl {...avatar} className=\"ring-2 ring-white\" />\n </div>\n )}\n />\n <Tooltip.Content>{avatar.name}</Tooltip.Content>\n </Tooltip.BaseRoot>\n </React.Fragment>\n ))}\n\n {hasOverflow && (\n <div\n className=\"relative\"\n style={{\n marginLeft: `-${parseInt(avatars[0].size ?? \"100px\") * 0.25}px`,\n zIndex: 0,\n }}\n >\n <Popover.Root>\n <Popover.Trigger openOnHover>\n <div\n className={cn(\n \"bg-ppx-neutral-3 text-ppx-neutral-18 hover:bg-ppx-neutral-4 flex cursor-pointer items-center justify-center font-medium transition-colors\",\n avatars[0].variant === \"rounded\"\n ? \"rounded-full\"\n : \"rounded-ppx-s\",\n )}\n style={{\n width: avatars[0].size ?? \"100px\",\n height: avatars[0].size ?? \"100px\",\n fontSize: `${parseInt(avatars[0].size ?? \"100px\") * 0.3}px`,\n }}\n >\n +{overflowAvatars.length}\n </div>\n </Popover.Trigger>\n\n <Popover.Content\n className=\"w-80\"\n positionerProps={{ align: \"start\", side: \"top\" }}\n >\n <div className=\"max-h-64 space-y-2 overflow-y-auto\">\n {overflowAvatars.map((avatar) => (\n <div\n key={avatar.name}\n className=\"flex items-center gap-3 rounded-md p-2\"\n >\n <Avatar {...avatar} size=\"24px\" hideTooltip />\n <span className=\"text-ppx-neutral-18 text-sm font-medium\">\n {avatar.name}\n </span>\n </div>\n ))}\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n )}\n </div>\n </Tooltip.BaseProvider>\n );\n}\n","import * as React from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\n\nimport { cn } from \"../utils\";\n\nfunction Switch({\n className,\n size,\n ...props\n}: React.ComponentProps<typeof BaseSwitch.Root> & {\n size?: \"sm\" | \"lg\" | \"default\";\n}) {\n return (\n <BaseSwitch.Root\n data-slot=\"switch\"\n className={cn(\n \"shadow-xs focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30 data-checked:bg-ppx-primary-5 data-unchecked:bg-ppx-neutral-4 data-disabled:cursor-not-allowed data-disabled:opacity-50 peer inline-flex shrink-0 items-center rounded-full border border-transparent outline-none transition-all\",\n size === \"sm\" && \"h-4 w-8\",\n size === undefined || size === \"default\" ? \"h-5 w-10\" : \"\",\n size === \"lg\" && \"h-6 w-12\",\n className,\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n \"bg-ppx-neutral-1 pointer-events-none block rounded-full ring-0 transition-transform duration-300 ease-in-out\",\n size === \"sm\" && \"data-checked:translate-x-[calc(100%+2px)] size-3.5\",\n size === undefined || size === \"default\"\n ? \"data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-4\"\n : \"\",\n size === \"lg\" &&\n \"data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-5\",\n )}\n />\n </BaseSwitch.Root>\n );\n}\n\nexport { Switch };\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\n\n// https://www.radix-ui.com/primitives/docs/components/separator\nexport function Separator({\n className,\n orientation = \"vertical\",\n decorative = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n orientation: \"horizontal\" | \"vertical\";\n decorative?: boolean;\n}) {\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n const ariaOrientation = orientation === \"vertical\" ? orientation : undefined;\n const semanticProps = decorative\n ? { role: \"none\" }\n : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n\n return (\n <div\n data-orientation={orientation}\n {...semanticProps}\n data-slot=\"separator\"\n className={cn(\n \"shrink-0 bg-ppx-neutral-3 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className,\n )}\n {...props}\n />\n );\n}\n\nSeparator.displayName = \"Separator\";\n","export default function CalenderIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 768 768\"\n {...props}\n >\n <path d=\"M618.645 61.378h-35.458v-61.379h-66.743v61.379h-266.974v-61.379h-66.743v61.379h-33.372c-55.205 0-100.115 44.91-100.115 100.115v506.391c0 55.206 44.91 100.115 100.115 100.115h469.29c55.206 0 100.115-44.909 100.115-100.115v-506.391c0-55.205-44.909-100.115-100.115-100.115zM652.016 667.885c0 18.396-14.968 33.372-25.029 33.372h-469.29c-26.747 0-41.715-14.976-41.715-33.372v-408.803h536.033v408.803zM566.71 500.817h-142.247v117.226h142.247v-117.226zM566.71 331.664h-142.247v117.226h142.247v-117.226zM343.537 331.664h-142.247v117.226h142.247v-117.226zM343.537 500.817h-142.247v117.226h142.247v-117.226z\"></path>\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { format as formatDate } from \"date-fns\";\nimport { cn } from \"../utils\";\nimport { Calendar } from \"./calendar\";\nimport * as Popover from \"./popover\";\nimport { triggerVariants } from \"../tw-styles/dropdown\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport CalenderIcon from \"../icons/calendar-icon\";\nimport { type OnSelectHandler } from \"react-day-picker\";\n\ntype CalendarProps = React.ComponentProps<typeof Calendar>;\n\ntype DatePickerProps = {\n placeholder?: string;\n format?: string;\n trailingIcon?: React.ReactNode;\n invalid?: boolean;\n\n triggerProps?: VariantProps<typeof triggerVariants> & {\n className?: string;\n disabled?: boolean;\n };\n\n renderTriggerContent?: React.ReactNode;\n\n popoverRootProps?: Omit<\n React.ComponentProps<typeof Popover.Root>,\n \"children\"\n >;\n popoverContentProps?: React.ComponentProps<typeof Popover.Content>;\n} & CalendarProps;\n\nexport function DatePicker({\n triggerProps,\n placeholder = \"Pick a date\",\n format = \"yyyy-MM-dd\",\n invalid,\n trailingIcon,\n renderTriggerContent,\n\n popoverRootProps,\n popoverContentProps,\n\n ...calendarProps\n}: DatePickerProps) {\n const [open, setOpen] = React.useState(false);\n\n const handleSelect: OnSelectHandler<Date> = (...args) => {\n (calendarProps as Record<string, any>).onSelect(...args);\n !calendarProps.mode || (calendarProps.mode === \"single\" && setOpen(false));\n };\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen} {...popoverRootProps}>\n <Popover.Trigger\n disabled={triggerProps?.disabled}\n className={cn(\n triggerVariants({\n size: triggerProps?.size,\n widthVariant: triggerProps?.widthVariant,\n }),\n \"gap-2.5\",\n triggerProps?.className,\n )}\n aria-invalid={invalid}\n aria-label=\"Open date picker\"\n >\n {renderTriggerContent ||\n renderFormattedDate(calendarProps, format) ||\n placeholder}\n\n {trailingIcon ?? (\n <CalenderIcon\n className={cn(\n \"text-ppx-foreground size-5 shrink-0\",\n triggerProps?.disabled && \"opacity-50\",\n )}\n />\n )}\n </Popover.Trigger>\n <Popover.Content\n className={cn(\"p-0\", popoverContentProps?.className)}\n {...popoverContentProps}\n >\n {/* @ts-expect-error */}\n <Calendar {...calendarProps} onSelect={handleSelect} />\n </Popover.Content>\n </Popover.Root>\n );\n}\n\nfunction renderFormattedDate(calendarProps: CalendarProps, format: string) {\n if (calendarProps.mode === \"single\" && calendarProps.selected) {\n return formatDate(calendarProps.selected, format);\n }\n\n if (calendarProps.mode === \"range\" && calendarProps.selected?.from) {\n let formattedDate = formatDate(calendarProps.selected.from, format);\n\n if (\n calendarProps.selected.to &&\n calendarProps.selected.from !== calendarProps.selected.to\n ) {\n formattedDate = `${formattedDate} - ${formatDate(calendarProps.selected.to, format)}`;\n }\n\n return formattedDate;\n }\n\n if (calendarProps.mode === \"multiple\" && calendarProps.selected?.length) {\n return calendarProps.selected\n .map((date) => formatDate(date, format))\n .join(\", \");\n }\n\n return \"\";\n}\n","import * as React from \"react\";\n\ninterface UploadCloudIconProps extends React.SVGProps<SVGSVGElement> {\n size?: number;\n}\n\nexport default function UploadCloudIcon({\n size = 24,\n ...props\n}: UploadCloudIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM8 13H10.55V16H13.45V13H16L12 9L8 13Z\" />\n </svg>\n );\n}\n\n","import { cn } from \"../utils\";\n\nexport default function RetryIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 2v6h-6\" />\n <path d=\"M3 12a9 9 0 0 1 15-6.7L21 8\" />\n <path d=\"M3 22v-6h6\" />\n <path d=\"M21 12a9 9 0 0 1-15 6.7L3 16\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function UploadIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"17 8 12 3 7 8\" />\n <line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\" />\n </svg>\n );\n}\n","import {\n type ChangeEvent,\n type DragEvent,\n type InputHTMLAttributes,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nexport type FileMetadata = {\n name: string;\n size: number;\n type: string;\n url: string;\n id: string;\n};\n\nexport type FileWithPreview = {\n file: File | FileMetadata;\n id: string;\n preview?: string;\n};\n\nexport type FileUploadOptions = {\n maxFiles?: number; // Only used when multiple is true, defaults to Infinity\n maxSize?: number; // in bytes\n accept?: string;\n multiple?: boolean; // Defaults to false\n initialFiles?: FileMetadata[];\n onFilesChange?: (files: FileWithPreview[]) => void; // Callback when files change\n onFilesAdded?: (addedFiles: FileWithPreview[]) => void; // Callback when new files are added\n};\n\nexport type FileUploadState = {\n files: FileWithPreview[];\n isDragging: boolean;\n errors: string[];\n};\n\nexport type FileUploadActions = {\n addFiles: (files: FileList | File[]) => void;\n removeFile: (id: string) => void;\n clearFiles: () => void;\n clearErrors: () => void;\n handleDragEnter: (e: DragEvent<HTMLElement>) => void;\n handleDragLeave: (e: DragEvent<HTMLElement>) => void;\n handleDragOver: (e: DragEvent<HTMLElement>) => void;\n handleDrop: (e: DragEvent<HTMLElement>) => void;\n handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;\n openFileDialog: () => void;\n getInputProps: (\n props?: InputHTMLAttributes<HTMLInputElement>,\n ) => InputHTMLAttributes<HTMLInputElement> & {\n // Use `any` here to avoid cross-React ref type conflicts across packages\n // biome-ignore lint/suspicious/noExplicitAny: intentional\n ref: any;\n };\n};\n\n// Helper function to format bytes to human-readable format\nexport const formatBytes = (bytes: number, decimals = 2): string => {\n if (bytes === 0) return \"0 Bytes\";\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return Number.parseFloat((bytes / k ** i).toFixed(dm)) + sizes[i];\n};\n\n// ============================================================================\n// Extended Hook with Upload Support\n// ============================================================================\n\nexport type UploadStatus = \"idle\" | \"uploading\" | \"success\" | \"error\";\n\nexport type FileWithUploadStatus = FileWithPreview & {\n progress: number;\n status: UploadStatus;\n error?: string;\n uploadedUrl?: string;\n};\n\nexport type PresignedUrlResponse = {\n url: string;\n fullPath: string;\n [key: string]: unknown;\n};\n\nexport type UploadConfig = {\n /**\n * Function to get a presigned URL for uploading\n * Called before uploading each file\n * @param params - Parameters including filename, contentType, size, and optional AbortSignal\n * @param params.signal - Optional AbortSignal to cancel the request\n */\n getPresignedUrl: (params: {\n filename: string;\n contentType: string;\n size: number;\n signal?: AbortSignal;\n }) => Promise<{\n result?: PresignedUrlResponse | null;\n error?: unknown;\n }>;\n\n /**\n * Function to upload the file to the storage\n * Receives the presigned URL and the file\n * @param url - The presigned URL to upload to\n * @param file - The file to upload\n * @param presignedData - The full presigned URL response data\n * @param onProgress - Optional callback for upload progress\n * @param signal - Optional AbortSignal to cancel the upload\n */\n uploadFile: (\n url: string,\n file: File,\n presignedData: PresignedUrlResponse,\n onProgress?: (progress: number) => void,\n signal?: AbortSignal,\n ) => Promise<{\n result?: { url: string; [key: string]: unknown };\n error?: unknown;\n }>;\n\n /**\n * Whether to auto-upload files when they are added\n * @default true\n */\n autoUpload?: boolean;\n\n /**\n * Called when a single file upload completes\n */\n onUploadComplete?: (file: FileWithUploadStatus) => void;\n\n /**\n * Called when a single file upload fails\n */\n onUploadError?: (file: FileWithUploadStatus, error: unknown) => void;\n\n /**\n * Called when all files finish uploading\n */\n onAllUploadsComplete?: (files: FileWithUploadStatus[]) => void;\n};\n\nexport type FileUploadWithUploaderOptions = FileUploadOptions & {\n upload?: UploadConfig;\n};\n\nexport type FileUploadWithUploaderState = Omit<FileUploadState, \"files\"> & {\n files: FileWithUploadStatus[];\n isUploading: boolean;\n};\n\nexport type FileUploadWithUploaderActions = Omit<\n FileUploadActions,\n \"addFiles\"\n> & {\n addFiles: (files: FileList | File[]) => void;\n uploadFiles: (\n files?: FileWithUploadStatus[],\n ) => Promise<FileWithUploadStatus[]>;\n retryUpload: (id: string) => Promise<void>;\n cancelUpload: (id: string) => void;\n};\n\nexport const useFileUpload = (\n options: FileUploadWithUploaderOptions = {},\n): [FileUploadWithUploaderState, FileUploadWithUploaderActions] => {\n const { upload, ...baseOptions } = options;\n const autoUpload = upload?.autoUpload ?? true;\n\n const [files, setFiles] = useState<FileWithUploadStatus[]>(\n (baseOptions.initialFiles ?? []).map((file) => ({\n file,\n id: file.id,\n preview: file.url,\n progress: 100,\n status: \"success\" as const,\n uploadedUrl: file.url,\n })),\n );\n const [isUploading, setIsUploading] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [errors, setErrors] = useState<string[]>([]);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const abortControllersRef = useRef<Map<string, AbortController>>(new Map());\n\n const {\n maxFiles = Number.POSITIVE_INFINITY,\n maxSize = Number.POSITIVE_INFINITY,\n accept = \"*\",\n multiple = false,\n onFilesChange,\n onFilesAdded,\n } = baseOptions;\n\n const validateFile = useCallback(\n (file: File): string | null => {\n if (file.size > maxSize) {\n return `File \"${file.name}\" exceeds the maximum size of ${formatBytes(maxSize)}.`;\n }\n\n if (accept !== \"*\") {\n const acceptedTypes = accept.split(\",\").map((type) => type.trim());\n const fileType = file.type || \"\";\n const fileExtension = `.${file.name.split(\".\").pop()}`;\n\n const isAccepted = acceptedTypes.some((type) => {\n if (type.startsWith(\".\")) {\n return fileExtension.toLowerCase() === type.toLowerCase();\n }\n if (type.endsWith(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n return fileType.startsWith(`${baseType}/`);\n }\n return fileType === type;\n });\n\n if (!isAccepted) {\n return `File \"${file.name}\" is not an accepted file type.`;\n }\n }\n\n return null;\n },\n [accept, maxSize],\n );\n\n const createPreview = useCallback((file: File): string | undefined => {\n if (file.type.startsWith(\"image/\")) {\n return URL.createObjectURL(file);\n }\n return undefined;\n }, []);\n\n const generateUniqueId = useCallback((file: File): string => {\n return `${file.name}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n }, []);\n\n const uploadSingleFile = useCallback(\n async (\n fileWithStatus: FileWithUploadStatus,\n ): Promise<FileWithUploadStatus> => {\n if (!upload) {\n return {\n ...fileWithStatus,\n status: \"error\",\n error: \"No upload config provided\",\n };\n }\n\n const file = fileWithStatus.file as File;\n if (!(file instanceof File)) {\n // Already uploaded file (FileMetadata)\n return { ...fileWithStatus, status: \"success\", progress: 100 };\n }\n\n const abortController = new AbortController();\n abortControllersRef.current.set(fileWithStatus.id, abortController);\n\n try {\n // Update status to uploading\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id\n ? { ...f, status: \"uploading\" as const, progress: 0 }\n : f,\n ),\n );\n\n // Step 1: Get presigned URL\n const { result: presignedResult, error: presignedError } =\n await upload.getPresignedUrl({\n filename: file.name,\n contentType: file.type,\n size: file.size,\n signal: abortController.signal,\n });\n\n if (presignedError || !presignedResult) {\n throw presignedError || new Error(\"Failed to get presigned URL\");\n }\n\n // Update progress after getting presigned URL\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id ? { ...f, progress: 10 } : f,\n ),\n );\n\n // Step 2: Upload file\n const { result: uploadResult, error: uploadError } =\n await upload.uploadFile(\n presignedResult.url,\n file,\n presignedResult,\n (progress) => {\n // Scale progress from 10-100\n const scaledProgress = 10 + progress * 0.9;\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id\n ? { ...f, progress: Math.round(scaledProgress) }\n : f,\n ),\n );\n },\n abortController.signal,\n );\n\n if (uploadError) {\n throw uploadError;\n }\n\n const uploadedFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"success\",\n progress: 100,\n uploadedUrl: uploadResult?.url ?? presignedResult.fullPath,\n };\n\n setFiles((prev) =>\n prev.map((f) => (f.id === fileWithStatus.id ? uploadedFile : f)),\n );\n\n upload.onUploadComplete?.(uploadedFile);\n\n return uploadedFile;\n } catch (error) {\n // Check if the upload was cancelled via AbortController\n const isAborted =\n error instanceof Error &&\n (error.name === \"AbortError\" || abortController.signal.aborted);\n\n if (isAborted) {\n // Upload was cancelled - return idle state (already set by cancelUpload)\n const cancelledFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"idle\",\n progress: 0,\n };\n return cancelledFile;\n }\n\n const errorMessage =\n error instanceof Error ? error.message : \"Upload failed\";\n const failedFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"error\",\n error: errorMessage,\n };\n\n setFiles((prev) =>\n prev.map((f) => (f.id === fileWithStatus.id ? failedFile : f)),\n );\n\n upload.onUploadError?.(failedFile, error);\n\n return failedFile;\n } finally {\n abortControllersRef.current.delete(fileWithStatus.id);\n }\n },\n [upload],\n );\n\n const uploadFiles = useCallback(\n async (\n filesToUpload?: FileWithUploadStatus[],\n ): Promise<FileWithUploadStatus[]> => {\n const targetFiles =\n filesToUpload ?? files.filter((f) => f.status === \"idle\");\n\n if (targetFiles.length === 0) return [];\n\n setIsUploading(true);\n const results: FileWithUploadStatus[] = [];\n\n for (const file of targetFiles) {\n const result = await uploadSingleFile(file);\n results.push(result);\n }\n\n setIsUploading(false);\n upload?.onAllUploadsComplete?.(results);\n\n return results;\n },\n [files, uploadSingleFile, upload],\n );\n\n const addFiles = useCallback(\n (newFiles: FileList | File[]) => {\n if (!newFiles || newFiles.length === 0) return;\n\n const newFilesArray = Array.from(newFiles);\n const newErrors: string[] = [];\n\n // Clear existing errors\n setErrors([]);\n\n // In single file mode, clear existing files first\n if (!multiple) {\n setFiles((prev) => {\n for (const file of prev) {\n if (file.preview && file.file instanceof File) {\n URL.revokeObjectURL(file.preview);\n }\n }\n return [];\n });\n }\n\n // Check if adding these files would exceed maxFiles\n if (\n multiple &&\n maxFiles !== Number.POSITIVE_INFINITY &&\n files.length + newFilesArray.length > maxFiles\n ) {\n newErrors.push(`You can only upload a maximum of ${maxFiles} files.`);\n setErrors(newErrors);\n return;\n }\n\n const validFiles: FileWithUploadStatus[] = [];\n\n for (const file of newFilesArray) {\n // Check for duplicates in multiple mode\n if (multiple) {\n const isDuplicate = files.some(\n (existingFile) =>\n existingFile.file.name === file.name &&\n existingFile.file.size === file.size,\n );\n if (isDuplicate) continue;\n }\n\n const error = validateFile(file);\n if (error) {\n newErrors.push(error);\n continue;\n }\n\n validFiles.push({\n file,\n id: generateUniqueId(file),\n preview: createPreview(file),\n progress: 0,\n status: \"idle\",\n });\n }\n\n if (validFiles.length > 0) {\n // Call onFilesAdded callback\n onFilesAdded?.(validFiles);\n\n setFiles((prev) => {\n const updatedFiles = !multiple\n ? validFiles\n : [...prev, ...validFiles];\n onFilesChange?.(updatedFiles);\n return updatedFiles;\n });\n\n // Auto-upload if configured\n if (autoUpload && upload) {\n // Use setTimeout to ensure state is updated before uploading\n setTimeout(() => {\n uploadFiles(validFiles);\n }, 0);\n }\n }\n\n if (newErrors.length > 0) {\n setErrors(newErrors);\n }\n\n // Reset input value\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n },\n [\n files,\n maxFiles,\n multiple,\n validateFile,\n createPreview,\n generateUniqueId,\n onFilesChange,\n onFilesAdded,\n autoUpload,\n upload,\n uploadFiles,\n ],\n );\n\n const removeFile = useCallback(\n (id: string) => {\n // Cancel any ongoing upload\n const controller = abortControllersRef.current.get(id);\n if (controller) {\n controller.abort();\n abortControllersRef.current.delete(id);\n }\n\n setFiles((prev) => {\n const fileToRemove = prev.find((file) => file.id === id);\n if (fileToRemove?.preview && fileToRemove.file instanceof File) {\n URL.revokeObjectURL(fileToRemove.preview);\n }\n\n const newFiles = prev.filter((file) => file.id !== id);\n onFilesChange?.(newFiles);\n return newFiles;\n });\n },\n [onFilesChange],\n );\n\n const clearFiles = useCallback(() => {\n // Cancel all ongoing uploads\n for (const controller of abortControllersRef.current.values()) {\n controller.abort();\n }\n abortControllersRef.current.clear();\n\n setFiles((prev) => {\n for (const file of prev) {\n if (file.preview && file.file instanceof File) {\n URL.revokeObjectURL(file.preview);\n }\n }\n return [];\n });\n\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n\n setErrors([]);\n onFilesChange?.([]);\n }, [onFilesChange]);\n\n const clearErrors = useCallback(() => {\n setErrors([]);\n }, []);\n\n const retryUpload = useCallback(\n async (id: string) => {\n const file = files.find((f) => f.id === id);\n if (file && file.status === \"error\") {\n setFiles((prev) =>\n prev.map((f) =>\n f.id === id\n ? { ...f, status: \"idle\" as const, error: undefined }\n : f,\n ),\n );\n await uploadSingleFile({ ...file, status: \"idle\", error: undefined });\n }\n },\n [files, uploadSingleFile],\n );\n\n const cancelUpload = useCallback((id: string) => {\n const controller = abortControllersRef.current.get(id);\n if (controller) {\n controller.abort();\n abortControllersRef.current.delete(id);\n }\n\n setFiles((prev) =>\n prev.map((f) =>\n f.id === id ? { ...f, status: \"idle\" as const, progress: 0 } : f,\n ),\n );\n }, []);\n\n const handleDragEnter = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n }, []);\n\n const handleDragLeave = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.currentTarget.contains(e.relatedTarget as Node)) return;\n setIsDragging(false);\n }, []);\n\n const handleDragOver = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n\n if (inputRef.current?.disabled) return;\n\n if (e.dataTransfer.files?.length > 0) {\n if (!multiple) {\n addFiles([e.dataTransfer.files[0]]);\n } else {\n addFiles(e.dataTransfer.files);\n }\n }\n },\n [addFiles, multiple],\n );\n\n const handleFileChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files?.length) {\n addFiles(e.target.files);\n }\n },\n [addFiles],\n );\n\n const openFileDialog = useCallback(() => {\n inputRef.current?.click();\n }, []);\n\n const getInputProps = useCallback(\n (props: InputHTMLAttributes<HTMLInputElement> = {}) => ({\n ...props,\n accept: props.accept || accept,\n multiple: props.multiple !== undefined ? props.multiple : multiple,\n onChange: handleFileChange,\n // biome-ignore lint/suspicious/noExplicitAny: intentional\n ref: inputRef as any,\n type: \"file\" as const,\n }),\n [accept, multiple, handleFileChange],\n );\n\n return [\n { files, isDragging, errors, isUploading },\n {\n addFiles,\n removeFile,\n clearFiles,\n clearErrors,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n handleFileChange,\n openFileDialog,\n getInputProps,\n uploadFiles,\n retryUpload,\n cancelUpload,\n },\n ];\n};\n","import { cn } from \"../utils\";\n\nexport default function FileIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14,2 14,8 20,8\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport UploadCloudIcon from \"../icons/upload-cloud-icon\";\nimport CloseIcon from \"../icons/close-icon\";\nimport CheckIcon from \"../icons/check-icon\";\nimport RetryIcon from \"../icons/retry-icon\";\nimport SpinnerIcon from \"../icons/spinner-icon\";\nimport UploadIcon from \"../icons/upload-icon\";\nimport type {\n FileWithUploadStatus,\n FileUploadWithUploaderActions,\n} from \"../hooks/use-file-upload\";\nimport { formatBytes } from \"../hooks/use-file-upload\";\nimport FileIcon from \"../icons/file-icon\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface FileUploadFile {\n id: string;\n file: File | { name: string; size: number; type: string; url?: string };\n progress?: number;\n status?: \"idle\" | \"uploading\" | \"success\" | \"error\";\n preview?: string;\n error?: string;\n uploadedUrl?: string;\n}\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface FileUploadContextValue {\n files: FileUploadFile[];\n addFiles: (files: FileList | File[]) => void;\n removeFile: (id: string) => void;\n clearFiles: () => void;\n retryUpload?: (id: string) => Promise<void>;\n accept?: string;\n multiple: boolean;\n disabled: boolean;\n isDragActive: boolean;\n isUploading: boolean;\n openFileDialog: () => void;\n getInputProps: FileUploadWithUploaderActions[\"getInputProps\"];\n handleDragEnter: FileUploadWithUploaderActions[\"handleDragEnter\"];\n handleDragLeave: FileUploadWithUploaderActions[\"handleDragLeave\"];\n handleDragOver: FileUploadWithUploaderActions[\"handleDragOver\"];\n handleDrop: FileUploadWithUploaderActions[\"handleDrop\"];\n}\n\nconst FileUploadContext = React.createContext<FileUploadContextValue | null>(\n null,\n);\n\nfunction useFileUploadContext() {\n const context = React.useContext(FileUploadContext);\n if (!context) {\n throw new Error(\n \"FileUpload components must be used within FileUpload.Root\",\n );\n }\n return context;\n}\n\n// ============================================================================\n// Root Component\n// ============================================================================\n\nexport interface RootProps {\n children: React.ReactNode;\n /** Files from the useFileUpload hook */\n files: FileUploadFile[] | FileWithUploadStatus[];\n /** Add files action from the hook */\n addFiles: (files: FileList | File[]) => void;\n /** Remove file action from the hook */\n removeFile: (id: string) => void;\n /** Clear files action from the hook */\n clearFiles: () => void;\n /** Retry upload action from the hook */\n retryUpload?: (id: string) => Promise<void>;\n /** Open file dialog action from the hook */\n openFileDialog: () => void;\n /** Get input props from the hook */\n getInputProps: FileUploadWithUploaderActions[\"getInputProps\"];\n /** Handle drag enter from the hook */\n handleDragEnter: FileUploadWithUploaderActions[\"handleDragEnter\"];\n /** Handle drag leave from the hook */\n handleDragLeave: FileUploadWithUploaderActions[\"handleDragLeave\"];\n /** Handle drag over from the hook */\n handleDragOver: FileUploadWithUploaderActions[\"handleDragOver\"];\n /** Handle drop from the hook */\n handleDrop: FileUploadWithUploaderActions[\"handleDrop\"];\n /** Whether dragging is active (from hook state) */\n isDragActive?: boolean;\n /** Whether upload is in progress (from hook state) */\n isUploading?: boolean;\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string;\n /** Allow multiple file selection */\n multiple?: boolean;\n /** Whether the upload is disabled */\n disabled?: boolean;\n className?: string;\n}\n\nfunction Root({\n children,\n files,\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n isDragActive = false,\n isUploading = false,\n accept,\n multiple = false,\n disabled = false,\n className,\n}: RootProps) {\n const contextValue: FileUploadContextValue = {\n files: files as FileUploadFile[],\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n accept,\n multiple,\n disabled,\n isDragActive,\n isUploading,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n };\n\n return (\n <FileUploadContext.Provider value={contextValue}>\n <div\n data-slot=\"file-upload\"\n className={cn(\"flex flex-col gap-4\", className)}\n >\n {children}\n </div>\n </FileUploadContext.Provider>\n );\n}\n\n// ============================================================================\n// Dropzone Component\n// ============================================================================\n\nconst dropzoneVariants = cva(\n \"flex flex-col items-center justify-center gap-4 rounded-ppx-m bg-ppx-neutral-2 transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30\",\n {\n variants: {\n size: {\n default: \"p-8 min-h-[200px]\",\n sm: \"p-6 min-h-[160px]\",\n lg: \"p-10 min-h-[260px]\",\n },\n isDragActive: {\n true: \"border-2 border-dashed border-ppx-primary-5 bg-ppx-primary-1\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isDragActive: false,\n },\n },\n);\n\nexport interface DropzoneProps\n extends Omit<React.ComponentProps<\"div\">, \"children\">,\n Omit<VariantProps<typeof dropzoneVariants>, \"isDragActive\"> {\n children?: React.ReactNode;\n /** Custom text for the dropzone */\n dropzoneText?: string;\n /** Custom text for the browse button */\n browseText?: string;\n /** Hide the default content */\n hideDefaultContent?: boolean;\n}\n\nfunction Dropzone({\n className,\n size,\n children,\n dropzoneText = \"Paste Or Drag & Drop Files Here\",\n browseText = \"Browse for files\",\n hideDefaultContent = false,\n ...props\n}: DropzoneProps) {\n const {\n accept,\n multiple,\n disabled,\n isDragActive,\n isUploading,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n addFiles,\n } = useFileUploadContext();\n\n const descriptionId = React.useId();\n const instructionsId = React.useId();\n const [announcement, setAnnouncement] = React.useState(\"\");\n\n const inputProps = getInputProps();\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n openFileDialog();\n }\n },\n [openFileDialog],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n if (disabled) return;\n const files = e.clipboardData.files;\n if (files.length > 0) {\n e.preventDefault();\n // Convert FileList to array and add files\n const filesArray = Array.from(files);\n addFiles(filesArray);\n setAnnouncement(\n `${filesArray.length} file${filesArray.length > 1 ? \"s\" : \"\"} pasted`,\n );\n }\n },\n [disabled, addFiles],\n );\n\n return (\n <div\n data-slot=\"file-upload-dropzone\"\n className={cn(\n dropzoneVariants({ size, isDragActive }),\n disabled && \"cursor-not-allowed opacity-60\",\n className,\n )}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-disabled={disabled}\n aria-describedby={`${descriptionId} ${instructionsId}`}\n aria-label=\"File upload dropzone\"\n {...props}\n >\n {/* Screen reader announcements */}\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"sr-only\"\n >\n {announcement}\n </div>\n <div id={descriptionId} className=\"sr-only\">\n {dropzoneText}\n </div>\n <div id={instructionsId} className=\"sr-only\">\n Press Enter or Space to browse files, or drag and drop files here.\n </div>\n\n <input\n {...inputProps}\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n\n {children ? (\n children\n ) : !hideDefaultContent ? (\n <>\n <div className=\"text-ppx-neutral-10 flex items-center gap-3\">\n <UploadCloudIcon size={40} aria-hidden=\"true\" />\n <span className=\"text-ppx-base text-ppx-neutral-13 font-medium\">\n {dropzoneText}\n </span>\n </div>\n\n <div className=\"flex w-full items-center gap-3\" aria-hidden=\"true\">\n <div className=\"bg-ppx-neutral-5 h-px flex-1\" />\n <span className=\"text-ppx-sm text-ppx-neutral-10 font-medium\">\n OR\n </span>\n <div className=\"bg-ppx-neutral-5 h-px flex-1\" />\n </div>\n\n <Button\n type=\"button\"\n variant=\"default\"\n onClick={openFileDialog}\n disabled={disabled || isUploading}\n >\n {isUploading ? (\n <>\n <SpinnerIcon className=\"size-4 animate-spin\" />\n Uploading...\n </>\n ) : (\n browseText\n )}\n </Button>\n </>\n ) : null}\n </div>\n );\n}\n\n// ============================================================================\n// Trigger Component (standalone button)\n// ============================================================================\n\nexport interface TriggerProps extends React.ComponentProps<typeof Button> {\n /** Text to show while uploading */\n uploadingText?: string;\n /** Show uploading state */\n showUploadingState?: boolean;\n}\n\nfunction Trigger({\n children,\n uploadingText = \"Uploading...\",\n showUploadingState = true,\n ...props\n}: TriggerProps) {\n const { openFileDialog, disabled, isUploading } = useFileUploadContext();\n\n const isDisabled = disabled || (showUploadingState && isUploading);\n\n return (\n <Button\n type=\"button\"\n onClick={openFileDialog}\n disabled={isDisabled}\n data-slot=\"file-upload-trigger\"\n {...props}\n >\n {showUploadingState && isUploading ? (\n <>\n <SpinnerIcon className=\"size-4 animate-spin\" />\n {uploadingText}\n </>\n ) : (\n (children ?? (\n <>\n <UploadIcon className=\"size-4\" />\n Select files\n </>\n ))\n )}\n </Button>\n );\n}\n\n// ============================================================================\n// ItemList Component\n// ============================================================================\n\nexport interface ItemListProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n children?: React.ReactNode | ((files: FileUploadFile[]) => React.ReactNode);\n}\n\nfunction ItemList({ className, children, ...props }: ItemListProps) {\n const { files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <div\n data-slot=\"file-upload-item-list\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n >\n {typeof children === \"function\" ? children(files) : children}\n </div>\n );\n}\n\n// ============================================================================\n// Item Component\n// ============================================================================\n\nconst ItemContext = React.createContext<FileUploadFile | null>(null);\n\nfunction useFileUploadItem() {\n const context = React.useContext(ItemContext);\n if (!context) {\n throw new Error(\n \"FileUpload.Item* components must be used within FileUpload.Item\",\n );\n }\n return context;\n}\n\nexport interface ItemProps extends React.ComponentProps<\"div\"> {\n file: FileUploadFile;\n /** Apply error styling based on file status */\n statusStyles?: boolean;\n}\n\nfunction Item({\n file,\n className,\n children,\n statusStyles = true,\n ...props\n}: ItemProps) {\n return (\n <ItemContext.Provider value={file}>\n <div\n data-slot=\"file-upload-item\"\n data-status={file.status}\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-4 bg-ppx-neutral-1 flex items-center gap-3 border p-3\",\n statusStyles &&\n file.status === \"error\" &&\n \"border-ppx-red-4 bg-ppx-red-1\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </ItemContext.Provider>\n );\n}\n\n// ============================================================================\n// ItemPreview Component\n// ============================================================================\n\nexport interface ItemPreviewProps extends React.ComponentProps<\"div\"> {\n /** Fallback icon when no preview is available */\n fallback?: React.ReactNode;\n}\n\nfunction ItemPreview({ className, fallback, ...props }: ItemPreviewProps) {\n const file = useFileUploadItem();\n\n return (\n <div\n data-slot=\"file-upload-item-preview\"\n className={cn(\n \"rounded-ppx-xs bg-ppx-neutral-3 flex size-10 shrink-0 items-center justify-center overflow-hidden\",\n className,\n )}\n {...props}\n >\n {file.preview ? (\n <img\n src={file.preview}\n alt={file.file.name}\n className=\"size-full object-cover\"\n />\n ) : (\n (fallback ?? <FileIcon className=\"text-ppx-neutral-10 size-5\" />)\n )}\n </div>\n );\n}\n\n// ============================================================================\n// ItemName Component\n// ============================================================================\n\nexport interface ItemNameProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemName({ className, ...props }: ItemNameProps) {\n const file = useFileUploadItem();\n\n return (\n <span\n data-slot=\"file-upload-item-name\"\n className={cn(\n \"text-ppx-sm text-ppx-neutral-14 truncate font-medium\",\n className,\n )}\n {...props}\n >\n {file.file.name}\n </span>\n );\n}\n\n// ============================================================================\n// ItemSize Component\n// ============================================================================\n\nexport interface ItemSizeProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemSize({ className, ...props }: ItemSizeProps) {\n const file = useFileUploadItem();\n\n return (\n <span\n data-slot=\"file-upload-item-size\"\n className={cn(\"text-ppx-xs text-ppx-neutral-10\", className)}\n {...props}\n >\n {formatBytes(file.file.size)}\n </span>\n );\n}\n\n// ============================================================================\n// ItemRemove Component\n// ============================================================================\n\nexport interface ItemRemoveProps extends React.ComponentProps<typeof Button> {}\n\nfunction ItemRemove({ className, children, ...props }: ItemRemoveProps) {\n const { removeFile } = useFileUploadContext();\n const file = useFileUploadItem();\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => removeFile(file.id)}\n data-slot=\"file-upload-item-remove\"\n aria-label={`Remove ${file.file.name}`}\n className={cn(\"ml-auto shrink-0\", className)}\n {...props}\n >\n {children ?? <CloseIcon className=\"size-4\" />}\n </Button>\n );\n}\n\n// ============================================================================\n// ItemProgress Component\n// ============================================================================\n\nexport interface ItemProgressProps extends React.ComponentProps<\"div\"> {}\n\nfunction ItemProgress({ className, ...props }: ItemProgressProps) {\n const file = useFileUploadItem();\n\n if (file.progress === undefined) return null;\n\n return (\n <div\n data-slot=\"file-upload-item-progress\"\n className={cn(\n \"bg-ppx-neutral-3 h-1.5 w-full overflow-hidden rounded-full\",\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-ppx-primary-5 h-full transition-all duration-300\"\n style={{ width: `${file.progress}%` }}\n />\n </div>\n );\n}\n\n// ============================================================================\n// ItemStatus Component\n// ============================================================================\n\nexport interface ItemStatusProps extends React.ComponentProps<\"div\"> {\n /** Custom success icon */\n successIcon?: React.ReactNode;\n /** Custom uploading text/element */\n uploadingContent?: React.ReactNode;\n /** Custom error text/element */\n errorContent?: React.ReactNode;\n}\n\nfunction ItemStatus({\n className,\n successIcon,\n uploadingContent,\n errorContent,\n ...props\n}: ItemStatusProps) {\n const file = useFileUploadItem();\n\n if (file.status === \"uploading\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-xs text-ppx-neutral-10 shrink-0\", className)}\n {...props}\n >\n {uploadingContent ?? `${file.progress ?? 0}%`}\n </span>\n );\n }\n\n if (file.status === \"success\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-green-5 shrink-0\", className)}\n {...props}\n >\n {successIcon ?? <CheckIcon className=\"size-4\" />}\n </span>\n );\n }\n\n if (file.status === \"error\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-xs text-ppx-red-5 shrink-0\", className)}\n {...props}\n >\n {errorContent ?? \"Failed\"}\n </span>\n );\n }\n\n return null;\n}\n\n// ============================================================================\n// ItemError Component\n// ============================================================================\n\nexport interface ItemErrorProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemError({ className, ...props }: ItemErrorProps) {\n const file = useFileUploadItem();\n\n if (!file.error) return null;\n\n return (\n <span\n data-slot=\"file-upload-item-error\"\n className={cn(\"text-ppx-xs text-ppx-red-5\", className)}\n {...props}\n >\n {file.error}\n </span>\n );\n}\n\n// ============================================================================\n// ItemRetry Component\n// ============================================================================\n\nexport interface ItemRetryProps extends React.ComponentProps<typeof Button> {}\n\nfunction ItemRetry({ className, children, ...props }: ItemRetryProps) {\n const { retryUpload } = useFileUploadContext();\n const file = useFileUploadItem();\n\n if (file.status !== \"error\" || !retryUpload) return null;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => retryUpload(file.id)}\n data-slot=\"file-upload-item-retry\"\n aria-label={`Retry uploading ${file.file.name}`}\n className={cn(\"shrink-0\", className)}\n {...props}\n >\n {children ?? <RetryIcon className=\"size-4\" />}\n </Button>\n );\n}\n\n// ============================================================================\n// ClearButton Component\n// ============================================================================\n\nexport interface ClearButtonProps extends React.ComponentProps<typeof Button> {}\n\nfunction ClearButton({ children, ...props }: ClearButtonProps) {\n const { clearFiles, files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={clearFiles}\n data-slot=\"file-upload-clear\"\n {...props}\n >\n {children ?? \"Remove all files\"}\n </Button>\n );\n}\n\n// ============================================================================\n// ImageGrid Component\n// ============================================================================\n\nexport interface ImageGridProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n children?: React.ReactNode | ((files: FileUploadFile[]) => React.ReactNode);\n}\n\nfunction ImageGrid({ className, children, ...props }: ImageGridProps) {\n const { files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <div\n data-slot=\"file-upload-image-grid\"\n className={cn(\"grid grid-cols-4 gap-2\", className)}\n {...props}\n >\n {typeof children === \"function\" ? children(files) : children}\n </div>\n );\n}\n\n// ============================================================================\n// ImageGridItem Component\n// ============================================================================\n\nexport interface ImageGridItemProps extends React.ComponentProps<\"div\"> {\n file: FileUploadFile;\n /** Show status overlays (uploading/error) */\n showStatusOverlay?: boolean;\n}\n\nfunction ImageGridItem({\n file,\n className,\n showStatusOverlay = true,\n ...props\n}: ImageGridItemProps) {\n const { removeFile, retryUpload } = useFileUploadContext();\n\n return (\n <div\n data-slot=\"file-upload-image-grid-item\"\n data-status={file.status}\n className={cn(\n \"rounded-ppx-s group relative aspect-square overflow-hidden\",\n file.status === \"error\" && \"ring-ppx-red-5 ring-2\",\n className,\n )}\n {...props}\n >\n {file.preview ? (\n <img\n src={file.preview}\n alt={file.file.name}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"bg-ppx-neutral-3 flex size-full items-center justify-center\">\n <FileIcon className=\"text-ppx-neutral-10 size-8\" />\n </div>\n )}\n\n {/* Upload overlay */}\n {showStatusOverlay && file.status === \"uploading\" && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/40\">\n <div className=\"text-sm font-medium text-white\">{file.progress}%</div>\n </div>\n )}\n\n {/* Error overlay */}\n {showStatusOverlay && file.status === \"error\" && retryUpload && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/40\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => retryUpload(file.id)}\n className=\"text-white hover:text-white\"\n >\n <RetryIcon className=\"size-5\" />\n </Button>\n </div>\n )}\n\n {/* Success indicator */}\n {showStatusOverlay && file.status === \"success\" && (\n <div className=\"bg-ppx-green-5 absolute bottom-1 right-1 rounded-full p-0.5\">\n <CheckIcon className=\"size-3 text-white\" />\n </div>\n )}\n\n {/* Remove button */}\n <button\n type=\"button\"\n onClick={() => removeFile(file.id)}\n className=\"absolute right-1 top-1 flex size-6 items-center justify-center rounded-full bg-black/60 text-white opacity-0 transition-opacity group-hover:opacity-100\"\n aria-label={`Remove ${file.file.name}`}\n >\n <CloseIcon className=\"size-3\" />\n </button>\n </div>\n );\n}\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport const FileUpload = {\n Root,\n Dropzone,\n Trigger,\n ItemList,\n Item,\n ItemPreview,\n ItemName,\n ItemSize,\n ItemRemove,\n ItemProgress,\n ItemStatus,\n ItemError,\n ItemRetry,\n ClearButton,\n ImageGrid,\n ImageGridItem,\n};\n","import * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined,\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n","// This tells the bundler to include the CSS file on the build output\nimport \"./index.css\";\n\n// Components with namespace conflicts - export as namespaces\nexport * as Dialog from \"./components/dialog\";\nexport * as Popover from \"./components/popover\";\nexport * as Combobox from \"./components/combobox\";\nexport * as Select from \"./components/select\";\nexport * as Menu from \"./components/menu\";\nexport * as Progress from \"./components/progress\";\nexport * as InputGroup from \"./components/input-group\";\nexport * as SegmentedControl from \"./components/segmented-control\";\nexport * as Tabs from \"./components/tabs\";\nexport * as Tooltip from \"./components/tooltip\";\nexport * as BlockCheckboxGroup from \"./components/block-checkbox-group\";\nexport * as BlockRadioGroup from \"./components/block-radio-group\";\nexport * as Breadcrumbs from \"./components/breadcrumbs\";\nexport * as RadioGroup from \"./components/radio-group\";\nexport * as Collapsible from \"./components/collapsible\";\nexport { Calendar } from \"./components/calendar\";\nexport { PXUIProvider } from \"./providers/px-ui-provider\";\nexport { toast, anchoredToast } from \"./components/toast\";\n\n// Simple components - export directly\nexport * from \"./components/button\";\nexport * from \"./components/checkbox\";\nexport * from \"./components/label\";\nexport * from \"./components/input\";\nexport * from \"./components/textarea\";\nexport * from \"./components/avatar\";\nexport * from \"./components/avatar-group\";\nexport * from \"./components/spinner\";\nexport * from \"./components/switch\";\nexport * from \"./components/separator\";\nexport * from \"./components/date-picker\";\nexport * from \"./components/file-upload\";\n\n// Icons\nexport { default as FileIcon } from \"./icons/file-icon\";\nexport { default as UploadIcon } from \"./icons/upload-icon\";\n\n// Hooks\nexport * from \"./hooks/use-debounce\";\nexport * from \"./hooks/use-file-upload\";\nexport * from \"./hooks/use-async-options\";\nexport * from \"./hooks/use-infinite-scroll\";\nexport * from \"./hooks/use-intersection-observer\";\nexport * from \"./hooks/use-mobile\";\n\n// Utils\nexport * from \"./utils\";\n"],"mappings":";;;;;;;;;;;;;;;;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,WAAU,WAAW;MACzB;KACL;GAIP,qBAAqB,KAAK,WAAW,aACpC,oBAAC;IAAI,WAAU;cACb,oBAAC,aAAU,WAAU,sBAAsB;KACvC;GAIR,oBAAC;IACC,MAAK;IACL,eAAe,WAAW,KAAK,GAAG;IAClC,WAAU;IACV,cAAY,UAAU,KAAK,KAAK;cAEhC,oBAAC,aAAU,WAAU,WAAW;KACzB;;GACL;;AAQV,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;ACt1BD,MAAM,oBAAoB;AAE1B,SAAgB,cAAc;CAC5B,MAAM,CAAC,UAAU,eAAeE,QAAM,SACpC,OACD;AAED,SAAM,gBAAgB;EACpB,MAAM,MAAM,OAAO,WAAW,eAAe,oBAAoB,EAAE,KAAK;EACxE,MAAM,iBAAiB;AACrB,eAAY,OAAO,aAAa,kBAAkB;;AAEpD,MAAI,iBAAiB,UAAU,SAAS;AACxC,cAAY,OAAO,aAAa,kBAAkB;AAClD,eAAa,IAAI,oBAAoB,UAAU,SAAS;IACvD,EAAE,CAAC;AAEN,QAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","names":["Root","BaseDialog","Portal","Trigger","Close","Content","Header","Footer","Title","Description","Root","BasePopover","Trigger","Header","Title","Description","Content","entry","Root","Button","ButtonComponent","Input","List","React","Root","Content","useInfiniteScroll","Item","MultiItem","ItemIndicator","InputGroup.Root","InputGroup.Input","InputGroup.Addon","InputGroup.Button","Trigger","Value","React","Root","Content","List","Item","Trigger","Value","Root","Trigger","Content","Item","Separator","Group","RadioGroup","Root","Indicator","Label","Root","BaseRadioGroup","Item","React","Root","BaseTabs","Trigger","Content","BaseTooltip","Root","Trigger","BaseCheckbox","Group","BaseCheckboxGroup","Item","Header","Title","Description","Group","BaseRadioGroup","Item","BaseRadioGroup","Item","RadioGroupItemPrimitive","Root","BaseCollapsible","Trigger","props","className","React","TOAST_ICONS: Record<ToastVariants, any>","toast","Tooltip.Root","Tooltip.Trigger","Tooltip.Content","AvatarBase","Tooltip.BaseProvider","Tooltip.BaseRoot","Tooltip.Trigger","Tooltip.Content","Popover.Root","Popover.Trigger","Popover.Content","BaseSwitch","React","handleSelect: OnSelectHandler<Date>","Popover.Root","Popover.Trigger","format","Popover.Content","formatDate","uploadedFile: FileWithUploadStatus","failedFile: FileWithUploadStatus","results: FileWithUploadStatus[]","newErrors: string[]","validFiles: FileWithUploadStatus[]","React","contextValue: FileUploadContextValue","React","React"],"sources":["../src/utils/classnames.ts","../src/components/button.tsx","../src/icons/close-icon.tsx","../src/components/dialog.tsx","../src/components/popover.tsx","../src/hooks/use-intersection-observer.ts","../src/hooks/use-infinite-scroll.ts","../src/components/spinner.tsx","../src/tw-styles/dropdown.ts","../src/icons/clear-icon.tsx","../src/icons/chevron-down-icon.tsx","../src/icons/search-icon.tsx","../src/icons/check-icon.tsx","../src/components/input-group.tsx","../src/hooks/use-debounce.ts","../src/hooks/use-async-options.ts","../src/components/combobox.tsx","../src/components/select.tsx","../src/components/menu.tsx","../src/components/progress.tsx","../src/components/segmented-control.tsx","../src/components/tabs.tsx","../src/components/tooltip.tsx","../src/components/checkbox.tsx","../src/components/block-checkbox-group.tsx","../src/components/radio-group.tsx","../src/components/block-radio-group.tsx","../src/components/breadcrumbs.tsx","../src/components/collapsible.tsx","../src/components/calendar.tsx","../src/icons/circle-alert-icon.tsx","../src/icons/circle-check-icon.tsx","../src/icons/info-icon.tsx","../src/icons/triangle-alert-icon.tsx","../src/icons/spinner-icon.tsx","../src/components/toast.tsx","../src/providers/px-ui-provider.tsx","../src/components/label.tsx","../src/components/input.tsx","../src/components/textarea.tsx","../src/components/avatar.tsx","../src/components/avatar-group.tsx","../src/components/switch.tsx","../src/components/separator.tsx","../src/icons/calendar-icon.tsx","../src/components/date-picker.tsx","../src/icons/upload-cloud-icon.tsx","../src/icons/retry-icon.tsx","../src/icons/upload-icon.tsx","../src/hooks/use-file-upload.ts","../src/icons/file-icon.tsx","../src/components/file-upload.tsx","../src/components/otp-input.tsx","../src/hooks/use-mobile.ts"],"sourcesContent":["import classnames, { type ArgumentArray } from \"classnames\";\nimport { extendTailwindMerge } from \"tailwind-merge\";\n\n// Create a custom tailwind-merge instance that knows about our custom utilities\nconst customTwMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n \"font-size\": [\n // Add our custom text-ppx-* utilities to the font-size group instead of text-color\n {\n text: [\n \"ppx-h1\",\n \"ppx-h2\",\n \"ppx-h3\",\n \"ppx-h4\",\n \"ppx-base\",\n \"ppx-sm\",\n \"ppx-xs\",\n ],\n },\n ],\n // Add custom height utilities\n h: [{ h: [\"stretch-available\", \"input\", \"input-s\"] }],\n // Add custom min-height utilities\n \"min-h\": [{ \"min-h\": [\"input\", \"input-s\"] }],\n // Add custom min-width utilities\n \"min-w\": [{ \"min-w\": [\"input\"] }],\n // Add custom padding utilities\n p: [{ p: [\"input\"] }],\n // Add custom border radius utilities\n rounded: [\n {\n rounded: [\n \"ppx-xs\",\n \"ppx-s\",\n \"ppx-m\",\n \"ppx-l\",\n \"ppx-xl\",\n \"input\",\n \"input-s\",\n ],\n },\n ],\n // Add custom font family utilities\n \"font-family\": [{ font: [\"sans-light\", \"sans-sb\", \"sans-b\"] }],\n },\n },\n});\n\nexport function cn(...inputs: ArgumentArray) {\n return customTwMerge(classnames(inputs));\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap transition-colors disabled:cursor-not-allowed shrink-0 [&_svg]:shrink-0 outline-none rounded-ppx-s font-medium focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30\",\n {\n variants: {\n variant: {\n default:\n \"bg-ppx-neutral-11 text-white shadow-xs not-disabled:hover:bg-ppx-neutral-10 not-disabled:active:bg-ppx-neutral-11 disabled:bg-ppx-neutral-6\",\n primary:\n \"bg-ppx-primary-5 text-white shadow-xs not-disabled:hover:bg-ppx-primary-4 not-disabled:active:bg-ppx-primary-5 disabled:bg-ppx-primary-2 disabled:text-ppx-neutral-8\",\n destructive:\n \"bg-ppx-red-5 text-white shadow-xs hover:bg-ppx-red-4 not-disabled:active:bg-ppx-red-5 disabled:bg-ppx-red-2 disabled:text-ppx-neutral-13\",\n outline:\n \"shadow-xs not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 disabled:border-ppx-neutral-7 border border-ppx-neutral-11 text-ppx-neutral-11 disabled:text-ppx-neutral-7\",\n \"primary-outline\":\n \"shadow-xs not-disabled:hover:bg-ppx-primary-1 not-disabled:active:bg-ppx-primary-2/50 disabled:text-ppx-primary-2 disabled:border-ppx-primary-2 border border-ppx-primary-5 text-ppx-primary-5\",\n ghost:\n \"not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 not-disabled:hover:text-black text-ppx-neutral-12 disabled:opacity-70\",\n link: \"text-ppx-neutral-12 underline-offset-4 underline cursor-pointer not-disabled:hover:bg-ppx-neutral-2 not-disabled:active:bg-ppx-neutral-3 disabled:opacity-70\",\n },\n size: {\n default: \"px-4 py-2 h-10 has-[>svg]:px-3 text-ppx-base\",\n sm: \"gap-1.5 px-3 has-[>svg]:px-2.5 h-8 text-ppx-sm\",\n lg: \"px-6 h-12 text-ppx-base font-sans-sb has-[>svg]:px-4\",\n \"icon-sm\": \"size-8\",\n icon: \"size-10 px-2\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface ButtonProps\n extends React.ComponentProps<\"button\">,\n VariantProps<typeof buttonVariants> {}\n\nfunction Button({ className, variant, size, ...props }: ButtonProps) {\n return (\n <button\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n","export default function CloseIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { Dialog as BaseDialog } from \"@base-ui/react\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport CloseIcon from \"../icons/close-icon\";\n\nexport function Root({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Root>) {\n return <BaseDialog.Root data-slot=\"dialog\" {...props} />;\n}\n\nexport function Portal({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Portal>) {\n return <BaseDialog.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nexport function Trigger({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Trigger>) {\n return <BaseDialog.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nexport function Close({\n ...props\n}: React.ComponentProps<typeof BaseDialog.Close>) {\n return <BaseDialog.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nexport function Overlay({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Backdrop>) {\n return (\n <BaseDialog.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n \"inset-0 bg-black/50 fixed transition-all duration-200 [&[data-ending-style]]:opacity-0 [&[data-starting-style]]:opacity-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Content({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Popup>) {\n return (\n <Portal data-slot=\"dialog-portal\">\n <Overlay />\n <BaseDialog.Popup\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed z-50 grid w-full bg-ppx-background text-ppx-foreground ppx-sm:max-w-[calc(100%-2rem)]\",\n \"gap-8 p-6 shadow-lg ppx-sm:max-w-lg rounded-ppx-m rounded-b-none border border-ppx-neutral-5 duration-200 outline-none ppx-sm:scale-[calc(1-0.1*var(--nested-dialogs))] ppx-sm:rounded-b-ppx-m\",\n \"bottom-0 fixed w-full ppx-sm:top-[50%] ppx-sm:bottom-auto ppx-sm:left-[50%] ppx-sm:translate-x-[-50%] ppx-sm:translate-y-[-50%]\",\n \"duration-200\",\n \"data-[starting-style]:translate-y-full data-[starting-style]:opacity-0\",\n \"data-[ending-style]:translate-y-full data-[ending-style]:opacity-0\",\n \"data-[starting-style]:ppx-sm:translate-y-[-50%] data-[starting-style]:ppx-sm:scale-95\",\n \"data-[ending-style]:ppx-sm:translate-y-[-50%] data-[ending-style]:ppx-sm:scale-95\",\n className,\n )}\n {...props}\n >\n {children}\n <BaseDialog.Close\n className=\"top-4 right-4 absolute text-ppx-muted-foreground\"\n render={(closeProps) => (\n <Button {...closeProps} size=\"icon-sm\" variant=\"ghost\">\n <CloseIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n )}\n />\n </BaseDialog.Popup>\n </Portal>\n );\n}\n\nexport function Header({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"gap-3 flex\", className)}\n {...props}\n />\n );\n}\n\nexport function HeaderContent({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\"gap-2 flex flex-col self-center\", className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function HeaderIcon({\n className,\n children,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n className={cn(\n \"size-12 flex shrink-0 items-center justify-center rounded-full bg-ppx-neutral-2 text-ppx-muted-foreground\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nexport function Footer({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"gap-2 flex flex-col-reverse ppx-sm:flex-row ppx-sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Title({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Title>) {\n return (\n <BaseDialog.Title\n data-slot=\"dialog-title\"\n className={cn(\"font-sans-sb text-ppx-h4 leading-none\", className)}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<typeof BaseDialog.Description>) {\n return (\n <BaseDialog.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-ppx-sm text-ppx-muted-foreground\", className)}\n {...props}\n />\n );\n}\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\n\nimport { cn } from \"../utils\";\nimport CloseIcon from \"../icons/close-icon\";\nimport { Button } from \"./button\";\n\nexport function Root(props: React.ComponentProps<typeof BasePopover.Root>) {\n return <BasePopover.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction Portal(props: React.ComponentProps<typeof BasePopover.Portal>) {\n return <BasePopover.Portal data-slot=\"popover-portal\" {...props} />;\n}\n\nexport function Trigger(\n props: React.ComponentProps<typeof BasePopover.Trigger>,\n) {\n return <BasePopover.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nexport function Close(props: React.ComponentProps<typeof BasePopover.Close>) {\n return <BasePopover.Close data-slot=\"popover-close\" {...props} />;\n}\n\nfunction Arrow(props: React.ComponentProps<typeof BasePopover.Arrow>) {\n return <BasePopover.Arrow data-slot=\"popover-arrow\" {...props} />;\n}\n\nfunction Positioner(\n props: React.ComponentProps<typeof BasePopover.Positioner>,\n) {\n return <BasePopover.Positioner data-slot=\"popover-positioner\" {...props} />;\n}\n\nexport function Header({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-header\"\n className={cn(\"gap-y-1 relative flex flex-col\", className)}\n {...props}\n />\n );\n}\n\nexport function Title({\n className,\n ...props\n}: React.ComponentProps<typeof BasePopover.Title>) {\n return (\n <BasePopover.Title\n data-slot=\"popover-title\"\n className={cn(\"font-sans-sb text-ppx-sm\", className)}\n {...props}\n />\n );\n}\n\nexport function Description({\n className,\n ...props\n}: React.ComponentProps<typeof BasePopover.Description>) {\n return (\n <BasePopover.Description\n data-slot=\"popover-description\"\n className={cn(\"text-ppx-sm text-ppx-muted-foreground\", className)}\n {...props}\n />\n );\n}\n\nexport function Content({\n children,\n className,\n positionerProps = {},\n popupProps = {},\n arrow = true,\n}: { popupProps?: React.ComponentProps<typeof BasePopover.Popup> } & {\n positionerProps?: React.ComponentProps<typeof Positioner>;\n} & { children: React.ReactNode; arrow?: boolean; className?: string }) {\n return (\n <Portal>\n <Positioner\n sideOffset={8}\n align=\"center\"\n positionMethod=\"fixed\"\n side=\"bottom\"\n {...positionerProps}\n >\n <BasePopover.Popup\n data-slot=\"popover-content\"\n {...popupProps}\n className={cn(\n \"p-4 shadow-md z-50 min-w-input origin-[var(--transform-origin)] rounded-ppx-m bg-ppx-background text-ppx-foreground outline -outline-offset-1 outline-ppx-neutral-5 transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n popupProps.className,\n className,\n )}\n >\n {arrow && (\n <Arrow className=\"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V9H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-ppx-background\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-ppx-neutral-5\"\n />\n </svg>\n </Arrow>\n )}\n {children}\n </BasePopover.Popup>\n </Positioner>\n </Portal>\n );\n}\n\nexport function CloseIconButton({\n className,\n ...props\n}: React.ComponentProps<\"button\">) {\n return (\n <BasePopover.Close\n render={(closeProps) => (\n <Button\n aria-label=\"Close\"\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn(\n \"self-start text-ppx-muted-foreground transition-colors hover:text-ppx-foreground\",\n className,\n )}\n {...closeProps}\n {...props}\n >\n <CloseIcon className=\"size-5\" />\n </Button>\n )}\n />\n );\n}\n\nexport function Footer({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"popover-footer\"\n className={cn(\n \"gap-2 flex flex-col-reverse ppx-sm:flex-row ppx-sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n","import React from \"react\";\n\nexport interface UseIntersectionObserverOptions {\n threshold?: number | number[];\n root?: Element | Document | null;\n rootMargin?: string;\n}\n\nexport type UseIntersectionObserverReturn = [\n (node: Element | null) => void,\n IntersectionObserverEntry | null,\n];\n\nexport function useIntersectionObserver(\n options: UseIntersectionObserverOptions = {},\n): UseIntersectionObserverReturn {\n const { threshold = 1, root = null, rootMargin = \"0px\" } = options;\n const [entry, setEntry] = React.useState<IntersectionObserverEntry | null>(\n null,\n );\n\n const previousObserver = React.useRef<IntersectionObserver | null>(null);\n\n const customRef = React.useCallback(\n (node: Element | null) => {\n if (previousObserver.current) {\n previousObserver.current.disconnect();\n previousObserver.current = null;\n }\n\n if (node?.nodeType === Node.ELEMENT_NODE) {\n const observer = new IntersectionObserver(\n ([entry]: IntersectionObserverEntry[]) => {\n setEntry(entry ?? null);\n },\n { threshold, root, rootMargin },\n );\n\n observer.observe(node);\n previousObserver.current = observer;\n }\n },\n [threshold, root, rootMargin],\n );\n\n return [customRef, entry] as const;\n}\n","import { useEffect, useEffectEvent } from \"react\";\nimport {\n useIntersectionObserver,\n type UseIntersectionObserverOptions,\n} from \"./use-intersection-observer\";\n\nconst DEFAULT_DELAY_IN_MS = 100;\n\nexport type UseInfiniteScrollHookArgs = Pick<\n UseIntersectionObserverOptions,\n \"rootMargin\" | \"threshold\"\n> & {\n isLoadingMore: boolean;\n // If the list has more items to load.\n hasMore: boolean;\n // The callback function to execute when the 'onLoadMore' is triggered.\n onLoadMore: () => unknown;\n // Flag to stop infinite scrolling. Can be used in case of an error etc too.\n disabled?: boolean;\n};\n\nfunction useInfiniteScroll({\n isLoadingMore,\n hasMore,\n onLoadMore,\n rootMargin,\n disabled,\n threshold,\n}: UseInfiniteScrollHookArgs) {\n const [ref, entry] = useIntersectionObserver({\n rootMargin,\n threshold,\n });\n const isVisible = Boolean(entry?.isIntersecting);\n\n const onLoadMoreEvent = useEffectEvent(() => {\n onLoadMore();\n });\n\n useEffect(() => {\n if (disabled) return;\n\n if (isVisible && hasMore && !isLoadingMore && !disabled) {\n // When we trigger 'onLoadMore' and new items are added to the list,\n // right before they become rendered on the screen, 'isLoadingMore' becomes false\n // and 'isVisible' can be true for a brief time, based on the scroll position.\n // So, it triggers 'onLoadMore' just after the first one is finished.\n // We use a small delay here to prevent this kind of situations.\n const timer = setTimeout(() => {\n onLoadMoreEvent();\n }, DEFAULT_DELAY_IN_MS);\n\n return () => {\n clearTimeout(timer);\n };\n }\n }, [isVisible, isLoadingMore, hasMore, disabled]);\n\n return [ref] as const;\n}\n\nexport default useInfiniteScroll;\n","import { cn } from \"../utils\";\n\ninterface SpinnerProps {\n size?: \"small\" | \"medium\" | \"large\";\n className?: string;\n}\n\nconst sizeClasses = {\n small: \"w-4 h-4\",\n medium: \"w-6 h-6\",\n large: \"w-8 h-8\",\n};\n\nexport function Spinner({ size = \"small\", className }: SpinnerProps) {\n const spinnerClasses = cn(\n \"animate-spin inline-block\",\n sizeClasses[size],\n className,\n );\n\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-label=\"Loading\"\n role=\"status\"\n className={spinnerClasses}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n","import { cva } from \"class-variance-authority\";\n\nexport const DROPDOWN_ITEM_CN =\n \"gap-2 py-2 pr-8 pl-4 text-ppx-sm flex cursor-default items-center outline-none select-none not-data-disabled:data-highlighted:bg-ppx-primary-b-1 data-selected:bg-ppx-primary-1! data-checked:bg-ppx-primary-1! text-ppx-foreground my-0.5 data-disabled:opacity-50\";\n\nexport const DROPDOWN_POPUP_CN =\n \"rounded-ppx-s shadow-xs max-h-[var(--available-height)] origin-[var(--transform-origin)] overflow-y-auto bg-ppx-background bg-clip-padding shadow-ppx-neutral-5 outline-1 outline-ppx-neutral-5 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[side=none]:data-[ending-style]:transition-none data-[starting-style]:scale-90 data-[starting-style]:opacity-0 data-[side=none]:data-[starting-style]:scale-100 data-[side=none]:data-[starting-style]:opacity-100 data-[side=none]:data-[starting-style]:transition-none group max-w-[var(--available-width)] text-ppx-foreground\";\n\nexport const DROPDOWN_POSITIONER_CN = \"z-10 outline-none\";\n\nexport const triggerVariants = cva(\n \"gap-2 text-ppx-sm bg-ppx-neutral-1 inline-flex items-center justify-between border border-ppx-neutral-5 aria-invalid:border-ppx-red-4 text-ppx-foreground outline-transparent p-input focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-ppx-neutral-6 focus-visible:aria-invalid:outline-transparent data-disabled:cursor-not-allowed data-disabled:border-ppx-neutral-3 data-disabled:bg-ppx-neutral-3 data-disabled:text-ppx-neutral-11 data-popup-open:brightness-97\",\n {\n variants: {\n size: {\n default: \"rounded-input min-h-input h-input\",\n sm: \"rounded-input-s min-h-input-s h-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n fit: \"min-w-0 w-fit\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"enforced\",\n },\n },\n);\n","import { cn } from \"../utils\";\n\nexport default function ClearIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M18 6L6 18\" />\n <path d=\"M6 6l12 12\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function ChevronDownIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <path d=\"M6 9l6 6 6-6\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function SearchIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={cn(\"shrink-0\", props.className)}\n >\n <path\n d=\"M15.9038 14.9625L11.2623 10.321C12.1404 9.24234 12.6723 7.85136 12.6723 6.33612C12.6723 2.83678 9.83548 0 6.33612 0C2.83677 0 0 2.83677 0 6.33612C0 9.83547 2.83677 12.6723 6.33612 12.6723C7.85133 12.6723 9.24233 12.1404 10.3326 11.2532L10.321 11.2623L14.9613 15.9026C15.0215 15.9628 15.1047 16 15.1966 16C15.2885 16 15.3717 15.9628 15.4319 15.9026L15.9026 15.4319C15.9628 15.3716 16 15.2884 16 15.1965C16 15.1053 15.9633 15.0226 15.9038 14.9624L15.9038 14.9625L15.9038 14.9625ZM6.34922 11.341C6.34886 11.341 6.34842 11.341 6.34798 11.341C3.59045 11.341 1.35503 9.10555 1.35503 6.34802C1.35503 3.59048 3.59045 1.35506 6.34798 1.35506C9.10552 1.35506 11.3409 3.59048 11.3409 6.34802C11.3409 6.34845 11.3409 6.34887 11.3409 6.34931V6.34925C11.3374 9.10469 9.10467 11.3375 6.34955 11.341H6.3492L6.34922 11.341Z\"\n fill=\"currentColor\"\n />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function CheckIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n fill=\"currentcolor\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M9.1603 1.12218C9.50684 1.34873 9.60427 1.81354 9.37792 2.16038L5.13603 8.66012C5.01614 8.8438 4.82192 8.96576 4.60451 8.99384C4.3871 9.02194 4.1683 8.95335 4.00574 8.80615L1.24664 6.30769C0.939709 6.02975 0.916013 5.55541 1.19372 5.24822C1.47142 4.94102 1.94536 4.91731 2.2523 5.19524L4.36085 7.10461L8.12299 1.33999C8.34934 0.993152 8.81376 0.895638 9.1603 1.12218Z\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils\";\nimport { Button as ButtonComponent } from \"./button\";\n\nconst inputGroupVariants = cva(\n \"group/input-group relative flex items-center border border-ppx-neutral-5 bg-ppx-neutral-1 outline-transparent has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-1 has-[[data-slot=input-group-control]:focus-visible]:bg-ppx-background has-[[data-slot=input-group-control]:focus-visible]:outline-ppx-primary-focus has-[[data-slot][aria-invalid=true]]:outline-ppx-red-4 has-[[data-slot][aria-invalid=true]]:outline has-[[data-slot][aria-invalid=true]]:-outline-offset-1 has-[[data-slot][aria-invalid=true]]:bg-ppx-red-1 has-[[data-slot=input-group-control]:disabled]:*:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:border-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:bg-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:text-ppx-neutral-11 has-[>[data-align=inline-start]]:[&>input]:pl-input has-[>[data-align=inline-end]]:[&>input]:pr-input\",\n {\n variants: {\n size: {\n default: \"h-input rounded-input\",\n sm: \"h-input-s rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n fit: \"min-w-0 w-fit\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\nexport function Root({\n className,\n size,\n disabled,\n widthVariant,\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof inputGroupVariants> & { disabled?: boolean }) {\n return (\n <div\n data-slot=\"input-group\"\n role=\"group\"\n className={cn(inputGroupVariants({ size, widthVariant }), className)}\n data-disabled={disabled}\n {...props}\n />\n );\n}\n\nconst inputGroupAddonVariants = cva(\n \"text-ppx-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 group-data-[disabled=true]/input-group:opacity-50\",\n {\n variants: {\n align: {\n \"inline-start\": \"order-first pl-input\",\n \"inline-end\": \"order-last pr-input\",\n },\n },\n defaultVariants: {\n align: \"inline-start\",\n },\n },\n);\n\ninterface AddonProps\n extends React.ComponentProps<\"div\">,\n VariantProps<typeof inputGroupAddonVariants> {}\n\nexport function Addon({\n className,\n align = \"inline-start\",\n ...props\n}: AddonProps) {\n return (\n <div\n role=\"group\"\n data-slot=\"input-group-addon\"\n data-align={align}\n className={cn(inputGroupAddonVariants({ align }), className)}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest(\"button\")) {\n return;\n }\n e.currentTarget.parentElement?.querySelector(\"input\")?.focus();\n }}\n {...props}\n />\n );\n}\n\nconst inputGroupButtonVariants = cva(\n \"text-ppx-sm shadow-none flex gap-2 items-center\",\n {\n variants: {\n size: {\n xs: \"h-6 gap-1 px-2 rounded-input [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2\",\n sm: \"h-8 px-2.5 gap-1.5 rounded-input has-[>svg]:px-2.5\",\n \"icon-xs\": \"size-6 rounded-input p-0 has-[>svg]:p-0\",\n \"icon-sm\": \"size-8 p-0 has-[>svg]:p-0\",\n },\n },\n defaultVariants: {\n size: \"xs\",\n },\n },\n);\n\nexport function Button({\n className,\n type = \"button\",\n variant = \"ghost\",\n size = \"xs\",\n ...props\n}: Omit<React.ComponentProps<typeof ButtonComponent>, \"size\"> &\n VariantProps<typeof inputGroupButtonVariants>) {\n return (\n <ButtonComponent\n type={type}\n data-size={size}\n variant={variant}\n className={cn(inputGroupButtonVariants({ size }), className)}\n {...props}\n />\n );\n}\n\nexport function Text({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n className={cn(\n \"gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center text-ppx-muted-foreground [&_svg]:pointer-events-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Input({\n className,\n invalid,\n ...props\n}: React.ComponentProps<\"input\"> & { invalid?: boolean }) {\n return (\n <input\n data-slot=\"input-group-control\"\n aria-invalid={invalid}\n className={cn(\n \"font-medium min-w-0 flex-1 rounded-none border-0 bg-transparent p-input text-ppx-sm text-ppx-foreground placeholder:font-sans-light placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:outline-none disabled:placeholder:text-ppx-neutral-11\",\n props.type === \"number\" && \"no-arrow-spin\",\n className,\n )}\n {...props}\n />\n );\n}\n","import { useEffect, useEffectEvent, useRef, useState } from \"react\";\n\nexport default function useDebounce<T>(\n callback: () => void,\n delay: number,\n deps: React.DependencyList,\n) {\n const timeout = useRef<ReturnType<typeof setTimeout> | null>(null);\n const cb = useEffectEvent(callback);\n\n useEffect(() => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n }\n\n timeout.current = setTimeout(() => {\n cb();\n timeout.current = null;\n }, delay);\n\n return () => {\n if (timeout.current) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n };\n }, [...deps, delay]);\n}\n","import { useRef, useState } from \"react\";\nimport { useInfiniteQuery, type QueryKey } from \"@tanstack/react-query\";\nimport useDebounce from \"./use-debounce\";\n\ntype LoadOptionsData<TData> = {\n options: TData[];\n hasMore: boolean;\n};\n\ntype LoadOptionsReturn<TData> = {\n data: LoadOptionsData<TData>;\n error: any;\n};\n\ntype LoadOptionsFn<TData> = (params: {\n search: string;\n page: number;\n signal: AbortSignal;\n}) => Promise<LoadOptionsReturn<TData>>;\n\nexport function useAsyncOptions<TData = any>(\n params: {\n /**\n * An unique key to identify the cache, used to cache the results.\n * This must be unique\n *\n * @example\n * ```ts\n * const userOptions = defineAsyncOptions({\n * cacheKey: [\"users\"],\n * loader: async ({ page, search }) => {\n * // Your async loading logic here\n * return {\n * data: { options: [], hasMore: false },\n * error: null,\n * };\n * },\n * }),\n * const userOptions = useAsyncOptions(userOptions);\n * ```\n * });\n */\n cacheKey: QueryKey;\n loader: LoadOptionsFn<TData>;\n },\n {\n isOpen,\n inputValue,\n }: {\n isOpen: boolean;\n inputValue: string;\n },\n) {\n const [debouncedSearch, setDebouncedSearch] = useState(inputValue);\n const isFetchedAfterMount = useRef(false);\n\n const query = useInfiniteQuery({\n queryKey: [...params.cacheKey, debouncedSearch],\n queryFn: async ({ pageParam, signal }) => {\n const { error, data } = await params.loader({\n search: debouncedSearch,\n page: pageParam,\n signal,\n });\n\n if (error) {\n throw new Error(error);\n }\n\n return data;\n },\n enabled: isOpen,\n initialPageParam: 1,\n staleTime: () => (isFetchedAfterMount.current ? Infinity : 0),\n getNextPageParam: (lastPage, allPages) =>\n lastPage.hasMore ? allPages.length + 1 : undefined,\n retry: false,\n });\n\n if (query.isFetchedAfterMount && !isFetchedAfterMount.current) {\n isFetchedAfterMount.current = true;\n }\n\n if (inputValue === \"\" && debouncedSearch !== \"\" && isOpen) {\n setDebouncedSearch(\"\");\n }\n\n useDebounce(\n () => {\n setDebouncedSearch(inputValue);\n },\n 300,\n [inputValue],\n );\n\n const items = query.data?.pages.flatMap((page) => page.options) ?? [];\n\n const handleLoadMore = () => {\n query.fetchNextPage();\n };\n\n return {\n items,\n isLoading: query.isLoading,\n isLoadingMore: query.isFetchingNextPage,\n hasMore: query.hasNextPage,\n isError: query.isError,\n onLoadMore: handleLoadMore,\n _query: query,\n };\n}\n\nexport type LoadOptionsConfig<TData> = {\n cacheKey: QueryKey;\n loader: LoadOptionsFn<TData>;\n};\n\nexport function defineLoadOptions<TData = any>(\n loadOptions: LoadOptionsConfig<TData>,\n) {\n return loadOptions;\n}\n\nexport type InferOption<T> =\n T extends LoadOptionsConfig<infer TData> ? TData : never;\nexport type InferOptions<T> =\n T extends LoadOptionsConfig<infer TData> ? TData[] : never;\n","import * as React from \"react\";\nimport { Combobox } from \"@base-ui/react/combobox\";\nimport { cn } from \"../utils\";\nimport useInfiniteScroll from \"../hooks/use-infinite-scroll\";\nimport { Spinner } from \"./spinner\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport ClearIcon from \"../icons/clear-icon\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport SearchIcon from \"../icons/search-icon\";\nimport CheckIcon from \"../icons/check-icon\";\nimport CloseIcon from \"../icons/close-icon\";\nimport * as InputGroup from \"./input-group\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { useAsyncOptions } from \"../hooks/use-async-options\";\nimport { type LoadOptionsConfig } from \"../hooks/use-async-options\";\n\nconst SINGLE_TEXT_CONTENT_CN =\n \"px-4 py-2 text-ppx-sm min-h-11 flex items-center justify-center text-ppx-muted-foreground\";\n\nexport const List = Combobox.List;\n\ntype ComboboxContextValues = React.ComponentProps<\n typeof Combobox.Root<any, any>\n> & {\n chipsTriggerRef: React.RefObject<HTMLDivElement | null>;\n searchableTriggerRef: React.RefObject<HTMLDivElement | null>;\n invalid?: boolean;\n isLoading?: boolean;\n isLoadingMore?: boolean;\n isError?: boolean;\n hasMore?: boolean;\n onLoadMore?: () => void;\n};\n\nconst ComboboxContext = React.createContext<ComboboxContextValues>(\n {} as ComboboxContextValues,\n);\n\nexport function Root<ItemValue, Multiple extends boolean | undefined = false>({\n children,\n ...props\n}: React.ComponentProps<typeof Combobox.Root<ItemValue, Multiple>> &\n Pick<\n ComboboxContextValues,\n | \"isLoading\"\n | \"isLoadingMore\"\n | \"isError\"\n | \"onLoadMore\"\n | \"hasMore\"\n | \"invalid\"\n > & { loadOptions?: LoadOptionsConfig<ItemValue> }) {\n const chipsTriggerRef = React.useRef<HTMLDivElement>(null);\n const searchableTriggerRef = React.useRef<HTMLDivElement>(null);\n const [isOpen, setIsOpen] = React.useState(false);\n const [inputValue, setInputValue] = React.useState(\"\");\n\n const fallbackProps = {\n open: isOpen,\n onOpenChange: setIsOpen,\n inputValue,\n onInputValueChange: setInputValue,\n };\n\n const mergedProps = {\n ...fallbackProps,\n ...props,\n };\n\n const asyncOptionsProps = props.loadOptions\n ? useAsyncOptions(props.loadOptions, {\n isOpen: mergedProps.open,\n inputValue: mergedProps.inputValue as string,\n })\n : {};\n\n const rootProps = {\n ...asyncOptionsProps,\n ...mergedProps,\n };\n\n const contextValues = {\n ...rootProps,\n chipsTriggerRef,\n searchableTriggerRef,\n };\n\n return (\n <ComboboxContext.Provider value={contextValues}>\n <Combobox.Root autoHighlight {...rootProps}>\n {children}\n </Combobox.Root>\n </ComboboxContext.Provider>\n );\n}\n\nexport function Content({\n empty = \"No options\",\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"trigger\",\n}: React.PropsWithChildren<{\n empty?: string;\n portalProps?: React.ComponentProps<typeof Combobox.Portal>;\n positionerProps?: React.ComponentProps<typeof Combobox.Positioner>;\n popupProps?: React.ComponentProps<typeof Combobox.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n const {\n chipsTriggerRef,\n searchableTriggerRef,\n isLoading,\n isError,\n isLoadingMore,\n hasMore,\n onLoadMore,\n } = useComboboxContext();\n const [infiniteScrollRef] = useInfiniteScroll({\n isLoadingMore: !!isLoadingMore,\n hasMore: !!hasMore,\n onLoadMore: () => onLoadMore?.(),\n disabled: isError,\n });\n\n return (\n <Combobox.Portal {...portalProps}>\n <Combobox.Positioner\n sideOffset={6}\n align=\"start\"\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n anchor={\n positionerProps?.anchor ??\n chipsTriggerRef.current ??\n searchableTriggerRef.current\n }\n >\n <Combobox.Popup\n className={cn(\n DROPDOWN_POPUP_CN,\n \"scroll-pb-2 scroll-pt-2 overscroll-contain\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n {...popupProps}\n >\n {children}\n\n {!isLoading && !isError && (\n <Combobox.Empty\n className={cn(SINGLE_TEXT_CONTENT_CN, \"empty:hidden\")}\n >\n {empty}\n </Combobox.Empty>\n )}\n\n {isLoading && (\n <Combobox.Status className={SINGLE_TEXT_CONTENT_CN}>\n Loading...\n </Combobox.Status>\n )}\n\n {isError && (\n <Combobox.Status className={SINGLE_TEXT_CONTENT_CN}>\n Error loading options\n </Combobox.Status>\n )}\n\n {hasMore && (\n <Combobox.Status\n ref={infiniteScrollRef}\n className=\"flex h-10 items-center justify-center\"\n aria-label=\"Loading more options\"\n >\n <Spinner className=\"stroke-ppx-neutral-10\" size=\"medium\" />\n </Combobox.Status>\n )}\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n );\n}\n\nexport function Item({\n className,\n ...props\n}: React.ComponentProps<typeof Combobox.Item>) {\n return (\n <Combobox.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n {props.children}\n </Combobox.Item>\n );\n}\n\nexport function MultiItem({\n className,\n ...props\n}: React.ComponentProps<typeof Combobox.Item>) {\n return (\n <Combobox.Item\n {...props}\n render={(itemProps, state) => (\n <div {...itemProps} className={cn(DROPDOWN_ITEM_CN, className)}>\n <ItemIndicator selected={state.selected} />\n {props.children}\n </div>\n )}\n ></Combobox.Item>\n );\n}\n\nfunction ItemIndicator(props: { selected: boolean }) {\n return (\n <div\n className={cn(\n \"border-ppx-neutral-10 bg-ppx-background peer flex size-4 shrink-0 items-center justify-center rounded-sm border outline-none transition-colors duration-150\",\n props.selected && \"border-ppx-primary-5 bg-ppx-primary-5 text-white\",\n )}\n >\n <Combobox.ItemIndicator>\n <CheckIcon />\n </Combobox.ItemIndicator>\n </div>\n );\n}\n\nexport function LoadingIndicator(props: { className?: string }) {\n return (\n <div className={cn(\"flex items-center justify-center\", props.className)}>\n <div className=\"flex space-x-1\">\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-40 [animation-delay:-0.3s] [animation-name:bounce-color]\"></div>\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-70 [animation-delay:-0.15s] [animation-name:bounce-color]\"></div>\n <div className=\"bg-ppx-foreground h-1 w-1 animate-bounce rounded-full opacity-100 [animation-name:bounce-color]\"></div>\n </div>\n </div>\n );\n}\n\nexport function SearchableTrigger(props: {\n placeholder?: string;\n size?: React.ComponentProps<typeof InputGroup.Root>[\"size\"];\n widthVariant?: React.ComponentProps<typeof InputGroup.Root>[\"widthVariant\"];\n className?: string;\n addons?: React.ReactNode;\n}) {\n const { invalid, disabled, searchableTriggerRef } = useComboboxContext();\n\n return (\n <InputGroup.Root {...props} disabled={disabled} ref={searchableTriggerRef}>\n <Combobox.Input\n render={(inputProps) => (\n <InputGroup.Input\n {...inputProps}\n invalid={invalid}\n placeholder={props.placeholder}\n />\n )}\n />\n\n {props.addons}\n <SearchableTriggerDropdownAddon />\n </InputGroup.Root>\n );\n}\n\nexport function SearchableTriggerDropdownAddon() {\n const { isLoading } = useComboboxContext();\n return (\n <InputGroup.Addon align=\"inline-end\" className=\"gap-0.5\">\n {isLoading && <LoadingIndicator className=\"mr-2\" />}\n {!isLoading && (\n <Combobox.Clear\n aria-label=\"Clear selection\"\n render={(clearProps) => (\n <InputGroup.Button size=\"icon-xs\" {...clearProps}>\n <ClearIcon className=\"size-4\" />\n </InputGroup.Button>\n )}\n />\n )}\n <Combobox.Trigger\n render={(triggerProps) => (\n <InputGroup.Button\n size=\"icon-xs\"\n aria-label=\"Open popup\"\n {...triggerProps}\n >\n <ChevronDownIcon />\n </InputGroup.Button>\n )}\n />\n </InputGroup.Addon>\n );\n}\n\ninterface TriggerProps\n extends Combobox.Trigger.Props,\n VariantProps<typeof triggerVariants> {}\n\nexport function Trigger({\n size,\n widthVariant,\n children,\n className,\n ...props\n}: TriggerProps) {\n const { isLoading, invalid } = useComboboxContext();\n return (\n <Combobox.Trigger\n aria-label=\"Open popup\"\n aria-invalid={invalid ?? undefined}\n className={cn(triggerVariants({ size, widthVariant }), className)}\n {...props}\n >\n {children}\n <div className=\"flex shrink-0 items-center gap-2\">\n {isLoading && <LoadingIndicator />}\n <ChevronDownIcon />\n </div>\n </Combobox.Trigger>\n );\n}\n\n/**\n * Renders the value, if `value` is a string or an object with `label` property in it,\n * then renders that value else you should provide a render function to render your custom value\n * **/\nexport function Value({\n children,\n className,\n placeholder,\n ...props\n}: {\n placeholder?: string;\n children?: React.ReactNode | ((selectedValue: any) => React.ReactNode);\n className?: string;\n}) {\n return (\n <span className={cn(\"text-ppx-sm truncate\", className)} {...props}>\n <Combobox.Value>\n {(value) => {\n if (value == null && placeholder) {\n return placeholder;\n }\n\n if (children) {\n return typeof children === \"function\" ? children(value) : children;\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return value.label;\n }\n\n return value;\n }}\n </Combobox.Value>\n </span>\n );\n}\n\nconst chipsTriggerVariants = cva(\n \"p-input text-ppx-sm bg-ppx-neutral-1 inline-flex items-center justify-between border border-ppx-neutral-5 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-ppx-primary-focus aria-invalid:border-ppx-red-4 focus-within:aria-invalid:outline-transparent has-data-disabled:border-ppx-neutral-3 has-data-disabled:bg-ppx-neutral-3 has-data-disabled:text-ppx-neutral-11 has-data-disabled:cursor-not-allowed\",\n {\n variants: {\n size: {\n default: \"rounded-input min-h-input\",\n sm: \"rounded-input-s min-h-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"enforced\",\n },\n },\n);\n\nexport function ChipsTrigger({\n size,\n widthVariant,\n ...props\n}: {\n children: React.ReactNode | ((selectedValue: any) => React.ReactNode);\n placeholder?: string;\n className?: string;\n} & VariantProps<typeof chipsTriggerVariants>) {\n const { chipsTriggerRef, isLoading, invalid } = useComboboxContext();\n return (\n <Combobox.Chips\n className={cn(\n chipsTriggerVariants({ size, widthVariant }),\n props.className,\n )}\n aria-invalid={invalid ?? undefined}\n ref={chipsTriggerRef}\n >\n <div className=\"flex flex-1 flex-wrap items-center gap-1\">\n <Combobox.Value>\n {(value: any[]) => (\n <>\n {value.map((item) => {\n return typeof props.children === \"function\"\n ? props.children(item)\n : props.children;\n })}\n <Combobox.Input\n placeholder={value.length > 0 ? \"\" : props.placeholder}\n className=\"text-ppx-sm text-ppx-foreground min-w-12 flex-1 border-0 outline-none\"\n />\n </>\n )}\n </Combobox.Value>\n </div>\n\n <div className=\"h-stretch-available text-ppx-muted-foreground flex items-center gap-2\">\n {isLoading && <LoadingIndicator />}\n <Combobox.Trigger className=\"h-full\">\n <ChevronDownIcon />\n </Combobox.Trigger>\n </div>\n </Combobox.Chips>\n );\n}\n\nexport function Chip(\n props: React.ComponentProps<typeof Combobox.Chip> & { key: React.Key },\n) {\n return (\n <Combobox.Chip\n {...props}\n className={cn(\n \"bg-ppx-neutral-3 text-ppx-foreground flex cursor-default items-center gap-1 rounded-full py-[0.2rem] pl-2 pr-1 text-sm outline-none\",\n props.className,\n )}\n >\n {props.children}\n <Combobox.ChipRemove\n className=\"hover:border-ppx-neutral-4 hover:bg-ppx-neutral-5 hover:text-ppx-background active:bg-ppx-neutral-6 flex size-5 shrink-0 items-center justify-center rounded-full border border-transparent text-inherit\"\n aria-label=\"Remove\"\n >\n <CloseIcon className=\"size-3\" />\n </Combobox.ChipRemove>\n </Combobox.Chip>\n );\n}\n\nexport function Search({\n placeholder = \"Search options\",\n ...props\n}: React.ComponentProps<typeof Combobox.Input>) {\n return (\n <div className=\"border-ppx-neutral-7 bg-ppx-background p-input sticky top-0 z-10 flex items-center justify-between gap-2 border-b-[0.75px]\">\n <Combobox.Input\n placeholder={placeholder}\n className=\"placeholder:text-ppx-neutral-7 flex-1 text-sm focus:outline-none\"\n data-popup-search\n {...props}\n />\n\n <SearchIcon className=\"text-ppx-neutral-10 size-3.5\" />\n </div>\n );\n}\n\nexport function useComboboxContext() {\n return React.useContext(ComboboxContext);\n}\n\nexport const BaseCombobox = Combobox;\n","import * as React from \"react\";\nimport { Select } from \"@base-ui/react/select\";\nimport { cn } from \"../utils\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport CheckIcon from \"../icons/check-icon\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\ntype SelectContextValues = {\n invalid?: boolean;\n};\n\nconst SelectContext = React.createContext<SelectContextValues>(\n {} as SelectContextValues,\n);\n\nfunction useSelectContext() {\n return React.useContext(SelectContext);\n}\n\nexport function Root<\n Value = any,\n Multiple extends boolean | undefined = false,\n>({\n children,\n invalid,\n ...props\n}: React.ComponentPropsWithoutRef<typeof Select.Root<Value, Multiple>> & {\n invalid?: boolean;\n}) {\n const value = React.useMemo(() => ({ invalid }), [invalid]);\n\n return (\n <SelectContext.Provider value={value}>\n <Select.Root {...props}>{children}</Select.Root>\n </SelectContext.Provider>\n );\n}\n\nexport function Content({\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"trigger\",\n}: React.PropsWithChildren<{\n portalProps?: React.ComponentProps<typeof Select.Portal>;\n positionerProps?: React.ComponentProps<typeof Select.Positioner>;\n popupProps?: React.ComponentProps<typeof Select.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n return (\n <Select.Portal {...portalProps}>\n <Select.Positioner\n sideOffset={6}\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n alignItemWithTrigger={false}\n >\n <Select.Popup\n className={cn(\n DROPDOWN_POPUP_CN,\n \"py-1\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n {...popupProps}\n >\n {children}\n </Select.Popup>\n </Select.Positioner>\n </Select.Portal>\n );\n}\n\nexport const List = Select.List;\n\nexport function Item({\n className,\n ...props\n}: React.ComponentProps<typeof Select.Item>) {\n return (\n <Select.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n <Select.ItemText>{props.children}</Select.ItemText>\n </Select.Item>\n );\n}\n\nexport function MultiItem({\n className,\n ...props\n}: React.ComponentProps<typeof Select.Item>) {\n return (\n <Select.Item\n {...props}\n render={(itemProps, state) => (\n <div {...itemProps} className={cn(DROPDOWN_ITEM_CN, className)}>\n <ItemIndicator selected={state.selected} />\n <Select.ItemText>{props.children}</Select.ItemText>\n </div>\n )}\n ></Select.Item>\n );\n}\n\nfunction ItemIndicator(props: { selected: boolean }) {\n return (\n <div\n className={cn(\n \"border-ppx-neutral-10 peer flex size-4 shrink-0 items-center justify-center rounded-sm border bg-white outline-none transition-colors duration-150\",\n props.selected && \"border-ppx-primary-5 bg-ppx-primary-5 text-white\",\n )}\n >\n <Select.ItemIndicator>\n <CheckIcon />\n </Select.ItemIndicator>\n </div>\n );\n}\n\nexport interface TriggerProps\n extends Select.Trigger.Props,\n VariantProps<typeof triggerVariants> {}\n\nexport function Trigger({ size, widthVariant, ...props }: TriggerProps) {\n const { invalid } = useSelectContext();\n return (\n <Select.Trigger\n aria-label=\"Open popup\"\n className={cn(triggerVariants({ size, widthVariant }), props.className)}\n aria-invalid={invalid ?? undefined}\n >\n {props.children}\n\n <Select.Icon className=\"shrink-0\">\n <ChevronDownIcon />\n </Select.Icon>\n </Select.Trigger>\n );\n}\n\nexport function MultiSelectedValue({\n selectedValue,\n maxItems,\n}: {\n selectedValue: any;\n maxItems: number;\n}) {\n if (\n !selectedValue ||\n (Array.isArray(selectedValue) && selectedValue.length === 0)\n ) {\n return null;\n }\n return (\n <div className=\"flex items-center gap-1\">\n <span className=\"truncate\">\n {selectedValue.slice(0, maxItems).join(\", \")}\n </span>\n {selectedValue.length > maxItems && (\n <span className=\"truncate\">\n {`(+${selectedValue.length - maxItems})`}\n </span>\n )}\n </div>\n );\n}\n\n/**\n * Renders the value, if `value` is a string or an object with `label` property in it,\n * then renders that value else you should provide a render function to render your custom value\n * **/\nexport function Value({\n children,\n className,\n placeholder,\n ...props\n}: Select.Value.Props & { placeholder?: string }) {\n return (\n <Select.Value className={cn(\"text-ppx-sm truncate\", className)} {...props}>\n {(value) => {\n if (value == null && placeholder) {\n return placeholder;\n }\n\n if (children) {\n return typeof children === \"function\" ? children(value) : children;\n }\n\n if (value && typeof value === \"object\" && \"label\" in value) {\n return value.label;\n }\n\n return value;\n }}\n </Select.Value>\n );\n}\n\nexport type SelectedValue<TValue> = TValue | null | undefined;\n\nexport const BaseSelect = Select;\n","import * as React from \"react\";\nimport { Menu } from \"@base-ui/react/menu\";\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\nimport {\n DROPDOWN_ITEM_CN,\n DROPDOWN_POPUP_CN,\n DROPDOWN_POSITIONER_CN,\n triggerVariants,\n} from \"../tw-styles/dropdown\";\nimport { type VariantProps } from \"class-variance-authority\";\n\nexport const Root = Menu.Root;\n\nexport function Trigger({\n className,\n children,\n size,\n widthVariant = \"fit\",\n ...props\n}: React.ComponentProps<typeof Menu.Trigger> &\n VariantProps<typeof triggerVariants>) {\n return (\n <Menu.Trigger\n className={cn(triggerVariants({ size, widthVariant }), className)}\n {...props}\n >\n {children}\n <DropdownIndicator />\n </Menu.Trigger>\n );\n}\n\nexport function Content({\n portalProps,\n positionerProps,\n popupProps,\n children,\n widthVariant = \"fit\",\n}: React.PropsWithChildren<{\n portalProps?: React.ComponentProps<typeof Menu.Portal>;\n positionerProps?: React.ComponentProps<typeof Menu.Positioner>;\n popupProps?: React.ComponentProps<typeof Menu.Popup>;\n widthVariant?: \"trigger\" | \"fit\" | \"enforced\";\n}>) {\n return (\n <Menu.Portal {...portalProps}>\n <Menu.Positioner\n sideOffset={6}\n align=\"start\"\n {...positionerProps}\n className={cn(DROPDOWN_POSITIONER_CN, positionerProps?.className)}\n >\n <Menu.Popup\n {...popupProps}\n className={cn(\n DROPDOWN_POPUP_CN,\n \"py-1\",\n widthVariant === \"trigger\"\n ? \"w-[var(--anchor-width)]\"\n : widthVariant === \"fit\"\n ? \"w-fit\"\n : widthVariant === \"enforced\"\n ? \"w-[var(--min-width-input)]\"\n : \"\",\n popupProps?.className,\n )}\n >\n {children}\n </Menu.Popup>\n </Menu.Positioner>\n </Menu.Portal>\n );\n}\n\nexport function DropdownIndicator() {\n return <ChevronDownIcon className=\"data-popup-open:rotate-180\" />;\n}\n\nexport function Item({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof Menu.Item>) {\n return (\n <Menu.Item className={cn(DROPDOWN_ITEM_CN, className)} {...props}>\n {children}\n </Menu.Item>\n );\n}\n\nexport function Separator({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.Separator>) {\n return (\n <Menu.Separator\n className={cn(\"bg-ppx-neutral-5 mx-2 my-1.5 h-px\", className)}\n {...props}\n />\n );\n}\n\nexport const Group = Menu.Group;\n\nexport function GroupLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.GroupLabel>) {\n return (\n <Menu.GroupLabel\n className={cn(\n \"font-sans-sb text-ppx-sm text-ppx-muted-foreground cursor-default select-none px-4 py-2 uppercase leading-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport const RadioGroup = Menu.RadioGroup;\n\nexport function RadioItem({\n className,\n ...props\n}: React.ComponentProps<typeof Menu.RadioItem>) {\n return (\n <Menu.RadioItem\n className={cn(DROPDOWN_ITEM_CN, className)}\n closeOnClick\n {...props}\n />\n );\n}\n\nexport const BaseTrigger = Menu.Trigger;\n\nexport const BaseMenu = Menu;\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Progress } from \"@base-ui/react/progress\";\n\nconst progressTrackVariants = cva(\n \"relative h-2 w-full overflow-hidden rounded-full bg-ppx-neutral-3\",\n {\n variants: {\n size: {\n default: \"h-2\",\n sm: \"h-1.5\",\n lg: \"h-3\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n },\n);\n\nexport const Root = Progress.Root;\n\nexport function Track({\n className,\n size,\n children,\n ...props\n}: React.ComponentProps<typeof Progress.Track> &\n VariantProps<typeof progressTrackVariants>) {\n return (\n <Progress.Track\n className={cn(progressTrackVariants({ size }), className)}\n {...props}\n >\n {children}\n </Progress.Track>\n );\n}\n\nexport function Indicator({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Indicator>) {\n return (\n <Progress.Indicator\n className={cn(\n \"bg-ppx-primary-b-5 h-full w-full flex-1 transition-all duration-300 ease-in-out\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Label({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Label>) {\n return (\n <Progress.Label\n className={cn(\"text-ppx-sm text-ppx-foreground font-medium\", className)}\n {...props}\n />\n );\n}\n\nexport function Value({\n className,\n ...props\n}: React.ComponentProps<typeof Progress.Value>) {\n return (\n <Progress.Value\n className={cn(\n \"text-ppx-h4 font-sans-b text-ppx-primary-b-5 flex-shrink-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport const BaseProgress = Progress;\n","import * as React from \"react\";\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst segmentedControlItemVariants = cva(\n \"relative flex items-center justify-center px-4 py-2 text-sm font-medium transition-all duration-200 ease-in-out cursor-pointer rounded-full whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ppx-primary-5 focus-visible:ring-offset-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"text-ppx-neutral-11 data-checked:bg-ppx-primary-5 data-checked:text-white data-checked:shadow-sm hover:text-ppx-neutral-12\",\n },\n size: {\n default: \"min-h-10 px-6\",\n sm: \"min-h-8 px-4 text-xs\",\n lg: \"min-h-12 px-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport function Root({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"segmented-control\"\n className={cn(\n \"bg-ppx-neutral-3 inline-flex items-center rounded-full p-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Item({\n children,\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof Radio.Root> &\n VariantProps<typeof segmentedControlItemVariants> & {\n children: React.ReactNode;\n }) {\n return (\n <Radio.Root\n data-slot=\"segmented-control-item\"\n className={cn(segmentedControlItemVariants({ variant, size, className }))}\n {...props}\n >\n {children}\n </Radio.Root>\n );\n}\n","import * as React from \"react\";\nimport { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\n\nimport { cn } from \"../utils\";\n\ntype TabsVariant = \"underline\";\n\ntype TabsContext = {\n variant: TabsVariant;\n};\n\nconst TabsContext = React.createContext<TabsContext | null>(null);\n\nconst useTabs = () => {\n const context = React.useContext(TabsContext);\n\n if (!context) {\n throw new Error(\"useTabs must be used within a Tabs\");\n }\n\n return context;\n};\n\nexport function Root({\n variant = \"underline\",\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Root> & {\n variant?: TabsVariant;\n}) {\n return (\n <TabsContext.Provider value={{ variant }}>\n <BaseTabs.Root\n data-slot=\"tabs\"\n className={cn(\"gap-2 flex flex-col\", className)}\n {...props}\n />\n </TabsContext.Provider>\n );\n}\n\nexport function List({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof BaseTabs.List>) {\n return (\n <BaseTabs.List\n data-slot=\"tabs-list\"\n className={cn(\n \"text-muted-foreground h-9 gap-x-1 p-1 relative z-0 inline-flex w-fit items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n <Indicator />\n <div\n className={\n \"absolute top-[calc(100%-1px)] left-1/2 z-2 h-[2px] w-[calc(100%-8px)] -translate-x-1/2 bg-[#EFEFEF]\"\n }\n />\n </BaseTabs.List>\n );\n}\n\nexport function Trigger({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Tab>) {\n return (\n <BaseTabs.Tab\n data-slot=\"tabs-trigger\"\n className={cn(\n \"focus-visible:ring-ring/50 [&_svg:not([class*='size-'])] gap-1.5 px-2 py-1 text-sm font-medium z-[1] flex-1 items-center justify-center text-nowrap whitespace-nowrap text-ppx-neutral-18 not-data-selected:hover:text-ppx-neutral-12 focus-visible:ring-[3px] data-selected:text-ppx-primary-b-5 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Indicator({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Indicator>) {\n const { variant } = useTabs();\n\n return (\n <BaseTabs.Indicator\n data-slot=\"tab-indicator\"\n className={cn(\n \"left-0 ease-in-out absolute w-[var(--active-tab-width)] translate-x-[var(--active-tab-left)] -translate-y-1/2 transition-all duration-300\",\n variant === \"underline\"\n ? \"top-full z-10 h-[2px] bg-ppx-primary-b-5\"\n : \"\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function Content({\n className,\n ...props\n}: React.ComponentProps<typeof BaseTabs.Panel>) {\n return (\n <BaseTabs.Panel\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n","import * as React from \"react\";\nimport { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\n\nimport { cn } from \"../utils\";\n\nfunction TooltipProvider(\n props: React.ComponentProps<typeof BaseTooltip.Provider>,\n) {\n return <BaseTooltip.Provider data-slot=\"tooltip-provider\" {...props} />;\n}\n\nfunction TooltipPortal({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Portal>) {\n return <BaseTooltip.Portal data-slot=\"tooltip-portal\" {...props} />;\n}\n\nfunction TooltipPositioner({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Positioner>) {\n return <BaseTooltip.Positioner data-slot=\"tooltip-positioner\" {...props} />;\n}\n\nfunction TooltipArrow({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Arrow>) {\n return <BaseTooltip.Arrow data-slot=\"tooltip-arrow\" {...props} />;\n}\n\nexport function Root({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Root>) {\n return (\n <TooltipProvider>\n <BaseTooltip.Root data-slot=\"tooltip\" {...props} />\n </TooltipProvider>\n );\n}\n\nexport const BaseRoot = BaseTooltip.Root;\nexport const BaseProvider = BaseTooltip.Provider;\n\nexport function Trigger({\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Trigger>) {\n return <BaseTooltip.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nexport function Content({\n className,\n align = \"center\",\n sideOffset = 8,\n side = \"top\",\n children,\n ...props\n}: React.ComponentProps<typeof BaseTooltip.Popup> & {\n align?: BaseTooltip.Positioner.Props[\"align\"];\n side?: BaseTooltip.Positioner.Props[\"side\"];\n sideOffset?: BaseTooltip.Positioner.Props[\"sideOffset\"];\n}) {\n return (\n <TooltipPortal>\n <TooltipPositioner sideOffset={sideOffset} align={align} side={side}>\n <BaseTooltip.Popup\n data-slot=\"tooltip-content\"\n className={cn(\n \"bg-black text-white px-3 py-1.5 shadow-sm rounded-md z-50 w-fit origin-[var(--transform-origin)] text-ppx-sm text-balance transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n >\n {children}\n <TooltipArrow className=\"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180\">\n <svg width=\"20\" height=\"10\" viewBox=\"0 0 20 10\" fill=\"none\">\n <path\n d=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V9H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n className=\"fill-black\"\n />\n <path\n d=\"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z\"\n className=\"fill-black\"\n />\n </svg>\n </TooltipArrow>\n </BaseTooltip.Popup>\n </TooltipPositioner>\n </TooltipPortal>\n );\n}\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\n\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst checkboxVariants = cva(\n \"peer aria-invalid:border-ppx-red-5 aria-invalid:text-shadow-ppx-red-5 flex items-center justify-center rounded-sm border transition-colors duration-150 outline-none focus-visible:ring-2 data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-white data-checked:bg-ppx-primary-5 data-[indeterminate]:bg-ppx-primary-5 data-checked:text-white data-[indeterminate]:text-white border-ppx-neutral-10 data-checked:border-ppx-primary-5 data-[indeterminate]:border-ppx-primary-5\",\n },\n size: {\n default: \"size-5\",\n sm: \"size-4\",\n lg: \"size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface CheckboxProps\n extends React.ComponentProps<typeof BaseCheckbox.Root>,\n VariantProps<typeof checkboxVariants> {}\n\nfunction Checkbox({ className, ...props }: CheckboxProps) {\n return (\n <BaseCheckbox.Root\n data-slot=\"checkbox\"\n className={cn(\n checkboxVariants({\n variant: props.variant,\n size: props.size,\n }),\n className,\n )}\n {...props}\n >\n <BaseCheckbox.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"block data-[unchecked]:hidden\"\n >\n {props.indeterminate ? (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"size-3.5\"\n >\n <path d=\"M5 12h14\" />\n </svg>\n ) : (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"size-3.5\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n )}\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n}\n\nexport { Checkbox };\n","import { cn } from \"../utils\";\nimport { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { Checkbox } from \"./checkbox\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCheckboxGroup>) {\n return (\n <BaseCheckboxGroup className={cn(\"flex gap-4\", className)} {...props} />\n );\n}\n\nexport function Item({\n className,\n invalid,\n children,\n ...rest\n}: React.PropsWithChildren<React.ComponentProps<typeof Checkbox>> & {\n className?: string;\n invalid?: boolean;\n}) {\n return (\n <label\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300\",\n className,\n )}\n >\n <div className=\"flex-1\">{children}</div>\n <Checkbox\n {...rest}\n className={\"ml-auto shrink-0 self-start\"}\n size=\"lg\"\n aria-invalid={invalid}\n />\n </label>\n );\n}\n\nexport function Header(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div className={cn(\"mb-5 flex items-center gap-2\", props.className)}>\n {props.children}\n </div>\n );\n}\n\nexport function Title(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div\n className={cn(\n \"font-sans-sb text-ppx-base text-ppx-foreground\",\n props.className,\n )}\n >\n {props.children}\n </div>\n );\n}\n\nexport function Description(\n props: React.PropsWithChildren<{ className?: string }>,\n) {\n return (\n <p\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground mb-5\",\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n","import * as React from \"react\";\nimport { Radio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\n\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"radio-group\"\n className={cn(\"flex flex-col gap-3\", className)}\n {...props}\n />\n );\n}\n\nconst radioVariants = cva(\n \"relative inline-flex bg-ppx-background aria-invalid:border-ppx-red-5 aspect-square shrink-0 rounded-full border border-ppx-neutral-10 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] data-disabled:cursor-not-allowed data-disabled:opacity-50 items-center justify-center\",\n {\n variants: {\n variant: {\n default: \"data-checked:border-ppx-primary-5 text-ppx-primary-5\",\n },\n size: {\n default: \"size-5\",\n sm: \"size-4\",\n lg: \"size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ninterface RadioGroupItemProps\n extends React.ComponentProps<typeof Radio.Root>,\n VariantProps<typeof radioVariants> {}\n\nexport function Item({\n className,\n variant,\n size,\n ...props\n}: RadioGroupItemProps) {\n return (\n <Radio.Root\n data-slot=\"radio-group-item\"\n className={cn(radioVariants({ variant, size, className }))}\n {...props}\n >\n <Radio.Indicator\n data-slot=\"radio-group-indicator\"\n className=\"relative flex items-center justify-center\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn(\n \"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\",\n size === \"sm\" && \"size-2\",\n size === undefined || size === \"default\" ? \"size-3\" : \"\",\n size === \"lg\" && \"size-3.5\",\n )}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n </svg>\n </Radio.Indicator>\n </Radio.Root>\n );\n}\n","import { cn } from \"../utils\";\nimport { Item as RadioGroupItemPrimitive } from \"./radio-group\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\n\nexport function Group({\n className,\n ...props\n}: React.ComponentProps<typeof BaseRadioGroup>) {\n return (\n <BaseRadioGroup\n data-slot=\"radio-group\"\n className={cn(\"flex gap-4\", className)}\n {...props}\n />\n );\n}\n\nexport function Item({\n className,\n invalid,\n children,\n ...rest\n}: React.PropsWithChildren<\n React.ComponentProps<typeof RadioGroupItemPrimitive>\n> & {\n className?: string;\n invalid?: boolean;\n}) {\n return (\n <label\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300\",\n className,\n )}\n >\n <div className=\"flex-1\">{children}</div>\n <RadioGroupItemPrimitive\n {...rest}\n className={\"ml-auto shrink-0 self-start\"}\n size=\"lg\"\n aria-invalid={invalid}\n />\n </label>\n );\n}\n\nexport function Header(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div className={cn(\"mb-5 flex items-center gap-2\", props.className)}>\n {props.children}\n </div>\n );\n}\n\nexport function Title(props: React.PropsWithChildren<{ className?: string }>) {\n return (\n <div\n className={cn(\n \"font-sans-sb text-ppx-base text-ppx-foreground\",\n props.className,\n )}\n >\n {props.children}\n </div>\n );\n}\n\nexport function Description(\n props: React.PropsWithChildren<{ className?: string }>,\n) {\n return (\n <p\n className={cn(\n \"text-ppx-sm text-ppx-muted-foreground mb-5\",\n props.className,\n )}\n >\n {props.children}\n </p>\n );\n}\n","import * as React from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\n\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nfunction Breadcrumb({ ...props }: React.ComponentProps<\"nav\">) {\n return <nav aria-label=\"breadcrumb\" data-slot=\"breadcrumb\" {...props} />;\n}\n\nfunction BreadcrumbList({ className, ...props }: React.ComponentProps<\"ol\">) {\n return (\n <ol\n data-slot=\"breadcrumb-list\"\n className={cn(\n \"gap-1.5 ppx-sm:gap-2.5 flex flex-wrap items-center text-ppx-xs break-words text-ppx-muted-foreground\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbItem({ className, ...props }: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-item\"\n className={cn(\"gap-1.5 inline-flex items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbLink({\n className,\n render,\n ...props\n}: React.ComponentProps<\"a\"> & useRender.ComponentProps<\"a\">) {\n const element = useRender({\n defaultTagName: \"a\",\n render,\n props: mergeProps<\"a\">(\n {\n className: cn(\n \"transition-colors hover:text-ppx-foreground hover:underline underline-offset-3\",\n className,\n ),\n },\n props,\n ),\n });\n\n return element;\n}\n\nfunction BreadcrumbPage({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"breadcrumb-page\"\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction BreadcrumbSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) {\n return (\n <li\n data-slot=\"breadcrumb-separator\"\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n <ChevronDownIcon className={cn(\"stroke-black rotate-270\", className)} />\n </li>\n );\n}\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n};\n","import * as React from \"react\";\nimport { Collapsible as BaseCollapsible } from \"@base-ui/react\";\n\nimport { cn } from \"../utils\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nexport function Root({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCollapsible.Root>) {\n return (\n <BaseCollapsible.Root\n data-slot=\"collapsible\"\n className={cn(\"flex flex-col\", className)}\n {...props}\n />\n );\n}\n\nexport function Trigger(\n props: React.ComponentProps<typeof BaseCollapsible.Trigger>,\n) {\n return (\n <BaseCollapsible.Trigger\n data-slot=\"collapsible-trigger\"\n {...props}\n className={cn(\"group flex items-center gap-2\", props.className)}\n />\n );\n}\n\nexport function Panel({\n className,\n ...props\n}: React.ComponentProps<typeof BaseCollapsible.Panel>) {\n return (\n <BaseCollapsible.Panel\n data-slot=\"collapsible-content\"\n className={cn(\n \"flex h-[var(--collapsible-panel-height)] w-full flex-col overflow-hidden transition-all duration-150 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0 [&[hidden]:not([hidden='until-found'])]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function ToggleIcon() {\n return (\n <ChevronDownIcon className=\"rotate-270 group-data-[panel-open]:rotate-360 transition-all ease-out\" />\n );\n}\n","import * as React from \"react\";\nimport {\n DayButton,\n DayPicker,\n getDefaultClassNames,\n type DayPickerProps,\n} from \"react-day-picker\";\n\nimport { cn } from \"../utils\";\nimport { Button, buttonVariants } from \"./button\";\nimport ChevronDownIcon from \"../icons/chevron-down-icon\";\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n formatters,\n components,\n ...props\n}: DayPickerProps) {\n const defaultClassNames = getDefaultClassNames();\n const buttonVariant = \"ghost\";\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-ppx-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(\"default\", { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit min-w-input\", defaultClassNames.root),\n months: cn(\n \"flex gap-4 flex-col ppx-md:flex-row relative\",\n defaultClassNames.months,\n ),\n month: cn(\"flex flex-col w-full gap-4\", defaultClassNames.month),\n nav: cn(\n \"flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between\",\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none\",\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n \"flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)\",\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n \"w-full flex items-center text-ppx-sm font-medium justify-center h-(--cell-size) gap-1.5\",\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n \"relative border border-ppx-neutral-5 shadow-xs rounded-ppx-s\",\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn(\n \"absolute bg-white inset-0 opacity-0\",\n defaultClassNames.dropdown,\n ),\n caption_label: cn(\n \"select-none font-medium\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"rounded-ppx-s pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-ppx-muted-foreground [&>svg]:size-3.5\",\n defaultClassNames.caption_label,\n ),\n table: \"w-full border-collapse\",\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"text-ppx-muted-foreground rounded-ppx-s flex-1 font-normal text-[0.8rem] select-none\",\n defaultClassNames.weekday,\n ),\n week: cn(\"flex w-full mt-2\", defaultClassNames.week),\n week_number_header: cn(\n \"select-none w-(--cell-size)\",\n defaultClassNames.week_number_header,\n ),\n week_number: cn(\n \"text-[0.8rem] select-none text-ppx-muted-foreground\",\n defaultClassNames.week_number,\n ),\n day: cn(\n \"relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-ppx-s group/day aspect-square select-none\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-ppx-s\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-ppx-s\",\n defaultClassNames.day,\n ),\n range_start: cn(\"rounded-l-ppx-s\", defaultClassNames.range_start),\n range_middle: cn(\n \"rounded-none bg-ppx-primary-b-1\",\n defaultClassNames.range_middle,\n ),\n range_end: cn(\"rounded-r-ppx-s\", defaultClassNames.range_end),\n today: cn(\n \"bg-ppx-primary-b-1 text-ppx-foreground rounded-ppx-s data-[selected=true]:rounded-none\",\n defaultClassNames.today,\n ),\n outside: cn(\n \"text-ppx-muted-foreground aria-selected:text-ppx-muted-foreground\",\n defaultClassNames.outside,\n ),\n disabled: cn(\n \"text-ppx-muted-foreground opacity-50\",\n defaultClassNames.disabled,\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n );\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronDownIcon\n className={cn(\"rotate-90\", className)}\n {...props}\n />\n );\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronDownIcon\n className={cn(\"rotate-270\", className)}\n {...props}\n />\n );\n }\n\n return <ChevronDownIcon className={cn(className)} {...props} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"size-(--cell-size) flex items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString()}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"min-w-(--cell-size) flex aspect-square size-auto w-full flex-col gap-1 font-normal leading-none [&>span]:text-[0.75rem] [&>span]:opacity-70\",\n // Focus styles\n \"ring-ppx-neutral-3 group-data-[focused=true]/day:ring-ppx-primary-5/50 group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px]\",\n // Single date selection\n \"data-[selected-single=true]:bg-ppx-primary-5 data-[selected-single=true]:hover:bg-ppx-primary-5 data-[selected-single=true]:text-white data-[selected-single=true]:hover:text-white\",\n // Range start\n \"data-[range-start=true]:rounded-ppx-s data-[range-start=true]:rounded-l-ppx-s data-[range-start=true]:bg-ppx-primary-5 data-[range-start=true]:hover:bg-ppx-primary-5 data-[range-start=true]:text-white\",\n // Range end\n \"data-[range-end=true]:rounded-ppx-s data-[range-end=true]:rounded-r-ppx-s data-[range-end=true]:bg-ppx-primary-5 data-[range-end=true]:hover:bg-ppx-primary-5 data-[range-end=true]:text-white\",\n // Range middle\n \"data-[range-middle=true]:bg-ppx-primary-b-1 data-[range-middle=true]:text-ppx-foreground data-[range-middle=true]:hover:bg-ppx-primary-b-1 data-[range-middle=true]:rounded-none\",\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, CalendarDayButton };\n","import { cn } from \"../utils\";\n\nexport default function CircleAlertIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <line x1=\"12\" x2=\"12\" y1=\"8\" y2=\"12\" />\n <line x1=\"12\" x2=\"12.01\" y1=\"16\" y2=\"16\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function CircleCheckIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m9 12 2 2 4-4\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function InfoIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function TriangleAlertIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"size-4 shrink-0\", props.className)}\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function SpinnerIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n );\n}\n","import { Toast } from \"@base-ui/react\";\nimport CircleAlertIcon from \"../icons/circle-alert-icon\";\nimport CircleCheckIcon from \"../icons/circle-check-icon\";\nimport InfoIcon from \"../icons/info-icon\";\nimport TriangleAlertIcon from \"../icons/triangle-alert-icon\";\nimport SpinnerIcon from \"../icons/spinner-icon\";\n\nimport { cn } from \"../utils\";\nimport { buttonVariants } from \"./button\";\nimport CloseIcon from \"../icons/close-icon\";\n\nconst toast = Toast.createToastManager();\nconst anchoredToast = Toast.createToastManager();\n\ntype ToastVariants =\n | \"success\"\n | \"info\"\n | \"loading\"\n | \"success\"\n | \"warning\"\n | \"error\";\n\nconst TOAST_ICONS: Record<ToastVariants, any> = {\n error: CircleAlertIcon,\n info: InfoIcon,\n loading: SpinnerIcon,\n success: CircleCheckIcon,\n warning: TriangleAlertIcon,\n} as const;\n\ntype ToastPosition =\n | \"top-left\"\n | \"top-center\"\n | \"top-right\"\n | \"bottom-left\"\n | \"bottom-center\"\n | \"bottom-right\";\n\ninterface ToastProviderProps extends Toast.Provider.Props {\n position?: ToastPosition;\n}\n\nfunction ToastProvider({\n children,\n position = \"top-center\",\n ...props\n}: ToastProviderProps) {\n return (\n <Toast.Provider toastManager={toast} {...props}>\n {children}\n <Toasts position={position} />\n </Toast.Provider>\n );\n}\n\nfunction Toasts(props: { position: ToastPosition }) {\n const { position = \"top-center\" } = props;\n const { toasts } = Toast.useToastManager();\n\n const isTop = position.startsWith(\"top\");\n const hasLoadingToast = toasts.some((t) => t.type === \"loading\");\n\n return (\n <Toast.Portal data-slot=\"toast-portal\">\n {hasLoadingToast && (\n <div\n className=\"bg-ppx-foreground/20 fixed inset-0 z-40 transition-opacity\"\n data-slot=\"toast-backdrop\"\n />\n )}\n <Toast.Viewport\n className={cn(\n \"max-w-90 fixed z-50 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]\",\n // Vertical positioning\n \"data-[position*=top]:top-(--toast-inset)\",\n \"data-[position*=bottom]:bottom-(--toast-inset)\",\n // Horizontal positioning\n \"data-[position*=left]:left-(--toast-inset)\",\n \"data-[position*=right]:right-(--toast-inset)\",\n \"data-[position*=center]:left-1/2 data-[position*=center]:-translate-x-1/2\",\n )}\n data-position={position}\n data-slot=\"toast-viewport\"\n >\n {toasts.map((toast) => {\n const Icon = toast.type\n ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS]\n : null;\n\n return (\n <Toast.Root\n className={cn(\n \"h-(--toast-calc-height) bg-ppx-background text-ppx-foreground rounded-ppx-m border-ppx-neutral-4 absolute z-[calc(9999-var(--toast-index))] w-full select-none border bg-clip-padding shadow-lg [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-ppx-m)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)]\",\n // Base positioning using data-position\n \"data-[position*=right]:left-auto data-[position*=right]:right-0\",\n \"data-[position*=left]:left-0 data-[position*=left]:right-auto\",\n \"data-[position*=center]:left-0 data-[position*=center]:right-0\",\n \"data-[position*=top]:bottom-auto data-[position*=top]:top-0 data-[position*=top]:origin-top\",\n \"data-[position*=bottom]:bottom-0 data-[position*=bottom]:top-auto data-[position*=bottom]:origin-bottom\",\n // Gap fill for hover\n \"after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full\",\n \"data-[position*=top]:after:top-full\",\n \"data-[position*=bottom]:after:bottom-full\",\n // Define some variables\n \"[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]\",\n // Define offset-y variable\n \"data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]\",\n \"data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]\",\n // Default state transform\n \"data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]\",\n \"data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]\",\n // Limited state\n \"data-limited:opacity-0\",\n // Expanded state\n \"data-expanded:h-(--toast-height)\",\n \"data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]\",\n // Starting and ending animations\n \"data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]\",\n \"data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]\",\n \"data-ending-style:opacity-0\",\n // Ending animations (direction-aware)\n \"data-[position*=top]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(-100%-var(--toast-inset)))]\",\n \"data-[position*=bottom]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]\",\n \"data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]\",\n \"data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]\",\n // Ending animations (expanded)\n \"data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]\",\n \"data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]\",\n toast.type === \"success\" && \"bg-ppx-green-1\",\n toast.type === \"info\" && \"bg-ppx-primary-b-1\",\n toast.type === \"warning\" && \"bg-ppx-yellow-1\",\n toast.type === \"error\" && \"bg-ppx-red-1\",\n )}\n data-position={position}\n key={toast.id}\n swipeDirection={\n position.includes(\"center\")\n ? [isTop ? \"up\" : \"down\"]\n : position.includes(\"left\")\n ? [\"left\", isTop ? \"up\" : \"down\"]\n : [\"right\", isTop ? \"up\" : \"down\"]\n }\n toast={toast}\n >\n <Toast.Content className=\"duration-250 data-behind:pointer-events-none data-behind:opacity-0 data-expanded:opacity-100 text-ppx-sm pointer-events-auto flex flex-col gap-2.5 overflow-hidden px-3.5 py-4 transition-opacity\">\n <div className=\"flex gap-2\">\n {Icon && (\n <div\n className=\"[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\"\n data-slot=\"toast-icon\"\n >\n <Icon className=\"in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80\" />\n </div>\n )}\n\n <div className=\"flex flex-col gap-1.5\">\n <Toast.Title\n className=\"text-ppx-base font-medium leading-none\"\n data-slot=\"toast-title\"\n />\n <Toast.Description\n className=\"text-ppx-muted-foreground\"\n data-slot=\"toast-description\"\n />\n\n {toast.type === \"loading\" ? null : (\n <Toast.Close\n className={buttonVariants({\n size: \"icon-sm\",\n variant: \"ghost\",\n className: \"absolute right-2 top-2 shrink-0\",\n })}\n aria-label=\"Close\"\n >\n <CloseIcon className=\"size-4\" />\n </Toast.Close>\n )}\n </div>\n </div>\n {toast.actionProps && (\n <Toast.Action\n className={buttonVariants({\n size: \"sm\",\n })}\n data-slot=\"toast-action\"\n >\n {toast.actionProps.children}\n </Toast.Action>\n )}\n </Toast.Content>\n </Toast.Root>\n );\n })}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n\nfunction AnchoredToastProvider({ children, ...props }: Toast.Provider.Props) {\n return (\n <Toast.Provider toastManager={anchoredToast} {...props}>\n {children}\n <AnchoredToasts />\n </Toast.Provider>\n );\n}\n\nfunction AnchoredToasts() {\n const { toasts } = Toast.useToastManager();\n\n return (\n <Toast.Portal data-slot=\"toast-portal-anchored\">\n <Toast.Viewport\n className=\"outline-none\"\n data-slot=\"toast-viewport-anchored\"\n >\n {toasts.map((toast) => {\n const Icon = toast.type\n ? TOAST_ICONS[toast.type as keyof typeof TOAST_ICONS]\n : null;\n const tooltipStyle =\n (toast.data as { tooltipStyle?: boolean })?.tooltipStyle ?? false;\n const positionerProps = toast.positionerProps;\n\n if (!positionerProps?.anchor) {\n return null;\n }\n\n return (\n <Toast.Positioner\n className=\"z-50 max-w-[min(--spacing(64),var(--available-width))]\"\n data-slot=\"toast-positioner\"\n key={toast.id}\n sideOffset={positionerProps.sideOffset ?? 4}\n toast={toast}\n >\n <Toast.Root\n className={cn(\n \"bg-ppx-background text-ppx-foreground data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 text-ppx-sm relative text-balance border bg-clip-padding transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)]\",\n tooltipStyle\n ? \"rounded-ppx-m shadow-md shadow-black/5 before:rounded-[calc(var(--radius-ppx-s)-1px)]\"\n : \"rounded-ppx-l shadow-lg before:rounded-[calc(var(--radius-ppx-m)-1px)]\",\n toast.type === \"success\" && \"bg-ppx-green-1\",\n toast.type === \"info\" && \"bg-ppx-primary-b-1\",\n toast.type === \"warning\" && \"bg-ppx-yellow-1\",\n toast.type === \"error\" && \"bg-ppx-red-1\",\n )}\n data-slot=\"toast-popup\"\n toast={toast}\n >\n {tooltipStyle ? (\n <Toast.Content className=\"pointer-events-auto px-2 py-1\">\n <Toast.Title data-slot=\"toast-title\" />\n </Toast.Content>\n ) : (\n <Toast.Content className=\"text-ppx-sm pointer-events-auto relative flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3\">\n <div className=\"flex gap-2\">\n {Icon && (\n <div\n className=\"[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\"\n data-slot=\"toast-icon\"\n >\n <Icon className=\"in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80\" />\n </div>\n )}\n\n <div className=\"flex flex-col gap-0.5\">\n <Toast.Title\n className=\"text-ppx-base font-medium leading-none\"\n data-slot=\"toast-title\"\n />\n <Toast.Description\n className=\"text-ppx-muted-foreground\"\n data-slot=\"toast-description\"\n />\n </div>\n </div>\n {toast.actionProps && (\n <Toast.Action\n className={buttonVariants({ size: \"sm\" })}\n data-slot=\"toast-action\"\n >\n {toast.actionProps.children}\n </Toast.Action>\n )}\n </Toast.Content>\n )}\n </Toast.Root>\n </Toast.Positioner>\n );\n })}\n </Toast.Viewport>\n </Toast.Portal>\n );\n}\n\nexport {\n ToastProvider,\n type ToastPosition,\n toast,\n AnchoredToastProvider,\n anchoredToast,\n};\n","import { createContext } from \"react\";\nimport { AnchoredToastProvider, ToastProvider } from \"../components/toast\";\n\nconst PXUIContext = createContext(null);\n\nexport function PXUIProvider(props: React.PropsWithChildren) {\n return (\n <PXUIContext.Provider value={null}>\n <ToastProvider>\n <AnchoredToastProvider>{props.children}</AnchoredToastProvider>\n </ToastProvider>\n </PXUIContext.Provider>\n );\n}\n","import { cn } from \"../utils\";\n\nfunction Label({ className, ...props }: React.ComponentProps<\"label\">) {\n return (\n <label\n data-slot=\"label\"\n className={cn(\n \"text-ppx-sm peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-50 group-data-disabled:pointer-events-none group-data-disabled:opacity-50 flex select-none items-center gap-2 font-medium leading-none\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst inputVariants = cva(\n \"font-medium shadow-xs inline-flex border-ppx-neutral-5 bg-ppx-neutral-1 text-ppx-sm text-ppx-foreground outline-transparent focus:-outline-offset-1 focus:outline-2 placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:not-aria-invalid:outline-ppx-primary-focus focus:not-aria-invalid:not-aria-disabled:bg-ppx-background focus:not-aria-invalid:bg-white disabled:cursor-not-allowed disabled:border-ppx-neutral-3 disabled:bg-ppx-neutral-3 disabled:text-ppx-neutral-11 disabled:placeholder:text-ppx-neutral-11 aria-invalid:outline-ppx-red-4 aria-invalid:bg-ppx-red-1 aria-invalid:outline aria-invalid:-outline-offset-1 placeholder:font-sans-light p-input border\",\n {\n variants: {\n size: {\n default: \"h-input rounded-input\",\n sm: \"h-input-s rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\ninterface InputProps\n extends Omit<React.ComponentProps<\"input\">, \"size\">,\n VariantProps<typeof inputVariants> {\n invalid?: boolean;\n}\n\nfunction Input({\n className,\n size,\n invalid,\n widthVariant,\n ...props\n}: InputProps) {\n return (\n <input\n data-slot=\"input\"\n className={cn(\n inputVariants({ size, widthVariant }),\n props.type === \"number\" && \"no-arrow-spin\",\n className,\n )}\n aria-invalid={invalid}\n {...props}\n />\n );\n}\n\nexport { Input };\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../utils\";\n\nconst textareaVariants = cva(\n \"font-medium shadow-xs border-ppx-neutral-5 bg-ppx-neutral-1 text-ppx-sm text-ppx-foreground outline-transparent focus:-outline-offset-1 focus:outline-2 placeholder:text-ppx-sm placeholder:text-ppx-neutral-12 focus:not-aria-invalid:outline-ppx-primary-focus focus:not-aria-invalid:bg-ppx-background disabled:cursor-not-allowed disabled:border-ppx-neutral-3 disabled:bg-ppx-neutral-3 disabled:text-ppx-neutral-11 disabled:placeholder:text-ppx-neutral-11 aria-invalid:outline-ppx-red-4 aria-invalid:bg-ppx-red-1 aria-invalid:outline aria-invalid:-outline-offset-1 placeholder:font-sans-light p-input border\",\n {\n variants: {\n size: {\n default: \"min-h-16 rounded-input\",\n sm: \"min-h-12 rounded-input-s\",\n },\n widthVariant: {\n enforced: \"min-w-input w-[var(--min-width-input)]\",\n full: \"min-w-0 w-full\",\n },\n },\n defaultVariants: {\n size: \"default\",\n widthVariant: \"full\",\n },\n },\n);\n\nexport interface TextareaProps\n extends React.ComponentProps<\"textarea\">,\n VariantProps<typeof textareaVariants> {\n invalid?: boolean;\n}\n\nfunction Textarea({\n className,\n size,\n invalid,\n widthVariant,\n ...props\n}: TextareaProps) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(textareaVariants({ size, widthVariant }), className)}\n aria-invalid={invalid}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import { Avatar as AvatarBase } from \"@base-ui/react/avatar\";\nimport { cn } from \"../utils\";\nimport { useMemo } from \"react\";\nimport * as Tooltip from \"./tooltip\";\n\ntype AvatarVariant = \"squared\" | \"rounded\";\n\nconst COLORS_PALETTE = [\n \"#bdc3c7\",\n \"#6f7b87\",\n \"#2c3e50\",\n \"#2f3193\",\n \"#662d91\",\n \"#922790\",\n \"#ec2176\",\n \"#ed1c24\",\n \"#f36622\",\n \"#f8941e\",\n \"#fab70f\",\n \"#fdde00\",\n \"#d1d219\",\n \"#8ec73f\",\n \"#00a650\",\n \"#00aa9c\",\n \"#00adef\",\n \"#0081cd\",\n \"#005bab\",\n \"#012a4a\",\n \"#013a63\",\n \"#06d6a0\",\n \"#ef476f\",\n \"#ff5d8f\",\n \"#0496ff\",\n \"#c879ff\",\n];\n\nconst generateNameInitials = (name: string) => {\n if (!name.length) return \"\";\n const rgx = new RegExp(/(\\b\\w)/g);\n\n const initials = [...name.matchAll(rgx)];\n return (\n (initials.shift()?.[1] || \"\") + (initials.pop()?.[1] || \"\")\n ).toUpperCase();\n};\n\nconst getBgColorAndTextColor = (name: string | null | undefined) => {\n if (!name) return {};\n let index = name[0].toUpperCase().charCodeAt(0);\n\n const lastName = name.split(\" \")[1];\n\n if (lastName) {\n index = index + lastName[0].toUpperCase().charCodeAt(0);\n index = Math.floor(index / 2);\n }\n\n index = Math.abs(index - 65);\n\n return {\n backgroundColor: COLORS_PALETTE[index],\n color: \"#fff\",\n };\n};\n\nconst replaceSizeInUrl = (url: string, size: string) => {\n const numberSize = size.replace(\"px\", \"\");\n const newSize = `${numberSize}x${numberSize}`;\n return url.replace(\"/SIZE/\", `/${newSize}/`);\n};\n\ninterface AvatarProps {\n imgSrc: string | null | undefined;\n name: string | null | undefined;\n variant?: AvatarVariant;\n size?: `${number}px`;\n className?: string;\n children?: React.ReactNode;\n hideTooltip?: boolean;\n}\n\nexport function Avatar(props: AvatarProps) {\n return (\n <Tooltip.Root disabled={props.hideTooltip}>\n <Tooltip.Trigger\n render={(tooltipProps) => (\n <AvatarImpl {...props} avatarRootProps={tooltipProps} />\n )}\n />\n <Tooltip.Content>{props.name}</Tooltip.Content>\n </Tooltip.Root>\n );\n}\n\ntype AvatarImplProps = Omit<AvatarProps, \"hideTooltip\"> & {\n avatarRootProps?: React.ComponentProps<typeof AvatarBase.Root>;\n};\n\nexport function AvatarImpl(props: AvatarImplProps) {\n const { variant = \"squared\", size = \"100px\", avatarRootProps } = props;\n const name = props.name ?? \"\";\n const nameInitial = useMemo(() => generateNameInitials(name), [name]);\n const colorStyle = useMemo(() => getBgColorAndTextColor(name), [name]);\n const sizeReplacedUrl = useMemo(\n () => (props.imgSrc ? replaceSizeInUrl(props.imgSrc, size) : undefined),\n [props.imgSrc, size],\n );\n\n return (\n <AvatarBase.Root\n data-slot=\"avatar\"\n className={cn(\n \"@container relative flex shrink-0 overflow-hidden\",\n variant === \"rounded\" && \"rounded-full\",\n variant === \"squared\" && \"rounded-ppx-s\",\n props.className,\n )}\n style={{\n width: size,\n height: size,\n }}\n {...avatarRootProps}\n >\n <AvatarBase.Image\n data-slot=\"avatar-image\"\n className={\"size-full object-cover\"}\n src={sizeReplacedUrl}\n />\n\n <AvatarBase.Fallback\n data-slot=\"avatar-fallback\"\n className={cn(\n \"font-medium flex size-full items-center justify-center text-[40cqw] select-none\",\n )}\n style={colorStyle}\n >\n {nameInitial}\n </AvatarBase.Fallback>\n\n {props.children}\n </AvatarBase.Root>\n );\n}\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Avatar, AvatarImpl } from \"./avatar\";\nimport * as Popover from \"./popover\";\nimport * as Tooltip from \"./tooltip\";\n\ninterface AvatarGroupProps {\n avatars: React.ComponentProps<typeof Avatar>[];\n max?: number;\n className?: string;\n}\n\nexport function AvatarGroup({ max = 4, avatars, className }: AvatarGroupProps) {\n const hasOverflow = avatars.length > max;\n const overflowAvatars = avatars.slice(max);\n\n return (\n <Tooltip.BaseProvider>\n <div\n className={cn(\"flex items-center\", className)}\n data-slot=\"avatar-group\"\n >\n {avatars.map((avatar, index) => (\n <React.Fragment key={avatar.name}>\n <Tooltip.BaseRoot>\n <Tooltip.Trigger\n render={(tooltipProps) => (\n <div\n className=\"relative\"\n style={{\n marginLeft:\n index > 0\n ? `-${parseInt(avatar.size ?? \"100px\") * 0.25}px`\n : \"0\",\n zIndex: avatars.length - index,\n }}\n {...tooltipProps}\n >\n <AvatarImpl {...avatar} className=\"ring-2 ring-white\" />\n </div>\n )}\n />\n <Tooltip.Content>{avatar.name}</Tooltip.Content>\n </Tooltip.BaseRoot>\n </React.Fragment>\n ))}\n\n {hasOverflow && (\n <div\n className=\"relative\"\n style={{\n marginLeft: `-${parseInt(avatars[0].size ?? \"100px\") * 0.25}px`,\n zIndex: 0,\n }}\n >\n <Popover.Root>\n <Popover.Trigger openOnHover>\n <div\n className={cn(\n \"bg-ppx-neutral-3 text-ppx-neutral-18 hover:bg-ppx-neutral-4 flex cursor-pointer items-center justify-center font-medium transition-colors\",\n avatars[0].variant === \"rounded\"\n ? \"rounded-full\"\n : \"rounded-ppx-s\",\n )}\n style={{\n width: avatars[0].size ?? \"100px\",\n height: avatars[0].size ?? \"100px\",\n fontSize: `${parseInt(avatars[0].size ?? \"100px\") * 0.3}px`,\n }}\n >\n +{overflowAvatars.length}\n </div>\n </Popover.Trigger>\n\n <Popover.Content\n className=\"w-80\"\n positionerProps={{ align: \"start\", side: \"top\" }}\n >\n <div className=\"max-h-64 space-y-2 overflow-y-auto\">\n {overflowAvatars.map((avatar) => (\n <div\n key={avatar.name}\n className=\"flex items-center gap-3 rounded-md p-2\"\n >\n <Avatar {...avatar} size=\"24px\" hideTooltip />\n <span className=\"text-ppx-neutral-18 text-sm font-medium\">\n {avatar.name}\n </span>\n </div>\n ))}\n </div>\n </Popover.Content>\n </Popover.Root>\n </div>\n )}\n </div>\n </Tooltip.BaseProvider>\n );\n}\n","import * as React from \"react\";\nimport { Switch as BaseSwitch } from \"@base-ui/react/switch\";\n\nimport { cn } from \"../utils\";\n\nfunction Switch({\n className,\n size,\n ...props\n}: React.ComponentProps<typeof BaseSwitch.Root> & {\n size?: \"sm\" | \"lg\" | \"default\";\n}) {\n return (\n <BaseSwitch.Root\n data-slot=\"switch\"\n className={cn(\n \"shadow-xs focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30 data-checked:bg-ppx-primary-5 data-unchecked:bg-ppx-neutral-4 data-disabled:cursor-not-allowed data-disabled:opacity-50 peer inline-flex shrink-0 items-center rounded-full border border-transparent outline-none transition-all\",\n size === \"sm\" && \"h-4 w-8\",\n size === undefined || size === \"default\" ? \"h-5 w-10\" : \"\",\n size === \"lg\" && \"h-6 w-12\",\n className,\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n \"bg-ppx-neutral-1 pointer-events-none block rounded-full ring-0 transition-transform duration-300 ease-in-out\",\n size === \"sm\" && \"data-checked:translate-x-[calc(100%+2px)] size-3.5\",\n size === undefined || size === \"default\"\n ? \"data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-4\"\n : \"\",\n size === \"lg\" &&\n \"data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-5\",\n )}\n />\n </BaseSwitch.Root>\n );\n}\n\nexport { Switch };\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\n\n// https://www.radix-ui.com/primitives/docs/components/separator\nexport function Separator({\n className,\n orientation = \"vertical\",\n decorative = false,\n ...props\n}: React.ComponentProps<\"div\"> & {\n orientation: \"horizontal\" | \"vertical\";\n decorative?: boolean;\n}) {\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n const ariaOrientation = orientation === \"vertical\" ? orientation : undefined;\n const semanticProps = decorative\n ? { role: \"none\" }\n : { \"aria-orientation\": ariaOrientation, role: \"separator\" };\n\n return (\n <div\n data-orientation={orientation}\n {...semanticProps}\n data-slot=\"separator\"\n className={cn(\n \"shrink-0 bg-ppx-neutral-3 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px\",\n className,\n )}\n {...props}\n />\n );\n}\n\nSeparator.displayName = \"Separator\";\n","export default function CalenderIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 768 768\"\n {...props}\n >\n <path d=\"M618.645 61.378h-35.458v-61.379h-66.743v61.379h-266.974v-61.379h-66.743v61.379h-33.372c-55.205 0-100.115 44.91-100.115 100.115v506.391c0 55.206 44.91 100.115 100.115 100.115h469.29c55.206 0 100.115-44.909 100.115-100.115v-506.391c0-55.205-44.909-100.115-100.115-100.115zM652.016 667.885c0 18.396-14.968 33.372-25.029 33.372h-469.29c-26.747 0-41.715-14.976-41.715-33.372v-408.803h536.033v408.803zM566.71 500.817h-142.247v117.226h142.247v-117.226zM566.71 331.664h-142.247v117.226h142.247v-117.226zM343.537 331.664h-142.247v117.226h142.247v-117.226zM343.537 500.817h-142.247v117.226h142.247v-117.226z\"></path>\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { format as formatDate } from \"date-fns\";\nimport { cn } from \"../utils\";\nimport { Calendar } from \"./calendar\";\nimport * as Popover from \"./popover\";\nimport { triggerVariants } from \"../tw-styles/dropdown\";\nimport type { VariantProps } from \"class-variance-authority\";\nimport CalenderIcon from \"../icons/calendar-icon\";\nimport { type OnSelectHandler } from \"react-day-picker\";\n\ntype CalendarProps = React.ComponentProps<typeof Calendar>;\n\ntype DatePickerProps = {\n placeholder?: string;\n format?: string;\n trailingIcon?: React.ReactNode;\n invalid?: boolean;\n\n triggerProps?: VariantProps<typeof triggerVariants> & {\n className?: string;\n disabled?: boolean;\n };\n\n renderTriggerContent?: React.ReactNode;\n\n popoverRootProps?: Omit<\n React.ComponentProps<typeof Popover.Root>,\n \"children\"\n >;\n popoverContentProps?: React.ComponentProps<typeof Popover.Content>;\n} & CalendarProps;\n\nexport function DatePicker({\n triggerProps,\n placeholder = \"Pick a date\",\n format = \"yyyy-MM-dd\",\n invalid,\n trailingIcon,\n renderTriggerContent,\n\n popoverRootProps,\n popoverContentProps,\n\n ...calendarProps\n}: DatePickerProps) {\n const [open, setOpen] = React.useState(false);\n\n const handleSelect: OnSelectHandler<Date> = (...args) => {\n (calendarProps as Record<string, any>).onSelect(...args);\n !calendarProps.mode || (calendarProps.mode === \"single\" && setOpen(false));\n };\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen} {...popoverRootProps}>\n <Popover.Trigger\n disabled={triggerProps?.disabled}\n className={cn(\n triggerVariants({\n size: triggerProps?.size,\n widthVariant: triggerProps?.widthVariant,\n }),\n \"gap-2.5\",\n triggerProps?.className,\n )}\n aria-invalid={invalid}\n aria-label=\"Open date picker\"\n >\n {renderTriggerContent ||\n renderFormattedDate(calendarProps, format) ||\n placeholder}\n\n {trailingIcon ?? (\n <CalenderIcon\n className={cn(\n \"text-ppx-foreground size-5 shrink-0\",\n triggerProps?.disabled && \"opacity-50\",\n )}\n />\n )}\n </Popover.Trigger>\n <Popover.Content\n className={cn(\"p-0\", popoverContentProps?.className)}\n {...popoverContentProps}\n >\n {/* @ts-expect-error */}\n <Calendar {...calendarProps} onSelect={handleSelect} />\n </Popover.Content>\n </Popover.Root>\n );\n}\n\nfunction renderFormattedDate(calendarProps: CalendarProps, format: string) {\n if (calendarProps.mode === \"single\" && calendarProps.selected) {\n return formatDate(calendarProps.selected, format);\n }\n\n if (calendarProps.mode === \"range\" && calendarProps.selected?.from) {\n let formattedDate = formatDate(calendarProps.selected.from, format);\n\n if (\n calendarProps.selected.to &&\n calendarProps.selected.from !== calendarProps.selected.to\n ) {\n formattedDate = `${formattedDate} - ${formatDate(calendarProps.selected.to, format)}`;\n }\n\n return formattedDate;\n }\n\n if (calendarProps.mode === \"multiple\" && calendarProps.selected?.length) {\n return calendarProps.selected\n .map((date) => formatDate(date, format))\n .join(\", \");\n }\n\n return \"\";\n}\n","import * as React from \"react\";\n\ninterface UploadCloudIconProps extends React.SVGProps<SVGSVGElement> {\n size?: number;\n}\n\nexport default function UploadCloudIcon({\n size = 24,\n ...props\n}: UploadCloudIconProps) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n {...props}\n >\n <path d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM8 13H10.55V16H13.45V13H16L12 9L8 13Z\" />\n </svg>\n );\n}\n\n","import { cn } from \"../utils\";\n\nexport default function RetryIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 2v6h-6\" />\n <path d=\"M3 12a9 9 0 0 1 15-6.7L21 8\" />\n <path d=\"M3 22v-6h6\" />\n <path d=\"M21 12a9 9 0 0 1-15 6.7L3 16\" />\n </svg>\n );\n}\n","import { cn } from \"../utils\";\n\nexport default function UploadIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <polyline points=\"17 8 12 3 7 8\" />\n <line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\" />\n </svg>\n );\n}\n","import {\n type ChangeEvent,\n type DragEvent,\n type InputHTMLAttributes,\n useCallback,\n useRef,\n useState,\n} from \"react\";\n\nexport type FileMetadata = {\n name: string;\n size: number;\n type: string;\n url: string;\n id: string;\n};\n\nexport type FileWithPreview = {\n file: File | FileMetadata;\n id: string;\n preview?: string;\n};\n\nexport type FileUploadOptions = {\n maxFiles?: number; // Only used when multiple is true, defaults to Infinity\n maxSize?: number; // in bytes\n accept?: string;\n multiple?: boolean; // Defaults to false\n initialFiles?: FileMetadata[];\n onFilesChange?: (files: FileWithPreview[]) => void; // Callback when files change\n onFilesAdded?: (addedFiles: FileWithPreview[]) => void; // Callback when new files are added\n};\n\nexport type FileUploadState = {\n files: FileWithPreview[];\n isDragging: boolean;\n errors: string[];\n};\n\nexport type FileUploadActions = {\n addFiles: (files: FileList | File[]) => void;\n removeFile: (id: string) => void;\n clearFiles: () => void;\n clearErrors: () => void;\n handleDragEnter: (e: DragEvent<HTMLElement>) => void;\n handleDragLeave: (e: DragEvent<HTMLElement>) => void;\n handleDragOver: (e: DragEvent<HTMLElement>) => void;\n handleDrop: (e: DragEvent<HTMLElement>) => void;\n handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;\n openFileDialog: () => void;\n getInputProps: (\n props?: InputHTMLAttributes<HTMLInputElement>,\n ) => InputHTMLAttributes<HTMLInputElement> & {\n // Use `any` here to avoid cross-React ref type conflicts across packages\n // biome-ignore lint/suspicious/noExplicitAny: intentional\n ref: any;\n };\n};\n\n// Helper function to format bytes to human-readable format\nexport const formatBytes = (bytes: number, decimals = 2): string => {\n if (bytes === 0) return \"0 Bytes\";\n\n const k = 1024;\n const dm = decimals < 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n\n return Number.parseFloat((bytes / k ** i).toFixed(dm)) + sizes[i];\n};\n\n// ============================================================================\n// Extended Hook with Upload Support\n// ============================================================================\n\nexport type UploadStatus = \"idle\" | \"uploading\" | \"success\" | \"error\";\n\nexport type FileWithUploadStatus = FileWithPreview & {\n progress: number;\n status: UploadStatus;\n error?: string;\n uploadedUrl?: string;\n};\n\nexport type PresignedUrlResponse = {\n url: string;\n fullPath: string;\n [key: string]: unknown;\n};\n\nexport type UploadConfig = {\n /**\n * Function to get a presigned URL for uploading\n * Called before uploading each file\n * @param params - Parameters including filename, contentType, size, and optional AbortSignal\n * @param params.signal - Optional AbortSignal to cancel the request\n */\n getPresignedUrl: (params: {\n filename: string;\n contentType: string;\n size: number;\n signal?: AbortSignal;\n }) => Promise<{\n result?: PresignedUrlResponse | null;\n error?: unknown;\n }>;\n\n /**\n * Function to upload the file to the storage\n * Receives the presigned URL and the file\n * @param url - The presigned URL to upload to\n * @param file - The file to upload\n * @param presignedData - The full presigned URL response data\n * @param onProgress - Optional callback for upload progress\n * @param signal - Optional AbortSignal to cancel the upload\n */\n uploadFile: (\n url: string,\n file: File,\n presignedData: PresignedUrlResponse,\n onProgress?: (progress: number) => void,\n signal?: AbortSignal,\n ) => Promise<{\n result?: { url: string; [key: string]: unknown };\n error?: unknown;\n }>;\n\n /**\n * Whether to auto-upload files when they are added\n * @default true\n */\n autoUpload?: boolean;\n\n /**\n * Called when a single file upload completes\n */\n onUploadComplete?: (file: FileWithUploadStatus) => void;\n\n /**\n * Called when a single file upload fails\n */\n onUploadError?: (file: FileWithUploadStatus, error: unknown) => void;\n\n /**\n * Called when all files finish uploading\n */\n onAllUploadsComplete?: (files: FileWithUploadStatus[]) => void;\n};\n\nexport type FileUploadWithUploaderOptions = FileUploadOptions & {\n upload?: UploadConfig;\n};\n\nexport type FileUploadWithUploaderState = Omit<FileUploadState, \"files\"> & {\n files: FileWithUploadStatus[];\n isUploading: boolean;\n};\n\nexport type FileUploadWithUploaderActions = Omit<\n FileUploadActions,\n \"addFiles\"\n> & {\n addFiles: (files: FileList | File[]) => void;\n uploadFiles: (\n files?: FileWithUploadStatus[],\n ) => Promise<FileWithUploadStatus[]>;\n retryUpload: (id: string) => Promise<void>;\n cancelUpload: (id: string) => void;\n};\n\nexport const useFileUpload = (\n options: FileUploadWithUploaderOptions = {},\n): [FileUploadWithUploaderState, FileUploadWithUploaderActions] => {\n const { upload, ...baseOptions } = options;\n const autoUpload = upload?.autoUpload ?? true;\n\n const [files, setFiles] = useState<FileWithUploadStatus[]>(\n (baseOptions.initialFiles ?? []).map((file) => ({\n file,\n id: file.id,\n preview: file.url,\n progress: 100,\n status: \"success\" as const,\n uploadedUrl: file.url,\n })),\n );\n const [isUploading, setIsUploading] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [errors, setErrors] = useState<string[]>([]);\n\n const inputRef = useRef<HTMLInputElement>(null);\n const abortControllersRef = useRef<Map<string, AbortController>>(new Map());\n\n const {\n maxFiles = Number.POSITIVE_INFINITY,\n maxSize = Number.POSITIVE_INFINITY,\n accept = \"*\",\n multiple = false,\n onFilesChange,\n onFilesAdded,\n } = baseOptions;\n\n const validateFile = useCallback(\n (file: File): string | null => {\n if (file.size > maxSize) {\n return `File \"${file.name}\" exceeds the maximum size of ${formatBytes(maxSize)}.`;\n }\n\n if (accept !== \"*\") {\n const acceptedTypes = accept.split(\",\").map((type) => type.trim());\n const fileType = file.type || \"\";\n const fileExtension = `.${file.name.split(\".\").pop()}`;\n\n const isAccepted = acceptedTypes.some((type) => {\n if (type.startsWith(\".\")) {\n return fileExtension.toLowerCase() === type.toLowerCase();\n }\n if (type.endsWith(\"/*\")) {\n const baseType = type.split(\"/\")[0];\n return fileType.startsWith(`${baseType}/`);\n }\n return fileType === type;\n });\n\n if (!isAccepted) {\n return `File \"${file.name}\" is not an accepted file type.`;\n }\n }\n\n return null;\n },\n [accept, maxSize],\n );\n\n const createPreview = useCallback((file: File): string | undefined => {\n if (file.type.startsWith(\"image/\")) {\n return URL.createObjectURL(file);\n }\n return undefined;\n }, []);\n\n const generateUniqueId = useCallback((file: File): string => {\n return `${file.name}-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n }, []);\n\n const uploadSingleFile = useCallback(\n async (\n fileWithStatus: FileWithUploadStatus,\n ): Promise<FileWithUploadStatus> => {\n if (!upload) {\n return {\n ...fileWithStatus,\n status: \"error\",\n error: \"No upload config provided\",\n };\n }\n\n const file = fileWithStatus.file as File;\n if (!(file instanceof File)) {\n // Already uploaded file (FileMetadata)\n return { ...fileWithStatus, status: \"success\", progress: 100 };\n }\n\n const abortController = new AbortController();\n abortControllersRef.current.set(fileWithStatus.id, abortController);\n\n try {\n // Update status to uploading\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id\n ? { ...f, status: \"uploading\" as const, progress: 0 }\n : f,\n ),\n );\n\n // Step 1: Get presigned URL\n const { result: presignedResult, error: presignedError } =\n await upload.getPresignedUrl({\n filename: file.name,\n contentType: file.type,\n size: file.size,\n signal: abortController.signal,\n });\n\n if (presignedError || !presignedResult) {\n throw presignedError || new Error(\"Failed to get presigned URL\");\n }\n\n // Update progress after getting presigned URL\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id ? { ...f, progress: 10 } : f,\n ),\n );\n\n // Step 2: Upload file\n const { result: uploadResult, error: uploadError } =\n await upload.uploadFile(\n presignedResult.url,\n file,\n presignedResult,\n (progress) => {\n // Scale progress from 10-100\n const scaledProgress = 10 + progress * 0.9;\n setFiles((prev) =>\n prev.map((f) =>\n f.id === fileWithStatus.id\n ? { ...f, progress: Math.round(scaledProgress) }\n : f,\n ),\n );\n },\n abortController.signal,\n );\n\n if (uploadError) {\n throw uploadError;\n }\n\n const uploadedFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"success\",\n progress: 100,\n uploadedUrl: uploadResult?.url ?? presignedResult.fullPath,\n };\n\n setFiles((prev) =>\n prev.map((f) => (f.id === fileWithStatus.id ? uploadedFile : f)),\n );\n\n upload.onUploadComplete?.(uploadedFile);\n\n return uploadedFile;\n } catch (error) {\n // Check if the upload was cancelled via AbortController\n const isAborted =\n error instanceof Error &&\n (error.name === \"AbortError\" || abortController.signal.aborted);\n\n if (isAborted) {\n // Upload was cancelled - return idle state (already set by cancelUpload)\n const cancelledFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"idle\",\n progress: 0,\n };\n return cancelledFile;\n }\n\n const errorMessage =\n error instanceof Error ? error.message : \"Upload failed\";\n const failedFile: FileWithUploadStatus = {\n ...fileWithStatus,\n status: \"error\",\n error: errorMessage,\n };\n\n setFiles((prev) =>\n prev.map((f) => (f.id === fileWithStatus.id ? failedFile : f)),\n );\n\n upload.onUploadError?.(failedFile, error);\n\n return failedFile;\n } finally {\n abortControllersRef.current.delete(fileWithStatus.id);\n }\n },\n [upload],\n );\n\n const uploadFiles = useCallback(\n async (\n filesToUpload?: FileWithUploadStatus[],\n ): Promise<FileWithUploadStatus[]> => {\n const targetFiles =\n filesToUpload ?? files.filter((f) => f.status === \"idle\");\n\n if (targetFiles.length === 0) return [];\n\n setIsUploading(true);\n const results: FileWithUploadStatus[] = [];\n\n for (const file of targetFiles) {\n const result = await uploadSingleFile(file);\n results.push(result);\n }\n\n setIsUploading(false);\n upload?.onAllUploadsComplete?.(results);\n\n return results;\n },\n [files, uploadSingleFile, upload],\n );\n\n const addFiles = useCallback(\n (newFiles: FileList | File[]) => {\n if (!newFiles || newFiles.length === 0) return;\n\n const newFilesArray = Array.from(newFiles);\n const newErrors: string[] = [];\n\n // Clear existing errors\n setErrors([]);\n\n // In single file mode, clear existing files first\n if (!multiple) {\n setFiles((prev) => {\n for (const file of prev) {\n if (file.preview && file.file instanceof File) {\n URL.revokeObjectURL(file.preview);\n }\n }\n return [];\n });\n }\n\n // Check if adding these files would exceed maxFiles\n if (\n multiple &&\n maxFiles !== Number.POSITIVE_INFINITY &&\n files.length + newFilesArray.length > maxFiles\n ) {\n newErrors.push(`You can only upload a maximum of ${maxFiles} files.`);\n setErrors(newErrors);\n return;\n }\n\n const validFiles: FileWithUploadStatus[] = [];\n\n for (const file of newFilesArray) {\n // Check for duplicates in multiple mode\n if (multiple) {\n const isDuplicate = files.some(\n (existingFile) =>\n existingFile.file.name === file.name &&\n existingFile.file.size === file.size,\n );\n if (isDuplicate) continue;\n }\n\n const error = validateFile(file);\n if (error) {\n newErrors.push(error);\n continue;\n }\n\n validFiles.push({\n file,\n id: generateUniqueId(file),\n preview: createPreview(file),\n progress: 0,\n status: \"idle\",\n });\n }\n\n if (validFiles.length > 0) {\n // Call onFilesAdded callback\n onFilesAdded?.(validFiles);\n\n setFiles((prev) => {\n const updatedFiles = !multiple\n ? validFiles\n : [...prev, ...validFiles];\n onFilesChange?.(updatedFiles);\n return updatedFiles;\n });\n\n // Auto-upload if configured\n if (autoUpload && upload) {\n // Use setTimeout to ensure state is updated before uploading\n setTimeout(() => {\n uploadFiles(validFiles);\n }, 0);\n }\n }\n\n if (newErrors.length > 0) {\n setErrors(newErrors);\n }\n\n // Reset input value\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n },\n [\n files,\n maxFiles,\n multiple,\n validateFile,\n createPreview,\n generateUniqueId,\n onFilesChange,\n onFilesAdded,\n autoUpload,\n upload,\n uploadFiles,\n ],\n );\n\n const removeFile = useCallback(\n (id: string) => {\n // Cancel any ongoing upload\n const controller = abortControllersRef.current.get(id);\n if (controller) {\n controller.abort();\n abortControllersRef.current.delete(id);\n }\n\n setFiles((prev) => {\n const fileToRemove = prev.find((file) => file.id === id);\n if (fileToRemove?.preview && fileToRemove.file instanceof File) {\n URL.revokeObjectURL(fileToRemove.preview);\n }\n\n const newFiles = prev.filter((file) => file.id !== id);\n onFilesChange?.(newFiles);\n return newFiles;\n });\n },\n [onFilesChange],\n );\n\n const clearFiles = useCallback(() => {\n // Cancel all ongoing uploads\n for (const controller of abortControllersRef.current.values()) {\n controller.abort();\n }\n abortControllersRef.current.clear();\n\n setFiles((prev) => {\n for (const file of prev) {\n if (file.preview && file.file instanceof File) {\n URL.revokeObjectURL(file.preview);\n }\n }\n return [];\n });\n\n if (inputRef.current) {\n inputRef.current.value = \"\";\n }\n\n setErrors([]);\n onFilesChange?.([]);\n }, [onFilesChange]);\n\n const clearErrors = useCallback(() => {\n setErrors([]);\n }, []);\n\n const retryUpload = useCallback(\n async (id: string) => {\n const file = files.find((f) => f.id === id);\n if (file && file.status === \"error\") {\n setFiles((prev) =>\n prev.map((f) =>\n f.id === id\n ? { ...f, status: \"idle\" as const, error: undefined }\n : f,\n ),\n );\n await uploadSingleFile({ ...file, status: \"idle\", error: undefined });\n }\n },\n [files, uploadSingleFile],\n );\n\n const cancelUpload = useCallback((id: string) => {\n const controller = abortControllersRef.current.get(id);\n if (controller) {\n controller.abort();\n abortControllersRef.current.delete(id);\n }\n\n setFiles((prev) =>\n prev.map((f) =>\n f.id === id ? { ...f, status: \"idle\" as const, progress: 0 } : f,\n ),\n );\n }, []);\n\n const handleDragEnter = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(true);\n }, []);\n\n const handleDragLeave = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n if (e.currentTarget.contains(e.relatedTarget as Node)) return;\n setIsDragging(false);\n }, []);\n\n const handleDragOver = useCallback((e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n }, []);\n\n const handleDrop = useCallback(\n (e: DragEvent<HTMLElement>) => {\n e.preventDefault();\n e.stopPropagation();\n setIsDragging(false);\n\n if (inputRef.current?.disabled) return;\n\n if (e.dataTransfer.files?.length > 0) {\n if (!multiple) {\n addFiles([e.dataTransfer.files[0]]);\n } else {\n addFiles(e.dataTransfer.files);\n }\n }\n },\n [addFiles, multiple],\n );\n\n const handleFileChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n if (e.target.files?.length) {\n addFiles(e.target.files);\n }\n },\n [addFiles],\n );\n\n const openFileDialog = useCallback(() => {\n inputRef.current?.click();\n }, []);\n\n const getInputProps = useCallback(\n (props: InputHTMLAttributes<HTMLInputElement> = {}) => ({\n ...props,\n accept: props.accept || accept,\n multiple: props.multiple !== undefined ? props.multiple : multiple,\n onChange: handleFileChange,\n // biome-ignore lint/suspicious/noExplicitAny: intentional\n ref: inputRef as any,\n type: \"file\" as const,\n }),\n [accept, multiple, handleFileChange],\n );\n\n return [\n { files, isDragging, errors, isUploading },\n {\n addFiles,\n removeFile,\n clearFiles,\n clearErrors,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n handleFileChange,\n openFileDialog,\n getInputProps,\n uploadFiles,\n retryUpload,\n cancelUpload,\n },\n ];\n};\n","import { cn } from \"../utils\";\n\nexport default function FileIcon(props: React.ComponentProps<\"svg\">) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n className={cn(\"shrink-0\", props.className)}\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14,2 14,8 20,8\" />\n </svg>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport UploadCloudIcon from \"../icons/upload-cloud-icon\";\nimport CloseIcon from \"../icons/close-icon\";\nimport CheckIcon from \"../icons/check-icon\";\nimport RetryIcon from \"../icons/retry-icon\";\nimport SpinnerIcon from \"../icons/spinner-icon\";\nimport UploadIcon from \"../icons/upload-icon\";\nimport type {\n FileWithUploadStatus,\n FileUploadWithUploaderActions,\n} from \"../hooks/use-file-upload\";\nimport { formatBytes } from \"../hooks/use-file-upload\";\nimport FileIcon from \"../icons/file-icon\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface FileUploadFile {\n id: string;\n file: File | { name: string; size: number; type: string; url?: string };\n progress?: number;\n status?: \"idle\" | \"uploading\" | \"success\" | \"error\";\n preview?: string;\n error?: string;\n uploadedUrl?: string;\n}\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface FileUploadContextValue {\n files: FileUploadFile[];\n addFiles: (files: FileList | File[]) => void;\n removeFile: (id: string) => void;\n clearFiles: () => void;\n retryUpload?: (id: string) => Promise<void>;\n accept?: string;\n multiple: boolean;\n disabled: boolean;\n isDragActive: boolean;\n isUploading: boolean;\n openFileDialog: () => void;\n getInputProps: FileUploadWithUploaderActions[\"getInputProps\"];\n handleDragEnter: FileUploadWithUploaderActions[\"handleDragEnter\"];\n handleDragLeave: FileUploadWithUploaderActions[\"handleDragLeave\"];\n handleDragOver: FileUploadWithUploaderActions[\"handleDragOver\"];\n handleDrop: FileUploadWithUploaderActions[\"handleDrop\"];\n}\n\nconst FileUploadContext = React.createContext<FileUploadContextValue | null>(\n null,\n);\n\nfunction useFileUploadContext() {\n const context = React.useContext(FileUploadContext);\n if (!context) {\n throw new Error(\n \"FileUpload components must be used within FileUpload.Root\",\n );\n }\n return context;\n}\n\n// ============================================================================\n// Root Component\n// ============================================================================\n\nexport interface RootProps {\n children: React.ReactNode;\n /** Files from the useFileUpload hook */\n files: FileUploadFile[] | FileWithUploadStatus[];\n /** Add files action from the hook */\n addFiles: (files: FileList | File[]) => void;\n /** Remove file action from the hook */\n removeFile: (id: string) => void;\n /** Clear files action from the hook */\n clearFiles: () => void;\n /** Retry upload action from the hook */\n retryUpload?: (id: string) => Promise<void>;\n /** Open file dialog action from the hook */\n openFileDialog: () => void;\n /** Get input props from the hook */\n getInputProps: FileUploadWithUploaderActions[\"getInputProps\"];\n /** Handle drag enter from the hook */\n handleDragEnter: FileUploadWithUploaderActions[\"handleDragEnter\"];\n /** Handle drag leave from the hook */\n handleDragLeave: FileUploadWithUploaderActions[\"handleDragLeave\"];\n /** Handle drag over from the hook */\n handleDragOver: FileUploadWithUploaderActions[\"handleDragOver\"];\n /** Handle drop from the hook */\n handleDrop: FileUploadWithUploaderActions[\"handleDrop\"];\n /** Whether dragging is active (from hook state) */\n isDragActive?: boolean;\n /** Whether upload is in progress (from hook state) */\n isUploading?: boolean;\n /** Accepted file types (e.g., \"image/*,.pdf\") */\n accept?: string;\n /** Allow multiple file selection */\n multiple?: boolean;\n /** Whether the upload is disabled */\n disabled?: boolean;\n className?: string;\n}\n\nfunction Root({\n children,\n files,\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n isDragActive = false,\n isUploading = false,\n accept,\n multiple = false,\n disabled = false,\n className,\n}: RootProps) {\n const contextValue: FileUploadContextValue = {\n files: files as FileUploadFile[],\n addFiles,\n removeFile,\n clearFiles,\n retryUpload,\n accept,\n multiple,\n disabled,\n isDragActive,\n isUploading,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n };\n\n return (\n <FileUploadContext.Provider value={contextValue}>\n <div\n data-slot=\"file-upload\"\n className={cn(\"flex flex-col gap-4\", className)}\n >\n {children}\n </div>\n </FileUploadContext.Provider>\n );\n}\n\n// ============================================================================\n// Dropzone Component\n// ============================================================================\n\nconst dropzoneVariants = cva(\n \"flex flex-col items-center justify-center gap-4 rounded-ppx-m bg-ppx-neutral-2 transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30\",\n {\n variants: {\n size: {\n default: \"p-8 min-h-[200px]\",\n sm: \"p-6 min-h-[160px]\",\n lg: \"p-10 min-h-[260px]\",\n },\n isDragActive: {\n true: \"border-2 border-dashed border-ppx-primary-5 bg-ppx-primary-1\",\n false: \"\",\n },\n },\n defaultVariants: {\n size: \"default\",\n isDragActive: false,\n },\n },\n);\n\nexport interface DropzoneProps\n extends Omit<React.ComponentProps<\"div\">, \"children\">,\n Omit<VariantProps<typeof dropzoneVariants>, \"isDragActive\"> {\n children?: React.ReactNode;\n /** Custom text for the dropzone */\n dropzoneText?: string;\n /** Custom text for the browse button */\n browseText?: string;\n /** Hide the default content */\n hideDefaultContent?: boolean;\n}\n\nfunction Dropzone({\n className,\n size,\n children,\n dropzoneText = \"Paste Or Drag & Drop Files Here\",\n browseText = \"Browse for files\",\n hideDefaultContent = false,\n ...props\n}: DropzoneProps) {\n const {\n accept,\n multiple,\n disabled,\n isDragActive,\n isUploading,\n openFileDialog,\n getInputProps,\n handleDragEnter,\n handleDragLeave,\n handleDragOver,\n handleDrop,\n addFiles,\n } = useFileUploadContext();\n\n const descriptionId = React.useId();\n const instructionsId = React.useId();\n const [announcement, setAnnouncement] = React.useState(\"\");\n\n const inputProps = getInputProps();\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n openFileDialog();\n }\n },\n [openFileDialog],\n );\n\n const handlePaste = React.useCallback(\n (e: React.ClipboardEvent) => {\n if (disabled) return;\n const files = e.clipboardData.files;\n if (files.length > 0) {\n e.preventDefault();\n // Convert FileList to array and add files\n const filesArray = Array.from(files);\n addFiles(filesArray);\n setAnnouncement(\n `${filesArray.length} file${filesArray.length > 1 ? \"s\" : \"\"} pasted`,\n );\n }\n },\n [disabled, addFiles],\n );\n\n return (\n <div\n data-slot=\"file-upload-dropzone\"\n className={cn(\n dropzoneVariants({ size, isDragActive }),\n disabled && \"cursor-not-allowed opacity-60\",\n className,\n )}\n onDragEnter={handleDragEnter}\n onDragLeave={handleDragLeave}\n onDragOver={handleDragOver}\n onDrop={handleDrop}\n onPaste={handlePaste}\n onKeyDown={handleKeyDown}\n tabIndex={disabled ? -1 : 0}\n role=\"button\"\n aria-disabled={disabled}\n aria-describedby={`${descriptionId} ${instructionsId}`}\n aria-label=\"File upload dropzone\"\n {...props}\n >\n {/* Screen reader announcements */}\n <div\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"sr-only\"\n >\n {announcement}\n </div>\n <div id={descriptionId} className=\"sr-only\">\n {dropzoneText}\n </div>\n <div id={instructionsId} className=\"sr-only\">\n Press Enter or Space to browse files, or drag and drop files here.\n </div>\n\n <input\n {...inputProps}\n className=\"sr-only\"\n accept={accept}\n multiple={multiple}\n disabled={disabled}\n tabIndex={-1}\n aria-hidden=\"true\"\n />\n\n {children ? (\n children\n ) : !hideDefaultContent ? (\n <>\n <div className=\"text-ppx-neutral-10 flex items-center gap-3\">\n <UploadCloudIcon size={40} aria-hidden=\"true\" />\n <span className=\"text-ppx-base text-ppx-neutral-13 font-medium\">\n {dropzoneText}\n </span>\n </div>\n\n <div className=\"flex w-full items-center gap-3\" aria-hidden=\"true\">\n <div className=\"bg-ppx-neutral-5 h-px flex-1\" />\n <span className=\"text-ppx-sm text-ppx-neutral-10 font-medium\">\n OR\n </span>\n <div className=\"bg-ppx-neutral-5 h-px flex-1\" />\n </div>\n\n <Button\n type=\"button\"\n variant=\"default\"\n onClick={openFileDialog}\n disabled={disabled || isUploading}\n >\n {isUploading ? (\n <>\n <SpinnerIcon className=\"size-4 animate-spin\" />\n Uploading...\n </>\n ) : (\n browseText\n )}\n </Button>\n </>\n ) : null}\n </div>\n );\n}\n\n// ============================================================================\n// Trigger Component (standalone button)\n// ============================================================================\n\nexport interface TriggerProps extends React.ComponentProps<typeof Button> {\n /** Text to show while uploading */\n uploadingText?: string;\n /** Show uploading state */\n showUploadingState?: boolean;\n /** Hide the default content */\n hideDefaultContent?: boolean;\n}\n\nfunction Trigger({\n children,\n uploadingText = \"Uploading...\",\n showUploadingState = true,\n hideDefaultContent = false,\n ...props\n}: TriggerProps) {\n const { openFileDialog, disabled, isUploading } = useFileUploadContext();\n\n const isDisabled = disabled || (showUploadingState && isUploading);\n\n return (\n <Button\n type=\"button\"\n onClick={openFileDialog}\n disabled={isDisabled}\n data-slot=\"file-upload-trigger\"\n className={cn(\n hideDefaultContent &&\n \"not-disabled:hover:bg-transparent h-auto border-none bg-transparent p-0 shadow-none hover:bg-transparent focus-visible:ring-0 active:bg-transparent\",\n props.className,\n )}\n {...props}\n >\n {showUploadingState && isUploading ? (\n <>\n <SpinnerIcon className=\"size-4 animate-spin\" />\n {uploadingText}\n </>\n ) : (\n (children ?? (\n <>\n <UploadIcon className=\"size-4\" />\n Select files\n </>\n ))\n )}\n </Button>\n );\n}\n\n// ============================================================================\n// ItemList Component\n// ============================================================================\n\nexport interface ItemListProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n children?: React.ReactNode | ((files: FileUploadFile[]) => React.ReactNode);\n}\n\nfunction ItemList({ className, children, ...props }: ItemListProps) {\n const { files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <div\n data-slot=\"file-upload-item-list\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n >\n {typeof children === \"function\" ? children(files) : children}\n </div>\n );\n}\n\n// ============================================================================\n// Item Component\n// ============================================================================\n\nconst ItemContext = React.createContext<FileUploadFile | null>(null);\n\nfunction useFileUploadItem() {\n const context = React.useContext(ItemContext);\n if (!context) {\n throw new Error(\n \"FileUpload.Item* components must be used within FileUpload.Item\",\n );\n }\n return context;\n}\n\nexport interface ItemProps extends React.ComponentProps<\"div\"> {\n file: FileUploadFile;\n /** Apply error styling based on file status */\n statusStyles?: boolean;\n}\n\nfunction Item({\n file,\n className,\n children,\n statusStyles = true,\n ...props\n}: ItemProps) {\n return (\n <ItemContext.Provider value={file}>\n <div\n data-slot=\"file-upload-item\"\n data-status={file.status}\n className={cn(\n \"rounded-ppx-s border-ppx-neutral-4 bg-ppx-neutral-1 flex items-center gap-3 border p-3\",\n statusStyles &&\n file.status === \"error\" &&\n \"border-ppx-red-4 bg-ppx-red-1\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n </ItemContext.Provider>\n );\n}\n\n// ============================================================================\n// ItemPreview Component\n// ============================================================================\n\nexport interface ItemPreviewProps extends React.ComponentProps<\"div\"> {\n /** Fallback icon when no preview is available */\n fallback?: React.ReactNode;\n}\n\nfunction ItemPreview({ className, fallback, ...props }: ItemPreviewProps) {\n const file = useFileUploadItem();\n\n return (\n <div\n data-slot=\"file-upload-item-preview\"\n className={cn(\n \"rounded-ppx-xs bg-ppx-neutral-3 flex size-10 shrink-0 items-center justify-center overflow-hidden\",\n className,\n )}\n {...props}\n >\n {file.preview ? (\n <img\n src={file.preview}\n alt={file.file.name}\n className=\"size-full object-cover\"\n />\n ) : (\n (fallback ?? <FileIcon className=\"text-ppx-neutral-10 size-5\" />)\n )}\n </div>\n );\n}\n\n// ============================================================================\n// ItemName Component\n// ============================================================================\n\nexport interface ItemNameProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemName({ className, ...props }: ItemNameProps) {\n const file = useFileUploadItem();\n\n return (\n <span\n data-slot=\"file-upload-item-name\"\n className={cn(\n \"text-ppx-sm text-ppx-neutral-14 truncate font-medium\",\n className,\n )}\n {...props}\n >\n {file.file.name}\n </span>\n );\n}\n\n// ============================================================================\n// ItemSize Component\n// ============================================================================\n\nexport interface ItemSizeProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemSize({ className, ...props }: ItemSizeProps) {\n const file = useFileUploadItem();\n\n return (\n <span\n data-slot=\"file-upload-item-size\"\n className={cn(\"text-ppx-xs text-ppx-neutral-10\", className)}\n {...props}\n >\n {formatBytes(file.file.size)}\n </span>\n );\n}\n\n// ============================================================================\n// ItemRemove Component\n// ============================================================================\n\nexport interface ItemRemoveProps extends React.ComponentProps<typeof Button> {}\n\nfunction ItemRemove({ className, children, ...props }: ItemRemoveProps) {\n const { removeFile } = useFileUploadContext();\n const file = useFileUploadItem();\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => removeFile(file.id)}\n data-slot=\"file-upload-item-remove\"\n aria-label={`Remove ${file.file.name}`}\n className={cn(\"ml-auto shrink-0\", className)}\n {...props}\n >\n {children ?? <CloseIcon className=\"size-4\" />}\n </Button>\n );\n}\n\n// ============================================================================\n// ItemProgress Component\n// ============================================================================\n\nexport interface ItemProgressProps extends React.ComponentProps<\"div\"> {}\n\nfunction ItemProgress({ className, ...props }: ItemProgressProps) {\n const file = useFileUploadItem();\n\n if (file.progress === undefined) return null;\n\n return (\n <div\n data-slot=\"file-upload-item-progress\"\n className={cn(\n \"bg-ppx-neutral-3 h-1.5 w-full overflow-hidden rounded-full\",\n className,\n )}\n {...props}\n >\n <div\n className=\"bg-ppx-primary-5 h-full transition-all duration-300\"\n style={{ width: `${file.progress}%` }}\n />\n </div>\n );\n}\n\n// ============================================================================\n// ItemStatus Component\n// ============================================================================\n\nexport interface ItemStatusProps extends React.ComponentProps<\"div\"> {\n /** Custom success icon */\n successIcon?: React.ReactNode;\n /** Custom uploading text/element */\n uploadingContent?: React.ReactNode;\n /** Custom error text/element */\n errorContent?: React.ReactNode;\n}\n\nfunction ItemStatus({\n className,\n successIcon,\n uploadingContent,\n errorContent,\n ...props\n}: ItemStatusProps) {\n const file = useFileUploadItem();\n\n if (file.status === \"uploading\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-xs text-ppx-neutral-10 shrink-0\", className)}\n {...props}\n >\n {uploadingContent ?? `${file.progress ?? 0}%`}\n </span>\n );\n }\n\n if (file.status === \"success\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-green-5 shrink-0\", className)}\n {...props}\n >\n {successIcon ?? <CheckIcon className=\"size-4\" />}\n </span>\n );\n }\n\n if (file.status === \"error\") {\n return (\n <span\n data-slot=\"file-upload-item-status\"\n className={cn(\"text-ppx-xs text-ppx-red-5 shrink-0\", className)}\n {...props}\n >\n {errorContent ?? \"Failed\"}\n </span>\n );\n }\n\n return null;\n}\n\n// ============================================================================\n// ItemError Component\n// ============================================================================\n\nexport interface ItemErrorProps extends React.ComponentProps<\"span\"> {}\n\nfunction ItemError({ className, ...props }: ItemErrorProps) {\n const file = useFileUploadItem();\n\n if (!file.error) return null;\n\n return (\n <span\n data-slot=\"file-upload-item-error\"\n className={cn(\"text-ppx-xs text-ppx-red-5\", className)}\n {...props}\n >\n {file.error}\n </span>\n );\n}\n\n// ============================================================================\n// ItemRetry Component\n// ============================================================================\n\nexport interface ItemRetryProps extends React.ComponentProps<typeof Button> {}\n\nfunction ItemRetry({ className, children, ...props }: ItemRetryProps) {\n const { retryUpload } = useFileUploadContext();\n const file = useFileUploadItem();\n\n if (file.status !== \"error\" || !retryUpload) return null;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => retryUpload(file.id)}\n data-slot=\"file-upload-item-retry\"\n aria-label={`Retry uploading ${file.file.name}`}\n className={cn(\"shrink-0\", className)}\n {...props}\n >\n {children ?? <RetryIcon className=\"size-4\" />}\n </Button>\n );\n}\n\n// ============================================================================\n// ClearButton Component\n// ============================================================================\n\nexport interface ClearButtonProps extends React.ComponentProps<typeof Button> {}\n\nfunction ClearButton({ children, ...props }: ClearButtonProps) {\n const { clearFiles, files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={clearFiles}\n data-slot=\"file-upload-clear\"\n {...props}\n >\n {children ?? \"Remove all files\"}\n </Button>\n );\n}\n\n// ============================================================================\n// ImageGrid Component\n// ============================================================================\n\nexport interface ImageGridProps\n extends Omit<React.ComponentProps<\"div\">, \"children\"> {\n children?: React.ReactNode | ((files: FileUploadFile[]) => React.ReactNode);\n}\n\nfunction ImageGrid({ className, children, ...props }: ImageGridProps) {\n const { files } = useFileUploadContext();\n\n if (files.length === 0) return null;\n\n return (\n <div\n data-slot=\"file-upload-image-grid\"\n className={cn(\"grid grid-cols-4 gap-2\", className)}\n {...props}\n >\n {typeof children === \"function\" ? children(files) : children}\n </div>\n );\n}\n\n// ============================================================================\n// ImageGridItem Component\n// ============================================================================\n\nexport interface ImageGridItemProps extends React.ComponentProps<\"div\"> {\n file: FileUploadFile;\n /** Show status overlays (uploading/error) */\n showStatusOverlay?: boolean;\n}\n\nfunction ImageGridItem({\n file,\n className,\n showStatusOverlay = true,\n ...props\n}: ImageGridItemProps) {\n const { removeFile, retryUpload } = useFileUploadContext();\n\n return (\n <div\n data-slot=\"file-upload-image-grid-item\"\n data-status={file.status}\n className={cn(\n \"rounded-ppx-s group relative aspect-square overflow-hidden\",\n file.status === \"error\" && \"ring-ppx-red-5 ring-2\",\n className,\n )}\n {...props}\n >\n {file.preview ? (\n <img\n src={file.preview}\n alt={file.file.name}\n className=\"size-full object-cover\"\n />\n ) : (\n <div className=\"bg-ppx-neutral-3 flex size-full items-center justify-center\">\n <FileIcon className=\"text-ppx-neutral-10 size-8\" />\n </div>\n )}\n\n {/* Upload overlay */}\n {showStatusOverlay && file.status === \"uploading\" && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/40\">\n <div className=\"text-sm font-medium text-white\">{file.progress}%</div>\n </div>\n )}\n\n {/* Error overlay */}\n {showStatusOverlay && file.status === \"error\" && retryUpload && (\n <div className=\"absolute inset-0 flex items-center justify-center bg-black/40\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n onClick={() => retryUpload(file.id)}\n className=\"text-white hover:text-white\"\n >\n <RetryIcon className=\"size-5\" />\n </Button>\n </div>\n )}\n\n {/* Success indicator */}\n {showStatusOverlay && file.status === \"success\" && (\n <div className=\"bg-ppx-green-5 absolute bottom-1 right-1 rounded-full p-0.5\">\n <CheckIcon className=\"size-3 text-white\" />\n </div>\n )}\n\n {/* Remove button */}\n <button\n type=\"button\"\n onClick={() => removeFile(file.id)}\n className=\"absolute right-1 top-1 flex size-6 items-center justify-center rounded-full bg-black/60 text-white opacity-0 transition-opacity group-hover:opacity-100\"\n aria-label={`Remove ${file.file.name}`}\n >\n <CloseIcon className=\"size-3\" />\n </button>\n </div>\n );\n}\n\n// ============================================================================\n// Exports\n// ============================================================================\n\nexport const FileUpload = {\n Root,\n Dropzone,\n Trigger,\n ItemList,\n Item,\n ItemPreview,\n ItemName,\n ItemSize,\n ItemRemove,\n ItemProgress,\n ItemStatus,\n ItemError,\n ItemRetry,\n ClearButton,\n ImageGrid,\n ImageGridItem,\n};\n","import * as React from \"react\"\nimport { OTPInput, OTPInputContext } from \"input-otp\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"../utils/classnames\"\n\nconst otpInputSlotVariants = cva(\n \"shadow-xs inline-flex border-ppx-neutral-5 bg-ppx-neutral-1 text-ppx-foreground outline-transparent focus:-outline-offset-1 focus:outline-2 focus:not-aria-invalid:outline-ppx-primary-focus focus:not-aria-invalid:not-aria-disabled:bg-ppx-background focus:not-aria-invalid:bg-white disabled:cursor-not-allowed disabled:border-ppx-neutral-3 disabled:bg-ppx-neutral-3 disabled:text-ppx-neutral-11 aria-invalid:outline-ppx-red-4 aria-invalid:bg-ppx-red-1 aria-invalid:outline aria-invalid:-outline-offset-1 relative flex items-center justify-center border-y border-r transition-all first:border-l data-[active=true]:z-10 data-[active=true]:outline-ppx-primary-focus data-[active=true]:outline data-[active=true]:-outline-offset-1 data-[active=true]:bg-white data-[active=true]:aria-invalid:outline-ppx-red-4 data-[active=true]:aria-invalid:bg-ppx-red-1\",\n {\n variants: {\n size: {\n default: \"h-[70px] w-[62.22222137451172px] first:rounded-l last:rounded-r font-sans font-medium text-[30px] leading-none tracking-normal align-middle\",\n sm: \"h-input-s w-8 first:rounded-l-input-s last:rounded-r-input-s font-medium text-ppx-sm\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n }\n)\n\n// Internal helper components (not exported, used only by OtpInput)\nfunction OtpInputGroup({\n className,\n ...props\n}: Readonly<React.ComponentProps<\"div\">>) {\n return (\n <div\n data-slot=\"input-otp-group\"\n className={cn(\"flex items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction OtpInputSlot({\n index,\n className,\n size,\n ...props\n}: Readonly<\n React.ComponentProps<\"div\"> & {\n index: number\n size?: VariantProps<typeof otpInputSlotVariants>[\"size\"]\n }\n>) {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}\n\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-active={isActive}\n className={cn(otpInputSlotVariants({ size }), className)}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-ppx-foreground h-4 w-px duration-1000\" />\n </div>\n )}\n </div>\n )\n}\n\nfunction OtpInputSeparator({\n className,\n ...props\n}: Readonly<React.ComponentProps<\"div\">>) {\n return (\n <div\n data-slot=\"input-otp-separator\"\n className={cn(\"flex items-center\", className)}\n {...props}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"h-4 w-4\"\n aria-hidden=\"true\"\n >\n <path d=\"M5 12h14\" />\n </svg>\n </div>\n )\n}\n\n// Prop config derived out of OTPInput component and some more\ninterface OtpInputProps\n extends Readonly<\n Omit<React.ComponentProps<typeof OTPInput>, \"children\" | \"render\" | \"maxLength\" | \"size\">\n > {\n \n length?: number\n maxLength?: number\n separatorAfter?: number[]\n invalid?: boolean\n containerClassName?: string\n slotClassName?: string\n separatorClassName?: string\n size?: VariantProps<typeof otpInputSlotVariants>[\"size\"]\n}\n\nfunction OtpInput({\n length = 6,\n separatorAfter = [],\n className,\n containerClassName,\n slotClassName,\n separatorClassName,\n maxLength,\n invalid,\n size = \"default\",\n \"aria-invalid\": ariaInvalid,\n ...props\n}: Readonly<OtpInputProps>) {\n const otpLength = maxLength ?? length\n const slots = Array.from({ length: otpLength }, (_, i) => i)\n const separatorPositions = new Set(separatorAfter)\n const isInvalid = invalid ?? ariaInvalid ?? undefined\n\n return (\n <OTPInput\n data-slot=\"input-otp\"\n maxLength={otpLength}\n aria-invalid={isInvalid}\n containerClassName={cn(\n \"flex items-center gap-2 has-disabled:opacity-50\",\n containerClassName\n )}\n className={cn(\"disabled:cursor-not-allowed\", className)}\n {...props}\n >\n {slots.map((index) => {\n const shouldAddSeparator = separatorPositions.has(index - 1) && index > 0\n\n return (\n <React.Fragment key={index}>\n {shouldAddSeparator && (\n <OtpInputSeparator className={separatorClassName} />\n )}\n <OtpInputGroup>\n <OtpInputSlot\n index={index}\n className={slotClassName}\n aria-invalid={isInvalid}\n size={size}\n />\n </OtpInputGroup>\n </React.Fragment>\n )\n })}\n </OTPInput>\n )\n}\n\nexport { OtpInput }\n","import * as React from \"react\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile() {\n const [isMobile, setIsMobile] = React.useState<boolean | undefined>(\n undefined,\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n const onChange = () => {\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n };\n mql.addEventListener(\"change\", onChange);\n setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);\n return () => mql.removeEventListener(\"change\", onChange);\n }, []);\n\n return !!isMobile;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,gBAAg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