@authdog/react-elements 0.0.28 → 0.0.30

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,41 +1,16 @@
1
1
 
2
- > @authdog/react-elements@0.0.28 build /home/runner/work/web-sdk/web-sdk/packages/react-elements
2
+ > @authdog/react-elements@0.0.30 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
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.3.5
7
+ CLI tsup v8.5.0
8
8
  CLI Using tsup config: /home/runner/work/web-sdk/web-sdk/packages/react-elements/tsup.config.ts
9
9
  CLI Target: es2020
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 15.64 KB
14
- ESM dist/lib/utils.mjs 166.00 B
15
- ESM dist/components/ui/alert.mjs 1.19 KB
16
- ESM dist/components/ui/avatar.mjs 749.00 B
17
- ESM dist/components/ui/badge.mjs 1.34 KB
18
- ESM dist/components/ui/button.mjs 1.36 KB
19
- ESM dist/components/ui/card.mjs 1.35 KB
20
- ESM dist/components/ui/dropdown-menu.mjs 5.37 KB
21
- ESM dist/components/ui/input.mjs 949.00 B
22
- ESM dist/components/ui/label.mjs 566.00 B
23
- ESM dist/components/ui/separator.mjs 604.00 B
24
- ESM dist/components/ui/sheet.mjs 2.68 KB
25
- ESM dist/index.mjs.map 49.68 KB
26
- ESM dist/lib/utils.mjs.map 415.00 B
27
- ESM dist/components/ui/alert.mjs.map 2.82 KB
28
- ESM dist/components/ui/avatar.mjs.map 2.13 KB
29
- ESM dist/components/ui/badge.mjs.map 2.63 KB
30
- ESM dist/components/ui/button.mjs.map 3.01 KB
31
- ESM dist/components/ui/card.mjs.map 3.54 KB
32
- ESM dist/components/ui/dropdown-menu.mjs.map 12.05 KB
33
- ESM dist/components/ui/input.mjs.map 1.67 KB
34
- ESM dist/components/ui/label.mjs.map 1.32 KB
35
- ESM dist/components/ui/separator.mjs.map 1.51 KB
36
- ESM dist/components/ui/sheet.mjs.map 6.49 KB
37
- ESM ⚡️ Build success in 187ms
38
- CJS dist/index.js 17.15 KB
13
+ CJS dist/index.js 21.10 KB
39
14
  CJS dist/lib/utils.js 620.00 B
40
15
  CJS dist/components/ui/alert.js 1.65 KB
41
16
  CJS dist/components/ui/avatar.js 1.34 KB
@@ -47,7 +22,7 @@
47
22
  CJS dist/components/ui/label.js 1.14 KB
48
23
  CJS dist/components/ui/separator.js 1.18 KB
49
24
  CJS dist/components/ui/sheet.js 3.36 KB
50
- CJS dist/index.js.map 49.50 KB
25
+ CJS dist/index.js.map 63.93 KB
51
26
  CJS dist/lib/utils.js.map 520.00 B
52
27
  CJS dist/components/ui/alert.js.map 3.01 KB
53
28
  CJS dist/components/ui/avatar.js.map 2.31 KB
@@ -59,12 +34,37 @@
59
34
  CJS dist/components/ui/label.js.map 1.45 KB
60
35
  CJS dist/components/ui/separator.js.map 1.64 KB
61
36
  CJS dist/components/ui/sheet.js.map 6.75 KB
