@mahatisystems/mahati-ui-components 5.2.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +17 -24
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +305 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +305 -300
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/check-mark_1-6GNY6HFY.png +0 -0
- package/dist/check-mark_2-YWM2KQA2.png +0 -0
- package/dist/close-EEDOIEDC.png +0 -0
- package/dist/close_copy_1-PFFNUORV.png +0 -0
- package/dist/danger_1-LUIFNS2J.png +0 -0
- package/dist/danger_1_1-PHLDGYEA.png +0 -0
- package/dist/danger_2-YTNTGWQA.png +0 -0
- package/dist/notification_1-K2I7DVDH.png +0 -0
- package/dist/notification_2-KFI6MN7T.png +0 -0
package/dist/index.js
CHANGED
|
@@ -382,60 +382,6 @@ var require_decrease = __commonJS({
|
|
|
382
382
|
module2.exports = "./decrease-SMWSBU7A.png";
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
// src/assets/icons/check-mark_1.png
|
|
386
|
-
var require_check_mark_1 = __commonJS({
|
|
387
|
-
"src/assets/icons/check-mark_1.png": function(exports2, module2) {
|
|
388
|
-
module2.exports = "./check-mark_1-6GNY6HFY.png";
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
// src/assets/icons/danger_1.png
|
|
392
|
-
var require_danger_1 = __commonJS({
|
|
393
|
-
"src/assets/icons/danger_1.png": function(exports2, module2) {
|
|
394
|
-
module2.exports = "./danger_1-LUIFNS2J.png";
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
// src/assets/icons/notification_1.png
|
|
398
|
-
var require_notification_1 = __commonJS({
|
|
399
|
-
"src/assets/icons/notification_1.png": function(exports2, module2) {
|
|
400
|
-
module2.exports = "./notification_1-K2I7DVDH.png";
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
// src/assets/icons/close.png
|
|
404
|
-
var require_close = __commonJS({
|
|
405
|
-
"src/assets/icons/close.png": function(exports2, module2) {
|
|
406
|
-
module2.exports = "./close-EEDOIEDC.png";
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
// src/assets/icons/check-mark_2.png
|
|
410
|
-
var require_check_mark_2 = __commonJS({
|
|
411
|
-
"src/assets/icons/check-mark_2.png": function(exports2, module2) {
|
|
412
|
-
module2.exports = "./check-mark_2-YWM2KQA2.png";
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
// src/assets/icons/danger_2.png
|
|
416
|
-
var require_danger_2 = __commonJS({
|
|
417
|
-
"src/assets/icons/danger_2.png": function(exports2, module2) {
|
|
418
|
-
module2.exports = "./danger_2-YTNTGWQA.png";
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
|
-
// src/assets/icons/danger_1_1.png
|
|
422
|
-
var require_danger_1_1 = __commonJS({
|
|
423
|
-
"src/assets/icons/danger_1_1.png": function(exports2, module2) {
|
|
424
|
-
module2.exports = "./danger_1_1-PHLDGYEA.png";
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
// src/assets/icons/notification_2.png
|
|
428
|
-
var require_notification_2 = __commonJS({
|
|
429
|
-
"src/assets/icons/notification_2.png": function(exports2, module2) {
|
|
430
|
-
module2.exports = "./notification_2-KFI6MN7T.png";
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
// src/assets/icons/close_copy_1.png
|
|
434
|
-
var require_close_copy_1 = __commonJS({
|
|
435
|
-
"src/assets/icons/close_copy_1.png": function(exports2, module2) {
|
|
436
|
-
module2.exports = "./close_copy_1-PFFNUORV.png";
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
385
|
// src/index.ts
|
|
440
386
|
var index_exports = {};
|
|
441
387
|
__export(index_exports, {
|
|
@@ -575,41 +521,76 @@ var import_react = require("react");
|
|
|
575
521
|
var import_lucide_react = require("lucide-react");
|
|
576
522
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
577
523
|
function Accordion(param) {
|
|
578
|
-
var title = param.title, children = param.children,
|
|
579
|
-
var _ref = _sliced_to_array((0, import_react.useState)(defaultOpen
|
|
580
|
-
|
|
524
|
+
var title = param.title, children = param.children, _param_items = param.items, items = _param_items === void 0 ? [] : _param_items, _param_defaultOpenIndex = param.defaultOpenIndex, defaultOpenIndex = _param_defaultOpenIndex === void 0 ? null : _param_defaultOpenIndex, defaultOpen = param.defaultOpen, _param_className = param.className, className = _param_className === void 0 ? "" : _param_className, _param_headerClassName = param.headerClassName, headerClassName = _param_headerClassName === void 0 ? "" : _param_headerClassName, _param_contentClassName = param.contentClassName, contentClassName = _param_contentClassName === void 0 ? "" : _param_contentClassName, icon = param.icon, _param_iconPosition = param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "right" : _param_iconPosition, _param_multipleOpen = param.multipleOpen, multipleOpen = _param_multipleOpen === void 0 ? false : _param_multipleOpen, onToggle = param.onToggle, accordionTestId = param.accordionTestId, headerTestId = param.headerTestId, contentTestId = param.contentTestId;
|
|
525
|
+
var _ref = _sliced_to_array((0, import_react.useState)(defaultOpen ? [
|
|
526
|
+
0
|
|
527
|
+
] : defaultOpenIndex !== null && defaultOpenIndex !== void 0 ? [
|
|
528
|
+
defaultOpenIndex
|
|
529
|
+
] : []), 2), openIndexes = _ref[0], setOpenIndexes = _ref[1];
|
|
530
|
+
var normalizedItems = items && items.length > 0 ? items : title !== void 0 ? [
|
|
531
|
+
{
|
|
532
|
+
title: title,
|
|
533
|
+
content: children
|
|
534
|
+
}
|
|
535
|
+
] : [];
|
|
536
|
+
var handleToggle = function handleToggle(index) {
|
|
537
|
+
var newIndexes;
|
|
538
|
+
if (multipleOpen) {
|
|
539
|
+
if (openIndexes.includes(index)) {
|
|
540
|
+
newIndexes = openIndexes.filter(function(i) {
|
|
541
|
+
return i !== index;
|
|
542
|
+
});
|
|
543
|
+
} else {
|
|
544
|
+
newIndexes = _to_consumable_array(openIndexes).concat([
|
|
545
|
+
index
|
|
546
|
+
]);
|
|
547
|
+
}
|
|
548
|
+
} else {
|
|
549
|
+
newIndexes = openIndexes.includes(index) ? [] : [
|
|
550
|
+
index
|
|
551
|
+
];
|
|
552
|
+
}
|
|
553
|
+
setOpenIndexes(newIndexes);
|
|
554
|
+
};
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
581
556
|
"data-testid": accordionTestId,
|
|
582
|
-
className: "
|
|
583
|
-
children:
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
onClick: function onClick() {
|
|
587
|
-
return setOpen(!open);
|
|
588
|
-
},
|
|
589
|
-
className: "\n w-full\n flex items-center justify-between\n font-medium\n border-none\n cursor-pointer\n min-h-[52px]\n px-4\n transition\n hover:opacity-95\n focus:outline-none\n sm:min-h-[60px]\n sm:px-6\n ".concat(open ? "text-white bg-gradient-to-r from-[#1761A3] to-[#4DAF83]" : "text-slate-800 bg-white", "\n "),
|
|
557
|
+
className: "w-full max-w-[684px] border border-slate-200 rounded-xl overflow-hidden bg-white ".concat(className),
|
|
558
|
+
children: normalizedItems.map(function(item, index) {
|
|
559
|
+
var isOpen = openIndexes.includes(index);
|
|
560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
|
|
590
561
|
children: [
|
|
591
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
592
|
-
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
|
|
563
|
+
"data-testid": headerTestId,
|
|
564
|
+
disabled: item.disabled,
|
|
565
|
+
onClick: function onClick() {
|
|
566
|
+
return handleToggle(index);
|
|
567
|
+
},
|
|
568
|
+
className: "\n w-full flex items-center justify-between\n px-6 min-h-[60px]\n font-medium transition\n ".concat(item.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer", "\n ").concat(isOpen ? "text-white bg-gradient-to-r from-[#1761A3] to-[#4DAF83]" : "text-slate-800 bg-white", "\n ").concat(headerClassName, "\n "),
|
|
569
|
+
children: [
|
|
570
|
+
iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
571
|
+
className: "mr-2",
|
|
572
|
+
children: icon || (isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, {}))
|
|
573
|
+
}),
|
|
574
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
575
|
+
className: "flex-1 text-left",
|
|
576
|
+
children: item.title
|
|
577
|
+
}),
|
|
578
|
+
iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
579
|
+
children: icon || (isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ChevronDown, {}))
|
|
580
|
+
})
|
|
581
|
+
]
|
|
593
582
|
}),
|
|
594
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
583
|
+
isOpen && !item.disabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
584
|
+
"data-testid": contentTestId,
|
|
585
|
+
className: "px-6 py-4 text-slate-600 border-t border-slate-200 ".concat(contentClassName),
|
|
586
|
+
children: item.content
|
|
587
|
+
}),
|
|
588
|
+
index !== normalizedItems.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
589
|
+
className: "border-t border-slate-200"
|
|
601
590
|
})
|
|
602
591
|
]
|
|
603
|
-
})
|
|
604
|
-
|
|
605
|
-
"data-testid": contentTestId,
|
|
606
|
-
className: "\r\n w-full\r\n overflow-hidden\r\n px-6 py-4\r\n text-slate-600\r\n border-t border-slate-200\r\n ",
|
|
607
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
608
|
-
className: "w-full box-border",
|
|
609
|
-
children: children
|
|
610
|
-
})
|
|
611
|
-
})
|
|
612
|
-
]
|
|
592
|
+
}, index);
|
|
593
|
+
})
|
|
613
594
|
});
|
|
614
595
|
}
|
|
615
596
|
Accordion.displayName = "Accordion";
|
|
@@ -1567,11 +1548,7 @@ var Calendar = function Calendar(param) {
|
|
|
1567
1548
|
onChange === null || onChange === void 0 ? void 0 : onChange(null, "");
|
|
1568
1549
|
}
|
|
1569
1550
|
if (enableTimeSelection) {
|
|
1570
|
-
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(
|
|
1571
|
-
hour: 12,
|
|
1572
|
-
minute: 0,
|
|
1573
|
-
period: "AM"
|
|
1574
|
-
});
|
|
1551
|
+
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(null);
|
|
1575
1552
|
setSelectedHour(12);
|
|
1576
1553
|
setSelectedMinute(0);
|
|
1577
1554
|
setSelectedPeriod("AM");
|
|
@@ -2169,10 +2146,11 @@ var Calendar = function Calendar(param) {
|
|
|
2169
2146
|
children: enableRangeSelection ? "Select Date Range" : "Select Date & Time"
|
|
2170
2147
|
}),
|
|
2171
2148
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
2172
|
-
className: "flex",
|
|
2149
|
+
className: "flex items-center ".concat(!enableTimeSelection ? "justify-center" : "justify-center"),
|
|
2173
2150
|
style: {
|
|
2174
|
-
gap: scale *
|
|
2175
|
-
marginBottom: scale * 24
|
|
2151
|
+
gap: enableTimeSelection ? scale * 20 : 0,
|
|
2152
|
+
marginBottom: scale * 24,
|
|
2153
|
+
width: "100%"
|
|
2176
2154
|
},
|
|
2177
2155
|
children: enableRangeSelection ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, {
|
|
2178
2156
|
children: [
|
|
@@ -2194,7 +2172,8 @@ var Calendar = function Calendar(param) {
|
|
|
2194
2172
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {
|
|
2195
2173
|
className: "text-gray-500",
|
|
2196
2174
|
style: {
|
|
2197
|
-
fontSize: scale * 12
|
|
2175
|
+
fontSize: scale * 12,
|
|
2176
|
+
gap: scale * 24
|
|
2198
2177
|
},
|
|
2199
2178
|
children: "From Date"
|
|
2200
2179
|
}),
|
|
@@ -2211,7 +2190,7 @@ var Calendar = function Calendar(param) {
|
|
|
2211
2190
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", {
|
|
2212
2191
|
type: "button",
|
|
2213
2192
|
onClick: handleEndFieldClick,
|
|
2214
|
-
className: "flex
|
|
2193
|
+
className: "flex items-center rounded-md shadow-sm",
|
|
2215
2194
|
style: {
|
|
2216
2195
|
height: scale * 40,
|
|
2217
2196
|
padding: "0 ".concat(scale * 16, "px"),
|
|
@@ -2222,6 +2201,9 @@ var Calendar = function Calendar(param) {
|
|
|
2222
2201
|
defaultIcon,
|
|
2223
2202
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
2224
2203
|
className: "flex flex-col items-start",
|
|
2204
|
+
style: {
|
|
2205
|
+
gap: scale * 4
|
|
2206
|
+
},
|
|
2225
2207
|
children: [
|
|
2226
2208
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", {
|
|
2227
2209
|
style: {
|
|
@@ -2245,10 +2227,11 @@ var Calendar = function Calendar(param) {
|
|
|
2245
2227
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", {
|
|
2246
2228
|
type: "button",
|
|
2247
2229
|
onClick: handleChooseDateClick,
|
|
2248
|
-
className: "flex items-center rounded-md shadow-sm",
|
|
2230
|
+
className: "flex items-center justify-center rounded-md shadow-sm",
|
|
2249
2231
|
style: {
|
|
2250
2232
|
height: scale * 40,
|
|
2251
2233
|
padding: "0 ".concat(scale * 16, "px"),
|
|
2234
|
+
minWidth: enableTimeSelection ? scale * 140 : scale * 220,
|
|
2252
2235
|
background: !showTimeSelector && enableTimeSelection ? "linear-gradient(to bottom,#1761A3,#4DAF83)" : "white",
|
|
2253
2236
|
color: !showTimeSelector && enableTimeSelection ? "white" : "#111827"
|
|
2254
2237
|
},
|
|
@@ -2269,6 +2252,7 @@ var Calendar = function Calendar(param) {
|
|
|
2269
2252
|
style: {
|
|
2270
2253
|
height: scale * 40,
|
|
2271
2254
|
padding: "0 ".concat(scale * 16, "px"),
|
|
2255
|
+
marginLeft: scale * 16,
|
|
2272
2256
|
background: showTimeSelector ? "linear-gradient(to bottom,#1761A3,#4DAF83)" : "white",
|
|
2273
2257
|
color: showTimeSelector ? "white" : "#111827"
|
|
2274
2258
|
},
|
|
@@ -2295,7 +2279,7 @@ var Calendar = function Calendar(param) {
|
|
|
2295
2279
|
marginBottom: scale * 22
|
|
2296
2280
|
},
|
|
2297
2281
|
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
2298
|
-
className: "flex items-center justify-between",
|
|
2282
|
+
className: "relative flex items-center justify-between",
|
|
2299
2283
|
children: [
|
|
2300
2284
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", {
|
|
2301
2285
|
"aria-label": "Previous month",
|
|
@@ -2312,16 +2296,44 @@ var Calendar = function Calendar(param) {
|
|
|
2312
2296
|
}
|
|
2313
2297
|
})
|
|
2314
2298
|
}),
|
|
2315
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("
|
|
2316
|
-
|
|
2317
|
-
className: "font-bold text-[#1761A3]",
|
|
2318
|
-
style: {
|
|
2319
|
-
fontSize: scale * 18
|
|
2320
|
-
},
|
|
2299
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
2300
|
+
className: "relative",
|
|
2321
2301
|
children: [
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2302
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", {
|
|
2303
|
+
onClick: handleMonthYearClick,
|
|
2304
|
+
className: "font-bold text-[#1761A3]",
|
|
2305
|
+
style: {
|
|
2306
|
+
fontSize: scale * 18
|
|
2307
|
+
},
|
|
2308
|
+
children: [
|
|
2309
|
+
monthName,
|
|
2310
|
+
" ",
|
|
2311
|
+
currentYear
|
|
2312
|
+
]
|
|
2313
|
+
}),
|
|
2314
|
+
showYearDropdown && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
2315
|
+
className: "absolute bg-white border rounded-md shadow-md z-[9999] max-h-40 overflow-y-auto",
|
|
2316
|
+
style: {
|
|
2317
|
+
marginTop: scale * 8,
|
|
2318
|
+
width: scale * 120
|
|
2319
|
+
},
|
|
2320
|
+
children: Array.from({
|
|
2321
|
+
length: 100
|
|
2322
|
+
}, function(_, i) {
|
|
2323
|
+
return currentYear - 50 + i;
|
|
2324
|
+
}).map(function(year) {
|
|
2325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
2326
|
+
onClick: function onClick() {
|
|
2327
|
+
return handleYearSelect(year);
|
|
2328
|
+
},
|
|
2329
|
+
className: "px-3 py-2 cursor-pointer hover:bg-gray-100",
|
|
2330
|
+
style: {
|
|
2331
|
+
fontSize: scale * 12
|
|
2332
|
+
},
|
|
2333
|
+
children: year
|
|
2334
|
+
}, year);
|
|
2335
|
+
})
|
|
2336
|
+
})
|
|
2325
2337
|
]
|
|
2326
2338
|
}),
|
|
2327
2339
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", {
|
|
@@ -2342,32 +2354,33 @@ var Calendar = function Calendar(param) {
|
|
|
2342
2354
|
]
|
|
2343
2355
|
})
|
|
2344
2356
|
}),
|
|
2345
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.
|
|
2346
|
-
className: "grid grid-cols-7",
|
|
2347
|
-
style: {
|
|
2348
|
-
gap: scale * 8
|
|
2349
|
-
},
|
|
2350
|
-
children: renderDays()
|
|
2351
|
-
}),
|
|
2352
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
2353
|
-
className: "border-t border-gray-200",
|
|
2354
|
-
style: {
|
|
2355
|
-
padding: scale * 8
|
|
2356
|
-
},
|
|
2357
|
+
!showTimeSelector ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, {
|
|
2357
2358
|
children: [
|
|
2359
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", {
|
|
2360
|
+
className: "grid grid-cols-7",
|
|
2361
|
+
style: {
|
|
2362
|
+
gap: scale * 24
|
|
2363
|
+
},
|
|
2364
|
+
children: renderDays()
|
|
2365
|
+
}),
|
|
2358
2366
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", {
|
|
2359
|
-
className: "flex",
|
|
2367
|
+
className: "flex justify-between",
|
|
2360
2368
|
style: {
|
|
2361
|
-
gap: scale * 12
|
|
2369
|
+
gap: scale * 12,
|
|
2370
|
+
marginTop: scale * 8
|
|
2362
2371
|
},
|
|
2363
2372
|
children: [
|
|
2364
2373
|
showTodayButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", {
|
|
2365
2374
|
onClick: selectToday,
|
|
2366
|
-
className: "flex items-center justify-center
|
|
2375
|
+
className: "flex items-center justify-center font-semibold",
|
|
2367
2376
|
style: {
|
|
2377
|
+
width: scale * 165,
|
|
2368
2378
|
height: scale * 38,
|
|
2369
|
-
|
|
2370
|
-
|
|
2379
|
+
borderRadius: scale * 6,
|
|
2380
|
+
background: "rgba(23, 97, 163, 0.15)",
|
|
2381
|
+
color: "#1761A3",
|
|
2382
|
+
fontSize: scale * 12,
|
|
2383
|
+
gap: scale * 8
|
|
2371
2384
|
},
|
|
2372
2385
|
children: [
|
|
2373
2386
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_hi2.HiCalendarDays, {
|
|
@@ -2381,13 +2394,16 @@ var Calendar = function Calendar(param) {
|
|
|
2381
2394
|
}),
|
|
2382
2395
|
showClearButton && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", {
|
|
2383
2396
|
onClick: clearDate,
|
|
2384
|
-
className: "
|
|
2397
|
+
className: "flex items-center justify-center font-semibold",
|
|
2385
2398
|
style: {
|
|
2399
|
+
width: scale * 165,
|
|
2386
2400
|
height: scale * 38,
|
|
2387
|
-
|
|
2388
|
-
|
|
2401
|
+
borderRadius: scale * 6,
|
|
2402
|
+
background: "rgba(239, 68, 68, 0.15)",
|
|
2403
|
+
color: "#EF4444",
|
|
2404
|
+
fontSize: scale * 12
|
|
2389
2405
|
},
|
|
2390
|
-
children: "Clear"
|
|
2406
|
+
children: "\uD83D\uDDD1 Clear"
|
|
2391
2407
|
})
|
|
2392
2408
|
]
|
|
2393
2409
|
}),
|
|
@@ -2396,12 +2412,13 @@ var Calendar = function Calendar(param) {
|
|
|
2396
2412
|
className: "w-full rounded-md font-semibold text-white",
|
|
2397
2413
|
style: {
|
|
2398
2414
|
height: scale * 38,
|
|
2415
|
+
marginTop: scale * 12,
|
|
2399
2416
|
background: "linear-gradient(to right,#1761A3,#4DAF83)"
|
|
2400
2417
|
},
|
|
2401
2418
|
children: "Confirm Date"
|
|
2402
2419
|
})
|
|
2403
2420
|
]
|
|
2404
|
-
})
|
|
2421
|
+
}) : renderTimeSelector()
|
|
2405
2422
|
]
|
|
2406
2423
|
})
|
|
2407
2424
|
})
|
|
@@ -2942,7 +2959,7 @@ var TabbedInterface = function TabbedInterface(param) {
|
|
|
2942
2959
|
var active = index === activeIndex;
|
|
2943
2960
|
var isDragging = draggableTabs && draggingIndex === index;
|
|
2944
2961
|
var showClose = showTabCloseIconInHeader && !!onCloseTab;
|
|
2945
|
-
var
|
|
2962
|
+
var closeIcon = showClose ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
2946
2963
|
role: "button",
|
|
2947
2964
|
"aria-label": "Close tab",
|
|
2948
2965
|
onClick: function onClick(e) {
|
|
@@ -2974,7 +2991,7 @@ var TabbedInterface = function TabbedInterface(param) {
|
|
|
2974
2991
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", {
|
|
2975
2992
|
className: "flex min-w-0 items-center gap-2",
|
|
2976
2993
|
children: [
|
|
2977
|
-
tabCloseIconPosition === "left" &&
|
|
2994
|
+
tabCloseIconPosition === "left" && closeIcon,
|
|
2978
2995
|
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
2979
2996
|
children: tab.icon
|
|
2980
2997
|
}),
|
|
@@ -2984,7 +3001,7 @@ var TabbedInterface = function TabbedInterface(param) {
|
|
|
2984
3001
|
})
|
|
2985
3002
|
]
|
|
2986
3003
|
}),
|
|
2987
|
-
tabCloseIconPosition === "right" &&
|
|
3004
|
+
tabCloseIconPosition === "right" && closeIcon
|
|
2988
3005
|
]
|
|
2989
3006
|
}),
|
|
2990
3007
|
variant === "underline" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", {
|
|
@@ -10409,50 +10426,6 @@ Tooltip2.displayName = "Tooltip";
|
|
|
10409
10426
|
var import_react19 = __toESM(require("react"));
|
|
10410
10427
|
var import_react_dom2 = __toESM(require("react-dom"));
|
|
10411
10428
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
10412
|
-
var assetSrc4 = function assetSrc4(m) {
|
|
10413
|
-
if (typeof m === "string") return m;
|
|
10414
|
-
var anyM = m;
|
|
10415
|
-
if (typeof (anyM === null || anyM === void 0 ? void 0 : anyM.src) === "string") return anyM.src;
|
|
10416
|
-
var d = anyM === null || anyM === void 0 ? void 0 : anyM.default;
|
|
10417
|
-
if (typeof d === "string") return d;
|
|
10418
|
-
if (typeof (d === null || d === void 0 ? void 0 : d.src) === "string") return d.src;
|
|
10419
|
-
return "";
|
|
10420
|
-
};
|
|
10421
|
-
var checkMarkIcon = "";
|
|
10422
|
-
var dangerIcon = "";
|
|
10423
|
-
var notificationIcon = "";
|
|
10424
|
-
var closeIcon = "";
|
|
10425
|
-
var checkMarkIcon2 = "";
|
|
10426
|
-
var dangerIcon2 = "";
|
|
10427
|
-
var dangerIcon1_1 = "";
|
|
10428
|
-
var notificationIcon2 = "";
|
|
10429
|
-
var closeIconCopy = "";
|
|
10430
|
-
try {
|
|
10431
|
-
checkMarkIcon = require_check_mark_1();
|
|
10432
|
-
dangerIcon = require_danger_1();
|
|
10433
|
-
notificationIcon = require_notification_1();
|
|
10434
|
-
closeIcon = require_close();
|
|
10435
|
-
checkMarkIcon2 = require_check_mark_2();
|
|
10436
|
-
dangerIcon2 = require_danger_2();
|
|
10437
|
-
dangerIcon1_1 = require_danger_1_1();
|
|
10438
|
-
notificationIcon2 = require_notification_2();
|
|
10439
|
-
closeIconCopy = require_close_copy_1();
|
|
10440
|
-
} catch (e) {}
|
|
10441
|
-
var FALLBACK_ICONS2 = {
|
|
10442
|
-
checkMarkIcon: "/toast-icons/check-mark_1.png",
|
|
10443
|
-
dangerIcon: "/toast-icons/danger_1.png",
|
|
10444
|
-
notificationIcon: "/toast-icons/notification_1.png",
|
|
10445
|
-
closeIcon: "/toast-icons/close.png",
|
|
10446
|
-
checkMarkIcon2: "/toast-icons/check-mark_2.png",
|
|
10447
|
-
dangerIcon2: "/toast-icons/danger_2.png",
|
|
10448
|
-
dangerIcon1_1: "/toast-icons/danger_1_1.png",
|
|
10449
|
-
notificationIcon2: "/toast-icons/notification_2.png",
|
|
10450
|
-
closeIconCopy: "/toast-icons/close_copy_1.png"
|
|
10451
|
-
};
|
|
10452
|
-
var getIconSrc2 = function getIconSrc2(imported, fallback) {
|
|
10453
|
-
var src = assetSrc4(imported);
|
|
10454
|
-
return src || fallback;
|
|
10455
|
-
};
|
|
10456
10429
|
var getStripGradient = function getStripGradient(type) {
|
|
10457
10430
|
switch(type){
|
|
10458
10431
|
case "success":
|
|
@@ -10466,6 +10439,19 @@ var getStripGradient = function getStripGradient(type) {
|
|
|
10466
10439
|
return "linear-gradient(90deg, rgba(23, 97, 163, 1) 22.5%, rgba(77, 175, 131, 1) 130%)";
|
|
10467
10440
|
}
|
|
10468
10441
|
};
|
|
10442
|
+
var getGradient = function getGradient(type) {
|
|
10443
|
+
switch(type){
|
|
10444
|
+
case "success":
|
|
10445
|
+
return "linear-gradient(90deg, rgba(40, 167, 69, 1) 0%, rgba(58, 208, 125, 1) 100%)";
|
|
10446
|
+
case "error":
|
|
10447
|
+
return "linear-gradient(90deg, rgba(220, 53, 69, 1) 0%, rgba(183, 28, 28, 1) 100%)";
|
|
10448
|
+
case "warning":
|
|
10449
|
+
return "linear-gradient(90deg, rgba(245, 158, 11, 1) 0%, rgba(255, 191, 92, 1) 100%)";
|
|
10450
|
+
case "notification":
|
|
10451
|
+
default:
|
|
10452
|
+
return "linear-gradient(90deg, rgba(23, 97, 163, 1) 0%, rgba(77, 175, 131, 1) 100%)";
|
|
10453
|
+
}
|
|
10454
|
+
};
|
|
10469
10455
|
var getTitleColor = function getTitleColor(type) {
|
|
10470
10456
|
switch(type){
|
|
10471
10457
|
case "success":
|
|
@@ -10485,31 +10471,31 @@ var getIcon = function getIcon(type, background) {
|
|
|
10485
10471
|
height: "28px",
|
|
10486
10472
|
objectFit: "contain"
|
|
10487
10473
|
};
|
|
10474
|
+
var altText = type.charAt(0).toUpperCase() + type.slice(1);
|
|
10488
10475
|
if (background === "transparent") {
|
|
10489
10476
|
switch(type){
|
|
10490
10477
|
case "success":
|
|
10491
10478
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10492
|
-
src:
|
|
10493
|
-
alt:
|
|
10479
|
+
src: "/icons/check-mark_2.png",
|
|
10480
|
+
alt: altText,
|
|
10494
10481
|
style: style
|
|
10495
10482
|
});
|
|
10496
10483
|
case "error":
|
|
10497
10484
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10498
|
-
src:
|
|
10499
|
-
alt:
|
|
10485
|
+
src: "/icons/danger_2.png",
|
|
10486
|
+
alt: altText,
|
|
10500
10487
|
style: style
|
|
10501
10488
|
});
|
|
10502
10489
|
case "warning":
|
|
10503
10490
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10504
|
-
src:
|
|
10505
|
-
alt:
|
|
10491
|
+
src: "/icons/danger_1_1.png",
|
|
10492
|
+
alt: altText,
|
|
10506
10493
|
style: style
|
|
10507
10494
|
});
|
|
10508
|
-
case "notification":
|
|
10509
10495
|
default:
|
|
10510
10496
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10511
|
-
src:
|
|
10512
|
-
alt:
|
|
10497
|
+
src: "/icons/notification_2.png",
|
|
10498
|
+
alt: altText,
|
|
10513
10499
|
style: style
|
|
10514
10500
|
});
|
|
10515
10501
|
}
|
|
@@ -10517,27 +10503,26 @@ var getIcon = function getIcon(type, background) {
|
|
|
10517
10503
|
switch(type){
|
|
10518
10504
|
case "success":
|
|
10519
10505
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10520
|
-
src:
|
|
10521
|
-
alt:
|
|
10506
|
+
src: "/icons/check-mark_1.png",
|
|
10507
|
+
alt: altText,
|
|
10522
10508
|
style: style
|
|
10523
10509
|
});
|
|
10524
10510
|
case "error":
|
|
10525
10511
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10526
|
-
src:
|
|
10527
|
-
alt:
|
|
10512
|
+
src: "/icons/danger_1.png",
|
|
10513
|
+
alt: altText,
|
|
10528
10514
|
style: style
|
|
10529
10515
|
});
|
|
10530
10516
|
case "warning":
|
|
10531
10517
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10532
|
-
src:
|
|
10533
|
-
alt:
|
|
10518
|
+
src: "/icons/danger_1.png",
|
|
10519
|
+
alt: altText,
|
|
10534
10520
|
style: style
|
|
10535
10521
|
});
|
|
10536
|
-
case "notification":
|
|
10537
10522
|
default:
|
|
10538
10523
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10539
|
-
src:
|
|
10540
|
-
alt:
|
|
10524
|
+
src: "/icons/notification_1.png",
|
|
10525
|
+
alt: altText,
|
|
10541
10526
|
style: style
|
|
10542
10527
|
});
|
|
10543
10528
|
}
|
|
@@ -10560,6 +10545,7 @@ var ToastMessage = import_react19.default.forwardRef(function(_0, _1) {
|
|
|
10560
10545
|
"className",
|
|
10561
10546
|
"testId"
|
|
10562
10547
|
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
10548
|
+
var backgroundClass = background === "transparent" ? "bg-white" : "";
|
|
10563
10549
|
var displayTitle = customTitle !== null && customTitle !== void 0 ? customTitle : type.charAt(0).toUpperCase() + type.slice(1);
|
|
10564
10550
|
var hasActions = action && action.length > 0;
|
|
10565
10551
|
(0, import_react19.useEffect)(function() {
|
|
@@ -10573,7 +10559,7 @@ var ToastMessage = import_react19.default.forwardRef(function(_0, _1) {
|
|
|
10573
10559
|
duration,
|
|
10574
10560
|
onClose
|
|
10575
10561
|
]);
|
|
10576
|
-
var closeIconSrc = (custom === null || custom === void 0 ? void 0 : custom.closeIconSrc) || (background === "transparent" ?
|
|
10562
|
+
var closeIconSrc = (custom === null || custom === void 0 ? void 0 : custom.closeIconSrc) || (background === "transparent" ? "icons/close_copy_1.png" : "/icons/close.png");
|
|
10577
10563
|
var iconElement = (custom === null || custom === void 0 ? void 0 : custom.iconSrc) ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("img", {
|
|
10578
10564
|
src: custom.iconSrc,
|
|
10579
10565
|
alt: type,
|
|
@@ -10586,7 +10572,10 @@ var ToastMessage = import_react19.default.forwardRef(function(_0, _1) {
|
|
|
10586
10572
|
var content = /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", _object_spread_props(_object_spread({
|
|
10587
10573
|
ref: ref,
|
|
10588
10574
|
"data-testid": testId,
|
|
10589
|
-
|
|
10575
|
+
style: {
|
|
10576
|
+
background: background === "transparent" ? "#ffffff" : getGradient(type)
|
|
10577
|
+
},
|
|
10578
|
+
className: "fixed top-[20px] right-[20px] w-[325px] rounded-[12px] shadow-md z-[9999] overflow-hidden flex \n".concat(hasActions ? "flex-col p-[10px]" : "flex-row items-center pl-[10px]", " \n").concat(backgroundClass, "\n").concat(className || ""),
|
|
10590
10579
|
role: "alert",
|
|
10591
10580
|
"aria-live": "assertive"
|
|
10592
10581
|
}, rest), {
|
|
@@ -10647,11 +10636,6 @@ var ToastMessage = import_react19.default.forwardRef(function(_0, _1) {
|
|
|
10647
10636
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", {
|
|
10648
10637
|
onClick: btn.onClick,
|
|
10649
10638
|
className: "text-[12px] font-semibold px-[16px] py-[6px] rounded-[6px] transition-all active:scale-95",
|
|
10650
|
-
style: {
|
|
10651
|
-
background: btn.backgroundColor || (btn.variant === "secondary" ? "transparent" : "rgba(255,255,255,0.9)"),
|
|
10652
|
-
color: btn.textColor || (btn.variant === "secondary" ? "white" : "black"),
|
|
10653
|
-
border: btn.borderColor ? "1px solid ".concat(btn.borderColor) : "none"
|
|
10654
|
-
},
|
|
10655
10639
|
children: btn.label
|
|
10656
10640
|
}, index);
|
|
10657
10641
|
})
|
|
@@ -12127,6 +12111,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12127
12111
|
return text;
|
|
12128
12112
|
};
|
|
12129
12113
|
var speakFromTime = function speakFromTime1(time) {
|
|
12114
|
+
window.speechSynthesis.cancel();
|
|
12130
12115
|
var source = text;
|
|
12131
12116
|
if (!source.trim()) return;
|
|
12132
12117
|
var words = source.split(/\s+/);
|
|
@@ -12175,6 +12160,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12175
12160
|
};
|
|
12176
12161
|
var togglePlay = function togglePlay() {
|
|
12177
12162
|
if (!utteranceRef.current) {
|
|
12163
|
+
window.speechSynthesis.cancel();
|
|
12178
12164
|
loopCountRef.current = 0;
|
|
12179
12165
|
speakFromTime(currentTime);
|
|
12180
12166
|
return;
|
|
@@ -12225,7 +12211,14 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12225
12211
|
setPlaying(false);
|
|
12226
12212
|
setCurrentTime(0);
|
|
12227
12213
|
(_textAreaRef_current = textAreaRef.current) === null || _textAreaRef_current === void 0 ? void 0 : _textAreaRef_current.setSelectionRange(0, 0);
|
|
12214
|
+
utteranceRef.current = null;
|
|
12228
12215
|
};
|
|
12216
|
+
(0, import_react23.useEffect)(function() {
|
|
12217
|
+
return function() {
|
|
12218
|
+
window.speechSynthesis.cancel();
|
|
12219
|
+
stopTimer();
|
|
12220
|
+
};
|
|
12221
|
+
}, []);
|
|
12229
12222
|
(0, import_react23.useEffect)(function() {
|
|
12230
12223
|
volumeRef.current = volume;
|
|
12231
12224
|
}, [
|
|
@@ -12281,6 +12274,9 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12281
12274
|
}, [
|
|
12282
12275
|
text
|
|
12283
12276
|
]);
|
|
12277
|
+
var getVolumeIcon = function getVolumeIcon() {
|
|
12278
|
+
return volume === 0 ? "/icons/mute-icon.png" : "/icons/sound-icon.png";
|
|
12279
|
+
};
|
|
12284
12280
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12285
12281
|
"data-testid": "text-to-audio-container",
|
|
12286
12282
|
className: "grid grid-cols-[4fr_1fr] gap-[10px] max-[900px]:grid-cols-1",
|
|
@@ -12332,7 +12328,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12332
12328
|
})
|
|
12333
12329
|
}),
|
|
12334
12330
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12335
|
-
className: "border border-[4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12331
|
+
className: "border border-[#4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12336
12332
|
"data-testid": "play-pause-btn",
|
|
12337
12333
|
onClick: togglePlay,
|
|
12338
12334
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ControlIcon, {
|
|
@@ -12340,7 +12336,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12340
12336
|
})
|
|
12341
12337
|
}),
|
|
12342
12338
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12343
|
-
className: "border border-[4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12339
|
+
className: "border border-[#4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12344
12340
|
"data-testid": "10-sec-forward-skip",
|
|
12345
12341
|
onClick: function onClick() {
|
|
12346
12342
|
return skip(10);
|
|
@@ -12350,7 +12346,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12350
12346
|
})
|
|
12351
12347
|
}),
|
|
12352
12348
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12353
|
-
className: "border border-[4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12349
|
+
className: "border border-[#4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12354
12350
|
"data-testid": "5-sec-forward-skip",
|
|
12355
12351
|
onClick: function onClick() {
|
|
12356
12352
|
return skip(5);
|
|
@@ -12368,7 +12364,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12368
12364
|
})
|
|
12369
12365
|
}),
|
|
12370
12366
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12371
|
-
className: "border border-[4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12367
|
+
className: "border border-[#4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12372
12368
|
"data-testid": "force-stop",
|
|
12373
12369
|
onClick: stop,
|
|
12374
12370
|
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ControlIcon, {
|
|
@@ -12376,7 +12372,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12376
12372
|
})
|
|
12377
12373
|
}),
|
|
12378
12374
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12379
|
-
className: "border border-[4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12375
|
+
className: "border border-[#4daf83] bg-[#d4e4eb] rounded-[6px] p-[6px] cursor-pointer",
|
|
12380
12376
|
"data-testid": "on-loop-btn",
|
|
12381
12377
|
onClick: function onClick() {
|
|
12382
12378
|
setLoopMode(function(prev) {
|
|
@@ -12423,22 +12419,23 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12423
12419
|
className: "flex items-center gap-[6px] w-[180px]",
|
|
12424
12420
|
children: [
|
|
12425
12421
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", {
|
|
12426
|
-
className: "flex-1 appearance-none h-[6px] rounded-
|
|
12422
|
+
className: "flex-1 appearance-none h-[6px] rounded-[5px] cursor-pointer",
|
|
12427
12423
|
"data-testid": "seek-bar",
|
|
12428
12424
|
type: "range",
|
|
12429
12425
|
min: 0,
|
|
12430
12426
|
max: duration,
|
|
12431
12427
|
step: 0.01,
|
|
12432
12428
|
value: currentTime,
|
|
12433
|
-
style: {
|
|
12434
|
-
"--progress": "".concat(currentTime / duration * 100, "%")
|
|
12435
|
-
},
|
|
12436
12429
|
onChange: function onChange(e) {
|
|
12437
12430
|
var t = Number(e.target.value);
|
|
12438
12431
|
setCurrentTime(t);
|
|
12439
12432
|
window.speechSynthesis.cancel();
|
|
12440
12433
|
stopTimer();
|
|
12441
12434
|
speakFromTime(t);
|
|
12435
|
+
},
|
|
12436
|
+
style: {
|
|
12437
|
+
accentColor: "#4daf83",
|
|
12438
|
+
background: "linear-gradient(90deg,\n rgba(23,97,163,1) 0%,\n rgba(77,175,131,1) ".concat(currentTime / duration * 100, "%,\n #e5e7eb ").concat(currentTime / duration * 100, "%,\n #e5e7eb 100%)")
|
|
12442
12439
|
}
|
|
12443
12440
|
}),
|
|
12444
12441
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", {
|
|
@@ -12470,7 +12467,7 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12470
12467
|
children: "Reads Entire page"
|
|
12471
12468
|
}),
|
|
12472
12469
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", {
|
|
12473
|
-
className: "bg-gradient-to-r from-[#1761a3] to-[#4daf83] text
|
|
12470
|
+
className: "bg-gradient-to-r from-[#1761a3] to-[#4daf83] text-white border-none px-[12px] py-[6px] rounded-[6px] cursor-pointer",
|
|
12474
12471
|
"data-testid": "reads-given-input",
|
|
12475
12472
|
onClick: function onClick() {
|
|
12476
12473
|
loopCountRef.current = 0;
|
|
@@ -12485,115 +12482,123 @@ var TexttoAudio = function TexttoAudio(param) {
|
|
|
12485
12482
|
})
|
|
12486
12483
|
]
|
|
12487
12484
|
}),
|
|
12488
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
12489
|
-
className: "flex flex-col gap-[16px]",
|
|
12490
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12491
|
-
className: "bg-[#f7fbfb] border border-[#cfe5da] rounded-[14px] p-[16px] mb-[16px]",
|
|
12492
|
-
children: [
|
|
12493
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12494
|
-
className: "flex justify-between items-center text-[13px] font-semibold text-[#243a36] mb-[10px]",
|
|
12495
|
-
children: [
|
|
12496
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {
|
|
12497
|
-
children: "Volume"
|
|
12498
|
-
}),
|
|
12499
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", {
|
|
12500
|
-
children: [
|
|
12501
|
-
Math.round(volume * 100),
|
|
12502
|
-
"%"
|
|
12503
|
-
]
|
|
12504
|
-
})
|
|
12505
|
-
]
|
|
12506
|
-
}),
|
|
12507
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", {
|
|
12508
|
-
"data-testid": "text-to-audio-volume",
|
|
12509
|
-
type: "range",
|
|
12510
|
-
min: 0,
|
|
12511
|
-
max: 1,
|
|
12512
|
-
step: 0.01,
|
|
12513
|
-
value: volume,
|
|
12514
|
-
style: {
|
|
12515
|
-
"--value": "".concat(volume * 100, "%")
|
|
12516
|
-
},
|
|
12517
|
-
onChange: function onChange(e) {
|
|
12518
|
-
return setVolume(Number(e.target.value));
|
|
12519
|
-
}
|
|
12520
|
-
})
|
|
12521
|
-
]
|
|
12522
|
-
})
|
|
12523
|
-
}),
|
|
12524
12485
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12525
|
-
className: "
|
|
12486
|
+
className: "flex flex-col gap-[16px]",
|
|
12526
12487
|
children: [
|
|
12527
12488
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12528
|
-
className: "
|
|
12489
|
+
className: "bg-[#f7fbfb] border border-[#cfe5da] rounded-[14px] p-[16px]",
|
|
12529
12490
|
children: [
|
|
12530
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
12531
|
-
|
|
12491
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12492
|
+
className: "flex justify-between items-center text-[13px] font-semibold text-[#243a36] mb-[10px]",
|
|
12493
|
+
children: [
|
|
12494
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {
|
|
12495
|
+
children: "Volume"
|
|
12496
|
+
}),
|
|
12497
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", {
|
|
12498
|
+
children: [
|
|
12499
|
+
Math.round(volume * 100),
|
|
12500
|
+
"%"
|
|
12501
|
+
]
|
|
12502
|
+
})
|
|
12503
|
+
]
|
|
12532
12504
|
}),
|
|
12533
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("
|
|
12505
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12506
|
+
className: "flex items-center gap-[10px]",
|
|
12534
12507
|
children: [
|
|
12535
|
-
|
|
12536
|
-
|
|
12508
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
12509
|
+
onClick: function onClick() {
|
|
12510
|
+
return setVolume(volume === 0 ? 1 : 0);
|
|
12511
|
+
},
|
|
12512
|
+
style: {
|
|
12513
|
+
width: 18,
|
|
12514
|
+
height: 18,
|
|
12515
|
+
backgroundImage: "url(".concat(getVolumeIcon(), ")"),
|
|
12516
|
+
backgroundSize: "contain",
|
|
12517
|
+
backgroundRepeat: "no-repeat",
|
|
12518
|
+
cursor: "pointer"
|
|
12519
|
+
}
|
|
12520
|
+
}),
|
|
12521
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", {
|
|
12522
|
+
"data-testid": "text-to-audio-volume",
|
|
12523
|
+
type: "range",
|
|
12524
|
+
min: 0,
|
|
12525
|
+
max: 1,
|
|
12526
|
+
step: 0.01,
|
|
12527
|
+
value: volume,
|
|
12528
|
+
onChange: function onChange(e) {
|
|
12529
|
+
return setVolume(Number(e.target.value));
|
|
12530
|
+
},
|
|
12531
|
+
className: "w-full appearance-none h-[6px] rounded-[5px]",
|
|
12532
|
+
style: {
|
|
12533
|
+
accentColor: "#4daf83",
|
|
12534
|
+
background: "linear-gradient(90deg, \n rgba(23,97,163,1) 0%, \n rgba(77,175,131,1) ".concat(volume * 100, "%, \n #e5e7eb ").concat(volume * 100, "%, \n #e5e7eb 100%)")
|
|
12535
|
+
}
|
|
12536
|
+
})
|
|
12537
12537
|
]
|
|
12538
12538
|
})
|
|
12539
12539
|
]
|
|
12540
12540
|
}),
|
|
12541
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
12542
|
-
className: "bg-[#eef5f2] rounded-[12px] p-[12px]",
|
|
12543
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", {
|
|
12544
|
-
className: "w-full appearance-none h-[6px] rounded-full",
|
|
12545
|
-
"data-testid": "test-to-audio-playbackspeed",
|
|
12546
|
-
type: "range",
|
|
12547
|
-
min: 0.5,
|
|
12548
|
-
max: 2,
|
|
12549
|
-
step: 0.25,
|
|
12550
|
-
value: speed,
|
|
12551
|
-
style: {
|
|
12552
|
-
"--value": "".concat((speed - 0.5) / 1.5 * 100, "%")
|
|
12553
|
-
},
|
|
12554
|
-
onChange: function onChange(e) {
|
|
12555
|
-
return setSpeed(Number(e.target.value));
|
|
12556
|
-
}
|
|
12557
|
-
})
|
|
12558
|
-
}),
|
|
12559
12541
|
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12560
|
-
|
|
12561
|
-
fontSize: 12,
|
|
12562
|
-
color: "#7a8b86",
|
|
12563
|
-
marginTop: 6,
|
|
12564
|
-
display: "flex",
|
|
12565
|
-
justifyContent: "space-between"
|
|
12566
|
-
},
|
|
12542
|
+
className: "bg-[#f7fbfb] border border-[#cfe5da] rounded-[14px] p-[16px]",
|
|
12567
12543
|
children: [
|
|
12568
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
12569
|
-
|
|
12544
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12545
|
+
className: "flex justify-between text-[13px] font-semibold mb-[10px]",
|
|
12546
|
+
children: [
|
|
12547
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {
|
|
12548
|
+
children: "Playback Speed"
|
|
12549
|
+
}),
|
|
12550
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", {
|
|
12551
|
+
children: [
|
|
12552
|
+
speed.toFixed(2),
|
|
12553
|
+
"x"
|
|
12554
|
+
]
|
|
12555
|
+
})
|
|
12556
|
+
]
|
|
12557
|
+
}),
|
|
12558
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", {
|
|
12559
|
+
"data-testid": "test-to-audio-playbackspeed",
|
|
12560
|
+
type: "range",
|
|
12561
|
+
min: 0.5,
|
|
12562
|
+
max: 2,
|
|
12563
|
+
step: 0.25,
|
|
12564
|
+
value: speed,
|
|
12565
|
+
className: "w-full appearance-none h-[6px] rounded-[5px]",
|
|
12566
|
+
onChange: function onChange(e) {
|
|
12567
|
+
return setSpeed(Number(e.target.value));
|
|
12568
|
+
},
|
|
12569
|
+
style: {
|
|
12570
|
+
accentColor: "#4daf83",
|
|
12571
|
+
background: "linear-gradient(90deg,\n rgba(23,97,163,1) 0%,\n rgba(77,175,131,1) ".concat((speed - 0.5) / 1.5 * 100, "%,\n #e5e7eb ").concat((speed - 0.5) / 1.5 * 100, "%,\n #e5e7eb 100%)")
|
|
12572
|
+
}
|
|
12570
12573
|
}),
|
|
12571
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
12572
|
-
|
|
12574
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12575
|
+
className: "flex justify-between text-xs text-gray-500 mt-1",
|
|
12576
|
+
children: [
|
|
12577
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {
|
|
12578
|
+
children: "Slower"
|
|
12579
|
+
}),
|
|
12580
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", {
|
|
12581
|
+
children: "Faster"
|
|
12582
|
+
})
|
|
12583
|
+
]
|
|
12573
12584
|
})
|
|
12574
12585
|
]
|
|
12575
|
-
})
|
|
12576
|
-
]
|
|
12577
|
-
}),
|
|
12578
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12579
|
-
className: "bg-[#f7fbfb] border border-[#cfe5da] rounded-[14px] p-[16px]",
|
|
12580
|
-
children: [
|
|
12581
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
12582
|
-
className: "text-[13px] font-semibold text-[#243a36] flex justify-between mb-[12px]"
|
|
12583
12586
|
}),
|
|
12584
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.
|
|
12585
|
-
|
|
12586
|
-
children:
|
|
12587
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", {
|
|
12588
|
+
className: "bg-[#f7fbfb] border border-[#cfe5da] rounded-[14px] p-[16px]",
|
|
12589
|
+
children: [
|
|
12590
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", {
|
|
12591
|
+
"data-testid": "quick-summary",
|
|
12592
|
+
className: "font-semibold mb-[8px]",
|
|
12593
|
+
children: "Quick Summary"
|
|
12594
|
+
}),
|
|
12595
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", {
|
|
12596
|
+
className: "text-sm text-[#4a5c57] leading-[1.5]",
|
|
12597
|
+
children: mode === "textarea" ? categorizeText(text) : getQuickSummary()
|
|
12598
|
+
})
|
|
12599
|
+
]
|
|
12587
12600
|
})
|
|
12588
12601
|
]
|
|
12589
|
-
}),
|
|
12590
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", {
|
|
12591
|
-
style: {
|
|
12592
|
-
fontSize: 13,
|
|
12593
|
-
color: "#4a5c57",
|
|
12594
|
-
lineHeight: 1.5
|
|
12595
|
-
},
|
|
12596
|
-
children: mode === "textarea" ? categorizeText(text) : getQuickSummary()
|
|
12597
12602
|
})
|
|
12598
12603
|
]
|
|
12599
12604
|
});
|