create-ec-app 0.0.6 → 0.0.7

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 (95) hide show
  1. package/package.json +3 -2
  2. package/templates/base/.prettierrc.json +12 -0
  3. package/templates/base/README.md +73 -0
  4. package/templates/base/biome.json +54 -0
  5. package/templates/base/eslint.config.js +23 -0
  6. package/templates/base/index.html +13 -0
  7. package/templates/base/package-lock.json +3898 -0
  8. package/templates/base/package.json +42 -0
  9. package/templates/base/public/vite.svg +1 -0
  10. package/templates/base/src/App.css +0 -0
  11. package/templates/base/src/App.tsx +11 -0
  12. package/templates/base/src/global.d.ts +4 -0
  13. package/templates/base/src/index.css +1 -0
  14. package/templates/base/src/main.tsx +29 -0
  15. package/templates/base/tsconfig.app.json +32 -0
  16. package/templates/base/tsconfig.json +19 -0
  17. package/templates/base/tsconfig.node.json +26 -0
  18. package/templates/base/vite.config.ts +14 -0
  19. package/templates/targets/power-pages/.env +3 -0
  20. package/templates/targets/power-pages/README.md +180 -0
  21. package/templates/targets/power-pages/powerpages.config.json +5 -0
  22. package/templates/targets/power-pages/src/App.patch.tsx +17 -0
  23. package/templates/targets/power-pages/src/context/AuthContext.tsx +273 -0
  24. package/templates/targets/power-pages/src/main.patch.tsx +32 -0
  25. package/templates/targets/power-pages/vite.config.patch.ts +23 -0
  26. package/templates/targets/swa/.env +2 -0
  27. package/templates/targets/swa/package.patch.json +5 -0
  28. package/templates/targets/swa/staticwebapp.config.json +5 -0
  29. package/templates/targets/swa/swa-cli.config.json +14 -0
  30. package/templates/targets/webresource/README.md +263 -0
  31. package/templates/targets/webresource/src/services/AuthService.ts +38 -0
  32. package/templates/targets/webresource/token.json +8 -0
  33. package/templates/targets/webresource/vite.config.patch.ts +40 -0
  34. package/templates/ui/kendo/kendo-tw-preset.js +240 -0
  35. package/templates/ui/kendo/package.patch.json +7 -0
  36. package/templates/ui/kendo/src/main.patch.tsx +29 -0
  37. package/templates/ui/kendo/tailwind.config.js +14 -0
  38. package/templates/ui/shadcn-ui/components.json +22 -0
  39. package/templates/ui/shadcn-ui/package.patch.json +50 -0
  40. package/templates/ui/shadcn-ui/src/components/ui/accordion.tsx +64 -0
  41. package/templates/ui/shadcn-ui/src/components/ui/alert-dialog.tsx +155 -0
  42. package/templates/ui/shadcn-ui/src/components/ui/alert.tsx +66 -0
  43. package/templates/ui/shadcn-ui/src/components/ui/aspect-ratio.tsx +11 -0
  44. package/templates/ui/shadcn-ui/src/components/ui/avatar.tsx +51 -0
  45. package/templates/ui/shadcn-ui/src/components/ui/badge.tsx +46 -0
  46. package/templates/ui/shadcn-ui/src/components/ui/breadcrumb.tsx +109 -0
  47. package/templates/ui/shadcn-ui/src/components/ui/button-group.tsx +83 -0
  48. package/templates/ui/shadcn-ui/src/components/ui/button.tsx +60 -0
  49. package/templates/ui/shadcn-ui/src/components/ui/calendar.tsx +216 -0
  50. package/templates/ui/shadcn-ui/src/components/ui/card.tsx +92 -0
  51. package/templates/ui/shadcn-ui/src/components/ui/carousel.tsx +239 -0
  52. package/templates/ui/shadcn-ui/src/components/ui/chart.tsx +357 -0
  53. package/templates/ui/shadcn-ui/src/components/ui/checkbox.tsx +32 -0
  54. package/templates/ui/shadcn-ui/src/components/ui/collapsible.tsx +31 -0
  55. package/templates/ui/shadcn-ui/src/components/ui/command.tsx +182 -0
  56. package/templates/ui/shadcn-ui/src/components/ui/context-menu.tsx +252 -0
  57. package/templates/ui/shadcn-ui/src/components/ui/dialog.tsx +141 -0
  58. package/templates/ui/shadcn-ui/src/components/ui/drawer.tsx +135 -0
  59. package/templates/ui/shadcn-ui/src/components/ui/dropdown-menu.tsx +255 -0
  60. package/templates/ui/shadcn-ui/src/components/ui/empty.tsx +104 -0
  61. package/templates/ui/shadcn-ui/src/components/ui/field.tsx +246 -0
  62. package/templates/ui/shadcn-ui/src/components/ui/form.tsx +167 -0
  63. package/templates/ui/shadcn-ui/src/components/ui/hover-card.tsx +44 -0
  64. package/templates/ui/shadcn-ui/src/components/ui/input-group.tsx +170 -0
  65. package/templates/ui/shadcn-ui/src/components/ui/input-otp.tsx +75 -0
  66. package/templates/ui/shadcn-ui/src/components/ui/input.tsx +21 -0
  67. package/templates/ui/shadcn-ui/src/components/ui/item.tsx +193 -0
  68. package/templates/ui/shadcn-ui/src/components/ui/kbd.tsx +28 -0
  69. package/templates/ui/shadcn-ui/src/components/ui/label.tsx +24 -0
  70. package/templates/ui/shadcn-ui/src/components/ui/menubar.tsx +274 -0
  71. package/templates/ui/shadcn-ui/src/components/ui/navigation-menu.tsx +168 -0
  72. package/templates/ui/shadcn-ui/src/components/ui/pagination.tsx +127 -0
  73. package/templates/ui/shadcn-ui/src/components/ui/popover.tsx +48 -0
  74. package/templates/ui/shadcn-ui/src/components/ui/progress.tsx +29 -0
  75. package/templates/ui/shadcn-ui/src/components/ui/radio-group.tsx +45 -0
  76. package/templates/ui/shadcn-ui/src/components/ui/resizable.tsx +54 -0
  77. package/templates/ui/shadcn-ui/src/components/ui/scroll-area.tsx +58 -0
  78. package/templates/ui/shadcn-ui/src/components/ui/select.tsx +185 -0
  79. package/templates/ui/shadcn-ui/src/components/ui/separator.tsx +28 -0
  80. package/templates/ui/shadcn-ui/src/components/ui/sheet.tsx +137 -0
  81. package/templates/ui/shadcn-ui/src/components/ui/sidebar.tsx +726 -0
  82. package/templates/ui/shadcn-ui/src/components/ui/skeleton.tsx +13 -0
  83. package/templates/ui/shadcn-ui/src/components/ui/slider.tsx +63 -0
  84. package/templates/ui/shadcn-ui/src/components/ui/sonner.tsx +38 -0
  85. package/templates/ui/shadcn-ui/src/components/ui/spinner.tsx +16 -0
  86. package/templates/ui/shadcn-ui/src/components/ui/switch.tsx +31 -0
  87. package/templates/ui/shadcn-ui/src/components/ui/table.tsx +114 -0
  88. package/templates/ui/shadcn-ui/src/components/ui/tabs.tsx +66 -0
  89. package/templates/ui/shadcn-ui/src/components/ui/textarea.tsx +18 -0
  90. package/templates/ui/shadcn-ui/src/components/ui/toggle-group.tsx +81 -0
  91. package/templates/ui/shadcn-ui/src/components/ui/toggle.tsx +45 -0
  92. package/templates/ui/shadcn-ui/src/components/ui/tooltip.tsx +61 -0
  93. package/templates/ui/shadcn-ui/src/hooks/use-mobile.ts +19 -0
  94. package/templates/ui/shadcn-ui/src/index.patch.css +121 -0
  95. package/templates/ui/shadcn-ui/src/lib/utils.ts +6 -0
