@authdog/react-elements 0.0.39 → 0.0.42

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.
Files changed (74) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.storybook/main.ts +21 -0
  3. package/.storybook/preview.ts +17 -0
  4. package/.storybook/vitest.setup.ts +7 -0
  5. package/.turbo/turbo-build.log +45 -42
  6. package/CHANGELOG.md +18 -0
  7. package/dist/components/ui/alert.js.map +1 -1
  8. package/dist/components/ui/alert.mjs.map +1 -1
  9. package/dist/components/ui/avatar.js.map +1 -1
  10. package/dist/components/ui/avatar.mjs.map +1 -1
  11. package/dist/components/ui/badge.js.map +1 -1
  12. package/dist/components/ui/badge.mjs.map +1 -1
  13. package/dist/components/ui/card.js.map +1 -1
  14. package/dist/components/ui/card.mjs.map +1 -1
  15. package/dist/components/ui/dropdown-menu.js +1 -1
  16. package/dist/components/ui/dropdown-menu.js.map +1 -1
  17. package/dist/components/ui/dropdown-menu.mjs +1 -1
  18. package/dist/components/ui/dropdown-menu.mjs.map +1 -1
  19. package/dist/components/ui/input.js.map +1 -1
  20. package/dist/components/ui/input.mjs.map +1 -1
  21. package/dist/components/ui/label.js.map +1 -1
  22. package/dist/components/ui/label.mjs.map +1 -1
  23. package/dist/components/ui/separator.js.map +1 -1
  24. package/dist/components/ui/separator.mjs.map +1 -1
  25. package/dist/components/ui/sheet.js.map +1 -1
  26. package/dist/components/ui/sheet.mjs.map +1 -1
  27. package/dist/index.d.mts +3 -1
  28. package/dist/index.d.ts +3 -1
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.mjs +1 -1
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/styles.css +218 -8
  34. package/package.json +25 -14
  35. package/src/components/core/client-only.tsx +10 -15
  36. package/src/components/core/navbar.tsx +81 -50
  37. package/src/components/core/placeholder-alert.tsx +7 -9
  38. package/src/components/core/user-dropdown.tsx +117 -57
  39. package/src/components/core/user-profile.tsx +180 -86
  40. package/src/components/flow/login.tsx +42 -29
  41. package/src/components/flow/totp-validator.tsx +94 -73
  42. package/src/components/icons.tsx +15 -21
  43. package/src/components/ui/alert.tsx +11 -11
  44. package/src/components/ui/avatar.tsx +10 -10
  45. package/src/components/ui/badge.tsx +9 -9
  46. package/src/components/ui/card.tsx +13 -13
  47. package/src/components/ui/dropdown-menu.tsx +214 -211
  48. package/src/components/ui/input.tsx +5 -5
  49. package/src/components/ui/label.tsx +7 -7
  50. package/src/components/ui/separator.tsx +7 -7
  51. package/src/components/ui/sheet.tsx +21 -21
  52. package/src/index.ts +6 -6
  53. package/src/stories/core/Navbar.stories.tsx +45 -0
  54. package/src/stories/core/PlaceholderAlert.stories.tsx +23 -0
  55. package/src/stories/core/UserDropdown.stories.tsx +56 -0
  56. package/src/stories/core/UserProfile.stories.tsx +47 -0
  57. package/src/stories/flow/LoginForm.stories.tsx +20 -0
  58. package/src/stories/flow/TotpValidator.stories.tsx +23 -0
  59. package/src/stories/showcase/Landing.stories.tsx +376 -0
  60. package/src/stories/ui/Button.stories.tsx +45 -0
  61. package/tsup.config.ts +6 -9
  62. package/vitest.config.ts +39 -0
  63. package/vitest.shims.d.ts +1 -0
  64. package/wrangler.prod.toml +4 -0
  65. package/ladle.config.mjs +0 -21
  66. package/src/main.tsx +0 -11
  67. package/src/preview.tsx +0 -11
  68. package/src/stories/Button._stories.tsx +0 -24
  69. package/src/stories/LoginForm.stories.tsx +0 -29
  70. package/src/stories/Navbar._stories.tsx +0 -28
  71. package/src/stories/PlaceholderAlert._stories.tsx +0 -13
  72. package/src/stories/TotpValidator.stories.tsx +0 -14
  73. package/src/stories/UserDropdown.stories.tsx +0 -36
  74. package/src/stories/UserProfile.stories.tsx +0 -46
