@phsa.tec/design-system-react 0.1.6 → 0.1.8

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 (213) hide show
  1. package/README.md +390 -209
  2. package/dist/index.d.mts +485 -0
  3. package/dist/index.d.ts +485 -0
  4. package/dist/index.js +4259 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +4186 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +46 -6
  9. package/.eslintrc.json +0 -7
  10. package/.github/workflows/deploy-storybook.yml +0 -75
  11. package/.storybook/main.ts +0 -16
  12. package/.storybook/preview.ts +0 -15
  13. package/components.json +0 -21
  14. package/jest.config.ts +0 -25
  15. package/next.config.ts +0 -7
  16. package/postcss.config.mjs +0 -8
  17. package/public/file.svg +0 -1
  18. package/public/globe.svg +0 -1
  19. package/public/next.svg +0 -1
  20. package/public/vercel.svg +0 -1
  21. package/public/window.svg +0 -1
  22. package/src/app/columns.tsx +0 -178
  23. package/src/app/favicon.ico +0 -0
  24. package/src/app/fonts/GeistMonoVF.woff +0 -0
  25. package/src/app/fonts/GeistVF.woff +0 -0
  26. package/src/app/globals.css +0 -94
  27. package/src/app/layout.tsx +0 -35
  28. package/src/app/page.tsx +0 -7
  29. package/src/components/actions/AlertDialog/AlertDialog.tsx +0 -45
  30. package/src/components/actions/AlertDialog/alert-dialog.stories.tsx +0 -21
  31. package/src/components/actions/AlertDialog/index.ts +0 -1
  32. package/src/components/actions/Button/Button.stories.ts +0 -38
  33. package/src/components/actions/Button/Button.tsx +0 -23
  34. package/src/components/actions/Button/index.ts +0 -1
  35. package/src/components/actions/Collapsible/index.ts +0 -1
  36. package/src/components/actions/Dialog/Dialog.stories.tsx +0 -70
  37. package/src/components/actions/Dialog/Dialog.tsx +0 -87
  38. package/src/components/actions/Dialog/components/DialogWithActions/index.tsx +0 -40
  39. package/src/components/actions/Dialog/index.ts +0 -1
  40. package/src/components/actions/Steps/Steps.stories.tsx +0 -25
  41. package/src/components/actions/Steps/Steps.tsx +0 -51
  42. package/src/components/actions/Steps/index.ts +0 -1
  43. package/src/components/actions/index.ts +0 -5
  44. package/src/components/dataDisplay/Avatar/Avatar.stories.tsx +0 -22
  45. package/src/components/dataDisplay/Avatar/Avatar.tsx +0 -21
  46. package/src/components/dataDisplay/Avatar/index.ts +0 -2
  47. package/src/components/dataDisplay/Badge/Badge.stories.tsx +0 -36
  48. package/src/components/dataDisplay/Badge/index.ts +0 -1
  49. package/src/components/dataDisplay/Card/Card.stories.tsx +0 -24
  50. package/src/components/dataDisplay/Card/Card.tsx +0 -34
  51. package/src/components/dataDisplay/Card/index.ts +0 -1
  52. package/src/components/dataDisplay/DataPairList/DataPairList.tsx +0 -56
  53. package/src/components/dataDisplay/DataPairList/data-pair-list.stories.tsx +0 -87
  54. package/src/components/dataDisplay/DataPairList/index.ts +0 -2
  55. package/src/components/dataDisplay/DataPairList/types.ts +0 -10
  56. package/src/components/dataDisplay/DropDownMenu/index.ts +0 -1
  57. package/src/components/dataDisplay/ErrorMessage/ErrorMessage.tsx +0 -6
  58. package/src/components/dataDisplay/ErrorMessage/index.ts +0 -1
  59. package/src/components/dataDisplay/Icon/Icon.stories.tsx +0 -21
  60. package/src/components/dataDisplay/Icon/Icon.tsx +0 -47
  61. package/src/components/dataDisplay/Icon/index.ts +0 -1
  62. package/src/components/dataDisplay/Icon/types.ts +0 -6
  63. package/src/components/dataDisplay/Label/Label.stories.tsx +0 -21
  64. package/src/components/dataDisplay/Label/Label.tsx +0 -10
  65. package/src/components/dataDisplay/Label/index.ts +0 -1
  66. package/src/components/dataDisplay/Table/Table.tsx +0 -173
  67. package/src/components/dataDisplay/Table/columns.tsx +0 -223
  68. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-column-header.tsx +0 -72
  69. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-pagination.tsx +0 -91
  70. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-toolbar.tsx +0 -17
  71. package/src/components/dataDisplay/Table/components/DynamicTable/data-table-view-options.tsx +0 -58
  72. package/src/components/dataDisplay/Table/components/DynamicTable/data-table.stories.tsx +0 -118
  73. package/src/components/dataDisplay/Table/components/DynamicTable/index.tsx +0 -136
  74. package/src/components/dataDisplay/Table/components/DynamicTable/types.ts +0 -43
  75. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-column-header.tsx +0 -71
  76. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-faceted-filter.tsx +0 -147
  77. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-pagination.tsx +0 -97
  78. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-row-actions.tsx +0 -78
  79. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-toolbar.tsx +0 -60
  80. package/src/components/dataDisplay/Table/custom/CustomTable/data-table-view-options.tsx +0 -59
  81. package/src/components/dataDisplay/Table/custom/CustomTable/data-table.tsx +0 -145
  82. package/src/components/dataDisplay/Table/custom/CustomTable/data.ts +0 -71
  83. package/src/components/dataDisplay/Table/custom/CustomTable/index.tsx +0 -34
  84. package/src/components/dataDisplay/Table/custom/CustomTable/schema.ts +0 -11
  85. package/src/components/dataDisplay/Table/index.ts +0 -2
  86. package/src/components/dataDisplay/Table/table.stories.tsx +0 -147
  87. package/src/components/dataDisplay/Table/types.ts +0 -15
  88. package/src/components/dataDisplay/Tabs/Tabs.stories.tsx +0 -34
  89. package/src/components/dataDisplay/Tabs/Tabs.tsx +0 -53
  90. package/src/components/dataDisplay/Tabs/index.ts +0 -1
  91. package/src/components/dataDisplay/Text/Text.stories.tsx +0 -66
  92. package/src/components/dataDisplay/Text/Text.tsx +0 -56
  93. package/src/components/dataDisplay/Text/index.ts +0 -1
  94. package/src/components/dataDisplay/index.ts +0 -8
  95. package/src/components/dataInput/Input/components/Input/Input.stories.tsx +0 -99
  96. package/src/components/dataInput/Input/components/Input/InputBase.tsx +0 -50
  97. package/src/components/dataInput/Input/components/Input/__tests__/input.test.tsx +0 -38
  98. package/src/components/dataInput/Input/components/Input/index.tsx +0 -48
  99. package/src/components/dataInput/Input/components/Input/types.ts +0 -15
  100. package/src/components/dataInput/Input/components/InputBase/index.tsx +0 -31
  101. package/src/components/dataInput/Input/components/MaskInput/__tests__/mask-input.test.tsx +0 -77
  102. package/src/components/dataInput/Input/components/MaskInput/index.ts +0 -1
  103. package/src/components/dataInput/Input/components/MaskInput/mask-input.stories.tsx +0 -85
  104. package/src/components/dataInput/Input/components/MaskInput/mask-input.tsx +0 -73
  105. package/src/components/dataInput/Input/components/MultipleInput/MultipleInput.tsx +0 -105
  106. package/src/components/dataInput/Input/components/MultipleInput/MultipleInputBase.tsx +0 -100
  107. package/src/components/dataInput/Input/components/MultipleInput/MultipleMaskInput.tsx +0 -35
  108. package/src/components/dataInput/Input/components/MultipleInput/MultipleNumberInput.tsx +0 -35
  109. package/src/components/dataInput/Input/components/MultipleInput/__tests__/multiple-input.test.tsx +0 -152
  110. package/src/components/dataInput/Input/components/MultipleInput/index.ts +0 -2
  111. package/src/components/dataInput/Input/components/MultipleInput/multiple-input.stories.tsx +0 -96
  112. package/src/components/dataInput/Input/components/NumberInput/__tests__/number-input.test.tsx +0 -175
  113. package/src/components/dataInput/Input/components/NumberInput/index.ts +0 -1
  114. package/src/components/dataInput/Input/components/NumberInput/number-input.stories.tsx +0 -76
  115. package/src/components/dataInput/Input/components/NumberInput/number-input.tsx +0 -70
  116. package/src/components/dataInput/Input/index.ts +0 -4
  117. package/src/components/dataInput/Select/MultiSelect/MultiSelect.stories.tsx +0 -119
  118. package/src/components/dataInput/Select/MultiSelect/MultiSelectBase.tsx +0 -135
  119. package/src/components/dataInput/Select/MultiSelect/index.tsx +0 -75
  120. package/src/components/dataInput/Select/Select.stories.tsx +0 -61
  121. package/src/components/dataInput/Select/Select.tsx +0 -73
  122. package/src/components/dataInput/Select/SelectBase.tsx +0 -58
  123. package/src/components/dataInput/Select/index.ts +0 -2
  124. package/src/components/dataInput/Switch/Switch.stories.tsx +0 -75
  125. package/src/components/dataInput/Switch/Switch.tsx +0 -52
  126. package/src/components/dataInput/Switch/index.ts +0 -1
  127. package/src/components/dataInput/checkbox/Checkbox.tsx +0 -57
  128. package/src/components/dataInput/checkbox/Checkbox_old.tsx +0 -58
  129. package/src/components/dataInput/checkbox/Checkout.stories.tsx +0 -62
  130. package/src/components/dataInput/checkbox/index.ts +0 -1
  131. package/src/components/dataInput/form/Form.tsx +0 -47
  132. package/src/components/dataInput/form/index.ts +0 -3
  133. package/src/components/dataInput/index.ts +0 -5
  134. package/src/components/feedback/ErrorLabel/index.tsx +0 -24
  135. package/src/components/feedback/Spinner/index.ts +0 -1
  136. package/src/components/feedback/Toast/Toast.stories.tsx +0 -45
  137. package/src/components/feedback/Toast/index.ts +0 -2
  138. package/src/components/feedback/index.ts +0 -2
  139. package/src/components/index.ts +0 -6
  140. package/src/components/layout/Crud/components/Table/index.tsx +0 -183
  141. package/src/components/layout/Crud/components/Table/types.ts +0 -15
  142. package/src/components/layout/Crud/crud.stories.tsx +0 -317
  143. package/src/components/layout/Crud/hook/useCrudLayout/index.tsx +0 -94
  144. package/src/components/layout/Crud/hook/useRequest/index.tsx +0 -156
  145. package/src/components/layout/Crud/index.tsx +0 -295
  146. package/src/components/layout/Crud/store/CrudLayoutStore.ts +0 -75
  147. package/src/components/layout/Crud/types.ts +0 -14
  148. package/src/components/layout/Drawer/CustomDrawer/index.tsx +0 -33
  149. package/src/components/layout/Drawer/Drawer.stories.tsx +0 -80
  150. package/src/components/layout/Drawer/index.ts +0 -2
  151. package/src/components/layout/PageLayout/PageLayout.stories.tsx +0 -42
  152. package/src/components/layout/PageLayout/index.tsx +0 -28
  153. package/src/components/layout/Separator/index.ts +0 -1
  154. package/src/components/layout/Sheet/Sheet.stories.tsx +0 -28
  155. package/src/components/layout/Sheet/Sheet.tsx +0 -22
  156. package/src/components/layout/Sheet/index.ts +0 -1
  157. package/src/components/layout/Sidebar/Sidebar.stories.tsx +0 -116
  158. package/src/components/layout/Sidebar/Sidebar.tsx +0 -50
  159. package/src/components/layout/Sidebar/components/app-sidebar.tsx +0 -203
  160. package/src/components/layout/Sidebar/components/footer-sidebar.tsx +0 -17
  161. package/src/components/layout/Sidebar/components/header-sidebar.tsx +0 -90
  162. package/src/components/layout/Sidebar/components/menus.tsx +0 -55
  163. package/src/components/layout/Sidebar/components/nav-projects.tsx +0 -88
  164. package/src/components/layout/Sidebar/components/nav-user.tsx +0 -114
  165. package/src/components/layout/Sidebar/components/team-switcher.tsx +0 -85
  166. package/src/components/layout/Sidebar/index.ts +0 -2
  167. package/src/components/layout/Sidebar/provider/index.tsx +0 -51
  168. package/src/components/layout/Tabs/Tabs.tsx +0 -51
  169. package/src/components/layout/Tabs/index.ts +0 -1
  170. package/src/components/layout/Tabs/tabs.stories.tsx +0 -57
  171. package/src/components/layout/index.ts +0 -6
  172. package/src/components/navigation/Breadcrumbs/Breadcrumbs.tsx +0 -66
  173. package/src/components/navigation/Breadcrumbs/index.ts +0 -2
  174. package/src/components/navigation/index.ts +0 -1
  175. package/src/components/ui/alert-dialog.tsx +0 -141
  176. package/src/components/ui/alert.tsx +0 -59
  177. package/src/components/ui/avatar.tsx +0 -50
  178. package/src/components/ui/badge.tsx +0 -40
  179. package/src/components/ui/breadcrumb.tsx +0 -115
  180. package/src/components/ui/button.tsx +0 -57
  181. package/src/components/ui/card.tsx +0 -83
  182. package/src/components/ui/checkbox.tsx +0 -34
  183. package/src/components/ui/collapsible.tsx +0 -11
  184. package/src/components/ui/command.tsx +0 -153
  185. package/src/components/ui/dialog.tsx +0 -124
  186. package/src/components/ui/drawer.tsx +0 -117
  187. package/src/components/ui/dropdown-menu.tsx +0 -201
  188. package/src/components/ui/form.tsx +0 -179
  189. package/src/components/ui/input.tsx +0 -24
  190. package/src/components/ui/label.tsx +0 -30
  191. package/src/components/ui/popover.tsx +0 -33
  192. package/src/components/ui/select.tsx +0 -161
  193. package/src/components/ui/separator.tsx +0 -31
  194. package/src/components/ui/sheet.tsx +0 -140
  195. package/src/components/ui/sidebar.tsx +0 -763
  196. package/src/components/ui/skeleton.tsx +0 -15
  197. package/src/components/ui/sonner.tsx +0 -31
  198. package/src/components/ui/spinner.tsx +0 -54
  199. package/src/components/ui/switch.tsx +0 -33
  200. package/src/components/ui/table.tsx +0 -120
  201. package/src/components/ui/tabs.tsx +0 -55
  202. package/src/components/ui/toast.tsx +0 -130
  203. package/src/components/ui/toaster.tsx +0 -35
  204. package/src/components/ui/tooltip.tsx +0 -32
  205. package/src/hooks/use-conditional-controller.tsx +0 -35
  206. package/src/hooks/use-mask.tsx +0 -116
  207. package/src/hooks/use-mobile.tsx +0 -19
  208. package/src/hooks/use-toast.ts +0 -191
  209. package/src/index.ts +0 -1
  210. package/src/introduction.mdx +0 -132
  211. package/src/lib/utils.ts +0 -6
  212. package/tailwind.config.ts +0 -83
  213. package/tsconfig.json +0 -27
