@kubetail/ui 2.7.0 → 3.0.0-rc1
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/{src/elements → elements}/alert.d.ts +2 -2
- package/dist/elements/avatar.cjs +1 -1
- package/dist/elements/avatar.cjs.map +1 -1
- package/dist/{src/elements → elements}/avatar.d.ts +1 -1
- package/dist/elements/avatar.js +1 -1
- package/dist/elements/avatar.js.map +1 -1
- package/dist/elements/button.cjs +1 -1
- package/dist/elements/button.cjs.map +1 -1
- package/dist/{src/elements → elements}/button.d.ts +7 -6
- package/dist/elements/button.js +17 -14
- package/dist/elements/button.js.map +1 -1
- package/dist/elements/checkbox.cjs +1 -1
- package/dist/elements/checkbox.cjs.map +1 -1
- package/dist/{src/elements → elements}/checkbox.d.ts +1 -1
- package/dist/elements/checkbox.js +2 -2
- package/dist/elements/checkbox.js.map +1 -1
- package/dist/elements/context-menu.cjs +1 -1
- package/dist/elements/context-menu.cjs.map +1 -1
- package/dist/{src/elements → elements}/context-menu.d.ts +8 -7
- package/dist/elements/context-menu.js +26 -31
- package/dist/elements/context-menu.js.map +1 -1
- package/dist/elements/dialog.cjs +1 -1
- package/dist/elements/dialog.cjs.map +1 -1
- package/dist/{src/elements → elements}/dialog.d.ts +3 -3
- package/dist/elements/dialog.js +16 -25
- package/dist/elements/dialog.js.map +1 -1
- package/dist/elements/dropdown-menu.cjs +1 -1
- package/dist/elements/dropdown-menu.cjs.map +1 -1
- package/dist/{src/elements → elements}/dropdown-menu.d.ts +11 -8
- package/dist/elements/dropdown-menu.js +27 -31
- package/dist/elements/dropdown-menu.js.map +1 -1
- package/dist/elements/form.cjs +1 -1
- package/dist/elements/form.cjs.map +1 -1
- package/dist/{src/elements → elements}/form.d.ts +8 -7
- package/dist/elements/form.js +39 -42
- package/dist/elements/form.js.map +1 -1
- package/dist/elements/label.cjs +1 -1
- package/dist/elements/label.cjs.map +1 -1
- package/dist/elements/label.d.ts +2 -0
- package/dist/elements/label.js +5 -6
- package/dist/elements/label.js.map +1 -1
- package/dist/elements/link.cjs +1 -1
- package/dist/elements/link.cjs.map +1 -1
- package/dist/{src/elements → elements}/link.d.ts +8 -7
- package/dist/elements/link.js +18 -13
- package/dist/elements/link.js.map +1 -1
- package/dist/{src/elements → elements}/pagination.d.ts +1 -1
- package/dist/elements/popover.cjs +1 -1
- package/dist/elements/popover.cjs.map +1 -1
- package/dist/elements/popover.d.ts +10 -0
- package/dist/elements/popover.js +13 -19
- package/dist/elements/popover.js.map +1 -1
- package/dist/{src/elements → elements}/search-box.d.ts +2 -2
- package/dist/elements/select.cjs +1 -1
- package/dist/elements/select.cjs.map +1 -1
- package/dist/elements/select.d.ts +19 -0
- package/dist/elements/select.js +32 -37
- package/dist/elements/select.js.map +1 -1
- package/dist/elements/separator.cjs +1 -1
- package/dist/elements/separator.cjs.map +1 -1
- package/dist/elements/separator.d.ts +3 -0
- package/dist/elements/separator.js +4 -5
- package/dist/elements/separator.js.map +1 -1
- package/dist/elements/sheet.cjs +1 -1
- package/dist/elements/sheet.cjs.map +1 -1
- package/dist/{src/elements → elements}/sheet.d.ts +2 -2
- package/dist/elements/sheet.js +8 -14
- package/dist/elements/sheet.js.map +1 -1
- package/dist/elements/sidebar.cjs +1 -1
- package/dist/elements/sidebar.cjs.map +1 -1
- package/dist/{src/elements → elements}/sidebar.d.ts +21 -20
- package/dist/elements/sidebar.js +63 -46
- package/dist/elements/sidebar.js.map +1 -1
- package/dist/elements/switch.cjs +1 -1
- package/dist/elements/switch.cjs.map +1 -1
- package/dist/{src/elements → elements}/switch.d.ts +1 -1
- package/dist/elements/switch.js +3 -3
- package/dist/elements/switch.js.map +1 -1
- package/dist/elements/tabs.cjs +1 -1
- package/dist/elements/tabs.cjs.map +1 -1
- package/dist/{src/elements → elements}/tabs.d.ts +3 -3
- package/dist/elements/tabs.js +4 -4
- package/dist/elements/tabs.js.map +1 -1
- package/dist/elements/toggle.cjs +1 -1
- package/dist/elements/toggle.cjs.map +1 -1
- package/dist/elements/toggle.d.ts +8 -0
- package/dist/elements/toggle.js +3 -3
- package/dist/elements/toggle.js.map +1 -1
- package/dist/elements/tooltip.cjs +1 -1
- package/dist/elements/tooltip.cjs.map +1 -1
- package/dist/elements/tooltip.d.ts +10 -0
- package/dist/elements/tooltip.js +14 -14
- package/dist/elements/tooltip.js.map +1 -1
- package/dist/{src/lib → lib}/utils.d.ts +1 -1
- package/package.json +10 -74
- package/dist/src/elements/alert.stories.d.ts +0 -19
- package/dist/src/elements/alert.test.d.ts +0 -1
- package/dist/src/elements/avatar.stories.d.ts +0 -15
- package/dist/src/elements/avatar.test.d.ts +0 -0
- package/dist/src/elements/button.stories.d.ts +0 -30
- package/dist/src/elements/button.test.d.ts +0 -1
- package/dist/src/elements/calendar.stories.d.ts +0 -14
- package/dist/src/elements/calendar.test.d.ts +0 -0
- package/dist/src/elements/card.stories.d.ts +0 -15
- package/dist/src/elements/card.test.d.ts +0 -1
- package/dist/src/elements/checkbox.stories.d.ts +0 -15
- package/dist/src/elements/checkbox.test.d.ts +0 -0
- package/dist/src/elements/context-menu.stories.d.ts +0 -17
- package/dist/src/elements/context-menu.test.d.ts +0 -0
- package/dist/src/elements/dialog.stories.d.ts +0 -17
- package/dist/src/elements/dialog.test.d.ts +0 -1
- package/dist/src/elements/dropdown-menu.stories.d.ts +0 -16
- package/dist/src/elements/dropdown-menu.test.d.ts +0 -0
- package/dist/src/elements/form.stories.d.ts +0 -16
- package/dist/src/elements/form.test.d.ts +0 -0
- package/dist/src/elements/input.stories.d.ts +0 -35
- package/dist/src/elements/input.test.d.ts +0 -0
- package/dist/src/elements/label.d.ts +0 -3
- package/dist/src/elements/label.stories.d.ts +0 -17
- package/dist/src/elements/label.test.d.ts +0 -1
- package/dist/src/elements/link.stories.d.ts +0 -25
- package/dist/src/elements/link.test.d.ts +0 -1
- package/dist/src/elements/pagination.stories.d.ts +0 -15
- package/dist/src/elements/pagination.test.d.ts +0 -0
- package/dist/src/elements/popover.d.ts +0 -7
- package/dist/src/elements/popover.stories.d.ts +0 -17
- package/dist/src/elements/popover.test.d.ts +0 -0
- package/dist/src/elements/search-box.stories.d.ts +0 -34
- package/dist/src/elements/search-box.test.d.ts +0 -0
- package/dist/src/elements/select.d.ts +0 -14
- package/dist/src/elements/select.stories.d.ts +0 -20
- package/dist/src/elements/select.test.d.ts +0 -0
- package/dist/src/elements/separator.d.ts +0 -3
- package/dist/src/elements/separator.stories.d.ts +0 -15
- package/dist/src/elements/separator.test.d.ts +0 -0
- package/dist/src/elements/sheet.stories.d.ts +0 -15
- package/dist/src/elements/sheet.test.d.ts +0 -0
- package/dist/src/elements/sidebar.stories.d.ts +0 -17
- package/dist/src/elements/sidebar.test.d.ts +0 -0
- package/dist/src/elements/skeleton.stories.d.ts +0 -15
- package/dist/src/elements/skeleton.test.d.ts +0 -0
- package/dist/src/elements/spinner.stories.d.ts +0 -16
- package/dist/src/elements/spinner.test.d.ts +0 -1
- package/dist/src/elements/switch.stories.d.ts +0 -15
- package/dist/src/elements/switch.test.d.ts +0 -0
- package/dist/src/elements/table.stories.d.ts +0 -17
- package/dist/src/elements/table.test.d.ts +0 -1
- package/dist/src/elements/tabs.stories.d.ts +0 -18
- package/dist/src/elements/tabs.test.d.ts +0 -1
- package/dist/src/elements/toggle.d.ts +0 -8
- package/dist/src/elements/toggle.stories.d.ts +0 -15
- package/dist/src/elements/toggle.test.d.ts +0 -0
- package/dist/src/elements/tooltip.d.ts +0 -6
- package/dist/src/elements/tooltip.stories.d.ts +0 -15
- package/dist/src/elements/tooltip.test.d.ts +0 -0
- package/dist/src/hooks/use-mobile.test.d.ts +0 -1
- /package/dist/{src/elements → elements}/calendar.d.ts +0 -0
- /package/dist/{src/elements → elements}/card.d.ts +0 -0
- /package/dist/{src/elements → elements}/input.d.ts +0 -0
- /package/dist/{src/elements → elements}/skeleton.d.ts +0 -0
- /package/dist/{src/elements → elements}/spinner.d.ts +0 -0
- /package/dist/{src/elements → elements}/table.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/use-mobile.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/elements/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as ContextMenuPrimitive from '@radix-ui/react-context-menu';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root data-slot=\"context-menu\" {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal data-slot=\"context-menu-portal\" {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {\n return <ContextMenuPrimitive.Sub data-slot=\"context-menu-sub\" {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {\n side?: 'top' | 'right' | 'bottom' | 'left';\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </ContextMenuPrimitive.SubTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {\n return (\n <ContextMenuPrimitive.SubContent\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.Label\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextM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
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../src/elements/context-menu.tsx"],"sourcesContent":["'use client';\n\nimport { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';\nimport { CheckIcon, ChevronRightIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {\n return <ContextMenuPrimitive.Root {...props} />;\n}\n\nfunction ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {\n return (\n <ContextMenuPrimitive.Trigger\n data-slot=\"context-menu-trigger\"\n className={cn('select-none', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {\n return <ContextMenuPrimitive.Group data-slot=\"context-menu-group\" {...props} />;\n}\n\nfunction ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {\n return <ContextMenuPrimitive.Portal {...props} />;\n}\n\nfunction ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubmenuRoot>) {\n return <ContextMenuPrimitive.SubmenuRoot {...props} />;\n}\n\nfunction ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {\n return <ContextMenuPrimitive.RadioGroup data-slot=\"context-menu-radio-group\" {...props} />;\n}\n\nfunction ContextMenuContent({\n className,\n side,\n align,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Popup> & {\n side?: React.ComponentProps<typeof ContextMenuPrimitive.Positioner>['side'];\n align?: React.ComponentProps<typeof ContextMenuPrimitive.Positioner>['align'];\n}) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Positioner side={side} align={align}>\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-content\"\n className={cn(\n 'z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <ContextMenuPrimitive.Item\n data-slot=\"context-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[inset]:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[highlighted]:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.SubmenuTrigger> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.SubmenuTrigger\n data-slot=\"context-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[inset]:pl-7 data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"cn-rtl-flip ml-auto\" />\n </ContextMenuPrimitive.SubmenuTrigger>\n );\n}\n\nfunction ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Popup>) {\n return (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Positioner>\n <ContextMenuPrimitive.Popup\n data-slot=\"context-menu-sub-content\"\n className={cn(\n 'z-50 min-w-32 origin-(--transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Positioner>\n </ContextMenuPrimitive.Portal>\n );\n}\n\nfunction ContextMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.CheckboxItem\n data-slot=\"context-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[inset]:pl-7 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.CheckboxItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction ContextMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {\n inset?: boolean;\n}) {\n return (\n <ContextMenuPrimitive.RadioItem\n data-slot=\"context-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[inset]:pl-7 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2\">\n <ContextMenuPrimitive.RadioItemIndicator>\n <CheckIcon />\n </ContextMenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n );\n}\n\nfunction ContextMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<'div'> & {\n inset?: boolean;\n}) {\n return (\n <div\n data-slot=\"context-menu-label\"\n data-inset={inset}\n className={cn('px-1.5 py-1 text-xs font-medium text-muted-foreground data-[inset]:pl-7', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {\n return (\n <ContextMenuPrimitive.Separator\n data-slot=\"context-menu-separator\"\n className={cn('-mx-1 my-1 h-px bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"context-menu-shortcut\"\n className={cn(\n 'ml-auto text-xs tracking-widest text-muted-foreground group-data-[highlighted]/context-menu-item:text-accent-foreground',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":";;;;;;AAOA,SAAS,EAAY,EAAE,GAAG,KAAiE;AACzF,QAAO,kBAAC,EAAqB,MAAtB,EAA2B,GAAI,GAAS,CAAA;;AAGjD,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAoE;AAC9G,QACE,kBAAC,EAAqB,SAAtB;EACE,aAAU;EACV,WAAW,EAAG,eAAe,EAAU;EACvC,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAiB,EAAE,GAAG,KAAkE;AAC/F,QAAO,kBAAC,EAAqB,OAAtB;EAA4B,aAAU;EAAqB,GAAI;EAAS,CAAA;;AAGjF,SAAS,EAAkB,EAAE,GAAG,KAAmE;AACjG,QAAO,kBAAC,EAAqB,QAAtB,EAA6B,GAAI,GAAS,CAAA;;AAGnD,SAAS,EAAe,EAAE,GAAG,KAAwE;AACnG,QAAO,kBAAC,EAAqB,aAAtB,EAAkC,GAAI,GAAS,CAAA;;AAGxD,SAAS,EAAsB,EAAE,GAAG,KAAuE;AACzG,QAAO,kBAAC,EAAqB,YAAtB;EAAiC,aAAU;EAA2B,GAAI;EAAS,CAAA;;AAG5F,SAAS,EAAmB,EAC1B,cACA,SACA,UACA,GAAG,KAIF;AACD,QACE,kBAAC,EAAqB,QAAtB,EAAA,UACE,kBAAC,EAAqB,YAAtB;EAAuC;EAAa;YAClD,kBAAC,EAAqB,OAAtB;GACE,aAAU;GACV,WAAW,EACT,0fACA,EACD;GACD,GAAI;GACJ,CAAA;EAC8B,CAAA,EACN,CAAA;;AAIlC,SAAS,EAAgB,EACvB,cACA,UACA,aAAU,WACV,GAAG,KAIF;AACD,QACE,kBAAC,EAAqB,MAAtB;EACE,aA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AI;EACJ,CAAA;;AAIN,SAAS,EAAqB,EAAE,cAAW,GAAG,KAAsE;AAClH,QACE,kBAAC,EAAqB,WAAtB;EACE,aAAU;EACV,WAAW,EAAG,6BAA6B,EAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAoB,EAAE,cAAW,GAAG,KAAuC;AAClF,QACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,2HACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
package/dist/elements/dialog.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`lucide-react`),i=require(`react`);i=e.__toESM(i,1);let a=require(`@
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../lib/utils.cjs`);let n=require(`react/jsx-runtime`),r=require(`lucide-react`),i=require(`react`);i=e.__toESM(i,1);let a=require(`@base-ui/react/dialog`);function o({...e}){return(0,n.jsx)(a.Dialog.Root,{...e})}function s({...e}){return(0,n.jsx)(a.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function c({...e}){return(0,n.jsx)(a.Dialog.Portal,{...e})}function l({...e}){return(0,n.jsx)(a.Dialog.Close,{"data-slot":`dialog-close`,...e})}function u({className:e,...r}){return(0,n.jsx)(a.Dialog.Backdrop,{"data-slot":`dialog-overlay`,className:t.cn(`data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...r})}function d({className:e,children:i,showCloseButton:o=!0,...s}){return(0,n.jsxs)(c,{children:[(0,n.jsx)(u,{}),(0,n.jsxs)(a.Dialog.Popup,{"data-slot":`dialog-content`,className:t.cn(`bg-background data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,e),...s,children:[i,o&&(0,n.jsxs)(a.Dialog.Close,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[open]:bg-accent data-[open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,n.jsx)(r.XIcon,{}),(0,n.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function f({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`dialog-header`,className:t.cn(`flex flex-col gap-2 text-center sm:text-left`,e),...r})}function p({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`dialog-footer`,className:t.cn(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r})}function m({className:e,...r}){return(0,n.jsx)(a.Dialog.Title,{"data-slot":`dialog-title`,className:t.cn(`text-lg leading-none font-semibold`,e),...r})}function h({className:e,...r}){return(0,n.jsx)(a.Dialog.Description,{"data-slot":`dialog-description`,className:t.cn(`text-muted-foreground text-sm`,e),...r})}exports.Dialog=o,exports.DialogClose=l,exports.DialogContent=d,exports.DialogDescription=h,exports.DialogFooter=p,exports.DialogHeader=f,exports.DialogOverlay=u,exports.DialogPortal=c,exports.DialogTitle=m,exports.DialogTrigger=s;
|
|
2
2
|
//# sourceMappingURL=dialog.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.cjs","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"dialog.cjs","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[open]:bg-accent data-[open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"2SAQA,SAAS,EAAO,CAAE,GAAG,GAA4D,CAC/E,OAAO,EAAA,EAAA,KAAC,EAAA,OAAgB,KAAjB,CAAsB,GAAI,EAAS,CAAA,CAG5C,SAAS,EAAc,CAAE,GAAG,GAA+D,CACzF,OAAO,EAAA,EAAA,KAAC,EAAA,OAAgB,QAAjB,CAAyB,YAAU,iBAAiB,GAAI,EA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6D,CAChG,OACE,EAAA,EAAA,KAAC,EAAA,OAAgB,MAAjB,CACE,YAAU,eACV,UAAW,EAAA,GAAG,qCAAsC,EAAU,CAC9D,GAAI,EACJ,CAAA,CAIN,SAAS,EAAkB,CAAE,YAAW,GAAG,GAAmE,CAC5G,OACE,EAAA,EAAA,KAAC,EAAA,OAAgB,YAAjB,CACE,YAAU,qBACV,UAAW,EAAA,GAAG,gCAAiC,EAAU,CACzD,GAAI,EACJ,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
|
|
3
3
|
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Backdrop>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Popup> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
package/dist/elements/dialog.js
CHANGED
|
@@ -3,13 +3,10 @@ import { cn as e } from "../lib/utils.js";
|
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
import { XIcon as r } from "lucide-react";
|
|
5
5
|
import "react";
|
|
6
|
-
import
|
|
6
|
+
import { Dialog as i } from "@base-ui/react/dialog";
|
|
7
7
|
//#region src/elements/dialog.tsx
|
|
8
8
|
function a({ ...e }) {
|
|
9
|
-
return /* @__PURE__ */ t(i.Root, {
|
|
10
|
-
"data-slot": "dialog",
|
|
11
|
-
...e
|
|
12
|
-
});
|
|
9
|
+
return /* @__PURE__ */ t(i.Root, { ...e });
|
|
13
10
|
}
|
|
14
11
|
function o({ ...e }) {
|
|
15
12
|
return /* @__PURE__ */ t(i.Trigger, {
|
|
@@ -18,10 +15,7 @@ function o({ ...e }) {
|
|
|
18
15
|
});
|
|
19
16
|
}
|
|
20
17
|
function s({ ...e }) {
|
|
21
|
-
return /* @__PURE__ */ t(i.Portal, {
|
|
22
|
-
"data-slot": "dialog-portal",
|
|
23
|
-
...e
|
|
24
|
-
});
|
|
18
|
+
return /* @__PURE__ */ t(i.Portal, { ...e });
|
|
25
19
|
}
|
|
26
20
|
function c({ ...e }) {
|
|
27
21
|
return /* @__PURE__ */ t(i.Close, {
|
|
@@ -30,29 +24,26 @@ function c({ ...e }) {
|
|
|
30
24
|
});
|
|
31
25
|
}
|
|
32
26
|
function l({ className: n, ...r }) {
|
|
33
|
-
return /* @__PURE__ */ t(i.
|
|
27
|
+
return /* @__PURE__ */ t(i.Backdrop, {
|
|
34
28
|
"data-slot": "dialog-overlay",
|
|
35
|
-
className: e("data-[
|
|
29
|
+
className: e("data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 fixed inset-0 z-50 bg-black/50", n),
|
|
36
30
|
...r
|
|
37
31
|
});
|
|
38
32
|
}
|
|
39
33
|
function u({ className: a, children: o, showCloseButton: c = !0, ...u }) {
|
|
40
|
-
return /* @__PURE__ */ n(s, {
|
|
41
|
-
"data-slot": "dialog-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className: "
|
|
49
|
-
children:
|
|
50
|
-
className: "sr-only",
|
|
51
|
-
children: "Close"
|
|
52
|
-
})]
|
|
34
|
+
return /* @__PURE__ */ n(s, { children: [/* @__PURE__ */ t(l, {}), /* @__PURE__ */ n(i.Popup, {
|
|
35
|
+
"data-slot": "dialog-content",
|
|
36
|
+
className: e("bg-background data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg", a),
|
|
37
|
+
...u,
|
|
38
|
+
children: [o, c && /* @__PURE__ */ n(i.Close, {
|
|
39
|
+
"data-slot": "dialog-close",
|
|
40
|
+
className: "ring-offset-background focus:ring-ring data-[open]:bg-accent data-[open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
41
|
+
children: [/* @__PURE__ */ t(r, {}), /* @__PURE__ */ t("span", {
|
|
42
|
+
className: "sr-only",
|
|
43
|
+
children: "Close"
|
|
53
44
|
})]
|
|
54
45
|
})]
|
|
55
|
-
});
|
|
46
|
+
})] });
|
|
56
47
|
}
|
|
57
48
|
function d({ className: n, ...r }) {
|
|
58
49
|
return /* @__PURE__ */ t("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../src/elements/dialog.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { XIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root {...props} />;\n}\n\nfunction DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal {...props} />;\n}\n\nfunction DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Backdrop>) {\n return (\n <DialogPrimitive.Backdrop\n data-slot=\"dialog-overlay\"\n className={cn(\n 'data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 fixed inset-0 z-50 bg-black/50',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Popup> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Popup\n data-slot=\"dialog-content\"\n className={cn(\n 'bg-background data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[open]:bg-accent data-[open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Popup>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-2 text-center sm:text-left', className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className)}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn('text-lg leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";;;;;;;AAQA,SAAS,EAAO,EAAE,GAAG,KAA4D;AAC/E,QAAO,kBAAC,EAAgB,MAAjB,EAAsB,GAAI,GAAS,CAAA;;AAG5C,SAAS,EAAc,EAAE,GAAG,KAA+D;AACzF,QAAO,kBAAC,EAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;EAAS,CAAA;;AAG1E,SAAS,EAAa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AG,iCAAiC,EAAU;EACzD,GAAI;EACJ,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../lib/utils.cjs`);let t=require(`react/jsx-runtime`),n=require(`lucide-react`),r=require(`@base-ui/react/menu`);function i({...e}){return(0,t.jsx)(r.Menu.Root,{...e})}function a({...e}){return(0,t.jsx)(r.Menu.Portal,{...e})}function o({...e}){return(0,t.jsx)(r.Menu.Trigger,{"data-slot":`dropdown-menu-trigger`,...e})}function s({className:n,side:i,align:a,sideOffset:o=4,...s}){return(0,t.jsx)(r.Menu.Portal,{children:(0,t.jsx)(r.Menu.Positioner,{side:i,align:a,sideOffset:o,children:(0,t.jsx)(r.Menu.Popup,{"data-slot":`dropdown-menu-content`,className:e.cn(`bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,n),...s})})})}function c({...e}){return(0,t.jsx)(r.Menu.Group,{"data-slot":`dropdown-menu-group`,...e})}function l({className:n,inset:i,variant:a=`default`,...o}){return(0,t.jsx)(r.Menu.Item,{"data-slot":`dropdown-menu-item`,"data-inset":i,"data-variant":a,className:e.cn(`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,n),...o})}function u({className:i,children:a,checked:o,...s}){return(0,t.jsxs)(r.Menu.CheckboxItem,{"data-slot":`dropdown-menu-checkbox-item`,className:e.cn(`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),checked:o,...s,children:[(0,t.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,t.jsx)(r.Menu.CheckboxItemIndicator,{children:(0,t.jsx)(n.CheckIcon,{className:`size-4`})})}),a]})}function d({...e}){return(0,t.jsx)(r.Menu.RadioGroup,{"data-slot":`dropdown-menu-radio-group`,...e})}function f({className:i,children:a,...o}){return(0,t.jsxs)(r.Menu.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e.cn(`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),...o,children:[(0,t.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,t.jsx)(r.Menu.RadioItemIndicator,{children:(0,t.jsx)(n.CircleIcon,{className:`size-2 fill-current`})})}),a]})}function p({className:n,inset:r,...i}){return(0,t.jsx)(`div`,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:e.cn(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),...i})}function m({className:n,...r}){return(0,t.jsx)(`div`,{role:`separator`,"data-slot":`dropdown-menu-separator`,className:e.cn(`bg-border -mx-1 my-1 h-px`,n),...r})}function h({className:n,...r}){return(0,t.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e.cn(`text-muted-foreground ml-auto text-xs tracking-widest`,n),...r})}function g({...e}){return(0,t.jsx)(r.Menu.SubmenuRoot,{...e})}function _({className:i,inset:a,children:o,...s}){return(0,t.jsxs)(r.Menu.SubmenuTrigger,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":a,className:e.cn(`data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8`,i),...s,children:[o,(0,t.jsx)(n.ChevronRightIcon,{className:`ml-auto size-4`})]})}function v({className:n,...i}){return(0,t.jsx)(r.Menu.Portal,{children:(0,t.jsx)(r.Menu.Positioner,{children:(0,t.jsx)(r.Menu.Popup,{"data-slot":`dropdown-menu-sub-content`,className:e.cn(`bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--transform-origin) overflow-hidden rounded-md border p-1 shadow-lg`,n),...i})})})}exports.DropdownMenu=i,exports.DropdownMenuCheckboxItem=u,exports.DropdownMenuContent=s,exports.DropdownMenuGroup=c,exports.DropdownMenuItem=l,exports.DropdownMenuLabel=p,exports.DropdownMenuPortal=a,exports.DropdownMenuRadioGroup=d,exports.DropdownMenuRadioItem=f,exports.DropdownMenuSeparator=m,exports.DropdownMenuShortcut=h,exports.DropdownMenuSub=g,exports.DropdownMenuSubContent=v,exports.DropdownMenuSubTrigger=_,exports.DropdownMenuTrigger=o;
|
|
2
2
|
//# sourceMappingURL=dropdown-menu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.cjs","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nexport type { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"4RASA,SAAS,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAAA,EAAA,KAAC,EAAsB,KAAvB,CAA4B,YAAU,gBAAgB,GAAI,EAAS,CAAA,CAG5E,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAO,EAAA,EAAA,KAAC,EAAsB,OAAvB,CAA8B,YAAU,uBAAuB,GAAI,EAAS,CAAA,CAGrF,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAO,EAAA,EAAA,KAAC,EAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,EAAS,CAAA,CAGvF,SAAS,EAAoB,CAC3B,YACA,aAAa,EACb,GAAG,GAC0D,CAC7D,OACE,EAAA,EAAA,KAAC,EAAsB,OAAvB,CAAA,UACE,EAAA,EAAA,KAAC,EAAsB,QAAvB,CACE,YAAU,wBACE,aACZ,UAAW,EAAA,GACT,yjBACA,EACD,CACD,GAAI,EACJ,CAAA,CAC2B,CAAA,CAInC,SAAS,EAAkB,CAAE,GAAG,GAAmE,CACjG,OAAO,EAAA,EAAA,KAAC,EAAsB,MAAvB,CAA6B,YAAU,sBAAsB,GAAI,EAAS,CAAA,CAGnF,SAAS,EAAiB,CACxB,YACA,QACA,UAAU,UACV,GAAG,GAIF,CACD,OACE,EAAA,EAAA,KAAC,EAAsB,KAAvB,CACE,YAAU,qBACV,aAAY,EACZ,eAAc,EACd,UAAW,EAAA,GACT,8mBACA,EACD,CACD,GAAI,EACJ,CAAA,CAIN,SAAS,EAAyB,CAChC,YACA,WACA,UACA,GAAG,GAC+D,CAClE,OACE,EAAA,EAAA,MAAC,EAAsB,aAAvB,CACE,YAAU,8BACV,UAAW,EAAA,GACT,+SACA,EACD,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AAvB,CAA2B,YAAU,oBAAoB,GAAI,EAAS,CAAA,CAG/E,SAAS,EAAuB,CAC9B,YACA,QACA,WACA,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,EAAsB,WAAvB,CACE,YAAU,4BACV,aAAY,EACZ,UAAW,EAAA,GACT,iOACA,EACD,CACD,GAAI,WAPN,CASG,GACD,EAAA,EAAA,KAAC,EAAA,iBAAD,CAAkB,UAAU,iBAAmB,CAAA,CACd,GAIvC,SAAS,EAAuB,CAC9B,YACA,GAAG,GAC6D,CAChE,OACE,EAAA,EAAA,KAAC,EAAsB,WAAvB,CACE,YAAU,4BACV,UAAW,EAAA,GACT,gfACA,EACD,CACD,GAAI,EACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.cjs","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n side,\n align,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Popup> & {\n side?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['side'];\n align?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['align'];\n sideOffset?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['sideOffset'];\n}) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Positioner side={side} align={align} sideOffset={sideOffset}>\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.RadioItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<'div'> & {\n inset?: boolean;\n}) {\n return (\n <div\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n role=\"separator\"\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>) {\n return <DropdownMenuPrimitive.SubmenuRoot {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubmenuTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Positioner>\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":"+PAOA,SAAS,EAAa,CAAE,GAAG,GAAkE,CAC3F,OAAO,EAAA,EAAA,KAAC,EAAA,KAAsB,KAAvB,CAA4B,GAAI,EAAS,CAAA,CAGlD,SAAS,EAAmB,CAAE,GAAG,GAAoE,CACnG,OAAO,EAAA,EAAA,KAAC,EAAA,KAAsB,OAAvB,CAA8B,GAAI,EAAS,CAAA,CAGpD,SAAS,EAAoB,CAAE,GAAG,GAAqE,CACrG,OAAO,EAAA,EAAA,KAAC,EAAA,KAAsB,QAAvB,CAA+B,YAAU,wBAAwB,GAAI,EAAS,CAAA,CAGvF,SAAS,EAAoB,CAC3B,YACA,OACA,QACA,aAAa,EACb,GAAG,GAKF,CACD,OACE,EAAA,EAAA,KAAC,EAAA,KAAsB,OAAvB,CAAA,UACE,EAAA,EAAA,KAAC,EAAA,KAAsB,WAAvB,CAAwC,OAAa,QAAmB,uBACtE,EAAA,EAAA,KAAC,EAAA,KAAs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uCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
|
|
1
|
+
import { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu';
|
|
3
2
|
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.
|
|
5
|
+
declare function DropdownMenuContent({ className, side, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup> & {
|
|
6
|
+
side?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['side'];
|
|
7
|
+
align?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['align'];
|
|
8
|
+
sideOffset?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['sideOffset'];
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
12
|
inset?: boolean;
|
|
@@ -12,14 +15,14 @@ declare function DropdownMenuItem({ className, inset, variant, ...props }: React
|
|
|
12
15
|
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<
|
|
18
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<'div'> & {
|
|
16
19
|
inset?: boolean;
|
|
17
20
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<
|
|
21
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.
|
|
21
|
-
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.
|
|
23
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {
|
|
22
25
|
inset?: boolean;
|
|
23
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.
|
|
27
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup>): import("react/jsx-runtime").JSX.Element;
|
|
25
28
|
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -2,19 +2,13 @@
|
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
import { CheckIcon as r, ChevronRightIcon as i, CircleIcon as a } from "lucide-react";
|
|
5
|
-
import
|
|
5
|
+
import { Menu as o } from "@base-ui/react/menu";
|
|
6
6
|
//#region src/elements/dropdown-menu.tsx
|
|
7
7
|
function s({ ...e }) {
|
|
8
|
-
return /* @__PURE__ */ t(o.Root, {
|
|
9
|
-
"data-slot": "dropdown-menu",
|
|
10
|
-
...e
|
|
11
|
-
});
|
|
8
|
+
return /* @__PURE__ */ t(o.Root, { ...e });
|
|
12
9
|
}
|
|
13
10
|
function c({ ...e }) {
|
|
14
|
-
return /* @__PURE__ */ t(o.Portal, {
|
|
15
|
-
"data-slot": "dropdown-menu-portal",
|
|
16
|
-
...e
|
|
17
|
-
});
|
|
11
|
+
return /* @__PURE__ */ t(o.Portal, { ...e });
|
|
18
12
|
}
|
|
19
13
|
function l({ ...e }) {
|
|
20
14
|
return /* @__PURE__ */ t(o.Trigger, {
|
|
@@ -22,12 +16,16 @@ function l({ ...e }) {
|
|
|
22
16
|
...e
|
|
23
17
|
});
|
|
24
18
|
}
|
|
25
|
-
function u({ className: n,
|
|
26
|
-
return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(o.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
function u({ className: n, side: r, align: i, sideOffset: a = 4, ...s }) {
|
|
20
|
+
return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(o.Positioner, {
|
|
21
|
+
side: r,
|
|
22
|
+
align: i,
|
|
23
|
+
sideOffset: a,
|
|
24
|
+
children: /* @__PURE__ */ t(o.Popup, {
|
|
25
|
+
"data-slot": "dropdown-menu-content",
|
|
26
|
+
className: e("bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", n),
|
|
27
|
+
...s
|
|
28
|
+
})
|
|
31
29
|
}) });
|
|
32
30
|
}
|
|
33
31
|
function d({ ...e }) {
|
|
@@ -41,19 +39,19 @@ function f({ className: n, inset: r, variant: i = "default", ...a }) {
|
|
|
41
39
|
"data-slot": "dropdown-menu-item",
|
|
42
40
|
"data-inset": r,
|
|
43
41
|
"data-variant": i,
|
|
44
|
-
className: e("
|
|
42
|
+
className: e("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", n),
|
|
45
43
|
...a
|
|
46
44
|
});
|
|
47
45
|
}
|
|
48
46
|
function p({ className: i, children: a, checked: s, ...c }) {
|
|
49
47
|
return /* @__PURE__ */ n(o.CheckboxItem, {
|
|
50
48
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
51
|
-
className: e("
|
|
49
|
+
className: e("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", i),
|
|
52
50
|
checked: s,
|
|
53
51
|
...c,
|
|
54
52
|
children: [/* @__PURE__ */ t("span", {
|
|
55
53
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
56
|
-
children: /* @__PURE__ */ t(o.
|
|
54
|
+
children: /* @__PURE__ */ t(o.CheckboxItemIndicator, { children: /* @__PURE__ */ t(r, { className: "size-4" }) })
|
|
57
55
|
}), a]
|
|
58
56
|
});
|
|
59
57
|
}
|
|
@@ -66,16 +64,16 @@ function m({ ...e }) {
|
|
|
66
64
|
function h({ className: r, children: i, ...s }) {
|
|
67
65
|
return /* @__PURE__ */ n(o.RadioItem, {
|
|
68
66
|
"data-slot": "dropdown-menu-radio-item",
|
|
69
|
-
className: e("
|
|
67
|
+
className: e("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", r),
|
|
70
68
|
...s,
|
|
71
69
|
children: [/* @__PURE__ */ t("span", {
|
|
72
70
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
73
|
-
children: /* @__PURE__ */ t(o.
|
|
71
|
+
children: /* @__PURE__ */ t(o.RadioItemIndicator, { children: /* @__PURE__ */ t(a, { className: "size-2 fill-current" }) })
|
|
74
72
|
}), i]
|
|
75
73
|
});
|
|
76
74
|
}
|
|
77
75
|
function g({ className: n, inset: r, ...i }) {
|
|
78
|
-
return /* @__PURE__ */ t(
|
|
76
|
+
return /* @__PURE__ */ t("div", {
|
|
79
77
|
"data-slot": "dropdown-menu-label",
|
|
80
78
|
"data-inset": r,
|
|
81
79
|
className: e("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", n),
|
|
@@ -83,7 +81,8 @@ function g({ className: n, inset: r, ...i }) {
|
|
|
83
81
|
});
|
|
84
82
|
}
|
|
85
83
|
function _({ className: n, ...r }) {
|
|
86
|
-
return /* @__PURE__ */ t(
|
|
84
|
+
return /* @__PURE__ */ t("div", {
|
|
85
|
+
role: "separator",
|
|
87
86
|
"data-slot": "dropdown-menu-separator",
|
|
88
87
|
className: e("bg-border -mx-1 my-1 h-px", n),
|
|
89
88
|
...r
|
|
@@ -97,26 +96,23 @@ function v({ className: n, ...r }) {
|
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
function y({ ...e }) {
|
|
100
|
-
return /* @__PURE__ */ t(o.
|
|
101
|
-
"data-slot": "dropdown-menu-sub",
|
|
102
|
-
...e
|
|
103
|
-
});
|
|
99
|
+
return /* @__PURE__ */ t(o.SubmenuRoot, { ...e });
|
|
104
100
|
}
|
|
105
101
|
function b({ className: r, inset: a, children: s, ...c }) {
|
|
106
|
-
return /* @__PURE__ */ n(o.
|
|
102
|
+
return /* @__PURE__ */ n(o.SubmenuTrigger, {
|
|
107
103
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
108
104
|
"data-inset": a,
|
|
109
|
-
className: e("
|
|
105
|
+
className: e("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8", r),
|
|
110
106
|
...c,
|
|
111
107
|
children: [s, /* @__PURE__ */ t(i, { className: "ml-auto size-4" })]
|
|
112
108
|
});
|
|
113
109
|
}
|
|
114
110
|
function x({ className: n, ...r }) {
|
|
115
|
-
return /* @__PURE__ */ t(o.
|
|
111
|
+
return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ t(o.Positioner, { children: /* @__PURE__ */ t(o.Popup, {
|
|
116
112
|
"data-slot": "dropdown-menu-sub-content",
|
|
117
|
-
className: e("bg-popover text-popover-foreground data-[
|
|
113
|
+
className: e("bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", n),
|
|
118
114
|
...r
|
|
119
|
-
});
|
|
115
|
+
}) }) });
|
|
120
116
|
}
|
|
121
117
|
//#endregion
|
|
122
118
|
export { s as DropdownMenu, p as DropdownMenuCheckboxItem, u as DropdownMenuContent, d as DropdownMenuGroup, f as DropdownMenuItem, g as DropdownMenuLabel, c as DropdownMenuPortal, m as DropdownMenuRadioGroup, h as DropdownMenuRadioItem, _ as DropdownMenuSeparator, v as DropdownMenuShortcut, y as DropdownMenuSub, x as DropdownMenuSubContent, b as DropdownMenuSubTrigger, l as DropdownMenuTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nexport type { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":";;;;;;AASA,SAAS,EAAa,EAAE,GAAG,KAAkE;AAC3F,QAAO,kBAAC,EAAsB,MAAvB;EAA4B,aAAU;EAAgB,GAAI;EAAS,CAAA;;AAG5E,SAAS,EAAmB,EAAE,GAAG,KAAoE;AACnG,QAAO,kBAAC,EAAsB,QAAvB;EAA8B,aAAU;EAAuB,GAAI;EAAS,CAAA;;AAGrF,SAAS,EAAoB,EAAE,GAAG,KAAqE;AACrG,QAAO,kBAAC,EAAsB,SAAvB;EAA+B,aAAU;EAAwB,GAAI;EAAS,CAAA;;AAGvF,SAAS,EAAoB,EAC3B,cACA,gBAAa,GACb,GAAG,KAC0D;AAC7D,QACE,kBAAC,EAAsB,QAAvB,EAAA,UACE,kBAAC,EAAsB,SAAvB;EACE,aAAU;EACE;EACZ,WAAW,EACT,0jBACA,EACD;EACD,G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WAAvB;EACE,aAAU;EACV,WAAW,EAAG,6BAA6B,EAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAqB,EAAE,cAAW,GAAG,KAAuC;AACnF,QACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EAAG,yDAAyD,EAAU;EACjF,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAgB,EAAE,GAAG,KAAiE;AAC7F,QAAO,kBAAC,EAAsB,KAAvB;EAA2B,aAAU;EAAoB,GAAI;EAAS,CAAA;;AAG/E,SAAS,EAAuB,EAC9B,cACA,UACA,aACA,GAAG,KAGF;AACD,QACE,kBAAC,EAAsB,YAAvB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EACT,kOACA,EACD;EACD,GAAI;YAPN,CASG,GACD,kBAAC,GAAD,EAAkB,WAAU,kBAAmB,CAAA,CACd;;;AAIvC,SAAS,EAAuB,EAC9B,cACA,GAAG,KAC6D;AAChE,QACE,kBAAC,EAAsB,YAAvB;EACE,aAAU;EACV,WAAW,EACT,ifACA,EACD;EACD,GAAI;EACJ,CAAA"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../src/elements/dropdown-menu.tsx"],"sourcesContent":["'use client';\n\nimport { Menu as DropdownMenuPrimitive } from '@base-ui/react/menu';\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\n\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root {...props} />;\n}\n\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return <DropdownMenuPrimitive.Portal {...props} />;\n}\n\nfunction DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return <DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />;\n}\n\nfunction DropdownMenuContent({\n className,\n side,\n align,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Popup> & {\n side?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['side'];\n align?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['align'];\n sideOffset?: React.ComponentProps<typeof DropdownMenuPrimitive.Positioner>['sideOffset'];\n}) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Positioner side={side} align={align} sideOffset={sideOffset}>\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--available-height) min-w-[8rem] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />;\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = 'default',\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: 'default' | 'destructive';\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n );\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return <DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />;\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.RadioItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n );\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<'div'> & {\n inset?: boolean;\n}) {\n return (\n <div\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn('px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n role=\"separator\"\n data-slot=\"dropdown-menu-separator\"\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}\n {...props}\n />\n );\n}\n\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuRoot>) {\n return <DropdownMenuPrimitive.SubmenuRoot {...props} />;\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubmenuTrigger> & {\n inset?: boolean;\n}) {\n return (\n <DropdownMenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubmenuTrigger>\n );\n}\n\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Popup>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Positioner>\n <DropdownMenuPrimitive.Popup\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n 'bg-popover text-popover-foreground data-[open]:animate-in data-[closed]:animate-out data-[closed]:fade-out-0 data-[open]:fade-in-0 data-[closed]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Positioner>\n </DropdownMenuPrimitive.Portal>\n );\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n"],"mappings":";;;;;;AAOA,SAAS,EAAa,EAAE,GAAG,KAAkE;AAC3F,QAAO,kBAAC,EAAsB,MAAvB,EAA4B,GAAI,GAAS,CAAA;;AAGlD,SAAS,EAAmB,EAAE,GAAG,KAAoE;AACnG,QAAO,kBAAC,EAAsB,QAAvB,EAA8B,GAAI,GAAS,CAAA;;AAGpD,SAAS,EAAoB,EAAE,GAAG,KAAqE;AACrG,QAAO,kBAAC,EAAsB,SAAvB;EAA+B,aAAU;EAAwB,GAAI;EAAS,CAAA;;AAGvF,SAAS,EAAoB,EAC3B,cACA,SACA,U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,GAAG,KAGF;AACD,QACE,kBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EAAG,qDAAqD,EAAU;EAC7E,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAsB,EAAE,cAAW,GAAG,KAAsC;AACnF,QACE,kBAAC,OAAD;EACE,MAAK;EACL,aAAU;EACV,WAAW,EAAG,6BAA6B,EAAU;EACrD,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAqB,EAAE,cAAW,GAAG,KAAuC;AACnF,QACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EAAG,yDAAyD,EAAU;EACjF,GAAI;EACJ,CAAA;;AAIN,SAAS,EAAgB,EAAE,GAAG,KAAyE;AACrG,QAAO,kBAAC,EAAsB,aAAvB,EAAmC,GAAI,GAAS,CAAA;;AAGzD,SAAS,EAAuB,EAC9B,cACA,UACA,aACA,GAAG,KAGF;AACD,QACE,kBAAC,EAAsB,gBAAvB;EACE,aAAU;EACV,cAAY;EACZ,WAAW,EACT,4PACA,EACD;EACD,GAAI;YAPN,CASG,GACD,kBAAC,GAAD,EAAkB,WAAU,kBAAmB,CAAA,CACV;;;AAI3C,SAAS,EAAuB,EAAE,cAAW,GAAG,KAAmE;AACjH,QACE,kBAAC,EAAsB,QAAvB,EAAA,UACE,kBAAC,EAAsB,YAAvB,EAAA,UACE,kBAAC,EAAsB,OAAvB;EACE,aAAU;EACV,WAAW,EACT,ibACA,EACD;EACD,GAAI;EACJ,CAAA,EAC+B,CAAA,EACN,CAAA"}
|
package/dist/elements/form.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`})
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../lib/utils.cjs`),t=require(`./label.cjs`);let n=require(`react/jsx-runtime`),r=require(`react`),i=require(`react-hook-form`);var a=i.FormProvider,o=(0,r.createContext)({}),s=(0,r.createContext)({}),c=({...e})=>{let t=(0,r.useMemo)(()=>({name:e.name}),[e.name]);return(0,n.jsx)(o.Provider,{value:t,children:(0,n.jsx)(i.Controller,{...e})})},l=()=>{let e=(0,r.useContext)(o),t=(0,r.useContext)(s),{getFieldState:n}=(0,i.useFormContext)(),a=(0,i.useFormState)({name:e.name}),c=n(e.name,a);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...c}};function u({className:t,...i}){let a=(0,r.useId)(),o=(0,r.useMemo)(()=>({id:a}),[a]);return(0,n.jsx)(s.Provider,{value:o,children:(0,n.jsx)(`div`,{"data-slot":`form-item`,className:e.cn(`grid gap-2`,t),...i})})}function d({className:r,...i}){let{error:a,formItemId:o}=l();return(0,n.jsx)(t.Label,{"data-slot":`form-label`,"data-error":!!a,className:e.cn(`data-[error=true]:text-destructive`,r),htmlFor:o,...i})}function f({children:e}){let{error:t,formItemId:i,formDescriptionId:a,formMessageId:o}=l(),s=r.Children.only(e);return(0,r.isValidElement)(s)?(0,r.cloneElement)(s,{"data-slot":`form-control`,id:i,"aria-describedby":t?`${a} ${o}`:a,"aria-invalid":!!t}):(0,n.jsx)(n.Fragment,{children:e})}function p({className:t,...r}){let{formDescriptionId:i}=l();return(0,n.jsx)(`p`,{"data-slot":`form-description`,id:i,className:e.cn(`text-muted-foreground text-sm`,t),...r})}function m({className:t,...r}){let{error:i,formMessageId:a}=l(),o=i?String(i?.message??``):r.children;return o?(0,n.jsx)(`p`,{"data-slot":`form-message`,id:a,className:e.cn(`text-destructive text-sm`,t),...r,children:o}):null}exports.Form=a,exports.FormControl=f,exports.FormDescription=p,exports.FormField=c,exports.FormItem=u,exports.FormLabel=d,exports.FormMessage=m,exports.useFormField=l;
|
|
2
2
|
//# sourceMappingURL=form.cjs.map
|