@valbuild/ui 0.26.0 → 0.27.0

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 (138) hide show
  1. package/package.json +7 -3
  2. package/server/.tmp/assets/index-082e6676.css +1 -0
  3. package/server/.tmp/assets/index-3108ab2a.js +197 -0
  4. package/{index.html → server/.tmp/index.html} +3 -1
  5. package/.babelrc.json +0 -10
  6. package/.storybook/main.js +0 -25
  7. package/.storybook/preview-head.html +0 -6
  8. package/.storybook/preview.js +0 -33
  9. package/.storybook/theme.css +0 -34
  10. package/CHANGELOG.md +0 -0
  11. package/components.json +0 -16
  12. package/fix-server-hack.js +0 -54
  13. package/fullscreen.vite.config.ts +0 -9
  14. package/jest.config.js +0 -4
  15. package/postcss.config.js +0 -6
  16. package/rollup.config.js +0 -23
  17. package/server.vite.config.ts +0 -31
  18. package/src/App.tsx +0 -73
  19. package/src/assets/icons/Bold.tsx +0 -23
  20. package/src/assets/icons/Chevron.tsx +0 -28
  21. package/src/assets/icons/FontColor.tsx +0 -30
  22. package/src/assets/icons/ImageIcon.tsx +0 -29
  23. package/src/assets/icons/Italic.tsx +0 -24
  24. package/src/assets/icons/Logo.tsx +0 -103
  25. package/src/assets/icons/Section.tsx +0 -41
  26. package/src/assets/icons/Strikethrough.tsx +0 -22
  27. package/src/assets/icons/TextIcon.tsx +0 -20
  28. package/src/assets/icons/Underline.tsx +0 -22
  29. package/src/assets/icons/Undo.tsx +0 -20
  30. package/src/components/Button.tsx +0 -68
  31. package/src/components/Checkbox.tsx +0 -51
  32. package/src/components/DraggableList.stories.tsx +0 -20
  33. package/src/components/DraggableList.tsx +0 -95
  34. package/src/components/Dropdown.tsx +0 -101
  35. package/src/components/EditButton.tsx +0 -10
  36. package/src/components/ErrorText.tsx +0 -3
  37. package/src/components/ExpandLogo.tsx +0 -72
  38. package/src/components/Grid.stories.tsx +0 -43
  39. package/src/components/Grid.tsx +0 -139
  40. package/src/components/RichTextEditor/ContentEditable.tsx +0 -117
  41. package/src/components/RichTextEditor/Nodes/ImageNode.tsx +0 -100
  42. package/src/components/RichTextEditor/Plugins/AutoFocus.tsx +0 -12
  43. package/src/components/RichTextEditor/Plugins/ImagePlugin.tsx +0 -45
  44. package/src/components/RichTextEditor/Plugins/LinkEditorPlugin.tsx +0 -58
  45. package/src/components/RichTextEditor/Plugins/Toolbar.tsx +0 -412
  46. package/src/components/RichTextEditor/RichTextEditor.tsx +0 -105
  47. package/src/components/UploadModal.tsx +0 -109
  48. package/src/components/User.tsx +0 -17
  49. package/src/components/ValFormField.tsx +0 -574
  50. package/src/components/ValFullscreen.tsx +0 -1278
  51. package/src/components/ValMenu.tsx +0 -92
  52. package/src/components/ValOverlay.tsx +0 -488
  53. package/src/components/ValOverlayContext.tsx +0 -80
  54. package/src/components/ValWindow.stories.tsx +0 -146
  55. package/src/components/ValWindow.tsx +0 -220
  56. package/src/components/dashboard/DashboardButton.tsx +0 -25
  57. package/src/components/dashboard/DashboardDropdown.tsx +0 -59
  58. package/src/components/dashboard/Dropdown.stories.tsx +0 -11
  59. package/src/components/dashboard/Dropdown.tsx +0 -70
  60. package/src/components/dashboard/FormGroup.stories.tsx +0 -37
  61. package/src/components/dashboard/FormGroup.tsx +0 -42
  62. package/src/components/dashboard/Grid2.stories.tsx +0 -56
  63. package/src/components/dashboard/Grid2.tsx +0 -72
  64. package/src/components/dashboard/Tree.stories.tsx +0 -91
  65. package/src/components/dashboard/Tree.tsx +0 -72
  66. package/src/components/dashboard/ValDashboardEditor.tsx +0 -269
  67. package/src/components/dashboard/ValDashboardGrid.tsx +0 -142
  68. package/src/components/dashboard/ValTreeNavigator.tsx +0 -253
  69. package/src/components/forms/Form.tsx +0 -126
  70. package/src/components/forms/FormContainer.tsx +0 -24
  71. package/src/components/forms/ImageForm.tsx +0 -195
  72. package/src/components/forms/TextArea.tsx +0 -24
  73. package/src/components/ui/accordion.tsx +0 -58
  74. package/src/components/ui/alert-dialog.tsx +0 -139
  75. package/src/components/ui/avatar.tsx +0 -48
  76. package/src/components/ui/button.tsx +0 -56
  77. package/src/components/ui/calendar.tsx +0 -62
  78. package/src/components/ui/card.tsx +0 -86
  79. package/src/components/ui/checkbox.tsx +0 -28
  80. package/src/components/ui/command.tsx +0 -153
  81. package/src/components/ui/dialog.tsx +0 -120
  82. package/src/components/ui/dropdown-menu.tsx +0 -198
  83. package/src/components/ui/form.tsx +0 -177
  84. package/src/components/ui/input.tsx +0 -24
  85. package/src/components/ui/label.tsx +0 -24
  86. package/src/components/ui/popover.tsx +0 -29
  87. package/src/components/ui/progress.tsx +0 -26
  88. package/src/components/ui/radio-group.tsx +0 -42
  89. package/src/components/ui/scroll-area.tsx +0 -51
  90. package/src/components/ui/select.tsx +0 -119
  91. package/src/components/ui/switch.tsx +0 -27
  92. package/src/components/ui/tabs.tsx +0 -53
  93. package/src/components/ui/toggle.tsx +0 -43
  94. package/src/components/ui/tooltip.tsx +0 -28
  95. package/src/components/usePatch.ts +0 -86
  96. package/src/components/useTheme.ts +0 -45
  97. package/src/dto/SerializedSchema.ts +0 -69
  98. package/src/dto/Session.ts +0 -12
  99. package/src/dto/SessionMode.ts +0 -5
  100. package/src/dto/Tree.ts +0 -18
  101. package/src/exports.ts +0 -6
  102. package/src/index.css +0 -115
  103. package/src/index.tsx +0 -14
  104. package/src/lib/IValStore.ts +0 -6
  105. package/src/lib/utils.ts +0 -6
  106. package/src/main.jsx +0 -10
  107. package/src/richtext/conversion/conversion.test.ts +0 -146
  108. package/src/richtext/conversion/lexicalToRichTextSource.test.ts +0 -89
  109. package/src/richtext/conversion/lexicalToRichTextSource.ts +0 -285
  110. package/src/richtext/conversion/parseRichTextSource.test.ts +0 -469
  111. package/src/richtext/conversion/parseRichTextSource.ts +0 -233
  112. package/src/richtext/conversion/richTextSourceToLexical.test.ts +0 -381
  113. package/src/richtext/conversion/richTextSourceToLexical.ts +0 -293
  114. package/src/richtext/shadowRootPolyFill.js +0 -115
  115. package/src/server.ts +0 -70
  116. package/src/stories/Button.stories.tsx +0 -20
  117. package/src/stories/Checkbox.stories.tsx +0 -14
  118. package/src/stories/Dropdown.stories.tsx +0 -23
  119. package/src/stories/Introduction.mdx +0 -221
  120. package/src/stories/RichTextEditor.stories.tsx +0 -24
  121. package/src/stories/assets/code-brackets.svg +0 -1
  122. package/src/stories/assets/colors.svg +0 -1
  123. package/src/stories/assets/comments.svg +0 -1
  124. package/src/stories/assets/direction.svg +0 -1
  125. package/src/stories/assets/flow.svg +0 -1
  126. package/src/stories/assets/plugin.svg +0 -1
  127. package/src/stories/assets/repo.svg +0 -1
  128. package/src/stories/assets/stackalt.svg +0 -1
  129. package/src/utils/Remote.ts +0 -15
  130. package/src/utils/imageMimeType.ts +0 -23
  131. package/src/utils/readImage.ts +0 -54
  132. package/src/utils/resolvePath.ts +0 -32
  133. package/src/vite-env.d.ts +0 -1
  134. package/src/vite-index.tsx +0 -7
  135. package/src/vite-server.ts +0 -42
  136. package/tailwind.config.js +0 -83
  137. package/tsconfig.json +0 -19
  138. package/vite.config.ts +0 -43
