@valbuild/ui 0.26.0 → 0.28.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 (145) hide show
  1. package/dist/valbuild-ui.cjs.js +41 -15
  2. package/dist/valbuild-ui.esm.js +41 -15
  3. package/package.json +7 -3
  4. package/server/.tmp/assets/index-18cfa26c.css +1 -0
  5. package/server/.tmp/assets/index-513f7a9c.js +197 -0
  6. package/{index.html → server/.tmp/index.html} +3 -1
  7. package/server/dist/style.css +0 -3
  8. package/server/dist/valbuild-ui-main.cjs.js +60 -34
  9. package/server/dist/valbuild-ui-main.esm.js +60 -34
  10. package/server/dist/valbuild-ui-server.cjs.js +1 -1
  11. package/server/dist/valbuild-ui-server.esm.js +1 -1
  12. package/.babelrc.json +0 -10
  13. package/.storybook/main.js +0 -25
  14. package/.storybook/preview-head.html +0 -6
  15. package/.storybook/preview.js +0 -33
  16. package/.storybook/theme.css +0 -34
  17. package/CHANGELOG.md +0 -0
  18. package/components.json +0 -16
  19. package/fix-server-hack.js +0 -54
  20. package/fullscreen.vite.config.ts +0 -9
  21. package/jest.config.js +0 -4
  22. package/postcss.config.js +0 -6
  23. package/rollup.config.js +0 -23
  24. package/server.vite.config.ts +0 -31
  25. package/src/App.tsx +0 -73
  26. package/src/assets/icons/Bold.tsx +0 -23
  27. package/src/assets/icons/Chevron.tsx +0 -28
  28. package/src/assets/icons/FontColor.tsx +0 -30
  29. package/src/assets/icons/ImageIcon.tsx +0 -29
  30. package/src/assets/icons/Italic.tsx +0 -24
  31. package/src/assets/icons/Logo.tsx +0 -103
  32. package/src/assets/icons/Section.tsx +0 -41
  33. package/src/assets/icons/Strikethrough.tsx +0 -22
  34. package/src/assets/icons/TextIcon.tsx +0 -20
  35. package/src/assets/icons/Underline.tsx +0 -22
  36. package/src/assets/icons/Undo.tsx +0 -20
  37. package/src/components/Button.tsx +0 -68
  38. package/src/components/Checkbox.tsx +0 -51
  39. package/src/components/DraggableList.stories.tsx +0 -20
  40. package/src/components/DraggableList.tsx +0 -95
  41. package/src/components/Dropdown.tsx +0 -101
  42. package/src/components/EditButton.tsx +0 -10
  43. package/src/components/ErrorText.tsx +0 -3
  44. package/src/components/ExpandLogo.tsx +0 -72
  45. package/src/components/Grid.stories.tsx +0 -43
  46. package/src/components/Grid.tsx +0 -139
  47. package/src/components/RichTextEditor/ContentEditable.tsx +0 -117
  48. package/src/components/RichTextEditor/Nodes/ImageNode.tsx +0 -100
  49. package/src/components/RichTextEditor/Plugins/AutoFocus.tsx +0 -12
  50. package/src/components/RichTextEditor/Plugins/ImagePlugin.tsx +0 -45
  51. package/src/components/RichTextEditor/Plugins/LinkEditorPlugin.tsx +0 -58
  52. package/src/components/RichTextEditor/Plugins/Toolbar.tsx +0 -412
  53. package/src/components/RichTextEditor/RichTextEditor.tsx +0 -105
  54. package/src/components/UploadModal.tsx +0 -109
  55. package/src/components/User.tsx +0 -17
  56. package/src/components/ValFormField.tsx +0 -574
  57. package/src/components/ValFullscreen.tsx +0 -1278
  58. package/src/components/ValMenu.tsx +0 -92
  59. package/src/components/ValOverlay.tsx +0 -488
  60. package/src/components/ValOverlayContext.tsx +0 -80
  61. package/src/components/ValWindow.stories.tsx +0 -146
  62. package/src/components/ValWindow.tsx +0 -220
  63. package/src/components/dashboard/DashboardButton.tsx +0 -25
  64. package/src/components/dashboard/DashboardDropdown.tsx +0 -59
  65. package/src/components/dashboard/Dropdown.stories.tsx +0 -11
  66. package/src/components/dashboard/Dropdown.tsx +0 -70
  67. package/src/components/dashboard/FormGroup.stories.tsx +0 -37
  68. package/src/components/dashboard/FormGroup.tsx +0 -42
  69. package/src/components/dashboard/Grid2.stories.tsx +0 -56
  70. package/src/components/dashboard/Grid2.tsx +0 -72
  71. package/src/components/dashboard/Tree.stories.tsx +0 -91
  72. package/src/components/dashboard/Tree.tsx +0 -72
  73. package/src/components/dashboard/ValDashboardEditor.tsx +0 -269
  74. package/src/components/dashboard/ValDashboardGrid.tsx +0 -142
  75. package/src/components/dashboard/ValTreeNavigator.tsx +0 -253
  76. package/src/components/forms/Form.tsx +0 -126
  77. package/src/components/forms/FormContainer.tsx +0 -24
  78. package/src/components/forms/ImageForm.tsx +0 -195
  79. package/src/components/forms/TextArea.tsx +0 -24
  80. package/src/components/ui/accordion.tsx +0 -58
  81. package/src/components/ui/alert-dialog.tsx +0 -139
  82. package/src/components/ui/avatar.tsx +0 -48
  83. package/src/components/ui/button.tsx +0 -56
  84. package/src/components/ui/calendar.tsx +0 -62
  85. package/src/components/ui/card.tsx +0 -86
  86. package/src/components/ui/checkbox.tsx +0 -28
  87. package/src/components/ui/command.tsx +0 -153
  88. package/src/components/ui/dialog.tsx +0 -120
  89. package/src/components/ui/dropdown-menu.tsx +0 -198
  90. package/src/components/ui/form.tsx +0 -177
  91. package/src/components/ui/input.tsx +0 -24
  92. package/src/components/ui/label.tsx +0 -24
  93. package/src/components/ui/popover.tsx +0 -29
  94. package/src/components/ui/progress.tsx +0 -26
  95. package/src/components/ui/radio-group.tsx +0 -42
  96. package/src/components/ui/scroll-area.tsx +0 -51
  97. package/src/components/ui/select.tsx +0 -119
  98. package/src/components/ui/switch.tsx +0 -27
  99. package/src/components/ui/tabs.tsx +0 -53
  100. package/src/components/ui/toggle.tsx +0 -43
  101. package/src/components/ui/tooltip.tsx +0 -28
  102. package/src/components/usePatch.ts +0 -86
  103. package/src/components/useTheme.ts +0 -45
  104. package/src/dto/SerializedSchema.ts +0 -69
  105. package/src/dto/Session.ts +0 -12
  106. package/src/dto/SessionMode.ts +0 -5
  107. package/src/dto/Tree.ts +0 -18
  108. package/src/exports.ts +0 -6
  109. package/src/index.css +0 -115
  110. package/src/index.tsx +0 -14
  111. package/src/lib/IValStore.ts +0 -6
  112. package/src/lib/utils.ts +0 -6
  113. package/src/main.jsx +0 -10
  114. package/src/richtext/conversion/conversion.test.ts +0 -146
  115. package/src/richtext/conversion/lexicalToRichTextSource.test.ts +0 -89
  116. package/src/richtext/conversion/lexicalToRichTextSource.ts +0 -285
  117. package/src/richtext/conversion/parseRichTextSource.test.ts +0 -469
  118. package/src/richtext/conversion/parseRichTextSource.ts +0 -233
  119. package/src/richtext/conversion/richTextSourceToLexical.test.ts +0 -381
  120. package/src/richtext/conversion/richTextSourceToLexical.ts +0 -293
  121. package/src/richtext/shadowRootPolyFill.js +0 -115
  122. package/src/server.ts +0 -70
  123. package/src/stories/Button.stories.tsx +0 -20
  124. package/src/stories/Checkbox.stories.tsx +0 -14
  125. package/src/stories/Dropdown.stories.tsx +0 -23
  126. package/src/stories/Introduction.mdx +0 -221
  127. package/src/stories/RichTextEditor.stories.tsx +0 -24
  128. package/src/stories/assets/code-brackets.svg +0 -1
  129. package/src/stories/assets/colors.svg +0 -1
  130. package/src/stories/assets/comments.svg +0 -1
  131. package/src/stories/assets/direction.svg +0 -1
  132. package/src/stories/assets/flow.svg +0 -1
  133. package/src/stories/assets/plugin.svg +0 -1
  134. package/src/stories/assets/repo.svg +0 -1
  135. package/src/stories/assets/stackalt.svg +0 -1
  136. package/src/utils/Remote.ts +0 -15
  137. package/src/utils/imageMimeType.ts +0 -23
  138. package/src/utils/readImage.ts +0 -54
  139. package/src/utils/resolvePath.ts +0 -32
  140. package/src/vite-env.d.ts +0 -1
  141. package/src/vite-index.tsx +0 -7
  142. package/src/vite-server.ts +0 -42
  143. package/tailwind.config.js +0 -83
  144. package/tsconfig.json +0 -19
  145. package/vite.config.ts +0 -43
