@optigrit/optigrit-ui 0.0.18 → 0.0.20
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.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
ShowWithAnimation,
|
|
7
7
|
Spinner,
|
|
8
8
|
cn
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-4KHU7KPD.js";
|
|
10
10
|
import "../chunk-MCQS3QNN.js";
|
|
11
11
|
import {
|
|
12
12
|
useKeyboardShortcuts
|
|
@@ -34,12 +34,12 @@ var getVariantClasses = (variant, color) => {
|
|
|
34
34
|
info: "bg-info text-white shadow-sm hover:shadow"
|
|
35
35
|
},
|
|
36
36
|
outlined: {
|
|
37
|
-
primary: "border border-primary-500 text-primary hover:border-primary hover:bg-[color-mix(in_srgb,var(--primary)_4%,transparent)]",
|
|
38
|
-
secondary: "border border-primary-secondary-500 text-secondary hover:border-primary-secondary hover:bg-[color-mix(in_srgb,var(--primary-secondary)_4%,transparent)]",
|
|
39
|
-
error: "border border-error-500 text-error hover:border-error hover:bg-[color-mix(in_srgb,var(--error)_4%,transparent)]",
|
|
40
|
-
success: "border border-success-500 text-success hover:border-success hover:bg-[color-mix(in_srgb,var(--success)_4%,transparent)]",
|
|
41
|
-
warning: "border border-warning-500 text-warning hover:border-warning hover:bg-[color-mix(in_srgb,var(--warning)_4%,transparent)]",
|
|
42
|
-
info: "border border-info-500 text-info hover:border-info hover:bg-[color-mix(in_srgb,var(--info)_4%,transparent)]"
|
|
37
|
+
primary: "border border-primary-500 text-primary hover:border-primary hover:bg-[color-mix(in_srgb,var(--primary)_4%,transparent)] backdrop-blur-sm",
|
|
38
|
+
secondary: "border border-primary-secondary-500 text-secondary hover:border-primary-secondary hover:bg-[color-mix(in_srgb,var(--primary-secondary)_4%,transparent)] backdrop-blur-sm",
|
|
39
|
+
error: "border border-error-500 text-error hover:border-error hover:bg-[color-mix(in_srgb,var(--error)_4%,transparent)] backdrop-blur-sm",
|
|
40
|
+
success: "border border-success-500 text-success hover:border-success hover:bg-[color-mix(in_srgb,var(--success)_4%,transparent)] backdrop-blur-sm",
|
|
41
|
+
warning: "border border-warning-500 text-warning hover:border-warning hover:bg-[color-mix(in_srgb,var(--warning)_4%,transparent)] backdrop-blur-sm",
|
|
42
|
+
info: "border border-info-500 text-info hover:border-info hover:bg-[color-mix(in_srgb,var(--info)_4%,transparent)] backdrop-blur-sm"
|
|
43
43
|
},
|
|
44
44
|
soft: {
|
|
45
45
|
primary: "bg-primary-100 text-primary hover:bg-primary-200",
|
|
@@ -157,11 +157,11 @@ import {
|
|
|
157
157
|
} from "react";
|
|
158
158
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
159
159
|
var iconOnlySizeClasses = {
|
|
160
|
-
xs: "text-xs h-
|
|
161
|
-
sm: "text-sm h-
|
|
162
|
-
md: "text-base h-
|
|
163
|
-
lg: "text-base h-
|
|
164
|
-
xl: "text-lg h-
|
|
160
|
+
xs: "text-xs h-6 w-6",
|
|
161
|
+
sm: "text-sm h-8 w-8",
|
|
162
|
+
md: "text-base h-12 w-12",
|
|
163
|
+
lg: "text-base h-14 w-14",
|
|
164
|
+
xl: "text-lg h-16 w-16"
|
|
165
165
|
};
|
|
166
166
|
var roundnessClasses2 = {
|
|
167
167
|
none: "rounded-none",
|
|
@@ -170,6 +170,13 @@ var roundnessClasses2 = {
|
|
|
170
170
|
lg: "rounded-[16px]",
|
|
171
171
|
full: "rounded-full"
|
|
172
172
|
};
|
|
173
|
+
var borderWidthClasses = {
|
|
174
|
+
xs: "border-[1px]",
|
|
175
|
+
sm: "border-[1px]",
|
|
176
|
+
md: "border-[2px]",
|
|
177
|
+
lg: "border-[3px]",
|
|
178
|
+
xl: "border-[3px]"
|
|
179
|
+
};
|
|
173
180
|
var IconButton = forwardRef2(
|
|
174
181
|
({
|
|
175
182
|
variant = "contained",
|
|
@@ -217,12 +224,13 @@ var IconButton = forwardRef2(
|
|
|
217
224
|
getVariantClasses(variant, color),
|
|
218
225
|
iconOnlySizeClasses[size],
|
|
219
226
|
roundnessClasses2[roundness],
|
|
227
|
+
variant === "outlined" && borderWidthClasses[size],
|
|
220
228
|
className
|
|
221
229
|
),
|
|
222
230
|
...rest,
|
|
223
231
|
children: [
|
|
224
232
|
/* @__PURE__ */ jsx2(Ripple, { ref: rippleRef, color: getRippleColor(variant, color) }),
|
|
225
|
-
loading ? /* @__PURE__ */ jsx2(Spinner, { size: spinnerSize[size], color: "inherit" }) :
|
|
233
|
+
loading ? /* @__PURE__ */ jsx2(Spinner, { size: spinnerSize[size], color: "inherit" }) : children
|
|
226
234
|
]
|
|
227
235
|
}
|
|
228
236
|
);
|
|
@@ -402,6 +410,7 @@ function Select(props) {
|
|
|
402
410
|
options = [{ label: "None", value: "" }],
|
|
403
411
|
renderOption,
|
|
404
412
|
optionsPosition = "bottom-start",
|
|
413
|
+
disabled,
|
|
405
414
|
...inputProps
|
|
406
415
|
} = props;
|
|
407
416
|
const container = useRef5(null);
|
|
@@ -412,23 +421,23 @@ function Select(props) {
|
|
|
412
421
|
{
|
|
413
422
|
key: "ArrowDown",
|
|
414
423
|
callback: () => handleKeyboardNavigation("ArrowDown"),
|
|
415
|
-
options: { preventDefault: isOpen }
|
|
424
|
+
options: { preventDefault: isOpen && !disabled }
|
|
416
425
|
},
|
|
417
426
|
{
|
|
418
427
|
key: "ArrowUp",
|
|
419
428
|
callback: () => handleKeyboardNavigation("ArrowUp"),
|
|
420
|
-
options: { preventDefault: isOpen }
|
|
429
|
+
options: { preventDefault: isOpen && !disabled }
|
|
421
430
|
},
|
|
422
431
|
{
|
|
423
432
|
key: "Enter",
|
|
424
433
|
callback: () => {
|
|
425
|
-
if (isOpen) {
|
|
434
|
+
if (isOpen && !disabled) {
|
|
426
435
|
const option = options.find((option2) => option2.value === activeOption);
|
|
427
436
|
if (option) handleOnChange(option);
|
|
428
437
|
setActiveOption("");
|
|
429
438
|
}
|
|
430
439
|
},
|
|
431
|
-
options: { preventDefault: isOpen }
|
|
440
|
+
options: { preventDefault: isOpen && !disabled }
|
|
432
441
|
},
|
|
433
442
|
{
|
|
434
443
|
key: "Escape",
|
|
@@ -442,7 +451,7 @@ function Select(props) {
|
|
|
442
451
|
}
|
|
443
452
|
]);
|
|
444
453
|
function handleKeyboardNavigation(key) {
|
|
445
|
-
if (isOpen) {
|
|
454
|
+
if (isOpen && !disabled) {
|
|
446
455
|
setActiveOption((pre) => {
|
|
447
456
|
const currentIndex = options.findIndex((option) => option.value === pre);
|
|
448
457
|
const nextIndex = (currentIndex + (key === "ArrowDown" ? 1 : -1) + options.length) % options.length;
|
|
@@ -455,6 +464,7 @@ function Select(props) {
|
|
|
455
464
|
}
|
|
456
465
|
}
|
|
457
466
|
function handleOnChange(options2) {
|
|
467
|
+
if (disabled) return;
|
|
458
468
|
setIsOpen(false);
|
|
459
469
|
props.onChangeValue?.(options2.value);
|
|
460
470
|
setActiveOption("");
|
|
@@ -466,12 +476,22 @@ function Select(props) {
|
|
|
466
476
|
InputField,
|
|
467
477
|
{
|
|
468
478
|
...inputProps,
|
|
479
|
+
disabled,
|
|
469
480
|
readOnly: true,
|
|
470
481
|
value: options.find((option) => option.value === props.value)?.label || void 0,
|
|
471
482
|
containerProps: {
|
|
483
|
+
...inputProps.containerProps,
|
|
472
484
|
ref: container,
|
|
473
|
-
className:
|
|
474
|
-
|
|
485
|
+
className: cn(
|
|
486
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
487
|
+
inputProps.containerProps?.className
|
|
488
|
+
),
|
|
489
|
+
onClick: (event) => {
|
|
490
|
+
inputProps.containerProps?.onClick?.(event);
|
|
491
|
+
if (!disabled) {
|
|
492
|
+
setIsOpen(true);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
475
495
|
},
|
|
476
496
|
onBlur: (event) => {
|
|
477
497
|
setIsOpen(false);
|
|
@@ -486,7 +506,7 @@ function Select(props) {
|
|
|
486
506
|
/* @__PURE__ */ jsx5(
|
|
487
507
|
Popover,
|
|
488
508
|
{
|
|
489
|
-
open: isOpen,
|
|
509
|
+
open: isOpen && !disabled,
|
|
490
510
|
targetRef: container,
|
|
491
511
|
position: optionsPosition,
|
|
492
512
|
className: "p-1 min-h-[100px]",
|
|
@@ -13247,8 +13267,92 @@ function FlagIcon(props) {
|
|
|
13247
13267
|
);
|
|
13248
13268
|
}
|
|
13249
13269
|
|
|
13270
|
+
// src/shared/Icons/CalendarIcon.tsx
|
|
13271
|
+
import { jsx as jsx287, jsxs as jsxs285 } from "react/jsx-runtime";
|
|
13272
|
+
var CalendarIcon = (props) => /* @__PURE__ */ jsxs285(
|
|
13273
|
+
"svg",
|
|
13274
|
+
{
|
|
13275
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13276
|
+
width: "16",
|
|
13277
|
+
height: "16",
|
|
13278
|
+
viewBox: "0 0 24 24",
|
|
13279
|
+
fill: "none",
|
|
13280
|
+
stroke: "currentColor",
|
|
13281
|
+
strokeWidth: "2",
|
|
13282
|
+
strokeLinecap: "round",
|
|
13283
|
+
strokeLinejoin: "round",
|
|
13284
|
+
...props,
|
|
13285
|
+
children: [
|
|
13286
|
+
/* @__PURE__ */ jsx287("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
13287
|
+
/* @__PURE__ */ jsx287("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
13288
|
+
/* @__PURE__ */ jsx287("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
13289
|
+
/* @__PURE__ */ jsx287("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
13290
|
+
]
|
|
13291
|
+
}
|
|
13292
|
+
);
|
|
13293
|
+
|
|
13294
|
+
// src/shared/Icons/ClockIcon.tsx
|
|
13295
|
+
import { jsx as jsx288, jsxs as jsxs286 } from "react/jsx-runtime";
|
|
13296
|
+
var ClockIcon = (props) => /* @__PURE__ */ jsxs286(
|
|
13297
|
+
"svg",
|
|
13298
|
+
{
|
|
13299
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13300
|
+
width: "16",
|
|
13301
|
+
height: "16",
|
|
13302
|
+
viewBox: "0 0 24 24",
|
|
13303
|
+
fill: "none",
|
|
13304
|
+
stroke: "currentColor",
|
|
13305
|
+
strokeWidth: "2",
|
|
13306
|
+
strokeLinecap: "round",
|
|
13307
|
+
strokeLinejoin: "round",
|
|
13308
|
+
...props,
|
|
13309
|
+
children: [
|
|
13310
|
+
/* @__PURE__ */ jsx288("circle", { cx: "12", cy: "12", r: "10" }),
|
|
13311
|
+
/* @__PURE__ */ jsx288("polyline", { points: "12 6 12 12 16 14" })
|
|
13312
|
+
]
|
|
13313
|
+
}
|
|
13314
|
+
);
|
|
13315
|
+
|
|
13316
|
+
// src/shared/Icons/ChevronLeftIcon.tsx
|
|
13317
|
+
import { jsx as jsx289 } from "react/jsx-runtime";
|
|
13318
|
+
var ChevronLeftIcon = (props) => /* @__PURE__ */ jsx289(
|
|
13319
|
+
"svg",
|
|
13320
|
+
{
|
|
13321
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13322
|
+
width: "16",
|
|
13323
|
+
height: "16",
|
|
13324
|
+
viewBox: "0 0 24 24",
|
|
13325
|
+
fill: "none",
|
|
13326
|
+
stroke: "currentColor",
|
|
13327
|
+
strokeWidth: "2",
|
|
13328
|
+
strokeLinecap: "round",
|
|
13329
|
+
strokeLinejoin: "round",
|
|
13330
|
+
...props,
|
|
13331
|
+
children: /* @__PURE__ */ jsx289("path", { d: "M15 19l-7-7 7-7" })
|
|
13332
|
+
}
|
|
13333
|
+
);
|
|
13334
|
+
|
|
13335
|
+
// src/shared/Icons/ChevronRightIcon.tsx
|
|
13336
|
+
import { jsx as jsx290 } from "react/jsx-runtime";
|
|
13337
|
+
var ChevronRightIcon = (props) => /* @__PURE__ */ jsx290(
|
|
13338
|
+
"svg",
|
|
13339
|
+
{
|
|
13340
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13341
|
+
width: "16",
|
|
13342
|
+
height: "16",
|
|
13343
|
+
viewBox: "0 0 24 24",
|
|
13344
|
+
fill: "none",
|
|
13345
|
+
stroke: "currentColor",
|
|
13346
|
+
strokeWidth: "2",
|
|
13347
|
+
strokeLinecap: "round",
|
|
13348
|
+
strokeLinejoin: "round",
|
|
13349
|
+
...props,
|
|
13350
|
+
children: /* @__PURE__ */ jsx290("path", { d: "M9 5l7 7-7 7" })
|
|
13351
|
+
}
|
|
13352
|
+
);
|
|
13353
|
+
|
|
13250
13354
|
// src/components/Forms/SearchBar/SearchBar.tsx
|
|
13251
|
-
import { jsx as
|
|
13355
|
+
import { jsx as jsx291 } from "react/jsx-runtime";
|
|
13252
13356
|
var SearchBar = React.forwardRef(
|
|
13253
13357
|
({
|
|
13254
13358
|
value,
|
|
@@ -13320,26 +13424,26 @@ var SearchBar = React.forwardRef(
|
|
|
13320
13424
|
handleClear();
|
|
13321
13425
|
}
|
|
13322
13426
|
};
|
|
13323
|
-
const defaultSearchIcon = /* @__PURE__ */
|
|
13427
|
+
const defaultSearchIcon = /* @__PURE__ */ jsx291(SearchIcon, { className: "text-gray-400 ml-2" });
|
|
13324
13428
|
const renderEndIcon = () => {
|
|
13325
13429
|
if (loading) {
|
|
13326
|
-
return /* @__PURE__ */
|
|
13430
|
+
return /* @__PURE__ */ jsx291("div", { className: "flex items-center justify-center pr-3", children: /* @__PURE__ */ jsx291(Spinner, { size: 16, color: "primary" }) });
|
|
13327
13431
|
}
|
|
13328
13432
|
if (currentValue) {
|
|
13329
|
-
return /* @__PURE__ */
|
|
13433
|
+
return /* @__PURE__ */ jsx291(
|
|
13330
13434
|
"button",
|
|
13331
13435
|
{
|
|
13332
13436
|
type: "button",
|
|
13333
13437
|
onClick: handleClear,
|
|
13334
13438
|
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
13439
|
"aria-label": "Clear search",
|
|
13336
|
-
children: /* @__PURE__ */
|
|
13440
|
+
children: /* @__PURE__ */ jsx291(CrossIcon, {})
|
|
13337
13441
|
}
|
|
13338
13442
|
);
|
|
13339
13443
|
}
|
|
13340
13444
|
return endIcon;
|
|
13341
13445
|
};
|
|
13342
|
-
return /* @__PURE__ */
|
|
13446
|
+
return /* @__PURE__ */ jsx291(
|
|
13343
13447
|
Input,
|
|
13344
13448
|
{
|
|
13345
13449
|
ref,
|
|
@@ -13360,7 +13464,7 @@ import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
|
13360
13464
|
|
|
13361
13465
|
// src/components/Forms/TelInput/CountrySelector.tsx
|
|
13362
13466
|
import { useMemo as useMemo2, useRef as useRef8, useState as useState6 } from "react";
|
|
13363
|
-
import { Fragment as Fragment4, jsx as
|
|
13467
|
+
import { Fragment as Fragment4, jsx as jsx292, jsxs as jsxs287 } from "react/jsx-runtime";
|
|
13364
13468
|
function CountrySelector(props) {
|
|
13365
13469
|
const {
|
|
13366
13470
|
countries,
|
|
@@ -13441,8 +13545,8 @@ function CountrySelector(props) {
|
|
|
13441
13545
|
setSearch("");
|
|
13442
13546
|
setActiveISO2("");
|
|
13443
13547
|
}
|
|
13444
|
-
return /* @__PURE__ */
|
|
13445
|
-
/* @__PURE__ */
|
|
13548
|
+
return /* @__PURE__ */ jsxs287(Fragment4, { children: [
|
|
13549
|
+
/* @__PURE__ */ jsxs287(
|
|
13446
13550
|
"div",
|
|
13447
13551
|
{
|
|
13448
13552
|
ref: triggerRef,
|
|
@@ -13452,16 +13556,16 @@ function CountrySelector(props) {
|
|
|
13452
13556
|
disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
13453
13557
|
),
|
|
13454
13558
|
children: [
|
|
13455
|
-
/* @__PURE__ */
|
|
13456
|
-
/* @__PURE__ */
|
|
13457
|
-
/* @__PURE__ */
|
|
13559
|
+
/* @__PURE__ */ jsx292(FlagIcon, { name: `Flag${selectedCountry.iso2.toUpperCase()}` }),
|
|
13560
|
+
/* @__PURE__ */ jsx292("span", { className: "text-xs text-text-secondary font-medium", children: selectedCountry.dialCode }),
|
|
13561
|
+
/* @__PURE__ */ jsx292("div", { className: cn(
|
|
13458
13562
|
"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
13563
|
isOpen ? "rotate-180" : ""
|
|
13460
13564
|
) })
|
|
13461
13565
|
]
|
|
13462
13566
|
}
|
|
13463
13567
|
),
|
|
13464
|
-
/* @__PURE__ */
|
|
13568
|
+
/* @__PURE__ */ jsx292(
|
|
13465
13569
|
Popover,
|
|
13466
13570
|
{
|
|
13467
13571
|
open: isOpen,
|
|
@@ -13473,13 +13577,13 @@ function CountrySelector(props) {
|
|
|
13473
13577
|
node.style.minWidth = "280px";
|
|
13474
13578
|
setTimeout(() => searchInputRef.current?.focus(), 50);
|
|
13475
13579
|
},
|
|
13476
|
-
children: /* @__PURE__ */
|
|
13580
|
+
children: /* @__PURE__ */ jsxs287(
|
|
13477
13581
|
"div",
|
|
13478
13582
|
{
|
|
13479
13583
|
className: "w-full bg-bg-secondary shadow-md border border-border/10 text-text rounded-xl flex flex-col overflow-hidden",
|
|
13480
13584
|
onMouseDown: (e) => e.preventDefault(),
|
|
13481
13585
|
children: [
|
|
13482
|
-
searchable && /* @__PURE__ */
|
|
13586
|
+
searchable && /* @__PURE__ */ jsx292("div", { className: "p-2 border-b border-border/10", children: /* @__PURE__ */ jsx292(
|
|
13483
13587
|
Input,
|
|
13484
13588
|
{
|
|
13485
13589
|
ref: searchInputRef,
|
|
@@ -13493,12 +13597,12 @@ function CountrySelector(props) {
|
|
|
13493
13597
|
className: "text-xs"
|
|
13494
13598
|
}
|
|
13495
13599
|
) }),
|
|
13496
|
-
/* @__PURE__ */
|
|
13600
|
+
/* @__PURE__ */ jsx292(
|
|
13497
13601
|
"div",
|
|
13498
13602
|
{
|
|
13499
13603
|
ref: optionsRef,
|
|
13500
13604
|
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__ */
|
|
13605
|
+
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
13606
|
"div",
|
|
13503
13607
|
{
|
|
13504
13608
|
"data-iso2": country.iso2,
|
|
@@ -13510,9 +13614,9 @@ function CountrySelector(props) {
|
|
|
13510
13614
|
selectedCountry.iso2 === country.iso2 ? "bg-bg" : ""
|
|
13511
13615
|
),
|
|
13512
13616
|
children: [
|
|
13513
|
-
/* @__PURE__ */
|
|
13514
|
-
/* @__PURE__ */
|
|
13515
|
-
/* @__PURE__ */
|
|
13617
|
+
/* @__PURE__ */ jsx292(FlagIcon, { name: `Flag${country.iso2.toUpperCase()}` }),
|
|
13618
|
+
/* @__PURE__ */ jsx292("span", { className: "text-sm truncate flex-1", children: country.name }),
|
|
13619
|
+
/* @__PURE__ */ jsx292("span", { className: "text-xs text-text-secondary font-mono shrink-0", children: country.dialCode })
|
|
13516
13620
|
]
|
|
13517
13621
|
},
|
|
13518
13622
|
country.iso2
|
|
@@ -13747,7 +13851,7 @@ function validatePhoneNumber(phone, country) {
|
|
|
13747
13851
|
}
|
|
13748
13852
|
|
|
13749
13853
|
// src/components/Forms/TelInput/TelInput.tsx
|
|
13750
|
-
import { jsx as
|
|
13854
|
+
import { jsx as jsx293 } from "react/jsx-runtime";
|
|
13751
13855
|
function TelInput(props) {
|
|
13752
13856
|
const {
|
|
13753
13857
|
value,
|
|
@@ -13802,14 +13906,14 @@ function TelInput(props) {
|
|
|
13802
13906
|
}
|
|
13803
13907
|
return null;
|
|
13804
13908
|
}
|
|
13805
|
-
return /* @__PURE__ */
|
|
13909
|
+
return /* @__PURE__ */ jsx293(
|
|
13806
13910
|
InputField,
|
|
13807
13911
|
{
|
|
13808
13912
|
...inputFieldProps,
|
|
13809
13913
|
type: "tel",
|
|
13810
13914
|
value,
|
|
13811
13915
|
placeholder,
|
|
13812
|
-
startIcon: /* @__PURE__ */
|
|
13916
|
+
startIcon: /* @__PURE__ */ jsx293(
|
|
13813
13917
|
CountrySelector,
|
|
13814
13918
|
{
|
|
13815
13919
|
countries: availableCountries,
|
|
@@ -13826,9 +13930,625 @@ function TelInput(props) {
|
|
|
13826
13930
|
);
|
|
13827
13931
|
}
|
|
13828
13932
|
|
|
13933
|
+
// src/components/Forms/DatePicker/DatePicker.tsx
|
|
13934
|
+
import { Fragment as Fragment5, useRef as useRef9, useState as useState8, useMemo as useMemo4 } from "react";
|
|
13935
|
+
import { jsx as jsx294, jsxs as jsxs288 } from "react/jsx-runtime";
|
|
13936
|
+
var MONTH_NAMES = [
|
|
13937
|
+
"January",
|
|
13938
|
+
"February",
|
|
13939
|
+
"March",
|
|
13940
|
+
"April",
|
|
13941
|
+
"May",
|
|
13942
|
+
"June",
|
|
13943
|
+
"July",
|
|
13944
|
+
"August",
|
|
13945
|
+
"September",
|
|
13946
|
+
"October",
|
|
13947
|
+
"November",
|
|
13948
|
+
"December"
|
|
13949
|
+
];
|
|
13950
|
+
var WEEKDAY_NAMES = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
13951
|
+
function parseDateInput(input) {
|
|
13952
|
+
if (!input) return null;
|
|
13953
|
+
if (input instanceof Date) return isNaN(input.getTime()) ? null : input;
|
|
13954
|
+
const parsed = new Date(input);
|
|
13955
|
+
return isNaN(parsed.getTime()) ? null : parsed;
|
|
13956
|
+
}
|
|
13957
|
+
function formatDate(date, formatStr = "YYYY-MM-DD") {
|
|
13958
|
+
if (!date) return "";
|
|
13959
|
+
const year = date.getFullYear();
|
|
13960
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
13961
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
13962
|
+
const monthName = MONTH_NAMES[date.getMonth()];
|
|
13963
|
+
const shortMonthName = monthName.substring(0, 3);
|
|
13964
|
+
return formatStr.replace("YYYY", String(year)).replace("MMM", shortMonthName).replace("MM", month).replace("DD", day);
|
|
13965
|
+
}
|
|
13966
|
+
function isSameDay(d1, d2) {
|
|
13967
|
+
if (!d1 || !d2) return false;
|
|
13968
|
+
return d1.getFullYear() === d2.getFullYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate();
|
|
13969
|
+
}
|
|
13970
|
+
function isToday(date) {
|
|
13971
|
+
return isSameDay(date, /* @__PURE__ */ new Date());
|
|
13972
|
+
}
|
|
13973
|
+
function DatePicker(props) {
|
|
13974
|
+
const {
|
|
13975
|
+
value,
|
|
13976
|
+
onChangeValue,
|
|
13977
|
+
minDate: minDateProp,
|
|
13978
|
+
maxDate: maxDateProp,
|
|
13979
|
+
format = "YYYY-MM-DD",
|
|
13980
|
+
optionsPosition = "bottom-start",
|
|
13981
|
+
disabled = false,
|
|
13982
|
+
clearable = true,
|
|
13983
|
+
...inputProps
|
|
13984
|
+
} = props;
|
|
13985
|
+
const container = useRef9(null);
|
|
13986
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
13987
|
+
const selectedDate = useMemo4(() => parseDateInput(value), [value]);
|
|
13988
|
+
const minDate = useMemo4(() => parseDateInput(minDateProp), [minDateProp]);
|
|
13989
|
+
const maxDate = useMemo4(() => parseDateInput(maxDateProp), [maxDateProp]);
|
|
13990
|
+
const [viewDate, setViewDate] = useState8(() => selectedDate || /* @__PURE__ */ new Date());
|
|
13991
|
+
const viewYear = viewDate.getFullYear();
|
|
13992
|
+
const viewMonth = viewDate.getMonth();
|
|
13993
|
+
const displayValue = useMemo4(() => {
|
|
13994
|
+
return formatDate(selectedDate, format);
|
|
13995
|
+
}, [selectedDate, format]);
|
|
13996
|
+
const calendarDays = useMemo4(() => {
|
|
13997
|
+
const firstDayOfMonth = new Date(viewYear, viewMonth, 1);
|
|
13998
|
+
const startingDayOfWeek = firstDayOfMonth.getDay();
|
|
13999
|
+
const days = [];
|
|
14000
|
+
for (let i = startingDayOfWeek - 1; i >= 0; i--) {
|
|
14001
|
+
const date = new Date(viewYear, viewMonth, -i);
|
|
14002
|
+
days.push({ date, isCurrentMonth: false });
|
|
14003
|
+
}
|
|
14004
|
+
const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();
|
|
14005
|
+
for (let i = 1; i <= daysInMonth; i++) {
|
|
14006
|
+
const date = new Date(viewYear, viewMonth, i);
|
|
14007
|
+
days.push({ date, isCurrentMonth: true });
|
|
14008
|
+
}
|
|
14009
|
+
const remaining = 42 - days.length;
|
|
14010
|
+
for (let i = 1; i <= remaining; i++) {
|
|
14011
|
+
const date = new Date(viewYear, viewMonth + 1, i);
|
|
14012
|
+
days.push({ date, isCurrentMonth: false });
|
|
14013
|
+
}
|
|
14014
|
+
return days;
|
|
14015
|
+
}, [viewYear, viewMonth]);
|
|
14016
|
+
function isDateDisabled(date) {
|
|
14017
|
+
if (disabled) return true;
|
|
14018
|
+
if (minDate) {
|
|
14019
|
+
const minStart = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
|
|
14020
|
+
if (date < minStart) return true;
|
|
14021
|
+
}
|
|
14022
|
+
if (maxDate) {
|
|
14023
|
+
const maxEnd = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
|
|
14024
|
+
if (date > maxEnd) return true;
|
|
14025
|
+
}
|
|
14026
|
+
return false;
|
|
14027
|
+
}
|
|
14028
|
+
function handlePrevMonth() {
|
|
14029
|
+
setViewDate(new Date(viewYear, viewMonth - 1, 1));
|
|
14030
|
+
}
|
|
14031
|
+
function handleNextMonth() {
|
|
14032
|
+
setViewDate(new Date(viewYear, viewMonth + 1, 1));
|
|
14033
|
+
}
|
|
14034
|
+
function handleSelectDate(date) {
|
|
14035
|
+
if (isDateDisabled(date)) return;
|
|
14036
|
+
const formatted = formatDate(date, format);
|
|
14037
|
+
onChangeValue?.(date, formatted);
|
|
14038
|
+
setIsOpen(false);
|
|
14039
|
+
}
|
|
14040
|
+
function handleClear(e) {
|
|
14041
|
+
e.stopPropagation();
|
|
14042
|
+
if (disabled) return;
|
|
14043
|
+
onChangeValue?.(null, "");
|
|
14044
|
+
setIsOpen(false);
|
|
14045
|
+
}
|
|
14046
|
+
function handleSelectToday() {
|
|
14047
|
+
const today = /* @__PURE__ */ new Date();
|
|
14048
|
+
if (isDateDisabled(today)) return;
|
|
14049
|
+
setViewDate(today);
|
|
14050
|
+
handleSelectDate(today);
|
|
14051
|
+
}
|
|
14052
|
+
useKeyboardShortcuts([
|
|
14053
|
+
{
|
|
14054
|
+
key: "Escape",
|
|
14055
|
+
callback: () => {
|
|
14056
|
+
if (isOpen) setIsOpen(false);
|
|
14057
|
+
},
|
|
14058
|
+
options: { preventDefault: isOpen }
|
|
14059
|
+
}
|
|
14060
|
+
]);
|
|
14061
|
+
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, {}) });
|
|
14062
|
+
return /* @__PURE__ */ jsxs288(Fragment5, { children: [
|
|
14063
|
+
/* @__PURE__ */ jsx294(
|
|
14064
|
+
InputField,
|
|
14065
|
+
{
|
|
14066
|
+
...inputProps,
|
|
14067
|
+
disabled,
|
|
14068
|
+
readOnly: true,
|
|
14069
|
+
value: displayValue,
|
|
14070
|
+
containerProps: {
|
|
14071
|
+
...inputProps.containerProps,
|
|
14072
|
+
ref: container,
|
|
14073
|
+
className: cn(
|
|
14074
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
14075
|
+
inputProps.containerProps?.className
|
|
14076
|
+
),
|
|
14077
|
+
onClick: (event) => {
|
|
14078
|
+
inputProps.containerProps?.onClick?.(event);
|
|
14079
|
+
if (!disabled) {
|
|
14080
|
+
if (selectedDate) setViewDate(selectedDate);
|
|
14081
|
+
setIsOpen(true);
|
|
14082
|
+
}
|
|
14083
|
+
}
|
|
14084
|
+
},
|
|
14085
|
+
onBlur: (event) => {
|
|
14086
|
+
setIsOpen(false);
|
|
14087
|
+
inputProps.onBlur?.(event);
|
|
14088
|
+
},
|
|
14089
|
+
endIcon: props.endIcon ? props.endIcon : DefaultCalendarIcon
|
|
14090
|
+
}
|
|
14091
|
+
),
|
|
14092
|
+
/* @__PURE__ */ jsx294(
|
|
14093
|
+
Popover,
|
|
14094
|
+
{
|
|
14095
|
+
open: isOpen && !disabled,
|
|
14096
|
+
targetRef: container,
|
|
14097
|
+
position: optionsPosition,
|
|
14098
|
+
className: "p-2 select-none",
|
|
14099
|
+
onClose: () => setIsOpen(false),
|
|
14100
|
+
children: /* @__PURE__ */ jsxs288(
|
|
14101
|
+
"div",
|
|
14102
|
+
{
|
|
14103
|
+
className: "w-[280px] bg-bg-secondary border-2 border-border/10 text-text p-3 rounded-2xl shadow-xl flex flex-col gap-3",
|
|
14104
|
+
onMouseDown: (event) => {
|
|
14105
|
+
event.preventDefault();
|
|
14106
|
+
},
|
|
14107
|
+
children: [
|
|
14108
|
+
/* @__PURE__ */ jsxs288("div", { className: "flex items-center justify-between px-1", children: [
|
|
14109
|
+
/* @__PURE__ */ jsx294(
|
|
14110
|
+
IconButton_default,
|
|
14111
|
+
{
|
|
14112
|
+
type: "button",
|
|
14113
|
+
variant: "text",
|
|
14114
|
+
size: "xs",
|
|
14115
|
+
"aria-label": "Previous month",
|
|
14116
|
+
onClick: handlePrevMonth,
|
|
14117
|
+
children: /* @__PURE__ */ jsx294(ChevronLeftIcon, { className: "w-4 h-4" })
|
|
14118
|
+
}
|
|
14119
|
+
),
|
|
14120
|
+
/* @__PURE__ */ jsxs288("div", { className: "font-semibold text-sm", children: [
|
|
14121
|
+
MONTH_NAMES[viewMonth],
|
|
14122
|
+
" ",
|
|
14123
|
+
viewYear
|
|
14124
|
+
] }),
|
|
14125
|
+
/* @__PURE__ */ jsx294(
|
|
14126
|
+
IconButton_default,
|
|
14127
|
+
{
|
|
14128
|
+
type: "button",
|
|
14129
|
+
variant: "text",
|
|
14130
|
+
size: "xs",
|
|
14131
|
+
"aria-label": "Next month",
|
|
14132
|
+
onClick: handleNextMonth,
|
|
14133
|
+
children: /* @__PURE__ */ jsx294(ChevronRightIcon, { className: "w-4 h-4" })
|
|
14134
|
+
}
|
|
14135
|
+
)
|
|
14136
|
+
] }),
|
|
14137
|
+
/* @__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)) }),
|
|
14138
|
+
/* @__PURE__ */ jsx294("div", { className: "grid grid-cols-7 gap-1 text-center", children: calendarDays.map(({ date, isCurrentMonth }, idx) => {
|
|
14139
|
+
const isSelected = isSameDay(date, selectedDate);
|
|
14140
|
+
const isDisabled = isDateDisabled(date);
|
|
14141
|
+
const today = isToday(date);
|
|
14142
|
+
return /* @__PURE__ */ jsx294(
|
|
14143
|
+
"button",
|
|
14144
|
+
{
|
|
14145
|
+
type: "button",
|
|
14146
|
+
disabled: isDisabled,
|
|
14147
|
+
onClick: () => handleSelectDate(date),
|
|
14148
|
+
className: cn(
|
|
14149
|
+
"h-8 w-8 text-xs rounded-lg flex items-center justify-center transition-all mx-auto",
|
|
14150
|
+
isSelected ? "bg-primary text-white font-semibold shadow-sm" : isCurrentMonth ? "text-text hover:bg-bg" : "text-text-secondary/40 hover:bg-bg/50",
|
|
14151
|
+
today && !isSelected && "border border-primary font-medium text-primary",
|
|
14152
|
+
isDisabled && "opacity-25 cursor-not-allowed hover:bg-transparent"
|
|
14153
|
+
),
|
|
14154
|
+
children: date.getDate()
|
|
14155
|
+
},
|
|
14156
|
+
idx
|
|
14157
|
+
);
|
|
14158
|
+
}) }),
|
|
14159
|
+
/* @__PURE__ */ jsxs288("div", { className: "flex items-center justify-between pt-2 border-t border-border/10 text-xs", children: [
|
|
14160
|
+
clearable && selectedDate ? /* @__PURE__ */ jsx294(
|
|
14161
|
+
Button_default,
|
|
14162
|
+
{
|
|
14163
|
+
type: "button",
|
|
14164
|
+
variant: "text",
|
|
14165
|
+
size: "xs",
|
|
14166
|
+
color: "secondary",
|
|
14167
|
+
onClick: handleClear,
|
|
14168
|
+
children: "Clear"
|
|
14169
|
+
}
|
|
14170
|
+
) : /* @__PURE__ */ jsx294("div", {}),
|
|
14171
|
+
/* @__PURE__ */ jsx294(
|
|
14172
|
+
Button_default,
|
|
14173
|
+
{
|
|
14174
|
+
type: "button",
|
|
14175
|
+
variant: "text",
|
|
14176
|
+
size: "xs",
|
|
14177
|
+
color: "primary",
|
|
14178
|
+
onClick: handleSelectToday,
|
|
14179
|
+
className: "ml-auto",
|
|
14180
|
+
children: "Today"
|
|
14181
|
+
}
|
|
14182
|
+
)
|
|
14183
|
+
] })
|
|
14184
|
+
]
|
|
14185
|
+
}
|
|
14186
|
+
)
|
|
14187
|
+
}
|
|
14188
|
+
)
|
|
14189
|
+
] });
|
|
14190
|
+
}
|
|
14191
|
+
|
|
14192
|
+
// src/components/Forms/TimePicker/TimePicker.tsx
|
|
14193
|
+
import { Fragment as Fragment6, useRef as useRef10, useState as useState9, useMemo as useMemo5, useEffect as useEffect2 } from "react";
|
|
14194
|
+
import { jsx as jsx295, jsxs as jsxs289 } from "react/jsx-runtime";
|
|
14195
|
+
function parseTimeInput(input) {
|
|
14196
|
+
if (!input) return null;
|
|
14197
|
+
if (input instanceof Date) {
|
|
14198
|
+
if (isNaN(input.getTime())) return null;
|
|
14199
|
+
return {
|
|
14200
|
+
hours: input.getHours(),
|
|
14201
|
+
minutes: input.getMinutes(),
|
|
14202
|
+
seconds: input.getSeconds()
|
|
14203
|
+
};
|
|
14204
|
+
}
|
|
14205
|
+
if (typeof input === "string") {
|
|
14206
|
+
const trimmed = input.trim();
|
|
14207
|
+
if (!trimmed) return null;
|
|
14208
|
+
const match12 = trimmed.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM|am|pm)$/i);
|
|
14209
|
+
if (match12) {
|
|
14210
|
+
let h = parseInt(match12[1], 10);
|
|
14211
|
+
const m = parseInt(match12[2], 10);
|
|
14212
|
+
const s = match12[3] ? parseInt(match12[3], 10) : 0;
|
|
14213
|
+
const period = match12[4].toUpperCase();
|
|
14214
|
+
if (h === 12) h = period === "AM" ? 0 : 12;
|
|
14215
|
+
else if (period === "PM") h += 12;
|
|
14216
|
+
if (h >= 0 && h < 24 && m >= 0 && m < 60 && s >= 0 && s < 60) {
|
|
14217
|
+
return { hours: h, minutes: m, seconds: s };
|
|
14218
|
+
}
|
|
14219
|
+
}
|
|
14220
|
+
const match24 = trimmed.match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
|
|
14221
|
+
if (match24) {
|
|
14222
|
+
const h = parseInt(match24[1], 10);
|
|
14223
|
+
const m = parseInt(match24[2], 10);
|
|
14224
|
+
const s = match24[3] ? parseInt(match24[3], 10) : 0;
|
|
14225
|
+
if (h >= 0 && h < 24 && m >= 0 && m < 60 && s >= 0 && s < 60) {
|
|
14226
|
+
return { hours: h, minutes: m, seconds: s };
|
|
14227
|
+
}
|
|
14228
|
+
}
|
|
14229
|
+
}
|
|
14230
|
+
return null;
|
|
14231
|
+
}
|
|
14232
|
+
function formatTimeString(state, format, useSeconds) {
|
|
14233
|
+
if (!state) return "";
|
|
14234
|
+
const { hours, minutes, seconds } = state;
|
|
14235
|
+
const pad = (num) => String(num).padStart(2, "0");
|
|
14236
|
+
if (format === "12h") {
|
|
14237
|
+
const period = hours >= 12 ? "PM" : "AM";
|
|
14238
|
+
let displayHours = hours % 12;
|
|
14239
|
+
if (displayHours === 0) displayHours = 12;
|
|
14240
|
+
const timeStr = `${pad(displayHours)}:${pad(minutes)}${useSeconds ? `:${pad(seconds)}` : ""}`;
|
|
14241
|
+
return `${timeStr} ${period}`;
|
|
14242
|
+
} else {
|
|
14243
|
+
return `${pad(hours)}:${pad(minutes)}${useSeconds ? `:${pad(seconds)}` : ""}`;
|
|
14244
|
+
}
|
|
14245
|
+
}
|
|
14246
|
+
function stateToDate(state) {
|
|
14247
|
+
if (!state) return null;
|
|
14248
|
+
const now = /* @__PURE__ */ new Date();
|
|
14249
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate(), state.hours, state.minutes, state.seconds);
|
|
14250
|
+
}
|
|
14251
|
+
function TimePicker(props) {
|
|
14252
|
+
const {
|
|
14253
|
+
value,
|
|
14254
|
+
onChangeValue,
|
|
14255
|
+
format = "12h",
|
|
14256
|
+
useSeconds = false,
|
|
14257
|
+
minuteInterval = 1,
|
|
14258
|
+
optionsPosition = "bottom-start",
|
|
14259
|
+
disabled = false,
|
|
14260
|
+
clearable = true,
|
|
14261
|
+
...inputProps
|
|
14262
|
+
} = props;
|
|
14263
|
+
const container = useRef10(null);
|
|
14264
|
+
const [isOpen, setIsOpen] = useState9(false);
|
|
14265
|
+
const parsedTime = useMemo5(() => parseTimeInput(value), [value]);
|
|
14266
|
+
const [draftTime, setDraftTime] = useState9(() => {
|
|
14267
|
+
return parsedTime || { hours: 12, minutes: 0, seconds: 0 };
|
|
14268
|
+
});
|
|
14269
|
+
useEffect2(() => {
|
|
14270
|
+
if (parsedTime) {
|
|
14271
|
+
setDraftTime(parsedTime);
|
|
14272
|
+
}
|
|
14273
|
+
}, [parsedTime]);
|
|
14274
|
+
const displayValue = useMemo5(() => {
|
|
14275
|
+
return formatTimeString(parsedTime, format, useSeconds);
|
|
14276
|
+
}, [parsedTime, format, useSeconds]);
|
|
14277
|
+
const hourOptions = useMemo5(() => {
|
|
14278
|
+
if (format === "12h") {
|
|
14279
|
+
return [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
14280
|
+
} else {
|
|
14281
|
+
return Array.from({ length: 24 }, (_, i) => i);
|
|
14282
|
+
}
|
|
14283
|
+
}, [format]);
|
|
14284
|
+
const minuteOptions = useMemo5(() => {
|
|
14285
|
+
const step = Math.max(1, minuteInterval);
|
|
14286
|
+
const options = [];
|
|
14287
|
+
for (let i = 0; i < 60; i += step) {
|
|
14288
|
+
options.push(i);
|
|
14289
|
+
}
|
|
14290
|
+
return options;
|
|
14291
|
+
}, [minuteInterval]);
|
|
14292
|
+
const secondOptions = useMemo5(() => {
|
|
14293
|
+
return Array.from({ length: 60 }, (_, i) => i);
|
|
14294
|
+
}, []);
|
|
14295
|
+
function commitTime(state) {
|
|
14296
|
+
if (disabled) return;
|
|
14297
|
+
if (!state) {
|
|
14298
|
+
onChangeValue?.("", null);
|
|
14299
|
+
} else {
|
|
14300
|
+
const formatted = formatTimeString(state, format, useSeconds);
|
|
14301
|
+
const dateObj = stateToDate(state);
|
|
14302
|
+
onChangeValue?.(formatted, dateObj);
|
|
14303
|
+
}
|
|
14304
|
+
}
|
|
14305
|
+
function handleHourSelect(displayHour) {
|
|
14306
|
+
setDraftTime((prev) => {
|
|
14307
|
+
let newHours = prev.hours;
|
|
14308
|
+
if (format === "12h") {
|
|
14309
|
+
const isPM2 = prev.hours >= 12;
|
|
14310
|
+
if (displayHour === 12) {
|
|
14311
|
+
newHours = isPM2 ? 12 : 0;
|
|
14312
|
+
} else {
|
|
14313
|
+
newHours = isPM2 ? displayHour + 12 : displayHour;
|
|
14314
|
+
}
|
|
14315
|
+
} else {
|
|
14316
|
+
newHours = displayHour;
|
|
14317
|
+
}
|
|
14318
|
+
const updated = { ...prev, hours: newHours };
|
|
14319
|
+
commitTime(updated);
|
|
14320
|
+
return updated;
|
|
14321
|
+
});
|
|
14322
|
+
}
|
|
14323
|
+
function handleMinuteSelect(min) {
|
|
14324
|
+
setDraftTime((prev) => {
|
|
14325
|
+
const updated = { ...prev, minutes: min };
|
|
14326
|
+
commitTime(updated);
|
|
14327
|
+
return updated;
|
|
14328
|
+
});
|
|
14329
|
+
}
|
|
14330
|
+
function handleSecondSelect(sec) {
|
|
14331
|
+
setDraftTime((prev) => {
|
|
14332
|
+
const updated = { ...prev, seconds: sec };
|
|
14333
|
+
commitTime(updated);
|
|
14334
|
+
return updated;
|
|
14335
|
+
});
|
|
14336
|
+
}
|
|
14337
|
+
function handlePeriodToggle(period) {
|
|
14338
|
+
setDraftTime((prev) => {
|
|
14339
|
+
let newHours = prev.hours;
|
|
14340
|
+
if (period === "AM" && prev.hours >= 12) {
|
|
14341
|
+
newHours -= 12;
|
|
14342
|
+
} else if (period === "PM" && prev.hours < 12) {
|
|
14343
|
+
newHours += 12;
|
|
14344
|
+
}
|
|
14345
|
+
const updated = { ...prev, hours: newHours };
|
|
14346
|
+
commitTime(updated);
|
|
14347
|
+
return updated;
|
|
14348
|
+
});
|
|
14349
|
+
}
|
|
14350
|
+
function handleSelectNow() {
|
|
14351
|
+
const now = /* @__PURE__ */ new Date();
|
|
14352
|
+
const state = {
|
|
14353
|
+
hours: now.getHours(),
|
|
14354
|
+
minutes: now.getMinutes(),
|
|
14355
|
+
seconds: now.getSeconds()
|
|
14356
|
+
};
|
|
14357
|
+
setDraftTime(state);
|
|
14358
|
+
commitTime(state);
|
|
14359
|
+
setIsOpen(false);
|
|
14360
|
+
}
|
|
14361
|
+
function handleClear(e) {
|
|
14362
|
+
e.stopPropagation();
|
|
14363
|
+
commitTime(null);
|
|
14364
|
+
setIsOpen(false);
|
|
14365
|
+
}
|
|
14366
|
+
useKeyboardShortcuts([
|
|
14367
|
+
{
|
|
14368
|
+
key: "Escape",
|
|
14369
|
+
callback: () => {
|
|
14370
|
+
if (isOpen) setIsOpen(false);
|
|
14371
|
+
},
|
|
14372
|
+
options: { preventDefault: isOpen }
|
|
14373
|
+
}
|
|
14374
|
+
]);
|
|
14375
|
+
const currentDisplayHour = useMemo5(() => {
|
|
14376
|
+
if (format === "12h") {
|
|
14377
|
+
let h = draftTime.hours % 12;
|
|
14378
|
+
return h === 0 ? 12 : h;
|
|
14379
|
+
}
|
|
14380
|
+
return draftTime.hours;
|
|
14381
|
+
}, [draftTime.hours, format]);
|
|
14382
|
+
const isPM = draftTime.hours >= 12;
|
|
14383
|
+
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, {}) });
|
|
14384
|
+
return /* @__PURE__ */ jsxs289(Fragment6, { children: [
|
|
14385
|
+
/* @__PURE__ */ jsx295(
|
|
14386
|
+
InputField,
|
|
14387
|
+
{
|
|
14388
|
+
...inputProps,
|
|
14389
|
+
disabled,
|
|
14390
|
+
readOnly: true,
|
|
14391
|
+
value: displayValue,
|
|
14392
|
+
containerProps: {
|
|
14393
|
+
...inputProps.containerProps,
|
|
14394
|
+
ref: container,
|
|
14395
|
+
className: cn(
|
|
14396
|
+
disabled ? "opacity-50 cursor-not-allowed [&_*]:cursor-not-allowed" : "[&_*]:cursor-pointer",
|
|
14397
|
+
inputProps.containerProps?.className
|
|
14398
|
+
),
|
|
14399
|
+
onClick: (event) => {
|
|
14400
|
+
inputProps.containerProps?.onClick?.(event);
|
|
14401
|
+
if (!disabled) {
|
|
14402
|
+
if (parsedTime) setDraftTime(parsedTime);
|
|
14403
|
+
setIsOpen(true);
|
|
14404
|
+
}
|
|
14405
|
+
}
|
|
14406
|
+
},
|
|
14407
|
+
onBlur: (event) => {
|
|
14408
|
+
setIsOpen(false);
|
|
14409
|
+
inputProps.onBlur?.(event);
|
|
14410
|
+
},
|
|
14411
|
+
endIcon: props.endIcon ? props.endIcon : DefaultClockIcon
|
|
14412
|
+
}
|
|
14413
|
+
),
|
|
14414
|
+
/* @__PURE__ */ jsx295(
|
|
14415
|
+
Popover,
|
|
14416
|
+
{
|
|
14417
|
+
open: isOpen && !disabled,
|
|
14418
|
+
targetRef: container,
|
|
14419
|
+
position: optionsPosition,
|
|
14420
|
+
className: "p-2 select-none",
|
|
14421
|
+
onClose: () => setIsOpen(false),
|
|
14422
|
+
children: /* @__PURE__ */ jsxs289(
|
|
14423
|
+
"div",
|
|
14424
|
+
{
|
|
14425
|
+
className: "w-[260px] bg-bg-secondary border-2 border-border/10 text-text p-3 rounded-2xl shadow-xl flex flex-col gap-3",
|
|
14426
|
+
onMouseDown: (event) => {
|
|
14427
|
+
event.preventDefault();
|
|
14428
|
+
},
|
|
14429
|
+
children: [
|
|
14430
|
+
/* @__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) }) }),
|
|
14431
|
+
/* @__PURE__ */ jsxs289("div", { className: "grid grid-cols-3 gap-2 h-44 text-center", children: [
|
|
14432
|
+
/* @__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: [
|
|
14433
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Hour" }),
|
|
14434
|
+
hourOptions.map((h) => {
|
|
14435
|
+
const isSelected = currentDisplayHour === h;
|
|
14436
|
+
return /* @__PURE__ */ jsx295(
|
|
14437
|
+
"button",
|
|
14438
|
+
{
|
|
14439
|
+
type: "button",
|
|
14440
|
+
onClick: () => handleHourSelect(h),
|
|
14441
|
+
className: cn(
|
|
14442
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14443
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14444
|
+
),
|
|
14445
|
+
children: format === "24h" ? String(h).padStart(2, "0") : h
|
|
14446
|
+
},
|
|
14447
|
+
h
|
|
14448
|
+
);
|
|
14449
|
+
})
|
|
14450
|
+
] }),
|
|
14451
|
+
/* @__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: [
|
|
14452
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Min" }),
|
|
14453
|
+
minuteOptions.map((m) => {
|
|
14454
|
+
const isSelected = draftTime.minutes === m;
|
|
14455
|
+
return /* @__PURE__ */ jsx295(
|
|
14456
|
+
"button",
|
|
14457
|
+
{
|
|
14458
|
+
type: "button",
|
|
14459
|
+
onClick: () => handleMinuteSelect(m),
|
|
14460
|
+
className: cn(
|
|
14461
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14462
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14463
|
+
),
|
|
14464
|
+
children: String(m).padStart(2, "0")
|
|
14465
|
+
},
|
|
14466
|
+
m
|
|
14467
|
+
);
|
|
14468
|
+
})
|
|
14469
|
+
] }),
|
|
14470
|
+
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: [
|
|
14471
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Sec" }),
|
|
14472
|
+
secondOptions.map((s) => {
|
|
14473
|
+
const isSelected = draftTime.seconds === s;
|
|
14474
|
+
return /* @__PURE__ */ jsx295(
|
|
14475
|
+
"button",
|
|
14476
|
+
{
|
|
14477
|
+
type: "button",
|
|
14478
|
+
onClick: () => handleSecondSelect(s),
|
|
14479
|
+
className: cn(
|
|
14480
|
+
"py-1 text-xs rounded-lg transition-all",
|
|
14481
|
+
isSelected ? "bg-primary text-white font-semibold" : "hover:bg-bg text-text"
|
|
14482
|
+
),
|
|
14483
|
+
children: String(s).padStart(2, "0")
|
|
14484
|
+
},
|
|
14485
|
+
s
|
|
14486
|
+
);
|
|
14487
|
+
})
|
|
14488
|
+
] }) : format === "12h" ? /* @__PURE__ */ jsxs289("div", { className: "flex flex-col gap-2", children: [
|
|
14489
|
+
/* @__PURE__ */ jsx295("div", { className: "text-[10px] uppercase font-bold text-text-secondary/70 sticky top-0 bg-bg-secondary py-0.5", children: "Period" }),
|
|
14490
|
+
/* @__PURE__ */ jsx295(
|
|
14491
|
+
"button",
|
|
14492
|
+
{
|
|
14493
|
+
type: "button",
|
|
14494
|
+
onClick: () => handlePeriodToggle("AM"),
|
|
14495
|
+
className: cn(
|
|
14496
|
+
"py-2 text-xs font-semibold rounded-xl transition-all",
|
|
14497
|
+
!isPM ? "bg-primary text-white shadow-sm" : "bg-bg text-text hover:bg-bg/80"
|
|
14498
|
+
),
|
|
14499
|
+
children: "AM"
|
|
14500
|
+
}
|
|
14501
|
+
),
|
|
14502
|
+
/* @__PURE__ */ jsx295(
|
|
14503
|
+
"button",
|
|
14504
|
+
{
|
|
14505
|
+
type: "button",
|
|
14506
|
+
onClick: () => handlePeriodToggle("PM"),
|
|
14507
|
+
className: cn(
|
|
14508
|
+
"py-2 text-xs font-semibold rounded-xl transition-all",
|
|
14509
|
+
isPM ? "bg-primary text-white shadow-sm" : "bg-bg text-text hover:bg-bg/80"
|
|
14510
|
+
),
|
|
14511
|
+
children: "PM"
|
|
14512
|
+
}
|
|
14513
|
+
)
|
|
14514
|
+
] }) : null
|
|
14515
|
+
] }),
|
|
14516
|
+
/* @__PURE__ */ jsxs289("div", { className: "flex items-center justify-between pt-2 border-t border-border/10 text-xs", children: [
|
|
14517
|
+
clearable && parsedTime ? /* @__PURE__ */ jsx295(
|
|
14518
|
+
Button_default,
|
|
14519
|
+
{
|
|
14520
|
+
type: "button",
|
|
14521
|
+
variant: "text",
|
|
14522
|
+
size: "xs",
|
|
14523
|
+
color: "secondary",
|
|
14524
|
+
onClick: handleClear,
|
|
14525
|
+
children: "Clear"
|
|
14526
|
+
}
|
|
14527
|
+
) : /* @__PURE__ */ jsx295("div", {}),
|
|
14528
|
+
/* @__PURE__ */ jsx295(
|
|
14529
|
+
Button_default,
|
|
14530
|
+
{
|
|
14531
|
+
type: "button",
|
|
14532
|
+
variant: "text",
|
|
14533
|
+
size: "xs",
|
|
14534
|
+
color: "primary",
|
|
14535
|
+
onClick: handleSelectNow,
|
|
14536
|
+
className: "ml-auto",
|
|
14537
|
+
children: "Now"
|
|
14538
|
+
}
|
|
14539
|
+
)
|
|
14540
|
+
] })
|
|
14541
|
+
]
|
|
14542
|
+
}
|
|
14543
|
+
)
|
|
14544
|
+
}
|
|
14545
|
+
)
|
|
14546
|
+
] });
|
|
14547
|
+
}
|
|
14548
|
+
|
|
13829
14549
|
// src/components/Navigation/Tab/TabList/index.tsx
|
|
13830
|
-
import { useEffect as
|
|
13831
|
-
import { jsx as
|
|
14550
|
+
import { useEffect as useEffect3, useRef as useRef11 } from "react";
|
|
14551
|
+
import { jsx as jsx296, jsxs as jsxs290 } from "react/jsx-runtime";
|
|
13832
14552
|
function TabList(props) {
|
|
13833
14553
|
const {
|
|
13834
14554
|
tabs,
|
|
@@ -13836,8 +14556,8 @@ function TabList(props) {
|
|
|
13836
14556
|
onChangeActiveTabValue,
|
|
13837
14557
|
...rest
|
|
13838
14558
|
} = props;
|
|
13839
|
-
const tabsContainer =
|
|
13840
|
-
const activeIndicator =
|
|
14559
|
+
const tabsContainer = useRef11(null);
|
|
14560
|
+
const activeIndicator = useRef11(null);
|
|
13841
14561
|
function handleValueChange() {
|
|
13842
14562
|
if (!tabsContainer.current || !activeIndicator.current) return;
|
|
13843
14563
|
const tab = tabsContainer.current.querySelector(`#${activeTabValue}`);
|
|
@@ -13848,7 +14568,7 @@ function TabList(props) {
|
|
|
13848
14568
|
activeIndicator.current.style.height = `${tabLayoutInfo.height}px`;
|
|
13849
14569
|
activeIndicator.current.style.transform = `translateX(${tabLayoutInfo.left - containerLayoutInfo.left}px)`;
|
|
13850
14570
|
}
|
|
13851
|
-
|
|
14571
|
+
useEffect3(() => {
|
|
13852
14572
|
handleValueChange();
|
|
13853
14573
|
window.addEventListener("resize", handleValueChange);
|
|
13854
14574
|
tabsContainer.current?.addEventListener("scroll", handleValueChange);
|
|
@@ -13857,14 +14577,14 @@ function TabList(props) {
|
|
|
13857
14577
|
tabsContainer.current?.removeEventListener("scroll", handleValueChange);
|
|
13858
14578
|
};
|
|
13859
14579
|
}, [activeTabValue]);
|
|
13860
|
-
return /* @__PURE__ */
|
|
14580
|
+
return /* @__PURE__ */ jsxs290(
|
|
13861
14581
|
"div",
|
|
13862
14582
|
{
|
|
13863
14583
|
...rest,
|
|
13864
14584
|
className: cn("bg-bg-secondary w-full p-1 rounded-xl relative", rest.className),
|
|
13865
14585
|
children: [
|
|
13866
|
-
/* @__PURE__ */
|
|
13867
|
-
/* @__PURE__ */
|
|
14586
|
+
/* @__PURE__ */ jsx296("div", { ref: activeIndicator, className: "absolute rounded-lg bg-primary transition-all duration-200" }),
|
|
14587
|
+
/* @__PURE__ */ jsx296("div", { ref: tabsContainer, className: "flex items-center gap-1 w-full overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx296(
|
|
13868
14588
|
"div",
|
|
13869
14589
|
{
|
|
13870
14590
|
id: tab.value,
|
|
@@ -13884,7 +14604,7 @@ function TabList(props) {
|
|
|
13884
14604
|
|
|
13885
14605
|
// src/components/Navigation/Tab/TabPanel/RenderPanel.tsx
|
|
13886
14606
|
import { memo } from "react";
|
|
13887
|
-
import { jsx as
|
|
14607
|
+
import { jsx as jsx297 } from "react/jsx-runtime";
|
|
13888
14608
|
var RenderPanel = memo((props) => {
|
|
13889
14609
|
const {
|
|
13890
14610
|
activePanelValue,
|
|
@@ -13893,14 +14613,14 @@ var RenderPanel = memo((props) => {
|
|
|
13893
14613
|
panelRemoveOnHide
|
|
13894
14614
|
} = props;
|
|
13895
14615
|
if (panels.length === 0) return null;
|
|
13896
|
-
return /* @__PURE__ */
|
|
14616
|
+
return /* @__PURE__ */ jsx297(
|
|
13897
14617
|
ShowWithAnimation,
|
|
13898
14618
|
{
|
|
13899
14619
|
when: panels[0].value === activePanelValue,
|
|
13900
14620
|
containerProps: { className: "w-full h-full" },
|
|
13901
14621
|
className: "w-full h-full",
|
|
13902
14622
|
removeOnHide: panelRemoveOnHide,
|
|
13903
|
-
otherwise: /* @__PURE__ */
|
|
14623
|
+
otherwise: /* @__PURE__ */ jsx297(RenderPanel, { ...props, panels: panels.slice(1) }),
|
|
13904
14624
|
animationStyle: animationStyle ?? {
|
|
13905
14625
|
children: {
|
|
13906
14626
|
from: { scale: 0.9, opacity: 0 },
|
|
@@ -13914,7 +14634,7 @@ var RenderPanel = memo((props) => {
|
|
|
13914
14634
|
});
|
|
13915
14635
|
|
|
13916
14636
|
// src/components/Navigation/Tab/TabPanel/index.tsx
|
|
13917
|
-
import { jsx as
|
|
14637
|
+
import { jsx as jsx298 } from "react/jsx-runtime";
|
|
13918
14638
|
function TabPanel(props) {
|
|
13919
14639
|
const {
|
|
13920
14640
|
activePanelValue,
|
|
@@ -13923,7 +14643,7 @@ function TabPanel(props) {
|
|
|
13923
14643
|
panelRemoveOnHide,
|
|
13924
14644
|
...rest
|
|
13925
14645
|
} = props;
|
|
13926
|
-
return /* @__PURE__ */
|
|
14646
|
+
return /* @__PURE__ */ jsx298("div", { ...rest, children: /* @__PURE__ */ jsx298(
|
|
13927
14647
|
RenderPanel,
|
|
13928
14648
|
{
|
|
13929
14649
|
activePanelValue,
|
|
@@ -13935,7 +14655,7 @@ function TabPanel(props) {
|
|
|
13935
14655
|
}
|
|
13936
14656
|
|
|
13937
14657
|
// src/components/DataDisplay/Table/Table.tsx
|
|
13938
|
-
import { forwardRef as forwardRef3, useMemo as
|
|
14658
|
+
import { forwardRef as forwardRef3, useMemo as useMemo6 } from "react";
|
|
13939
14659
|
|
|
13940
14660
|
// src/components/DataDisplay/Table/TableContext.tsx
|
|
13941
14661
|
import { createContext, useContext } from "react";
|
|
@@ -13945,17 +14665,17 @@ var TableContext = createContext({
|
|
|
13945
14665
|
var useTableContext = () => useContext(TableContext);
|
|
13946
14666
|
|
|
13947
14667
|
// src/components/DataDisplay/Table/Table.tsx
|
|
13948
|
-
import { jsx as
|
|
14668
|
+
import { jsx as jsx299 } from "react/jsx-runtime";
|
|
13949
14669
|
var Table = forwardRef3(
|
|
13950
14670
|
({ className = "", children, stickyHeader = false, loading = false, ...props }, ref) => {
|
|
13951
|
-
const value =
|
|
13952
|
-
return /* @__PURE__ */
|
|
14671
|
+
const value = useMemo6(() => ({ stickyHeader }), [stickyHeader]);
|
|
14672
|
+
return /* @__PURE__ */ jsx299(TableContext.Provider, { value, children: /* @__PURE__ */ jsx299(
|
|
13953
14673
|
"table",
|
|
13954
14674
|
{
|
|
13955
14675
|
ref,
|
|
13956
14676
|
className: `w-full caption-bottom text-sm border-collapse ${stickyHeader ? "relative" : ""} ${className}`,
|
|
13957
14677
|
...props,
|
|
13958
|
-
children: loading ? /* @__PURE__ */
|
|
14678
|
+
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
14679
|
}
|
|
13960
14680
|
) });
|
|
13961
14681
|
}
|
|
@@ -13965,10 +14685,10 @@ var Table_default = Table;
|
|
|
13965
14685
|
|
|
13966
14686
|
// src/components/DataDisplay/Table/TableContainer.tsx
|
|
13967
14687
|
import { forwardRef as forwardRef4 } from "react";
|
|
13968
|
-
import { jsx as
|
|
14688
|
+
import { jsx as jsx300 } from "react/jsx-runtime";
|
|
13969
14689
|
var TableContainer = forwardRef4(
|
|
13970
14690
|
({ className = "", children, ...props }, ref) => {
|
|
13971
|
-
return /* @__PURE__ */
|
|
14691
|
+
return /* @__PURE__ */ jsx300(
|
|
13972
14692
|
"div",
|
|
13973
14693
|
{
|
|
13974
14694
|
ref,
|
|
@@ -13984,10 +14704,10 @@ var TableContainer_default = TableContainer;
|
|
|
13984
14704
|
|
|
13985
14705
|
// src/components/DataDisplay/Table/TableHead.tsx
|
|
13986
14706
|
import { forwardRef as forwardRef5 } from "react";
|
|
13987
|
-
import { jsx as
|
|
14707
|
+
import { jsx as jsx301 } from "react/jsx-runtime";
|
|
13988
14708
|
var TableHead = forwardRef5(
|
|
13989
14709
|
({ className = "", children, ...props }, ref) => {
|
|
13990
|
-
return /* @__PURE__ */
|
|
14710
|
+
return /* @__PURE__ */ jsx301(
|
|
13991
14711
|
"thead",
|
|
13992
14712
|
{
|
|
13993
14713
|
ref,
|
|
@@ -14003,10 +14723,10 @@ var TableHead_default = TableHead;
|
|
|
14003
14723
|
|
|
14004
14724
|
// src/components/DataDisplay/Table/TableBody.tsx
|
|
14005
14725
|
import { forwardRef as forwardRef6 } from "react";
|
|
14006
|
-
import { jsx as
|
|
14726
|
+
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
14007
14727
|
var TableBody = forwardRef6(
|
|
14008
14728
|
({ className = "", children, ...props }, ref) => {
|
|
14009
|
-
return /* @__PURE__ */
|
|
14729
|
+
return /* @__PURE__ */ jsx302(
|
|
14010
14730
|
"tbody",
|
|
14011
14731
|
{
|
|
14012
14732
|
ref,
|
|
@@ -14022,10 +14742,10 @@ var TableBody_default = TableBody;
|
|
|
14022
14742
|
|
|
14023
14743
|
// src/components/DataDisplay/Table/TableRow.tsx
|
|
14024
14744
|
import { forwardRef as forwardRef7 } from "react";
|
|
14025
|
-
import { jsx as
|
|
14745
|
+
import { jsx as jsx303 } from "react/jsx-runtime";
|
|
14026
14746
|
var TableRow = forwardRef7(
|
|
14027
14747
|
({ className = "", children, hover = false, selected = false, ...props }, ref) => {
|
|
14028
|
-
return /* @__PURE__ */
|
|
14748
|
+
return /* @__PURE__ */ jsx303(
|
|
14029
14749
|
"tr",
|
|
14030
14750
|
{
|
|
14031
14751
|
ref,
|
|
@@ -14041,7 +14761,7 @@ var TableRow_default = TableRow;
|
|
|
14041
14761
|
|
|
14042
14762
|
// src/components/DataDisplay/Table/TableCell.tsx
|
|
14043
14763
|
import { forwardRef as forwardRef8 } from "react";
|
|
14044
|
-
import { jsx as
|
|
14764
|
+
import { jsx as jsx304 } from "react/jsx-runtime";
|
|
14045
14765
|
var TableCell = forwardRef8(
|
|
14046
14766
|
({ className = "", align = "left", variant, component, children, ...props }, ref) => {
|
|
14047
14767
|
const { stickyHeader } = useTableContext();
|
|
@@ -14054,7 +14774,7 @@ var TableCell = forwardRef8(
|
|
|
14054
14774
|
justify: "text-justify",
|
|
14055
14775
|
inherit: "text-inherit"
|
|
14056
14776
|
};
|
|
14057
|
-
return /* @__PURE__ */
|
|
14777
|
+
return /* @__PURE__ */ jsx304(
|
|
14058
14778
|
Component,
|
|
14059
14779
|
{
|
|
14060
14780
|
ref,
|
|
@@ -14069,17 +14789,17 @@ TableCell.displayName = "TableCell";
|
|
|
14069
14789
|
var TableCell_default = TableCell;
|
|
14070
14790
|
|
|
14071
14791
|
// src/components/DataDisplay/Table/DataTable.tsx
|
|
14072
|
-
import { jsx as
|
|
14792
|
+
import { jsx as jsx305, jsxs as jsxs291 } from "react/jsx-runtime";
|
|
14073
14793
|
function DataTable({
|
|
14074
14794
|
data,
|
|
14075
14795
|
columns,
|
|
14076
14796
|
loading,
|
|
14077
14797
|
pagination
|
|
14078
14798
|
}) {
|
|
14079
|
-
return /* @__PURE__ */
|
|
14080
|
-
/* @__PURE__ */
|
|
14081
|
-
/* @__PURE__ */
|
|
14082
|
-
/* @__PURE__ */
|
|
14799
|
+
return /* @__PURE__ */ jsxs291(TableContainer_default, { children: [
|
|
14800
|
+
/* @__PURE__ */ jsxs291(Table_default, { loading, children: [
|
|
14801
|
+
/* @__PURE__ */ jsx305(TableHead_default, { children: /* @__PURE__ */ jsx305(TableRow_default, { children: columns.map((col) => /* @__PURE__ */ jsx305(TableCell_default, { variant: "head", children: col.title }, col.key)) }) }),
|
|
14802
|
+
/* @__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
14803
|
] }),
|
|
14084
14804
|
pagination && (() => {
|
|
14085
14805
|
const getVisiblePages = (current, total) => {
|
|
@@ -14089,8 +14809,8 @@ function DataTable({
|
|
|
14089
14809
|
return [1, "...", current - 1, current, current + 1, "...", total];
|
|
14090
14810
|
};
|
|
14091
14811
|
const visiblePages = getVisiblePages(pagination.page, pagination.totalPages);
|
|
14092
|
-
return /* @__PURE__ */
|
|
14093
|
-
/* @__PURE__ */
|
|
14812
|
+
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: [
|
|
14813
|
+
/* @__PURE__ */ jsx305(
|
|
14094
14814
|
Button_default,
|
|
14095
14815
|
{
|
|
14096
14816
|
variant: "outlined",
|
|
@@ -14101,7 +14821,7 @@ function DataTable({
|
|
|
14101
14821
|
children: "Previous"
|
|
14102
14822
|
}
|
|
14103
14823
|
),
|
|
14104
|
-
visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */
|
|
14824
|
+
visiblePages.map((p, index) => p === "..." ? /* @__PURE__ */ jsx305("span", { className: "px-2", children: "..." }, `ellipsis-${index}`) : /* @__PURE__ */ jsx305(
|
|
14105
14825
|
Button_default,
|
|
14106
14826
|
{
|
|
14107
14827
|
variant: p === pagination.page ? "soft" : "outlined",
|
|
@@ -14114,7 +14834,7 @@ function DataTable({
|
|
|
14114
14834
|
},
|
|
14115
14835
|
p
|
|
14116
14836
|
)),
|
|
14117
|
-
/* @__PURE__ */
|
|
14837
|
+
/* @__PURE__ */ jsx305(
|
|
14118
14838
|
Button_default,
|
|
14119
14839
|
{
|
|
14120
14840
|
variant: "outlined",
|
|
@@ -14133,10 +14853,10 @@ var DataTable_default = DataTable;
|
|
|
14133
14853
|
|
|
14134
14854
|
// src/components/DataDisplay/Table/TableFooter.tsx
|
|
14135
14855
|
import { forwardRef as forwardRef9 } from "react";
|
|
14136
|
-
import { jsx as
|
|
14856
|
+
import { jsx as jsx306 } from "react/jsx-runtime";
|
|
14137
14857
|
var TableFooter = forwardRef9(
|
|
14138
14858
|
({ className = "", children, ...props }, ref) => {
|
|
14139
|
-
return /* @__PURE__ */
|
|
14859
|
+
return /* @__PURE__ */ jsx306(
|
|
14140
14860
|
"tfoot",
|
|
14141
14861
|
{
|
|
14142
14862
|
ref,
|
|
@@ -14151,8 +14871,8 @@ TableFooter.displayName = "TableFooter";
|
|
|
14151
14871
|
var TableFooter_default = TableFooter;
|
|
14152
14872
|
|
|
14153
14873
|
// src/components/DataDisplay/Carousel/Carousel.tsx
|
|
14154
|
-
import { useState as
|
|
14155
|
-
import { Fragment as
|
|
14874
|
+
import { useState as useState10, useEffect as useEffect4, useCallback as useCallback3, forwardRef as forwardRef10 } from "react";
|
|
14875
|
+
import { Fragment as Fragment7, jsx as jsx307, jsxs as jsxs292 } from "react/jsx-runtime";
|
|
14156
14876
|
var Carousel = forwardRef10(
|
|
14157
14877
|
({
|
|
14158
14878
|
items,
|
|
@@ -14164,8 +14884,8 @@ var Carousel = forwardRef10(
|
|
|
14164
14884
|
style,
|
|
14165
14885
|
...props
|
|
14166
14886
|
}, ref) => {
|
|
14167
|
-
const [currentIndex, setCurrentIndex] =
|
|
14168
|
-
const [isHovered, setIsHovered] =
|
|
14887
|
+
const [currentIndex, setCurrentIndex] = useState10(0);
|
|
14888
|
+
const [isHovered, setIsHovered] = useState10(false);
|
|
14169
14889
|
const goToNext = useCallback3(() => {
|
|
14170
14890
|
setCurrentIndex((prevIndex) => prevIndex === items.length - 1 ? 0 : prevIndex + 1);
|
|
14171
14891
|
}, [items.length]);
|
|
@@ -14175,7 +14895,7 @@ var Carousel = forwardRef10(
|
|
|
14175
14895
|
const goToIndex = (index) => {
|
|
14176
14896
|
setCurrentIndex(index);
|
|
14177
14897
|
};
|
|
14178
|
-
|
|
14898
|
+
useEffect4(() => {
|
|
14179
14899
|
if (!autoPlay || isHovered) return;
|
|
14180
14900
|
const timer = setInterval(goToNext, interval);
|
|
14181
14901
|
return () => clearInterval(timer);
|
|
@@ -14183,7 +14903,7 @@ var Carousel = forwardRef10(
|
|
|
14183
14903
|
if (!items || items.length === 0) {
|
|
14184
14904
|
return null;
|
|
14185
14905
|
}
|
|
14186
|
-
return /* @__PURE__ */
|
|
14906
|
+
return /* @__PURE__ */ jsxs292(
|
|
14187
14907
|
"div",
|
|
14188
14908
|
{
|
|
14189
14909
|
ref,
|
|
@@ -14193,13 +14913,13 @@ var Carousel = forwardRef10(
|
|
|
14193
14913
|
onMouseLeave: () => setIsHovered(false),
|
|
14194
14914
|
...props,
|
|
14195
14915
|
children: [
|
|
14196
|
-
/* @__PURE__ */
|
|
14916
|
+
/* @__PURE__ */ jsx307(
|
|
14197
14917
|
"div",
|
|
14198
14918
|
{
|
|
14199
14919
|
className: "flex transition-transform duration-500 ease-in-out h-full w-full flex-1",
|
|
14200
14920
|
style: { transform: `translateX(-${currentIndex * 100}%)` },
|
|
14201
|
-
children: items.map((item) => /* @__PURE__ */
|
|
14202
|
-
/* @__PURE__ */
|
|
14921
|
+
children: items.map((item) => /* @__PURE__ */ jsxs292("div", { className: "w-full h-full relative shrink-0", style: { flex: "0 0 100%" }, children: [
|
|
14922
|
+
/* @__PURE__ */ jsx307(
|
|
14203
14923
|
"img",
|
|
14204
14924
|
{
|
|
14205
14925
|
src: item.imageUrl,
|
|
@@ -14207,15 +14927,15 @@ var Carousel = forwardRef10(
|
|
|
14207
14927
|
className: "w-full h-full object-cover"
|
|
14208
14928
|
}
|
|
14209
14929
|
),
|
|
14210
|
-
(item.title || item.description) && /* @__PURE__ */
|
|
14211
|
-
item.title && /* @__PURE__ */
|
|
14212
|
-
item.description && /* @__PURE__ */
|
|
14930
|
+
(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: [
|
|
14931
|
+
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 }),
|
|
14932
|
+
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
14933
|
] })
|
|
14214
14934
|
] }, item.id))
|
|
14215
14935
|
}
|
|
14216
14936
|
),
|
|
14217
|
-
showArrows && items.length > 1 && /* @__PURE__ */
|
|
14218
|
-
/* @__PURE__ */
|
|
14937
|
+
showArrows && items.length > 1 && /* @__PURE__ */ jsxs292(Fragment7, { children: [
|
|
14938
|
+
/* @__PURE__ */ jsx307(
|
|
14219
14939
|
IconButton_default,
|
|
14220
14940
|
{
|
|
14221
14941
|
onClick: goToPrevious,
|
|
@@ -14223,7 +14943,7 @@ var Carousel = forwardRef10(
|
|
|
14223
14943
|
color: "secondary",
|
|
14224
14944
|
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
14945
|
"aria-label": "Previous slide",
|
|
14226
|
-
children: /* @__PURE__ */
|
|
14946
|
+
children: /* @__PURE__ */ jsx307(
|
|
14227
14947
|
"svg",
|
|
14228
14948
|
{
|
|
14229
14949
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14232,12 +14952,12 @@ var Carousel = forwardRef10(
|
|
|
14232
14952
|
strokeWidth: 2,
|
|
14233
14953
|
stroke: "currentColor",
|
|
14234
14954
|
className: "w-5 h-5",
|
|
14235
|
-
children: /* @__PURE__ */
|
|
14955
|
+
children: /* @__PURE__ */ jsx307("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" })
|
|
14236
14956
|
}
|
|
14237
14957
|
)
|
|
14238
14958
|
}
|
|
14239
14959
|
),
|
|
14240
|
-
/* @__PURE__ */
|
|
14960
|
+
/* @__PURE__ */ jsx307(
|
|
14241
14961
|
IconButton_default,
|
|
14242
14962
|
{
|
|
14243
14963
|
onClick: goToNext,
|
|
@@ -14245,7 +14965,7 @@ var Carousel = forwardRef10(
|
|
|
14245
14965
|
color: "secondary",
|
|
14246
14966
|
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
14967
|
"aria-label": "Next slide",
|
|
14248
|
-
children: /* @__PURE__ */
|
|
14968
|
+
children: /* @__PURE__ */ jsx307(
|
|
14249
14969
|
"svg",
|
|
14250
14970
|
{
|
|
14251
14971
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -14254,13 +14974,13 @@ var Carousel = forwardRef10(
|
|
|
14254
14974
|
strokeWidth: 2,
|
|
14255
14975
|
stroke: "currentColor",
|
|
14256
14976
|
className: "w-5 h-5",
|
|
14257
|
-
children: /* @__PURE__ */
|
|
14977
|
+
children: /* @__PURE__ */ jsx307("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" })
|
|
14258
14978
|
}
|
|
14259
14979
|
)
|
|
14260
14980
|
}
|
|
14261
14981
|
)
|
|
14262
14982
|
] }),
|
|
14263
|
-
showIndicators && items.length > 1 && /* @__PURE__ */
|
|
14983
|
+
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
14984
|
"button",
|
|
14265
14985
|
{
|
|
14266
14986
|
onClick: () => goToIndex(index),
|
|
@@ -14281,10 +15001,10 @@ Carousel.displayName = "Carousel";
|
|
|
14281
15001
|
|
|
14282
15002
|
// src/components/DataDisplay/Separator/Separator.tsx
|
|
14283
15003
|
import React3 from "react";
|
|
14284
|
-
import { jsx as
|
|
15004
|
+
import { jsx as jsx308 } from "react/jsx-runtime";
|
|
14285
15005
|
var Separator = React3.forwardRef(
|
|
14286
15006
|
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => {
|
|
14287
|
-
return /* @__PURE__ */
|
|
15007
|
+
return /* @__PURE__ */ jsx308(
|
|
14288
15008
|
"div",
|
|
14289
15009
|
{
|
|
14290
15010
|
ref,
|
|
@@ -14304,7 +15024,7 @@ Separator.displayName = "Separator";
|
|
|
14304
15024
|
|
|
14305
15025
|
// src/components/Overlay/Dialog/Dialog.tsx
|
|
14306
15026
|
import { createPortal } from "react-dom";
|
|
14307
|
-
import { jsx as
|
|
15027
|
+
import { jsx as jsx309 } from "react/jsx-runtime";
|
|
14308
15028
|
function Dialog(props) {
|
|
14309
15029
|
const {
|
|
14310
15030
|
open,
|
|
@@ -14336,7 +15056,7 @@ function Dialog(props) {
|
|
|
14336
15056
|
]);
|
|
14337
15057
|
if (typeof window === "undefined") return null;
|
|
14338
15058
|
return createPortal(
|
|
14339
|
-
/* @__PURE__ */
|
|
15059
|
+
/* @__PURE__ */ jsx309(
|
|
14340
15060
|
ShowWithAnimation,
|
|
14341
15061
|
{
|
|
14342
15062
|
when: open,
|
|
@@ -14364,7 +15084,7 @@ function Dialog(props) {
|
|
|
14364
15084
|
onClose?.();
|
|
14365
15085
|
}
|
|
14366
15086
|
},
|
|
14367
|
-
children: /* @__PURE__ */
|
|
15087
|
+
children: /* @__PURE__ */ jsx309(
|
|
14368
15088
|
ShowWithAnimation,
|
|
14369
15089
|
{
|
|
14370
15090
|
when: open,
|
|
@@ -14389,19 +15109,19 @@ function Dialog(props) {
|
|
|
14389
15109
|
}
|
|
14390
15110
|
|
|
14391
15111
|
// src/components/Overlay/Dialog/DialogHeader.tsx
|
|
14392
|
-
import { jsx as
|
|
15112
|
+
import { jsx as jsx310, jsxs as jsxs293 } from "react/jsx-runtime";
|
|
14393
15113
|
function DialogHeader(props) {
|
|
14394
15114
|
const { title, children, ...rest } = props;
|
|
14395
|
-
return /* @__PURE__ */
|
|
14396
|
-
/* @__PURE__ */
|
|
15115
|
+
return /* @__PURE__ */ jsxs293("div", { ...rest, className: cn("p-4 sticky top-0 z-[20] backdrop-blur-sm", props.className), children: [
|
|
15116
|
+
/* @__PURE__ */ jsx310(Show, { when: !!title, children: /* @__PURE__ */ jsx310("h1", { className: "text-lg font-bold", children: title }) }),
|
|
14397
15117
|
children
|
|
14398
15118
|
] });
|
|
14399
15119
|
}
|
|
14400
15120
|
|
|
14401
15121
|
// src/components/Overlay/Dialog/DialogFooter.tsx
|
|
14402
|
-
import { jsx as
|
|
15122
|
+
import { jsx as jsx311 } from "react/jsx-runtime";
|
|
14403
15123
|
function DialogFooter(props) {
|
|
14404
|
-
return /* @__PURE__ */
|
|
15124
|
+
return /* @__PURE__ */ jsx311(
|
|
14405
15125
|
"div",
|
|
14406
15126
|
{
|
|
14407
15127
|
...props,
|
|
@@ -14411,9 +15131,9 @@ function DialogFooter(props) {
|
|
|
14411
15131
|
}
|
|
14412
15132
|
|
|
14413
15133
|
// src/components/Overlay/Dialog/DialogContent.tsx
|
|
14414
|
-
import { jsx as
|
|
15134
|
+
import { jsx as jsx312 } from "react/jsx-runtime";
|
|
14415
15135
|
function DialogContent(props) {
|
|
14416
|
-
return /* @__PURE__ */
|
|
15136
|
+
return /* @__PURE__ */ jsx312(
|
|
14417
15137
|
"div",
|
|
14418
15138
|
{
|
|
14419
15139
|
...props,
|
|
@@ -14424,7 +15144,7 @@ function DialogContent(props) {
|
|
|
14424
15144
|
|
|
14425
15145
|
// src/components/Overlay/Drawer/Drawer.tsx
|
|
14426
15146
|
import { createPortal as createPortal2 } from "react-dom";
|
|
14427
|
-
import { jsx as
|
|
15147
|
+
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
14428
15148
|
function Drawer(props) {
|
|
14429
15149
|
const {
|
|
14430
15150
|
open,
|
|
@@ -14459,7 +15179,7 @@ function Drawer(props) {
|
|
|
14459
15179
|
}[_size] + (isHorizontal ? "vw" : "vh");
|
|
14460
15180
|
})();
|
|
14461
15181
|
return createPortal2(
|
|
14462
|
-
/* @__PURE__ */
|
|
15182
|
+
/* @__PURE__ */ jsx313(
|
|
14463
15183
|
ShowWithAnimation,
|
|
14464
15184
|
{
|
|
14465
15185
|
when: open,
|
|
@@ -14489,7 +15209,7 @@ function Drawer(props) {
|
|
|
14489
15209
|
onClose?.();
|
|
14490
15210
|
}
|
|
14491
15211
|
},
|
|
14492
|
-
children: /* @__PURE__ */
|
|
15212
|
+
children: /* @__PURE__ */ jsx313(
|
|
14493
15213
|
ShowWithAnimation,
|
|
14494
15214
|
{
|
|
14495
15215
|
when: open,
|
|
@@ -14536,9 +15256,9 @@ function Drawer(props) {
|
|
|
14536
15256
|
}
|
|
14537
15257
|
|
|
14538
15258
|
// src/components/Overlay/Drawer/DrawerContent.tsx
|
|
14539
|
-
import { jsx as
|
|
15259
|
+
import { jsx as jsx314 } from "react/jsx-runtime";
|
|
14540
15260
|
function DrawerContent({ children, className, style }) {
|
|
14541
|
-
return /* @__PURE__ */
|
|
15261
|
+
return /* @__PURE__ */ jsx314(
|
|
14542
15262
|
"div",
|
|
14543
15263
|
{
|
|
14544
15264
|
className: cn("overflow-auto flex-1 p-4 relative hide-scrollbar", className),
|
|
@@ -14549,9 +15269,9 @@ function DrawerContent({ children, className, style }) {
|
|
|
14549
15269
|
}
|
|
14550
15270
|
|
|
14551
15271
|
// src/components/Overlay/Drawer/DrawerHeader.tsx
|
|
14552
|
-
import { jsx as
|
|
15272
|
+
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
14553
15273
|
function DrawerHeader({ children, className, style }) {
|
|
14554
|
-
return /* @__PURE__ */
|
|
15274
|
+
return /* @__PURE__ */ jsx315(
|
|
14555
15275
|
"div",
|
|
14556
15276
|
{
|
|
14557
15277
|
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 +15282,9 @@ function DrawerHeader({ children, className, style }) {
|
|
|
14562
15282
|
}
|
|
14563
15283
|
|
|
14564
15284
|
// src/components/Overlay/Drawer/DrawerFooter.tsx
|
|
14565
|
-
import { jsx as
|
|
15285
|
+
import { jsx as jsx316 } from "react/jsx-runtime";
|
|
14566
15286
|
function DrawerFooter({ children, className, style }) {
|
|
14567
|
-
return /* @__PURE__ */
|
|
15287
|
+
return /* @__PURE__ */ jsx316(
|
|
14568
15288
|
"div",
|
|
14569
15289
|
{
|
|
14570
15290
|
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 +15299,13 @@ import { createRoot } from "react-dom/client";
|
|
|
14579
15299
|
import { createPortal as createPortal3 } from "react-dom";
|
|
14580
15300
|
|
|
14581
15301
|
// src/components/Overlay/Alert/Alert.tsx
|
|
14582
|
-
import { useEffect as
|
|
14583
|
-
import { jsx as
|
|
15302
|
+
import { useEffect as useEffect5, useState as useState11, useRef as useRef12, useCallback as useCallback4 } from "react";
|
|
15303
|
+
import { jsx as jsx317, jsxs as jsxs294 } from "react/jsx-runtime";
|
|
14584
15304
|
var icons = {
|
|
14585
|
-
success: /* @__PURE__ */
|
|
14586
|
-
error: /* @__PURE__ */
|
|
14587
|
-
warning: /* @__PURE__ */
|
|
14588
|
-
info: /* @__PURE__ */
|
|
15305
|
+
success: /* @__PURE__ */ jsx317(SuccessIcon, {}),
|
|
15306
|
+
error: /* @__PURE__ */ jsx317(ErrorIcon, {}),
|
|
15307
|
+
warning: /* @__PURE__ */ jsx317(WarningIcon, {}),
|
|
15308
|
+
info: /* @__PURE__ */ jsx317(InfoIcon, {})
|
|
14589
15309
|
};
|
|
14590
15310
|
var textStyles = {
|
|
14591
15311
|
success: "text-success-800",
|
|
@@ -14613,14 +15333,14 @@ var progressColors = {
|
|
|
14613
15333
|
};
|
|
14614
15334
|
function AlertComponent({ open, title, type, options, onClose }) {
|
|
14615
15335
|
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
|
-
|
|
15336
|
+
const [progress, setProgress] = useState11(100);
|
|
15337
|
+
const [showContent, setShowContent] = useState11(false);
|
|
15338
|
+
const timerRef = useRef12(null);
|
|
15339
|
+
const animFrameRef = useRef12(null);
|
|
15340
|
+
const startTimeRef = useRef12(0);
|
|
15341
|
+
const remainingRef = useRef12(0);
|
|
15342
|
+
const onCloseRef = useRef12(onClose);
|
|
15343
|
+
useEffect5(() => {
|
|
14624
15344
|
onCloseRef.current = onClose;
|
|
14625
15345
|
}, [onClose]);
|
|
14626
15346
|
const clearTimers = useCallback4(() => {
|
|
@@ -14648,7 +15368,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14648
15368
|
animFrameRef.current = requestAnimationFrame(animate);
|
|
14649
15369
|
timerRef.current = setTimeout(() => onCloseRef.current(), duration);
|
|
14650
15370
|
}, [options?.duration]);
|
|
14651
|
-
|
|
15371
|
+
useEffect5(() => {
|
|
14652
15372
|
if (open && options?.duration) {
|
|
14653
15373
|
setProgress(100);
|
|
14654
15374
|
const paintTimer = setTimeout(() => {
|
|
@@ -14673,7 +15393,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14673
15393
|
if (!options?.duration || remainingRef.current <= 0) return;
|
|
14674
15394
|
startProgressAnimation(remainingRef.current);
|
|
14675
15395
|
}, [options?.duration, startProgressAnimation]);
|
|
14676
|
-
return /* @__PURE__ */
|
|
15396
|
+
return /* @__PURE__ */ jsx317(
|
|
14677
15397
|
ShowWithAnimation,
|
|
14678
15398
|
{
|
|
14679
15399
|
when: open,
|
|
@@ -14692,7 +15412,7 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14692
15412
|
}
|
|
14693
15413
|
},
|
|
14694
15414
|
className: "pointer-events-auto flex justify-center",
|
|
14695
|
-
children: /* @__PURE__ */
|
|
15415
|
+
children: /* @__PURE__ */ jsxs294(
|
|
14696
15416
|
"div",
|
|
14697
15417
|
{
|
|
14698
15418
|
className: cn(
|
|
@@ -14702,37 +15422,37 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14702
15422
|
onMouseEnter: handleMouseEnter,
|
|
14703
15423
|
onMouseLeave: handleMouseLeave,
|
|
14704
15424
|
children: [
|
|
14705
|
-
/* @__PURE__ */
|
|
14706
|
-
/* @__PURE__ */
|
|
14707
|
-
/* @__PURE__ */
|
|
14708
|
-
/* @__PURE__ */
|
|
15425
|
+
/* @__PURE__ */ jsxs294("div", { className: cn("flex gap-3 items-center px-4 pt-4", options?.content ? "pb-2" : "pb-4"), children: [
|
|
15426
|
+
/* @__PURE__ */ jsx317("div", { className: cn("flex-shrink-0", iconStyles[type]), children: icons[type] }),
|
|
15427
|
+
/* @__PURE__ */ jsx317("h3", { className: cn("flex-1 text-sm font-semibold", textStyles[type]), children: title }),
|
|
15428
|
+
/* @__PURE__ */ jsx317(
|
|
14709
15429
|
"button",
|
|
14710
15430
|
{
|
|
14711
15431
|
onClick: onClose,
|
|
14712
15432
|
className: cn("flex-shrink-0 opacity-50 hover:opacity-100 transition-opacity rounded-md", textStyles[type]),
|
|
14713
15433
|
"aria-label": "Close Alert",
|
|
14714
|
-
children: /* @__PURE__ */
|
|
15434
|
+
children: /* @__PURE__ */ jsx317(CloseIcon, {})
|
|
14715
15435
|
}
|
|
14716
15436
|
)
|
|
14717
15437
|
] }),
|
|
14718
|
-
options?.content && /* @__PURE__ */
|
|
14719
|
-
/* @__PURE__ */
|
|
15438
|
+
options?.content && /* @__PURE__ */ jsxs294("div", { className: "px-4 pb-4", children: [
|
|
15439
|
+
/* @__PURE__ */ jsxs294(
|
|
14720
15440
|
"button",
|
|
14721
15441
|
{
|
|
14722
15442
|
onClick: () => setShowContent(!showContent),
|
|
14723
15443
|
className: cn("text-xs font-medium underline opacity-80 hover:opacity-100 transition-opacity flex items-center gap-1", textStyles[type]),
|
|
14724
15444
|
children: [
|
|
14725
15445
|
showContent ? "Less Info" : "More Info",
|
|
14726
|
-
/* @__PURE__ */
|
|
15446
|
+
/* @__PURE__ */ jsx317(ChevronDownIcon, { className: cn("w-3 h-3 transition-transform duration-200", showContent ? "rotate-180" : "rotate-0") })
|
|
14727
15447
|
]
|
|
14728
15448
|
}
|
|
14729
15449
|
),
|
|
14730
|
-
/* @__PURE__ */
|
|
15450
|
+
/* @__PURE__ */ jsx317("div", { className: cn(
|
|
14731
15451
|
"grid transition-all duration-300 ease-in-out",
|
|
14732
15452
|
showContent ? "grid-rows-[1fr] opacity-100 mt-2" : "grid-rows-[0fr] opacity-0 mt-0"
|
|
14733
|
-
), children: /* @__PURE__ */
|
|
15453
|
+
), 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
15454
|
] }),
|
|
14735
|
-
options?.duration && /* @__PURE__ */
|
|
15455
|
+
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
15456
|
"div",
|
|
14737
15457
|
{
|
|
14738
15458
|
className: cn("h-full transition-none", progressColors[type]),
|
|
@@ -14749,19 +15469,19 @@ function AlertComponent({ open, title, type, options, onClose }) {
|
|
|
14749
15469
|
}
|
|
14750
15470
|
|
|
14751
15471
|
// src/components/Overlay/Alert/renderAlert.tsx
|
|
14752
|
-
import { jsx as
|
|
15472
|
+
import { jsx as jsx318 } from "react/jsx-runtime";
|
|
14753
15473
|
var alertRoot = null;
|
|
14754
15474
|
var alertContainer = null;
|
|
14755
15475
|
var alertStack = [];
|
|
14756
15476
|
var nextId = 0;
|
|
14757
15477
|
function AlertStackContainer({ alerts, onClose }) {
|
|
14758
15478
|
return createPortal3(
|
|
14759
|
-
/* @__PURE__ */
|
|
15479
|
+
/* @__PURE__ */ jsx318(
|
|
14760
15480
|
"div",
|
|
14761
15481
|
{
|
|
14762
15482
|
style: { position: "fixed", top: 0, left: 0, right: 0, zIndex: 9999, pointerEvents: "none" },
|
|
14763
15483
|
className: "flex flex-col items-center gap-2 p-4 sm:p-6",
|
|
14764
|
-
children: alerts.map((alert) => /* @__PURE__ */
|
|
15484
|
+
children: alerts.map((alert) => /* @__PURE__ */ jsx318(
|
|
14765
15485
|
AlertComponent,
|
|
14766
15486
|
{
|
|
14767
15487
|
open: alert.open,
|
|
@@ -14797,7 +15517,7 @@ var renderStack = () => {
|
|
|
14797
15517
|
}, 300);
|
|
14798
15518
|
};
|
|
14799
15519
|
alertRoot.render(
|
|
14800
|
-
/* @__PURE__ */
|
|
15520
|
+
/* @__PURE__ */ jsx318(AlertStackContainer, { alerts: [...alertStack], onClose: handleClose })
|
|
14801
15521
|
);
|
|
14802
15522
|
};
|
|
14803
15523
|
var renderAlert = (props) => {
|
|
@@ -14847,10 +15567,10 @@ var handleError = () => {
|
|
|
14847
15567
|
|
|
14848
15568
|
// src/components/Surfaces/Card/Card.tsx
|
|
14849
15569
|
import React5 from "react";
|
|
14850
|
-
import { jsx as
|
|
15570
|
+
import { jsx as jsx319 } from "react/jsx-runtime";
|
|
14851
15571
|
var Card = React5.forwardRef(
|
|
14852
15572
|
({ className, children, ...props }, ref) => {
|
|
14853
|
-
return /* @__PURE__ */
|
|
15573
|
+
return /* @__PURE__ */ jsx319(
|
|
14854
15574
|
"div",
|
|
14855
15575
|
{
|
|
14856
15576
|
ref,
|
|
@@ -14868,22 +15588,22 @@ Card.displayName = "Card";
|
|
|
14868
15588
|
|
|
14869
15589
|
// src/components/Surfaces/Card/CardHeader.tsx
|
|
14870
15590
|
import React6 from "react";
|
|
14871
|
-
import { jsx as
|
|
15591
|
+
import { jsx as jsx320, jsxs as jsxs295 } from "react/jsx-runtime";
|
|
14872
15592
|
var CardHeader = React6.forwardRef(
|
|
14873
15593
|
({ className, avatar, action, title, subheader, ...props }, ref) => {
|
|
14874
|
-
return /* @__PURE__ */
|
|
15594
|
+
return /* @__PURE__ */ jsxs295(
|
|
14875
15595
|
"div",
|
|
14876
15596
|
{
|
|
14877
15597
|
ref,
|
|
14878
15598
|
className: cn("flex items-center p-6", className),
|
|
14879
15599
|
...props,
|
|
14880
15600
|
children: [
|
|
14881
|
-
avatar && /* @__PURE__ */
|
|
14882
|
-
/* @__PURE__ */
|
|
14883
|
-
title && /* @__PURE__ */
|
|
14884
|
-
subheader && /* @__PURE__ */
|
|
15601
|
+
avatar && /* @__PURE__ */ jsx320("div", { className: "mr-4 flex-shrink-0", children: avatar }),
|
|
15602
|
+
/* @__PURE__ */ jsxs295("div", { className: "flex-1 flex flex-col gap-1", children: [
|
|
15603
|
+
title && /* @__PURE__ */ jsx320("div", { className: "font-semibold leading-none tracking-tight", children: title }),
|
|
15604
|
+
subheader && /* @__PURE__ */ jsx320("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: subheader })
|
|
14885
15605
|
] }),
|
|
14886
|
-
action && /* @__PURE__ */
|
|
15606
|
+
action && /* @__PURE__ */ jsx320("div", { className: "ml-4 flex-shrink-0 self-start", children: action })
|
|
14887
15607
|
]
|
|
14888
15608
|
}
|
|
14889
15609
|
);
|
|
@@ -14893,10 +15613,10 @@ CardHeader.displayName = "CardHeader";
|
|
|
14893
15613
|
|
|
14894
15614
|
// src/components/Surfaces/Card/CardContent.tsx
|
|
14895
15615
|
import React7 from "react";
|
|
14896
|
-
import { jsx as
|
|
15616
|
+
import { jsx as jsx321 } from "react/jsx-runtime";
|
|
14897
15617
|
var CardContent = React7.forwardRef(
|
|
14898
15618
|
({ className, ...props }, ref) => {
|
|
14899
|
-
return /* @__PURE__ */
|
|
15619
|
+
return /* @__PURE__ */ jsx321(
|
|
14900
15620
|
"div",
|
|
14901
15621
|
{
|
|
14902
15622
|
ref,
|
|
@@ -14910,10 +15630,10 @@ CardContent.displayName = "CardContent";
|
|
|
14910
15630
|
|
|
14911
15631
|
// src/components/Surfaces/Card/CardFooter.tsx
|
|
14912
15632
|
import React8 from "react";
|
|
14913
|
-
import { Fragment as
|
|
15633
|
+
import { Fragment as Fragment8, jsx as jsx322, jsxs as jsxs296 } from "react/jsx-runtime";
|
|
14914
15634
|
var CardFooter = React8.forwardRef(
|
|
14915
15635
|
({ className, text, action, children }, ref) => {
|
|
14916
|
-
return /* @__PURE__ */
|
|
15636
|
+
return /* @__PURE__ */ jsx322(
|
|
14917
15637
|
"div",
|
|
14918
15638
|
{
|
|
14919
15639
|
ref,
|
|
@@ -14921,23 +15641,154 @@ var CardFooter = React8.forwardRef(
|
|
|
14921
15641
|
"flex items-center justify-between p-6 bg-white dark:bg-gray-900 rounded-b-xl",
|
|
14922
15642
|
className
|
|
14923
15643
|
),
|
|
14924
|
-
children: children || /* @__PURE__ */
|
|
14925
|
-
text && /* @__PURE__ */
|
|
14926
|
-
action && /* @__PURE__ */
|
|
15644
|
+
children: children || /* @__PURE__ */ jsxs296(Fragment8, { children: [
|
|
15645
|
+
text && /* @__PURE__ */ jsx322("div", { className: "text-sm text-gray-500 dark:text-gray-400", children: text }),
|
|
15646
|
+
action && /* @__PURE__ */ jsx322("div", { className: "ml-auto flex items-center gap-2", children: action })
|
|
14927
15647
|
] })
|
|
14928
15648
|
}
|
|
14929
15649
|
);
|
|
14930
15650
|
}
|
|
14931
15651
|
);
|
|
14932
15652
|
CardFooter.displayName = "CardFooter";
|
|
15653
|
+
|
|
15654
|
+
// src/components/Primitives/Avatar/index.tsx
|
|
15655
|
+
import { Fragment as Fragment9, useLayoutEffect as useLayoutEffect2, useState as useState12 } from "react";
|
|
15656
|
+
import { jsx as jsx323, jsxs as jsxs297 } from "react/jsx-runtime";
|
|
15657
|
+
function Avatar(props) {
|
|
15658
|
+
const {
|
|
15659
|
+
label,
|
|
15660
|
+
labelProps,
|
|
15661
|
+
src = "",
|
|
15662
|
+
alt = "Avatar",
|
|
15663
|
+
variant = "outlined",
|
|
15664
|
+
color = "secondary",
|
|
15665
|
+
size = "md",
|
|
15666
|
+
...iconButtonProps
|
|
15667
|
+
} = props;
|
|
15668
|
+
const [hasError, setHasError] = useState12(false);
|
|
15669
|
+
const fallbackText = getInitials(alt);
|
|
15670
|
+
const shouldRenderImage = Boolean(src) && !hasError;
|
|
15671
|
+
useLayoutEffect2(() => {
|
|
15672
|
+
setHasError(false);
|
|
15673
|
+
}, [src]);
|
|
15674
|
+
return /* @__PURE__ */ jsx323(
|
|
15675
|
+
Tooltip,
|
|
15676
|
+
{
|
|
15677
|
+
...labelProps,
|
|
15678
|
+
label,
|
|
15679
|
+
labelContainerProps: {
|
|
15680
|
+
...labelProps?.labelContainerProps,
|
|
15681
|
+
style: {
|
|
15682
|
+
...labelProps?.labelContainerProps?.style,
|
|
15683
|
+
display: label ? "flex" : "none"
|
|
15684
|
+
}
|
|
15685
|
+
},
|
|
15686
|
+
children: /* @__PURE__ */ jsx323(
|
|
15687
|
+
IconButton_default,
|
|
15688
|
+
{
|
|
15689
|
+
role: "img",
|
|
15690
|
+
"aria-label": alt,
|
|
15691
|
+
...iconButtonProps,
|
|
15692
|
+
variant,
|
|
15693
|
+
color,
|
|
15694
|
+
size,
|
|
15695
|
+
children: shouldRenderImage ? /* @__PURE__ */ jsxs297(Fragment9, { children: [
|
|
15696
|
+
/* @__PURE__ */ jsx323(
|
|
15697
|
+
"img",
|
|
15698
|
+
{
|
|
15699
|
+
src,
|
|
15700
|
+
alt: "",
|
|
15701
|
+
"aria-hidden": "true",
|
|
15702
|
+
className: "h-full w-full object-fill blur-sm absolute z-[-1]",
|
|
15703
|
+
onError: () => setHasError(true),
|
|
15704
|
+
loading: "lazy",
|
|
15705
|
+
decoding: "async"
|
|
15706
|
+
}
|
|
15707
|
+
),
|
|
15708
|
+
/* @__PURE__ */ jsx323(
|
|
15709
|
+
"img",
|
|
15710
|
+
{
|
|
15711
|
+
src,
|
|
15712
|
+
alt: "",
|
|
15713
|
+
"aria-hidden": "true",
|
|
15714
|
+
className: "h-full w-full object-contain",
|
|
15715
|
+
onError: () => setHasError(true),
|
|
15716
|
+
loading: "lazy",
|
|
15717
|
+
decoding: "async"
|
|
15718
|
+
}
|
|
15719
|
+
)
|
|
15720
|
+
] }) : /* @__PURE__ */ jsx323("span", { "aria-hidden": "true", className: "select-none leading-none", children: fallbackText })
|
|
15721
|
+
}
|
|
15722
|
+
)
|
|
15723
|
+
}
|
|
15724
|
+
);
|
|
15725
|
+
}
|
|
15726
|
+
function getInitials(label) {
|
|
15727
|
+
const trimmedLabel = label.trim();
|
|
15728
|
+
if (!trimmedLabel) return "?";
|
|
15729
|
+
const words = trimmedLabel.split(/\s+/).filter(Boolean);
|
|
15730
|
+
if (words.length === 1) {
|
|
15731
|
+
return words[0].slice(0, 2).toUpperCase();
|
|
15732
|
+
}
|
|
15733
|
+
return words.slice(0, 2).map((word) => word[0]?.toUpperCase() ?? "").join("");
|
|
15734
|
+
}
|
|
15735
|
+
|
|
15736
|
+
// src/components/Primitives/AvatarStack/index.tsx
|
|
15737
|
+
import { useState as useState13 } from "react";
|
|
15738
|
+
import { jsx as jsx324 } from "react/jsx-runtime";
|
|
15739
|
+
import { createElement } from "react";
|
|
15740
|
+
function AvatarStack(props) {
|
|
15741
|
+
const {
|
|
15742
|
+
avatars = [],
|
|
15743
|
+
max = Infinity,
|
|
15744
|
+
size = "md",
|
|
15745
|
+
onClickAvatar
|
|
15746
|
+
} = props;
|
|
15747
|
+
const allowAvatars = avatars.slice(0, max);
|
|
15748
|
+
const [hoverIndex, setHoverIndex] = useState13(-1);
|
|
15749
|
+
return /* @__PURE__ */ jsx324("div", { className: cn(
|
|
15750
|
+
"flex items-center",
|
|
15751
|
+
{
|
|
15752
|
+
"xs": "-space-x-2",
|
|
15753
|
+
"sm": "-space-x-3",
|
|
15754
|
+
"md": "-space-x-4",
|
|
15755
|
+
"lg": "-space-x-5",
|
|
15756
|
+
"xl": "-space-x-6"
|
|
15757
|
+
}[size]
|
|
15758
|
+
), children: allowAvatars.map((avatarProps, index) => /* @__PURE__ */ createElement(
|
|
15759
|
+
Avatar,
|
|
15760
|
+
{
|
|
15761
|
+
...avatarProps,
|
|
15762
|
+
size,
|
|
15763
|
+
key: avatarProps.id,
|
|
15764
|
+
className: "hover:scale-105 transition-all border-2",
|
|
15765
|
+
style: {
|
|
15766
|
+
zIndex: hoverIndex === index ? avatars.length + 1 : avatars.length - index
|
|
15767
|
+
},
|
|
15768
|
+
onClick: () => onClickAvatar?.(avatarProps.id),
|
|
15769
|
+
onMouseEnter: () => setHoverIndex(index),
|
|
15770
|
+
onMouseLeave: () => setHoverIndex(-1)
|
|
15771
|
+
}
|
|
15772
|
+
)) });
|
|
15773
|
+
}
|
|
14933
15774
|
export {
|
|
15775
|
+
Avatar,
|
|
15776
|
+
AvatarStack,
|
|
14934
15777
|
Button_default as Button,
|
|
15778
|
+
CalendarIcon,
|
|
14935
15779
|
Card,
|
|
14936
15780
|
CardContent,
|
|
14937
15781
|
CardFooter,
|
|
14938
15782
|
CardHeader,
|
|
14939
15783
|
Carousel,
|
|
15784
|
+
ChevronDownIcon,
|
|
15785
|
+
ChevronLeftIcon,
|
|
15786
|
+
ChevronRightIcon,
|
|
15787
|
+
ClockIcon,
|
|
15788
|
+
CloseIcon,
|
|
15789
|
+
CrossIcon,
|
|
14940
15790
|
DataTable_default as DataTable,
|
|
15791
|
+
DatePicker,
|
|
14941
15792
|
Dialog,
|
|
14942
15793
|
DialogContent,
|
|
14943
15794
|
DialogFooter,
|
|
@@ -14946,13 +15797,17 @@ export {
|
|
|
14946
15797
|
DrawerContent,
|
|
14947
15798
|
DrawerFooter,
|
|
14948
15799
|
DrawerHeader,
|
|
15800
|
+
ErrorIcon,
|
|
14949
15801
|
FlagIcon,
|
|
14950
15802
|
IconButton_default as IconButton,
|
|
15803
|
+
InfoIcon,
|
|
14951
15804
|
InputField,
|
|
14952
15805
|
MultiSelect,
|
|
14953
15806
|
SearchBar,
|
|
15807
|
+
SearchIcon,
|
|
14954
15808
|
Select,
|
|
14955
15809
|
Separator,
|
|
15810
|
+
SuccessIcon,
|
|
14956
15811
|
TabList,
|
|
14957
15812
|
TabPanel,
|
|
14958
15813
|
Table_default as Table,
|
|
@@ -14963,7 +15818,9 @@ export {
|
|
|
14963
15818
|
TableHead_default as TableHead,
|
|
14964
15819
|
TableRow_default as TableRow,
|
|
14965
15820
|
TelInput,
|
|
15821
|
+
TimePicker,
|
|
14966
15822
|
Tooltip,
|
|
15823
|
+
WarningIcon,
|
|
14967
15824
|
handleAlert,
|
|
14968
15825
|
handleError,
|
|
14969
15826
|
isValidPhoneChars,
|