@@ -1,198 +0,0 @@
1
- import * as React from "react";
2
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
- import { Check, ChevronRight, Circle } from "lucide-react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const DropdownMenu = DropdownMenuPrimitive.Root;
8
-
9
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
10
-
11
- const DropdownMenuGroup = DropdownMenuPrimitive.Group;
12
-
13
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
14
-
15
- const DropdownMenuSub = DropdownMenuPrimitive.Sub;
16
-
17
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
18
-
19
- const DropdownMenuSubTrigger = React.forwardRef<
20
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
21
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
22
- inset?: boolean;
23
- }
24
- >(({ className, inset, children, ...props }, ref) => (
25
- <DropdownMenuPrimitive.SubTrigger
26
- ref={ref}
27
- className={cn(
28
- "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
29
- inset && "pl-8",
30
- className
31
- )}
32
- {...props}
33
- >
34
- {children}
35
- <ChevronRight className="ml-auto h-4 w-4" />
36
- </DropdownMenuPrimitive.SubTrigger>
37
- ));
38
- DropdownMenuSubTrigger.displayName =
39
- DropdownMenuPrimitive.SubTrigger.displayName;
40
-
41
- const DropdownMenuSubContent = React.forwardRef<
42
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
43
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
44
- >(({ className, ...props }, ref) => (
45
- <DropdownMenuPrimitive.SubContent
46
- ref={ref}
47
- className={cn(
48
- "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",
49
- className
50
- )}
51
- {...props}
52
- />
53
- ));
54
- DropdownMenuSubContent.displayName =
55
- DropdownMenuPrimitive.SubContent.displayName;
56
-
57
- const DropdownMenuContent = React.forwardRef<
58
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
59
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
60
- >(({ className, sideOffset = 4, ...props }, ref) => (
61
- <DropdownMenuPrimitive.Portal>
62
- <DropdownMenuPrimitive.Content
63
- ref={ref}
64
- sideOffset={sideOffset}
65
- className={cn(
66
- "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",
67
- className
68
- )}
69
- {...props}
70
- />
71
- </DropdownMenuPrimitive.Portal>
72
- ));
73
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
74
-
75
- const DropdownMenuItem = React.forwardRef<
76
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
77
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
78
- inset?: boolean;
79
- }
80
- >(({ className, inset, ...props }, ref) => (
81
- <DropdownMenuPrimitive.Item
82
- ref={ref}
83
- className={cn(
84
- "relative flex cursor-default select-none items-center 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",
85
- inset && "pl-8",
86
- className
87
- )}
88
- {...props}
89
- />
90
- ));
91
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
92
-
93
- const DropdownMenuCheckboxItem = React.forwardRef<
94
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
95
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
96
- >(({ className, children, checked, ...props }, ref) => (
97
- <DropdownMenuPrimitive.CheckboxItem
98
- ref={ref}
99
- className={cn(
100
- "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",
101
- className
102
- )}
103
- checked={checked}
104
- {...props}
105
- >
106
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
107
- <DropdownMenuPrimitive.ItemIndicator>
108
- <Check className="h-4 w-4" />
109
- </DropdownMenuPrimitive.ItemIndicator>
110
- </span>
111
- {children}
112
- </DropdownMenuPrimitive.CheckboxItem>
113
- ));
114
- DropdownMenuCheckboxItem.displayName =
115
- DropdownMenuPrimitive.CheckboxItem.displayName;
116
-
117
- const DropdownMenuRadioItem = React.forwardRef<
118
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
119
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
120
- >(({ className, children, ...props }, ref) => (
121
- <DropdownMenuPrimitive.RadioItem
122
- ref={ref}
123
- className={cn(
124
- "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",
125
- className
126
- )}
127
- {...props}
128
- >
129
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
130
- <DropdownMenuPrimitive.ItemIndicator>
131
- <Circle className="h-2 w-2 fill-current" />
132
- </DropdownMenuPrimitive.ItemIndicator>
133
- </span>
134
- {children}
135
- </DropdownMenuPrimitive.RadioItem>
136
- ));
137
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
138
-
139
- const DropdownMenuLabel = React.forwardRef<
140
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
141
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
142
- inset?: boolean;
143
- }
144
- >(({ className, inset, ...props }, ref) => (
145
- <DropdownMenuPrimitive.Label
146
- ref={ref}
147
- className={cn(
148
- "px-2 py-1.5 text-sm font-semibold",
149
- inset && "pl-8",
150
- className
151
- )}
152
- {...props}
153
- />
154
- ));
155
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
156
-
157
- const DropdownMenuSeparator = React.forwardRef<
158
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
159
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
160
- >(({ className, ...props }, ref) => (
161
- <DropdownMenuPrimitive.Separator
162
- ref={ref}
163
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
164
- {...props}
165
- />
166
- ));
167
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
168
-
169
- const DropdownMenuShortcut = ({
170
- className,
171
- ...props
172
- }: React.HTMLAttributes<HTMLSpanElement>) => {
173
- return (
174
- <span
175
- className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
176
- {...props}
177
- />
178
- );
179
- };
180
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
181
-
182
- export {
183
- DropdownMenu,
184
- DropdownMenuTrigger,
185
- DropdownMenuContent,
186
- DropdownMenuItem,
187
- DropdownMenuCheckboxItem,
188
- DropdownMenuRadioItem,
189
- DropdownMenuLabel,
190
- DropdownMenuSeparator,
191
- DropdownMenuShortcut,
192
- DropdownMenuGroup,
193
- DropdownMenuPortal,
194
- DropdownMenuSub,
195
- DropdownMenuSubContent,
196
- DropdownMenuSubTrigger,
197
- DropdownMenuRadioGroup,
198
- };
@@ -1,177 +0,0 @@
1
- import * as React from "react";
2
- import * as LabelPrimitive from "@radix-ui/react-label";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import {
5
- Controller,
6
- ControllerProps,
7
- FieldPath,
8
- FieldValues,
9
- FormProvider,
10
- useFormContext,
11
- } from "react-hook-form";
12
-
13
- import { cn } from "../../lib/utils";
14
- import { Label } from "./label";
15
-
16
- const Form = FormProvider;
17
-
18
- type FormFieldContextValue<
19
- TFieldValues extends FieldValues = FieldValues,
20
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
21
- > = {
22
- name: TName;
23
- };
24
-
25
- const FormFieldContext = React.createContext<FormFieldContextValue>(
26
- {} as FormFieldContextValue
27
- );
28
-
29
- const FormField = <
30
- TFieldValues extends FieldValues = FieldValues,
31
- TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
32
- >({
33
- ...props
34
- }: ControllerProps<TFieldValues, TName>) => {
35
- return (
36
- <FormFieldContext.Provider value={{ name: props.name }}>
37
- <Controller {...props} />
38
- </FormFieldContext.Provider>
39
- );
40
- };
41
-
42
- const useFormField = () => {
43
- const fieldContext = React.useContext(FormFieldContext);
44
- const itemContext = React.useContext(FormItemContext);
45
- const { getFieldState, formState } = useFormContext();
46
-
47
- const fieldState = getFieldState(fieldContext.name, formState);
48
-
49
- if (!fieldContext) {
50
- throw new Error("useFormField should be used within <FormField>");
51
- }
52
-
53
- const { id } = itemContext;
54
-
55
- return {
56
- id,
57
- name: fieldContext.name,
58
- formItemId: `${id}-form-item`,
59
- formDescriptionId: `${id}-form-item-description`,
60
- formMessageId: `${id}-form-item-message`,
61
- ...fieldState,
62
- };
63
- };
64
-
65
- type FormItemContextValue = {
66
- id: string;
67
- };
68
-
69
- const FormItemContext = React.createContext<FormItemContextValue>(
70
- {} as FormItemContextValue
71
- );
72
-
73
- const FormItem = React.forwardRef<
74
- HTMLDivElement,
75
- React.HTMLAttributes<HTMLDivElement>
76
- >(({ className, ...props }, ref) => {
77
- const id = React.useId();
78
-
79
- return (
80
- <FormItemContext.Provider value={{ id }}>
81
- <div ref={ref} className={cn("space-y-2", className)} {...props} />
82
- </FormItemContext.Provider>
83
- );
84
- });
85
- FormItem.displayName = "FormItem";
86
-
87
- const FormLabel = React.forwardRef<
88
- React.ElementRef<typeof LabelPrimitive.Root>,
89
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
90
- >(({ className, ...props }, ref) => {
91
- const { error, formItemId } = useFormField();
92
-
93
- return (
94
- <Label
95
- ref={ref}
96
- className={cn(error && "text-destructive", className)}
97
- htmlFor={formItemId}
98
- {...props}
99
- />
100
- );
101
- });
102
- FormLabel.displayName = "FormLabel";
103
-
104
- const FormControl = React.forwardRef<
105
- React.ElementRef<typeof Slot>,
106
- React.ComponentPropsWithoutRef<typeof Slot>
107
- >(({ ...props }, ref) => {
108
- const { error, formItemId, formDescriptionId, formMessageId } =
109
- useFormField();
110
-
111
- return (
112
- <Slot
113
- ref={ref}
114
- id={formItemId}
115
- aria-describedby={
116
- !error
117
- ? `${formDescriptionId}`
118
- : `${formDescriptionId} ${formMessageId}`
119
- }
120
- aria-invalid={!!error}
121
- {...props}
122
- />
123
- );
124
- });
125
- FormControl.displayName = "FormControl";
126
-
127
- const FormDescription = React.forwardRef<
128
- HTMLParagraphElement,
129
- React.HTMLAttributes<HTMLParagraphElement>
130
- >(({ className, ...props }, ref) => {
131
- const { formDescriptionId } = useFormField();
132
-
133
- return (
134
- <p
135
- ref={ref}
136
- id={formDescriptionId}
137
- className={cn("text-sm text-muted-foreground", className)}
138
- {...props}
139
- />
140
- );
141
- });
142
- FormDescription.displayName = "FormDescription";
143
-
144
- const FormMessage = React.forwardRef<
145
- HTMLParagraphElement,
146
- React.HTMLAttributes<HTMLParagraphElement>
147
- >(({ className, children, ...props }, ref) => {
148
- const { error, formMessageId } = useFormField();
149
- const body = error ? String(error?.message) : children;
150
-
151
- if (!body) {
152
- return null;
153
- }
154
-
155
- return (
156
- <p
157
- ref={ref}
158
- id={formMessageId}
159
- className={cn("text-sm font-medium text-destructive", className)}
160
- {...props}
161
- >
162
- {body}
163
- </p>
164
- );
165
- });
166
- FormMessage.displayName = "FormMessage";
167
-
168
- export {
169
- useFormField,
170
- Form,
171
- FormItem,
172
- FormLabel,
173
- FormControl,
174
- FormDescription,
175
- FormMessage,
176
- FormField,
177
- };
@@ -1,24 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../../lib/utils";
4
-
5
- export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
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-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
14
- className
15
- )}
16
- ref={ref}
17
- {...props}
18
- />
19
- );
20
- }
21
- );
22
- Input.displayName = "Input";
23
-
24
- export { Input };
@@ -1,24 +0,0 @@
1
- import * as React from "react";
2
- import * as LabelPrimitive from "@radix-ui/react-label";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const labelVariants = cva(
8
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
- );
10
-
11
- const Label = React.forwardRef<
12
- React.ElementRef<typeof LabelPrimitive.Root>,
13
- React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
- VariantProps<typeof labelVariants>
15
- >(({ className, ...props }, ref) => (
16
- <LabelPrimitive.Root
17
- ref={ref}
18
- className={cn(labelVariants(), className)}
19
- {...props}
20
- />
21
- ));
22
- Label.displayName = LabelPrimitive.Root.displayName;
23
-
24
- export { Label };
@@ -1,29 +0,0 @@
1
- import * as React from "react";
2
- import * as PopoverPrimitive from "@radix-ui/react-popover";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const Popover = PopoverPrimitive.Root;
7
-
8
- const PopoverTrigger = PopoverPrimitive.Trigger;
9
-
10
- const PopoverContent = React.forwardRef<
11
- React.ElementRef<typeof PopoverPrimitive.Content>,
12
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
13
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
14
- <PopoverPrimitive.Portal>
15
- <PopoverPrimitive.Content
16
- ref={ref}
17
- align={align}
18
- sideOffset={sideOffset}
19
- className={cn(
20
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
21
- className
22
- )}
23
- {...props}
24
- />
25
- </PopoverPrimitive.Portal>
26
- ));
27
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
28
-
29
- export { Popover, PopoverTrigger, PopoverContent };
@@ -1,26 +0,0 @@
1
- import * as React from "react";
2
- import * as ProgressPrimitive from "@radix-ui/react-progress";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const Progress = React.forwardRef<
7
- React.ElementRef<typeof ProgressPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
9
- >(({ className, value, ...props }, ref) => (
10
- <ProgressPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
14
- className
15
- )}
16
- {...props}
17
- >
18
- <ProgressPrimitive.Indicator
19
- className="flex-1 w-full h-full transition-all bg-primary"
20
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
21
- />
22
- </ProgressPrimitive.Root>
23
- ));
24
- Progress.displayName = ProgressPrimitive.Root.displayName;
25
-
26
- export { Progress };
@@ -1,42 +0,0 @@
1
- import * as React from "react";
2
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3
- import { Circle } from "lucide-react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const RadioGroup = React.forwardRef<
8
- React.ElementRef<typeof RadioGroupPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
10
- >(({ className, ...props }, ref) => {
11
- return (
12
- <RadioGroupPrimitive.Root
13
- className={cn("grid gap-2", className)}
14
- {...props}
15
- ref={ref}
16
- />
17
- );
18
- });
19
- RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
20
-
21
- const RadioGroupItem = React.forwardRef<
22
- React.ElementRef<typeof RadioGroupPrimitive.Item>,
23
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
24
- >(({ className, ...props }, ref) => {
25
- return (
26
- <RadioGroupPrimitive.Item
27
- ref={ref}
28
- className={cn(
29
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
30
- className
31
- )}
32
- {...props}
33
- >
34
- <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
35
- <Circle className="h-2.5 w-2.5 fill-current text-current" />
36
- </RadioGroupPrimitive.Indicator>
37
- </RadioGroupPrimitive.Item>
38
- );
39
- });
40
- RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
41
-
42
- export { RadioGroup, RadioGroupItem };
@@ -1,51 +0,0 @@
1
- import * as React from "react";
2
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const ScrollArea = React.forwardRef<
7
- React.ElementRef<typeof ScrollAreaPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
9
- >(({ className, children, ...props }, ref) => (
10
- <ScrollAreaPrimitive.Root
11
- ref={ref}
12
- className={cn("relative overflow-hidden", className)}
13
- {...props}
14
- >
15
- <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
16
- {children}
17
- </ScrollAreaPrimitive.Viewport>
18
- <ScrollBar />
19
- <ScrollAreaPrimitive.Corner />
20
- </ScrollAreaPrimitive.Root>
21
- ));
22
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
23
-
24
- const ScrollBar = React.forwardRef<
25
- React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
26
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
27
- >(({ className, orientation = "vertical", ...props }, ref) => (
28
- <ScrollAreaPrimitive.ScrollAreaScrollbar
29
- ref={ref}
30
- orientation={orientation}
31
- className={cn(
32
- "flex touch-none select-none transition-colors",
33
- orientation === "vertical" &&
34
- "h-full w-2.5 border-l border-l-transparent p-[1px]",
35
- orientation === "horizontal" &&
36
- "h-2.5 flex-col border-t border-t-transparent p-[1px]",
37
- className
38
- )}
39
- {...props}
40
- >
41
- <ScrollAreaPrimitive.ScrollAreaThumb
42
- className={cn(
43
- "relative rounded-full bg-border",
44
- orientation === "vertical" && "flex-1"
45
- )}
46
- />
47
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
48
- ));
49
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
50
-
51
- export { ScrollArea, ScrollBar };
@@ -1,119 +0,0 @@
1
- import * as React from "react";
2
- import * as SelectPrimitive from "@radix-ui/react-select";
3
- import { Check, ChevronDown } from "lucide-react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const Select = SelectPrimitive.Root;
8
-
9
- const SelectGroup = SelectPrimitive.Group;
10
-
11
- const SelectValue = SelectPrimitive.Value;
12
-
13
- const SelectTrigger = React.forwardRef<
14
- React.ElementRef<typeof SelectPrimitive.Trigger>,
15
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
- >(({ className, children, ...props }, ref) => (
17
- <SelectPrimitive.Trigger
18
- ref={ref}
19
- className={cn(
20
- "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
21
- className
22
- )}
23
- {...props}
24
- >
25
- {children}
26
- <SelectPrimitive.Icon asChild>
27
- <ChevronDown className="w-4 h-4 opacity-50" />
28
- </SelectPrimitive.Icon>
29
- </SelectPrimitive.Trigger>
30
- ));
31
- SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
32
-
33
- const SelectContent = React.forwardRef<
34
- React.ElementRef<typeof SelectPrimitive.Content>,
35
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
36
- >(({ className, children, position = "popper", ...props }, ref) => (
37
- <SelectPrimitive.Portal>
38
- <SelectPrimitive.Content
39
- ref={ref}
40
- className={cn(
41
- "relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
42
- position === "popper" &&
43
- "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
44
- className
45
- )}
46
- position={position}
47
- {...props}
48
- >
49
- <SelectPrimitive.Viewport
50
- className={cn(
51
- "p-1",
52
- position === "popper" &&
53
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
54
- )}
55
- >
56
- {children}
57
- </SelectPrimitive.Viewport>
58
- </SelectPrimitive.Content>
59
- </SelectPrimitive.Portal>
60
- ));
61
- SelectContent.displayName = SelectPrimitive.Content.displayName;
62
-
63
- const SelectLabel = React.forwardRef<
64
- React.ElementRef<typeof SelectPrimitive.Label>,
65
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
66
- >(({ className, ...props }, ref) => (
67
- <SelectPrimitive.Label
68
- ref={ref}
69
- className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
70
- {...props}
71
- />
72
- ));
73
- SelectLabel.displayName = SelectPrimitive.Label.displayName;
74
-
75
- const SelectItem = React.forwardRef<
76
- React.ElementRef<typeof SelectPrimitive.Item>,
77
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
78
- >(({ className, children, ...props }, ref) => (
79
- <SelectPrimitive.Item
80
- ref={ref}
81
- className={cn(
82
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
83
- className
84
- )}
85
- {...props}
86
- >
87
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
88
- <SelectPrimitive.ItemIndicator>
89
- <Check className="w-4 h-4" />
90
- </SelectPrimitive.ItemIndicator>
91
- </span>
92
-
93
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
94
- </SelectPrimitive.Item>
95
- ));
96
- SelectItem.displayName = SelectPrimitive.Item.displayName;
97
-
98
- const SelectSeparator = React.forwardRef<
99
- React.ElementRef<typeof SelectPrimitive.Separator>,
100
- React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
101
- >(({ className, ...props }, ref) => (
102
- <SelectPrimitive.Separator
103
- ref={ref}
104
- className={cn("-mx-1 my-1 h-px bg-muted", className)}
105
- {...props}
106
- />
107
- ));
108
- SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
109
-
110
- export {
111
- Select,
112
- SelectGroup,
113
- SelectValue,
114
- SelectTrigger,
115
- SelectContent,
116
- SelectLabel,
117
- SelectItem,
118
- SelectSeparator,
119
- };