@snapcall/design-system 1.23.3 → 1.24.2
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/components/Dialog/index.d.mts +1 -1
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/MediaCard/index.d.mts +3 -2
- package/dist/components/MediaCard/index.d.ts +3 -2
- package/dist/components/MediaCard/index.js +101 -56
- package/dist/components/MediaCard/index.mjs +90 -45
- package/dist/components/Tooltip/index.d.mts +8 -1
- package/dist/components/Tooltip/index.d.ts +8 -1
- package/dist/components/Tooltip/index.js +184 -6
- package/dist/components/Tooltip/index.mjs +30 -2
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
// src/components/MediaCard/MediaCard.tsx
|
|
15
15
|
import { cloneElement } from "react";
|
|
16
16
|
|
|
17
|
-
// src/icons/
|
|
17
|
+
// src/icons/file6.tsx
|
|
18
18
|
import { forwardRef } from "react";
|
|
19
|
-
import {
|
|
20
|
-
var
|
|
21
|
-
function
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var File6Icon = forwardRef(
|
|
21
|
+
function File6Icon2(_a, ref) {
|
|
22
22
|
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
23
23
|
return /* @__PURE__ */ jsxs(
|
|
24
24
|
"svg",
|
|
@@ -32,8 +32,50 @@ var Image1Icon = forwardRef(
|
|
|
32
32
|
className
|
|
33
33
|
}, other), {
|
|
34
34
|
children: [
|
|
35
|
-
duotone && /* @__PURE__ */
|
|
36
|
-
|
|
35
|
+
duotone && /* @__PURE__ */ jsx(
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
opacity: "0.12",
|
|
39
|
+
d: "M19.1213 7.12139L14.8787 2.87875C14.6222 2.62223 14.324 2.41696 14 2.26953V6.40007C14 6.96012 14 7.24015 14.109 7.45406C14.2049 7.64222 14.3578 7.7952 14.546 7.89108C14.7599 8.00007 15.0399 8.00007 15.6 8.00007H19.7305C19.5831 7.67611 19.3778 7.37792 19.1213 7.12139Z",
|
|
40
|
+
fill: "currentColor"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"path",
|
|
45
|
+
{
|
|
46
|
+
d: "M14 2.26953V6.40007C14 6.96012 14 7.24015 14.109 7.45406C14.2049 7.64222 14.3578 7.7952 14.546 7.89108C14.7599 8.00007 15.0399 8.00007 15.6 8.00007H19.7305M16 13H8M16 17H8M10 9H8M14 2H8.8C7.11984 2 6.27976 2 5.63803 2.32698C5.07354 2.6146 4.6146 3.07354 4.32698 3.63803C4 4.27976 4 5.11984 4 6.8V17.2C4 18.8802 4 19.7202 4.32698 20.362C4.6146 20.9265 5.07354 21.3854 5.63803 21.673C6.27976 22 7.11984 22 8.8 22H15.2C16.8802 22 17.7202 22 18.362 21.673C18.9265 21.3854 19.3854 20.9265 19.673 20.362C20 19.7202 20 18.8802 20 17.2V8L14 2Z",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: "2",
|
|
49
|
+
strokeLinecap: "round",
|
|
50
|
+
strokeLinejoin: "round"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
]
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
// src/icons/image1.tsx
|
|
60
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
61
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
62
|
+
var Image1Icon = forwardRef2(
|
|
63
|
+
function Image1Icon2(_a, ref) {
|
|
64
|
+
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
65
|
+
return /* @__PURE__ */ jsxs2(
|
|
66
|
+
"svg",
|
|
67
|
+
__spreadProps(__spreadValues({
|
|
68
|
+
ref,
|
|
69
|
+
width: size,
|
|
70
|
+
height: size,
|
|
71
|
+
viewBox: "0 0 24 24",
|
|
72
|
+
fill: "none",
|
|
73
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
+
className
|
|
75
|
+
}, other), {
|
|
76
|
+
children: [
|
|
77
|
+
duotone && /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
78
|
+
/* @__PURE__ */ jsx2(
|
|
37
79
|
"path",
|
|
38
80
|
{
|
|
39
81
|
d: "M6.36574 19.6343L14.8687 11.1314C15.2647 10.7354 15.4627 10.5373 15.691 10.4632C15.8919 10.3979 16.1082 10.3979 16.3091 10.4632C16.5374 10.5373 16.7354 10.7354 17.1314 11.1314L21 15V16.2C21 17.8802 21 18.7202 20.6731 19.362C20.3854 19.9265 19.9265 20.3854 19.362 20.673C18.7203 21 17.8802 21 16.2 21H6.93142C6.3256 21 6.0227 21 5.88243 20.8802C5.76073 20.7763 5.69614 20.6203 5.7087 20.4608C5.72317 20.2769 5.93736 20.0627 6.36574 19.6343Z",
|
|
@@ -41,7 +83,7 @@ var Image1Icon = forwardRef(
|
|
|
41
83
|
fillOpacity: "0.12"
|
|
42
84
|
}
|
|
43
85
|
),
|
|
44
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ jsx2(
|
|
45
87
|
"path",
|
|
46
88
|
{
|
|
47
89
|
d: "M8.50005 10.5C9.60462 10.5 10.5 9.60457 10.5 8.5C10.5 7.39543 9.60462 6.5 8.50005 6.5C7.39548 6.5 6.50005 7.39543 6.50005 8.5C6.50005 9.60457 7.39548 10.5 8.50005 10.5Z",
|
|
@@ -50,7 +92,7 @@ var Image1Icon = forwardRef(
|
|
|
50
92
|
}
|
|
51
93
|
)
|
|
52
94
|
] }),
|
|
53
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ jsx2(
|
|
54
96
|
"path",
|
|
55
97
|
{
|
|
56
98
|
d: "M16.2 21H6.93137C6.32555 21 6.02265 21 5.88238 20.8802C5.76068 20.7763 5.69609 20.6203 5.70865 20.4608C5.72312 20.2769 5.93731 20.0627 6.36569 19.6343L14.8686 11.1314C15.2646 10.7354 15.4627 10.5373 15.691 10.4632C15.8918 10.3979 16.1082 10.3979 16.309 10.4632C16.5373 10.5373 16.7354 10.7354 17.1314 11.1314L21 15V16.2M16.2 21C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2M16.2 21H7.8C6.11984 21 5.27976 21 4.63803 20.673C4.07354 20.3854 3.6146 19.9265 3.32698 19.362C3 18.7202 3 17.8802 3 16.2V7.8C3 6.11984 3 5.27976 3.32698 4.63803C3.6146 4.07354 4.07354 3.6146 4.63803 3.32698C5.27976 3 6.11984 3 7.8 3H16.2C17.8802 3 18.7202 3 19.362 3.32698C19.9265 3.6146 20.3854 4.07354 20.673 4.63803C21 5.27976 21 6.11984 21 7.8V16.2M10.5 8.5C10.5 9.60457 9.60457 10.5 8.5 10.5C7.39543 10.5 6.5 9.60457 6.5 8.5C6.5 7.39543 7.39543 6.5 8.5 6.5C9.60457 6.5 10.5 7.39543 10.5 8.5Z",
|
|
@@ -67,11 +109,11 @@ var Image1Icon = forwardRef(
|
|
|
67
109
|
);
|
|
68
110
|
|
|
69
111
|
// src/icons/play.tsx
|
|
70
|
-
import { forwardRef as
|
|
71
|
-
import { jsx as
|
|
72
|
-
var PlayIcon =
|
|
112
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
113
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
114
|
+
var PlayIcon = forwardRef3(function PlayIcon2(_a, ref) {
|
|
73
115
|
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
74
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ jsxs3(
|
|
75
117
|
"svg",
|
|
76
118
|
__spreadProps(__spreadValues({
|
|
77
119
|
ref,
|
|
@@ -83,7 +125,7 @@ var PlayIcon = forwardRef2(function PlayIcon2(_a, ref) {
|
|
|
83
125
|
className
|
|
84
126
|
}, other), {
|
|
85
127
|
children: [
|
|
86
|
-
duotone && /* @__PURE__ */
|
|
128
|
+
duotone && /* @__PURE__ */ jsx3(
|
|
87
129
|
"path",
|
|
88
130
|
{
|
|
89
131
|
opacity: "0.12",
|
|
@@ -91,7 +133,7 @@ var PlayIcon = forwardRef2(function PlayIcon2(_a, ref) {
|
|
|
91
133
|
fill: "currentColor"
|
|
92
134
|
}
|
|
93
135
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ jsx3(
|
|
95
137
|
"path",
|
|
96
138
|
{
|
|
97
139
|
d: "M5 4.98951C5 4.01835 5 3.53277 5.20249 3.2651C5.37889 3.03191 5.64852 2.88761 5.9404 2.87018C6.27544 2.85017 6.67946 3.11953 7.48752 3.65823L18.0031 10.6686C18.6708 11.1137 19.0046 11.3363 19.1209 11.6168C19.2227 11.8621 19.2227 12.1377 19.1209 12.383C19.0046 12.6635 18.6708 12.886 18.0031 13.3312L7.48752 20.3415C6.67946 20.8802 6.27544 21.1496 5.9404 21.1296C5.64852 21.1122 5.37889 20.9679 5.20249 20.7347C5 20.467 5 19.9814 5 19.0103V4.98951Z",
|
|
@@ -107,12 +149,12 @@ var PlayIcon = forwardRef2(function PlayIcon2(_a, ref) {
|
|
|
107
149
|
});
|
|
108
150
|
|
|
109
151
|
// src/icons/recording2.tsx
|
|
110
|
-
import { forwardRef as
|
|
111
|
-
import { jsx as
|
|
112
|
-
var Recording2Icon =
|
|
152
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
153
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
154
|
+
var Recording2Icon = forwardRef4(
|
|
113
155
|
function Recording2Icon2(_a, ref) {
|
|
114
156
|
var _b = _a, { size = 24, className = "text-gray-1000" } = _b, other = __objRest(_b, ["size", "className"]);
|
|
115
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ jsx4(
|
|
116
158
|
"svg",
|
|
117
159
|
__spreadProps(__spreadValues({
|
|
118
160
|
ref,
|
|
@@ -123,7 +165,7 @@ var Recording2Icon = forwardRef3(
|
|
|
123
165
|
xmlns: "http://www.w3.org/2000/svg",
|
|
124
166
|
className
|
|
125
167
|
}, other), {
|
|
126
|
-
children: /* @__PURE__ */
|
|
168
|
+
children: /* @__PURE__ */ jsx4(
|
|
127
169
|
"path",
|
|
128
170
|
{
|
|
129
171
|
d: "M3 10L3 14M7.5 11V13M12 6V18M16.5 3V21M21 10V14",
|
|
@@ -139,12 +181,12 @@ var Recording2Icon = forwardRef3(
|
|
|
139
181
|
);
|
|
140
182
|
|
|
141
183
|
// src/icons/videoRecorder.tsx
|
|
142
|
-
import { forwardRef as
|
|
143
|
-
import { jsx as
|
|
144
|
-
var VideoRecorderIcon =
|
|
184
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
185
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
186
|
+
var VideoRecorderIcon = forwardRef5(
|
|
145
187
|
function VideoRecorderIcon2(_a, ref) {
|
|
146
188
|
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
147
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ jsxs4(
|
|
148
190
|
"svg",
|
|
149
191
|
__spreadProps(__spreadValues({
|
|
150
192
|
ref,
|
|
@@ -156,7 +198,7 @@ var VideoRecorderIcon = forwardRef4(
|
|
|
156
198
|
className
|
|
157
199
|
}, other), {
|
|
158
200
|
children: [
|
|
159
|
-
duotone && /* @__PURE__ */
|
|
201
|
+
duotone && /* @__PURE__ */ jsx5(
|
|
160
202
|
"path",
|
|
161
203
|
{
|
|
162
204
|
opacity: "0.12",
|
|
@@ -168,7 +210,7 @@ var VideoRecorderIcon = forwardRef4(
|
|
|
168
210
|
strokeLinejoin: "round"
|
|
169
211
|
}
|
|
170
212
|
),
|
|
171
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ jsx5(
|
|
172
214
|
"path",
|
|
173
215
|
{
|
|
174
216
|
d: "M22 8.93137C22 8.32555 22 8.02265 21.8802 7.88238C21.7763 7.76068 21.6203 7.69609 21.4608 7.70865C21.2769 7.72312 21.0627 7.93731 20.6343 8.36569L17 12L20.6343 15.6343C21.0627 16.0627 21.2769 16.2769 21.4608 16.2914C21.6203 16.3039 21.7763 16.2393 21.8802 16.1176C22 15.9774 22 15.6744 22 15.0686V8.93137Z",
|
|
@@ -178,7 +220,7 @@ var VideoRecorderIcon = forwardRef4(
|
|
|
178
220
|
strokeLinejoin: "round"
|
|
179
221
|
}
|
|
180
222
|
),
|
|
181
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ jsx5(
|
|
182
224
|
"path",
|
|
183
225
|
{
|
|
184
226
|
d: "M2 9.8C2 8.11984 2 7.27976 2.32698 6.63803C2.6146 6.07354 3.07354 5.6146 3.63803 5.32698C4.27976 5 5.11984 5 6.8 5H12.2C13.8802 5 14.7202 5 15.362 5.32698C15.9265 5.6146 16.3854 6.07354 16.673 6.63803C17 7.27976 17 8.11984 17 9.8V14.2C17 15.8802 17 16.7202 16.673 17.362C16.3854 17.9265 15.9265 18.3854 15.362 18.673C14.7202 19 13.8802 19 12.2 19H6.8C5.11984 19 4.27976 19 3.63803 18.673C3.07354 18.3854 2.6146 17.9265 2.32698 17.362C2 16.7202 2 15.8802 2 14.2V9.8Z",
|
|
@@ -206,11 +248,12 @@ var secondsToDuration = (seconds) => {
|
|
|
206
248
|
};
|
|
207
249
|
|
|
208
250
|
// src/components/MediaCard/MediaCard.tsx
|
|
209
|
-
import { jsx as
|
|
251
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
210
252
|
var typesIcons = {
|
|
211
|
-
audio: /* @__PURE__ */
|
|
212
|
-
video: /* @__PURE__ */
|
|
213
|
-
image: /* @__PURE__ */
|
|
253
|
+
audio: /* @__PURE__ */ jsx6(Recording2Icon, {}),
|
|
254
|
+
video: /* @__PURE__ */ jsx6(VideoRecorderIcon, { duotone: true }),
|
|
255
|
+
image: /* @__PURE__ */ jsx6(Image1Icon, { duotone: true }),
|
|
256
|
+
other: /* @__PURE__ */ jsx6(File6Icon, { duotone: true })
|
|
214
257
|
};
|
|
215
258
|
var MediaCard = (_a) => {
|
|
216
259
|
var _b = _a, {
|
|
@@ -219,6 +262,7 @@ var MediaCard = (_a) => {
|
|
|
219
262
|
duration,
|
|
220
263
|
type,
|
|
221
264
|
image,
|
|
265
|
+
icon,
|
|
222
266
|
action,
|
|
223
267
|
actionBehavior = "default",
|
|
224
268
|
isLoading,
|
|
@@ -231,6 +275,7 @@ var MediaCard = (_a) => {
|
|
|
231
275
|
"duration",
|
|
232
276
|
"type",
|
|
233
277
|
"image",
|
|
278
|
+
"icon",
|
|
234
279
|
"action",
|
|
235
280
|
"actionBehavior",
|
|
236
281
|
"isLoading",
|
|
@@ -238,24 +283,24 @@ var MediaCard = (_a) => {
|
|
|
238
283
|
"author",
|
|
239
284
|
"className"
|
|
240
285
|
]);
|
|
241
|
-
const thumbnail = /* @__PURE__ */
|
|
286
|
+
const thumbnail = /* @__PURE__ */ jsx6(
|
|
242
287
|
"div",
|
|
243
288
|
{
|
|
244
289
|
className: cn("min-h-0 bg-gray-50 relative", {
|
|
245
290
|
"aspect-square rounded-md shrink-0": size === "medium" || size === "small",
|
|
246
291
|
"flex-1": size === "large"
|
|
247
292
|
}),
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
293
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "flex justify-center items-center w-full h-full rounded-[inherit] overflow-hidden relative", children: [
|
|
294
|
+
/* @__PURE__ */ jsx6(
|
|
250
295
|
"div",
|
|
251
296
|
{
|
|
252
297
|
className: cn(
|
|
253
298
|
"absolute w-full h-full",
|
|
254
299
|
size === "large" ? "p-2" : "p-1"
|
|
255
300
|
),
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
duration !== void 0 && size === "large" && /* @__PURE__ */
|
|
258
|
-
size !== "small" && author && /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ jsxs5("div", { className: "relative w-full h-full flex justify-center items-center", children: [
|
|
302
|
+
duration !== void 0 && size === "large" && /* @__PURE__ */ jsx6("div", { className: "absolute bottom-0 left-0", children: /* @__PURE__ */ jsx6("p", { className: "px-1 py-0.5 bg-black/50 dark:bg-white/50 rounded-sm text-xs text-white dark:text-black font-medium truncate", children: secondsToDuration(duration) }) }),
|
|
303
|
+
size !== "small" && author && /* @__PURE__ */ jsx6("div", { className: "absolute bottom-0 right-0", children: /* @__PURE__ */ jsx6(
|
|
259
304
|
Avatar,
|
|
260
305
|
{
|
|
261
306
|
size: size === "large" ? "sm" : "xs",
|
|
@@ -263,7 +308,7 @@ var MediaCard = (_a) => {
|
|
|
263
308
|
image: author.image
|
|
264
309
|
}
|
|
265
310
|
) }),
|
|
266
|
-
type === "video" && image && /* @__PURE__ */
|
|
311
|
+
type === "video" && image && /* @__PURE__ */ jsx6(
|
|
267
312
|
PlayIcon,
|
|
268
313
|
{
|
|
269
314
|
size: size === "large" ? 24 : size === "medium" ? 18 : 12,
|
|
@@ -273,14 +318,14 @@ var MediaCard = (_a) => {
|
|
|
273
318
|
] })
|
|
274
319
|
}
|
|
275
320
|
),
|
|
276
|
-
typeof image === "string" ? /* @__PURE__ */
|
|
321
|
+
typeof image === "string" ? /* @__PURE__ */ jsx6("img", { className: "w-full h-full object-cover", src: image }) : image ? image : cloneElement(icon || typesIcons[type], {
|
|
277
322
|
className: "text-gray-900 self-center",
|
|
278
323
|
size: size === "large" ? 24 : size === "medium" ? 18 : 16
|
|
279
324
|
})
|
|
280
325
|
] })
|
|
281
326
|
}
|
|
282
327
|
);
|
|
283
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ jsxs5(
|
|
284
329
|
"div",
|
|
285
330
|
__spreadProps(__spreadValues({}, otherProps), {
|
|
286
331
|
className: cn(
|
|
@@ -296,7 +341,7 @@ var MediaCard = (_a) => {
|
|
|
296
341
|
),
|
|
297
342
|
children: [
|
|
298
343
|
size === "large" && thumbnail,
|
|
299
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ jsxs5(
|
|
300
345
|
"div",
|
|
301
346
|
{
|
|
302
347
|
className: cn("flex gap-4", {
|
|
@@ -305,12 +350,12 @@ var MediaCard = (_a) => {
|
|
|
305
350
|
}),
|
|
306
351
|
children: [
|
|
307
352
|
size !== "large" && thumbnail,
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-2 items-center w-full min-w-0", children: [
|
|
354
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex-1 flex flex-col gap-0.5 min-w-0", children: [
|
|
355
|
+
/* @__PURE__ */ jsx6("p", { className: "text-black text-sm font-medium truncate", children: title }),
|
|
356
|
+
/* @__PURE__ */ jsx6("p", { className: "text-xs text-gray-900 truncate", children: description })
|
|
312
357
|
] }),
|
|
313
|
-
isLoading ? /* @__PURE__ */
|
|
358
|
+
isLoading ? /* @__PURE__ */ jsx6(SpinnerIcon, { size: 24, className: "text-blue-700 animate-spin" }) : /* @__PURE__ */ jsx6(
|
|
314
359
|
"div",
|
|
315
360
|
{
|
|
316
361
|
className: cn({
|
|
@@ -6,5 +6,12 @@ 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 TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
header?: React.ReactNode;
|
|
14
|
+
action?: string | React.ReactNode;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
16
|
|
|
10
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
17
|
+
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipProvider, TooltipTrigger };
|
|
@@ -6,5 +6,12 @@ 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 TooltipArrow: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
declare const TooltipContentCard: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
title: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
header?: React.ReactNode;
|
|
14
|
+
action?: string | React.ReactNode;
|
|
15
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
16
|
|
|
10
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
17
|
+
export { Tooltip, TooltipArrow, TooltipContent, TooltipContentCard, TooltipProvider, TooltipTrigger };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
+
var __defProps = Object.defineProperties;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -19,6 +21,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
21
|
}
|
|
20
22
|
return a;
|
|
21
23
|
};
|
|
24
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
25
|
var __objRest = (source, exclude) => {
|
|
23
26
|
var target = {};
|
|
24
27
|
for (var prop in source)
|
|
@@ -57,14 +60,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
57
60
|
var Tooltip_exports = {};
|
|
58
61
|
__export(Tooltip_exports, {
|
|
59
62
|
Tooltip: () => Tooltip,
|
|
63
|
+
TooltipArrow: () => TooltipArrow,
|
|
60
64
|
TooltipContent: () => TooltipContent,
|
|
65
|
+
TooltipContentCard: () => TooltipContentCard,
|
|
61
66
|
TooltipProvider: () => TooltipProvider,
|
|
62
67
|
TooltipTrigger: () => TooltipTrigger
|
|
63
68
|
});
|
|
64
69
|
module.exports = __toCommonJS(Tooltip_exports);
|
|
65
70
|
|
|
66
71
|
// src/components/Tooltip/Tooltip.tsx
|
|
67
|
-
var
|
|
72
|
+
var React2 = __toESM(require("react"));
|
|
68
73
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
69
74
|
|
|
70
75
|
// src/utils/cn.ts
|
|
@@ -74,37 +79,210 @@ function cn(...inputs) {
|
|
|
74
79
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
75
80
|
}
|
|
76
81
|
|
|
77
|
-
// src/components/
|
|
82
|
+
// src/components/Button/Button.tsx
|
|
83
|
+
var React = __toESM(require("react"));
|
|
84
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
85
|
+
var import_cva = require("cva");
|
|
86
|
+
|
|
87
|
+
// src/icons/spinner.tsx
|
|
88
|
+
var import_react = require("react");
|
|
78
89
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
90
|
+
var SpinnerIcon = (0, import_react.forwardRef)(
|
|
91
|
+
function SpinnerIcon2(_a, ref) {
|
|
92
|
+
var _b = _a, { size = 24, className = "animate-spin text-gray-1000" } = _b, other = __objRest(_b, ["size", "className"]);
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
|
+
"svg",
|
|
95
|
+
__spreadProps(__spreadValues({
|
|
96
|
+
ref,
|
|
97
|
+
width: size,
|
|
98
|
+
height: size,
|
|
99
|
+
viewBox: "0 0 25 24",
|
|
100
|
+
fill: "none",
|
|
101
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
102
|
+
className
|
|
103
|
+
}, other), {
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
"path",
|
|
107
|
+
{
|
|
108
|
+
opacity: "0.12",
|
|
109
|
+
d: "M24.5 12C24.5 18.6274 19.1274 24 12.5 24C5.87258 24 0.5 18.6274 0.5 12C0.5 5.37258 5.87258 0 12.5 0C19.1274 0 24.5 5.37258 24.5 12ZM3.668 12C3.668 16.8778 7.62222 20.832 12.5 20.832C17.3778 20.832 21.332 16.8778 21.332 12C21.332 7.12222 17.3778 3.168 12.5 3.168C7.62222 3.168 3.668 7.12222 3.668 12Z",
|
|
110
|
+
fill: "currentColor"
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
114
|
+
"path",
|
|
115
|
+
{
|
|
116
|
+
d: "M22.916 12C23.7908 12 24.5108 12.7122 24.3956 13.5794C24.1641 15.323 23.5512 17.0011 22.5928 18.4912C21.3476 20.4272 19.5719 21.9643 17.4774 22.919C15.3829 23.8738 13.058 24.206 10.7799 23.8761C8.50179 23.5461 6.36667 22.5679 4.62912 21.0581C2.89158 19.5483 1.62494 17.5706 0.98025 15.3609C0.335563 13.1511 0.340035 10.8026 0.993131 8.5953C1.64623 6.38803 2.92039 4.41517 4.66367 2.91199C6.00545 1.75501 7.58156 0.913857 9.27571 0.441275C10.1184 0.206218 10.9241 0.819698 11.0462 1.68595C11.1683 2.55221 10.5575 3.33995 9.72694 3.61463C8.63201 3.97673 7.61359 4.55146 6.73246 5.31122C5.44941 6.41757 4.51162 7.86959 4.03094 9.49414C3.55027 11.1187 3.54697 12.8472 4.02146 14.4736C4.49595 16.1 5.4282 17.5555 6.70703 18.6668C7.98587 19.778 9.55732 20.4979 11.234 20.7408C12.9107 20.9836 14.6218 20.7391 16.1634 20.0364C17.7049 19.3337 19.0119 18.2024 19.9283 16.7775C20.5576 15.799 20.9846 14.7103 21.1903 13.5755C21.3464 12.7148 22.0412 12 22.916 12Z",
|
|
117
|
+
fill: "currentColor"
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
// src/components/Button/Button.tsx
|
|
127
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
128
|
+
var buttonVariants = (0, import_cva.cva)({
|
|
129
|
+
base: "inline-flex items-center justify-center gap-2 rounded-md 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",
|
|
130
|
+
variants: {
|
|
131
|
+
variant: {
|
|
132
|
+
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",
|
|
133
|
+
secondary: "bg-gray-50 text-black [&>svg]:text-black hover:bg-gray-100 active:bg-gray-500 focus-visible:ring-black",
|
|
134
|
+
tertiary: "bg-gray-50 text-blue-700 [&>svg]:text-blue-700 hover:bg-blue-100 active:bg-blue-200 focus-visible:ring-blue-700",
|
|
135
|
+
outline: "bg-white text-black [&>svg]:text-black ring-1 ring-offset-0 ring-gray-200 hover:bg-gray-50 active:bg-gray-200 focus-visible:ring-black",
|
|
136
|
+
outlineBlue: "bg-transparent text-blue-700 [&>svg]:text-blue-700 ring-1 ring-inset ring-offset-0 ring-blue-700 hover:bg-blue-50 active:bg-blue-200 focus-visible:ring-blue-700 ",
|
|
137
|
+
destructive: "bg-red-700 text-white [&>svg]:text-white dark:text-black dark:[&>svg]:text-black hover:bg-red-800 active:bg-red-900 focus-visible:ring-red-1000",
|
|
138
|
+
ghostBlue: "bg-transparent text-blue-700 [&>svg]:text-blue-700 hover:bg-blue-100 active:bg-blue-200 focus-visible:ring-blue-700",
|
|
139
|
+
ghostRed: "bg-transparent text-red-700 [&>svg]:text-red-700 hover:bg-red-100 active:bg-red-200 focus-visible:ring-red-700",
|
|
140
|
+
ghostGray: "bg-transparent text-black [&>svg]:text-black hover:bg-gray-100 active:bg-gray-200 focus-visible:ring-black",
|
|
141
|
+
roundedFill: "rounded-2xl text-black [&>svg]:text-black bg-gray-200 active:bg-gray-300 border-2 border-gray-400 hover:border-gray-600",
|
|
142
|
+
roundedGlass: "rounded-2xl text-black [&>svg]:text-black bg-gray-100/50 hover:bg-gray-100/75 active:bg-gray-100 backdrop-blur-[20px]"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
defaultVariants: {
|
|
146
|
+
variant: "primary"
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
var buttonSizes = (0, import_cva.cva)({
|
|
150
|
+
variants: {
|
|
151
|
+
size: {
|
|
152
|
+
xs: "text-xs px-2.5 py-1.5",
|
|
153
|
+
sm: "text-sm px-3 py-2",
|
|
154
|
+
md: "text-md px-3.5 py-2.5",
|
|
155
|
+
lg: "text-lg px-4 py-3"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
defaultVariants: {
|
|
159
|
+
size: "md"
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
var iconButtonSizes = (0, import_cva.cva)({
|
|
163
|
+
variants: {
|
|
164
|
+
size: {
|
|
165
|
+
xs: "p-2",
|
|
166
|
+
sm: "p-2.5",
|
|
167
|
+
md: "p-[11px]",
|
|
168
|
+
lg: "p-3"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
defaultVariants: {
|
|
172
|
+
size: "md"
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
var iconSizes = {
|
|
176
|
+
xs: 12,
|
|
177
|
+
sm: 16,
|
|
178
|
+
md: 18,
|
|
179
|
+
lg: 24
|
|
180
|
+
};
|
|
181
|
+
var Button = React.forwardRef(
|
|
182
|
+
(_a, ref) => {
|
|
183
|
+
var _b = _a, {
|
|
184
|
+
className,
|
|
185
|
+
variant,
|
|
186
|
+
size,
|
|
187
|
+
icon = false,
|
|
188
|
+
isLoading = false,
|
|
189
|
+
asChild = false,
|
|
190
|
+
children,
|
|
191
|
+
type = "button"
|
|
192
|
+
} = _b, props = __objRest(_b, [
|
|
193
|
+
"className",
|
|
194
|
+
"variant",
|
|
195
|
+
"size",
|
|
196
|
+
"icon",
|
|
197
|
+
"isLoading",
|
|
198
|
+
"asChild",
|
|
199
|
+
"children",
|
|
200
|
+
"type"
|
|
201
|
+
]);
|
|
202
|
+
var _a2;
|
|
203
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
204
|
+
const sizesStyle = icon ? iconButtonSizes : buttonSizes;
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
206
|
+
Comp,
|
|
207
|
+
__spreadProps(__spreadValues({
|
|
208
|
+
className: cn(
|
|
209
|
+
buttonVariants({ variant, className }),
|
|
210
|
+
sizesStyle({ size })
|
|
211
|
+
),
|
|
212
|
+
ref,
|
|
213
|
+
disabled: (_a2 = props.disabled) != null ? _a2 : isLoading,
|
|
214
|
+
type
|
|
215
|
+
}, props), {
|
|
216
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
218
|
+
SpinnerIcon,
|
|
219
|
+
{
|
|
220
|
+
size: iconSizes[size || "md"],
|
|
221
|
+
className: "absolute text-inherit animate-spin"
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex gap-[inherit] invisible", children })
|
|
225
|
+
] }) : children
|
|
226
|
+
})
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
Button.displayName = "Button";
|
|
231
|
+
|
|
232
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
233
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
79
234
|
var TooltipProvider = (_a) => {
|
|
80
235
|
var _b = _a, {
|
|
81
236
|
delayDuration = 0
|
|
82
237
|
} = _b, props = __objRest(_b, [
|
|
83
238
|
"delayDuration"
|
|
84
239
|
]);
|
|
85
|
-
return /* @__PURE__ */ (0,
|
|
240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Provider, __spreadValues({ delayDuration }, props));
|
|
86
241
|
};
|
|
87
242
|
var Tooltip = TooltipPrimitive.Root;
|
|
88
243
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
89
|
-
var TooltipContent =
|
|
244
|
+
var TooltipContent = React2.forwardRef((_a, ref) => {
|
|
90
245
|
var _b = _a, { className, sideOffset = 4 } = _b, props = __objRest(_b, ["className", "sideOffset"]);
|
|
91
|
-
return /* @__PURE__ */ (0,
|
|
246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
92
247
|
TooltipPrimitive.Content,
|
|
93
248
|
__spreadValues({
|
|
94
249
|
ref,
|
|
95
250
|
sideOffset,
|
|
96
251
|
className: cn(
|
|
97
|
-
"z-50
|
|
252
|
+
"z-50 rounded-md bg-black px-3 py-1.5 text-sm text-white font-medium animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
98
253
|
className
|
|
99
254
|
)
|
|
100
255
|
}, props)
|
|
101
256
|
);
|
|
102
257
|
});
|
|
103
258
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
259
|
+
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
260
|
+
var TooltipContentCard = React2.forwardRef((_a, ref) => {
|
|
261
|
+
var _b = _a, { title, description, header, action, className } = _b, props = __objRest(_b, ["title", "description", "header", "action", "className"]);
|
|
262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
263
|
+
"div",
|
|
264
|
+
__spreadProps(__spreadValues({
|
|
265
|
+
ref,
|
|
266
|
+
className: cn("flex flex-col gap-3 py-1.5", className)
|
|
267
|
+
}, props), {
|
|
268
|
+
children: [
|
|
269
|
+
header,
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col gap-1", children: [
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { className: "text-sm font-medium text-white", children: title }),
|
|
272
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-gray-900", children: description })
|
|
273
|
+
] }),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, { variant: "secondary", size: "xs", asChild: typeof action !== "string", children: action })
|
|
275
|
+
]
|
|
276
|
+
})
|
|
277
|
+
);
|
|
278
|
+
});
|
|
279
|
+
TooltipContentCard.displayName = "TooltipContentCard";
|
|
104
280
|
// Annotate the CommonJS export names for ESM import in node:
|
|
105
281
|
0 && (module.exports = {
|
|
106
282
|
Tooltip,
|
|
283
|
+
TooltipArrow,
|
|
107
284
|
TooltipContent,
|
|
285
|
+
TooltipContentCard,
|
|
108
286
|
TooltipProvider,
|
|
109
287
|
TooltipTrigger
|
|
110
288
|
});
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button
|
|
3
|
+
} from "../../chunk-R6W6SKNR.mjs";
|
|
4
|
+
import "../../chunk-N65I4EXR.mjs";
|
|
1
5
|
import {
|
|
2
6
|
__objRest,
|
|
7
|
+
__spreadProps,
|
|
3
8
|
__spreadValues,
|
|
4
9
|
cn
|
|
5
10
|
} from "../../chunk-BOWIL6WZ.mjs";
|
|
@@ -7,7 +12,7 @@ import {
|
|
|
7
12
|
// src/components/Tooltip/Tooltip.tsx
|
|
8
13
|
import * as React from "react";
|
|
9
14
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
16
|
var TooltipProvider = (_a) => {
|
|
12
17
|
var _b = _a, {
|
|
13
18
|
delayDuration = 0
|
|
@@ -26,16 +31,39 @@ var TooltipContent = React.forwardRef((_a, ref) => {
|
|
|
26
31
|
ref,
|
|
27
32
|
sideOffset,
|
|
28
33
|
className: cn(
|
|
29
|
-
"z-50
|
|
34
|
+
"z-50 rounded-md bg-black px-3 py-1.5 text-sm text-white font-medium animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
30
35
|
className
|
|
31
36
|
)
|
|
32
37
|
}, props)
|
|
33
38
|
);
|
|
34
39
|
});
|
|
35
40
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
41
|
+
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
42
|
+
var TooltipContentCard = React.forwardRef((_a, ref) => {
|
|
43
|
+
var _b = _a, { title, description, header, action, className } = _b, props = __objRest(_b, ["title", "description", "header", "action", "className"]);
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"div",
|
|
46
|
+
__spreadProps(__spreadValues({
|
|
47
|
+
ref,
|
|
48
|
+
className: cn("flex flex-col gap-3 py-1.5", className)
|
|
49
|
+
}, props), {
|
|
50
|
+
children: [
|
|
51
|
+
header,
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
53
|
+
/* @__PURE__ */ jsx("h4", { className: "text-sm font-medium text-white", children: title }),
|
|
54
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-900", children: description })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ jsx(Button, { variant: "secondary", size: "xs", asChild: typeof action !== "string", children: action })
|
|
57
|
+
]
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
});
|
|
61
|
+
TooltipContentCard.displayName = "TooltipContentCard";
|
|
36
62
|
export {
|
|
37
63
|
Tooltip,
|
|
64
|
+
TooltipArrow,
|
|
38
65
|
TooltipContent,
|
|
66
|
+
TooltipContentCard,
|
|
39
67
|
TooltipProvider,
|
|
40
68
|
TooltipTrigger
|
|
41
69
|
};
|