@optigrit/optigrit-ui 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.d.ts +27 -1
- package/dist/components/index.js +873 -159
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -402,6 +402,7 @@ function Select(props) {
|
|
|
402
402
|
options = [{ label: "None", value: "" }],
|
|
403
403
|
renderOption,
|
|
404
404
|
optionsPosition = "bottom-start",
|
|
405
|
+
disabled,
|
|
405
406
|
...inputProps
|
|
406
407
|
} = props;
|
|
407
408
|
const container = useRef5(null);
|
|
@@ -412,23 +413,23 @@ function Select(props) {
|
|
|
412
413
|
{
|
|
413
414
|
key: "ArrowDown",
|
|
414
415
|
callback: () => handleKeyboardNavigation("ArrowDown"),
|
|
415
|
-
options: { preventDefault: isOpen }
|
|
416
|
+
options: { preventDefault: isOpen && !disabled }
|
|
416
417
|
},
|
|
417
418
|
{
|
|
418
419
|
key: "ArrowUp",
|
|
419
420
|
callback: () => handleKeyboardNavigation("ArrowUp"),
|
|
420
|
-
options: { preventDefault: isOpen }
|
|
421
|
+
options: { preventDefault: isOpen && !disabled }
|
|
421
422
|
},
|
|
422
423
|
{
|
|
423
424
|
key: "Enter",
|
|
424
425
|
callback: () => {
|
|
425
|
-
if (isOpen) {
|
|
426
|
+
if (isOpen && !disabled) {
|
|
426
427
|
const option = options.find((option2) => option2.value === activeOption);
|
|
427
428
|
if (option) handleOnChange(option);
|
|
428
429
|
setActiveOption("");
|
|
429
430
|
}
|
|
430
431
|
},
|
|
431
|
-
options: { preventDefault: isOpen }
|
|
432
|
+
options: { preventDefault: isOpen && !disabled }
|
|
432
433
|
},
|
|
433
434
|
{
|
|
434
435
|
key: "Escape",
|
|
@@ -442,7 +443,7 @@ function Select(props) {
|
|
|
442
443
|
}
|
|
443
444
|
]);
|
|
444
445
|
function handleKeyboardNavigation(key) {
|
|
445
|
-
if (isOpen) {
|
|
446
|
+
if (isOpen && !disabled) {
|
|
446
447
|
setActiveOption((pre) => {
|
|
447
448
|
const currentIndex = options.findIndex((option) => option.value === pre);
|
|
448
449
|
const nextIndex = (currentIndex + (key === "ArrowDown" ? 1 : -1) + options.length) % options.length;
|
|
@@ -455,6 +456,7 @@ function Select(props) {
|
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
function handleOnChange(options2) {
|
|
459
|
+
if (disabled) return;
|
|
458
460
|
setIsOpen(false);
|
|
459
461
|
props.onChangeValue?.(options2.value);
|
|
460
462
|
setActiveOption("");
|
|
@@ -466,12 +468,22 @@ function Select(props) {
|
|
|
466
468
|
InputField,
|
|
467
469
|
{
|
|
468
470
|
...inputProps,
|
|
471
|
+
disabled,
|
|
469
472
|
readOnly: true,
|
|
470
473
|
value: options.find((option) => option.value === props.value)?.label || void 0,
|
|
471
474
|
containerProps: {
|
|
475
|
+
...inputProps.containerProps,
|
|
472
476
|
ref: container,
|
|
473
|
-
className:
|
|
474
|
-
|
|
477
|
+
className: cn(
|
|
478
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
479
|
+
inputProps.containerProps?.className
|
|
480
|
+
),
|
|
481
|
+
onClick: (event) => {
|
|
482
|
+
inputProps.containerProps?.onClick?.(event);
|
|
483
|
+
if (!disabled) {
|
|
484
|
+
setIsOpen(true);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
475
487
|
},
|
|
476
488
|
onBlur: (event) => {
|
|
477
489
|
setIsOpen(false);
|
|
@@ -486,7 +498,7 @@ function Select(props) {
|
|
|
486
498
|
/* @__PURE__ */ jsx5(
|
|
487
499
|
Popover,
|
|
488
500
|
{
|
|
489
|
-
open: isOpen,
|
|
501
|
+
open: isOpen && !disabled,
|
|
490
502
|
targetRef: container,
|
|
491
503
|
position: optionsPosition,
|
|
492
504
|
className: "p-1 min-h-[100px]",
|
|
@@ -13247,8 +13259,92 @@ function FlagIcon(props) {
|
|
|
13247
13259
|
);
|
|
13248
13260
|
}
|
|
13249
13261
|
|
|
13262
|
+
// src/shared/Icons/CalendarIcon.tsx
|
|
13263
|
+
import { jsx as jsx287, jsxs as jsxs285 } from "react/jsx-runtime";
|
|
13264
|
+
var CalendarIcon = (props) => /* @__PURE__ */ jsxs285(
|
|
13265
|
+
"svg",
|
|
13266
|
+
{
|
|
13267
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13268
|
+
width: "16",
|
|
13269
|
+
height: "16",
|
|
13270
|
+
viewBox: "0 0 24 24",
|
|
13271
|
+
fill: "none",
|
|
13272
|
+
stroke: "currentColor",
|
|
13273
|
+
strokeWidth: "2",
|
|
13274
|
+
strokeLinecap: "round",
|
|
13275
|
+
strokeLinejoin: "round",
|
|
13276
|
+
...props,
|
|
13277
|
+
children: [
|
|
13278
|
+
/* @__PURE__ */ jsx287("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
13279
|
+
/* @__PURE__ */ jsx287("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
13280
|
+
/* @__PURE__ */ jsx287("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
13281
|
+
/* @__PURE__ */ jsx287("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
13282
|
+
]
|
|
13283
|
+
}
|
|
13284
|
+
);
|
|
13285
|
+
|
|
13286
|
+
// src/shared/Icons/ClockIcon.tsx
|
|
13287
|
+
import { jsx as jsx288, jsxs as jsxs286 } from "react/jsx-runtime";
|
|
13288
|
+
var ClockIcon = (props) => /* @__PURE__ */ jsxs286(
|
|
13289
|
+
"svg",
|
|
13290
|
+
{
|
|
13291
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13292
|
+
width: "16",
|
|
13293
|
+
height: "16",
|
|
13294
|
+
viewBox: "0 0 24 24",
|
|
13295
|
+
fill: "none",
|
|
13296
|
+
stroke: "currentColor",
|
|
13297
|
+
strokeWidth: "2",
|
|
13298
|
+
strokeLinecap: "round",
|
|
13299
|
+
strokeLinejoin: "round",
|
|
13300
|
+
...props,
|
|
13301
|
+
children: [
|
|
13302
|
+
/* @__PURE__ */ jsx288("circle", { cx: "12", cy: "12", r: "10" }),
|
|
13303
|
+
/* @__PURE__ */ jsx288("polyline", { points: "12 6 12 12 16 14" })
|
|
13304
|
+
]
|
|
13305
|
+
}
|
|
13306
|
+
);
|
|
13307
|
+
|
|
13308
|
+
// src/shared/Icons/ChevronLeftIcon.tsx
|
|
13309
|
+
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
13310
|
+
var ChevronLeftIcon = (props) => /* @__PURE__ */ jsx289(
|
|
13311
|
+
"svg",
|
|
13312
|
+
{
|
|
13313
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13314
|
+
width: "16",
|
|
13315
|
+
height: "16",
|
|
13316
|
+
viewBox: "0 0 24 24",
|
|
13317
|
+
fill: "none",
|
|
13318
|
+
stroke: "currentColor",
|
|
13319
|
+
strokeWidth: "2",
|
|
13320
|
+
strokeLinecap: "round",
|
|
13321
|
+
strokeLinejoin: "round",
|
|
13322
|
+
...props,
|
|
13323
|
+
children: /* @__PURE__ */ jsx289("path", { d: "M15 19l-7-7 7-7" })
|
|
13324
|
+
}
|
|
13325
|
+
);
|
|
13326
|
+
|
|
13327
|
+
// src/shared/Icons/ChevronRightIcon.tsx
|
|
13328
|
+
import { jsx as jsx290 } from "react/jsx-runtime";
|
|
13329
|
+
var ChevronRightIcon = (props) => /* @__PURE__ */ jsx290(
|
|
13330
|
+
"svg",
|
|
13331
|
+
{
|
|
13332
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13333
|
+
width: "16",
|
|
13334
|
+
height: "16",
|
|
13335
|
+
viewBox: "0 0 24 24",
|
|
13336
|
+
fill: "none",
|
|
13337
|
+
stroke: "currentColor",
|
|
13338
|
+
strokeWidth: "2",
|
|
13339
|
+
strokeLinecap: "round",
|
|
13340
|
+
strokeLinejoin: "round",
|
|
13341
|
+
...props,
|
|
13342
|
+
children: /* @__PURE__ */ jsx290("path", { d: "M9 5l7 7-7 7" })
|
|
13343
|
+
}
|
|
13344
|
+
);
|
|
13345
|
+
|
|
13250
13346
|
// src/components/Forms/SearchBar/SearchBar.tsx
|
|
13251
|
-
import { jsx as
|
|
13347
|
+
import { jsx as jsx291 } from "react/jsx-runtime";
|
|
13252
13348
|
var SearchBar = React.forwardRef(
|
|
13253
13349
|
({
|
|
13254
13350
|
value,
|
|
@@ -13320,26 +13416,26 @@ var SearchBar = React.forwardRef(
|
|
|
13320
13416
|
handleClear();
|
|
13321
13417
|
}
|
|
13322
13418
|
};
|
|
13323
|
-
const defaultSearchIcon = /* @__PURE__ */
|
|
13419
|
+
const defaultSearchIcon = /* @__PURE__ */ jsx291(SearchIcon, { className: "text-gray-400 ml-2" });
|
|
13324
13420
|
const renderEndIcon = () => {
|
|
13325
13421
|
if (loading) {
|
|
13326
|
-
return /* @__PURE__ */
|
|
13422
|
+
return /* @__PURE__ */ jsx291("div", { className: "flex items-center justify-center pr-3", children: /* @__PURE__ */ jsx291(Spinner, { size: 16, color: "primary" }) });
|
|
13327
13423
|
}
|
|
13328
13424
|
if (currentValue) {
|
|
13329
|
-
return /* @__PURE__ */
|
|
13425
|
+
return /* @__PURE__ */ jsx291(
|
|
13330
13426
|
"button",
|
|
13331
13427
|
{
|
|
13332
13428
|
type: "button",
|
|
13333
13429
|
onClick: handleClear,
|
|
13334
13430
|
className: "flex items-center justify-center p-1 mr-2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer focus:outline-none focus:ring-1 focus:ring-gray-300",
|
|
13335
13431
|
"aria-label": "Clear search",
|
|
13336
|
-
children: /* @__PURE__ */
|
|
13432
|
+
children: /* @__PURE__ */ jsx291(CrossIcon, {})
|
|
13337
13433
|
}
|
|
13338
13434
|
);
|
|
13339
13435
|
}
|
|
13340
13436
|
return endIcon;
|
|
13341
13437
|
};
|
|
13342
|
-
return /* @__PURE__ */
|
|
13438
|
+
return /* @__PURE__ */ jsx291(
|
|
13343
13439
|
Input,
|
|
13344
13440
|
{
|
|
13345
13441
|
ref,
|
|
@@ -13360,7 +13456,7 @@ import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
|
13360
13456
|
|
|
13361
13457
|
// src/components/Forms/TelInput/CountrySelector.tsx
|
|
13362
13458
|
import { useMemo as useMemo2, useRef as useRef8, useState as useState6 } from "react";
|
|
13363
|
-
import { Fragment as Fragment4, jsx as
|
|
13459
|
+
import { Fragment as Fragment4, jsx as jsx292, jsxs as jsxs287 } from "react/jsx-runtime";
|
|
13364
13460
|
function CountrySelector(props) {
|
|
13365
13461
|
const {
|
|
13366
13462
|
countries,
|
|
@@ -13441,8 +13537,8 @@ function CountrySelector(props) {
|
|
|
13441
13537
|
setSearch("");
|
|
13442
13538
|
setActiveISO2("");
|
|
13443
13539
|
}
|
|
13444
|
-
return /* @__PURE__ */
|
|
13445
|
-
/* @__PURE__ */
|
|
13540
|
+
return /* @__PURE__ */ jsxs287(Fragment4, { children: [
|
|
13541
|
+
/* @__PURE__ */ jsxs287(
|
|
13446
13542
|
"div",
|
|
13447
13543
|
{
|
|
13448
13544
|
ref: triggerRef,
|
|
@@ -13452,16 +13548,16 @@ function CountrySelector(props) {
|
|
|
13452
13548
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
13453
13549
|
),
|
|
13454
13550
|
children: [
|
|
13455
|
-
/* @__PURE__ */
|
|
13456
|
-
/* @__PURE__ */
|
|
13457
|
-
/* @__PURE__ */
|
|
13551
|
+
/* @__PURE__ */ jsx292(FlagIcon, { name: `Flag${selectedCountry.iso2.toUpperCase()}` }),
|
|
13552
|
+
/* @__PURE__ */ jsx292("span", { className: "text-xs text-text-secondary font-medium", children: selectedCountry.dialCode }),
|
|
13553
|
+
/* @__PURE__ */ jsx292("div", { className: cn(
|
|
13458
13554
|
"w-0 h-0 border-l-[4px] border-r-[4px] border-t-[4px] border-l-transparent border-r-transparent border-t-gray-500 transition-transform",
|
|
13459
13555
|
isOpen ? "rotate-180" : ""
|
|
13460
13556
|
) })
|
|
13461
13557
|
]
|
|
13462
13558
|
}
|
|
13463
13559
|
),
|
|
13464
|
-
/* @__PURE__ */
|
|
13560
|
+
/* @__PURE__ */ jsx292(
|
|
13465
13561
|
Popover,
|
|
13466
13562
|
{
|
|
13467
13563
|
open: isOpen,
|
|
@@ -13473,13 +13569,13 @@ function CountrySelector(props) {
|
|
|
13473
13569
|
node.style.minWidth = "280px";
|
|
13474
13570
|
setTimeout(() => searchInputRef.current?.focus(), 50);
|
|
13475
13571
|
},
|
|
13476
|
-
children: /* @__PURE__ */
|
|
13572
|
+
children: /* @__PURE__ */ jsxs287(
|
|
13477
13573
|
"div",
|
|
13478
13574
|
{
|
|
13479
13575
|
className: "w-full bg-bg-secondary shadow-md border border-border/10 text-text rounded-xl flex flex-col overflow-hidden",
|
|
13480
13576
|
onMouseDown: (e) => e.preventDefault(),
|
|
13481
13577
|
children: [
|
|
13482
|
-
searchable && /* @__PURE__ */
|
|
13578
|
+
searchable && /* @__PURE__ */ jsx292("div", { className: "p-2 border-b border-border/10", children: /* @__PURE__ */ jsx292(
|
|
13483
13579
|
Input,
|
|
13484
13580
|
{
|
|
13485
13581
|
ref: searchInputRef,
|
|
@@ -13493,12 +13589,12 @@ function CountrySelector(props) {
|
|
|
13493
13589
|
className: "text-xs"
|
|
13494
13590
|
}
|
|
13495
13591
|
) }),
|
|
13496
|
-
/* @__PURE__ */
|
|
13592
|
+
/* @__PURE__ */ jsx292(
|
|
13497
13593
|
"div",
|
|
13498
13594
|
{
|
|
13499
13595
|
ref: optionsRef,
|
|
13500
13596
|
className: "max-h-[200px] overflow-y-scroll scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden p-1 flex flex-col gap-0.5",
|
|
13501
|
-
children: filteredCountries.length === 0 ? /* @__PURE__ */
|
|
13597
|
+
children: filteredCountries.length === 0 ? /* @__PURE__ */ jsx292("div", { className: "p-3 text-center text-xs text-text-secondary/60", children: "No countries found" }) : filteredCountries.map((country) => /* @__PURE__ */ jsxs287(
|
|
13502
13598
|
"div",
|
|
13503
13599
|
{
|
|
13504
13600
|
"data-iso2": country.iso2,
|
|
@@ -13510,9 +13606,9 @@ function CountrySelector(props) {
|
|
|
13510
13606
|
selectedCountry.iso2 === country.iso2 ? "bg-bg" : ""
|
|
13511
13607
|
),
|
|
13512
13608
|
children: [
|
|
13513
|
-
/* @__PURE__ */
|
|
13514
|
-
/* @__PURE__ */
|
|
13515
|
-
/* @__PURE__ */
|
|
13609
|
+
/* @__PURE__ */ jsx292(FlagIcon, { name: `Flag${country.iso2.toUpperCase()}` }),
|
|
13610
|
+
/* @__PURE__ */ jsx292("span", { className: "text-sm truncate flex-1", children: country.name }),
|
|
13611
|
+
/* @__PURE__ */ jsx292("span", { className: "text-xs text-text-secondary font-mono shrink-0", children: country.dialCode })
|
|
13516
13612
|
]
|
|
13517
13613
|
},
|
|
13518
13614
|
country.iso2
|
|
@@ -13747,7 +13843,7 @@ function validatePhoneNumber(phone, country) {
|
|
|
13747
13843
|
}
|
|
13748
13844
|
|
|
13749
13845
|
// src/components/Forms/TelInput/TelInput.tsx
|
|
13750
|
-
import { jsx as
|
|
13846
|
+
import { jsx as jsx293 } from "react/jsx-runtime";
|
|
13751
13847
|
function TelInput(props) {
|
|
13752
13848
|
const {
|
|
13753
13849
|
value,
|
|
@@ -13802,14 +13898,14 @@ function TelInput(props) {
|
|
|
13802
13898
|
}
|
|
13803
13899
|
return null;
|
|
13804
13900
|
}
|
|
13805
|
-
return /* @__PURE__ */
|
|
13901
|
+
return /* @__PURE__ */ jsx293(
|
|
13806
13902
|
InputField,
|
|
13807
13903
|
{
|
|
13808
13904
|
...inputFieldProps,
|
|
13809
13905
|
type: "tel",
|
|
13810
13906
|
value,
|
|
13811
13907
|
placeholder,
|
|
13812
|
-
startIcon: /* @__PURE__ */
|
|
13908
|
+
startIcon: /* @__PURE__ */ jsx293(
|
|
13813
13909
|
CountrySelector,
|
|
13814
13910
|
{
|
|
13815
13911
|
countries: availableCountries,
|
|
@@ -13826,9 +13922,625 @@ function TelInput(props) {
|
|
|
13826
13922
|
);
|
|
13827
13923
|
}
|
|
13828
13924
|
|
|
13925
|
+
// src/components/Forms/DatePicker/DatePicker.tsx
|
|
13926
|
+
import { Fragment as Fragment5, useRef as useRef9, useState as useState8, useMemo as useMemo4 } from "react";
|
|
13927
|
+
import { jsx as jsx294, jsxs as jsxs288 } from "react/jsx-runtime";
|
|
13928
|
+
var MONTH_NAMES = [
|
|
13929
|
+
"January",
|
|
13930
|
+
"February",
|
|
13931
|
+
"March",
|
|
13932
|
+
"April",
|
|
13933
|
+
"May",
|
|
13934
|
+
"June",
|
|
13935
|
+
"July",
|
|
13936
|
+
"August",
|
|
13937
|
+
"September",
|
|
13938
|
+
"October",
|
|
13939
|
+
"November",
|
|
13940
|
+
"December"
|
|
13941
|
+
];
|
|
13942
|
+
var WEEKDAY_NAMES = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
13943
|
+
function parseDateInput(input) {
|
|
13944
|
+
if (!input) return null;
|
|
13945
|
+
if (input instanceof Date) return isNaN(input.getTime()) ? null : input;
|
|
13946
|
+
const parsed = new Date(input);
|
|
13947
|
+
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13948
|
+
}
|
|
13949
|
+
function formatDate(date, formatStr = "YYYY-MM-DD") {
|
|
13950
|
+
if (!date) return "";
|
|
13951
|
+
const year = date.getFullYear();
|
|
13952
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
13953
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
13954
|
+
const monthName = MONTH_NAMES[date.getMonth()];
|
|
13955
|
+
const shortMonthName = monthName.substring(0, 3);
|
|
13956
|
+
return formatStr.replace("YYYY", String(year)).replace("MMM", shortMonthName).replace("MM", month).replace("DD", day);
|
|
13957
|
+
}
|
|
13958
|
+
function isSameDay(d1, d2) {
|
|
13959
|
+
if (!d1 || !d2) return false;
|
|
13960
|
+
return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate();
|
|
13961
|
+
}
|
|
13962
|
+
function isToday(date) {
|
|
13963
|
+
return isSameDay(date, /* @__PURE__ */ new Date());
|
|
13964
|
+
}
|
|
13965
|
+
function DatePicker(props) {
|
|
13966
|
+
const {
|
|
13967
|
+
value,
|
|
13968
|
+
onChangeValue,
|
|
13969
|
+
minDate: minDateProp,
|
|
13970
|
+
maxDate: maxDateProp,
|
|
13971
|
+
format = "YYYY-MM-DD",
|
|
13972
|
+
optionsPosition = "bottom-start",
|
|
13973
|
+
disabled = false,
|
|
13974
|
+
clearable = true,
|
|
13975
|
+
...inputProps
|
|
13976
|
+
} = props;
|
|
13977
|
+
const container = useRef9(null);
|
|
13978
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
13979
|
+
const selectedDate = useMemo4(() => parseDateInput(value), [value]);
|
|
13980
|
+
const minDate = useMemo4(() => parseDateInput(minDateProp), [minDateProp]);
|
|
13981
|
+
const maxDate = useMemo4(() => parseDateInput(maxDateProp), [maxDateProp]);
|
|
13982
|
+
const [viewDate, setViewDate] = useState8(() => selectedDate || /* @__PURE__ */ new Date());
|
|
13983
|
+
const viewYear = viewDate.getFullYear();
|
|
13984
|
+
const viewMonth = viewDate.getMonth();
|
|
13985
|
+
const displayValue = useMemo4(() => {
|
|
13986
|
+
return formatDate(selectedDate, format);
|
|
13987
|
+
}, [selectedDate, format]);
|
|
13988
|
+
const calendarDays = useMemo4(() => {
|
|
13989
|
+
const firstDayOfMonth = new Date(viewYear, viewMonth, 1);
|
|
13990
|
+
const startingDayOfWeek = firstDayOfMonth.getDay();
|
|
13991
|
+
const days = [];
|
|
13992
|
+
for (let i = startingDayOfWeek - 1; i >= 0; i--) {
|
|
13993
|
+
const date = new Date(viewYear, viewMonth, -i);
|
|
13994
|
+
days.push({ date, isCurrentMonth: false });
|
|
13995
|
+
}
|
|
13996
|
+
const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();
|
|
13997
|
+
for (let i = 1; i <= daysInMonth; i++) {
|
|
13998
|
+
const date = new Date(viewYear, viewMonth, i);
|
|
13999
|
+
days.push({ date, isCurrentMonth: true });
|
|
14000
|
+
}
|
|
14001
|
+
const remaining = 42 - days.length;
|
|
14002
|
+
for (let i = 1; i <= remaining; i++) {
|
|
14003
|
+
const date = new Date(viewYear, viewMonth + 1, i);
|
|
14004
|
+
days.push({ date, isCurrentMonth: false });
|
|
14005
|
+
}
|
|
14006
|
+
return days;
|
|
14007
|
+
}, [viewYear, viewMonth]);
|
|
14008
|
+
function isDateDisabled(date) {
|
|
14009
|
+
if (disabled) return true;
|
|
14010
|
+
if (minDate) {
|
|
14011
|
+
const minStart = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
|
|
14012
|
+
if (date < minStart) return true;
|
|
14013
|
+
}
|
|
14014
|
+
if (maxDate) {
|
|
14015
|
+
const maxEnd = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
|
|
14016
|
+
if (date > maxEnd) return true;
|
|
14017
|
+
}
|
|
14018
|
+
return false;
|
|
14019
|
+
}
|
|
14020
|
+
function handlePrevMonth() {
|
|
14021
|
+
setViewDate(new Date(viewYear, viewMonth - 1, 1));
|
|
14022
|
+
}
|
|
14023
|
+
function handleNextMonth() {
|
|
14024
|
+
setViewDate(new Date(viewYear, viewMonth + 1, 1));
|
|
14025
|
+
}
|
|
14026
|
+
function handleSelectDate(date) {
|
|
14027
|
+
if (isDateDisabled(date)) return;
|
|
14028
|
+
const formatted = formatDate(date, format);
|
|
14029
|
+
onChangeValue?.(date, formatted);
|
|
14030
|
+
setIsOpen(false);
|
|
14031
|
+
}
|
|
14032
|
+
function handleClear(e) {
|
|
14033
|
+
e.stopPropagation();
|
|
14034
|
+
if (disabled) return;
|
|
14035
|
+
onChangeValue?.(null, "");
|
|
14036
|
+
setIsOpen(false);
|
|
14037
|
+
}
|
|
14038
|
+
function handleSelectToday() {
|
|
14039
|
+
const today = /* @__PURE__ */ new Date();
|
|
14040
|
+
if (isDateDisabled(today)) return;
|
|
14041
|
+
setViewDate(today);
|
|
14042
|
+
handleSelectDate(today);
|
|
14043
|
+
}
|
|
14044
|
+
useKeyboardShortcuts([
|
|
14045
|
+
{
|
|
14046
|
+
key: "Escape",
|
|
14047
|
+
callback: () => {
|
|
14048
|
+
if (isOpen) setIsOpen(false);
|
|
14049
|
+
},
|
|
14050
|
+
options: { preventDefault: isOpen }
|
|
14051
|
+
}
|
|
14052
|
+
]);
|
|
14053
|
+
const DefaultCalendarIcon = /* @__PURE__ */ jsx294("div", { className: "relative h-full aspect-square pr-1 flex items-center justify-center text-text-secondary/70", children: /* @__PURE__ */ jsx294(CalendarIcon, {}) });
|
|
14054
|
+
return /* @__PURE__ */ jsxs288(Fragment5, { children: [
|
|
14055
|
+
/* @__PURE__ */ jsx294(
|
|
14056
|
+
InputField,
|
|
14057
|
+
{
|
|
14058
|
+
...inputProps,
|
|
14059
|
+
disabled,
|
|
14060
|
+
readOnly: true,
|
|
14061
|
+
value: displayValue,
|
|
14062
|
+
containerProps: {
|
|
14063
|
+
...inputProps.containerProps,
|
|
14064
|
+
ref: container,
|
|
14065
|
+
className: cn(
|
|
14066
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
14067
|
+
inputProps.containerProps?.className
|
|
14068
|
+
),
|
|
14069
|
+
onClick: (event) => {
|
|
14070
|
+
inputProps.containerProps?.onClick?.(event);
|
|
14071
|
+
if (!disabled) {
|
|
14072
|
+
if (selectedDate) setViewDate(selectedDate);
|
|
14073
|
+
setIsOpen(true);
|
|
14074
|
+
}
|
|
14075
|
+
}
|
|
14076
|
+
},
|
|
14077
|
+
onBlur: (event) => {
|
|
14078
|
+
setIsOpen(false);
|
|
14079
|
+
inputProps.onBlur?.(event);
|
|
14080
|
+
},
|
|
14081
|
+
endIcon: props.endIcon ? props.endIcon : DefaultCalendarIcon
|
|
14082
|
+
}
|
|
14083
|
+
),
|
|
14084
|
+
/* @__PURE__ */ jsx294(
|
|
14085
|
+
Popover,
|
|
14086
|
+
{
|
|
14087
|
+
open: isOpen && !disabled,
|
|
14088
|
+
targetRef: container,
|
|
14089
|
+
position: optionsPosition,
|
|
14090
|
+
className: "p-2 select-none",
|
|
14091
|
+
onClose: () => setIsOpen(false),
|
|
14092
|
+
children: /* @__PURE__ */ jsxs288(
|
|
14093
|
+
"div",
|
|
14094
|
+
{
|
|
14095
|
+
className: "w-[280px] bg-bg-secondary border-2 border-border/10 text-text p-3 rounded-2xl shadow-xl flex flex-col gap-3",
|
|
14096
|
+
onMouseDown: (event) => {
|
|
14097
|
+
event.preventDefault();
|
|
14098
|
+
},
|
|
14099
|
+
children: [
|
|
14100
|
+
/* @__PURE__ */ jsxs288("div", { className: "flex items-center justify-between px-1", children: [
|
|
14101
|
+
/* @__PURE__ */ jsx294(
|
|
14102
|
+
IconButton_default,
|
|
14103
|
+
{
|
|
14104
|
+
type: "button",
|
|
14105
|
+
variant: "text",
|
|
14106
|
+
size: "xs",
|
|
14107
|
+
"aria-label": "Previous month",
|
|
14108
|
+
onClick: handlePrevMonth,
|
|
14109
|
+
children: /* @__PURE__ */ jsx294(ChevronLeftIcon, { className: "w-4 h-4" })
|
|
14110
|
+
}
|
|
14111
|
+
),
|
|
14112
|
+
/* @__PURE__ */ jsxs288("div", { className: "font-semibold text-sm", children: [
|
|
14113
|
+
MONTH_NAMES[viewMonth],
|
|
14114
|
+
" ",
|
|
14115
|
+
viewYear
|
|
14116
|
+
] }),
|
|
14117
|
+
/* @__PURE__ */ jsx294(
|
|
14118
|
+
IconButton_default,
|
|
14119
|
+
{
|
|
14120
|
+
type: "button",
|
|
14121
|
+
variant: "text",
|
|
14122
|
+
size: "xs",
|
|
14123
|
+
"aria-label": "Next month",
|
|
14124
|
+
onClick: handleNextMonth,
|
|
14125
|
+
children: /* @__PURE__ */ jsx294(ChevronRightIcon, { className: "w-4 h-4" })
|
|
14126
|
+
}
|
|
14127
|
+
)
|
|
14128
|
+
] }),
|
|
14129
|
+
/* @__PURE__ */ jsx294("div", { className: "grid grid-cols-7 gap-1 text-center", children: WEEKDAY_NAMES.map((day) => /* @__PURE__ */ jsx294("div", { className: "text-[11px] font-medium text-text-secondary/70 py-1", children: day }, day)) }),
|
|
14130
|
+
/* @__PURE__ */ jsx294("div", { className: "grid grid-cols-7 gap-1 text-center", children: calendarDays.map(({ date, isCurrentMonth }, idx) => {
|
|
14131
|
+
const isSelected = isSameDay(date, selectedDate);
|
|
14132
|
+
const isDisabled = isDateDisabled(date);
|
|
14133
|
+
const today = isToday(date);
|
|
14134
|
+
return /* @__PURE__ */ jsx294(
|
|
14135
|
+
"button",
|
|
14136
|
+
{
|
|
14137
|
+
type: "button",
|
|
14138
|
+
disabled: isDisabled,
|
|
14139
|
+
onClick: () => handleSelectDate(date),
|
|
14140
|
+
className: cn(
|
|
14141
|
+
"h-8 w-8 text-xs rounded-lg flex items-center justify-center transition-all mx-auto",
|
|
14142
|
+
isSelected ? "bg-primary text-white font-semibold shadow-sm" : isCurrentMonth ? "text-text hover:bg-bg" : "text-text-secondary/40 hover:bg-bg/50",
|
|
14143
|
+
today && !isSelected && "border border-primary font-medium text-primary",
|
|
14144
|
+
isDisabled && "opacity-25 cursor-not-allowed hover:bg-transparent"
|
|
14145
|
+
),
|
|
14146
|
+
children: date.getDate()
|
|
14147
|
+
},
|
|
14148
|
+
idx
|
|
14149
|
+
);
|
|
14150
|
+
}) }),
|
|
14151
|
+
/* @__PURE__ */ jsxs288("div", { className: "flex items-center justify-between pt-2 border-t border-border/10 text-xs", children: [
|
|
14152
|
+
clearable && selectedDate ? /* @__PURE__ */ jsx294(
|
|
14153
|
+
Button_default,
|
|
14154
|
+
{
|
|
14155
|
+
type: "button",
|
|
14156
|
+
variant: "text",
|
|
14157
|
+
size: "xs",
|
|
14158
|
+
color: "secondary",
|
|
14159
|
+
onClick: handleClear,
|
|
14160
|
+
children: "Clear"
|
|
14161
|
+
}
|
|
14162
|
+
) : /* @__PURE__ */ jsx294("div", {}),
|
|
14163
|
+
/* @__PURE__ */ jsx294(
|
|
14164
|
+
Button_default,
|
|
14165
|
+
{
|
|
14166
|
+
type: "button",
|
|
14167
|
+
variant: "text",
|
|
14168
|
+
size: "xs",
|
|
14169
|
+
color: "primary",
|
|
14170
|
+
onClick: handleSelectToday,
|
|
14171
|
+
className: "ml-auto",
|
|
14172
|
+
children: "Today"
|
|
14173
|
+
}
|
|
14174
|
+
)
|
|
14175
|
+
] })
|
|
14176
|
+
]
|
|
14177
|
+
}
|
|
14178
|
+
)
|
|
14179
|
+
}
|
|
14180
|
+
)
|
|
14181
|
+
] });
|
|
14182
|
+
}
|
|
14183
|
+
|
|
14184
|
+
// src/components/Forms/TimePicker/TimePicker.tsx
|
|
14185
|
+
import { Fragment as Fragment6, useRef as useRef10, useState as useState9, useMemo as useMemo5, useEffect as useEffect2 } from "react";
|
|
14186
|
+
import { jsx as jsx295, jsxs as jsxs289 } from "react/jsx-runtime";
|
|
14187
|
+
function parseTimeInput(input) {
|
|
14188
|
+
if (!input) return null;
|
|
14189
|
+
if (input instanceof Date) {
|
|
14190
|
+
if (isNaN(input.getTime())) return null;
|
|
14191
|
+
return {
|
|
14192
|
+
hours: input.getHours(),
|
|
14193
|
+
minutes: input.getMinutes(),
|
|
14194
|
+
seconds: input.getSeconds()
|
|
14195
|
+
};
|
|
14196
|
+
}
|
|
14197
|
+
if (typeof input === "string") {
|
|
14198
|
+
const trimmed = input.trim();
|
|
14199
|
+
if (!trimmed) return null;
|
|
14200
|
+
const match12 = trimmed.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM|am|pm)$/i);
|
|
14201
|
+
if (match12) {
|
|
14202
|
+
let h = parseInt(match12[1], 10);
|
|
14203
|
+
const m = parseInt(match12[2], 10);
|
|
14204
|
+
const s = match12[3] ? parseInt(match12[3], 10) : 0;
|
|
14205
|
+
const period = match12[4].toUpperCase();
|
|
14206
|
+
if (h === 12) h = period === "AM" ? 0 : 12;
|
|
14207
|
+
else if (period === "PM") h += 12;
|
|
14208
|
+
if (h >= 0 && h < 24 && m >= 0 && m < 60 && s >= 0 && s < 60) {
|
|
14209
|
+
return { hours: h, minutes: m, seconds: s };
|
|
14210
|
+
}
|
|
14211
|
+
}
|
|
14212
|
+
const match24 = trimmed.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
|
|
14213
|
+
if (match24) {
|
|
14214
|
+
const h = parseInt(match24[1], 10);
|
|
14215
|
+
const m = parseInt(match24[2], 10);
|
|
14216
|
+
const s = match24[3] ? parseInt(match24[3], 10) : 0;
|
|
14217
|
+
if (h >= 0 && h < 24 && m >= 0 && m < 60 && s >= 0 && s < 60) {
|
|
14218
|
+
return { hours: h, minutes: m, seconds: s };
|
|
14219
|
+
}
|
|
14220
|
+
}
|
|
14221
|
+
}
|
|
14222
|
+
return null;
|
|
14223
|
+
}
|
|
14224
|
+
function formatTimeString(state, format, useSeconds) {
|
|
14225
|
+
if (!state) return "";
|
|
14226
|
+
const { hours, minutes, seconds } = state;
|
|
14227
|
+
const pad = (num) => String(num).padStart(2, "0");
|
|
14228
|
+
if (format === "12h") {
|
|
14229
|
+
const period = hours >= 12 ? "PM" : "AM";
|
|
14230
|
+
let displayHours = hours % 12;
|
|
14231
|
+
if (displayHours === 0) displayHours = 12;
|
|
14232
|
+
const timeStr = `${pad(displayHours)}:${pad(minutes)}${useSeconds ? `:${pad(seconds)}` : ""}`;
|
|
14233
|
+
return `${timeStr} ${period}`;
|
|
14234
|
+
} else {
|
|
14235
|
+
return `${pad(hours)}:${pad(minutes)}${useSeconds ? `:${pad(seconds)}` : ""}`;
|
|
14236
|
+
}
|
|
14237
|
+
}
|
|
14238
|
+
function stateToDate(state) {
|
|
14239
|
+
if (!state) return null;
|
|
14240
|
+
const now = /* @__PURE__ */ new Date();
|
|
14241
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), state.hours, state.minutes, state.seconds);
|
|
14242
|
+
}
|
|
14243
|
+
function TimePicker(props) {
|
|
14244
|
+
const {
|
|
14245
|
+
value,
|
|
14246
|
+
onChangeValue,
|
|
14247
|
+
format = "12h",
|
|
14248
|
+
useSeconds = false,
|
|
14249
|
+
minuteInterval = 1,
|
|
14250
|
+
optionsPosition = "bottom-start",
|
|
14251
|
+
disabled = false,
|
|
14252
|
+
clearable = true,
|
|
14253
|
+
...inputProps
|
|
14254
|
+
} = props;
|
|
14255
|
+
const container = useRef10(null);
|
|
14256
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
14257
|
+
const parsedTime = useMemo5(() => parseTimeInput(value), [value]);
|
|
14258
|
+
const [draftTime, setDraftTime] = useState9(() => {
|
|
14259
|
+
return parsedTime || { hours: 12, minutes: 0, seconds: 0 };
|
|
14260
|
+
});
|
|
14261
|
+
useEffect2(() => {
|
|
14262
|
+
if (parsedTime) {
|
|
14263
|
+
setDraftTime(parsedTime);
|
|
14264
|
+
}
|
|
14265
|
+
}, [parsedTime]);
|
|
14266
|
+
const displayValue = useMemo5(() => {
|
|
14267
|
+
return formatTimeString(parsedTime, format, useSeconds);
|
|
14268
|
+
}, [parsedTime, format, useSeconds]);
|
|
14269
|
+
const hourOptions = useMemo5(() => {
|
|
14270
|
+
if (format === "12h") {
|
|
14271
|
+
return [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
14272
|
+
} else {
|
|
14273
|
+
return Array.from({ length: 24 }, (_, i) => i);
|
|
14274
|
+
}
|
|
14275
|
+
}, [format]);
|
|
14276
|
+
const minuteOptions = useMemo5(() => {
|
|
14277
|
+
const step = Math.max(1, minuteInterval);
|
|
14278
|
+
const options = [];
|
|
14279
|
+
for (let i = 0; i < 60; i += step) {
|
|
14280
|
+
options.push(i);
|
|
14281
|
+
}
|
|
14282
|
+
return options;
|
|
14283
|
+
}, [minuteInterval]);
|
|
14284
|
+
const secondOptions = useMemo5(() => {
|
|
14285
|
+
return Array.from({ length: 60 }, (_, i) => i);
|
|
14286
|
+
}, []);
|
|
14287
|
+
function commitTime(state) {
|
|
14288
|
+
if (disabled) return;
|
|
14289
|
+
if (!state) {
|
|
14290
|
+
onChangeValue?.("", null);
|
|
14291
|
+
} else {
|
|
14292
|
+
const formatted = formatTimeString(state, format, useSeconds);
|
|
14293
|
+
const dateObj = stateToDate(state);
|
|
14294
|
+
onChangeValue?.(formatted, dateObj);
|
|
14295
|
+
}
|
|
14296
|
+
}
|
|
14297
|
+
function handleHourSelect(displayHour) {
|
|
14298
|
+
setDraftTime((prev) => {
|
|
14299
|
+
let newHours = prev.hours;
|
|
14300
|
+
if (format === "12h") {
|
|
14301
|
+
const isPM2 = prev.hours >= 12;
|
|
14302
|
+
if (displayHour === 12) {
|
|
14303
|
+
newHours = isPM2 ? 12 : 0;
|
|
14304
|
+
} else {
|
|
14305
|
+
newHours = isPM2 ? displayHour + 12 : displayHour;
|
|
14306
|
+
}
|
|
14307
|
+
} else {
|
|
14308
|
+
newHours = displayHour;
|
|
14309
|
+
}
|
|
14310
|
+
const updated = { ...prev, hours: newHours };
|
|
14311
|
+
commitTime(updated);
|
|
14312
|
+
return updated;
|
|
14313
|
+
});
|
|
14314
|
+
}
|
|
14315
|
+
function handleMinuteSelect(min) {
|
|
14316
|
+
setDraftTime((prev) => {
|
|
14317
|
+
const updated = { ...prev, minutes: min };
|
|
14318
|
+
commitTime(updated);
|
|
14319
|
+
return updated;
|
|
14320
|
+
});
|
|
14321
|
+
}
|
|
14322
|
+
function handleSecondSelect(sec) {
|
|
14323
|
+
setDraftTime((prev) => {
|
|
14324
|
+
const updated = { ...prev, seconds: sec };
|
|
14325
|
+
commitTime(updated);
|
|
14326
|
+
return updated;
|
|
14327
|
+
});
|
|
14328
|
+
}
|
|
14329
|
+
function handlePeriodToggle(period) {
|
|
14330
|
+
setDraftTime((prev) => {
|
|
14331
|
+
let newHours = prev.hours;
|
|
14332
|
+
if (period === "AM" && prev.hours >= 12) {
|
|
14333
|
+
newHours -= 12;
|
|
14334
|
+
} else if (period === "PM" && prev.hours < 12) {
|
|
14335
|
+
newHours += 12;
|
|
14336
|
+
}
|
|
14337
|
+
const updated = { ...prev, hours: newHours };
|
|
14338
|
+
commitTime(updated);
|
|
14339
|
+
return updated;
|
|
14340
|
+
});
|
|
14341
|
+
}
|
|
14342
|
+
function handleSelectNow() {
|
|
14343
|
+
const now = /* @__PURE__ */ new Date();
|
|
14344
|
+
const state = {
|
|
14345
|
+
hours: now.getHours(),
|
|
14346
|
+
minutes: now.getMinutes(),
|
|
14347
|
+
seconds: now.getSeconds()
|
|
14348
|
+
};
|
|
14349
|
+
setDraftTime(state);
|
|
14350
|
+
commitTime(state);
|
|
14351
|
+
setIsOpen(false);
|
|
14352
|
+
}
|
|
14353
|
+
function handleClear(e) {
|
|
14354
|
+
e.stopPropagation();
|
|
14355
|
+
commitTime(null);
|
|
14356
|
+
setIsOpen(false);
|
|
14357
|
+
}
|
|
14358
|
+
useKeyboardShortcuts([
|
|
14359
|
+
{
|
|
14360
|
+
key: "Escape",
|
|
14361
|
+
callback: () => {
|
|
14362
|
+
if (isOpen) setIsOpen(false);
|
|
14363
|
+
},
|
|
14364
|
+
options: { preventDefault: isOpen }
|
|
14365
|
+
}
|
|
14366
|
+
]);
|
|
14367
|
+
const currentDisplayHour = useMemo5(() => {
|
|
14368
|
+
if (format === "12h") {
|
|
14369
|
+
let h = draftTime.hours % 12;
|
|
14370
|
+
return h === 0 ? 12 : h;
|
|
14371
|
+
}
|
|
14372
|
+
return draftTime.hours;
|
|
14373
|
+
}, [draftTime.hours, format]);
|
|
14374
|
+
const isPM = draftTime.hours >= 12;
|
|
14375
|
+
const DefaultClockIcon = /* @__PURE__ */ jsx295("div", { className: "relative h-full aspect-square pr-1 flex items-center justify-center text-text-secondary/70", children: /* @__PURE__ */ jsx295(ClockIcon, {}) });
|
|
14376
|
+
return /* @__PURE__ */ jsxs289(Fragment6, { children: [
|
|
14377
|
+
/* @__PURE__ */ jsx295(
|
|
14378
|
+
InputField,
|
|
14379
|
+
{
|
|
14380
|
+
...inputProps,
|
|
14381
|
+
disabled,
|
|
14382
|
+
readOnly: true,
|
|
14383
|
+
value: displayValue,
|
|
14384
|
+
containerProps: {
|
|
14385
|
+
...inputProps.containerProps,
|
|
14386
|
+
ref: container,
|
|
14387
|
+
className: cn(
|
|
14388
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
14389
|
+
inputProps.containerProps?.className
|
|
14390
|
+
),
|
|
14391
|
+
onClick: (event) => {
|
|
14392
|
+
inputProps.containerProps?.onClick?.(event);
|
|
14393
|
+
if (!disabled) {
|
|
14394
|
+
if (parsedTime) setDraftTime(parsedTime);
|
|
14395
|
+
setIsOpen(true);
|
|
14396
|
+
}
|
|
14397
|
+
}
|
|
14398
|
+
},
|
|
14399
|
+
onBlur: (event) => {
|
|
14400
|
+
setIsOpen(false);
|
|
14401
|
+
inputProps.onBlur?.(event);
|
|
14402
|
+
},
|
|
14403
|
+
endIcon: props.endIcon ? props.endIcon : DefaultClockIcon
|
|
14404
|
+
}
|
|
14405
|
+
),
|
|
14406
|
+
/* @__PURE__ */ jsx295(
|
|
14407
|
+
Popover,
|
|
14408
|
+
{
|
|
14409
|
+
open: isOpen && !disabled,
|
|
14410
|
+
targetRef: container,
|
|
14411
|
+
position: optionsPosition,
|
|
14412
|
+
className: "p-2 select-none",
|
|
14413
|
+
onClose: () => setIsOpen(false),
|
|
14414
|
+
children: /* @__PURE__ */ jsxs289(
|
|
14415
|
+
"div",
|
|
14416
|
+
{
|
|
14417
|
+
className: "w-[260px] bg-bg-secondary border-2 border-border/10 text-text p-3 rounded-2xl shadow-xl flex flex-col gap-3",
|
|
14418
|
+
onMouseDown: (event) => {
|
|
14419
|
+
event.preventDefault();
|
|
14420
|
+
},
|
|
14421
|
+
children: [
|
|
14422
|
+
/* @__PURE__ */ jsx295("div", { className: "flex items-center justify-center gap-1.5 py-1 px-3 bg-bg rounded-xl text-center", children: /* @__PURE__ */ jsx295("span", { className: "text-lg font-bold text-primary tracking-tight", children: formatTimeString(draftTime, format, useSeconds) }) }),
|
|
14423
|
+
/* @__PURE__ */ jsxs289("div", { className: "grid grid-cols-3 gap-2 h-44 text-center", children: [
|
|
14424
|
+
/* @__PURE__ */ jsxs289("div", { className: "flex flex-col gap-1 overflow-y-auto scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden pr-0.5", children: [
|
|
14425
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Hour" }),
|
|
14426
|
+
hourOptions.map((h) => {
|
|
14427
|
+
const isSelected = currentDisplayHour === h;
|
|
14428
|
+
return /* @__PURE__ */ jsx295(
|
|
14429
|
+
"button",
|
|
14430
|
+
{
|
|
14431
|
+
type: "button",
|
|
14432
|
+
onClick: () => handleHourSelect(h),
|
|
14433
|
+
className: cn(
|
|
14434
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14435
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14436
|
+
),
|
|
14437
|
+
children: format === "24h" ? String(h).padStart(2, "0") : h
|
|
14438
|
+
},
|
|
14439
|
+
h
|
|
14440
|
+
);
|
|
14441
|
+
})
|
|
14442
|
+
] }),
|
|
14443
|
+
/* @__PURE__ */ jsxs289("div", { className: "flex flex-col gap-1 overflow-y-auto scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden pr-0.5", children: [
|
|
14444
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Min" }),
|
|
14445
|
+
minuteOptions.map((m) => {
|
|
14446
|
+
const isSelected = draftTime.minutes === m;
|
|
14447
|
+
return /* @__PURE__ */ jsx295(
|
|
14448
|
+
"button",
|
|
14449
|
+
{
|
|
14450
|
+
type: "button",
|
|
14451
|
+
onClick: () => handleMinuteSelect(m),
|
|
14452
|
+
className: cn(
|
|
14453
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14454
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14455
|
+
),
|
|
14456
|
+
children: String(m).padStart(2, "0")
|
|
14457
|
+
},
|
|
14458
|
+
m
|
|
14459
|
+
);
|
|
14460
|
+
})
|
|
14461
|
+
] }),
|
|
14462
|
+
useSeconds ? /* @__PURE__ */ jsxs289("div", { className: "flex flex-col gap-1 overflow-y-auto scrollbar-hide [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden pr-0.5", children: [
|
|
14463
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Sec" }),
|
|
14464
|
+
secondOptions.map((s) => {
|
|
14465
|
+
const isSelected = draftTime.seconds === s;
|
|
14466
|
+
return /* @__PURE__ */ jsx295(
|
|
14467
|
+
"button",
|
|
14468
|
+
{
|
|
14469
|
+
type: "button",
|
|
14470
|
+
onClick: () => handleSecondSelect(s),
|
|
14471
|
+
className: cn(
|
|
14472
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14473
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14474
|
+
),
|
|
14475
|
+
children: String(s).padStart(2, "0")
|
|
14476
|
+
},
|
|
14477
|
+
s
|
|
14478
|
+
);
|
|
14479
|
+
})
|
|
14480
|
+
] }) : format === "12h" ? /* @__PURE__ */ jsxs289("div", { className: "flex flex-col gap-2", children: [
|
|
14481
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Period" }),
|
|
14482
|
+
/* @__PURE__ */ jsx295(
|
|
14483
|
+
"button",
|
|
14484
|
+
{
|
|
14485
|
+
type: "button",
|
|
14486
|
+
onClick: () => handlePeriodToggle("AM"),
|
|
14487
|
+
className: cn(
|
|
14488
|
+
"py-2 text-xs font-semibold rounded-xl transition-all",
|
|
14489
|
+
!isPM ? "bg-primary text-white shadow-sm" : "bg-bg text-text hover:bg-bg/80"
|
|
14490
|
+
),
|
|
14491
|
+
children: "AM"
|
|
14492
|
+
}
|
|
14493
|
+
),
|
|
14494
|
+
/* @__PURE__ */ jsx295(
|
|
14495
|
+
"button",
|
|
14496
|
+
{
|
|
14497
|
+
type: "button",
|
|
14498
|
+
onClick: () => handlePeriodToggle("PM"),
|
|
14499
|
+
className: cn(
|
|
14500
|
+
"py-2 text-xs font-semibold rounded-xl transition-all",
|
|
14501
|
+
isPM ? "bg-primary text-white shadow-sm" : "bg-bg text-text hover:bg-bg/80"
|
|
14502
|
+
),
|
|
14503
|
+
children: "PM"
|
|
14504
|
+
}
|
|
14505
|
+
)
|
|
14506
|
+
] }) : null
|
|
14507
|
+
] }),
|
|
14508
|
+
/* @__PURE__ */ jsxs289("div", { className: "flex items-center justify-between pt-2 border-t border-border/10 text-xs", children: [
|
|
14509
|
+
clearable && parsedTime ? /* @__PURE__ */ jsx295(
|
|
14510
|
+
Button_default,
|
|
14511
|
+
{
|
|
14512
|
+
type: "button",
|
|
14513
|
+
variant: "text",
|
|
14514
|
+
size: "xs",
|
|
14515
|
+
color: "secondary",
|
|
14516
|
+
onClick: handleClear,
|
|
14517
|
+
children: "Clear"
|
|
14518
|
+
}
|
|
14519
|
+
) : /* @__PURE__ */ jsx295("div", {}),
|
|
14520
|
+
/* @__PURE__ */ jsx295(
|
|
14521
|
+
Button_default,
|
|
14522
|
+
{
|
|
14523
|
+
type: "button",
|
|
14524
|
+
variant: "text",
|
|
14525
|
+
size: "xs",
|
|
14526
|
+
color: "primary",
|
|
14527
|
+
onClick: handleSelectNow,
|
|
14528
|
+
className: "ml-auto",
|
|
14529
|
+
children: "Now"
|
|
14530
|
+
}
|
|
14531
|
+
)
|
|
14532
|
+
] })
|
|
14533
|
+
]
|
|
14534
|
+
}
|
|
14535
|
+
)
|
|
14536
|
+
}
|
|
14537
|
+
)
|
|
14538
|
+
] });
|
|
14539
|
+
}
|
|
14540
|
+
|
|
13829
14541
|
// src/components/Navigation/Tab/TabList/index.tsx
|
|
13830
|
-
import { useEffect as
|
|
13831
|
-
import { jsx as
|
|
14542
|
+
import { useEffect as useEffect3, useRef as useRef11 } from "react";
|
|
14543
|
+
import { jsx as jsx296, jsxs as jsxs290 } from "react/jsx-runtime";
|
|
13832
14544
|
function TabList(props) {
|
|
13833
14545
|
const {
|
|
13834
14546
|
tabs,
|
|
@@ -13836,8 +14548,8 @@ function TabList(props) {
|
|
|
13836
14548
|
onChangeActiveTabValue,
|
|
13837
14549
|
...rest
|
|
13838
14550
|
} = props;
|
|
13839
|
-
const tabsContainer =
|
|
13840
|
-
const activeIndicator =
|
|
14551
|
+
const tabsContainer = useRef11(null);
|
|
14552
|
+
const activeIndicator = useRef11(null);
|
|
13841
14553
|
function handleValueChange() {
|
|
13842
14554
|
if (!tabsContainer.current || !activeIndicator.current) return;
|
|
13843
14555
|
const tab = tabsContainer.current.querySelector(`#${activeTabValue}`);
|
|
@@ -13848,7 +14560,7 @@ function TabList(props) {
|
|
|
13848
14560
|
activeIndicator.current.style.height = `${tabLayoutInfo.height}px`;
|
|
13849
14561
|
activeIndicator.current.style.transform = `translateX(${tabLayoutInfo.left - containerLayoutInfo.left}px)`;
|
|
13850
14562
|
}
|
|
13851
|
-
|
|
14563
|
+
useEffect3(() => {
|
|
13852
14564
|
handleValueChange();
|
|
13853
14565
|
window.addEventListener("resize", handleValueChange);
|
|
13854
14566
|
tabsContainer.current?.addEventListener("scroll", handleValueChange);
|
|
@@ -13857,14 +14569,14 @@ function TabList(props) {
|
|
|
13857
14569
|
tabsContainer.current?.removeEventListener("scroll", handleValueChange);
|
|
13858
14570
|
};
|
|
13859
14571
|
}, [activeTabValue]);
|
|
13860
|
-
return /* @__PURE__ */
|
|
14572
|
+
return /* @__PURE__ */ jsxs290(
|
|
13861
14573
|
"div",
|
|
13862
14574
|
{
|
|
13863
14575
|
...rest,
|
|
13864
14576
|
className: cn("bg-bg-secondary w-full p-1 rounded-xl relative", rest.className),
|
|
13865
14577
|
children: [
|
|
13866
|
-
/* @__PURE__ */
|
|
13867
|
-
/* @__PURE__ */
|
|
14578
|
+
/* @__PURE__ */ jsx296("div", { ref: activeIndicator, className: "absolute rounded-lg bg-primary transition-all duration-200" }),
|
|
14579
|
+
/* @__PURE__ */ jsx296("div", { ref: tabsContainer, className: "flex items-center gap-1 w-full overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx296(
|
|
13868
14580
|
"div",
|
|
13869
14581
|
{
|
|
13870
14582
|
id: tab.value,
|
|
@@ -13884,7 +14596,7 @@ function TabList(props) {
|
|
|
13884
14596
|
|
|
13885
14597
|
// src/components/Navigation/Tab/TabPanel/RenderPanel.tsx
|
|
13886
14598
|
import { memo } from "react";
|
|
13887
|
-
import { jsx as
|
|
14599
|
+
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
13888
14600
|
var RenderPanel = memo((props) => {
|
|
13889
14601
|
const {
|
|
13890
14602
|
activePanelValue,
|
|
@@ -13893,14 +14605,14 @@ var RenderPanel = memo((props) => {
|
|
|
13893
14605
|
panelRemoveOnHide
|
|
13894
14606
|
} = props;
|
|
13895
14607
|
if (panels.length === 0) return null;
|
|
13896
|
-
return /* @__PURE__ */
|
|
14608
|
+
return /* @__PURE__ */ jsx297(
|
|
13897
14609
|
ShowWithAnimation,
|
|
13898
14610
|
{
|
|
13899
14611
|
when: panels[0].value === activePanelValue,
|
|
13900
14612
|
containerProps: { className: "w-full h-full" },
|
|
13901
14613
|
className: "w-full h-full",
|
|
13902
14614
|
removeOnHide: panelRemoveOnHide,
|
|
13903
|
-
otherwise: /* @__PURE__ */
|
|
14615
|
+
otherwise: /* @__PURE__ */ jsx297(RenderPanel, { ...props, panels: panels.slice(1) }),
|
|
13904
14616
|
animationStyle: animationStyle ?? {
|
|
13905
14617
|
children: {
|
|
13906
14618
|
from: { scale: 0.9, opacity: 0 },
|
|
@@ -13914,7 +14626,7 @@ var RenderPanel = memo((props) => {
|
|
|
13914
14626
|
});
|
|
13915
14627
|
|
|
13916
14628
|
// src/components/Navigation/Tab/TabPanel/index.tsx
|
|
13917
|
-
import { jsx as
|
|
14629
|
+
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
13918
14630
|
function TabPanel(props) {
|
|
13919
14631
|
const {
|
|
13920
14632
|
activePanelValue,
|
|
@@ -13923,7 +14635,7 @@ function TabPanel(props) {
|
|
|
13923
14635
|
panelRemoveOnHide,
|
|
13924
14636
|
...rest
|
|
13925
14637
|
} = props;
|
|
13926
|
-
return /* @__PURE__ */
|
|
14638
|
+
return /* @__PURE__ */ jsx298("div", { ...rest, children: /* @__PURE__ */ jsx298(
|
|
13927
14639
|
RenderPanel,
|
|
13928
14640
|
{
|
|
13929
14641
|
activePanelValue,
|
|
@@ -13935,7 +14647,7 @@ function TabPanel(props) {
|
|
|
13935
14647
|
}
|
|
13936
14648
|
|
|
13937
14649
|
// src/components/DataDisplay/Table/Table.tsx
|
|
13938
|
-
import { forwardRef as forwardRef3, useMemo as
|
|
14650
|
+
import { forwardRef as forwardRef3, useMemo as useMemo6 } from "react";
|
|
13939
14651
|
|
|
13940
14652
|
// src/components/DataDisplay/Table/TableContext.tsx
|
|
13941
14653
|
import { createContext, useContext } from "react";
|
|
@@ -13945,17 +14657,17 @@ var TableContext = createContext({
|
|
|
13945
14657
|
var useTableContext = () => useContext(TableContext);
|
|
13946
14658
|
|
|
13947
14659
|
// src/components/DataDisplay/Table/Table.tsx
|
|
13948
|
-
import { jsx as
|
|
14660
|
+
import { jsx as jsx299 } from "react/jsx-runtime";
|
|
13949
14661
|
var Table = forwardRef3(
|
|
13950
14662
|
({ className = "", children, stickyHeader = false, loading = false, ...props }, ref) => {
|
|
13951
|
-
const value =
|
|
13952
|
-
return /* @__PURE__ */
|
|
14663
|
+
const value = useMemo6(() => ({ stickyHeader }), [stickyHeader]);
|
|
14664
|
+
return /* @__PURE__ */ jsx299(TableContext.Provider, { value, children: /* @__PURE__ */ jsx299(
|
|
13953
14665
|
"table",
|
|
13954
14666
|
{
|
|
13955
14667
|
ref,
|
|
13956
14668
|
className: `w-full caption-bottom text-sm border-collapse ${stickyHeader ? "relative" : ""} ${className}`,
|
|
13957
14669
|
...props,
|
|
13958
|
-
children: loading ? /* @__PURE__ */
|
|
14670
|
+
children: loading ? /* @__PURE__ */ jsx299("tbody", { className: "h-48", children: /* @__PURE__ */ jsx299("tr", { children: /* @__PURE__ */ jsx299("td", { colSpan: 100, className: "text-center align-middle h-full", children: /* @__PURE__ */ jsx299("div", { className: "flex justify-center items-center h-full", children: /* @__PURE__ */ jsx299(Spinner, { size: 32 }) }) }) }) }) : children
|
|
13959
14671
|
}
|
|
13960
14672
|
) });
|
|
13961
14673
|
}
|
|
@@ -13965,10 +14677,10 @@ var Table_default = Table;
|
|
|
13965
14677
|
|
|
13966
14678
|
// src/components/DataDisplay/Table/TableContainer.tsx
|
|
13967
14679
|
import { forwardRef as forwardRef4 } from "react";
|
|
13968
|
-
import { jsx as
|
|
14680
|
+
import { jsx as jsx300 } from "react/jsx-runtime";
|
|
13969
14681
|
var TableContainer = forwardRef4(
|
|
13970
14682
|
({ className = "", children, ...props }, ref) => {
|
|
13971
|
-
return /* @__PURE__ */
|
|
14683
|
+
return /* @__PURE__ */ jsx300(
|
|
13972
14684
|
"div",
|
|
13973
14685
|
{
|
|
13974
14686
|
ref,
|
|
@@ -13984,10 +14696,10 @@ var TableContainer_default = TableContainer;
|
|
|
13984
14696
|
|
|
13985
14697
|
// src/components/DataDisplay/Table/TableHead.tsx
|
|
13986
14698
|
import { forwardRef as forwardRef5 } from "react";
|
|
13987
|
-
import { jsx as
|
|
14699
|
+
import { jsx as jsx301 } from "react/jsx-runtime";
|
|
13988
14700
|
var TableHead = forwardRef5(
|
|
13989
14701
|
({ className = "", children, ...props }, ref) => {
|
|
13990
|
-
return /* @__PURE__ */
|
|
14702
|
+
return /* @__PURE__ */ jsx301(
|
|
13991
14703
|
"thead",
|
|
13992
14704
|
{
|
|
13993
14705
|
ref,
|
|
@@ -14003,10 +14715,10 @@ var TableHead_default = TableHead;
|
|
|
14003
14715
|
|
|
14004
14716
|
// src/components/DataDisplay/Table/TableBody.tsx
|
|
14005
14717
|
import { forwardRef as forwardRef6 } from "react";
|
|
14006
|
-
import { jsx as
|
|
14718
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
14007
14719
|
var TableBody = forwardRef6(
|
|
14008
14720
|
({ className = "", children, ...props }, ref) => {
|
|
14009
|
-
return /* @__PURE__ */
|
|
14721
|
+
return /* @__PURE__ */ jsx302(
|
|
14010
14722
|
"tbody",
|
|
14011
14723
|
{
|
|
14012
14724
|
ref,
|
|
@@ -14022,10 +14734,10 @@ var TableBody_default = TableBody;
|
|
|
14022
14734
|
|
|
14023
14735
|
// src/components/DataDisplay/Table/TableRow.tsx
|
|
14024
14736
|
import { forwardRef as forwardRef7 } from "react";
|
|
14025
|
-
import { jsx as
|
|
14737
|
+
import { jsx as jsx303 } from "react/jsx-runtime";
|
|
14026
14738
|
var TableRow = forwardRef7(
|
|
14027
14739
|
({ className = "", children, hover = false, selected = false, ...props }, ref) => {
|
|
14028
|
-
return /* @__PURE__ */
|
|
14740
|
+
return /* @__PURE__ */ jsx303(
|
|
14029
14741
|
"tr",
|
|
14030
14742
|
{
|
|
14031
14743
|
ref,
|
|
@@ -14041,7 +14753,7 @@ var TableRow_default = TableRow;
|
|
|
14041
14753
|
|
|
14042
14754
|
// src/components/DataDisplay/Table/TableCell.tsx
|
|
14043
14755
|
import { forwardRef as forwardRef8 } from "react";
|
|
14044
|
-
import { jsx as
|
|
14756
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
14045
14757
|
var TableCell = forwardRef8(
|
|
14046
14758
|
({ className = "", align = "left", variant, component, children, ...props }, ref) => {
|
|
14047
14759
|
const { stickyHeader } = useTableContext();
|
|
@@ -14054,7 +14766,7 @@ var TableCell = forwardRef8(
|
|
|
14054
14766
|
justify: "text-justify",
|
|
14055
14767
|
inherit: "text-inherit"
|
|
14056
14768
|
};
|
|
14057
|
-
return /* @__PURE__ */
|
|
14769
|
+
return /* @__PURE__ */ jsx304(
|
|
14058
14770
|
Component,
|
|
14059
14771
|
{
|
|
14060
14772
|
ref,
|
|
@@ -14069,17 +14781,17 @@ TableCell.displayName = "TableCell";
|
|
|
14069
14781
|
var TableCell_default = TableCell;
|
|
14070
14782
|
|
|
14071
14783
|
// src/components/DataDisplay/Table/DataTable.tsx
|
|
14072
|
-
import { jsx as
|
|
14784
|
+
import { jsx as jsx305, jsxs as jsxs291 } from "react/jsx-runtime";
|
|
14073
14785
|
function DataTable({
|
|
14074
14786
|
data,
|
|
14075
14787
|
columns,
|
|
14076
14788
|
loading,
|
|
14077
14789
|
pagination
|
|
14078
14790
|
}) {
|
|
14079
|
-
return /* @__PURE__ */
|
|
14080
|
-
/* @__PURE__ */
|
|
14081
|
-
/* @__PURE__ */
|
|
14082
|
-
/* @__PURE__ */
|
|
14791
|
+
return /* @__PURE__ */ jsxs291(TableContainer_default, { children: [
|
|
14792
|
+
/* @__PURE__ */ jsxs291(Table_default, { loading, children: [
|
|
14793
|
+
/* @__PURE__ */ jsx305(TableHead_default, { children: /* @__PURE__ */ jsx305(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx305(TableCell_default, { variant: "head", children: col.title }, col.key)) }) }),
|
|
14794
|
+
/* @__PURE__ */ jsx305(TableBody_default, { children: data.map((row) => /* @__PURE__ */ jsx305(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx305(TableCell_default, { children: col.render ? col.render(row) : row[col.key] }, col.key)) }, row.id)) })
|
|
14083
14795
|
] }),
|
|
14084
14796
|
pagination && (() => {
|
|
14085
14797
|
const getVisiblePages = (current, total) => {
|
|
@@ -14089,8 +14801,8 @@ function DataTable({
|
|
|
14089
14801
|
return [1, "...", current - 1, current, current + 1, "...", total];
|
|
14090
14802
|
};
|
|
14091
14803
|
const visiblePages = getVisiblePages(pagination.page, pagination.totalPages);
|
|
14092
|
-
return /* @__PURE__ */
|
|
14093
|
-
/* @__PURE__ */
|
|
14804
|
+
return /* @__PURE__ */ jsx305("div", { className: "flex justify-end items-center px-3 py-2 border-t bg-transparent text-sm text-text-secondary", children: /* @__PURE__ */ jsxs291("div", { className: "flex justify-end gap-2 items-center", children: [
|
|
14805
|
+
/* @__PURE__ */ jsx305(
|
|
14094
14806
|
Button_default,
|
|
14095
14807
|
{
|
|
14096
14808
|
variant: "outlined",
|
|
@@ -14101,7 +14813,7 @@ function DataTable({
|
|
|
14101
14813
|
children: "Previous"
|
|
14102
14814
|
}
|
|
14103
14815
|
),
|
|
14104
|
-
visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */
|
|
14816
|
+
visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */ jsx305("span", { className: "px-2", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx305(
|
|
14105
14817
|
Button_default,
|
|
14106
14818
|
{
|
|
14107
14819
|
variant: p === pagination.page ? "soft" : "outlined",
|
|
@@ -14114,7 +14826,7 @@ function DataTable({
|
|
|
14114
14826
|
},
|
|
14115
14827
|
p
|
|
14116
14828
|
)),
|
|
14117
|
-
/* @__PURE__ */
|
|
14829
|
+
/* @__PURE__ */ jsx305(
|
|
14118
14830
|
Button_default,
|
|
14119
14831
|
{
|
|
14120
14832
|
variant: "outlined",
|
|
@@ -14133,10 +14845,10 @@ var DataTable_default = DataTable;
|
|
|
14133
14845
|
|
|
14134
14846
|
// src/components/DataDisplay/Table/TableFooter.tsx
|
|
14135
14847
|
import { forwardRef as forwardRef9 } from "react";
|
|
14136
|
-
import { jsx as
|
|
14848
|
+
import { jsx as jsx306 } from "react/jsx-runtime";
|
|
14137
14849
|
var TableFooter = forwardRef9(
|
|
14138
14850
|
({ className = "", children, ...props }, ref) => {
|
|
14139
|
-
return /* @__PURE__ */
|
|
14851
|
+
return /* @__PURE__ */ jsx306(
|
|
14140
14852
|
"tfoot",
|
|
14141
14853
|
{
|
|
14142
14854
|
ref,
|
|
@@ -14151,8 +14863,8 @@ TableFooter.displayName = "TableFooter";
|
|
|
14151
14863
|
var TableFooter_default = TableFooter;
|
|
14152
14864
|
|
|
14153
14865
|
// src/components/DataDisplay/Carousel/Carousel.tsx
|
|
14154
|
-
import { useState as
|
|
14155
|
-
import { Fragment as
|
|
14866
|
+
import { useState as useState10, useEffect as useEffect4, useCallback as useCallback3, forwardRef as forwardRef10 } from "react";
|
|
14867
|
+
import { Fragment as Fragment7, jsx as jsx307, jsxs as jsxs292 } from "react/jsx-runtime";
|
|
14156
14868
|
var Carousel = forwardRef10(
|
|
14157
14869
|
({
|
|
14158
14870
|
items,
|
|
@@ -14164,8 +14876,8 @@ var Carousel = forwardRef10(
|
|
|
14164
14876
|
style,
|
|
14165
14877
|
...props
|
|
14166
14878
|
}, ref) => {
|
|
14167
|
-
const [currentIndex, setCurrentIndex] =
|
|
14168
|
-
const [isHovered, setIsHovered] =
|
|
14879
|
+
const [currentIndex, setCurrentIndex] = useState10(0);
|
|
14880
|
+
const [isHovered, setIsHovered] = useState10(false);
|
|
14169
14881
|
const goToNext = useCallback3(() => {
|
|
14170
14882
|
setCurrentIndex((prevIndex) => prevIndex === items.length - 1 ? 0 : prevIndex + 1);
|
|
14171
14883
|
}, [items.length]);
|
|
@@ -14175,7 +14887,7 @@ var Carousel = forwardRef10(
|
|
|
14175
14887
|
const goToIndex = (index) => {
|
|
14176
14888
|
setCurrentIndex(index);
|
|
14177
14889
|
};
|
|
14178
|
-
|
|
14890
|
+
useEffect4(() => {
|
|
14179
14891
|
if (!autoPlay || isHovered) return;
|
|
14180
14892
|
const timer = setInterval(goToNext, interval);
|
|
14181
14893
|
return () => clearInterval(timer);
|
|
@@ -14183,7 +14895,7 @@ var Carousel = forwardRef10(
|
|
|
14183
14895
|
if (!items || items.length === 0) {
|
|
14184
14896
|
return null;
|
|
14185
14897
|
}
|
|
14186
|
-
return /* @__PURE__ */
|
|
14898
|
+
return /* @__PURE__ */ jsxs292(
|
|
14187
14899
|
"div",
|
|
14188
14900
|
{
|
|
14189
14901
|
ref,
|
|
@@ -14193,13 +14905,13 @@ var Carousel = forwardRef10(
|
|
|
14193
14905
|
onMouseLeave: () => setIsHovered(false),
|
|
14194
14906
|
...props,
|
|
14195
14907
|
children: [
|
|
14196
|
-
/* @__PURE__ */
|
|
14908
|
+
/* @__PURE__ */ jsx307(
|
|
14197
14909
|
"div",
|
|
14198
14910
|
{
|
|
14199
14911
|
className: "flex transition-transform duration-500 ease-in-out h-full w-full flex-1",
|
|
14200
14912
|
style: { transform: `translateX(-${currentIndex * 100}%)` },
|
|
14201
|
-
children: items.map((item) => /* @__PURE__ */
|
|
14202
|
-
/* @__PURE__ */
|
|
14913
|
+
children: items.map((item) => /* @__PURE__ */ jsxs292("div", { className: "w-full h-full relative shrink-0", style: { flex: "0 0 100%" }, children: [
|
|
14914
|
+
/* @__PURE__ */ jsx307(
|
|
14203
14915
|
"img",
|
|
14204
14916
|
{
|
|
14205
14917
|
src: item.imageUrl,
|
|
@@ -14207,15 +14919,15 @@ var Carousel = forwardRef10(
|
|
|
14207
14919
|
className: "w-full h-full object-cover"
|
|
14208
14920
|
}
|
|
14209
14921
|
),
|
|
14210
|
-
(item.title || item.description) && /* @__PURE__ */
|
|
14211
|
-
item.title && /* @__PURE__ */
|
|
14212
|
-
item.description && /* @__PURE__ */
|
|
14922
|
+
(item.title || item.description) && /* @__PURE__ */ jsxs292("div", { className: "absolute inset-0 bg-gradient-to-t from-black/80 via-black/30 to-transparent flex flex-col justify-end p-6 md:p-8", children: [
|
|
14923
|
+
item.title && /* @__PURE__ */ jsx307("h3", { className: "text-white text-xl md:text-3xl font-semibold mb-2 transform transition-all duration-500 translate-y-0 opacity-100", children: item.title }),
|
|
14924
|
+
item.description && /* @__PURE__ */ jsx307("p", { className: "text-white/80 text-sm md:text-base max-w-2xl transform transition-all duration-500 delay-100 translate-y-0 opacity-100", children: item.description })
|
|
14213
14925
|
] })
|
|
14214
14926
|
] }, item.id))
|
|
14215
14927
|
}
|
|
14216
14928
|
),
|
|
14217
|
-
showArrows && items.length > 1 && /* @__PURE__ */
|
|
14218
|
-
/* @__PURE__ */
|
|
14929
|
+
showArrows && items.length > 1 && /* @__PURE__ */ jsxs292(Fragment7, { children: [
|
|
14930
|
+
/* @__PURE__ */ jsx307(
|
|
14219
14931
|
IconButton_default,
|
|
14220
14932
|
{
|
|
14221
14933
|
onClick: goToPrevious,
|
|
@@ -14223,7 +14935,7 @@ var Carousel = forwardRef10(
|
|
|
14223
14935
|
color: "secondary",
|
|
14224
14936
|
className: "absolute left-4 top-1/2 -translate-y-1/2 !bg-black/30 hover:!bg-black/50 text-white backdrop-blur-sm transition-all opacity-0 group-hover:opacity-100 disabled:opacity-0 z-10",
|
|
14225
14937
|
"aria-label": "Previous slide",
|
|
14226
|
-
children: /* @__PURE__ */
|
|
14938
|
+
children: /* @__PURE__ */ jsx307(
|
|
14227
14939
|
"svg",
|
|
14228
14940
|
{
|
|
14229
14941
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14232,12 +14944,12 @@ var Carousel = forwardRef10(
|
|
|
14232
14944
|
strokeWidth: 2,
|
|
14233
14945
|
stroke: "currentColor",
|
|
14234
14946
|
className: "w-5 h-5",
|
|
14235
|
-
children: /* @__PURE__ */
|
|
14947
|
+
children: /* @__PURE__ */ jsx307("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" })
|
|
14236
14948
|
}
|
|
14237
14949
|
)
|
|
14238
14950
|
}
|
|
14239
14951
|
),
|
|
14240
|
-
/* @__PURE__ */
|
|
14952
|
+
/* @__PURE__ */ jsx307(
|
|
14241
14953
|
IconButton_default,
|
|
14242
14954
|
{
|
|
14243
14955
|
onClick: goToNext,
|
|
@@ -14245,7 +14957,7 @@ var Carousel = forwardRef10(
|
|
|
14245
14957
|
color: "secondary",
|
|
14246
14958
|
className: "absolute right-4 top-1/2 -translate-y-1/2 !bg-black/30 hover:!bg-black/50 text-white backdrop-blur-sm transition-all opacity-0 group-hover:opacity-100 disabled:opacity-0 z-10",
|
|
14247
14959
|
"aria-label": "Next slide",
|
|
14248
|
-
children: /* @__PURE__ */
|
|
14960
|
+
children: /* @__PURE__ */ jsx307(
|
|
14249
14961
|
"svg",
|
|
14250
14962
|
{
|
|
14251
14963
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14254,13 +14966,13 @@ var Carousel = forwardRef10(
|
|
|
14254
14966
|
strokeWidth: 2,
|
|
14255
14967
|
stroke: "currentColor",
|
|
14256
14968
|
className: "w-5 h-5",
|
|
14257
|
-
children: /* @__PURE__ */
|
|
14969
|
+
children: /* @__PURE__ */ jsx307("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" })
|
|
14258
14970
|
}
|
|
14259
14971
|
)
|
|
14260
14972
|
}
|
|
14261
14973
|
)
|
|
14262
14974
|
] }),
|
|
14263
|
-
showIndicators && items.length > 1 && /* @__PURE__ */
|
|
14975
|
+
showIndicators && items.length > 1 && /* @__PURE__ */ jsx307("div", { className: "absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2 z-20", children: items.map((_, index) => /* @__PURE__ */ jsx307(
|
|
14264
14976
|
"button",
|
|
14265
14977
|
{
|
|
14266
14978
|
onClick: () => goToIndex(index),
|
|
@@ -14281,10 +14993,10 @@ Carousel.displayName = "Carousel";
|
|
|
14281
14993
|
|
|
14282
14994
|
// src/components/DataDisplay/Separator/Separator.tsx
|
|
14283
14995
|
import React3 from "react";
|
|
14284
|
-
import { jsx as
|
|
14996
|
+
import { jsx as jsx308 } from "react/jsx-runtime";
|
|
14285
14997
|
var Separator = React3.forwardRef(
|
|
14286
14998
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
14287
|
-
return /* @__PURE__ */
|
|
14999
|
+
return /* @__PURE__ */ jsx308(
|
|
14288
15000
|
"div",
|
|
14289
15001
|
{
|
|
14290
15002
|
ref,
|
|
@@ -14304,7 +15016,7 @@ Separator.displayName = "Separator";
|
|
|
14304
15016
|
|
|
14305
15017
|
// src/components/Overlay/Dialog/Dialog.tsx
|
|
14306
15018
|
import { createPortal } from "react-dom";
|
|
14307
|
-
import { jsx as
|
|
15019
|
+
import { jsx as jsx309 } from "react/jsx-runtime";
|
|
14308
15020
|
function Dialog(props) {
|
|
14309
15021
|
const {
|
|
14310
15022
|
open,
|
|
@@ -14336,7 +15048,7 @@ function Dialog(props) {
|
|
|
14336
15048
|
]);
|
|
14337
15049
|
if (typeof window === "undefined") return null;
|
|
14338
15050
|
return createPortal(
|
|
14339
|
-
/* @__PURE__ */
|
|
15051
|
+
/* @__PURE__ */ jsx309(
|
|
14340
15052
|
ShowWithAnimation,
|
|
14341
15053
|
{
|
|
14342
15054
|
when: open,
|
|
@@ -14364,7 +15076,7 @@ function Dialog(props) {
|
|
|
14364
15076
|
onClose?.();
|
|
14365
15077
|
}
|
|
14366
15078
|
},
|
|
14367
|
-
children: /* @__PURE__ */
|
|
15079
|
+
children: /* @__PURE__ */ jsx309(
|
|
14368
15080
|
ShowWithAnimation,
|
|
14369
15081
|
{
|
|
14370
15082
|
when: open,
|
|
@@ -14389,19 +15101,19 @@ function Dialog(props) {
|
|
|
14389
15101
|
}
|
|
14390
15102
|
|
|
14391
15103
|
// src/components/Overlay/Dialog/DialogHeader.tsx
|
|
14392
|
-
import { jsx as
|
|
15104
|
+
import { jsx as jsx310, jsxs as jsxs293 } from "react/jsx-runtime";
|
|
14393
15105
|
function DialogHeader(props) {
|
|
14394
15106
|
const { title, children, ...rest } = props;
|
|
14395
|
-
return /* @__PURE__ */
|
|
14396
|
-
/* @__PURE__ */
|
|
15107
|
+
return /* @__PURE__ */ jsxs293("div", { ...rest, className: cn("p-4 sticky top-0 z-[20] backdrop-blur-sm", props.className), children: [
|
|
15108
|
+
/* @__PURE__ */ jsx310(Show, { when: !!title, children: /* @__PURE__ */ jsx310("h1", { className: "text-lg font-bold", children: title }) }),
|
|
14397
15109
|
children
|
|
14398
15110
|
] });
|
|
14399
15111
|
}
|
|
14400
15112
|
|
|
14401
15113
|
// src/components/Overlay/Dialog/DialogFooter.tsx
|
|
14402
|
-
import { jsx as
|
|
15114
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
14403
15115
|
function DialogFooter(props) {
|
|
14404
|
-
return /* @__PURE__ */
|
|
15116
|
+
return /* @__PURE__ */ jsx311(
|
|
14405
15117
|
"div",
|
|
14406
15118
|
{
|
|
14407
15119
|
...props,
|
|
@@ -14411,9 +15123,9 @@ function DialogFooter(props) {
|
|
|
14411
15123
|
}
|
|
14412
15124
|
|
|
14413
15125
|
// src/components/Overlay/Dialog/DialogContent.tsx
|
|
14414
|
-
import { jsx as
|
|
15126
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
14415
15127
|
function DialogContent(props) {
|
|
14416
|
-
return /* @__PURE__ */
|
|
15128
|
+
return /* @__PURE__ */ jsx312(
|
|
14417
15129
|
"div",
|
|
14418
15130
|
{
|
|
14419
15131
|
...props,
|
|
@@ -14424,7 +15136,7 @@ function DialogContent(props) {
|
|
|
14424
15136
|
|
|
14425
15137
|
// src/components/Overlay/Drawer/Drawer.tsx
|
|
14426
15138
|
import { createPortal as createPortal2 } from "react-dom";
|
|
14427
|
-
import { jsx as
|
|
15139
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
14428
15140
|
function Drawer(props) {
|
|
14429
15141
|
const {
|
|
14430
15142
|
open,
|
|
@@ -14459,7 +15171,7 @@ function Drawer(props) {
|
|
|
14459
15171
|
}[_size] + (isHorizontal ? "vw" : "vh");
|
|
14460
15172
|
})();
|
|
14461
15173
|
return createPortal2(
|
|
14462
|
-
/* @__PURE__ */
|
|
15174
|
+
/* @__PURE__ */ jsx313(
|
|
14463
15175
|
ShowWithAnimation,
|
|
14464
15176
|
{
|
|
14465
15177
|
when: open,
|
|
@@ -14489,7 +15201,7 @@ function Drawer(props) {
|
|
|
14489
15201
|
onClose?.();
|
|
14490
15202
|
}
|
|
14491
15203
|
},
|
|
14492
|
-
children: /* @__PURE__ */
|
|
15204
|
+
children: /* @__PURE__ */ jsx313(
|
|
14493
15205
|
ShowWithAnimation,
|
|
14494
15206
|
{
|
|
14495
15207
|
when: open,
|
|
@@ -14536,9 +15248,9 @@ function Drawer(props) {
|
|
|
14536
15248
|
}
|
|
14537
15249
|
|
|
14538
15250
|
// src/components/Overlay/Drawer/DrawerContent.tsx
|
|
14539
|
-
import { jsx as
|
|
15251
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
14540
15252
|
function DrawerContent({ children, className, style }) {
|
|
14541
|
-
return /* @__PURE__ */
|
|
15253
|
+
return /* @__PURE__ */ jsx314(
|
|
14542
15254
|
"div",
|
|
14543
15255
|
{
|
|
14544
15256
|
className: cn("overflow-auto flex-1 p-4 relative hide-scrollbar", className),
|
|
@@ -14549,9 +15261,9 @@ function DrawerContent({ children, className, style }) {
|
|
|
14549
15261
|
}
|
|
14550
15262
|
|
|
14551
15263
|
// src/components/Overlay/Drawer/DrawerHeader.tsx
|
|
14552
|
-
import { jsx as
|
|
15264
|
+
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
14553
15265
|
function DrawerHeader({ children, className, style }) {
|
|
14554
|
-
return /* @__PURE__ */
|
|
15266
|
+
return /* @__PURE__ */ jsx315(
|
|
14555
15267
|
"div",
|
|
14556
15268
|
{
|
|
14557
15269
|
className: cn("sticky top-0 z-20 backdrop-blur-sm bg-bg-secondary/60 px-4 py-3 border-b border-border", className),
|
|
@@ -14562,9 +15274,9 @@ function DrawerHeader({ children, className, style }) {
|
|
|
14562
15274
|
}
|
|
14563
15275
|
|
|
14564
15276
|
// src/components/Overlay/Drawer/DrawerFooter.tsx
|
|
14565
|
-
import { jsx as
|
|
15277
|
+
import { jsx as jsx316 } from "react/jsx-runtime";
|
|
14566
15278
|
function DrawerFooter({ children, className, style }) {
|
|
14567
|
-
return /* @__PURE__ */
|
|
15279
|
+
return /* @__PURE__ */ jsx316(
|
|
14568
15280
|
"div",
|
|
14569
15281
|
{
|
|
14570
15282
|
className: cn("sticky bottom-0 z-20 backdrop-blur-sm bg-bg-secondary/60 px-4 py-3 border-t border-border", className),
|
|
@@ -14579,13 +15291,13 @@ import { createRoot } from "react-dom/client";
|
|
|
14579
15291
|
import { createPortal as createPortal3 } from "react-dom";
|
|
14580
15292
|
|
|
14581
15293
|
// src/components/Overlay/Alert/Alert.tsx
|
|
14582
|
-
import { useEffect as
|
|
14583
|
-
import { jsx as
|
|
15294
|
+
import { useEffect as useEffect5, useState as useState11, useRef as useRef12, useCallback as useCallback4 } from "react";
|
|
15295
|
+
import { jsx as jsx317, jsxs as jsxs294 } from "react/jsx-runtime";
|
|
14584
15296
|
var icons = {
|
|
14585
|
-
success: /* @__PURE__ */
|
|
14586
|
-
error: /* @__PURE__ */
|
|
14587
|
-
warning: /* @__PURE__ */
|
|
14588
|
-
info: /* @__PURE__ */
|
|
15297
|
+
success: /* @__PURE__ */ jsx317(SuccessIcon, {}),
|
|
15298
|
+
error: /* @__PURE__ */ jsx317(ErrorIcon, {}),
|
|
15299
|
+
warning: /* @__PURE__ */ jsx317(WarningIcon, {}),
|
|
15300
|
+
info: /* @__PURE__ */ jsx317(InfoIcon, {})
|
|
14589
15301
|
};
|
|
14590
15302
|
var textStyles = {
|
|
14591
15303
|
success: "text-success-800",
|
|
@@ -14613,14 +15325,14 @@ var progressColors = {
|
|
|
14613
15325
|
};
|
|
14614
15326
|
function AlertComponent({ open, title, type, options, onClose }) {
|
|
14615
15327
|
if (typeof window === "undefined") return null;
|
|
14616
|
-
const [progress, setProgress] =
|
|
14617
|
-
const [showContent, setShowContent] =
|
|
14618
|
-
const timerRef =
|
|
14619
|
-
const animFrameRef =
|
|
14620
|
-
const startTimeRef =
|
|
14621
|
-
const remainingRef =
|
|
14622
|
-
const onCloseRef =
|
|
14623
|
-
|
|
15328
|
+
const [progress, setProgress] = useState11(100);
|
|
15329
|
+
const [showContent, setShowContent] = useState11(false);
|
|
15330
|
+
const timerRef = useRef12(null);
|
|
15331
|
+
const animFrameRef = useRef12(null);
|
|
15332
|
+
const startTimeRef = useRef12(0);
|
|
15333
|
+
const remainingRef = useRef12(0);
|
|
15334
|
+
const onCloseRef = useRef12(onClose);
|
|
15335
|
+
useEffect5(() => {
|
|
14624
15336
|
onCloseRef.current = onClose;
|
|
14625
15337
|
}, [onClose]);
|
|
14626
15338
|
const clearTimers = useCallback4(() => {
|
|
@@ -14648,7 +15360,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14648
15360
|
animFrameRef.current = requestAnimationFrame(animate);
|
|
14649
15361
|
timerRef.current = setTimeout(() => onCloseRef.current(), duration);
|
|
14650
15362
|
}, [options?.duration]);
|
|
14651
|
-
|
|
15363
|
+
useEffect5(() => {
|
|
14652
15364
|
if (open && options?.duration) {
|
|
14653
15365
|
setProgress(100);
|
|
14654
15366
|
const paintTimer = setTimeout(() => {
|
|
@@ -14673,7 +15385,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14673
15385
|
if (!options?.duration || remainingRef.current <= 0) return;
|
|
14674
15386
|
startProgressAnimation(remainingRef.current);
|
|
14675
15387
|
}, [options?.duration, startProgressAnimation]);
|
|
14676
|
-
return /* @__PURE__ */
|
|
15388
|
+
return /* @__PURE__ */ jsx317(
|
|
14677
15389
|
ShowWithAnimation,
|
|
14678
15390
|
{
|
|
14679
15391
|
when: open,
|
|
@@ -14692,7 +15404,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14692
15404
|
}
|
|
14693
15405
|
},
|
|
14694
15406
|
className: "pointer-events-auto flex justify-center",
|
|
14695
|
-
children: /* @__PURE__ */
|
|
15407
|
+
children: /* @__PURE__ */ jsxs294(
|
|
14696
15408
|
"div",
|
|
14697
15409
|
{
|
|
14698
15410
|
className: cn(
|
|
@@ -14702,37 +15414,37 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14702
15414
|
onMouseEnter: handleMouseEnter,
|
|
14703
15415
|
onMouseLeave: handleMouseLeave,
|
|
14704
15416
|
children: [
|
|
14705
|
-
/* @__PURE__ */
|
|
14706
|
-
/* @__PURE__ */
|
|
14707
|
-
/* @__PURE__ */
|
|
14708
|
-
/* @__PURE__ */
|
|
15417
|
+
/* @__PURE__ */ jsxs294("div", { className: cn("flex gap-3 items-center px-4 pt-4", options?.content ? "pb-2" : "pb-4"), children: [
|
|
15418
|
+
/* @__PURE__ */ jsx317("div", { className: cn("flex-shrink-0", iconStyles[type]), children: icons[type] }),
|
|
15419
|
+
/* @__PURE__ */ jsx317("h3", { className: cn("flex-1 text-sm font-semibold", textStyles[type]), children: title }),
|
|
15420
|
+
/* @__PURE__ */ jsx317(
|
|
14709
15421
|
"button",
|
|
14710
15422
|
{
|
|
14711
15423
|
onClick: onClose,
|
|
14712
15424
|
className: cn("flex-shrink-0 opacity-50 hover:opacity-100 transition-opacity rounded-md", textStyles[type]),
|
|
14713
15425
|
"aria-label": "Close Alert",
|
|
14714
|
-
children: /* @__PURE__ */
|
|
15426
|
+
children: /* @__PURE__ */ jsx317(CloseIcon, {})
|
|
14715
15427
|
}
|
|
14716
15428
|
)
|
|
14717
15429
|
] }),
|
|
14718
|
-
options?.content && /* @__PURE__ */
|
|
14719
|
-
/* @__PURE__ */
|
|
15430
|
+
options?.content && /* @__PURE__ */ jsxs294("div", { className: "px-4 pb-4", children: [
|
|
15431
|
+
/* @__PURE__ */ jsxs294(
|
|
14720
15432
|
"button",
|
|
14721
15433
|
{
|
|
14722
15434
|
onClick: () => setShowContent(!showContent),
|
|
14723
15435
|
className: cn("text-xs font-medium underline opacity-80 hover:opacity-100 transition-opacity flex items-center gap-1", textStyles[type]),
|
|
14724
15436
|
children: [
|
|
14725
15437
|
showContent ? "Less Info" : "More Info",
|
|
14726
|
-
/* @__PURE__ */
|
|
15438
|
+
/* @__PURE__ */ jsx317(ChevronDownIcon, { className: cn("w-3 h-3 transition-transform duration-200", showContent ? "rotate-180" : "rotate-0") })
|
|
14727
15439
|
]
|
|
14728
15440
|
}
|
|
14729
15441
|
),
|
|
14730
|
-
/* @__PURE__ */
|
|
15442
|
+
/* @__PURE__ */ jsx317("div", { className: cn(
|
|
14731
15443
|
"grid transition-all duration-300 ease-in-out",
|
|
14732
15444
|
showContent ? "grid-rows-[1fr] opacity-100 mt-2" : "grid-rows-[0fr] opacity-0 mt-0"
|
|
14733
|
-
), children: /* @__PURE__ */
|
|
15445
|
+
), children: /* @__PURE__ */ jsx317("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx317("div", { className: cn("text-sm opacity-90 leading-relaxed pb-1", textStyles[type]), children: options.content }) }) })
|
|
14734
15446
|
] }),
|
|
14735
|
-
options?.duration && /* @__PURE__ */
|
|
15447
|
+
options?.duration && /* @__PURE__ */ jsx317("div", { className: "w-full h-1 bg-black/5 dark:bg-white/5 absolute bottom-0 left-0", children: /* @__PURE__ */ jsx317(
|
|
14736
15448
|
"div",
|
|
14737
15449
|
{
|
|
14738
15450
|
className: cn("h-full transition-none", progressColors[type]),
|
|
@@ -14749,19 +15461,19 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14749
15461
|
}
|
|
14750
15462
|
|
|
14751
15463
|
// src/components/Overlay/Alert/renderAlert.tsx
|
|
14752
|
-
import { jsx as
|
|
15464
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
14753
15465
|
var alertRoot = null;
|
|
14754
15466
|
var alertContainer = null;
|
|
14755
15467
|
var alertStack = [];
|
|
14756
15468
|
var nextId = 0;
|
|
14757
15469
|
function AlertStackContainer({ alerts, onClose }) {
|
|
14758
15470
|
return createPortal3(
|
|
14759
|
-
/* @__PURE__ */
|
|
15471
|
+
/* @__PURE__ */ jsx318(
|
|
14760
15472
|
"div",
|
|
14761
15473
|
{
|
|
14762
15474
|
style: { position: "fixed", top: 0, left: 0, right: 0, zIndex: 9999, pointerEvents: "none" },
|
|
14763
15475
|
className: "flex flex-col items-center gap-2 p-4 sm:p-6",
|
|
14764
|
-
children: alerts.map((alert) => /* @__PURE__ */
|
|
15476
|
+
children: alerts.map((alert) => /* @__PURE__ */ jsx318(
|
|
14765
15477
|
AlertComponent,
|
|
14766
15478
|
{
|
|
14767
15479
|
open: alert.open,
|
|
@@ -14797,7 +15509,7 @@ var renderStack = () => {
|
|
|
14797
15509
|
}, 300);
|
|
14798
15510
|
};
|
|
14799
15511
|
alertRoot.render(
|
|
14800
|
-
/* @__PURE__ */
|
|
15512
|
+
/* @__PURE__ */ jsx318(AlertStackContainer, { alerts: [...alertStack], onClose: handleClose })
|
|
14801
15513
|
);
|
|
14802
15514
|
};
|
|
14803
15515
|
var renderAlert = (props) => {
|
|
@@ -14847,10 +15559,10 @@ var handleError = () => {
|
|
|
14847
15559
|
|
|
14848
15560
|
// src/components/Surfaces/Card/Card.tsx
|
|
14849
15561
|
import React5 from "react";
|
|
14850
|
-
import { jsx as
|
|
15562
|
+
import { jsx as jsx319 } from "react/jsx-runtime";
|
|
14851
15563
|
var Card = React5.forwardRef(
|
|
14852
15564
|
({ className, children, ...props }, ref) => {
|
|
14853
|
-
return /* @__PURE__ */
|
|
15565
|
+
return /* @__PURE__ */ jsx319(
|
|
14854
15566
|
"div",
|
|
14855
15567
|
{
|
|
14856
15568
|
ref,
|
|
@@ -14868,22 +15580,22 @@ Card.displayName = "Card";
|
|
|
14868
15580
|
|
|
14869
15581
|
// src/components/Surfaces/Card/CardHeader.tsx
|
|
14870
15582
|
import React6 from "react";
|
|
14871
|
-
import { jsx as
|
|
15583
|
+
import { jsx as jsx320, jsxs as jsxs295 } from "react/jsx-runtime";
|
|
14872
15584
|
var CardHeader = React6.forwardRef(
|
|
14873
15585
|
({ className, avatar, action, title, subheader, ...props }, ref) => {
|
|
14874
|
-
return /* @__PURE__ */
|
|
15586
|
+
return /* @__PURE__ */ jsxs295(
|
|
14875
15587
|
"div",
|
|
14876
15588
|
{
|
|
14877
15589
|
ref,
|
|
14878
15590
|
className: cn("flex items-center p-6", className),
|
|
14879
15591
|
...props,
|
|
14880
15592
|
children: [
|
|
14881
|
-
avatar && /* @__PURE__ */
|
|
14882
|
-
/* @__PURE__ */
|
|
14883
|
-
title && /* @__PURE__ */
|
|
14884
|
-
subheader && /* @__PURE__ */
|
|
15593
|
+
avatar && /* @__PURE__ */ jsx320("div", { className: "mr-4 flex-shrink-0", children: avatar }),
|
|
15594
|
+
/* @__PURE__ */ jsxs295("div", { className: "flex-1 flex flex-col gap-1", children: [
|
|
15595
|
+
title && /* @__PURE__ */ jsx320("div", { className: "font-semibold leading-none tracking-tight", children: title }),
|
|
15596
|
+
subheader && /* @__PURE__ */ jsx320("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: subheader })
|
|
14885
15597
|
] }),
|
|
14886
|
-
action && /* @__PURE__ */
|
|
15598
|
+
action && /* @__PURE__ */ jsx320("div", { className: "ml-4 flex-shrink-0 self-start", children: action })
|
|
14887
15599
|
]
|
|
14888
15600
|
}
|
|
14889
15601
|
);
|
|
@@ -14893,10 +15605,10 @@ CardHeader.displayName = "CardHeader";
|
|
|
14893
15605
|
|
|
14894
15606
|
// src/components/Surfaces/Card/CardContent.tsx
|
|
14895
15607
|
import React7 from "react";
|
|
14896
|
-
import { jsx as
|
|
15608
|
+
import { jsx as jsx321 } from "react/jsx-runtime";
|
|
14897
15609
|
var CardContent = React7.forwardRef(
|
|
14898
15610
|
({ className, ...props }, ref) => {
|
|
14899
|
-
return /* @__PURE__ */
|
|
15611
|
+
return /* @__PURE__ */ jsx321(
|
|
14900
15612
|
"div",
|
|
14901
15613
|
{
|
|
14902
15614
|
ref,
|
|
@@ -14910,10 +15622,10 @@ CardContent.displayName = "CardContent";
|
|
|
14910
15622
|
|
|
14911
15623
|
// src/components/Surfaces/Card/CardFooter.tsx
|
|
14912
15624
|
import React8 from "react";
|
|
14913
|
-
import { Fragment as
|
|
15625
|
+
import { Fragment as Fragment8, jsx as jsx322, jsxs as jsxs296 } from "react/jsx-runtime";
|
|
14914
15626
|
var CardFooter = React8.forwardRef(
|
|
14915
15627
|
({ className, text, action, children }, ref) => {
|
|
14916
|
-
return /* @__PURE__ */
|
|
15628
|
+
return /* @__PURE__ */ jsx322(
|
|
14917
15629
|
"div",
|
|
14918
15630
|
{
|
|
14919
15631
|
ref,
|
|
@@ -14921,9 +15633,9 @@ var CardFooter = React8.forwardRef(
|
|
|
14921
15633
|
"flex items-center justify-between p-6 bg-white dark:bg-gray-900 rounded-b-xl",
|
|
14922
15634
|
className
|
|
14923
15635
|
),
|
|
14924
|
-
children: children || /* @__PURE__ */
|
|
14925
|
-
text && /* @__PURE__ */
|
|
14926
|
-
action && /* @__PURE__ */
|
|
15636
|
+
children: children || /* @__PURE__ */ jsxs296(Fragment8, { children: [
|
|
15637
|
+
text && /* @__PURE__ */ jsx322("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: text }),
|
|
15638
|
+
action && /* @__PURE__ */ jsx322("div", { className: "ml-auto flex items-center gap-2", children: action })
|
|
14927
15639
|
] })
|
|
14928
15640
|
}
|
|
14929
15641
|
);
|
|
@@ -14938,6 +15650,7 @@ export {
|
|
|
14938
15650
|
CardHeader,
|
|
14939
15651
|
Carousel,
|
|
14940
15652
|
DataTable_default as DataTable,
|
|
15653
|
+
DatePicker,
|
|
14941
15654
|
Dialog,
|
|
14942
15655
|
DialogContent,
|
|
14943
15656
|
DialogFooter,
|
|
@@ -14963,6 +15676,7 @@ export {
|
|
|
14963
15676
|
TableHead_default as TableHead,
|
|
14964
15677
|
TableRow_default as TableRow,
|
|
14965
15678
|
TelInput,
|
|
15679
|
+
TimePicker,
|
|
14966
15680
|
Tooltip,
|
|
14967
15681
|
handleAlert,
|
|
14968
15682
|
handleError,
|