@@ -1,20 +1,22 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { Check, ChevronRight, Circle } from "lucide-react"
6
- import type { ComponentType } from "react"
3
+ import * as React from "react";
4
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
5
+ import { Check, ChevronRight, Circle } from "lucide-react";
6
+ import type { ComponentType } from "react";
7
7
 
8
- import { cn } from "../../lib/utils"
8
+ import { cn } from "../../lib/utils";
9
9
 
10
- const CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>
11
- const CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>
12
- const ChevronRightIcon = ChevronRight as ComponentType<React.SVGProps<SVGSVGElement>>
10
+ const CheckIcon = Check as ComponentType<React.SVGProps<SVGSVGElement>>;
11
+ const CircleIcon = Circle as ComponentType<React.SVGProps<SVGSVGElement>>;
12
+ const ChevronRightIcon = ChevronRight as ComponentType<
13
+ React.SVGProps<SVGSVGElement>
14
+ >;
13
15
 
14
16
  function DropdownMenu({
15
17
  ...props
16
18
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
17
- return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
19
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
18
20
  }
19
21
 
20
22
  function DropdownMenuPortal({
@@ -22,226 +24,227 @@ function DropdownMenuPortal({
22
24
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
23
25
  return (
24
26
  <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
25
- )
27
+ );
26
28
  }
27
29
 
28
- function DropdownMenuTrigger({
29
- ...props
30
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
31
- return (
32
- <DropdownMenuPrimitive.Trigger
33
- data-slot="dropdown-menu-trigger"
34
- {...props}
35
- />
36
- )
37
- }
38
-
39
- function DropdownMenuContent({
40
- className,
41
- sideOffset = 4,
42
- ...props
43
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
44
- return (
45
- <DropdownMenuPrimitive.Portal>
46
- <DropdownMenuPrimitive.Content
47
- data-slot="dropdown-menu-content"
48
- sideOffset={sideOffset}
49
- className={cn(
50
- "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",
51
- className
52
- )}
53
- {...props}
54
- />
55
- </DropdownMenuPrimitive.Portal>
56
- )
57
- }
30
+ const DropdownMenuTrigger = React.forwardRef<
31
+ React.ElementRef<typeof DropdownMenuPrimitive.Trigger>,
32
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>
33
+ >(({ ...props }, ref) => (
34
+ <DropdownMenuPrimitive.Trigger
35
+ ref={ref}
36
+ data-slot="dropdown-menu-trigger"
37
+ {...props}
38
+ />
39
+ ));
40
+ DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
58
41
 
59
- function DropdownMenuGroup({
60
- ...props
61
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
62
- return (
63
- <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
64
- )
65
- }
66
-
67
- function DropdownMenuItem({
68
- className,
69
- inset,
70
- variant = "default",
71
- ...props
72
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
73
- inset?: boolean
74
- variant?: "default" | "destructive"
75
- }) {
76
- return (
77
- <DropdownMenuPrimitive.Item
78
- data-slot="dropdown-menu-item"
79
- data-inset={inset}
80
- data-variant={variant}
42
+ const DropdownMenuContent = React.forwardRef<
43
+ React.ElementRef<typeof DropdownMenuPrimitive.Content>,
44
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
45
+ >(({ className, sideOffset = 4, ...props }, ref) => (
46
+ <DropdownMenuPrimitive.Portal>
47
+ <DropdownMenuPrimitive.Content
48
+ ref={ref}
49
+ data-slot="dropdown-menu-content"
50
+ sideOffset={sideOffset}
81
51
  className={cn(
82
- "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",
83
- className
52
+ "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",
53
+ className,
84
54
  )}
85
55
  {...props}
86
56
  />
87
- )
88
- }
57
+ </DropdownMenuPrimitive.Portal>
58
+ ));
59
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
89
60
 
90
- function DropdownMenuCheckboxItem({
91
- className,
92
- children,
93
- checked,
94
- ...props
95
- }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
96
- return (
97
- <DropdownMenuPrimitive.CheckboxItem
98
- data-slot="dropdown-menu-checkbox-item"
99
- className={cn(
100
- "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",
101
- className
102
- )}
103
- checked={checked}
104
- {...props}
105
- >
106
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
107
- <DropdownMenuPrimitive.ItemIndicator>
108
- <CheckIcon className="size-4" />
109
- </DropdownMenuPrimitive.ItemIndicator>
110
- </span>
111
- {children}
112
- </DropdownMenuPrimitive.CheckboxItem>
113
- )
114
- }
61
+ const DropdownMenuGroup = React.forwardRef<
62
+ React.ElementRef<typeof DropdownMenuPrimitive.Group>,
63
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Group>
64
+ >(({ ...props }, ref) => (
65
+ <DropdownMenuPrimitive.Group
66
+ ref={ref}
67
+ data-slot="dropdown-menu-group"
68
+ {...props}
69
+ />
70
+ ));
71
+ DropdownMenuGroup.displayName = DropdownMenuPrimitive.Group.displayName;
115
72
 
116
- function DropdownMenuRadioGroup({
117
- ...props
118
- }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
119
- return (
120
- <DropdownMenuPrimitive.RadioGroup
121
- data-slot="dropdown-menu-radio-group"
122
- {...props}
123
- />
124
- )
125
- }
73
+ const DropdownMenuItem = React.forwardRef<
74
+ React.ElementRef<typeof DropdownMenuPrimitive.Item>,
75
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
76
+ inset?: boolean;
77
+ variant?: "default" | "destructive";
78
+ }
79
+ >(({ className, inset, variant = "default", ...props }, ref) => (
80
+ <DropdownMenuPrimitive.Item
81
+ ref={ref}
82
+ data-slot="dropdown-menu-item"
83
+ data-inset={inset}
84
+ data-variant={variant}
85
+ className={cn(
86
+ "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",
87
+ className,
88
+ )}
89
+ {...props}
90
+ />
91
+ ));
92
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
126
93
 
127
- function DropdownMenuRadioItem({
128
- className,
129
- children,
130
- ...props
131
- }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
132
- return (
133
- <DropdownMenuPrimitive.RadioItem
134
- data-slot="dropdown-menu-radio-item"
135
- className={cn(
136
- "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",
137
- className
138
- )}
139
- {...props}
140
- >
141
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
142
- <DropdownMenuPrimitive.ItemIndicator>
143
- <CircleIcon className="size-2 fill-current" />
144
- </DropdownMenuPrimitive.ItemIndicator>
145
- </span>
146
- {children}
147
- </DropdownMenuPrimitive.RadioItem>
148
- )
149
- }
94
+ const DropdownMenuCheckboxItem = React.forwardRef<
95
+ React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
96
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
97
+ >(({ className, children, checked, ...props }, ref) => (
98
+ <DropdownMenuPrimitive.CheckboxItem
99
+ ref={ref}
100
+ data-slot="dropdown-menu-checkbox-item"
101
+ className={cn(
102
+ "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",
103
+ className,
104
+ )}
105
+ checked={checked}
106
+ {...props}
107
+ >
108
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
109
+ <DropdownMenuPrimitive.ItemIndicator>
110
+ <CheckIcon className="size-4" />
111
+ </DropdownMenuPrimitive.ItemIndicator>
112
+ </span>
113
+ {children}
114
+ </DropdownMenuPrimitive.CheckboxItem>
115
+ ));
116
+ DropdownMenuCheckboxItem.displayName =
117
+ DropdownMenuPrimitive.CheckboxItem.displayName;
150
118
 
151
- function DropdownMenuLabel({
152
- className,
153
- inset,
154
- ...props
155
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
156
- inset?: boolean
157
- }) {
158
- return (
159
- <DropdownMenuPrimitive.Label
160
- data-slot="dropdown-menu-label"
161
- data-inset={inset}
162
- className={cn(
163
- "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
164
- className
165
- )}
166
- {...props}
167
- />
168
- )
169
- }
119
+ const DropdownMenuRadioGroup = React.forwardRef<
120
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioGroup>,
121
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioGroup>
122
+ >(({ ...props }, ref) => (
123
+ <DropdownMenuPrimitive.RadioGroup
124
+ ref={ref}
125
+ data-slot="dropdown-menu-radio-group"
126
+ {...props}
127
+ />
128
+ ));
129
+ DropdownMenuRadioGroup.displayName =
130
+ DropdownMenuPrimitive.RadioGroup.displayName;
170
131
 
171
- function DropdownMenuSeparator({
172
- className,
173
- ...props
174
- }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
175
- return (
176
- <DropdownMenuPrimitive.Separator
177
- data-slot="dropdown-menu-separator"
178
- className={cn("bg-border -mx-1 my-1 h-px", className)}
179
- {...props}
180
- />
181
- )
182
- }
132
+ const DropdownMenuRadioItem = React.forwardRef<
133
+ React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
134
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
135
+ >(({ className, children, ...props }, ref) => (
136
+ <DropdownMenuPrimitive.RadioItem
137
+ ref={ref}
138
+ data-slot="dropdown-menu-radio-item"
139
+ className={cn(
140
+ "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",
141
+ className,
142
+ )}
143
+ {...props}
144
+ >
145
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
146
+ <DropdownMenuPrimitive.ItemIndicator>
147
+ <CircleIcon className="size-2 fill-current" />
148
+ </DropdownMenuPrimitive.ItemIndicator>
149
+ </span>
150
+ {children}
151
+ </DropdownMenuPrimitive.RadioItem>
152
+ ));
153
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
183
154
 
184
- function DropdownMenuShortcut({
185
- className,
186
- ...props
187
- }: React.ComponentProps<"span">) {
188
- return (
189
- <span
190
- data-slot="dropdown-menu-shortcut"
191
- className={cn(
192
- "text-muted-foreground ml-auto text-xs tracking-widest",
193
- className
194
- )}
195
- {...props}
196
- />
197
- )
198
- }
155
+ const DropdownMenuLabel = React.forwardRef<
156
+ React.ElementRef<typeof DropdownMenuPrimitive.Label>,
157
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
158
+ inset?: boolean;
159
+ }
160
+ >(({ className, inset, ...props }, ref) => (
161
+ <DropdownMenuPrimitive.Label
162
+ ref={ref}
163
+ data-slot="dropdown-menu-label"
164
+ data-inset={inset}
165
+ className={cn(
166
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
167
+ className,
168
+ )}
169
+ {...props}
170
+ />
171
+ ));
172
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
173
+
174
+ const DropdownMenuSeparator = React.forwardRef<
175
+ React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
176
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
177
+ >(({ className, ...props }, ref) => (
178
+ <DropdownMenuPrimitive.Separator
179
+ ref={ref}
180
+ data-slot="dropdown-menu-separator"
181
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
182
+ {...props}
183
+ />
184
+ ));
185
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
186
+
187
+ const DropdownMenuShortcut = React.forwardRef<
188
+ HTMLSpanElement,
189
+ React.ComponentPropsWithoutRef<"span">
190
+ >(({ className, ...props }, ref) => (
191
+ <span
192
+ ref={ref}
193
+ data-slot="dropdown-menu-shortcut"
194
+ className={cn(
195
+ "text-muted-foreground ml-auto text-xs tracking-widest",
196
+ className,
197
+ )}
198
+ {...props}
199
+ />
200
+ ));
201
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
199
202
 
200
203
  function DropdownMenuSub({
201
204
  ...props
202
205
  }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
203
- return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
206
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
204
207
  }
205
208
 
206
- function DropdownMenuSubTrigger({
207
- className,
208
- inset,
209
- children,
210
- ...props
211
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
212
- inset?: boolean
213
- }) {
214
- return (
215
- <DropdownMenuPrimitive.SubTrigger
216
- data-slot="dropdown-menu-sub-trigger"
217
- data-inset={inset}
218
- className={cn(
219
- "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",
220
- className
221
- )}
222
- {...props}
223
- >
224
- {children}
225
- <ChevronRightIcon className="ml-auto size-4" />
226
- </DropdownMenuPrimitive.SubTrigger>
227
- )
228
- }
209
+ const DropdownMenuSubTrigger = React.forwardRef<
210
+ React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
211
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
212
+ inset?: boolean;
213
+ }
214
+ >(({ className, inset, children, ...props }, ref) => (
215
+ <DropdownMenuPrimitive.SubTrigger
216
+ ref={ref}
217
+ data-slot="dropdown-menu-sub-trigger"
218
+ data-inset={inset}
219
+ className={cn(
220
+ "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",
221
+ className,
222
+ )}
223
+ {...props}
224
+ >
225
+ {children}
226
+ <ChevronRightIcon className="ml-auto size-4" />
227
+ </DropdownMenuPrimitive.SubTrigger>
228
+ ));
229
+ DropdownMenuSubTrigger.displayName =
230
+ DropdownMenuPrimitive.SubTrigger.displayName;
229
231
 
230
- function DropdownMenuSubContent({
231
- className,
232
- ...props
233
- }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
234
- return (
235
- <DropdownMenuPrimitive.SubContent
236
- data-slot="dropdown-menu-sub-content"
237
- className={cn(
238
- "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",
239
- className
240
- )}
241
- {...props}
242
- />
243
- )
244
- }
232
+ const DropdownMenuSubContent = React.forwardRef<
233
+ React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
234
+ React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
235
+ >(({ className, ...props }, ref) => (
236
+ <DropdownMenuPrimitive.SubContent
237
+ ref={ref}
238
+ data-slot="dropdown-menu-sub-content"
239
+ className={cn(
240
+ "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",
241
+ className,
242
+ )}
243
+ {...props}
244
+ />
245
+ ));
246
+ DropdownMenuSubContent.displayName =
247
+ DropdownMenuPrimitive.SubContent.displayName;
245
248
 
246
249
  export {
247
250
  DropdownMenu,
@@ -259,4 +262,4 @@ export {
259
262
  DropdownMenuSub,
260
263
  DropdownMenuSubTrigger,
261
264
  DropdownMenuSubContent,
262
- }
265
+ };
@@ -1,6 +1,6 @@
1
- import * as React from "react"
1
+ import * as React from "react";
2
2
 
3
- import { cn } from "@authdog/react-elements/lib/utils"
3
+ import { cn } from "../../lib/utils";
4
4
 
5
5
  function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
6
  return (
@@ -11,11 +11,11 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
11
11
  "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
12
12
  "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
13
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
14
- className
14
+ className,
15
15
  )}
16
16
  {...props}
17
17
  />
18
- )
18
+ );
19
19
  }
