@cogito.ai/cli 0.4.2 → 0.4.3

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 (101) hide show
  1. package/README.md +29 -22
  2. package/dist/index.js +9 -15
  3. package/dist/templates/web-nextjs/.github/copilot-instructions.md +5 -6
  4. package/dist/templates/web-nextjs/README.md +25 -24
  5. package/dist/templates/web-nextjs/apps/docs/.source/browser.ts +18 -8
  6. package/dist/templates/web-nextjs/apps/docs/.source/dynamic.ts +11 -5
  7. package/dist/templates/web-nextjs/apps/docs/.source/server.ts +37 -17
  8. package/dist/templates/web-nextjs/apps/docs/app/docs/[[...slug]]/page.tsx +1 -6
  9. package/dist/templates/web-nextjs/apps/docs/app/docs/layout.tsx +1 -4
  10. package/dist/templates/web-nextjs/apps/docs/app/llms-full.txt/route.ts +3 -1
  11. package/dist/templates/web-nextjs/apps/docs/next-env.d.ts +1 -1
  12. package/dist/templates/web-nextjs/apps/web/.github/copilot-instructions.md +53 -6
  13. package/dist/templates/web-nextjs/apps/web/.github/skills/impeccable/SKILL.md +55 -0
  14. package/dist/templates/web-nextjs/apps/web/DESIGN.md +65 -0
  15. package/dist/templates/web-nextjs/apps/web/messages/en.json +81 -5
  16. package/dist/templates/web-nextjs/apps/web/messages/zh.json +81 -5
  17. package/dist/templates/web-nextjs/apps/web/next.config.ts +3 -3
  18. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/forgot-password/page.tsx +174 -39
  19. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/login/page.tsx +13 -3
  20. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/reset-password/page.tsx +4 -1
  21. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/signup/page.tsx +18 -17
  22. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/dashboard/page.tsx +1 -5
  23. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/layout.tsx +1 -5
  24. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/profile/page.tsx +2 -8
  25. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/about/page.tsx +3 -6
  26. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/globals.css +17 -5
  27. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/help/page.tsx +1 -5
  28. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +10 -8
  29. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/page.tsx +22 -6
  30. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/privacy/page.tsx +3 -6
  31. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/terms/page.tsx +1 -5
  32. package/dist/templates/web-nextjs/apps/web/src/app/auth/callback/route.ts +2 -3
  33. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/app-sidebar.tsx +13 -16
  34. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/chart-area-interactive.tsx +122 -146
  35. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data-table.tsx +84 -149
  36. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-documents.tsx +7 -16
  37. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-main.tsx +4 -4
  38. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-secondary.tsx +4 -4
  39. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-user.tsx +12 -21
  40. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/page.tsx +10 -13
  41. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/section-cards.tsx +5 -9
  42. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/site-header.tsx +6 -7
  43. package/dist/templates/web-nextjs/apps/web/src/components/landing/features.tsx +63 -0
  44. package/dist/templates/web-nextjs/apps/web/src/components/landing/footer.tsx +48 -0
  45. package/dist/templates/web-nextjs/apps/web/src/components/landing/header.tsx +97 -0
  46. package/dist/templates/web-nextjs/apps/web/src/components/landing/hero.tsx +45 -0
  47. package/dist/templates/web-nextjs/apps/web/src/components/landing/how-it-works.tsx +35 -0
  48. package/dist/templates/web-nextjs/apps/web/src/components/landing/pricing-teaser.tsx +23 -0
  49. package/dist/templates/web-nextjs/apps/web/src/components/profile/profile-form.tsx +6 -4
  50. package/dist/templates/web-nextjs/apps/web/src/components/providers/theme-provider.tsx +16 -0
  51. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert-dialog.tsx +32 -49
  52. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert.tsx +16 -23
  53. package/dist/templates/web-nextjs/apps/web/src/components/ui/avatar.tsx +25 -38
  54. package/dist/templates/web-nextjs/apps/web/src/components/ui/badge.tsx +16 -18
  55. package/dist/templates/web-nextjs/apps/web/src/components/ui/breadcrumb.tsx +19 -26
  56. package/dist/templates/web-nextjs/apps/web/src/components/ui/button.tsx +23 -24
  57. package/dist/templates/web-nextjs/apps/web/src/components/ui/card.tsx +19 -36
  58. package/dist/templates/web-nextjs/apps/web/src/components/ui/chart.tsx +60 -94
  59. package/dist/templates/web-nextjs/apps/web/src/components/ui/checkbox.tsx +8 -11
  60. package/dist/templates/web-nextjs/apps/web/src/components/ui/collapsible.tsx +5 -17
  61. package/dist/templates/web-nextjs/apps/web/src/components/ui/command.tsx +25 -48
  62. package/dist/templates/web-nextjs/apps/web/src/components/ui/dialog.tsx +21 -35
  63. package/dist/templates/web-nextjs/apps/web/src/components/ui/drawer.tsx +24 -35
  64. package/dist/templates/web-nextjs/apps/web/src/components/ui/dropdown-menu.tsx +26 -55
  65. package/dist/templates/web-nextjs/apps/web/src/components/ui/field.tsx +62 -76
  66. package/dist/templates/web-nextjs/apps/web/src/components/ui/form.tsx +19 -34
  67. package/dist/templates/web-nextjs/apps/web/src/components/ui/input-otp.tsx +13 -20
  68. package/dist/templates/web-nextjs/apps/web/src/components/ui/input.tsx +6 -6
  69. package/dist/templates/web-nextjs/apps/web/src/components/ui/label.tsx +6 -6
  70. package/dist/templates/web-nextjs/apps/web/src/components/ui/pagination.tsx +21 -42
  71. package/dist/templates/web-nextjs/apps/web/src/components/ui/popover.tsx +16 -31
  72. package/dist/templates/web-nextjs/apps/web/src/components/ui/progress.tsx +5 -8
  73. package/dist/templates/web-nextjs/apps/web/src/components/ui/radio-group.tsx +8 -8
  74. package/dist/templates/web-nextjs/apps/web/src/components/ui/scroll-area.tsx +10 -12
  75. package/dist/templates/web-nextjs/apps/web/src/components/ui/select.tsx +26 -41
  76. package/dist/templates/web-nextjs/apps/web/src/components/ui/separator.tsx +7 -7
  77. package/dist/templates/web-nextjs/apps/web/src/components/ui/sheet.tsx +29 -38
  78. package/dist/templates/web-nextjs/apps/web/src/components/ui/sidebar.tsx +157 -189
  79. package/dist/templates/web-nextjs/apps/web/src/components/ui/skeleton.tsx +3 -3
  80. package/dist/templates/web-nextjs/apps/web/src/components/ui/slider.tsx +10 -15
  81. package/dist/templates/web-nextjs/apps/web/src/components/ui/sonner.tsx +13 -7
  82. package/dist/templates/web-nextjs/apps/web/src/components/ui/switch.tsx +9 -9
  83. package/dist/templates/web-nextjs/apps/web/src/components/ui/table.tsx +24 -48
  84. package/dist/templates/web-nextjs/apps/web/src/components/ui/tabs.tsx +21 -31
  85. package/dist/templates/web-nextjs/apps/web/src/components/ui/textarea.tsx +5 -5
  86. package/dist/templates/web-nextjs/apps/web/src/components/ui/theme-toggle.tsx +23 -0
  87. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle-group.tsx +15 -16
  88. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle.tsx +14 -15
  89. package/dist/templates/web-nextjs/apps/web/src/components/ui/tooltip.tsx +8 -12
  90. package/dist/templates/web-nextjs/apps/web/src/core/repositories/IAuthRepository.ts +2 -0
  91. package/dist/templates/web-nextjs/apps/web/src/core/types/auth.ts +1 -3
  92. package/dist/templates/web-nextjs/apps/web/src/features/auth/actions.ts +57 -1
  93. package/dist/templates/web-nextjs/apps/web/src/features/auth/index.ts +2 -0
  94. package/dist/templates/web-nextjs/apps/web/src/hooks/use-mobile.ts +4 -4
  95. package/dist/templates/web-nextjs/apps/web/src/i18n/config.ts +1 -1
  96. package/dist/templates/web-nextjs/apps/web/src/infra/db/SupabaseAuthRepository.ts +48 -4
  97. package/dist/templates/web-nextjs/apps/web/src/infra/db/client.ts +1 -4
  98. package/dist/templates/web-nextjs/apps/web/src/lib/utils.ts +2 -2
  99. package/dist/templates/web-nextjs/apps/web/src/lib/validations/auth.ts +13 -0
  100. package/dist/templates/web-nextjs/apps/web/src/styles/tokens.css +58 -0
  101. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import { useMemo } from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