@@ -0,0 +1,45 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
5
+ import { CircleIcon } from "lucide-react"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function RadioGroup({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
13
+ return (
14
+ <RadioGroupPrimitive.Root
15
+ data-slot="radio-group"
16
+ className={cn("grid gap-3", className)}
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ function RadioGroupItem({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
26
+ return (
27
+ <RadioGroupPrimitive.Item
28
+ data-slot="radio-group-item"
29
+ className={cn(
30
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
31
+ className
32
+ )}
33
+ {...props}
34
+ >
35
+ <RadioGroupPrimitive.Indicator
36
+ data-slot="radio-group-indicator"
37
+ className="relative flex items-center justify-center"
38
+ >
39
+ <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
40
+ </RadioGroupPrimitive.Indicator>
41
+ </RadioGroupPrimitive.Item>
42
+ )
43
+ }
44
+
45
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,54 @@
1
+ import * as React from "react"
2
+ import { GripVerticalIcon } from "lucide-react"
3
+ import * as ResizablePrimitive from "react-resizable-panels"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function ResizablePanelGroup({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
11
+ return (
12
+ <ResizablePrimitive.PanelGroup
13
+ data-slot="resizable-panel-group"
14
+ className={cn(
15
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function ResizablePanel({
24
+ ...props
25
+ }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
26
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
27
+ }
28
+
29
+ function ResizableHandle({
30
+ withHandle,
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
34
+ withHandle?: boolean
35
+ }) {
36
+ return (
37
+ <ResizablePrimitive.PanelResizeHandle
38
+ data-slot="resizable-handle"
39
+ className={cn(
40
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ {withHandle && (
46
+ <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
47
+ <GripVerticalIcon className="size-2.5" />
48
+ </div>
49
+ )}
50
+ </ResizablePrimitive.PanelResizeHandle>
51
+ )
52
+ }
53
+
54
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
@@ -0,0 +1,58 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function ScrollArea({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
13
+ return (
14
+ <ScrollAreaPrimitive.Root
15
+ data-slot="scroll-area"
16
+ className={cn("relative", className)}
17
+ {...props}
18
+ >
19
+ <ScrollAreaPrimitive.Viewport
20
+ data-slot="scroll-area-viewport"
21
+ className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
22
+ >
23
+ {children}
24
+ </ScrollAreaPrimitive.Viewport>
25
+ <ScrollBar />
26
+ <ScrollAreaPrimitive.Corner />
27
+ </ScrollAreaPrimitive.Root>
28
+ )
29
+ }
30
+
31
+ function ScrollBar({
32
+ className,
33
+ orientation = "vertical",
34
+ ...props
35
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
36
+ return (
37
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
38
+ data-slot="scroll-area-scrollbar"
39
+ orientation={orientation}
40
+ className={cn(
41
+ "flex touch-none p-px transition-colors select-none",
42
+ orientation === "vertical" &&
43
+ "h-full w-2.5 border-l border-l-transparent",
44
+ orientation === "horizontal" &&
45
+ "h-2.5 flex-col border-t border-t-transparent",
46
+ className
47
+ )}
48
+ {...props}
49
+ >
50
+ <ScrollAreaPrimitive.ScrollAreaThumb
51
+ data-slot="scroll-area-thumb"
52
+ className="bg-border relative flex-1 rounded-full"
53
+ />
54
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
55
+ )
56
+ }
57
+
58
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,185 @@
1
+ import * as React from "react"
2
+ import * as SelectPrimitive from "@radix-ui/react-select"
3
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Select({
8
+ ...props
9
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
10
+ return <SelectPrimitive.Root data-slot="select" {...props} />
11
+ }
12
+
13
+ function SelectGroup({
14
+ ...props
15
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
16
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />
17
+ }
18
+
19
+ function SelectValue({
20
+ ...props
21
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
22
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
23
+ }
24
+
25
+ function SelectTrigger({
26
+ className,
27
+ size = "default",
28
+ children,
29
+ ...props
30
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
31
+ size?: "sm" | "default"
32
+ }) {
33
+ return (
34
+ <SelectPrimitive.Trigger
35
+ data-slot="select-trigger"
36
+ data-size={size}
37
+ className={cn(
38
+ "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
39
+ className
40
+ )}
41
+ {...props}
42
+ >
43
+ {children}
44
+ <SelectPrimitive.Icon asChild>
45
+ <ChevronDownIcon className="size-4 opacity-50" />
46
+ </SelectPrimitive.Icon>
47
+ </SelectPrimitive.Trigger>
48
+ )
49
+ }
50
+
51
+ function SelectContent({
52
+ className,
53
+ children,
54
+ position = "popper",
55
+ align = "center",
56
+ ...props
57
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
58
+ return (
59
+ <SelectPrimitive.Portal>
60
+ <SelectPrimitive.Content
61
+ data-slot="select-content"
62
+ className={cn(
63
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
64
+ position === "popper" &&
65
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
66
+ className
67
+ )}
68
+ position={position}
69
+ align={align}
70
+ {...props}
71
+ >
72
+ <SelectScrollUpButton />
73
+ <SelectPrimitive.Viewport
74
+ className={cn(
75
+ "p-1",
76
+ position === "popper" &&
77
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
78
+ )}
79
+ >
80
+ {children}
81
+ </SelectPrimitive.Viewport>
82
+ <SelectScrollDownButton />
83
+ </SelectPrimitive.Content>
84
+ </SelectPrimitive.Portal>
85
+ )
86
+ }
87
+
88
+ function SelectLabel({
89
+ className,
90
+ ...props
91
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
92
+ return (
93
+ <SelectPrimitive.Label
94
+ data-slot="select-label"
95
+ className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
96
+ {...props}
97
+ />
98
+ )
99
+ }
100
+
101
+ function SelectItem({
102
+ className,
103
+ children,
104
+ ...props
105
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
106
+ return (
107
+ <SelectPrimitive.Item
108
+ data-slot="select-item"
109
+ className={cn(
110
+ "focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ <span className="absolute right-2 flex size-3.5 items-center justify-center">
116
+ <SelectPrimitive.ItemIndicator>
117
+ <CheckIcon className="size-4" />
118
+ </SelectPrimitive.ItemIndicator>
119
+ </span>
120
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
121
+ </SelectPrimitive.Item>
122
+ )
123
+ }
124
+
125
+ function SelectSeparator({
126
+ className,
127
+ ...props
128
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
129
+ return (
130
+ <SelectPrimitive.Separator
131
+ data-slot="select-separator"
132
+ className={cn("bg-border pointer-events-none -mx-1 my-1 h-px", className)}
133
+ {...props}
134
+ />
135
+ )
136
+ }
137
+
138
+ function SelectScrollUpButton({
139
+ className,
140
+ ...props
141
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
142
+ return (
143
+ <SelectPrimitive.ScrollUpButton
144
+ data-slot="select-scroll-up-button"
145
+ className={cn(
146
+ "flex cursor-default items-center justify-center py-1",
147
+ className
148
+ )}
149
+ {...props}
150
+ >
151
+ <ChevronUpIcon className="size-4" />
152
+ </SelectPrimitive.ScrollUpButton>
153
+ )
154
+ }
155
+
156
+ function SelectScrollDownButton({
157
+ className,
158
+ ...props
159
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
160
+ return (
161
+ <SelectPrimitive.ScrollDownButton
162
+ data-slot="select-scroll-down-button"
163
+ className={cn(
164
+ "flex cursor-default items-center justify-center py-1",
165
+ className
166
+ )}
167
+ {...props}
168
+ >
169
+ <ChevronDownIcon className="size-4" />
170
+ </SelectPrimitive.ScrollDownButton>
171
+ )
172
+ }
173
+
174
+ export {
175
+ Select,
176
+ SelectContent,
177
+ SelectGroup,
178
+ SelectItem,
179
+ SelectLabel,
180
+ SelectScrollDownButton,
181
+ SelectScrollUpButton,
182
+ SelectSeparator,
183
+ SelectTrigger,
184
+ SelectValue,
185
+ }
@@ -0,0 +1,28 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as SeparatorPrimitive from "@radix-ui/react-separator"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Separator({
9
+ className,
10
+ orientation = "horizontal",
11
+ decorative = true,
12
+ ...props
13
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
14
+ return (
15
+ <SeparatorPrimitive.Root
16
+ data-slot="separator"
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ export { Separator }
@@ -0,0 +1,137 @@
1
+ import * as React from "react"
2
+ import * as SheetPrimitive from "@radix-ui/react-dialog"
3
+ import { XIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
8
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />
9
+ }
10
+
11
+ function SheetTrigger({
12
+ ...props
13
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
14
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
15
+ }
16
+
17
+ function SheetClose({
18
+ ...props
19
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
20
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
21
+ }
22
+
23
+ function SheetPortal({
24
+ ...props
25
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
26
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
27
+ }
28
+
29
+ function SheetOverlay({
30
+ className,
31
+ ...props
32
+ }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
33
+ return (
34
+ <SheetPrimitive.Overlay
35
+ data-slot="sheet-overlay"
36
+ className={cn(
37
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
38
+ className
39
+ )}
40
+ {...props}
41
+ />
42
+ )
43
+ }
44
+
45
+ function SheetContent({
46
+ className,
47
+ children,
48
+ side = "right",
49
+ ...props
50
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
51
+ side?: "top" | "right" | "bottom" | "left"
52
+ }) {
53
+ return (
54
+ <SheetPortal>
55
+ <SheetOverlay />
56
+ <SheetPrimitive.Content
57
+ data-slot="sheet-content"
58
+ className={cn(
59
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
60
+ side === "right" &&
61
+ "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
62
+ side === "left" &&
63
+ "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
64
+ side === "top" &&
65
+ "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
66
+ side === "bottom" &&
67
+ "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
68
+ className
69
+ )}
70
+ {...props}
71
+ >
72
+ {children}
73
+ <SheetPrimitive.Close className="ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none">
74
+ <XIcon className="size-4" />
75
+ <span className="sr-only">Close</span>
76
+ </SheetPrimitive.Close>
77
+ </SheetPrimitive.Content>
78
+ </SheetPortal>
79
+ )
80
+ }
81
+
82
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
83
+ return (
84
+ <div
85
+ data-slot="sheet-header"
86
+ className={cn("flex flex-col gap-1.5 p-4", className)}
87
+ {...props}
88
+ />
89
+ )
90
+ }
91
+
92
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
93
+ return (
94
+ <div
95
+ data-slot="sheet-footer"
96
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function SheetTitle({
103
+ className,
104
+ ...props
105
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
106
+ return (
107
+ <SheetPrimitive.Title
108
+ data-slot="sheet-title"
109
+ className={cn("text-foreground font-semibold", className)}
110
+ {...props}
111
+ />
112
+ )
113
+ }
114
+
115
+ function SheetDescription({
116
+ className,
117
+ ...props
118
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
119
+ return (
120
+ <SheetPrimitive.Description
121
+ data-slot="sheet-description"
122
+ className={cn("text-muted-foreground text-sm", className)}
123
+ {...props}
124
+ />
125
+ )
126
+ }
127
+
128
+ export {
129
+ Sheet,
130
+ SheetTrigger,
131
+ SheetClose,
132
+ SheetContent,
133
+ SheetHeader,
134
+ SheetFooter,
135
+ SheetTitle,
136
+ SheetDescription,
137
+ }