62
- CJS ⚡️ Build success in 189ms
37
+ CJS ⚡️ Build success in 240ms
38
+ ESM dist/index.mjs 19.34 KB
39
+ ESM dist/lib/utils.mjs 166.00 B
40
+ ESM dist/components/ui/alert.mjs 1.19 KB
41
+ ESM dist/components/ui/avatar.mjs 749.00 B
42
+ ESM dist/components/ui/button.mjs 1.36 KB
43
+ ESM dist/components/ui/card.mjs 1.35 KB
44
+ ESM dist/components/ui/dropdown-menu.mjs 5.37 KB
45
+ ESM dist/components/ui/badge.mjs 1.34 KB
46
+ ESM dist/components/ui/input.mjs 949.00 B
47
+ ESM dist/components/ui/label.mjs 566.00 B
48
+ ESM dist/components/ui/separator.mjs 604.00 B
49
+ ESM dist/components/ui/sheet.mjs 2.68 KB
50
+ ESM dist/index.mjs.map 64.20 KB
51
+ ESM dist/lib/utils.mjs.map 415.00 B
52
+ ESM dist/components/ui/alert.mjs.map 2.82 KB
53
+ ESM dist/components/ui/avatar.mjs.map 2.13 KB
54
+ ESM dist/components/ui/button.mjs.map 3.01 KB
55
+ ESM dist/components/ui/card.mjs.map 3.54 KB
56
+ ESM dist/components/ui/dropdown-menu.mjs.map 12.05 KB
57
+ ESM dist/components/ui/badge.mjs.map 2.63 KB
58
+ ESM dist/components/ui/input.mjs.map 1.67 KB
59
+ ESM dist/components/ui/label.mjs.map 1.32 KB
60
+ ESM dist/components/ui/separator.mjs.map 1.51 KB
61
+ ESM dist/components/ui/sheet.mjs.map 6.49 KB
62
+ ESM ⚡️ Build success in 245ms
63
63
  DTS Build start
64
- DTS ⚡️ Build success in 9160ms
65
- DTS dist/index.d.mts 1.98 KB
66
- DTS dist/index.d.ts 1.98 KB
64
+ DTS ⚡️ Build success in 11623ms
65
+ DTS dist/index.d.mts 2.31 KB
66
+ DTS dist/index.d.ts 2.31 KB
67
67
 
68
- > @authdog/react-elements@0.0.28 build:styles /home/runner/work/web-sdk/web-sdk/packages/react-elements
68
+ > @authdog/react-elements@0.0.30 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.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 732d717: add totp validator component
8
+
9
+ ## 0.0.29
10
+
11
+ ### Patch Changes
12
+
13
+ - 83c8f6c: add client-only to react-elements
14
+
3
15
  ## 0.0.28
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
- import React__default from 'react';
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';
6
6
 
@@ -13,6 +13,10 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Var
13
13
  }
14
14
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
15
 
16
+ declare const ClientOnly: ({ children }: {
17
+ children: ReactNode;
18
+ }) => react_jsx_runtime.JSX.Element | null;
19
+
16
20
  interface NavItem {
17
21
  title: string;
18
22
  href: string;
@@ -51,4 +55,9 @@ interface PlaceholderAlertProps {
51
55
  }
52
56
  declare const PlaceholderAlert: (props: PlaceholderAlertProps) => react_jsx_runtime.JSX.Element;
53
57
 
54
- export { Button, Navbar, PlaceholderAlert, UserProfile };
58
+ interface TOTPValidatorProps {
59
+ onValidate: (code: string) => Promise<void>;
60
+ }
61
+ declare const TOTPValidator: ({ onValidate }: TOTPValidatorProps) => react_jsx_runtime.JSX.Element;
62
+
63
+ export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserProfile };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as class_variance_authority_types from 'class-variance-authority/types';
2
2
  import * as React from 'react';
3
- import React__default from 'react';
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';
6
6
 
@@ -13,6 +13,10 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Var
13
13
  }
14
14
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
15
 
