@org-design-system/components 0.1.10 → 0.1.13

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.
@@ -1,111 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Avatar as AvatarPrimitive } from "radix-ui"
5
- import { cn } from "../lib/utils"
6
-
7
- function Avatar({
8
- className,
9
- size = "default",
10
- ...props
11
- }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
12
- size?: "default" | "sm" | "lg"
13
- }) {
14
- return (
15
- <AvatarPrimitive.Root
16
- data-slot="avatar"
17
- data-size={size}
18
- className={cn(
19
- "group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
20
- className
21
- )}
22
- {...props}
23
- />
24
- )
25
- }
26
-
27
- function AvatarImage({
28
- className,
29
- ...props
30
- }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
31
- return (
32
- <AvatarPrimitive.Image
33
- data-slot="avatar-image"
34
- className={cn(
35
- "aspect-square size-full rounded-full object-cover",
36
- className
37
- )}
38
- {...props}
39
- />
40
- )
41
- }
42
-
43
- function AvatarFallback({
44
- className,
45
- ...props
46
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
47
- return (
48
- <AvatarPrimitive.Fallback
49
- data-slot="avatar-fallback"
50
- className={cn(
51
- "flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",
52
- className
53
- )}
54
- {...props}
55
- />
56
- )
57
- }
58
-
59
- function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
60
- return (
61
- <span
62
- data-slot="avatar-badge"
63
- className={cn(
64
- "absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none",
65
- "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
66
- "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
67
- "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
68
- className
69
- )}
70
- {...props}
71
- />
72
- )
73
- }
74
-
75
- function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
76
- return (
77
- <div
78
- data-slot="avatar-group"
79
- className={cn(
80
- "group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background",
81
- className
82
- )}
83
- {...props}
84
- />
85
- )
86
- }
87
-
88
- function AvatarGroupCount({
89
- className,
90
- ...props
91
- }: React.ComponentProps<"div">) {
92
- return (
93
- <div
94
- data-slot="avatar-group-count"
95
- className={cn(
96
- "relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
97
- className
98
- )}
99
- {...props}
100
- />
101
- )
102
- }
103
-
104
- export {
105
- Avatar,
106
- AvatarImage,
107
- AvatarFallback,
108
- AvatarGroup,
109
- AvatarGroupCount,
110
- AvatarBadge,
111
- }
@@ -1,103 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../lib/utils"
4
-
5
- function Card({
6
- className,
7
- size = "default",
8
- ...props
9
- }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
10
- return (
11
- <div
12
- data-slot="card"
13
- data-size={size}
14
- className={cn(
15
- "group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
- className
17
- )}
18
- {...props}
19
- />
20
- )
21
- }
22
-
23
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
24
- return (
25
- <div
26
- data-slot="card-header"
27
- className={cn(
28
- "group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3",
29
- className
30
- )}
31
- {...props}
32
- />
33
- )
34
- }
35
-
36
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
37
- return (
38
- <div
39
- data-slot="card-title"
40
- className={cn(
41
- "text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
42
- className
43
- )}
44
- {...props}
45
- />
46
- )
47
- }
48
-
49
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
50
- return (
51
- <div
52
- data-slot="card-description"
53
- className={cn("text-sm text-muted-foreground", className)}
54
- {...props}
55
- />
56
- )
57
- }
58
-
59
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
60
- return (
61
- <div
62
- data-slot="card-action"
63
- className={cn(
64
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
65
- className
66
- )}
67
- {...props}
68
- />
69
- )
70
- }
71
-
72
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
73
- return (
74
- <div
75
- data-slot="card-content"
76
- className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
77
- {...props}
78
- />
79
- )
80
- }
81
-
82
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
83
- return (
84
- <div
85
- data-slot="card-footer"
86
- className={cn(
87
- "flex items-center rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/card:p-3",
88
- className
89
- )}
90
- {...props}
91
- />
92
- )
93
- }
94
-
95
- export {
96
- Card,
97
- CardHeader,
98
- CardFooter,
99
- CardTitle,
100
- CardAction,
101
- CardDescription,
102
- CardContent,
103
- }
@@ -1,33 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Checkbox as CheckboxPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/utils"
7
- import { CheckIcon } from "@org-design-system/icons"
8
-
9
- function Checkbox({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
- return (
14
- <CheckboxPrimitive.Root
15
- data-slot="checkbox"
16
- className={cn(
17
- "peer relative flex size-4 shrink-0 items-center justify-center rounded-sm border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
18
- className
19
- )}
20
- {...props}
21
- >
22
- <CheckboxPrimitive.Indicator
23
- data-slot="checkbox-indicator"
24
- className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
25
- >
26
- <CheckIcon
27
- />
28
- </CheckboxPrimitive.Indicator>
29
- </CheckboxPrimitive.Root>
30
- )
31
- }
32
-
33
- export { Checkbox }
@@ -1,19 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../lib/utils"
4
-
5
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
6
- return (
7
- <input
8
- type={type}
9
- data-slot="input"
10
- className={cn(
11
- "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
12
- className
13
- )}
14
- {...props}
15
- />
16
- )
17
- }
18
-
19
- export { Input }
@@ -1,24 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Label as LabelPrimitive } from "radix-ui"
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,89 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Popover as PopoverPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/utils"
7
-
8
- function Popover({
9
- ...props
10
- }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
11
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
12
- }
13
-
14
- function PopoverTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
17
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
18
- }
19
-
20
- function PopoverContent({
21
- className,
22
- align = "center",
23
- sideOffset = 4,
24
- ...props
25
- }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
26
- return (
27
- <PopoverPrimitive.Portal>
28
- <PopoverPrimitive.Content
29
- data-slot="popover-content"
30
- align={align}
31
- sideOffset={sideOffset}
32
- className={cn(
33
- "z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
34
- className
35
- )}
36
- {...props}
37
- />
38
- </PopoverPrimitive.Portal>
39
- )
40
- }
41
-
42
- function PopoverAnchor({
43
- ...props
44
- }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
46
- }
47
-
48
- function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
49
- return (
50
- <div
51
- data-slot="popover-header"
52
- className={cn("flex flex-col gap-0.5 text-sm", className)}
53
- {...props}
54
- />
55
- )
56
- }
57
-
58
- function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
59
- return (
60
- <div
61
- data-slot="popover-title"
62
- className={cn("font-medium", className)}
63
- {...props}
64
- />
65
- )
66
- }
67
-
68
- function PopoverDescription({
69
- className,
70
- ...props
71
- }: React.ComponentProps<"p">) {
72
- return (
73
- <p
74
- data-slot="popover-description"
75
- className={cn("text-muted-foreground", className)}
76
- {...props}
77
- />
78
- )
79
- }
80
-
81
- export {
82
- Popover,
83
- PopoverAnchor,
84
- PopoverContent,
85
- PopoverDescription,
86
- PopoverHeader,
87
- PopoverTitle,
88
- PopoverTrigger,
89
- }
@@ -1,192 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Select as SelectPrimitive } from "radix-ui"
5
-
6
- import { cn } from "../lib/utils"
7
- import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
8
-
9
- function Select({
10
- ...props
11
- }: React.ComponentProps<typeof SelectPrimitive.Root>) {
12
- return <SelectPrimitive.Root data-slot="select" {...props} />
13
- }
14
-
15
- function SelectGroup({
16
- className,
17
- ...props
18
- }: React.ComponentProps<typeof SelectPrimitive.Group>) {
19
- return (
20
- <SelectPrimitive.Group
21
- data-slot="select-group"
22
- className={cn("scroll-my-1 p-1", className)}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- function SelectValue({
29
- ...props
30
- }: React.ComponentProps<typeof SelectPrimitive.Value>) {
31
- return <SelectPrimitive.Value data-slot="select-value" {...props} />
32
- }
33
-
34
- function SelectTrigger({
35
- className,
36
- size = "default",
37
- children,
38
- ...props
39
- }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
40
- size?: "sm" | "default"
41
- }) {
42
- return (
43
- <SelectPrimitive.Trigger
44
- data-slot="select-trigger"
45
- data-size={size}
46
- className={cn(
47
- "flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
48
- className
49
- )}
50
- {...props}
51
- >
52
- {children}
53
- <SelectPrimitive.Icon asChild>
54
- <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
55
- </SelectPrimitive.Icon>
56
- </SelectPrimitive.Trigger>
57
- )
58
- }
59
-
60
- function SelectContent({
61
- className,
62
- children,
63
- position = "item-aligned",
64
- align = "center",
65
- ...props
66
- }: React.ComponentProps<typeof SelectPrimitive.Content>) {
67
- return (
68
- <SelectPrimitive.Portal>
69
- <SelectPrimitive.Content
70
- data-slot="select-content"
71
- data-align-trigger={position === "item-aligned"}
72
- className={cn("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position ==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className )}
73
- position={position}
74
- align={align}
75
- {...props}
76
- >
77
- <SelectScrollUpButton />
78
- <SelectPrimitive.Viewport
79
- data-position={position}
80
- className={cn(
81
- "data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",
82
- position === "popper" && ""
83
- )}
84
- >
85
- {children}
86
- </SelectPrimitive.Viewport>
87
- <SelectScrollDownButton />
88
- </SelectPrimitive.Content>
89
- </SelectPrimitive.Portal>
90
- )
91
- }
92
-
93
- function SelectLabel({
94
- className,
95
- ...props
96
- }: React.ComponentProps<typeof SelectPrimitive.Label>) {
97
- return (
98
- <SelectPrimitive.Label
99
- data-slot="select-label"
100
- className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}
101
- {...props}
102
- />
103
- )
104
- }
105
-
106
- function SelectItem({
107
- className,
108
- children,
109
- ...props
110
- }: React.ComponentProps<typeof SelectPrimitive.Item>) {
111
- return (
112
- <SelectPrimitive.Item
113
- data-slot="select-item"
114
- className={cn(
115
- "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
116
- className
117
- )}
118
- {...props}
119
- >
120
- <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center">
121
- <SelectPrimitive.ItemIndicator>
122
- <CheckIcon className="pointer-events-none" />
123
- </SelectPrimitive.ItemIndicator>
124
- </span>
125
- <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
126
- </SelectPrimitive.Item>
127
- )
128
- }
129
-
130
- function SelectSeparator({
131
- className,
132
- ...props
133
- }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
134
- return (
135
- <SelectPrimitive.Separator
136
- data-slot="select-separator"
137
- className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
138
- {...props}
139
- />
140
- )
141
- }
142
-
143
- function SelectScrollUpButton({
144
- className,
145
- ...props
146
- }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
147
- return (
148
- <SelectPrimitive.ScrollUpButton
149
- data-slot="select-scroll-up-button"
150
- className={cn(
151
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
152
- className
153
- )}
154
- {...props}
155
- >
156
- <ChevronUpIcon
157
- />
158
- </SelectPrimitive.ScrollUpButton>
159
- )
160
- }
161
-
162
- function SelectScrollDownButton({
163
- className,
164
- ...props
165
- }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
166
- return (
167
- <SelectPrimitive.ScrollDownButton
168
- data-slot="select-scroll-down-button"
169
- className={cn(
170
- "z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
171
- className
172
- )}
173
- {...props}
174
- >
175
- <ChevronDownIcon
176
- />
177
- </SelectPrimitive.ScrollDownButton>
178
- )
179
- }
180
-
181
- export {
182
- Select,
183
- SelectContent,
184
- SelectGroup,
185
- SelectItem,
186
- SelectLabel,
187
- SelectScrollDownButton,
188
- SelectScrollUpButton,
189
- SelectSeparator,
190
- SelectTrigger,
191
- SelectValue,
192
- }
@@ -1,18 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../lib/utils"
4
-
5
- function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
- return (
7
- <textarea
8
- data-slot="textarea"
9
- className={cn(
10
- "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- export { Textarea }
@@ -1,46 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { Toggle as TogglePrimitive } from "radix-ui"
6
-
7
- import { cn } from "../lib/utils"
8
-
9
- const toggleVariants = cva(
10
- "group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
- {
12
- variants: {
13
- variant: {
14
- default: "bg-transparent",
15
- outline: "border border-input bg-transparent hover:bg-muted",
16
- },
17
- size: {
18
- default: "h-8 min-w-8 px-2",
19
- sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]",
20
- lg: "h-9 min-w-9 px-2.5",
21
- },
22
- },
23
- defaultVariants: {
24
- variant: "default",
25
- size: "default",
26
- },
27
- }
28
- )
29
-
30
- function Toggle({
31
- className,
32
- variant = "default",
33
- size = "default",
34
- ...props
35
- }: React.ComponentProps<typeof TogglePrimitive.Root> &
36
- VariantProps<typeof toggleVariants>) {
37
- return (
38
- <TogglePrimitive.Root
39
- data-slot="toggle"
40
- className={cn(toggleVariants({ variant, size, className }))}
41
- {...props}
42
- />
43
- )
44
- }
45
-
46
- export { Toggle, toggleVariants }