@authdog/react-elements 0.0.31 → 0.0.33

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @authdog/react-elements@0.0.31 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
2
+ > @authdog/react-elements@0.0.33 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
3
3
  > pnpm tsup && pnpm build:styles
4
4
 
5
5
  CLI 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
@@ -10,61 +10,61 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 19.40 KB
13
+ CJS dist/components/ui/alert.js 1.65 KB
14
+ CJS dist/index.js 23.73 KB
15
+ CJS dist/lib/utils.js 620.00 B
16
+ CJS dist/components/ui/avatar.js 1.34 KB
17
+ CJS dist/components/ui/badge.js 1.78 KB
18
+ CJS dist/components/ui/button.js 1.94 KB
19
+ CJS dist/components/ui/card.js 1.85 KB
20
+ CJS dist/components/ui/dropdown-menu.js 6.10 KB
21
+ CJS dist/components/ui/input.js 1.37 KB
22
+ CJS dist/components/ui/label.js 1.14 KB
23
+ CJS dist/components/ui/separator.js 1.18 KB
24
+ CJS dist/components/ui/sheet.js 3.36 KB
25
+ CJS dist/components/ui/alert.js.map 3.01 KB
26
+ CJS dist/index.js.map 70.61 KB
27
+ CJS dist/lib/utils.js.map 520.00 B
28
+ CJS dist/components/ui/avatar.js.map 2.31 KB
29
+ CJS dist/components/ui/badge.js.map 2.79 KB
30
+ CJS dist/components/ui/button.js.map 3.17 KB
31
+ CJS dist/components/ui/card.js.map 3.81 KB
32
+ CJS dist/components/ui/dropdown-menu.js.map 12.49 KB
33
+ CJS dist/components/ui/input.js.map 1.79 KB
34
+ CJS dist/components/ui/label.js.map 1.45 KB
35
+ CJS dist/components/ui/separator.js.map 1.64 KB
36
+ CJS dist/components/ui/sheet.js.map 6.75 KB
37
+ CJS ⚡️ Build success in 146ms
38
+ ESM dist/index.mjs 21.84 KB
14
39
  ESM dist/lib/utils.mjs 166.00 B
15
40
  ESM dist/components/ui/alert.mjs 1.19 KB
16
41
  ESM dist/components/ui/avatar.mjs 749.00 B
17
42
  ESM dist/components/ui/badge.mjs 1.34 KB
18
43
  ESM dist/components/ui/button.mjs 1.36 KB
19
44
  ESM dist/components/ui/card.mjs 1.35 KB
20
- ESM dist/components/ui/dropdown-menu.mjs 5.37 KB
21
45
  ESM dist/components/ui/input.mjs 949.00 B
22
46
  ESM dist/components/ui/label.mjs 566.00 B
23
47
  ESM dist/components/ui/separator.mjs 604.00 B
24
48
  ESM dist/components/ui/sheet.mjs 2.68 KB
25
- ESM dist/index.mjs.map 64.21 KB
49
+ ESM dist/components/ui/dropdown-menu.mjs 5.37 KB
50
+ ESM dist/index.mjs.map 70.93 KB
26
51
  ESM dist/lib/utils.mjs.map 415.00 B
27
52
  ESM dist/components/ui/alert.mjs.map 2.82 KB
28
53
  ESM dist/components/ui/avatar.mjs.map 2.13 KB
29
54
  ESM dist/components/ui/badge.mjs.map 2.63 KB
30
55
  ESM dist/components/ui/button.mjs.map 3.01 KB
31
56
  ESM dist/components/ui/card.mjs.map 3.54 KB
32
- ESM dist/components/ui/dropdown-menu.mjs.map 12.05 KB
33
57
  ESM dist/components/ui/input.mjs.map 1.67 KB
34
58
  ESM dist/components/ui/label.mjs.map 1.32 KB
35
59
  ESM dist/components/ui/separator.mjs.map 1.51 KB
36
60
  ESM dist/components/ui/sheet.mjs.map 6.49 KB
37
- ESM ⚡️ Build success in 210ms
38
- CJS dist/index.js 21.16 KB
39
- CJS dist/lib/utils.js 620.00 B
40
- CJS dist/components/ui/alert.js 1.65 KB
41
- CJS dist/components/ui/avatar.js 1.34 KB
42
- CJS dist/components/ui/badge.js 1.78 KB
43
- CJS dist/components/ui/button.js 1.94 KB
44
- CJS dist/components/ui/card.js 1.85 KB
45
- CJS dist/components/ui/dropdown-menu.js 6.10 KB
46
- CJS dist/components/ui/input.js 1.37 KB
47
- CJS dist/components/ui/label.js 1.14 KB
48
- CJS dist/components/ui/separator.js 1.18 KB
49
- CJS dist/components/ui/sheet.js 3.36 KB
50
- CJS dist/index.js.map 63.94 KB
51
- CJS dist/lib/utils.js.map 520.00 B
52
- CJS dist/components/ui/alert.js.map 3.01 KB
53
- CJS dist/components/ui/avatar.js.map 2.31 KB
54
- CJS dist/components/ui/badge.js.map 2.79 KB
55
- CJS dist/components/ui/button.js.map 3.17 KB
56
- CJS dist/components/ui/card.js.map 3.81 KB
57
- CJS dist/components/ui/dropdown-menu.js.map 12.51 KB
58
- CJS dist/components/ui/input.js.map 1.79 KB
59
- CJS dist/components/ui/label.js.map 1.45 KB
60
- CJS dist/components/ui/separator.js.map 1.64 KB
61
- CJS dist/components/ui/sheet.js.map 6.75 KB
62
- CJS ⚡️ Build success in 245ms
61
+ ESM dist/components/ui/dropdown-menu.mjs.map 12.03 KB
62
+ ESM ⚡️ Build success in 155ms
63
63
  DTS Build start
64
- DTS ⚡️ Build success in 12681ms
65
- DTS dist/index.d.mts 2.31 KB
66
- DTS dist/index.d.ts 2.31 KB
64
+ DTS ⚡️ Build success in 5663ms
65
+ DTS dist/index.d.mts 3.15 KB
66
+ DTS dist/index.d.ts 3.15 KB
67
67
 
68
- > @authdog/react-elements@0.0.31 build:styles /home/runner/work/web-sdk/web-sdk/packages/react-elements
68
+ > @authdog/react-elements@0.0.33 build:styles /home/runner/work/web-sdk/web-sdk/packages/react-elements
69
69
  > postcss src/global.css -o dist/styles.css
70
70
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @authdog/react-elements
2
2
 
3
+ ## 0.0.33
4
+
5
+ ### Patch Changes
6
+
7
+ - 94640cc: add user dropdown component
8
+
9
+ ## 0.0.32
10
+
11
+ ### Patch Changes
12
+
13
+ - ef53b12: fix text user-profile on dark mode
14
+
3
15
  ## 0.0.31
