@authdog/react-elements 0.0.48 → 0.0.49
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/.turbo/turbo-build.log +15 -15
- package/CHANGELOG.md +6 -0
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu.mjs +1 -1
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +9 -0
- package/package.json +1 -1
- package/src/components/core/navbar.tsx +2 -1
- package/src/components/icons.tsx +9 -4
- package/src/components/ui/dropdown-menu.tsx +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @authdog/react-elements@0.0.
|
|
2
|
+
> @authdog/react-elements@0.0.49 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
|
|
3
3
|
> pnpm tsup && pnpm build:styles
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts, src/lib/utils.ts, src/components/ui/alert.tsx, src/components/ui/avatar.tsx, src/components/ui/badge.tsx, src/components/ui/button.tsx, src/components/ui/card.tsx, src/components/ui/dropdown-menu.tsx, src/components/ui/input.tsx, src/components/ui/label.tsx, src/components/ui/separator.tsx, src/components/ui/sheet.tsx, src/components/ui/theme-toggle.tsx
|
|
@@ -10,66 +10,66 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
13
|
+
[32mCJS[39m [1mdist/index.js [22m[32m35.10 KB[39m
|
|
14
14
|
[32mCJS[39m [1mdist/lib/utils.js [22m[32m620.00 B[39m
|
|
15
15
|
[32mCJS[39m [1mdist/components/ui/alert.js [22m[32m1.65 KB[39m
|
|
16
16
|
[32mCJS[39m [1mdist/components/ui/avatar.js [22m[32m1.34 KB[39m
|
|
17
17
|
[32mCJS[39m [1mdist/components/ui/badge.js [22m[32m1.78 KB[39m
|
|
18
18
|
[32mCJS[39m [1mdist/components/ui/button.js [22m[32m1.94 KB[39m
|
|
19
19
|
[32mCJS[39m [1mdist/components/ui/card.js [22m[32m1.85 KB[39m
|
|
20
|
-
[32mCJS[39m [1mdist/components/ui/dropdown-menu.js [22m[32m6.
|
|
20
|
+
[32mCJS[39m [1mdist/components/ui/dropdown-menu.js [22m[32m6.77 KB[39m
|
|
21
21
|
[32mCJS[39m [1mdist/components/ui/input.js [22m[32m1.37 KB[39m
|
|
22
22
|
[32mCJS[39m [1mdist/components/ui/label.js [22m[32m1.14 KB[39m
|
|
23
23
|
[32mCJS[39m [1mdist/components/ui/separator.js [22m[32m1.18 KB[39m
|
|
24
24
|
[32mCJS[39m [1mdist/components/ui/sheet.js [22m[32m3.36 KB[39m
|
|
25
25
|
[32mCJS[39m [1mdist/components/ui/theme-toggle.js [22m[32m2.72 KB[39m
|
|
26
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
26
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m100.15 KB[39m
|
|
27
27
|
[32mCJS[39m [1mdist/lib/utils.js.map [22m[32m520.00 B[39m
|
|
28
28
|
[32mCJS[39m [1mdist/components/ui/alert.js.map [22m[32m3.00 KB[39m
|
|
29
29
|
[32mCJS[39m [1mdist/components/ui/avatar.js.map [22m[32m2.30 KB[39m
|
|
30
30
|
[32mCJS[39m [1mdist/components/ui/badge.js.map [22m[32m2.78 KB[39m
|
|
31
31
|
[32mCJS[39m [1mdist/components/ui/button.js.map [22m[32m3.17 KB[39m
|
|
32
32
|
[32mCJS[39m [1mdist/components/ui/card.js.map [22m[32m3.80 KB[39m
|
|
33
|
-
[32mCJS[39m [1mdist/components/ui/dropdown-menu.js.map [22m[32m14.
|
|
33
|
+
[32mCJS[39m [1mdist/components/ui/dropdown-menu.js.map [22m[32m14.87 KB[39m
|
|
34
34
|
[32mCJS[39m [1mdist/components/ui/input.js.map [22m[32m1.78 KB[39m
|
|
35
35
|
[32mCJS[39m [1mdist/components/ui/label.js.map [22m[32m1.43 KB[39m
|
|
36
36
|
[32mCJS[39m [1mdist/components/ui/separator.js.map [22m[32m1.63 KB[39m
|
|
37
37
|
[32mCJS[39m [1mdist/components/ui/sheet.js.map [22m[32m6.76 KB[39m
|
|
38
38
|
[32mCJS[39m [1mdist/components/ui/theme-toggle.js.map [22m[32m5.62 KB[39m
|
|
39
|
-
[32mCJS[39m ⚡️ Build success in
|
|
40
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m32.
|
|
39
|
+
[32mCJS[39m ⚡️ Build success in 253ms
|
|
40
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m32.60 KB[39m
|
|
41
41
|
[32mESM[39m [1mdist/lib/utils.mjs [22m[32m166.00 B[39m
|
|
42
42
|
[32mESM[39m [1mdist/components/ui/alert.mjs [22m[32m1.19 KB[39m
|
|
43
43
|
[32mESM[39m [1mdist/components/ui/avatar.mjs [22m[32m749.00 B[39m
|
|
44
44
|
[32mESM[39m [1mdist/components/ui/badge.mjs [22m[32m1.34 KB[39m
|
|
45
45
|
[32mESM[39m [1mdist/components/ui/button.mjs [22m[32m1.36 KB[39m
|
|
46
46
|
[32mESM[39m [1mdist/components/ui/card.mjs [22m[32m1.35 KB[39m
|
|
47
|
-
[32mESM[39m [1mdist/components/ui/dropdown-menu.mjs [22m[
|
|
48
|
-
[32mESM[39m [1mdist/components/ui/input.mjs [22m[32m949.00 B[39m
|
|
47
|
+
[32mESM[39m [1mdist/components/ui/dropdown-menu.mjs [22m[32m6.02 KB[39m
|
|
49
48
|
[32mESM[39m [1mdist/components/ui/label.mjs [22m[32m566.00 B[39m
|
|
50
49
|
[32mESM[39m [1mdist/components/ui/separator.mjs [22m[32m604.00 B[39m
|
|
51
50
|
[32mESM[39m [1mdist/components/ui/sheet.mjs [22m[32m2.68 KB[39m
|
|
52
51
|
[32mESM[39m [1mdist/components/ui/theme-toggle.mjs [22m[32m2.13 KB[39m
|
|
53
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[32m100.
|
|
52
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m100.74 KB[39m
|
|
53
|
+
[32mESM[39m [1mdist/components/ui/input.mjs [22m[32m949.00 B[39m
|
|
54
54
|
[32mESM[39m [1mdist/lib/utils.mjs.map [22m[32m415.00 B[39m
|
|
55
55
|
[32mESM[39m [1mdist/components/ui/alert.mjs.map [22m[32m2.82 KB[39m
|
|
56
56
|
[32mESM[39m [1mdist/components/ui/avatar.mjs.map [22m[32m2.12 KB[39m
|
|
57
57
|
[32mESM[39m [1mdist/components/ui/badge.mjs.map [22m[32m2.62 KB[39m
|
|
58
58
|
[32mESM[39m [1mdist/components/ui/button.mjs.map [22m[32m3.01 KB[39m
|
|
59
59
|
[32mESM[39m [1mdist/components/ui/card.mjs.map [22m[32m3.54 KB[39m
|
|
60
|
-
[32mESM[39m [1mdist/components/ui/dropdown-menu.mjs.map [22m[32m14.35 KB[39m
|
|
61
|
-
[32mESM[39m [1mdist/components/ui/input.mjs.map [22m[32m1.65 KB[39m
|
|
62
60
|
[32mESM[39m [1mdist/components/ui/label.mjs.map [22m[32m1.31 KB[39m
|
|
63
61
|
[32mESM[39m [1mdist/components/ui/separator.mjs.map [22m[32m1.50 KB[39m
|
|
64
62
|
[32mESM[39m [1mdist/components/ui/sheet.mjs.map [22m[32m6.49 KB[39m
|
|
65
63
|
[32mESM[39m [1mdist/components/ui/theme-toggle.mjs.map [22m[32m5.56 KB[39m
|
|
66
|
-
[32mESM[39m
|
|
64
|
+
[32mESM[39m [1mdist/components/ui/input.mjs.map [22m[32m1.65 KB[39m
|
|
65
|
+
[32mESM[39m [1mdist/components/ui/dropdown-menu.mjs.map [22m[32m14.41 KB[39m
|
|
66
|
+
[32mESM[39m ⚡️ Build success in 258ms
|
|
67
67
|
[34mDTS[39m Build start
|
|
68
|
-
[32mDTS[39m ⚡️ Build success in
|
|
68
|
+
[32mDTS[39m ⚡️ Build success in 15647ms
|
|
69
69
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.66 KB[39m
|
|
70
70
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.66 KB[39m
|
|
71
71
|
|
|
72
|
-
> @authdog/react-elements@0.0.
|
|
72
|
+
> @authdog/react-elements@0.0.49 build:styles /home/runner/work/web-sdk/web-sdk/packages/react-elements
|
|
73
73
|
> postcss src/global.css -o dist/styles.css
|
|
74
74
|
|
|
75
75
|
Browserslist: browsers data (caniuse-lite) is 6 months old. Please run:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";"use client";var N=Object.create;var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var n in o)m(e,n,{get:o[n],enumerable:!0})},u=(e,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of I(o))!z.call(e,d)&&d!==n&&m(e,d,{get:()=>o[d],enumerable:!(i=S(o,d))||i.enumerable});return e};var c=(e,o,n)=>(n=e!=null?N(G(e)):{},u(o||!e||!e.__esModule?m(n,"default",{value:e,enumerable:!0}):n,e)),k=e=>u(m({},"__esModule",{value:!0}),e);var H={};T(H,{DropdownMenu:()=>_,DropdownMenuCheckboxItem:()=>M,DropdownMenuContent:()=>v,DropdownMenuGroup:()=>R,DropdownMenuItem:()=>P,DropdownMenuLabel:()=>y,DropdownMenuPortal:()=>L,DropdownMenuRadioGroup:()=>
|
|
2
|
+
"use strict";"use client";var N=Object.create;var m=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var n in o)m(e,n,{get:o[n],enumerable:!0})},u=(e,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let d of I(o))!z.call(e,d)&&d!==n&&m(e,d,{get:()=>o[d],enumerable:!(i=S(o,d))||i.enumerable});return e};var c=(e,o,n)=>(n=e!=null?N(G(e)):{},u(o||!e||!e.__esModule?m(n,"default",{value:e,enumerable:!0}):n,e)),k=e=>u(m({},"__esModule",{value:!0}),e);var H={};T(H,{DropdownMenu:()=>_,DropdownMenuCheckboxItem:()=>M,DropdownMenuContent:()=>v,DropdownMenuGroup:()=>R,DropdownMenuItem:()=>P,DropdownMenuLabel:()=>y,DropdownMenuPortal:()=>L,DropdownMenuRadioGroup:()=>g,DropdownMenuRadioItem:()=>D,DropdownMenuSeparator:()=>b,DropdownMenuShortcut:()=>h,DropdownMenuSub:()=>j,DropdownMenuSubContent:()=>C,DropdownMenuSubTrigger:()=>x,DropdownMenuTrigger:()=>w});module.exports=k(H);var a=c(require("react")),t=c(require("@radix-ui/react-dropdown-menu")),p=require("lucide-react");var l=require("clsx"),f=require("tailwind-merge");function s(...e){return(0,f.twMerge)((0,l.clsx)(e))}var r=require("react/jsx-runtime"),E=p.Check,W=p.Circle,V=p.ChevronRight;function _({...e}){return(0,r.jsx)(t.Root,{"data-slot":"dropdown-menu",...e})}function L({...e}){return(0,r.jsx)(t.Portal,{"data-slot":"dropdown-menu-portal",...e})}var w=a.forwardRef(({...e},o)=>(0,r.jsx)(t.Trigger,{ref:o,"data-slot":"dropdown-menu-trigger",...e}));w.displayName=t.Trigger.displayName;var v=a.forwardRef(({className:e,sideOffset:o=4,...n},i)=>(0,r.jsx)(t.Portal,{children:(0,r.jsx)(t.Content,{ref:i,"data-slot":"dropdown-menu-content",sideOffset:o,className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})}));v.displayName=t.Content.displayName;var R=a.forwardRef(({...e},o)=>(0,r.jsx)(t.Group,{ref:o,"data-slot":"dropdown-menu-group",...e}));R.displayName=t.Group.displayName;var P=a.forwardRef(({className:e,inset:o,variant:n="default",...i},d)=>(0,r.jsx)(t.Item,{ref:d,"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":n,className:s("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i}));P.displayName=t.Item.displayName;var M=a.forwardRef(({className:e,children:o,checked:n,...i},d)=>(0,r.jsxs)(t.CheckboxItem,{ref:d,"data-slot":"dropdown-menu-checkbox-item",className:s("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:n,...i,children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(t.ItemIndicator,{children:(0,r.jsx)(E,{className:"size-4"})})}),o]}));M.displayName=t.CheckboxItem.displayName;var g=a.forwardRef(({...e},o)=>(0,r.jsx)(t.RadioGroup,{ref:o,"data-slot":"dropdown-menu-radio-group",...e}));g.displayName=t.RadioGroup.displayName;var D=a.forwardRef(({className:e,children:o,...n},i)=>(0,r.jsxs)(t.RadioItem,{ref:i,"data-slot":"dropdown-menu-radio-item",className:s("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(t.ItemIndicator,{children:(0,r.jsx)(W,{className:"size-2 fill-current"})})}),o]}));D.displayName=t.RadioItem.displayName;var y=a.forwardRef(({className:e,inset:o,...n},i)=>(0,r.jsx)(t.Label,{ref:i,"data-slot":"dropdown-menu-label","data-inset":o,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...n}));y.displayName=t.Label.displayName;var b=a.forwardRef(({className:e,...o},n)=>(0,r.jsx)(t.Separator,{ref:n,"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...o}));b.displayName=t.Separator.displayName;var h=a.forwardRef(({className:e,...o},n)=>(0,r.jsx)("span",{ref:n,"data-slot":"dropdown-menu-shortcut",className:s("text-muted-foreground ml-auto text-xs tracking-widest",e),...o}));h.displayName="DropdownMenuShortcut";function j({...e}){return(0,r.jsx)(t.Sub,{"data-slot":"dropdown-menu-sub",...e})}var x=a.forwardRef(({className:e,inset:o,children:n,...i},d)=>(0,r.jsxs)(t.SubTrigger,{ref:d,"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:s("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...i,children:[n,(0,r.jsx)(V,{className:"ml-auto size-4"})]}));x.displayName=t.SubTrigger.displayName;var C=a.forwardRef(({className:e,...o},n)=>(0,r.jsx)(t.SubContent,{ref:n,"data-slot":"dropdown-menu-sub-content",className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...o}));C.displayName=t.SubContent.displayName;
|
|
3
3
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx","../../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentType } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst ChevronRightIcon = ChevronRight as ComponentType<\n React.SVGProps<SVGSVGElement>\n>;\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nconst DropdownMenuTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n));\nDropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...props}\n />\n));\nDropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n }\n>(({ className, inset, variant = \"default\", ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n));\nDropdownMenuRadioGroup.displayName =\n DropdownMenuPrimitive.RadioGroup.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":["dropdown_menu_exports","__export","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","__toCommonJS","React","DropdownMenuPrimitive","import_lucide_react","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","CheckIcon","CircleIcon","ChevronRightIcon","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","ref","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx","../../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentType } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst ChevronRightIcon = ChevronRight as ComponentType<\n React.SVGProps<SVGSVGElement>\n>;\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nconst DropdownMenuTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n));\nDropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...props}\n />\n));\nDropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n }\n>(({ className, inset, variant = \"default\", ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n));\nDropdownMenuRadioGroup.displayName =\n DropdownMenuPrimitive.RadioGroup.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":["dropdown_menu_exports","__export","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","__toCommonJS","React","DropdownMenuPrimitive","import_lucide_react","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","CheckIcon","CircleIcon","ChevronRightIcon","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","ref","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import*as i from"react";import*as e from"@radix-ui/react-dropdown-menu";import{Check as c,ChevronRight as l,Circle as f}from"lucide-react";import{clsx as m}from"clsx";import{twMerge as u}from"tailwind-merge";function d(...t){return u(m(t))}import{jsx as n,jsxs as
|
|
2
|
+
"use client";import*as i from"react";import*as e from"@radix-ui/react-dropdown-menu";import{Check as c,ChevronRight as l,Circle as f}from"lucide-react";import{clsx as m}from"clsx";import{twMerge as u}from"tailwind-merge";function d(...t){return u(m(t))}import{jsx as n,jsxs as p}from"react/jsx-runtime";var w=c,v=f,R=l;function W({...t}){return n(e.Root,{"data-slot":"dropdown-menu",...t})}function V({...t}){return n(e.Portal,{"data-slot":"dropdown-menu-portal",...t})}var P=i.forwardRef(({...t},o)=>n(e.Trigger,{ref:o,"data-slot":"dropdown-menu-trigger",...t}));P.displayName=e.Trigger.displayName;var M=i.forwardRef(({className:t,sideOffset:o=4,...r},a)=>n(e.Portal,{children:n(e.Content,{ref:a,"data-slot":"dropdown-menu-content",sideOffset:o,className:d("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})}));M.displayName=e.Content.displayName;var g=i.forwardRef(({...t},o)=>n(e.Group,{ref:o,"data-slot":"dropdown-menu-group",...t}));g.displayName=e.Group.displayName;var D=i.forwardRef(({className:t,inset:o,variant:r="default",...a},s)=>n(e.Item,{ref:s,"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:d("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a}));D.displayName=e.Item.displayName;var y=i.forwardRef(({className:t,children:o,checked:r,...a},s)=>p(e.CheckboxItem,{ref:s,"data-slot":"dropdown-menu-checkbox-item",className:d("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...a,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(e.ItemIndicator,{children:n(w,{className:"size-4"})})}),o]}));y.displayName=e.CheckboxItem.displayName;var b=i.forwardRef(({...t},o)=>n(e.RadioGroup,{ref:o,"data-slot":"dropdown-menu-radio-group",...t}));b.displayName=e.RadioGroup.displayName;var h=i.forwardRef(({className:t,children:o,...r},a)=>p(e.RadioItem,{ref:a,"data-slot":"dropdown-menu-radio-item",className:d("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[n("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:n(e.ItemIndicator,{children:n(v,{className:"size-2 fill-current"})})}),o]}));h.displayName=e.RadioItem.displayName;var x=i.forwardRef(({className:t,inset:o,...r},a)=>n(e.Label,{ref:a,"data-slot":"dropdown-menu-label","data-inset":o,className:d("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r}));x.displayName=e.Label.displayName;var C=i.forwardRef(({className:t,...o},r)=>n(e.Separator,{ref:r,"data-slot":"dropdown-menu-separator",className:d("bg-border -mx-1 my-1 h-px",t),...o}));C.displayName=e.Separator.displayName;var N=i.forwardRef(({className:t,...o},r)=>n("span",{ref:r,"data-slot":"dropdown-menu-shortcut",className:d("text-muted-foreground ml-auto text-xs tracking-widest",t),...o}));N.displayName="DropdownMenuShortcut";function _({...t}){return n(e.Sub,{"data-slot":"dropdown-menu-sub",...t})}var S=i.forwardRef(({className:t,inset:o,children:r,...a},s)=>p(e.SubTrigger,{ref:s,"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:d("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",t),...a,children:[r,n(R,{className:"ml-auto size-4"})]}));S.displayName=e.SubTrigger.displayName;var I=i.forwardRef(({className:t,...o},r)=>n(e.SubContent,{ref:r,"data-slot":"dropdown-menu-sub-content",className:d("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...o}));I.displayName=e.SubContent.displayName;export{W as DropdownMenu,y as DropdownMenuCheckboxItem,M as DropdownMenuContent,g as DropdownMenuGroup,D as DropdownMenuItem,x as DropdownMenuLabel,V as DropdownMenuPortal,b as DropdownMenuRadioGroup,h as DropdownMenuRadioItem,C as DropdownMenuSeparator,N as DropdownMenuShortcut,_ as DropdownMenuSub,I as DropdownMenuSubContent,S as DropdownMenuSubTrigger,P as DropdownMenuTrigger};
|
|
3
3
|
//# sourceMappingURL=dropdown-menu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx","../../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentType } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst ChevronRightIcon = ChevronRight as ComponentType<\n React.SVGProps<SVGSVGElement>\n>;\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nconst DropdownMenuTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n));\nDropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...props}\n />\n));\nDropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n }\n>(({ className, inset, variant = \"default\", ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n));\nDropdownMenuRadioGroup.displayName =\n DropdownMenuPrimitive.RadioGroup.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":["React","DropdownMenuPrimitive","Check","ChevronRight","Circle","clsx","twMerge","cn","inputs","jsx","jsxs","CheckIcon","Check","CircleIcon","Circle","ChevronRightIcon","ChevronRight","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","ref","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/dropdown-menu.tsx","../../../src/lib/utils.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { Check, ChevronRight, Circle } from \"lucide-react\";\nimport type { ComponentType } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>;\nconst ChevronRightIcon = ChevronRight as ComponentType<\n React.SVGProps<SVGSVGElement>\n>;\n\nfunction DropdownMenu({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />;\n}\n\nfunction DropdownMenuPortal({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n return (\n <DropdownMenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n );\n}\n\nconst DropdownMenuTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Trigger\n ref={ref}\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n));\nDropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.Group\n ref={ref}\n data-slot=\"dropdown-menu-group\"\n {...props}\n />\n));\nDropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n }\n>(({ className, inset, variant = \"default\", ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioGroup = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>\n>(({ ...props }, ref) => (\n <DropdownMenuPrimitive.RadioGroup\n ref={ref}\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n));\nDropdownMenuRadioGroup.displayName =\n DropdownMenuPrimitive.RadioGroup.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"text-muted-foreground ml-auto text-xs tracking-widest\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />;\n}\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n};\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":["React","DropdownMenuPrimitive","Check","ChevronRight","Circle","clsx","twMerge","cn","inputs","jsx","jsxs","CheckIcon","Check","CircleIcon","Circle","ChevronRightIcon","ChevronRight","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","ref","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var rt=Object.create;var ee=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var dt=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},ye=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of nt(t))!st.call(e,m)&&m!==r&&ee(e,m,{get:()=>t[m],enumerable:!(i=at(t,m))||i.enumerable});return e};var F=(e,t,r)=>(r=e!=null?rt(it(e)):{},ye(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),lt=e=>ye(ee({},"__esModule",{value:!0}),e);var Dt={};dt(Dt,{Button:()=>h,ClientOnly:()=>ke,Navbar:()=>Le,PlaceholderAlert:()=>et,TOTPValidator:()=>tt,UserDropdown:()=>Xe,UserProfile:()=>qe});module.exports=lt(Dt);var Pe=F(require("react")),Ce=require("@radix-ui/react-slot"),Re=require("class-variance-authority");var we=require("clsx"),Ne=require("tailwind-merge");function n(...e){return(0,Ne.twMerge)((0,we.clsx)(e))}var Me=require("react/jsx-runtime"),ct=(0,Re.cva)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),h=Pe.forwardRef(({className:e,variant:t,size:r,asChild:i=!1,...m},w)=>(0,Me.jsx)(i?Ce.Slot:"button",{className:n(ct({variant:t,size:r,className:e})),ref:w,...m}));h.displayName="Button";var te=require("react"),oe=require("react/jsx-runtime"),ke=({children:e})=>{let[t,r]=(0,te.useState)(!1);return(0,te.useEffect)(()=>{r(!0)},[]),t?(0,oe.jsx)(oe.Fragment,{children:e}):null};var be=require("react"),Y=require("lucide-react");var _=F(require("@radix-ui/react-avatar"));var re=require("react/jsx-runtime");function W({className:e,...t}){return(0,re.jsx)(_.Root,{"data-slot":"avatar",className:n("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function j({className:e,...t}){return(0,re.jsx)(_.Image,{"data-slot":"avatar-image",className:n("aspect-square size-full",e),...t})}function U({className:e,...t}){return(0,re.jsx)(_.Fallback,{"data-slot":"avatar-fallback",className:n("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var P=F(require("react")),s=F(require("@radix-ui/react-dropdown-menu")),H=require("lucide-react");var v=require("react/jsx-runtime"),mt=H.Check,pt=H.Circle,ut=H.ChevronRight;function ae({...e}){return(0,v.jsx)(s.Root,{"data-slot":"dropdown-menu",...e})}var $=P.forwardRef(({...e},t)=>(0,v.jsx)(s.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));$.displayName=s.Trigger.displayName;var Z=P.forwardRef(({className:e,sideOffset:t=4,...r},i)=>(0,v.jsx)(s.Portal,{children:(0,v.jsx)(s.Content,{ref:i,"data-slot":"dropdown-menu-content",sideOffset:t,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})}));Z.displayName=s.Content.displayName;var ve=P.forwardRef(({...e},t)=>(0,v.jsx)(s.Group,{ref:t,"data-slot":"dropdown-menu-group",...e}));ve.displayName=s.Group.displayName;var A=P.forwardRef(({className:e,inset:t,variant:r="default",...i},m)=>(0,v.jsx)(s.Item,{ref:m,"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:n("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i}));A.displayName=s.Item.displayName;var ft=P.forwardRef(({className:e,children:t,checked:r,...i},m)=>(0,v.jsxs)(s.CheckboxItem,{ref:m,"data-slot":"dropdown-menu-checkbox-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:r,...i,children:[(0,v.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,v.jsx)(s.ItemIndicator,{children:(0,v.jsx)(mt,{className:"size-4"})})}),t]}));ft.displayName=s.CheckboxItem.displayName;var vt=P.forwardRef(({...e},t)=>(0,v.jsx)(s.RadioGroup,{ref:t,"data-slot":"dropdown-menu-radio-group",...e}));vt.displayName=s.RadioGroup.displayName;var gt=P.forwardRef(({className:e,children:t,...r},i)=>(0,v.jsxs)(s.RadioItem,{ref:i,"data-slot":"dropdown-menu-radio-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[(0,v.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,v.jsx)(s.ItemIndicator,{children:(0,v.jsx)(pt,{className:"size-2 fill-current"})})}),t]}));gt.displayName=s.RadioItem.displayName;var ge=P.forwardRef(({className:e,inset:t,...r},i)=>(0,v.jsx)(s.Label,{ref:i,"data-slot":"dropdown-menu-label","data-inset":t,className:n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r}));ge.displayName=s.Label.displayName;var z=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)(s.Separator,{ref:r,"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",e),...t}));z.displayName=s.Separator.displayName;var bt=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)("span",{ref:r,"data-slot":"dropdown-menu-shortcut",className:n("text-muted-foreground ml-auto text-xs tracking-widest",e),...t}));bt.displayName="DropdownMenuShortcut";var xt=P.forwardRef(({className:e,inset:t,children:r,...i},m)=>(0,v.jsxs)(s.SubTrigger,{ref:m,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:n("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...i,children:[r,(0,v.jsx)(ut,{className:"ml-auto size-4"})]}));xt.displayName=s.SubTrigger.displayName;var ht=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)(s.SubContent,{ref:r,"data-slot":"dropdown-menu-sub-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t}));ht.displayName=s.SubContent.displayName;var y=F(require("@radix-ui/react-dialog")),De=require("lucide-react");var R=require("react/jsx-runtime"),yt=De.X;function Se({...e}){return(0,R.jsx)(y.Root,{"data-slot":"sheet",...e})}function Te({...e}){return(0,R.jsx)(y.Trigger,{"data-slot":"sheet-trigger",...e})}function wt({...e}){return(0,R.jsx)(y.Portal,{"data-slot":"sheet-portal",...e})}function Nt({className:e,...t}){return(0,R.jsx)(y.Overlay,{"data-slot":"sheet-overlay",className: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/50",e),...t})}function Ie({className:e,children:t,side:r="right",...i}){return(0,R.jsxs)(wt,{children:[(0,R.jsx)(Nt,{}),(0,R.jsxs)(y.Content,{"data-slot":"sheet-content",className:n("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...i,children:[t,(0,R.jsxs)(y.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,R.jsx)(yt,{className:"size-4"}),(0,R.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var ie=require("react"),ne=require("react/jsx-runtime"),Pt={className:"mr-2 h-4 w-4","aria-hidden":"true"},K=({Icon:e})=>{let[t,r]=(0,ie.useState)(!1);return(0,ie.useEffect)(()=>{r(!0)},[]),(0,ne.jsx)("span",{className:"inline-flex items-center justify-center",children:t?(0,ne.jsx)(e,{...Pt}):(0,ne.jsx)("span",{className:"mr-2 h-4 w-4","aria-hidden":"true"})})};var de=require("react"),le=require("lucide-react");var se=require("react/jsx-runtime"),Ee="authdog-theme",Ct=()=>{if(typeof window>"u")return"light";let e=window.localStorage.getItem(Ee);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},Ae=e=>{document.documentElement.classList.toggle("dark",e==="dark")},Ve=()=>{let[e,t]=(0,de.useState)("light");return(0,de.useEffect)(()=>{let i=Ct();Ae(i),t(i)},[]),(0,se.jsx)(h,{variant:"ghost",size:"icon",className:"cursor-pointer","aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",onClick:()=>{let i=e==="dark"?"light":"dark";Ae(i);try{window.localStorage.setItem(Ee,i)}catch{}t(i)},children:e==="dark"?(0,se.jsx)(le.Sun,{className:"h-4 w-4"}):(0,se.jsx)(le.Moon,{className:"h-4 w-4"})})};var a=require("react/jsx-runtime");function Le({items:e=[],children:t,className:r,logoText:i="ACME Corp",logoSrc:m,altText:w,user:g={name:"John Doe",email:"john@example.com",image:"https://i.pravatar.cc/150?u=a042581f4e29026704d"},onNavigateHome:E=()=>console.log("Navigating to home"),onNavItemClick:N=l=>console.log(`Navigating to ${l}`),dropdownMenuItems:C=[{name:"Profile",uri:"/profile",icon:Y.User}],onDropdownMenuItemClick:V=l=>console.log(`Navigating to ${l}`),onProfileSelected:D,onLogout:L=()=>console.log("Logout clicked"),isLoading:M=!1,identityHost:S="https://stg-id.authdog.xyz",environmentId:p="58be35b0-708f-49f6-84f0-6695d307d997"}){let[l,b]=(0,be.useState)(!1),[I,x]=(0,be.useState)(!1),u=g!=null&&g.id!==null&&g.id!==void 0;return(0,a.jsx)("header",{className:n("w-full border-b bg-background",r),children:(0,a.jsxs)("div",{className:n("mx-auto flex h-16 w-full max-w-6xl items-center justify-between px-4 md:px-6"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 md:gap-4",children:[(0,a.jsxs)("button",{type:"button",onClick:E,className:n("group inline-flex items-center gap-2 md:gap-3 rounded-md px-1 py-1 text-left cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),"aria-label":"Go to homepage",children:[m&&!I&&(0,a.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-md bg-muted/80 ring-1 ring-border",children:(0,a.jsx)("img",{src:m,alt:i,className:"h-7 w-7 object-contain",onError:()=>x(!0)})}),w??(0,a.jsx)("span",{className:"text-base font-semibold tracking-tight md:text-lg group-hover:text-primary",children:i})]}),t]}),(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-end gap-6",children:[(0,a.jsx)("nav",{className:"hidden md:flex items-center gap-6",children:e?.map((c,T)=>(0,a.jsx)("span",{onClick:()=>{c.disabled||N(c.href)},className:n("text-sm font-medium transition-colors hover:text-primary cursor-pointer",c.disabled&&"cursor-not-allowed opacity-80"),children:c.title},T))}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)(Se,{open:l,onOpenChange:b,children:[(0,a.jsx)(Te,{asChild:!0,children:(0,a.jsx)(h,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open Menu",children:(0,a.jsx)(K,{Icon:Y.Menu})})}),(0,a.jsx)(Ie,{side:"left",className:"pr-0",children:(0,a.jsx)("nav",{className:"grid gap-2 py-6",children:e?.map((c,T)=>(0,a.jsx)("a",{href:c.href,className:n("flex w-full items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent cursor-pointer",c.disabled&&"cursor-not-allowed opacity-80"),onClick:()=>b(!1),children:c.title},T))})})]}),(0,a.jsx)(Ve,{}),u?(0,a.jsxs)(ae,{children:[(0,a.jsx)($,{asChild:!0,children:(0,a.jsx)(h,{variant:"ghost",className:"relative h-8 w-8 rounded-full cursor-pointer",disabled:M,children:(0,a.jsx)(W,{className:"h-8 w-8",children:M?(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse bg-muted rounded-full"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j,{src:g.photos?.[0]?.value||"/placeholder.svg",alt:g.displayName}),(0,a.jsx)(U,{children:g.displayName?.charAt(0)})]})})})}),(0,a.jsx)(Z,{className:"w-56",align:"end",forceMount:!0,children:M?(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("div",{className:"h-4 w-3/4 animate-pulse bg-muted rounded mb-2"}),(0,a.jsx)("div",{className:"h-3 w-1/2 animate-pulse bg-muted rounded"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ge,{className:"font-normal",children:(0,a.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium leading-none",children:g.displayName}),(0,a.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:g.emails?.[0]?.value})]})}),C.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z,{}),(0,a.jsx)(ve,{children:C.map((c,T)=>(0,a.jsxs)(A,{onClick:()=>{c.disabled||(c.uri==="/profile"&&D&&D(),V(c.uri))},disabled:c.disabled,className:"cursor-pointer",children:[c.icon&&(0,a.jsx)(K,{Icon:c.icon}),(0,a.jsx)("span",{children:c.name})]},T))}),(0,a.jsx)(z,{})]}),(0,a.jsxs)(A,{onClick:L,className:"cursor-pointer",children:[(0,a.jsx)(K,{Icon:Y.LogOut}),(0,a.jsx)("span",{children:"Log out"})]})]})})]}):(0,a.jsx)(h,{variant:"default","aria-label":"Sign in",onClick:()=>{if(!p)throw new Error("Environment ID is required");if(!S)throw new Error("Identity Host is required");let c=`${S}/signin/${p}`;window.open(c,"_blank")},children:"Sign in"})]})]})]})})}var k=require("react");var ze=require("@radix-ui/react-slot"),Be=require("class-variance-authority");var Ge=require("react/jsx-runtime"),Rt=(0,Be.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ce({className:e,variant:t,asChild:r=!1,...i}){return(0,Ge.jsx)(r?ze.Slot:"span",{"data-slot":"badge",className:n(Rt({variant:t}),e),...i})}var B=require("react/jsx-runtime");function q({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card",className:n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Oe({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-header",className:n("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Fe({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-title",className:n("leading-none font-semibold",e),...t})}function _e({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-description",className:n("text-muted-foreground text-sm",e),...t})}function X({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-content",className:n("px-6",e),...t})}function We({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-footer",className:n("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Ue=require("react/jsx-runtime");function je({className:e,type:t,...r}){return(0,Ue.jsx)("input",{type:t,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var He=F(require("@radix-ui/react-label"));var Ke=require("react/jsx-runtime");function $e({className:e,...t}){return(0,Ke.jsx)(He.Root,{"data-slot":"label",className:n("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Ye=require("lucide-react"),o=require("react/jsx-runtime"),qe=({loading:e,user:t,handleAuthenticated:r,onRequestEmailVerification:i,onVerifyEmail:m,onAddEmail:w})=>{let[g,E]=(0,k.useState)(!1),[N,C]=(0,k.useState)("profile"),[V,D]=(0,k.useState)(null),[L,M]=(0,k.useState)({}),[S,p]=(0,k.useState)(!1),[l,b]=(0,k.useState)("");(0,k.useEffect)(()=>{E(!0)},[]),(0,k.useEffect)(()=>{!e&&r&&r()},[e,t,r]);let I={className:"mr-2 h-4 w-4","aria-hidden":"true"},x=u=>g?(0,o.jsx)(u,{...I}):null;return!g||e?(0,o.jsx)("div",{children:"Loading..."}):t?(0,o.jsxs)("div",{className:"grid grid-cols-[14rem,1fr] w-full bg-transparent",children:[(0,o.jsxs)("div",{className:"h-full border-r border-border p-3 md:p-4 bg-transparent flex flex-col min-w-0",children:[(0,o.jsxs)("div",{className:"mb-3 md:mb-4",children:[(0,o.jsx)("h1",{className:"text-xl font-bold text-foreground",children:"Account"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Manage your account info."})]}),(0,o.jsx)("nav",{className:"space-y-1 flex-1",children:(0,o.jsxs)("button",{onClick:()=>C("profile"),className:`flex items-center w-full px-3 py-2 text-sm rounded-md ${N==="profile"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:[x(Ye.User),"Profile"]})})]}),(0,o.jsxs)("div",{className:"h-full p-3 md:p-5 min-w-0 bg-transparent",children:[(0,o.jsx)("div",{className:"flex justify-between items-center mb-3 md:mb-4",children:(0,o.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:N==="profile"?"Profile details":N==="security"?"Security settings":"Preferences"})}),N==="profile"?(0,o.jsxs)("div",{className:"space-y-5 md:space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-foreground",children:"Profile"}),(0,o.jsx)("div",{className:"flex items-center justify-between",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsxs)(W,{className:"h-12 w-12 mr-4 border",children:[(0,o.jsx)(j,{src:t.photos?.[0]?.value,alt:"Profile picture"}),(0,o.jsx)(U,{children:t.displayName?.split(" ").map(u=>u[0]).join("")})]}),(0,o.jsx)("span",{className:"font-medium text-foreground",children:t.displayName})]})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-foreground",children:"Email addresses"}),(0,o.jsxs)("div",{className:"space-y-2.5",children:[t.emails.map((u,c)=>{let xe=(t?.verifications||[]).find(fe=>fe.email===u.value)?.verified===!0,he=L[u.value]||"";return(0,o.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)("span",{className:"text-foreground",children:u.value}),(0,o.jsx)("div",{className:"mt-1",children:xe?(0,o.jsx)(ce,{className:"text-xs rounded-full px-2.5 py-0.5 bg-green-100 text-green-800 border border-green-300 dark:bg-green-500/20 dark:text-green-200 dark:border-green-400/40",children:"Verified"}):(0,o.jsx)(ce,{className:"text-xs rounded-full px-2.5 py-0.5 bg-amber-100 text-amber-800 border border-amber-300 dark:bg-amber-500/20 dark:text-amber-200 dark:border-amber-400/40",children:"Not verified"})})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[c===0&&(0,o.jsx)(ce,{variant:"outline",className:"text-xs bg-muted text-foreground hover:bg-muted",children:"Primary"}),!xe&&(0,o.jsx)(o.Fragment,{children:V===u.value?(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)("input",{className:"h-7 w-24 text-sm rounded-md border border-border bg-background px-2 text-foreground",placeholder:"Code",value:he,onChange:fe=>M(ot=>({...ot,[u.value]:fe.target.value}))}),(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:async()=>{m&&await m(u.value,he)},children:"Verify"}),(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:()=>D(null),children:"Cancel"})]}):(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:async()=>{i&&await i(u.value),D(u.value)},children:"Send code"})})})]})]},u.value)}),(0,o.jsx)("div",{className:"mt-2",children:S?(0,o.jsx)("div",{className:"max-w-md",children:(0,o.jsxs)(q,{children:[(0,o.jsxs)(Oe,{children:[(0,o.jsx)(Fe,{children:"Add email address"}),(0,o.jsx)(_e,{children:"You'll need to verify this email address before it can be added to your account."})]}),(0,o.jsx)(X,{children:(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)($e,{htmlFor:"new-email",children:"Email address"}),(0,o.jsx)(je,{id:"new-email",placeholder:"Enter your email address",value:l,onChange:u=>b(u.target.value),onKeyDown:async u=>{if(u.key==="Enter"){let c=String(l||"").trim().toLowerCase();if(!c)return;w&&await w(c),p(!1),b("")}}})]})}),(0,o.jsxs)(We,{className:"justify-end gap-2",children:[(0,o.jsx)(h,{variant:"ghost",onClick:()=>{p(!1),b("")},children:"Cancel"}),(0,o.jsx)(h,{onClick:async()=>{let u=String(l||"").trim().toLowerCase();u&&(w&&await w(u),p(!1),b(""))},children:"Add"})]})]})}):(0,o.jsx)(h,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>p(!0),children:"Add email"})})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Connected accounts"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("div",{className:"flex items-center",children:(0,o.jsx)("div",{className:"mr-2",children:(0,o.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:t.provider})})}),(0,o.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t?.emails?.[0]?.value})]},t.provider)})]})]}):N==="security"?(0,o.jsxs)("div",{className:"space-y-5 md:space-y-6",children:[(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Password"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"Set password"})]})}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Passkeys"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"+\xA0Add a passkey"})]})}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Two-step verification"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"+\xA0Add two-step verification"})]})}),(0,o.jsxs)("div",{className:"border rounded-md overflow-hidden",children:[(0,o.jsx)("div",{className:"px-4 py-3 border-b text-sm font-medium text-gray-900 dark:text-gray-100",children:"Active devices"}),(0,o.jsx)("div",{className:"p-4 space-y-3",children:(0,o.jsxs)("div",{className:"text-sm",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"inline-block h-5 w-5 rounded-sm bg-gray-900 dark:bg-white"}),(0,o.jsx)("span",{className:"font-medium",children:"X11"}),(0,o.jsx)("span",{className:"text-xs rounded-md border px-2 py-0.5 text-gray-600 dark:text-gray-300",children:"This device"})]}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"Firefox 142.0"}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:"127.0.0.1 (Local), (Your City)"}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:"Today at 7:08 PM"})]})})]}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Delete account"}),(0,o.jsx)("button",{className:"text-sm text-red-600 hover:underline",children:"Delete account"})]})})]}):(0,o.jsx)("div",{className:"space-y-5 md:space-y-6",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Preferences"}),(0,o.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Locale"}),(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Auto"})]}),(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Theme"}),(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"System"})]})]})]})})]})]}):(0,o.jsx)("div",{children:"No user"})};var J=require("lucide-react"),f=require("react/jsx-runtime"),Mt=e=>e&&String(e).trim().split(/\s+/).slice(0,2).map(i=>i[0]?.toUpperCase()).join("")||"?",Xe=({trigger:e,user:t,className:r,onManageAccount:i,onSignout:m,links:w=[],side:g="bottom",align:E="end",sideOffset:N=8,modal:C=!1,triggerAsChild:V=!1,triggerWrapperClassName:D})=>{let L=t?.emails?.[0]?.value||t?.email||"",M=t?.displayName||t?.name||"",S=t?.photos?.[0]?.value||t?.avatar||"",p=x=>{if(x.onClick)return x.onClick();x.href&&(x.href.startsWith("http")?window.open(x.href,"_blank"):window.location.assign(x.href))},l=J.ExternalLink,b=J.Settings,I=J.LogOut;return(0,f.jsxs)(ae,{modal:C,children:[V?(0,f.jsx)($,{asChild:!0,children:e}):(0,f.jsx)($,{className:n("inline-flex items-center justify-center bg-transparent p-0 border-0 outline-none focus-visible:outline-none",D),children:e}),(0,f.jsxs)(Z,{align:E,side:g,sideOffset:N,className:n("w-72 p-2 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",r),children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-4 pb-3",children:[(0,f.jsxs)(W,{className:"h-9 w-9 rounded-full",children:[(0,f.jsx)(j,{src:S,alt:M}),(0,f.jsx)(U,{className:"rounded-full",children:Mt(M)})]}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("div",{className:"text-sm font-semibold truncate",children:M}),(0,f.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:L})]})]}),(0,f.jsx)(z,{}),(0,f.jsxs)(A,{className:"cursor-pointer py-2",onClick:()=>i?.(),children:[(0,f.jsx)(b,{className:"mr-2 h-4 w-4"}),(0,f.jsx)("span",{children:"Manage account"})]}),w.map((x,u)=>{let c=x.icon??l;return(0,f.jsxs)(A,{className:"cursor-pointer py-2",onClick:()=>p(x),children:[(0,f.jsx)(c,{className:"mr-2 h-4 w-4"}),(0,f.jsx)("span",{children:x.label})]},`${x.label}-${u}`)}),(0,f.jsx)(z,{}),(0,f.jsxs)(A,{className:"cursor-pointer py-2 rounded-md font-semibold text-red-600 dark:text-red-300 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700 dark:hover:bg-red-500/20 dark:focus:bg-red-500/25 dark:hover:text-red-100 dark:focus:text-red-100 border border-transparent dark:border-red-500/30 ring-0 focus-visible:ring-2 focus-visible:ring-red-400/40 dark:focus-visible:ring-red-400/40",onClick:()=>m?.(),children:[(0,f.jsx)(I,{className:"mr-2 h-4 w-4 text-red-600 dark:text-red-300"}),(0,f.jsx)("span",{children:"Sign out"})]})]})]})};var Ze=require("lucide-react");var Je=require("class-variance-authority");var ue=require("react/jsx-runtime"),kt=(0,Je.cva)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...r}){return(0,ue.jsx)("div",{"data-slot":"alert",role:"alert",className:n(kt({variant:t}),e),...r})}function Qe({className:e,...t}){return(0,ue.jsx)("div",{"data-slot":"alert-title",className:n("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function pe({className:e,...t}){return(0,ue.jsx)("div",{"data-slot":"alert-description",className:n("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var G=require("react/jsx-runtime"),et=e=>{let t=e.title??"Placeholder Alert",r=e.description??"This is a placeholder alert.";return(0,G.jsx)("div",{className:"grid w-full max-w-xl items-start gap-4",children:(0,G.jsxs)(me,{children:[(0,G.jsx)(K,{Icon:Ze.CheckCircle2Icon}),(0,G.jsx)(Qe,{children:t}),(0,G.jsx)(pe,{children:r})]})})};var O=require("react");var Q=require("lucide-react"),d=require("react/jsx-runtime"),tt=({onValidate:e})=>{let[t,r]=(0,O.useState)(["","","","","",""]),[i,m]=(0,O.useState)(!1),[w,g]=(0,O.useState)(""),[E,N]=(0,O.useState)(!1),C=(0,O.useRef)([]),V=(p,l)=>{if(!/^\d*$/.test(l))return;let b=[...t];b[p]=l.slice(-1),r(b),g(""),N(!1),l&&p<5&&C.current[p+1]?.focus()},D=(p,l)=>{l.key==="Backspace"&&!t[p]&&p>0&&C.current[p-1]?.focus(),l.key==="v"&&(l.ctrlKey||l.metaKey)&&(l.preventDefault(),navigator.clipboard.readText().then(b=>{let I=b.replace(/\D/g,"").slice(0,6).split(""),x=[...t];I.forEach((c,T)=>{T<6&&(x[T]=c)}),r(x);let u=Math.min(I.length,5);C.current[u]?.focus()}))},L=async()=>{let p=t.join("");if(p.length!==6){g("Please enter all 6 digits");return}m(!0),g("");try{await e(p),N(!0)}catch{g("Invalid TOTP code. Please try again.")}finally{m(!1)}},M=p=>{p.preventDefault(),L()},S=()=>{r(["","","","","",""]),g(""),N(!1),m(!1),C.current[0]?.focus()};return E?(0,d.jsx)("div",{className:"max-w-md mx-auto",children:(0,d.jsx)(q,{className:"border-green-200 bg-green-50",children:(0,d.jsx)(X,{className:"pt-6",children:(0,d.jsxs)("div",{className:"text-center space-y-4",children:[(0,d.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:(0,d.jsx)(Q.CheckCircle,{className:"w-8 h-8 text-green-600"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Verification Successful!"}),(0,d.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"Your TOTP code has been validated."})]}),(0,d.jsx)(h,{onClick:S,variant:"outline",className:"bg-white",children:"Verify Another Code"})]})})})}):(0,d.jsx)("div",{className:"max-w-md mx-auto",children:(0,d.jsx)(q,{children:(0,d.jsx)(X,{className:"pt-6",children:(0,d.jsxs)("div",{className:"text-center space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,d.jsx)(Q.Shield,{className:"w-6 h-6 text-blue-600"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold",children:"Enter Verification Code"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Enter the 6-digit code from your authenticator app"})]}),(0,d.jsxs)("form",{onSubmit:M,className:"space-y-6",children:[(0,d.jsx)("div",{className:"flex justify-center gap-2",children:t.map((p,l)=>(0,d.jsx)(q,{className:"w-12 h-14 border-2 focus-within:border-blue-500 transition-colors",children:(0,d.jsx)(X,{className:"p-0 h-full flex items-center justify-center",children:(0,d.jsx)("input",{ref:b=>{C.current[l]=b},type:"tel",inputMode:"numeric",maxLength:1,value:p,onChange:b=>V(l,b.target.value),onKeyDown:b=>D(l,b),className:"w-full h-full text-center text-2xl font-bold border-none outline-none bg-transparent",autoComplete:"one-time-code",disabled:i,style:{height:"auto"}})})},l))}),w&&(0,d.jsxs)(me,{variant:"destructive",children:[(0,d.jsx)(Q.AlertCircle,{className:"h-4 w-4"}),(0,d.jsx)(pe,{children:w})]}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(h,{type:"submit",className:"w-full",disabled:i||t.some(p=>p===""),children:i?"Verifying...":"Verify Code"}),(0,d.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:S,className:"w-full text-xs",children:"Clear Code"})]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Codes refresh every 30 seconds"})]})})})})};
|
|
2
|
+
"use strict";var rt=Object.create;var ee=Object.defineProperty;var at=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var it=Object.getPrototypeOf,st=Object.prototype.hasOwnProperty;var dt=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},ye=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of nt(t))!st.call(e,l)&&l!==r&&ee(e,l,{get:()=>t[l],enumerable:!(i=at(t,l))||i.enumerable});return e};var W=(e,t,r)=>(r=e!=null?rt(it(e)):{},ye(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),lt=e=>ye(ee({},"__esModule",{value:!0}),e);var Dt={};dt(Dt,{Button:()=>h,ClientOnly:()=>ke,Navbar:()=>Le,PlaceholderAlert:()=>et,TOTPValidator:()=>tt,UserDropdown:()=>Xe,UserProfile:()=>qe});module.exports=lt(Dt);var Pe=W(require("react")),Ce=require("@radix-ui/react-slot"),Re=require("class-variance-authority");var we=require("clsx"),Ne=require("tailwind-merge");function n(...e){return(0,Ne.twMerge)((0,we.clsx)(e))}var Me=require("react/jsx-runtime"),ct=(0,Re.cva)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),h=Pe.forwardRef(({className:e,variant:t,size:r,asChild:i=!1,...l},w)=>(0,Me.jsx)(i?Ce.Slot:"button",{className:n(ct({variant:t,size:r,className:e})),ref:w,...l}));h.displayName="Button";var te=require("react"),oe=require("react/jsx-runtime"),ke=({children:e})=>{let[t,r]=(0,te.useState)(!1);return(0,te.useEffect)(()=>{r(!0)},[]),t?(0,oe.jsx)(oe.Fragment,{children:e}):null};var be=require("react"),Y=require("lucide-react");var _=W(require("@radix-ui/react-avatar"));var re=require("react/jsx-runtime");function F({className:e,...t}){return(0,re.jsx)(_.Root,{"data-slot":"avatar",className:n("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function j({className:e,...t}){return(0,re.jsx)(_.Image,{"data-slot":"avatar-image",className:n("aspect-square size-full",e),...t})}function U({className:e,...t}){return(0,re.jsx)(_.Fallback,{"data-slot":"avatar-fallback",className:n("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var P=W(require("react")),s=W(require("@radix-ui/react-dropdown-menu")),H=require("lucide-react");var v=require("react/jsx-runtime"),mt=H.Check,pt=H.Circle,ut=H.ChevronRight;function ae({...e}){return(0,v.jsx)(s.Root,{"data-slot":"dropdown-menu",...e})}var $=P.forwardRef(({...e},t)=>(0,v.jsx)(s.Trigger,{ref:t,"data-slot":"dropdown-menu-trigger",...e}));$.displayName=s.Trigger.displayName;var Z=P.forwardRef(({className:e,sideOffset:t=4,...r},i)=>(0,v.jsx)(s.Portal,{children:(0,v.jsx)(s.Content,{ref:i,"data-slot":"dropdown-menu-content",sideOffset:t,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})}));Z.displayName=s.Content.displayName;var ve=P.forwardRef(({...e},t)=>(0,v.jsx)(s.Group,{ref:t,"data-slot":"dropdown-menu-group",...e}));ve.displayName=s.Group.displayName;var A=P.forwardRef(({className:e,inset:t,variant:r="default",...i},l)=>(0,v.jsx)(s.Item,{ref:l,"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,className:n("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...i}));A.displayName=s.Item.displayName;var ft=P.forwardRef(({className:e,children:t,checked:r,...i},l)=>(0,v.jsxs)(s.CheckboxItem,{ref:l,"data-slot":"dropdown-menu-checkbox-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),checked:r,...i,children:[(0,v.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,v.jsx)(s.ItemIndicator,{children:(0,v.jsx)(mt,{className:"size-4"})})}),t]}));ft.displayName=s.CheckboxItem.displayName;var vt=P.forwardRef(({...e},t)=>(0,v.jsx)(s.RadioGroup,{ref:t,"data-slot":"dropdown-menu-radio-group",...e}));vt.displayName=s.RadioGroup.displayName;var gt=P.forwardRef(({className:e,children:t,...r},i)=>(0,v.jsxs)(s.RadioItem,{ref:i,"data-slot":"dropdown-menu-radio-item",className:n("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[(0,v.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,v.jsx)(s.ItemIndicator,{children:(0,v.jsx)(pt,{className:"size-2 fill-current"})})}),t]}));gt.displayName=s.RadioItem.displayName;var ge=P.forwardRef(({className:e,inset:t,...r},i)=>(0,v.jsx)(s.Label,{ref:i,"data-slot":"dropdown-menu-label","data-inset":t,className:n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r}));ge.displayName=s.Label.displayName;var z=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)(s.Separator,{ref:r,"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",e),...t}));z.displayName=s.Separator.displayName;var bt=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)("span",{ref:r,"data-slot":"dropdown-menu-shortcut",className:n("text-muted-foreground ml-auto text-xs tracking-widest",e),...t}));bt.displayName="DropdownMenuShortcut";var xt=P.forwardRef(({className:e,inset:t,children:r,...i},l)=>(0,v.jsxs)(s.SubTrigger,{ref:l,"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:n("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...i,children:[r,(0,v.jsx)(ut,{className:"ml-auto size-4"})]}));xt.displayName=s.SubTrigger.displayName;var ht=P.forwardRef(({className:e,...t},r)=>(0,v.jsx)(s.SubContent,{ref:r,"data-slot":"dropdown-menu-sub-content",className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",e),...t}));ht.displayName=s.SubContent.displayName;var y=W(require("@radix-ui/react-dialog")),De=require("lucide-react");var R=require("react/jsx-runtime"),yt=De.X;function Se({...e}){return(0,R.jsx)(y.Root,{"data-slot":"sheet",...e})}function Te({...e}){return(0,R.jsx)(y.Trigger,{"data-slot":"sheet-trigger",...e})}function wt({...e}){return(0,R.jsx)(y.Portal,{"data-slot":"sheet-portal",...e})}function Nt({className:e,...t}){return(0,R.jsx)(y.Overlay,{"data-slot":"sheet-overlay",className: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/50",e),...t})}function Ie({className:e,children:t,side:r="right",...i}){return(0,R.jsxs)(wt,{children:[(0,R.jsx)(Nt,{}),(0,R.jsxs)(y.Content,{"data-slot":"sheet-content",className:n("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...i,children:[t,(0,R.jsxs)(y.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,R.jsx)(yt,{className:"size-4"}),(0,R.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var ie=require("react"),ne=require("react/jsx-runtime"),Pt={className:"mr-2 h-4 w-4 text-current","aria-hidden":"true"},K=({Icon:e,withMargin:t=!0})=>{let[r,i]=(0,ie.useState)(!1);return(0,ie.useEffect)(()=>{i(!0)},[]),(0,ne.jsx)("span",{className:"inline-flex items-center justify-center",children:r?(0,ne.jsx)(e,{...t?Pt:{className:"h-4 w-4 text-current","aria-hidden":"true"}}):(0,ne.jsx)("span",{className:t?"mr-2 h-4 w-4":"h-4 w-4","aria-hidden":"true"})})};var de=require("react"),le=require("lucide-react");var se=require("react/jsx-runtime"),Ee="authdog-theme",Ct=()=>{if(typeof window>"u")return"light";let e=window.localStorage.getItem(Ee);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},Ae=e=>{document.documentElement.classList.toggle("dark",e==="dark")},Ve=()=>{let[e,t]=(0,de.useState)("light");return(0,de.useEffect)(()=>{let i=Ct();Ae(i),t(i)},[]),(0,se.jsx)(h,{variant:"ghost",size:"icon",className:"cursor-pointer","aria-label":e==="dark"?"Switch to light theme":"Switch to dark theme",onClick:()=>{let i=e==="dark"?"light":"dark";Ae(i);try{window.localStorage.setItem(Ee,i)}catch{}t(i)},children:e==="dark"?(0,se.jsx)(le.Sun,{className:"h-4 w-4"}):(0,se.jsx)(le.Moon,{className:"h-4 w-4"})})};var a=require("react/jsx-runtime");function Le({items:e=[],children:t,className:r,logoText:i="ACME Corp",logoSrc:l,altText:w,user:g={name:"John Doe",email:"john@example.com",image:"https://i.pravatar.cc/150?u=a042581f4e29026704d"},onNavigateHome:E=()=>console.log("Navigating to home"),onNavItemClick:N=c=>console.log(`Navigating to ${c}`),dropdownMenuItems:C=[{name:"Profile",uri:"/profile",icon:Y.User}],onDropdownMenuItemClick:V=c=>console.log(`Navigating to ${c}`),onProfileSelected:D,onLogout:L=()=>console.log("Logout clicked"),isLoading:M=!1,identityHost:S="https://stg-id.authdog.xyz",environmentId:p="58be35b0-708f-49f6-84f0-6695d307d997"}){let[c,b]=(0,be.useState)(!1),[I,x]=(0,be.useState)(!1),u=g!=null&&g.id!==null&&g.id!==void 0;return(0,a.jsx)("header",{className:n("w-full border-b bg-background",r),children:(0,a.jsxs)("div",{className:n("mx-auto flex h-16 w-full max-w-6xl items-center justify-between px-4 md:px-6"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 md:gap-4",children:[(0,a.jsxs)("button",{type:"button",onClick:E,className:n("group inline-flex items-center gap-2 md:gap-3 rounded-md px-1 py-1 text-left cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"),"aria-label":"Go to homepage",children:[l&&!I&&(0,a.jsx)("span",{className:"inline-flex h-8 w-8 items-center justify-center overflow-hidden rounded-md bg-muted/80 ring-1 ring-border",children:(0,a.jsx)("img",{src:l,alt:i,className:"h-7 w-7 object-contain",onError:()=>x(!0)})}),w??(0,a.jsx)("span",{className:"text-base font-semibold tracking-tight md:text-lg group-hover:text-primary",children:i})]}),t]}),(0,a.jsxs)("div",{className:"flex flex-1 items-center justify-end gap-6",children:[(0,a.jsx)("nav",{className:"hidden md:flex items-center gap-6",children:e?.map((m,T)=>(0,a.jsx)("span",{onClick:()=>{m.disabled||N(m.href)},className:n("text-sm font-medium transition-colors hover:text-primary cursor-pointer",m.disabled&&"cursor-not-allowed opacity-80"),children:m.title},T))}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)(Se,{open:c,onOpenChange:b,children:[(0,a.jsx)(Te,{asChild:!0,children:(0,a.jsx)(h,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open Menu",children:(0,a.jsx)(K,{Icon:Y.Menu,withMargin:!1})})}),(0,a.jsx)(Ie,{side:"left",className:"pr-0",children:(0,a.jsx)("nav",{className:"grid gap-2 py-6",children:e?.map((m,T)=>(0,a.jsx)("a",{href:m.href,className:n("flex w-full items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent cursor-pointer",m.disabled&&"cursor-not-allowed opacity-80"),onClick:()=>b(!1),children:m.title},T))})})]}),(0,a.jsx)(Ve,{}),u?(0,a.jsxs)(ae,{children:[(0,a.jsx)($,{asChild:!0,children:(0,a.jsx)(h,{variant:"ghost",className:"relative h-8 w-8 rounded-full cursor-pointer",disabled:M,children:(0,a.jsx)(F,{className:"h-8 w-8",children:M?(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse bg-muted rounded-full"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j,{src:g.photos?.[0]?.value||"/placeholder.svg",alt:g.displayName}),(0,a.jsx)(U,{children:g.displayName?.charAt(0)})]})})})}),(0,a.jsx)(Z,{className:"w-56",align:"end",forceMount:!0,children:M?(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("div",{className:"h-4 w-3/4 animate-pulse bg-muted rounded mb-2"}),(0,a.jsx)("div",{className:"h-3 w-1/2 animate-pulse bg-muted rounded"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ge,{className:"font-normal",children:(0,a.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium leading-none",children:g.displayName}),(0,a.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:g.emails?.[0]?.value})]})}),C.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(z,{}),(0,a.jsx)(ve,{children:C.map((m,T)=>(0,a.jsxs)(A,{onClick:()=>{m.disabled||(m.uri==="/profile"&&D&&D(),V(m.uri))},disabled:m.disabled,className:"cursor-pointer",children:[m.icon&&(0,a.jsx)(K,{Icon:m.icon}),(0,a.jsx)("span",{children:m.name})]},T))}),(0,a.jsx)(z,{})]}),(0,a.jsxs)(A,{onClick:L,className:"cursor-pointer",children:[(0,a.jsx)(K,{Icon:Y.LogOut}),(0,a.jsx)("span",{children:"Log out"})]})]})})]}):(0,a.jsx)(h,{variant:"default",className:"cursor-pointer","aria-label":"Sign in",onClick:()=>{if(!p)throw new Error("Environment ID is required");if(!S)throw new Error("Identity Host is required");let m=`${S}/signin/${p}`;window.open(m,"_blank")},children:"Sign in"})]})]})]})})}var k=require("react");var ze=require("@radix-ui/react-slot"),Be=require("class-variance-authority");var Ge=require("react/jsx-runtime"),Rt=(0,Be.cva)("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function ce({className:e,variant:t,asChild:r=!1,...i}){return(0,Ge.jsx)(r?ze.Slot:"span",{"data-slot":"badge",className:n(Rt({variant:t}),e),...i})}var B=require("react/jsx-runtime");function q({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card",className:n("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function Oe({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-header",className:n("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function We({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-title",className:n("leading-none font-semibold",e),...t})}function _e({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-description",className:n("text-muted-foreground text-sm",e),...t})}function X({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-content",className:n("px-6",e),...t})}function Fe({className:e,...t}){return(0,B.jsx)("div",{"data-slot":"card-footer",className:n("flex items-center px-6 [.border-t]:pt-6",e),...t})}var Ue=require("react/jsx-runtime");function je({className:e,type:t,...r}){return(0,Ue.jsx)("input",{type:t,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var He=W(require("@radix-ui/react-label"));var Ke=require("react/jsx-runtime");function $e({className:e,...t}){return(0,Ke.jsx)(He.Root,{"data-slot":"label",className:n("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Ye=require("lucide-react"),o=require("react/jsx-runtime"),qe=({loading:e,user:t,handleAuthenticated:r,onRequestEmailVerification:i,onVerifyEmail:l,onAddEmail:w})=>{let[g,E]=(0,k.useState)(!1),[N,C]=(0,k.useState)("profile"),[V,D]=(0,k.useState)(null),[L,M]=(0,k.useState)({}),[S,p]=(0,k.useState)(!1),[c,b]=(0,k.useState)("");(0,k.useEffect)(()=>{E(!0)},[]),(0,k.useEffect)(()=>{!e&&r&&r()},[e,t,r]);let I={className:"mr-2 h-4 w-4","aria-hidden":"true"},x=u=>g?(0,o.jsx)(u,{...I}):null;return!g||e?(0,o.jsx)("div",{children:"Loading..."}):t?(0,o.jsxs)("div",{className:"grid grid-cols-[14rem,1fr] w-full bg-transparent",children:[(0,o.jsxs)("div",{className:"h-full border-r border-border p-3 md:p-4 bg-transparent flex flex-col min-w-0",children:[(0,o.jsxs)("div",{className:"mb-3 md:mb-4",children:[(0,o.jsx)("h1",{className:"text-xl font-bold text-foreground",children:"Account"}),(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Manage your account info."})]}),(0,o.jsx)("nav",{className:"space-y-1 flex-1",children:(0,o.jsxs)("button",{onClick:()=>C("profile"),className:`flex items-center w-full px-3 py-2 text-sm rounded-md ${N==="profile"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,children:[x(Ye.User),"Profile"]})})]}),(0,o.jsxs)("div",{className:"h-full p-3 md:p-5 min-w-0 bg-transparent",children:[(0,o.jsx)("div",{className:"flex justify-between items-center mb-3 md:mb-4",children:(0,o.jsx)("h2",{className:"text-xl font-semibold text-foreground",children:N==="profile"?"Profile details":N==="security"?"Security settings":"Preferences"})}),N==="profile"?(0,o.jsxs)("div",{className:"space-y-5 md:space-y-6",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-foreground",children:"Profile"}),(0,o.jsx)("div",{className:"flex items-center justify-between",children:(0,o.jsxs)("div",{className:"flex items-center",children:[(0,o.jsxs)(F,{className:"h-12 w-12 mr-4 border",children:[(0,o.jsx)(j,{src:t.photos?.[0]?.value,alt:"Profile picture"}),(0,o.jsx)(U,{children:t.displayName?.split(" ").map(u=>u[0]).join("")})]}),(0,o.jsx)("span",{className:"font-medium text-foreground",children:t.displayName})]})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-foreground",children:"Email addresses"}),(0,o.jsxs)("div",{className:"space-y-2.5",children:[t.emails.map((u,m)=>{let xe=(t?.verifications||[]).find(fe=>fe.email===u.value)?.verified===!0,he=L[u.value]||"";return(0,o.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)("span",{className:"text-foreground",children:u.value}),(0,o.jsx)("div",{className:"mt-1",children:xe?(0,o.jsx)(ce,{className:"text-xs rounded-full px-2.5 py-0.5 bg-green-100 text-green-800 border border-green-300 dark:bg-green-500/20 dark:text-green-200 dark:border-green-400/40",children:"Verified"}):(0,o.jsx)(ce,{className:"text-xs rounded-full px-2.5 py-0.5 bg-amber-100 text-amber-800 border border-amber-300 dark:bg-amber-500/20 dark:text-amber-200 dark:border-amber-400/40",children:"Not verified"})})]}),(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[m===0&&(0,o.jsx)(ce,{variant:"outline",className:"text-xs bg-muted text-foreground hover:bg-muted",children:"Primary"}),!xe&&(0,o.jsx)(o.Fragment,{children:V===u.value?(0,o.jsxs)("div",{className:"flex items-center gap-1",children:[(0,o.jsx)("input",{className:"h-7 w-24 text-sm rounded-md border border-border bg-background px-2 text-foreground",placeholder:"Code",value:he,onChange:fe=>M(ot=>({...ot,[u.value]:fe.target.value}))}),(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:async()=>{l&&await l(u.value,he)},children:"Verify"}),(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:()=>D(null),children:"Cancel"})]}):(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("button",{className:"h-7 rounded-md border border-border px-2 text-xs",onClick:async()=>{i&&await i(u.value),D(u.value)},children:"Send code"})})})]})]},u.value)}),(0,o.jsx)("div",{className:"mt-2",children:S?(0,o.jsx)("div",{className:"max-w-md",children:(0,o.jsxs)(q,{children:[(0,o.jsxs)(Oe,{children:[(0,o.jsx)(We,{children:"Add email address"}),(0,o.jsx)(_e,{children:"You'll need to verify this email address before it can be added to your account."})]}),(0,o.jsx)(X,{children:(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)($e,{htmlFor:"new-email",children:"Email address"}),(0,o.jsx)(je,{id:"new-email",placeholder:"Enter your email address",value:c,onChange:u=>b(u.target.value),onKeyDown:async u=>{if(u.key==="Enter"){let m=String(c||"").trim().toLowerCase();if(!m)return;w&&await w(m),p(!1),b("")}}})]})}),(0,o.jsxs)(Fe,{className:"justify-end gap-2",children:[(0,o.jsx)(h,{variant:"ghost",onClick:()=>{p(!1),b("")},children:"Cancel"}),(0,o.jsx)(h,{onClick:async()=>{let u=String(c||"").trim().toLowerCase();u&&(w&&await w(u),p(!1),b(""))},children:"Add"})]})]})}):(0,o.jsx)(h,{variant:"outline",size:"sm",className:"text-xs",onClick:()=>p(!0),children:"Add email"})})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Connected accounts"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("div",{className:"flex items-center",children:(0,o.jsx)("div",{className:"mr-2",children:(0,o.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:t.provider})})}),(0,o.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t?.emails?.[0]?.value})]},t.provider)})]})]}):N==="security"?(0,o.jsxs)("div",{className:"space-y-5 md:space-y-6",children:[(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Password"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"Set password"})]})}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Passkeys"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"+\xA0Add a passkey"})]})}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Two-step verification"}),(0,o.jsx)("button",{className:"text-sm text-indigo-600 hover:underline",children:"+\xA0Add two-step verification"})]})}),(0,o.jsxs)("div",{className:"border rounded-md overflow-hidden",children:[(0,o.jsx)("div",{className:"px-4 py-3 border-b text-sm font-medium text-gray-900 dark:text-gray-100",children:"Active devices"}),(0,o.jsx)("div",{className:"p-4 space-y-3",children:(0,o.jsxs)("div",{className:"text-sm",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"inline-block h-5 w-5 rounded-sm bg-gray-900 dark:bg-white"}),(0,o.jsx)("span",{className:"font-medium",children:"X11"}),(0,o.jsx)("span",{className:"text-xs rounded-md border px-2 py-0.5 text-gray-600 dark:text-gray-300",children:"This device"})]}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400 mt-1",children:"Firefox 142.0"}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:"127.0.0.1 (Local), (Your City)"}),(0,o.jsx)("div",{className:"text-gray-600 dark:text-gray-400",children:"Today at 7:08 PM"})]})})]}),(0,o.jsx)("div",{className:"border rounded-md overflow-hidden",children:(0,o.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,o.jsx)("div",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Delete account"}),(0,o.jsx)("button",{className:"text-sm text-red-600 hover:underline",children:"Delete account"})]})})]}):(0,o.jsx)("div",{className:"space-y-5 md:space-y-6",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Preferences"}),(0,o.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Locale"}),(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"Auto"})]}),(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-gray-700 dark:text-gray-300",children:"Theme"}),(0,o.jsx)("span",{className:"text-gray-500 dark:text-gray-400",children:"System"})]})]})]})})]})]}):(0,o.jsx)("div",{children:"No user"})};var J=require("lucide-react"),f=require("react/jsx-runtime"),Mt=e=>e&&String(e).trim().split(/\s+/).slice(0,2).map(i=>i[0]?.toUpperCase()).join("")||"?",Xe=({trigger:e,user:t,className:r,onManageAccount:i,onSignout:l,links:w=[],side:g="bottom",align:E="end",sideOffset:N=8,modal:C=!1,triggerAsChild:V=!1,triggerWrapperClassName:D})=>{let L=t?.emails?.[0]?.value||t?.email||"",M=t?.displayName||t?.name||"",S=t?.photos?.[0]?.value||t?.avatar||"",p=x=>{if(x.onClick)return x.onClick();x.href&&(x.href.startsWith("http")?window.open(x.href,"_blank"):window.location.assign(x.href))},c=J.ExternalLink,b=J.Settings,I=J.LogOut;return(0,f.jsxs)(ae,{modal:C,children:[V?(0,f.jsx)($,{asChild:!0,children:e}):(0,f.jsx)($,{className:n("inline-flex items-center justify-center bg-transparent p-0 border-0 outline-none focus-visible:outline-none",D),children:e}),(0,f.jsxs)(Z,{align:E,side:g,sideOffset:N,className:n("w-72 p-2 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",r),children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-4 pb-3",children:[(0,f.jsxs)(F,{className:"h-9 w-9 rounded-full",children:[(0,f.jsx)(j,{src:S,alt:M}),(0,f.jsx)(U,{className:"rounded-full",children:Mt(M)})]}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("div",{className:"text-sm font-semibold truncate",children:M}),(0,f.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:L})]})]}),(0,f.jsx)(z,{}),(0,f.jsxs)(A,{className:"cursor-pointer py-2",onClick:()=>i?.(),children:[(0,f.jsx)(b,{className:"mr-2 h-4 w-4"}),(0,f.jsx)("span",{children:"Manage account"})]}),w.map((x,u)=>{let m=x.icon??c;return(0,f.jsxs)(A,{className:"cursor-pointer py-2",onClick:()=>p(x),children:[(0,f.jsx)(m,{className:"mr-2 h-4 w-4"}),(0,f.jsx)("span",{children:x.label})]},`${x.label}-${u}`)}),(0,f.jsx)(z,{}),(0,f.jsxs)(A,{className:"cursor-pointer py-2 rounded-md font-semibold text-red-600 dark:text-red-300 hover:bg-red-50 hover:text-red-700 focus:bg-red-50 focus:text-red-700 dark:hover:bg-red-500/20 dark:focus:bg-red-500/25 dark:hover:text-red-100 dark:focus:text-red-100 border border-transparent dark:border-red-500/30 ring-0 focus-visible:ring-2 focus-visible:ring-red-400/40 dark:focus-visible:ring-red-400/40",onClick:()=>l?.(),children:[(0,f.jsx)(I,{className:"mr-2 h-4 w-4 text-red-600 dark:text-red-300"}),(0,f.jsx)("span",{children:"Sign out"})]})]})]})};var Ze=require("lucide-react");var Je=require("class-variance-authority");var ue=require("react/jsx-runtime"),kt=(0,Je.cva)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...r}){return(0,ue.jsx)("div",{"data-slot":"alert",role:"alert",className:n(kt({variant:t}),e),...r})}function Qe({className:e,...t}){return(0,ue.jsx)("div",{"data-slot":"alert-title",className:n("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function pe({className:e,...t}){return(0,ue.jsx)("div",{"data-slot":"alert-description",className:n("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var G=require("react/jsx-runtime"),et=e=>{let t=e.title??"Placeholder Alert",r=e.description??"This is a placeholder alert.";return(0,G.jsx)("div",{className:"grid w-full max-w-xl items-start gap-4",children:(0,G.jsxs)(me,{children:[(0,G.jsx)(K,{Icon:Ze.CheckCircle2Icon}),(0,G.jsx)(Qe,{children:t}),(0,G.jsx)(pe,{children:r})]})})};var O=require("react");var Q=require("lucide-react"),d=require("react/jsx-runtime"),tt=({onValidate:e})=>{let[t,r]=(0,O.useState)(["","","","","",""]),[i,l]=(0,O.useState)(!1),[w,g]=(0,O.useState)(""),[E,N]=(0,O.useState)(!1),C=(0,O.useRef)([]),V=(p,c)=>{if(!/^\d*$/.test(c))return;let b=[...t];b[p]=c.slice(-1),r(b),g(""),N(!1),c&&p<5&&C.current[p+1]?.focus()},D=(p,c)=>{c.key==="Backspace"&&!t[p]&&p>0&&C.current[p-1]?.focus(),c.key==="v"&&(c.ctrlKey||c.metaKey)&&(c.preventDefault(),navigator.clipboard.readText().then(b=>{let I=b.replace(/\D/g,"").slice(0,6).split(""),x=[...t];I.forEach((m,T)=>{T<6&&(x[T]=m)}),r(x);let u=Math.min(I.length,5);C.current[u]?.focus()}))},L=async()=>{let p=t.join("");if(p.length!==6){g("Please enter all 6 digits");return}l(!0),g("");try{await e(p),N(!0)}catch{g("Invalid TOTP code. Please try again.")}finally{l(!1)}},M=p=>{p.preventDefault(),L()},S=()=>{r(["","","","","",""]),g(""),N(!1),l(!1),C.current[0]?.focus()};return E?(0,d.jsx)("div",{className:"max-w-md mx-auto",children:(0,d.jsx)(q,{className:"border-green-200 bg-green-50",children:(0,d.jsx)(X,{className:"pt-6",children:(0,d.jsxs)("div",{className:"text-center space-y-4",children:[(0,d.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:(0,d.jsx)(Q.CheckCircle,{className:"w-8 h-8 text-green-600"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Verification Successful!"}),(0,d.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"Your TOTP code has been validated."})]}),(0,d.jsx)(h,{onClick:S,variant:"outline",className:"bg-white",children:"Verify Another Code"})]})})})}):(0,d.jsx)("div",{className:"max-w-md mx-auto",children:(0,d.jsx)(q,{children:(0,d.jsx)(X,{className:"pt-6",children:(0,d.jsxs)("div",{className:"text-center space-y-6",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,d.jsx)(Q.Shield,{className:"w-6 h-6 text-blue-600"})}),(0,d.jsx)("h3",{className:"text-lg font-semibold",children:"Enter Verification Code"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Enter the 6-digit code from your authenticator app"})]}),(0,d.jsxs)("form",{onSubmit:M,className:"space-y-6",children:[(0,d.jsx)("div",{className:"flex justify-center gap-2",children:t.map((p,c)=>(0,d.jsx)(q,{className:"w-12 h-14 border-2 focus-within:border-blue-500 transition-colors",children:(0,d.jsx)(X,{className:"p-0 h-full flex items-center justify-center",children:(0,d.jsx)("input",{ref:b=>{C.current[c]=b},type:"tel",inputMode:"numeric",maxLength:1,value:p,onChange:b=>V(c,b.target.value),onKeyDown:b=>D(c,b),className:"w-full h-full text-center text-2xl font-bold border-none outline-none bg-transparent",autoComplete:"one-time-code",disabled:i,style:{height:"auto"}})})},c))}),w&&(0,d.jsxs)(me,{variant:"destructive",children:[(0,d.jsx)(Q.AlertCircle,{className:"h-4 w-4"}),(0,d.jsx)(pe,{children:w})]}),(0,d.jsxs)("div",{className:"space-y-3",children:[(0,d.jsx)(h,{type:"submit",className:"w-full",disabled:i||t.some(p=>p===""),children:i?"Verifying...":"Verify Code"}),(0,d.jsx)(h,{type:"button",variant:"ghost",size:"sm",onClick:S,className:"w-full text-xs",children:"Clear Code"})]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Codes refresh every 30 seconds"})]})})})})};
|
|
3
3
|
//# sourceMappingURL=index.js.map
|