3
+ import { useMemo } from 'react'
4
+ import { cva, type VariantProps } from 'class-variance-authority'
5
5
 
6
- import { cn } from "@/lib/utils"
7
- import { Label } from "@/components/ui/label"
8
- import { Separator } from "@/components/ui/separator"
6
+ import { cn } from '@/lib/utils'
7
+ import { Label } from '@/components/ui/label'
8
+ import { Separator } from '@/components/ui/separator'
9
9
 
10
- function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
10
+ function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
11
11
  return (
12
12
  <fieldset
13
13
  data-slot="field-set"
14
14
  className={cn(
15
- "flex flex-col gap-6",
16
- "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
17
- className
15
+ 'flex flex-col gap-6',
16
+ 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
17
+ className,
18
18
  )}
19
19
  {...props}
20
20
  />
@@ -23,66 +23,63 @@ function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
23
23
 
24
24
  function FieldLegend({
25
25
  className,
26
- variant = "legend",
26
+ variant = 'legend',
27
27
  ...props
28
- }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
28
+ }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
29
29
  return (
30
30
  <legend
31
31
  data-slot="field-legend"
32
32
  data-variant={variant}
33
33
  className={cn(
34
- "mb-3 font-medium",
35
- "data-[variant=legend]:text-base",
36
- "data-[variant=label]:text-sm",
37
- className
34
+ 'mb-3 font-medium',
35
+ 'data-[variant=legend]:text-base',
36
+ 'data-[variant=label]:text-sm',
37
+ className,
38
38
  )}
39
39
  {...props}
40
40
  />
41
41
  )
42
42
  }
