@arolariu/components 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXAMPLES.md +1035 -1035
- package/changelog.md +5 -0
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/aspect-ratio.js.map +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/background-beams.js.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/bubble-background.js.map +1 -1
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/collapsible.d.ts +2 -1
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/collapsible.js +2 -30
- package/dist/components/ui/collapsible.js.map +1 -1
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/counting-number.js.map +1 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dot-background.js.map +1 -1
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdrawer.js.map +1 -1
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/fireworks-background.js.map +1 -1
- package/dist/components/ui/flip-button.js.map +1 -1
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +4 -3
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/gradient-background.js.map +1 -1
- package/dist/components/ui/gradient-text.js.map +1 -1
- package/dist/components/ui/highlight-text.js.map +1 -1
- package/dist/components/ui/hole-background.js.map +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/ripple-button.js.map +1 -1
- package/dist/components/ui/scratcher.js.map +1 -1
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typewriter.js +6 -2
- package/dist/components/ui/typewriter.js.map +1 -1
- package/dist/hooks/useIsMobile.js.map +1 -1
- package/dist/hooks/useWindowSize.js.map +1 -1
- package/dist/index.css +25 -1779
- package/dist/index.css.map +1 -1
- package/dist/lib/utilities.js.map +1 -1
- package/package.json +2 -15
- package/src/components/ui/chart.tsx +1 -1
- package/src/components/ui/checkbox.tsx +2 -2
- package/src/components/ui/collapsible.tsx +3 -1
- package/src/components/ui/field.tsx +1 -1
- package/src/components/ui/form.tsx +8 -4
- package/src/components/ui/input-group.tsx +2 -0
- package/src/components/ui/sidebar.tsx +2 -0
- package/src/components/ui/table.tsx +2 -0
- package/src/components/ui/typewriter.tsx +2 -2
- package/src/index.css +6 -6
- package/dist/components/ui/field.d.ts +0 -26
- package/dist/components/ui/field.d.ts.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
|
|
2
2
|
declare const Collapsible: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
-
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement
|
|
3
|
+
declare const CollapsibleTrigger: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const CollapsibleContent: import("react").ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
5
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
5
6
|
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,QAAA,MAAM,WAAW,kIAA4B,CAAC;AAE9C,QAAA,
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/ui/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,oBAAoB,MAAM,6BAA6B,CAAC;AAEpE,QAAA,MAAM,WAAW,kIAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,4IAA0C,CAAC;AAEnE,QAAA,MAAM,kBAAkB,yIAA0C,CAAC;AAEnE,OAAO,EAAC,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAC,CAAC"}
|
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { CollapsibleContent, CollapsibleTrigger, Root } from "@radix-ui/react-collapsible";
|
|
3
|
-
var __webpack_require__ = {};
|
|
4
|
-
(()=>{
|
|
5
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
6
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: definition[key]
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
|
-
(()=>{
|
|
13
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
-
})();
|
|
15
|
-
(()=>{
|
|
16
|
-
__webpack_require__.r = (exports)=>{
|
|
17
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
18
|
-
value: 'Module'
|
|
19
|
-
});
|
|
20
|
-
Object.defineProperty(exports, '__esModule', {
|
|
21
|
-
value: true
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
})();
|
|
25
|
-
var react_collapsible_namespaceObject = {};
|
|
26
|
-
__webpack_require__.r(react_collapsible_namespaceObject);
|
|
27
|
-
__webpack_require__.d(react_collapsible_namespaceObject, {
|
|
28
|
-
CollapsibleContent: ()=>CollapsibleContent,
|
|
29
|
-
CollapsibleTrigger: ()=>CollapsibleTrigger,
|
|
30
|
-
Root: ()=>Root
|
|
31
|
-
});
|
|
32
3
|
const Collapsible = Root;
|
|
33
|
-
const
|
|
4
|
+
const collapsible_CollapsibleTrigger = CollapsibleTrigger;
|
|
5
|
+
const collapsible_CollapsibleContent = CollapsibleContent;
|
|
34
6
|
export { Collapsible, collapsible_CollapsibleContent as CollapsibleContent, collapsible_CollapsibleTrigger as CollapsibleTrigger };
|
|
35
7
|
|
|
36
8
|
//# sourceMappingURL=collapsible.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/collapsible.js","sources":["../../../src/components/ui/collapsible.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\r\n\r\nconst Collapsible = CollapsiblePrimitive.Root;\r\n\r\nconst CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;\r\n\r\nconst CollapsibleContent = CollapsiblePrimitive.CollapsibleContent;\r\n\r\nexport {Collapsible, CollapsibleContent, CollapsibleTrigger};\r\n"],"names":["Collapsible","CollapsiblePrimitive","CollapsibleTrigger","CollapsibleContent"],"mappings":";;AAIA,MAAMA,cAAcC;AAEpB,MAAMC,iCAAqBD;AAE3B,MAAME,iCAAqBF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/command.js","sources":["../../../src/components/ui/command.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport type {DialogProps} from \"@radix-ui/react-dialog\";\r\nimport {Command as CommandPrimitive} from \"cmdk\";\r\nimport {Search} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Dialog, DialogContent} from \"@/components/ui/dialog\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Command = React.forwardRef<React.ComponentRef<typeof CommandPrimitive>, React.ComponentPropsWithoutRef<typeof CommandPrimitive>>(\r\n ({className, ...props}, ref) => (\r\n <CommandPrimitive\r\n ref={ref}\r\n className={cn(\r\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-white text-neutral-950 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n ),\r\n);\r\nCommand.displayName = CommandPrimitive.displayName;\r\n\r\nconst CommandDialog = ({children, ...props}: DialogProps) => {\r\n return (\r\n <Dialog {...props}>\r\n <DialogContent className='overflow-hidden p-0'>\r\n <Command className='[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 dark:[&_[cmdk-group-heading]]:text-neutral-400 [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5'>\r\n {children}\r\n </Command>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n};\r\n\r\nconst CommandInput = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.Input>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\r\n>(({className, ...props}, ref) => (\r\n <div\r\n className='flex items-center border-b px-3'\r\n // eslint-disable-next-line react/no-unknown-property -- cmdk specific attribute\r\n cmdk-input-wrapper=''>\r\n <Search className='mr-2 h-4 w-4 shrink-0 opacity-50' />\r\n <CommandPrimitive.Input\r\n ref={ref}\r\n className={cn(\r\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 disabled:cursor-not-allowed disabled:opacity-50 dark:placeholder:text-neutral-400\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </div>\r\n));\r\n\r\nCommandInput.displayName = CommandPrimitive.Input.displayName;\r\n\r\nconst CommandList = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.List>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\r\n>(({className, ...props}, ref) => (\r\n <CommandPrimitive.List\r\n ref={ref}\r\n className={cn(\"max-h-[300px] overflow-x-hidden overflow-y-auto\", className)}\r\n {...props}\r\n />\r\n));\r\n\r\nCommandList.displayName = CommandPrimitive.List.displayName;\r\n\r\nconst CommandEmpty = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.Empty>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\r\n>((props, ref) => (\r\n <CommandPrimitive.Empty\r\n ref={ref}\r\n className='py-6 text-center text-sm'\r\n {...props}\r\n />\r\n));\r\n\r\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\r\n\r\nconst CommandGroup = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.Group>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\r\n>(({className, ...props}, ref) => (\r\n <CommandPrimitive.Group\r\n ref={ref}\r\n className={cn(\r\n \"overflow-hidden p-1 text-neutral-950 dark:text-neutral-50 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500 dark:[&_[cmdk-group-heading]]:text-neutral-400\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\n\r\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\r\n\r\nconst CommandSeparator = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\r\n>(({className, ...props}, ref) => (\r\n <CommandPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 h-px bg-neutral-200 dark:bg-neutral-800\", className)}\r\n {...props}\r\n />\r\n));\r\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\r\n\r\nconst CommandItem = React.forwardRef<\r\n React.ComponentRef<typeof CommandPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\r\n>(({className, ...props}, ref) => (\r\n <CommandPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-neutral-100 data-[selected=true]:text-neutral-900 dark:data-[selected=true]:bg-neutral-800 dark:data-[selected=true]:text-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\n\r\nCommandItem.displayName = CommandPrimitive.Item.displayName;\r\n\r\nconst CommandShortcut = ({className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return (\r\n <span\r\n className={cn(\"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n );\r\n};\r\nCommandShortcut.displayName = \"CommandShortcut\";\r\n\r\nexport {Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut};\r\n"],"names":["Command","React","className","props","ref","CommandPrimitive","cn","CommandDialog","children","Dialog","DialogContent","CommandInput","Search","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut"],"mappings":";;;;;;;AAUA,MAAMA,kBAAU,WAAHA,GAAGC,WACd,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACtB,IAACC,SAAgBA;QACf,KAAKD;QACL,WAAWE,GACT,6HACAJ;QAED,GAAGC,KAAK;;AAIfH,gBAAQ,WAAW,GAAGK,QAAAA,WAA4B;AAElD,MAAME,gBAAgB,CAAC,EAACC,QAAQ,EAAE,GAAGL,OAAmB,GAC/C,WAAP,GACE,IAACM,QAAMA;QAAE,GAAGN,KAAK;kBACf,kBAACO,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AG,iDAAiDJ;QAC9D,GAAGC,KAAK;;AAGba,iBAAiB,WAAW,GAAGX,QAAAA,SAAAA,CAAAA,WAAsC;AAErE,MAAMY,cAAc,WAAdA,GAAchB,WAGlB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACC,QAAAA,IAAqB;QACpB,KAAKD;QACL,WAAWE,GACT,6YACAJ;QAED,GAAGC,KAAK;;AAIbc,YAAY,WAAW,GAAGZ,QAAAA,IAAAA,CAAAA,WAAiC;AAE3D,MAAMa,kBAAkB,CAAC,EAAChB,SAAS,EAAE,GAAGC,OAA6C,GAC5E,WAAP,GACE,IAAC;QACC,WAAWG,GAAG,0EAA0EJ;QACvF,GAAGC,KAAK;;AAIfe,gBAAgB,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\context-menu.js","sources":["webpack://@arolariu/components/./src/components/ui/context-menu.tsx"],"sourcesContent":["\r\n\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport {Check, ChevronRight, Circle} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, children, ...props}, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <ChevronRight className='ml-auto h-4 w-4' />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({className, children, checked, ...props}, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className='h-4 w-4' />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({className, children, ...props}, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className='h-4 w-4 fill-current' />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <ContextMenuPrimitive.Label\r\n ref={ref}\r\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-neutral-950 dark:text-neutral-50\", inset && \"pl-8\", className)}\r\n {...props}\r\n />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 my-1 h-px bg-neutral-200 dark:bg-neutral-800\", className)}\r\n {...props}\r\n />\r\n));\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return (\r\n <span\r\n className={cn(\"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n );\r\n};\r\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuCheckboxItem,\r\n ContextMenuContent,\r\n ContextMenuGroup,\r\n ContextMenuItem,\r\n ContextMenuLabel,\r\n ContextMenuPortal,\r\n ContextMenuRadioGroup,\r\n ContextMenuRadioItem,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuTrigger,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","cn","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":";;;;;;AAQA,MAAMA,cAAcC;AAEpB,MAAMC,qBAAqBD;AAE3B,MAAME,mBAAmBF;AAEzB,MAAM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,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"file":"components/ui/context-menu.js","sources":["../../../src/components/ui/context-menu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\r\nimport {Check, ChevronRight, Circle} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst ContextMenu = ContextMenuPrimitive.Root;\r\n\r\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\r\n\r\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\r\n\r\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\r\n\r\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\r\n\r\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\r\n\r\nconst ContextMenuSubTrigger = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, children, ...props}, ref) => (\r\n <ContextMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-900 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <ChevronRight className='ml-auto h-4 w-4' />\r\n </ContextMenuPrimitive.SubTrigger>\r\n));\r\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst ContextMenuSubContent = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\r\n\r\nconst ContextMenuContent = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.Portal>\r\n <ContextMenuPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-[--radix-context-menu-content-available-height] min-w-[8rem] origin-[--radix-context-menu-content-transform-origin] overflow-x-hidden overflow-y-auto rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </ContextMenuPrimitive.Portal>\r\n));\r\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\r\n\r\nconst ContextMenuItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <ContextMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\r\n\r\nconst ContextMenuCheckboxItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\r\n>(({className, children, checked, ...props}, ref) => (\r\n <ContextMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Check className='h-4 w-4' />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.CheckboxItem>\r\n));\r\nContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst ContextMenuRadioItem = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\r\n>(({className, children, ...props}, ref) => (\r\n <ContextMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <ContextMenuPrimitive.ItemIndicator>\r\n <Circle className='h-4 w-4 fill-current' />\r\n </ContextMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </ContextMenuPrimitive.RadioItem>\r\n));\r\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\r\n\r\nconst ContextMenuLabel = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <ContextMenuPrimitive.Label\r\n ref={ref}\r\n className={cn(\"px-2 py-1.5 text-sm font-semibold text-neutral-950 dark:text-neutral-50\", inset && \"pl-8\", className)}\r\n {...props}\r\n />\r\n));\r\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\r\n\r\nconst ContextMenuSeparator = React.forwardRef<\r\n React.ComponentRef<typeof ContextMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\r\n>(({className, ...props}, ref) => (\r\n <ContextMenuPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 my-1 h-px bg-neutral-200 dark:bg-neutral-800\", className)}\r\n {...props}\r\n />\r\n));\r\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\r\n\r\nconst ContextMenuShortcut = ({className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return (\r\n <span\r\n className={cn(\"ml-auto text-xs tracking-widest text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n );\r\n};\r\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\r\n\r\nexport {\r\n ContextMenu,\r\n ContextMenuCheckboxItem,\r\n ContextMenuContent,\r\n ContextMenuGroup,\r\n ContextMenuItem,\r\n ContextMenuLabel,\r\n ContextMenuPortal,\r\n ContextMenuRadioGroup,\r\n ContextMenuRadioItem,\r\n ContextMenuSeparator,\r\n ContextMenuShortcut,\r\n ContextMenuSub,\r\n ContextMenuSubContent,\r\n ContextMenuSubTrigger,\r\n ContextMenuTrigger,\r\n};\r\n"],"names":["ContextMenu","ContextMenuPrimitive","ContextMenuTrigger","ContextMenuGroup","ContextMenuPortal","ContextMenuSub","ContextMenuRadioGroup","ContextMenuSubTrigger","React","className","inset","children","props","ref","cn","ChevronRight","ContextMenuSubContent","ContextMenuContent","ContextMenuItem","ContextMenuCheckboxItem","checked","Check","ContextMenuRadioItem","Circle","ContextMenuLabel","ContextMenuSeparator","ContextMenuShortcut"],"mappings":";;;;;;AAQA,MAAMA,cAAcC;AAEpB,MAAMC,qBAAqBD;AAE3B,MAAME,mBAAmBF;AAEzB,MAAMG,oBAAoBH;AAE1B,MAAMI,iBAAiBJ;AAEvB,MAAMK,wBAAwBL;AAE9B,MAAMM,wBAAwB,WAAxBA,GAAwBC,WAK5B,CAAC,EAACC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACzC,KAACZ,YAA+B;QAC9B,KAAKY;QACL,WAAWC,GACT,8UACAJ,SAAS,QACTD;QAED,GAAGG,KAAK;;YACRD;0BACD,IAACI,cAAYA;gBAAC,WAAU;;;;AAG5BR,sBAAsB,WAAW,GAAGN,WAAAA,WAA2C;AAE/E,MAAMe,wBAAwB,WAAxBA,GAAwBR,WAG5B,CAAC,EAACC,SAAS,EAAE,GAAGG,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACZ,YAA+B;QAC9B,KAAKY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wBAAC,WAAU;;;;YAGrBZ;;;AAGLW,qBAAqB,WAAW,GAAGrB,UAAAA,WAA0C;AAE7E,MAAMuB,mBAAmB,WAAnBA,GAAmBhB,WAKvB,CAAC,EAACC,SAAS,EAAEC,KAAK,EAAE,GAAGE,OAAM,EAAEC,MAAAA,WAAAA,GAC/B,IAACZ,OAA0B;QACzB,KAAKY;QACL,WAAWC,GAAG,2EAA2EJ,SAAS,QAAQD;QACzG,GAAGG,KAAK;;AAGbY,iBAAiB,WAAW,GAAGvB,MAAAA,WAAsC;AAErE,MAAMwB,uBAAuB,WAAvBA,GAAuBjB,WAG3B,CAAC,EAACC,SAAS,EAAE,GAAGG,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACZ,WAA8B;QAC7B,KAAKY;QACL,WAAWC,GAAG,sDAAsDL;QACnE,GAAGG,KAAK;;AAGba,qBAAqB,WAAW,GAAGxB,UAAAA,WAA0C;AAE7E,MAAMyB,sBAAsB,CAAC,EAACjB,SAAS,EAAE,GAAGG,OAA6C,GAChF,WAAP,GACE,IAAC;QACC,WAAWE,GAAG,0EAA0EL;QACvF,GAAGG,KAAK;;AAIfc,oBAAoB,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/counting-number.js","sources":["../../../src/components/ui/counting-number.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {type SpringOptions, type UseInViewOptions, useInView, useMotionValue, useSpring} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\ninterface CountingNumberProps extends React.HTMLAttributes<HTMLSpanElement> {\r\n number: number;\r\n fromNumber?: number;\r\n padStart?: boolean;\r\n inView?: boolean;\r\n inViewMargin?: UseInViewOptions[\"margin\"];\r\n inViewOnce?: boolean;\r\n decimalSeparator?: string;\r\n transition?: SpringOptions;\r\n decimalPlaces?: number;\r\n}\r\n\r\nconst CountingNumber = React.forwardRef<HTMLSpanElement, CountingNumberProps>(\r\n (\r\n {\r\n number,\r\n fromNumber = 0,\r\n padStart = false,\r\n inView = false,\r\n inViewMargin = \"0px\",\r\n inViewOnce = true,\r\n decimalSeparator = \".\",\r\n transition = {stiffness: 90, damping: 50},\r\n decimalPlaces = 0,\r\n className,\r\n ...props\r\n },\r\n ref,\r\n ) => {\r\n const localRef = React.useRef<HTMLSpanElement>(null);\r\n React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);\r\n\r\n const numberStr = number.toString();\r\n const decimals = typeof decimalPlaces === \"number\" ? decimalPlaces : numberStr.includes(\".\") ? numberStr?.split(\".\")[1].length : 0;\r\n\r\n const motionVal = useMotionValue(fromNumber);\r\n const springVal = useSpring(motionVal, transition);\r\n const inViewResult = useInView(localRef, {\r\n once: inViewOnce,\r\n margin: inViewMargin,\r\n });\r\n const isInView = !inView || inViewResult;\r\n\r\n React.useEffect(() => {\r\n if (isInView) motionVal.set(number);\r\n }, [isInView, number, motionVal]);\r\n\r\n React.useEffect(() => {\r\n const unsubscribe = springVal.on(\"change\", (latest) => {\r\n if (localRef.current) {\r\n let formatted = decimals > 0 ? latest.toFixed(decimals) : Math.round(latest).toString();\r\n\r\n if (decimals > 0) {\r\n formatted = formatted.replace(\".\", decimalSeparator);\r\n }\r\n\r\n if (padStart) {\r\n const finalIntLength = Math.floor(Math.abs(number)).toString().length;\r\n const [intPart, fracPart] = formatted.split(decimalSeparator);\r\n const paddedInt = intPart.padStart(finalIntLength, \"0\");\r\n formatted = fracPart ? `${paddedInt}${decimalSeparator}${fracPart}` : paddedInt;\r\n }\r\n\r\n localRef.current.textContent = formatted;\r\n }\r\n });\r\n return () => unsubscribe();\r\n }, [springVal, decimals, padStart, number, decimalSeparator]);\r\n\r\n const finalIntLength = Math.floor(Math.abs(number)).toString().length;\r\n const suffix = decimals > 0 ? `${decimalSeparator}${\"0\".repeat(decimals)}` : \"\";\r\n const initialText = padStart ? `${\"0\".padStart(finalIntLength, \"0\")}${suffix}` : `0${suffix}`;\r\n\r\n return (\r\n <span\r\n ref={localRef}\r\n className={className}\r\n {...props}>\r\n {initialText}\r\n </span>\r\n );\r\n },\r\n);\r\n\r\nCountingNumber.displayName = \"CountingNumber\";\r\n\r\nexport {CountingNumber, type CountingNumberProps};\r\n"],"names":["CountingNumber","React","number","fromNumber","padStart","inView","inViewMargin","inViewOnce","decimalSeparator","transition","decimalPlaces","className","props","ref","localRef","numberStr","decimals","motionVal","useMotionValue","springVal","useSpring","inViewResult","useInView","isInView","unsubscribe","latest","formatted","Math","finalIntLength","intPart","fracPart","paddedInt","suffix","initialText"],"mappings":";;;;AAiBA,MAAMA,iBAAiB,WAAjBA,GAAiBC,WACrB,CACE,EACEC,MAAM,EACNC,aAAa,CAAC,EACdC,WAAW,KAAK,EAChBC,SAAS,KAAK,EACdC,eAAe,KAAK,EACpBC,aAAa,IAAI,EACjBC,mBAAmB,GAAG,EACtBC,aAAa;IAAC,WAAW;IAAI,SAAS;AAAE,CAAC,EACzCC,gBAAgB,CAAC,EACjBC,SAAS,EACT,GAAGC,OACJ,EACDC;IAEA,MAAMC,WAAWb,OAA8B;IAC/CA,oBAA0BY,KAAK,IAAMC,SAAS,OAAO;IAErD,MAAMC,YAAYb,OAAO,QAAQ;IACjC,MAAMc,WAAW,AAAyB,YAAzB,OAAON,gBAA6BA,gBAAgBK,UAAU,QAAQ,CAAC,OAAOA,WAAW,MAAM,IAAI,CAAC,EAAE,CAAC,SAAS;IAEjI,MAAME,YAAYC,eAAef;IACjC,MAAMgB,YAAYC,UAAUH,WAAWR;IACvC,MAAMY,eAAeC,UAAUR,UAAU;QACvC,MAAMP;QACN,QAAQD;IACV;IACA,MAAMiB,WAAW,CAAClB,UAAUgB;IAE5BpB,UAAgB;QACd,IAAIsB,UAAUN,UAAU,GAAG,CAACf;IAC9B,GAAG;QAACqB;QAAUrB;QAAQe;KAAU;IAEhChB,UAAgB;QACd,MAAMuB,cAAcL,UAAU,EAAE,CAAC,UAAU,CAACM;YAC1C,IAAIX,SAAS,OAAO,EAAE;gBACpB,IAAIY,YAAYV,WAAW,IAAIS,OAAO,OAAO,CAACT,YAAYW,KAAK,KAAK,CAACF,QAAQ,QAAQ;gBAErF,IAAIT,WAAW,GACbU,YAAYA,UAAU,OAAO,CAAC,KAAKlB;gBAGrC,IAAIJ,UAAU;oBACZ,MAAMwB,iBAAiBD,KAAK,KAAK,CAACA,KAAK,GAAG,CAACzB,SAAS,QAAQ,GAAG,MAAM;oBACrE,MAAM,CAAC2B,SAASC,SAAS,GAAGJ,UAAU,KAAK,CAAClB;oBAC5C,MAAMuB,YAAYF,QAAQ,QAAQ,CAACD,gBAAgB;oBACnDF,YAAYI,WAAW,GAAGC,YAAYvB,mBAAmBsB,UAAU,GAAGC;gBACxE;gBAEAjB,SAAS,OAAO,CAAC,WAAW,GAAGY;YACjC;QACF;QACA,OAAO,IAAMF;IACf,GAAG;QAACL;QAAWH;QAAUZ;QAAUF;QAAQM;KAAiB;IAE5D,MAAMoB,iBAAiBD,KAAK,KAAK,CAACA,KAAK,GAAG,CAACzB,SAAS,QAAQ,GAAG,MAAM;IACrE,MAAM8B,SAAShB,WAAW,IAAI,GAAGR,mBAAmB,IAAI,MAAM,CAACQ,WAAW,GAAG;IAC7E,MAAMiB,cAAc7B,WAAW,GAAG,IAAI,QAAQ,CAACwB,gBAAgB,OAAOI,QAAQ,GAAG,CAAC,CAAC,EAAEA,QAAQ;IAE7F,OAAO,WAAP,GACE,IAAC;QACC,KAAKlB;QACL,WAAWH;QACV,GAAGC,KAAK;kBACRqB;;AAGP;AAGFjC,eAAe,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/dialog.js","sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\r\nimport {X} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Dialog = DialogPrimitive.Root;\r\n\r\nconst DialogTrigger = DialogPrimitive.Trigger;\r\n\r\nconst DialogPortal = DialogPrimitive.Portal;\r\n\r\nconst DialogClose = DialogPrimitive.Close;\r\n\r\nconst DialogOverlay = React.forwardRef<\r\n React.ComponentRef<typeof DialogPrimitive.Overlay>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Overlay\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\r\n\r\nconst DialogContent = React.forwardRef<\r\n React.ComponentRef<typeof DialogPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\r\n>(({className, children, ...props}, ref) => (\r\n <DialogPortal>\r\n <DialogOverlay />\r\n <DialogPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <DialogPrimitive.Close className='absolute top-4 right-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400'>\r\n <X className='h-4 w-4' />\r\n <span className='sr-only'>Close</span>\r\n </DialogPrimitive.Close>\r\n </DialogPrimitive.Content>\r\n </DialogPortal>\r\n));\r\nDialogContent.displayName = DialogPrimitive.Content.displayName;\r\n\r\nconst DialogHeader = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"flex flex-col space-y-1.5 text-center sm:text-left\", className)}\r\n {...props}\r\n />\r\n);\r\nDialogHeader.displayName = \"DialogHeader\";\r\n\r\nconst DialogFooter = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", className)}\r\n {...props}\r\n />\r\n);\r\nDialogFooter.displayName = \"DialogFooter\";\r\n\r\nconst DialogTitle = React.forwardRef<\r\n React.ComponentRef<typeof DialogPrimitive.Title>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Title\r\n ref={ref}\r\n className={cn(\"text-lg leading-none font-semibold tracking-tight\", className)}\r\n {...props}\r\n />\r\n));\r\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\r\n\r\nconst DialogDescription = React.forwardRef<\r\n React.ComponentRef<typeof DialogPrimitive.Description>,\r\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\r\n>(({className, ...props}, ref) => (\r\n <DialogPrimitive.Description\r\n ref={ref}\r\n className={cn(\"text-sm text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n));\r\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\r\n\r\nexport {\r\n Dialog,\r\n DialogClose,\r\n DialogContent,\r\n DialogDescription,\r\n DialogFooter,\r\n DialogHeader,\r\n DialogOverlay,\r\n DialogPortal,\r\n DialogTitle,\r\n DialogTrigger,\r\n};\r\n"],"names":["Dialog","DialogPrimitive","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","React","className","props","ref","cn","DialogContent","children","X","DialogHeader","DialogFooter","DialogTitle","DialogDescription"],"mappings":";;;;;;AAQA,MAAMA,SAASC;AAEf,MAAMC,gBAAgBD;AAEtB,MAAME,eAAeF;AAErB,MAAMG,cAAcH;AAEpB,MAAMI,gBAAgB,WAAhBA,GAAgBC,WAGpB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,SAAuB;QACtB,KAAKQ;QACL,WAAWC,GACT,0JACAH;QAED,GAAGC,KAAK;;AAGbH,cAAc,WAAW,GAAGJ,QAAAA,WAAmC;AAE/D,MAAMU,gBAAgB,WAAhBA,GAAgBL,WAGpB,CAAC,EAACC,SAAS,EAAEK,QAAQ,EAAE,GAAGJ,OAAM,EAAEC,MAAAA,WAAAA,GAClC,KAACN,cAAAA;;0BACC,IAACE,eAAAA,CAAAA;0BACD,KAACJ,SAAuB;gBACtB,KAAKQ;gBACL,WAAWC,GACT,yjBACAH;gBAED,GAAGC,KAAK;;oBACRI;kCACD,KAACX,OAAqB;wBAAC,WAAU;;0CAC/B,IAACY,GAACA;gCAAC,WAAU;;0CACb,IAAC;gCAAK,WAAU;0CAAU;;;;;;;;AAKlCF,cAAc,WAAW,GAAGV,QAAAA,WAAmC;AAE/D,MAAMa,eAAe,CAAC,EAACP,SAAS,EAAE,GAAGC,OAA4C,iBAC/E,IAAC;QACC,WAAWE,GAAG,sDAAsDH;QACnE,GAAGC,KAAK;;AAGbM,aAAa,WAAW,GAAG;AAE3B,MAAMC,eAAe,CAAC,EAACR,SAAS,EAAE,GAAGC,OAA4C,iBAC/E,IAAC;QACC,WAAWE,GAAG,iEAAiEH;QAC9E,GAAGC,KAAK;;AAGbO,aAAa,WAAW,GAAG;AAE3B,MAAMC,cAAc,WAAdA,GAAcV,WAGlB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,OAAqB;QACpB,KAAKQ;QACL,WAAWC,GAAG,qDAAqDH;QAClE,GAAGC,KAAK;;AAGbQ,YAAY,WAAW,GAAGf,MAAAA,WAAiC;AAE3D,MAAMgB,oBAAoB,WAApBA,GAAoBX,WAGxB,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACR,aAA2B;QAC1B,KAAKQ;QACL,WAAWC,GAAG,kDAAkDH;QAC/D,GAAGC,KAAK;;AAGbS,kBAAkB,WAAW,GAAGhB,YAAAA,WAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/dot-background.js","sources":["../../../src/components/ui/dot-background.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport {motion} from \"motion/react\";\r\nimport React, {useEffect, useId, useRef, useState} from \"react\";\r\n\r\n/**\r\n * DotBackground Component Props\r\n * @param width The horizontal spacing between dots\r\n * @param height The vertical spacing between dots\r\n * @param x The x-offset of the entire pattern\r\n * @param y The y-offset of the entire pattern\r\n * @param cx The x-offset of individual dots\r\n * @param cy The y-offset of individual dots\r\n * @param cr The radius of each dot\r\n * @param className Additional CSS classes to apply to the SVG container\r\n * @param glow Whether dots should have a glowing animation effect\r\n */\r\ninterface DotBackgroundProps extends React.SVGProps<SVGSVGElement> {\r\n width?: number;\r\n height?: number;\r\n x?: number;\r\n y?: number;\r\n cx?: number;\r\n cy?: number;\r\n cr?: number;\r\n className?: string;\r\n glow?: boolean;\r\n [key: string]: unknown;\r\n}\r\n\r\n/**\r\n * DotBackground Component\r\n * A React component that creates an animated or static dot pattern background using SVG.\r\n * The pattern automatically adjusts to fill its container and can optionally display glowing dots.\r\n * @see DotBackgroundProps for the props interface.\r\n * @example\r\n * // Basic usage\r\n * <DotBackground />\r\n *\r\n * // With glowing effect and custom spacing\r\n * <DotBackground\r\n * width={20}\r\n * height={20}\r\n * glow={true}\r\n * className=\"opacity-50\"\r\n * />\r\n *@summary Summary:\r\n * - The component is client-side only (\"use client\")\r\n * - Automatically responds to container size changes\r\n * - When glow is enabled, dots will animate with random delays and durations\r\n * - Uses Motion for animations\r\n * - Dots color can be controlled via the text color utility classes\r\n */\r\n\r\nexport function DotBackground({\r\n width = 16,\r\n height = 16,\r\n x = 0,\r\n y = 0,\r\n cx = 1,\r\n cy = 1,\r\n cr = 1,\r\n className,\r\n glow = false,\r\n ...props\r\n}: DotBackgroundProps) {\r\n const id = useId();\r\n const containerRef = useRef<SVGSVGElement>(null);\r\n const [dimensions, setDimensions] = useState({width: 0, height: 0});\r\n\r\n useEffect(() => {\r\n const updateDimensions = () => {\r\n if (containerRef.current) {\r\n const {width, height} = containerRef.current.getBoundingClientRect();\r\n setDimensions({width, height});\r\n }\r\n };\r\n\r\n updateDimensions();\r\n window.addEventListener(\"resize\", updateDimensions);\r\n return () => window.removeEventListener(\"resize\", updateDimensions);\r\n }, []);\r\n\r\n const dots = Array.from(\r\n {\r\n length: Math.ceil(dimensions.width / width) * Math.ceil(dimensions.height / height),\r\n },\r\n (_, i) => {\r\n const col = i % Math.ceil(dimensions.width / width);\r\n const row = Math.floor(i / Math.ceil(dimensions.width / width));\r\n return {\r\n x: col * width + cx,\r\n y: row * height + cy,\r\n delay: Math.random() * 5,\r\n duration: Math.random() * 3 + 2,\r\n };\r\n },\r\n );\r\n\r\n return (\r\n <svg\r\n ref={containerRef}\r\n aria-hidden='true'\r\n className={cn(\"pointer-events-none absolute inset-0 h-full w-full\", className)}\r\n {...props}>\r\n <defs>\r\n <radialGradient id={`${id}-gradient`}>\r\n <stop\r\n offset='0%'\r\n stopColor='currentColor'\r\n stopOpacity='1'\r\n />\r\n <stop\r\n offset='100%'\r\n stopColor='currentColor'\r\n stopOpacity='0'\r\n />\r\n </radialGradient>\r\n </defs>\r\n {dots.map((dot) => (\r\n <motion.circle\r\n key={`${dot.x}-${dot.y}`}\r\n cx={dot.x}\r\n cy={dot.y}\r\n r={cr}\r\n fill={glow ? `url(#${id}-gradient)` : \"currentColor\"}\r\n className='text-neutral-400/80'\r\n initial={glow ? {opacity: 0.4, scale: 1} : {}}\r\n animate={\r\n glow\r\n ? {\r\n opacity: [0.4, 1, 0.4],\r\n scale: [1, 1.5, 1],\r\n }\r\n : {}\r\n }\r\n transition={\r\n glow\r\n ? {\r\n duration: dot.duration,\r\n repeat: Infinity,\r\n repeatType: \"reverse\",\r\n delay: dot.delay,\r\n ease: \"easeInOut\",\r\n }\r\n : {}\r\n }\r\n />\r\n ))}\r\n </svg>\r\n );\r\n}\r\n"],"names":["DotBackground","width","height","x","y","cx","cy","cr","className","glow","props","id","useId","containerRef","useRef","dimensions","setDimensions","useState","useEffect","updateDimensions","window","dots","Array","Math","_","i","col","row","cn","dot","motion","Infinity"],"mappings":";;;;;AAuDO,SAASA,cAAc,EAC5BC,QAAQ,EAAE,EACVC,SAAS,EAAE,EACXC,IAAI,CAAC,EACLC,IAAI,CAAC,EACLC,KAAK,CAAC,EACNC,KAAK,CAAC,EACNC,KAAK,CAAC,EACNC,SAAS,EACTC,OAAO,KAAK,EACZ,GAAGC,OACgB;IACnB,MAAMC,KAAKC;IACX,MAAMC,eAAeC,OAAsB;IAC3C,MAAM,CAACC,YAAYC,cAAc,GAAGC,SAAS;QAAC,OAAO;QAAG,QAAQ;IAAC;IAEjEC,UAAU;QACR,MAAMC,mBAAmB;YACvB,IAAIN,aAAa,OAAO,EAAE;gBACxB,MAAM,EAACZ,KAAK,EAAEC,MAAM,EAAC,GAAGW,aAAa,OAAO,CAAC,qBAAqB;gBAClEG,cAAc;oBAACf;oBAAOC;gBAAM;YAC9B;QACF;QAEAiB;QACAC,OAAO,gBAAgB,CAAC,UAAUD;QAClC,OAAO,IAAMC,OAAO,mBAAmB,CAAC,UAAUD;IACpD,GAAG,EAAE;IAEL,MAAME,OAAOC,MAAM,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oBACR,IACA,CAAC;mBAxBF,GAAGA,IAAI,CAAC,CAAC,CAAC,EAAEA,IAAI,CAAC,EAAE;;;AA8BlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components
|
|
1
|
+
{"version":3,"file":"components/ui/drawer.js","sources":["../../../src/components/ui/drawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\nimport {Drawer as DrawerPrimitive} from \"vaul\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst Drawer = ({shouldScaleBackground = true, ...props}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\r\n <DrawerPrimitive.Root\r\n shouldScaleBackground={shouldScaleBackground}\r\n {...props}\r\n />\r\n);\r\nDrawer.displayName = \"Drawer\";\r\n\r\nconst DrawerTrigger = DrawerPrimitive.Trigger;\r\n\r\nconst DrawerPortal = DrawerPrimitive.Portal;\r\n\r\nconst DrawerClose = DrawerPrimitive.Close;\r\n\r\nconst DrawerOverlay = React.forwardRef<\r\n React.ComponentRef<typeof DrawerPrimitive.Overlay>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\r\n>(({className, ...props}, ref) => (\r\n <DrawerPrimitive.Overlay\r\n ref={ref}\r\n className={cn(\"fixed inset-0 z-50 bg-black/80\", className)}\r\n {...props}\r\n />\r\n));\r\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\r\n\r\nconst DrawerContent = React.forwardRef<\r\n React.ComponentRef<typeof DrawerPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>\r\n>(({className, children, ...props}, ref) => (\r\n <DrawerPortal>\r\n <DrawerOverlay />\r\n <DrawerPrimitive.Content\r\n ref={ref}\r\n className={cn(\r\n \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-950\",\r\n className,\r\n )}\r\n {...props}>\r\n <div className='mx-auto mt-4 h-2 w-[100px] rounded-full bg-neutral-100 dark:bg-neutral-800' />\r\n {children}\r\n </DrawerPrimitive.Content>\r\n </DrawerPortal>\r\n));\r\nDrawerContent.displayName = \"DrawerContent\";\r\n\r\nconst DrawerHeader = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)}\r\n {...props}\r\n />\r\n);\r\nDrawerHeader.displayName = \"DrawerHeader\";\r\n\r\nconst DrawerFooter = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => (\r\n <div\r\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\r\n {...props}\r\n />\r\n);\r\nDrawerFooter.displayName = \"DrawerFooter\";\r\n\r\nconst DrawerTitle = React.forwardRef<\r\n React.ComponentRef<typeof DrawerPrimitive.Title>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\r\n>(({className, ...props}, ref) => (\r\n <DrawerPrimitive.Title\r\n ref={ref}\r\n className={cn(\"text-lg leading-none font-semibold tracking-tight\", className)}\r\n {...props}\r\n />\r\n));\r\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\r\n\r\nconst DrawerDescription = React.forwardRef<\r\n React.ComponentRef<typeof DrawerPrimitive.Description>,\r\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\r\n>(({className, ...props}, ref) => (\r\n <DrawerPrimitive.Description\r\n ref={ref}\r\n className={cn(\"text-sm text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}\r\n />\r\n));\r\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\r\n\r\nexport {\r\n Drawer,\r\n DrawerClose,\r\n DrawerContent,\r\n DrawerDescription,\r\n DrawerFooter,\r\n DrawerHeader,\r\n DrawerOverlay,\r\n DrawerPortal,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n};\r\n"],"names":["Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","React","className","ref","cn","DrawerContent","children","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":";;;;;AAOA,MAAMA,gBAAS,CAAC,EAACC,wBAAwB,IAAI,EAAE,GAAGC,OAAyD,iBACzG,IAACC,OAAAA,IAAoB;QACnB,uBAAuBF;QACtB,GAAGC,KAAK;;AAGbF,cAAO,WAAW,GAAG;AAErB,MAAMI,gBAAgBD,OAAAA,OAAuB;AAE7C,MAAME,eAAeF,OAAAA,MAAsB;AAE3C,MAAMG,cAAcH,OAAAA,KAAqB;AAEzC,MAAMI,gBAAgB,WAAhBA,GAAgBC,WAGpB,CAAC,EAACC,SAAS,EAAE,GAAGP,OAAM,EAAEQ,MAAAA,WAAAA,GACxB,IAACP,OAAAA,OAAuB;QACtB,KAAKO;QACL,WAAWC,GAAG,kCAAkCF;QAC/C,GAAGP,KAAK;;AAGbK,cAAc,WAAW,GAAGJ,OAAAA,OAAAA,CAAAA,WAAmC;AAE/D,MAAMS,gBAAgB,WAAhBA,GAAgBJ,WAGpB,CAAC,EAACC,SAAS,EAAEI,QAAQ,EAAE,GAAGX,OAAM,EAAEQ,MAAAA,WAAAA,GAClC,KAACL,cAAAA;;0BACC,IAACE,eAAAA,CAAAA;0BACD,KAACJ,OAAAA,OAAuB;gBACtB,KAAKO;gBACL,WAAWC,GACT,4JACAF;gBAED,GAAGP,KAAK;;kCACT,IAAC;wBAAI,WAAU;;oBACdW;;;;;AAIPD,cAAc,WAAW,GAAG;AAE5B,MAAME,eAAe,CAAC,EAACL,SAAS,EAAE,GAAGP,OAA4C,iBAC/E,IAAC;QACC,WAAWS,GAAG,6CAA6CF;QAC1D,GAAGP,KAAK;;AAGbY,aAAa,WAAW,GAAG;AAE3B,MAAMC,eAAe,CAAC,EAACN,SAAS,EAAE,GAAGP,OAA4C,iBAC/E,IAAC;QACC,WAAWS,GAAG,mCAAmCF;QAChD,GAAGP,KAAK;;AAGba,aAAa,WAAW,GAAG;AAE3B,MAAMC,cAAc,WAAdA,GAAcR,WAGlB,CAAC,EAACC,SAAS,EAAE,GAAGP,OAAM,EAAEQ,MAAAA,WAAAA,GACxB,IAACP,OAAAA,KAAqB;QACpB,KAAKO;QACL,WAAWC,GAAG,qDAAqDF;QAClE,GAAGP,KAAK;;AAGbc,YAAY,WAAW,GAAGb,OAAAA,KAAAA,CAAAA,WAAiC;AAE3D,MAAMc,oBAAoB,WAApBA,GAAoBT,WAGxB,CAAC,EAACC,SAAS,EAAE,GAAGP,OAAM,EAAEQ,MAAAA,WAAAA,GACxB,IAACP,OAAAA,WAA2B;QAC1B,KAAKO;QACL,WAAWC,GAAG,kDAAkDF;QAC/D,GAAGP,KAAK;;AAGbe,kBAAkB,WAAW,GAAGd,OAAAA,WAAAA,CAAAA,WAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\dropdown-menu.js","sources":["webpack://@arolariu/components/./src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\r\n\r\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\r\nimport {Check, ChevronRight, Circle} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst DropdownMenu = DropdownMenuPrimitive.Root;\r\n\r\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\r\n\r\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\r\n\r\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\r\n\r\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\r\n\r\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\r\n\r\nconst DropdownMenuSubTrigger = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, children, ...props}, ref) => (\r\n <DropdownMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 data-[state=open]:bg-neutral-100 dark:focus:bg-neutral-800 dark:data-[state=open]:bg-neutral-800 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <ChevronRight className='ml-auto' />\r\n </DropdownMenuPrimitive.SubTrigger>\r\n));\r\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst DropdownMenuSubContent = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\r\n>(({className, ...props}, ref) => (\r\n <DropdownMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\r\n\r\nconst DropdownMenuContent = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\r\n>(({className, sideOffset = 4, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Portal>\r\n <DropdownMenuPrimitive.Content\r\n ref={ref}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </DropdownMenuPrimitive.Portal>\r\n));\r\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\r\n\r\nconst DropdownMenuItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 [&>svg]:size-4 [&>svg]:shrink-0\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\r\n\r\nconst DropdownMenuCheckboxItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\r\n>(({className, children, checked, ...props}, ref) => (\r\n <DropdownMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <DropdownMenuPrimitive.ItemIndicator>\r\n <Check className='h-4 w-4' />\r\n </DropdownMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </DropdownMenuPrimitive.CheckboxItem>\r\n));\r\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst DropdownMenuRadioItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\r\n>(({className, children, ...props}, ref) => (\r\n <DropdownMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <DropdownMenuPrimitive.ItemIndicator>\r\n <Circle className='h-2 w-2 fill-current' />\r\n </DropdownMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </DropdownMenuPrimitive.RadioItem>\r\n));\r\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\r\n\r\nconst DropdownMenuLabel = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Label\r\n ref={ref}\r\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\r\n\r\nconst DropdownMenuSeparator = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\r\n>(({className, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800\", className)}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\r\n\r\nconst DropdownMenuShortcut = ({className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return (\r\n <span\r\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\r\n {...props}\r\n />\r\n );\r\n};\r\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\r\n\r\nexport {\r\n DropdownMenu,\r\n DropdownMenuCheckboxItem,\r\n DropdownMenuContent,\r\n DropdownMenuGroup,\r\n DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuPortal,\r\n DropdownMenuRadioGroup,\r\n DropdownMenuRadioItem,\r\n DropdownMenuSeparator,\r\n DropdownMenuShortcut,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuTrigger,\r\n};\r\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","cn","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;;AAQA,MAAMA,eAAeC;AAErB,MAAMC,sBAAsBD;AAE5B,MAAME,oBAAoBF;AAE1B,MAAMG,qBAAqBH;AAE3B,MAAMI,kBAAkBJ;AAExB,MAAMK,yBAAyBL;AAE/B,MAAMM,yBAAyB,WAAzBA,GAAyBC,WAK7B,CAAC,EAACC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACzC,KAACZ,YAAgC;QAC/B,KAAKY;QACL,WAAWC,GACT,oRACAJ,SAAS,QACTD;QAED,GAAGG,KAAK;;YACRD;0BACD,IAACI,cAAYA;gBAAC,WAAU;;;;AAG5BR,uBAAuB,WAAW,GAAGN,WAAAA,WAA4C;AAEjF,MAAMe,yBAAyB,WAAzBA,GAAyBR,WAG7B,CAAC,EAACC,SAAS,EAAE,GAAGG,OAAM,EAAEC,MAAAA,WAAAA,GACxB,IAACZ,YAAgC;QAC/B,KAAKY;QACL,WAAWC,GACT,4jBACAL;QAED,GAAGG,KAAK;;AAGbI,uBAAuB,WAAW,GAAGf,WAAAA,WAA4C;AAEjF,MAAMgB,sBAAsB,WAAtBA,GAAsBT,WAG1B,CAAC,EAACC,SAAS,EAAES,aAAa,CAAC,EAAE,GAAGN,OAAM,EAAEC,MAAAA,WAAAA,GACxC,IAACZ,QAA4B;kBAC3B,kBAACA,SAA6B;YAC5B,KAAKY;YACL,YAAYK;YACZ,WAAWJ,GACT,iQACA,4YACAL;YAED,GAAGG,KAAK;;;AAIfK,oBAAoB,WAAW,GAAGhB,QAAAA,WAAyC;AAE3E,MAAMkB,mBAAmB,WAAnBA,GAAmBX,WAKvB,CAAC,EAACC,SAAS,EAAEC,KAAK,EAAE,GAAGE,OAAM,EAAEC,MAAAA,WAAAA,GAC/B,IAACZ,MAA0B;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AWC,GAAG,sDAAsDL;QACnE,GAAGG,KAAK;;AAGbc,sBAAsB,WAAW,GAAGzB,UAAAA,WAA2C;AAE/E,MAAM0B,uBAAuB,CAAC,EAAClB,SAAS,EAAE,GAAGG,OAA6C,GACjF,WAAP,GACE,IAAC;QACC,WAAWE,GAAG,8CAA8CL;QAC3D,GAAGG,KAAK;;AAIfe,qBAAqB,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"file":"components/ui/dropdown-menu.js","sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\r\nimport {Check, ChevronRight, Circle} from \"lucide-react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst DropdownMenu = DropdownMenuPrimitive.Root;\r\n\r\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\r\n\r\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\r\n\r\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\r\n\r\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\r\n\r\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\r\n\r\nconst DropdownMenuSubTrigger = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, children, ...props}, ref) => (\r\n <DropdownMenuPrimitive.SubTrigger\r\n ref={ref}\r\n className={cn(\r\n \"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 data-[state=open]:bg-neutral-100 dark:focus:bg-neutral-800 dark:data-[state=open]:bg-neutral-800 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n <ChevronRight className='ml-auto' />\r\n </DropdownMenuPrimitive.SubTrigger>\r\n));\r\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;\r\n\r\nconst DropdownMenuSubContent = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\r\n>(({className, ...props}, ref) => (\r\n <DropdownMenuPrimitive.SubContent\r\n ref={ref}\r\n className={cn(\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;\r\n\r\nconst DropdownMenuContent = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\r\n>(({className, sideOffset = 4, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Portal>\r\n <DropdownMenuPrimitive.Content\r\n ref={ref}\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-x-hidden overflow-y-auto rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50\",\r\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n </DropdownMenuPrimitive.Portal>\r\n));\r\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\r\n\r\nconst DropdownMenuItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Item\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50 [&>svg]:size-4 [&>svg]:shrink-0\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\r\n\r\nconst DropdownMenuCheckboxItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\r\n>(({className, children, checked, ...props}, ref) => (\r\n <DropdownMenuPrimitive.CheckboxItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n checked={checked}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <DropdownMenuPrimitive.ItemIndicator>\r\n <Check className='h-4 w-4' />\r\n </DropdownMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </DropdownMenuPrimitive.CheckboxItem>\r\n));\r\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\r\n\r\nconst DropdownMenuRadioItem = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\r\n>(({className, children, ...props}, ref) => (\r\n <DropdownMenuPrimitive.RadioItem\r\n ref={ref}\r\n className={cn(\r\n \"relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50\",\r\n className,\r\n )}\r\n {...props}>\r\n <span className='absolute left-2 flex h-3.5 w-3.5 items-center justify-center'>\r\n <DropdownMenuPrimitive.ItemIndicator>\r\n <Circle className='h-2 w-2 fill-current' />\r\n </DropdownMenuPrimitive.ItemIndicator>\r\n </span>\r\n {children}\r\n </DropdownMenuPrimitive.RadioItem>\r\n));\r\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\r\n\r\nconst DropdownMenuLabel = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\r\n inset?: boolean;\r\n }\r\n>(({className, inset, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Label\r\n ref={ref}\r\n className={cn(\"px-2 py-1.5 text-sm font-semibold\", inset && \"pl-8\", className)}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\r\n\r\nconst DropdownMenuSeparator = React.forwardRef<\r\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\r\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\r\n>(({className, ...props}, ref) => (\r\n <DropdownMenuPrimitive.Separator\r\n ref={ref}\r\n className={cn(\"-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800\", className)}\r\n {...props}\r\n />\r\n));\r\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\r\n\r\nconst DropdownMenuShortcut = ({className, ...props}: React.HTMLAttributes<HTMLSpanElement>) => {\r\n return (\r\n <span\r\n className={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\r\n {...props}\r\n />\r\n );\r\n};\r\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\r\n\r\nexport {\r\n DropdownMenu,\r\n DropdownMenuCheckboxItem,\r\n DropdownMenuContent,\r\n DropdownMenuGroup,\r\n DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuPortal,\r\n DropdownMenuRadioGroup,\r\n DropdownMenuRadioItem,\r\n DropdownMenuSeparator,\r\n DropdownMenuShortcut,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuTrigger,\r\n};\r\n"],"names":["DropdownMenu","DropdownMenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","React","className","inset","children","props","ref","cn","ChevronRight","DropdownMenuSubContent","DropdownMenuContent","sideOffset","DropdownMenuItem","DropdownMenuCheckboxItem","checked","Check","DropdownMenuRadioItem","Circle","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut"],"mappings":";;;;;;AAQA,MAAMA,eAAeC;AAErB,MAAMC,sBAAsBD;AAE5B,MAAME,oBAAoBF;AAE1B,MAAMG,qBAAqBH;AAE3B,MAAMI,kBAAkBJ;AAExB,MAAMK,yBAAyBL;AAE/B,MAAMM,yBAAyB,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|
-
{"version":3,"file":"components\\ui\\dropdrawer.js","sources":["webpack://@arolariu/components/./src/components/ui/dropdrawer.tsx"],"sourcesContent":["\r\n\r\n/* eslint-disable */\r\n\r\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport {AnimatePresence, motion, Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Drawer, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger} from \"@/components/ui/drawer\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuSeparator,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuTrigger,\r\n} from \"@/components/ui/dropdown-menu\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst DropDrawerContext = React.createContext<{isMobile: boolean}>({\r\n isMobile: false,\r\n});\r\n\r\nconst useDropDrawerContext = () => {\r\n const context = React.useContext(DropDrawerContext);\r\n if (!context) {\r\n throw new Error(\"DropDrawer components cannot be rendered outside the Context\");\r\n }\r\n return context;\r\n};\r\n\r\nfunction DropDrawer({children, ...props}: React.ComponentProps<typeof Drawer> | React.ComponentProps<typeof DropdownMenu>) {\r\n const isMobile = useIsMobile();\r\n const DropdownComponent = isMobile ? Drawer : DropdownMenu;\r\n\r\n return (\r\n <DropDrawerContext.Provider value={{isMobile}}>\r\n <DropdownComponent\r\n data-slot='drop-drawer'\r\n {...(isMobile && {autoFocus: true})}\r\n {...props}>\r\n {children}\r\n </DropdownComponent>\r\n </DropDrawerContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerTrigger({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerTrigger> | React.ComponentProps<typeof DropdownMenuTrigger>) {\r\n const {isMobile} = useDropDrawerContext();\r\n const TriggerComponent = isMobile ? DrawerTrigger : DropdownMenuTrigger;\r\n\r\n return (\r\n <TriggerComponent\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </TriggerComponent>\r\n );\r\n}\r\n\r\nfunction DropDrawerContent({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerContent> | React.ComponentProps<typeof DropdownMenuContent>) {\r\n const {isMobile} = useDropDrawerContext();\r\n const [activeSubmenu, setActiveSubmenu] = React.useState<string | null>(null);\r\n const [submenuTitle, setSubmenuTitle] = React.useState<string | null>(null);\r\n const [submenuStack, setSubmenuStack] = React.useState<{id: string; title: string}[]>([]);\r\n // Add animation direction state\r\n const [animationDirection, setAnimationDirection] = React.useState<\"forward\" | \"backward\">(\"forward\");\r\n\r\n // Create a ref to store submenu content by ID\r\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(new Map());\r\n\r\n // Function to navigate to a submenu\r\n const navigateToSubmenu = React.useCallback((id: string, title: string) => {\r\n // Set animation direction to forward when navigating to a submenu\r\n setAnimationDirection(\"forward\");\r\n setActiveSubmenu(id);\r\n setSubmenuTitle(title);\r\n setSubmenuStack((prev) => [...prev, {id, title}]);\r\n }, []);\r\n\r\n // Function to go back to previous menu\r\n const goBack = React.useCallback(() => {\r\n // Set animation direction to backward when going back\r\n setAnimationDirection(\"backward\");\r\n\r\n if (submenuStack.length <= 1) {\r\n // If we're at the first level, go back to main menu\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n } else {\r\n // Go back to previous submenu\r\n const newStack = [...submenuStack];\r\n newStack.pop(); // Remove current\r\n const previous = newStack[newStack.length - 1];\r\n setActiveSubmenu(previous.id);\r\n setSubmenuTitle(previous.title);\r\n setSubmenuStack(newStack);\r\n }\r\n }, [submenuStack]);\r\n\r\n // Function to register submenu content\r\n const registerSubmenuContent = React.useCallback((id: string, content: React.ReactNode[]) => {\r\n submenuContentRef.current.set(id, content);\r\n }, []);\r\n\r\n // Function to extract submenu content\r\n const extractSubmenuContent = React.useCallback((elements: React.ReactNode, targetId: string): React.ReactNode[] => {\r\n const result: React.ReactNode[] = [];\r\n\r\n // Recursive function to search through all children\r\n const findSubmenuContent = (node: React.ReactNode) => {\r\n // Skip if not a valid element\r\n if (!React.isValidElement(node)) return;\r\n\r\n const element = node as React.ReactElement;\r\n // Use a more specific type to avoid 'any'\r\n const props = element.props as {\r\n id?: string;\r\n \"data-submenu-id\"?: string;\r\n children?: React.ReactNode;\r\n };\r\n\r\n // Check if this is a DropDrawerSub\r\n if (element.type === DropDrawerSub) {\r\n // Get all possible ID values\r\n const elementId = props.id;\r\n const dataSubmenuId = props[\"data-submenu-id\"];\r\n\r\n // If this is the submenu we're looking for\r\n if (elementId === targetId || dataSubmenuId === targetId) {\r\n // Find the SubContent within this Sub\r\n if (props.children) {\r\n React.Children.forEach(props.children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n const subContentProps = child.props as {\r\n children?: React.ReactNode;\r\n };\r\n if (subContentProps.children) {\r\n React.Children.forEach(subContentProps.children, (contentChild) => {\r\n result.push(contentChild);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n return; // Found what we needed, no need to search deeper\r\n }\r\n }\r\n\r\n // If this element has children, search through them\r\n if (props.children) {\r\n if (Array.isArray(props.children)) {\r\n props.children.forEach((child: React.ReactNode) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(props.children);\r\n }\r\n }\r\n };\r\n\r\n // Start the search from the root elements\r\n if (Array.isArray(elements)) {\r\n elements.forEach((child) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(elements);\r\n }\r\n\r\n return result;\r\n }, []);\r\n\r\n // Get submenu content (either from cache or extract it)\r\n const getSubmenuContent = React.useCallback(\r\n (id: string) => {\r\n // Check if we have the content in our ref\r\n const cachedContent = submenuContentRef.current.get(id || \"\");\r\n if (cachedContent && cachedContent.length > 0) {\r\n return cachedContent;\r\n }\r\n\r\n // If not in cache, extract it\r\n const submenuContent = extractSubmenuContent(children, id);\r\n\r\n if (submenuContent.length === 0) {\r\n return [];\r\n }\r\n\r\n // Store in cache for future use\r\n if (id) {\r\n submenuContentRef.current.set(id, submenuContent);\r\n }\r\n\r\n return submenuContent;\r\n },\r\n [children, extractSubmenuContent],\r\n );\r\n\r\n // Animation variants for Framer Motion\r\n const variants = {\r\n enter: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\r\n opacity: 0,\r\n }),\r\n center: {\r\n x: 0,\r\n opacity: 1,\r\n },\r\n exit: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\r\n opacity: 0,\r\n }),\r\n };\r\n\r\n // Animation transition\r\n const transition = {\r\n duration: 0.3,\r\n ease: [0.25, 0.1, 0.25, 1.0], // cubic-bezier easing\r\n } satisfies Transition;\r\n\r\n if (isMobile) {\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n setActiveSubmenu: (id) => {\r\n if (id === null) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n }\r\n },\r\n submenuTitle,\r\n setSubmenuTitle,\r\n navigateToSubmenu,\r\n registerSubmenuContent,\r\n }}>\r\n <DrawerContent\r\n data-slot='drop-drawer-content'\r\n className={cn(\"max-h-[90vh]\", className)}\r\n {...props}>\r\n {activeSubmenu ? (\r\n <>\r\n <DrawerHeader>\r\n <div className='flex items-center gap-2'>\r\n <button\r\n onClick={goBack}\r\n className='rounded-full p-1 hover:bg-neutral-100/50 dark:hover:bg-neutral-800/50'>\r\n <ChevronLeftIcon className='h-5 w-5' />\r\n </button>\r\n <DrawerTitle>{submenuTitle || \"Submenu\"}</DrawerTitle>\r\n </div>\r\n </DrawerHeader>\r\n <div className='relative max-h-[70vh] flex-1 overflow-y-auto'>\r\n {/* Use AnimatePresence to handle exit animations */}\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key={activeSubmenu || \"main\"}\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className='h-full w-full space-y-1.5 pb-6'>\r\n {activeSubmenu ? getSubmenuContent(activeSubmenu) : children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <DrawerHeader className='sr-only'>\r\n <DrawerTitle>Menu</DrawerTitle>\r\n </DrawerHeader>\r\n <div className='max-h-[70vh] overflow-y-auto'>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key='main-menu'\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className='w-full space-y-1.5 pb-6'>\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n )}\r\n </DrawerContent>\r\n </SubmenuContext.Provider>\r\n );\r\n }\r\n\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n setActiveSubmenu,\r\n submenuTitle,\r\n setSubmenuTitle,\r\n registerSubmenuContent,\r\n }}>\r\n <DropdownMenuContent\r\n data-slot='drop-drawer-content'\r\n align='end'\r\n sideOffset={4}\r\n className={cn(\"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\", className)}\r\n {...props}>\r\n {children}\r\n </DropdownMenuContent>\r\n </SubmenuContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerItem({\r\n className,\r\n children,\r\n onSelect,\r\n onClick,\r\n icon,\r\n inset,\r\n disabled,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuItem> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n if (disabled) return;\r\n if (onClick) onClick(e);\r\n if (onSelect) onSelect(e as unknown as Event);\r\n };\r\n\r\n // Only wrap in DrawerClose if it's not a submenu item\r\n const content = (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n data-disabled={disabled}\r\n className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n disabled && \"pointer-events-none opacity-50\",\r\n className,\r\n )}\r\n onClick={handleClick}\r\n aria-disabled={disabled}\r\n {...props}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n {icon && <div className='flex-shrink-0'>{icon}</div>}\r\n </div>\r\n );\r\n\r\n // Check if this is inside a submenu\r\n const isInSubmenu =\r\n (props as Record<string, unknown>)[\"data-parent-submenu-id\"] || (props as Record<string, unknown>)[\"data-parent-submenu\"];\r\n\r\n if (isInSubmenu) {\r\n return content;\r\n }\r\n\r\n return <DrawerClose asChild>{content}</DrawerClose>;\r\n }\r\n\r\n return (\r\n <DropdownMenuItem\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n className={className}\r\n onSelect={onSelect}\r\n onClick={onClick as React.MouseEventHandler<HTMLDivElement>}\r\n inset={inset}\r\n disabled={disabled}\r\n {...props}>\r\n <div className='flex w-full items-center justify-between'>\r\n <div>{children}</div>\r\n {icon && <div>{icon}</div>}\r\n </div>\r\n </DropdownMenuItem>\r\n );\r\n}\r\n\r\nfunction DropDrawerSeparator({className, ...props}: React.ComponentProps<typeof DropdownMenuSeparator>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // For mobile, render a simple divider\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n // For desktop, use the standard dropdown separator\r\n return (\r\n <DropdownMenuSeparator\r\n data-slot='drop-drawer-separator'\r\n className={className}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction DropDrawerLabel({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuLabel> | React.ComponentProps<typeof DrawerTitle>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerHeader className='p-0'>\r\n <DrawerTitle\r\n data-slot='drop-drawer-label'\r\n className={cn(\"px-4 py-2 text-sm font-medium text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerTitle>\r\n </DrawerHeader>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuLabel\r\n data-slot='drop-drawer-label'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\nfunction DropDrawerFooter({className, children, ...props}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerFooter\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-4\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerFooter>\r\n );\r\n }\r\n\r\n // No direct equivalent in DropdownMenu, so we'll just render a div\r\n return (\r\n <div\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-2\", className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\nfunction DropDrawerGroup({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n children: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Add separators between children on mobile\r\n const childrenWithSeparators = React.useMemo(() => {\r\n if (!isMobile) return children;\r\n\r\n const childArray = React.Children.toArray(children);\r\n\r\n // Filter out any existing separators\r\n const filteredChildren = childArray.filter((child) => React.isValidElement(child) && child.type !== DropDrawerSeparator);\r\n\r\n // Add separators between items\r\n return filteredChildren.flatMap((child, index) => {\r\n if (index === filteredChildren.length - 1) return [child];\r\n return [\r\n child,\r\n <div\r\n key={`separator-${index}`}\r\n className='h-px bg-neutral-200 dark:bg-neutral-800'\r\n aria-hidden='true'\r\n />,\r\n ];\r\n });\r\n }, [children, isMobile]);\r\n\r\n if (isMobile) {\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={cn(\r\n \"mx-2 my-3 overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {childrenWithSeparators}\r\n </div>\r\n );\r\n }\r\n\r\n // On desktop, use a div with proper role and attributes\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\n// Context for managing submenu state on mobile\r\ninterface SubmenuContextType {\r\n activeSubmenu: string | null;\r\n setActiveSubmenu: (id: string | null) => void;\r\n submenuTitle: string | null;\r\n setSubmenuTitle: (title: string | null) => void;\r\n navigateToSubmenu?: (id: string, title: string) => void;\r\n registerSubmenuContent?: (id: string, content: React.ReactNode[]) => void;\r\n}\r\n\r\nconst SubmenuContext = React.createContext<SubmenuContextType>({\r\n activeSubmenu: null,\r\n setActiveSubmenu: () => {},\r\n submenuTitle: null,\r\n setSubmenuTitle: () => {},\r\n navigateToSubmenu: undefined,\r\n registerSubmenuContent: undefined,\r\n});\r\n\r\n// Submenu components\r\n// Counter for generating simple numeric IDs\r\nlet submenuIdCounter = 0;\r\n\r\nfunction DropDrawerSub({\r\n children,\r\n id,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSub> & {\r\n id?: string;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {registerSubmenuContent} = React.useContext(SubmenuContext);\r\n\r\n // Generate a simple numeric ID instead of using React.useId()\r\n const [generatedId] = React.useState(() => `submenu-${submenuIdCounter++}`);\r\n const submenuId = id || generatedId;\r\n\r\n // Extract submenu content to register with parent\r\n React.useEffect(() => {\r\n if (!registerSubmenuContent) return;\r\n\r\n // Find the SubContent within this Sub\r\n const contentItems: React.ReactNode[] = [];\r\n React.Children.forEach(children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n React.Children.forEach((child.props as {children?: React.ReactNode}).children, (contentChild) => {\r\n contentItems.push(contentChild);\r\n });\r\n }\r\n });\r\n\r\n // Register the content with the parent\r\n if (contentItems.length > 0) {\r\n registerSubmenuContent(submenuId, contentItems);\r\n }\r\n }, [children, registerSubmenuContent, submenuId]);\r\n\r\n if (isMobile) {\r\n // For mobile, we'll use the context to manage submenu state\r\n // Process children to pass the submenu ID to the trigger and content\r\n const processedChildren = React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child;\r\n\r\n if (child.type === DropDrawerSubTrigger) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\r\n );\r\n }\r\n\r\n if (child.type === DropDrawerSubContent) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\r\n );\r\n }\r\n\r\n return child;\r\n });\r\n\r\n return (\r\n <div\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n id={submenuId}>\r\n {processedChildren}\r\n </div>\r\n );\r\n }\r\n\r\n // For desktop, pass the generated ID to the DropdownMenuSub\r\n return (\r\n <DropdownMenuSub\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n // Don't pass id to DropdownMenuSub as it doesn't accept this prop\r\n {...props}>\r\n {children}\r\n </DropdownMenuSub>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubTrigger({\r\n className,\r\n inset,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {navigateToSubmenu} = React.useContext(SubmenuContext);\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n // Find the parent submenu ID\r\n const handleClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n // Get the closest parent with data-submenu-id attribute\r\n const element = e.currentTarget as HTMLElement;\r\n let submenuId: string | null = null;\r\n\r\n // First check if the element itself has the data attribute\r\n if (element.closest(\"[data-submenu-id]\")) {\r\n const closestElement = element.closest(\"[data-submenu-id]\");\r\n const id = closestElement?.getAttribute(\"data-submenu-id\");\r\n if (id) {\r\n submenuId = id;\r\n }\r\n }\r\n\r\n // If not found, try props\r\n if (!submenuId) {\r\n submenuId =\r\n ((props as Record<string, unknown>)[\"data-parent-submenu-id\"] as string)\r\n || ((props as Record<string, unknown>)[\"data-parent-submenu\"] as string);\r\n }\r\n\r\n if (!submenuId) {\r\n return;\r\n }\r\n\r\n // Get the title\r\n const title = typeof children === \"string\" ? children : \"Submenu\";\r\n\r\n // Navigate to the submenu\r\n if (navigateToSubmenu) {\r\n navigateToSubmenu(submenuId, title);\r\n }\r\n };\r\n\r\n // Combine onClick handlers\r\n const combinedOnClick = (e: React.MouseEvent) => {\r\n // Call the original onClick if provided\r\n const typedProps = props as Record<string, unknown>;\r\n if (typedProps[\"onClick\"]) {\r\n const originalOnClick = typedProps[\"onClick\"] as React.MouseEventHandler<HTMLDivElement>;\r\n originalOnClick(e as React.MouseEvent<HTMLDivElement>);\r\n }\r\n\r\n // Call our navigation handler\r\n handleClick(e);\r\n };\r\n\r\n // Remove onClick from props to avoid duplicate handlers\r\n const {...restProps} = props as Record<string, unknown>;\r\n\r\n // Don't wrap in DrawerClose for submenu triggers\r\n return (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n onClick={combinedOnClick}\r\n {...restProps}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n <ChevronRightIcon className='h-5 w-5' />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSubTrigger\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={className}\r\n inset={inset}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubContent({className, sideOffset = 4, children, ...props}: React.ComponentProps<typeof DropdownMenuSubContent>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n // For mobile, we don't render the content directly\r\n // It will be rendered by the DropDrawerContent component when active\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSubContent\r\n data-slot='drop-drawer-sub-content'\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:border-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubContent>\r\n );\r\n}\r\n\r\nexport {\r\n DropDrawer,\r\n DropDrawerContent,\r\n DropDrawerFooter,\r\n DropDrawerGroup,\r\n DropDrawerItem,\r\n DropDrawerLabel,\r\n DropDrawerSeparator,\r\n DropDrawerSub,\r\n DropDrawerSubContent,\r\n DropDrawerSubTrigger,\r\n DropDrawerTrigger,\r\n};\r\n"],"names":["DropDrawerContext","React","useDropDrawerContext","context","Error","DropDrawer","children","props","isMobile","useIsMobile","DropdownComponent","Drawer","DropdownMenu","DropDrawerTrigger","className","TriggerComponent","DrawerTrigger","DropdownMenuTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","prev","goBack","newStack","previous","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentProps","contentChild","Array","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","SubmenuContext","DrawerContent","cn","DrawerHeader","ChevronLeftIcon","DrawerTitle","AnimatePresence","motion","DropdownMenuContent","DropDrawerItem","onSelect","onClick","icon","inset","disabled","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","setTimeout","clearTimeout","handleClick","e","isInSubmenu","DrawerClose","DropdownMenuItem","DropDrawerSeparator","DropdownMenuSeparator","DropDrawerLabel","DropdownMenuLabel","DropDrawerFooter","DrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","undefined","submenuIdCounter","generatedId","submenuId","contentItems","processedChildren","DropDrawerSubTrigger","DropdownMenuSub","closestElement","combinedOnClick","typedProps","originalOnClick","restProps","ChevronRightIcon","DropdownMenuSubTrigger","sideOffset","DropdownMenuSubContent"],"mappings":";;;;;;;;;AAuBA,MAAMA,oBAAoB,WAApBA,GAAoBC,cAAyC;IACjE,UAAU;AACZ;AAEA,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,WAAiBD;IACjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAElB,OAAOD;AACT;AAEA,SAASE,WAA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;QACZ,WAAW1D;QACX,OAAO0D;QACN,GAAGjE,KAAK;kBACRD;;AAGP;AAEA,SAAS2C,qBAAqB,EAACnC,SAAS,EAAEmG,aAAa,CAAC,EAAE3G,QAAQ,EAAE,GAAGC,OAA2D;IAChI,MAAM,EAACC,QAAQ,EAAC,GAAGN;IAEnB,IAAIM,UAGF,OAAO;IAGT,OAAO,WAAP,GACE,IAAC0G,wBAAsBA;QACrB,aAAU;QACV,YAAYD;QACZ,WAAWpD,GACT,gHACA/C;QAED,GAAGP,KAAK;kBACRD;;AAGP"}
|
|
1
|
+
{"version":3,"file":"components/ui/dropdrawer.js","sources":["../../../src/components/ui/dropdrawer.tsx"],"sourcesContent":["\"use client\";\r\n\r\n/* eslint-disable */\r\n\r\nimport {ChevronLeftIcon, ChevronRightIcon} from \"lucide-react\";\r\nimport {AnimatePresence, motion, Transition} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {Drawer, DrawerClose, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger} from \"@/components/ui/drawer\";\r\nimport {\r\n DropdownMenu,\r\n DropdownMenuContent,\r\n DropdownMenuItem,\r\n DropdownMenuLabel,\r\n DropdownMenuSeparator,\r\n DropdownMenuSub,\r\n DropdownMenuSubContent,\r\n DropdownMenuSubTrigger,\r\n DropdownMenuTrigger,\r\n} from \"@/components/ui/dropdown-menu\";\r\nimport {useIsMobile} from \"@/hooks/useIsMobile\";\r\nimport {cn} from \"@/lib/utilities\";\r\n\r\nconst DropDrawerContext = React.createContext<{isMobile: boolean}>({\r\n isMobile: false,\r\n});\r\n\r\nconst useDropDrawerContext = () => {\r\n const context = React.useContext(DropDrawerContext);\r\n if (!context) {\r\n throw new Error(\"DropDrawer components cannot be rendered outside the Context\");\r\n }\r\n return context;\r\n};\r\n\r\nfunction DropDrawer({children, ...props}: React.ComponentProps<typeof Drawer> | React.ComponentProps<typeof DropdownMenu>) {\r\n const isMobile = useIsMobile();\r\n const DropdownComponent = isMobile ? Drawer : DropdownMenu;\r\n\r\n return (\r\n <DropDrawerContext.Provider value={{isMobile}}>\r\n <DropdownComponent\r\n data-slot='drop-drawer'\r\n {...(isMobile && {autoFocus: true})}\r\n {...props}>\r\n {children}\r\n </DropdownComponent>\r\n </DropDrawerContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerTrigger({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerTrigger> | React.ComponentProps<typeof DropdownMenuTrigger>) {\r\n const {isMobile} = useDropDrawerContext();\r\n const TriggerComponent = isMobile ? DrawerTrigger : DropdownMenuTrigger;\r\n\r\n return (\r\n <TriggerComponent\r\n data-slot='drop-drawer-trigger'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </TriggerComponent>\r\n );\r\n}\r\n\r\nfunction DropDrawerContent({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DrawerContent> | React.ComponentProps<typeof DropdownMenuContent>) {\r\n const {isMobile} = useDropDrawerContext();\r\n const [activeSubmenu, setActiveSubmenu] = React.useState<string | null>(null);\r\n const [submenuTitle, setSubmenuTitle] = React.useState<string | null>(null);\r\n const [submenuStack, setSubmenuStack] = React.useState<{id: string; title: string}[]>([]);\r\n // Add animation direction state\r\n const [animationDirection, setAnimationDirection] = React.useState<\"forward\" | \"backward\">(\"forward\");\r\n\r\n // Create a ref to store submenu content by ID\r\n const submenuContentRef = React.useRef<Map<string, React.ReactNode[]>>(new Map());\r\n\r\n // Function to navigate to a submenu\r\n const navigateToSubmenu = React.useCallback((id: string, title: string) => {\r\n // Set animation direction to forward when navigating to a submenu\r\n setAnimationDirection(\"forward\");\r\n setActiveSubmenu(id);\r\n setSubmenuTitle(title);\r\n setSubmenuStack((prev) => [...prev, {id, title}]);\r\n }, []);\r\n\r\n // Function to go back to previous menu\r\n const goBack = React.useCallback(() => {\r\n // Set animation direction to backward when going back\r\n setAnimationDirection(\"backward\");\r\n\r\n if (submenuStack.length <= 1) {\r\n // If we're at the first level, go back to main menu\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n } else {\r\n // Go back to previous submenu\r\n const newStack = [...submenuStack];\r\n newStack.pop(); // Remove current\r\n const previous = newStack[newStack.length - 1];\r\n setActiveSubmenu(previous.id);\r\n setSubmenuTitle(previous.title);\r\n setSubmenuStack(newStack);\r\n }\r\n }, [submenuStack]);\r\n\r\n // Function to register submenu content\r\n const registerSubmenuContent = React.useCallback((id: string, content: React.ReactNode[]) => {\r\n submenuContentRef.current.set(id, content);\r\n }, []);\r\n\r\n // Function to extract submenu content\r\n const extractSubmenuContent = React.useCallback((elements: React.ReactNode, targetId: string): React.ReactNode[] => {\r\n const result: React.ReactNode[] = [];\r\n\r\n // Recursive function to search through all children\r\n const findSubmenuContent = (node: React.ReactNode) => {\r\n // Skip if not a valid element\r\n if (!React.isValidElement(node)) return;\r\n\r\n const element = node as React.ReactElement;\r\n // Use a more specific type to avoid 'any'\r\n const props = element.props as {\r\n id?: string;\r\n \"data-submenu-id\"?: string;\r\n children?: React.ReactNode;\r\n };\r\n\r\n // Check if this is a DropDrawerSub\r\n if (element.type === DropDrawerSub) {\r\n // Get all possible ID values\r\n const elementId = props.id;\r\n const dataSubmenuId = props[\"data-submenu-id\"];\r\n\r\n // If this is the submenu we're looking for\r\n if (elementId === targetId || dataSubmenuId === targetId) {\r\n // Find the SubContent within this Sub\r\n if (props.children) {\r\n React.Children.forEach(props.children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n const subContentProps = child.props as {\r\n children?: React.ReactNode;\r\n };\r\n if (subContentProps.children) {\r\n React.Children.forEach(subContentProps.children, (contentChild) => {\r\n result.push(contentChild);\r\n });\r\n }\r\n }\r\n });\r\n }\r\n return; // Found what we needed, no need to search deeper\r\n }\r\n }\r\n\r\n // If this element has children, search through them\r\n if (props.children) {\r\n if (Array.isArray(props.children)) {\r\n props.children.forEach((child: React.ReactNode) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(props.children);\r\n }\r\n }\r\n };\r\n\r\n // Start the search from the root elements\r\n if (Array.isArray(elements)) {\r\n elements.forEach((child) => findSubmenuContent(child));\r\n } else {\r\n findSubmenuContent(elements);\r\n }\r\n\r\n return result;\r\n }, []);\r\n\r\n // Get submenu content (either from cache or extract it)\r\n const getSubmenuContent = React.useCallback(\r\n (id: string) => {\r\n // Check if we have the content in our ref\r\n const cachedContent = submenuContentRef.current.get(id || \"\");\r\n if (cachedContent && cachedContent.length > 0) {\r\n return cachedContent;\r\n }\r\n\r\n // If not in cache, extract it\r\n const submenuContent = extractSubmenuContent(children, id);\r\n\r\n if (submenuContent.length === 0) {\r\n return [];\r\n }\r\n\r\n // Store in cache for future use\r\n if (id) {\r\n submenuContentRef.current.set(id, submenuContent);\r\n }\r\n\r\n return submenuContent;\r\n },\r\n [children, extractSubmenuContent],\r\n );\r\n\r\n // Animation variants for Framer Motion\r\n const variants = {\r\n enter: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"100%\" : \"-100%\",\r\n opacity: 0,\r\n }),\r\n center: {\r\n x: 0,\r\n opacity: 1,\r\n },\r\n exit: (direction: \"forward\" | \"backward\") => ({\r\n x: direction === \"forward\" ? \"-100%\" : \"100%\",\r\n opacity: 0,\r\n }),\r\n };\r\n\r\n // Animation transition\r\n const transition = {\r\n duration: 0.3,\r\n ease: [0.25, 0.1, 0.25, 1.0], // cubic-bezier easing\r\n } satisfies Transition;\r\n\r\n if (isMobile) {\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n setActiveSubmenu: (id) => {\r\n if (id === null) {\r\n setActiveSubmenu(null);\r\n setSubmenuTitle(null);\r\n setSubmenuStack([]);\r\n }\r\n },\r\n submenuTitle,\r\n setSubmenuTitle,\r\n navigateToSubmenu,\r\n registerSubmenuContent,\r\n }}>\r\n <DrawerContent\r\n data-slot='drop-drawer-content'\r\n className={cn(\"max-h-[90vh]\", className)}\r\n {...props}>\r\n {activeSubmenu ? (\r\n <>\r\n <DrawerHeader>\r\n <div className='flex items-center gap-2'>\r\n <button\r\n onClick={goBack}\r\n className='rounded-full p-1 hover:bg-neutral-100/50 dark:hover:bg-neutral-800/50'>\r\n <ChevronLeftIcon className='h-5 w-5' />\r\n </button>\r\n <DrawerTitle>{submenuTitle || \"Submenu\"}</DrawerTitle>\r\n </div>\r\n </DrawerHeader>\r\n <div className='relative max-h-[70vh] flex-1 overflow-y-auto'>\r\n {/* Use AnimatePresence to handle exit animations */}\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key={activeSubmenu || \"main\"}\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className='h-full w-full space-y-1.5 pb-6'>\r\n {activeSubmenu ? getSubmenuContent(activeSubmenu) : children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n ) : (\r\n <>\r\n <DrawerHeader className='sr-only'>\r\n <DrawerTitle>Menu</DrawerTitle>\r\n </DrawerHeader>\r\n <div className='max-h-[70vh] overflow-y-auto'>\r\n <AnimatePresence\r\n initial={false}\r\n mode='wait'\r\n custom={animationDirection}>\r\n <motion.div\r\n key='main-menu'\r\n custom={animationDirection}\r\n variants={variants}\r\n initial='enter'\r\n animate='center'\r\n exit='exit'\r\n transition={transition}\r\n className='w-full space-y-1.5 pb-6'>\r\n {children}\r\n </motion.div>\r\n </AnimatePresence>\r\n </div>\r\n </>\r\n )}\r\n </DrawerContent>\r\n </SubmenuContext.Provider>\r\n );\r\n }\r\n\r\n return (\r\n <SubmenuContext.Provider\r\n value={{\r\n activeSubmenu,\r\n setActiveSubmenu,\r\n submenuTitle,\r\n setSubmenuTitle,\r\n registerSubmenuContent,\r\n }}>\r\n <DropdownMenuContent\r\n data-slot='drop-drawer-content'\r\n align='end'\r\n sideOffset={4}\r\n className={cn(\"max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[220px] overflow-y-auto\", className)}\r\n {...props}>\r\n {children}\r\n </DropdownMenuContent>\r\n </SubmenuContext.Provider>\r\n );\r\n}\r\n\r\nfunction DropDrawerItem({\r\n className,\r\n children,\r\n onSelect,\r\n onClick,\r\n icon,\r\n inset,\r\n disabled,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuItem> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n const handleClick = (e: React.MouseEvent<HTMLDivElement>) => {\r\n if (disabled) return;\r\n if (onClick) onClick(e);\r\n if (onSelect) onSelect(e as unknown as Event);\r\n };\r\n\r\n // Only wrap in DrawerClose if it's not a submenu item\r\n const content = (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n data-disabled={disabled}\r\n className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n disabled && \"pointer-events-none opacity-50\",\r\n className,\r\n )}\r\n onClick={handleClick}\r\n aria-disabled={disabled}\r\n {...props}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n {icon && <div className='flex-shrink-0'>{icon}</div>}\r\n </div>\r\n );\r\n\r\n // Check if this is inside a submenu\r\n const isInSubmenu =\r\n (props as Record<string, unknown>)[\"data-parent-submenu-id\"] || (props as Record<string, unknown>)[\"data-parent-submenu\"];\r\n\r\n if (isInSubmenu) {\r\n return content;\r\n }\r\n\r\n return <DrawerClose asChild>{content}</DrawerClose>;\r\n }\r\n\r\n return (\r\n <DropdownMenuItem\r\n data-slot='drop-drawer-item'\r\n data-inset={inset}\r\n className={className}\r\n onSelect={onSelect}\r\n onClick={onClick as React.MouseEventHandler<HTMLDivElement>}\r\n inset={inset}\r\n disabled={disabled}\r\n {...props}>\r\n <div className='flex w-full items-center justify-between'>\r\n <div>{children}</div>\r\n {icon && <div>{icon}</div>}\r\n </div>\r\n </DropdownMenuItem>\r\n );\r\n}\r\n\r\nfunction DropDrawerSeparator({className, ...props}: React.ComponentProps<typeof DropdownMenuSeparator>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // For mobile, render a simple divider\r\n if (isMobile) {\r\n return null;\r\n }\r\n\r\n // For desktop, use the standard dropdown separator\r\n return (\r\n <DropdownMenuSeparator\r\n data-slot='drop-drawer-separator'\r\n className={className}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nfunction DropDrawerLabel({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuLabel> | React.ComponentProps<typeof DrawerTitle>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerHeader className='p-0'>\r\n <DrawerTitle\r\n data-slot='drop-drawer-label'\r\n className={cn(\"px-4 py-2 text-sm font-medium text-neutral-500 dark:text-neutral-400\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerTitle>\r\n </DrawerHeader>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuLabel\r\n data-slot='drop-drawer-label'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </DropdownMenuLabel>\r\n );\r\n}\r\n\r\nfunction DropDrawerFooter({className, children, ...props}: React.ComponentProps<typeof DrawerFooter> | React.ComponentProps<\"div\">) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n return (\r\n <DrawerFooter\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-4\", className)}\r\n {...props}>\r\n {children}\r\n </DrawerFooter>\r\n );\r\n }\r\n\r\n // No direct equivalent in DropdownMenu, so we'll just render a div\r\n return (\r\n <div\r\n data-slot='drop-drawer-footer'\r\n className={cn(\"p-2\", className)}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\nfunction DropDrawerGroup({\r\n className,\r\n children,\r\n ...props\r\n}: React.ComponentProps<\"div\"> & {\r\n children: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n // Add separators between children on mobile\r\n const childrenWithSeparators = React.useMemo(() => {\r\n if (!isMobile) return children;\r\n\r\n const childArray = React.Children.toArray(children);\r\n\r\n // Filter out any existing separators\r\n const filteredChildren = childArray.filter((child) => React.isValidElement(child) && child.type !== DropDrawerSeparator);\r\n\r\n // Add separators between items\r\n return filteredChildren.flatMap((child, index) => {\r\n if (index === filteredChildren.length - 1) return [child];\r\n return [\r\n child,\r\n <div\r\n key={`separator-${index}`}\r\n className='h-px bg-neutral-200 dark:bg-neutral-800'\r\n aria-hidden='true'\r\n />,\r\n ];\r\n });\r\n }, [children, isMobile]);\r\n\r\n if (isMobile) {\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={cn(\r\n \"mx-2 my-3 overflow-hidden rounded-xl bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {childrenWithSeparators}\r\n </div>\r\n );\r\n }\r\n\r\n // On desktop, use a div with proper role and attributes\r\n return (\r\n <div\r\n data-drop-drawer-group\r\n data-slot='drop-drawer-group'\r\n role='group'\r\n className={className}\r\n {...props}>\r\n {children}\r\n </div>\r\n );\r\n}\r\n\r\n// Context for managing submenu state on mobile\r\ninterface SubmenuContextType {\r\n activeSubmenu: string | null;\r\n setActiveSubmenu: (id: string | null) => void;\r\n submenuTitle: string | null;\r\n setSubmenuTitle: (title: string | null) => void;\r\n navigateToSubmenu?: (id: string, title: string) => void;\r\n registerSubmenuContent?: (id: string, content: React.ReactNode[]) => void;\r\n}\r\n\r\nconst SubmenuContext = React.createContext<SubmenuContextType>({\r\n activeSubmenu: null,\r\n setActiveSubmenu: () => {},\r\n submenuTitle: null,\r\n setSubmenuTitle: () => {},\r\n navigateToSubmenu: undefined,\r\n registerSubmenuContent: undefined,\r\n});\r\n\r\n// Submenu components\r\n// Counter for generating simple numeric IDs\r\nlet submenuIdCounter = 0;\r\n\r\nfunction DropDrawerSub({\r\n children,\r\n id,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSub> & {\r\n id?: string;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {registerSubmenuContent} = React.useContext(SubmenuContext);\r\n\r\n // Generate a simple numeric ID instead of using React.useId()\r\n const [generatedId] = React.useState(() => `submenu-${submenuIdCounter++}`);\r\n const submenuId = id || generatedId;\r\n\r\n // Extract submenu content to register with parent\r\n React.useEffect(() => {\r\n if (!registerSubmenuContent) return;\r\n\r\n // Find the SubContent within this Sub\r\n const contentItems: React.ReactNode[] = [];\r\n React.Children.forEach(children, (child) => {\r\n if (React.isValidElement(child) && child.type === DropDrawerSubContent) {\r\n // Add all children of the SubContent to the result\r\n React.Children.forEach((child.props as {children?: React.ReactNode}).children, (contentChild) => {\r\n contentItems.push(contentChild);\r\n });\r\n }\r\n });\r\n\r\n // Register the content with the parent\r\n if (contentItems.length > 0) {\r\n registerSubmenuContent(submenuId, contentItems);\r\n }\r\n }, [children, registerSubmenuContent, submenuId]);\r\n\r\n if (isMobile) {\r\n // For mobile, we'll use the context to manage submenu state\r\n // Process children to pass the submenu ID to the trigger and content\r\n const processedChildren = React.Children.map(children, (child) => {\r\n if (!React.isValidElement(child)) return child;\r\n\r\n if (child.type === DropDrawerSubTrigger) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\r\n );\r\n }\r\n\r\n if (child.type === DropDrawerSubContent) {\r\n return React.cloneElement(\r\n child as React.ReactElement,\r\n {\r\n ...(child.props as object),\r\n \"data-parent-submenu-id\": submenuId,\r\n \"data-submenu-id\": submenuId,\r\n // Use only data attributes, not custom props\r\n \"data-parent-submenu\": submenuId,\r\n } as React.HTMLAttributes<HTMLElement>,\r\n );\r\n }\r\n\r\n return child;\r\n });\r\n\r\n return (\r\n <div\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n id={submenuId}>\r\n {processedChildren}\r\n </div>\r\n );\r\n }\r\n\r\n // For desktop, pass the generated ID to the DropdownMenuSub\r\n return (\r\n <DropdownMenuSub\r\n data-slot='drop-drawer-sub'\r\n data-submenu-id={submenuId}\r\n // Don't pass id to DropdownMenuSub as it doesn't accept this prop\r\n {...props}>\r\n {children}\r\n </DropdownMenuSub>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubTrigger({\r\n className,\r\n inset,\r\n children,\r\n ...props\r\n}: React.ComponentProps<typeof DropdownMenuSubTrigger> & {\r\n icon?: React.ReactNode;\r\n}) {\r\n const {isMobile} = useDropDrawerContext();\r\n const {navigateToSubmenu} = React.useContext(SubmenuContext);\r\n\r\n // Define hooks outside of conditionals to follow React rules\r\n // Check if this item is inside a group by looking at parent elements\r\n const isInGroup = React.useCallback((element: HTMLElement | null): boolean => {\r\n if (!element) return false;\r\n\r\n // Check if any parent has a data-drop-drawer-group attribute\r\n let parent = element.parentElement;\r\n while (parent) {\r\n if (parent.hasAttribute(\"data-drop-drawer-group\")) {\r\n return true;\r\n }\r\n parent = parent.parentElement;\r\n }\r\n return false;\r\n }, []);\r\n\r\n // Create a ref to check if the item is in a group\r\n const itemRef = React.useRef<HTMLDivElement>(null);\r\n const [isInsideGroup, setIsInsideGroup] = React.useState(false);\r\n\r\n React.useEffect(() => {\r\n // Only run this effect in mobile mode\r\n if (!isMobile) return;\r\n\r\n // Use a short timeout to ensure the DOM is fully rendered\r\n const timer = setTimeout(() => {\r\n if (itemRef.current) {\r\n setIsInsideGroup(isInGroup(itemRef.current));\r\n }\r\n }, 0);\r\n\r\n return () => clearTimeout(timer);\r\n }, [isInGroup, isMobile]);\r\n\r\n if (isMobile) {\r\n // Find the parent submenu ID\r\n const handleClick = (e: React.MouseEvent) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n // Get the closest parent with data-submenu-id attribute\r\n const element = e.currentTarget as HTMLElement;\r\n let submenuId: string | null = null;\r\n\r\n // First check if the element itself has the data attribute\r\n if (element.closest(\"[data-submenu-id]\")) {\r\n const closestElement = element.closest(\"[data-submenu-id]\");\r\n const id = closestElement?.getAttribute(\"data-submenu-id\");\r\n if (id) {\r\n submenuId = id;\r\n }\r\n }\r\n\r\n // If not found, try props\r\n if (!submenuId) {\r\n submenuId =\r\n ((props as Record<string, unknown>)[\"data-parent-submenu-id\"] as string)\r\n || ((props as Record<string, unknown>)[\"data-parent-submenu\"] as string);\r\n }\r\n\r\n if (!submenuId) {\r\n return;\r\n }\r\n\r\n // Get the title\r\n const title = typeof children === \"string\" ? children : \"Submenu\";\r\n\r\n // Navigate to the submenu\r\n if (navigateToSubmenu) {\r\n navigateToSubmenu(submenuId, title);\r\n }\r\n };\r\n\r\n // Combine onClick handlers\r\n const combinedOnClick = (e: React.MouseEvent) => {\r\n // Call the original onClick if provided\r\n const typedProps = props as Record<string, unknown>;\r\n if (typedProps[\"onClick\"]) {\r\n const originalOnClick = typedProps[\"onClick\"] as React.MouseEventHandler<HTMLDivElement>;\r\n originalOnClick(e as React.MouseEvent<HTMLDivElement>);\r\n }\r\n\r\n // Call our navigation handler\r\n handleClick(e);\r\n };\r\n\r\n // Remove onClick from props to avoid duplicate handlers\r\n const {...restProps} = props as Record<string, unknown>;\r\n\r\n // Don't wrap in DrawerClose for submenu triggers\r\n return (\r\n <div\r\n ref={itemRef}\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={cn(\r\n \"flex cursor-pointer items-center justify-between px-4 py-4\",\r\n // Only apply margin, background and rounded corners if not in a group\r\n !isInsideGroup && \"mx-2 my-1.5 rounded-md bg-neutral-100 dark:bg-neutral-100 dark:bg-neutral-800 dark:dark:bg-neutral-800\",\r\n // For items in a group, don't add background but add more padding\r\n isInsideGroup && \"bg-transparent py-4\",\r\n inset && \"pl-8\",\r\n className,\r\n )}\r\n onClick={combinedOnClick}\r\n {...restProps}>\r\n <div className='flex items-center gap-2'>{children}</div>\r\n <ChevronRightIcon className='h-5 w-5' />\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <DropdownMenuSubTrigger\r\n data-slot='drop-drawer-sub-trigger'\r\n data-inset={inset}\r\n className={className}\r\n inset={inset}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubTrigger>\r\n );\r\n}\r\n\r\nfunction DropDrawerSubContent({className, sideOffset = 4, children, ...props}: React.ComponentProps<typeof DropdownMenuSubContent>) {\r\n const {isMobile} = useDropDrawerContext();\r\n\r\n if (isMobile) {\r\n // For mobile, we don't render the content directly\r\n // It will be rendered by the DropDrawerContent component when active\r\n return null;\r\n }\r\n\r\n return (\r\n <DropdownMenuSubContent\r\n data-slot='drop-drawer-sub-content'\r\n sideOffset={sideOffset}\r\n className={cn(\r\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 p-1 shadow-lg dark:border-neutral-800\",\r\n className,\r\n )}\r\n {...props}>\r\n {children}\r\n </DropdownMenuSubContent>\r\n );\r\n}\r\n\r\nexport {\r\n DropDrawer,\r\n DropDrawerContent,\r\n DropDrawerFooter,\r\n DropDrawerGroup,\r\n DropDrawerItem,\r\n DropDrawerLabel,\r\n DropDrawerSeparator,\r\n DropDrawerSub,\r\n DropDrawerSubContent,\r\n DropDrawerSubTrigger,\r\n DropDrawerTrigger,\r\n};\r\n"],"names":["DropDrawerContext","React","useDropDrawerContext","context","Error","DropDrawer","children","props","isMobile","useIsMobile","DropdownComponent","Drawer","DropdownMenu","DropDrawerTrigger","className","TriggerComponent","DrawerTrigger","DropdownMenuTrigger","DropDrawerContent","activeSubmenu","setActiveSubmenu","submenuTitle","setSubmenuTitle","submenuStack","setSubmenuStack","animationDirection","setAnimationDirection","submenuContentRef","Map","navigateToSubmenu","id","title","prev","goBack","newStack","previous","registerSubmenuContent","content","extractSubmenuContent","elements","targetId","result","findSubmenuContent","node","element","DropDrawerSub","elementId","dataSubmenuId","child","DropDrawerSubContent","subContentProps","contentChild","Array","getSubmenuContent","cachedContent","submenuContent","variants","direction","transition","SubmenuContext","DrawerContent","cn","DrawerHeader","ChevronLeftIcon","DrawerTitle","AnimatePresence","motion","DropdownMenuContent","DropDrawerItem","onSelect","onClick","icon","inset","disabled","isInGroup","parent","itemRef","isInsideGroup","setIsInsideGroup","timer","setTimeout","clearTimeout","handleClick","e","isInSubmenu","DrawerClose","DropdownMenuItem","DropDrawerSeparator","DropdownMenuSeparator","DropDrawerLabel","DropdownMenuLabel","DropDrawerFooter","DrawerFooter","DropDrawerGroup","childrenWithSeparators","childArray","filteredChildren","index","undefined","submenuIdCounter","generatedId","submenuId","contentItems","processedChildren","DropDrawerSubTrigger","DropdownMenuSub","closestElement","combinedOnClick","typedProps","originalOnClick","restProps","ChevronRightIcon","DropdownMenuSubTrigger","sideOffset","DropdownMenuSubContent"],"mappings":";;;;;;;;;AAuBA,MAAMA,oBAAoB,WAApBA,GAAoBC,cAAyC;IACjE,UAAU;AACZ;AAEA,MAAMC,uBAAuB;IAC3B,MAAMC,UAAUF,WAAiBD;IACjC,IAAI,CAACG,SACH,MAAM,IAAIC,MAAM;IAElB,OAAOD;AACT;AAEA,SAASE,WAAW,EAACC,QAAQ,EAAE,GAAGC,OAAuF;IACvH,MAAMC,WAAWC;IACjB,MAAMC,oBAAoBF,WAAWG,SAASC;IAE9C,OAAO,WAAP,GACE,IAACZ,kBAAkB,QAAQ;QAAC,OAAO;YAACQ;QAAQ;kBAC1C,kBAACE,mBAAAA;YACC,aAAU;YACT,GAAIF,YAAY;gBAAC,WAAW;YAAI,CAAC;YACjC,GAAGD,KAAK;sBACRD;;;AAIT;AAEA,SAASO,kBAAkB,EACzBC,SAAS,EACTR,QAAQ,EACR,GAAGC,OAC2F;IAC9F,MAAM,EAACC,QAAQ,EAAC,GAAGN;IACnB,MAAMa,mBAAmBP,WAAWQ,gBAAgBC;IAEpD,OAAO,WAAP,GACE,IAACF,kBAAAA;QACC,aAAU;QACV,WAAWD;QACV,GAAGP,KAAK;kBACRD;;AAGP;AAEA,SAASY,kBAAkB,EACzBJ,SAAS,EACTR,QAAQ,EACR,GAAGC,OAC2F;IAC9F,MAAM,EAACC,QAAQ,EAAC,GAAGN;IACnB,MAAM,CAACiB,eAAeC,iBAAiB,GAAGnB,SAA8B;IACxE,MAAM,CAACoB,cAAcC,gBAAgB,GAAGrB,SAA8B;IACtE,MAAM,CAACsB,cAAcC,gBAAgB,GAAGvB,SAA8C,EAAE;IAExF,MAAM,CAACwB,oBAAoBC,sBAAsB,GAAGzB,SAAuC;IAG3F,MAAM0B,oBAAoB1B,OAA6C,IAAI2B;IAG3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