@@ -1,139 +0,0 @@
1
- import * as React from "react";
2
- import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
3
-
4
- import { cn } from "../../lib/utils";
5
- import { buttonVariants } from "./button";
6
-
7
- const AlertDialog = AlertDialogPrimitive.Root;
8
-
9
- const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
10
-
11
- const AlertDialogPortal = AlertDialogPrimitive.Portal;
12
-
13
- const AlertDialogOverlay = React.forwardRef<
14
- React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
15
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
16
- >(({ className, ...props }, ref) => (
17
- <AlertDialogPrimitive.Overlay
18
- className={cn(
19
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
20
- className
21
- )}
22
- {...props}
23
- ref={ref}
24
- />
25
- ));
26
- AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
27
-
28
- const AlertDialogContent = React.forwardRef<
29
- React.ElementRef<typeof AlertDialogPrimitive.Content>,
30
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
31
- >(({ className, ...props }, ref) => (
32
- <AlertDialogPortal>
33
- <AlertDialogOverlay />
34
- <AlertDialogPrimitive.Content
35
- ref={ref}
36
- className={cn(
37
- "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 md:w-full",
38
- className
39
- )}
40
- {...props}
41
- />
42
- </AlertDialogPortal>
43
- ));
44
- AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
45
-
46
- const AlertDialogHeader = ({
47
- className,
48
- ...props
49
- }: React.HTMLAttributes<HTMLDivElement>) => (
50
- <div
51
- className={cn(
52
- "flex flex-col space-y-2 text-center sm:text-left",
53
- className
54
- )}
55
- {...props}
56
- />
57
- );
58
- AlertDialogHeader.displayName = "AlertDialogHeader";
59
-
60
- const AlertDialogFooter = ({
61
- className,
62
- ...props
63
- }: React.HTMLAttributes<HTMLDivElement>) => (
64
- <div
65
- className={cn(
66
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
67
- className
68
- )}
69
- {...props}
70
- />
71
- );
72
- AlertDialogFooter.displayName = "AlertDialogFooter";
73
-
74
- const AlertDialogTitle = React.forwardRef<
75
- React.ElementRef<typeof AlertDialogPrimitive.Title>,
76
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
77
- >(({ className, ...props }, ref) => (
78
- <AlertDialogPrimitive.Title
79
- ref={ref}
80
- className={cn("text-lg font-semibold", className)}
81
- {...props}
82
- />
83
- ));
84
- AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
85
-
86
- const AlertDialogDescription = React.forwardRef<
87
- React.ElementRef<typeof AlertDialogPrimitive.Description>,
88
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
89
- >(({ className, ...props }, ref) => (
90
- <AlertDialogPrimitive.Description
91
- ref={ref}
92
- className={cn("text-sm text-muted-foreground", className)}
93
- {...props}
94
- />
95
- ));
96
- AlertDialogDescription.displayName =
97
- AlertDialogPrimitive.Description.displayName;
98
-
99
- const AlertDialogAction = React.forwardRef<
100
- React.ElementRef<typeof AlertDialogPrimitive.Action>,
101
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
102
- >(({ className, ...props }, ref) => (
103
- <AlertDialogPrimitive.Action
104
- ref={ref}
105
- className={cn(buttonVariants(), className)}
106
- {...props}
107
- />
108
- ));
109
- AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
110
-
111
- const AlertDialogCancel = React.forwardRef<
112
- React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
113
- React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
114
- >(({ className, ...props }, ref) => (
115
- <AlertDialogPrimitive.Cancel
116
- ref={ref}
117
- className={cn(
118
- buttonVariants({ variant: "outline" }),
119
- "mt-2 sm:mt-0",
120
- className
121
- )}
122
- {...props}
123
- />
124
- ));
125
- AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
126
-
127
- export {
128
- AlertDialog,
129
- AlertDialogPortal,
130
- AlertDialogOverlay,
131
- AlertDialogTrigger,
132
- AlertDialogContent,
133
- AlertDialogHeader,
134
- AlertDialogFooter,
135
- AlertDialogTitle,
136
- AlertDialogDescription,
137
- AlertDialogAction,
138
- AlertDialogCancel,
139
- };
@@ -1,48 +0,0 @@
1
- import * as React from "react";
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- const Avatar = React.forwardRef<
7
- React.ElementRef<typeof AvatarPrimitive.Root>,
8
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
9
- >(({ className, ...props }, ref) => (
10
- <AvatarPrimitive.Root
11
- ref={ref}
12
- className={cn(
13
- "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
14
- className
15
- )}
16
- {...props}
17
- />
18
- ));
19
- Avatar.displayName = AvatarPrimitive.Root.displayName;
20
-
21
- const AvatarImage = React.forwardRef<
22
- React.ElementRef<typeof AvatarPrimitive.Image>,
23
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
24
- >(({ className, ...props }, ref) => (
25
- <AvatarPrimitive.Image
26
- ref={ref}
27
- className={cn("aspect-square h-full w-full", className)}
28
- {...props}
29
- />
30
- ));
31
- AvatarImage.displayName = AvatarPrimitive.Image.displayName;
32
-
33
- const AvatarFallback = React.forwardRef<
34
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
35
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
36
- >(({ className, ...props }, ref) => (
37
- <AvatarPrimitive.Fallback
38
- ref={ref}
39
- className={cn(
40
- "flex h-full w-full items-center justify-center rounded-full bg-muted",
41
- className
42
- )}
43
- {...props}
44
- />
45
- ));
46
- AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
47
-
48
- export { Avatar, AvatarImage, AvatarFallback };
@@ -1,56 +0,0 @@
1
- import * as React from "react";
2
- import { Slot } from "@radix-ui/react-slot";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const buttonVariants = cva(
8
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
9
- {
10
- variants: {
11
- variant: {
12
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-destructive-foreground hover:bg-destructive/90",
15
- outline:
16
- "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
17
- secondary:
18
- "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
- ghost: "hover:bg-accent hover:text-accent-foreground",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default: "h-10 px-4 py-2",
24
- sm: "h-9 rounded-md px-3",
25
- lg: "h-11 rounded-md px-8",
26
- icon: "h-10 w-10",
27
- },
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default",
32
- },
33
- }
34
- );
35
-
36
- export interface ButtonProps
37
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
- VariantProps<typeof buttonVariants> {
39
- asChild?: boolean;
40
- }
41
-
42
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
- ({ className, variant, size, asChild = false, ...props }, ref) => {
44
- const Comp = asChild ? Slot : "button";
45
- return (
46
- <Comp
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- ref={ref}
49
- {...props}
50
- />
51
- );
52
- }
53
- );
54
- Button.displayName = "Button";
55
-
56
- export { Button, buttonVariants };
@@ -1,62 +0,0 @@
1
- import * as React from "react";
2
- import { ChevronLeft, ChevronRight } from "lucide-react";
3
- import { DayPicker } from "react-day-picker";
4
-
5
- import { cn } from "../../lib/utils";
6
- import { buttonVariants } from "./button";
7
-
8
- export type CalendarProps = React.ComponentProps<typeof DayPicker>;
9
-
10
- function Calendar({
11
- className,
12
- classNames,
13
- showOutsideDays = true,
14
- ...props
15
- }: CalendarProps) {
16
- return (
17
- <DayPicker
18
- showOutsideDays={showOutsideDays}
19
- className={cn("p-3", className)}
20
- classNames={{
21
- months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
22
- month: "space-y-4",
23
- caption: "flex justify-center pt-1 relative items-center",
24
- caption_label: "text-sm font-medium",
25
- nav: "space-x-1 flex items-center",
26
- nav_button: cn(
27
- buttonVariants({ variant: "outline" }),
28
- "h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
29
- ),
30
- nav_button_previous: "absolute left-1",
31
- nav_button_next: "absolute right-1",
32
- table: "w-full border-collapse space-y-1",
33
- head_row: "flex",
34
- head_cell:
35
- "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
36
- row: "flex w-full mt-2",
37
- cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
38
- day: cn(
39
- buttonVariants({ variant: "ghost" }),
40
- "h-9 w-9 p-0 font-normal aria-selected:opacity-100"
41
- ),
42
- day_selected:
43
- "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
44
- day_today: "bg-accent text-accent-foreground",
45
- day_outside: "text-muted-foreground opacity-50",
46
- day_disabled: "text-muted-foreground opacity-50",
47
- day_range_middle:
48
- "aria-selected:bg-accent aria-selected:text-accent-foreground",
49
- day_hidden: "invisible",
50
- ...classNames,
51
- }}
52
- components={{
53
- IconLeft: () => <ChevronLeft className="w-4 h-4" />,
54
- IconRight: () => <ChevronRight className="w-4 h-4" />,
55
- }}
56
- {...props}
57
- />
58
- );
59
- }
60
- Calendar.displayName = "Calendar";
61
-
62
- export { Calendar };
@@ -1,86 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { cn } from "../../lib/utils";
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- "rounded-lg border bg-card text-card-foreground shadow-sm",
13
- className
14
- )}
15
- {...props}
16
- />
17
- ));
18
- Card.displayName = "Card";
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn("flex flex-col space-y-1.5 p-6", className)}
27
- {...props}
28
- />
29
- ));
30
- CardHeader.displayName = "CardHeader";
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLParagraphElement,
34
- React.HTMLAttributes<HTMLHeadingElement>
35
- >(({ className, ...props }, ref) => (
36
- <h3
37
- ref={ref}
38
- className={cn(
39
- "text-2xl font-semibold leading-none tracking-tight",
40
- className
41
- )}
42
- {...props}
43
- />
44
- ));
45
- CardTitle.displayName = "CardTitle";
46
-
47
- const CardDescription = React.forwardRef<
48
- HTMLParagraphElement,
49
- React.HTMLAttributes<HTMLParagraphElement>
50
- >(({ className, ...props }, ref) => (
51
- <p
52
- ref={ref}
53
- className={cn("text-sm text-muted-foreground", className)}
54
- {...props}
55
- />
56
- ));
57
- CardDescription.displayName = "CardDescription";
58
-
59
- const CardContent = React.forwardRef<
60
- HTMLDivElement,
61
- React.HTMLAttributes<HTMLDivElement>
62
- >(({ className, ...props }, ref) => (
63
- <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
64
- ));
65
- CardContent.displayName = "CardContent";
66
-
67
- const CardFooter = React.forwardRef<
68
- HTMLDivElement,
69
- React.HTMLAttributes<HTMLDivElement>
70
- >(({ className, ...props }, ref) => (
71
- <div
72
- ref={ref}
73
- className={cn("flex items-center p-6 pt-0", className)}
74
- {...props}
75
- />
76
- ));
77
- CardFooter.displayName = "CardFooter";
78
-
79
- export {
80
- Card,
81
- CardHeader,
82
- CardFooter,
83
- CardTitle,
84
- CardDescription,
85
- CardContent,
86
- };
@@ -1,28 +0,0 @@
1
- import * as React from "react";
2
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
3
- import { Check } from "lucide-react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const Checkbox = React.forwardRef<
8
- React.ElementRef<typeof CheckboxPrimitive.Root>,
9
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
10
- >(({ className, ...props }, ref) => (
11
- <CheckboxPrimitive.Root
12
- ref={ref}
13
- className={cn(
14
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
15
- className
16
- )}
17
- {...props}
18
- >
19
- <CheckboxPrimitive.Indicator
20
- className={cn("flex items-center justify-center text-current")}
21
- >
22
- <Check className="w-4 h-4" />
23
- </CheckboxPrimitive.Indicator>
24
- </CheckboxPrimitive.Root>
25
- ));
26
- Checkbox.displayName = CheckboxPrimitive.Root.displayName;
27
-
28
- export { Checkbox };
@@ -1,153 +0,0 @@
1
- import * as React from "react";
2
- import { DialogProps } from "@radix-ui/react-dialog";
3
- import { Command as CommandPrimitive } from "cmdk";
4
- import { Search } from "lucide-react";
5
-
6
- import { cn } from "../../lib/utils";
7
- import { Dialog, DialogContent } from "./dialog";
8
-
9
- const Command = React.forwardRef<
10
- React.ElementRef<typeof CommandPrimitive>,
11
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
12
- >(({ className, ...props }, ref) => (
13
- <CommandPrimitive
14
- ref={ref}
15
- className={cn(
16
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
17
- className
18
- )}
19
- {...props}
20
- />
21
- ));
22
- Command.displayName = CommandPrimitive.displayName;
23
-
24
- type CommandDialogProps = DialogProps;
25
-
26
- const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
27
- return (
28
- <Dialog {...props}>
29
- <DialogContent className="p-0 overflow-hidden shadow-lg">
30
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
31
- {children}
32
- </Command>
33
- </DialogContent>
34
- </Dialog>
35
- );
36
- };
37
-
38
- const CommandInput = React.forwardRef<
39
- React.ElementRef<typeof CommandPrimitive.Input>,
40
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
- >(({ className, ...props }, ref) => (
42
- <div className="flex items-center px-3 border-b" cmdk-input-wrapper="">
43
- <Search className="w-4 h-4 mr-2 opacity-50 shrink-0" />
44
- <CommandPrimitive.Input
45
- ref={ref}
46
- className={cn(
47
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
48
- className
49
- )}
50
- {...props}
51
- />
52
- </div>
53
- ));
54
-
55
- CommandInput.displayName = CommandPrimitive.Input.displayName;
56
-
57
- const CommandList = React.forwardRef<
58
- React.ElementRef<typeof CommandPrimitive.List>,
59
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
- >(({ className, ...props }, ref) => (
61
- <CommandPrimitive.List
62
- ref={ref}
63
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
64
- {...props}
65
- />
66
- ));
67
-
68
- CommandList.displayName = CommandPrimitive.List.displayName;
69
-
70
- const CommandEmpty = React.forwardRef<
71
- React.ElementRef<typeof CommandPrimitive.Empty>,
72
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
- >((props, ref) => (
74
- <CommandPrimitive.Empty
75
- ref={ref}
76
- className="py-6 text-sm text-center"
77
- {...props}
78
- />
79
- ));
80
-
81
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
82
-
83
- const CommandGroup = React.forwardRef<
84
- React.ElementRef<typeof CommandPrimitive.Group>,
85
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
86
- >(({ className, ...props }, ref) => (
87
- <CommandPrimitive.Group
88
- ref={ref}
89
- className={cn(
90
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
91
- className
92
- )}
93
- {...props}
94
- />
95
- ));
96
-
97
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
98
-
99
- const CommandSeparator = React.forwardRef<
100
- React.ElementRef<typeof CommandPrimitive.Separator>,
101
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
102
- >(({ className, ...props }, ref) => (
103
- <CommandPrimitive.Separator
104
- ref={ref}
105
- className={cn("-mx-1 h-px bg-border", className)}
106
- {...props}
107
- />
108
- ));
109
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
110
-
111
- const CommandItem = React.forwardRef<
112
- React.ElementRef<typeof CommandPrimitive.Item>,
113
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
114
- >(({ className, ...props }, ref) => (
115
- <CommandPrimitive.Item
116
- ref={ref}
117
- className={cn(
118
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
119
- className
120
- )}
121
- {...props}
122
- />
123
- ));
124
-
125
- CommandItem.displayName = CommandPrimitive.Item.displayName;
126
-
127
- const CommandShortcut = ({
128
- className,
129
- ...props
130
- }: React.HTMLAttributes<HTMLSpanElement>) => {
131
- return (
132
- <span
133
- className={cn(
134
- "ml-auto text-xs tracking-widest text-muted-foreground",
135
- className
136
- )}
137
- {...props}
138
- />
139
- );
140
- };
141
- CommandShortcut.displayName = "CommandShortcut";
142
-
143
- export {
144
- Command,
145
- CommandDialog,
146
- CommandInput,
147
- CommandList,
148
- CommandEmpty,
149
- CommandGroup,
150
- CommandItem,
151
- CommandShortcut,
152
- CommandSeparator,
153
- };
@@ -1,120 +0,0 @@
1
- import * as React from "react";
2
- import * as DialogPrimitive from "@radix-ui/react-dialog";
3
- import { X } from "lucide-react";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const Dialog = DialogPrimitive.Root;
8
-
9
- const DialogTrigger = DialogPrimitive.Trigger;
10
-
11
- const DialogPortal = DialogPrimitive.Portal;
12
-
13
- const DialogClose = DialogPrimitive.Close;
14
-
15
- const DialogOverlay = React.forwardRef<
16
- React.ElementRef<typeof DialogPrimitive.Overlay>,
17
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
18
- >(({ className, ...props }, ref) => (
19
- <DialogPrimitive.Overlay
20
- ref={ref}
21
- className={cn(
22
- "fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
23
- className
24
- )}
25
- {...props}
26
- />
27
- ));
28
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
29
-
30
- const DialogContent = React.forwardRef<
31
- React.ElementRef<typeof DialogPrimitive.Content>,
32
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
33
- >(({ className, children, ...props }, ref) => (
34
- <DialogPortal>
35
- <DialogOverlay />
36
- <DialogPrimitive.Content
37
- ref={ref}
38
- className={cn(
39
- "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 md:w-full",
40
- className
41
- )}
42
- {...props}
43
- >
44
- {children}
45
- <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">
46
- <X className="w-4 h-4" />
47
- <span className="sr-only">Close</span>
48
- </DialogPrimitive.Close>
49
- </DialogPrimitive.Content>
50
- </DialogPortal>
51
- ));
52
- DialogContent.displayName = DialogPrimitive.Content.displayName;
53
-
54
- const DialogHeader = ({
55
- className,
56
- ...props
57
- }: React.HTMLAttributes<HTMLDivElement>) => (
58
- <div
59
- className={cn(
60
- "flex flex-col space-y-1.5 text-center sm:text-left",
61
- className
62
- )}
63
- {...props}
64
- />
65
- );
66
- DialogHeader.displayName = "DialogHeader";
67
-
68
- const DialogFooter = ({
69
- className,
70
- ...props
71
- }: React.HTMLAttributes<HTMLDivElement>) => (
72
- <div
73
- className={cn(
74
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
75
- className
76
- )}
77
- {...props}
78
- />
79
- );
80
- DialogFooter.displayName = "DialogFooter";
81
-
82
- const DialogTitle = React.forwardRef<
83
- React.ElementRef<typeof DialogPrimitive.Title>,
84
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
85
- >(({ className, ...props }, ref) => (
86
- <DialogPrimitive.Title
87
- ref={ref}
88
- className={cn(
89
- "text-lg font-semibold leading-none tracking-tight",
90
- className
91
- )}
92
- {...props}
93
- />
94
- ));
95
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
96
-
97
- const DialogDescription = React.forwardRef<
98
- React.ElementRef<typeof DialogPrimitive.Description>,
99
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
100
- >(({ className, ...props }, ref) => (
101
- <DialogPrimitive.Description
102
- ref={ref}
103
- className={cn("text-sm text-muted-foreground", className)}
104
- {...props}
105
- />
106
- ));
107
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
108
-
109
- export {
110
- Dialog,
111
- DialogPortal,
112
- DialogOverlay,
113
- DialogClose,
114
- DialogTrigger,
115
- DialogContent,
116
- DialogHeader,
117
- DialogFooter,
118
- DialogTitle,
119
- DialogDescription,
120
- };