@cogito.ai/cli 0.4.2 → 0.4.4

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 (135) 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 +1 -1
  6. package/dist/templates/web-nextjs/apps/docs/.source/server.ts +6 -6
  7. package/dist/templates/web-nextjs/apps/docs/app/docs/[[...slug]]/page.tsx +1 -6
  8. package/dist/templates/web-nextjs/apps/docs/app/docs/layout.tsx +1 -4
  9. package/dist/templates/web-nextjs/apps/docs/app/llms-full.txt/route.ts +3 -1
  10. package/dist/templates/web-nextjs/apps/docs/next-env.d.ts +1 -1
  11. package/dist/templates/web-nextjs/apps/web/.env.example +35 -0
  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 +151 -5
  16. package/dist/templates/web-nextjs/apps/web/messages/zh.json +151 -5
  17. package/dist/templates/web-nextjs/apps/web/next-env.d.ts +1 -1
  18. package/dist/templates/web-nextjs/apps/web/next.config.ts +3 -3
  19. package/dist/templates/web-nextjs/apps/web/package.json +4 -0
  20. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/forgot-password/page.tsx +167 -38
  21. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/login/page.tsx +13 -3
  22. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/reset-password/page.tsx +4 -1
  23. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/signup/page.tsx +18 -17
  24. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/dashboard/page.tsx +1 -5
  25. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/[paymentId]/page.tsx +88 -0
  26. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/payment/checkout/page.tsx +170 -0
  27. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/pricing/page.tsx +120 -0
  28. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/layout.tsx +45 -2
  29. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/profile/page.tsx +2 -8
  30. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/settings/subscription/page.tsx +128 -0
  31. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/about/page.tsx +3 -6
  32. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/globals.css +17 -5
  33. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/help/page.tsx +1 -5
  34. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +10 -8
  35. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/page.tsx +22 -6
  36. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/privacy/page.tsx +3 -6
  37. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/terms/page.tsx +1 -5
  38. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/create/route.ts +43 -0
  39. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/notify/route.ts +105 -0
  40. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/query/route.ts +54 -0
  41. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/alipay/return/route.ts +20 -0
  42. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/create/route.ts +52 -0
  43. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/create/route.ts +58 -0
  44. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/notify/route.ts +92 -0
  45. package/dist/templates/web-nextjs/apps/web/src/app/api/payments/wechat/query/route.ts +54 -0
  46. package/dist/templates/web-nextjs/apps/web/src/app/auth/callback/route.ts +2 -3
  47. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/app-sidebar.tsx +13 -16
  48. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/chart-area-interactive.tsx +122 -146
  49. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data-table.tsx +84 -149
  50. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-documents.tsx +7 -16
  51. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-main.tsx +4 -4
  52. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-secondary.tsx +4 -4
  53. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-user.tsx +12 -21
  54. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/page.tsx +10 -13
  55. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/section-cards.tsx +5 -9
  56. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/site-header.tsx +6 -7
  57. package/dist/templates/web-nextjs/apps/web/src/components/landing/features.tsx +63 -0
  58. package/dist/templates/web-nextjs/apps/web/src/components/landing/footer.tsx +48 -0
  59. package/dist/templates/web-nextjs/apps/web/src/components/landing/header.tsx +97 -0
  60. package/dist/templates/web-nextjs/apps/web/src/components/landing/hero.tsx +45 -0
  61. package/dist/templates/web-nextjs/apps/web/src/components/landing/how-it-works.tsx +35 -0
  62. package/dist/templates/web-nextjs/apps/web/src/components/landing/pricing-teaser.tsx +23 -0
  63. package/dist/templates/web-nextjs/apps/web/src/components/profile/profile-form.tsx +6 -4
  64. package/dist/templates/web-nextjs/apps/web/src/components/providers/theme-provider.tsx +16 -0
  65. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert-dialog.tsx +32 -49
  66. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert.tsx +16 -23
  67. package/dist/templates/web-nextjs/apps/web/src/components/ui/avatar.tsx +25 -38
  68. package/dist/templates/web-nextjs/apps/web/src/components/ui/badge.tsx +16 -18
  69. package/dist/templates/web-nextjs/apps/web/src/components/ui/breadcrumb.tsx +19 -26
  70. package/dist/templates/web-nextjs/apps/web/src/components/ui/button.tsx +23 -24
  71. package/dist/templates/web-nextjs/apps/web/src/components/ui/card.tsx +19 -36
  72. package/dist/templates/web-nextjs/apps/web/src/components/ui/chart.tsx +60 -94
  73. package/dist/templates/web-nextjs/apps/web/src/components/ui/checkbox.tsx +8 -11
  74. package/dist/templates/web-nextjs/apps/web/src/components/ui/collapsible.tsx +5 -17
  75. package/dist/templates/web-nextjs/apps/web/src/components/ui/command.tsx +25 -48
  76. package/dist/templates/web-nextjs/apps/web/src/components/ui/dialog.tsx +21 -35
  77. package/dist/templates/web-nextjs/apps/web/src/components/ui/drawer.tsx +24 -35
  78. package/dist/templates/web-nextjs/apps/web/src/components/ui/dropdown-menu.tsx +26 -55
  79. package/dist/templates/web-nextjs/apps/web/src/components/ui/field.tsx +62 -76
  80. package/dist/templates/web-nextjs/apps/web/src/components/ui/form.tsx +19 -34
  81. package/dist/templates/web-nextjs/apps/web/src/components/ui/input-otp.tsx +13 -20
  82. package/dist/templates/web-nextjs/apps/web/src/components/ui/input.tsx +6 -6
  83. package/dist/templates/web-nextjs/apps/web/src/components/ui/label.tsx +6 -6
  84. package/dist/templates/web-nextjs/apps/web/src/components/ui/pagination.tsx +21 -42
  85. package/dist/templates/web-nextjs/apps/web/src/components/ui/popover.tsx +16 -31
  86. package/dist/templates/web-nextjs/apps/web/src/components/ui/progress.tsx +5 -8
  87. package/dist/templates/web-nextjs/apps/web/src/components/ui/radio-group.tsx +8 -8
  88. package/dist/templates/web-nextjs/apps/web/src/components/ui/scroll-area.tsx +10 -12
  89. package/dist/templates/web-nextjs/apps/web/src/components/ui/select.tsx +26 -41
  90. package/dist/templates/web-nextjs/apps/web/src/components/ui/separator.tsx +7 -7
  91. package/dist/templates/web-nextjs/apps/web/src/components/ui/sheet.tsx +29 -38
  92. package/dist/templates/web-nextjs/apps/web/src/components/ui/sidebar.tsx +157 -189
  93. package/dist/templates/web-nextjs/apps/web/src/components/ui/skeleton.tsx +3 -3
  94. package/dist/templates/web-nextjs/apps/web/src/components/ui/slider.tsx +10 -15
  95. package/dist/templates/web-nextjs/apps/web/src/components/ui/sonner.tsx +13 -7
  96. package/dist/templates/web-nextjs/apps/web/src/components/ui/switch.tsx +9 -9
  97. package/dist/templates/web-nextjs/apps/web/src/components/ui/table.tsx +24 -48
  98. package/dist/templates/web-nextjs/apps/web/src/components/ui/tabs.tsx +21 -31
  99. package/dist/templates/web-nextjs/apps/web/src/components/ui/textarea.tsx +5 -5
  100. package/dist/templates/web-nextjs/apps/web/src/components/ui/theme-toggle.tsx +23 -0
  101. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle-group.tsx +15 -16
  102. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle.tsx +14 -15
  103. package/dist/templates/web-nextjs/apps/web/src/components/ui/tooltip.tsx +8 -12
  104. package/dist/templates/web-nextjs/apps/web/src/core/repositories/IAuthRepository.ts +2 -0
  105. package/dist/templates/web-nextjs/apps/web/src/core/types/auth.ts +1 -3
  106. package/dist/templates/web-nextjs/apps/web/src/features/auth/actions.ts +57 -1
  107. package/dist/templates/web-nextjs/apps/web/src/features/auth/index.ts +2 -0
  108. package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/client.ts +36 -0
  109. package/dist/templates/web-nextjs/apps/web/src/features/subscription/alipay/server.ts +83 -0
  110. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/index.ts +4 -0
  111. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-badge.tsx +9 -0
  112. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/pro-feature-comparison.tsx +70 -0
  113. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/quota-warning-banner.tsx +37 -0
  114. package/dist/templates/web-nextjs/apps/web/src/features/subscription/components/upgrade-button.tsx +42 -0
  115. package/dist/templates/web-nextjs/apps/web/src/features/subscription/hooks.ts +141 -0
  116. package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-helpers.ts +27 -0
  117. package/dist/templates/web-nextjs/apps/web/src/features/subscription/payment-service.ts +56 -0
  118. package/dist/templates/web-nextjs/apps/web/src/features/subscription/service.ts +55 -0
  119. package/dist/templates/web-nextjs/apps/web/src/features/subscription/types.ts +73 -0
  120. package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/client.ts +33 -0
  121. package/dist/templates/web-nextjs/apps/web/src/features/subscription/wechat/server.ts +147 -0
  122. package/dist/templates/web-nextjs/apps/web/src/hooks/use-mobile.ts +4 -4
  123. package/dist/templates/web-nextjs/apps/web/src/i18n/config.ts +1 -1
  124. package/dist/templates/web-nextjs/apps/web/src/infra/db/SupabaseAuthRepository.ts +48 -4
  125. package/dist/templates/web-nextjs/apps/web/src/infra/db/client.ts +1 -4
  126. package/dist/templates/web-nextjs/apps/web/src/lib/supabase/admin.ts +23 -0
  127. package/dist/templates/web-nextjs/apps/web/src/lib/utils.ts +2 -2
  128. package/dist/templates/web-nextjs/apps/web/src/lib/validations/auth.ts +13 -0
  129. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/client.ts +66 -0
  130. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/crypto.ts +99 -0
  131. package/dist/templates/web-nextjs/apps/web/src/lib/wechat-pay/types.ts +10 -0
  132. package/dist/templates/web-nextjs/apps/web/src/styles/tokens.css +58 -0
  133. package/dist/templates/web-nextjs/pnpm-lock.yaml +319 -0
  134. package/dist/templates/web-nextjs/supabase/migrations/20250608_add_subscription_tables.sql +125 -0
  135. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