20
20
 
21
- export { Input }
21
+ export { Input };
@@ -1,9 +1,9 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import * as React from "react"
4
- import * as LabelPrimitive from "@radix-ui/react-label"
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
5
 
6
- import { cn } from "@authdog/react-elements/lib/utils"
6
+ import { cn } from "../../lib/utils";
7
7
 
8
8
  function Label({
9
9
  className,
@@ -14,11 +14,11 @@ function Label({
14
14
  data-slot="label"
15
15
  className={cn(
16
16
  "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
- className
17
+ className,
18
18
  )}
19
19
  {...props}
20
20
  />
21
- )
21
+ );
22
22
  }
23
23
 
24
- export { Label }
24
+ export { Label };
@@ -1,9 +1,9 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import * as React from "react"
4
- import * as SeparatorPrimitive from "@radix-ui/react-separator"
3
+ import * as React from "react";
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
5
5
 
6
- import { cn } from "@authdog/react-elements/lib/utils"
6
+ import { cn } from "../../lib/utils";
7
7
 
8
8
  function Separator({
9
9
  className,
@@ -18,11 +18,11 @@ function Separator({
18
18
  orientation={orientation}
19
19
  className={cn(
20
20
  "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
- className
21
+ className,
22
22
  )}
23
23
  {...props}
24
24
  />
25
- )
25
+ );
26
26
  }
27
27
 
28
- export { Separator }
28
+ export { Separator };