@snapcall/design-system 1.25.1 → 1.26.1
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.
- package/dist/{chunk-SSZ45TLL.mjs → chunk-DNGG2G6R.mjs} +4 -4
- package/dist/{chunk-R6W6SKNR.mjs → chunk-HVMCOLSX.mjs} +3 -3
- package/dist/{chunk-YC4ZDBIC.mjs → chunk-VBMQG5SW.mjs} +58 -38
- package/dist/components/AlertDialog/index.js +9 -15
- package/dist/components/AlertDialog/index.mjs +7 -13
- package/dist/components/Badge/index.d.mts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +58 -38
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Button/index.js +3 -3
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/Calendar/index.js +3 -3
- package/dist/components/Calendar/index.mjs +1 -1
- package/dist/components/Carousel/index.js +3 -3
- package/dist/components/Carousel/index.mjs +1 -1
- package/dist/components/Command/index.js +6 -6
- package/dist/components/Command/index.mjs +2 -2
- package/dist/components/CreatableSelect/index.js +64 -44
- package/dist/components/CreatableSelect/index.mjs +3 -3
- package/dist/components/Dialog/index.js +28 -193
- package/dist/components/Dialog/index.mjs +10 -30
- package/dist/components/DropdownMenu/index.js +3 -3
- package/dist/components/DropdownMenu/index.mjs +3 -3
- package/dist/components/FilterButton/index.js +61 -41
- package/dist/components/FilterButton/index.mjs +2 -2
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Pagination/index.js +3 -3
- package/dist/components/Pagination/index.mjs +1 -1
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Select/index.mjs +3 -3
- package/dist/components/Sheet/index.js +3 -3
- package/dist/components/Sheet/index.mjs +1 -1
- package/dist/components/Tabs/index.js +2 -2
- package/dist/components/Tabs/index.mjs +2 -2
- package/dist/components/Textarea/index.js +3 -3
- package/dist/components/Textarea/index.mjs +3 -3
- package/dist/components/Toaster/index.js +4 -4
- package/dist/components/Toaster/index.mjs +2 -2
- package/dist/components/Toggle/index.d.mts +66 -0
- package/dist/components/Toggle/index.d.ts +66 -0
- package/dist/components/Toggle/index.js +117 -0
- package/dist/components/Toggle/index.mjs +48 -0
- package/dist/components/Tooltip/index.d.mts +2 -1
- package/dist/components/Tooltip/index.d.ts +2 -1
- package/dist/components/Tooltip/index.js +7 -4
- package/dist/components/Tooltip/index.mjs +4 -2
- package/dist/index.d.mts +65 -2
- package/dist/index.d.ts +65 -2
- package/dist/index.js +2 -0
- package/dist/index.mjs +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -100,7 +100,7 @@ var Input = React.forwardRef(
|
|
|
100
100
|
"div",
|
|
101
101
|
{
|
|
102
102
|
className: cn(
|
|
103
|
-
"flex h-9 w-full rounded-
|
|
103
|
+
"flex h-9 w-full rounded-lg border border-gray-200 bg-transparent focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2",
|
|
104
104
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
105
105
|
{
|
|
106
106
|
"border-red-700 focus-within:border-gray-200 focus-within:outline-red-700": !!props["data-has-error"]
|
|
@@ -33,7 +33,7 @@ var Input = React.forwardRef(
|
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
35
|
className: cn(
|
|
36
|
-
"flex h-9 w-full rounded-
|
|
36
|
+
"flex h-9 w-full rounded-lg border border-gray-200 bg-transparent focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2",
|
|
37
37
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
38
38
|
{
|
|
39
39
|
"border-red-700 focus-within:border-gray-200 focus-within:outline-red-700": !!props["data-has-error"]
|
|
@@ -246,7 +246,7 @@ var SpinnerIcon = (0, import_react5.forwardRef)(
|
|
|
246
246
|
// src/components/Button/Button.tsx
|
|
247
247
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
248
248
|
var buttonVariants = (0, import_cva.cva)({
|
|
249
|
-
base: "inline-flex items-center justify-center gap-2 rounded-
|
|
249
|
+
base: "inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium ring-offset-background transition-colors relative focus-visible:outline-hidden focus-visible:ring-2 disabled:select-none disabled:pointer-events-none disabled:opacity-40",
|
|
250
250
|
variants: {
|
|
251
251
|
variant: {
|
|
252
252
|
primary: "bg-blue-700 text-white [&>svg]:text-white dark:text-black dark:[&>svg]:text-black hover:bg-blue-800 active:bg-blue-900 focus-visible:ring-blue-1000",
|
|
@@ -276,7 +276,7 @@ var buttonSizes = (0, import_cva.cva)({
|
|
|
276
276
|
}
|
|
277
277
|
},
|
|
278
278
|
defaultVariants: {
|
|
279
|
-
size: "
|
|
279
|
+
size: "sm"
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
282
|
var iconButtonSizes = (0, import_cva.cva)({
|
|
@@ -289,7 +289,7 @@ var iconButtonSizes = (0, import_cva.cva)({
|
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
defaultVariants: {
|
|
292
|
-
size: "
|
|
292
|
+
size: "sm"
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
var iconSizes = {
|
|
@@ -126,7 +126,7 @@ var SelectTrigger = React.forwardRef((_a, ref) => {
|
|
|
126
126
|
__spreadProps(__spreadValues({
|
|
127
127
|
ref,
|
|
128
128
|
className: cn(
|
|
129
|
-
"flex gap-2 h-9 w-full px-3 py-2 text-sm outline-hidden text-black placeholder:text-gray-700 rounded-
|
|
129
|
+
"flex gap-2 h-9 w-full px-3 py-2 text-sm outline-hidden text-black placeholder:text-gray-700 rounded-lg border border-gray-200 bg-white focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2px items-center justify-between",
|
|
130
130
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
131
131
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
132
132
|
// when the disabled attr is set by reference
|
|
@@ -157,7 +157,7 @@ var SelectContent = React.forwardRef((_a, ref) => {
|
|
|
157
157
|
__spreadProps(__spreadValues({
|
|
158
158
|
ref,
|
|
159
159
|
className: cn(
|
|
160
|
-
"relative z-150 overflow-hidden rounded-
|
|
160
|
+
"relative z-150 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xs 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",
|
|
161
161
|
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",
|
|
162
162
|
className
|
|
163
163
|
),
|
|
@@ -195,7 +195,7 @@ var SelectItem = React.forwardRef((_a, ref) => {
|
|
|
195
195
|
__spreadProps(__spreadValues({
|
|
196
196
|
ref,
|
|
197
197
|
className: cn(
|
|
198
|
-
"flex w-full cursor-default select-none items-center rounded-
|
|
198
|
+
"flex w-full cursor-default select-none items-center rounded-lg py-1.5 px-2 text-black text-sm outline-hidden hover:bg-gray-50 active:bg-gray-100 focus:bg-gray-100 data-disabled:pointer-events-none data-disabled:opacity-50 data-[state=checked]:bg-gray-50",
|
|
199
199
|
className
|
|
200
200
|
)
|
|
201
201
|
}, props), {
|
|
@@ -54,7 +54,7 @@ var SelectTrigger = React.forwardRef((_a, ref) => {
|
|
|
54
54
|
__spreadProps(__spreadValues({
|
|
55
55
|
ref,
|
|
56
56
|
className: cn(
|
|
57
|
-
"flex gap-2 h-9 w-full px-3 py-2 text-sm outline-hidden text-black placeholder:text-gray-700 rounded-
|
|
57
|
+
"flex gap-2 h-9 w-full px-3 py-2 text-sm outline-hidden text-black placeholder:text-gray-700 rounded-lg border border-gray-200 bg-white focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2px items-center justify-between",
|
|
58
58
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
59
59
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
60
60
|
// when the disabled attr is set by reference
|
|
@@ -85,7 +85,7 @@ var SelectContent = React.forwardRef((_a, ref) => {
|
|
|
85
85
|
__spreadProps(__spreadValues({
|
|
86
86
|
ref,
|
|
87
87
|
className: cn(
|
|
88
|
-
"relative z-150 overflow-hidden rounded-
|
|
88
|
+
"relative z-150 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-xs 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",
|
|
89
89
|
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",
|
|
90
90
|
className
|
|
91
91
|
),
|
|
@@ -123,7 +123,7 @@ var SelectItem = React.forwardRef((_a, ref) => {
|
|
|
123
123
|
__spreadProps(__spreadValues({
|
|
124
124
|
ref,
|
|
125
125
|
className: cn(
|
|
126
|
-
"flex w-full cursor-default select-none items-center rounded-
|
|
126
|
+
"flex w-full cursor-default select-none items-center rounded-lg py-1.5 px-2 text-black text-sm outline-hidden hover:bg-gray-50 active:bg-gray-100 focus:bg-gray-100 data-disabled:pointer-events-none data-disabled:opacity-50 data-[state=checked]:bg-gray-50",
|
|
127
127
|
className
|
|
128
128
|
)
|
|
129
129
|
}, props), {
|
|
@@ -160,7 +160,7 @@ var SpinnerIcon = (0, import_react2.forwardRef)(
|
|
|
160
160
|
// src/components/Button/Button.tsx
|
|
161
161
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
162
162
|
var buttonVariants = (0, import_cva.cva)({
|
|
163
|
-
base: "inline-flex items-center justify-center gap-2 rounded-
|
|
163
|
+
base: "inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium ring-offset-background transition-colors relative focus-visible:outline-hidden focus-visible:ring-2 disabled:select-none disabled:pointer-events-none disabled:opacity-40",
|
|
164
164
|
variants: {
|
|
165
165
|
variant: {
|
|
166
166
|
primary: "bg-blue-700 text-white [&>svg]:text-white dark:text-black dark:[&>svg]:text-black hover:bg-blue-800 active:bg-blue-900 focus-visible:ring-blue-1000",
|
|
@@ -190,7 +190,7 @@ var buttonSizes = (0, import_cva.cva)({
|
|
|
190
190
|
}
|
|
191
191
|
},
|
|
192
192
|
defaultVariants: {
|
|
193
|
-
size: "
|
|
193
|
+
size: "sm"
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
var iconButtonSizes = (0, import_cva.cva)({
|
|
@@ -203,7 +203,7 @@ var iconButtonSizes = (0, import_cva.cva)({
|
|
|
203
203
|
}
|
|
204
204
|
},
|
|
205
205
|
defaultVariants: {
|
|
206
|
-
size: "
|
|
206
|
+
size: "sm"
|
|
207
207
|
}
|
|
208
208
|
});
|
|
209
209
|
var iconSizes = {
|
|
@@ -84,7 +84,7 @@ var TabsList = React.forwardRef((_a, ref) => {
|
|
|
84
84
|
__spreadValues({
|
|
85
85
|
ref,
|
|
86
86
|
className: cn(
|
|
87
|
-
"inline-flex items-center justify-center gap-
|
|
87
|
+
"inline-flex items-center justify-center gap-1 rounded-lg p-1 bg-gray-50 text-gray-700",
|
|
88
88
|
className
|
|
89
89
|
)
|
|
90
90
|
}, props)
|
|
@@ -98,7 +98,7 @@ var TabsTrigger = React.forwardRef((_a, ref) => {
|
|
|
98
98
|
__spreadValues({
|
|
99
99
|
ref,
|
|
100
100
|
className: cn(
|
|
101
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-
|
|
101
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-lg px-3 py-1 text-sm font-medium ring-offset-white transition-all",
|
|
102
102
|
"hover:bg-gray-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2",
|
|
103
103
|
"data-[state=active]:bg-white data-[state=active]:text-blue-700 dark:data-[state=active]:text-black data-[state=active]:shadow-xs",
|
|
104
104
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
@@ -16,7 +16,7 @@ var TabsList = React.forwardRef((_a, ref) => {
|
|
|
16
16
|
__spreadValues({
|
|
17
17
|
ref,
|
|
18
18
|
className: cn(
|
|
19
|
-
"inline-flex items-center justify-center gap-
|
|
19
|
+
"inline-flex items-center justify-center gap-1 rounded-lg p-1 bg-gray-50 text-gray-700",
|
|
20
20
|
className
|
|
21
21
|
)
|
|
22
22
|
}, props)
|
|
@@ -30,7 +30,7 @@ var TabsTrigger = React.forwardRef((_a, ref) => {
|
|
|
30
30
|
__spreadValues({
|
|
31
31
|
ref,
|
|
32
32
|
className: cn(
|
|
33
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-
|
|
33
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-lg px-3 py-1 text-sm font-medium ring-offset-white transition-all",
|
|
34
34
|
"hover:bg-gray-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-700 focus-visible:ring-offset-2",
|
|
35
35
|
"data-[state=active]:bg-white data-[state=active]:text-blue-700 dark:data-[state=active]:text-black data-[state=active]:shadow-xs",
|
|
36
36
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
@@ -123,11 +123,11 @@ var Textarea = React.forwardRef(
|
|
|
123
123
|
"onMaximizeClick"
|
|
124
124
|
]);
|
|
125
125
|
const isDisabled = !!props["data-is-disabled"] || disabled;
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
127
127
|
"div",
|
|
128
128
|
{
|
|
129
129
|
className: cn(
|
|
130
|
-
"flex min-h-[80px] w-full rounded-
|
|
130
|
+
"flex min-h-[80px] w-full rounded-lg border border-gray-200 bg-transparent relative focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2",
|
|
131
131
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
132
132
|
{
|
|
133
133
|
"border-red-700 focus-within:border-gray-200 focus-within:outline-red-700": !!props["data-has-error"]
|
|
@@ -156,7 +156,7 @@ var Textarea = React.forwardRef(
|
|
|
156
156
|
)
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
|
-
)
|
|
159
|
+
);
|
|
160
160
|
}
|
|
161
161
|
);
|
|
162
162
|
Textarea.displayName = "Textarea";
|
|
@@ -58,11 +58,11 @@ var Textarea = React.forwardRef(
|
|
|
58
58
|
"onMaximizeClick"
|
|
59
59
|
]);
|
|
60
60
|
const isDisabled = !!props["data-is-disabled"] || disabled;
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ jsxs(
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: cn(
|
|
65
|
-
"flex min-h-[80px] w-full rounded-
|
|
65
|
+
"flex min-h-[80px] w-full rounded-lg border border-gray-200 bg-transparent relative focus-within:outline-2 focus-within:outline-blue-300 focus-within:outline-offset-2",
|
|
66
66
|
{ "cursor-not-allowed opacity-50": isDisabled },
|
|
67
67
|
{
|
|
68
68
|
"border-red-700 focus-within:border-gray-200 focus-within:outline-red-700": !!props["data-has-error"]
|
|
@@ -91,7 +91,7 @@ var Textarea = React.forwardRef(
|
|
|
91
91
|
)
|
|
92
92
|
]
|
|
93
93
|
}
|
|
94
|
-
)
|
|
94
|
+
);
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
97
|
Textarea.displayName = "Textarea";
|
|
@@ -165,7 +165,7 @@ var SpinnerIcon = (0, import_react2.forwardRef)(
|
|
|
165
165
|
// src/components/Button/Button.tsx
|
|
166
166
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
167
167
|
var buttonVariants = (0, import_cva.cva)({
|
|
168
|
-
base: "inline-flex items-center justify-center gap-2 rounded-
|
|
168
|
+
base: "inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium ring-offset-background transition-colors relative focus-visible:outline-hidden focus-visible:ring-2 disabled:select-none disabled:pointer-events-none disabled:opacity-40",
|
|
169
169
|
variants: {
|
|
170
170
|
variant: {
|
|
171
171
|
primary: "bg-blue-700 text-white [&>svg]:text-white dark:text-black dark:[&>svg]:text-black hover:bg-blue-800 active:bg-blue-900 focus-visible:ring-blue-1000",
|
|
@@ -195,7 +195,7 @@ var buttonSizes = (0, import_cva.cva)({
|
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
defaultVariants: {
|
|
198
|
-
size: "
|
|
198
|
+
size: "sm"
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
var iconButtonSizes = (0, import_cva.cva)({
|
|
@@ -208,7 +208,7 @@ var iconButtonSizes = (0, import_cva.cva)({
|
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
210
|
defaultVariants: {
|
|
211
|
-
size: "
|
|
211
|
+
size: "sm"
|
|
212
212
|
}
|
|
213
213
|
});
|
|
214
214
|
var iconSizes = {
|
|
@@ -286,7 +286,7 @@ var ToastViewport = React2.forwardRef((_a, ref) => {
|
|
|
286
286
|
});
|
|
287
287
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
288
288
|
var toastVariants = (0, import_cva2.cva)({
|
|
289
|
-
base: "group pointer-events-auto relative flex w-full shadow-xs items-center justify-between gap-4 overflow-hidden rounded-
|
|
289
|
+
base: "group pointer-events-auto relative flex w-full shadow-xs items-center justify-between gap-4 overflow-hidden rounded-lg px-4 py-2 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:fade-out data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",
|
|
290
290
|
variants: {
|
|
291
291
|
variant: {
|
|
292
292
|
default: "bg-gray-100 text-black",
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "../../chunk-FMJFBQTF.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Button
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-HVMCOLSX.mjs";
|
|
7
7
|
import "../../chunk-N65I4EXR.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__objRest,
|
|
@@ -33,7 +33,7 @@ var ToastViewport = React.forwardRef((_a, ref) => {
|
|
|
33
33
|
});
|
|
34
34
|
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
35
35
|
var toastVariants = cva({
|
|
36
|
-
base: "group pointer-events-auto relative flex w-full shadow-xs items-center justify-between gap-4 overflow-hidden rounded-
|
|
36
|
+
base: "group pointer-events-auto relative flex w-full shadow-xs items-center justify-between gap-4 overflow-hidden rounded-lg px-4 py-2 transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:fade-out data-[state=open]:slide-in-from-top-full sm:data-[state=open]:slide-in-from-bottom-full",
|
|
37
37
|
variants: {
|
|
38
38
|
variant: {
|
|
39
39
|
default: "bg-gray-100 text-black",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'cva';
|
|
3
|
+
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | undefined;
|
|
6
|
+
} & ({
|
|
7
|
+
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
} | null | undefined)[] | {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
} | null | undefined)[] | {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
} | null | undefined)[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
} | null | undefined)[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
} | null | undefined)[] | {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} | null | undefined)[] | {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
} | null | undefined)[] | {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
} | null | undefined)[] | {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
} | null | undefined)[] | {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
} | null | undefined)[] | {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
} | null | undefined)[] | {
|
|
30
|
+
[x: string]: any;
|
|
31
|
+
} | null | undefined;
|
|
32
|
+
className?: never;
|
|
33
|
+
} | {
|
|
34
|
+
class?: never;
|
|
35
|
+
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
} | null | undefined)[] | {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
} | null | undefined)[] | {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
} | null | undefined)[] | {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} | null | undefined)[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
} | null | undefined)[] | {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
} | null | undefined)[] | {
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
} | null | undefined)[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
} | null | undefined)[] | {
|
|
52
|
+
[x: string]: any;
|
|
53
|
+
} | null | undefined)[] | {
|
|
54
|
+
[x: string]: any;
|
|
55
|
+
} | null | undefined)[] | {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
} | null | undefined)[] | {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
} | null | undefined;
|
|
60
|
+
})) | undefined) => string;
|
|
61
|
+
interface ToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof toggleVariants> {
|
|
62
|
+
pressed?: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
|
|
66
|
+
export { Toggle, type ToggleProps, toggleVariants };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { VariantProps } from 'cva';
|
|
3
|
+
|
|
4
|
+
declare const toggleVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | undefined;
|
|
6
|
+
} & ({
|
|
7
|
+
class?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
8
|
+
[x: string]: any;
|
|
9
|
+
} | null | undefined)[] | {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
} | null | undefined)[] | {
|
|
12
|
+
[x: string]: any;
|
|
13
|
+
} | null | undefined)[] | {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
} | null | undefined)[] | {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
} | null | undefined)[] | {
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
} | null | undefined)[] | {
|
|
20
|
+
[x: string]: any;
|
|
21
|
+
} | null | undefined)[] | {
|
|
22
|
+
[x: string]: any;
|
|
23
|
+
} | null | undefined)[] | {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
} | null | undefined)[] | {
|
|
26
|
+
[x: string]: any;
|
|
27
|
+
} | null | undefined)[] | {
|
|
28
|
+
[x: string]: any;
|
|
29
|
+
} | null | undefined)[] | {
|
|
30
|
+
[x: string]: any;
|
|
31
|
+
} | null | undefined;
|
|
32
|
+
className?: never;
|
|
33
|
+
} | {
|
|
34
|
+
class?: never;
|
|
35
|
+
className?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
} | null | undefined)[] | {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
} | null | undefined)[] | {
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
} | null | undefined)[] | {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
} | null | undefined)[] | {
|
|
44
|
+
[x: string]: any;
|
|
45
|
+
} | null | undefined)[] | {
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
} | null | undefined)[] | {
|
|
48
|
+
[x: string]: any;
|
|
49
|
+
} | null | undefined)[] | {
|
|
50
|
+
[x: string]: any;
|
|
51
|
+
} | null | undefined)[] | {
|
|
52
|
+
[x: string]: any;
|
|
53
|
+
} | null | undefined)[] | {
|
|
54
|
+
[x: string]: any;
|
|
55
|
+
} | null | undefined)[] | {
|
|
56
|
+
[x: string]: any;
|
|
57
|
+
} | null | undefined)[] | {
|
|
58
|
+
[x: string]: any;
|
|
59
|
+
} | null | undefined;
|
|
60
|
+
})) | undefined) => string;
|
|
61
|
+
interface ToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof toggleVariants> {
|
|
62
|
+
pressed?: boolean;
|
|
63
|
+
}
|
|
64
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
65
|
+
|
|
66
|
+
export { Toggle, type ToggleProps, toggleVariants };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __spreadValues = (a, b) => {
|
|
14
|
+
for (var prop in b || (b = {}))
|
|
15
|
+
if (__hasOwnProp.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
if (__getOwnPropSymbols)
|
|
18
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
+
if (__propIsEnum.call(b, prop))
|
|
20
|
+
__defNormalProp(a, prop, b[prop]);
|
|
21
|
+
}
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(from))
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return to;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
+
mod
|
|
56
|
+
));
|
|
57
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
|
|
59
|
+
// src/components/Toggle/index.ts
|
|
60
|
+
var Toggle_exports = {};
|
|
61
|
+
__export(Toggle_exports, {
|
|
62
|
+
Toggle: () => Toggle,
|
|
63
|
+
toggleVariants: () => toggleVariants
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(Toggle_exports);
|
|
66
|
+
|
|
67
|
+
// src/components/Toggle/Toggle.tsx
|
|
68
|
+
var React = __toESM(require("react"));
|
|
69
|
+
var import_cva = require("cva");
|
|
70
|
+
|
|
71
|
+
// src/utils/cn.ts
|
|
72
|
+
var import_clsx = require("clsx");
|
|
73
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
74
|
+
function cn(...inputs) {
|
|
75
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/components/Toggle/Toggle.tsx
|
|
79
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
80
|
+
var toggleVariants = (0, import_cva.cva)({
|
|
81
|
+
base: "inline-flex items-center justify-center border border-gray-200 rounded-lg bg-white text-black font-medium whitespace-nowrap transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-300 focus-visible:ring-offset-2 disabled:opacity-30 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
82
|
+
variants: {
|
|
83
|
+
size: {
|
|
84
|
+
sm: "px-2 py-1 text-xs gap-1",
|
|
85
|
+
md: "px-2 py-1 text-sm gap-2"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
defaultVariants: {
|
|
89
|
+
size: "md"
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
var Toggle = React.forwardRef(
|
|
93
|
+
(_a, ref) => {
|
|
94
|
+
var _b = _a, { className, size, pressed, children } = _b, props = __objRest(_b, ["className", "size", "pressed", "children"]);
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
+
"button",
|
|
97
|
+
__spreadProps(__spreadValues({
|
|
98
|
+
ref,
|
|
99
|
+
type: "button",
|
|
100
|
+
"aria-pressed": pressed,
|
|
101
|
+
className: cn(
|
|
102
|
+
toggleVariants({ size }),
|
|
103
|
+
pressed && "bg-gray-50",
|
|
104
|
+
className
|
|
105
|
+
)
|
|
106
|
+
}, props), {
|
|
107
|
+
children
|
|
108
|
+
})
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
Toggle.displayName = "Toggle";
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
Toggle,
|
|
116
|
+
toggleVariants
|
|
117
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__objRest,
|
|
3
|
+
__spreadProps,
|
|
4
|
+
__spreadValues,
|
|
5
|
+
cn
|
|
6
|
+
} from "../../chunk-BOWIL6WZ.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/Toggle/Toggle.tsx
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import { cva } from "cva";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var toggleVariants = cva({
|
|
13
|
+
base: "inline-flex items-center justify-center border border-gray-200 rounded-lg bg-white text-black font-medium whitespace-nowrap transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-blue-300 focus-visible:ring-offset-2 disabled:opacity-30 disabled:pointer-events-none disabled:cursor-not-allowed",
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "px-2 py-1 text-xs gap-1",
|
|
17
|
+
md: "px-2 py-1 text-sm gap-2"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
size: "md"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
var Toggle = React.forwardRef(
|
|
25
|
+
(_a, ref) => {
|
|
26
|
+
var _b = _a, { className, size, pressed, children } = _b, props = __objRest(_b, ["className", "size", "pressed", "children"]);
|
|
27
|
+
return /* @__PURE__ */ jsx(
|
|
28
|
+
"button",
|
|
29
|
+
__spreadProps(__spreadValues({
|
|
30
|
+
ref,
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-pressed": pressed,
|
|
33
|
+
className: cn(
|
|
34
|
+
toggleVariants({ size }),
|
|
35
|
+
pressed && "bg-gray-50",
|
|
36
|
+
className
|
|
37
|
+
)
|
|
38
|
+
}, props), {
|
|
39
|
+
children
|
|
40
|
+
})
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Toggle.displayName = "Toggle";
|
|
45
|
+
export {
|
|
46
|
+
Toggle,
|
|
47
|
+
toggleVariants
|
|
48
|
+
};
|
|
@@ -6,6 +6,7 @@ declare const TooltipProvider: ({ delayDuration, ...props }: React.ComponentProp
|
|
|
6
6
|
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
7
7
|
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const TooltipPortal: React.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
9
10
|
declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
11
|
declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
11
12
|
title: string;
|
|
@@ -14,4 +15,4 @@ declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttr
|
|
|
14
15
|
action?: string | React.ReactNode;
|
|
15
16
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
17
|
|
|
17
|
-
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipProvider, TooltipTrigger };
|
|
18
|
+
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipPortal, TooltipProvider, TooltipTrigger };
|
|
@@ -6,6 +6,7 @@ declare const TooltipProvider: ({ delayDuration, ...props }: React.ComponentProp
|
|
|
6
6
|
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
7
7
|
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const TooltipPortal: React.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
9
10
|
declare const TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
11
|
declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
11
12
|
title: string;
|
|
@@ -14,4 +15,4 @@ declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttr
|
|
|
14
15
|
action?: string | React.ReactNode;
|
|
15
16
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
16
17
|
|
|
17
|
-
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipProvider, TooltipTrigger };
|
|
18
|
+
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipPortal, TooltipProvider, TooltipTrigger };
|