16
+ declare const ClientOnly: ({ children }: {
17
+ children: ReactNode;
18
+ }) => react_jsx_runtime.JSX.Element | null;
19
+
16
20
  interface NavItem {
17
21
  title: string;
18
22
  href: string;
@@ -51,4 +55,9 @@ interface PlaceholderAlertProps {
51
55
  }
52
56
  declare const PlaceholderAlert: (props: PlaceholderAlertProps) => react_jsx_runtime.JSX.Element;
53
57
 
54
- export { Button, Navbar, PlaceholderAlert, UserProfile };
58
+ interface TOTPValidatorProps {
59
+ onValidate: (code: string) => Promise<void>;
60
+ }
61
+ declare const TOTPValidator: ({ onValidate }: TOTPValidatorProps) => react_jsx_runtime.JSX.Element;
62
+
63
+ export { Button, ClientOnly, Navbar, PlaceholderAlert, TOTPValidator, UserProfile };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use strict";var be=Object.create;var N=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var Ne=(e,o)=>{for(var r in o)N(e,r,{get:o[r],enumerable:!0})},O=(e,o,r,d)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of ye(o))!Pe.call(e,s)&&s!==r&&N(e,s,{get:()=>o[s],enumerable:!(d=xe(o,s))||d.enumerable});return e};var C=(e,o,r)=>(r=e!=null?be(we(e)):{},O(o||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),Ce=e=>O(N({},"__esModule",{value:!0}),e);var ze={};Ne(ze,{Button:()=>c,Navbar:()=>re,PlaceholderAlert:()=>ge,UserProfile:()=>me});module.exports=Ce(ze);var H=C(require("react")),W=require("@radix-ui/react-slot"),$=require("class-variance-authority");var j=require("clsx"),U=require("tailwind-merge");function n(...e){return(0,U.twMerge)((0,j.clsx)(e))}var q=require("react/jsx-runtime"),Me=(0,$.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"}}),c=H.forwardRef(({className:e,variant:o,size:r,asChild:d=!1,...s},v)=>(0,q.jsx)(d?W.Slot:"button",{className:n(Me({variant:o,size:r,className:e})),ref:v,...s}));c.displayName="Button";var ae=require("react"),x=require("lucide-react");var h=C(require("@radix-ui/react-avatar"));var R=require("react/jsx-runtime");function M({className:e,...o}){return(0,R.jsx)(h.Root,{"data-slot":"avatar",className:n("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),...o})}function D({className:e,...o}){return(0,R.jsx)(h.Image,{"data-slot":"avatar-image",className:n("aspect-square size-full",e),...o})}function S({className:e,...o}){return(0,R.jsx)(h.Fallback,{"data-slot":"avatar-fallback",className:n("bg-muted flex size-full items-center justify-center rounded-full",e),...o})}var i=C(require("@radix-ui/react-dropdown-menu")),B=require("lucide-react");var f=require("react/jsx-runtime");function X({...e}){return(0,f.jsx)(i.Root,{"data-slot":"dropdown-menu",...e})}function J({...e}){return(0,f.jsx)(i.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function K({className:e,sideOffset:o=4,...r}){return(0,f.jsx)(i.Portal,{children:(0,f.jsx)(i.Content,{"data-slot":"dropdown-menu-content",sideOffset:o,className:n("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...r})})}function Q({...e}){return(0,f.jsx)(i.Group,{"data-slot":"dropdown-menu-group",...e})}function L({className:e,inset:o,variant:r="default",...d}){return(0,f.jsx)(i.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":r,className:n("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...d})}function Y({className:e,inset:o,...r}){return(0,f.jsx)(i.Label,{"data-slot":"dropdown-menu-label","data-inset":o,className:n("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",e),...r})}function E({className:e,...o}){return(0,f.jsx)(i.Separator,{"data-slot":"dropdown-menu-separator",className:n("bg-border -mx-1 my-1 h-px",e),...o})}var l=C(require("@radix-ui/react-dialog")),Z=require("lucide-react");var m=require("react/jsx-runtime"),De=Z.X;function ee({...e}){return(0,m.jsx)(l.Root,{"data-slot":"sheet",...e})}function te({...e}){return(0,m.jsx)(l.Trigger,{"data-slot":"sheet-trigger",...e})}function Se({...e}){return(0,m.jsx)(l.Portal,{"data-slot":"sheet-portal",...e})}function Re({className:e,...o}){return(0,m.jsx)(l.Overlay,{"data-slot":"sheet-overlay",className:n("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...o})}function oe({className:e,children:o,side:r="right",...d}){return(0,m.jsxs)(Se,{children:[(0,m.jsx)(Re,{}),(0,m.jsxs)(l.Content,{"data-slot":"sheet-content",className:n("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...d,children:[o,(0,m.jsxs)(l.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,m.jsx)(De,{className:"size-4"}),(0,m.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}var I=require("react"),k=require("react/jsx-runtime"),ke={className:"mr-2 h-4 w-4","aria-hidden":"true"},Ie=e=>{let[o,r]=(0,I.useState)(!1);return(0,I.useEffect)(()=>{r(!0)},[]),o?(0,k.jsx)(e,{...ke}):(0,k.jsx)("span",{className:"mr-2 h-4 w-4","aria-hidden":"true"})},b=({Icon:e})=>(0,k.jsx)("span",{className:"inline-flex items-center justify-center",children:Ie(e)});var a=require("react/jsx-runtime");function re({items:e=[],children:o,className:r,logoText:d="ACME Corp",user:s={name:"John Doe",email:"john@example.com",image:"https://i.pravatar.cc/150?u=a042581f4e29026704d"},onNavigateHome:v=()=>console.log("Navigating to home"),onNavItemClick:w=V=>console.log(`Navigating to ${V}`),onProfileSelected:T,onLogout:z=()=>console.log("Logout clicked"),isLoading:p=!1,identityHost:P="https://stg-id.authdog.xyz",environmentId:_="58be35b0-708f-49f6-84f0-6695d307d997"}){let[V,F]=(0,ae.useState)(!1),he=s!=null&&s.id!==null&&s.id!==void 0;return(0,a.jsx)("header",{className:n("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:v,children:d}),(0,a.jsx)("nav",{className:"hidden md:flex gap-6",children:e?.map((u,G)=>(0,a.jsx)("span",{onClick:()=>{u.disabled||w(u.href)},className:n("text-sm font-medium transition-colors hover:text-primary cursor-pointer",u.disabled&&"cursor-not-allowed opacity-80"),children:u.title},G))})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[o,he?(0,a.jsxs)(X,{children:[(0,a.jsx)(J,{asChild:!0,children:(0,a.jsx)(c,{variant:"ghost",className:"relative h-8 w-8 rounded-full",disabled:p,children:(0,a.jsx)(M,{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)(D,{src:s.photos?.[0]?.value||"/placeholder.svg",alt:s.displayName}),(0,a.jsx)(S,{children:s.displayName?.charAt(0)})]})})})}),(0,a.jsx)(K,{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)(Y,{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:s.displayName}),(0,a.jsx)("p",{className:"text-xs leading-none text-muted-foreground",children:s.emails?.[0]?.value})]})}),(0,a.jsx)(E,{}),(0,a.jsx)(Q,{children:(0,a.jsxs)(L,{onClick:T,children:[(0,a.jsx)(b,{Icon:x.User}),(0,a.jsx)("span",{children:"Profile"})]})}),(0,a.jsx)(E,{}),(0,a.jsxs)(L,{onClick:z,children:[(0,a.jsx)(b,{Icon:x.LogOut}),(0,a.jsx)("span",{children:"Log out"})]})]})})]}):(0,a.jsx)(c,{variant:"default","aria-label":"Sign in",onClick:()=>{if(!_)throw new Error("Environment ID is required");if(!P)throw new Error("Identity Host is required");let u=`${P}/signin/${_}`;window.open(u,"_blank")},children:"Sign in"}),(0,a.jsxs)(ee,{open:V,onOpenChange:F,children:[(0,a.jsx)(te,{asChild:!0,children:(0,a.jsx)(c,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open Menu",children:(0,a.jsx)(b,{Icon:x.Menu})})}),(0,a.jsx)(oe,{side:"left",className:"pr-0",children:(0,a.jsx)("nav",{className:"grid gap-2 py-6",children:e?.map((u,G)=>(0,a.jsx)("a",{href:u.href,className:n("flex w-full items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent",u.disabled&&"cursor-not-allowed opacity-80"),onClick:()=>F(!1),children:u.title},G))})})]})]})]})})}var y=require("react");var ne=require("@radix-ui/react-slot"),ie=require("class-variance-authority");var de=require("react/jsx-runtime"),Ae=(0,ie.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 se({className:e,variant:o,asChild:r=!1,...d}){return(0,de.jsx)(r?ne.Slot:"span",{"data-slot":"badge",className:n(Ae({variant:o}),e),...d})}var le=require("lucide-react"),t=require("react/jsx-runtime"),me=({loading:e,user:o,handleAuthenticated:r})=>{let[d,s]=(0,y.useState)(!1),[v,w]=(0,y.useState)("profile");(0,y.useEffect)(()=>{s(!0)},[]),(0,y.useEffect)(()=>{!e&&r&&r()},[e,o,r]);let T={className:"mr-2 h-4 w-4","aria-hidden":"true"},z=p=>d?(0,t.jsx)(p,{...T}):null;return!d||e?(0,t.jsx)("div",{children:"Loading..."}):o?(0,t.jsxs)("div",{className:"grid grid-cols-[16rem,1fr] h-screen bg-gray-100",children:[(0,t.jsxs)("div",{className:"h-full border-r p-6 bg-white flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h1",{className:"text-xl font-bold",children:"Account"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Manage your account info."})]}),(0,t.jsx)("nav",{className:"space-y-1 flex-1",children:(0,t.jsxs)("button",{onClick:()=>w("profile"),className:`flex items-center w-full px-3 py-2 text-sm rounded-md ${v==="profile"?"bg-gray-100 text-gray-900":"text-gray-700 hover:bg-gray-50"}`,children:[z(le.User),"Profile"]})})]}),(0,t.jsxs)("div",{className:"h-full p-10 overflow-y-auto min-w-0 bg-white",children:[(0,t.jsx)("div",{className:"flex justify-between items-center mb-6",children:(0,t.jsx)("h2",{className:"text-xl font-semibold",children:v==="profile"?"Profile details":"Security settings"})}),v==="profile"?(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Profile"}),(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)(M,{className:"h-12 w-12 mr-4 border",children:[(0,t.jsx)(D,{src:o.photos?.[0]?.value,alt:"Profile picture"}),(0,t.jsx)(S,{children:o.displayName?.split(" ").map(p=>p[0]).join("")})]}),(0,t.jsx)("span",{className:"font-medium",children:o.displayName})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Email addresses"}),(0,t.jsx)("div",{className:"space-y-3",children:o.emails.map((p,P)=>(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:p.value}),P===0&&(0,t.jsx)(se,{variant:"outline",className:"text-xs bg-gray-100 text-gray-700 hover:bg-gray-100",children:"Primary"})]},p.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Connected accounts"}),(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)("div",{className:"mr-2",children:(0,t.jsx)("span",{children:o.provider})})}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:o?.emails?.[0]?.value})]},o.provider)})]})]}):(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Two-factor authentication"}),(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Two-factor authentication"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Add an extra layer of security to your account"})]}),(0,t.jsx)(c,{variant:"outline",size:"sm",children:"Enable"})]})})]},"two-factor"),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Password"}),(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Change password"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Last changed 3 months ago"})]}),(0,t.jsx)(c,{variant:"outline",size:"sm",children:"Change"})]})})]},"password"),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Active sessions"}),(0,t.jsx)("div",{className:"space-y-3",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:"Current session"}),(0,t.jsx)("p",{className:"text-sm text-gray-500",children:"Chrome on Windows \u2022 Active now"})]}),(0,t.jsx)(c,{variant:"outline",size:"sm",children:"Sign out"})]})})]},"sessions")]})]})]}):(0,t.jsx)("div",{children:"No user"})};var ve=require("lucide-react");var ce=require("class-variance-authority");var A=require("react/jsx-runtime"),Te=(0,ce.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 pe({className:e,variant:o,...r}){return(0,A.jsx)("div",{"data-slot":"alert",role:"alert",className:n(Te({variant:o}),e),...r})}function ue({className:e,...o}){return(0,A.jsx)("div",{"data-slot":"alert-title",className:n("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...o})}function fe({className:e,...o}){return(0,A.jsx)("div",{"data-slot":"alert-description",className:n("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...o})}var g=require("react/jsx-runtime"),ge=e=>{let o=e.title??"Placeholder Alert",r=e.description??"This is a placeholder alert.";return(0,g.jsx)("div",{className:"grid w-full max-w-xl items-start gap-4",children:(0,g.jsxs)(pe,{children:[(0,g.jsx)(b,{Icon:ve.CheckCircle2Icon}),(0,g.jsx)(ue,{children:o}),(0,g.jsx)(fe,{children:r})]})})};
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-[16rem,1fr] h-screen bg-gray-100",children:[(0,o.jsxs)("div",{className:"h-full border-r p-6 bg-white flex flex-col min-w-0",children:[(0,o.jsxs)("div",{className:"mb-6",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-10 overflow-y-auto min-w-0 bg-white",children:[(0,o.jsx)("div",{className:"flex justify-between items-center mb-6",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-8",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-4",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-4",children:"Email addresses"}),(0,o.jsx)("div",{className:"space-y-3",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-4",children:"Connected accounts"}),(0,o.jsx)("div",{className:"space-y-3",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-8",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("h3",{className:"text-sm font-medium mb-4",children:"Two-factor authentication"}),(0,o.jsx)("div",{className:"space-y-3",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-4",children:"Password"}),(0,o.jsx)("div",{className:"space-y-3",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-4",children:"Active sessions"}),(0,o.jsx)("div",{className:"space-y-3",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"})]})})})})};
3
3
  //# sourceMappingURL=index.js.map