@openconsole/shadcn 0.0.0 → 0.2.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 (73) hide show
  1. package/README.md +380 -0
  2. package/accordion.tsx +66 -66
  3. package/alert-dialog.tsx +196 -196
  4. package/alert.tsx +66 -66
  5. package/aspect-ratio.tsx +11 -11
  6. package/avatar.tsx +53 -53
  7. package/badge.tsx +46 -46
  8. package/breadcrumb.tsx +109 -109
  9. package/button-group.tsx +83 -83
  10. package/button.tsx +60 -60
  11. package/calendar.tsx +219 -219
  12. package/card.tsx +92 -92
  13. package/carousel.tsx +241 -241
  14. package/chart.tsx +374 -374
  15. package/checkbox.tsx +32 -32
  16. package/collapsible.tsx +33 -33
  17. package/command.tsx +184 -184
  18. package/context-menu.tsx +252 -252
  19. package/dialog.tsx +143 -143
  20. package/direction.tsx +22 -22
  21. package/drawer.tsx +135 -135
  22. package/dropdown-menu.tsx +257 -257
  23. package/empty.tsx +104 -104
  24. package/field.tsx +248 -248
  25. package/form.tsx +167 -167
  26. package/hooks/index.ts +1 -1
  27. package/hooks/use-mobile.ts +19 -19
  28. package/hover-card.tsx +44 -44
  29. package/icon.tsx +21 -21
  30. package/index.ts +59 -59
  31. package/input-group.tsx +170 -170
  32. package/input-otp.tsx +77 -77
  33. package/input.tsx +21 -21
  34. package/item.tsx +193 -193
  35. package/kbd.tsx +28 -28
  36. package/label.tsx +24 -24
  37. package/lib/index.ts +1 -1
  38. package/lib/utils.ts +6 -6
  39. package/menubar.tsx +276 -276
  40. package/native-select.tsx +62 -62
  41. package/navigation-menu.tsx +168 -168
  42. package/package.json +10 -2
  43. package/pagination.tsx +127 -127
  44. package/popover.tsx +89 -89
  45. package/progress.tsx +31 -31
  46. package/radio-group.tsx +45 -45
  47. package/resizable.tsx +53 -53
  48. package/scroll-area.tsx +58 -58
  49. package/select.tsx +187 -187
  50. package/separator.tsx +28 -28
  51. package/sheet.tsx +139 -139
  52. package/sidebar.tsx +724 -724
  53. package/skeleton.tsx +13 -13
  54. package/slider.tsx +63 -63
  55. package/sonner.tsx +40 -40
  56. package/spinner.tsx +16 -16
  57. package/styles.css +122 -0
  58. package/switch.tsx +35 -35
  59. package/table.tsx +116 -116
  60. package/tabs.tsx +66 -66
  61. package/textarea.tsx +18 -18
  62. package/toggle-group.tsx +83 -83
  63. package/toggle.tsx +47 -47
  64. package/tooltip.tsx +61 -61
  65. package/tsconfig.json +12 -12
  66. package/tsconfig.tsbuildinfo +1 -1
  67. package/skill/SKILL.md +0 -599
  68. package/skill/customization.md +0 -263
  69. package/skill/rules/base-vs-radix.md +0 -167
  70. package/skill/rules/composition.md +0 -240
  71. package/skill/rules/forms.md +0 -271
  72. package/skill/rules/icons.md +0 -136
  73. package/skill/rules/styling.md +0 -180