43
43
 
44
- function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
44
+ function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
45
45
  return (
46
46
  <div
47
47
  data-slot="field-group"
48
48
  className={cn(
49
- "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
50
- className
49
+ 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',
50
+ className,
51
51
  )}
52
52
  {...props}
53
53
  />
54
54
  )
55
55
  }
56
56
 
57
- const fieldVariants = cva(
58
- "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
59
- {
60
- variants: {
61
- orientation: {
62
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
63
- horizontal: [
64
- "flex-row items-center",
65
- "[&>[data-slot=field-label]]:flex-auto",
66
- "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
67
- ],
68
- responsive: [
69
- "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
70
- "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
71
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
72
- ],
73
- },
57
+ const fieldVariants = cva('group/field flex w-full gap-3 data-[invalid=true]:text-destructive', {
58
+ variants: {
59
+ orientation: {
60
+ vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
61
+ horizontal: [
62
+ 'flex-row items-center',
63
+ '[&>[data-slot=field-label]]:flex-auto',
64
+ 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
65
+ ],
66
+ responsive: [
67
+ 'flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto',
68
+ '@md/field-group:[&>[data-slot=field-label]]:flex-auto',
69
+ '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
70
+ ],
74
71
  },
75
- defaultVariants: {
76
- orientation: "vertical",
77
- },
78
- }
79
- )
72
+ },
73
+ defaultVariants: {
74
+ orientation: 'vertical',
75
+ },
76
+ })
80
77
 
81
78
  function Field({
82
79
  className,
83
- orientation = "vertical",
80
+ orientation = 'vertical',
84
81
  ...props
85
- }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
82
+ }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
86
83
  return (
87
84
  <div
88
85
  role="group"
@@ -94,59 +91,53 @@ function Field({
94
91
  )
95
92
  }
96
93
 
97
- function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
94
+ function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
98
95
  return (
99
96
  <div
100
97
  data-slot="field-content"
101
- className={cn(
102
- "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
103
- className
104
- )}
98
+ className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}
105
99
  {...props}
106
100
  />
107
101
  )
108
102
  }
