@snapcall/design-system 1.20.0 → 1.21.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.
- package/dist/chunk-IO5BLXCA.mjs +97 -0
- package/dist/chunk-N65I4EXR.mjs +48 -0
- package/dist/{chunk-WST7J5RJ.mjs → chunk-RN2FGOFK.mjs} +4 -2
- package/dist/{chunk-O46NQFTB.mjs → chunk-XI3KELZM.mjs} +8 -47
- package/dist/components/AlertDialog/index.mjs +2 -1
- package/dist/components/Avatar/index.mjs +3 -92
- package/dist/components/Button/index.mjs +2 -1
- package/dist/components/Calendar/index.mjs +2 -1
- package/dist/components/Carousel/index.mjs +2 -1
- package/dist/components/Command/index.mjs +3 -2
- package/dist/components/CreatableSelect/index.mjs +3 -2
- package/dist/components/Dialog/index.mjs +2 -1
- package/dist/components/FilterButton/index.mjs +2 -1
- package/dist/components/MediaCard/index.d.mts +21 -0
- package/dist/components/MediaCard/index.d.ts +21 -0
- package/dist/components/MediaCard/index.js +500 -0
- package/dist/components/MediaCard/index.mjs +324 -0
- package/dist/components/Pagination/index.mjs +2 -1
- package/dist/components/Sheet/index.mjs +2 -1
- package/dist/components/Toaster/index.mjs +2 -1
- package/dist/index.d.mts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +4 -0
- package/dist/index.mjs +2 -0
- package/dist/tailwind.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
35
|
+
var __export = (target, all) => {
|
|
36
|
+
for (var name in all)
|
|
37
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
38
|
+
};
|
|
39
|
+
var __copyProps = (to, from, except, desc) => {
|
|
40
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
41
|
+
for (let key of __getOwnPropNames(from))
|
|
42
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
43
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
44
|
+
}
|
|
45
|
+
return to;
|
|
46
|
+
};
|
|
47
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
|
|
49
|
+
// src/components/MediaCard/index.ts
|
|
50
|
+
var MediaCard_exports = {};
|
|
51
|
+
__export(MediaCard_exports, {
|
|
52
|
+
MediaCard: () => MediaCard
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(MediaCard_exports);
|
|
55
|
+
|
|
56
|
+
// src/components/MediaCard/MediaCard.tsx
|
|
57
|
+
var import_react7 = require("react");
|
|
58
|
+
|
|
59
|
+
// src/icons/image1.tsx
|
|
60
|
+
var import_react = require("react");
|
|
61
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
62
|
+
var Image1Icon = (0, import_react.forwardRef)(
|
|
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__ */ (0, import_jsx_runtime.jsxs)(
|
|
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__ */ (0, import_jsx_runtime.jsxs)("g", { opacity: "0.12", children: [
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
+
"path",
|
|
80
|
+
{
|
|
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",
|
|
82
|
+
fill: "currentColor"
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
86
|
+
"path",
|
|
87
|
+
{
|
|
88
|
+
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",
|
|
89
|
+
fill: "currentColor"
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
"path",
|
|
95
|
+
{
|
|
96
|
+
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",
|
|
97
|
+
stroke: "currentColor",
|
|
98
|
+
strokeWidth: "2",
|
|
99
|
+
strokeLinecap: "round",
|
|
100
|
+
strokeLinejoin: "round"
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
// src/icons/play.tsx
|
|
110
|
+
var import_react2 = require("react");
|
|
111
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
112
|
+
var PlayIcon = (0, import_react2.forwardRef)(function PlayIcon2(_a, ref) {
|
|
113
|
+
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
115
|
+
"svg",
|
|
116
|
+
__spreadProps(__spreadValues({
|
|
117
|
+
ref,
|
|
118
|
+
width: size,
|
|
119
|
+
height: size,
|
|
120
|
+
viewBox: "0 0 24 24",
|
|
121
|
+
fill: "none",
|
|
122
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
123
|
+
className
|
|
124
|
+
}, other), {
|
|
125
|
+
children: [
|
|
126
|
+
duotone && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
127
|
+
"path",
|
|
128
|
+
{
|
|
129
|
+
opacity: "0.12",
|
|
130
|
+
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",
|
|
131
|
+
fill: "currentColor"
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
135
|
+
"path",
|
|
136
|
+
{
|
|
137
|
+
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",
|
|
138
|
+
stroke: "currentColor",
|
|
139
|
+
strokeWidth: "2",
|
|
140
|
+
strokeLinecap: "round",
|
|
141
|
+
strokeLinejoin: "round"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
]
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// src/icons/recording2.tsx
|
|
150
|
+
var import_react3 = require("react");
|
|
151
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
152
|
+
var Recording2Icon = (0, import_react3.forwardRef)(
|
|
153
|
+
function Recording2Icon2(_a, ref) {
|
|
154
|
+
var _b = _a, { size = 24, className = "text-gray-1000" } = _b, other = __objRest(_b, ["size", "className"]);
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
156
|
+
"svg",
|
|
157
|
+
__spreadProps(__spreadValues({
|
|
158
|
+
ref,
|
|
159
|
+
width: size,
|
|
160
|
+
height: size,
|
|
161
|
+
viewBox: "0 0 24 24",
|
|
162
|
+
fill: "none",
|
|
163
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
164
|
+
className
|
|
165
|
+
}, other), {
|
|
166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
167
|
+
"path",
|
|
168
|
+
{
|
|
169
|
+
d: "M3 10L3 14M7.5 11V13M12 6V18M16.5 3V21M21 10V14",
|
|
170
|
+
stroke: "currentColor",
|
|
171
|
+
strokeWidth: "2",
|
|
172
|
+
strokeLinecap: "round",
|
|
173
|
+
strokeLinejoin: "round"
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
// src/icons/spinner.tsx
|
|
182
|
+
var import_react4 = require("react");
|
|
183
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
184
|
+
var SpinnerIcon = (0, import_react4.forwardRef)(
|
|
185
|
+
function SpinnerIcon2(_a, ref) {
|
|
186
|
+
var _b = _a, { size = 24, className = "animate-spin text-gray-1000" } = _b, other = __objRest(_b, ["size", "className"]);
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
188
|
+
"svg",
|
|
189
|
+
__spreadProps(__spreadValues({
|
|
190
|
+
ref,
|
|
191
|
+
width: size,
|
|
192
|
+
height: size,
|
|
193
|
+
viewBox: "0 0 25 24",
|
|
194
|
+
fill: "none",
|
|
195
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
196
|
+
className
|
|
197
|
+
}, other), {
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
200
|
+
"path",
|
|
201
|
+
{
|
|
202
|
+
opacity: "0.12",
|
|
203
|
+
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",
|
|
204
|
+
fill: "currentColor"
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
208
|
+
"path",
|
|
209
|
+
{
|
|
210
|
+
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",
|
|
211
|
+
fill: "currentColor"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
})
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
// src/icons/videoRecorder.tsx
|
|
221
|
+
var import_react5 = require("react");
|
|
222
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
223
|
+
var VideoRecorderIcon = (0, import_react5.forwardRef)(
|
|
224
|
+
function VideoRecorderIcon2(_a, ref) {
|
|
225
|
+
var _b = _a, { size = 24, className = "text-gray-1000", duotone = false } = _b, other = __objRest(_b, ["size", "className", "duotone"]);
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
227
|
+
"svg",
|
|
228
|
+
__spreadProps(__spreadValues({
|
|
229
|
+
ref,
|
|
230
|
+
width: size,
|
|
231
|
+
height: size,
|
|
232
|
+
viewBox: "0 0 24 24",
|
|
233
|
+
fill: "none",
|
|
234
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
235
|
+
className
|
|
236
|
+
}, other), {
|
|
237
|
+
children: [
|
|
238
|
+
duotone && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
239
|
+
"path",
|
|
240
|
+
{
|
|
241
|
+
opacity: "0.12",
|
|
242
|
+
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",
|
|
243
|
+
fill: "currentColor",
|
|
244
|
+
stroke: "currentColor",
|
|
245
|
+
strokeWidth: "2",
|
|
246
|
+
strokeLinecap: "round",
|
|
247
|
+
strokeLinejoin: "round"
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
251
|
+
"path",
|
|
252
|
+
{
|
|
253
|
+
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",
|
|
254
|
+
stroke: "currentColor",
|
|
255
|
+
strokeWidth: "2",
|
|
256
|
+
strokeLinecap: "round",
|
|
257
|
+
strokeLinejoin: "round"
|
|
258
|
+
}
|
|
259
|
+
),
|
|
260
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
261
|
+
"path",
|
|
262
|
+
{
|
|
263
|
+
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",
|
|
264
|
+
stroke: "currentColor",
|
|
265
|
+
strokeWidth: "2",
|
|
266
|
+
strokeLinecap: "round",
|
|
267
|
+
strokeLinejoin: "round"
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
]
|
|
271
|
+
})
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
// src/utils/cn.ts
|
|
277
|
+
var import_clsx = require("clsx");
|
|
278
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
279
|
+
function cn(...inputs) {
|
|
280
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// src/components/Avatar/Avatar.tsx
|
|
284
|
+
var import_react6 = require("react");
|
|
285
|
+
var import_cva = require("cva");
|
|
286
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
287
|
+
var avatarSizes = (0, import_cva.cva)({
|
|
288
|
+
variants: {
|
|
289
|
+
size: {
|
|
290
|
+
xxs: "w-[8px] h-[8px] rounded-[3px]",
|
|
291
|
+
xs: "w-[16px] h-[16px] rounded-[3px] text-[10px]",
|
|
292
|
+
sm: "w-[24px] h-[24px] rounded-[4px] text-md",
|
|
293
|
+
md: "w-[36px] h-[36px] rounded-[6px] text-md",
|
|
294
|
+
lg: "w-[45px] h-[45px] rounded-[8px] text-md",
|
|
295
|
+
xl: "w-[72px] h-[72px] rounded-[10px] text-[30px]"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
defaultVariants: {
|
|
299
|
+
size: "md"
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
var avatarColors = {
|
|
303
|
+
amber: "bg-amber-200 text-amber-700 data-[size=xxs]:bg-amber-700",
|
|
304
|
+
red: "bg-red-300 text-red-700 data-[size=xxs]:bg-red-700",
|
|
305
|
+
green: "bg-green-300 text-green-700 data-[size=xxs]:bg-green-700",
|
|
306
|
+
plum: "bg-plum-300 text-plum-700 data-[size=xxs]:bg-plum-700",
|
|
307
|
+
crimson: "bg-crimson-300 text-crimson-700 data-[size=xxs]:bg-crimson-700",
|
|
308
|
+
blue: "bg-blue-300 text-blue-700 data-[size=xxs]:bg-blue-700",
|
|
309
|
+
purple: "bg-purple-300 text-purple-700 data-[size=xxs]:bg-purple-700",
|
|
310
|
+
violet: "bg-violet-300 text-violet-700 data-[size=xxs]:bg-violet-700",
|
|
311
|
+
indigo: "bg-indigo-300 text-indigo-700 data-[size=xxs]:bg-indigo-700",
|
|
312
|
+
cyan: "bg-cyan-300 text-cyan-700 data-[size=xxs]:bg-cyan-700",
|
|
313
|
+
teal: "bg-teal-300 text-teal-700 data-[size=xxs]:bg-teal-700",
|
|
314
|
+
grass: "bg-grass-300 text-grass-700 data-[size=xxs]:bg-grass-700",
|
|
315
|
+
brown: "bg-brown-300 text-brown-700 data-[size=xxs]:bg-brown-700",
|
|
316
|
+
lime: "bg-lime-300 text-lime-700 data-[size=xxs]:bg-lime-700",
|
|
317
|
+
yellow: "bg-yellow-300 text-yellow-700 data-[size=xxs]:bg-yellow-700",
|
|
318
|
+
gold: "bg-gold-300 text-gold-700 data-[size=xxs]:bg-gold-700",
|
|
319
|
+
bronze: "bg-bronze-300 text-bronze-700 data-[size=xxs]:bg-bronze-700",
|
|
320
|
+
gray: "bg-gray-300 text-gray-700 data-[size=xxs]:bg-gray-700"
|
|
321
|
+
};
|
|
322
|
+
var avatarVariants = (0, import_cva.cva)({
|
|
323
|
+
variants: {
|
|
324
|
+
variant: avatarColors
|
|
325
|
+
},
|
|
326
|
+
defaultVariants: {
|
|
327
|
+
variant: "blue"
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
var getNameInitials = (name) => {
|
|
331
|
+
const initial = name[0].toUpperCase();
|
|
332
|
+
return initial;
|
|
333
|
+
};
|
|
334
|
+
var getColorFromName = (name) => {
|
|
335
|
+
const nameValue = Array.from(name).reduce(
|
|
336
|
+
(total, current) => current.charCodeAt(0) + total,
|
|
337
|
+
0
|
|
338
|
+
);
|
|
339
|
+
const colorIndex = nameValue % Object.keys(avatarColors).length;
|
|
340
|
+
return Object.keys(avatarColors)[colorIndex];
|
|
341
|
+
};
|
|
342
|
+
var Avatar = (0, import_react6.forwardRef)(function Avatar2(_a, forwardedRef) {
|
|
343
|
+
var _b = _a, { size, className, icon, name, variant, image } = _b, other = __objRest(_b, ["size", "className", "icon", "name", "variant", "image"]);
|
|
344
|
+
const color = getColorFromName(name);
|
|
345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
346
|
+
"div",
|
|
347
|
+
__spreadProps(__spreadValues({
|
|
348
|
+
"data-size": size,
|
|
349
|
+
ref: forwardedRef,
|
|
350
|
+
className: cn(
|
|
351
|
+
"flex items-center justify-center font-semibold relative overflow-hidden shrink-0",
|
|
352
|
+
variant ? avatarVariants({ variant }) : avatarVariants({
|
|
353
|
+
variant: color
|
|
354
|
+
}),
|
|
355
|
+
avatarSizes({ size }),
|
|
356
|
+
{
|
|
357
|
+
relative: Boolean(icon)
|
|
358
|
+
},
|
|
359
|
+
className
|
|
360
|
+
)
|
|
361
|
+
}, other), {
|
|
362
|
+
children: [
|
|
363
|
+
image ? image : name && size !== "xxs" ? getNameInitials(name) : null,
|
|
364
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "absolute bottom-0 right-0", children: icon })
|
|
365
|
+
]
|
|
366
|
+
})
|
|
367
|
+
);
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
// src/components/MediaCard/utils.ts
|
|
371
|
+
var secondsToDuration = (seconds) => {
|
|
372
|
+
const hours = Math.floor(seconds / (60 * 60));
|
|
373
|
+
const minutes = Math.floor(seconds / 60) % 60;
|
|
374
|
+
const leftoverSeconds = seconds % 60;
|
|
375
|
+
const hoursText = hours ? `${hours}:` : "";
|
|
376
|
+
const minutesText = minutes ? `${minutes}:` : "0:";
|
|
377
|
+
const secondsText = leftoverSeconds < 10 ? `0${leftoverSeconds}` : `${leftoverSeconds}`;
|
|
378
|
+
return `${hoursText}${minutesText}${secondsText}`;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
// src/components/MediaCard/MediaCard.tsx
|
|
382
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
383
|
+
var typesIcons = {
|
|
384
|
+
audio: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Recording2Icon, {}),
|
|
385
|
+
video: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(VideoRecorderIcon, { duotone: true }),
|
|
386
|
+
image: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Image1Icon, { duotone: true })
|
|
387
|
+
};
|
|
388
|
+
var MediaCard = (_a) => {
|
|
389
|
+
var _b = _a, {
|
|
390
|
+
title,
|
|
391
|
+
description,
|
|
392
|
+
duration,
|
|
393
|
+
type,
|
|
394
|
+
image,
|
|
395
|
+
action,
|
|
396
|
+
actionBehavior = "default",
|
|
397
|
+
isLoading,
|
|
398
|
+
size,
|
|
399
|
+
className
|
|
400
|
+
} = _b, otherProps = __objRest(_b, [
|
|
401
|
+
"title",
|
|
402
|
+
"description",
|
|
403
|
+
"duration",
|
|
404
|
+
"type",
|
|
405
|
+
"image",
|
|
406
|
+
"action",
|
|
407
|
+
"actionBehavior",
|
|
408
|
+
"isLoading",
|
|
409
|
+
"size",
|
|
410
|
+
"className"
|
|
411
|
+
]);
|
|
412
|
+
const thumbnail = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
413
|
+
"div",
|
|
414
|
+
__spreadProps(__spreadValues({}, otherProps), {
|
|
415
|
+
className: cn(
|
|
416
|
+
"flex-1 min-h-0 bg-gray-50 relative",
|
|
417
|
+
{
|
|
418
|
+
"aspect-square rounded-md": size === "medium" || size === "small"
|
|
419
|
+
},
|
|
420
|
+
className
|
|
421
|
+
),
|
|
422
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex justify-center items-center w-full h-full rounded-[inherit] overflow-hidden relative", children: [
|
|
423
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
424
|
+
"div",
|
|
425
|
+
{
|
|
426
|
+
className: cn(
|
|
427
|
+
"absolute w-full h-full",
|
|
428
|
+
size === "large" ? "p-2" : "p-1"
|
|
429
|
+
),
|
|
430
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "relative w-full h-full flex justify-center items-center", children: [
|
|
431
|
+
duration && size === "large" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute bottom-0 left-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "px-1 py-0.5 bg-black/50 dark:bg-white/50 rounded text-xs text-white dark:text-black font-medium truncate", children: secondsToDuration(duration) }) }),
|
|
432
|
+
size !== "small" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute bottom-0 right-0", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Avatar, { size: size === "large" ? "sm" : "xs", name: "Avatar" }) }),
|
|
433
|
+
type === "video" && image && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
434
|
+
PlayIcon,
|
|
435
|
+
{
|
|
436
|
+
size: size === "large" ? 24 : size === "medium" ? 18 : 12,
|
|
437
|
+
className: "text-white fill-white dark:text-black dark:fill-black"
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
] })
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
typeof image === "string" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { className: "w-full h-full object-cover", src: image }) : image ? image : (0, import_react7.cloneElement)(typesIcons[type], {
|
|
444
|
+
className: "text-gray-900 self-center",
|
|
445
|
+
size: size === "large" ? 24 : size === "medium" ? 18 : 16
|
|
446
|
+
})
|
|
447
|
+
] })
|
|
448
|
+
})
|
|
449
|
+
);
|
|
450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
451
|
+
"div",
|
|
452
|
+
{
|
|
453
|
+
className: cn(
|
|
454
|
+
"flex flex-col bg-white border border-gray-200 divide-y divide-gray-200 rounded-lg shadow-sm group/mediacard",
|
|
455
|
+
"hover:bg-gray-25 active:bg-gray-50 overflow-hidden",
|
|
456
|
+
{
|
|
457
|
+
"opacity-40": isLoading,
|
|
458
|
+
"w-[232px] h-[184px]": size === "large",
|
|
459
|
+
"w-[240px] h-[72px]": size === "medium",
|
|
460
|
+
"w-[240px] h-[52px]": size === "small"
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
children: [
|
|
464
|
+
size === "large" && thumbnail,
|
|
465
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
466
|
+
"div",
|
|
467
|
+
{
|
|
468
|
+
className: cn("flex gap-4", {
|
|
469
|
+
"p-3": size === "large",
|
|
470
|
+
"py-2 pl-2 pr-3.5 h-full": size === "medium" || size === "small"
|
|
471
|
+
}),
|
|
472
|
+
children: [
|
|
473
|
+
size !== "large" && thumbnail,
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex gap-2 items-center w-full", children: [
|
|
475
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 flex flex-col gap-0.5 min-w-0", children: [
|
|
476
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-black text-sm font-medium truncate", children: title }),
|
|
477
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-gray-900 truncate", children: description })
|
|
478
|
+
] }),
|
|
479
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SpinnerIcon, { size: 24, className: "text-blue-700 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
480
|
+
"div",
|
|
481
|
+
{
|
|
482
|
+
className: cn({
|
|
483
|
+
"invisible group-hover/mediacard:visible group-focus-within/mediacard:visible": actionBehavior === "hover"
|
|
484
|
+
}),
|
|
485
|
+
children: action
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] })
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
)
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
);
|
|
495
|
+
};
|
|
496
|
+
MediaCard.displayName = "MediaCard";
|
|
497
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
498
|
+
0 && (module.exports = {
|
|
499
|
+
MediaCard
|
|
500
|
+
});
|