ar-saas 0.3.1 → 0.3.2
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/LICENSE +21 -21
- package/README.md +338 -314
- package/dist/cli.js +19 -0
- package/dist/generator.js +166 -55
- package/package.json +52 -50
- package/templates/backend/.env.example +67 -67
- package/templates/backend/.prettierrc +4 -4
- package/templates/backend/README.md +249 -168
- package/templates/backend/eslint.config.mjs +35 -35
- package/templates/backend/nest-cli.json +8 -8
- package/templates/backend/package-lock.json +10979 -10979
- package/templates/backend/package.json +88 -88
- package/templates/backend/src/app.controller.spec.ts +24 -24
- package/templates/backend/src/app.controller.ts +15 -15
- package/templates/backend/src/app.module.ts +40 -40
- package/templates/backend/src/app.service.ts +11 -11
- package/templates/backend/src/common/base/base.repository.ts +221 -221
- package/templates/backend/src/common/base/base.schema.ts +24 -24
- package/templates/backend/src/common/decorators/cookie.decorator.ts +9 -9
- package/templates/backend/src/common/decorators/current-user.decorator.ts +20 -20
- package/templates/backend/src/common/decorators/workspace-id.decorator.ts +14 -14
- package/templates/backend/src/common/filters/global-exception.filter.ts +61 -61
- package/templates/backend/src/common/guards/jwt-auth.guard.ts +5 -5
- package/templates/backend/src/common/interceptors/workspace-tenant.interceptor.ts +45 -45
- package/templates/backend/src/main.ts +51 -51
- package/templates/backend/src/modules/auth/auth.controller.ts +158 -158
- package/templates/backend/src/modules/auth/auth.module.ts +20 -20
- package/templates/backend/src/modules/auth/auth.service.ts +257 -257
- package/templates/backend/src/modules/auth/dto/forgot-password.dto.ts +9 -9
- package/templates/backend/src/modules/auth/dto/login.dto.ts +14 -14
- package/templates/backend/src/modules/auth/dto/refresh-token.dto.ts +12 -12
- package/templates/backend/src/modules/auth/dto/register.dto.ts +26 -26
- package/templates/backend/src/modules/auth/dto/reset-password.dto.ts +16 -16
- package/templates/backend/src/modules/auth/dto/verify-email.dto.ts +9 -9
- package/templates/backend/src/modules/auth/strategies/jwt.strategy.ts +43 -43
- package/templates/backend/src/modules/mail/mail.module.ts +9 -9
- package/templates/backend/src/modules/mail/mail.service.ts +141 -141
- package/templates/backend/src/modules/users/schemas/user.schema.ts +54 -54
- package/templates/backend/src/modules/users/users.module.ts +14 -14
- package/templates/backend/src/modules/users/users.repository.ts +51 -51
- package/templates/backend/src/modules/users/users.service.ts +104 -104
- package/templates/backend/src/modules/workspaces/schemas/workspace.schema.ts +26 -26
- package/templates/backend/src/modules/workspaces/workspaces.module.ts +16 -16
- package/templates/backend/src/modules/workspaces/workspaces.repository.ts +34 -34
- package/templates/backend/src/modules/workspaces/workspaces.service.ts +42 -42
- package/templates/backend/test/app.e2e-spec.ts +25 -25
- package/templates/backend/test/jest-e2e.json +9 -9
- package/templates/backend/tsconfig.build.json +4 -4
- package/templates/backend/tsconfig.json +26 -26
- package/templates/frontend/.env.local.example +1 -1
- package/templates/frontend/README.md +152 -0
- package/templates/frontend/components.json +20 -20
- package/templates/frontend/eslint.config.mjs +14 -14
- package/templates/frontend/next.config.ts +5 -5
- package/templates/frontend/package-lock.json +6722 -6722
- package/templates/frontend/package.json +48 -48
- package/templates/frontend/pnpm-lock.yaml +5012 -5012
- package/templates/frontend/pnpm-workspace.yaml +3 -3
- package/templates/frontend/postcss.config.mjs +7 -7
- package/templates/frontend/src/app/(auth)/forgot-password/page.tsx +84 -84
- package/templates/frontend/src/app/(auth)/layout.tsx +28 -28
- package/templates/frontend/src/app/(auth)/login/page.tsx +111 -111
- package/templates/frontend/src/app/(auth)/register/page.tsx +161 -161
- package/templates/frontend/src/app/(auth)/reset-password/page.tsx +120 -120
- package/templates/frontend/src/app/(auth)/verify-email/page.tsx +78 -78
- package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -111
- package/templates/frontend/src/app/(dashboard)/dashboard/page.tsx +105 -105
- package/templates/frontend/src/app/(dashboard)/layout.tsx +38 -38
- package/templates/frontend/src/app/(dashboard)/profile/page.tsx +226 -226
- package/templates/frontend/src/app/(dashboard)/settings/page.tsx +156 -156
- package/templates/frontend/src/app/(dashboard)/team/page.tsx +178 -178
- package/templates/frontend/src/app/(legal)/privacy/page.tsx +127 -127
- package/templates/frontend/src/app/(legal)/terms/page.tsx +118 -118
- package/templates/frontend/src/app/globals.css +81 -81
- package/templates/frontend/src/app/layout.tsx +26 -26
- package/templates/frontend/src/app/page.tsx +5 -45
- package/templates/frontend/src/app/setup/page.tsx +371 -275
- package/templates/frontend/src/components/dashboard/header.tsx +89 -89
- package/templates/frontend/src/components/dashboard/sidebar.tsx +71 -71
- package/templates/frontend/src/components/dashboard/stat-card.tsx +34 -34
- package/templates/frontend/src/components/landing/faq.tsx +39 -39
- package/templates/frontend/src/components/landing/features.tsx +54 -54
- package/templates/frontend/src/components/landing/footer.tsx +76 -76
- package/templates/frontend/src/components/landing/hero.tsx +72 -72
- package/templates/frontend/src/components/landing/navbar.tsx +78 -78
- package/templates/frontend/src/components/landing/pricing.tsx +90 -90
- package/templates/frontend/src/components/ui/accordion.tsx +52 -52
- package/templates/frontend/src/components/ui/avatar.tsx +46 -46
- package/templates/frontend/src/components/ui/badge.tsx +30 -30
- package/templates/frontend/src/components/ui/button.tsx +52 -52
- package/templates/frontend/src/components/ui/card.tsx +50 -50
- package/templates/frontend/src/components/ui/checkbox.tsx +27 -27
- package/templates/frontend/src/components/ui/dialog.tsx +100 -100
- package/templates/frontend/src/components/ui/dropdown-menu.tsx +173 -173
- package/templates/frontend/src/components/ui/form.tsx +158 -158
- package/templates/frontend/src/components/ui/input.tsx +21 -21
- package/templates/frontend/src/components/ui/label.tsx +22 -22
- package/templates/frontend/src/components/ui/separator.tsx +25 -25
- package/templates/frontend/src/components/ui/skeleton.tsx +7 -7
- package/templates/frontend/src/components/ui/switch.tsx +28 -28
- package/templates/frontend/src/components/ui/tabs.tsx +54 -54
- package/templates/frontend/src/components/ui/textarea.tsx +20 -20
- package/templates/frontend/src/components/ui/toast.tsx +109 -109
- package/templates/frontend/src/components/ui/toaster.tsx +30 -30
- package/templates/frontend/src/config/site.ts +197 -197
- package/templates/frontend/src/hooks/use-toast.ts +116 -116
- package/templates/frontend/src/lib/api/auth.ts +39 -39
- package/templates/frontend/src/lib/api/client.ts +66 -66
- package/templates/frontend/src/lib/hooks/use-auth.ts +1 -1
- package/templates/frontend/src/lib/utils.ts +6 -6
- package/templates/frontend/src/providers/auth-provider.tsx +60 -60
- package/templates/frontend/src/types/api.ts +12 -12
- package/templates/frontend/src/types/auth.ts +27 -27
- package/templates/frontend/tsconfig.json +23 -23
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
5
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
6
|
-
import {
|
|
7
|
-
Controller,
|
|
8
|
-
FormProvider,
|
|
9
|
-
useFormContext,
|
|
10
|
-
type ControllerProps,
|
|
11
|
-
type FieldPath,
|
|
12
|
-
type FieldValues,
|
|
13
|
-
} from 'react-hook-form'
|
|
14
|
-
import { cn } from '@/lib/utils'
|
|
15
|
-
import { Label } from '@/components/ui/label'
|
|
16
|
-
|
|
17
|
-
const Form = FormProvider
|
|
18
|
-
|
|
19
|
-
type FormFieldContextValue<
|
|
20
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
21
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
22
|
-
> = { name: TName }
|
|
23
|
-
|
|
24
|
-
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)
|
|
25
|
-
|
|
26
|
-
const FormField = <
|
|
27
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
28
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
29
|
-
>({
|
|
30
|
-
...props
|
|
31
|
-
}: ControllerProps<TFieldValues, TName>) => {
|
|
32
|
-
return (
|
|
33
|
-
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
34
|
-
<Controller {...props} />
|
|
35
|
-
</FormFieldContext.Provider>
|
|
36
|
-
)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const useFormField = () => {
|
|
40
|
-
const fieldContext = React.useContext(FormFieldContext)
|
|
41
|
-
const itemContext = React.useContext(FormItemContext)
|
|
42
|
-
const { getFieldState, formState } = useFormContext()
|
|
43
|
-
|
|
44
|
-
const fieldState = getFieldState(fieldContext.name, formState)
|
|
45
|
-
|
|
46
|
-
if (!fieldContext) {
|
|
47
|
-
throw new Error('useFormField debe usarse dentro de <FormField>')
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const { id } = itemContext
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
id,
|
|
54
|
-
name: fieldContext.name,
|
|
55
|
-
formItemId: `${id}-form-item`,
|
|
56
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
57
|
-
formMessageId: `${id}-form-item-message`,
|
|
58
|
-
...fieldState,
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
type FormItemContextValue = { id: string }
|
|
63
|
-
|
|
64
|
-
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)
|
|
65
|
-
|
|
66
|
-
const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
67
|
-
({ className, ...props }, ref) => {
|
|
68
|
-
const id = React.useId()
|
|
69
|
-
return (
|
|
70
|
-
<FormItemContext.Provider value={{ id }}>
|
|
71
|
-
<div ref={ref} className={cn('space-y-2', className)} {...props} />
|
|
72
|
-
</FormItemContext.Provider>
|
|
73
|
-
)
|
|
74
|
-
},
|
|
75
|
-
)
|
|
76
|
-
FormItem.displayName = 'FormItem'
|
|
77
|
-
|
|
78
|
-
const FormLabel = React.forwardRef<
|
|
79
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
80
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
81
|
-
>(({ className, ...props }, ref) => {
|
|
82
|
-
const { error, formItemId } = useFormField()
|
|
83
|
-
return (
|
|
84
|
-
<Label
|
|
85
|
-
ref={ref}
|
|
86
|
-
className={cn(error && 'text-destructive', className)}
|
|
87
|
-
htmlFor={formItemId}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
)
|
|
91
|
-
})
|
|
92
|
-
FormLabel.displayName = 'FormLabel'
|
|
93
|
-
|
|
94
|
-
const FormControl = React.forwardRef<
|
|
95
|
-
React.ElementRef<typeof Slot>,
|
|
96
|
-
React.ComponentPropsWithoutRef<typeof Slot>
|
|
97
|
-
>(({ ...props }, ref) => {
|
|
98
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
99
|
-
return (
|
|
100
|
-
<Slot
|
|
101
|
-
ref={ref}
|
|
102
|
-
id={formItemId}
|
|
103
|
-
aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}
|
|
104
|
-
aria-invalid={!!error}
|
|
105
|
-
{...props}
|
|
106
|
-
/>
|
|
107
|
-
)
|
|
108
|
-
})
|
|
109
|
-
FormControl.displayName = 'FormControl'
|
|
110
|
-
|
|
111
|
-
const FormDescription = React.forwardRef<
|
|
112
|
-
HTMLParagraphElement,
|
|
113
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
114
|
-
>(({ className, ...props }, ref) => {
|
|
115
|
-
const { formDescriptionId } = useFormField()
|
|
116
|
-
return (
|
|
117
|
-
<p
|
|
118
|
-
ref={ref}
|
|
119
|
-
id={formDescriptionId}
|
|
120
|
-
className={cn('text-[0.8rem] text-muted-foreground', className)}
|
|
121
|
-
{...props}
|
|
122
|
-
/>
|
|
123
|
-
)
|
|
124
|
-
})
|
|
125
|
-
FormDescription.displayName = 'FormDescription'
|
|
126
|
-
|
|
127
|
-
const FormMessage = React.forwardRef<
|
|
128
|
-
HTMLParagraphElement,
|
|
129
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
130
|
-
>(({ className, children, ...props }, ref) => {
|
|
131
|
-
const { error, formMessageId } = useFormField()
|
|
132
|
-
const body = error ? String(error?.message) : children
|
|
133
|
-
|
|
134
|
-
if (!body) return null
|
|
135
|
-
|
|
136
|
-
return (
|
|
137
|
-
<p
|
|
138
|
-
ref={ref}
|
|
139
|
-
id={formMessageId}
|
|
140
|
-
className={cn('text-[0.8rem] font-medium text-destructive', className)}
|
|
141
|
-
{...props}
|
|
142
|
-
>
|
|
143
|
-
{body}
|
|
144
|
-
</p>
|
|
145
|
-
)
|
|
146
|
-
})
|
|
147
|
-
FormMessage.displayName = 'FormMessage'
|
|
148
|
-
|
|
149
|
-
export {
|
|
150
|
-
useFormField,
|
|
151
|
-
Form,
|
|
152
|
-
FormItem,
|
|
153
|
-
FormLabel,
|
|
154
|
-
FormControl,
|
|
155
|
-
FormDescription,
|
|
156
|
-
FormMessage,
|
|
157
|
-
FormField,
|
|
158
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
5
|
+
import { Slot } from '@radix-ui/react-slot'
|
|
6
|
+
import {
|
|
7
|
+
Controller,
|
|
8
|
+
FormProvider,
|
|
9
|
+
useFormContext,
|
|
10
|
+
type ControllerProps,
|
|
11
|
+
type FieldPath,
|
|
12
|
+
type FieldValues,
|
|
13
|
+
} from 'react-hook-form'
|
|
14
|
+
import { cn } from '@/lib/utils'
|
|
15
|
+
import { Label } from '@/components/ui/label'
|
|
16
|
+
|
|
17
|
+
const Form = FormProvider
|
|
18
|
+
|
|
19
|
+
type FormFieldContextValue<
|
|
20
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
21
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
22
|
+
> = { name: TName }
|
|
23
|
+
|
|
24
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)
|
|
25
|
+
|
|
26
|
+
const FormField = <
|
|
27
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
28
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
29
|
+
>({
|
|
30
|
+
...props
|
|
31
|
+
}: ControllerProps<TFieldValues, TName>) => {
|
|
32
|
+
return (
|
|
33
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
34
|
+
<Controller {...props} />
|
|
35
|
+
</FormFieldContext.Provider>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const useFormField = () => {
|
|
40
|
+
const fieldContext = React.useContext(FormFieldContext)
|
|
41
|
+
const itemContext = React.useContext(FormItemContext)
|
|
42
|
+
const { getFieldState, formState } = useFormContext()
|
|
43
|
+
|
|
44
|
+
const fieldState = getFieldState(fieldContext.name, formState)
|
|
45
|
+
|
|
46
|
+
if (!fieldContext) {
|
|
47
|
+
throw new Error('useFormField debe usarse dentro de <FormField>')
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const { id } = itemContext
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
id,
|
|
54
|
+
name: fieldContext.name,
|
|
55
|
+
formItemId: `${id}-form-item`,
|
|
56
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
57
|
+
formMessageId: `${id}-form-item-message`,
|
|
58
|
+
...fieldState,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type FormItemContextValue = { id: string }
|
|
63
|
+
|
|
64
|
+
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)
|
|
65
|
+
|
|
66
|
+
const FormItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
67
|
+
({ className, ...props }, ref) => {
|
|
68
|
+
const id = React.useId()
|
|
69
|
+
return (
|
|
70
|
+
<FormItemContext.Provider value={{ id }}>
|
|
71
|
+
<div ref={ref} className={cn('space-y-2', className)} {...props} />
|
|
72
|
+
</FormItemContext.Provider>
|
|
73
|
+
)
|
|
74
|
+
},
|
|
75
|
+
)
|
|
76
|
+
FormItem.displayName = 'FormItem'
|
|
77
|
+
|
|
78
|
+
const FormLabel = React.forwardRef<
|
|
79
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
80
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
81
|
+
>(({ className, ...props }, ref) => {
|
|
82
|
+
const { error, formItemId } = useFormField()
|
|
83
|
+
return (
|
|
84
|
+
<Label
|
|
85
|
+
ref={ref}
|
|
86
|
+
className={cn(error && 'text-destructive', className)}
|
|
87
|
+
htmlFor={formItemId}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
})
|
|
92
|
+
FormLabel.displayName = 'FormLabel'
|
|
93
|
+
|
|
94
|
+
const FormControl = React.forwardRef<
|
|
95
|
+
React.ElementRef<typeof Slot>,
|
|
96
|
+
React.ComponentPropsWithoutRef<typeof Slot>
|
|
97
|
+
>(({ ...props }, ref) => {
|
|
98
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
99
|
+
return (
|
|
100
|
+
<Slot
|
|
101
|
+
ref={ref}
|
|
102
|
+
id={formItemId}
|
|
103
|
+
aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}
|
|
104
|
+
aria-invalid={!!error}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
})
|
|
109
|
+
FormControl.displayName = 'FormControl'
|
|
110
|
+
|
|
111
|
+
const FormDescription = React.forwardRef<
|
|
112
|
+
HTMLParagraphElement,
|
|
113
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
114
|
+
>(({ className, ...props }, ref) => {
|
|
115
|
+
const { formDescriptionId } = useFormField()
|
|
116
|
+
return (
|
|
117
|
+
<p
|
|
118
|
+
ref={ref}
|
|
119
|
+
id={formDescriptionId}
|
|
120
|
+
className={cn('text-[0.8rem] text-muted-foreground', className)}
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
})
|
|
125
|
+
FormDescription.displayName = 'FormDescription'
|
|
126
|
+
|
|
127
|
+
const FormMessage = React.forwardRef<
|
|
128
|
+
HTMLParagraphElement,
|
|
129
|
+
React.HTMLAttributes<HTMLParagraphElement>
|
|
130
|
+
>(({ className, children, ...props }, ref) => {
|
|
131
|
+
const { error, formMessageId } = useFormField()
|
|
132
|
+
const body = error ? String(error?.message) : children
|
|
133
|
+
|
|
134
|
+
if (!body) return null
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
<p
|
|
138
|
+
ref={ref}
|
|
139
|
+
id={formMessageId}
|
|
140
|
+
className={cn('text-[0.8rem] font-medium text-destructive', className)}
|
|
141
|
+
{...props}
|
|
142
|
+
>
|
|
143
|
+
{body}
|
|
144
|
+
</p>
|
|
145
|
+
)
|
|
146
|
+
})
|
|
147
|
+
FormMessage.displayName = 'FormMessage'
|
|
148
|
+
|
|
149
|
+
export {
|
|
150
|
+
useFormField,
|
|
151
|
+
Form,
|
|
152
|
+
FormItem,
|
|
153
|
+
FormLabel,
|
|
154
|
+
FormControl,
|
|
155
|
+
FormDescription,
|
|
156
|
+
FormMessage,
|
|
157
|
+
FormField,
|
|
158
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { cn } from '@/lib/utils'
|
|
3
|
-
|
|
4
|
-
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
|
5
|
-
({ className, type, ...props }, ref) => {
|
|
6
|
-
return (
|
|
7
|
-
<input
|
|
8
|
-
type={type}
|
|
9
|
-
className={cn(
|
|
10
|
-
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
11
|
-
className,
|
|
12
|
-
)}
|
|
13
|
-
ref={ref}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
)
|
|
17
|
-
},
|
|
18
|
-
)
|
|
19
|
-
Input.displayName = 'Input'
|
|
20
|
-
|
|
21
|
-
export { Input }
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
|
|
5
|
+
({ className, type, ...props }, ref) => {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
className={cn(
|
|
10
|
+
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
11
|
+
className,
|
|
12
|
+
)}
|
|
13
|
+
ref={ref}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
)
|
|
17
|
+
},
|
|
18
|
+
)
|
|
19
|
+
Input.displayName = 'Input'
|
|
20
|
+
|
|
21
|
+
export { Input }
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
const Label = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
11
|
-
<LabelPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
className={cn(
|
|
14
|
-
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
15
|
-
className,
|
|
16
|
-
)}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
))
|
|
20
|
-
Label.displayName = LabelPrimitive.Root.displayName
|
|
21
|
-
|
|
22
|
-
export { Label }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as LabelPrimitive from '@radix-ui/react-label'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Label = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof LabelPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<LabelPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
))
|
|
20
|
+
Label.displayName = LabelPrimitive.Root.displayName
|
|
21
|
+
|
|
22
|
+
export { Label }
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
const Separator = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
10
|
-
>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
11
|
-
<SeparatorPrimitive.Root
|
|
12
|
-
ref={ref}
|
|
13
|
-
decorative={decorative}
|
|
14
|
-
orientation={orientation}
|
|
15
|
-
className={cn(
|
|
16
|
-
'shrink-0 bg-border',
|
|
17
|
-
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...props}
|
|
21
|
-
/>
|
|
22
|
-
))
|
|
23
|
-
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
24
|
-
|
|
25
|
-
export { Separator }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Separator = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
|
10
|
+
>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (
|
|
11
|
+
<SeparatorPrimitive.Root
|
|
12
|
+
ref={ref}
|
|
13
|
+
decorative={decorative}
|
|
14
|
+
orientation={orientation}
|
|
15
|
+
className={cn(
|
|
16
|
+
'shrink-0 bg-border',
|
|
17
|
+
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
))
|
|
23
|
+
Separator.displayName = SeparatorPrimitive.Root.displayName
|
|
24
|
+
|
|
25
|
+
export { Separator }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { cn } from '@/lib/utils'
|
|
2
|
-
|
|
3
|
-
function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
4
|
-
return <div className={cn('animate-pulse rounded-md bg-muted', className)} {...props} />
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export { Skeleton }
|
|
1
|
+
import { cn } from '@/lib/utils'
|
|
2
|
+
|
|
3
|
+
function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {
|
|
4
|
+
return <div className={cn('animate-pulse rounded-md bg-muted', className)} {...props} />
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { Skeleton }
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as SwitchPrimitive from '@radix-ui/react-switch'
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
const Switch = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof SwitchPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => (
|
|
11
|
-
<SwitchPrimitive.Root
|
|
12
|
-
className={cn(
|
|
13
|
-
'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
14
|
-
className,
|
|
15
|
-
)}
|
|
16
|
-
{...props}
|
|
17
|
-
ref={ref}
|
|
18
|
-
>
|
|
19
|
-
<SwitchPrimitive.Thumb
|
|
20
|
-
className={cn(
|
|
21
|
-
'pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',
|
|
22
|
-
)}
|
|
23
|
-
/>
|
|
24
|
-
</SwitchPrimitive.Root>
|
|
25
|
-
))
|
|
26
|
-
Switch.displayName = SwitchPrimitive.Root.displayName
|
|
27
|
-
|
|
28
|
-
export { Switch }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Switch = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof SwitchPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<SwitchPrimitive.Root
|
|
12
|
+
className={cn(
|
|
13
|
+
'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
ref={ref}
|
|
18
|
+
>
|
|
19
|
+
<SwitchPrimitive.Thumb
|
|
20
|
+
className={cn(
|
|
21
|
+
'pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0',
|
|
22
|
+
)}
|
|
23
|
+
/>
|
|
24
|
+
</SwitchPrimitive.Root>
|
|
25
|
+
))
|
|
26
|
+
Switch.displayName = SwitchPrimitive.Root.displayName
|
|
27
|
+
|
|
28
|
+
export { Switch }
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
5
|
-
import { cn } from '@/lib/utils'
|
|
6
|
-
|
|
7
|
-
const Tabs = TabsPrimitive.Root
|
|
8
|
-
|
|
9
|
-
const TabsList = React.forwardRef<
|
|
10
|
-
React.ElementRef<typeof TabsPrimitive.List>,
|
|
11
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
12
|
-
>(({ className, ...props }, ref) => (
|
|
13
|
-
<TabsPrimitive.List
|
|
14
|
-
ref={ref}
|
|
15
|
-
className={cn(
|
|
16
|
-
'inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
))
|
|
22
|
-
TabsList.displayName = TabsPrimitive.List.displayName
|
|
23
|
-
|
|
24
|
-
const TabsTrigger = React.forwardRef<
|
|
25
|
-
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
26
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
27
|
-
>(({ className, ...props }, ref) => (
|
|
28
|
-
<TabsPrimitive.Trigger
|
|
29
|
-
ref={ref}
|
|
30
|
-
className={cn(
|
|
31
|
-
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
36
|
-
))
|
|
37
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
38
|
-
|
|
39
|
-
const TabsContent = React.forwardRef<
|
|
40
|
-
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
41
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
42
|
-
>(({ className, ...props }, ref) => (
|
|
43
|
-
<TabsPrimitive.Content
|
|
44
|
-
ref={ref}
|
|
45
|
-
className={cn(
|
|
46
|
-
'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
47
|
-
className,
|
|
48
|
-
)}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
))
|
|
52
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
53
|
-
|
|
54
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
const Tabs = TabsPrimitive.Root
|
|
8
|
+
|
|
9
|
+
const TabsList = React.forwardRef<
|
|
10
|
+
React.ElementRef<typeof TabsPrimitive.List>,
|
|
11
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
12
|
+
>(({ className, ...props }, ref) => (
|
|
13
|
+
<TabsPrimitive.List
|
|
14
|
+
ref={ref}
|
|
15
|
+
className={cn(
|
|
16
|
+
'inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
|
|
17
|
+
className,
|
|
18
|
+
)}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
))
|
|
22
|
+
TabsList.displayName = TabsPrimitive.List.displayName
|
|
23
|
+
|
|
24
|
+
const TabsTrigger = React.forwardRef<
|
|
25
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
26
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
27
|
+
>(({ className, ...props }, ref) => (
|
|
28
|
+
<TabsPrimitive.Trigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
))
|
|
37
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
|
|
38
|
+
|
|
39
|
+
const TabsContent = React.forwardRef<
|
|
40
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
41
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
42
|
+
>(({ className, ...props }, ref) => (
|
|
43
|
+
<TabsPrimitive.Content
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
'mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
))
|
|
52
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName
|
|
53
|
+
|
|
54
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent }
|