package/item.tsx CHANGED
@@ -1,193 +1,193 @@
1
- import * as React from "react"
2
- import { cva, type VariantProps } from "class-variance-authority"
3
- import { Slot } from "radix-ui"
4
-
5
- import { cn } from "./lib/utils"
6
- import { Separator } from "./separator"
7
-
8
- function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9
- return (
10
- <div
11
- role="list"
12
- data-slot="item-group"
13
- className={cn("group/item-group flex flex-col", className)}
14
- {...props}
15
- />
16
- )
17
- }
18
-
19
- function ItemSeparator({
20
- className,
21
- ...props
22
- }: React.ComponentProps<typeof Separator>) {
23
- return (
24
- <Separator
25
- data-slot="item-separator"
26
- orientation="horizontal"
27
- className={cn("my-0", className)}
28
- {...props}
29
- />
30
- )
31
- }
32
-
33
- const itemVariants = cva(
34
- "group/item flex flex-wrap items-center rounded-md border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-accent/50",
35
- {
36
- variants: {
37
- variant: {
38
- default: "bg-transparent",
39
- outline: "border-border",
40
- muted: "bg-muted/50",
41
- },
42
- size: {
43
- default: "gap-4 p-4",
44
- sm: "gap-2.5 px-4 py-3",
45
- },
46
- },
47
- defaultVariants: {
48
- variant: "default",
49
- size: "default",
50
- },
51
- }
52
- )
53
-
54
- function Item({
55
- className,
56
- variant = "default",
57
- size = "default",
58
- asChild = false,
59
- ...props
60
- }: React.ComponentProps<"div"> &
61
- VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62
- const Comp = asChild ? Slot.Root : "div"
63
- return (
64
- <Comp
65
- data-slot="item"
66
- data-variant={variant}
67
- data-size={size}
68
- className={cn(itemVariants({ variant, size, className }))}
69
- {...props}
70
- />
71
- )
72
- }
73
-
74
- const itemMediaVariants = cva(
75
- "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",
76
- {
77
- variants: {
78
- variant: {
79
- default: "bg-transparent",
80
- icon: "size-8 rounded-sm border bg-muted [&_svg:not([class*='size-'])]:size-4",
81
- image:
82
- "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",
83
- },
84
- },
85
- defaultVariants: {
86
- variant: "default",
87
- },
88
- }
89
- )
90
-
91
- function ItemMedia({
92
- className,
93
- variant = "default",
94
- ...props
95
- }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
96
- return (
97
- <div
98
- data-slot="item-media"
99
- data-variant={variant}
100
- className={cn(itemMediaVariants({ variant, className }))}
101
- {...props}
102
- />
103
- )
104
- }
105
-
106
- function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
107
- return (
108
- <div
109
- data-slot="item-content"
110
- className={cn(
111
- "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
112
- className
113
- )}
114
- {...props}
115
- />
116
- )
117
- }
118
-
119
- function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
120
- return (
121
- <div
122
- data-slot="item-title"
123
- className={cn(
124
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
125
- className
126
- )}
127
- {...props}
128
- />
129
- )
130
- }
131
-
132
- function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
133
- return (
134
- <p
135
- data-slot="item-description"
136
- className={cn(
137
- "line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground",
138
- "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
139
- className
140
- )}
141
- {...props}
142
- />
143
- )
144
- }
145
-
146
- function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
147
- return (
148
- <div
149
- data-slot="item-actions"
150
- className={cn("flex items-center gap-2", className)}
151
- {...props}
152
- />
153
- )
154
- }
155
-
156
- function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
157
- return (
158
- <div
159
- data-slot="item-header"
160
- className={cn(
161
- "flex basis-full items-center justify-between gap-2",
162
- className
163
- )}
164
- {...props}
165
- />
166
- )
167
- }
168
-
169
- function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
170
- return (
171
- <div
172
- data-slot="item-footer"
173
- className={cn(
174
- "flex basis-full items-center justify-between gap-2",
175
- className
176
- )}
177
- {...props}
178
- />
179
- )
180
- }
181
-
182
- export {
183
- Item,
184
- ItemMedia,
185
- ItemContent,
186
- ItemActions,
187
- ItemGroup,
188
- ItemSeparator,
189
- ItemTitle,
190
- ItemDescription,
191
- ItemHeader,
192
- ItemFooter,
193
- }
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { Slot } from "radix-ui"
4
+
5
+ import { cn } from "./lib/utils"
6
+ import { Separator } from "./separator"
7
+
8
+ function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9
+ return (
10
+ <div
11
+ role="list"
12
+ data-slot="item-group"
13
+ className={cn("group/item-group flex flex-col", className)}
14
+ {...props}
15
+ />
16
+ )
17
+ }
18
+
19
+ function ItemSeparator({
20
+ className,
21
+ ...props
22
+ }: React.ComponentProps<typeof Separator>) {
23
+ return (
24
+ <Separator
25
+ data-slot="item-separator"
26
+ orientation="horizontal"
27
+ className={cn("my-0", className)}
28
+ {...props}
29
+ />
30
+ )
31
+ }
32
+
33
+ const itemVariants = cva(
34
+ "group/item flex flex-wrap items-center rounded-md border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-accent/50",
35
+ {
36
+ variants: {
37
+ variant: {
38
+ default: "bg-transparent",
39
+ outline: "border-border",
40
+ muted: "bg-muted/50",
41
+ },
42
+ size: {
43
+ default: "gap-4 p-4",
44
+ sm: "gap-2.5 px-4 py-3",
45
+ },
46
+ },
47
+ defaultVariants: {
48
+ variant: "default",
49
+ size: "default",
50
+ },
51
+ }
52
+ )
53
+
54
+ function Item({
55
+ className,
56
+ variant = "default",
57
+ size = "default",
58
+ asChild = false,
59
+ ...props
60
+ }: React.ComponentProps<"div"> &
61
+ VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62
+ const Comp = asChild ? Slot.Root : "div"
63
+ return (
64
+ <Comp
65
+ data-slot="item"
66
+ data-variant={variant}
67
+ data-size={size}
68
+ className={cn(itemVariants({ variant, size, className }))}
69
+ {...props}
70
+ />
71
+ )
72
+ }
73
+
74
+ const itemMediaVariants = cva(
75
+ "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",
76
+ {
77
+ variants: {
78
+ variant: {
79
+ default: "bg-transparent",
80
+ icon: "size-8 rounded-sm border bg-muted [&_svg:not([class*='size-'])]:size-4",
81
+ image:
82
+ "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",
83
+ },
84
+ },
85
+ defaultVariants: {
86
+ variant: "default",
87
+ },
88
+ }
89
+ )
90
+
91
+ function ItemMedia({
92
+ className,
93
+ variant = "default",
94
+ ...props
95
+ }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
96
+ return (
97
+ <div
98
+ data-slot="item-media"
99
+ data-variant={variant}
100
+ className={cn(itemMediaVariants({ variant, className }))}
101
+ {...props}
102
+ />
103
+ )
104
+ }
105
+
106
+ function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
107
+ return (
108
+ <div
109
+ data-slot="item-content"
110
+ className={cn(
111
+ "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
112
+ className
113
+ )}
114
+ {...props}
115
+ />
116
+ )
117
+ }
118
+
119
+ function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
120
+ return (
121
+ <div
122
+ data-slot="item-title"
123
+ className={cn(
124
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
125
+ className
126
+ )}
127
+ {...props}
128
+ />
129
+ )
130
+ }
131
+
132
+ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
133
+ return (
134
+ <p
135
+ data-slot="item-description"
136
+ className={cn(
137
+ "line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground",
138
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
139
+ className
140
+ )}
141
+ {...props}
142
+ />
143
+ )
144
+ }
145
+
146
+ function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
147
+ return (
148
+ <div
149
+ data-slot="item-actions"
150
+ className={cn("flex items-center gap-2", className)}
151
+ {...props}
152
+ />
153
+ )
154
+ }
155
+
156
+ function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
157
+ return (
158
+ <div
159
+ data-slot="item-header"
160
+ className={cn(
161
+ "flex basis-full items-center justify-between gap-2",
162
+ className
163
+ )}
164
+ {...props}
165
+ />
166
+ )
167
+ }
168
+
169
+ function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
170
+ return (
171
+ <div
172
+ data-slot="item-footer"
173
+ className={cn(
174
+ "flex basis-full items-center justify-between gap-2",
175
+ className
176
+ )}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+
182
+ export {
183
+ Item,
184
+ ItemMedia,
185
+ ItemContent,
186
+ ItemActions,
187
+ ItemGroup,
188
+ ItemSeparator,
189
+ ItemTitle,
190
+ ItemDescription,
191
+ ItemHeader,
192
+ ItemFooter,
193
+ }
package/kbd.tsx CHANGED
@@ -1,28 +1,28 @@
1
- import { cn } from "./lib/utils"
2
-
3
- function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
4
- return (
5
- <kbd
6
- data-slot="kbd"
7
- className={cn(
8
- "pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none",
9
- "[&_svg:not([class*='size-'])]:size-3",
10
- "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
19
- return (
20
- <kbd
21
- data-slot="kbd-group"
22
- className={cn("inline-flex items-center gap-1", className)}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- export { Kbd, KbdGroup }
1
+ import { cn } from "./lib/utils"
2
+
3
+ function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
4
+ return (
5
+ <kbd
6
+ data-slot="kbd"
7
+ className={cn(
8
+ "pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none",
9
+ "[&_svg:not([class*='size-'])]:size-3",
10
+ "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
19
+ return (
20
+ <kbd
21
+ data-slot="kbd-group"
22
+ className={cn("inline-flex items-center gap-1", className)}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ export { Kbd, KbdGroup }
package/label.tsx CHANGED
@@ -1,24 +1,24 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as LabelPrimitive from "@radix-ui/react-label";
5
-
6
- import { cn } from "./lib/utils";
7
-
8
- function Label({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
- return (
13
- <LabelPrimitive.Root
14
- data-slot="label"
15
- className={cn(
16
- "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
- className,
18
- )}
19
- {...props}
20
- />
21
- );
22
- }
23
-
24
- export { Label };
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as LabelPrimitive from "@radix-ui/react-label";
5
+
6
+ import { cn } from "./lib/utils";
7
+
8
+ function Label({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
12
+ return (
13
+ <LabelPrimitive.Root
14
+ data-slot="label"
15
+ className={cn(
16
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
17
+ className,
18
+ )}
19
+ {...props}
20
+ />
21
+ );
22
+ }
23
+
24
+ export { Label };
package/lib/index.ts CHANGED
@@ -1 +1 @@
1
- export * from "./utils";
1
+ export * from "./utils";
package/lib/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { clsx, type ClassValue } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs));
6
- }
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }