@codefast/ui 0.0.4 → 0.0.6
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 +52 -1
- package/dist/accordion.js.map +1 -1
- package/dist/accordion.mjs +52 -1
- package/dist/accordion.mjs.map +1 -1
- package/dist/alert-dialog.d.mts +1 -3
- package/dist/alert-dialog.d.ts +1 -3
- package/dist/alert-dialog.js +106 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert-dialog.mjs +106 -1
- package/dist/alert-dialog.mjs.map +1 -1
- package/dist/alert.js +54 -1
- package/dist/alert.js.map +1 -1
- package/dist/alert.mjs +54 -1
- package/dist/alert.mjs.map +1 -1
- package/dist/aspect-ratio.js +8 -1
- package/dist/aspect-ratio.js.map +1 -1
- package/dist/aspect-ratio.mjs +8 -1
- package/dist/aspect-ratio.mjs.map +1 -1
- package/dist/avatar.js +47 -1
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.mjs +47 -1
- package/dist/avatar.mjs.map +1 -1
- package/dist/badge.js +30 -1
- package/dist/badge.js.map +1 -1
- package/dist/badge.mjs +30 -1
- package/dist/badge.mjs.map +1 -1
- package/dist/breadcrumb.js +99 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/breadcrumb.mjs +99 -1
- package/dist/breadcrumb.mjs.map +1 -1
- package/dist/button.d.mts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +9 -1
- package/dist/button.mjs +9 -1
- package/dist/calendar.js +82 -1
- package/dist/calendar.js.map +1 -1
- package/dist/calendar.mjs +82 -1
- package/dist/calendar.mjs.map +1 -1
- package/dist/card.js +66 -1
- package/dist/card.js.map +1 -1
- package/dist/card.mjs +66 -1
- package/dist/card.mjs.map +1 -1
- package/dist/carousel.js +193 -1
- package/dist/carousel.js.map +1 -1
- package/dist/carousel.mjs +193 -1
- package/dist/carousel.mjs.map +1 -1
- package/dist/checkbox.js +26 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.mjs +26 -1
- package/dist/checkbox.mjs.map +1 -1
- package/dist/chunk-4K26QLS2.js +52 -0
- package/dist/chunk-4K26QLS2.js.map +1 -0
- package/dist/chunk-5GHZ6EXI.js +41 -0
- package/dist/chunk-5GHZ6EXI.js.map +1 -0
- package/dist/chunk-EIHWTXQ4.mjs +112 -0
- package/dist/chunk-EIHWTXQ4.mjs.map +1 -0
- package/dist/chunk-G3NP7M2N.js +19 -0
- package/dist/chunk-G3NP7M2N.js.map +1 -0
- package/dist/chunk-LDYBRDAY.js +112 -0
- package/dist/chunk-LDYBRDAY.js.map +1 -0
- package/dist/chunk-PTD4AMHI.mjs +25 -0
- package/dist/{chunk-76AASLTX.mjs.map → chunk-PTD4AMHI.mjs.map} +1 -1
- package/dist/chunk-RTKEO347.js +25 -0
- package/dist/chunk-RTKEO347.js.map +1 -0
- package/dist/chunk-T52N6ZBP.mjs +41 -0
- package/dist/chunk-T52N6ZBP.mjs.map +1 -0
- package/dist/chunk-UG3URV2Z.mjs +19 -0
- package/dist/chunk-UG3URV2Z.mjs.map +1 -0
- package/dist/chunk-Z524G4RY.mjs +52 -0
- package/dist/chunk-Z524G4RY.mjs.map +1 -0
- package/dist/collapsible.js +12 -1
- package/dist/collapsible.js.map +1 -1
- package/dist/collapsible.mjs +12 -1
- package/dist/collapsible.mjs.map +1 -1
- package/dist/command.js +131 -1
- package/dist/command.js.map +1 -1
- package/dist/command.mjs +131 -1
- package/dist/command.mjs.map +1 -1
- package/dist/context-menu.d.mts +2 -2
- package/dist/context-menu.d.ts +2 -2
- package/dist/context-menu.js +169 -1
- package/dist/context-menu.js.map +1 -1
- package/dist/context-menu.mjs +169 -1
- package/dist/context-menu.mjs.map +1 -1
- package/dist/dialog.d.mts +1 -3
- package/dist/dialog.d.ts +1 -3
- package/dist/dialog.js +22 -1
- package/dist/dialog.mjs +22 -1
- package/dist/drawer.d.mts +1 -3
- package/dist/drawer.d.ts +1 -3
- package/dist/drawer.js +97 -1
- package/dist/drawer.js.map +1 -1
- package/dist/drawer.mjs +97 -1
- package/dist/drawer.mjs.map +1 -1
- package/dist/dropdown-menu.d.mts +1 -2
- package/dist/dropdown-menu.d.ts +1 -2
- package/dist/dropdown-menu.js +157 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/dropdown-menu.mjs +157 -1
- package/dist/dropdown-menu.mjs.map +1 -1
- package/dist/form.js +117 -1
- package/dist/form.js.map +1 -1
- package/dist/form.mjs +117 -1
- package/dist/form.mjs.map +1 -1
- package/dist/hover-card.js +30 -1
- package/dist/hover-card.js.map +1 -1
- package/dist/hover-card.mjs +30 -1
- package/dist/hover-card.mjs.map +1 -1
- package/dist/input-otp.js +59 -1
- package/dist/input-otp.js.map +1 -1
- package/dist/input-otp.mjs +59 -1
- package/dist/input-otp.mjs.map +1 -1
- package/dist/input.js +25 -1
- package/dist/input.js.map +1 -1
- package/dist/input.mjs +25 -1
- package/dist/input.mjs.map +1 -1
- package/dist/label.js +8 -1
- package/dist/label.mjs +8 -1
- package/dist/menubar.d.mts +1 -2
- package/dist/menubar.d.ts +1 -2
- package/dist/menubar.js +188 -1
- package/dist/menubar.js.map +1 -1
- package/dist/menubar.mjs +188 -1
- package/dist/menubar.mjs.map +1 -1
- package/dist/navigation-menu.js +124 -1
- package/dist/navigation-menu.js.map +1 -1
- package/dist/navigation-menu.mjs +124 -1
- package/dist/navigation-menu.mjs.map +1 -1
- package/dist/pagination.js +123 -1
- package/dist/pagination.js.map +1 -1
- package/dist/pagination.mjs +123 -1
- package/dist/pagination.mjs.map +1 -1
- package/dist/popover.d.mts +2 -1
- package/dist/popover.d.ts +2 -1
- package/dist/popover.js +42 -1
- package/dist/popover.js.map +1 -1
- package/dist/popover.mjs +42 -1
- package/dist/popover.mjs.map +1 -1
- package/dist/progress.js +33 -1
- package/dist/progress.js.map +1 -1
- package/dist/progress.mjs +33 -1
- package/dist/progress.mjs.map +1 -1
- package/dist/radio-group.js +46 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.mjs +46 -1
- package/dist/radio-group.mjs.map +1 -1
- package/dist/resizable.js +47 -1
- package/dist/resizable.js.map +1 -1
- package/dist/resizable.mjs +47 -1
- package/dist/resizable.mjs.map +1 -1
- package/dist/scroll-area.js +44 -1
- package/dist/scroll-area.js.map +1 -1
- package/dist/scroll-area.mjs +44 -1
- package/dist/scroll-area.mjs.map +1 -1
- package/dist/select.js +134 -1
- package/dist/select.js.map +1 -1
- package/dist/select.mjs +134 -1
- package/dist/select.mjs.map +1 -1
- package/dist/separator.js +29 -1
- package/dist/separator.js.map +1 -1
- package/dist/separator.mjs +29 -1
- package/dist/separator.mjs.map +1 -1
- package/dist/sheet.d.mts +1 -3
- package/dist/sheet.d.ts +1 -3
- package/dist/sheet.js +121 -1
- package/dist/sheet.js.map +1 -1
- package/dist/sheet.mjs +121 -1
- package/dist/sheet.mjs.map +1 -1
- package/dist/skeleton.js +21 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/skeleton.mjs +21 -1
- package/dist/skeleton.mjs.map +1 -1
- package/dist/slider.js +28 -1
- package/dist/slider.js.map +1 -1
- package/dist/slider.mjs +28 -1
- package/dist/slider.mjs.map +1 -1
- package/dist/sonner.js +34 -1
- package/dist/sonner.js.map +1 -1
- package/dist/sonner.mjs +34 -1
- package/dist/sonner.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/switch.js +25 -1
- package/dist/switch.js.map +1 -1
- package/dist/switch.mjs +25 -1
- package/dist/switch.mjs.map +1 -1
- package/dist/table.js +94 -1
- package/dist/table.js.map +1 -1
- package/dist/table.mjs +94 -1
- package/dist/table.mjs.map +1 -1
- package/dist/tabs.js +52 -1
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.mjs +52 -1
- package/dist/tabs.mjs.map +1 -1
- package/dist/textarea.js +24 -1
- package/dist/textarea.js.map +1 -1
- package/dist/textarea.mjs +24 -1
- package/dist/textarea.mjs.map +1 -1
- package/dist/toggle-group.js +49 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle-group.mjs +49 -1
- package/dist/toggle-group.mjs.map +1 -1
- package/dist/toggle.d.mts +1 -1
- package/dist/toggle.d.ts +1 -1
- package/dist/toggle.js +10 -1
- package/dist/toggle.mjs +10 -1
- package/dist/tooltip.d.mts +2 -3
- package/dist/tooltip.d.ts +2 -3
- package/dist/tooltip.js +41 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.mjs +41 -1
- package/dist/tooltip.mjs.map +1 -1
- package/dist/utils.js +10 -1
- package/dist/utils.mjs +10 -1
- package/package.json +6 -6
- package/src/accordion.tsx +2 -6
- package/src/alert-dialog.tsx +4 -35
- package/src/alert.tsx +1 -1
- package/src/avatar.tsx +1 -1
- package/src/badge.tsx +1 -1
- package/src/breadcrumb.tsx +1 -1
- package/src/button.tsx +5 -5
- package/src/calendar.tsx +6 -7
- package/src/card.tsx +1 -1
- package/src/checkbox.tsx +1 -2
- package/src/command.tsx +6 -17
- package/src/context-menu.tsx +32 -44
- package/src/dialog.tsx +9 -37
- package/src/drawer.tsx +3 -27
- package/src/dropdown-menu.tsx +15 -44
- package/src/form.tsx +0 -1
- package/src/hover-card.tsx +12 -20
- package/src/input-otp.tsx +2 -2
- package/src/input.tsx +1 -1
- package/src/menubar.tsx +17 -42
- package/src/navigation-menu.tsx +6 -19
- package/src/pagination.tsx +2 -4
- package/src/popover.tsx +18 -12
- package/src/progress.tsx +3 -1
- package/src/radio-group.tsx +6 -4
- package/src/resizable.tsx +2 -5
- package/src/select.tsx +13 -22
- package/src/sheet.tsx +15 -59
- package/src/slider.tsx +1 -1
- package/src/sonner.tsx +4 -2
- package/src/switch.tsx +2 -8
- package/src/table.tsx +2 -2
- package/src/tabs.tsx +3 -4
- package/src/textarea.tsx +1 -1
- package/src/toggle.tsx +4 -7
- package/src/tooltip.tsx +23 -34
- package/dist/chunk-4ZL55G6C.js +0 -2
- package/dist/chunk-4ZL55G6C.js.map +0 -1
- package/dist/chunk-76AASLTX.mjs +0 -2
- package/dist/chunk-7UVSBFQU.js +0 -2
- package/dist/chunk-7UVSBFQU.js.map +0 -1
- package/dist/chunk-BP7PEVLB.js +0 -2
- package/dist/chunk-BP7PEVLB.js.map +0 -1
- package/dist/chunk-BPCLLQ62.mjs +0 -2
- package/dist/chunk-BPCLLQ62.mjs.map +0 -1
- package/dist/chunk-CAGY2ZSE.js +0 -2
- package/dist/chunk-CAGY2ZSE.js.map +0 -1
- package/dist/chunk-JTI7KCLO.mjs +0 -2
- package/dist/chunk-JTI7KCLO.mjs.map +0 -1
- package/dist/chunk-QZCQ42BP.js +0 -2
- package/dist/chunk-QZCQ42BP.js.map +0 -1
- package/dist/chunk-WZ4XIF6U.mjs +0 -2
- package/dist/chunk-WZ4XIF6U.mjs.map +0 -1
- package/dist/chunk-YQJHVJVX.mjs +0 -2
- package/dist/chunk-YQJHVJVX.mjs.map +0 -1
package/dist/context-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context-menu.tsx"],"names":["React","ContextMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","className","inset","children","props","ref","cn","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","ContextMenuRadioItem","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":"qDAEA,UAAYA,MAAW,QACvB,UAAYC,MAA0B,+BACtC,OACE,aAAAC,EACA,oBAAAC,EACA,iBAAAC,MACK,wBAiDL,OAWE,OAAAC,EAXF,QAAAC,MAAA,oBA1CF,IAAMC,EAAmC,OAMnCC,EAA0C,UAM1CC,EAAwC,QAMxCC,EAAyC,SAMzCC,EAAsC,MAMtCC,EAA6C,aAM7CC,EAA8B,aAKlC,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAA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EAACH,EAAA,CAAU,UAAU,SAAS,EAChC,EACF,EACCc,GACH,CACD,EACDO,EAAwB,YACD,eAAa,YAMpC,IAAME,EAA6B,aAGjC,CAAC,CAAE,UAAAX,EAAW,SAAAE,EAAU,GAAGC,CAAM,EAAGC,IACpCZ,EAAsB,YAArB,CACC,IAAKY,EACL,UAAWC,EACT,sJACA,6DACAL,CACF,EACC,GAAGG,EAEJ,UAAAZ,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAsB,gBAArB,CACC,SAAAA,EAACD,EAAA,CAAc,UAAU,sBAAsB,EACjD,EACF,EACCY,GACH,CACD,EACDS,EAAqB,YAAmC,YAAU,YAMlE,IAAMC,EAAyB,aAK7B,CAAC,CAAE,UAAAZ,EAAW,MAAAC,EAAO,GAAGE,CAAM,EAAGC,IACjCb,EAAsB,QAArB,CACC,IAAKa,EACL,UAAWC,EACT,oDACAJ,GAAS,OACTD,CACF,EACC,GAAGG,EACN,CACD,EACDS,EAAiB,YAAmC,QAAM,YAM1D,IAAMC,EAA6B,aAGjC,CAAC,CAAE,UAAAb,EAAW,GAAGG,CAAM,EAAGC,IAC1Bb,EAAsB,YAArB,CACC,IAAKa,EACL,UAAWC,EAAG,4BAA6BL,CAAS,EACnD,GAAGG,EACN,CACD,EACDU,EAAqB,YAAmC,YAAU,YAMlE,SAASC,EAAoB,CAC3B,UAAAd,EACA,GAAGG,CACL,EAA6D,CAC3D,OACEZ,EAAC,QACC,UAAWc,EACT,wDACAL,CACF,EACC,GAAGG,EACN,CAEJ","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuPortal\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ContextMenuPrimitive.ContextMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none\",\n \"data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ContextMenuPrimitive.ContextMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=open]:data-[side=top]:slide-in-from-bottom-2\",\n \"data-[state=open]:data-[side=right]:slide-in-from-left-2\",\n \"data-[state=open]:data-[side=bottom]:slide-in-from-top-2\",\n \"data-[state=open]:data-[side=left]:slide-in-from-right-2\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[state=closed]:data-[side=top]:slide-out-to-bottom-2\",\n \"data-[state=closed]:data-[side=right]:slide-out-to-left-2\",\n \"data-[state=closed]:data-[side=bottom]:slide-out-to-top-2\",\n \"data-[state=closed]:data-[side=left]:slide-out-to-right-2\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n ContextMenuPrimitive.ContextMenuContentProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=open]:data-[side=top]:slide-in-from-bottom-2\",\n \"data-[state=open]:data-[side=right]:slide-in-from-left-2\",\n \"data-[state=open]:data-[side=bottom]:slide-in-from-top-2\",\n \"data-[state=open]:data-[side=left]:slide-in-from-right-2\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[state=closed]:data-[side=top]:slide-out-to-bottom-2\",\n \"data-[state=closed]:data-[side=right]:slide-out-to-left-2\",\n \"data-[state=closed]:data-[side=bottom]:slide-out-to-top-2\",\n \"data-[state=closed]:data-[side=left]:slide-out-to-right-2\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n ContextMenuPrimitive.ContextMenuItemProps & {\n inset?: boolean;\n }\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 outline-none\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ContextMenuPrimitive.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 outline-none\",\n \"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));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ContextMenuPrimitive.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 outline-none\",\n \"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));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n ContextMenuPrimitive.ContextMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n ContextMenuPrimitive.ContextMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\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 ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/context-menu.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,0BAA0B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA2CL,SAUE,KAVF;AApCF,IAAM,cAAmC;AAMzC,IAAM,qBAA0C;AAMhD,IAAM,mBAAwC;AAM9C,IAAM,iBAAsC;AAM5C,IAAM,wBAA6C;AAMnD,IAAM,wBAA8B,iBAKlC,CAAC,EAAE,WAAW,OAAO,UAAU,GAAG,MAAM,GAAG,QAC3C;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEH;AAAA;AAAA,MACD,oBAAC,oBAAiB,WAAU,kBAAiB;AAAA;AAAA;AAC/C,CACD;AACD,sBAAsB,cAAmC,gCAAW;AAMpE,IAAM,wBAA8B,iBAGlC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,oBAAsB,6BAArB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,oCAArB,EACC,8BAAC,iBAAc,WAAU,uBAAsB,GACjD,GACF;AAAA,MACC;AAAA;AAAA;AACH,CACD;AACD,qBAAqB,cAAmC,+BAAU;AAMlE,IAAM,mBAAyB,iBAK7B,CAAC,EAAE,WAAW,OAAO,GAAG,MAAM,GAAG,QACjC;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,SAAS;AAAA,MACT;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAmC,2BAAM;AAM1D,IAAM,uBAA6B,iBAGjC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,6BAA6B,SAAS;AAAA,IACnD,GAAG;AAAA;AACN,CACD;AACD,qBAAqB,cAAmC,+BAAU;AAMlE,SAAS,oBAAoB;AAAA,EAC3B;AAAA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,mBAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gBAAgB,SAAS;AAAA,IACtC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAmC,2BAAM","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ContextMenuPrimitive.ContextMenuSubTriggerProps & {\n inset?: boolean;\n }\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));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ContextMenuPrimitive.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));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n ContextMenuPrimitive.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));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n ContextMenuPrimitive.ContextMenuItemProps & {\n inset?: boolean;\n }\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));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ContextMenuPrimitive.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));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ContextMenuPrimitive.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));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n ContextMenuPrimitive.ContextMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n ContextMenuPrimitive.ContextMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuArrow = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Arrow>,\n ContextMenuPrimitive.ContextMenuArrowProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow\n ref={ref}\n className={cn(\"fill-popover\", className)}\n {...props}\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};\n"]}
|
package/dist/context-menu.mjs
CHANGED
|
@@ -1,2 +1,170 @@
|
|
|
1
|
-
"use client";
|
|
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 {
|
|
10
|
+
CheckIcon,
|
|
11
|
+
ChevronRightIcon,
|
|
12
|
+
DotFilledIcon
|
|
13
|
+
} from "@radix-ui/react-icons";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var ContextMenu = ContextMenuPrimitive.Root;
|
|
16
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
17
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
18
|
+
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
19
|
+
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
20
|
+
var ContextMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
21
|
+
ContextMenuPrimitive.SubTrigger,
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: cn(
|
|
25
|
+
"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",
|
|
26
|
+
inset && "pl-8",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props,
|
|
30
|
+
children: [
|
|
31
|
+
children,
|
|
32
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
));
|
|
36
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
37
|
+
var ContextMenuSubContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
38
|
+
ContextMenuPrimitive.SubContent,
|
|
39
|
+
{
|
|
40
|
+
ref,
|
|
41
|
+
className: cn(
|
|
42
|
+
"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",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props
|
|
46
|
+
}
|
|
47
|
+
) }));
|
|
48
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
49
|
+
var ContextMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
50
|
+
ContextMenuPrimitive.Content,
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
className: cn(
|
|
54
|
+
"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",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
) }));
|
|
60
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
61
|
+
var ContextMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
+
ContextMenuPrimitive.Item,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
className: cn(
|
|
66
|
+
"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",
|
|
67
|
+
inset && "pl-8",
|
|
68
|
+
className
|
|
69
|
+
),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
));
|
|
73
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
74
|
+
var ContextMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
75
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
76
|
+
{
|
|
77
|
+
ref,
|
|
78
|
+
className: cn(
|
|
79
|
+
"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",
|
|
80
|
+
className
|
|
81
|
+
),
|
|
82
|
+
checked,
|
|
83
|
+
...props,
|
|
84
|
+
children: [
|
|
85
|
+
/* @__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" }) }) }),
|
|
86
|
+
children
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
91
|
+
var ContextMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
92
|
+
ContextMenuPrimitive.RadioItem,
|
|
93
|
+
{
|
|
94
|
+
ref,
|
|
95
|
+
className: cn(
|
|
96
|
+
"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",
|
|
97
|
+
className
|
|
98
|
+
),
|
|
99
|
+
...props,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__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" }) }) }),
|
|
102
|
+
children
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
));
|
|
106
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
107
|
+
var ContextMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
108
|
+
ContextMenuPrimitive.Label,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
className: cn(
|
|
112
|
+
"text-foreground px-2 py-1.5 text-sm font-semibold",
|
|
113
|
+
inset && "pl-8",
|
|
114
|
+
className
|
|
115
|
+
),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
120
|
+
var ContextMenuSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
121
|
+
ContextMenuPrimitive.Separator,
|
|
122
|
+
{
|
|
123
|
+
ref,
|
|
124
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
125
|
+
...props
|
|
126
|
+
}
|
|
127
|
+
));
|
|
128
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
129
|
+
function ContextMenuShortcut({
|
|
130
|
+
className,
|
|
131
|
+
...props
|
|
132
|
+
}) {
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
"span",
|
|
135
|
+
{
|
|
136
|
+
className: cn(
|
|
137
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
138
|
+
className
|
|
139
|
+
),
|
|
140
|
+
...props
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
var ContextMenuArrow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
145
|
+
ContextMenuPrimitive.Arrow,
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
className: cn("fill-popover", className),
|
|
149
|
+
...props
|
|
150
|
+
}
|
|
151
|
+
));
|
|
152
|
+
ContextMenuArrow.displayName = ContextMenuPrimitive.Arrow.displayName;
|
|
153
|
+
export {
|
|
154
|
+
ContextMenu,
|
|
155
|
+
ContextMenuArrow,
|
|
156
|
+
ContextMenuCheckboxItem,
|
|
157
|
+
ContextMenuContent,
|
|
158
|
+
ContextMenuGroup,
|
|
159
|
+
ContextMenuItem,
|
|
160
|
+
ContextMenuLabel,
|
|
161
|
+
ContextMenuRadioGroup,
|
|
162
|
+
ContextMenuRadioItem,
|
|
163
|
+
ContextMenuSeparator,
|
|
164
|
+
ContextMenuShortcut,
|
|
165
|
+
ContextMenuSub,
|
|
166
|
+
ContextMenuSubContent,
|
|
167
|
+
ContextMenuSubTrigger,
|
|
168
|
+
ContextMenuTrigger
|
|
169
|
+
};
|
|
2
170
|
//# 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 {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuPortal\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ContextMenuPrimitive.ContextMenuSubTriggerProps & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none\",\n \"data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ContextMenuPrimitive.ContextMenuSubContentProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=open]:data-[side=top]:slide-in-from-bottom-2\",\n \"data-[state=open]:data-[side=right]:slide-in-from-left-2\",\n \"data-[state=open]:data-[side=bottom]:slide-in-from-top-2\",\n \"data-[state=open]:data-[side=left]:slide-in-from-right-2\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[state=closed]:data-[side=top]:slide-out-to-bottom-2\",\n \"data-[state=closed]:data-[side=right]:slide-out-to-left-2\",\n \"data-[state=closed]:data-[side=bottom]:slide-out-to-top-2\",\n \"data-[state=closed]:data-[side=left]:slide-out-to-right-2\",\n className,\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n ContextMenuPrimitive.ContextMenuContentProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md\",\n \"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n \"data-[state=open]:data-[side=top]:slide-in-from-bottom-2\",\n \"data-[state=open]:data-[side=right]:slide-in-from-left-2\",\n \"data-[state=open]:data-[side=bottom]:slide-in-from-top-2\",\n \"data-[state=open]:data-[side=left]:slide-in-from-right-2\",\n \"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95\",\n \"data-[state=closed]:data-[side=top]:slide-out-to-bottom-2\",\n \"data-[state=closed]:data-[side=right]:slide-out-to-left-2\",\n \"data-[state=closed]:data-[side=bottom]:slide-out-to-top-2\",\n \"data-[state=closed]:data-[side=left]:slide-out-to-right-2\",\n className,\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n ContextMenuPrimitive.ContextMenuItemProps & {\n inset?: boolean;\n }\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 outline-none\",\n \"aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ContextMenuPrimitive.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 outline-none\",\n \"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));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ContextMenuPrimitive.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 outline-none\",\n \"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));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n ContextMenuPrimitive.ContextMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n ContextMenuPrimitive.ContextMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\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 ContextMenuPortal,\n ContextMenuSub,\n ContextMenuSubContent,\n ContextMenuSubTrigger,\n ContextMenuRadioGroup,\n};\n"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,UAAYC,MAA0B,+BACtC,OACE,aAAAC,EACA,oBAAAC,EACA,i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SAAAE,EAAU,QAAAS,EAAS,GAAGR,CAAM,EAAGC,IAC7CZ,EAAsB,eAArB,CACC,IAAKY,EACL,UAAWC,EACT,sJACA,6DACAL,CACF,EACA,QAASW,EACR,GAAGR,EAEJ,UAAAZ,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAsB,gBAArB,CACC,SAAAA,EAACqB,EAAA,CAAU,UAAU,SAAS,EAChC,EACF,EACCV,GACH,CACD,EACDQ,EAAwB,YACD,eAAa,YAMpC,IAAMG,EAA6B,aAGjC,CAAC,CAAE,UAAAb,EAAW,SAAAE,EAAU,GAAGC,CAAM,EAAGC,IACpCZ,EAAsB,YAArB,CACC,IAAKY,EACL,UAAWC,EACT,sJACA,6DACAL,CACF,EACC,GAAGG,EAEJ,UAAAZ,EAAC,QAAK,UAAU,4DACd,SAAAA,EAAsB,gBAArB,CACC,SAAAA,EAACuB,EAAA,CAAc,UAAU,sBAAsB,EACjD,EACF,EACCZ,GACH,CACD,EACDW,EAAqB,YAAmC,YAAU,YAMlE,IAAME,EAAyB,aAK7B,CAAC,CAAE,UAAAf,EAAW,MAAAC,EAAO,GAAGE,CAAM,EAAGC,IACjCb,EAAsB,QAArB,CACC,IAAKa,EACL,UAAWC,EACT,oDACAJ,GAAS,OACTD,CACF,EACC,GAAGG,EACN,CACD,EACDY,EAAiB,YAAmC,QAAM,YAM1D,IAAMC,EAA6B,aAGjC,CAAC,CAAE,UAAAhB,EAAW,GAAGG,CAAM,EAAGC,IAC1Bb,EAAsB,YAArB,CACC,IAAKa,EACL,UAAWC,EAAG,4BAA6BL,CAAS,EACnD,GAAGG,EACN,CACD,EACDa,EAAqB,YAAmC,YAAU,YAMlE,SAASC,EAAoB,CAC3B,UAAAjB,EACA,GAAGG,CACL,EAA6D,CAC3D,OACEZ,EAAC,QACC,UAAWc,EACT,wDACAL,CACF,EACC,GAAGG,EACN,CAEJ","names":["React","ContextMenuPrimitive","CheckIcon","ChevronRightIcon","DotFilledIcon","jsx","jsxs","ContextMenu","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","className","inset","children","props","ref","cn","ChevronRightIcon","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","CheckIcon","ContextMenuRadioItem","DotFilledIcon","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"]}
|
|
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 {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenu\n * -------------------------------------------------------------------------- */\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSub\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioGroup\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubTrigger\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n ContextMenuPrimitive.ContextMenuSubTriggerProps & {\n inset?: boolean;\n }\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));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSubContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSubContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n ContextMenuPrimitive.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));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuContent\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuContent = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n ContextMenuPrimitive.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));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n ContextMenuPrimitive.ContextMenuItemProps & {\n inset?: boolean;\n }\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));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuCheckboxItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n ContextMenuPrimitive.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));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuRadioItem\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n ContextMenuPrimitive.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));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuLabel\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuLabel = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n ContextMenuPrimitive.ContextMenuLabelProps & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"text-foreground px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className,\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuSeparator\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuSeparator = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n ContextMenuPrimitive.ContextMenuSeparatorProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuShortcut\n * -------------------------------------------------------------------------- */\n\nfunction ContextMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element {\n return (\n <span\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ContextMenuArrow\n * -------------------------------------------------------------------------- */\n\nconst ContextMenuArrow = React.forwardRef<\n React.ElementRef<typeof ContextMenuPrimitive.Arrow>,\n ContextMenuPrimitive.ContextMenuArrowProps\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Arrow\n ref={ref}\n className={cn(\"fill-popover\", className)}\n {...props}\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};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,0BAA0B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA2CL,SAUE,KAVF;AApCF,IAAM,cAAmC;AAMzC,IAAM,qBAA0C;AAMhD,IAAM,mBAAwC;AAM9C,IAAM,iB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AM,GAAG,QAC1B;AAAA,EAAsB;AAAA,EAArB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,gBAAgB,SAAS;AAAA,IACtC,GAAG;AAAA;AACN,CACD;AACD,iBAAiB,cAAmC,2BAAM;","names":[]}
|
package/dist/dialog.d.mts
CHANGED
|
@@ -3,13 +3,11 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
3
3
|
|
|
4
4
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
5
5
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
7
6
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
7
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
8
|
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
11
9
|
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
12
10
|
declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
11
|
declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
12
|
|
|
15
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader,
|
|
13
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
package/dist/dialog.d.ts
CHANGED
|
@@ -3,13 +3,11 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
3
3
|
|
|
4
4
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
5
5
|
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
-
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
7
6
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
7
|
declare const DialogContent: React.ForwardRefExoticComponent<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
8
|
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
11
9
|
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
12
10
|
declare const DialogTitle: React.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
11
|
declare const DialogDescription: React.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
12
|
|
|
15
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader,
|
|
13
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger };
|
package/dist/dialog.js
CHANGED
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkLDYBRDAYjs = require('./chunk-LDYBRDAY.js');
|
|
12
|
+
require('./chunk-G3NP7M2N.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.Dialog = _chunkLDYBRDAYjs.Dialog; exports.DialogClose = _chunkLDYBRDAYjs.DialogClose; exports.DialogContent = _chunkLDYBRDAYjs.DialogContent; exports.DialogDescription = _chunkLDYBRDAYjs.DialogDescription; exports.DialogFooter = _chunkLDYBRDAYjs.DialogFooter; exports.DialogHeader = _chunkLDYBRDAYjs.DialogHeader; exports.DialogTitle = _chunkLDYBRDAYjs.DialogTitle; exports.DialogTrigger = _chunkLDYBRDAYjs.DialogTrigger;
|
|
2
23
|
//# sourceMappingURL=dialog.js.map
|
package/dist/dialog.mjs
CHANGED
|
@@ -1,2 +1,23 @@
|
|
|
1
|
-
"use client";
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogFooter,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
DialogTrigger
|
|
11
|
+
} from "./chunk-EIHWTXQ4.mjs";
|
|
12
|
+
import "./chunk-UG3URV2Z.mjs";
|
|
13
|
+
export {
|
|
14
|
+
Dialog,
|
|
15
|
+
DialogClose,
|
|
16
|
+
DialogContent,
|
|
17
|
+
DialogDescription,
|
|
18
|
+
DialogFooter,
|
|
19
|
+
DialogHeader,
|
|
20
|
+
DialogTitle,
|
|
21
|
+
DialogTrigger
|
|
22
|
+
};
|
|
2
23
|
//# sourceMappingURL=dialog.mjs.map
|
package/dist/drawer.d.mts
CHANGED
|
@@ -4,9 +4,7 @@ import { Drawer as Drawer$1 } from 'vaul';
|
|
|
4
4
|
|
|
5
5
|
declare function Drawer({ shouldScaleBackground, ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
|
|
6
6
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const DrawerPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
8
7
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
8
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
9
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
12
10
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -15,4 +13,4 @@ declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTML
|
|
|
15
13
|
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
14
|
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
15
|
|
|
18
|
-
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader,
|
|
16
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
package/dist/drawer.d.ts
CHANGED
|
@@ -4,9 +4,7 @@ import { Drawer as Drawer$1 } from 'vaul';
|
|
|
4
4
|
|
|
5
5
|
declare function Drawer({ shouldScaleBackground, ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
|
|
6
6
|
declare const DrawerTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
-
declare const DrawerPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
8
7
|
declare const DrawerClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
8
|
declare const DrawerContent: React.ForwardRefExoticComponent<Omit<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
11
9
|
onAnimationEnd?: ((open: boolean) => void) | undefined;
|
|
12
10
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -15,4 +13,4 @@ declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTML
|
|
|
15
13
|
declare const DrawerTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
14
|
declare const DrawerDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
15
|
|
|
18
|
-
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader,
|
|
16
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger };
|
package/dist/drawer.js
CHANGED
|
@@ -1,2 +1,98 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
|
|
5
|
+
|
|
6
|
+
// src/drawer.tsx
|
|
7
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
8
|
+
var _vaul = require('vaul');
|
|
9
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
10
|
+
function Drawer({
|
|
11
|
+
shouldScaleBackground = true,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
15
|
+
_vaul.Drawer.Root,
|
|
16
|
+
{
|
|
17
|
+
shouldScaleBackground,
|
|
18
|
+
...props
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
var DrawerTrigger = _vaul.Drawer.Trigger;
|
|
23
|
+
var DrawerClose = _vaul.Drawer.Close;
|
|
24
|
+
var DrawerContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal, { children: [
|
|
25
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
26
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
27
|
+
_vaul.Drawer.Content,
|
|
28
|
+
{
|
|
29
|
+
ref,
|
|
30
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
31
|
+
"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full" }),
|
|
37
|
+
children
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }));
|
|
42
|
+
DrawerContent.displayName = "DrawerContent";
|
|
43
|
+
function DrawerHeader({
|
|
44
|
+
className,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "grid gap-1.5 p-4 text-center sm:text-left", className),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function DrawerFooter({
|
|
56
|
+
className,
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "mt-auto flex flex-col gap-2 p-4", className),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
68
|
+
_vaul.Drawer.Title,
|
|
69
|
+
{
|
|
70
|
+
ref,
|
|
71
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0,
|
|
72
|
+
"text-lg font-semibold leading-none tracking-tight",
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
));
|
|
78
|
+
DrawerTitle.displayName = _vaul.Drawer.Title.displayName;
|
|
79
|
+
var DrawerDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
80
|
+
_vaul.Drawer.Description,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
className: _chunkG3NP7M2Njs.cn.call(void 0, "text-muted-foreground text-sm", className),
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
));
|
|
87
|
+
DrawerDescription.displayName = _vaul.Drawer.Description.displayName;
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
exports.Drawer = Drawer; exports.DrawerClose = DrawerClose; exports.DrawerContent = DrawerContent; exports.DrawerDescription = DrawerDescription; exports.DrawerFooter = DrawerFooter; exports.DrawerHeader = DrawerHeader; exports.DrawerTitle = DrawerTitle; exports.DrawerTrigger = DrawerTrigger;
|
|
2
98
|
//# sourceMappingURL=drawer.js.map
|
package/dist/drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/drawer.tsx"],"names":[
|
|
1
|
+
{"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAYtC,cA6BA,YA7BA;AALJ,SAAS,OAAO;AAAA,EACd,wBAAwB;AAAA,EACxB,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAMA,IAAM,gB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":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\nfunction Drawer({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element {\n return (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\nconst DrawerContent = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-[100px] rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n));\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\nfunction DrawerHeader({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element {\n return (\n <div\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\nfunction DrawerFooter({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element {\n return (\n <div\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\nconst DrawerTitle = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n \"text-lg font-semibold leading-none tracking-tight\",\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\nconst DrawerDescription = React.forwardRef<\n React.ElementRef<typeof DrawerPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"]}
|