@@ -1,124 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
- import { X } from "lucide-react";
6
-
7
- import { cn } from "../../lib/utils";
8
-
9
- export type DialogProps = DialogPrimitive.DialogProps;
10
-
11
- const Dialog = DialogPrimitive.Root;
12
-
13
- const DialogTrigger = DialogPrimitive.Trigger;
14
-
15
- const DialogPortal = DialogPrimitive.Portal;
16
-
17
- const DialogClose = DialogPrimitive.Close;
18
-
19
- const DialogOverlay = React.forwardRef<
20
- React.ElementRef<typeof DialogPrimitive.Overlay>,
21
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
22
- >(({ className, ...props }, ref) => (
23
- <DialogPrimitive.Overlay
24
- ref={ref}
25
- className={cn(
26
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
27
- className
28
- )}
29
- {...props}
30
- />
31
- ));
32
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
33
-
34
- const DialogContent = React.forwardRef<
35
- React.ElementRef<typeof DialogPrimitive.Content>,
36
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
37
- >(({ className, children, ...props }, ref) => (
38
- <DialogPortal>
39
- <DialogOverlay />
40
- <DialogPrimitive.Content
41
- ref={ref}
42
- className={cn(
43
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg overflow-auto max-h-[80vh]",
44
- className
45
- )}
46
- {...props}
47
- >
48
- {children}
49
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
50
- <X className="h-4 w-4" />
51
- <span className="sr-only">Close</span>
52
- </DialogPrimitive.Close>
53
- </DialogPrimitive.Content>
54
- </DialogPortal>
55
- ));
56
- DialogContent.displayName = DialogPrimitive.Content.displayName;
57
-
58
- const DialogHeader = ({
59
- className,
60
- ...props
61
- }: React.HTMLAttributes<HTMLDivElement>) => (
62
- <div
63
- className={cn(
64
- "flex flex-col space-y-1.5 text-center sm:text-left",
65
- className
66
- )}
67
- {...props}
68
- />
69
- );
70
- DialogHeader.displayName = "DialogHeader";
71
-
72
- const DialogFooter = ({
73
- className,
74
- ...props
75
- }: React.HTMLAttributes<HTMLDivElement>) => (
76
- <div
77
- className={cn(
78
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
79
- className
80
- )}
81
- {...props}
82
- />
83
- );
84
- DialogFooter.displayName = "DialogFooter";
85
-
86
- const DialogTitle = React.forwardRef<
87
- React.ElementRef<typeof DialogPrimitive.Title>,
88
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
89
- >(({ className, ...props }, ref) => (
90
- <DialogPrimitive.Title
91
- ref={ref}
92
- className={cn(
93
- "text-lg font-semibold leading-none tracking-tight",
94
- className
95
- )}
96
- {...props}
97
- />
98
- ));
99
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
100
-
101
- const DialogDescription = React.forwardRef<
102
- React.ElementRef<typeof DialogPrimitive.Description>,
103
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
104
- >(({ className, ...props }, ref) => (
105
- <DialogPrimitive.Description
106
- ref={ref}
107
- className={cn("text-sm text-muted-foreground", className)}
108
- {...props}
109
- />
110
- ));
111
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
112
-
113
- export {
114
- Dialog,
115
- DialogPortal,
116
- DialogOverlay,
117
- DialogTrigger,
118
- DialogClose,
119
- DialogContent,
120
- DialogHeader,
121
- DialogFooter,
122
- DialogTitle,
123
- DialogDescription,
124
- };
@@ -1,117 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Drawer as DrawerPrimitive } from "vaul";
5
-
6
- import { cn } from "../../lib/utils";
7
-
8
- export type DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;
9
-
10
- const Drawer = ({ shouldScaleBackground = true, ...props }: DrawerProps) => (
11
- <DrawerPrimitive.Root
12
- shouldScaleBackground={shouldScaleBackground}
13
- {...props}
14
- />
15
- );
16
- Drawer.displayName = "Drawer";
17
-
18
- const DrawerTrigger = DrawerPrimitive.Trigger;
19
-
20
- const DrawerPortal = DrawerPrimitive.Portal;
21
-
22
- const DrawerClose = DrawerPrimitive.Close;
23
-
24
- const DrawerOverlay = React.forwardRef<
25
- React.ElementRef<typeof DrawerPrimitive.Overlay>,
26
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>
27
- >(({ className, ...props }, ref) => (
28
- <DrawerPrimitive.Overlay
29
- ref={ref}
30
- className={cn("fixed inset-0 z-50 bg-black/80", className)}
31
- {...props}
32
- />
33
- ));
34
- DrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;
35
-
36
- const DrawerContent = React.forwardRef<
37
- React.ElementRef<typeof DrawerPrimitive.Content>,
38
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
39
- >(({ className, children, ...props }, ref) => (
40
- <DrawerPortal>
41
- <DrawerOverlay />
42
- <DrawerPrimitive.Content
43
- ref={ref}
44
- className={cn(
45
- "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
46
- className
47
- )}
48
- {...props}
49
- >
50
- <div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
51
- {children}
52
- </DrawerPrimitive.Content>
53
- </DrawerPortal>
54
- ));
55
- DrawerContent.displayName = "DrawerContent";
56
-
57
- const DrawerHeader = ({
58
- className,
59
- ...props
60
- }: React.HTMLAttributes<HTMLDivElement>) => (
61
- <div
62
- className={cn("grid gap-1.5 p-4 text-center sm:text-left", className)}
63
- {...props}
64
- />
65
- );
66
- DrawerHeader.displayName = "DrawerHeader";
67
-
68
- const DrawerFooter = ({
69
- className,
70
- ...props
71
- }: React.HTMLAttributes<HTMLDivElement>) => (
72
- <div
73
- className={cn("mt-auto flex flex-col gap-2 p-4", className)}
74
- {...props}
75
- />
76
- );
77
- DrawerFooter.displayName = "DrawerFooter";
78
-
79
- const DrawerTitle = React.forwardRef<
80
- React.ElementRef<typeof DrawerPrimitive.Title>,
81
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
82
- >(({ className, ...props }, ref) => (
83
- <DrawerPrimitive.Title
84
- ref={ref}
85
- className={cn(
86
- "text-lg font-semibold leading-none tracking-tight",
87
- className
88
- )}
89
- {...props}
90
- />
91
- ));
92
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
93
-
94
- const DrawerDescription = React.forwardRef<
95
- React.ElementRef<typeof DrawerPrimitive.Description>,
96
- React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>
97
- >(({ className, ...props }, ref) => (
98
- <DrawerPrimitive.Description
99
- ref={ref}
100
- className={cn("text-sm text-muted-foreground", className)}
101
- {...props}
102
- />
103
- ));
104
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
105
-
106
- export {
107
- Drawer,
108
- DrawerPortal,
109
- DrawerOverlay,
110
- DrawerTrigger,
111
- DrawerClose,
112
- DrawerContent,
113
- DrawerHeader,
114
- DrawerFooter,
115
- DrawerTitle,
116
- DrawerDescription,
117
- };
@@ -1,201 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
5
- import { Check, ChevronRight, Circle } from "lucide-react";
6
-
7
- import { cn } from "../../lib/utils";
8
-
9
- const DropdownMenu = DropdownMenuPrimitive.Root;
10
-
11
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
12
-
13
- const DropdownMenuGroup = DropdownMenuPrimitive.Group;
14
-
15
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
16
-
17
- const DropdownMenuSub = DropdownMenuPrimitive.Sub;
18
-
19
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
20
-
21
- const DropdownMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
- inset?: boolean;
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- "flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
31
- inset && "pl-8",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto" />
38
- </DropdownMenuPrimitive.SubTrigger>
39
- ));
40
- DropdownMenuSubTrigger.displayName =
41
- DropdownMenuPrimitive.SubTrigger.displayName;
42
-
43
- const DropdownMenuSubContent = React.forwardRef<
44
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
- >(({ className, ...props }, ref) => (
47
- <DropdownMenuPrimitive.SubContent
48
- ref={ref}
49
- className={cn(
50
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
51
- className
52
- )}
53
- {...props}
54
- />
55
- ));
56
- DropdownMenuSubContent.displayName =
57
- DropdownMenuPrimitive.SubContent.displayName;
58
-
59
- const DropdownMenuContent = React.forwardRef<
60
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
- >(({ className, sideOffset = 4, ...props }, ref) => (
63
- <DropdownMenuPrimitive.Portal>
64
- <DropdownMenuPrimitive.Content
65
- ref={ref}
66
- sideOffset={sideOffset}
67
- className={cn(
68
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
69
- "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",
70
- className
71
- )}
72
- {...props}
73
- />
74
- </DropdownMenuPrimitive.Portal>
75
- ));
76
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
77
-
78
- const DropdownMenuItem = React.forwardRef<
79
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
80
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
81
- inset?: boolean;
82
- }
83
- >(({ className, inset, ...props }, ref) => (
84
- <DropdownMenuPrimitive.Item
85
- ref={ref}
86
- className={cn(
87
- "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
88
- inset && "pl-8",
89
- className
90
- )}
91
- {...props}
92
- />
93
- ));
94
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
95
-
96
- const DropdownMenuCheckboxItem = React.forwardRef<
97
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
98
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
99
- >(({ className, children, checked, ...props }, ref) => (
100
- <DropdownMenuPrimitive.CheckboxItem
101
- ref={ref}
102
- className={cn(
103
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
104
- className
105
- )}
106
- checked={checked}
107
- {...props}
108
- >
109
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
110
- <DropdownMenuPrimitive.ItemIndicator>
111
- <Check className="h-4 w-4" />
112
- </DropdownMenuPrimitive.ItemIndicator>
113
- </span>
114
- {children}
115
- </DropdownMenuPrimitive.CheckboxItem>
116
- ));
117
- DropdownMenuCheckboxItem.displayName =
118
- DropdownMenuPrimitive.CheckboxItem.displayName;
119
-
120
- const DropdownMenuRadioItem = React.forwardRef<
121
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
122
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
123
- >(({ className, children, ...props }, ref) => (
124
- <DropdownMenuPrimitive.RadioItem
125
- ref={ref}
126
- className={cn(
127
- "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
128
- className
129
- )}
130
- {...props}
131
- >
132
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
133
- <DropdownMenuPrimitive.ItemIndicator>
134
- <Circle className="h-2 w-2 fill-current" />
135
- </DropdownMenuPrimitive.ItemIndicator>
136
- </span>
137
- {children}
138
- </DropdownMenuPrimitive.RadioItem>
139
- ));
140
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
141
-
142
- const DropdownMenuLabel = React.forwardRef<
143
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
144
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
145
- inset?: boolean;
146
- }
147
- >(({ className, inset, ...props }, ref) => (
148
- <DropdownMenuPrimitive.Label
149
- ref={ref}
150
- className={cn(
151
- "px-2 py-1.5 text-sm font-semibold",
152
- inset && "pl-8",
153
- className
154
- )}
155
- {...props}
156
- />
157
- ));
158
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
159
-
160
- const DropdownMenuSeparator = React.forwardRef<
161
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
162
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
163
- >(({ className, ...props }, ref) => (
164
- <DropdownMenuPrimitive.Separator
165
- ref={ref}
166
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
167
- {...props}
168
- />
169
- ));
170
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
171
-
172
- const DropdownMenuShortcut = ({
173
- className,
174
- ...props
175
- }: React.HTMLAttributes<HTMLSpanElement>) => {
176
- return (
177
- <span
178
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
179
- {...props}
180
- />
181
- );
182
- };
183
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
184
-
185
- export {
186
- DropdownMenu,
187
- DropdownMenuTrigger,
188
- DropdownMenuContent,
189
- DropdownMenuItem,
190
- DropdownMenuCheckboxItem,
191
- DropdownMenuRadioItem,
192
- DropdownMenuLabel,
193
- DropdownMenuSeparator,
194
- DropdownMenuShortcut,
195
- DropdownMenuGroup,
196
- DropdownMenuPortal,
197
- DropdownMenuSub,
198
- DropdownMenuSubContent,
199
- DropdownMenuSubTrigger,
200
- DropdownMenuRadioGroup,
201
- };
@@ -1,179 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as LabelPrimitive from "@radix-ui/react-label";
5
- import { Slot } from "@radix-ui/react-slot";
6
- import {
7
- Controller,
8
- ControllerProps,
9
- FieldPath,
10
- FieldValues,
11
- FormProvider,
12
- useFormContext,
13
- } from "react-hook-form";
14
-
15
- import { cn } from "../../lib/utils";
16
- import { Label } from "../../components/ui/label";
17
-
18
- const Form = FormProvider;
19
-
20
- type FormFieldContextValue<
21
- TFieldValues extends FieldValues = FieldValues,
22
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
23
- > = {
24
- name: TName;
25
- };
26
-
27
- const FormFieldContext = React.createContext<FormFieldContextValue>(
28
- {} as FormFieldContextValue
29
- );
30
-
31
- const FormField = <
32
- TFieldValues extends FieldValues = FieldValues,
33
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
34
- >({
35
- ...props
36
- }: ControllerProps<TFieldValues, TName>) => {
37
- return (
38
- <FormFieldContext.Provider value={{ name: props.name }}>
39
- <Controller {...props} />
40
- </FormFieldContext.Provider>
41
- );
42
- };
43
-
44
- const useFormField = () => {
45
- const fieldContext = React.useContext(FormFieldContext);
46
- const itemContext = React.useContext(FormItemContext);
47
- const { getFieldState, formState } = useFormContext();
48
-
49
- const fieldState = getFieldState(fieldContext.name, formState);
50
-
51
- if (!fieldContext) {
52
- throw new Error("useFormField should be used within <FormField>");
53
- }
54
-
55
- const { id } = itemContext;
56
-
57
- return {
58
- id,
59
- name: fieldContext.name,
60
- formItemId: `${id}-form-item`,
61
- formDescriptionId: `${id}-form-item-description`,
62
- formMessageId: `${id}-form-item-message`,
63
- ...fieldState,
64
- };
65
- };
66
-
67
- type FormItemContextValue = {
68
- id: string;
69
- };
70
-
71
- const FormItemContext = React.createContext<FormItemContextValue>(
72
- {} as FormItemContextValue
73
- );
74
-
75
- const FormItem = React.forwardRef<
76
- HTMLDivElement,
77
- React.HTMLAttributes<HTMLDivElement>
78
- >(({ className, ...props }, ref) => {
79
- const id = React.useId();
80
-
81
- return (
82
- <FormItemContext.Provider value={{ id }}>
83
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
84
- </FormItemContext.Provider>
85
- );
86
- });
87
- FormItem.displayName = "FormItem";
88
-
89
- const FormLabel = React.forwardRef<
90
- React.ElementRef<typeof LabelPrimitive.Root>,
91
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
92
- >(({ className, ...props }, ref) => {
93
- const { error, formItemId } = useFormField();
94
-
95
- return (
96
- <Label
97
- ref={ref}
98
- className={cn(error && "text-destructive", className)}
99
- htmlFor={formItemId}
100
- {...props}
101
- />
102
- );
103
- });
104
- FormLabel.displayName = "FormLabel";
105
-
106
- const FormControl = React.forwardRef<
107
- React.ElementRef<typeof Slot>,
108
- React.ComponentPropsWithoutRef<typeof Slot>
109
- >(({ ...props }, ref) => {
110
- const { error, formItemId, formDescriptionId, formMessageId } =
111
- useFormField();
112
-
113
- return (
114
- <Slot
115
- ref={ref}
116
- id={formItemId}
117
- aria-describedby={
118
- !error
119
- ? `${formDescriptionId}`
120
- : `${formDescriptionId} ${formMessageId}`
121
- }
122
- aria-invalid={!!error}
123
- {...props}
124
- />
125
- );
126
- });
127
- FormControl.displayName = "FormControl";
128
-
129
- const FormDescription = React.forwardRef<
130
- HTMLParagraphElement,
131
- React.HTMLAttributes<HTMLParagraphElement>
132
- >(({ className, ...props }, ref) => {
133
- const { formDescriptionId } = useFormField();
134
-
135
- return (
136
- <p
137
- ref={ref}
138
- id={formDescriptionId}
139
- className={cn("text-[0.8rem] text-muted-foreground", className)}
140
- {...props}
141
- />
142
- );
143
- });
144
- FormDescription.displayName = "FormDescription";
145
-
146
- const FormMessage = React.forwardRef<
147
- HTMLParagraphElement,
148
- React.HTMLAttributes<HTMLParagraphElement>
149
- >(({ className, children, ...props }, ref) => {
150
- const { error, formMessageId } = useFormField();
151
- const body = error ? String(error?.message) : children;
152
-
153
- if (!body) {
154
- return null;
155
- }
156
-
157
- return (
158
- <p
159
- ref={ref}
160
- id={formMessageId}
161
- className={cn("text-[0.8rem] font-medium text-destructive", className)}
162
- {...props}
163
- >
164
- {body}
165
- </p>
166
- );
167
- });
168
- FormMessage.displayName = "FormMessage";
169
-
170
- export {
171
- useFormField,
172
- Form,
173
- FormItem,
174
- FormLabel,
175
- FormControl,
176
- FormDescription,
177
- FormMessage,
178
- FormField,
179
- };
@@ -1,24 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../../lib/utils";
4
-
5
- export type InputProps = React.ComponentProps<"input">;
6
-
7
- const Input = React.forwardRef<HTMLInputElement, InputProps>(
8
- ({ className, type, ...props }, ref) => {
9
- return (
10
- <input
11
- type={type}
12
- className={cn(
13
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
14
- className
15
- )}
16
- ref={ref}
17
- {...props}
18
- />
19
- );
20
- }
21
- );
22
- Input.displayName = "Input";
23
-
24
- export { Input };
@@ -1,30 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as LabelPrimitive from "@radix-ui/react-label";
5
- import { cva, type VariantProps } from "class-variance-authority";
6
-
7
- import { cn } from "../../lib/utils";
8
-
9
- const labelVariants = cva(
10
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
11
- );
12
-
13
- export type LabelProps = React.ComponentPropsWithoutRef<
14
- typeof LabelPrimitive.Root
15
- > &
16
- VariantProps<typeof labelVariants>;
17
-
18
- const Label = React.forwardRef<
19
- React.ElementRef<typeof LabelPrimitive.Root>,
20
- LabelProps
21
- >(({ className, ...props }, ref) => (
22
- <LabelPrimitive.Root
23
- ref={ref}
24
- className={cn(labelVariants(), className)}
25
- {...props}
26
- />
27
- ));
28
- Label.displayName = LabelPrimitive.Root.displayName;
29
-
30
- export { Label };