@sofya-ds/react 1.1.12 → 1.1.14
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/index.cjs +1084 -1197
- package/dist/index.css +1 -1
- package/dist/index.d.cts +75 -62
- package/dist/index.d.ts +75 -62
- package/dist/index.js +1131 -1210
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -158,6 +158,7 @@ __export(index_exports, {
|
|
|
158
158
|
hexToHslChannels: () => import_tokens2.hexToHslChannels,
|
|
159
159
|
iconColorOptions: () => iconColorOptions,
|
|
160
160
|
iconNames: () => iconNames,
|
|
161
|
+
iconSizeMap: () => iconSizeMap,
|
|
161
162
|
iconSizeOptions: () => iconSizeOptions,
|
|
162
163
|
inputVariantOptions: () => inputVariantOptions,
|
|
163
164
|
isTextContent: () => isTextContent,
|
|
@@ -301,107 +302,89 @@ var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"), 1);
|
|
|
301
302
|
var React2 = __toESM(require("react"), 1);
|
|
302
303
|
|
|
303
304
|
// src/components/icon-data.ts
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
"question": { viewBox: "0 0 16.25 16.25", d: "M9.0625 12.1875C9.0625 12.3729 9.00752 12.5542 8.90451 12.7083C8.80149 12.8625 8.65507 12.9827 8.48377 13.0536C8.31246 13.1246 8.12396 13.1432 7.94211 13.107C7.76025 13.0708 7.5932 12.9815 7.46209 12.8504C7.33098 12.7193 7.24169 12.5523 7.20552 12.3704C7.16934 12.1885 7.18791 12 7.25887 11.8287C7.32982 11.6574 7.44999 11.511 7.60416 11.408C7.75833 11.305 7.93958 11.25 8.125 11.25C8.37364 11.25 8.6121 11.3488 8.78792 11.5246C8.96373 11.7004 9.0625 11.9389 9.0625 12.1875ZM8.125 3.75C6.40157 3.75 5 5.01172 5 6.5625V6.875C5 7.04076 5.06585 7.19973 5.18306 7.31694C5.30027 7.43415 5.45924 7.5 5.625 7.5C5.79076 7.5 5.94973 7.43415 6.06695 7.31694C6.18416 7.19973 6.25 7.04076 6.25 6.875V6.5625C6.25 5.70312 7.09141 5 8.125 5C9.1586 5 10 5.70312 10 6.5625C10 7.42188 9.1586 8.125 8.125 8.125C7.95924 8.125 7.80027 8.19085 7.68306 8.30806C7.56585 8.42527 7.5 8.58424 7.5 8.75V9.375C7.5 9.54076 7.56585 9.69973 7.68306 9.81694C7.80027 9.93415 7.95924 10 8.125 10C8.29076 10 8.44974 9.93415 8.56695 9.81694C8.68416 9.69973 8.75 9.54076 8.75 9.375V9.31875C10.175 9.05703 11.25 7.92031 11.25 6.5625C11.25 5.01172 9.84844 3.75 8.125 3.75ZM16.25 8.125C16.25 9.73197 15.7735 11.3029 14.8807 12.639C13.9879 13.9752 12.719 15.0166 11.2343 15.6315C9.74966 16.2465 8.11599 16.4074 6.53989 16.0939C4.9638 15.7804 3.51606 15.0065 2.37976 13.8702C1.24346 12.7339 0.469628 11.2862 0.156123 9.71011C-0.157382 8.13401 0.00352043 6.50035 0.618482 5.0157C1.23344 3.53105 2.27485 2.2621 3.611 1.36931C4.94714 0.476523 6.51803 0 8.125 0C10.2792 0.00227486 12.3445 0.85903 13.8677 2.38227C15.391 3.90551 16.2477 5.97081 16.25 8.125ZM15 8.125C15 6.76525 14.5968 5.43604 13.8414 4.30545C13.0859 3.17487 12.0122 2.29368 10.756 1.77333C9.49971 1.25298 8.11738 1.11683 6.78376 1.3821C5.45014 1.64737 4.22513 2.30215 3.26364 3.26364C2.30216 4.22513 1.64738 5.45013 1.3821 6.78375C1.11683 8.11737 1.25298 9.49971 1.77333 10.7559C2.29368 12.0122 3.17487 13.0859 4.30546 13.8414C5.43605 14.5968 6.76526 15 8.125 15C9.94773 14.9979 11.6952 14.2729 12.9841 12.9841C14.2729 11.6952 14.9979 9.94773 15 8.125Z" },
|
|
336
|
-
"caret-up": { viewBox: "0 0 13.7508 7.50098", d: "M13.5675 7.31768C13.5095 7.37579 13.4406 7.42189 13.3647 7.45334C13.2888 7.48479 13.2075 7.50098 13.1253 7.50098C13.0432 7.50098 12.9619 7.48479 12.886 7.45334C12.8101 7.42189 12.7412 7.37579 12.6832 7.31768L6.87535 1.50909L1.06753 7.31768C0.95026 7.43495 0.7912 7.50084 0.625347 7.50084C0.459495 7.50084 0.300435 7.43495 0.18316 7.31768C0.0658846 7.2004 3.26935e-09 7.04134 0 6.87549C-3.26935e-09 6.70964 0.0658846 6.55058 0.18316 6.4333L6.43316 0.183304C6.49121 0.125194 6.56014 0.0790947 6.63601 0.047642C6.71188 0.0161893 6.79321 0 6.87535 0C6.95748 0 7.03881 0.0161893 7.11469 0.047642C7.19056 0.0790947 7.25949 0.125194 7.31754 0.183304L13.5675 6.4333C13.6256 6.49135 13.6717 6.56028 13.7032 6.63615C13.7347 6.71203 13.7508 6.79336 13.7508 6.87549C13.7508 6.95763 13.7347 7.03896 13.7032 7.11483C13.6717 7.1907 13.6256 7.25963 13.5675 7.31768Z" },
|
|
337
|
-
"stop 1": { viewBox: "0 0 13.75 13.75", d: "M12.5 0H1.25C0.918479 0 0.600537 0.131696 0.366116 0.366116C0.131696 0.600537 0 0.918479 0 1.25V12.5C0 12.8315 0.131696 13.1495 0.366116 13.3839C0.600537 13.6183 0.918479 13.75 1.25 13.75H12.5C12.8315 13.75 13.1495 13.6183 13.3839 13.3839C13.6183 13.1495 13.75 12.8315 13.75 12.5V1.25C13.75 0.918479 13.6183 0.600537 13.3839 0.366116C13.1495 0.131696 12.8315 0 12.5 0ZM12.5 12.5H1.25V1.25H12.5V12.5Z" },
|
|
338
|
-
"pause 1": { viewBox: "0 0 13.75 13.75", d: "M13.75 0.625V3.75C13.75 3.91576 13.6842 4.07473 13.5669 4.19194C13.4497 4.30915 13.2908 4.375 13.125 4.375C12.9592 4.375 12.8003 4.30915 12.6831 4.19194C12.5658 4.07473 12.5 3.91576 12.5 3.75V1.25H10C9.83424 1.25 9.67527 1.18415 9.55806 1.06694C9.44085 0.949731 9.375 0.79076 9.375 0.625C9.375 0.45924 9.44085 0.300269 9.55806 0.183058C9.67527 0.0658481 9.83424 0 10 0H13.125C13.2908 0 13.4497 0.0658481 13.5669 0.183058C13.6842 0.300269 13.75 0.45924 13.75 0.625ZM3.75 12.5H1.25V10C1.25 9.83424 1.18415 9.67527 1.06694 9.55806C0.949731 9.44085 0.79076 9.375 0.625 9.375C0.45924 9.375 0.300269 9.44085 0.183058 9.55806C0.0658481 9.67527 0 9.83424 0 10V13.125C0 13.2908 0.0658481 13.4497 0.183058 13.5669C0.300269 13.6842 0.45924 13.75 0.625 13.75H3.75C3.91576 13.75 4.07473 13.6842 4.19194 13.5669C4.30915 13.4497 4.375 13.2908 4.375 13.125C4.375 12.9592 4.30915 12.8003 4.19194 12.6831C4.07473 12.5658 3.91576 12.5 3.75 12.5ZM13.125 9.375C12.9592 9.375 12.8003 9.44085 12.6831 9.55806C12.5658 9.67527 12.5 9.83424 12.5 10V12.5H10C9.83424 12.5 9.67527 12.5658 9.55806 12.6831C9.44085 12.8003 9.375 12.9592 9.375 13.125C9.375 13.2908 9.44085 13.4497 9.55806 13.5669C9.67527 13.6842 9.83424 13.75 10 13.75H13.125C13.2908 13.75 13.4497 13.6842 13.5669 13.5669C13.6842 13.4497 13.75 13.2908 13.75 13.125V10C13.75 9.83424 13.6842 9.67527 13.5669 9.55806C13.4497 9.44085 13.2908 9.375 13.125 9.375ZM3.75 0H0.625C0.45924 0 0.300269 0.0658481 0.183058 0.183058C0.0658481 0.300269 0 0.45924 0 0.625V3.75C0 3.91576 0.0658481 4.07473 0.183058 4.19194C0.300269 4.30915 0.45924 4.375 0.625 4.375C0.79076 4.375 0.949731 4.30915 1.06694 4.19194C1.18415 4.07473 1.25 3.91576 1.25 3.75V1.25H3.75C3.91576 1.25 4.07473 1.18415 4.19194 1.06694C4.30915 0.949731 4.375 0.79076 4.375 0.625C4.375 0.45924 4.30915 0.300269 4.19194 0.183058C4.07473 0.0658481 3.91576 0 3.75 0Z" },
|
|
339
|
-
"play 1": { viewBox: "0 0 13.75 13.75", d: "M8.75 4.375V0.625C8.75 0.45924 8.81585 0.300269 8.93306 0.183058C9.05027 0.0658481 9.20924 0 9.375 0C9.54076 0 9.69973 0.0658481 9.81694 0.183058C9.93415 0.300269 10 0.45924 10 0.625V3.75H13.125C13.2908 3.75 13.4497 3.81585 13.5669 3.93306C13.6842 4.05027 13.75 4.20924 13.75 4.375C13.75 4.54076 13.6842 4.69973 13.5669 4.81694C13.4497 4.93415 13.2908 5 13.125 5H9.375C9.20924 5 9.05027 4.93415 8.93306 4.81694C8.81585 4.69973 8.75 4.54076 8.75 4.375ZM4.375 8.75H0.625C0.45924 8.75 0.300269 8.81585 0.183058 8.93306C0.0658481 9.05027 0 9.20924 0 9.375C0 9.54076 0.0658481 9.69973 0.183058 9.81694C0.300269 9.93415 0.45924 10 0.625 10H3.75V13.125C3.75 13.2908 3.81585 13.4497 3.93306 13.5669C4.05027 13.6842 4.20924 13.75 4.375 13.75C4.54076 13.75 4.69973 13.6842 4.81694 13.5669C4.93415 13.4497 5 13.2908 5 13.125V9.375C5 9.20924 4.93415 9.05027 4.81694 8.93306C4.69973 8.81585 4.54076 8.75 4.375 8.75ZM13.125 8.75H9.375C9.20924 8.75 9.05027 8.81585 8.93306 8.93306C8.81585 9.05027 8.75 9.20924 8.75 9.375V13.125C8.75 13.2908 8.81585 13.4497 8.93306 13.5669C9.05027 13.6842 9.20924 13.75 9.375 13.75C9.54076 13.75 9.69973 13.6842 9.81694 13.5669C9.93415 13.4497 10 13.2908 10 13.125V10H13.125C13.2908 10 13.4497 9.93415 13.5669 9.81694C13.6842 9.69973 13.75 9.54076 13.75 9.375C13.75 9.20924 13.6842 9.05027 13.5669 8.93306C13.4497 8.81585 13.2908 8.75 13.125 8.75ZM4.375 0C4.20924 0 4.05027 0.0658481 3.93306 0.183058C3.81585 0.300269 3.75 0.45924 3.75 0.625V3.75H0.625C0.45924 3.75 0.300269 3.81585 0.183058 3.93306C0.0658481 4.05027 0 4.20924 0 4.375C0 4.54076 0.0658481 4.69973 0.183058 4.81694C0.300269 4.93415 0.45924 5 0.625 5H4.375C4.54076 5 4.69973 4.93415 4.81694 4.81694C4.93415 4.69973 5 4.54076 5 4.375V0.625C5 0.45924 4.93415 0.300269 4.81694 0.183058C4.69973 0.0658481 4.54076 0 4.375 0Z" },
|
|
340
|
-
"corners-out 1": { viewBox: "0 0 16 16", strokes: [
|
|
341
|
-
{ d: "M1 5V1H5", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
342
|
-
{ d: "M11 1H15V5", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
343
|
-
{ d: "M15 11V15H11", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
344
|
-
{ d: "M5 15H1V11", strokeWidth: 1.75, strokeLinecap: "round" }
|
|
345
|
-
] },
|
|
346
|
-
"corners-in 1": { viewBox: "0 0 16 16", strokes: [
|
|
347
|
-
{ d: "M1 1H5V5", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
348
|
-
{ d: "M11 1H15V5", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
349
|
-
{ d: "M15 11V15H11", strokeWidth: 1.75, strokeLinecap: "round" },
|
|
350
|
-
{ d: "M1 11H5V15", strokeWidth: 1.75, strokeLinecap: "round" }
|
|
351
|
-
] },
|
|
352
|
-
"Volume": { viewBox: "0 0 12 14", strokes: [
|
|
353
|
-
{ d: "M1 13L1 7", strokeWidth: 2, strokeLinecap: "round" },
|
|
354
|
-
{ d: "M6 13L6 4", strokeWidth: 2, strokeLinecap: "round" },
|
|
355
|
-
{ d: "M11 13L11 1", strokeWidth: 2, strokeLinecap: "round" }
|
|
356
|
-
] }
|
|
305
|
+
var import_icons_react = require("@tabler/icons-react");
|
|
306
|
+
var tablerIconRegistry = {
|
|
307
|
+
IconAdjustmentsHorizontalFilled: import_icons_react.IconAdjustmentsHorizontalFilled,
|
|
308
|
+
IconArrowUp: import_icons_react.IconArrowUp,
|
|
309
|
+
IconBuildingHospital: import_icons_react.IconBuildingHospital,
|
|
310
|
+
IconBooks: import_icons_react.IconBooks,
|
|
311
|
+
IconBulb: import_icons_react.IconBulb,
|
|
312
|
+
IconChartBar: import_icons_react.IconChartBar,
|
|
313
|
+
IconCheck: import_icons_react.IconCheck,
|
|
314
|
+
IconChecklist: import_icons_react.IconChecklist,
|
|
315
|
+
IconChevronDown: import_icons_react.IconChevronDown,
|
|
316
|
+
IconChevronUp: import_icons_react.IconChevronUp,
|
|
317
|
+
IconFile: import_icons_react.IconFile,
|
|
318
|
+
IconFolders: import_icons_react.IconFolders,
|
|
319
|
+
IconHelpCircle: import_icons_react.IconHelpCircle,
|
|
320
|
+
IconLanguage: import_icons_react.IconLanguage,
|
|
321
|
+
IconMapPin: import_icons_react.IconMapPin,
|
|
322
|
+
IconMessages: import_icons_react.IconMessages,
|
|
323
|
+
IconMicrophone: import_icons_react.IconMicrophone,
|
|
324
|
+
IconPencil: import_icons_react.IconPencil,
|
|
325
|
+
IconPlus: import_icons_react.IconPlus,
|
|
326
|
+
IconSchool: import_icons_react.IconSchool,
|
|
327
|
+
IconSearch: import_icons_react.IconSearch,
|
|
328
|
+
IconSparkles: import_icons_react.IconSparkles,
|
|
329
|
+
IconUser: import_icons_react.IconUser,
|
|
330
|
+
IconUserFilled: import_icons_react.IconUserFilled,
|
|
331
|
+
IconUserCircle: import_icons_react.IconUserCircle,
|
|
332
|
+
IconUserSearch: import_icons_react.IconUserSearch,
|
|
333
|
+
IconUsers: import_icons_react.IconUsers,
|
|
334
|
+
IconUsersGroup: import_icons_react.IconUsersGroup,
|
|
335
|
+
IconX: import_icons_react.IconX
|
|
357
336
|
};
|
|
358
|
-
var
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
"
|
|
372
|
-
"
|
|
373
|
-
"
|
|
374
|
-
"
|
|
375
|
-
"
|
|
376
|
-
"
|
|
377
|
-
"
|
|
378
|
-
"
|
|
379
|
-
"
|
|
380
|
-
"
|
|
381
|
-
"
|
|
382
|
-
"
|
|
383
|
-
"
|
|
384
|
-
"
|
|
385
|
-
"
|
|
386
|
-
"
|
|
387
|
-
"
|
|
388
|
-
"
|
|
389
|
-
"
|
|
390
|
-
"
|
|
391
|
-
"
|
|
392
|
-
"
|
|
393
|
-
"
|
|
394
|
-
"
|
|
395
|
-
"
|
|
396
|
-
"
|
|
337
|
+
var tablerIconNames = Object.keys(tablerIconRegistry).sort(
|
|
338
|
+
(left, right) => left.localeCompare(right)
|
|
339
|
+
);
|
|
340
|
+
function resolveTablerIcon(name) {
|
|
341
|
+
const candidate = tablerIconRegistry[name];
|
|
342
|
+
if (!candidate) {
|
|
343
|
+
throw new Error(
|
|
344
|
+
`Icon could not resolve Tabler icon \`${name}\`. Import it and append it to tablerIconRegistry before using it.`
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
return candidate;
|
|
348
|
+
}
|
|
349
|
+
var legacyIconToTablerNameMap = {
|
|
350
|
+
"adjustments-horizontal-filled": "IconAdjustmentsHorizontalFilled",
|
|
351
|
+
"books": "IconBooks",
|
|
352
|
+
"organization": "IconBuildingHospital",
|
|
353
|
+
"locations": "IconMapPin",
|
|
354
|
+
"people": "IconUsers",
|
|
355
|
+
"terminologies": "IconLanguage",
|
|
356
|
+
"guidelines": "IconChecklist",
|
|
357
|
+
"logs": "IconChartBar",
|
|
358
|
+
"profile": "IconUserSearch",
|
|
359
|
+
"experience": "IconSchool",
|
|
360
|
+
"voice": "IconMicrophone",
|
|
361
|
+
"plus": "IconPlus",
|
|
362
|
+
"check": "IconCheck",
|
|
363
|
+
"caret-down": "IconChevronDown",
|
|
364
|
+
"lightbulb": "IconBulb",
|
|
365
|
+
"chats": "IconMessages",
|
|
366
|
+
"file": "IconFile",
|
|
367
|
+
"folders": "IconFolders",
|
|
368
|
+
"sparkle": "IconSparkles",
|
|
369
|
+
"x": "IconX",
|
|
370
|
+
"pencil-simple-line": "IconPencil",
|
|
371
|
+
"search": "IconSearch",
|
|
372
|
+
"arrow-up": "IconArrowUp",
|
|
373
|
+
"question": "IconHelpCircle",
|
|
374
|
+
"user-filled": "IconUserFilled",
|
|
375
|
+
"caret-up": "IconChevronUp",
|
|
376
|
+
"users-group": "IconUsersGroup"
|
|
397
377
|
};
|
|
378
|
+
var iconNames = Object.keys(legacyIconToTablerNameMap);
|
|
398
379
|
var iconRegistry = Object.fromEntries(
|
|
399
|
-
Object.entries(
|
|
400
|
-
|
|
401
|
-
|
|
380
|
+
Object.entries(legacyIconToTablerNameMap).map(([name, tablerName]) => [
|
|
381
|
+
name,
|
|
382
|
+
resolveTablerIcon(tablerName)
|
|
402
383
|
])
|
|
403
384
|
);
|
|
404
|
-
var
|
|
385
|
+
var iconNameMap = Object.fromEntries(
|
|
386
|
+
iconNames.map((name) => [name, name])
|
|
387
|
+
);
|
|
405
388
|
|
|
406
389
|
// src/components/icon.tsx
|
|
407
390
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -442,7 +425,7 @@ var iconColorOptions = [
|
|
|
442
425
|
"agent-mint",
|
|
443
426
|
"agent-green"
|
|
444
427
|
];
|
|
445
|
-
var
|
|
428
|
+
var iconSizeMap = {
|
|
446
429
|
xs: 12,
|
|
447
430
|
sm: 16,
|
|
448
431
|
md: 20,
|
|
@@ -485,7 +468,7 @@ var iconColorScale = {
|
|
|
485
468
|
"agent-green": "var(--sofya-agent-green)"
|
|
486
469
|
};
|
|
487
470
|
function resolveIconSize(size) {
|
|
488
|
-
return typeof size === "number" ? size :
|
|
471
|
+
return typeof size === "number" ? size : iconSizeMap[size];
|
|
489
472
|
}
|
|
490
473
|
function resolveIconColor(color) {
|
|
491
474
|
if (!color || color === "current") {
|
|
@@ -493,55 +476,43 @@ function resolveIconColor(color) {
|
|
|
493
476
|
}
|
|
494
477
|
return iconColorScale[color];
|
|
495
478
|
}
|
|
496
|
-
var Icon = React2.forwardRef(function Icon2({
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
}
|
|
506
|
-
const
|
|
507
|
-
const
|
|
479
|
+
var Icon = React2.forwardRef(function Icon2(incomingProps, ref) {
|
|
480
|
+
const {
|
|
481
|
+
decorative,
|
|
482
|
+
size = "md",
|
|
483
|
+
color = "current",
|
|
484
|
+
title,
|
|
485
|
+
strokeWidth = 2,
|
|
486
|
+
className,
|
|
487
|
+
style
|
|
488
|
+
} = incomingProps;
|
|
489
|
+
const IconComponent = iconRegistry[incomingProps.name];
|
|
490
|
+
const {
|
|
491
|
+
decorative: _decorative,
|
|
492
|
+
color: _color,
|
|
493
|
+
name: _name,
|
|
494
|
+
size: _size,
|
|
495
|
+
strokeWidth: _strokeWidth,
|
|
496
|
+
title: _title,
|
|
497
|
+
...props
|
|
498
|
+
} = incomingProps;
|
|
508
499
|
const dimension = resolveIconSize(size);
|
|
509
500
|
const resolvedColor = resolveIconColor(color);
|
|
510
501
|
const resolvedStyle = resolvedColor ? { ...style, color: resolvedColor } : style;
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
"svg",
|
|
502
|
+
const isDecorative = decorative ?? !title;
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
504
|
+
IconComponent,
|
|
515
505
|
{
|
|
516
506
|
ref,
|
|
517
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
518
|
-
viewBox: icon.viewBox,
|
|
519
507
|
className: cn("inline-block shrink-0 align-middle", className),
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
"aria-hidden": title ? void 0 : true,
|
|
523
|
-
"aria-labelledby": title ? titleId : void 0,
|
|
508
|
+
role: isDecorative ? void 0 : "img",
|
|
509
|
+
"aria-hidden": isDecorative ? true : void 0,
|
|
524
510
|
focusable: "false",
|
|
525
511
|
...props,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("title", { id: titleId, children: title }) : null,
|
|
531
|
-
fillPath ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: fillPath, fill: "currentColor" }) : null,
|
|
532
|
-
strokePaths?.map((path, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
533
|
-
"path",
|
|
534
|
-
{
|
|
535
|
-
d: path.d,
|
|
536
|
-
fill: "none",
|
|
537
|
-
stroke: "currentColor",
|
|
538
|
-
strokeWidth: path.strokeWidth ?? strokeWidth,
|
|
539
|
-
strokeLinecap: path.strokeLinecap ?? "round",
|
|
540
|
-
strokeLinejoin: "round"
|
|
541
|
-
},
|
|
542
|
-
`${name}-${index}`
|
|
543
|
-
))
|
|
544
|
-
]
|
|
512
|
+
size: dimension,
|
|
513
|
+
title,
|
|
514
|
+
stroke: strokeWidth,
|
|
515
|
+
style: resolvedStyle
|
|
545
516
|
}
|
|
546
517
|
);
|
|
547
518
|
});
|
|
@@ -1010,10 +981,10 @@ function Badge({ className, variant, alert, pillTone, ...props }) {
|
|
|
1010
981
|
}
|
|
1011
982
|
|
|
1012
983
|
// src/components/button.tsx
|
|
1013
|
-
var
|
|
984
|
+
var React8 = __toESM(require("react"), 1);
|
|
985
|
+
var import_icons_react2 = require("@tabler/icons-react");
|
|
1014
986
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
1015
987
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1016
|
-
var import_react = require("motion/react");
|
|
1017
988
|
|
|
1018
989
|
// src/components/button-language-flags.ts
|
|
1019
990
|
function createFlagDataUri(svg) {
|
|
@@ -1137,8 +1108,271 @@ var dropdownLanguageFlagSrc = {
|
|
|
1137
1108
|
`)
|
|
1138
1109
|
};
|
|
1139
1110
|
|
|
1140
|
-
// src/components/button.tsx
|
|
1111
|
+
// src/components/button-ripple.tsx
|
|
1112
|
+
var React6 = __toESM(require("react"), 1);
|
|
1113
|
+
var import_react = require("motion/react");
|
|
1141
1114
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1115
|
+
var MAX_ACTIVE_RIPPLES = 3;
|
|
1116
|
+
var buttonRippleVariantClasses = {
|
|
1117
|
+
default: "bg-[hsl(var(--sofya-primary-foreground)/0.82)] mix-blend-screen",
|
|
1118
|
+
gradient: "bg-[hsl(var(--sofya-primary-foreground)/0.8)] mix-blend-screen",
|
|
1119
|
+
dropdown: "bg-[hsl(var(--sofya-primary)/0.36)]",
|
|
1120
|
+
icon: "bg-[hsl(var(--sofya-primary)/0.34)]",
|
|
1121
|
+
language: "bg-[hsl(var(--sofya-background)/0.76)] mix-blend-screen",
|
|
1122
|
+
secondary: "bg-[hsl(var(--sofya-primary)/0.30)]",
|
|
1123
|
+
outline: "bg-[hsl(var(--sofya-primary)/0.32)]",
|
|
1124
|
+
ghost: "bg-[hsl(var(--sofya-primary)/0.28)]",
|
|
1125
|
+
destructive: "bg-[hsl(var(--sofya-destructive-foreground)/0.78)] mix-blend-screen"
|
|
1126
|
+
};
|
|
1127
|
+
var buttonRippleBaseSize = {
|
|
1128
|
+
default: 20,
|
|
1129
|
+
sm: 18,
|
|
1130
|
+
lg: 22,
|
|
1131
|
+
icon: 18
|
|
1132
|
+
};
|
|
1133
|
+
function useButtonRippleState({
|
|
1134
|
+
disabled,
|
|
1135
|
+
onClick,
|
|
1136
|
+
onPointerDown,
|
|
1137
|
+
size,
|
|
1138
|
+
variant
|
|
1139
|
+
}) {
|
|
1140
|
+
const prefersReducedMotion = Boolean((0, import_react.useReducedMotion)());
|
|
1141
|
+
const [ripples, setRipples] = React6.useState([]);
|
|
1142
|
+
const rippleIdRef = React6.useRef(0);
|
|
1143
|
+
const lastRippleAtRef = React6.useRef(0);
|
|
1144
|
+
const handleRippleComplete = React6.useCallback((rippleId) => {
|
|
1145
|
+
setRipples(
|
|
1146
|
+
(currentRipples) => currentRipples.filter((currentRipple) => currentRipple.id !== rippleId)
|
|
1147
|
+
);
|
|
1148
|
+
}, []);
|
|
1149
|
+
const createRipple = React6.useCallback(
|
|
1150
|
+
(currentTarget, clientX, clientY) => {
|
|
1151
|
+
const now = performance.now();
|
|
1152
|
+
if (now - lastRippleAtRef.current < 48) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
lastRippleAtRef.current = now;
|
|
1156
|
+
const rect = currentTarget.getBoundingClientRect();
|
|
1157
|
+
const hasPointerPosition = clientX !== void 0 && clientY !== void 0;
|
|
1158
|
+
const x = hasPointerPosition ? clientX - rect.left : rect.width / 2;
|
|
1159
|
+
const y = hasPointerPosition ? clientY - rect.top : rect.height / 2;
|
|
1160
|
+
const radius = Math.max(
|
|
1161
|
+
Math.hypot(x, y),
|
|
1162
|
+
Math.hypot(rect.width - x, y),
|
|
1163
|
+
Math.hypot(x, rect.height - y),
|
|
1164
|
+
Math.hypot(rect.width - x, rect.height - y)
|
|
1165
|
+
);
|
|
1166
|
+
const baseSize = buttonRippleBaseSize[size];
|
|
1167
|
+
const finalDiameter = Math.max(
|
|
1168
|
+
radius * 2 + 24,
|
|
1169
|
+
Math.max(rect.width, rect.height) + 18
|
|
1170
|
+
);
|
|
1171
|
+
setRipples((currentRipples) => {
|
|
1172
|
+
const nextRipple = {
|
|
1173
|
+
id: rippleIdRef.current++,
|
|
1174
|
+
scale: finalDiameter / baseSize,
|
|
1175
|
+
size: baseSize,
|
|
1176
|
+
x: x - baseSize / 2,
|
|
1177
|
+
y: y - baseSize / 2
|
|
1178
|
+
};
|
|
1179
|
+
const nextRipples = [...currentRipples, nextRipple];
|
|
1180
|
+
if (nextRipples.length > MAX_ACTIVE_RIPPLES) {
|
|
1181
|
+
return nextRipples.slice(nextRipples.length - MAX_ACTIVE_RIPPLES);
|
|
1182
|
+
}
|
|
1183
|
+
return nextRipples;
|
|
1184
|
+
});
|
|
1185
|
+
},
|
|
1186
|
+
[size]
|
|
1187
|
+
);
|
|
1188
|
+
const handlePointerDown = React6.useCallback(
|
|
1189
|
+
(event) => {
|
|
1190
|
+
onPointerDown?.(event);
|
|
1191
|
+
if (event.defaultPrevented || disabled) {
|
|
1192
|
+
return;
|
|
1193
|
+
}
|
|
1194
|
+
if (prefersReducedMotion) {
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
if (event.button === 0) {
|
|
1198
|
+
createRipple(
|
|
1199
|
+
event.currentTarget,
|
|
1200
|
+
event.clientX,
|
|
1201
|
+
event.clientY
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
[createRipple, disabled, onPointerDown, prefersReducedMotion]
|
|
1206
|
+
);
|
|
1207
|
+
const handleClick = React6.useCallback(
|
|
1208
|
+
(event) => {
|
|
1209
|
+
if (!disabled && !prefersReducedMotion && event.detail === 0) {
|
|
1210
|
+
createRipple(event.currentTarget);
|
|
1211
|
+
}
|
|
1212
|
+
onClick?.(event);
|
|
1213
|
+
},
|
|
1214
|
+
[createRipple, disabled, onClick, prefersReducedMotion]
|
|
1215
|
+
);
|
|
1216
|
+
return {
|
|
1217
|
+
handleClick,
|
|
1218
|
+
handlePointerDown,
|
|
1219
|
+
handleRippleComplete,
|
|
1220
|
+
prefersReducedMotion,
|
|
1221
|
+
rippleClassName: buttonRippleVariantClasses[variant],
|
|
1222
|
+
ripples
|
|
1223
|
+
};
|
|
1224
|
+
}
|
|
1225
|
+
function ButtonRippleLayer({
|
|
1226
|
+
onAnimationComplete,
|
|
1227
|
+
prefersReducedMotion,
|
|
1228
|
+
rippleClassName,
|
|
1229
|
+
ripples
|
|
1230
|
+
}) {
|
|
1231
|
+
if (ripples.length === 0) {
|
|
1232
|
+
return null;
|
|
1233
|
+
}
|
|
1234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1235
|
+
"span",
|
|
1236
|
+
{
|
|
1237
|
+
"aria-hidden": "true",
|
|
1238
|
+
className: "pointer-events-none absolute inset-0 z-[1] overflow-hidden rounded-[inherit]",
|
|
1239
|
+
children: ripples.map((ripple) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1240
|
+
import_react.motion.span,
|
|
1241
|
+
{
|
|
1242
|
+
className: cn(
|
|
1243
|
+
"absolute rounded-full will-change-transform transform-gpu",
|
|
1244
|
+
rippleClassName
|
|
1245
|
+
),
|
|
1246
|
+
initial: prefersReducedMotion ? { opacity: 0.32, scale: 0.72 } : { opacity: 0.56, scale: 0 },
|
|
1247
|
+
animate: prefersReducedMotion ? { opacity: 0, scale: 1.02 } : { opacity: [0.56, 0.26, 0], scale: ripple.scale },
|
|
1248
|
+
transition: prefersReducedMotion ? { duration: 0.2, ease: "linear" } : {
|
|
1249
|
+
duration: 0.62,
|
|
1250
|
+
times: [0, 0.35, 1],
|
|
1251
|
+
ease: [0.16, 1, 0.3, 1]
|
|
1252
|
+
},
|
|
1253
|
+
style: {
|
|
1254
|
+
height: ripple.size,
|
|
1255
|
+
left: ripple.x,
|
|
1256
|
+
top: ripple.y,
|
|
1257
|
+
transformOrigin: "center center",
|
|
1258
|
+
width: ripple.size
|
|
1259
|
+
},
|
|
1260
|
+
onAnimationComplete: () => {
|
|
1261
|
+
onAnimationComplete(ripple.id);
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
ripple.id
|
|
1265
|
+
))
|
|
1266
|
+
}
|
|
1267
|
+
);
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// src/components/button-loading-state.ts
|
|
1271
|
+
var React7 = __toESM(require("react"), 1);
|
|
1272
|
+
var BUTTON_SEQUENCE_MS = 250;
|
|
1273
|
+
function useButtonLoadingState({
|
|
1274
|
+
buttonRef,
|
|
1275
|
+
children,
|
|
1276
|
+
leftIcon,
|
|
1277
|
+
loading,
|
|
1278
|
+
rightIcon
|
|
1279
|
+
}) {
|
|
1280
|
+
const expandedWidthRef = React7.useRef(void 0);
|
|
1281
|
+
const previousLoadingRef = React7.useRef(loading);
|
|
1282
|
+
const timeoutsRef = React7.useRef([]);
|
|
1283
|
+
const frameRef = React7.useRef(null);
|
|
1284
|
+
const [animatedWidth, setAnimatedWidth] = React7.useState(void 0);
|
|
1285
|
+
const [loadingPhase, setLoadingPhase] = React7.useState(
|
|
1286
|
+
loading ? "loading" : "idle"
|
|
1287
|
+
);
|
|
1288
|
+
const clearAnimationTimers = React7.useCallback(() => {
|
|
1289
|
+
for (const timeoutId of timeoutsRef.current) {
|
|
1290
|
+
window.clearTimeout(timeoutId);
|
|
1291
|
+
}
|
|
1292
|
+
timeoutsRef.current = [];
|
|
1293
|
+
if (frameRef.current !== null) {
|
|
1294
|
+
window.cancelAnimationFrame(frameRef.current);
|
|
1295
|
+
frameRef.current = null;
|
|
1296
|
+
}
|
|
1297
|
+
}, []);
|
|
1298
|
+
React7.useLayoutEffect(() => {
|
|
1299
|
+
const element = buttonRef.current;
|
|
1300
|
+
if (element && loadingPhase === "idle" && !loading) {
|
|
1301
|
+
expandedWidthRef.current = element.offsetWidth;
|
|
1302
|
+
}
|
|
1303
|
+
if (element && loadingPhase === "loading" && animatedWidth === void 0) {
|
|
1304
|
+
setAnimatedWidth(element.offsetHeight);
|
|
1305
|
+
}
|
|
1306
|
+
}, [animatedWidth, buttonRef, loading, loadingPhase, children, leftIcon, rightIcon]);
|
|
1307
|
+
React7.useEffect(() => {
|
|
1308
|
+
return () => {
|
|
1309
|
+
clearAnimationTimers();
|
|
1310
|
+
};
|
|
1311
|
+
}, [clearAnimationTimers]);
|
|
1312
|
+
React7.useEffect(() => {
|
|
1313
|
+
const element = buttonRef.current;
|
|
1314
|
+
if (!element) {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
const previousLoading = previousLoadingRef.current;
|
|
1318
|
+
previousLoadingRef.current = loading;
|
|
1319
|
+
if (previousLoading === loading) {
|
|
1320
|
+
return;
|
|
1321
|
+
}
|
|
1322
|
+
clearAnimationTimers();
|
|
1323
|
+
if (loading) {
|
|
1324
|
+
const currentWidth2 = element.offsetWidth;
|
|
1325
|
+
const collapsedWidth = element.offsetHeight;
|
|
1326
|
+
expandedWidthRef.current = currentWidth2;
|
|
1327
|
+
setAnimatedWidth(currentWidth2);
|
|
1328
|
+
setLoadingPhase("hiding-content");
|
|
1329
|
+
timeoutsRef.current.push(
|
|
1330
|
+
window.setTimeout(() => {
|
|
1331
|
+
setLoadingPhase("collapsing");
|
|
1332
|
+
setAnimatedWidth(collapsedWidth);
|
|
1333
|
+
}, BUTTON_SEQUENCE_MS)
|
|
1334
|
+
);
|
|
1335
|
+
timeoutsRef.current.push(
|
|
1336
|
+
window.setTimeout(() => {
|
|
1337
|
+
setLoadingPhase("loading");
|
|
1338
|
+
}, BUTTON_SEQUENCE_MS * 2)
|
|
1339
|
+
);
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
const currentWidth = element.offsetWidth;
|
|
1343
|
+
const expandedWidth = expandedWidthRef.current ?? Math.max(element.scrollWidth, currentWidth);
|
|
1344
|
+
setAnimatedWidth(currentWidth);
|
|
1345
|
+
setLoadingPhase("hiding-spinner");
|
|
1346
|
+
timeoutsRef.current.push(
|
|
1347
|
+
window.setTimeout(() => {
|
|
1348
|
+
setLoadingPhase("expanding");
|
|
1349
|
+
frameRef.current = window.requestAnimationFrame(() => {
|
|
1350
|
+
frameRef.current = window.requestAnimationFrame(() => {
|
|
1351
|
+
setAnimatedWidth(expandedWidth);
|
|
1352
|
+
});
|
|
1353
|
+
});
|
|
1354
|
+
}, BUTTON_SEQUENCE_MS)
|
|
1355
|
+
);
|
|
1356
|
+
timeoutsRef.current.push(
|
|
1357
|
+
window.setTimeout(() => {
|
|
1358
|
+
setLoadingPhase("revealing-content");
|
|
1359
|
+
}, BUTTON_SEQUENCE_MS * 2)
|
|
1360
|
+
);
|
|
1361
|
+
timeoutsRef.current.push(
|
|
1362
|
+
window.setTimeout(() => {
|
|
1363
|
+
setLoadingPhase("idle");
|
|
1364
|
+
setAnimatedWidth(void 0);
|
|
1365
|
+
}, BUTTON_SEQUENCE_MS * 3)
|
|
1366
|
+
);
|
|
1367
|
+
}, [buttonRef, clearAnimationTimers, loading]);
|
|
1368
|
+
return {
|
|
1369
|
+
animatedWidth,
|
|
1370
|
+
loadingPhase
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
// src/components/button.tsx
|
|
1375
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1142
1376
|
var buttonVariantOptions = [
|
|
1143
1377
|
"default",
|
|
1144
1378
|
"gradient",
|
|
@@ -1151,17 +1385,6 @@ var buttonVariantOptions = [
|
|
|
1151
1385
|
"destructive"
|
|
1152
1386
|
];
|
|
1153
1387
|
var buttonSizeOptions = ["default", "sm", "lg", "icon"];
|
|
1154
|
-
var buttonRippleVariantClasses = {
|
|
1155
|
-
default: "bg-[hsl(var(--sofya-primary-foreground)/0.82)] mix-blend-screen",
|
|
1156
|
-
gradient: "bg-[hsl(var(--sofya-primary-foreground)/0.8)] mix-blend-screen",
|
|
1157
|
-
dropdown: "bg-[hsl(var(--sofya-primary)/0.36)]",
|
|
1158
|
-
icon: "bg-[hsl(var(--sofya-primary)/0.34)]",
|
|
1159
|
-
language: "bg-[hsl(var(--sofya-background)/0.76)] mix-blend-screen",
|
|
1160
|
-
secondary: "bg-[hsl(var(--sofya-primary)/0.30)]",
|
|
1161
|
-
outline: "bg-[hsl(var(--sofya-primary)/0.32)]",
|
|
1162
|
-
ghost: "bg-[hsl(var(--sofya-primary)/0.28)]",
|
|
1163
|
-
destructive: "bg-[hsl(var(--sofya-destructive-foreground)/0.78)] mix-blend-screen"
|
|
1164
|
-
};
|
|
1165
1388
|
var buttonVariants = (0, import_class_variance_authority4.cva)(
|
|
1166
1389
|
"relative isolate inline-flex items-center justify-center gap-2 overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[0.025em] transform-gpu transition-[width,transform,filter,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
1167
1390
|
{
|
|
@@ -1190,7 +1413,6 @@ var buttonVariants = (0, import_class_variance_authority4.cva)(
|
|
|
1190
1413
|
}
|
|
1191
1414
|
}
|
|
1192
1415
|
);
|
|
1193
|
-
var BUTTON_SEQUENCE_MS = 250;
|
|
1194
1416
|
var loadingSpinnerSizeClasses = {
|
|
1195
1417
|
default: "h-4 w-4",
|
|
1196
1418
|
sm: "h-3.5 w-3.5",
|
|
@@ -1203,52 +1425,21 @@ var languageButtonSizeClasses = {
|
|
|
1203
1425
|
lg: "h-12 w-12 rounded-full p-0",
|
|
1204
1426
|
icon: "h-11 w-11 rounded-full p-0"
|
|
1205
1427
|
};
|
|
1206
|
-
var buttonRippleBaseSize = {
|
|
1207
|
-
default: 20,
|
|
1208
|
-
sm: 18,
|
|
1209
|
-
lg: 22,
|
|
1210
|
-
icon: 18
|
|
1211
|
-
};
|
|
1212
1428
|
function ButtonSpinner({
|
|
1213
1429
|
size
|
|
1214
1430
|
}) {
|
|
1215
|
-
return /* @__PURE__ */ (0,
|
|
1216
|
-
|
|
1431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1432
|
+
import_icons_react2.IconLoader2,
|
|
1217
1433
|
{
|
|
1218
1434
|
"aria-hidden": "true",
|
|
1219
1435
|
className: cn(
|
|
1220
1436
|
"animate-spin text-current",
|
|
1221
1437
|
loadingSpinnerSizeClasses[size]
|
|
1222
|
-
)
|
|
1223
|
-
viewBox: "0 0 24 24",
|
|
1224
|
-
fill: "none",
|
|
1225
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1226
|
-
children: [
|
|
1227
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1228
|
-
"circle",
|
|
1229
|
-
{
|
|
1230
|
-
cx: "12",
|
|
1231
|
-
cy: "12",
|
|
1232
|
-
r: "9",
|
|
1233
|
-
className: "opacity-20",
|
|
1234
|
-
stroke: "currentColor",
|
|
1235
|
-
strokeWidth: "3"
|
|
1236
|
-
}
|
|
1237
|
-
),
|
|
1238
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1239
|
-
"path",
|
|
1240
|
-
{
|
|
1241
|
-
d: "M21 12A9 9 0 0 0 12 3",
|
|
1242
|
-
stroke: "currentColor",
|
|
1243
|
-
strokeWidth: "3",
|
|
1244
|
-
strokeLinecap: "round"
|
|
1245
|
-
}
|
|
1246
|
-
)
|
|
1247
|
-
]
|
|
1438
|
+
)
|
|
1248
1439
|
}
|
|
1249
1440
|
);
|
|
1250
1441
|
}
|
|
1251
|
-
var Button =
|
|
1442
|
+
var Button = React8.forwardRef(
|
|
1252
1443
|
({
|
|
1253
1444
|
active = false,
|
|
1254
1445
|
disabled,
|
|
@@ -1267,20 +1458,9 @@ var Button = React6.forwardRef(
|
|
|
1267
1458
|
style,
|
|
1268
1459
|
...props
|
|
1269
1460
|
}, ref) => {
|
|
1270
|
-
const buttonRef =
|
|
1271
|
-
const expandedWidthRef = React6.useRef(void 0);
|
|
1272
|
-
const previousLoadingRef = React6.useRef(loading);
|
|
1273
|
-
const timeoutsRef = React6.useRef([]);
|
|
1274
|
-
const frameRef = React6.useRef(null);
|
|
1275
|
-
const [animatedWidth, setAnimatedWidth] = React6.useState(void 0);
|
|
1276
|
-
const [loadingPhase, setLoadingPhase] = React6.useState(
|
|
1277
|
-
loading ? "loading" : "idle"
|
|
1278
|
-
);
|
|
1279
|
-
const [ripples, setRipples] = React6.useState([]);
|
|
1280
|
-
const rippleIdRef = React6.useRef(0);
|
|
1461
|
+
const buttonRef = React8.useRef(null);
|
|
1281
1462
|
const Component = asChild ? import_react_slot.Slot : "button";
|
|
1282
|
-
const
|
|
1283
|
-
const hasChildren = React6.Children.count(children) > 0;
|
|
1463
|
+
const hasChildren = React8.Children.count(children) > 0;
|
|
1284
1464
|
const isIconOnly = !hasChildren && Boolean(leftIcon || rightIcon);
|
|
1285
1465
|
const isIconOnlyAction = variant === "icon" && isIconOnly;
|
|
1286
1466
|
const resolvedSize = size ?? (isIconOnly ? "icon" : "default");
|
|
@@ -1291,6 +1471,13 @@ var Button = React6.forwardRef(
|
|
|
1291
1471
|
const resolvedLanguageLabel = resolvedLanguageLocale ? buttonLanguageLabels[resolvedLanguageLocale] : void 0;
|
|
1292
1472
|
const iconSlotClassName = "inline-flex shrink-0 items-center justify-center [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0";
|
|
1293
1473
|
const iconOnlyNode = leftIcon ?? rightIcon;
|
|
1474
|
+
const { animatedWidth, loadingPhase } = useButtonLoadingState({
|
|
1475
|
+
buttonRef,
|
|
1476
|
+
children,
|
|
1477
|
+
leftIcon,
|
|
1478
|
+
loading,
|
|
1479
|
+
rightIcon
|
|
1480
|
+
});
|
|
1294
1481
|
const isDisabled = disabled || loadingPhase !== "idle";
|
|
1295
1482
|
const resolvedWidthStyle = animatedWidth === void 0 ? style?.width : `${animatedWidth}px`;
|
|
1296
1483
|
const isCompactPhase = loadingPhase === "collapsing" || loadingPhase === "loading" || loadingPhase === "hiding-spinner";
|
|
@@ -1313,153 +1500,26 @@ var Button = React6.forwardRef(
|
|
|
1313
1500
|
backgroundSize: "cover"
|
|
1314
1501
|
} : void 0
|
|
1315
1502
|
};
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
Math.hypot(x, rect.height - y),
|
|
1332
|
-
Math.hypot(rect.width - x, rect.height - y)
|
|
1333
|
-
);
|
|
1334
|
-
const baseSize = buttonRippleBaseSize[resolvedSize];
|
|
1335
|
-
const finalDiameter = Math.max(
|
|
1336
|
-
radius * 2 + 24,
|
|
1337
|
-
Math.max(rect.width, rect.height) + 18
|
|
1338
|
-
);
|
|
1339
|
-
setRipples((currentRipples) => [
|
|
1340
|
-
...currentRipples,
|
|
1341
|
-
{
|
|
1342
|
-
id: rippleIdRef.current++,
|
|
1343
|
-
scale: finalDiameter / baseSize,
|
|
1344
|
-
size: baseSize,
|
|
1345
|
-
x: x - baseSize / 2,
|
|
1346
|
-
y: y - baseSize / 2
|
|
1347
|
-
}
|
|
1348
|
-
]);
|
|
1349
|
-
},
|
|
1350
|
-
[resolvedSize]
|
|
1351
|
-
);
|
|
1352
|
-
const handlePointerDown = React6.useCallback(
|
|
1353
|
-
(event) => {
|
|
1354
|
-
onPointerDown?.(event);
|
|
1355
|
-
if (event.defaultPrevented || isDisabled) {
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
if (event.button === 0) {
|
|
1359
|
-
createRipple(
|
|
1360
|
-
event.currentTarget,
|
|
1361
|
-
event.clientX,
|
|
1362
|
-
event.clientY
|
|
1363
|
-
);
|
|
1364
|
-
}
|
|
1365
|
-
},
|
|
1366
|
-
[createRipple, isDisabled, onPointerDown]
|
|
1367
|
-
);
|
|
1368
|
-
const handleClick = React6.useCallback(
|
|
1369
|
-
(event) => {
|
|
1370
|
-
if (!isDisabled && event.detail === 0) {
|
|
1371
|
-
createRipple(event.currentTarget);
|
|
1372
|
-
}
|
|
1373
|
-
onClick?.(event);
|
|
1374
|
-
},
|
|
1375
|
-
[createRipple, isDisabled, onClick]
|
|
1376
|
-
);
|
|
1377
|
-
const clearAnimationTimers = React6.useCallback(() => {
|
|
1378
|
-
for (const timeoutId of timeoutsRef.current) {
|
|
1379
|
-
window.clearTimeout(timeoutId);
|
|
1380
|
-
}
|
|
1381
|
-
timeoutsRef.current = [];
|
|
1382
|
-
if (frameRef.current !== null) {
|
|
1383
|
-
window.cancelAnimationFrame(frameRef.current);
|
|
1384
|
-
frameRef.current = null;
|
|
1385
|
-
}
|
|
1386
|
-
}, []);
|
|
1387
|
-
React6.useImperativeHandle(
|
|
1503
|
+
const {
|
|
1504
|
+
handleClick,
|
|
1505
|
+
handlePointerDown,
|
|
1506
|
+
handleRippleComplete,
|
|
1507
|
+
prefersReducedMotion,
|
|
1508
|
+
rippleClassName,
|
|
1509
|
+
ripples
|
|
1510
|
+
} = useButtonRippleState({
|
|
1511
|
+
disabled: isDisabled,
|
|
1512
|
+
onClick,
|
|
1513
|
+
onPointerDown,
|
|
1514
|
+
size: resolvedSize,
|
|
1515
|
+
variant: resolvedVariant
|
|
1516
|
+
});
|
|
1517
|
+
React8.useImperativeHandle(
|
|
1388
1518
|
ref,
|
|
1389
1519
|
() => buttonRef.current
|
|
1390
1520
|
);
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
if (element && loadingPhase === "idle" && !loading) {
|
|
1394
|
-
expandedWidthRef.current = element.offsetWidth;
|
|
1395
|
-
}
|
|
1396
|
-
if (element && loadingPhase === "loading" && animatedWidth === void 0) {
|
|
1397
|
-
setAnimatedWidth(element.offsetHeight);
|
|
1398
|
-
}
|
|
1399
|
-
}, [animatedWidth, loading, loadingPhase, children, leftIcon, rightIcon]);
|
|
1400
|
-
React6.useEffect(() => {
|
|
1401
|
-
return () => {
|
|
1402
|
-
clearAnimationTimers();
|
|
1403
|
-
};
|
|
1404
|
-
}, [clearAnimationTimers]);
|
|
1405
|
-
React6.useEffect(() => {
|
|
1406
|
-
const element = buttonRef.current;
|
|
1407
|
-
if (!element) {
|
|
1408
|
-
return;
|
|
1409
|
-
}
|
|
1410
|
-
const previousLoading = previousLoadingRef.current;
|
|
1411
|
-
previousLoadingRef.current = loading;
|
|
1412
|
-
if (previousLoading === loading) {
|
|
1413
|
-
return;
|
|
1414
|
-
}
|
|
1415
|
-
clearAnimationTimers();
|
|
1416
|
-
if (loading) {
|
|
1417
|
-
const currentWidth2 = element.offsetWidth;
|
|
1418
|
-
const collapsedWidth = element.offsetHeight;
|
|
1419
|
-
expandedWidthRef.current = currentWidth2;
|
|
1420
|
-
setAnimatedWidth(currentWidth2);
|
|
1421
|
-
setLoadingPhase("hiding-content");
|
|
1422
|
-
timeoutsRef.current.push(
|
|
1423
|
-
window.setTimeout(() => {
|
|
1424
|
-
setLoadingPhase("collapsing");
|
|
1425
|
-
setAnimatedWidth(collapsedWidth);
|
|
1426
|
-
}, BUTTON_SEQUENCE_MS)
|
|
1427
|
-
);
|
|
1428
|
-
timeoutsRef.current.push(
|
|
1429
|
-
window.setTimeout(() => {
|
|
1430
|
-
setLoadingPhase("loading");
|
|
1431
|
-
}, BUTTON_SEQUENCE_MS * 2)
|
|
1432
|
-
);
|
|
1433
|
-
return;
|
|
1434
|
-
}
|
|
1435
|
-
const currentWidth = element.offsetWidth;
|
|
1436
|
-
const expandedWidth = expandedWidthRef.current ?? Math.max(element.scrollWidth, currentWidth);
|
|
1437
|
-
setAnimatedWidth(currentWidth);
|
|
1438
|
-
setLoadingPhase("hiding-spinner");
|
|
1439
|
-
timeoutsRef.current.push(
|
|
1440
|
-
window.setTimeout(() => {
|
|
1441
|
-
setLoadingPhase("expanding");
|
|
1442
|
-
frameRef.current = window.requestAnimationFrame(() => {
|
|
1443
|
-
frameRef.current = window.requestAnimationFrame(() => {
|
|
1444
|
-
setAnimatedWidth(expandedWidth);
|
|
1445
|
-
});
|
|
1446
|
-
});
|
|
1447
|
-
}, BUTTON_SEQUENCE_MS)
|
|
1448
|
-
);
|
|
1449
|
-
timeoutsRef.current.push(
|
|
1450
|
-
window.setTimeout(() => {
|
|
1451
|
-
setLoadingPhase("revealing-content");
|
|
1452
|
-
}, BUTTON_SEQUENCE_MS * 2)
|
|
1453
|
-
);
|
|
1454
|
-
timeoutsRef.current.push(
|
|
1455
|
-
window.setTimeout(() => {
|
|
1456
|
-
setLoadingPhase("idle");
|
|
1457
|
-
setAnimatedWidth(void 0);
|
|
1458
|
-
}, BUTTON_SEQUENCE_MS * 3)
|
|
1459
|
-
);
|
|
1460
|
-
}, [children, clearAnimationTimers, leftIcon, loading, rightIcon]);
|
|
1461
|
-
const buttonContent = isLanguageButton ? null : isIconOnly ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: iconSlotClassName, children: iconOnlyNode }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1462
|
-
leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: iconSlotClassName, children: leftIcon }) : null,
|
|
1521
|
+
const buttonContent = isLanguageButton ? null : isIconOnly ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: iconSlotClassName, children: iconOnlyNode }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1522
|
+
leftIcon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: iconSlotClassName, children: leftIcon }) : null,
|
|
1463
1523
|
hasChildren ? renderTextContent(children, {
|
|
1464
1524
|
as: "span",
|
|
1465
1525
|
className: "inline-flex items-center text-current",
|
|
@@ -1469,9 +1529,9 @@ var Button = React6.forwardRef(
|
|
|
1469
1529
|
letterSpacing: "inherit"
|
|
1470
1530
|
}
|
|
1471
1531
|
}) : null,
|
|
1472
|
-
rightIcon ? /* @__PURE__ */ (0,
|
|
1532
|
+
rightIcon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: iconSlotClassName, children: rightIcon }) : null
|
|
1473
1533
|
] });
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1475
1535
|
Component,
|
|
1476
1536
|
{
|
|
1477
1537
|
className: cn(
|
|
@@ -1492,41 +1552,16 @@ var Button = React6.forwardRef(
|
|
|
1492
1552
|
style: { ...resolvedButtonStyle, width: resolvedWidthStyle },
|
|
1493
1553
|
...props,
|
|
1494
1554
|
children: [
|
|
1495
|
-
/* @__PURE__ */ (0,
|
|
1496
|
-
|
|
1555
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1556
|
+
ButtonRippleLayer,
|
|
1497
1557
|
{
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
{
|
|
1503
|
-
className: cn(
|
|
1504
|
-
"absolute rounded-full will-change-transform transform-gpu",
|
|
1505
|
-
resolvedRippleClassName
|
|
1506
|
-
),
|
|
1507
|
-
initial: prefersReducedMotion ? { opacity: 0.32, scale: 0.72 } : { opacity: 0.56, scale: 0 },
|
|
1508
|
-
animate: prefersReducedMotion ? { opacity: 0, scale: 1.02 } : { opacity: [0.56, 0.26, 0], scale: ripple.scale },
|
|
1509
|
-
transition: prefersReducedMotion ? { duration: 0.2, ease: "linear" } : {
|
|
1510
|
-
duration: 0.62,
|
|
1511
|
-
times: [0, 0.35, 1],
|
|
1512
|
-
ease: [0.16, 1, 0.3, 1]
|
|
1513
|
-
},
|
|
1514
|
-
style: {
|
|
1515
|
-
height: ripple.size,
|
|
1516
|
-
left: ripple.x,
|
|
1517
|
-
top: ripple.y,
|
|
1518
|
-
transformOrigin: "center center",
|
|
1519
|
-
width: ripple.size
|
|
1520
|
-
},
|
|
1521
|
-
onAnimationComplete: () => {
|
|
1522
|
-
handleRippleComplete(ripple.id);
|
|
1523
|
-
}
|
|
1524
|
-
},
|
|
1525
|
-
ripple.id
|
|
1526
|
-
))
|
|
1558
|
+
onAnimationComplete: handleRippleComplete,
|
|
1559
|
+
prefersReducedMotion,
|
|
1560
|
+
rippleClassName,
|
|
1561
|
+
ripples
|
|
1527
1562
|
}
|
|
1528
1563
|
),
|
|
1529
|
-
/* @__PURE__ */ (0,
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1530
1565
|
"span",
|
|
1531
1566
|
{
|
|
1532
1567
|
className: cn(
|
|
@@ -1536,7 +1571,7 @@ var Button = React6.forwardRef(
|
|
|
1536
1571
|
children: buttonContent
|
|
1537
1572
|
}
|
|
1538
1573
|
),
|
|
1539
|
-
/* @__PURE__ */ (0,
|
|
1574
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1540
1575
|
"span",
|
|
1541
1576
|
{
|
|
1542
1577
|
"aria-hidden": "true",
|
|
@@ -1544,7 +1579,7 @@ var Button = React6.forwardRef(
|
|
|
1544
1579
|
"pointer-events-none absolute inset-0 z-[2] flex items-center justify-center transition-opacity duration-sofya ease-sofya",
|
|
1545
1580
|
showSpinner ? "opacity-100" : "opacity-0"
|
|
1546
1581
|
),
|
|
1547
|
-
children: /* @__PURE__ */ (0,
|
|
1582
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ButtonSpinner, { size: resolvedSize })
|
|
1548
1583
|
}
|
|
1549
1584
|
)
|
|
1550
1585
|
]
|
|
@@ -1555,9 +1590,9 @@ var Button = React6.forwardRef(
|
|
|
1555
1590
|
Button.displayName = "Button";
|
|
1556
1591
|
|
|
1557
1592
|
// src/components/surface.tsx
|
|
1558
|
-
var
|
|
1593
|
+
var React9 = __toESM(require("react"), 1);
|
|
1559
1594
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
1560
|
-
var
|
|
1595
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1561
1596
|
var surfaceStyles = {
|
|
1562
1597
|
card: {
|
|
1563
1598
|
backgroundColor: "hsl(var(--sofya-surface-card-background))",
|
|
@@ -1589,7 +1624,7 @@ var surfaceStyles = {
|
|
|
1589
1624
|
};
|
|
1590
1625
|
function SurfaceComponent({ as, asChild = false, variant = "card", className, style, ...props }, ref) {
|
|
1591
1626
|
const Component = asChild ? import_react_slot2.Slot : as ?? "div";
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1593
1628
|
Component,
|
|
1594
1629
|
{
|
|
1595
1630
|
ref,
|
|
@@ -1600,16 +1635,16 @@ function SurfaceComponent({ as, asChild = false, variant = "card", className, st
|
|
|
1600
1635
|
}
|
|
1601
1636
|
);
|
|
1602
1637
|
}
|
|
1603
|
-
var SurfaceBase =
|
|
1638
|
+
var SurfaceBase = React9.forwardRef(SurfaceComponent);
|
|
1604
1639
|
SurfaceBase.displayName = "Surface";
|
|
1605
1640
|
var Surface = SurfaceBase;
|
|
1606
1641
|
|
|
1607
1642
|
// src/components/card.tsx
|
|
1608
|
-
var
|
|
1643
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1609
1644
|
var cardVariants = ["card", "panel", "focus"];
|
|
1610
1645
|
function Card({ className, variant = "card", ...props }) {
|
|
1611
1646
|
const hasHoverShadow = variant === "card" || variant === "panel";
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
1647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1613
1648
|
Surface,
|
|
1614
1649
|
{
|
|
1615
1650
|
variant,
|
|
@@ -1623,10 +1658,10 @@ function Card({ className, variant = "card", ...props }) {
|
|
|
1623
1658
|
);
|
|
1624
1659
|
}
|
|
1625
1660
|
function CardHeader({ className, ...props }) {
|
|
1626
|
-
return /* @__PURE__ */ (0,
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("flex flex-col gap-2 p-6", className), ...props });
|
|
1627
1662
|
}
|
|
1628
1663
|
function CardTitle({ children, className, ...props }) {
|
|
1629
|
-
return /* @__PURE__ */ (0,
|
|
1664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1630
1665
|
"h3",
|
|
1631
1666
|
{
|
|
1632
1667
|
className: cn("text-card-foreground", className),
|
|
@@ -1644,27 +1679,49 @@ function CardDescription({
|
|
|
1644
1679
|
className,
|
|
1645
1680
|
...props
|
|
1646
1681
|
}) {
|
|
1647
|
-
return /* @__PURE__ */ (0,
|
|
1682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: cn("text-muted-foreground", className), ...props, children: renderTextContent(children, {
|
|
1648
1683
|
as: "span",
|
|
1649
1684
|
className: "block text-muted-foreground",
|
|
1650
1685
|
size: "body"
|
|
1651
1686
|
}) });
|
|
1652
1687
|
}
|
|
1653
1688
|
function CardContent({ children, className, ...props }) {
|
|
1654
|
-
return /* @__PURE__ */ (0,
|
|
1689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("p-6 pt-0", className), ...props, children: renderTextContent(children, {
|
|
1655
1690
|
as: "span"
|
|
1656
1691
|
}) });
|
|
1657
1692
|
}
|
|
1658
1693
|
function CardFooter({ children, className, ...props }) {
|
|
1659
|
-
return /* @__PURE__ */ (0,
|
|
1694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: cn("flex items-center gap-4 p-6 pt-0", className), ...props, children: renderTextContent(children, {
|
|
1660
1695
|
as: "span"
|
|
1661
1696
|
}) });
|
|
1662
1697
|
}
|
|
1663
1698
|
|
|
1664
1699
|
// src/components/checkbox.tsx
|
|
1665
|
-
var
|
|
1666
|
-
var
|
|
1667
|
-
|
|
1700
|
+
var React10 = __toESM(require("react"), 1);
|
|
1701
|
+
var import_icons_react3 = require("@tabler/icons-react");
|
|
1702
|
+
|
|
1703
|
+
// src/lib/selection-control-classes.ts
|
|
1704
|
+
var selectionControlContainerBaseClasses = "flex w-fit gap-4";
|
|
1705
|
+
var selectionControlContentBaseClasses = "grid gap-2";
|
|
1706
|
+
var selectionControlLabelTextBaseClasses = "text-[color:var(--sofya-text-default)] [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-[3px]";
|
|
1707
|
+
var selectionControlDescriptionTextBaseClasses = "text-muted-foreground";
|
|
1708
|
+
var selectionControlControlBaseClasses = "border border-[color:var(--sofya-border-strong)] bg-card transition-[background-color,border-color,box-shadow,color] duration-sofya ease-sofya disabled:cursor-not-allowed disabled:opacity-50";
|
|
1709
|
+
function selectionControlContainerClasses({
|
|
1710
|
+
alignClassName,
|
|
1711
|
+
className,
|
|
1712
|
+
disabled
|
|
1713
|
+
}) {
|
|
1714
|
+
return cn(
|
|
1715
|
+
selectionControlContainerBaseClasses,
|
|
1716
|
+
alignClassName,
|
|
1717
|
+
disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer",
|
|
1718
|
+
className
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
// src/components/checkbox.tsx
|
|
1723
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1724
|
+
var Checkbox = React10.forwardRef(
|
|
1668
1725
|
function Checkbox2({
|
|
1669
1726
|
checked,
|
|
1670
1727
|
className,
|
|
@@ -1677,23 +1734,21 @@ var Checkbox = React8.forwardRef(
|
|
|
1677
1734
|
labelClassName,
|
|
1678
1735
|
...props
|
|
1679
1736
|
}, ref) {
|
|
1680
|
-
const generatedId =
|
|
1737
|
+
const generatedId = React10.useId();
|
|
1681
1738
|
const resolvedId = id ?? generatedId;
|
|
1682
1739
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
1683
1740
|
const alignClassName = description ? "items-start" : "items-center";
|
|
1684
|
-
|
|
1685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1686
1742
|
"label",
|
|
1687
1743
|
{
|
|
1688
1744
|
htmlFor: resolvedId,
|
|
1689
|
-
className:
|
|
1690
|
-
"flex w-fit gap-4",
|
|
1745
|
+
className: selectionControlContainerClasses({
|
|
1691
1746
|
alignClassName,
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
),
|
|
1747
|
+
className,
|
|
1748
|
+
disabled
|
|
1749
|
+
}),
|
|
1695
1750
|
children: [
|
|
1696
|
-
/* @__PURE__ */ (0,
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1697
1752
|
"input",
|
|
1698
1753
|
{
|
|
1699
1754
|
ref,
|
|
@@ -1707,41 +1762,24 @@ var Checkbox = React8.forwardRef(
|
|
|
1707
1762
|
...props
|
|
1708
1763
|
}
|
|
1709
1764
|
),
|
|
1710
|
-
/* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1711
1766
|
"span",
|
|
1712
1767
|
{
|
|
1713
1768
|
"aria-hidden": "true",
|
|
1714
1769
|
className: cn(
|
|
1715
|
-
"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[8px]
|
|
1716
|
-
|
|
1770
|
+
"inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[8px] text-transparent",
|
|
1771
|
+
selectionControlControlBaseClasses,
|
|
1772
|
+
"peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground peer-focus-visible:ring-2 peer-focus-visible:ring-[color:var(--sofya-focus-ring-soft)] peer-focus-visible:ring-offset-0"
|
|
1717
1773
|
),
|
|
1718
|
-
children: /* @__PURE__ */ (0,
|
|
1719
|
-
"svg",
|
|
1720
|
-
{
|
|
1721
|
-
viewBox: "0 0 16 16",
|
|
1722
|
-
fill: "none",
|
|
1723
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1724
|
-
className: "h-4 w-4 shrink-0",
|
|
1725
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1726
|
-
"path",
|
|
1727
|
-
{
|
|
1728
|
-
d: "M2.75 8.25L6.4 11.9L13.35 4.95",
|
|
1729
|
-
stroke: "currentColor",
|
|
1730
|
-
strokeWidth: "2.4",
|
|
1731
|
-
strokeLinecap: "round",
|
|
1732
|
-
strokeLinejoin: "round"
|
|
1733
|
-
}
|
|
1734
|
-
)
|
|
1735
|
-
}
|
|
1736
|
-
)
|
|
1774
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons_react3.IconCheck, { "aria-hidden": "true", className: "h-4 w-4 shrink-0", stroke: 2.4 })
|
|
1737
1775
|
}
|
|
1738
1776
|
),
|
|
1739
|
-
label || description ? /* @__PURE__ */ (0,
|
|
1740
|
-
label ? /* @__PURE__ */ (0,
|
|
1777
|
+
label || description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: selectionControlContentBaseClasses, children: [
|
|
1778
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1741
1779
|
"span",
|
|
1742
1780
|
{
|
|
1743
1781
|
className: cn(
|
|
1744
|
-
|
|
1782
|
+
selectionControlLabelTextBaseClasses,
|
|
1745
1783
|
labelClassName
|
|
1746
1784
|
),
|
|
1747
1785
|
children: renderTextContent(label, {
|
|
@@ -1751,11 +1789,14 @@ var Checkbox = React8.forwardRef(
|
|
|
1751
1789
|
})
|
|
1752
1790
|
}
|
|
1753
1791
|
) : null,
|
|
1754
|
-
description ? /* @__PURE__ */ (0,
|
|
1792
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1755
1793
|
"span",
|
|
1756
1794
|
{
|
|
1757
1795
|
id: descriptionId,
|
|
1758
|
-
className: cn(
|
|
1796
|
+
className: cn(
|
|
1797
|
+
selectionControlDescriptionTextBaseClasses,
|
|
1798
|
+
descriptionClassName
|
|
1799
|
+
),
|
|
1759
1800
|
children: renderTextContent(description, {
|
|
1760
1801
|
as: "span",
|
|
1761
1802
|
className: "text-muted-foreground",
|
|
@@ -1772,17 +1813,41 @@ var Checkbox = React8.forwardRef(
|
|
|
1772
1813
|
Checkbox.displayName = "Checkbox";
|
|
1773
1814
|
|
|
1774
1815
|
// src/components/dropdown.tsx
|
|
1775
|
-
var
|
|
1816
|
+
var React12 = __toESM(require("react"), 1);
|
|
1776
1817
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1818
|
+
|
|
1819
|
+
// src/lib/use-controllable-state.ts
|
|
1820
|
+
var React11 = __toESM(require("react"), 1);
|
|
1821
|
+
function useControllableState({
|
|
1822
|
+
defaultValue,
|
|
1823
|
+
onChange,
|
|
1824
|
+
value
|
|
1825
|
+
}) {
|
|
1826
|
+
const isControlled = value !== void 0;
|
|
1827
|
+
const [uncontrolledValue, setUncontrolledValue] = React11.useState(defaultValue);
|
|
1828
|
+
const currentValue = isControlled ? value : uncontrolledValue;
|
|
1829
|
+
const setValue = React11.useCallback(
|
|
1830
|
+
(nextValue) => {
|
|
1831
|
+
if (!isControlled) {
|
|
1832
|
+
setUncontrolledValue(nextValue);
|
|
1833
|
+
}
|
|
1834
|
+
onChange?.(nextValue);
|
|
1835
|
+
},
|
|
1836
|
+
[isControlled, onChange]
|
|
1837
|
+
);
|
|
1838
|
+
return [currentValue, setValue, setUncontrolledValue];
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
// src/components/dropdown.tsx
|
|
1842
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1843
|
+
var dropdownVariantOptions = [
|
|
1844
|
+
"card",
|
|
1845
|
+
"panel",
|
|
1846
|
+
"language",
|
|
1847
|
+
"selected"
|
|
1848
|
+
];
|
|
1849
|
+
var dropdownLanguageItems = [
|
|
1850
|
+
{ value: "en-US", label: "English", languageLocale: "en-US" },
|
|
1786
1851
|
{ value: "pt-BR", label: "Portuguese", languageLocale: "pt-BR" },
|
|
1787
1852
|
{ value: "es-ES", label: "Spanish", languageLocale: "es-ES" }
|
|
1788
1853
|
];
|
|
@@ -1818,7 +1883,7 @@ function resolveItemLanguageLocale(item) {
|
|
|
1818
1883
|
}
|
|
1819
1884
|
function DefaultDropdownTriggerIcon({ variant }) {
|
|
1820
1885
|
if (variant === "selected") {
|
|
1821
|
-
return /* @__PURE__ */ (0,
|
|
1886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1822
1887
|
Icon,
|
|
1823
1888
|
{
|
|
1824
1889
|
name: "caret-down",
|
|
@@ -1826,16 +1891,16 @@ function DefaultDropdownTriggerIcon({ variant }) {
|
|
|
1826
1891
|
}
|
|
1827
1892
|
);
|
|
1828
1893
|
}
|
|
1829
|
-
return /* @__PURE__ */ (0,
|
|
1894
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex h-8 w-8 items-center justify-center rounded-[6px]", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "caret-down", className: "!h-4 !w-4" }) });
|
|
1830
1895
|
}
|
|
1831
1896
|
function DefaultDropdownItemIndicator() {
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
1897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "check", size: 16 });
|
|
1833
1898
|
}
|
|
1834
1899
|
function DefaultDropdownInlineCheck() {
|
|
1835
|
-
return /* @__PURE__ */ (0,
|
|
1900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { name: "check", size: 14 });
|
|
1836
1901
|
}
|
|
1837
1902
|
function LanguageFlagIcon({ locale }) {
|
|
1838
|
-
return /* @__PURE__ */ (0,
|
|
1903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1839
1904
|
"img",
|
|
1840
1905
|
{
|
|
1841
1906
|
alt: "",
|
|
@@ -1867,40 +1932,41 @@ function Dropdown({
|
|
|
1867
1932
|
const isLanguageVariant = variant === "language";
|
|
1868
1933
|
const isSelectedVariant = variant === "selected";
|
|
1869
1934
|
const usesDefaultListStyle = !isLanguageVariant;
|
|
1870
|
-
const resolvedItems =
|
|
1935
|
+
const resolvedItems = React12.useMemo(
|
|
1871
1936
|
() => isLanguageVariant ? items && items.length > 0 ? items : dropdownLanguageItems : items ?? [],
|
|
1872
1937
|
[isLanguageVariant, items]
|
|
1873
1938
|
);
|
|
1874
1939
|
const defaultUncontrolledValue = defaultValue ?? (isLanguageVariant ? resolvedItems[0]?.value : void 0);
|
|
1875
|
-
const [
|
|
1876
|
-
defaultUncontrolledValue
|
|
1877
|
-
|
|
1878
|
-
|
|
1940
|
+
const [selectedValue, setSelectedValue, setUncontrolledSelectedValue] = useControllableState({
|
|
1941
|
+
defaultValue: defaultUncontrolledValue,
|
|
1942
|
+
onChange: onValueChange,
|
|
1943
|
+
value
|
|
1944
|
+
});
|
|
1879
1945
|
const radioValue = selectedValue ?? "";
|
|
1880
1946
|
const selectedItem = resolvedItems.find(
|
|
1881
1947
|
(item) => item.value === selectedValue
|
|
1882
1948
|
);
|
|
1883
1949
|
const hasSelectedItem = selectedItem !== void 0;
|
|
1884
1950
|
const selectedLanguageLocale = resolveItemLanguageLocale(selectedItem);
|
|
1885
|
-
|
|
1951
|
+
React12.useEffect(() => {
|
|
1886
1952
|
if (value !== void 0) {
|
|
1887
1953
|
return;
|
|
1888
1954
|
}
|
|
1889
|
-
const currentValueIsAvailable =
|
|
1955
|
+
const currentValueIsAvailable = selectedValue !== void 0 && resolvedItems.some((item) => item.value === selectedValue);
|
|
1890
1956
|
if (!currentValueIsAvailable && defaultUncontrolledValue !== void 0) {
|
|
1891
|
-
|
|
1957
|
+
setUncontrolledSelectedValue(defaultUncontrolledValue);
|
|
1892
1958
|
}
|
|
1893
|
-
}, [
|
|
1894
|
-
|
|
1959
|
+
}, [
|
|
1960
|
+
defaultUncontrolledValue,
|
|
1961
|
+
resolvedItems,
|
|
1962
|
+
selectedValue,
|
|
1963
|
+
setUncontrolledSelectedValue,
|
|
1964
|
+
value
|
|
1965
|
+
]);
|
|
1966
|
+
const resolvedTriggerIcon = isLanguageVariant ? void 0 : triggerIcon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DefaultDropdownTriggerIcon, { variant }) : triggerIcon;
|
|
1895
1967
|
const triggerLabel = selectedItem?.triggerLabel ?? selectedItem?.label ?? placeholder;
|
|
1896
1968
|
const selectedTriggerToneClassName = isSelectedVariant ? hasSelectedItem ? "text-foreground" : "text-[color:var(--sofya-text-soft)]" : void 0;
|
|
1897
|
-
|
|
1898
|
-
if (value === void 0) {
|
|
1899
|
-
setInternalValue(nextValue);
|
|
1900
|
-
}
|
|
1901
|
-
onValueChange?.(nextValue);
|
|
1902
|
-
}
|
|
1903
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1969
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1904
1970
|
DropdownMenuPrimitive.Root,
|
|
1905
1971
|
{
|
|
1906
1972
|
defaultOpen,
|
|
@@ -1908,7 +1974,7 @@ function Dropdown({
|
|
|
1908
1974
|
onOpenChange,
|
|
1909
1975
|
open,
|
|
1910
1976
|
children: [
|
|
1911
|
-
/* @__PURE__ */ (0,
|
|
1977
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.Trigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1912
1978
|
Button,
|
|
1913
1979
|
{
|
|
1914
1980
|
type: "button",
|
|
@@ -1921,14 +1987,14 @@ function Dropdown({
|
|
|
1921
1987
|
triggerClassName
|
|
1922
1988
|
),
|
|
1923
1989
|
rightIcon: resolvedTriggerIcon,
|
|
1924
|
-
children: isLanguageVariant ? null : /* @__PURE__ */ (0,
|
|
1990
|
+
children: isLanguageVariant ? null : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "min-w-0 truncate", children: renderTextContent(triggerLabel, {
|
|
1925
1991
|
as: "span",
|
|
1926
1992
|
className: "block min-w-0 truncate text-inherit",
|
|
1927
1993
|
size: "body"
|
|
1928
1994
|
}) })
|
|
1929
1995
|
}
|
|
1930
1996
|
) }),
|
|
1931
|
-
/* @__PURE__ */ (0,
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1932
1998
|
DropdownMenuPrimitive.Content,
|
|
1933
1999
|
{
|
|
1934
2000
|
align,
|
|
@@ -1938,18 +2004,18 @@ function Dropdown({
|
|
|
1938
2004
|
dropdownContentClasses[variant],
|
|
1939
2005
|
contentClassName
|
|
1940
2006
|
),
|
|
1941
|
-
children: /* @__PURE__ */ (0,
|
|
2007
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1942
2008
|
DropdownMenuPrimitive.RadioGroup,
|
|
1943
2009
|
{
|
|
1944
2010
|
value: radioValue,
|
|
1945
|
-
onValueChange:
|
|
2011
|
+
onValueChange: setSelectedValue,
|
|
1946
2012
|
className: "grid gap-2",
|
|
1947
2013
|
children: resolvedItems.map((item) => {
|
|
1948
2014
|
const isSelected = item.value === selectedValue;
|
|
1949
2015
|
const itemLanguageLocale = resolveItemLanguageLocale(item);
|
|
1950
|
-
const indicator = item.indicator ?? /* @__PURE__ */ (0,
|
|
1951
|
-
const itemIcon = item.icon ?? (variant === "language" && itemLanguageLocale ? /* @__PURE__ */ (0,
|
|
1952
|
-
return /* @__PURE__ */ (0,
|
|
2016
|
+
const indicator = item.indicator ?? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DefaultDropdownItemIndicator, {});
|
|
2017
|
+
const itemIcon = item.icon ?? (variant === "language" && itemLanguageLocale ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(LanguageFlagIcon, { locale: itemLanguageLocale }) : null);
|
|
2018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1953
2019
|
DropdownMenuPrimitive.RadioItem,
|
|
1954
2020
|
{
|
|
1955
2021
|
value: item.value,
|
|
@@ -1960,7 +2026,7 @@ function Dropdown({
|
|
|
1960
2026
|
dropdownItemClasses[variant],
|
|
1961
2027
|
itemClassName
|
|
1962
2028
|
),
|
|
1963
|
-
children: usesDefaultListStyle ? /* @__PURE__ */ (0,
|
|
2029
|
+
children: usesDefaultListStyle ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1964
2030
|
"span",
|
|
1965
2031
|
{
|
|
1966
2032
|
"data-dropdown-item-body": true,
|
|
@@ -1969,32 +2035,32 @@ function Dropdown({
|
|
|
1969
2035
|
isSelected ? "bg-[color:var(--sofya-surface-selected)]" : "bg-transparent"
|
|
1970
2036
|
),
|
|
1971
2037
|
children: [
|
|
1972
|
-
itemIcon ? /* @__PURE__ */ (0,
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
2038
|
+
itemIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }) : null,
|
|
2039
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate", children: renderTextContent(item.label, {
|
|
1974
2040
|
as: "span",
|
|
1975
2041
|
className: "block truncate text-inherit",
|
|
1976
2042
|
size: "body"
|
|
1977
2043
|
}) }),
|
|
1978
|
-
isSelected ? /* @__PURE__ */ (0,
|
|
2044
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1979
2045
|
"span",
|
|
1980
2046
|
{
|
|
1981
2047
|
"aria-hidden": "true",
|
|
1982
2048
|
className: "flex h-[14px] w-[14px] shrink-0 items-center justify-center",
|
|
1983
|
-
children: /* @__PURE__ */ (0,
|
|
2049
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DefaultDropdownInlineCheck, {})
|
|
1984
2050
|
}
|
|
1985
2051
|
) : null
|
|
1986
2052
|
]
|
|
1987
2053
|
}
|
|
1988
|
-
) : /* @__PURE__ */ (0,
|
|
1989
|
-
/* @__PURE__ */ (0,
|
|
1990
|
-
itemIcon ? /* @__PURE__ */ (0,
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2055
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
2056
|
+
itemIcon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex shrink-0 items-center justify-center", children: itemIcon }) : null,
|
|
2057
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "truncate", children: renderTextContent(item.label, {
|
|
1992
2058
|
as: "span",
|
|
1993
2059
|
className: "block truncate text-inherit",
|
|
1994
2060
|
size: "body"
|
|
1995
2061
|
}) })
|
|
1996
2062
|
] }),
|
|
1997
|
-
/* @__PURE__ */ (0,
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1998
2064
|
"span",
|
|
1999
2065
|
{
|
|
2000
2066
|
"aria-hidden": "true",
|
|
@@ -2021,14 +2087,14 @@ function Dropdown({
|
|
|
2021
2087
|
}
|
|
2022
2088
|
|
|
2023
2089
|
// src/components/dialog.tsx
|
|
2024
|
-
var
|
|
2090
|
+
var React13 = __toESM(require("react"), 1);
|
|
2025
2091
|
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
2026
|
-
var
|
|
2092
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2027
2093
|
var Dialog = DialogPrimitive.Root;
|
|
2028
2094
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2029
2095
|
var DialogPortal = DialogPrimitive.Portal;
|
|
2030
2096
|
var DialogClose = DialogPrimitive.Close;
|
|
2031
|
-
var DialogOverlay =
|
|
2097
|
+
var DialogOverlay = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2032
2098
|
DialogPrimitive.Overlay,
|
|
2033
2099
|
{
|
|
2034
2100
|
ref,
|
|
@@ -2040,7 +2106,7 @@ var DialogOverlay = React10.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2040
2106
|
}
|
|
2041
2107
|
));
|
|
2042
2108
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
2043
|
-
var DialogContent =
|
|
2109
|
+
var DialogContent = React13.forwardRef(
|
|
2044
2110
|
({
|
|
2045
2111
|
className,
|
|
2046
2112
|
children,
|
|
@@ -2053,9 +2119,9 @@ var DialogContent = React10.forwardRef(
|
|
|
2053
2119
|
const dialogCardStyle = {
|
|
2054
2120
|
"--sofya-surface-shadow-override": "var(--sofya-shadow-lg)"
|
|
2055
2121
|
};
|
|
2056
|
-
return /* @__PURE__ */ (0,
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogPortal, { children: [
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogOverlay, { className: overlayClassName }),
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "sofya-dialog-positioner fixed inset-0 z-50 flex items-center justify-center p-4", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2059
2125
|
DialogPrimitive.Content,
|
|
2060
2126
|
{
|
|
2061
2127
|
ref,
|
|
@@ -2064,7 +2130,7 @@ var DialogContent = React10.forwardRef(
|
|
|
2064
2130
|
className
|
|
2065
2131
|
),
|
|
2066
2132
|
...props,
|
|
2067
|
-
children: /* @__PURE__ */ (0,
|
|
2133
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2068
2134
|
Card,
|
|
2069
2135
|
{
|
|
2070
2136
|
variant: cardVariant,
|
|
@@ -2075,15 +2141,15 @@ var DialogContent = React10.forwardRef(
|
|
|
2075
2141
|
style: dialogCardStyle,
|
|
2076
2142
|
children: [
|
|
2077
2143
|
children,
|
|
2078
|
-
showCloseButton ? /* @__PURE__ */ (0,
|
|
2144
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2079
2145
|
Button,
|
|
2080
2146
|
{
|
|
2081
2147
|
type: "button",
|
|
2082
|
-
variant: "
|
|
2148
|
+
variant: "ghost",
|
|
2083
2149
|
size: "icon",
|
|
2084
2150
|
"aria-label": "Close",
|
|
2085
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
2086
|
-
className: "absolute right-4 top-4 z-10
|
|
2151
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { name: "x", size: 18 }),
|
|
2152
|
+
className: "absolute right-4 top-4 z-10 text-muted-foreground hover:text-foreground"
|
|
2087
2153
|
}
|
|
2088
2154
|
) }) : null
|
|
2089
2155
|
]
|
|
@@ -2096,10 +2162,10 @@ var DialogContent = React10.forwardRef(
|
|
|
2096
2162
|
);
|
|
2097
2163
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
2098
2164
|
function DialogHeader({ className, ...props }) {
|
|
2099
|
-
return /* @__PURE__ */ (0,
|
|
2165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("grid gap-2 px-6 pt-6 pr-16 text-left", className), ...props });
|
|
2100
2166
|
}
|
|
2101
2167
|
function DialogFooter({ className, ...props }) {
|
|
2102
|
-
return /* @__PURE__ */ (0,
|
|
2168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2103
2169
|
"div",
|
|
2104
2170
|
{
|
|
2105
2171
|
className: cn(
|
|
@@ -2110,11 +2176,11 @@ function DialogFooter({ className, ...props }) {
|
|
|
2110
2176
|
}
|
|
2111
2177
|
);
|
|
2112
2178
|
}
|
|
2113
|
-
var DialogCancel =
|
|
2114
|
-
({ type = "button", variant = "outline", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2179
|
+
var DialogCancel = React13.forwardRef(
|
|
2180
|
+
({ type = "button", variant = "outline", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogPrimitive.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { ref, type, variant, ...props }) })
|
|
2115
2181
|
);
|
|
2116
2182
|
DialogCancel.displayName = "DialogCancel";
|
|
2117
|
-
var DialogTitle =
|
|
2183
|
+
var DialogTitle = React13.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2118
2184
|
DialogPrimitive.Title,
|
|
2119
2185
|
{
|
|
2120
2186
|
ref,
|
|
@@ -2128,7 +2194,7 @@ var DialogTitle = React10.forwardRef(({ children, className, ...props }, ref) =>
|
|
|
2128
2194
|
}
|
|
2129
2195
|
));
|
|
2130
2196
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
2131
|
-
var DialogDescription =
|
|
2197
|
+
var DialogDescription = React13.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2132
2198
|
DialogPrimitive.Description,
|
|
2133
2199
|
{
|
|
2134
2200
|
ref,
|
|
@@ -2144,9 +2210,9 @@ var DialogDescription = React10.forwardRef(({ children, className, ...props }, r
|
|
|
2144
2210
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2145
2211
|
|
|
2146
2212
|
// src/components/empty.tsx
|
|
2147
|
-
var
|
|
2213
|
+
var React14 = __toESM(require("react"), 1);
|
|
2148
2214
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
2149
|
-
var
|
|
2215
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2150
2216
|
var emptyMediaVariantOptions = ["default", "icon"];
|
|
2151
2217
|
var emptyMediaVariants = (0, import_class_variance_authority5.cva)(
|
|
2152
2218
|
"inline-flex shrink-0 items-center justify-center transition-[background-color,border-color,color,box-shadow] duration-sofya ease-sofya",
|
|
@@ -2162,11 +2228,11 @@ var emptyMediaVariants = (0, import_class_variance_authority5.cva)(
|
|
|
2162
2228
|
}
|
|
2163
2229
|
}
|
|
2164
2230
|
);
|
|
2165
|
-
var EmptyMedia =
|
|
2166
|
-
return /* @__PURE__ */ (0,
|
|
2231
|
+
var EmptyMedia = React14.forwardRef(function EmptyMedia2({ className, variant, ...props }, ref) {
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn(emptyMediaVariants({ variant }), className), ...props });
|
|
2167
2233
|
});
|
|
2168
2234
|
function EmptyHeader({ className, ...props }) {
|
|
2169
|
-
return /* @__PURE__ */ (0,
|
|
2235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2170
2236
|
"div",
|
|
2171
2237
|
{
|
|
2172
2238
|
className: cn("flex max-w-[34rem] flex-col items-center gap-4 text-center", className),
|
|
@@ -2175,7 +2241,7 @@ function EmptyHeader({ className, ...props }) {
|
|
|
2175
2241
|
);
|
|
2176
2242
|
}
|
|
2177
2243
|
function EmptyTitle({ children, className, ...props }) {
|
|
2178
|
-
return /* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2179
2245
|
"h2",
|
|
2180
2246
|
{
|
|
2181
2247
|
className: cn("text-foreground", className),
|
|
@@ -2193,7 +2259,7 @@ function EmptyDescription({
|
|
|
2193
2259
|
className,
|
|
2194
2260
|
...props
|
|
2195
2261
|
}) {
|
|
2196
|
-
return /* @__PURE__ */ (0,
|
|
2262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2197
2263
|
"p",
|
|
2198
2264
|
{
|
|
2199
2265
|
className: cn("max-w-full text-muted-foreground whitespace-nowrap", className),
|
|
@@ -2207,7 +2273,7 @@ function EmptyDescription({
|
|
|
2207
2273
|
);
|
|
2208
2274
|
}
|
|
2209
2275
|
function EmptyContent({ children, className, ...props }) {
|
|
2210
|
-
return /* @__PURE__ */ (0,
|
|
2276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2211
2277
|
"div",
|
|
2212
2278
|
{
|
|
2213
2279
|
className: cn("flex flex-wrap items-center justify-center gap-4 text-center", className),
|
|
@@ -2218,9 +2284,9 @@ function EmptyContent({ children, className, ...props }) {
|
|
|
2218
2284
|
}
|
|
2219
2285
|
);
|
|
2220
2286
|
}
|
|
2221
|
-
var Empty =
|
|
2222
|
-
const hasCustomChildren =
|
|
2223
|
-
return /* @__PURE__ */ (0,
|
|
2287
|
+
var Empty = React14.forwardRef(function Empty2({ children, className, content, description, media, title, ...props }, ref) {
|
|
2288
|
+
const hasCustomChildren = React14.Children.count(children) > 0;
|
|
2289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2224
2290
|
"div",
|
|
2225
2291
|
{
|
|
2226
2292
|
ref,
|
|
@@ -2229,13 +2295,13 @@ var Empty = React11.forwardRef(function Empty2({ children, className, content, d
|
|
|
2229
2295
|
className
|
|
2230
2296
|
),
|
|
2231
2297
|
...props,
|
|
2232
|
-
children: hasCustomChildren ? children : /* @__PURE__ */ (0,
|
|
2233
|
-
/* @__PURE__ */ (0,
|
|
2234
|
-
media ?? /* @__PURE__ */ (0,
|
|
2235
|
-
/* @__PURE__ */ (0,
|
|
2236
|
-
/* @__PURE__ */ (0,
|
|
2298
|
+
children: hasCustomChildren ? children : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(EmptyHeader, { children: [
|
|
2300
|
+
media ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmptyMedia, { variant: "icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { name: "folders", size: 28 }) }),
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmptyTitle, { children: title ?? "Nada por aqui" }),
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmptyDescription, { children: description ?? "Quando houver conte\xFAdo dispon\xEDvel, ele aparecer\xE1 aqui." })
|
|
2237
2303
|
] }),
|
|
2238
|
-
content !== void 0 && content !== null ? /* @__PURE__ */ (0,
|
|
2304
|
+
content !== void 0 && content !== null ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EmptyContent, { children: content }) : null
|
|
2239
2305
|
] })
|
|
2240
2306
|
}
|
|
2241
2307
|
);
|
|
@@ -2248,104 +2314,73 @@ EmptyDescription.displayName = "EmptyDescription";
|
|
|
2248
2314
|
EmptyContent.displayName = "EmptyContent";
|
|
2249
2315
|
|
|
2250
2316
|
// src/components/input.tsx
|
|
2251
|
-
var
|
|
2317
|
+
var React17 = __toESM(require("react"), 1);
|
|
2252
2318
|
var import_input_otp2 = require("input-otp");
|
|
2253
|
-
var import_react2 = require("motion/react");
|
|
2254
2319
|
|
|
2255
|
-
// src/
|
|
2256
|
-
var
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
)
|
|
2272
|
-
|
|
2273
|
-
InputOTP.displayName = "InputOTP";
|
|
2274
|
-
var InputOTPGroup = React12.forwardRef(({ className, ...props }, ref) => {
|
|
2275
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2276
|
-
"div",
|
|
2320
|
+
// src/lib/field-shell.tsx
|
|
2321
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2322
|
+
function FieldLabel({
|
|
2323
|
+
children,
|
|
2324
|
+
className,
|
|
2325
|
+
htmlFor,
|
|
2326
|
+
textClassName = "block text-[color:var(--sofya-text-default)]",
|
|
2327
|
+
textSize = "body",
|
|
2328
|
+
textStyle = {
|
|
2329
|
+
fontWeight: 500
|
|
2330
|
+
}
|
|
2331
|
+
}) {
|
|
2332
|
+
if (!children) {
|
|
2333
|
+
return null;
|
|
2334
|
+
}
|
|
2335
|
+
const Component = htmlFor ? "label" : "div";
|
|
2336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2337
|
+
Component,
|
|
2277
2338
|
{
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2339
|
+
className: cn("text-[color:var(--sofya-text-default)]", className),
|
|
2340
|
+
htmlFor,
|
|
2341
|
+
children: renderTextContent(children, {
|
|
2342
|
+
as: "span",
|
|
2343
|
+
className: textClassName,
|
|
2344
|
+
size: textSize,
|
|
2345
|
+
style: textStyle
|
|
2346
|
+
})
|
|
2284
2347
|
}
|
|
2285
2348
|
);
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
);
|
|
2304
|
-
}
|
|
2305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2306
|
-
"div",
|
|
2349
|
+
}
|
|
2350
|
+
function FieldShell({
|
|
2351
|
+
containerClassName,
|
|
2352
|
+
control,
|
|
2353
|
+
label,
|
|
2354
|
+
labelClassName,
|
|
2355
|
+
labelHtmlFor,
|
|
2356
|
+
labelTextClassName,
|
|
2357
|
+
labelTextSize,
|
|
2358
|
+
labelTextStyle
|
|
2359
|
+
}) {
|
|
2360
|
+
if (!label && !containerClassName) {
|
|
2361
|
+
return control;
|
|
2362
|
+
}
|
|
2363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("grid w-full gap-2", containerClassName), children: [
|
|
2364
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2365
|
+
FieldLabel,
|
|
2307
2366
|
{
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
...props,
|
|
2315
|
-
children: [
|
|
2316
|
-
slot.char ?? null,
|
|
2317
|
-
slot.hasFakeCaret ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "h-10 w-[2px] animate-pulse rounded-full bg-primary shadow-[var(--sofya-shadow-caret-glow)]" }) }) : null
|
|
2318
|
-
]
|
|
2367
|
+
className: labelClassName,
|
|
2368
|
+
htmlFor: labelHtmlFor,
|
|
2369
|
+
textClassName: labelTextClassName,
|
|
2370
|
+
textSize: labelTextSize,
|
|
2371
|
+
textStyle: labelTextStyle,
|
|
2372
|
+
children: label
|
|
2319
2373
|
}
|
|
2320
|
-
)
|
|
2321
|
-
|
|
2322
|
-
);
|
|
2323
|
-
|
|
2324
|
-
var InputOTPSeparator = React12.forwardRef(({ className, ...props }, ref) => {
|
|
2325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2326
|
-
"div",
|
|
2327
|
-
{
|
|
2328
|
-
ref,
|
|
2329
|
-
role: "separator",
|
|
2330
|
-
className: cn(
|
|
2331
|
-
"flex items-center justify-center px-2 text-[28px] leading-none text-[color:var(--sofya-text-soft)]",
|
|
2332
|
-
className
|
|
2333
|
-
),
|
|
2334
|
-
...props,
|
|
2335
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": "true", children: "." })
|
|
2336
|
-
}
|
|
2337
|
-
);
|
|
2338
|
-
});
|
|
2339
|
-
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
2374
|
+
) : null,
|
|
2375
|
+
control
|
|
2376
|
+
] });
|
|
2377
|
+
}
|
|
2340
2378
|
|
|
2341
|
-
// src/components/input.tsx
|
|
2342
|
-
var
|
|
2343
|
-
var
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
"otp",
|
|
2347
|
-
"upload"
|
|
2348
|
-
];
|
|
2379
|
+
// src/components/input-upload.tsx
|
|
2380
|
+
var React15 = __toESM(require("react"), 1);
|
|
2381
|
+
var import_icons_react4 = require("@tabler/icons-react");
|
|
2382
|
+
var import_react2 = require("motion/react");
|
|
2383
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2349
2384
|
var uploadKindOptions = ["document", "image", "video"];
|
|
2350
2385
|
var uploadAcceptByKind = {
|
|
2351
2386
|
document: ".pdf,.doc,.docx,.txt,.rtf,.odt,.jpg,.jpeg,.png,.webp,.gif",
|
|
@@ -2392,7 +2427,7 @@ function mergeUploadFiles(currentFiles, nextFiles, multiple) {
|
|
|
2392
2427
|
return Array.from(filesBySignature.values());
|
|
2393
2428
|
}
|
|
2394
2429
|
var uploadListItemTransition = {
|
|
2395
|
-
duration: 0.
|
|
2430
|
+
duration: 0.18,
|
|
2396
2431
|
ease: [0.22, 1, 0.36, 1]
|
|
2397
2432
|
};
|
|
2398
2433
|
function formatUploadFileSize(bytes) {
|
|
@@ -2438,96 +2473,12 @@ function resolveUploadFileVisualKind(file, fallbackKind) {
|
|
|
2438
2473
|
}
|
|
2439
2474
|
return "document";
|
|
2440
2475
|
}
|
|
2441
|
-
function InputShell({
|
|
2442
|
-
containerClassName,
|
|
2443
|
-
control,
|
|
2444
|
-
label,
|
|
2445
|
-
labelClassName,
|
|
2446
|
-
resolvedId
|
|
2447
|
-
}) {
|
|
2448
|
-
if (!label && !containerClassName) {
|
|
2449
|
-
return control;
|
|
2450
|
-
}
|
|
2451
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("grid w-full gap-2", containerClassName), children: [
|
|
2452
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2453
|
-
"label",
|
|
2454
|
-
{
|
|
2455
|
-
className: cn(
|
|
2456
|
-
"text-[color:var(--sofya-text-default)]",
|
|
2457
|
-
labelClassName
|
|
2458
|
-
),
|
|
2459
|
-
htmlFor: resolvedId,
|
|
2460
|
-
children: renderTextContent(label, {
|
|
2461
|
-
as: "span",
|
|
2462
|
-
className: "block text-[color:var(--sofya-text-default)]",
|
|
2463
|
-
size: "body",
|
|
2464
|
-
style: {
|
|
2465
|
-
fontWeight: 500
|
|
2466
|
-
}
|
|
2467
|
-
})
|
|
2468
|
-
}
|
|
2469
|
-
) : null,
|
|
2470
|
-
control
|
|
2471
|
-
] });
|
|
2472
|
-
}
|
|
2473
|
-
function UploadInputShell({
|
|
2474
|
-
containerClassName,
|
|
2475
|
-
control,
|
|
2476
|
-
label,
|
|
2477
|
-
labelClassName,
|
|
2478
|
-
optionalLabel
|
|
2479
|
-
}) {
|
|
2480
|
-
if (!label && !optionalLabel && !containerClassName) {
|
|
2481
|
-
return control;
|
|
2482
|
-
}
|
|
2483
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("grid w-full gap-2", containerClassName), children: [
|
|
2484
|
-
label || optionalLabel ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2485
|
-
"div",
|
|
2486
|
-
{
|
|
2487
|
-
className: cn(
|
|
2488
|
-
"text-[color:var(--sofya-text-default)]",
|
|
2489
|
-
labelClassName
|
|
2490
|
-
),
|
|
2491
|
-
children: [
|
|
2492
|
-
renderTextContent(label, {
|
|
2493
|
-
as: "span",
|
|
2494
|
-
className: "text-[color:var(--sofya-text-default)]",
|
|
2495
|
-
size: "body",
|
|
2496
|
-
style: {
|
|
2497
|
-
fontWeight: 700
|
|
2498
|
-
}
|
|
2499
|
-
}),
|
|
2500
|
-
optionalLabel ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "ml-2 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(optionalLabel, {
|
|
2501
|
-
as: "span",
|
|
2502
|
-
className: "text-[color:var(--sofya-text-subtle)]",
|
|
2503
|
-
size: "tiny"
|
|
2504
|
-
}) }) : null
|
|
2505
|
-
]
|
|
2506
|
-
}
|
|
2507
|
-
) : null,
|
|
2508
|
-
control
|
|
2509
|
-
] });
|
|
2510
|
-
}
|
|
2511
2476
|
function UploadGlyph({ className }) {
|
|
2512
|
-
return /* @__PURE__ */ (0,
|
|
2513
|
-
|
|
2477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2478
|
+
import_icons_react4.IconUpload,
|
|
2514
2479
|
{
|
|
2515
2480
|
"aria-hidden": "true",
|
|
2516
|
-
className: cn("inline-block shrink-0 align-middle", className)
|
|
2517
|
-
fill: "none",
|
|
2518
|
-
focusable: "false",
|
|
2519
|
-
viewBox: "0 0 20 20",
|
|
2520
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2521
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2522
|
-
"path",
|
|
2523
|
-
{
|
|
2524
|
-
d: "M10 12.5V3.75M6.66667 7.08333L10 3.75L13.3333 7.08333M5 11.6667V14.1667C5 14.6269 5.3731 15 5.83333 15H14.1667C14.6269 15 15 14.6269 15 14.1667V11.6667",
|
|
2525
|
-
stroke: "currentColor",
|
|
2526
|
-
strokeLinecap: "round",
|
|
2527
|
-
strokeLinejoin: "round",
|
|
2528
|
-
strokeWidth: "2"
|
|
2529
|
-
}
|
|
2530
|
-
)
|
|
2481
|
+
className: cn("inline-block shrink-0 align-middle", className)
|
|
2531
2482
|
}
|
|
2532
2483
|
);
|
|
2533
2484
|
}
|
|
@@ -2536,120 +2487,32 @@ function UploadFileTypeGlyph({
|
|
|
2536
2487
|
kind
|
|
2537
2488
|
}) {
|
|
2538
2489
|
if (kind === "image") {
|
|
2539
|
-
return /* @__PURE__ */ (0,
|
|
2540
|
-
|
|
2490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2491
|
+
import_icons_react4.IconPhoto,
|
|
2541
2492
|
{
|
|
2542
2493
|
"aria-hidden": "true",
|
|
2543
|
-
className: cn("inline-block shrink-0 align-middle", className)
|
|
2544
|
-
fill: "none",
|
|
2545
|
-
focusable: "false",
|
|
2546
|
-
viewBox: "0 0 18 18",
|
|
2547
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2548
|
-
children: [
|
|
2549
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2550
|
-
"rect",
|
|
2551
|
-
{
|
|
2552
|
-
x: "2.5",
|
|
2553
|
-
y: "3",
|
|
2554
|
-
width: "13",
|
|
2555
|
-
height: "12",
|
|
2556
|
-
rx: "2.5",
|
|
2557
|
-
stroke: "currentColor",
|
|
2558
|
-
strokeWidth: "1.5"
|
|
2559
|
-
}
|
|
2560
|
-
),
|
|
2561
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("circle", { cx: "6.75", cy: "7.25", r: "1.25", fill: "currentColor" }),
|
|
2562
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2563
|
-
"path",
|
|
2564
|
-
{
|
|
2565
|
-
d: "M4.5 12L7.25 9.25C7.64052 8.85948 8.27368 8.85948 8.66421 9.25L9.5 10.0858C9.89052 10.4763 10.5237 10.4763 10.9142 10.0858L11.25 9.75C11.6405 9.35948 12.2737 9.35948 12.6642 9.75L13.5 10.5858",
|
|
2566
|
-
stroke: "currentColor",
|
|
2567
|
-
strokeLinecap: "round",
|
|
2568
|
-
strokeLinejoin: "round",
|
|
2569
|
-
strokeWidth: "1.5"
|
|
2570
|
-
}
|
|
2571
|
-
)
|
|
2572
|
-
]
|
|
2494
|
+
className: cn("inline-block shrink-0 align-middle", className)
|
|
2573
2495
|
}
|
|
2574
2496
|
);
|
|
2575
2497
|
}
|
|
2576
2498
|
if (kind === "video") {
|
|
2577
|
-
return /* @__PURE__ */ (0,
|
|
2578
|
-
|
|
2499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2500
|
+
import_icons_react4.IconVideo,
|
|
2579
2501
|
{
|
|
2580
2502
|
"aria-hidden": "true",
|
|
2581
|
-
className: cn("inline-block shrink-0 align-middle", className)
|
|
2582
|
-
fill: "none",
|
|
2583
|
-
focusable: "false",
|
|
2584
|
-
viewBox: "0 0 18 18",
|
|
2585
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2586
|
-
children: [
|
|
2587
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2588
|
-
"rect",
|
|
2589
|
-
{
|
|
2590
|
-
x: "2.5",
|
|
2591
|
-
y: "4",
|
|
2592
|
-
width: "13",
|
|
2593
|
-
height: "10",
|
|
2594
|
-
rx: "2.5",
|
|
2595
|
-
stroke: "currentColor",
|
|
2596
|
-
strokeWidth: "1.5"
|
|
2597
|
-
}
|
|
2598
|
-
),
|
|
2599
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2600
|
-
"path",
|
|
2601
|
-
{
|
|
2602
|
-
d: "M8 7.35C8 7.03889 8.33624 6.84443 8.60583 7.00018L11.1583 8.47518C11.4279 8.63094 11.4279 9.02088 11.1583 9.17664L8.60583 10.6516C8.33624 10.8074 8 10.6129 8 10.3018V7.35Z",
|
|
2603
|
-
fill: "currentColor"
|
|
2604
|
-
}
|
|
2605
|
-
)
|
|
2606
|
-
]
|
|
2503
|
+
className: cn("inline-block shrink-0 align-middle", className)
|
|
2607
2504
|
}
|
|
2608
2505
|
);
|
|
2609
2506
|
}
|
|
2610
|
-
return /* @__PURE__ */ (0,
|
|
2611
|
-
|
|
2507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2508
|
+
import_icons_react4.IconFileText,
|
|
2612
2509
|
{
|
|
2613
2510
|
"aria-hidden": "true",
|
|
2614
|
-
className: cn("inline-block shrink-0 align-middle", className)
|
|
2615
|
-
fill: "none",
|
|
2616
|
-
focusable: "false",
|
|
2617
|
-
viewBox: "0 0 18 18",
|
|
2618
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2619
|
-
children: [
|
|
2620
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2621
|
-
"path",
|
|
2622
|
-
{
|
|
2623
|
-
d: "M7.5 2.25H5C3.89543 2.25 3 3.14543 3 4.25V13.75C3 14.8546 3.89543 15.75 5 15.75H13C14.1046 15.75 15 14.8546 15 13.75V8.25L11.25 4.5H9.75C8.50736 4.5 7.5 3.49264 7.5 2.25Z",
|
|
2624
|
-
stroke: "currentColor",
|
|
2625
|
-
strokeLinejoin: "round",
|
|
2626
|
-
strokeWidth: "1.5"
|
|
2627
|
-
}
|
|
2628
|
-
),
|
|
2629
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2630
|
-
"path",
|
|
2631
|
-
{
|
|
2632
|
-
d: "M7.5 2.25V4.25C7.5 5.35457 8.39543 6.25 9.5 6.25H11.5",
|
|
2633
|
-
stroke: "currentColor",
|
|
2634
|
-
strokeLinecap: "round",
|
|
2635
|
-
strokeLinejoin: "round",
|
|
2636
|
-
strokeWidth: "1.5"
|
|
2637
|
-
}
|
|
2638
|
-
),
|
|
2639
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2640
|
-
"path",
|
|
2641
|
-
{
|
|
2642
|
-
d: "M6 10H12M6 12.5H10",
|
|
2643
|
-
stroke: "currentColor",
|
|
2644
|
-
strokeLinecap: "round",
|
|
2645
|
-
strokeWidth: "1.5"
|
|
2646
|
-
}
|
|
2647
|
-
)
|
|
2648
|
-
]
|
|
2511
|
+
className: cn("inline-block shrink-0 align-middle", className)
|
|
2649
2512
|
}
|
|
2650
2513
|
);
|
|
2651
2514
|
}
|
|
2652
|
-
var UploadInputControl =
|
|
2515
|
+
var UploadInputControl = React15.forwardRef(function UploadInputControl2({
|
|
2653
2516
|
accept,
|
|
2654
2517
|
"aria-label": ariaLabel,
|
|
2655
2518
|
className,
|
|
@@ -2663,17 +2526,17 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2663
2526
|
resolvedId,
|
|
2664
2527
|
...uploadProps
|
|
2665
2528
|
}, ref) {
|
|
2666
|
-
const inputRef =
|
|
2667
|
-
const [isDragActive, setIsDragActive] =
|
|
2668
|
-
const [selectedFiles, setSelectedFiles] =
|
|
2529
|
+
const inputRef = React15.useRef(null);
|
|
2530
|
+
const [isDragActive, setIsDragActive] = React15.useState(false);
|
|
2531
|
+
const [selectedFiles, setSelectedFiles] = React15.useState([]);
|
|
2669
2532
|
const resolvedMultiple = multiple ?? true;
|
|
2670
2533
|
const prefersReducedMotion = (0, import_react2.useReducedMotion)();
|
|
2671
|
-
|
|
2534
|
+
React15.useImperativeHandle(ref, () => inputRef.current);
|
|
2672
2535
|
const resolvedAccept = accept ?? uploadAcceptByKind[uploadKind];
|
|
2673
2536
|
const resolvedAriaLabel = ariaLabel ?? uploadAriaLabelByKind[uploadKind];
|
|
2674
2537
|
const resolvedTitle = uploadTitle ?? "Arraste arquivos aqui ou clique para selecionar";
|
|
2675
2538
|
const resolvedDescription = uploadDescription ?? uploadDescriptionByKind[uploadKind];
|
|
2676
|
-
const syncSelectedFiles =
|
|
2539
|
+
const syncSelectedFiles = React15.useCallback(
|
|
2677
2540
|
(files) => {
|
|
2678
2541
|
const normalizedFiles = resolvedMultiple ? files : files.slice(0, 1);
|
|
2679
2542
|
setSelectedFiles(normalizedFiles);
|
|
@@ -2681,7 +2544,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2681
2544
|
},
|
|
2682
2545
|
[onFilesChange, resolvedMultiple]
|
|
2683
2546
|
);
|
|
2684
|
-
const applyFilesToInput =
|
|
2547
|
+
const applyFilesToInput = React15.useCallback((files) => {
|
|
2685
2548
|
const inputElement = inputRef.current;
|
|
2686
2549
|
if (!inputElement || typeof DataTransfer === "undefined") {
|
|
2687
2550
|
return false;
|
|
@@ -2700,7 +2563,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2700
2563
|
return false;
|
|
2701
2564
|
}
|
|
2702
2565
|
}, []);
|
|
2703
|
-
const handleInputChange =
|
|
2566
|
+
const handleInputChange = React15.useCallback(
|
|
2704
2567
|
(event) => {
|
|
2705
2568
|
const nextFiles = mergeUploadFiles(
|
|
2706
2569
|
selectedFiles,
|
|
@@ -2719,12 +2582,12 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2719
2582
|
syncSelectedFiles
|
|
2720
2583
|
]
|
|
2721
2584
|
);
|
|
2722
|
-
const openPicker =
|
|
2585
|
+
const openPicker = React15.useCallback(() => {
|
|
2723
2586
|
if (!disabled) {
|
|
2724
2587
|
inputRef.current?.click();
|
|
2725
2588
|
}
|
|
2726
2589
|
}, [disabled]);
|
|
2727
|
-
const handleKeyDown =
|
|
2590
|
+
const handleKeyDown = React15.useCallback(
|
|
2728
2591
|
(event) => {
|
|
2729
2592
|
if (disabled) {
|
|
2730
2593
|
return;
|
|
@@ -2736,7 +2599,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2736
2599
|
},
|
|
2737
2600
|
[disabled, openPicker]
|
|
2738
2601
|
);
|
|
2739
|
-
const handleDragEnter =
|
|
2602
|
+
const handleDragEnter = React15.useCallback(
|
|
2740
2603
|
(event) => {
|
|
2741
2604
|
event.preventDefault();
|
|
2742
2605
|
if (!disabled) {
|
|
@@ -2745,7 +2608,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2745
2608
|
},
|
|
2746
2609
|
[disabled]
|
|
2747
2610
|
);
|
|
2748
|
-
const handleDragLeave =
|
|
2611
|
+
const handleDragLeave = React15.useCallback(
|
|
2749
2612
|
(event) => {
|
|
2750
2613
|
if (disabled) {
|
|
2751
2614
|
return;
|
|
@@ -2758,7 +2621,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2758
2621
|
},
|
|
2759
2622
|
[disabled]
|
|
2760
2623
|
);
|
|
2761
|
-
const handleDragOver =
|
|
2624
|
+
const handleDragOver = React15.useCallback(
|
|
2762
2625
|
(event) => {
|
|
2763
2626
|
event.preventDefault();
|
|
2764
2627
|
if (disabled) {
|
|
@@ -2769,7 +2632,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2769
2632
|
},
|
|
2770
2633
|
[disabled]
|
|
2771
2634
|
);
|
|
2772
|
-
const handleDrop =
|
|
2635
|
+
const handleDrop = React15.useCallback(
|
|
2773
2636
|
(event) => {
|
|
2774
2637
|
event.preventDefault();
|
|
2775
2638
|
if (disabled) {
|
|
@@ -2802,7 +2665,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2802
2665
|
syncSelectedFiles
|
|
2803
2666
|
]
|
|
2804
2667
|
);
|
|
2805
|
-
const handleRemoveFile =
|
|
2668
|
+
const handleRemoveFile = React15.useCallback(
|
|
2806
2669
|
(fileIndex) => {
|
|
2807
2670
|
if (disabled) {
|
|
2808
2671
|
return;
|
|
@@ -2813,8 +2676,8 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2813
2676
|
},
|
|
2814
2677
|
[applyFilesToInput, disabled, selectedFiles, syncSelectedFiles]
|
|
2815
2678
|
);
|
|
2816
|
-
return /* @__PURE__ */ (0,
|
|
2817
|
-
/* @__PURE__ */ (0,
|
|
2679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "grid w-full gap-4", children: [
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2818
2681
|
"input",
|
|
2819
2682
|
{
|
|
2820
2683
|
...uploadProps,
|
|
@@ -2829,7 +2692,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2829
2692
|
onChange: handleInputChange
|
|
2830
2693
|
}
|
|
2831
2694
|
),
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2695
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2833
2696
|
"label",
|
|
2834
2697
|
{
|
|
2835
2698
|
"aria-disabled": disabled || void 0,
|
|
@@ -2849,8 +2712,8 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2849
2712
|
onDrop: handleDrop,
|
|
2850
2713
|
onKeyDown: handleKeyDown,
|
|
2851
2714
|
children: [
|
|
2852
|
-
/* @__PURE__ */ (0,
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex size-10 items-center justify-center rounded-[6px] p-2 text-[color:var(--sofya-text-default)]", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(UploadGlyph, { className: "size-[18px]" }) }),
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-[color:var(--sofya-text-default)]", children: renderTextContent(resolvedTitle, {
|
|
2854
2717
|
as: "span",
|
|
2855
2718
|
className: "block text-[color:var(--sofya-text-default)]",
|
|
2856
2719
|
size: "body",
|
|
@@ -2858,7 +2721,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2858
2721
|
fontWeight: 500
|
|
2859
2722
|
}
|
|
2860
2723
|
}) }),
|
|
2861
|
-
resolvedDescription ? /* @__PURE__ */ (0,
|
|
2724
|
+
resolvedDescription ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-[color:var(--sofya-text-subtle)]", children: renderTextContent(resolvedDescription, {
|
|
2862
2725
|
as: "span",
|
|
2863
2726
|
className: "block text-[color:var(--sofya-text-subtle)]",
|
|
2864
2727
|
size: "tiny"
|
|
@@ -2866,28 +2729,27 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2866
2729
|
]
|
|
2867
2730
|
}
|
|
2868
2731
|
),
|
|
2869
|
-
/* @__PURE__ */ (0,
|
|
2732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { role: "list", className: "grid gap-4 overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react2.AnimatePresence, { initial: false, children: selectedFiles.map((file, index) => {
|
|
2870
2733
|
const fileKey = resolveUploadFileSignature(file);
|
|
2871
|
-
return /* @__PURE__ */ (0,
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2872
2735
|
import_react2.motion.div,
|
|
2873
2736
|
{
|
|
2874
|
-
layout: true,
|
|
2875
2737
|
role: "listitem",
|
|
2876
2738
|
className: "overflow-hidden",
|
|
2877
|
-
initial: prefersReducedMotion ? { opacity: 0 } : { opacity: 0, y:
|
|
2878
|
-
animate: prefersReducedMotion ? { opacity: 1 } : { opacity: 1, y: 0
|
|
2879
|
-
exit: prefersReducedMotion ? { opacity: 0 } : { opacity: 0,
|
|
2739
|
+
initial: prefersReducedMotion ? { opacity: 0 } : { opacity: 0, y: 8 },
|
|
2740
|
+
animate: prefersReducedMotion ? { opacity: 1 } : { opacity: 1, y: 0 },
|
|
2741
|
+
exit: prefersReducedMotion ? { opacity: 0 } : { opacity: 0, y: -6 },
|
|
2880
2742
|
transition: uploadListItemTransition,
|
|
2881
|
-
children: /* @__PURE__ */ (0,
|
|
2882
|
-
/* @__PURE__ */ (0,
|
|
2743
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Card, { variant: "panel", className: "flex items-center gap-4 p-4", children: [
|
|
2744
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "flex size-11 shrink-0 items-center justify-center rounded-full bg-[color:var(--sofya-surface-hover)] text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2883
2745
|
UploadFileTypeGlyph,
|
|
2884
2746
|
{
|
|
2885
2747
|
className: "size-[18px]",
|
|
2886
2748
|
kind: resolveUploadFileVisualKind(file, uploadKind)
|
|
2887
2749
|
}
|
|
2888
2750
|
) }),
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2751
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
2752
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "truncate text-[color:var(--sofya-text-default)]", children: renderTextContent(file.name, {
|
|
2891
2753
|
as: "span",
|
|
2892
2754
|
className: "block truncate text-[color:var(--sofya-text-default)]",
|
|
2893
2755
|
size: "body",
|
|
@@ -2895,7 +2757,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2895
2757
|
fontWeight: 500
|
|
2896
2758
|
}
|
|
2897
2759
|
}) }),
|
|
2898
|
-
/* @__PURE__ */ (0,
|
|
2760
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "mt-2 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(
|
|
2899
2761
|
`${resolveUploadFileBadge(
|
|
2900
2762
|
file
|
|
2901
2763
|
)} \xB7 ${formatUploadFileSize(file.size)}`,
|
|
@@ -2906,7 +2768,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2906
2768
|
}
|
|
2907
2769
|
) })
|
|
2908
2770
|
] }),
|
|
2909
|
-
/* @__PURE__ */ (0,
|
|
2771
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2910
2772
|
"button",
|
|
2911
2773
|
{
|
|
2912
2774
|
"aria-label": `Remover ${file.name}`,
|
|
@@ -2918,7 +2780,7 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2918
2780
|
event.stopPropagation();
|
|
2919
2781
|
handleRemoveFile(index);
|
|
2920
2782
|
},
|
|
2921
|
-
children: /* @__PURE__ */ (0,
|
|
2783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2922
2784
|
Icon,
|
|
2923
2785
|
{
|
|
2924
2786
|
"aria-hidden": "true",
|
|
@@ -2936,9 +2798,104 @@ var UploadInputControl = React13.forwardRef(function UploadInputControl2({
|
|
|
2936
2798
|
}) }) })
|
|
2937
2799
|
] });
|
|
2938
2800
|
});
|
|
2939
|
-
UploadInputControl.displayName = "UploadInputControl";
|
|
2940
|
-
|
|
2941
|
-
|
|
2801
|
+
UploadInputControl.displayName = "UploadInputControl";
|
|
2802
|
+
|
|
2803
|
+
// src/components/input-otp.tsx
|
|
2804
|
+
var React16 = __toESM(require("react"), 1);
|
|
2805
|
+
var import_input_otp = require("input-otp");
|
|
2806
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2807
|
+
var InputOTP = React16.forwardRef(({ className, containerClassName, ...props }, ref) => {
|
|
2808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2809
|
+
import_input_otp.OTPInput,
|
|
2810
|
+
{
|
|
2811
|
+
ref,
|
|
2812
|
+
containerClassName: cn(
|
|
2813
|
+
"flex items-center gap-4 has-[:disabled]:opacity-50",
|
|
2814
|
+
containerClassName
|
|
2815
|
+
),
|
|
2816
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
2817
|
+
...props
|
|
2818
|
+
}
|
|
2819
|
+
);
|
|
2820
|
+
});
|
|
2821
|
+
InputOTP.displayName = "InputOTP";
|
|
2822
|
+
var InputOTPGroup = React16.forwardRef(({ className, ...props }, ref) => {
|
|
2823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2824
|
+
"div",
|
|
2825
|
+
{
|
|
2826
|
+
ref,
|
|
2827
|
+
className: cn(
|
|
2828
|
+
"flex overflow-hidden rounded-[12px] border border-[color:var(--sofya-border-hover)] bg-card",
|
|
2829
|
+
className
|
|
2830
|
+
),
|
|
2831
|
+
...props
|
|
2832
|
+
}
|
|
2833
|
+
);
|
|
2834
|
+
});
|
|
2835
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
2836
|
+
var InputOTPSlot = React16.forwardRef(
|
|
2837
|
+
({ className, index, ...props }, ref) => {
|
|
2838
|
+
const otpContext = React16.useContext(import_input_otp.OTPInputContext);
|
|
2839
|
+
const slot = otpContext.slots[index];
|
|
2840
|
+
if (!slot) {
|
|
2841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2842
|
+
"div",
|
|
2843
|
+
{
|
|
2844
|
+
ref,
|
|
2845
|
+
className: cn(
|
|
2846
|
+
"relative flex h-[92px] w-[96px] items-center justify-center border-r border-[color:var(--sofya-border-strong)] bg-card last:border-r-0",
|
|
2847
|
+
className
|
|
2848
|
+
),
|
|
2849
|
+
...props
|
|
2850
|
+
}
|
|
2851
|
+
);
|
|
2852
|
+
}
|
|
2853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2854
|
+
"div",
|
|
2855
|
+
{
|
|
2856
|
+
ref,
|
|
2857
|
+
className: cn(
|
|
2858
|
+
"relative flex h-[92px] w-[96px] items-center justify-center border-r border-[color:var(--sofya-border-strong)] bg-card text-[40px] font-medium leading-none tracking-[-0.04em] text-[color:var(--sofya-text-default)] transition-[background-color,box-shadow,border-color,color] duration-sofya ease-sofya last:border-r-0",
|
|
2859
|
+
slot.isActive && "z-10 border-transparent bg-[color:var(--sofya-surface-hover)] text-primary shadow-[var(--sofya-shadow-otp-focus)] ring-2 ring-inset ring-[color:var(--sofya-focus-ring-strong)]",
|
|
2860
|
+
className
|
|
2861
|
+
),
|
|
2862
|
+
...props,
|
|
2863
|
+
children: [
|
|
2864
|
+
slot.char ?? null,
|
|
2865
|
+
slot.hasFakeCaret ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "h-10 w-[2px] animate-pulse rounded-full bg-primary shadow-[var(--sofya-shadow-caret-glow)]" }) }) : null
|
|
2866
|
+
]
|
|
2867
|
+
}
|
|
2868
|
+
);
|
|
2869
|
+
}
|
|
2870
|
+
);
|
|
2871
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
2872
|
+
var InputOTPSeparator = React16.forwardRef(({ className, ...props }, ref) => {
|
|
2873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2874
|
+
"div",
|
|
2875
|
+
{
|
|
2876
|
+
ref,
|
|
2877
|
+
role: "separator",
|
|
2878
|
+
className: cn(
|
|
2879
|
+
"flex items-center justify-center px-2 text-[28px] leading-none text-[color:var(--sofya-text-soft)]",
|
|
2880
|
+
className
|
|
2881
|
+
),
|
|
2882
|
+
...props,
|
|
2883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": "true", children: "." })
|
|
2884
|
+
}
|
|
2885
|
+
);
|
|
2886
|
+
});
|
|
2887
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
2888
|
+
|
|
2889
|
+
// src/components/input.tsx
|
|
2890
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2891
|
+
var inputVariantOptions = [
|
|
2892
|
+
"default",
|
|
2893
|
+
"search",
|
|
2894
|
+
"otp",
|
|
2895
|
+
"upload"
|
|
2896
|
+
];
|
|
2897
|
+
var Input = React17.forwardRef((props, ref) => {
|
|
2898
|
+
const generatedId = React17.useId();
|
|
2942
2899
|
const resolvedId = props.id ?? generatedId;
|
|
2943
2900
|
const variant = props.variant ?? "default";
|
|
2944
2901
|
if (variant === "otp") {
|
|
@@ -2966,7 +2923,7 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
2966
2923
|
);
|
|
2967
2924
|
const hasTrailingGroup = resolvedSplitIndex < resolvedLength;
|
|
2968
2925
|
const otpAriaLabel = otpProps["aria-label"] ?? "Verification code";
|
|
2969
|
-
const otpControl = /* @__PURE__ */ (0,
|
|
2926
|
+
const otpControl = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2970
2927
|
InputOTP,
|
|
2971
2928
|
{
|
|
2972
2929
|
ref,
|
|
@@ -2979,7 +2936,7 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
2979
2936
|
containerClassName: className2,
|
|
2980
2937
|
...otpProps,
|
|
2981
2938
|
children: [
|
|
2982
|
-
/* @__PURE__ */ (0,
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InputOTPGroup, { className: otpGroupClassName, children: Array.from({ length: resolvedSplitIndex }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2983
2940
|
InputOTPSlot,
|
|
2984
2941
|
{
|
|
2985
2942
|
className: otpSlotClassName,
|
|
@@ -2987,10 +2944,10 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
2987
2944
|
},
|
|
2988
2945
|
`otp-leading-${index}`
|
|
2989
2946
|
)) }),
|
|
2990
|
-
hasTrailingGroup ? otpSeparator ?? /* @__PURE__ */ (0,
|
|
2991
|
-
hasTrailingGroup ? /* @__PURE__ */ (0,
|
|
2947
|
+
hasTrailingGroup ? otpSeparator ?? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InputOTPSeparator, { className: otpSeparatorClassName }) : null,
|
|
2948
|
+
hasTrailingGroup ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(InputOTPGroup, { className: otpGroupClassName, children: Array.from(
|
|
2992
2949
|
{ length: resolvedLength - resolvedSplitIndex },
|
|
2993
|
-
(_, index) => /* @__PURE__ */ (0,
|
|
2950
|
+
(_, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2994
2951
|
InputOTPSlot,
|
|
2995
2952
|
{
|
|
2996
2953
|
className: otpSlotClassName,
|
|
@@ -3002,12 +2959,12 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3002
2959
|
]
|
|
3003
2960
|
}
|
|
3004
2961
|
);
|
|
3005
|
-
return /* @__PURE__ */ (0,
|
|
3006
|
-
|
|
2962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2963
|
+
FieldShell,
|
|
3007
2964
|
{
|
|
3008
2965
|
containerClassName: containerClassName2,
|
|
3009
2966
|
control: otpControl,
|
|
3010
|
-
resolvedId
|
|
2967
|
+
labelHtmlFor: resolvedId
|
|
3011
2968
|
}
|
|
3012
2969
|
);
|
|
3013
2970
|
}
|
|
@@ -3021,7 +2978,7 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3021
2978
|
variant: _variant2,
|
|
3022
2979
|
...uploadProps
|
|
3023
2980
|
} = props;
|
|
3024
|
-
const uploadControl = /* @__PURE__ */ (0,
|
|
2981
|
+
const uploadControl = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3025
2982
|
UploadInputControl,
|
|
3026
2983
|
{
|
|
3027
2984
|
...uploadProps,
|
|
@@ -3029,14 +2986,28 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3029
2986
|
resolvedId
|
|
3030
2987
|
}
|
|
3031
2988
|
);
|
|
3032
|
-
|
|
3033
|
-
|
|
2989
|
+
const uploadLabel = label2 || uploadOptionalLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2990
|
+
renderTextContent(label2, {
|
|
2991
|
+
as: "span",
|
|
2992
|
+
className: "text-[color:var(--sofya-text-default)]",
|
|
2993
|
+
size: "body",
|
|
2994
|
+
style: {
|
|
2995
|
+
fontWeight: 700
|
|
2996
|
+
}
|
|
2997
|
+
}),
|
|
2998
|
+
uploadOptionalLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "ml-2 text-[color:var(--sofya-text-subtle)]", children: renderTextContent(uploadOptionalLabel, {
|
|
2999
|
+
as: "span",
|
|
3000
|
+
className: "text-[color:var(--sofya-text-subtle)]",
|
|
3001
|
+
size: "tiny"
|
|
3002
|
+
}) }) : null
|
|
3003
|
+
] }) : void 0;
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3005
|
+
FieldShell,
|
|
3034
3006
|
{
|
|
3035
3007
|
containerClassName: containerClassName2,
|
|
3036
3008
|
control: uploadControl,
|
|
3037
|
-
label:
|
|
3038
|
-
labelClassName: labelClassName2
|
|
3039
|
-
optionalLabel: uploadOptionalLabel
|
|
3009
|
+
label: uploadLabel,
|
|
3010
|
+
labelClassName: labelClassName2
|
|
3040
3011
|
}
|
|
3041
3012
|
);
|
|
3042
3013
|
}
|
|
@@ -3053,8 +3024,8 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3053
3024
|
const isSearch = variant === "search";
|
|
3054
3025
|
const resolvedType = type ?? (isSearch ? "search" : void 0);
|
|
3055
3026
|
const ariaLabel = nativeProps["aria-label"] ?? (typeof label === "string" ? label : isSearch ? "Search" : void 0);
|
|
3056
|
-
const nativeControl = isSearch ? /* @__PURE__ */ (0,
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3027
|
+
const nativeControl = isSearch ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex h-[88px] w-full items-center gap-6 rounded-full border border-[color:var(--sofya-border-strong)] bg-card px-8 shadow-none transition-[border-color,box-shadow,background-color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] hover:ring-2 hover:ring-[color:var(--sofya-focus-ring-soft)] focus-within:border-transparent focus-within:ring-2 focus-within:ring-[color:var(--sofya-focus-ring-soft)] has-[:active]:border-transparent has-[:active]:ring-2 has-[:active]:ring-[color:var(--sofya-focus-ring-soft)]", children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3058
3029
|
Icon,
|
|
3059
3030
|
{
|
|
3060
3031
|
"aria-hidden": "true",
|
|
@@ -3063,7 +3034,7 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3063
3034
|
size: 32
|
|
3064
3035
|
}
|
|
3065
3036
|
),
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3037
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3067
3038
|
"input",
|
|
3068
3039
|
{
|
|
3069
3040
|
id: resolvedId,
|
|
@@ -3079,7 +3050,7 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3079
3050
|
placeholder: nativeProps.placeholder ?? "Search"
|
|
3080
3051
|
}
|
|
3081
3052
|
)
|
|
3082
|
-
] }) : /* @__PURE__ */ (0,
|
|
3053
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3083
3054
|
"input",
|
|
3084
3055
|
{
|
|
3085
3056
|
id: resolvedId,
|
|
@@ -3093,25 +3064,25 @@ var Input = React13.forwardRef((props, ref) => {
|
|
|
3093
3064
|
"aria-label": ariaLabel
|
|
3094
3065
|
}
|
|
3095
3066
|
);
|
|
3096
|
-
return /* @__PURE__ */ (0,
|
|
3097
|
-
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3068
|
+
FieldShell,
|
|
3098
3069
|
{
|
|
3099
3070
|
containerClassName,
|
|
3100
3071
|
control: nativeControl,
|
|
3101
3072
|
label: isSearch ? void 0 : label,
|
|
3102
3073
|
labelClassName: isSearch ? void 0 : labelClassName,
|
|
3103
|
-
resolvedId
|
|
3074
|
+
labelHtmlFor: isSearch ? void 0 : resolvedId
|
|
3104
3075
|
}
|
|
3105
3076
|
);
|
|
3106
3077
|
});
|
|
3107
3078
|
Input.displayName = "Input";
|
|
3108
3079
|
|
|
3109
3080
|
// src/components/label.tsx
|
|
3110
|
-
var
|
|
3111
|
-
var
|
|
3112
|
-
var Label =
|
|
3081
|
+
var React18 = __toESM(require("react"), 1);
|
|
3082
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3083
|
+
var Label = React18.forwardRef(
|
|
3113
3084
|
({ children, className, ...props }, ref) => {
|
|
3114
|
-
return /* @__PURE__ */ (0,
|
|
3085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3115
3086
|
"label",
|
|
3116
3087
|
{
|
|
3117
3088
|
ref,
|
|
@@ -3135,10 +3106,10 @@ var Label = React14.forwardRef(
|
|
|
3135
3106
|
Label.displayName = "Label";
|
|
3136
3107
|
|
|
3137
3108
|
// src/components/link.tsx
|
|
3138
|
-
var
|
|
3109
|
+
var React19 = __toESM(require("react"), 1);
|
|
3139
3110
|
var import_react_slot3 = require("@radix-ui/react-slot");
|
|
3140
3111
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
3141
|
-
var
|
|
3112
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3142
3113
|
var linkVariants = (0, import_class_variance_authority6.cva)(
|
|
3143
3114
|
"inline bg-[linear-gradient(currentColor,currentColor)] bg-[position:0_100%] bg-no-repeat pb-0 text-primary no-underline transition-[color,background-size,box-shadow] duration-sofya ease-sofya hover:text-[color:var(--sofya-link-hover)] focus-visible:rounded-[4px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
3144
3115
|
{
|
|
@@ -3153,9 +3124,9 @@ var linkVariants = (0, import_class_variance_authority6.cva)(
|
|
|
3153
3124
|
}
|
|
3154
3125
|
}
|
|
3155
3126
|
);
|
|
3156
|
-
var Link =
|
|
3127
|
+
var Link = React19.forwardRef(function Link2({ asChild = false, children, className, variant = "default", ...props }, ref) {
|
|
3157
3128
|
const Component = asChild ? import_react_slot3.Slot : "a";
|
|
3158
|
-
return /* @__PURE__ */ (0,
|
|
3129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3159
3130
|
Component,
|
|
3160
3131
|
{
|
|
3161
3132
|
ref,
|
|
@@ -3173,7 +3144,7 @@ var Link = React15.forwardRef(function Link2({ asChild = false, children, classN
|
|
|
3173
3144
|
Link.displayName = "Link";
|
|
3174
3145
|
|
|
3175
3146
|
// src/components/logo.tsx
|
|
3176
|
-
var
|
|
3147
|
+
var React20 = __toESM(require("react"), 1);
|
|
3177
3148
|
|
|
3178
3149
|
// src/components/logo-data.ts
|
|
3179
3150
|
var logoAssets = {
|
|
@@ -3270,7 +3241,7 @@ var logoAssets = {
|
|
|
3270
3241
|
};
|
|
3271
3242
|
|
|
3272
3243
|
// src/components/logo.tsx
|
|
3273
|
-
var
|
|
3244
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3274
3245
|
var logoVariants = ["mono", "default", "text", "full"];
|
|
3275
3246
|
var logoSizeOptions = ["sm", "md", "lg", "xl", "2xl"];
|
|
3276
3247
|
var logoSizeScale = {
|
|
@@ -3306,7 +3277,7 @@ function resolveLogoDimensions(variant, size, width, height) {
|
|
|
3306
3277
|
height: resolvedHeight
|
|
3307
3278
|
};
|
|
3308
3279
|
}
|
|
3309
|
-
var Logo =
|
|
3280
|
+
var Logo = React20.forwardRef(function Logo2({
|
|
3310
3281
|
variant = "full",
|
|
3311
3282
|
size = "lg",
|
|
3312
3283
|
width,
|
|
@@ -3317,10 +3288,10 @@ var Logo = React16.forwardRef(function Logo2({
|
|
|
3317
3288
|
...props
|
|
3318
3289
|
}, ref) {
|
|
3319
3290
|
const asset = logoAssets[variant];
|
|
3320
|
-
const titleId =
|
|
3291
|
+
const titleId = React20.useId();
|
|
3321
3292
|
const dimensions = resolveLogoDimensions(variant, size, width, height);
|
|
3322
3293
|
const monoFill = variant === "mono" ? monoColor ?? "currentColor" : void 0;
|
|
3323
|
-
return /* @__PURE__ */ (0,
|
|
3294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
3324
3295
|
"svg",
|
|
3325
3296
|
{
|
|
3326
3297
|
ref,
|
|
@@ -3335,8 +3306,8 @@ var Logo = React16.forwardRef(function Logo2({
|
|
|
3335
3306
|
focusable: "false",
|
|
3336
3307
|
...props,
|
|
3337
3308
|
children: [
|
|
3338
|
-
title ? /* @__PURE__ */ (0,
|
|
3339
|
-
asset.paths.map((path, index) => /* @__PURE__ */ (0,
|
|
3309
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("title", { id: titleId, children: title }) : null,
|
|
3310
|
+
asset.paths.map((path, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3340
3311
|
"path",
|
|
3341
3312
|
{
|
|
3342
3313
|
d: path.d,
|
|
@@ -3353,10 +3324,12 @@ var Logo = React16.forwardRef(function Logo2({
|
|
|
3353
3324
|
Logo.displayName = "Logo";
|
|
3354
3325
|
|
|
3355
3326
|
// src/components/pagination.tsx
|
|
3327
|
+
var import_icons_react5 = require("@tabler/icons-react");
|
|
3356
3328
|
var import_react_slot4 = require("@radix-ui/react-slot");
|
|
3357
3329
|
var import_class_variance_authority7 = require("class-variance-authority");
|
|
3358
|
-
|
|
3359
|
-
|
|
3330
|
+
|
|
3331
|
+
// src/lib/inherited-typography.ts
|
|
3332
|
+
var inheritedTypographyStyle = {
|
|
3360
3333
|
color: "inherit",
|
|
3361
3334
|
fontFamily: "inherit",
|
|
3362
3335
|
fontSize: "inherit",
|
|
@@ -3364,6 +3337,9 @@ var inheritTypographyStyle = {
|
|
|
3364
3337
|
letterSpacing: "inherit",
|
|
3365
3338
|
lineHeight: "inherit"
|
|
3366
3339
|
};
|
|
3340
|
+
|
|
3341
|
+
// src/components/pagination.tsx
|
|
3342
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3367
3343
|
var paginationLinkVariants = (0, import_class_variance_authority7.cva)(
|
|
3368
3344
|
"inline-flex h-10 min-w-10 items-center justify-center rounded-full border border-transparent px-4 [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] font-medium leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-soft)] no-underline transition-[transform,background-color,border-color,color,box-shadow] duration-sofya ease-sofya motion-safe:active:scale-[0.985] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0",
|
|
3369
3345
|
{
|
|
@@ -3384,7 +3360,7 @@ var paginationLinkVariants = (0, import_class_variance_authority7.cva)(
|
|
|
3384
3360
|
}
|
|
3385
3361
|
);
|
|
3386
3362
|
function Pagination({ className, ...props }) {
|
|
3387
|
-
return /* @__PURE__ */ (0,
|
|
3363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3388
3364
|
"nav",
|
|
3389
3365
|
{
|
|
3390
3366
|
"aria-label": "Pagination",
|
|
@@ -3397,7 +3373,7 @@ function PaginationContent({
|
|
|
3397
3373
|
className,
|
|
3398
3374
|
...props
|
|
3399
3375
|
}) {
|
|
3400
|
-
return /* @__PURE__ */ (0,
|
|
3376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3401
3377
|
"ul",
|
|
3402
3378
|
{
|
|
3403
3379
|
className: cn(
|
|
@@ -3409,7 +3385,7 @@ function PaginationContent({
|
|
|
3409
3385
|
);
|
|
3410
3386
|
}
|
|
3411
3387
|
function PaginationItem({ className, ...props }) {
|
|
3412
|
-
return /* @__PURE__ */ (0,
|
|
3388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("li", { className: cn("list-none", className), ...props });
|
|
3413
3389
|
}
|
|
3414
3390
|
function PaginationLink({
|
|
3415
3391
|
asChild = false,
|
|
@@ -3419,7 +3395,7 @@ function PaginationLink({
|
|
|
3419
3395
|
...props
|
|
3420
3396
|
}) {
|
|
3421
3397
|
const Component = asChild ? import_react_slot4.Slot : "a";
|
|
3422
|
-
return /* @__PURE__ */ (0,
|
|
3398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3423
3399
|
Component,
|
|
3424
3400
|
{
|
|
3425
3401
|
"aria-current": isActive ? "page" : void 0,
|
|
@@ -3429,67 +3405,29 @@ function PaginationLink({
|
|
|
3429
3405
|
);
|
|
3430
3406
|
}
|
|
3431
3407
|
function PaginationChevronLeft() {
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3433
|
-
"svg",
|
|
3434
|
-
{
|
|
3435
|
-
"aria-hidden": "true",
|
|
3436
|
-
className: "h-4 w-4",
|
|
3437
|
-
viewBox: "0 0 16 16",
|
|
3438
|
-
fill: "none",
|
|
3439
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3440
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3441
|
-
"path",
|
|
3442
|
-
{
|
|
3443
|
-
d: "M9.5 3.5L5 8L9.5 12.5",
|
|
3444
|
-
stroke: "currentColor",
|
|
3445
|
-
strokeWidth: "1.75",
|
|
3446
|
-
strokeLinecap: "round",
|
|
3447
|
-
strokeLinejoin: "round"
|
|
3448
|
-
}
|
|
3449
|
-
)
|
|
3450
|
-
}
|
|
3451
|
-
);
|
|
3408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons_react5.IconChevronLeft, { "aria-hidden": "true", className: "h-4 w-4", stroke: 1.75 });
|
|
3452
3409
|
}
|
|
3453
3410
|
function PaginationChevronRight() {
|
|
3454
|
-
return /* @__PURE__ */ (0,
|
|
3455
|
-
"svg",
|
|
3456
|
-
{
|
|
3457
|
-
"aria-hidden": "true",
|
|
3458
|
-
className: "h-4 w-4",
|
|
3459
|
-
viewBox: "0 0 16 16",
|
|
3460
|
-
fill: "none",
|
|
3461
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3462
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3463
|
-
"path",
|
|
3464
|
-
{
|
|
3465
|
-
d: "M6.5 3.5L11 8L6.5 12.5",
|
|
3466
|
-
stroke: "currentColor",
|
|
3467
|
-
strokeWidth: "1.75",
|
|
3468
|
-
strokeLinecap: "round",
|
|
3469
|
-
strokeLinejoin: "round"
|
|
3470
|
-
}
|
|
3471
|
-
)
|
|
3472
|
-
}
|
|
3473
|
-
);
|
|
3411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_icons_react5.IconChevronRight, { "aria-hidden": "true", className: "h-4 w-4", stroke: 1.75 });
|
|
3474
3412
|
}
|
|
3475
3413
|
function PaginationPrevious({
|
|
3476
3414
|
className,
|
|
3477
3415
|
text = "Previous",
|
|
3478
3416
|
...props
|
|
3479
3417
|
}) {
|
|
3480
|
-
return /* @__PURE__ */ (0,
|
|
3418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3481
3419
|
PaginationLink,
|
|
3482
3420
|
{
|
|
3483
3421
|
"aria-label": "Go to previous page",
|
|
3484
3422
|
className: cn("gap-2 px-4", className),
|
|
3485
3423
|
...props,
|
|
3486
3424
|
children: [
|
|
3487
|
-
/* @__PURE__ */ (0,
|
|
3488
|
-
/* @__PURE__ */ (0,
|
|
3425
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PaginationChevronLeft, {}),
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:block", children: renderTextContent(text, {
|
|
3489
3427
|
as: "span",
|
|
3490
3428
|
className: "block text-inherit",
|
|
3491
3429
|
size: "body",
|
|
3492
|
-
style:
|
|
3430
|
+
style: inheritedTypographyStyle
|
|
3493
3431
|
}) })
|
|
3494
3432
|
]
|
|
3495
3433
|
}
|
|
@@ -3500,20 +3438,20 @@ function PaginationNext({
|
|
|
3500
3438
|
text = "Next",
|
|
3501
3439
|
...props
|
|
3502
3440
|
}) {
|
|
3503
|
-
return /* @__PURE__ */ (0,
|
|
3441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3504
3442
|
PaginationLink,
|
|
3505
3443
|
{
|
|
3506
3444
|
"aria-label": "Go to next page",
|
|
3507
3445
|
className: cn("gap-2 px-4", className),
|
|
3508
3446
|
...props,
|
|
3509
3447
|
children: [
|
|
3510
|
-
/* @__PURE__ */ (0,
|
|
3448
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:block", children: renderTextContent(text, {
|
|
3511
3449
|
as: "span",
|
|
3512
3450
|
className: "block text-inherit",
|
|
3513
3451
|
size: "body",
|
|
3514
|
-
style:
|
|
3452
|
+
style: inheritedTypographyStyle
|
|
3515
3453
|
}) }),
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(PaginationChevronRight, {})
|
|
3517
3455
|
]
|
|
3518
3456
|
}
|
|
3519
3457
|
);
|
|
@@ -3522,7 +3460,7 @@ function PaginationEllipsis({
|
|
|
3522
3460
|
className,
|
|
3523
3461
|
...props
|
|
3524
3462
|
}) {
|
|
3525
|
-
return /* @__PURE__ */ (0,
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3526
3464
|
"span",
|
|
3527
3465
|
{
|
|
3528
3466
|
"aria-hidden": "true",
|
|
@@ -3532,35 +3470,35 @@ function PaginationEllipsis({
|
|
|
3532
3470
|
),
|
|
3533
3471
|
...props,
|
|
3534
3472
|
children: [
|
|
3535
|
-
/* @__PURE__ */ (0,
|
|
3473
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: renderTextContent("...", {
|
|
3536
3474
|
as: "span",
|
|
3537
3475
|
className: "block text-inherit",
|
|
3538
3476
|
size: "h5",
|
|
3539
|
-
style:
|
|
3477
|
+
style: inheritedTypographyStyle
|
|
3540
3478
|
}) }),
|
|
3541
|
-
/* @__PURE__ */ (0,
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "sr-only", children: "More pages" })
|
|
3542
3480
|
]
|
|
3543
3481
|
}
|
|
3544
3482
|
);
|
|
3545
3483
|
}
|
|
3546
3484
|
|
|
3547
3485
|
// src/components/popover.tsx
|
|
3548
|
-
var
|
|
3486
|
+
var React21 = __toESM(require("react"), 1);
|
|
3549
3487
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
3550
|
-
var
|
|
3488
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3551
3489
|
var Popover = PopoverPrimitive.Root;
|
|
3552
3490
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
3553
3491
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
3554
3492
|
var PopoverPortal = PopoverPrimitive.Portal;
|
|
3555
3493
|
var PopoverClose = PopoverPrimitive.Close;
|
|
3556
|
-
var PopoverContent =
|
|
3494
|
+
var PopoverContent = React21.forwardRef(function PopoverContent2({
|
|
3557
3495
|
align = "center",
|
|
3558
3496
|
className,
|
|
3559
3497
|
collisionPadding = 8,
|
|
3560
3498
|
sideOffset = 8,
|
|
3561
3499
|
...props
|
|
3562
3500
|
}, ref) {
|
|
3563
|
-
return /* @__PURE__ */ (0,
|
|
3501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3564
3502
|
PopoverPrimitive.Content,
|
|
3565
3503
|
{
|
|
3566
3504
|
ref,
|
|
@@ -3577,8 +3515,8 @@ var PopoverContent = React17.forwardRef(function PopoverContent2({
|
|
|
3577
3515
|
) });
|
|
3578
3516
|
});
|
|
3579
3517
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
3580
|
-
var PopoverTitle =
|
|
3581
|
-
return /* @__PURE__ */ (0,
|
|
3518
|
+
var PopoverTitle = React21.forwardRef(function PopoverTitle2({ children, className, ...props }, ref) {
|
|
3519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3582
3520
|
"h4",
|
|
3583
3521
|
{
|
|
3584
3522
|
ref,
|
|
@@ -3594,8 +3532,8 @@ var PopoverTitle = React17.forwardRef(function PopoverTitle2({ children, classNa
|
|
|
3594
3532
|
);
|
|
3595
3533
|
});
|
|
3596
3534
|
PopoverTitle.displayName = "PopoverTitle";
|
|
3597
|
-
var PopoverDescription =
|
|
3598
|
-
return /* @__PURE__ */ (0,
|
|
3535
|
+
var PopoverDescription = React21.forwardRef(function PopoverDescription2({ children, className, ...props }, ref) {
|
|
3536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3599
3537
|
"p",
|
|
3600
3538
|
{
|
|
3601
3539
|
ref,
|
|
@@ -3613,9 +3551,9 @@ var PopoverDescription = React17.forwardRef(function PopoverDescription2({ child
|
|
|
3613
3551
|
PopoverDescription.displayName = "PopoverDescription";
|
|
3614
3552
|
|
|
3615
3553
|
// src/components/progress.tsx
|
|
3616
|
-
var
|
|
3554
|
+
var React22 = __toESM(require("react"), 1);
|
|
3617
3555
|
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
3618
|
-
var
|
|
3556
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3619
3557
|
var progressSizeOptions = ["sm", "default", "lg"];
|
|
3620
3558
|
function clampProgressValue(value, max) {
|
|
3621
3559
|
if (Number.isNaN(value)) {
|
|
@@ -3623,7 +3561,7 @@ function clampProgressValue(value, max) {
|
|
|
3623
3561
|
}
|
|
3624
3562
|
return Math.min(Math.max(value, 0), max);
|
|
3625
3563
|
}
|
|
3626
|
-
var Progress =
|
|
3564
|
+
var Progress = React22.forwardRef(function Progress2({
|
|
3627
3565
|
className,
|
|
3628
3566
|
indicatorClassName,
|
|
3629
3567
|
max = 100,
|
|
@@ -3634,7 +3572,7 @@ var Progress = React18.forwardRef(function Progress2({
|
|
|
3634
3572
|
const safeMax = max > 0 ? max : 100;
|
|
3635
3573
|
const resolvedValue = typeof value === "number" ? clampProgressValue(value, safeMax) : null;
|
|
3636
3574
|
const progressScale = resolvedValue === null ? void 0 : Number((resolvedValue / safeMax).toFixed(4));
|
|
3637
|
-
return /* @__PURE__ */ (0,
|
|
3575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3638
3576
|
ProgressPrimitive.Root,
|
|
3639
3577
|
{
|
|
3640
3578
|
ref,
|
|
@@ -3647,7 +3585,7 @@ var Progress = React18.forwardRef(function Progress2({
|
|
|
3647
3585
|
className
|
|
3648
3586
|
),
|
|
3649
3587
|
...props,
|
|
3650
|
-
children: /* @__PURE__ */ (0,
|
|
3588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3651
3589
|
ProgressPrimitive.Indicator,
|
|
3652
3590
|
{
|
|
3653
3591
|
"data-slot": "progress-indicator",
|
|
@@ -3664,12 +3602,12 @@ var Progress = React18.forwardRef(function Progress2({
|
|
|
3664
3602
|
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
3665
3603
|
|
|
3666
3604
|
// src/components/radio-group.tsx
|
|
3667
|
-
var
|
|
3605
|
+
var React23 = __toESM(require("react"), 1);
|
|
3668
3606
|
var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
|
|
3669
|
-
var
|
|
3607
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3670
3608
|
var radioGroupOrientationOptions = ["horizontal", "vertical"];
|
|
3671
|
-
var RadioGroup2 =
|
|
3672
|
-
return /* @__PURE__ */ (0,
|
|
3609
|
+
var RadioGroup2 = React23.forwardRef(function RadioGroup3({ className, ...props }, ref) {
|
|
3610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3673
3611
|
RadioGroupPrimitive.Root,
|
|
3674
3612
|
{
|
|
3675
3613
|
ref,
|
|
@@ -3683,7 +3621,7 @@ var RadioGroup2 = React19.forwardRef(function RadioGroup3({ className, ...props
|
|
|
3683
3621
|
);
|
|
3684
3622
|
});
|
|
3685
3623
|
RadioGroup2.displayName = RadioGroupPrimitive.Root.displayName;
|
|
3686
|
-
var RadioGroupItem =
|
|
3624
|
+
var RadioGroupItem = React23.forwardRef(function RadioGroupItem2({
|
|
3687
3625
|
className,
|
|
3688
3626
|
controlClassName,
|
|
3689
3627
|
description,
|
|
@@ -3695,22 +3633,21 @@ var RadioGroupItem = React19.forwardRef(function RadioGroupItem2({
|
|
|
3695
3633
|
labelClassName,
|
|
3696
3634
|
...props
|
|
3697
3635
|
}, ref) {
|
|
3698
|
-
const generatedId =
|
|
3636
|
+
const generatedId = React23.useId();
|
|
3699
3637
|
const resolvedId = id ?? generatedId;
|
|
3700
3638
|
const labelId = label ? `${resolvedId}-label` : void 0;
|
|
3701
3639
|
const descriptionId = description ? `${resolvedId}-description` : void 0;
|
|
3702
3640
|
const alignClassName = description ? "items-start" : "items-center";
|
|
3703
|
-
return /* @__PURE__ */ (0,
|
|
3641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3704
3642
|
"label",
|
|
3705
3643
|
{
|
|
3706
|
-
className:
|
|
3707
|
-
"flex w-fit gap-4",
|
|
3644
|
+
className: selectionControlContainerClasses({
|
|
3708
3645
|
alignClassName,
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
),
|
|
3646
|
+
className,
|
|
3647
|
+
disabled
|
|
3648
|
+
}),
|
|
3712
3649
|
children: [
|
|
3713
|
-
/* @__PURE__ */ (0,
|
|
3650
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3714
3651
|
RadioGroupPrimitive.Item,
|
|
3715
3652
|
{
|
|
3716
3653
|
ref,
|
|
@@ -3720,11 +3657,13 @@ var RadioGroupItem = React19.forwardRef(function RadioGroupItem2({
|
|
|
3720
3657
|
"aria-describedby": descriptionId,
|
|
3721
3658
|
"data-slot": "radio-group-item",
|
|
3722
3659
|
className: cn(
|
|
3723
|
-
"peer mt-0 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full
|
|
3660
|
+
"peer mt-0 inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-primary-foreground outline-none",
|
|
3661
|
+
selectionControlControlBaseClasses,
|
|
3662
|
+
"focus-visible:ring-2 focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0 data-[state=checked]:border-primary data-[state=checked]:bg-primary aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/20",
|
|
3724
3663
|
controlClassName
|
|
3725
3664
|
),
|
|
3726
3665
|
...props,
|
|
3727
|
-
children: /* @__PURE__ */ (0,
|
|
3666
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(RadioGroupPrimitive.Indicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3728
3667
|
"span",
|
|
3729
3668
|
{
|
|
3730
3669
|
"data-slot": "radio-group-indicator",
|
|
@@ -3736,13 +3675,13 @@ var RadioGroupItem = React19.forwardRef(function RadioGroupItem2({
|
|
|
3736
3675
|
) })
|
|
3737
3676
|
}
|
|
3738
3677
|
),
|
|
3739
|
-
label || description ? /* @__PURE__ */ (0,
|
|
3740
|
-
label ? /* @__PURE__ */ (0,
|
|
3678
|
+
label || description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: selectionControlContentBaseClasses, children: [
|
|
3679
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3741
3680
|
"span",
|
|
3742
3681
|
{
|
|
3743
3682
|
id: labelId,
|
|
3744
3683
|
className: cn(
|
|
3745
|
-
|
|
3684
|
+
selectionControlLabelTextBaseClasses,
|
|
3746
3685
|
labelClassName
|
|
3747
3686
|
),
|
|
3748
3687
|
children: renderTextContent(label, {
|
|
@@ -3752,11 +3691,14 @@ var RadioGroupItem = React19.forwardRef(function RadioGroupItem2({
|
|
|
3752
3691
|
})
|
|
3753
3692
|
}
|
|
3754
3693
|
) : null,
|
|
3755
|
-
description ? /* @__PURE__ */ (0,
|
|
3694
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3756
3695
|
"span",
|
|
3757
3696
|
{
|
|
3758
3697
|
id: descriptionId,
|
|
3759
|
-
className: cn(
|
|
3698
|
+
className: cn(
|
|
3699
|
+
selectionControlDescriptionTextBaseClasses,
|
|
3700
|
+
descriptionClassName
|
|
3701
|
+
),
|
|
3760
3702
|
children: renderTextContent(description, {
|
|
3761
3703
|
as: "span",
|
|
3762
3704
|
className: "text-muted-foreground",
|
|
@@ -3772,12 +3714,12 @@ var RadioGroupItem = React19.forwardRef(function RadioGroupItem2({
|
|
|
3772
3714
|
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
3773
3715
|
|
|
3774
3716
|
// src/components/scroll-area.tsx
|
|
3775
|
-
var
|
|
3717
|
+
var React24 = __toESM(require("react"), 1);
|
|
3776
3718
|
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
3777
|
-
var
|
|
3719
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3778
3720
|
var scrollAreaOrientationOptions = ["horizontal", "vertical"];
|
|
3779
|
-
var ScrollArea =
|
|
3780
|
-
return /* @__PURE__ */ (0,
|
|
3721
|
+
var ScrollArea = React24.forwardRef(function ScrollArea2({ className, ...props }, ref) {
|
|
3722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3781
3723
|
ScrollAreaPrimitive.Root,
|
|
3782
3724
|
{
|
|
3783
3725
|
ref,
|
|
@@ -3788,8 +3730,8 @@ var ScrollArea = React20.forwardRef(function ScrollArea2({ className, ...props }
|
|
|
3788
3730
|
);
|
|
3789
3731
|
});
|
|
3790
3732
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
3791
|
-
var ScrollAreaViewport =
|
|
3792
|
-
return /* @__PURE__ */ (0,
|
|
3733
|
+
var ScrollAreaViewport = React24.forwardRef(function ScrollAreaViewport2({ className, ...props }, ref) {
|
|
3734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3793
3735
|
ScrollAreaPrimitive.Viewport,
|
|
3794
3736
|
{
|
|
3795
3737
|
ref,
|
|
@@ -3803,8 +3745,8 @@ var ScrollAreaViewport = React20.forwardRef(function ScrollAreaViewport2({ class
|
|
|
3803
3745
|
);
|
|
3804
3746
|
});
|
|
3805
3747
|
ScrollAreaViewport.displayName = ScrollAreaPrimitive.Viewport.displayName;
|
|
3806
|
-
var ScrollAreaScrollbar =
|
|
3807
|
-
return /* @__PURE__ */ (0,
|
|
3748
|
+
var ScrollAreaScrollbar = React24.forwardRef(function ScrollAreaScrollbar2({ className, orientation = "vertical", thumbClassName, ...props }, ref) {
|
|
3749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3808
3750
|
ScrollAreaPrimitive.Scrollbar,
|
|
3809
3751
|
{
|
|
3810
3752
|
ref,
|
|
@@ -3815,7 +3757,7 @@ var ScrollAreaScrollbar = React20.forwardRef(function ScrollAreaScrollbar2({ cla
|
|
|
3815
3757
|
className
|
|
3816
3758
|
),
|
|
3817
3759
|
...props,
|
|
3818
|
-
children: /* @__PURE__ */ (0,
|
|
3760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3819
3761
|
ScrollAreaPrimitive.Thumb,
|
|
3820
3762
|
{
|
|
3821
3763
|
"data-slot": "scroll-area-thumb",
|
|
@@ -3829,8 +3771,8 @@ var ScrollAreaScrollbar = React20.forwardRef(function ScrollAreaScrollbar2({ cla
|
|
|
3829
3771
|
);
|
|
3830
3772
|
});
|
|
3831
3773
|
ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName;
|
|
3832
|
-
var ScrollAreaCorner =
|
|
3833
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
+
var ScrollAreaCorner = React24.forwardRef(function ScrollAreaCorner2({ className, ...props }, ref) {
|
|
3775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3834
3776
|
ScrollAreaPrimitive.Corner,
|
|
3835
3777
|
{
|
|
3836
3778
|
ref,
|
|
@@ -3843,22 +3785,19 @@ var ScrollAreaCorner = React20.forwardRef(function ScrollAreaCorner2({ className
|
|
|
3843
3785
|
ScrollAreaCorner.displayName = ScrollAreaPrimitive.Corner.displayName;
|
|
3844
3786
|
|
|
3845
3787
|
// src/components/select.tsx
|
|
3846
|
-
var
|
|
3788
|
+
var React25 = __toESM(require("react"), 1);
|
|
3847
3789
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
letterSpacing: "inherit",
|
|
3855
|
-
lineHeight: "inherit"
|
|
3856
|
-
};
|
|
3790
|
+
|
|
3791
|
+
// src/lib/form-control-classes.ts
|
|
3792
|
+
var formControlBaseClasses = "flex w-full items-center justify-between gap-4 rounded-[10px] border border-[color:var(--sofya-border-strong)] bg-card px-4 text-left [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] [font-weight:var(--sofya-text-body-font-weight)] leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)] text-[color:var(--sofya-text-default)] shadow-none transition-[border-color,box-shadow,background-color,color] duration-sofya ease-sofya hover:border-[color:var(--sofya-border-hover)] focus:outline-none focus:ring-2 focus:ring-[color:var(--sofya-focus-ring-soft)] focus:ring-offset-0 active:border-transparent active:ring-2 active:ring-[color:var(--sofya-focus-ring-soft)] disabled:cursor-not-allowed disabled:bg-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus:ring-destructive/20 data-[placeholder]:text-[color:var(--sofya-text-placeholder)]";
|
|
3793
|
+
|
|
3794
|
+
// src/components/select.tsx
|
|
3795
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3857
3796
|
var selectSizeOptions = ["default", "sm"];
|
|
3858
3797
|
var Select = SelectPrimitive.Root;
|
|
3859
3798
|
var SelectGroup = SelectPrimitive.Group;
|
|
3860
|
-
var SelectValue =
|
|
3861
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
+
var SelectValue = React25.forwardRef(function SelectValue2({ className, ...props }, ref) {
|
|
3800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3862
3801
|
Text,
|
|
3863
3802
|
{
|
|
3864
3803
|
ref,
|
|
@@ -3866,34 +3805,28 @@ var SelectValue = React21.forwardRef(function SelectValue2({ className, ...props
|
|
|
3866
3805
|
"data-slot": "select-value",
|
|
3867
3806
|
className: cn("block truncate text-inherit", className),
|
|
3868
3807
|
size: "body",
|
|
3869
|
-
style:
|
|
3870
|
-
|
|
3871
|
-
fontSize: "inherit",
|
|
3872
|
-
fontWeight: "inherit",
|
|
3873
|
-
lineHeight: "inherit",
|
|
3874
|
-
letterSpacing: "inherit",
|
|
3875
|
-
color: "inherit"
|
|
3876
|
-
},
|
|
3877
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Value, { className: "block truncate", ...props })
|
|
3808
|
+
style: inheritedTypographyStyle,
|
|
3809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectPrimitive.Value, { className: "block truncate", ...props })
|
|
3878
3810
|
}
|
|
3879
3811
|
);
|
|
3880
3812
|
});
|
|
3881
3813
|
SelectValue.displayName = SelectPrimitive.Value.displayName;
|
|
3882
|
-
var SelectTrigger =
|
|
3883
|
-
return /* @__PURE__ */ (0,
|
|
3814
|
+
var SelectTrigger = React25.forwardRef(function SelectTrigger2({ className, children, size = "default", ...props }, ref) {
|
|
3815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3884
3816
|
SelectPrimitive.Trigger,
|
|
3885
3817
|
{
|
|
3886
3818
|
ref,
|
|
3887
3819
|
"data-slot": "select-trigger",
|
|
3888
3820
|
"data-size": size,
|
|
3889
3821
|
className: cn(
|
|
3890
|
-
|
|
3822
|
+
formControlBaseClasses,
|
|
3823
|
+
"data-[size=default]:h-10 data-[size=default]:py-2 data-[size=sm]:h-9 data-[size=sm]:px-2 data-[size=sm]:text-[14px] data-[size=sm]:leading-5 [&>span]:line-clamp-1 [&>span]:flex-1",
|
|
3891
3824
|
className
|
|
3892
3825
|
),
|
|
3893
3826
|
...props,
|
|
3894
3827
|
children: [
|
|
3895
3828
|
children,
|
|
3896
|
-
/* @__PURE__ */ (0,
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3897
3830
|
Icon,
|
|
3898
3831
|
{
|
|
3899
3832
|
name: "caret-down",
|
|
@@ -3906,8 +3839,8 @@ var SelectTrigger = React21.forwardRef(function SelectTrigger2({ className, chil
|
|
|
3906
3839
|
);
|
|
3907
3840
|
});
|
|
3908
3841
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
3909
|
-
var SelectScrollUpButton =
|
|
3910
|
-
return /* @__PURE__ */ (0,
|
|
3842
|
+
var SelectScrollUpButton = React25.forwardRef(function SelectScrollUpButton2({ className, ...props }, ref) {
|
|
3843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3911
3844
|
SelectPrimitive.ScrollUpButton,
|
|
3912
3845
|
{
|
|
3913
3846
|
ref,
|
|
@@ -3917,13 +3850,13 @@ var SelectScrollUpButton = React21.forwardRef(function SelectScrollUpButton2({ c
|
|
|
3917
3850
|
className
|
|
3918
3851
|
),
|
|
3919
3852
|
...props,
|
|
3920
|
-
children: /* @__PURE__ */ (0,
|
|
3853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: "caret-up", size: 12 })
|
|
3921
3854
|
}
|
|
3922
3855
|
);
|
|
3923
3856
|
});
|
|
3924
3857
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
3925
|
-
var SelectScrollDownButton =
|
|
3926
|
-
return /* @__PURE__ */ (0,
|
|
3858
|
+
var SelectScrollDownButton = React25.forwardRef(function SelectScrollDownButton2({ className, ...props }, ref) {
|
|
3859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3927
3860
|
SelectPrimitive.ScrollDownButton,
|
|
3928
3861
|
{
|
|
3929
3862
|
ref,
|
|
@@ -3933,13 +3866,13 @@ var SelectScrollDownButton = React21.forwardRef(function SelectScrollDownButton2
|
|
|
3933
3866
|
className
|
|
3934
3867
|
),
|
|
3935
3868
|
...props,
|
|
3936
|
-
children: /* @__PURE__ */ (0,
|
|
3869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: "caret-down", size: 12 })
|
|
3937
3870
|
}
|
|
3938
3871
|
);
|
|
3939
3872
|
});
|
|
3940
3873
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
3941
|
-
var SelectContent =
|
|
3942
|
-
return /* @__PURE__ */ (0,
|
|
3874
|
+
var SelectContent = React25.forwardRef(function SelectContent2({ className, children, position = "popper", ...props }, ref) {
|
|
3875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3943
3876
|
SelectPrimitive.Content,
|
|
3944
3877
|
{
|
|
3945
3878
|
ref,
|
|
@@ -3952,8 +3885,8 @@ var SelectContent = React21.forwardRef(function SelectContent2({ className, chil
|
|
|
3952
3885
|
),
|
|
3953
3886
|
...props,
|
|
3954
3887
|
children: [
|
|
3955
|
-
/* @__PURE__ */ (0,
|
|
3956
|
-
/* @__PURE__ */ (0,
|
|
3888
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectScrollUpButton, {}),
|
|
3889
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3957
3890
|
SelectPrimitive.Viewport,
|
|
3958
3891
|
{
|
|
3959
3892
|
"data-slot": "select-viewport",
|
|
@@ -3961,14 +3894,14 @@ var SelectContent = React21.forwardRef(function SelectContent2({ className, chil
|
|
|
3961
3894
|
children
|
|
3962
3895
|
}
|
|
3963
3896
|
),
|
|
3964
|
-
/* @__PURE__ */ (0,
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectScrollDownButton, {})
|
|
3965
3898
|
]
|
|
3966
3899
|
}
|
|
3967
3900
|
) });
|
|
3968
3901
|
});
|
|
3969
3902
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
3970
|
-
var SelectLabel =
|
|
3971
|
-
return /* @__PURE__ */ (0,
|
|
3903
|
+
var SelectLabel = React25.forwardRef(function SelectLabel2({ className, ...props }, ref) {
|
|
3904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3972
3905
|
SelectPrimitive.Label,
|
|
3973
3906
|
{
|
|
3974
3907
|
ref,
|
|
@@ -3990,8 +3923,8 @@ var SelectLabel = React21.forwardRef(function SelectLabel2({ className, ...props
|
|
|
3990
3923
|
);
|
|
3991
3924
|
});
|
|
3992
3925
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
3993
|
-
var SelectItem =
|
|
3994
|
-
return /* @__PURE__ */ (0,
|
|
3926
|
+
var SelectItem = React25.forwardRef(function SelectItem2({ className, children, ...props }, ref) {
|
|
3927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3995
3928
|
SelectPrimitive.Item,
|
|
3996
3929
|
{
|
|
3997
3930
|
ref,
|
|
@@ -4002,20 +3935,20 @@ var SelectItem = React21.forwardRef(function SelectItem2({ className, children,
|
|
|
4002
3935
|
),
|
|
4003
3936
|
...props,
|
|
4004
3937
|
children: [
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
3938
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectPrimitive.ItemText, { className: "truncate", children: renderTextContent(children, {
|
|
4006
3939
|
as: "span",
|
|
4007
3940
|
className: "block truncate text-[color:var(--sofya-text-default)]",
|
|
4008
3941
|
size: "body",
|
|
4009
|
-
style:
|
|
3942
|
+
style: inheritedTypographyStyle
|
|
4010
3943
|
}) }),
|
|
4011
|
-
/* @__PURE__ */ (0,
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SelectPrimitive.ItemIndicator, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "absolute right-4 inline-flex h-4 w-4 items-center justify-center text-primary", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon, { name: "check", size: 14 }) }) })
|
|
4012
3945
|
]
|
|
4013
3946
|
}
|
|
4014
3947
|
);
|
|
4015
3948
|
});
|
|
4016
3949
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
4017
|
-
var SelectSeparator =
|
|
4018
|
-
return /* @__PURE__ */ (0,
|
|
3950
|
+
var SelectSeparator = React25.forwardRef(function SelectSeparator2({ className, ...props }, ref) {
|
|
3951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4019
3952
|
SelectPrimitive.Separator,
|
|
4020
3953
|
{
|
|
4021
3954
|
ref,
|
|
@@ -4028,11 +3961,11 @@ var SelectSeparator = React21.forwardRef(function SelectSeparator2({ className,
|
|
|
4028
3961
|
SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
4029
3962
|
|
|
4030
3963
|
// src/components/separator.tsx
|
|
4031
|
-
var
|
|
3964
|
+
var React26 = __toESM(require("react"), 1);
|
|
4032
3965
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
4033
|
-
var
|
|
4034
|
-
var Separator2 =
|
|
4035
|
-
return /* @__PURE__ */ (0,
|
|
3966
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3967
|
+
var Separator2 = React26.forwardRef(function Separator3({ className, decorative = true, orientation = "horizontal", ...props }, ref) {
|
|
3968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4036
3969
|
SeparatorPrimitive.Root,
|
|
4037
3970
|
{
|
|
4038
3971
|
ref,
|
|
@@ -4051,8 +3984,8 @@ var Separator2 = React22.forwardRef(function Separator3({ className, decorative
|
|
|
4051
3984
|
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
4052
3985
|
|
|
4053
3986
|
// src/components/slider.tsx
|
|
4054
|
-
var
|
|
4055
|
-
var
|
|
3987
|
+
var React27 = __toESM(require("react"), 1);
|
|
3988
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
4056
3989
|
function clampSliderValue(value, min, max) {
|
|
4057
3990
|
if (Number.isNaN(value)) {
|
|
4058
3991
|
return min;
|
|
@@ -4077,7 +4010,7 @@ function resolveSliderMeasurement(value, fallback) {
|
|
|
4077
4010
|
function isTextValue(value) {
|
|
4078
4011
|
return typeof value === "string" || typeof value === "number";
|
|
4079
4012
|
}
|
|
4080
|
-
var Slider =
|
|
4013
|
+
var Slider = React27.forwardRef(function Slider2({
|
|
4081
4014
|
className,
|
|
4082
4015
|
defaultValue,
|
|
4083
4016
|
formatValue,
|
|
@@ -4100,23 +4033,28 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4100
4033
|
valueClassName,
|
|
4101
4034
|
...props
|
|
4102
4035
|
}, ref) {
|
|
4103
|
-
const resolvedId =
|
|
4036
|
+
const resolvedId = React27.useId();
|
|
4104
4037
|
const inputId = id ?? resolvedId;
|
|
4105
4038
|
const safeMin = min;
|
|
4106
4039
|
const safeMax = resolveSliderMax(safeMin, max);
|
|
4107
|
-
const
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4040
|
+
const [controllableValue, setControllableValue, setUncontrolledValue] = useControllableState({
|
|
4041
|
+
defaultValue: clampSliderValue(defaultValue ?? safeMin, safeMin, safeMax),
|
|
4042
|
+
onChange: onValueChange,
|
|
4043
|
+
value
|
|
4044
|
+
});
|
|
4045
|
+
React27.useEffect(() => {
|
|
4046
|
+
if (value !== void 0) {
|
|
4113
4047
|
return;
|
|
4114
4048
|
}
|
|
4115
|
-
|
|
4116
|
-
(currentValue2) => clampSliderValue(currentValue2, safeMin, safeMax)
|
|
4049
|
+
setUncontrolledValue(
|
|
4050
|
+
(currentValue2) => clampSliderValue(currentValue2 ?? safeMin, safeMin, safeMax)
|
|
4117
4051
|
);
|
|
4118
|
-
}, [
|
|
4119
|
-
const currentValue =
|
|
4052
|
+
}, [safeMax, safeMin, setUncontrolledValue, value]);
|
|
4053
|
+
const currentValue = clampSliderValue(
|
|
4054
|
+
controllableValue ?? safeMin,
|
|
4055
|
+
safeMin,
|
|
4056
|
+
safeMax
|
|
4057
|
+
);
|
|
4120
4058
|
const valueRatio = safeMax === safeMin ? 0 : (currentValue - safeMin) / (safeMax - safeMin);
|
|
4121
4059
|
const valuePercentage = valueRatio * 100;
|
|
4122
4060
|
const formattedValue = formatValue?.(currentValue) ?? currentValue.toString();
|
|
@@ -4148,38 +4086,29 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4148
4086
|
safeMin,
|
|
4149
4087
|
safeMax
|
|
4150
4088
|
);
|
|
4151
|
-
|
|
4152
|
-
setInternalValue(nextValue);
|
|
4153
|
-
}
|
|
4089
|
+
setControllableValue(nextValue);
|
|
4154
4090
|
onChange?.(event);
|
|
4155
|
-
onValueChange?.(nextValue);
|
|
4156
4091
|
};
|
|
4157
|
-
return /* @__PURE__ */ (0,
|
|
4092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4158
4093
|
"div",
|
|
4159
4094
|
{
|
|
4160
4095
|
"data-slot": "slider",
|
|
4161
4096
|
className: cn("grid w-full gap-2", className),
|
|
4162
4097
|
children: [
|
|
4163
|
-
label || showValue ? /* @__PURE__ */ (0,
|
|
4164
|
-
label ? /* @__PURE__ */ (0,
|
|
4165
|
-
|
|
4098
|
+
label || showValue ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
|
|
4099
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4100
|
+
FieldLabel,
|
|
4166
4101
|
{
|
|
4167
4102
|
htmlFor: inputId,
|
|
4168
4103
|
className: cn(
|
|
4169
|
-
"min-w-0
|
|
4104
|
+
"min-w-0",
|
|
4170
4105
|
labelClassName
|
|
4171
4106
|
),
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
className: "block text-[color:var(--sofya-text-default)]",
|
|
4175
|
-
size: "body",
|
|
4176
|
-
style: {
|
|
4177
|
-
fontWeight: 500
|
|
4178
|
-
}
|
|
4179
|
-
})
|
|
4107
|
+
textClassName: "block min-w-0 text-[color:var(--sofya-text-default)]",
|
|
4108
|
+
children: label
|
|
4180
4109
|
}
|
|
4181
|
-
) : /* @__PURE__ */ (0,
|
|
4182
|
-
showValue ? /* @__PURE__ */ (0,
|
|
4110
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", {}),
|
|
4111
|
+
showValue ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4183
4112
|
"div",
|
|
4184
4113
|
{
|
|
4185
4114
|
className: cn(
|
|
@@ -4197,7 +4126,7 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4197
4126
|
}
|
|
4198
4127
|
) : null
|
|
4199
4128
|
] }) : null,
|
|
4200
|
-
/* @__PURE__ */ (0,
|
|
4129
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
4201
4130
|
"div",
|
|
4202
4131
|
{
|
|
4203
4132
|
"data-slot": "slider-control",
|
|
@@ -4207,7 +4136,7 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4207
4136
|
),
|
|
4208
4137
|
style: controlStyle,
|
|
4209
4138
|
children: [
|
|
4210
|
-
/* @__PURE__ */ (0,
|
|
4139
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4211
4140
|
"input",
|
|
4212
4141
|
{
|
|
4213
4142
|
...props,
|
|
@@ -4224,7 +4153,7 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4224
4153
|
style: inputBoundsStyle
|
|
4225
4154
|
}
|
|
4226
4155
|
),
|
|
4227
|
-
/* @__PURE__ */ (0,
|
|
4156
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4228
4157
|
"div",
|
|
4229
4158
|
{
|
|
4230
4159
|
"data-slot": "slider-track",
|
|
@@ -4235,7 +4164,7 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4235
4164
|
style: trackBoundsStyle
|
|
4236
4165
|
}
|
|
4237
4166
|
),
|
|
4238
|
-
/* @__PURE__ */ (0,
|
|
4167
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4239
4168
|
"div",
|
|
4240
4169
|
{
|
|
4241
4170
|
"data-slot": "slider-range",
|
|
@@ -4246,7 +4175,7 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4246
4175
|
style: rangeStyle
|
|
4247
4176
|
}
|
|
4248
4177
|
),
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4178
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4250
4179
|
"div",
|
|
4251
4180
|
{
|
|
4252
4181
|
"data-slot": "slider-thumb",
|
|
@@ -4267,10 +4196,10 @@ var Slider = React23.forwardRef(function Slider2({
|
|
|
4267
4196
|
Slider.displayName = "Slider";
|
|
4268
4197
|
|
|
4269
4198
|
// src/components/skeleton.tsx
|
|
4270
|
-
var
|
|
4271
|
-
var
|
|
4272
|
-
var Skeleton =
|
|
4273
|
-
return /* @__PURE__ */ (0,
|
|
4199
|
+
var React28 = __toESM(require("react"), 1);
|
|
4200
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
4201
|
+
var Skeleton = React28.forwardRef(function Skeleton2({ className, ...props }, ref) {
|
|
4202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4274
4203
|
"div",
|
|
4275
4204
|
{
|
|
4276
4205
|
ref,
|
|
@@ -4285,15 +4214,15 @@ var Skeleton = React24.forwardRef(function Skeleton2({ className, ...props }, re
|
|
|
4285
4214
|
Skeleton.displayName = "Skeleton";
|
|
4286
4215
|
|
|
4287
4216
|
// src/components/sonner.tsx
|
|
4288
|
-
var
|
|
4217
|
+
var React29 = __toESM(require("react"), 1);
|
|
4289
4218
|
var import_sonner = require("sonner");
|
|
4290
|
-
var
|
|
4219
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4291
4220
|
var notificationVariantOptions = ["default", "success", "error", "warning"];
|
|
4292
4221
|
function ToastStatusIcon({
|
|
4293
4222
|
iconName,
|
|
4294
4223
|
className
|
|
4295
4224
|
}) {
|
|
4296
|
-
return /* @__PURE__ */ (0,
|
|
4225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4297
4226
|
"span",
|
|
4298
4227
|
{
|
|
4299
4228
|
"aria-hidden": "true",
|
|
@@ -4301,7 +4230,7 @@ function ToastStatusIcon({
|
|
|
4301
4230
|
"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border shadow-sofya-sm",
|
|
4302
4231
|
className
|
|
4303
4232
|
),
|
|
4304
|
-
children: /* @__PURE__ */ (0,
|
|
4233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: iconName, size: 16 })
|
|
4305
4234
|
}
|
|
4306
4235
|
);
|
|
4307
4236
|
}
|
|
@@ -4322,35 +4251,35 @@ var defaultToastClassNames = {
|
|
|
4322
4251
|
loading: "border-border bg-card text-foreground"
|
|
4323
4252
|
};
|
|
4324
4253
|
var defaultToastIcons = {
|
|
4325
|
-
success: /* @__PURE__ */ (0,
|
|
4254
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4326
4255
|
ToastStatusIcon,
|
|
4327
4256
|
{
|
|
4328
4257
|
iconName: "check",
|
|
4329
4258
|
className: "border-success/15 bg-success/12 text-success"
|
|
4330
4259
|
}
|
|
4331
4260
|
),
|
|
4332
|
-
error: /* @__PURE__ */ (0,
|
|
4261
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4333
4262
|
ToastStatusIcon,
|
|
4334
4263
|
{
|
|
4335
4264
|
iconName: "x",
|
|
4336
4265
|
className: "border-destructive/15 bg-destructive/12 text-destructive"
|
|
4337
4266
|
}
|
|
4338
4267
|
),
|
|
4339
|
-
warning: /* @__PURE__ */ (0,
|
|
4268
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4340
4269
|
ToastStatusIcon,
|
|
4341
4270
|
{
|
|
4342
4271
|
iconName: "question",
|
|
4343
4272
|
className: "border-warning/20 bg-warning/15 text-foreground"
|
|
4344
4273
|
}
|
|
4345
4274
|
),
|
|
4346
|
-
info: /* @__PURE__ */ (0,
|
|
4275
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4347
4276
|
ToastStatusIcon,
|
|
4348
4277
|
{
|
|
4349
4278
|
iconName: "question",
|
|
4350
4279
|
className: "border-primary/15 bg-primary/10 text-primary"
|
|
4351
4280
|
}
|
|
4352
4281
|
),
|
|
4353
|
-
close: /* @__PURE__ */ (0,
|
|
4282
|
+
close: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Icon, { name: "x", size: 12 })
|
|
4354
4283
|
};
|
|
4355
4284
|
function mergeToastClassNames(overrides) {
|
|
4356
4285
|
return {
|
|
@@ -4358,7 +4287,7 @@ function mergeToastClassNames(overrides) {
|
|
|
4358
4287
|
...overrides
|
|
4359
4288
|
};
|
|
4360
4289
|
}
|
|
4361
|
-
var Toaster =
|
|
4290
|
+
var Toaster = React29.forwardRef(
|
|
4362
4291
|
function Toaster2({
|
|
4363
4292
|
className,
|
|
4364
4293
|
closeButton = true,
|
|
@@ -4370,7 +4299,7 @@ var Toaster = React25.forwardRef(
|
|
|
4370
4299
|
visibleToasts = 5,
|
|
4371
4300
|
...props
|
|
4372
4301
|
}, ref) {
|
|
4373
|
-
return /* @__PURE__ */ (0,
|
|
4302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4374
4303
|
import_sonner.Toaster,
|
|
4375
4304
|
{
|
|
4376
4305
|
ref,
|
|
@@ -4400,10 +4329,11 @@ var Toaster = React25.forwardRef(
|
|
|
4400
4329
|
Toaster.displayName = "Toaster";
|
|
4401
4330
|
|
|
4402
4331
|
// src/components/spinner.tsx
|
|
4403
|
-
var
|
|
4404
|
-
var
|
|
4332
|
+
var React30 = __toESM(require("react"), 1);
|
|
4333
|
+
var import_icons_react6 = require("@tabler/icons-react");
|
|
4334
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
4405
4335
|
var spinnerSizeOptions = ["sm", "default", "lg"];
|
|
4406
|
-
var Spinner =
|
|
4336
|
+
var Spinner = React30.forwardRef(function Spinner2({
|
|
4407
4337
|
"aria-label": ariaLabelProp,
|
|
4408
4338
|
"aria-labelledby": ariaLabelledby,
|
|
4409
4339
|
className,
|
|
@@ -4412,15 +4342,12 @@ var Spinner = React26.forwardRef(function Spinner2({
|
|
|
4412
4342
|
...props
|
|
4413
4343
|
}, ref) {
|
|
4414
4344
|
const ariaLabel = ariaLabelProp ?? (ariaLabelledby ? void 0 : "Loading");
|
|
4415
|
-
return /* @__PURE__ */ (0,
|
|
4416
|
-
|
|
4345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4346
|
+
import_icons_react6.IconLoader2,
|
|
4417
4347
|
{
|
|
4418
4348
|
ref,
|
|
4419
4349
|
"data-size": size,
|
|
4420
4350
|
"data-slot": "spinner",
|
|
4421
|
-
viewBox: "0 0 24 24",
|
|
4422
|
-
fill: "none",
|
|
4423
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4424
4351
|
role,
|
|
4425
4352
|
"aria-label": ariaLabel,
|
|
4426
4353
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -4428,30 +4355,18 @@ var Spinner = React26.forwardRef(function Spinner2({
|
|
|
4428
4355
|
"shrink-0 animate-spin text-primary data-[size=sm]:h-3.5 data-[size=sm]:w-3.5 data-[size=default]:h-4 data-[size=default]:w-4 data-[size=lg]:h-6 data-[size=lg]:w-6",
|
|
4429
4356
|
className
|
|
4430
4357
|
),
|
|
4431
|
-
...props
|
|
4432
|
-
children: [
|
|
4433
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("circle", { cx: "12", cy: "12", r: "9", className: "opacity-20", stroke: "currentColor", strokeWidth: "3" }),
|
|
4434
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4435
|
-
"path",
|
|
4436
|
-
{
|
|
4437
|
-
d: "M21 12A9 9 0 0 0 12 3",
|
|
4438
|
-
stroke: "currentColor",
|
|
4439
|
-
strokeWidth: "3",
|
|
4440
|
-
strokeLinecap: "round"
|
|
4441
|
-
}
|
|
4442
|
-
)
|
|
4443
|
-
]
|
|
4358
|
+
...props
|
|
4444
4359
|
}
|
|
4445
4360
|
);
|
|
4446
4361
|
});
|
|
4447
4362
|
Spinner.displayName = "Spinner";
|
|
4448
4363
|
|
|
4449
4364
|
// src/components/switch.tsx
|
|
4450
|
-
var
|
|
4365
|
+
var React31 = __toESM(require("react"), 1);
|
|
4451
4366
|
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
4452
|
-
var
|
|
4453
|
-
var Switch =
|
|
4454
|
-
return /* @__PURE__ */ (0,
|
|
4367
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
4368
|
+
var Switch = React31.forwardRef(({ className, ...props }, ref) => {
|
|
4369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4455
4370
|
SwitchPrimitives.Root,
|
|
4456
4371
|
{
|
|
4457
4372
|
className: cn(
|
|
@@ -4460,7 +4375,7 @@ var Switch = React27.forwardRef(({ className, ...props }, ref) => {
|
|
|
4460
4375
|
),
|
|
4461
4376
|
...props,
|
|
4462
4377
|
ref,
|
|
4463
|
-
children: /* @__PURE__ */ (0,
|
|
4378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
4464
4379
|
SwitchPrimitives.Thumb,
|
|
4465
4380
|
{
|
|
4466
4381
|
className: "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-sm ring-0 transition-transform duration-sofya ease-sofya data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
@@ -4473,8 +4388,8 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
|
4473
4388
|
|
|
4474
4389
|
// src/components/table.tsx
|
|
4475
4390
|
var import_class_variance_authority8 = require("class-variance-authority");
|
|
4476
|
-
var
|
|
4477
|
-
var
|
|
4391
|
+
var React32 = __toESM(require("react"), 1);
|
|
4392
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
4478
4393
|
var tableCellVariantOptions = ["default", "primary", "muted"];
|
|
4479
4394
|
var tableStatusToneOptions = [
|
|
4480
4395
|
"active",
|
|
@@ -4524,21 +4439,13 @@ var tableActionButtonVariants = (0, import_class_variance_authority8.cva)(
|
|
|
4524
4439
|
}
|
|
4525
4440
|
}
|
|
4526
4441
|
);
|
|
4527
|
-
var
|
|
4528
|
-
|
|
4529
|
-
fontSize: "inherit",
|
|
4530
|
-
fontWeight: "inherit",
|
|
4531
|
-
lineHeight: "inherit",
|
|
4532
|
-
letterSpacing: "inherit",
|
|
4533
|
-
color: "inherit"
|
|
4534
|
-
};
|
|
4535
|
-
var Table = React28.forwardRef(function Table2({ className, ...props }, ref) {
|
|
4536
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4442
|
+
var Table = React32.forwardRef(function Table2({ className, ...props }, ref) {
|
|
4443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4537
4444
|
"div",
|
|
4538
4445
|
{
|
|
4539
4446
|
"data-slot": "table-container",
|
|
4540
4447
|
className: "relative w-full overflow-x-auto",
|
|
4541
|
-
children: /* @__PURE__ */ (0,
|
|
4448
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4542
4449
|
"table",
|
|
4543
4450
|
{
|
|
4544
4451
|
"data-slot": "table",
|
|
@@ -4553,8 +4460,8 @@ var Table = React28.forwardRef(function Table2({ className, ...props }, ref) {
|
|
|
4553
4460
|
}
|
|
4554
4461
|
);
|
|
4555
4462
|
});
|
|
4556
|
-
var TableHeader =
|
|
4557
|
-
return /* @__PURE__ */ (0,
|
|
4463
|
+
var TableHeader = React32.forwardRef(function TableHeader2({ className, ...props }, ref) {
|
|
4464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4558
4465
|
"thead",
|
|
4559
4466
|
{
|
|
4560
4467
|
"data-slot": "table-header",
|
|
@@ -4567,8 +4474,8 @@ var TableHeader = React28.forwardRef(function TableHeader2({ className, ...props
|
|
|
4567
4474
|
}
|
|
4568
4475
|
);
|
|
4569
4476
|
});
|
|
4570
|
-
var TableBody =
|
|
4571
|
-
return /* @__PURE__ */ (0,
|
|
4477
|
+
var TableBody = React32.forwardRef(function TableBody2({ className, ...props }, ref) {
|
|
4478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4572
4479
|
"tbody",
|
|
4573
4480
|
{
|
|
4574
4481
|
"data-slot": "table-body",
|
|
@@ -4578,8 +4485,8 @@ var TableBody = React28.forwardRef(function TableBody2({ className, ...props },
|
|
|
4578
4485
|
}
|
|
4579
4486
|
);
|
|
4580
4487
|
});
|
|
4581
|
-
var TableFooter =
|
|
4582
|
-
return /* @__PURE__ */ (0,
|
|
4488
|
+
var TableFooter = React32.forwardRef(function TableFooter2({ className, ...props }, ref) {
|
|
4489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4583
4490
|
"tfoot",
|
|
4584
4491
|
{
|
|
4585
4492
|
"data-slot": "table-footer",
|
|
@@ -4592,8 +4499,8 @@ var TableFooter = React28.forwardRef(function TableFooter2({ className, ...props
|
|
|
4592
4499
|
}
|
|
4593
4500
|
);
|
|
4594
4501
|
});
|
|
4595
|
-
var TableRow =
|
|
4596
|
-
return /* @__PURE__ */ (0,
|
|
4502
|
+
var TableRow = React32.forwardRef(function TableRow2({ className, ...props }, ref) {
|
|
4503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4597
4504
|
"tr",
|
|
4598
4505
|
{
|
|
4599
4506
|
"data-slot": "table-row",
|
|
@@ -4606,8 +4513,8 @@ var TableRow = React28.forwardRef(function TableRow2({ className, ...props }, re
|
|
|
4606
4513
|
}
|
|
4607
4514
|
);
|
|
4608
4515
|
});
|
|
4609
|
-
var TableHead =
|
|
4610
|
-
return /* @__PURE__ */ (0,
|
|
4516
|
+
var TableHead = React32.forwardRef(function TableHead2({ className, children, ...props }, ref) {
|
|
4517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4611
4518
|
"th",
|
|
4612
4519
|
{
|
|
4613
4520
|
"data-slot": "table-head",
|
|
@@ -4621,14 +4528,14 @@ var TableHead = React28.forwardRef(function TableHead2({ className, children, ..
|
|
|
4621
4528
|
as: "span",
|
|
4622
4529
|
className: "inline-flex items-center gap-2 text-inherit",
|
|
4623
4530
|
size: "tiny",
|
|
4624
|
-
style:
|
|
4531
|
+
style: inheritedTypographyStyle
|
|
4625
4532
|
})
|
|
4626
4533
|
}
|
|
4627
4534
|
);
|
|
4628
4535
|
});
|
|
4629
|
-
var TableCell =
|
|
4536
|
+
var TableCell = React32.forwardRef(
|
|
4630
4537
|
function TableCell2({ className, variant, children, ...props }, ref) {
|
|
4631
|
-
return /* @__PURE__ */ (0,
|
|
4538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4632
4539
|
"td",
|
|
4633
4540
|
{
|
|
4634
4541
|
"data-slot": "table-cell",
|
|
@@ -4639,14 +4546,14 @@ var TableCell = React28.forwardRef(
|
|
|
4639
4546
|
as: "span",
|
|
4640
4547
|
className: "block text-inherit [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
4641
4548
|
size: "body",
|
|
4642
|
-
style:
|
|
4549
|
+
style: inheritedTypographyStyle
|
|
4643
4550
|
})
|
|
4644
4551
|
}
|
|
4645
4552
|
);
|
|
4646
4553
|
}
|
|
4647
4554
|
);
|
|
4648
|
-
var TableCaption =
|
|
4649
|
-
return /* @__PURE__ */ (0,
|
|
4555
|
+
var TableCaption = React32.forwardRef(function TableCaption2({ className, children, ...props }, ref) {
|
|
4556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4650
4557
|
"caption",
|
|
4651
4558
|
{
|
|
4652
4559
|
"data-slot": "table-caption",
|
|
@@ -4660,7 +4567,7 @@ var TableCaption = React28.forwardRef(function TableCaption2({ className, childr
|
|
|
4660
4567
|
as: "span",
|
|
4661
4568
|
className: "block text-inherit",
|
|
4662
4569
|
size: "body",
|
|
4663
|
-
style:
|
|
4570
|
+
style: inheritedTypographyStyle
|
|
4664
4571
|
})
|
|
4665
4572
|
}
|
|
4666
4573
|
);
|
|
@@ -4671,7 +4578,7 @@ function TableStatusBadge({
|
|
|
4671
4578
|
children,
|
|
4672
4579
|
...props
|
|
4673
4580
|
}) {
|
|
4674
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4675
4582
|
Badge,
|
|
4676
4583
|
{
|
|
4677
4584
|
variant: "pill",
|
|
@@ -4681,13 +4588,13 @@ function TableStatusBadge({
|
|
|
4681
4588
|
as: "span",
|
|
4682
4589
|
className: "inline-flex items-center gap-2 text-inherit [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
4683
4590
|
size: "tiny",
|
|
4684
|
-
style:
|
|
4591
|
+
style: inheritedTypographyStyle
|
|
4685
4592
|
})
|
|
4686
4593
|
}
|
|
4687
4594
|
);
|
|
4688
4595
|
}
|
|
4689
|
-
var TableActionButton =
|
|
4690
|
-
return /* @__PURE__ */ (0,
|
|
4596
|
+
var TableActionButton = React32.forwardRef(function TableActionButton2({ className, tone, type = "button", children, ...props }, ref) {
|
|
4597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4691
4598
|
Button,
|
|
4692
4599
|
{
|
|
4693
4600
|
ref,
|
|
@@ -4700,13 +4607,13 @@ var TableActionButton = React28.forwardRef(function TableActionButton2({ classNa
|
|
|
4700
4607
|
as: "span",
|
|
4701
4608
|
className: "inline-flex items-center justify-center text-inherit [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
|
|
4702
4609
|
size: "body",
|
|
4703
|
-
style:
|
|
4610
|
+
style: inheritedTypographyStyle
|
|
4704
4611
|
})
|
|
4705
4612
|
}
|
|
4706
4613
|
);
|
|
4707
4614
|
});
|
|
4708
|
-
var TableActions =
|
|
4709
|
-
return /* @__PURE__ */ (0,
|
|
4615
|
+
var TableActions = React32.forwardRef(function TableActions2({ className, ...props }, ref) {
|
|
4616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4710
4617
|
"div",
|
|
4711
4618
|
{
|
|
4712
4619
|
ref,
|
|
@@ -4727,10 +4634,10 @@ TableActionButton.displayName = "TableActionButton";
|
|
|
4727
4634
|
TableActions.displayName = "TableActions";
|
|
4728
4635
|
|
|
4729
4636
|
// src/components/tabs.tsx
|
|
4730
|
-
var
|
|
4637
|
+
var React33 = __toESM(require("react"), 1);
|
|
4731
4638
|
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
4732
4639
|
var import_react3 = require("motion/react");
|
|
4733
|
-
var
|
|
4640
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
4734
4641
|
function resolveDefaultValue(items, defaultValue) {
|
|
4735
4642
|
if (defaultValue) {
|
|
4736
4643
|
return defaultValue;
|
|
@@ -4749,33 +4656,26 @@ function Tabs({
|
|
|
4749
4656
|
...props
|
|
4750
4657
|
}) {
|
|
4751
4658
|
const resolvedDefaultValue = resolveDefaultValue(items, defaultValue);
|
|
4752
|
-
const
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4659
|
+
const [currentValue, setCurrentValue, setUncontrolledCurrentValue] = useControllableState({
|
|
4660
|
+
defaultValue: resolvedDefaultValue,
|
|
4661
|
+
onChange: onValueChange,
|
|
4662
|
+
value
|
|
4663
|
+
});
|
|
4664
|
+
const indicatorLayoutId = React33.useId();
|
|
4665
|
+
React33.useEffect(() => {
|
|
4666
|
+
if (value === void 0) {
|
|
4667
|
+
setUncontrolledCurrentValue(resolvedDefaultValue);
|
|
4759
4668
|
}
|
|
4760
|
-
}, [
|
|
4761
|
-
|
|
4762
|
-
(nextValue) => {
|
|
4763
|
-
if (!isControlled) {
|
|
4764
|
-
setSelectedValue(nextValue);
|
|
4765
|
-
}
|
|
4766
|
-
onValueChange?.(nextValue);
|
|
4767
|
-
},
|
|
4768
|
-
[isControlled, onValueChange]
|
|
4769
|
-
);
|
|
4770
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
4669
|
+
}, [resolvedDefaultValue, setUncontrolledCurrentValue, value]);
|
|
4670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4771
4671
|
TabsPrimitive.Root,
|
|
4772
4672
|
{
|
|
4773
4673
|
className: cn("w-full", className),
|
|
4774
|
-
onValueChange:
|
|
4674
|
+
onValueChange: setCurrentValue,
|
|
4775
4675
|
value: currentValue,
|
|
4776
4676
|
...props,
|
|
4777
4677
|
children: [
|
|
4778
|
-
/* @__PURE__ */ (0,
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4779
4679
|
TabsPrimitive.List,
|
|
4780
4680
|
{
|
|
4781
4681
|
"aria-label": "Subtelas navegaveis",
|
|
@@ -4786,7 +4686,7 @@ function Tabs({
|
|
|
4786
4686
|
children: items.map((item) => {
|
|
4787
4687
|
const isUnavailable = item.disabled || item.loading;
|
|
4788
4688
|
const isActive = item.value === currentValue;
|
|
4789
|
-
return /* @__PURE__ */ (0,
|
|
4689
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
4790
4690
|
TabsPrimitive.Trigger,
|
|
4791
4691
|
{
|
|
4792
4692
|
value: item.value,
|
|
@@ -4798,7 +4698,7 @@ function Tabs({
|
|
|
4798
4698
|
item.triggerClassName
|
|
4799
4699
|
),
|
|
4800
4700
|
children: [
|
|
4801
|
-
isActive ? /* @__PURE__ */ (0,
|
|
4701
|
+
isActive ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4802
4702
|
import_react3.motion.span,
|
|
4803
4703
|
{
|
|
4804
4704
|
"aria-hidden": "true",
|
|
@@ -4808,15 +4708,15 @@ function Tabs({
|
|
|
4808
4708
|
transition: { duration: 0.25, ease: "easeInOut" }
|
|
4809
4709
|
}
|
|
4810
4710
|
) : null,
|
|
4811
|
-
/* @__PURE__ */ (0,
|
|
4812
|
-
item.loading ? /* @__PURE__ */ (0,
|
|
4711
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "relative z-10 inline-flex items-center gap-2", children: [
|
|
4712
|
+
item.loading ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4813
4713
|
"span",
|
|
4814
4714
|
{
|
|
4815
4715
|
"aria-hidden": "true",
|
|
4816
4716
|
className: "h-4 w-4 animate-spin rounded-full border-2 border-current border-r-transparent"
|
|
4817
4717
|
}
|
|
4818
4718
|
) : null,
|
|
4819
|
-
/* @__PURE__ */ (0,
|
|
4719
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: renderTextContent(item.label, {
|
|
4820
4720
|
as: "span",
|
|
4821
4721
|
className: "block text-inherit",
|
|
4822
4722
|
size: "h5"
|
|
@@ -4830,7 +4730,7 @@ function Tabs({
|
|
|
4830
4730
|
}
|
|
4831
4731
|
),
|
|
4832
4732
|
items.map(
|
|
4833
|
-
(item) => item.content !== void 0 ? /* @__PURE__ */ (0,
|
|
4733
|
+
(item) => item.content !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
4834
4734
|
TabsPrimitive.Content,
|
|
4835
4735
|
{
|
|
4836
4736
|
value: item.value,
|
|
@@ -4853,9 +4753,9 @@ function Tabs({
|
|
|
4853
4753
|
Tabs.displayName = "Tabs";
|
|
4854
4754
|
|
|
4855
4755
|
// src/components/textarea.tsx
|
|
4856
|
-
var
|
|
4857
|
-
var
|
|
4858
|
-
var Textarea =
|
|
4756
|
+
var React34 = __toESM(require("react"), 1);
|
|
4757
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4758
|
+
var Textarea = React34.forwardRef(
|
|
4859
4759
|
({
|
|
4860
4760
|
className,
|
|
4861
4761
|
containerClassName,
|
|
@@ -4865,10 +4765,10 @@ var Textarea = React30.forwardRef(
|
|
|
4865
4765
|
rows = 5,
|
|
4866
4766
|
...props
|
|
4867
4767
|
}, ref) => {
|
|
4868
|
-
const generatedId =
|
|
4768
|
+
const generatedId = React34.useId();
|
|
4869
4769
|
const resolvedId = id ?? generatedId;
|
|
4870
4770
|
const ariaLabel = props["aria-label"] ?? (typeof label === "string" ? label : void 0);
|
|
4871
|
-
const control = /* @__PURE__ */ (0,
|
|
4771
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4872
4772
|
"textarea",
|
|
4873
4773
|
{
|
|
4874
4774
|
className: cn(
|
|
@@ -4882,43 +4782,29 @@ var Textarea = React30.forwardRef(
|
|
|
4882
4782
|
"aria-label": ariaLabel
|
|
4883
4783
|
}
|
|
4884
4784
|
);
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
),
|
|
4896
|
-
htmlFor: resolvedId,
|
|
4897
|
-
children: renderTextContent(label, {
|
|
4898
|
-
as: "span",
|
|
4899
|
-
className: "block text-[color:var(--sofya-text-default)]",
|
|
4900
|
-
size: "body",
|
|
4901
|
-
style: {
|
|
4902
|
-
fontWeight: 500
|
|
4903
|
-
}
|
|
4904
|
-
})
|
|
4905
|
-
}
|
|
4906
|
-
) : null,
|
|
4907
|
-
control
|
|
4908
|
-
] });
|
|
4785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4786
|
+
FieldShell,
|
|
4787
|
+
{
|
|
4788
|
+
control,
|
|
4789
|
+
containerClassName,
|
|
4790
|
+
label,
|
|
4791
|
+
labelClassName,
|
|
4792
|
+
labelHtmlFor: resolvedId
|
|
4793
|
+
}
|
|
4794
|
+
);
|
|
4909
4795
|
}
|
|
4910
4796
|
);
|
|
4911
4797
|
Textarea.displayName = "Textarea";
|
|
4912
4798
|
|
|
4913
4799
|
// src/components/tooltip.tsx
|
|
4914
|
-
var
|
|
4800
|
+
var React35 = __toESM(require("react"), 1);
|
|
4915
4801
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
4916
|
-
var
|
|
4802
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4917
4803
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
4918
4804
|
var Tooltip = TooltipPrimitive.Root;
|
|
4919
4805
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
4920
|
-
var TooltipContent =
|
|
4921
|
-
return /* @__PURE__ */ (0,
|
|
4806
|
+
var TooltipContent = React35.forwardRef(function TooltipContent2({ className, sideOffset = 8, ...props }, ref) {
|
|
4807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4922
4808
|
TooltipPrimitive.Content,
|
|
4923
4809
|
{
|
|
4924
4810
|
ref,
|
|
@@ -4942,9 +4828,9 @@ var TooltipContent = React31.forwardRef(function TooltipContent2({ className, si
|
|
|
4942
4828
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
4943
4829
|
|
|
4944
4830
|
// src/theme/provider.tsx
|
|
4945
|
-
var
|
|
4831
|
+
var React36 = __toESM(require("react"), 1);
|
|
4946
4832
|
var import_tokens = require("@sofya-ds/tokens");
|
|
4947
|
-
var
|
|
4833
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4948
4834
|
var SOFYA_FONT_LINKS = [
|
|
4949
4835
|
{
|
|
4950
4836
|
id: "preconnect-googleapis",
|
|
@@ -4964,7 +4850,7 @@ var SOFYA_FONT_LINKS = [
|
|
|
4964
4850
|
}
|
|
4965
4851
|
];
|
|
4966
4852
|
function useSofyaFontLinks() {
|
|
4967
|
-
|
|
4853
|
+
React36.useEffect(() => {
|
|
4968
4854
|
if (typeof document === "undefined") {
|
|
4969
4855
|
return;
|
|
4970
4856
|
}
|
|
@@ -4997,7 +4883,7 @@ function SofyaProvider({
|
|
|
4997
4883
|
useSofyaFontLinks();
|
|
4998
4884
|
const theme = (0, import_tokens.createWhitelabelTheme)(overrides ?? {}, preset);
|
|
4999
4885
|
const cssVariables = (0, import_tokens.themeToCssVariables)(theme);
|
|
5000
|
-
return /* @__PURE__ */ (0,
|
|
4886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
5001
4887
|
"div",
|
|
5002
4888
|
{
|
|
5003
4889
|
"data-sofya-theme": theme.name,
|
|
@@ -5141,6 +5027,7 @@ var import_tokens2 = require("@sofya-ds/tokens");
|
|
|
5141
5027
|
hexToHslChannels,
|
|
5142
5028
|
iconColorOptions,
|
|
5143
5029
|
iconNames,
|
|
5030
|
+
iconSizeMap,
|
|
5144
5031
|
iconSizeOptions,
|
|
5145
5032
|
inputVariantOptions,
|
|
5146
5033
|
isTextContent,
|