@authdog/react-elements 0.0.38 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +44 -41
- package/CHANGELOG.md +12 -0
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/avatar.mjs.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu.mjs.map +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sheet.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/core/client-only.tsx +10 -15
- package/src/components/core/navbar.tsx +81 -50
- package/src/components/core/placeholder-alert.tsx +7 -9
- package/src/components/core/user-dropdown.tsx +97 -55
- package/src/components/core/user-profile.tsx +180 -85
- package/src/components/flow/login.tsx +42 -29
- package/src/components/flow/totp-validator.tsx +94 -73
- package/src/components/icons.tsx +13 -13
- package/src/components/ui/alert.tsx +11 -11
- package/src/components/ui/avatar.tsx +10 -10
- package/src/components/ui/badge.tsx +9 -9
- package/src/components/ui/card.tsx +13 -13
- package/src/components/ui/dropdown-menu.tsx +39 -37
- package/src/components/ui/input.tsx +5 -5
- package/src/components/ui/label.tsx +7 -7
- package/src/components/ui/separator.tsx +7 -7
- package/src/components/ui/sheet.tsx +21 -21
- package/src/index.ts +6 -6
- package/src/main.tsx +4 -6
- package/src/preview.tsx +4 -8
- package/src/stories/Button._stories.tsx +15 -11
- package/src/stories/LoginForm.stories.tsx +6 -6
- package/src/stories/Navbar._stories.tsx +57 -19
- package/src/stories/PlaceholderAlert._stories.tsx +8 -8
- package/src/stories/TotpValidator.stories.tsx +10 -8
- package/src/stories/UserDropdown.stories.tsx +7 -9
- package/src/stories/UserProfile.stories.tsx +12 -12
- package/tsup.config.ts +6 -9
|
@@ -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<
|
|
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,7 +24,7 @@ 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
30
|
function DropdownMenuTrigger({
|
|
@@ -33,7 +35,7 @@ function DropdownMenuTrigger({
|
|
|
33
35
|
data-slot="dropdown-menu-trigger"
|
|
34
36
|
{...props}
|
|
35
37
|
/>
|
|
36
|
-
)
|
|
38
|
+
);
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function DropdownMenuContent({
|
|
@@ -48,12 +50,12 @@ function DropdownMenuContent({
|
|
|
48
50
|
sideOffset={sideOffset}
|
|
49
51
|
className={cn(
|
|
50
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",
|
|
51
|
-
className
|
|
53
|
+
className,
|
|
52
54
|
)}
|
|
53
55
|
{...props}
|
|
54
56
|
/>
|
|
55
57
|
</DropdownMenuPrimitive.Portal>
|
|
56
|
-
)
|
|
58
|
+
);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
function DropdownMenuGroup({
|
|
@@ -61,7 +63,7 @@ function DropdownMenuGroup({
|
|
|
61
63
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
|
|
62
64
|
return (
|
|
63
65
|
<DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
|
|
64
|
-
)
|
|
66
|
+
);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
function DropdownMenuItem({
|
|
@@ -70,8 +72,8 @@ function DropdownMenuItem({
|
|
|
70
72
|
variant = "default",
|
|
71
73
|
...props
|
|
72
74
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
73
|
-
inset?: boolean
|
|
74
|
-
variant?: "default" | "destructive"
|
|
75
|
+
inset?: boolean;
|
|
76
|
+
variant?: "default" | "destructive";
|
|
75
77
|
}) {
|
|
76
78
|
return (
|
|
77
79
|
<DropdownMenuPrimitive.Item
|
|
@@ -80,11 +82,11 @@ function DropdownMenuItem({
|
|
|
80
82
|
data-variant={variant}
|
|
81
83
|
className={cn(
|
|
82
84
|
"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
|
|
85
|
+
className,
|
|
84
86
|
)}
|
|
85
87
|
{...props}
|
|
86
88
|
/>
|
|
87
|
-
)
|
|
89
|
+
);
|
|
88
90
|
}
|
|
89
91
|
|
|
90
92
|
function DropdownMenuCheckboxItem({
|
|
@@ -98,7 +100,7 @@ function DropdownMenuCheckboxItem({
|
|
|
98
100
|
data-slot="dropdown-menu-checkbox-item"
|
|
99
101
|
className={cn(
|
|
100
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",
|
|
101
|
-
className
|
|
103
|
+
className,
|
|
102
104
|
)}
|
|
103
105
|
checked={checked}
|
|
104
106
|
{...props}
|
|
@@ -110,7 +112,7 @@ function DropdownMenuCheckboxItem({
|
|
|
110
112
|
</span>
|
|
111
113
|
{children}
|
|
112
114
|
</DropdownMenuPrimitive.CheckboxItem>
|
|
113
|
-
)
|
|
115
|
+
);
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
function DropdownMenuRadioGroup({
|
|
@@ -121,7 +123,7 @@ function DropdownMenuRadioGroup({
|
|
|
121
123
|
data-slot="dropdown-menu-radio-group"
|
|
122
124
|
{...props}
|
|
123
125
|
/>
|
|
124
|
-
)
|
|
126
|
+
);
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
function DropdownMenuRadioItem({
|
|
@@ -134,7 +136,7 @@ function DropdownMenuRadioItem({
|
|
|
134
136
|
data-slot="dropdown-menu-radio-item"
|
|
135
137
|
className={cn(
|
|
136
138
|
"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
|
|
139
|
+
className,
|
|
138
140
|
)}
|
|
139
141
|
{...props}
|
|
140
142
|
>
|
|
@@ -145,7 +147,7 @@ function DropdownMenuRadioItem({
|
|
|
145
147
|
</span>
|
|
146
148
|
{children}
|
|
147
149
|
</DropdownMenuPrimitive.RadioItem>
|
|
148
|
-
)
|
|
150
|
+
);
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
function DropdownMenuLabel({
|
|
@@ -153,7 +155,7 @@ function DropdownMenuLabel({
|
|
|
153
155
|
inset,
|
|
154
156
|
...props
|
|
155
157
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
156
|
-
inset?: boolean
|
|
158
|
+
inset?: boolean;
|
|
157
159
|
}) {
|
|
158
160
|
return (
|
|
159
161
|
<DropdownMenuPrimitive.Label
|
|
@@ -161,11 +163,11 @@ function DropdownMenuLabel({
|
|
|
161
163
|
data-inset={inset}
|
|
162
164
|
className={cn(
|
|
163
165
|
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
164
|
-
className
|
|
166
|
+
className,
|
|
165
167
|
)}
|
|
166
168
|
{...props}
|
|
167
169
|
/>
|
|
168
|
-
)
|
|
170
|
+
);
|
|
169
171
|
}
|
|
170
172
|
|
|
171
173
|
function DropdownMenuSeparator({
|
|
@@ -178,7 +180,7 @@ function DropdownMenuSeparator({
|
|
|
178
180
|
className={cn("bg-border -mx-1 my-1 h-px", className)}
|
|
179
181
|
{...props}
|
|
180
182
|
/>
|
|
181
|
-
)
|
|
183
|
+
);
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
function DropdownMenuShortcut({
|
|
@@ -190,17 +192,17 @@ function DropdownMenuShortcut({
|
|
|
190
192
|
data-slot="dropdown-menu-shortcut"
|
|
191
193
|
className={cn(
|
|
192
194
|
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
193
|
-
className
|
|
195
|
+
className,
|
|
194
196
|
)}
|
|
195
197
|
{...props}
|
|
196
198
|
/>
|
|
197
|
-
)
|
|
199
|
+
);
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
function DropdownMenuSub({
|
|
201
203
|
...props
|
|
202
204
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
|
|
203
|
-
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props}
|
|
205
|
+
return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
function DropdownMenuSubTrigger({
|
|
@@ -209,7 +211,7 @@ function DropdownMenuSubTrigger({
|
|
|
209
211
|
children,
|
|
210
212
|
...props
|
|
211
213
|
}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
212
|
-
inset?: boolean
|
|
214
|
+
inset?: boolean;
|
|
213
215
|
}) {
|
|
214
216
|
return (
|
|
215
217
|
<DropdownMenuPrimitive.SubTrigger
|
|
@@ -217,14 +219,14 @@ function DropdownMenuSubTrigger({
|
|
|
217
219
|
data-inset={inset}
|
|
218
220
|
className={cn(
|
|
219
221
|
"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
|
|
222
|
+
className,
|
|
221
223
|
)}
|
|
222
224
|
{...props}
|
|
223
225
|
>
|
|
224
226
|
{children}
|
|
225
227
|
<ChevronRightIcon className="ml-auto size-4" />
|
|
226
228
|
</DropdownMenuPrimitive.SubTrigger>
|
|
227
|
-
)
|
|
229
|
+
);
|
|
228
230
|
}
|
|
229
231
|
|
|
230
232
|
function DropdownMenuSubContent({
|
|
@@ -236,11 +238,11 @@ function DropdownMenuSubContent({
|
|
|
236
238
|
data-slot="dropdown-menu-sub-content"
|
|
237
239
|
className={cn(
|
|
238
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",
|
|
239
|
-
className
|
|
241
|
+
className,
|
|
240
242
|
)}
|
|
241
243
|
{...props}
|
|
242
244
|
/>
|
|
243
|
-
)
|
|
245
|
+
);
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
export {
|
|
@@ -259,4 +261,4 @@ export {
|
|
|
259
261
|
DropdownMenuSub,
|
|
260
262
|
DropdownMenuSubTrigger,
|
|
261
263
|
DropdownMenuSubContent,
|
|
262
|
-
}
|
|
264
|
+
};
|
|
@@ -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 "@authdog/react-elements/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 "@authdog/react-elements/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 "@authdog/react-elements/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 };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as SheetPrimitive from "@radix-ui/react-dialog"
|
|
5
|
-
import { X } from "lucide-react"
|
|
6
|
-
import type { ComponentType } from "react"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
import type { ComponentType } from "react";
|
|
7
7
|
|
|
8
|
-
import { cn } from "@authdog/react-elements/lib/utils"
|
|
8
|
+
import { cn } from "@authdog/react-elements/lib/utils";
|
|
9
9
|
|
|
10
|
-
const XIcon = X as ComponentType<React.SVGProps<SVGSVGElement
|
|
10
|
+
const XIcon = X as ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
11
11
|
|
|
12
12
|
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
13
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props}
|
|
13
|
+
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
function SheetTrigger({
|
|
17
17
|
...props
|
|
18
18
|
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
19
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props}
|
|
19
|
+
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
function SheetClose({
|
|
23
23
|
...props
|
|
24
24
|
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
25
|
-
return <SheetPrimitive.Close data-slot="sheet-close" {...props}
|
|
25
|
+
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function SheetPortal({
|
|
29
29
|
...props
|
|
30
30
|
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
31
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props}
|
|
31
|
+
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function SheetOverlay({
|
|
@@ -40,11 +40,11 @@ function SheetOverlay({
|
|
|
40
40
|
data-slot="sheet-overlay"
|
|
41
41
|
className={cn(
|
|
42
42
|
"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",
|
|
43
|
-
className
|
|
43
|
+
className,
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|
|
47
|
-
)
|
|
47
|
+
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function SheetContent({
|
|
@@ -53,7 +53,7 @@ function SheetContent({
|
|
|
53
53
|
side = "right",
|
|
54
54
|
...props
|
|
55
55
|
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
56
|
-
side?: "top" | "right" | "bottom" | "left"
|
|
56
|
+
side?: "top" | "right" | "bottom" | "left";
|
|
57
57
|
}) {
|
|
58
58
|
return (
|
|
59
59
|
<SheetPortal>
|
|
@@ -70,7 +70,7 @@ function SheetContent({
|
|
|
70
70
|
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
71
71
|
side === "bottom" &&
|
|
72
72
|
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
73
|
-
className
|
|
73
|
+
className,
|
|
74
74
|
)}
|
|
75
75
|
{...props}
|
|
76
76
|
>
|
|
@@ -81,7 +81,7 @@ function SheetContent({
|
|
|
81
81
|
</SheetPrimitive.Close>
|
|
82
82
|
</SheetPrimitive.Content>
|
|
83
83
|
</SheetPortal>
|
|
84
|
-
)
|
|
84
|
+
);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -91,7 +91,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
91
91
|
className={cn("flex flex-col gap-1.5 p-4", className)}
|
|
92
92
|
{...props}
|
|
93
93
|
/>
|
|
94
|
-
)
|
|
94
|
+
);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -101,7 +101,7 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
101
101
|
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
102
102
|
{...props}
|
|
103
103
|
/>
|
|
104
|
-
)
|
|
104
|
+
);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
function SheetTitle({
|
|
@@ -114,7 +114,7 @@ function SheetTitle({
|
|
|
114
114
|
className={cn("text-foreground font-semibold", className)}
|
|
115
115
|
{...props}
|
|
116
116
|
/>
|
|
117
|
-
)
|
|
117
|
+
);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
function SheetDescription({
|
|
@@ -127,7 +127,7 @@ function SheetDescription({
|
|
|
127
127
|
className={cn("text-muted-foreground text-sm", className)}
|
|
128
128
|
{...props}
|
|
129
129
|
/>
|
|
130
|
-
)
|
|
130
|
+
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export {
|
|
@@ -139,4 +139,4 @@ export {
|
|
|
139
139
|
SheetFooter,
|
|
140
140
|
SheetTitle,
|
|
141
141
|
SheetDescription,
|
|
142
|
-
}
|
|
142
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {Button} from "./components/ui/button";
|
|
1
|
+
export { Button } from "./components/ui/button";
|
|
2
2
|
export { ClientOnly } from "./components/core/client-only";
|
|
3
|
-
export {Navbar} from "./components/core/navbar";
|
|
4
|
-
export {UserProfile} from "./components/core/user-profile";
|
|
5
|
-
export {UserDropdown} from "./components/core/user-dropdown";
|
|
6
|
-
export {PlaceholderAlert} from "./components/core/placeholder-alert";
|
|
7
|
-
export {TOTPValidator} from "./components/flow/totp-validator";
|
|
3
|
+
export { Navbar } from "./components/core/navbar";
|
|
4
|
+
export { UserProfile } from "./components/core/user-profile";
|
|
5
|
+
export { UserDropdown } from "./components/core/user-dropdown";
|
|
6
|
+
export { PlaceholderAlert } from "./components/core/placeholder-alert";
|
|
7
|
+
export { TOTPValidator } from "./components/flow/totp-validator";
|
package/src/main.tsx
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./global.css";
|
|
3
3
|
|
|
4
4
|
// This is the main entry point for Ladle
|
|
5
5
|
export default function Main({ children }: { children: React.ReactNode }) {
|
|
6
6
|
return (
|
|
7
|
-
<div className="min-h-screen bg-background text-foreground">
|
|
8
|
-
{children}
|
|
9
|
-
</div>
|
|
7
|
+
<div className="min-h-screen bg-background text-foreground">{children}</div>
|
|
10
8
|
);
|
|
11
|
-
}
|
|
9
|
+
}
|
package/src/preview.tsx
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./global.css";
|
|
3
3
|
|
|
4
4
|
// This is the preview component for Ladle
|
|
5
5
|
export default function Preview({ children }: { children: React.ReactNode }) {
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
{children}
|
|
9
|
-
</div>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
6
|
+
return <div className="ladle-main">{children}</div>;
|
|
7
|
+
}
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import type { Story } from
|
|
2
|
-
import { Button } from
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Button } from "../components/ui/button";
|
|
3
3
|
import "../global.css";
|
|
4
4
|
|
|
5
5
|
export const Default: Story = () => <Button>Click me</Button>;
|
|
6
|
-
Default.storyName =
|
|
6
|
+
Default.storyName = "Default Button";
|
|
7
7
|
|
|
8
8
|
export const Primary: Story = () => <Button variant="default">Primary</Button>;
|
|
9
|
-
Primary.storyName =
|
|
9
|
+
Primary.storyName = "Primary Button";
|
|
10
10
|
|
|
11
|
-
export const Secondary: Story = () =>
|
|
12
|
-
|
|
11
|
+
export const Secondary: Story = () => (
|
|
12
|
+
<Button variant="secondary">Secondary</Button>
|
|
13
|
+
);
|
|
14
|
+
Secondary.storyName = "Secondary Button";
|
|
13
15
|
|
|
14
|
-
export const Destructive: Story = () =>
|
|
15
|
-
|
|
16
|
+
export const Destructive: Story = () => (
|
|
17
|
+
<Button variant="destructive">Delete</Button>
|
|
18
|
+
);
|
|
19
|
+
Destructive.storyName = "Destructive Button";
|
|
16
20
|
|
|
17
21
|
export const Outline: Story = () => <Button variant="outline">Outline</Button>;
|
|
18
|
-
Outline.storyName =
|
|
22
|
+
Outline.storyName = "Outline Button";
|
|
19
23
|
|
|
20
24
|
export const Ghost: Story = () => <Button variant="ghost">Ghost</Button>;
|
|
21
|
-
Ghost.storyName =
|
|
25
|
+
Ghost.storyName = "Ghost Button";
|
|
22
26
|
|
|
23
27
|
export const Link: Story = () => <Button variant="link">Link</Button>;
|
|
24
|
-
Link.storyName =
|
|
28
|
+
Link.storyName = "Link Button";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// import { useState, useEffect } from "react"
|
|
2
|
-
import type { Story } from "@ladle/react"
|
|
3
|
-
import { LoginForm } from "../components/flow/login"
|
|
4
|
-
import "../global.css"
|
|
2
|
+
import type { Story } from "@ladle/react";
|
|
3
|
+
import { LoginForm } from "../components/flow/login";
|
|
4
|
+
import "../global.css";
|
|
5
5
|
|
|
6
|
-
export const Default: Story = () => <LoginForm
|
|
7
|
-
Default.storyName = "Default Login Form"
|
|
6
|
+
export const Default: Story = () => <LoginForm />;
|
|
7
|
+
Default.storyName = "Default Login Form";
|
|
8
8
|
|
|
9
9
|
// export const Loading: Story = () => {
|
|
10
10
|
// const [isLoading, setIsLoading] = useState(true)
|
|
@@ -26,4 +26,4 @@ Default.storyName = "Default Login Form"
|
|
|
26
26
|
// const [email, setEmail] = useState("user@example.com")
|
|
27
27
|
// return <LoginForm />
|
|
28
28
|
// }
|
|
29
|
-
// WithPrefilledEmail.storyName = "With Pre-filled Email"
|
|
29
|
+
// WithPrefilledEmail.storyName = "With Pre-filled Email"
|
|
@@ -1,28 +1,66 @@
|
|
|
1
|
-
import type { Story } from
|
|
2
|
-
import { Navbar } from "../components/core/navbar"
|
|
3
|
-
import { Button } from "../components/ui/button"
|
|
4
|
-
import "../global.css"
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { Navbar } from "../components/core/navbar";
|
|
3
|
+
import { Button } from "../components/ui/button";
|
|
4
|
+
import "../global.css";
|
|
5
5
|
|
|
6
6
|
export const Default: Story = () => <Navbar logoText="Authdog" />;
|
|
7
|
-
Default.storyName =
|
|
7
|
+
Default.storyName = "Default Navbar";
|
|
8
8
|
|
|
9
|
-
export const CustomNavigation: Story = () =>
|
|
9
|
+
export const CustomNavigation: Story = () => (
|
|
10
|
+
<Navbar
|
|
10
11
|
logoText="Authdog"
|
|
11
|
-
items={[
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
items={[
|
|
13
|
+
{ title: "Home", href: "/" },
|
|
14
|
+
{ title: "Features", href: "/features" },
|
|
15
|
+
{ title: "Pricing", href: "/pricing" },
|
|
16
|
+
{ title: "Contact", href: "/contact" },
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
14
20
|
|
|
21
|
+
CustomNavigation.storyName = "Custom Navigation";
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
export const CustomUser: Story = () => (
|
|
24
|
+
<Navbar
|
|
25
|
+
logoText="Authdog"
|
|
26
|
+
user={{
|
|
27
|
+
name: "Jane Smith",
|
|
28
|
+
email: "jane@Authdog.com",
|
|
29
|
+
image: "https://github.com/shadcn.png",
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
CustomUser.storyName = "Custom User";
|
|
20
34
|
|
|
21
|
-
export const WithChildren: Story = () =>
|
|
22
|
-
|
|
35
|
+
export const WithChildren: Story = () => (
|
|
36
|
+
<Navbar
|
|
37
|
+
logoText="Authdog"
|
|
38
|
+
children={
|
|
39
|
+
<Button variant="outline" size="sm">
|
|
40
|
+
Get Started
|
|
41
|
+
</Button>
|
|
42
|
+
}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
WithChildren.storyName = "With Children";
|
|
23
46
|
|
|
24
|
-
export const CustomStyling: Story = () =>
|
|
25
|
-
|
|
47
|
+
export const CustomStyling: Story = () => (
|
|
48
|
+
<Navbar
|
|
49
|
+
logoText="Authdog"
|
|
50
|
+
className="bg-gradient-to-r from-blue-500 to-purple-500 text-white"
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
CustomStyling.storyName = "Custom Styling";
|
|
26
54
|
|
|
27
|
-
export const WithDisabledItems: Story = () =>
|
|
28
|
-
|
|
55
|
+
export const WithDisabledItems: Story = () => (
|
|
56
|
+
<Navbar
|
|
57
|
+
logoText="Authdog"
|
|
58
|
+
items={[
|
|
59
|
+
{ title: "Dashboard", href: "/dashboard" },
|
|
60
|
+
{ title: "Projects", href: "/projects" },
|
|
61
|
+
{ title: "Team", href: "/team", disabled: true },
|
|
62
|
+
{ title: "Reports", href: "/reports", disabled: true },
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
WithDisabledItems.storyName = "With Disabled Items";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Story } from
|
|
2
|
-
import { PlaceholderAlert } from "../components/core/placeholder-alert"
|
|
3
|
-
import "../global.css"
|
|
1
|
+
import type { Story } from "@ladle/react";
|
|
2
|
+
import { PlaceholderAlert } from "../components/core/placeholder-alert";
|
|
3
|
+
import "../global.css";
|
|
4
4
|
|
|
5
5
|
export const Default: Story = () => <PlaceholderAlert />;
|
|
6
|
-
Default.storyName =
|
|
6
|
+
Default.storyName = "Default Placeholder Alert";
|
|
7
7
|
export const CustomTitleAndDescription: Story = () => (
|
|
8
|
-
<PlaceholderAlert
|
|
9
|
-
title="Custom Alert Title"
|
|
10
|
-
description="This is a custom description for the placeholder alert."
|
|
8
|
+
<PlaceholderAlert
|
|
9
|
+
title="Custom Alert Title"
|
|
10
|
+
description="This is a custom description for the placeholder alert."
|
|
11
11
|
/>
|
|
12
12
|
);
|
|
13
|
-
CustomTitleAndDescription.storyName =
|
|
13
|
+
CustomTitleAndDescription.storyName = "Custom Title and Description";
|