4
16
 
5
17
  ### Patch Changes
@@ -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 \"@authdog/react-elements/lib/utils\"\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>\nconst ChevronRightIcon = ChevronRight as ComponentType<React.SVGProps<SVGSVGElement>>\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\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\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 )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","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":";ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,6BAAAC,EAAA,wBAAAC,EAAA,sBAAAC,EAAA,qBAAAC,EAAA,sBAAAC,EAAA,uBAAAC,EAAA,2BAAAC,EAAA,0BAAAC,EAAA,0BAAAC,EAAA,yBAAAC,EAAA,oBAAAC,EAAA,2BAAAC,EAAA,2BAAAC,EAAA,wBAAAC,IAAA,eAAAC,EAAAjB,GAGA,IAAAkB,EAAuC,4CACvCC,EAA4C,wBCJ5C,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CDWS,IAAAC,EAAA,6BAPHC,EAAY,QACZC,EAAa,SACbC,EAAmB,eAEzB,SAASC,EAAa,CACpB,GAAGC,CACL,EAA4D,CAC1D,SAAO,OAAuB,OAAtB,CAA2B,YAAU,gBAAiB,GAAGA,EAAO,CAC1E,CAEA,SAASC,EAAmB,CAC1B,GAAGD,CACL,EAA8D,CAC5D,SACE,OAAuB,SAAtB,CAA6B,YAAU,uBAAwB,GAAGA,EAAO,CAE9E,CAE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,mBAACH,EAAA,CAAW,UAAU,sBAAsB,EAC9C,EACF,EACCe,GACH,CAEJ,CAEA,SAASI,EAAkB,CACzB,UAAAZ,EACA,MAAAK,EACA,GAAGT,CACL,EAEG,CACD,SACE,OAAuB,QAAtB,CACC,YAAU,sBACV,aAAYS,EACZ,UAAWH,EACT,oDACAF,CACF,EACC,GAAGJ,EACN,CAEJ,CAEA,SAASiB,EAAsB,CAC7B,UAAAb,EACA,GAAGJ,CACL,EAAiE,CAC/D,SACE,OAAuB,YAAtB,CACC,YAAU,0BACV,UAAWM,EAAG,4BAA6BF,CAAS,EACnD,GAAGJ,EACN,CAEJ,CAEA,SAASkB,EAAqB,CAC5B,UAAAd,EACA,GAAGJ,CACL,EAAiC,CAC/B,SACE,OAAC,QACC,YAAU,yBACV,UAAWM,EACT,wDACAF,CACF,EACC,GAAGJ,EACN,CAEJ,CAEA,SAASmB,EAAgB,CACvB,GAAGnB,CACL,EAA2D,CACzD,SAAO,OAAuB,MAAtB,CAA0B,YAAU,oBAAqB,GAAGA,EAAO,CAC7E,CAEA,SAASoB,EAAuB,CAC9B,UAAAhB,EACA,MAAAK,EACA,SAAAG,EACA,GAAGZ,CACL,EAEG,CACD,SACE,QAAuB,aAAtB,CACC,YAAU,4BACV,aAAYS,EACZ,UAAWH,EACT,iOACAF,CACF,EACC,GAAGJ,EAEH,UAAAY,KACD,OAACd,EAAA,CAAiB,UAAU,iBAAiB,GAC/C,CAEJ,CAEA,SAASuB,EAAuB,CAC9B,UAAAjB,EACA,GAAGJ,CACL,EAAkE,CAChE,SACE,OAAuB,aAAtB,CACC,YAAU,4BACV,UAAWM,EACT,gfACAF,CACF,EACC,GAAGJ,EACN,CAEJ","names":["dropdown_menu_exports","__export","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","__toCommonJS","DropdownMenuPrimitive","import_lucide_react","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","CheckIcon","CircleIcon","ChevronRightIcon","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","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<React.SVGProps<SVGSVGElement>>\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\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\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 )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","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":";ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,6BAAAC,EAAA,wBAAAC,EAAA,sBAAAC,EAAA,qBAAAC,EAAA,sBAAAC,EAAA,uBAAAC,EAAA,2BAAAC,EAAA,0BAAAC,EAAA,0BAAAC,EAAA,yBAAAC,EAAA,oBAAAC,EAAA,2BAAAC,EAAA,2BAAAC,EAAA,wBAAAC,IAAA,eAAAC,EAAAjB,GAGA,IAAAkB,EAAuC,4CACvCC,EAA4C,wBCJ5C,IAAAC,EAAsC,gBACtCC,EAAwB,0BAEjB,SAASC,KAAMC,EAAsB,CAC1C,SAAO,cAAQ,QAAKA,CAAM,CAAC,CAC7B,CDWS,IAAAC,EAAA,6BAPHC,EAAY,QACZC,EAAa,SACbC,EAAmB,eAEzB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M,EACT,gfACAF,CACF,EACC,GAAGJ,EACN,CAEJ","names":["dropdown_menu_exports","__export","DropdownMenu","DropdownMenuCheckboxItem","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuPortal","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubContent","DropdownMenuSubTrigger","DropdownMenuTrigger","__toCommonJS","DropdownMenuPrimitive","import_lucide_react","import_clsx","import_tailwind_merge","cn","inputs","import_jsx_runtime","CheckIcon","CircleIcon","ChevronRightIcon","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
@@ -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 \"@authdog/react-elements/lib/utils\"\n\nconst CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>\nconst CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>\nconst ChevronRightIcon = ChevronRight as ComponentType<React.SVGProps<SVGSVGElement>>\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\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\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 )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","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":";aAGA,UAAYA,MAA2B,gCACvC,OAAS,SAAAC,EAAO,gBAAAC,EAAc,UAAAC,MAAc,eCJ5C,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDWS,cAAAC,EAgFL,QAAAC,MAhFK,oB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,SAASwB,EAAuB,CAC9B,UAAAjB,EACA,GAAGJ,CACL,EAAkE,CAChE,OACET,EAAuB,aAAtB,CACC,YAAU,4BACV,UAAWe,EACT,gfACAF,CACF,EACC,GAAGJ,EACN,CAEJ","names":["DropdownMenuPrimitive","Check","ChevronRight","Circle","clsx","twMerge","cn","inputs","jsx","jsxs","CheckIcon","Check","CircleIcon","Circle","ChevronRightIcon","ChevronRight","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","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<React.SVGProps<SVGSVGElement>>\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\nfunction DropdownMenuTrigger({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {\n return (\n <DropdownMenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n className,\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n data-slot=\"dropdown-menu-content\"\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (\n <DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <DropdownMenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (\n <DropdownMenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (\n <DropdownMenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (\n <DropdownMenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span className=\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"size-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.Label\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (\n <DropdownMenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"bg-border -mx-1 my-1 h-px\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\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 )\n}\n\nfunction DropdownMenuSub({\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n}) {\n return (\n <DropdownMenuPrimitive.SubTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (\n <DropdownMenuPrimitive.SubContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n","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":";aAGA,UAAYA,MAA2B,gCACvC,OAAS,SAAAC,EAAO,gBAAAC,EAAc,UAAAC,MAAc,eCJ5C,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDWS,cAAAC,EAgFL,QAAAC,MAhFK,oBAPT,IAAMC,EAAYC,EACZC,EAAaC,EACbC,EAAmBC,EAEzB,SAASC,EAAa,CACpB,GAAGC,CACL,EAA4D,CAC1D,OAAOT,EAAuB,OAAtB,CAA2B,YAAU,gBAAiB,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AEJ","names":["DropdownMenuPrimitive","Check","ChevronRight","Circle","clsx","twMerge","cn","inputs","jsx","jsxs","CheckIcon","Check","CircleIcon","Circle","ChevronRightIcon","ChevronRight","DropdownMenu","props","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","className","sideOffset","cn","DropdownMenuGroup","DropdownMenuItem","inset","variant","DropdownMenuCheckboxItem","children","checked","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"]}
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
- import * as React from 'react';
2
+ import * as React$1 from 'react';
3
3
  import React__default, { ReactNode } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -8,10 +8,10 @@ declare const buttonVariants: (props?: ({
8
8
  variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
9
9
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
11
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
12
12
  asChild?: boolean;
13
13
  }
14
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
15
15
 
16
16
  declare const ClientOnly: ({ children }: {
17
17
  children: ReactNode;
@@ -49,6 +49,36 @@ interface UserProfileProps {
49
49
  }
50
50
  declare const UserProfile: ({ loading, user, handleAuthenticated }: UserProfileProps) => react_jsx_runtime.JSX.Element;
51
51
 
52
+ type UserDropdownLink = {
53
+ label: string;
54
+ href?: string;
55
+ onClick?: () => void;
56
+ icon?: React.ComponentType<any>;
57
+ };
58
+ interface UserDropdownProps {
59
+ trigger: React.ReactElement;
60
+ user: {
61
+ displayName?: string;
62
+ name?: string;
63
+ email?: string;
64
+ emails?: {
65
+ value: string;
66
+ }[];
67
+ photos?: {
68
+ value: string;
69
+ }[];
70
+ avatar?: string;
71
+ };
72
+ className?: string;
73
+ onManageAccount?: () => void;
74
+ onSignout?: () => void;
75
+ links?: UserDropdownLink[];
76
+ side?: "top" | "right" | "bottom" | "left";
77
+ align?: "start" | "center" | "end";
78
+ sideOffset?: number;
79
+ }
80
+ declare const UserDropdown: ({ trigger, user, className, onManageAccount, onSignout, links, side, align, sideOffset }: UserDropdownProps) => react_jsx_runtime.JSX.Element;
81
+
52
82
  interface PlaceholderAlertProps {
53
83
  title?: string;
54
84
  description?: string;
@@ -60,4 +90,4 @@ interface TOTPValidatorProps {
60
90
  }
61
91
  declare const TOTPValidator: ({ onValidate }: TOTPValidatorProps) => react_jsx_runtime.JSX.Element;
62
92
 
63
- export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserProfile };
93
+ export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserDropdown, UserProfile };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
- import * as React from 'react';
2
+ import * as React$1 from 'react';
3
3
  import React__default, { ReactNode } from 'react';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
@@ -8,10 +8,10 @@ declare const buttonVariants: (props?: ({
8
8
  variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
9
9
  size?: "default" | "sm" | "lg" | "icon" | null | undefined;
10
10
  } & class_variance_authority_types.ClassProp) | undefined) => string;
11
- interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
11
+ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
12
12
  asChild?: boolean;
13
13
  }
14
- declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
+ declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
15
15
 
16
16
  declare const ClientOnly: ({ children }: {
17
17
  children: ReactNode;
@@ -49,6 +49,36 @@ interface UserProfileProps {
49
49
  }
50
50
  declare const UserProfile: ({ loading, user, handleAuthenticated }: UserProfileProps) => react_jsx_runtime.JSX.Element;
51
51
 
52
+ type UserDropdownLink = {
53
+ label: string;
54
+ href?: string;
55
+ onClick?: () => void;
56
+ icon?: React.ComponentType<any>;
57
+ };
58
+ interface UserDropdownProps {
59
+ trigger: React.ReactElement;
60
+ user: {
61
+ displayName?: string;
62
+ name?: string;
63
+ email?: string;
64
+ emails?: {
65
+ value: string;
66
+ }[];
67
+ photos?: {
68
+ value: string;
69
+ }[];
70
+ avatar?: string;
71
+ };
72
+ className?: string;
73
+ onManageAccount?: () => void;
74
+ onSignout?: () => void;
75
+ links?: UserDropdownLink[];
76
+ side?: "top" | "right" | "bottom" | "left";
77
+ align?: "start" | "center" | "end";
78
+ sideOffset?: number;
79
+ }
80
+ declare const UserDropdown: ({ trigger, user, className, onManageAccount, onSignout, links, side, align, sideOffset }: UserDropdownProps) => react_jsx_runtime.JSX.Element;
81
+
52
82
  interface PlaceholderAlertProps {
53
83
  title?: string;
54
84
  description?: string;
@@ -60,4 +90,4 @@ interface TOTPValidatorProps {
60
90
  }
61
91
  declare const TOTPValidator: ({ onValidate }: TOTPValidatorProps) => react_jsx_runtime.JSX.Element;
62
92
 
63
- export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserProfile };
93
+ export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserDropdown, UserProfile };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";var ze=Object.create;var z=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Ge=Object.getPrototypeOf,Le=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var r in t)z(e,r,{get:t[r],enumerable:!0})},oe=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Ee(t))!Le.call(e,d)&&d!==r&&z(e,d,{get:()=>t[d],enumerable:!(c=Be(t,d))||c.enumerable});return e};var B=(e,t,r)=>(r=e!=null?ze(Ge(e)):{},oe(t||!e||!e.__esModule?z(r,"default",{value:e,enumerable:!0}):r,e)),_e=e=>oe(z({},"__esModule",{value:!0}),e);var Xe={};Oe(Xe,{Button:()=>u,ClientOnly:()=>le,Navbar:()=>ye,PlaceholderAlert:()=>Ie,TOTPValidator:()=>Te,UserProfile:()=>De});module.exports=_e(Xe);var ne=B(require("react")),ie=require("@radix-ui/react-slot"),se=require("class-variance-authority");var ae=require("clsx"),re=require("tailwind-merge");function s(...e){return(0,re.twMerge)((0,ae.clsx)(e))}var de=require("react/jsx-runtime"),Fe=(0,se.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"}}),u=ne.forwardRef(({className:e,variant:t,size:r,asChild:c=!1,...d},g)=>(0,de.jsx)(c?ie.Slot:"button",{className:s(Fe({variant:t,size:r,className:e})),ref:g,...d}));u.displayName="Button";var E=require("react"),G=require("react/jsx-runtime"),le=({children:e})=>{let[t,r]=(0,E.useState)(!1);return(0,E.useEffect)(()=>{r(!0)},[]),t?(0,G.jsx)(G.Fragment,{children:e}):null};var xe=require("react"),D=require("lucide-react");var C=B(require("@radix-ui/react-avatar"));var F=require("react/jsx-runtime");function L({className:e,...t}){return(0,F.jsx)(C.Root,{"data-slot":"avatar",className:s("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function O({className:e,...t}){return(0,F.jsx)(C.Image,{"data-slot":"avatar-image",className:s("aspect-square size-full",e),...t})}function _({className:e,...t}){return(0,F.jsx)(C.Fallback,{"data-slot":"avatar-fallback",className:s("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var l=B(require("@radix-ui/react-dropdown-menu")),X=require("lucide-react");var x=require("react/jsx-runtime");function ce({...e}){return(0,x.jsx)(l.Root,{"data-slot":"dropdown-menu",...e})}function me({...e}){return(0,x.jsx)(l.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function pe({className:e,sideOffset:t=4,...r}){return(0,x.jsx)(l.Portal,{children:(0,x.jsx)(l.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,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),...r})})}function ue({...e}){return(0,x.jsx)(l.Group,{"data-slot":"dropdown-menu-group",...e})}function J({className:e,inset:t,variant:r="default",...c}){return(0,x.jsx)(l.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,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 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),...c})}function fe({className:e,inset:t,...r}){return(0,x.jsx)(l.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function Y({className:e,...t}){return(0,x.jsx)(l.Separator,{"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}var f=B(require("@radix-ui/react-dialog")),ve=require("lucide-react");var v=require("react/jsx-runtime"),je=ve.X;function ge({...e}){return(0,v.jsx)(f.Root,{"data-slot":"sheet",...e})}function he({...e}){return(0,v.jsx)(f.Trigger,{"data-slot":"sheet-trigger",...e})}function He({...e}){return(0,v.jsx)(f.Portal,{"data-slot":"sheet-portal",...e})}function Ue({className:e,...t}){return(0,v.jsx)(f.Overlay,{"data-slot":"sheet-overlay",className:s("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 be({className:e,children:t,side:r="right",...c}){return(0,v.jsxs)(He,{children:[(0,v.jsx)(Ue,{}),(0,v.jsxs)(f.Content,{"data-slot":"sheet-content",className:s("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),...c,children:[t,(0,v.jsxs)(f.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,v.jsx)(je,{className:"size-4"}),(0,v.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var H=require("react"),j=require("react/jsx-runtime"),Ke={className:"mr-2 h-4 w-4","aria-hidden":"true"},$e=e=>{let[t,r]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{r(!0)},[]),t?(0,j.jsx)(e,{...Ke}):(0,j.jsx)("span",{className:"mr-2 h-4 w-4","aria-hidden":"true"})},M=({Icon:e})=>(0,j.jsx)("span",{className:"inline-flex items-center justify-center",children:$e(e)});var a=require("react/jsx-runtime");function ye({items:e=[],children:t,className:r,logoText:c="ACME Corp",user:d={name:"John Doe",email:"john@example.com",image:"https://i.pravatar.cc/150?u=a042581f4e29026704d"},onNavigateHome:g=()=>console.log("Navigating to home"),onNavItemClick:h=I=>console.log(`Navigating to ${I}`),onProfileSelected:k,onLogout:y=()=>console.log("Logout clicked"),isLoading:p=!1,identityHost:N="https://stg-id.authdog.xyz",environmentId:T="58be35b0-708f-49f6-84f0-6695d307d997"}){let[I,A]=(0,xe.useState)(!1),V=d!=null&&d.id!==null&&d.id!==void 0;return(0,a.jsx)("header",{className:s("border-b bg-background",r),children:(0,a.jsxs)("div",{className:"container flex h-16 items-center justify-between px-4 md:px-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("span",{className:"text-xl font-bold cursor-pointer",onClick:g,children:c}),(0,a.jsx)("nav",{className:"hidden md:flex gap-6",children:e?.map((i,m)=>(0,a.jsx)("span",{onClick:()=>{i.disabled||h(i.href)},className:s("text-sm font-medium transition-colors hover:text-primary cursor-pointer",i.disabled&&"cursor-not-allowed opacity-80"),children:i.title},m))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[t,V?(0,a.jsxs)(ce,{children:[(0,a.jsx)(me,{asChild:!0,children:(0,a.jsx)(u,{variant:"ghost",className:"relative h-8 w-8 rounded-full",disabled:p,children:(0,a.jsx)(L,{className:"h-8 w-8",children:p?(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse bg-muted rounded-full"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O,{src:d.photos?.[0]?.value||"/placeholder.svg",alt:d.displayName}),(0,a.jsx)(_,{children:d.displayName?.charAt(0)})]})})})}),(0,a.jsx)(pe,{className:"w-56",align:"end",forceMount:!0,children:p?(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)(fe,{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:d.displayName}),(0,a.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:d.emails?.[0]?.value})]})}),(0,a.jsx)(Y,{}),(0,a.jsx)(ue,{children:(0,a.jsxs)(J,{onClick:k,children:[(0,a.jsx)(M,{Icon:D.User}),(0,a.jsx)("span",{children:"Profile"})]})}),(0,a.jsx)(Y,{}),(0,a.jsxs)(J,{onClick:y,children:[(0,a.jsx)(M,{Icon:D.LogOut}),(0,a.jsx)("span",{children:"Log out"})]})]})})]}):(0,a.jsx)(u,{variant:"default","aria-label":"Sign in",onClick:()=>{if(!T)throw new Error("Environment ID is required");if(!N)throw new Error("Identity Host is required");let i=`${N}/signin/${T}`;window.open(i,"_blank")},children:"Sign in"}),(0,a.jsxs)(ge,{open:I,onOpenChange:A,children:[(0,a.jsx)(he,{asChild:!0,children:(0,a.jsx)(u,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open Menu",children:(0,a.jsx)(M,{Icon:D.Menu})})}),(0,a.jsx)(be,{side:"left",className:"pr-0",children:(0,a.jsx)("nav",{className:"grid gap-2 py-6",children:e?.map((i,m)=>(0,a.jsx)("a",{href:i.href,className:s("flex w-full items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent",i.disabled&&"cursor-not-allowed opacity-80"),onClick:()=>A(!1),children:i.title},m))})})]})]})]})})}var S=require("react");var we=require("@radix-ui/react-slot"),Pe=require("class-variance-authority");var Ce=require("react/jsx-runtime"),We=(0,Pe.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 Ne({className:e,variant:t,asChild:r=!1,...c}){return(0,Ce.jsx)(r?we.Slot:"span",{"data-slot":"badge",className:s(We({variant:t}),e),...c})}var Me=require("lucide-react"),o=require("react/jsx-runtime"),De=({loading:e,user:t,handleAuthenticated:r})=>{let[c,d]=(0,S.useState)(!1),[g,h]=(0,S.useState)("profile");(0,S.useEffect)(()=>{d(!0)},[]),(0,S.useEffect)(()=>{!e&&r&&r()},[e,t,r]);let k={className:"mr-2 h-4 w-4","aria-hidden":"true"},y=p=>c?(0,o.jsx)(p,{...k}):null;return!c||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 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",children:"Account"}),(0,o.jsx)("p",{className:"text-sm text-gray-500",children:"Manage your account info."})]}),(0,o.jsx)("nav",{className:"space-y-1 flex-1",children:(0,o.jsxs)("button",{onClick:()=>h("profile"),className:`flex items-center w-full px-3 py-2 text-sm rounded-md ${g==="profile"?"bg-gray-100 text-gray-900":"text-gray-700 hover:bg-gray-50"}`,children:[y(Me.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",children:g==="profile"?"Profile details":"Security settings"})}),g==="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",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)(L,{className:"h-12 w-12 mr-4 border",children:[(0,o.jsx)(O,{src:t.photos?.[0]?.value,alt:"Profile picture"}),(0,o.jsx)(_,{children:t.displayName?.split(" ").map(p=>p[0]).join("")})]}),(0,o.jsx)("span",{className:"font-medium",children:t.displayName})]})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3",children:"Email addresses"}),(0,o.jsx)("div",{className:"space-y-2.5",children:t.emails.map((p,N)=>(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{children:p.value}),N===0&&(0,o.jsx)(Ne,{variant:"outline",className:"text-xs bg-gray-100 text-gray-700 hover:bg-gray-100",children:"Primary"})]},p.value))})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3",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",{children:t.provider})})}),(0,o.jsx)("span",{className:"text-sm text-gray-500",children:t?.emails?.[0]?.value})]},t.provider)})]})]}):(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",children:"Two-factor authentication"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium",children:"Two-factor authentication"}),(0,o.jsx)("p",{className:"text-sm text-gray-500",children:"Add an extra layer of security to your account"})]}),(0,o.jsx)(u,{variant:"outline",size:"sm",children:"Enable"})]})})]},"two-factor"),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3",children:"Password"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium",children:"Change password"}),(0,o.jsx)("p",{className:"text-sm text-gray-500",children:"Last changed 3 months ago"})]}),(0,o.jsx)(u,{variant:"outline",size:"sm",children:"Change"})]})})]},"password"),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3",children:"Active sessions"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium",children:"Current session"}),(0,o.jsx)("p",{className:"text-sm text-gray-500",children:"Chrome on Windows \u2022 Active now"})]}),(0,o.jsx)(u,{variant:"outline",size:"sm",children:"Sign out"})]})})]},"sessions")]})]})]}):(0,o.jsx)("div",{children:"No user"})};var ke=require("lucide-react");var Se=require("class-variance-authority");var $=require("react/jsx-runtime"),qe=(0,Se.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 U({className:e,variant:t,...r}){return(0,$.jsx)("div",{"data-slot":"alert",role:"alert",className:s(qe({variant:t}),e),...r})}function Re({className:e,...t}){return(0,$.jsx)("div",{"data-slot":"alert-title",className:s("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function K({className:e,...t}){return(0,$.jsx)("div",{"data-slot":"alert-description",className:s("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var w=require("react/jsx-runtime"),Ie=e=>{let t=e.title??"Placeholder Alert",r=e.description??"This is a placeholder alert.";return(0,w.jsx)("div",{className:"grid w-full max-w-xl items-start gap-4",children:(0,w.jsxs)(U,{children:[(0,w.jsx)(M,{Icon:ke.CheckCircle2Icon}),(0,w.jsx)(Re,{children:t}),(0,w.jsx)(K,{children:r})]})})};var P=require("react");var Q=require("react/jsx-runtime");function W({className:e,...t}){return(0,Q.jsx)("div",{"data-slot":"card",className:s("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function q({className:e,...t}){return(0,Q.jsx)("div",{"data-slot":"card-content",className:s("px-6",e),...t})}var R=require("lucide-react"),n=require("react/jsx-runtime"),Te=({onValidate:e})=>{let[t,r]=(0,P.useState)(["","","","","",""]),[c,d]=(0,P.useState)(!1),[g,h]=(0,P.useState)(""),[k,y]=(0,P.useState)(!1),p=(0,P.useRef)([]),N=(i,m)=>{if(!/^\d*$/.test(m))return;let b=[...t];b[i]=m.slice(-1),r(b),h(""),y(!1),m&&i<5&&p.current[i+1]?.focus()},T=(i,m)=>{m.key==="Backspace"&&!t[i]&&i>0&&p.current[i-1]?.focus(),m.key==="v"&&(m.ctrlKey||m.metaKey)&&(m.preventDefault(),navigator.clipboard.readText().then(b=>{let Z=b.replace(/\D/g,"").slice(0,6).split(""),ee=[...t];Z.forEach((Ve,te)=>{te<6&&(ee[te]=Ve)}),r(ee);let Ae=Math.min(Z.length,5);p.current[Ae]?.focus()}))},I=async()=>{let i=t.join("");if(i.length!==6){h("Please enter all 6 digits");return}d(!0),h("");try{await e(i),y(!0)}catch{h("Invalid TOTP code. Please try again.")}finally{d(!1)}},A=i=>{i.preventDefault(),I()},V=()=>{r(["","","","","",""]),h(""),y(!1),d(!1),p.current[0]?.focus()};return k?(0,n.jsx)("div",{className:"max-w-md mx-auto",children:(0,n.jsx)(W,{className:"border-green-200 bg-green-50",children:(0,n.jsx)(q,{className:"pt-6",children:(0,n.jsxs)("div",{className:"text-center space-y-4",children:[(0,n.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:(0,n.jsx)(R.CheckCircle,{className:"w-8 h-8 text-green-600"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Verification Successful!"}),(0,n.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"Your TOTP code has been validated."})]}),(0,n.jsx)(u,{onClick:V,variant:"outline",className:"bg-white",children:"Verify Another Code"})]})})})}):(0,n.jsx)("div",{className:"max-w-md mx-auto",children:(0,n.jsx)(W,{children:(0,n.jsx)(q,{className:"pt-6",children:(0,n.jsxs)("div",{className:"text-center space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,n.jsx)(R.Shield,{className:"w-6 h-6 text-blue-600"})}),(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Enter Verification Code"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Enter the 6-digit code from your authenticator app"})]}),(0,n.jsxs)("form",{onSubmit:A,className:"space-y-6",children:[(0,n.jsx)("div",{className:"flex justify-center gap-2",children:t.map((i,m)=>(0,n.jsx)(W,{className:"w-12 h-14 border-2 focus-within:border-blue-500 transition-colors",children:(0,n.jsx)(q,{className:"p-0 h-full flex items-center justify-center",children:(0,n.jsx)("input",{ref:b=>{p.current[m]=b},type:"tel",inputMode:"numeric",maxLength:1,value:i,onChange:b=>N(m,b.target.value),onKeyDown:b=>T(m,b),className:"w-full h-full text-center text-2xl font-bold border-none outline-none bg-transparent",autoComplete:"one-time-code",disabled:c,style:{height:"auto"}})})},m))}),g&&(0,n.jsxs)(U,{variant:"destructive",children:[(0,n.jsx)(R.AlertCircle,{className:"h-4 w-4"}),(0,n.jsx)(K,{children:g})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(u,{type:"submit",className:"w-full",disabled:c||t.some(i=>i===""),children:c?"Verifying...":"Verify Code"}),(0,n.jsx)(u,{type:"button",variant:"ghost",size:"sm",onClick:V,className:"w-full text-xs",children:"Clear Code"})]})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Codes refresh every 30 seconds"})]})})})})};
2
+ "use strict";var Be=Object.create;var U=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty;var Fe=(e,t)=>{for(var r in t)U(e,r,{get:t[r],enumerable:!0})},se=(e,t,r,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of Oe(t))!Ue.call(e,d)&&d!==r&&U(e,d,{get:()=>t[d],enumerable:!(l=Ge(t,d))||l.enumerable});return e};var F=(e,t,r)=>(r=e!=null?Be(_e(e)):{},se(t||!e||!e.__esModule?U(r,"default",{value:e,enumerable:!0}):r,e)),je=e=>se(U({},"__esModule",{value:!0}),e);var Ze={};Fe(Ze,{Button:()=>v,ClientOnly:()=>fe,Navbar:()=>Ne,PlaceholderAlert:()=>Ve,TOTPValidator:()=>ze,UserDropdown:()=>Re,UserProfile:()=>Se});module.exports=je(Ze);var ce=F(require("react")),me=require("@radix-ui/react-slot"),pe=require("class-variance-authority");var de=require("clsx"),le=require("tailwind-merge");function s(...e){return(0,le.twMerge)((0,de.clsx)(e))}var ue=require("react/jsx-runtime"),He=(0,pe.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"}}),v=ce.forwardRef(({className:e,variant:t,size:r,asChild:l=!1,...d},h)=>(0,ue.jsx)(l?me.Slot:"button",{className:s(He({variant:t,size:r,className:e})),ref:h,...d}));v.displayName="Button";var j=require("react"),H=require("react/jsx-runtime"),fe=({children:e})=>{let[t,r]=(0,j.useState)(!1);return(0,j.useEffect)(()=>{r(!0)},[]),t?(0,H.jsx)(H.Fragment,{children:e}):null};var we=require("react"),B=require("lucide-react");var A=F(require("@radix-ui/react-avatar"));var $=require("react/jsx-runtime");function T({className:e,...t}){return(0,$.jsx)(A.Root,{"data-slot":"avatar",className:s("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...t})}function V({className:e,...t}){return(0,$.jsx)(A.Image,{"data-slot":"avatar-image",className:s("aspect-square size-full",e),...t})}function z({className:e,...t}){return(0,$.jsx)(A.Fallback,{"data-slot":"avatar-fallback",className:s("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}var c=F(require("@radix-ui/react-dropdown-menu")),oe=require("lucide-react");var N=require("react/jsx-runtime");function K({...e}){return(0,N.jsx)(c.Root,{"data-slot":"dropdown-menu",...e})}function W({...e}){return(0,N.jsx)(c.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function q({className:e,sideOffset:t=4,...r}){return(0,N.jsx)(c.Portal,{children:(0,N.jsx)(c.Content,{"data-slot":"dropdown-menu-content",sideOffset:t,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),...r})})}function ve({...e}){return(0,N.jsx)(c.Group,{"data-slot":"dropdown-menu-group",...e})}function D({className:e,inset:t,variant:r="default",...l}){return(0,N.jsx)(c.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":r,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 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),...l})}function ge({className:e,inset:t,...r}){return(0,N.jsx)(c.Label,{"data-slot":"dropdown-menu-label","data-inset":t,className:s("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function E({className:e,...t}){return(0,N.jsx)(c.Separator,{"data-slot":"dropdown-menu-separator",className:s("bg-border -mx-1 my-1 h-px",e),...t})}var g=F(require("@radix-ui/react-dialog")),he=require("lucide-react");var b=require("react/jsx-runtime"),$e=he.X;function xe({...e}){return(0,b.jsx)(g.Root,{"data-slot":"sheet",...e})}function be({...e}){return(0,b.jsx)(g.Trigger,{"data-slot":"sheet-trigger",...e})}function Ke({...e}){return(0,b.jsx)(g.Portal,{"data-slot":"sheet-portal",...e})}function We({className:e,...t}){return(0,b.jsx)(g.Overlay,{"data-slot":"sheet-overlay",className:s("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 ye({className:e,children:t,side:r="right",...l}){return(0,b.jsxs)(Ke,{children:[(0,b.jsx)(We,{}),(0,b.jsxs)(g.Content,{"data-slot":"sheet-content",className:s("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),...l,children:[t,(0,b.jsxs)(g.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,b.jsx)($e,{className:"size-4"}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var J=require("react"),X=require("react/jsx-runtime"),qe={className:"mr-2 h-4 w-4","aria-hidden":"true"},Xe=e=>{let[t,r]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{r(!0)},[]),t?(0,X.jsx)(e,{...qe}):(0,X.jsx)("span",{className:"mr-2 h-4 w-4","aria-hidden":"true"})},L=({Icon:e})=>(0,X.jsx)("span",{className:"inline-flex items-center justify-center",children:Xe(e)});var a=require("react/jsx-runtime");function Ne({items:e=[],children:t,className:r,logoText:l="ACME Corp",user:d={name:"John Doe",email:"john@example.com",image:"https://i.pravatar.cc/150?u=a042581f4e29026704d"},onNavigateHome:h=()=>console.log("Navigating to home"),onNavItemClick:x=k=>console.log(`Navigating to ${k}`),onProfileSelected:C,onLogout:P=()=>console.log("Logout clicked"),isLoading:u=!1,identityHost:y="https://stg-id.authdog.xyz",environmentId:R="58be35b0-708f-49f6-84f0-6695d307d997"}){let[k,I]=(0,we.useState)(!1),f=d!=null&&d.id!==null&&d.id!==void 0;return(0,a.jsx)("header",{className:s("border-b bg-background",r),children:(0,a.jsxs)("div",{className:"container flex h-16 items-center justify-between px-4 md:px-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("span",{className:"text-xl font-bold cursor-pointer",onClick:h,children:l}),(0,a.jsx)("nav",{className:"hidden md:flex gap-6",children:e?.map((i,p)=>(0,a.jsx)("span",{onClick:()=>{i.disabled||x(i.href)},className:s("text-sm font-medium transition-colors hover:text-primary cursor-pointer",i.disabled&&"cursor-not-allowed opacity-80"),children:i.title},p))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[t,f?(0,a.jsxs)(K,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(v,{variant:"ghost",className:"relative h-8 w-8 rounded-full",disabled:u,children:(0,a.jsx)(T,{className:"h-8 w-8",children:u?(0,a.jsx)("div",{className:"h-8 w-8 animate-pulse bg-muted rounded-full"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{src:d.photos?.[0]?.value||"/placeholder.svg",alt:d.displayName}),(0,a.jsx)(z,{children:d.displayName?.charAt(0)})]})})})}),(0,a.jsx)(q,{className:"w-56",align:"end",forceMount:!0,children:u?(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:d.displayName}),(0,a.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:d.emails?.[0]?.value})]})}),(0,a.jsx)(E,{}),(0,a.jsx)(ve,{children:(0,a.jsxs)(D,{onClick:C,children:[(0,a.jsx)(L,{Icon:B.User}),(0,a.jsx)("span",{children:"Profile"})]})}),(0,a.jsx)(E,{}),(0,a.jsxs)(D,{onClick:P,children:[(0,a.jsx)(L,{Icon:B.LogOut}),(0,a.jsx)("span",{children:"Log out"})]})]})})]}):(0,a.jsx)(v,{variant:"default","aria-label":"Sign in",onClick:()=>{if(!R)throw new Error("Environment ID is required");if(!y)throw new Error("Identity Host is required");let i=`${y}/signin/${R}`;window.open(i,"_blank")},children:"Sign in"}),(0,a.jsxs)(xe,{open:k,onOpenChange:I,children:[(0,a.jsx)(be,{asChild:!0,children:(0,a.jsx)(v,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open Menu",children:(0,a.jsx)(L,{Icon:B.Menu})})}),(0,a.jsx)(ye,{side:"left",className:"pr-0",children:(0,a.jsx)("nav",{className:"grid gap-2 py-6",children:e?.map((i,p)=>(0,a.jsx)("a",{href:i.href,className:s("flex w-full items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent",i.disabled&&"cursor-not-allowed opacity-80"),onClick:()=>I(!1),children:i.title},p))})})]})]})]})})}var G=require("react");var Pe=require("@radix-ui/react-slot"),Ce=require("class-variance-authority");var De=require("react/jsx-runtime"),Je=(0,Ce.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 ke({className:e,variant:t,asChild:r=!1,...l}){return(0,De.jsx)(r?Pe.Slot:"span",{"data-slot":"badge",className:s(Je({variant:t}),e),...l})}var Me=require("lucide-react"),o=require("react/jsx-runtime"),Se=({loading:e,user:t,handleAuthenticated:r})=>{let[l,d]=(0,G.useState)(!1),[h,x]=(0,G.useState)("profile");(0,G.useEffect)(()=>{d(!0)},[]),(0,G.useEffect)(()=>{!e&&r&&r()},[e,t,r]);let C={className:"mr-2 h-4 w-4","aria-hidden":"true"},P=u=>l?(0,o.jsx)(u,{...C}):null;return!l||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 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-gray-900 dark:text-gray-100",children:"Account"}),(0,o.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Manage your account info."})]}),(0,o.jsx)("nav",{className:"space-y-1 flex-1",children:(0,o.jsxs)("button",{onClick:()=>x("profile"),className:`flex items-center w-full px-3 py-2 text-sm rounded-md ${h==="profile"?"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-gray-100":"text-gray-700 hover:bg-gray-50 dark:text-gray-300 dark:hover:bg-gray-800"}`,children:[P(Me.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-gray-900 dark:text-gray-100",children:h==="profile"?"Profile details":"Security settings"})}),h==="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-gray-900 dark:text-gray-100",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)(T,{className:"h-12 w-12 mr-4 border",children:[(0,o.jsx)(V,{src:t.photos?.[0]?.value,alt:"Profile picture"}),(0,o.jsx)(z,{children:t.displayName?.split(" ").map(u=>u[0]).join("")})]}),(0,o.jsx)("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:t.displayName})]})})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Email addresses"}),(0,o.jsx)("div",{className:"space-y-2.5",children:t.emails.map((u,y)=>(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-gray-900 dark:text-gray-100",children:u.value}),y===0&&(0,o.jsx)(ke,{variant:"outline",className:"text-xs bg-gray-100 text-gray-700 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-800",children:"Primary"})]},u.value))})]}),(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)})]})]}):(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-gray-900 dark:text-gray-100",children:"Two-factor authentication"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:"Two-factor authentication"}),(0,o.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Add an extra layer of security to your account"})]}),(0,o.jsx)(v,{variant:"outline",size:"sm",children:"Enable"})]})})]},"two-factor"),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Password"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:"Change password"}),(0,o.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Last changed 3 months ago"})]}),(0,o.jsx)(v,{variant:"outline",size:"sm",children:"Change"})]})})]},"password"),(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-3 text-gray-900 dark:text-gray-100",children:"Active sessions"}),(0,o.jsx)("div",{className:"space-y-2.5",children:(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("p",{className:"font-medium text-gray-900 dark:text-gray-100",children:"Current session"}),(0,o.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Chrome on Windows \u2022 Active now"})]}),(0,o.jsx)(v,{variant:"outline",size:"sm",children:"Sign out"})]})})]},"sessions")]})]})]}):(0,o.jsx)("div",{children:"No user"})};var O=require("lucide-react"),m=require("react/jsx-runtime"),Ye=e=>e&&String(e).trim().split(/\s+/).slice(0,2).map(l=>l[0]?.toUpperCase()).join("")||"?",Re=({trigger:e,user:t,className:r,onManageAccount:l,onSignout:d,links:h=[],side:x="bottom",align:C="end",sideOffset:P=8})=>{let u=t?.emails?.[0]?.value||t?.email||"",y=t?.displayName||t?.name||"",R=t?.photos?.[0]?.value||t?.avatar||"",k=f=>{if(f.onClick)return f.onClick();f.href&&(f.href.startsWith("http")?window.open(f.href,"_blank"):window.location.assign(f.href))},I=O.ExternalLink;return(0,m.jsxs)(K,{children:[(0,m.jsx)(W,{className:"inline-flex items-center justify-center h-10 w-10 rounded-full focus:outline-none",children:e}),(0,m.jsxs)(q,{align:C,side:x,sideOffset:P,className:s("w-72 p-2 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",r),children:[(0,m.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-4 pb-3",children:[(0,m.jsxs)(T,{className:"h-9 w-9 rounded-full",children:[(0,m.jsx)(V,{src:R,alt:y}),(0,m.jsx)(z,{className:"rounded-full",children:Ye(y)})]}),(0,m.jsxs)("div",{className:"min-w-0",children:[(0,m.jsx)("div",{className:"text-sm font-semibold truncate",children:y}),(0,m.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:u})]})]}),(0,m.jsx)(E,{}),(0,m.jsxs)(D,{className:"cursor-pointer py-2",onClick:()=>l?.(),children:[(0,m.jsx)(O.Settings,{className:"mr-2 h-4 w-4"}),(0,m.jsx)("span",{children:"Manage account"})]}),h.map((f,i)=>{let p=f.icon??I;return(0,m.jsxs)(D,{className:"cursor-pointer py-2",onClick:()=>k(f),children:[(0,m.jsx)(p,{className:"mr-2 h-4 w-4"}),(0,m.jsx)("span",{children:f.label})]},`${f.label}-${i}`)}),(0,m.jsx)(E,{}),(0,m.jsxs)(D,{className:"cursor-pointer text-red-600 focus:text-red-700 py-2",onClick:()=>d?.(),children:[(0,m.jsx)(O.LogOut,{className:"mr-2 h-4 w-4"}),(0,m.jsx)("span",{children:"Sign out"})]})]})]})};var Te=require("lucide-react");var Ie=require("class-variance-authority");var Z=require("react/jsx-runtime"),Qe=(0,Ie.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 Y({className:e,variant:t,...r}){return(0,Z.jsx)("div",{"data-slot":"alert",role:"alert",className:s(Qe({variant:t}),e),...r})}function Ae({className:e,...t}){return(0,Z.jsx)("div",{"data-slot":"alert-title",className:s("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function Q({className:e,...t}){return(0,Z.jsx)("div",{"data-slot":"alert-description",className:s("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var M=require("react/jsx-runtime"),Ve=e=>{let t=e.title??"Placeholder Alert",r=e.description??"This is a placeholder alert.";return(0,M.jsx)("div",{className:"grid w-full max-w-xl items-start gap-4",children:(0,M.jsxs)(Y,{children:[(0,M.jsx)(L,{Icon:Te.CheckCircle2Icon}),(0,M.jsx)(Ae,{children:t}),(0,M.jsx)(Q,{children:r})]})})};var S=require("react");var ae=require("react/jsx-runtime");function ee({className:e,...t}){return(0,ae.jsx)("div",{"data-slot":"card",className:s("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function te({className:e,...t}){return(0,ae.jsx)("div",{"data-slot":"card-content",className:s("px-6",e),...t})}var _=require("lucide-react"),n=require("react/jsx-runtime"),ze=({onValidate:e})=>{let[t,r]=(0,S.useState)(["","","","","",""]),[l,d]=(0,S.useState)(!1),[h,x]=(0,S.useState)(""),[C,P]=(0,S.useState)(!1),u=(0,S.useRef)([]),y=(i,p)=>{if(!/^\d*$/.test(p))return;let w=[...t];w[i]=p.slice(-1),r(w),x(""),P(!1),p&&i<5&&u.current[i+1]?.focus()},R=(i,p)=>{p.key==="Backspace"&&!t[i]&&i>0&&u.current[i-1]?.focus(),p.key==="v"&&(p.ctrlKey||p.metaKey)&&(p.preventDefault(),navigator.clipboard.readText().then(w=>{let re=w.replace(/\D/g,"").slice(0,6).split(""),ne=[...t];re.forEach((Le,ie)=>{ie<6&&(ne[ie]=Le)}),r(ne);let Ee=Math.min(re.length,5);u.current[Ee]?.focus()}))},k=async()=>{let i=t.join("");if(i.length!==6){x("Please enter all 6 digits");return}d(!0),x("");try{await e(i),P(!0)}catch{x("Invalid TOTP code. Please try again.")}finally{d(!1)}},I=i=>{i.preventDefault(),k()},f=()=>{r(["","","","","",""]),x(""),P(!1),d(!1),u.current[0]?.focus()};return C?(0,n.jsx)("div",{className:"max-w-md mx-auto",children:(0,n.jsx)(ee,{className:"border-green-200 bg-green-50",children:(0,n.jsx)(te,{className:"pt-6",children:(0,n.jsxs)("div",{className:"text-center space-y-4",children:[(0,n.jsx)("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:(0,n.jsx)(_.CheckCircle,{className:"w-8 h-8 text-green-600"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Verification Successful!"}),(0,n.jsx)("p",{className:"text-sm text-green-700 mt-1",children:"Your TOTP code has been validated."})]}),(0,n.jsx)(v,{onClick:f,variant:"outline",className:"bg-white",children:"Verify Another Code"})]})})})}):(0,n.jsx)("div",{className:"max-w-md mx-auto",children:(0,n.jsx)(ee,{children:(0,n.jsx)(te,{className:"pt-6",children:(0,n.jsxs)("div",{className:"text-center space-y-6",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:(0,n.jsx)(_.Shield,{className:"w-6 h-6 text-blue-600"})}),(0,n.jsx)("h3",{className:"text-lg font-semibold",children:"Enter Verification Code"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Enter the 6-digit code from your authenticator app"})]}),(0,n.jsxs)("form",{onSubmit:I,className:"space-y-6",children:[(0,n.jsx)("div",{className:"flex justify-center gap-2",children:t.map((i,p)=>(0,n.jsx)(ee,{className:"w-12 h-14 border-2 focus-within:border-blue-500 transition-colors",children:(0,n.jsx)(te,{className:"p-0 h-full flex items-center justify-center",children:(0,n.jsx)("input",{ref:w=>{u.current[p]=w},type:"tel",inputMode:"numeric",maxLength:1,value:i,onChange:w=>y(p,w.target.value),onKeyDown:w=>R(p,w),className:"w-full h-full text-center text-2xl font-bold border-none outline-none bg-transparent",autoComplete:"one-time-code",disabled:l,style:{height:"auto"}})})},p))}),h&&(0,n.jsxs)(Y,{variant:"destructive",children:[(0,n.jsx)(_.AlertCircle,{className:"h-4 w-4"}),(0,n.jsx)(Q,{children:h})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(v,{type:"submit",className:"w-full",disabled:l||t.some(i=>i===""),children:l?"Verifying...":"Verify Code"}),(0,n.jsx)(v,{type:"button",variant:"ghost",size:"sm",onClick:f,className:"w-full text-xs",children:"Clear Code"})]})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Codes refresh every 30 seconds"})]})})})})};
3
3
  //# sourceMappingURL=index.js.map