109
103
 
110
- function FieldLabel({
111
- className,
112
- ...props
113
- }: React.ComponentProps<typeof Label>) {
104
+ function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
114
105
  return (
115
106
  <Label
116
107
  data-slot="field-label"
117
108
  className={cn(
118
- "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
119
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
120
- "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",
121
- className
109
+ 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
110
+ 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',
111
+ 'has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10',
112
+ className,
122
113
  )}
123
114
  {...props}
124
115
  />
125
116
  )
126
117
  }
127
118
 
128
- function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
119
+ function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
129
120
  return (
130
121
  <div
131
122
  data-slot="field-label"
132
123
  className={cn(
133
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
134
- className
124
+ 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
125
+ className,
135
126
  )}
136
127
  {...props}
137
128
  />
138
129
  )
139
130
  }
140
131
 
141
- function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
132
+ function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
142
133
  return (
143
134
  <p
144
135
  data-slot="field-description"
145
136
  className={cn(
146
- "text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
147
- "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
148
- "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
149
- className
137
+ 'text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance',
138
+ 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',
139
+ '[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',
140
+ className,
150
141
  )}
151
142
  {...props}
152
143
  />
@@ -157,7 +148,7 @@ function FieldSeparator({
157
148
  children,
158
149
  className,
159
150
  ...props
160
- }: React.ComponentProps<"div"> & {
151
+ }: React.ComponentProps<'div'> & {
161
152
  children?: React.ReactNode
162
153
  }) {
163
154
  return (
@@ -165,8 +156,8 @@ function FieldSeparator({
165
156
  data-slot="field-separator"
166
157
  data-content={!!children}
167
158
  className={cn(
168
- "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
169
- className
159
+ 'relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2',
160
+ className,
170
161
  )}
171
162
  {...props}
172
163
  >
@@ -188,7 +179,7 @@ function FieldError({
188
179
  children,
189
180
  errors,
190
181
  ...props
191
- }: React.ComponentProps<"div"> & {
182
+ }: React.ComponentProps<'div'> & {
192
183
  errors?: Array<{ message?: string } | undefined>
193
184
  }) {
194
185
  const content = useMemo(() => {
@@ -200,9 +191,7 @@ function FieldError({
200
191
  return null
201
192
  }
202
193
 
203
- const uniqueErrors = [
204
- ...new Map(errors.map((error) => [error?.message, error])).values(),
205
- ]
194
+ const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()]
206
195
 
207
196
  if (uniqueErrors?.length == 1) {
208
197
  return uniqueErrors[0]?.message
@@ -210,10 +199,7 @@ function FieldError({
210
199
 
211
200
  return (
212
201
  <ul className="ml-4 flex list-disc flex-col gap-1">
213
- {uniqueErrors.map(
214
- (error, index) =>
215
- error?.message && <li key={index}>{error.message}</li>
216
- )}
202
+ {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
217
203
  </ul>
218
204
  )
219
205
  }, [children, errors])
@@ -226,7 +212,7 @@ function FieldError({
226
212
  <div
227
213
  role="alert"
228
214
  data-slot="field-error"
229
- className={cn("text-sm font-normal text-destructive", className)}
215
+ className={cn('text-sm font-normal text-destructive', className)}
230
216
  {...props}
231
217
  >
232
218
  {content}
@@ -1,6 +1,6 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
3
+ import * as React from 'react'
4
4
  import {
5
5
  Controller,
6
6
  type ControllerProps,
@@ -9,10 +9,10 @@ import {
9
9
  FormProvider,
10
10
  useFormContext,
11
11
  type UseFormReturn,
12
- } from "react-hook-form"
12
+ } from 'react-hook-form'
13
13
 
14
- import { cn } from "@/lib/utils"
15
- import { Label } from "@/components/ui/label"
14
+ import { cn } from '@/lib/utils'
15
+ import { Label } from '@/components/ui/label'
16
16
 
17
17
  const Form = FormProvider
18
18
 
@@ -23,9 +23,7 @@ type FormFieldContextValue<
23
23
  name: TName
24
24
  }
25
25
 
26
- const FormFieldContext = React.createContext<FormFieldContextValue>(
27
- {} as FormFieldContextValue,
28
- )
26
+ const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)
29
27
 
30
28
  function FormField<
31
29
  TFieldValues extends FieldValues = FieldValues,
@@ -46,7 +44,7 @@ function useFormField() {
46
44
  const fieldState = getFieldState(fieldContext.name, formState)
47
45
 
48
46
  if (!fieldContext) {
49
- throw new Error("useFormField should be used within <FormField>")
47
+ throw new Error('useFormField should be used within <FormField>')
50
48
  }
51
49
 
52
50
  const { id } = itemContext
@@ -65,67 +63,54 @@ type FormItemContextValue = {
65
63
  id: string
66
64
  }
67
65
 
68
- const FormItemContext = React.createContext<FormItemContextValue>(
69
- {} as FormItemContextValue,
70
- )
66
+ const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)
71
67
 
72
- function FormItem({ className, ...props }: React.ComponentProps<"div">) {
68
+ function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
73
69
  const id = React.useId()
74
70
 
75
71
  return (
76
72
  <FormItemContext.Provider value={{ id }}>
77
- <div className={cn("grid gap-2", className)} {...props} />
73
+ <div className={cn('grid gap-2', className)} {...props} />
78
74
  </FormItemContext.Provider>
79
75
  )
80
76
  }
81
77
 
82
- function FormLabel({
83
- className,
84
- ...props
85
- }: React.ComponentProps<typeof Label>) {
78
+ function FormLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
86
79
  const { error, formItemId } = useFormField()
87
80
 
88
81
  return (
89
- <Label
90
- className={cn(error && "text-destructive", className)}
91
- htmlFor={formItemId}
92
- {...props}
93
- />
82
+ <Label className={cn(error && 'text-destructive', className)} htmlFor={formItemId} {...props} />
94
83
  )
95
84
  }
96
85
 
97
- function FormControl({ ...props }: React.ComponentProps<"div">) {
86
+ function FormControl({ ...props }: React.ComponentProps<'div'>) {
98
87
  const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
99
88
 
100
89
  return (
101
90
  <div
102
91
  id={formItemId}
103
- aria-describedby={
104
- !error
105
- ? `${formDescriptionId}`
106
- : `${formDescriptionId} ${formMessageId}`
107
- }
92
+ aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
108
93
  aria-invalid={!!error}
109
94
  {...props}
110
95
  />
111
96
  )
112
97
  }
113
98
 
114
- function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
99
+ function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
115
100
  const { formDescriptionId } = useFormField()
116
101
 
117
102
  return (
118
103
  <p
119
104
  id={formDescriptionId}
120
- className={cn("text-sm text-muted-foreground", className)}
105
+ className={cn('text-sm text-muted-foreground', className)}
121
106
  {...props}
122
107
  />
123
108
  )
124
109
  }
125
110
 
126
- function FormMessage({ className, children, ...props }: React.ComponentProps<"p">) {
111
+ function FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {
127
112
  const { error, formMessageId } = useFormField()
128
- const body = error ? String(error?.message ?? "") : children
113
+ const body = error ? String(error?.message ?? '') : children
129
114
 
130
115
  if (!body) {
131
116
  return null
@@ -134,7 +119,7 @@ function FormMessage({ className, children, ...props }: React.ComponentProps<"p"
134
119
  return (
135
120
  <p
136
121
  id={formMessageId}
137
- className={cn("text-sm font-medium text-destructive", className)}
122
+ className={cn('text-sm font-medium text-destructive', className)}
138
123
  {...props}
139
124
  >
140
125
  {body}
@@ -1,10 +1,10 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { OTPInput, OTPInputContext } from "input-otp"
5
- import { MinusIcon } from "lucide-react"
3
+ import * as React from 'react'
4
+ import { OTPInput, OTPInputContext } from 'input-otp'
5
+ import { MinusIcon } from 'lucide-react'
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from '@/lib/utils'
8
8
 
9
9
  function InputOTP({
10
10
  className,
@@ -16,23 +16,16 @@ function InputOTP({
16
16
  return (
17
17
  <OTPInput
18
18
  data-slot="input-otp"
19
- containerClassName={cn(
20
- "flex items-center gap-2 has-disabled:opacity-50",
21
- containerClassName
22
- )}
23
- className={cn("disabled:cursor-not-allowed", className)}
19
+ containerClassName={cn('flex items-center gap-2 has-disabled:opacity-50', containerClassName)}
20
+ className={cn('disabled:cursor-not-allowed', className)}
24
21
  {...props}
25
22
  />
26
23
  )
27
24
  }
28
25
 
29
- function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
26
+ function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
30
27
  return (
31
- <div
32
- data-slot="input-otp-group"
33
- className={cn("flex items-center", className)}
34
- {...props}
35
- />
28
+ <div data-slot="input-otp-group" className={cn('flex items-center', className)} {...props} />
36
29
  )
37
30
  }
38
31
 
@@ -40,7 +33,7 @@ function InputOTPSlot({
40
33
  index,
41
34
  className,
42
35
  ...props
43
- }: React.ComponentProps<"div"> & {
36
+ }: React.ComponentProps<'div'> & {
44
37
  index: number
45
38
  }) {
46
39
  const inputOTPContext = React.useContext(OTPInputContext)
@@ -51,8 +44,8 @@ function InputOTPSlot({
51
44
  data-slot="input-otp-slot"
52
45
  data-active={isActive}
53
46
  className={cn(
54
- "relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40",
55
- className
47
+ 'relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40',
48
+ className,
56
49
  )}
57
50
  {...props}
58
51
  >
@@ -66,7 +59,7 @@ function InputOTPSlot({
66
59
  )
67
60
  }
68
61
 
69
- function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
62
+ function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
70
63
  return (
71
64
  <div data-slot="input-otp-separator" role="separator" {...props}>
72
65
  <MinusIcon />
@@ -1,16 +1,16 @@
1
- import * as React from "react"
2
- import { Input as InputPrimitive } from "@base-ui/react/input"
1
+ import * as React from 'react'
2
+ import { Input as InputPrimitive } from '@base-ui/react/input'
3
3
 
4
- import { cn } from "@/lib/utils"
4
+ import { cn } from '@/lib/utils'
5
5
 
6
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
+ function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
7
7
  return (
8
8
  <InputPrimitive
9
9
  type={type}
10
10
  data-slot="input"
11
11
  className={cn(
12
- "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
13
- className
12
+ 'h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',
13
+ className,
14
14
  )}
15
15
  {...props}
16
16
  />
@@ -1,16 +1,16 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
3
+ import * as React from 'react'
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from '@/lib/utils'
6
6
 
7
- function Label({ className, ...props }: React.ComponentProps<"label">) {
7
+ function Label({ className, ...props }: React.ComponentProps<'label'>) {
8
8
  return (
9
9
  <label
10
10
  data-slot="label"
11
11
  className={cn(
12
- "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",
13
- className
12
+ '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',
13
+ className,
14
14
  )}
15
15
  {...props}
16
16
  />
@@ -1,79 +1,64 @@
1
- import * as React from "react"
2
- import {
3
- ChevronLeftIcon,
4
- ChevronRightIcon,
5
- MoreHorizontalIcon,
6
- } from "lucide-react"
1
+ import * as React from 'react'
2
+ import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react'
7
3
 
8
- import { cn } from "@/lib/utils"
9
- import { buttonVariants, type Button } from "@/components/ui/button"
4
+ import { cn } from '@/lib/utils'
5
+ import { buttonVariants, type Button } from '@/components/ui/button'
10
6
 
11
- function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
7
+ function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
12
8
  return (
13
9
  <nav
14
10
  role="navigation"
15
11
  aria-label="pagination"
16
12
  data-slot="pagination"
17
- className={cn("mx-auto flex w-full justify-center", className)}
13
+ className={cn('mx-auto flex w-full justify-center', className)}
18
14
  {...props}
19
15
  />
20
16
  )
21
17
  }
22
18
 
23
- function PaginationContent({
24
- className,
25
- ...props
26
- }: React.ComponentProps<"ul">) {
19
+ function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
27
20
  return (
28
21
  <ul
29
22
  data-slot="pagination-content"
30
- className={cn("flex flex-row items-center gap-1", className)}
23
+ className={cn('flex flex-row items-center gap-1', className)}
31
24
  {...props}
32
25
  />
33
26
  )
34
27
  }
35
28
 
36
- function PaginationItem({ ...props }: React.ComponentProps<"li">) {
29
+ function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
37
30
  return <li data-slot="pagination-item" {...props} />
38
31
  }
39
32
 
40
33
  type PaginationLinkProps = {
41
34
  isActive?: boolean
42
- } & Pick<React.ComponentProps<typeof Button>, "size"> &
43
- React.ComponentProps<"a">
35
+ } & Pick<React.ComponentProps<typeof Button>, 'size'> &
36
+ React.ComponentProps<'a'>
44
37
 
45
- function PaginationLink({
46
- className,
47
- isActive,
48
- size = "icon",
49
- ...props
50
- }: PaginationLinkProps) {
38
+ function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
51
39
  return (
52
40
  <a
53
- aria-current={isActive ? "page" : undefined}
41
+ aria-current={isActive ? 'page' : undefined}
54
42
  data-slot="pagination-link"
55
43
  data-active={isActive}
56
44
  className={cn(
57
45
  buttonVariants({
58
- variant: isActive ? "outline" : "ghost",
46
+ variant: isActive ? 'outline' : 'ghost',
59
47
  size,
60
48
  }),
61
- className
49
+ className,
62
50
  )}
63
51
  {...props}
64
52
  />
65
53
  )
66
54
  }
67
55
 
68
- function PaginationPrevious({
69
- className,
70
- ...props
71
- }: React.ComponentProps<typeof PaginationLink>) {
56
+ function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
72
57
  return (
73
58
  <PaginationLink
74
59
  aria-label="Go to previous page"
75
60
  size="default"
76
- className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
61
+ className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
77
62
  {...props}
78
63
  >
79
64
  <ChevronLeftIcon />
@@ -82,15 +67,12 @@ function PaginationPrevious({
82
67
  )
83
68
  }
84
69
 
85
- function PaginationNext({
86
- className,
87
- ...props
88
- }: React.ComponentProps<typeof PaginationLink>) {
70
+ function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
89
71
  return (
90
72
  <PaginationLink
91
73
  aria-label="Go to next page"
92
74
  size="default"
93
- className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
75
+ className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
94
76
  {...props}
95
77
  >
96
78
  <span className="hidden sm:block">Next</span>
@@ -99,15 +81,12 @@ function PaginationNext({
99
81
  )
100
82
  }
101
83
 
102
- function PaginationEllipsis({
103
- className,
104
- ...props
105
- }: React.ComponentProps<"span">) {
84
+ function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
106
85
  return (
107
86
  <span
108
87
  aria-hidden
109
88
  data-slot="pagination-ellipsis"
110
- className={cn("flex size-9 items-center justify-center", className)}
89
+ className={cn('flex size-9 items-center justify-center', className)}
111
90
  {...props}
112
91
  >
113
92
  <MoreHorizontalIcon className="size-4" />