@codefast/ui 0.0.26 → 0.0.28
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/accordion.js +1 -49
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs +1 -49
- package/dist/accordion.mjs.map +1 -1
- package/dist/alert-dialog.js +1 -65
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert-dialog.mjs +1 -65
- package/dist/alert-dialog.mjs.map +1 -1
- package/dist/alert.js +1 -33
- package/dist/alert.js.map +1 -1
- package/dist/alert.mjs +1 -33
- package/dist/alert.mjs.map +1 -1
- package/dist/animate.plugin.js +2 -0
- package/dist/animate.plugin.js.map +1 -0
- package/dist/animate.plugin.mjs +2 -0
- package/dist/animate.plugin.mjs.map +1 -0
- package/dist/aspect-ratio.js +1 -8
- package/dist/aspect-ratio.js.map +1 -1
- package/dist/aspect-ratio.mjs +1 -8
- package/dist/aspect-ratio.mjs.map +1 -1
- package/dist/avatar.js +1 -34
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.mjs +1 -34
- package/dist/avatar.mjs.map +1 -1
- package/dist/badge.js +1 -26
- package/dist/badge.js.map +1 -1
- package/dist/badge.mjs +1 -26
- package/dist/badge.mjs.map +1 -1
- package/dist/blockquote.js +1 -12
- package/dist/blockquote.js.map +1 -1
- package/dist/blockquote.mjs +1 -12
- package/dist/blockquote.mjs.map +1 -1
- package/dist/box.js +1 -12
- package/dist/box.js.map +1 -1
- package/dist/box.mjs +1 -12
- package/dist/box.mjs.map +1 -1
- package/dist/breadcrumb.js +1 -71
- package/dist/breadcrumb.js.map +1 -1
- package/dist/breadcrumb.mjs +1 -71
- package/dist/breadcrumb.mjs.map +1 -1
- package/dist/button.js +1 -10
- package/dist/button.mjs +1 -10
- package/dist/calendar.js +1 -70
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.mjs +1 -70
- package/dist/calendar.mjs.map +1 -1
- package/dist/card.js +1 -29
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +1 -29
- package/dist/card.mjs.map +1 -1
- package/dist/carousel.js +1 -193
- package/dist/carousel.js.map +1 -1
- package/dist/carousel.mjs +1 -193
- package/dist/carousel.mjs.map +1 -1
- package/dist/checkbox-cards.js +1 -51
- package/dist/checkbox-cards.js.map +1 -1
- package/dist/checkbox-cards.mjs +1 -51
- package/dist/checkbox-cards.mjs.map +1 -1
- package/dist/checkbox-group.js +1 -39
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox-group.mjs +1 -39
- package/dist/checkbox-group.mjs.map +1 -1
- package/dist/checkbox-group.primitive.js +1 -18
- package/dist/checkbox-group.primitive.mjs +1 -18
- package/dist/checkbox.js +1 -26
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.mjs +1 -26
- package/dist/checkbox.mjs.map +1 -1
- package/dist/chunk-2RQCRE7N.js +2 -0
- package/dist/chunk-2RQCRE7N.js.map +1 -0
- package/dist/chunk-ATQPXKGH.mjs +2 -0
- package/dist/{chunk-JULVZPCS.mjs.map → chunk-ATQPXKGH.mjs.map} +1 -1
- package/dist/chunk-CF2GOAXC.mjs +2 -0
- package/dist/{chunk-AUQEMOIM.mjs.map → chunk-CF2GOAXC.mjs.map} +1 -1
- package/dist/chunk-CHJJRHD2.mjs +2 -0
- package/dist/{chunk-TXRIFICH.mjs.map → chunk-CHJJRHD2.mjs.map} +1 -1
- package/dist/chunk-CNPQJV2G.js +2 -0
- package/dist/chunk-CNPQJV2G.js.map +1 -0
- package/dist/chunk-DCN2KICL.js +2 -0
- package/dist/chunk-DCN2KICL.js.map +1 -0
- package/dist/chunk-HJ4U5JJA.mjs +2 -0
- package/dist/chunk-HJ4U5JJA.mjs.map +1 -0
- package/dist/chunk-IBJ5USOR.js +2 -0
- package/dist/chunk-IBJ5USOR.js.map +1 -0
- package/dist/chunk-J5EXNAHZ.js +2 -0
- package/dist/chunk-J5EXNAHZ.js.map +1 -0
- package/dist/chunk-JTI7KCLO.mjs +2 -0
- package/dist/chunk-JTI7KCLO.mjs.map +1 -0
- package/dist/chunk-JVGHOCS7.js +2 -0
- package/dist/chunk-JVGHOCS7.js.map +1 -0
- package/dist/chunk-KICZFOKE.js +2 -0
- package/dist/chunk-KICZFOKE.js.map +1 -0
- package/dist/chunk-MXVHKLFU.mjs +2 -0
- package/dist/{chunk-FGI3JA75.mjs.map → chunk-MXVHKLFU.mjs.map} +1 -1
- package/dist/chunk-O7LLHO4I.js +2 -0
- package/dist/chunk-O7LLHO4I.js.map +1 -0
- package/dist/chunk-QZCQ42BP.js +2 -0
- package/dist/chunk-QZCQ42BP.js.map +1 -0
- package/dist/chunk-S23IT4G2.js +2 -0
- package/dist/chunk-S23IT4G2.js.map +1 -0
- package/dist/chunk-TMXZMQRK.mjs +2 -0
- package/dist/{chunk-73S45XV3.mjs.map → chunk-TMXZMQRK.mjs.map} +1 -1
- package/dist/chunk-VDYNVLXR.mjs +2 -0
- package/dist/{chunk-U6VR5RJ5.mjs.map → chunk-VDYNVLXR.mjs.map} +1 -1
- package/dist/chunk-XPJZ6WQM.js +2 -0
- package/dist/chunk-XPJZ6WQM.js.map +1 -0
- package/dist/chunk-YV4UJQ5X.mjs +2 -0
- package/dist/{chunk-EWS3N4OZ.mjs.map → chunk-YV4UJQ5X.mjs.map} +1 -1
- package/dist/chunk-ZLAYTLRK.mjs +2 -0
- package/dist/chunk-ZLAYTLRK.mjs.map +1 -0
- package/dist/chunk-ZMVKHU4U.mjs +2 -0
- package/dist/{chunk-Q24YJU6W.mjs.map → chunk-ZMVKHU4U.mjs.map} +1 -1
- package/dist/code.js +1 -12
- package/dist/code.js.map +1 -1
- package/dist/code.mjs +1 -12
- package/dist/code.mjs.map +1 -1
- package/dist/collapsible.js +1 -12
- package/dist/collapsible.js.map +1 -1
- package/dist/collapsible.mjs +1 -12
- package/dist/collapsible.mjs.map +1 -1
- package/dist/command.js +1 -93
- package/dist/command.js.map +1 -1
- package/dist/command.mjs +1 -93
- package/dist/command.mjs.map +1 -1
- package/dist/container.js +1 -16
- package/dist/container.js.map +1 -1
- package/dist/container.mjs +1 -16
- package/dist/container.mjs.map +1 -1
- package/dist/context-menu.js +1 -153
- package/dist/context-menu.js.map +1 -1
- package/dist/context-menu.mjs +1 -153
- package/dist/context-menu.mjs.map +1 -1
- package/dist/data-table.js +1 -235
- package/dist/data-table.js.map +1 -1
- package/dist/data-table.mjs +1 -235
- package/dist/data-table.mjs.map +1 -1
- package/dist/dialog.js +1 -22
- package/dist/dialog.mjs +1 -22
- package/dist/drawer.js +1 -64
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +1 -64
- package/dist/drawer.mjs.map +1 -1
- package/dist/dropdown-menu.js +1 -34
- package/dist/dropdown-menu.mjs +1 -34
- package/dist/em.js +1 -12
- package/dist/em.js.map +1 -1
- package/dist/em.mjs +1 -12
- package/dist/em.mjs.map +1 -1
- package/dist/form.js +1 -91
- package/dist/form.js.map +1 -1
- package/dist/form.mjs +1 -91
- package/dist/form.mjs.map +1 -1
- package/dist/heading.js +1 -12
- package/dist/heading.js.map +1 -1
- package/dist/heading.mjs +1 -12
- package/dist/heading.mjs.map +1 -1
- package/dist/hover-card.js +1 -35
- package/dist/hover-card.js.map +1 -1
- package/dist/hover-card.mjs +1 -35
- package/dist/hover-card.mjs.map +1 -1
- package/dist/input-otp.js +1 -62
- package/dist/input-otp.js.map +1 -1
- package/dist/input-otp.mjs +1 -62
- package/dist/input-otp.mjs.map +1 -1
- package/dist/input.js +1 -28
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +1 -28
- package/dist/input.mjs.map +1 -1
- package/dist/kbd.js +1 -26
- package/dist/kbd.js.map +1 -1
- package/dist/kbd.mjs +1 -26
- package/dist/kbd.mjs.map +1 -1
- package/dist/label.js +1 -8
- package/dist/label.mjs +1 -8
- package/dist/menubar.js +1 -168
- package/dist/menubar.js.map +1 -1
- package/dist/menubar.mjs +1 -168
- package/dist/menubar.mjs.map +1 -1
- package/dist/navigation-menu.js +1 -119
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs +1 -119
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/pagination.js +1 -86
- package/dist/pagination.js.map +1 -1
- package/dist/pagination.mjs +1 -86
- package/dist/pagination.mjs.map +1 -1
- package/dist/perspective.plugin.js +2 -0
- package/dist/perspective.plugin.js.map +1 -0
- package/dist/perspective.plugin.mjs +2 -0
- package/dist/perspective.plugin.mjs.map +1 -0
- package/dist/popover.js +1 -37
- package/dist/popover.js.map +1 -1
- package/dist/popover.mjs +1 -37
- package/dist/popover.mjs.map +1 -1
- package/dist/pre.js +1 -12
- package/dist/pre.js.map +1 -1
- package/dist/pre.mjs +1 -12
- package/dist/pre.mjs.map +1 -1
- package/dist/progress.js +1 -30
- package/dist/progress.js.map +1 -1
- package/dist/progress.mjs +1 -30
- package/dist/progress.mjs.map +1 -1
- package/dist/quote.js +1 -12
- package/dist/quote.js.map +1 -1
- package/dist/quote.mjs +1 -12
- package/dist/quote.mjs.map +1 -1
- package/dist/radio-cards.js +1 -31
- package/dist/radio-cards.js.map +1 -1
- package/dist/radio-cards.mjs +1 -31
- package/dist/radio-cards.mjs.map +1 -1
- package/dist/radio-group.js +1 -32
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.mjs +1 -32
- package/dist/radio-group.mjs.map +1 -1
- package/dist/radio.js +1 -28
- package/dist/radio.js.map +1 -1
- package/dist/radio.mjs +1 -28
- package/dist/radio.mjs.map +1 -1
- package/dist/resizable.js +1 -44
- package/dist/resizable.js.map +1 -1
- package/dist/resizable.mjs +1 -44
- package/dist/resizable.mjs.map +1 -1
- package/dist/scroll-area.js +1 -38
- package/dist/scroll-area.js.map +1 -1
- package/dist/scroll-area.mjs +1 -38
- package/dist/scroll-area.mjs.map +1 -1
- package/dist/section.js +1 -12
- package/dist/section.js.map +1 -1
- package/dist/section.mjs +1 -12
- package/dist/section.mjs.map +1 -1
- package/dist/select.js +1 -26
- package/dist/select.mjs +1 -26
- package/dist/separator.js +1 -25
- package/dist/separator.js.map +1 -1
- package/dist/separator.mjs +1 -25
- package/dist/separator.mjs.map +1 -1
- package/dist/sheet.js +1 -64
- package/dist/sheet.js.map +1 -1
- package/dist/sheet.mjs +1 -64
- package/dist/sheet.mjs.map +1 -1
- package/dist/skeleton.js +1 -12
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.mjs +1 -12
- package/dist/skeleton.mjs.map +1 -1
- package/dist/slider.js +1 -32
- package/dist/slider.js.map +1 -1
- package/dist/slider.mjs +1 -32
- package/dist/slider.mjs.map +1 -1
- package/dist/sonner.js +1 -29
- package/dist/sonner.js.map +1 -1
- package/dist/sonner.mjs +1 -29
- package/dist/sonner.mjs.map +1 -1
- package/dist/spinner.js +1 -7
- package/dist/spinner.mjs +1 -7
- package/dist/strong.js +1 -12
- package/dist/strong.js.map +1 -1
- package/dist/strong.mjs +1 -12
- package/dist/strong.mjs.map +1 -1
- package/dist/switch.js +1 -25
- package/dist/switch.js.map +1 -1
- package/dist/switch.mjs +1 -25
- package/dist/switch.mjs.map +1 -1
- package/dist/table.js +1 -50
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +1 -50
- package/dist/table.mjs.map +1 -1
- package/dist/tabs.js +1 -52
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.mjs +1 -52
- package/dist/tabs.mjs.map +1 -1
- package/dist/tailwind.config.js +1 -383
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.mjs +1 -383
- package/dist/tailwind.config.mjs.map +1 -1
- package/dist/text.js +1 -12
- package/dist/text.js.map +1 -1
- package/dist/text.mjs +1 -12
- package/dist/text.mjs.map +1 -1
- package/dist/textarea.js +1 -24
- package/dist/textarea.js.map +1 -1
- package/dist/textarea.mjs +1 -24
- package/dist/textarea.mjs.map +1 -1
- package/dist/toggle-group.js +1 -56
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle-group.mjs +1 -56
- package/dist/toggle-group.mjs.map +1 -1
- package/dist/toggle.js +1 -10
- package/dist/toggle.mjs +1 -10
- package/dist/tooltip.js +1 -36
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.mjs +1 -36
- package/dist/tooltip.mjs.map +1 -1
- package/dist/utils.js +1 -10
- package/dist/utils.mjs +1 -10
- package/package.json +6 -10
- package/dist/chunk-3ZZ3SRTJ.js +0 -148
- package/dist/chunk-3ZZ3SRTJ.js.map +0 -1
- package/dist/chunk-73S45XV3.mjs +0 -51
- package/dist/chunk-AOIW2XNK.js +0 -34
- package/dist/chunk-AOIW2XNK.js.map +0 -1
- package/dist/chunk-AUQEMOIM.mjs +0 -34
- package/dist/chunk-BA3XYBWR.js +0 -120
- package/dist/chunk-BA3XYBWR.js.map +0 -1
- package/dist/chunk-EWS3N4OZ.mjs +0 -148
- package/dist/chunk-FGI3JA75.mjs +0 -25
- package/dist/chunk-G3NP7M2N.js +0 -19
- package/dist/chunk-G3NP7M2N.js.map +0 -1
- package/dist/chunk-IVYGBU4G.js +0 -25
- package/dist/chunk-IVYGBU4G.js.map +0 -1
- package/dist/chunk-JULVZPCS.mjs +0 -120
- package/dist/chunk-MOJNV3XZ.js +0 -120
- package/dist/chunk-MOJNV3XZ.js.map +0 -1
- package/dist/chunk-Q24YJU6W.mjs +0 -120
- package/dist/chunk-TFYKPLNV.js +0 -73
- package/dist/chunk-TFYKPLNV.js.map +0 -1
- package/dist/chunk-TH24V27M.js +0 -67
- package/dist/chunk-TH24V27M.js.map +0 -1
- package/dist/chunk-TXRIFICH.mjs +0 -67
- package/dist/chunk-U6VR5RJ5.mjs +0 -73
- package/dist/chunk-UG3URV2Z.mjs +0 -19
- package/dist/chunk-UG3URV2Z.mjs.map +0 -1
- package/dist/chunk-Y3DZHPJ5.js +0 -51
- package/dist/chunk-Y3DZHPJ5.js.map +0 -1
package/dist/context-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context-menu.tsx"],"names":[],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuTriggerProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Trigger>;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Group>;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioGroup>;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>;\n\ninterface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst ContextMenuSubTrigger = React.forwardRef<ContextMenuSubTriggerElement, ContextMenuSubTriggerProps>(\n ({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\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 select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n ),\n);\n\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof ContextMenuPrimitive.SubContent>;\ntype ContextMenuSubContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;\n\nconst ContextMenuSubContent = React.forwardRef<ContextMenuSubContentElement, ContextMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuContentElement = React.ElementRef<typeof ContextMenuPrimitive.Content>;\ntype ContextMenuContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuItemElement = React.ElementRef<typeof ContextMenuPrimitive.Item>;\n\ninterface ContextMenuItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>;\ntype ContextMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>;\n\nconst ContextMenuCheckboxItem = React.forwardRef<ContextMenuCheckboxItemElement, ContextMenuCheckboxItemProps>(\n ({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n ),\n);\n\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof ContextMenuPrimitive.RadioItem>;\ntype ContextMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>;\n\nconst ContextMenuRadioItem = React.forwardRef<ContextMenuRadioItemElement, ContextMenuRadioItemProps>(\n ({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n ),\n);\n\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuLabelElement = React.ElementRef<typeof ContextMenuPrimitive.Label>;\n\ninterface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n ),\n);\n\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof ContextMenuPrimitive.Separator>;\ntype ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;\n\nconst ContextMenuSeparator = React.forwardRef<ContextMenuSeparatorElement, ContextMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 my-1 h-px\", className)} {...props} />\n ),\n);\n\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuArrowElement = React.ElementRef<typeof ContextMenuPrimitive.Arrow>;\ntype ContextMenuArrowProps = ContextMenuPrimitive.ContextMenuArrowProps;\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow ref={ref} className={cn(\"fill-popover\", className)} {...props} />\n ),\n);\n\nContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n ContextMenuArrow,\n type ContextMenuProps,\n type ContextMenuTriggerProps,\n type ContextMenuContentProps,\n type ContextMenuItemProps,\n type ContextMenuCheckboxItemProps,\n type ContextMenuRadioItemProps,\n type ContextMenuLabelProps,\n type ContextMenuSeparatorProps,\n type ContextMenuShortcutProps,\n type ContextMenuGroupProps,\n type ContextMenuSubProps,\n type ContextMenuSubContentProps,\n type ContextMenuSubTriggerProps,\n type ContextMenuRadioGroupProps,\n type ContextMenuArrowProps,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/context-menu.tsx"],"names":["React","ContextMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","className","inset","children","props","ref","cn","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut","ContextMenuArrow"],"mappings":"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","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuTriggerProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Trigger>;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Group>;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioGroup>;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>;\n\ninterface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst ContextMenuSubTrigger = React.forwardRef<ContextMenuSubTriggerElement, ContextMenuSubTriggerProps>(\n ({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\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 select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n ),\n);\n\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof ContextMenuPrimitive.SubContent>;\ntype ContextMenuSubContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;\n\nconst ContextMenuSubContent = React.forwardRef<ContextMenuSubContentElement, ContextMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuContentElement = React.ElementRef<typeof ContextMenuPrimitive.Content>;\ntype ContextMenuContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuItemElement = React.ElementRef<typeof ContextMenuPrimitive.Item>;\n\ninterface ContextMenuItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>;\ntype ContextMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>;\n\nconst ContextMenuCheckboxItem = React.forwardRef<ContextMenuCheckboxItemElement, ContextMenuCheckboxItemProps>(\n ({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n ),\n);\n\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof ContextMenuPrimitive.RadioItem>;\ntype ContextMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>;\n\nconst ContextMenuRadioItem = React.forwardRef<ContextMenuRadioItemElement, ContextMenuRadioItemProps>(\n ({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n ),\n);\n\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuLabelElement = React.ElementRef<typeof ContextMenuPrimitive.Label>;\n\ninterface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n ),\n);\n\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof ContextMenuPrimitive.Separator>;\ntype ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;\n\nconst ContextMenuSeparator = React.forwardRef<ContextMenuSeparatorElement, ContextMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 my-1 h-px\", className)} {...props} />\n ),\n);\n\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuArrowElement = React.ElementRef<typeof ContextMenuPrimitive.Arrow>;\ntype ContextMenuArrowProps = ContextMenuPrimitive.ContextMenuArrowProps;\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow ref={ref} className={cn(\"fill-popover\", className)} {...props} />\n ),\n);\n\nContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n ContextMenuArrow,\n type ContextMenuProps,\n type ContextMenuTriggerProps,\n type ContextMenuContentProps,\n type ContextMenuItemProps,\n type ContextMenuCheckboxItemProps,\n type ContextMenuRadioItemProps,\n type ContextMenuLabelProps,\n type ContextMenuSeparatorProps,\n type ContextMenuShortcutProps,\n type ContextMenuGroupProps,\n type ContextMenuSubProps,\n type ContextMenuSubContentProps,\n type ContextMenuSubTriggerProps,\n type ContextMenuRadioGroupProps,\n type ContextMenuArrowProps,\n};\n"]}
|
package/dist/context-menu.mjs
CHANGED
|
@@ -1,154 +1,2 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
cn
|
|
4
|
-
} from "./chunk-UG3URV2Z.mjs";
|
|
5
|
-
|
|
6
|
-
// src/context-menu.tsx
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
9
|
-
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from "@radix-ui/react-icons";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
var ContextMenu = ContextMenuPrimitive.Root;
|
|
12
|
-
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
13
|
-
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
14
|
-
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
15
|
-
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
16
|
-
var ContextMenuSubTrigger = React.forwardRef(
|
|
17
|
-
({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
18
|
-
ContextMenuPrimitive.SubTrigger,
|
|
19
|
-
{
|
|
20
|
-
ref,
|
|
21
|
-
className: cn(
|
|
22
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",
|
|
23
|
-
inset && "pl-8",
|
|
24
|
-
className
|
|
25
|
-
),
|
|
26
|
-
...props,
|
|
27
|
-
children: [
|
|
28
|
-
children,
|
|
29
|
-
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
35
|
-
var ContextMenuSubContent = React.forwardRef(
|
|
36
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
37
|
-
ContextMenuPrimitive.SubContent,
|
|
38
|
-
{
|
|
39
|
-
ref,
|
|
40
|
-
className: cn(
|
|
41
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
42
|
-
className
|
|
43
|
-
),
|
|
44
|
-
...props
|
|
45
|
-
}
|
|
46
|
-
) })
|
|
47
|
-
);
|
|
48
|
-
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
49
|
-
var ContextMenuContent = React.forwardRef(
|
|
50
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
51
|
-
ContextMenuPrimitive.Content,
|
|
52
|
-
{
|
|
53
|
-
ref,
|
|
54
|
-
className: cn(
|
|
55
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",
|
|
56
|
-
className
|
|
57
|
-
),
|
|
58
|
-
...props
|
|
59
|
-
}
|
|
60
|
-
) })
|
|
61
|
-
);
|
|
62
|
-
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
63
|
-
var ContextMenuItem = React.forwardRef(
|
|
64
|
-
({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
65
|
-
ContextMenuPrimitive.Item,
|
|
66
|
-
{
|
|
67
|
-
ref,
|
|
68
|
-
className: cn(
|
|
69
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
70
|
-
inset && "pl-8",
|
|
71
|
-
className
|
|
72
|
-
),
|
|
73
|
-
...props
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
);
|
|
77
|
-
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
78
|
-
var ContextMenuCheckboxItem = React.forwardRef(
|
|
79
|
-
({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
80
|
-
ContextMenuPrimitive.CheckboxItem,
|
|
81
|
-
{
|
|
82
|
-
ref,
|
|
83
|
-
className: cn(
|
|
84
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
85
|
-
className
|
|
86
|
-
),
|
|
87
|
-
checked,
|
|
88
|
-
...props,
|
|
89
|
-
children: [
|
|
90
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
91
|
-
children
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
);
|
|
96
|
-
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
97
|
-
var ContextMenuRadioItem = React.forwardRef(
|
|
98
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
99
|
-
ContextMenuPrimitive.RadioItem,
|
|
100
|
-
{
|
|
101
|
-
ref,
|
|
102
|
-
className: cn(
|
|
103
|
-
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
104
|
-
className
|
|
105
|
-
),
|
|
106
|
-
...props,
|
|
107
|
-
children: [
|
|
108
|
-
/* @__PURE__ */ jsx("span", { className: "absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(DotFilledIcon, { className: "size-4 fill-current" }) }) }),
|
|
109
|
-
children
|
|
110
|
-
]
|
|
111
|
-
}
|
|
112
|
-
)
|
|
113
|
-
);
|
|
114
|
-
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
115
|
-
var ContextMenuLabel = React.forwardRef(
|
|
116
|
-
({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
117
|
-
ContextMenuPrimitive.Label,
|
|
118
|
-
{
|
|
119
|
-
ref,
|
|
120
|
-
className: cn("text-foreground px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
121
|
-
...props
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
);
|
|
125
|
-
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
126
|
-
var ContextMenuSeparator = React.forwardRef(
|
|
127
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Separator, { ref, className: cn("bg-border -mx-1 my-1 h-px", className), ...props })
|
|
128
|
-
);
|
|
129
|
-
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
130
|
-
function ContextMenuShortcut({ className, ...props }) {
|
|
131
|
-
return /* @__PURE__ */ jsx("span", { className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props });
|
|
132
|
-
}
|
|
133
|
-
var ContextMenuArrow = React.forwardRef(
|
|
134
|
-
({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Arrow, { ref, className: cn("fill-popover", className), ...props })
|
|
135
|
-
);
|
|
136
|
-
ContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;
|
|
137
|
-
export {
|
|
138
|
-
ContextMenu,
|
|
139
|
-
ContextMenuArrow,
|
|
140
|
-
ContextMenuCheckboxItem,
|
|
141
|
-
ContextMenuContent,
|
|
142
|
-
ContextMenuGroup,
|
|
143
|
-
ContextMenuItem,
|
|
144
|
-
ContextMenuLabel,
|
|
145
|
-
ContextMenuRadioGroup,
|
|
146
|
-
ContextMenuRadioItem,
|
|
147
|
-
ContextMenuSeparator,
|
|
148
|
-
ContextMenuShortcut,
|
|
149
|
-
ContextMenuSub,
|
|
150
|
-
ContextMenuSubContent,
|
|
151
|
-
ContextMenuSubTrigger,
|
|
152
|
-
ContextMenuTrigger
|
|
153
|
-
};
|
|
1
|
+
"use client";import{b as r}from"./chunk-JTI7KCLO.mjs";import*as a from"react";import*as e from"@radix-ui/react-context-menu";import{CheckIcon as m,ChevronRightIcon as C,DotFilledIcon as x}from"@radix-ui/react-icons";import{jsx as i,jsxs as p}from"react/jsx-runtime";var I=e.Root,S=e.Trigger,h=e.Group,N=e.Sub,E=e.RadioGroup,d=a.forwardRef(({className:t,inset:o,children:n,...s},u)=>p(e.SubTrigger,{ref:u,className:r("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none",o&&"pl-8",t),...s,children:[n,i(C,{className:"ml-auto size-4"})]}));d.displayName=e.SubTrigger.displayName;var c=a.forwardRef(({className:t,...o},n)=>i(e.Portal,{children:i(e.SubContent,{ref:n,className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",t),...o})}));c.displayName=e.SubContent.displayName;var l=a.forwardRef(({className:t,...o},n)=>i(e.Portal,{children:i(e.Content,{ref:n,className:r("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none",t),...o})}));l.displayName=e.Content.displayName;var f=a.forwardRef(({className:t,inset:o,...n},s)=>i(e.Item,{ref:s,className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",o&&"pl-8",t),...n}));f.displayName=e.Item.displayName;var M=a.forwardRef(({className:t,children:o,checked:n,...s},u)=>p(e.CheckboxItem,{ref:u,className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),checked:n,...s,children:[i("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:i(e.ItemIndicator,{children:i(m,{className:"size-4"})})}),o]}));M.displayName=e.CheckboxItem.displayName;var P=a.forwardRef(({className:t,children:o,...n},s)=>p(e.RadioItem,{ref:s,className:r("focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50",t),...n,children:[i("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:i(e.ItemIndicator,{children:i(x,{className:"size-4 fill-current"})})}),o]}));P.displayName=e.RadioItem.displayName;var y=a.forwardRef(({className:t,inset:o,...n},s)=>i(e.Label,{ref:s,className:r("text-foreground px-2 py-1.5 text-sm font-semibold",o&&"pl-8",t),...n}));y.displayName=e.Label.displayName;var R=a.forwardRef(({className:t,...o},n)=>i(e.Separator,{ref:n,className:r("bg-border -mx-1 my-1 h-px",t),...o}));R.displayName=e.Separator.displayName;function w({className:t,...o}){return i("span",{className:r("text-muted-foreground ml-auto text-xs tracking-widest",t),...o})}var b=a.forwardRef(({className:t,...o},n)=>i(e.Arrow,{ref:n,className:r("fill-popover",t),...o}));b.displayName=e.Arrow.displayName;export{I as ContextMenu,b as ContextMenuArrow,M as ContextMenuCheckboxItem,l as ContextMenuContent,h as ContextMenuGroup,f as ContextMenuItem,y as ContextMenuLabel,E as ContextMenuRadioGroup,P as ContextMenuRadioItem,R as ContextMenuSeparator,w as ContextMenuShortcut,N as ContextMenuSub,c as ContextMenuSubContent,d as ContextMenuSubTrigger,S as ContextMenuTrigger};
|
|
154
2
|
//# sourceMappingURL=context-menu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuTriggerProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Trigger>;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Group>;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioGroup>;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>;\n\ninterface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst ContextMenuSubTrigger = React.forwardRef<ContextMenuSubTriggerElement, ContextMenuSubTriggerProps>(\n ({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\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 select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n ),\n);\n\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof ContextMenuPrimitive.SubContent>;\ntype ContextMenuSubContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;\n\nconst ContextMenuSubContent = React.forwardRef<ContextMenuSubContentElement, ContextMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuContentElement = React.ElementRef<typeof ContextMenuPrimitive.Content>;\ntype ContextMenuContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuItemElement = React.ElementRef<typeof ContextMenuPrimitive.Item>;\n\ninterface ContextMenuItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>;\ntype ContextMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>;\n\nconst ContextMenuCheckboxItem = React.forwardRef<ContextMenuCheckboxItemElement, ContextMenuCheckboxItemProps>(\n ({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n ),\n);\n\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof ContextMenuPrimitive.RadioItem>;\ntype ContextMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>;\n\nconst ContextMenuRadioItem = React.forwardRef<ContextMenuRadioItemElement, ContextMenuRadioItemProps>(\n ({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n ),\n);\n\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuLabelElement = React.ElementRef<typeof ContextMenuPrimitive.Label>;\n\ninterface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n ),\n);\n\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof ContextMenuPrimitive.Separator>;\ntype ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;\n\nconst ContextMenuSeparator = React.forwardRef<ContextMenuSeparatorElement, ContextMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 my-1 h-px\", className)} {...props} />\n ),\n);\n\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuArrowElement = React.ElementRef<typeof ContextMenuPrimitive.Arrow>;\ntype ContextMenuArrowProps = ContextMenuPrimitive.ContextMenuArrowProps;\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow ref={ref} className={cn(\"fill-popover\", className)} {...props} />\n ),\n);\n\nContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n ContextMenuArrow,\n type ContextMenuProps,\n type ContextMenuTriggerProps,\n type ContextMenuContentProps,\n type ContextMenuItemProps,\n type ContextMenuCheckboxItemProps,\n type ContextMenuRadioItemProps,\n type ContextMenuLabelProps,\n type ContextMenuSeparatorProps,\n type ContextMenuShortcutProps,\n type ContextMenuGroupProps,\n type ContextMenuSubProps,\n type ContextMenuSubContentProps,\n type ContextMenuSubTriggerProps,\n type ContextMenuRadioGroupProps,\n type ContextMenuArrowProps,\n};\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuProps = React.ComponentProps<typeof ContextMenuPrimitive.Root>;\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuTriggerProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Trigger>;\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Group>;\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubProps = React.ComponentProps<typeof ContextMenuPrimitive.Sub>;\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioGroupProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioGroup>;\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubTriggerElement = React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>;\n\ninterface ContextMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst ContextMenuSubTrigger = React.forwardRef<ContextMenuSubTriggerElement, ContextMenuSubTriggerProps>(\n ({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\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 select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n ),\n);\n\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSubContentElement = React.ElementRef<typeof ContextMenuPrimitive.SubContent>;\ntype ContextMenuSubContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>;\n\nconst ContextMenuSubContent = React.forwardRef<ContextMenuSubContentElement, ContextMenuSubContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:data-[side=top]:slide-out-to-bottom-2 data-[state=closed]:data-[side=right]:slide-out-to-left-2 data-[state=closed]:data-[side=bottom]:slide-out-to-top-2 data-[state=closed]:data-[side=left]:slide-out-to-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuContentElement = React.ElementRef<typeof ContextMenuPrimitive.Content>;\ntype ContextMenuContentProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>;\n\nconst ContextMenuContent = React.forwardRef<ContextMenuContentElement, ContextMenuContentProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2 z-50 min-w-[8rem] rounded-md border p-1 shadow-md focus:outline-none\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n ),\n);\n\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuItemElement = React.ElementRef<typeof ContextMenuPrimitive.Item>;\n\ninterface ContextMenuItemProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> {\n inset?: boolean;\n}\n\nconst ContextMenuItem = React.forwardRef<ContextMenuItemElement, ContextMenuItemProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n ),\n);\n\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuCheckboxItemElement = React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>;\ntype ContextMenuCheckboxItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>;\n\nconst ContextMenuCheckboxItem = React.forwardRef<ContextMenuCheckboxItemElement, ContextMenuCheckboxItemProps>(\n ({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n ),\n);\n\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuRadioItemElement = React.ElementRef<typeof ContextMenuPrimitive.RadioItem>;\ntype ContextMenuRadioItemProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>;\n\nconst ContextMenuRadioItem = React.forwardRef<ContextMenuRadioItemElement, ContextMenuRadioItemProps>(\n ({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm focus:outline-none aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"size-4 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n ),\n);\n\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuLabelElement = React.ElementRef<typeof ContextMenuPrimitive.Label>;\n\ninterface ContextMenuLabelProps extends React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> {\n inset?: boolean;\n}\n\nconst ContextMenuLabel = React.forwardRef<ContextMenuLabelElement, ContextMenuLabelProps>(\n ({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\"text-foreground px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\n {...props}\n />\n ),\n);\n\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuSeparatorElement = React.ElementRef<typeof ContextMenuPrimitive.Separator>;\ntype ContextMenuSeparatorProps = React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>;\n\nconst ContextMenuSeparator = React.forwardRef<ContextMenuSeparatorElement, ContextMenuSeparatorProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator ref={ref} className={cn(\"bg-border -mx-1 my-1 h-px\", className)} {...props} />\n ),\n);\n\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuShortcutProps = React.HTMLAttributes<HTMLSpanElement>;\n\nfunction ContextMenuShortcut({ className, ...props }: ContextMenuShortcutProps): React.JSX.Element {\n return <span className={cn(\"text-muted-foreground ml-auto text-xs tracking-widest\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\ntype ContextMenuArrowElement = React.ElementRef<typeof ContextMenuPrimitive.Arrow>;\ntype ContextMenuArrowProps = ContextMenuPrimitive.ContextMenuArrowProps;\n\nconst ContextMenuArrow = React.forwardRef<ContextMenuArrowElement, ContextMenuArrowProps>(\n ({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow ref={ref} className={cn(\"fill-popover\", className)} {...props} />\n ),\n);\n\nContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n ContextMenuArrow,\n type ContextMenuProps,\n type ContextMenuTriggerProps,\n type ContextMenuContentProps,\n type ContextMenuItemProps,\n type ContextMenuCheckboxItemProps,\n type ContextMenuRadioItemProps,\n type ContextMenuLabelProps,\n type ContextMenuSeparatorProps,\n type ContextMenuShortcutProps,\n type ContextMenuGroupProps,\n type ContextMenuSubProps,\n type ContextMenuSubContentProps,\n type ContextMenuSubTriggerProps,\n type ContextMenuRadioGroupProps,\n type ContextMenuArrowProps,\n};\n"],"mappings":"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","names":["React","ContextMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","className","inset","children","props","ref","cn","ChevronRightIcon","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","CheckIcon","ContextMenuRadioItem","DotFilledIcon","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut","ContextMenuArrow"]}
|
package/dist/data-table.js
CHANGED
|
@@ -1,236 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkBA3XYBWRjs = require('./chunk-BA3XYBWR.js');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var _chunk3ZZ3SRTJjs = require('./chunk-3ZZ3SRTJ.js');
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _chunkTFYKPLNVjs = require('./chunk-TFYKPLNV.js');
|
|
21
|
-
require('./chunk-Y3DZHPJ5.js');
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
|
|
25
|
-
|
|
26
|
-
// src/data-table.tsx
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var _reacticons = require('@radix-ui/react-icons');
|
|
38
|
-
var _jsxruntime = require('react/jsx-runtime');
|
|
39
|
-
function DataTableViewOptions({ table }) {
|
|
40
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenu, { children: [
|
|
41
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkTFYKPLNVjs.Button, { variant: "outline", size: "sm", className: "ml-auto hidden h-8 lg:flex", children: [
|
|
42
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon, { className: "mr-2 size-4" }),
|
|
43
|
-
"View"
|
|
44
|
-
] }) }),
|
|
45
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuContent, { align: "end", className: "w-36", children: [
|
|
46
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuLabel, { children: "Toggle columns" }),
|
|
47
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuSeparator, {}),
|
|
48
|
-
table.getAllColumns().filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide()).map((column) => {
|
|
49
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
50
|
-
_chunk3ZZ3SRTJjs.DropdownMenuCheckboxItem,
|
|
51
|
-
{
|
|
52
|
-
className: "capitalize",
|
|
53
|
-
checked: column.getIsVisible(),
|
|
54
|
-
onCheckedChange: (value) => {
|
|
55
|
-
column.toggleVisibility(Boolean(value));
|
|
56
|
-
},
|
|
57
|
-
children: column.id
|
|
58
|
-
},
|
|
59
|
-
column.id
|
|
60
|
-
);
|
|
61
|
-
})
|
|
62
|
-
] })
|
|
63
|
-
] });
|
|
64
|
-
}
|
|
65
|
-
function DataTablePagination({
|
|
66
|
-
table,
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}) {
|
|
70
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center justify-between px-2", className), ...props, children: [
|
|
71
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "text-muted-foreground flex-1 text-sm", children: [
|
|
72
|
-
table.getFilteredSelectedRowModel().rows.length,
|
|
73
|
-
" of ",
|
|
74
|
-
table.getFilteredRowModel().rows.length,
|
|
75
|
-
" row(s) selected."
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center space-x-6 lg:space-x-8", children: [
|
|
78
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center space-x-2", children: [
|
|
79
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-medium", children: "Rows per page" }),
|
|
80
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
81
|
-
_chunkBA3XYBWRjs.Select,
|
|
82
|
-
{
|
|
83
|
-
value: String(table.getState().pagination.pageSize),
|
|
84
|
-
onValueChange: (value) => {
|
|
85
|
-
table.setPageSize(Number(value));
|
|
86
|
-
},
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectTrigger, { className: "h-8 w-16", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectValue, { placeholder: table.getState().pagination.pageSize }) }),
|
|
89
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBA3XYBWRjs.SelectItem, { value: String(pageSize), children: pageSize }, pageSize)) })
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
] }),
|
|
94
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex w-28 items-center justify-center text-sm font-medium", children: [
|
|
95
|
-
"Page ",
|
|
96
|
-
table.getState().pagination.pageIndex + 1,
|
|
97
|
-
" of ",
|
|
98
|
-
table.getPageCount()
|
|
99
|
-
] }),
|
|
100
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center space-x-2", children: [
|
|
101
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
102
|
-
_chunkTFYKPLNVjs.Button,
|
|
103
|
-
{
|
|
104
|
-
variant: "outline",
|
|
105
|
-
size: "icon-xs",
|
|
106
|
-
className: "hidden lg:flex",
|
|
107
|
-
onClick: () => {
|
|
108
|
-
table.setPageIndex(0);
|
|
109
|
-
},
|
|
110
|
-
disabled: !table.getCanPreviousPage(),
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: "Go to first page" }),
|
|
113
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowLeftIcon, { className: "size-4" })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
),
|
|
117
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
118
|
-
_chunkTFYKPLNVjs.Button,
|
|
119
|
-
{
|
|
120
|
-
variant: "outline",
|
|
121
|
-
size: "icon-xs",
|
|
122
|
-
onClick: () => {
|
|
123
|
-
table.previousPage();
|
|
124
|
-
},
|
|
125
|
-
disabled: !table.getCanPreviousPage(),
|
|
126
|
-
children: [
|
|
127
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: "Go to previous page" }),
|
|
128
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon, { className: "size-4" })
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
),
|
|
132
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
133
|
-
_chunkTFYKPLNVjs.Button,
|
|
134
|
-
{
|
|
135
|
-
variant: "outline",
|
|
136
|
-
size: "icon-xs",
|
|
137
|
-
onClick: () => {
|
|
138
|
-
table.nextPage();
|
|
139
|
-
},
|
|
140
|
-
disabled: !table.getCanNextPage(),
|
|
141
|
-
children: [
|
|
142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: "Go to next page" }),
|
|
143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon, { className: "size-4" })
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
148
|
-
_chunkTFYKPLNVjs.Button,
|
|
149
|
-
{
|
|
150
|
-
variant: "outline",
|
|
151
|
-
size: "icon-xs",
|
|
152
|
-
className: "hidden lg:flex",
|
|
153
|
-
onClick: () => {
|
|
154
|
-
table.setPageIndex(table.getPageCount() - 1);
|
|
155
|
-
},
|
|
156
|
-
disabled: !table.getCanNextPage(),
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: "Go to last page" }),
|
|
159
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowRightIcon, { className: "size-4" })
|
|
160
|
-
]
|
|
161
|
-
}
|
|
162
|
-
)
|
|
163
|
-
] })
|
|
164
|
-
] })
|
|
165
|
-
] });
|
|
166
|
-
}
|
|
167
|
-
function DataTableColumnHeader({
|
|
168
|
-
column,
|
|
169
|
-
title,
|
|
170
|
-
className
|
|
171
|
-
}) {
|
|
172
|
-
if (!column.getCanSort()) {
|
|
173
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className, children: title });
|
|
174
|
-
}
|
|
175
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "flex items-center space-x-2", className), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenu, { children: [
|
|
176
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkTFYKPLNVjs.Button, { variant: "ghost", size: "xs", className: "data-[state=open]:bg-accent -ml-3", children: [
|
|
177
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: title }),
|
|
178
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, SortIcon, { sorted: column.getIsSorted() })
|
|
179
|
-
] }) }),
|
|
180
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuContent, { align: "start", children: [
|
|
181
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
182
|
-
_chunk3ZZ3SRTJjs.DropdownMenuItem,
|
|
183
|
-
{
|
|
184
|
-
onClick: () => {
|
|
185
|
-
column.toggleSorting(false);
|
|
186
|
-
},
|
|
187
|
-
children: [
|
|
188
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon, { className: "text-muted-foreground/70 mr-2 size-3.5" }),
|
|
189
|
-
"Asc"
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
194
|
-
_chunk3ZZ3SRTJjs.DropdownMenuItem,
|
|
195
|
-
{
|
|
196
|
-
onClick: () => {
|
|
197
|
-
column.toggleSorting(true);
|
|
198
|
-
},
|
|
199
|
-
children: [
|
|
200
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon, { className: "text-muted-foreground/70 mr-2 size-3.5" }),
|
|
201
|
-
"Desc"
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3ZZ3SRTJjs.DropdownMenuSeparator, {}),
|
|
206
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
207
|
-
_chunk3ZZ3SRTJjs.DropdownMenuItem,
|
|
208
|
-
{
|
|
209
|
-
onClick: () => {
|
|
210
|
-
column.toggleVisibility(false);
|
|
211
|
-
},
|
|
212
|
-
children: [
|
|
213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon, { className: "text-muted-foreground/70 mr-2 size-3.5" }),
|
|
214
|
-
"Hide"
|
|
215
|
-
]
|
|
216
|
-
}
|
|
217
|
-
)
|
|
218
|
-
] })
|
|
219
|
-
] }) });
|
|
220
|
-
}
|
|
221
|
-
function SortIcon({ sorted }) {
|
|
222
|
-
switch (sorted) {
|
|
223
|
-
case "desc":
|
|
224
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon, { className: "ml-2 size-4" });
|
|
225
|
-
case "asc":
|
|
226
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon, { className: "ml-2 size-4" });
|
|
227
|
-
default:
|
|
228
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon, { className: "ml-2 size-4" });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
exports.DataTableColumnHeader = DataTableColumnHeader; exports.DataTablePagination = DataTablePagination; exports.DataTableViewOptions = DataTableViewOptions;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkJ5EXNAHZjs = require('./chunk-J5EXNAHZ.js');var _chunkKICZFOKEjs = require('./chunk-KICZFOKE.js');var _chunkXPJZ6WQMjs = require('./chunk-XPJZ6WQM.js');require('./chunk-JVGHOCS7.js');var _chunkQZCQ42BPjs = require('./chunk-QZCQ42BP.js');var _reacticons = require('@radix-ui/react-icons');var _jsxruntime = require('react/jsx-runtime');function A({table:a}){return _jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"outline",size:"sm",className:"ml-auto hidden h-8 lg:flex",children:[_jsxruntime.jsx.call(void 0, _reacticons.MixerHorizontalIcon,{className:"mr-2 size-4"}),"View"]})}),_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.h,{align:"end",className:"w-36",children:[_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.l,{children:"Toggle columns"}),_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.m,{}),a.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.j,{className:"capitalize",checked:n.getIsVisible(),onCheckedChange:s=>{n.toggleVisibility(!!s)},children:n.id},n.id))]})]})}function B({table:a,className:n,...s}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkQZCQ42BPjs.b.call(void 0, "flex items-center justify-between px-2",n),...s,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"text-muted-foreground flex-1 text-sm",children:[a.getFilteredSelectedRowModel().rows.length," of ",a.getFilteredRowModel().rows.length," row(s) selected."]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-6 lg:space-x-8",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:"Rows per page"}),_jsxruntime.jsxs.call(void 0, _chunkJ5EXNAHZjs.a,{value:String(a.getState().pagination.pageSize),onValueChange:i=>{a.setPageSize(Number(i))},children:[_jsxruntime.jsx.call(void 0, _chunkJ5EXNAHZjs.d,{className:"h-8 w-16",children:_jsxruntime.jsx.call(void 0, _chunkJ5EXNAHZjs.c,{placeholder:a.getState().pagination.pageSize})}),_jsxruntime.jsx.call(void 0, _chunkJ5EXNAHZjs.g,{side:"top",children:[10,20,30,40,50].map(i=>_jsxruntime.jsx.call(void 0, _chunkJ5EXNAHZjs.i,{value:String(i),children:i},i))})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-28 items-center justify-center text-sm font-medium",children:["Page ",a.getState().pagination.pageIndex+1," of ",a.getPageCount()]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(0)},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to first page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.previousPage()},disabled:!a.getCanPreviousPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to previous page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"outline",size:"icon-xs",onClick:()=>{a.nextPage()},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to next page"}),_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"size-4"})]}),_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"outline",size:"icon-xs",className:"hidden lg:flex",onClick:()=>{a.setPageIndex(a.getPageCount()-1)},disabled:!a.getCanNextPage(),children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Go to last page"}),_jsxruntime.jsx.call(void 0, _reacticons.DoubleArrowRightIcon,{className:"size-4"})]})]})]})]})}function L({column:a,title:n,className:s}){return a.getCanSort()?_jsxruntime.jsx.call(void 0, "div",{className:_chunkQZCQ42BPjs.b.call(void 0, "flex items-center space-x-2",s),children:_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkXPJZ6WQMjs.b,{variant:"ghost",size:"xs",className:"data-[state=open]:bg-accent -ml-3",children:[_jsxruntime.jsx.call(void 0, "span",{children:n}),_jsxruntime.jsx.call(void 0, z,{sorted:a.getIsSorted()})]})}),_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.h,{align:"start",children:[_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.i,{onClick:()=>{a.toggleSorting(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Asc"]}),_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.i,{onClick:()=>{a.toggleSorting(!0)},children:[_jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Desc"]}),_jsxruntime.jsx.call(void 0, _chunkKICZFOKEjs.m,{}),_jsxruntime.jsxs.call(void 0, _chunkKICZFOKEjs.i,{onClick:()=>{a.toggleVisibility(!1)},children:[_jsxruntime.jsx.call(void 0, _reacticons.EyeNoneIcon,{className:"text-muted-foreground/70 mr-2 size-3.5"}),"Hide"]})]})]})}):_jsxruntime.jsx.call(void 0, "div",{className:s,children:n})}function z({sorted:a}){switch(a){case"desc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowDownIcon,{className:"ml-2 size-4"});case"asc":return _jsxruntime.jsx.call(void 0, _reacticons.ArrowUpIcon,{className:"ml-2 size-4"});default:return _jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{className:"ml-2 size-4"})}}exports.DataTableColumnHeader = L; exports.DataTablePagination = B; exports.DataTableViewOptions = A;
|
|
236
2
|
//# sourceMappingURL=data-table.js.map
|