- import { cn } from "@/lib/utils"
1
+ import { cn } from '@/lib/utils'
2
2
 
3
- function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
3
+ function Skeleton({ className, ...props }: React.ComponentProps<'div'>) {
4
4
  return (
5
5
  <div
6
6
  data-slot="skeleton"
7
- className={cn("animate-pulse rounded-md bg-accent", className)}
7
+ className={cn('animate-pulse rounded-md bg-accent', className)}
8
8
  {...props}
9
9
  />
10
10
  )
@@ -1,9 +1,9 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { Slider as SliderPrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { Slider as SliderPrimitive } from 'radix-ui'
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from '@/lib/utils'
7
7
 
8
8
  function Slider({
9
9
  className,
@@ -14,13 +14,8 @@ function Slider({
14
14
  ...props
15
15
  }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
16
  const _values = React.useMemo(
17
- () =>
18
- Array.isArray(value)
19
- ? value
20
- : Array.isArray(defaultValue)
21
- ? defaultValue
22
- : [min, max],
23
- [value, defaultValue, min, max]
17
+ () => (Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max]),
18
+ [value, defaultValue, min, max],
24
19
  )
25
20
 
26
21
  return (
@@ -31,21 +26,21 @@ function Slider({
31
26
  min={min}
32
27
  max={max}
33
28
  className={cn(
34
- "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
35
- className
29
+ 'relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col',
30
+ className,
36
31
  )}
37
32
  {...props}
38
33
  >
39
34
  <SliderPrimitive.Track
40
35
  data-slot="slider-track"
41
36
  className={cn(
42
- "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
37
+ 'relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5',
43
38
  )}
44
39
  >
45
40
  <SliderPrimitive.Range
46
41
  data-slot="slider-range"
47
42
  className={cn(
48
- "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
43
+ 'absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full',
49
44
  )}
50
45
  />
51
46
  </SliderPrimitive.Track>
@@ -1,7 +1,13 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import { Toaster as Sonner, type ToasterProps } from "sonner"
4
- import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react"
3
+ import { Toaster as Sonner, type ToasterProps } from 'sonner'
4
+ import {
5
+ CircleCheckIcon,
6
+ InfoIcon,
7
+ TriangleAlertIcon,
8
+ OctagonXIcon,
9
+ Loader2Icon,
10
+ } from 'lucide-react'
5
11
 
6
12
  /**
7
13
  * Toaster wrapping Sonner with consistent icon set and shadcn CSS variable theming.
@@ -22,10 +28,10 @@ const Toaster = ({ ...props }: ToasterProps) => {
22
28
  }}
23
29
  style={
24
30
  {
25
- "--normal-bg": "var(--popover)",
26
- "--normal-text": "var(--popover-foreground)",
27
- "--normal-border": "var(--border)",
28
- "--border-radius": "var(--radius)",
31
+ '--normal-bg': 'var(--popover)',
32
+ '--normal-text': 'var(--popover-foreground)',
33
+ '--normal-border': 'var(--border)',
34
+ '--border-radius': 'var(--radius)',
29
35
  } as React.CSSProperties
30
36
  }
31
37
  {...props}
@@ -1,31 +1,31 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { Switch as SwitchPrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { Switch as SwitchPrimitive } from 'radix-ui'
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from '@/lib/utils'
7
7
 
8
8
  function Switch({
9
9
  className,
10
- size = "default",
10
+ size = 'default',
11
11
  ...props
12
12
  }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
13
- size?: "sm" | "default"
13
+ size?: 'sm' | 'default'
14
14
  }) {
15
15
  return (
16
16
  <SwitchPrimitive.Root
17
17
  data-slot="switch"
18
18
  data-size={size}
19
19
  className={cn(
20
- "peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
21
- className
20
+ 'peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80',
21
+ className,
22
22
  )}
23
23
  {...props}
24
24
  >
25
25
  <SwitchPrimitive.Thumb
26
26
  data-slot="switch-thumb"
27
27
  className={cn(
28
- "pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"
28
+ 'pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground',
29
29
  )}
30
30
  />
31
31
  </SwitchPrimitive.Root>
@@ -1,116 +1,92 @@
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 Table({ className, ...props }: React.ComponentProps<"table">) {
7
+ function Table({ className, ...props }: React.ComponentProps<'table'>) {
8
8
  return (
9
- <div
10
- data-slot="table-container"
11
- className="relative w-full overflow-x-auto"
12
- >
9
+ <div data-slot="table-container" className="relative w-full overflow-x-auto">
13
10
  <table
14
11
  data-slot="table"
15
- className={cn("w-full caption-bottom text-sm", className)}
12
+ className={cn('w-full caption-bottom text-sm', className)}
16
13
  {...props}
17
14
  />
18
15
  </div>
19
16
  )
20
17
  }
21
18
 
22
- function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
23
- return (
24
- <thead
25
- data-slot="table-header"
26
- className={cn("[&_tr]:border-b", className)}
27
- {...props}
28
- />
29
- )
19
+ function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
20
+ return <thead data-slot="table-header" className={cn('[&_tr]:border-b', className)} {...props} />
30
21
  }
31
22
 
32
- function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
23
+ function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
33
24
  return (
34
25
  <tbody
35
26
  data-slot="table-body"
36
- className={cn("[&_tr:last-child]:border-0", className)}
27
+ className={cn('[&_tr:last-child]:border-0', className)}
37
28
  {...props}
38
29
  />
39
30
  )
40
31
  }
41
32
 
42
- function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
33
+ function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
43
34
  return (
44
35
  <tfoot
45
36
  data-slot="table-footer"
46
- className={cn(
47
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
48
- className
49
- )}
37
+ className={cn('border-t bg-muted/50 font-medium [&>tr]:last:border-b-0', className)}
50
38
  {...props}
51
39
  />
52
40
  )
53
41
  }
54
42
 
55
- function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
43
+ function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
56
44
  return (
57
45
  <tr
58
46
  data-slot="table-row"
59
47
  className={cn(
60
- "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
61
- className
48
+ 'border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted',
49
+ className,
62
50
  )}
63
51
  {...props}
64
52
  />
65
53
  )
66
54
  }
67
55
 
68
- function TableHead({ className, ...props }: React.ComponentProps<"th">) {
56
+ function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
69
57
  return (
70
58
  <th
71
59
  data-slot="table-head"
72
60
  className={cn(
73
- "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
74
- className
61
+ 'h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
62
+ className,
75
63
  )}
76
64
  {...props}
77
65
  />
78
66
  )
79
67
  }
80
68
 
81
- function TableCell({ className, ...props }: React.ComponentProps<"td">) {
69
+ function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
82
70
  return (
83
71
  <td
84
72
  data-slot="table-cell"
85
73
  className={cn(
86
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
87
- className
74
+ 'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
75
+ className,
88
76
  )}
89
77
  {...props}
90
78
  />
91
79
  )
92
80
  }
93
81
 
94
- function TableCaption({
95
- className,
96
- ...props
97
- }: React.ComponentProps<"caption">) {
82
+ function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
98
83
  return (
99
84
  <caption
100
85
  data-slot="table-caption"
101
- className={cn("mt-4 text-sm text-muted-foreground", className)}
86
+ className={cn('mt-4 text-sm text-muted-foreground', className)}
102
87
  {...props}
103
88
  />
104
89
  )
105
90
  }
106
91
 
107
- export {
108
- Table,
109
- TableHeader,
110
- TableBody,
111
- TableFooter,
112
- TableHead,
113
- TableRow,
114
- TableCell,
115
- TableCaption,
116
- }
92
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }
@@ -1,14 +1,14 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { Tabs as TabsPrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { cva, type VariantProps } from 'class-variance-authority'
5
+ import { Tabs as TabsPrimitive } from 'radix-ui'
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from '@/lib/utils'
8
8
 
9
9
  function Tabs({
10
10
  className,
11
- orientation = "horizontal",
11
+ orientation = 'horizontal',
12
12
  ...props
13
13
  }: React.ComponentProps<typeof TabsPrimitive.Root>) {
14
14
  return (
@@ -16,36 +16,32 @@ function Tabs({
16
16
  data-slot="tabs"
17
17
  data-orientation={orientation}
18
18
  orientation={orientation}
19
- className={cn(
20
- "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
21
- className
22
- )}
19
+ className={cn('group/tabs flex gap-2 data-[orientation=horizontal]:flex-col', className)}
23
20
  {...props}
24
21
  />
25
22
  )
26
23
  }
27
24
 
28
25
  const tabsListVariants = cva(
29
- "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",
26
+ 'group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none',
30
27
  {
31
28
  variants: {
32
29
  variant: {
33
- default: "bg-muted",
34
- line: "gap-1 bg-transparent",
30
+ default: 'bg-muted',
31
+ line: 'gap-1 bg-transparent',
35
32
  },
36
33
  },
37
34
  defaultVariants: {
38
- variant: "default",
35
+ variant: 'default',
39
36
  },
40
- }
37
+ },
41
38
  )
42
39
 
43
40
  function TabsList({
44
41
  className,
45
- variant = "default",
42
+ variant = 'default',
46
43
  ...props
47
- }: React.ComponentProps<typeof TabsPrimitive.List> &
48
- VariantProps<typeof tabsListVariants>) {
44
+ }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>) {
49
45
  return (
50
46
  <TabsPrimitive.List
51
47
  data-slot="tabs-list"
@@ -56,33 +52,27 @@ function TabsList({
56
52
  )
57
53
  }
58
54
 
59
- function TabsTrigger({
60
- className,
61
- ...props
62
- }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
55
+ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
63
56
  return (
64
57
  <TabsPrimitive.Trigger
65
58
  data-slot="tabs-trigger"
66
59
  className={cn(
67
60
  "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
68
- "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
69
- "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground",
70
- "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
71
- className
61
+ 'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent',
62
+ 'data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground',
63
+ 'after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100',
64
+ className,
72
65
  )}
73
66
  {...props}
74
67
  />
75
68
  )
76
69
  }
77
70
 
78
- function TabsContent({
79
- className,
80
- ...props
81
- }: React.ComponentProps<typeof TabsPrimitive.Content>) {
71
+ function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
82
72
  return (
83
73
  <TabsPrimitive.Content
84
74
  data-slot="tabs-content"
85
- className={cn("flex-1 outline-none", className)}
75
+ className={cn('flex-1 outline-none', className)}
86
76
  {...props}
87
77
  />
88
78
  )
@@ -1,14 +1,14 @@
1
- import * as React from "react"
1
+ import * as React from 'react'
2
2
 
3
- import { cn } from "@/lib/utils"
3
+ import { cn } from '@/lib/utils'
4
4
 
5
- function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
5
+ function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
6
6
  return (
7
7
  <textarea
8
8
  data-slot="textarea"
9
9
  className={cn(
10
- "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
11
- className
10
+ 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40',
11
+ className,
12
12
  )}
13
13
  {...props}
14
14
  />
@@ -0,0 +1,23 @@
1
+ 'use client'
2
+
3
+ import { useTheme } from 'next-themes'
4
+ import { Sun, Moon } from 'lucide-react'
5
+ import { Button } from '@/components/ui/button'
6
+
7
+ export function ThemeToggle() {
8
+ const { theme, setTheme } = useTheme()
9
+
10
+ return (
11
+ <Button
12
+ variant="ghost"
13
+ size="icon"
14
+ onClick={() => setTheme(theme === 'dark' ? 'light' : 'dark')}
15
+ aria-label="Toggle theme"
16
+ className="min-h-[44px] min-w-[44px]"
17
+ >
18
+ <Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
19
+ <Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
20
+ <span className="sr-only">Toggle theme</span>
21
+ </Button>
22
+ )
23
+ }
@@ -1,19 +1,19 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { type VariantProps } from "class-variance-authority"
5
- import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { type VariantProps } from 'class-variance-authority'
5
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui'
6
6
 
7
- import { cn } from "@/lib/utils"
8
- import { toggleVariants } from "@/components/ui/toggle"
7
+ import { cn } from '@/lib/utils'
8
+ import { toggleVariants } from '@/components/ui/toggle'
9
9
 
10
10
  const ToggleGroupContext = React.createContext<
11
11
  VariantProps<typeof toggleVariants> & {
12
12
  spacing?: number
13
13
  }
14
14
  >({
15
- size: "default",
16
- variant: "default",
15
+ size: 'default',
16
+ variant: 'default',
17
17
  spacing: 0,
18
18
  })
19
19
 
@@ -34,10 +34,10 @@ function ToggleGroup({
34
34
  data-variant={variant}
35
35
  data-size={size}
36
36
  data-spacing={spacing}
37
- style={{ "--gap": spacing } as React.CSSProperties}
37
+ style={{ '--gap': spacing } as React.CSSProperties}
38
38
  className={cn(
39
- "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
40
- className
39
+ 'group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs',
40
+ className,
41
41
  )}
42
42
  {...props}
43
43
  >
@@ -54,8 +54,7 @@ function ToggleGroupItem({
54
54
  variant,
55
55
  size,
56
56
  ...props
57
- }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
58
- VariantProps<typeof toggleVariants>) {
57
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {
59
58
  const context = React.useContext(ToggleGroupContext)
60
59
 
61
60
  return (
@@ -69,9 +68,9 @@ function ToggleGroupItem({
69
68
  variant: context.variant || variant,
70
69
  size: context.size || size,
71
70
  }),
72
- "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
73
- "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
74
- className
71
+ 'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10',
72
+ 'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l',
73
+ className,
75
74
  )}
76
75
  {...props}
77
76
  >
@@ -1,31 +1,31 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { Toggle as TogglePrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { cva, type VariantProps } from 'class-variance-authority'
5
+ import { Toggle as TogglePrimitive } from 'radix-ui'
6
6
 
7
- import { cn } from "@/lib/utils"
7
+ import { cn } from '@/lib/utils'
8
8
 
9
9
  const toggleVariants = cva(
10
10
  "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
11
  {
12
12
  variants: {
13
13
  variant: {
14
- default: "bg-transparent",
14
+ default: 'bg-transparent',
15
15
  outline:
16
- "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
16
+ 'border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground',
17
17
  },
18
18
  size: {
19
- default: "h-9 min-w-9 px-2",
20
- sm: "h-8 min-w-8 px-1.5",
21
- lg: "h-10 min-w-10 px-2.5",
19
+ default: 'h-9 min-w-9 px-2',
20
+ sm: 'h-8 min-w-8 px-1.5',
21
+ lg: 'h-10 min-w-10 px-2.5',
22
22
  },
23
23
  },
24
24
  defaultVariants: {
25
- variant: "default",
26
- size: "default",
25
+ variant: 'default',
26
+ size: 'default',
27
27
  },
28
- }
28
+ },
29
29
  )
30
30
 
31
31
  function Toggle({
@@ -33,8 +33,7 @@ function Toggle({
33
33
  variant,
34
34
  size,
35
35
  ...props
36
- }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
- VariantProps<typeof toggleVariants>) {
36
+ }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {
38
37
  return (
39
38
  <TogglePrimitive.Root
40
39
  data-slot="toggle"
@@ -1,9 +1,9 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import { Tooltip as TooltipPrimitive } from "radix-ui"
3
+ import * as React from 'react'
4
+ import { Tooltip as TooltipPrimitive } from 'radix-ui'
5
5
 
6
- import { cn } from "@/lib/utils"
6
+ import { cn } from '@/lib/utils'
7
7
 
8
8
  function TooltipProvider({
9
9
  delayDuration = 0,
@@ -18,15 +18,11 @@ function TooltipProvider({
18
18
  )
19
19
  }
20
20
 
21
- function Tooltip({
22
- ...props
23
- }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
21
+ function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
24
22
  return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
25
23
  }
26
24
 
27
- function TooltipTrigger({
28
- ...props
29
- }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
25
+ function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
30
26
  return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
31
27
  }
32
28
 
@@ -42,8 +38,8 @@ function TooltipContent({
42
38
  data-slot="tooltip-content"
43
39
  sideOffset={sideOffset}
44
40
  className={cn(
45
- "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
46
- className
41
+ 'z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
42
+ className,
47
43
  )}
48
44
  {...props}
49
45
  >
@@ -9,4 +9,6 @@ export interface IAuthRepository {
9
9
  updateDisplayName(name: string): Promise<AuthResult>
10
10
  requestPasswordReset(email: string, redirectTo: string): Promise<void>
11
11
  resetPassword(password: string): Promise<AuthResult>
12
+ sendPasswordResetOTP(email: string): Promise<AuthResult>
13
+ verifyPasswordResetOTP(email: string, token: string, newPassword: string): Promise<AuthResult>
12
14
  }
@@ -9,6 +9,4 @@ export type AuthResult = {
9
9
  error: string | null
10
10
  }
11
11
 
12
- export type ActionResult<T = void> =
13
- | { data: T; error: null }
14
- | { data: null; error: string }
12
+ export type ActionResult<T = void> = { data: T; error: null } | { data: null; error: string }