@deepnoid/ui 0.1.12 → 0.1.13
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/.turbo/turbo-build.log +158 -148
- package/dist/{chunk-LHDOM76J.mjs → chunk-2KAR2PTQ.mjs} +1 -1
- package/dist/{chunk-QYJORE4E.mjs → chunk-4GLKWK3Z.mjs} +1 -1
- package/dist/{chunk-H5DOTBKA.mjs → chunk-56RN6YOP.mjs} +1 -1
- package/dist/{chunk-RMTHVIPI.mjs → chunk-57WBWSSL.mjs} +2 -2
- package/dist/{chunk-ILFY6MZ6.mjs → chunk-6G7GOPSB.mjs} +5 -5
- package/dist/{chunk-PI6Q5JDU.mjs → chunk-7R4NOC2G.mjs} +11 -11
- package/dist/{chunk-6BBDU4HW.mjs → chunk-7R4QY3TA.mjs} +1 -1
- package/dist/{chunk-M5KV3WZ2.mjs → chunk-A7OXEUCC.mjs} +29 -37
- package/dist/{chunk-W55GVLPJ.mjs → chunk-AHTNXGAY.mjs} +1 -1
- package/dist/{chunk-RRI3I435.mjs → chunk-DADMVOYI.mjs} +1 -1
- package/dist/{chunk-ASQAVFM5.mjs → chunk-GQS6V47G.mjs} +1 -1
- package/dist/{chunk-C62UPLCC.mjs → chunk-GXWSYM7Z.mjs} +2 -2
- package/dist/{chunk-KHI2DZTG.mjs → chunk-LP724WOP.mjs} +4 -4
- package/dist/{chunk-BWURZ3WF.mjs → chunk-NEUCUEIG.mjs} +2 -2
- package/dist/{chunk-DPCE4DLW.mjs → chunk-NJ4PBW65.mjs} +1 -1
- package/dist/{chunk-G3LQ3ZX6.mjs → chunk-O5UA4WDU.mjs} +1 -1
- package/dist/{chunk-OHDRKCOC.mjs → chunk-T5LK5CJS.mjs} +41 -23
- package/dist/chunk-TTY3EEXX.mjs +143 -0
- package/dist/{chunk-N4F3R6HG.mjs → chunk-WB24YDE2.mjs} +1 -1
- package/dist/{chunk-N4UFXIUC.mjs → chunk-YQGZRSUQ.mjs} +1 -1
- package/dist/chunk-ZMJYDLTS.mjs +380 -0
- package/dist/components/avatar/avatar.js +29 -37
- package/dist/components/avatar/avatar.mjs +2 -2
- package/dist/components/avatar/index.js +29 -37
- package/dist/components/avatar/index.mjs +2 -2
- package/dist/components/breadcrumb/breadcrumb.d.mts +0 -3
- package/dist/components/breadcrumb/breadcrumb.d.ts +0 -3
- package/dist/components/breadcrumb/breadcrumb.js +257 -65
- package/dist/components/breadcrumb/breadcrumb.mjs +13 -3
- package/dist/components/breadcrumb/index.js +257 -65
- package/dist/components/breadcrumb/index.mjs +13 -3
- package/dist/components/button/button-group.js +1 -1
- package/dist/components/button/button-group.mjs +1 -1
- package/dist/components/button/button.js +29 -37
- package/dist/components/button/button.mjs +4 -4
- package/dist/components/button/icon-button.d.mts +157 -0
- package/dist/components/button/icon-button.d.ts +157 -0
- package/dist/components/button/icon-button.js +4674 -0
- package/dist/components/button/icon-button.mjs +16 -0
- package/dist/components/button/index.d.mts +5 -0
- package/dist/components/button/index.d.ts +5 -0
- package/dist/components/button/index.js +566 -45
- package/dist/components/button/index.mjs +16 -7
- package/dist/components/button/text-button.d.mts +146 -0
- package/dist/components/button/text-button.d.ts +146 -0
- package/dist/components/button/text-button.js +507 -0
- package/dist/components/button/text-button.mjs +11 -0
- package/dist/components/chip/chip.js +29 -37
- package/dist/components/chip/chip.mjs +3 -3
- package/dist/components/chip/index.js +29 -37
- package/dist/components/chip/index.mjs +3 -3
- package/dist/components/dateTimePicker/calendar.js +29 -37
- package/dist/components/dateTimePicker/calendar.mjs +3 -3
- package/dist/components/dateTimePicker/dateTimePicker.js +29 -37
- package/dist/components/dateTimePicker/dateTimePicker.mjs +7 -7
- package/dist/components/dateTimePicker/index.js +29 -37
- package/dist/components/dateTimePicker/index.mjs +7 -7
- package/dist/components/dateTimePicker/timePicker.js +29 -37
- package/dist/components/dateTimePicker/timePicker.mjs +5 -5
- package/dist/components/icon/Icon.d.mts +4 -4
- package/dist/components/icon/Icon.d.ts +4 -4
- package/dist/components/icon/Icon.js +29 -37
- package/dist/components/icon/Icon.mjs +2 -2
- package/dist/components/icon/index.js +29 -37
- package/dist/components/icon/index.mjs +2 -2
- package/dist/components/icon/template.d.mts +1 -1
- package/dist/components/icon/template.d.ts +1 -1
- package/dist/components/icon/template.js +29 -37
- package/dist/components/icon/template.mjs +1 -1
- package/dist/components/input/index.js +29 -37
- package/dist/components/input/index.mjs +3 -3
- package/dist/components/input/input.js +29 -37
- package/dist/components/input/input.mjs +3 -3
- package/dist/components/list/index.js +29 -37
- package/dist/components/list/index.mjs +4 -4
- package/dist/components/list/listItem.js +29 -37
- package/dist/components/list/listItem.mjs +4 -4
- package/dist/components/modal/index.js +29 -37
- package/dist/components/modal/index.mjs +10 -7
- package/dist/components/modal/modal.js +29 -37
- package/dist/components/modal/modal.mjs +10 -7
- package/dist/components/pagination/index.js +36 -44
- package/dist/components/pagination/index.mjs +5 -5
- package/dist/components/pagination/pagination.js +36 -44
- package/dist/components/pagination/pagination.mjs +5 -5
- package/dist/components/ripple/index.mjs +3 -3
- package/dist/components/select/index.js +29 -37
- package/dist/components/select/index.mjs +4 -4
- package/dist/components/select/option.js +29 -37
- package/dist/components/select/option.mjs +3 -3
- package/dist/components/select/select.js +29 -37
- package/dist/components/select/select.mjs +4 -4
- package/dist/components/table/index.js +36 -44
- package/dist/components/table/index.mjs +6 -6
- package/dist/components/table/table.js +36 -44
- package/dist/components/table/table.mjs +6 -6
- package/dist/components/toast/index.js +29 -37
- package/dist/components/toast/index.mjs +4 -4
- package/dist/components/toast/toast.js +29 -37
- package/dist/components/toast/toast.mjs +3 -3
- package/dist/components/toast/use-toast.js +29 -37
- package/dist/components/toast/use-toast.mjs +4 -4
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1102 -608
- package/dist/index.mjs +50 -42
- package/package.json +1 -1
- /package/dist/{chunk-VUYUQGLF.mjs → chunk-MY5U63QO.mjs} +0 -0
package/dist/index.js
CHANGED
|
@@ -111,6 +111,7 @@ __export(index_exports, {
|
|
|
111
111
|
Chip: () => chip_default,
|
|
112
112
|
DateTimePicker: () => dateTimePicker_default,
|
|
113
113
|
Icon: () => Icon_default,
|
|
114
|
+
IconButton: () => icon_button_default,
|
|
114
115
|
Input: () => input_default,
|
|
115
116
|
List: () => list_default,
|
|
116
117
|
ListItem: () => listItem_default,
|
|
@@ -121,6 +122,7 @@ __export(index_exports, {
|
|
|
121
122
|
Switch: () => switch_default,
|
|
122
123
|
Table: () => table_default,
|
|
123
124
|
Tabs: () => tabs_default,
|
|
125
|
+
TextButton: () => text_button_default,
|
|
124
126
|
Textarea: () => textarea_default,
|
|
125
127
|
Toast: () => toast_default,
|
|
126
128
|
ToastProvider: () => ToastProvider,
|
|
@@ -544,6 +546,35 @@ var template = {
|
|
|
544
546
|
}
|
|
545
547
|
);
|
|
546
548
|
},
|
|
549
|
+
home: ({ className }) => {
|
|
550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
551
|
+
"svg",
|
|
552
|
+
{
|
|
553
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
554
|
+
width: "18",
|
|
555
|
+
height: "18",
|
|
556
|
+
viewBox: "0 0 18 18",
|
|
557
|
+
fill: "none",
|
|
558
|
+
className,
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
561
|
+
"path",
|
|
562
|
+
{
|
|
563
|
+
d: "M8.60249 2.88071C8.70796 2.77538 8.85092 2.71621 8.99999 2.71621C9.14905 2.71621 9.29202 2.77538 9.39749 2.88071L15.915 9.39821C15.9669 9.45191 16.029 9.49474 16.0976 9.52418C16.1663 9.55363 16.2401 9.56911 16.3148 9.56973C16.3895 9.57034 16.4635 9.55607 16.5326 9.52776C16.6018 9.49944 16.6645 9.45764 16.7173 9.4048C16.7701 9.35196 16.8119 9.28914 16.8401 9.22C16.8684 9.15086 16.8826 9.07678 16.8819 9.00209C16.8812 8.92741 16.8656 8.8536 16.8361 8.78499C16.8066 8.71638 16.7637 8.65433 16.71 8.60246L10.1932 2.08496C10.0365 1.92826 9.85051 1.80396 9.64577 1.71915C9.44103 1.63435 9.22159 1.5907 8.99999 1.5907C8.77838 1.5907 8.55894 1.63435 8.3542 1.71915C8.14947 1.80396 7.96344 1.92826 7.80674 2.08496L1.28924 8.60246C1.23554 8.65438 1.19272 8.71647 1.16327 8.78511C1.13382 8.85375 1.11834 8.92757 1.11773 9.00225C1.11711 9.07694 1.13138 9.15101 1.15969 9.22012C1.18801 9.28924 1.22981 9.35202 1.28265 9.40481C1.33549 9.4576 1.39831 9.49934 1.46745 9.52759C1.53659 9.55584 1.61067 9.57004 1.68536 9.56935C1.76005 9.56867 1.83385 9.55312 1.90246 9.5236C1.97108 9.49409 2.03312 9.45121 2.08499 9.39746L8.60249 2.88071Z",
|
|
564
|
+
fill: "currentColor"
|
|
565
|
+
}
|
|
566
|
+
),
|
|
567
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
568
|
+
"path",
|
|
569
|
+
{
|
|
570
|
+
d: "M9 4.07397L15.1193 10.1932C15.1418 10.2157 15.1643 10.2367 15.1875 10.2577V14.9062C15.1875 15.6825 14.5575 16.3125 13.7812 16.3125H11.25C11.1008 16.3125 10.9577 16.2532 10.8523 16.1477C10.7468 16.0422 10.6875 15.8992 10.6875 15.75V12.375C10.6875 12.2258 10.6282 12.0827 10.5227 11.9772C10.4173 11.8717 10.2742 11.8125 10.125 11.8125H7.875C7.72582 11.8125 7.58274 11.8717 7.47725 11.9772C7.37176 12.0827 7.3125 12.2258 7.3125 12.375V15.75C7.3125 15.8992 7.25324 16.0422 7.14775 16.1477C7.04226 16.2532 6.89918 16.3125 6.75 16.3125H4.21875C3.84579 16.3125 3.4881 16.1643 3.22438 15.9006C2.96066 15.6369 2.8125 15.2792 2.8125 14.9062V10.2577C2.83583 10.2369 2.85859 10.2153 2.88075 10.1932L9 4.07397Z",
|
|
571
|
+
fill: "currentColor"
|
|
572
|
+
}
|
|
573
|
+
)
|
|
574
|
+
]
|
|
575
|
+
}
|
|
576
|
+
);
|
|
577
|
+
},
|
|
547
578
|
// ----------------------------------- old ---------------------------------
|
|
548
579
|
// ** Status **
|
|
549
580
|
plus: ({ className, fill }) => {
|
|
@@ -1000,43 +1031,6 @@ var template = {
|
|
|
1000
1031
|
// );
|
|
1001
1032
|
// },
|
|
1002
1033
|
// ** Common **
|
|
1003
|
-
home: ({ className, fill }) => {
|
|
1004
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1005
|
-
"svg",
|
|
1006
|
-
{
|
|
1007
|
-
width: "24",
|
|
1008
|
-
height: "24",
|
|
1009
|
-
viewBox: "0 0 24 24",
|
|
1010
|
-
fill: "none",
|
|
1011
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1012
|
-
className,
|
|
1013
|
-
children: fill ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
1014
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1015
|
-
"path",
|
|
1016
|
-
{
|
|
1017
|
-
d: "M11.4699 3.84111C11.6106 3.70066 11.8012 3.62177 11.9999 3.62177C12.1987 3.62177 12.3893 3.70066 12.5299 3.84111L21.2199 12.5311C21.2892 12.6027 21.3719 12.6598 21.4635 12.6991C21.555 12.7383 21.6534 12.759 21.753 12.7598C21.8526 12.7606 21.9513 12.7416 22.0435 12.7038C22.1356 12.6661 22.2194 12.6104 22.2897 12.5399C22.3601 12.4694 22.4158 12.3857 22.4534 12.2935C22.4911 12.2013 22.51 12.1025 22.5091 12.003C22.5082 11.9034 22.4875 11.805 22.4481 11.7135C22.4088 11.622 22.3516 11.5393 22.2799 11.4701L13.5909 2.78011C13.382 2.57118 13.134 2.40544 12.861 2.29237C12.588 2.17929 12.2954 2.12109 11.9999 2.12109C11.7045 2.12109 11.4119 2.17929 11.1389 2.29237C10.8659 2.40544 10.6179 2.57118 10.4089 2.78011L1.71894 11.4701C1.64734 11.5393 1.59025 11.6221 1.55098 11.7136C1.51172 11.8052 1.49108 11.9036 1.49026 12.0032C1.48944 12.1028 1.50846 12.2015 1.54622 12.2937C1.58397 12.3858 1.6397 12.4695 1.71015 12.5399C1.78061 12.6103 1.86437 12.6659 1.95656 12.7036C2.04875 12.7413 2.14752 12.7602 2.2471 12.7593C2.34669 12.7584 2.44509 12.7377 2.53658 12.6983C2.62806 12.659 2.71079 12.6018 2.77994 12.5301L11.4699 3.84111Z",
|
|
1018
|
-
fill: "currentColor"
|
|
1019
|
-
}
|
|
1020
|
-
),
|
|
1021
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1022
|
-
"path",
|
|
1023
|
-
{
|
|
1024
|
-
d: "M12 5.43213L20.159 13.5911C20.189 13.6211 20.219 13.6491 20.25 13.6771V19.8751C20.25 20.9101 19.41 21.7501 18.375 21.7501H15C14.8011 21.7501 14.6103 21.6711 14.4697 21.5305C14.329 21.3898 14.25 21.199 14.25 21.0001V16.5001C14.25 16.3012 14.171 16.1105 14.0303 15.9698C13.8897 15.8291 13.6989 15.7501 13.5 15.7501H10.5C10.3011 15.7501 10.1103 15.8291 9.96967 15.9698C9.82902 16.1105 9.75 16.3012 9.75 16.5001V21.0001C9.75 21.199 9.67098 21.3898 9.53033 21.5305C9.38968 21.6711 9.19891 21.7501 9 21.7501H5.625C5.12772 21.7501 4.65081 21.5526 4.29917 21.201C3.94754 20.8493 3.75 20.3724 3.75 19.8751V13.6771C3.78111 13.6493 3.81146 13.6206 3.841 13.5911L12 5.43213Z",
|
|
1025
|
-
fill: "currentColor"
|
|
1026
|
-
}
|
|
1027
|
-
)
|
|
1028
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1029
|
-
"path",
|
|
1030
|
-
{
|
|
1031
|
-
d: "M2.25 12.0001L11.204 3.04507C11.644 2.60607 12.356 2.60607 12.795 3.04507L21.75 12.0001M4.5 9.75007V19.8751C4.5 20.4961 5.004 21.0001 5.625 21.0001H9.75V16.1251C9.75 15.5041 10.254 15.0001 10.875 15.0001H13.125C13.746 15.0001 14.25 15.5041 14.25 16.1251V21.0001H18.375C18.996 21.0001 19.5 20.4961 19.5 19.8751V9.75007M8.25 21.0001H16.5",
|
|
1032
|
-
stroke: "currentColor",
|
|
1033
|
-
strokeLinecap: "round",
|
|
1034
|
-
strokeLinejoin: "round"
|
|
1035
|
-
}
|
|
1036
|
-
)
|
|
1037
|
-
}
|
|
1038
|
-
);
|
|
1039
|
-
},
|
|
1040
1034
|
camera: ({ className, fill }) => {
|
|
1041
1035
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1042
1036
|
"svg",
|
|
@@ -4648,7 +4642,7 @@ var backdropStyle = tv({
|
|
|
4648
4642
|
});
|
|
4649
4643
|
|
|
4650
4644
|
// src/components/breadcrumb/breadcrumb.tsx
|
|
4651
|
-
var
|
|
4645
|
+
var import_react8 = require("react");
|
|
4652
4646
|
|
|
4653
4647
|
// src/components/icon/Icon.tsx
|
|
4654
4648
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -4678,78 +4672,8 @@ var Icon = ({ name, size = "md", fill = false, className, onClick, ...props }) =
|
|
|
4678
4672
|
};
|
|
4679
4673
|
var Icon_default = Icon;
|
|
4680
4674
|
|
|
4681
|
-
// src/components/breadcrumb/breadcrumb.tsx
|
|
4682
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4683
|
-
var BreadcrumbMenu = (0, import_react3.forwardRef)(({ label, onClick, isCurrent, size }, ref) => {
|
|
4684
|
-
const slots = (0, import_react3.useMemo)(() => breadcrumbStyle({ size }), [size]);
|
|
4685
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4686
|
-
"span",
|
|
4687
|
-
{
|
|
4688
|
-
ref,
|
|
4689
|
-
onClick,
|
|
4690
|
-
className: `${slots.content()} ${isCurrent ? "text-primary-main underline" : ""}`,
|
|
4691
|
-
"aria-current": isCurrent ? "page" : void 0,
|
|
4692
|
-
children: label
|
|
4693
|
-
}
|
|
4694
|
-
);
|
|
4695
|
-
});
|
|
4696
|
-
var Breadcrumb = (0, import_react3.forwardRef)(({ startIconName, size, menus, classNames }, ref) => {
|
|
4697
|
-
const slots = (0, import_react3.useMemo)(() => breadcrumbStyle({ size }), [size]);
|
|
4698
|
-
const renderMenus = (menus2) => menus2.map((menu, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center gap-[5px]", children: [
|
|
4699
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BreadcrumbMenu, { label: menu.label, onClick: menu.onClick, isCurrent: !menu.children, size }),
|
|
4700
|
-
menu.children ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
4701
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: "right", className: slots.separator() }),
|
|
4702
|
-
renderMenus(menu.children)
|
|
4703
|
-
] }) : index !== menus2.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: "right", className: slots.separator() })
|
|
4704
|
-
] }, `${menu.label}-${index}`));
|
|
4705
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ul", { className: "flex items-center gap-1", children: [
|
|
4706
|
-
startIconName && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { name: startIconName, fill: true, size, className: `${slots.icon()}` }) }),
|
|
4707
|
-
renderMenus(menus)
|
|
4708
|
-
] }) });
|
|
4709
|
-
});
|
|
4710
|
-
Breadcrumb.displayName = "Breadcrumb";
|
|
4711
|
-
var breadcrumb_default = Breadcrumb;
|
|
4712
|
-
var breadcrumbStyle = tv({
|
|
4713
|
-
slots: {
|
|
4714
|
-
base: ["flex", "items-center"],
|
|
4715
|
-
content: [
|
|
4716
|
-
"text-neutral-main",
|
|
4717
|
-
"flex",
|
|
4718
|
-
"items-center",
|
|
4719
|
-
"hover:underline",
|
|
4720
|
-
"cursor-pointer",
|
|
4721
|
-
"[line-height:initial]"
|
|
4722
|
-
],
|
|
4723
|
-
icon: ["fill-primary-main", "text-primary-main", "stroke-primary-main"],
|
|
4724
|
-
separator: ["stroke-neutral-main"]
|
|
4725
|
-
},
|
|
4726
|
-
variants: {
|
|
4727
|
-
size: {
|
|
4728
|
-
sm: {
|
|
4729
|
-
base: "text-sm",
|
|
4730
|
-
separator: "w-[18px] h-[18px]"
|
|
4731
|
-
},
|
|
4732
|
-
md: {
|
|
4733
|
-
base: "text-md",
|
|
4734
|
-
separator: "w-[21px] h-[21px]"
|
|
4735
|
-
},
|
|
4736
|
-
lg: {
|
|
4737
|
-
base: "text-lg",
|
|
4738
|
-
separator: "w-[24px] h-[24px]"
|
|
4739
|
-
},
|
|
4740
|
-
xl: {
|
|
4741
|
-
base: "text-xl",
|
|
4742
|
-
separator: "w-[27px] h-[27px]"
|
|
4743
|
-
}
|
|
4744
|
-
}
|
|
4745
|
-
},
|
|
4746
|
-
defaultVariants: {
|
|
4747
|
-
size: "md"
|
|
4748
|
-
}
|
|
4749
|
-
});
|
|
4750
|
-
|
|
4751
4675
|
// src/components/button/button.tsx
|
|
4752
|
-
var
|
|
4676
|
+
var import_react4 = __toESM(require("react"));
|
|
4753
4677
|
|
|
4754
4678
|
// src/utils/props.ts
|
|
4755
4679
|
var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
|
|
@@ -4773,12 +4697,12 @@ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
|
|
|
4773
4697
|
|
|
4774
4698
|
// src/components/ripple/ripple.tsx
|
|
4775
4699
|
var import_framer_motion = require("framer-motion");
|
|
4776
|
-
var
|
|
4700
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4777
4701
|
var Ripple = (props) => {
|
|
4778
4702
|
const { ripples = [], motionProps, color = "currentColor", style, onClear } = props;
|
|
4779
|
-
return /* @__PURE__ */ (0,
|
|
4703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: ripples.map((ripple) => {
|
|
4780
4704
|
const duration = (0, import_framer_motion.clamp)(ripple.size > 100 ? 0.75 : 0.5, 0.01 * ripple.size, 0.2);
|
|
4781
|
-
return /* @__PURE__ */ (0,
|
|
4705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_framer_motion.LazyMotion, { features: import_framer_motion.domAnimation, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_framer_motion.AnimatePresence, { mode: "popLayout", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
4782
4706
|
import_framer_motion.m.span,
|
|
4783
4707
|
{
|
|
4784
4708
|
animate: { transform: "scale(2)", opacity: 0 },
|
|
@@ -4813,11 +4737,11 @@ Ripple.displayName = "HeroUI.Ripple";
|
|
|
4813
4737
|
var ripple_default = Ripple;
|
|
4814
4738
|
|
|
4815
4739
|
// src/components/ripple/useRipple.ts
|
|
4816
|
-
var
|
|
4740
|
+
var import_react3 = require("react");
|
|
4817
4741
|
function useRipple(props = {}) {
|
|
4818
|
-
const [ripples, setRipples] = (0,
|
|
4742
|
+
const [ripples, setRipples] = (0, import_react3.useState)([]);
|
|
4819
4743
|
const getUniqueID = (key) => `${key}-${Math.random().toString(36).substr(2, 9)}`;
|
|
4820
|
-
const onPress = (0,
|
|
4744
|
+
const onPress = (0, import_react3.useCallback)((event) => {
|
|
4821
4745
|
const trigger = event.target;
|
|
4822
4746
|
const rect = trigger.getBoundingClientRect();
|
|
4823
4747
|
const size = Math.max(trigger.clientWidth, trigger.clientHeight);
|
|
@@ -4831,27 +4755,27 @@ function useRipple(props = {}) {
|
|
|
4831
4755
|
}
|
|
4832
4756
|
]);
|
|
4833
4757
|
}, []);
|
|
4834
|
-
const onClear = (0,
|
|
4758
|
+
const onClear = (0, import_react3.useCallback)((key) => {
|
|
4835
4759
|
setRipples((prevState) => prevState.filter((ripple) => ripple.key !== key));
|
|
4836
4760
|
}, []);
|
|
4837
4761
|
return { ripples, onClear, onPress, ...props };
|
|
4838
4762
|
}
|
|
4839
4763
|
|
|
4840
4764
|
// src/components/button/button.tsx
|
|
4841
|
-
var
|
|
4842
|
-
var Button = (0,
|
|
4765
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4766
|
+
var Button = (0, import_react4.forwardRef)((originalProps, ref) => {
|
|
4843
4767
|
const [props, variantProps] = mapPropsVariants(originalProps, buttonStyle.variantKeys);
|
|
4844
4768
|
const { classNames, startContent, endContent, disableRipple, children, ...buttonProps } = props;
|
|
4845
|
-
const slots = (0,
|
|
4769
|
+
const slots = (0, import_react4.useMemo)(() => buttonStyle({ ...variantProps }), [variantProps]);
|
|
4846
4770
|
const { onPress: onRipplePressHandler, onClear: onClearRipple, ripples } = useRipple();
|
|
4847
|
-
const handlePress = (0,
|
|
4771
|
+
const handlePress = (0, import_react4.useCallback)(
|
|
4848
4772
|
(e) => {
|
|
4849
4773
|
if (disableRipple || originalProps.isDisabled) return;
|
|
4850
4774
|
onRipplePressHandler(e);
|
|
4851
4775
|
},
|
|
4852
4776
|
[disableRipple, originalProps.isDisabled, ref, onRipplePressHandler]
|
|
4853
4777
|
);
|
|
4854
|
-
const mouseDownHandler = (0,
|
|
4778
|
+
const mouseDownHandler = (0, import_react4.useCallback)(
|
|
4855
4779
|
(e) => {
|
|
4856
4780
|
var _a;
|
|
4857
4781
|
(_a = buttonProps.onMouseDown) == null ? void 0 : _a.call(buttonProps, e);
|
|
@@ -4860,11 +4784,11 @@ var Button = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
4860
4784
|
},
|
|
4861
4785
|
[buttonProps.onMouseDown, disableRipple, originalProps.isDisabled, ref, onRipplePressHandler]
|
|
4862
4786
|
);
|
|
4863
|
-
const getRippleProps = (0,
|
|
4787
|
+
const getRippleProps = (0, import_react4.useCallback)(
|
|
4864
4788
|
() => ({ ripples, onClear: onClearRipple }),
|
|
4865
4789
|
[ripples, onClearRipple]
|
|
4866
4790
|
);
|
|
4867
|
-
const getBaseProps = (0,
|
|
4791
|
+
const getBaseProps = (0, import_react4.useCallback)(
|
|
4868
4792
|
() => ({
|
|
4869
4793
|
...buttonProps,
|
|
4870
4794
|
onMouseDown: mouseDownHandler,
|
|
@@ -4875,7 +4799,7 @@ var Button = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
4875
4799
|
}),
|
|
4876
4800
|
[buttonProps, ref, originalProps.isDisabled, originalProps.isLoading, slots, classNames == null ? void 0 : classNames.base]
|
|
4877
4801
|
);
|
|
4878
|
-
const getContentProps = (0,
|
|
4802
|
+
const getContentProps = (0, import_react4.useCallback)(
|
|
4879
4803
|
() => ({
|
|
4880
4804
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
4881
4805
|
size: originalProps.size
|
|
@@ -4883,24 +4807,24 @@ var Button = (0, import_react5.forwardRef)((originalProps, ref) => {
|
|
|
4883
4807
|
[slots, classNames, originalProps.size]
|
|
4884
4808
|
);
|
|
4885
4809
|
const renderContent = (content) => {
|
|
4886
|
-
if (
|
|
4810
|
+
if (import_react4.default.isValidElement(content)) {
|
|
4887
4811
|
const _content = content;
|
|
4888
4812
|
const existingProps = _content.props;
|
|
4889
4813
|
const mergedProps = {
|
|
4890
4814
|
...getContentProps(),
|
|
4891
4815
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
4892
4816
|
};
|
|
4893
|
-
return
|
|
4817
|
+
return import_react4.default.cloneElement(content, mergedProps);
|
|
4894
4818
|
} else {
|
|
4895
4819
|
const contentProps = getContentProps();
|
|
4896
|
-
return /* @__PURE__ */ (0,
|
|
4820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ...contentProps, children: content });
|
|
4897
4821
|
}
|
|
4898
4822
|
};
|
|
4899
|
-
return /* @__PURE__ */ (0,
|
|
4823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { ...getBaseProps(), children: originalProps.isLoading ? renderContent(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon_default, { name: "loading", className: "animate-spin" })) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4900
4824
|
startContent && renderContent(startContent),
|
|
4901
4825
|
children,
|
|
4902
4826
|
endContent && renderContent(endContent),
|
|
4903
|
-
!disableRipple && /* @__PURE__ */ (0,
|
|
4827
|
+
!disableRipple && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ripple_default, { ...getRippleProps() })
|
|
4904
4828
|
] }) });
|
|
4905
4829
|
});
|
|
4906
4830
|
Button.displayName = "Button";
|
|
@@ -5229,168 +5153,736 @@ var buttonStyle = tv({
|
|
|
5229
5153
|
]
|
|
5230
5154
|
});
|
|
5231
5155
|
|
|
5232
|
-
// src/components/button/button
|
|
5233
|
-
var
|
|
5234
|
-
var
|
|
5235
|
-
var
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
disabled: props.isDisabled,
|
|
5241
|
-
isInGroup: true
|
|
5242
|
-
});
|
|
5243
|
-
}) });
|
|
5244
|
-
});
|
|
5245
|
-
ButtonGroup.displayName = "ButtonGroup";
|
|
5246
|
-
var button_group_default = ButtonGroup;
|
|
5247
|
-
var buttonGroup = tv({
|
|
5248
|
-
base: "flex"
|
|
5249
|
-
});
|
|
5250
|
-
|
|
5251
|
-
// src/components/input/input.tsx
|
|
5252
|
-
var import_react7 = __toESM(require("react"));
|
|
5253
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
5254
|
-
var Input = (0, import_react7.forwardRef)((originalProps, ref) => {
|
|
5255
|
-
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
5256
|
-
const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
|
|
5257
|
-
const inputRef = (0, import_react7.useRef)(null);
|
|
5258
|
-
const slots = (0, import_react7.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
5259
|
-
const getContentProps = (0, import_react7.useCallback)(
|
|
5260
|
-
() => ({
|
|
5261
|
-
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
5262
|
-
size: originalProps.size
|
|
5263
|
-
}),
|
|
5264
|
-
[slots, classNames, originalProps.size]
|
|
5265
|
-
);
|
|
5266
|
-
const renderStartContent = () => {
|
|
5267
|
-
if (import_react7.default.isValidElement(startContent)) {
|
|
5268
|
-
const existingProps = startContent.props;
|
|
5269
|
-
const mergedProps = {
|
|
5270
|
-
...getContentProps(),
|
|
5271
|
-
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5272
|
-
};
|
|
5273
|
-
return import_react7.default.cloneElement(startContent, mergedProps);
|
|
5274
|
-
} else {
|
|
5275
|
-
const contentProps = getContentProps();
|
|
5276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ...contentProps, children: startContent });
|
|
5277
|
-
}
|
|
5156
|
+
// src/components/button/icon-button.tsx
|
|
5157
|
+
var import_react5 = require("react");
|
|
5158
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
5159
|
+
var IconButton = (0, import_react5.forwardRef)((props, ref) => {
|
|
5160
|
+
const [localProps, variantProps] = mapPropsVariants(props, iconButtonStyle.variantKeys);
|
|
5161
|
+
const { classNames, iconName, disableRipple, isDisabled, isLoading, size, onMouseDown, ...buttonProps } = {
|
|
5162
|
+
...localProps,
|
|
5163
|
+
...variantProps
|
|
5278
5164
|
};
|
|
5279
|
-
const
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { name: props.type === "time" ? "clock" : "calendar", size: originalProps.size, className: "cursor-pointer" })
|
|
5289
|
-
}
|
|
5165
|
+
const slots = (0, import_react5.useMemo)(() => iconButtonStyle({ ...variantProps }), [variantProps]);
|
|
5166
|
+
const { onPress, onClear, ripples } = useRipple();
|
|
5167
|
+
const handleRipple = (0, import_react5.useCallback)(
|
|
5168
|
+
(e) => {
|
|
5169
|
+
if (!disableRipple && !isDisabled) {
|
|
5170
|
+
onPress(e);
|
|
5171
|
+
}
|
|
5172
|
+
},
|
|
5173
|
+
[disableRipple, isDisabled, onPress]
|
|
5290
5174
|
);
|
|
5291
|
-
const
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
5302
|
-
} else {
|
|
5303
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, {});
|
|
5304
|
-
}
|
|
5305
|
-
};
|
|
5306
|
-
const renderEndContent = () => {
|
|
5307
|
-
switch (props.type) {
|
|
5308
|
-
case "date":
|
|
5309
|
-
case "datetime-local":
|
|
5310
|
-
case "month":
|
|
5311
|
-
case "week":
|
|
5312
|
-
case "time":
|
|
5313
|
-
return renderDateTimePickerIcon();
|
|
5314
|
-
default:
|
|
5315
|
-
return renderContentWithIcon();
|
|
5316
|
-
}
|
|
5317
|
-
};
|
|
5318
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
5319
|
-
"div",
|
|
5175
|
+
const handleMouseDown = (0, import_react5.useCallback)(
|
|
5176
|
+
(e) => {
|
|
5177
|
+
onMouseDown == null ? void 0 : onMouseDown(e);
|
|
5178
|
+
handleRipple(e);
|
|
5179
|
+
},
|
|
5180
|
+
[onMouseDown, handleRipple]
|
|
5181
|
+
);
|
|
5182
|
+
const rippleProps = (0, import_react5.useMemo)(() => ({ ripples, onClear }), [ripples, onClear]);
|
|
5183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
5184
|
+
"button",
|
|
5320
5185
|
{
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
className: clsx(
|
|
5332
|
-
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
5333
|
-
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
5334
|
-
),
|
|
5335
|
-
children: [
|
|
5336
|
-
startContent && renderStartContent(),
|
|
5337
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
|
|
5338
|
-
renderEndContent()
|
|
5339
|
-
]
|
|
5340
|
-
}
|
|
5341
|
-
),
|
|
5342
|
-
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
5343
|
-
errorText && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
5344
|
-
] })
|
|
5345
|
-
]
|
|
5186
|
+
...buttonProps,
|
|
5187
|
+
onMouseDown: handleMouseDown,
|
|
5188
|
+
ref,
|
|
5189
|
+
disabled: isDisabled || isLoading,
|
|
5190
|
+
"data-loading": isLoading,
|
|
5191
|
+
className: slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5192
|
+
children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: "loading", size, className: "animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
5193
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon_default, { name: iconName, size }),
|
|
5194
|
+
!disableRipple && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ripple_default, { ...rippleProps })
|
|
5195
|
+
] })
|
|
5346
5196
|
}
|
|
5347
5197
|
);
|
|
5348
5198
|
});
|
|
5349
|
-
|
|
5350
|
-
var
|
|
5351
|
-
var
|
|
5352
|
-
{
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
],
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5199
|
+
IconButton.displayName = "IconButton";
|
|
5200
|
+
var icon_button_default = IconButton;
|
|
5201
|
+
var iconButtonStyle = tv({
|
|
5202
|
+
slots: {
|
|
5203
|
+
base: [
|
|
5204
|
+
"relative",
|
|
5205
|
+
"flex",
|
|
5206
|
+
"items-center",
|
|
5207
|
+
"justify-center",
|
|
5208
|
+
"whitespace-nowrap",
|
|
5209
|
+
"transition",
|
|
5210
|
+
"duration-200",
|
|
5211
|
+
"select-none",
|
|
5212
|
+
"overflow-hidden",
|
|
5213
|
+
"box-border"
|
|
5214
|
+
]
|
|
5215
|
+
},
|
|
5216
|
+
variants: {
|
|
5217
|
+
variant: {
|
|
5218
|
+
solid: [],
|
|
5219
|
+
soft: [],
|
|
5220
|
+
outline: [],
|
|
5221
|
+
ghost: []
|
|
5222
|
+
},
|
|
5223
|
+
color: {
|
|
5224
|
+
primary: [],
|
|
5225
|
+
secondary: [],
|
|
5226
|
+
neutral: [],
|
|
5227
|
+
info: [],
|
|
5228
|
+
success: [],
|
|
5229
|
+
warning: [],
|
|
5230
|
+
danger: []
|
|
5231
|
+
},
|
|
5232
|
+
size: {
|
|
5233
|
+
sm: {
|
|
5234
|
+
base: ["w-[24px]", "h-[24px]", "rounded-sm"]
|
|
5235
|
+
},
|
|
5236
|
+
md: {
|
|
5237
|
+
base: ["w-[32px]", "h-[32px]", "rounded-md"]
|
|
5238
|
+
},
|
|
5239
|
+
lg: {
|
|
5240
|
+
base: ["w-[40px]", "h-[40px]", "rounded-lg"]
|
|
5241
|
+
},
|
|
5242
|
+
xl: {
|
|
5243
|
+
base: ["w-[50px]", "h-[50px]", "rounded-xl"]
|
|
5244
|
+
}
|
|
5245
|
+
},
|
|
5246
|
+
isLoading: {
|
|
5247
|
+
true: {}
|
|
5248
|
+
},
|
|
5249
|
+
isDisabled: {
|
|
5250
|
+
true: {
|
|
5251
|
+
base: ["!bg-neutral-soft", "!border-neutral-soft", "!text-neutral-light", "pointer-events-none"]
|
|
5252
|
+
}
|
|
5253
|
+
},
|
|
5254
|
+
isInGroup: {
|
|
5255
|
+
true: {
|
|
5256
|
+
base: ["[&:not(:first-child):not(:last-child)]:rounded-none", "first:rounded-r-none", "last:rounded-l-none"]
|
|
5257
|
+
}
|
|
5258
|
+
}
|
|
5259
|
+
},
|
|
5260
|
+
compoundVariants: [
|
|
5261
|
+
{
|
|
5262
|
+
variant: "solid",
|
|
5263
|
+
color: "primary",
|
|
5264
|
+
class: {
|
|
5265
|
+
base: ["text-white", "bg-primary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5266
|
+
}
|
|
5267
|
+
},
|
|
5268
|
+
{
|
|
5269
|
+
variant: "solid",
|
|
5270
|
+
color: "secondary",
|
|
5271
|
+
class: {
|
|
5272
|
+
base: ["text-white", "bg-secondary-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5273
|
+
}
|
|
5274
|
+
},
|
|
5275
|
+
{
|
|
5276
|
+
variant: "solid",
|
|
5277
|
+
color: "neutral",
|
|
5278
|
+
class: {
|
|
5279
|
+
base: ["text-white", "bg-neutral-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5280
|
+
}
|
|
5281
|
+
},
|
|
5282
|
+
{
|
|
5283
|
+
variant: "solid",
|
|
5284
|
+
color: "info",
|
|
5285
|
+
class: {
|
|
5286
|
+
base: ["text-white", "bg-info-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5287
|
+
}
|
|
5288
|
+
},
|
|
5289
|
+
{
|
|
5290
|
+
variant: "solid",
|
|
5291
|
+
color: "success",
|
|
5292
|
+
class: {
|
|
5293
|
+
base: ["text-white", "bg-success-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5294
|
+
}
|
|
5295
|
+
},
|
|
5296
|
+
{
|
|
5297
|
+
variant: "solid",
|
|
5298
|
+
color: "warning",
|
|
5299
|
+
class: {
|
|
5300
|
+
base: ["text-white", "bg-warning-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5301
|
+
}
|
|
5302
|
+
},
|
|
5303
|
+
{
|
|
5304
|
+
variant: "solid",
|
|
5305
|
+
color: "danger",
|
|
5306
|
+
class: {
|
|
5307
|
+
base: ["text-white", "bg-danger-main", "hover:bg-gradient-to-t", "hover:from-white/20", "hover:to-white/20"]
|
|
5308
|
+
}
|
|
5309
|
+
},
|
|
5310
|
+
// soft
|
|
5311
|
+
{
|
|
5312
|
+
variant: "soft",
|
|
5313
|
+
color: "primary",
|
|
5314
|
+
class: {
|
|
5315
|
+
base: ["text-primary-main", "bg-primary-soft", "!border-primary-soft", "hover:!border-primary-light"]
|
|
5316
|
+
}
|
|
5317
|
+
},
|
|
5318
|
+
{
|
|
5319
|
+
variant: "soft",
|
|
5320
|
+
color: "secondary",
|
|
5321
|
+
class: {
|
|
5322
|
+
base: ["text-secondary-main", "bg-secondary-soft", "!border-secondary-soft", "hover:!border-secondary-light"]
|
|
5323
|
+
}
|
|
5324
|
+
},
|
|
5325
|
+
{
|
|
5326
|
+
variant: "soft",
|
|
5327
|
+
color: "neutral",
|
|
5328
|
+
class: {
|
|
5329
|
+
base: ["text-neutral-main", "bg-neutral-soft", "!border-neutral-soft", "hover:!border-neutral-light"]
|
|
5330
|
+
}
|
|
5331
|
+
},
|
|
5332
|
+
{
|
|
5333
|
+
variant: "soft",
|
|
5334
|
+
color: "info",
|
|
5335
|
+
class: {
|
|
5336
|
+
base: ["text-info-main", "bg-info-soft", "!border-info-soft", "hover:!border-info-light"]
|
|
5337
|
+
}
|
|
5338
|
+
},
|
|
5339
|
+
{
|
|
5340
|
+
variant: "soft",
|
|
5341
|
+
color: "success",
|
|
5342
|
+
class: {
|
|
5343
|
+
base: ["text-success-main", "bg-success-soft", "!border-success-soft", "hover:!border-success-light"]
|
|
5344
|
+
}
|
|
5345
|
+
},
|
|
5346
|
+
{
|
|
5347
|
+
variant: "soft",
|
|
5348
|
+
color: "warning",
|
|
5349
|
+
class: {
|
|
5350
|
+
base: ["text-warning-main", "bg-warning-soft", "!border-warning-soft", "hover:!border-warning-light"]
|
|
5351
|
+
}
|
|
5352
|
+
},
|
|
5353
|
+
{
|
|
5354
|
+
variant: "soft",
|
|
5355
|
+
color: "danger",
|
|
5356
|
+
class: {
|
|
5357
|
+
base: ["text-danger-main", "bg-danger-soft", "!border-danger-soft", "hover:!border-danger-light"]
|
|
5358
|
+
}
|
|
5359
|
+
},
|
|
5360
|
+
// outline
|
|
5361
|
+
{
|
|
5362
|
+
variant: "outline",
|
|
5363
|
+
color: "primary",
|
|
5364
|
+
class: {
|
|
5365
|
+
base: ["bg-transparent", "!border-primary-main", "text-primary-main", "hover:bg-primary-soft"]
|
|
5366
|
+
}
|
|
5367
|
+
},
|
|
5368
|
+
{
|
|
5369
|
+
variant: "outline",
|
|
5370
|
+
color: "secondary",
|
|
5371
|
+
class: {
|
|
5372
|
+
base: ["bg-transparent", "!border-secondary-main", "text-secondary-main", "hover:bg-secondary-soft"]
|
|
5373
|
+
}
|
|
5374
|
+
},
|
|
5375
|
+
{
|
|
5376
|
+
variant: "outline",
|
|
5377
|
+
color: "neutral",
|
|
5378
|
+
class: {
|
|
5379
|
+
base: ["bg-transparent", "!border-neutral-main", "text-neutral-main", "hover:bg-neutral-soft"]
|
|
5380
|
+
}
|
|
5381
|
+
},
|
|
5382
|
+
{
|
|
5383
|
+
variant: "outline",
|
|
5384
|
+
color: "info",
|
|
5385
|
+
class: {
|
|
5386
|
+
base: ["bg-transparent", "!border-info-main", "text-info-main", "hover:bg-info-soft"]
|
|
5387
|
+
}
|
|
5388
|
+
},
|
|
5389
|
+
{
|
|
5390
|
+
variant: "outline",
|
|
5391
|
+
color: "success",
|
|
5392
|
+
class: {
|
|
5393
|
+
base: ["bg-transparent", "!border-success-main", "text-success-main", "hover:bg-success-soft"]
|
|
5394
|
+
}
|
|
5395
|
+
},
|
|
5396
|
+
{
|
|
5397
|
+
variant: "outline",
|
|
5398
|
+
color: "warning",
|
|
5399
|
+
class: {
|
|
5400
|
+
base: ["bg-transparent", "!border-warning-main", "text-warning-main", "hover:bg-warning-soft"]
|
|
5401
|
+
}
|
|
5402
|
+
},
|
|
5403
|
+
{
|
|
5404
|
+
variant: "outline",
|
|
5405
|
+
color: "danger",
|
|
5406
|
+
class: {
|
|
5407
|
+
base: ["bg-transparent", "!border-danger-main", "text-danger-main", "hover:bg-danger-soft"]
|
|
5408
|
+
}
|
|
5409
|
+
},
|
|
5410
|
+
// ghost
|
|
5411
|
+
{
|
|
5412
|
+
variant: "ghost",
|
|
5413
|
+
color: "primary",
|
|
5414
|
+
class: {
|
|
5415
|
+
base: ["text-primary-main", "border-transparent", "hover:bg-primary-soft"]
|
|
5416
|
+
}
|
|
5417
|
+
},
|
|
5418
|
+
{
|
|
5419
|
+
variant: "ghost",
|
|
5420
|
+
color: "secondary",
|
|
5421
|
+
class: {
|
|
5422
|
+
base: ["text-secondary-main", "border-transparent", "hover:bg-secondary-soft"]
|
|
5423
|
+
}
|
|
5424
|
+
},
|
|
5425
|
+
{
|
|
5426
|
+
variant: "ghost",
|
|
5427
|
+
color: "neutral",
|
|
5428
|
+
class: {
|
|
5429
|
+
base: ["text-neutral-main", "border-transparent", "hover:bg-neutral-soft"]
|
|
5430
|
+
}
|
|
5431
|
+
},
|
|
5432
|
+
{
|
|
5433
|
+
variant: "ghost",
|
|
5434
|
+
color: "info",
|
|
5435
|
+
class: {
|
|
5436
|
+
base: ["text-info-main", "border-transparent", "hover:bg-info-soft"]
|
|
5437
|
+
}
|
|
5438
|
+
},
|
|
5439
|
+
{
|
|
5440
|
+
variant: "ghost",
|
|
5441
|
+
color: "success",
|
|
5442
|
+
class: {
|
|
5443
|
+
base: ["text-success-main", "border-transparent", "hover:bg-success-soft"]
|
|
5444
|
+
}
|
|
5445
|
+
},
|
|
5446
|
+
{
|
|
5447
|
+
variant: "ghost",
|
|
5448
|
+
color: "warning",
|
|
5449
|
+
class: {
|
|
5450
|
+
base: ["text-warning-main", "border-transparent", "hover:bg-warning-soft"]
|
|
5451
|
+
}
|
|
5452
|
+
},
|
|
5453
|
+
{
|
|
5454
|
+
variant: "ghost",
|
|
5455
|
+
color: "danger",
|
|
5456
|
+
class: {
|
|
5457
|
+
base: ["text-danger-main", "border-transparent", "hover:bg-danger-soft"]
|
|
5458
|
+
}
|
|
5459
|
+
},
|
|
5460
|
+
// soft/outline + size
|
|
5461
|
+
{
|
|
5462
|
+
variant: ["soft", "outline"],
|
|
5463
|
+
size: "sm",
|
|
5464
|
+
class: {
|
|
5465
|
+
base: ["border-sm"]
|
|
5466
|
+
}
|
|
5467
|
+
},
|
|
5468
|
+
{
|
|
5469
|
+
variant: ["soft", "outline"],
|
|
5470
|
+
size: "md",
|
|
5471
|
+
class: {
|
|
5472
|
+
base: ["border-md"]
|
|
5473
|
+
}
|
|
5474
|
+
},
|
|
5475
|
+
{
|
|
5476
|
+
variant: ["soft", "outline"],
|
|
5477
|
+
size: "lg",
|
|
5478
|
+
class: {
|
|
5479
|
+
base: ["border-lg"]
|
|
5480
|
+
}
|
|
5481
|
+
},
|
|
5482
|
+
{
|
|
5483
|
+
variant: ["soft", "outline"],
|
|
5484
|
+
size: "xl",
|
|
5485
|
+
class: {
|
|
5486
|
+
base: ["border-xl"]
|
|
5487
|
+
}
|
|
5488
|
+
},
|
|
5489
|
+
// isDisabled + variant
|
|
5490
|
+
{
|
|
5491
|
+
variant: ["soft", "ghost"],
|
|
5492
|
+
isDisabled: true,
|
|
5493
|
+
class: {
|
|
5494
|
+
base: ["!border-neutral-soft"]
|
|
5495
|
+
}
|
|
5496
|
+
},
|
|
5497
|
+
{
|
|
5498
|
+
variant: ["outline"],
|
|
5499
|
+
isDisabled: true,
|
|
5500
|
+
class: {
|
|
5501
|
+
base: ["!border-neutral-light"]
|
|
5502
|
+
}
|
|
5503
|
+
}
|
|
5504
|
+
],
|
|
5505
|
+
defaultVariants: {
|
|
5506
|
+
size: "md",
|
|
5507
|
+
variant: "solid",
|
|
5508
|
+
color: "primary",
|
|
5509
|
+
fullWidth: false,
|
|
5510
|
+
isDisabled: false,
|
|
5511
|
+
isLoading: false,
|
|
5512
|
+
isInGroup: false
|
|
5513
|
+
}
|
|
5514
|
+
});
|
|
5515
|
+
|
|
5516
|
+
// src/components/button/text-button.tsx
|
|
5517
|
+
var import_react6 = require("react");
|
|
5518
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
5519
|
+
var TextButton = (0, import_react6.forwardRef)((originalProps, ref) => {
|
|
5520
|
+
const [props, variantProps] = mapPropsVariants(originalProps, textButtonStyle.variantKeys);
|
|
5521
|
+
const { children, startContent, endContent, classNames, variant, isDisabled, size, ...buttonProps } = {
|
|
5522
|
+
...props,
|
|
5523
|
+
...variantProps
|
|
5524
|
+
};
|
|
5525
|
+
const slots = (0, import_react6.useMemo)(() => textButtonStyle({ ...variantProps }), [variantProps]);
|
|
5526
|
+
const getContentProps = (0, import_react6.useCallback)(() => {
|
|
5527
|
+
const className = slots.content({ class: classNames == null ? void 0 : classNames.content });
|
|
5528
|
+
return { className, size };
|
|
5529
|
+
}, [slots, classNames, size]);
|
|
5530
|
+
const renderContent = (content) => {
|
|
5531
|
+
const contentProps = getContentProps();
|
|
5532
|
+
if ((0, import_react6.isValidElement)(content)) {
|
|
5533
|
+
const _content = content;
|
|
5534
|
+
const contentProps2 = getContentProps();
|
|
5535
|
+
const mergedProps = {
|
|
5536
|
+
...contentProps2,
|
|
5537
|
+
...typeof _content.props.className === "string" && {
|
|
5538
|
+
className: clsx(contentProps2.className, _content.props.className)
|
|
5539
|
+
}
|
|
5540
|
+
};
|
|
5541
|
+
return (0, import_react6.cloneElement)(_content, mergedProps);
|
|
5542
|
+
}
|
|
5543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ...contentProps, children: content });
|
|
5544
|
+
};
|
|
5545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
5546
|
+
"button",
|
|
5547
|
+
{
|
|
5548
|
+
...buttonProps,
|
|
5549
|
+
ref,
|
|
5550
|
+
disabled: isDisabled,
|
|
5551
|
+
className: clsx(
|
|
5552
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5553
|
+
variant === "underline" && slots.underline({ class: classNames == null ? void 0 : classNames.underline })
|
|
5554
|
+
),
|
|
5555
|
+
children: [
|
|
5556
|
+
startContent && renderContent(startContent),
|
|
5557
|
+
children,
|
|
5558
|
+
endContent && renderContent(endContent)
|
|
5559
|
+
]
|
|
5560
|
+
}
|
|
5561
|
+
);
|
|
5562
|
+
});
|
|
5563
|
+
TextButton.displayName = "TextButton";
|
|
5564
|
+
var text_button_default = TextButton;
|
|
5565
|
+
var textButtonStyle = tv({
|
|
5566
|
+
slots: {
|
|
5567
|
+
base: ["flex", "items-center", "justify-center", "whitespace-nowrap", "overflow-hidden"],
|
|
5568
|
+
content: [],
|
|
5569
|
+
underline: ["underline", "decoration-skip-ink", "underline-offset-[1px]"]
|
|
5570
|
+
},
|
|
5571
|
+
variants: {
|
|
5572
|
+
variant: {
|
|
5573
|
+
"non-under": [],
|
|
5574
|
+
underline: []
|
|
5575
|
+
},
|
|
5576
|
+
color: {
|
|
5577
|
+
primary: [],
|
|
5578
|
+
secondary: [],
|
|
5579
|
+
neutral: []
|
|
5580
|
+
},
|
|
5581
|
+
size: {
|
|
5582
|
+
sm: {
|
|
5583
|
+
base: ["text-sm"],
|
|
5584
|
+
underline: ["decoration-[1px]"]
|
|
5585
|
+
},
|
|
5586
|
+
md: {
|
|
5587
|
+
base: ["text-md"],
|
|
5588
|
+
underline: ["decoration-[1.25px]"]
|
|
5589
|
+
},
|
|
5590
|
+
lg: {
|
|
5591
|
+
base: ["text-lg"],
|
|
5592
|
+
underline: ["decoration-[1.5px]"]
|
|
5593
|
+
},
|
|
5594
|
+
xl: {
|
|
5595
|
+
base: ["text-xl"],
|
|
5596
|
+
underline: ["decoration-[1.75px]"]
|
|
5597
|
+
}
|
|
5598
|
+
},
|
|
5599
|
+
isDisabled: {
|
|
5600
|
+
true: {
|
|
5601
|
+
base: ["!text-neutral-light", "pointer-events-none"]
|
|
5602
|
+
}
|
|
5603
|
+
},
|
|
5604
|
+
isInGroup: {
|
|
5605
|
+
true: {
|
|
5606
|
+
base: ["[&:not(:first-child):not(:last-child)]:rounded-none", "first:rounded-r-none", "last:rounded-l-none"]
|
|
5607
|
+
}
|
|
5608
|
+
}
|
|
5609
|
+
},
|
|
5610
|
+
compoundVariants: [
|
|
5611
|
+
{
|
|
5612
|
+
color: "primary",
|
|
5613
|
+
class: {
|
|
5614
|
+
base: ["text-primary-main", "hover:text-primary-dark", "active:text-primary-strong"]
|
|
5615
|
+
}
|
|
5616
|
+
},
|
|
5617
|
+
{
|
|
5618
|
+
color: "secondary",
|
|
5619
|
+
class: {
|
|
5620
|
+
base: ["text-secondary-main", "hover:text-secondary-dark", "active:text-secondary-strong"]
|
|
5621
|
+
}
|
|
5622
|
+
},
|
|
5623
|
+
{
|
|
5624
|
+
color: "neutral",
|
|
5625
|
+
class: {
|
|
5626
|
+
base: ["text-neutral-main", "hover:text-neutral-dark", "active:text-neutral-strong"]
|
|
5627
|
+
}
|
|
5628
|
+
}
|
|
5629
|
+
],
|
|
5630
|
+
defaultVariants: {
|
|
5631
|
+
size: "md",
|
|
5632
|
+
color: "primary",
|
|
5633
|
+
variant: "non-under",
|
|
5634
|
+
isDisabled: false,
|
|
5635
|
+
isInGroup: false
|
|
5636
|
+
}
|
|
5637
|
+
});
|
|
5638
|
+
|
|
5639
|
+
// src/components/button/button-group.tsx
|
|
5640
|
+
var import_react7 = __toESM(require("react"));
|
|
5641
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
5642
|
+
var ButtonGroup = (0, import_react7.forwardRef)(({ children, ...props }, ref) => {
|
|
5643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref, className: buttonGroup(), children: import_react7.default.Children.map(children, (child) => {
|
|
5644
|
+
return import_react7.default.cloneElement(child, {
|
|
5645
|
+
...props,
|
|
5646
|
+
...child.props,
|
|
5647
|
+
disabled: props.isDisabled,
|
|
5648
|
+
isInGroup: true
|
|
5649
|
+
});
|
|
5650
|
+
}) });
|
|
5651
|
+
});
|
|
5652
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
5653
|
+
var button_group_default = ButtonGroup;
|
|
5654
|
+
var buttonGroup = tv({
|
|
5655
|
+
base: ["flex", "gap-[20px]"]
|
|
5656
|
+
});
|
|
5657
|
+
|
|
5658
|
+
// src/components/breadcrumb/breadcrumb.tsx
|
|
5659
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
5660
|
+
var BreadcrumbMenu = (0, import_react8.forwardRef)(({ label, onClick, isCurrent, size }, ref) => {
|
|
5661
|
+
const slots = (0, import_react8.useMemo)(() => breadcrumbStyle({ size }), [size]);
|
|
5662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5663
|
+
text_button_default,
|
|
5664
|
+
{
|
|
5665
|
+
variant: isCurrent ? "underline" : "non-under",
|
|
5666
|
+
color: isCurrent ? "primary" : "neutral",
|
|
5667
|
+
size,
|
|
5668
|
+
onClick,
|
|
5669
|
+
"aria-label": label,
|
|
5670
|
+
classNames: { base: "font-bold" },
|
|
5671
|
+
children: label
|
|
5672
|
+
}
|
|
5673
|
+
);
|
|
5674
|
+
});
|
|
5675
|
+
var Breadcrumb = (0, import_react8.forwardRef)(({ startIconName, size, menus, classNames }, ref) => {
|
|
5676
|
+
const slots = (0, import_react8.useMemo)(() => breadcrumbStyle({ size }), [size]);
|
|
5677
|
+
const renderMenus = (menus2) => {
|
|
5678
|
+
const flatMenus = [];
|
|
5679
|
+
const flatten = (items) => {
|
|
5680
|
+
var _a;
|
|
5681
|
+
for (const item of items) {
|
|
5682
|
+
flatMenus.push(item);
|
|
5683
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
5684
|
+
flatten(item.children);
|
|
5685
|
+
}
|
|
5686
|
+
}
|
|
5687
|
+
};
|
|
5688
|
+
flatten(menus2);
|
|
5689
|
+
return flatMenus.map((menu, index) => {
|
|
5690
|
+
const isLast = index === flatMenus.length - 1;
|
|
5691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5692
|
+
"li",
|
|
5693
|
+
{
|
|
5694
|
+
className: "flex items-center gap-[5px]",
|
|
5695
|
+
"aria-current": isLast ? "page" : void 0,
|
|
5696
|
+
children: [
|
|
5697
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BreadcrumbMenu, { label: menu.label, onClick: menu.onClick, isCurrent: isLast, size }),
|
|
5698
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: "right", className: slots.separator() })
|
|
5699
|
+
]
|
|
5700
|
+
},
|
|
5701
|
+
`${menu.label}-${index}`
|
|
5702
|
+
);
|
|
5703
|
+
});
|
|
5704
|
+
};
|
|
5705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("nav", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "aria-label": "Breadcrumb", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("ul", { className: "flex items-center gap-1", children: [
|
|
5706
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: startIconName, size, className: `${slots.icon()}` }) }),
|
|
5707
|
+
renderMenus(menus)
|
|
5708
|
+
] }) });
|
|
5709
|
+
});
|
|
5710
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
5711
|
+
var breadcrumb_default = Breadcrumb;
|
|
5712
|
+
var breadcrumbStyle = tv({
|
|
5713
|
+
slots: {
|
|
5714
|
+
base: ["flex", "items-center"],
|
|
5715
|
+
icon: ["fill-primary-main", "text-primary-main", "stroke-primary-main"],
|
|
5716
|
+
separator: ["text-neutral-main"]
|
|
5717
|
+
},
|
|
5718
|
+
variants: {
|
|
5719
|
+
size: {
|
|
5720
|
+
sm: {
|
|
5721
|
+
base: "text-sm",
|
|
5722
|
+
separator: "w-[18px] h-[18px]"
|
|
5723
|
+
},
|
|
5724
|
+
md: {
|
|
5725
|
+
base: "text-md",
|
|
5726
|
+
separator: "w-[21px] h-[21px]"
|
|
5727
|
+
},
|
|
5728
|
+
lg: {
|
|
5729
|
+
base: "text-lg",
|
|
5730
|
+
separator: "w-[24px] h-[24px]"
|
|
5731
|
+
},
|
|
5732
|
+
xl: {
|
|
5733
|
+
base: "text-xl",
|
|
5734
|
+
separator: "w-[27px] h-[27px]"
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
5737
|
+
},
|
|
5738
|
+
defaultVariants: {
|
|
5739
|
+
size: "md"
|
|
5740
|
+
}
|
|
5741
|
+
});
|
|
5742
|
+
|
|
5743
|
+
// src/components/input/input.tsx
|
|
5744
|
+
var import_react9 = __toESM(require("react"));
|
|
5745
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5746
|
+
var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
|
|
5747
|
+
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
5748
|
+
const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
|
|
5749
|
+
const inputRef = (0, import_react9.useRef)(null);
|
|
5750
|
+
const slots = (0, import_react9.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
5751
|
+
const getContentProps = (0, import_react9.useCallback)(
|
|
5752
|
+
() => ({
|
|
5753
|
+
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
5754
|
+
size: originalProps.size
|
|
5755
|
+
}),
|
|
5756
|
+
[slots, classNames, originalProps.size]
|
|
5757
|
+
);
|
|
5758
|
+
const renderStartContent = () => {
|
|
5759
|
+
if (import_react9.default.isValidElement(startContent)) {
|
|
5760
|
+
const existingProps = startContent.props;
|
|
5761
|
+
const mergedProps = {
|
|
5762
|
+
...getContentProps(),
|
|
5763
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5764
|
+
};
|
|
5765
|
+
return import_react9.default.cloneElement(startContent, mergedProps);
|
|
5766
|
+
} else {
|
|
5767
|
+
const contentProps = getContentProps();
|
|
5768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...contentProps, children: startContent });
|
|
5769
|
+
}
|
|
5770
|
+
};
|
|
5771
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5772
|
+
"div",
|
|
5773
|
+
{
|
|
5774
|
+
...getContentProps(),
|
|
5775
|
+
onClick: () => {
|
|
5776
|
+
const target = ref && "current" in ref ? ref.current : inputRef.current;
|
|
5777
|
+
target == null ? void 0 : target.focus();
|
|
5778
|
+
target == null ? void 0 : target.showPicker();
|
|
5779
|
+
},
|
|
5780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon_default, { name: props.type === "time" ? "clock" : "calendar", size: originalProps.size, className: "cursor-pointer" })
|
|
5781
|
+
}
|
|
5782
|
+
);
|
|
5783
|
+
const renderContentWithIcon = () => {
|
|
5784
|
+
if (import_react9.default.isValidElement(endContent)) {
|
|
5785
|
+
const existingProps = endContent.props;
|
|
5786
|
+
const mergedProps = {
|
|
5787
|
+
...getContentProps(),
|
|
5788
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5789
|
+
};
|
|
5790
|
+
return import_react9.default.cloneElement(endContent, mergedProps);
|
|
5791
|
+
} else if (errorText) {
|
|
5792
|
+
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
5793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
5794
|
+
} else {
|
|
5795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, {});
|
|
5796
|
+
}
|
|
5797
|
+
};
|
|
5798
|
+
const renderEndContent = () => {
|
|
5799
|
+
switch (props.type) {
|
|
5800
|
+
case "date":
|
|
5801
|
+
case "datetime-local":
|
|
5802
|
+
case "month":
|
|
5803
|
+
case "week":
|
|
5804
|
+
case "time":
|
|
5805
|
+
return renderDateTimePickerIcon();
|
|
5806
|
+
default:
|
|
5807
|
+
return renderContentWithIcon();
|
|
5808
|
+
}
|
|
5809
|
+
};
|
|
5810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
5811
|
+
"div",
|
|
5812
|
+
{
|
|
5813
|
+
className: clsx(
|
|
5814
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5815
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
5816
|
+
),
|
|
5817
|
+
children: [
|
|
5818
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5819
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper }), children: [
|
|
5820
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
5821
|
+
"div",
|
|
5822
|
+
{
|
|
5823
|
+
className: clsx(
|
|
5824
|
+
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
5825
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
5826
|
+
),
|
|
5827
|
+
children: [
|
|
5828
|
+
startContent && renderStartContent(),
|
|
5829
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
|
|
5830
|
+
renderEndContent()
|
|
5831
|
+
]
|
|
5832
|
+
}
|
|
5833
|
+
),
|
|
5834
|
+
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
5835
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
5836
|
+
] })
|
|
5837
|
+
]
|
|
5838
|
+
}
|
|
5839
|
+
);
|
|
5840
|
+
});
|
|
5841
|
+
Input.displayName = "Input";
|
|
5842
|
+
var input_default = Input;
|
|
5843
|
+
var inputStyle = tv(
|
|
5844
|
+
{
|
|
5845
|
+
slots: {
|
|
5846
|
+
base: ["group/input", "flex"],
|
|
5847
|
+
vertical: ["flex-col"],
|
|
5848
|
+
horizon: ["flex-row", "gap-0"],
|
|
5849
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
5850
|
+
innerWrapper: ["flex", "flex-col"],
|
|
5851
|
+
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input:bg-danger-soft"],
|
|
5852
|
+
input: [
|
|
5853
|
+
"w-full",
|
|
5854
|
+
"h-full",
|
|
5855
|
+
"bg-transparent",
|
|
5856
|
+
"text-neutral-main",
|
|
5857
|
+
"placeholder:text-neutral-main",
|
|
5858
|
+
"outline-none",
|
|
5859
|
+
"focus:ring-0",
|
|
5860
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5861
|
+
"group-has-[:hover]/input:placeholder:text-neutral-dark",
|
|
5862
|
+
"group-has-[:focus]/input:text-neutral-dark",
|
|
5863
|
+
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
5864
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
5865
|
+
"group-has-[p.error]/input:placeholder:text-danger-main"
|
|
5866
|
+
],
|
|
5867
|
+
content: [
|
|
5868
|
+
"flex",
|
|
5869
|
+
"items-center",
|
|
5870
|
+
"select-none",
|
|
5871
|
+
"text-neutral-main",
|
|
5872
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5873
|
+
"group-has-[p.error]/input:text-danger-main"
|
|
5874
|
+
],
|
|
5875
|
+
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
5876
|
+
errorText: ["text-danger-main"],
|
|
5877
|
+
readonly: ["pointer-events-none"]
|
|
5878
|
+
},
|
|
5879
|
+
variants: {
|
|
5880
|
+
variant: {
|
|
5881
|
+
solid: {
|
|
5882
|
+
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
5883
|
+
readonly: ["!bg-trans-light"]
|
|
5884
|
+
},
|
|
5885
|
+
outline: {
|
|
5394
5886
|
inputWrapper: [
|
|
5395
5887
|
"border-neutral-light",
|
|
5396
5888
|
"group-has-[:hover]/input:bg-trans-soft",
|
|
@@ -5574,24 +6066,24 @@ var inputStyle = tv(
|
|
|
5574
6066
|
);
|
|
5575
6067
|
|
|
5576
6068
|
// src/components/tabs/tabs.tsx
|
|
5577
|
-
var
|
|
5578
|
-
var
|
|
5579
|
-
var Tabs = (0,
|
|
6069
|
+
var import_react10 = require("react");
|
|
6070
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
6071
|
+
var Tabs = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
5580
6072
|
const [props, variantProps] = mapPropsVariants(originalProps, tabs.variantKeys);
|
|
5581
6073
|
const { data, defaultTabIndex, classNames } = props;
|
|
5582
|
-
const [activeTabIndex, setActiveTabIndex] = (0,
|
|
5583
|
-
const slots = (0,
|
|
5584
|
-
const getBaseProps = (0,
|
|
6074
|
+
const [activeTabIndex, setActiveTabIndex] = (0, import_react10.useState)(defaultTabIndex || 0);
|
|
6075
|
+
const slots = (0, import_react10.useMemo)(() => tabs({ ...variantProps }), [...Object.values(variantProps)]);
|
|
6076
|
+
const getBaseProps = (0, import_react10.useCallback)(() => {
|
|
5585
6077
|
return {
|
|
5586
6078
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
5587
6079
|
};
|
|
5588
6080
|
}, [slots, classNames == null ? void 0 : classNames.base]);
|
|
5589
|
-
const getTabsProps = (0,
|
|
6081
|
+
const getTabsProps = (0, import_react10.useCallback)(() => {
|
|
5590
6082
|
return {
|
|
5591
6083
|
className: slots.tabs({ class: classNames == null ? void 0 : classNames.tabs })
|
|
5592
6084
|
};
|
|
5593
6085
|
}, [slots, classNames == null ? void 0 : classNames.tabs]);
|
|
5594
|
-
const getTabProps = (0,
|
|
6086
|
+
const getTabProps = (0, import_react10.useCallback)(
|
|
5595
6087
|
(index, disabled) => {
|
|
5596
6088
|
return {
|
|
5597
6089
|
className: slots.tab({ class: classNames == null ? void 0 : classNames.tab }),
|
|
@@ -5605,20 +6097,20 @@ var Tabs = (0, import_react8.forwardRef)((originalProps, ref) => {
|
|
|
5605
6097
|
},
|
|
5606
6098
|
[slots, classNames == null ? void 0 : classNames.tab, activeTabIndex]
|
|
5607
6099
|
);
|
|
5608
|
-
const getContentWrapperProps = (0,
|
|
6100
|
+
const getContentWrapperProps = (0, import_react10.useCallback)(() => {
|
|
5609
6101
|
return {
|
|
5610
6102
|
className: slots.contentWrapper({ class: classNames == null ? void 0 : classNames.contentWrapper })
|
|
5611
6103
|
};
|
|
5612
6104
|
}, [slots, classNames == null ? void 0 : classNames.contentWrapper]);
|
|
5613
|
-
const getContentProps = (0,
|
|
6105
|
+
const getContentProps = (0, import_react10.useCallback)(() => {
|
|
5614
6106
|
return {
|
|
5615
6107
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content })
|
|
5616
6108
|
};
|
|
5617
6109
|
}, [slots, classNames == null ? void 0 : classNames.content]);
|
|
5618
|
-
return /* @__PURE__ */ (0,
|
|
5619
|
-
/* @__PURE__ */ (0,
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
(tabItem, index) => index === activeTabIndex ? /* @__PURE__ */ (0,
|
|
6110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ref, ...getBaseProps(), children: [
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getTabsProps(), children: data == null ? void 0 : data.map((tabItem, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getTabProps(index, tabItem.disabled), children: tabItem.title }, `tabs-header-${tabItem.key}`)) }),
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getContentWrapperProps(), children: data == null ? void 0 : data.map(
|
|
6113
|
+
(tabItem, index) => index === activeTabIndex ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getContentProps(), children: tabItem.component }, `tabs-content${tabItem.key}`) : null
|
|
5622
6114
|
) })
|
|
5623
6115
|
] });
|
|
5624
6116
|
});
|
|
@@ -5782,38 +6274,38 @@ var tabs = tv({
|
|
|
5782
6274
|
});
|
|
5783
6275
|
|
|
5784
6276
|
// src/components/textarea/textarea.tsx
|
|
5785
|
-
var
|
|
5786
|
-
var
|
|
5787
|
-
var
|
|
5788
|
-
var Textarea = (0,
|
|
6277
|
+
var import_react11 = require("react");
|
|
6278
|
+
var import_tailwind_variants11 = require("tailwind-variants");
|
|
6279
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
6280
|
+
var Textarea = (0, import_react11.forwardRef)((originalProps, ref) => {
|
|
5789
6281
|
const [props, variantProps] = mapPropsVariants(originalProps, textareaStyle.variantKeys);
|
|
5790
6282
|
const { classNames, label, errorMessage, ...textareaProps } = props;
|
|
5791
|
-
const slots = (0,
|
|
5792
|
-
const getBaseProps = (0,
|
|
6283
|
+
const slots = (0, import_react11.useMemo)(() => textareaStyle({ ...variantProps }), [variantProps]);
|
|
6284
|
+
const getBaseProps = (0, import_react11.useCallback)(
|
|
5793
6285
|
() => ({
|
|
5794
6286
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
5795
6287
|
}),
|
|
5796
6288
|
[slots, classNames]
|
|
5797
6289
|
);
|
|
5798
|
-
const getLabelProps = (0,
|
|
6290
|
+
const getLabelProps = (0, import_react11.useCallback)(
|
|
5799
6291
|
() => ({
|
|
5800
6292
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
5801
6293
|
}),
|
|
5802
6294
|
[slots, classNames]
|
|
5803
6295
|
);
|
|
5804
|
-
const getInnerWrapperProps = (0,
|
|
6296
|
+
const getInnerWrapperProps = (0, import_react11.useCallback)(
|
|
5805
6297
|
() => ({
|
|
5806
6298
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
5807
6299
|
}),
|
|
5808
6300
|
[slots, classNames]
|
|
5809
6301
|
);
|
|
5810
|
-
const getTextareaWrapperProps = (0,
|
|
6302
|
+
const getTextareaWrapperProps = (0, import_react11.useCallback)(
|
|
5811
6303
|
() => ({
|
|
5812
6304
|
className: slots.textareaWrapper({ class: classNames == null ? void 0 : classNames.textareaWrapper })
|
|
5813
6305
|
}),
|
|
5814
6306
|
[slots, classNames]
|
|
5815
6307
|
);
|
|
5816
|
-
const getTextareaProps = (0,
|
|
6308
|
+
const getTextareaProps = (0, import_react11.useCallback)(
|
|
5817
6309
|
() => ({
|
|
5818
6310
|
...textareaProps,
|
|
5819
6311
|
ref,
|
|
@@ -5824,23 +6316,23 @@ var Textarea = (0, import_react9.forwardRef)((originalProps, ref) => {
|
|
|
5824
6316
|
}),
|
|
5825
6317
|
[textareaProps, ref, slots, classNames == null ? void 0 : classNames.textarea, originalProps.isDisabled, originalProps.isRequired]
|
|
5826
6318
|
);
|
|
5827
|
-
const getErrorMessageProps = (0,
|
|
6319
|
+
const getErrorMessageProps = (0, import_react11.useCallback)(
|
|
5828
6320
|
() => ({
|
|
5829
6321
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
5830
6322
|
}),
|
|
5831
6323
|
[slots, classNames]
|
|
5832
6324
|
);
|
|
5833
|
-
return /* @__PURE__ */ (0,
|
|
5834
|
-
props.label && /* @__PURE__ */ (0,
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
/* @__PURE__ */ (0,
|
|
5837
|
-
props.errorMessage && /* @__PURE__ */ (0,
|
|
6325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ...getBaseProps(), children: [
|
|
6326
|
+
props.label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ...getTextareaWrapperProps(), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { ...getTextareaProps() }) }),
|
|
6329
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
5838
6330
|
] })
|
|
5839
6331
|
] });
|
|
5840
6332
|
});
|
|
5841
6333
|
Textarea.displayName = "Textarea";
|
|
5842
6334
|
var textarea_default = Textarea;
|
|
5843
|
-
var textareaStyle = (0,
|
|
6335
|
+
var textareaStyle = (0, import_tailwind_variants11.tv)({
|
|
5844
6336
|
slots: {
|
|
5845
6337
|
base: ["group/textarea", "flex", "flex-col", "gap-[10px]", "select-none"],
|
|
5846
6338
|
label: ["flex", "items-center"],
|
|
@@ -5983,19 +6475,19 @@ var textareaStyle = (0, import_tailwind_variants9.tv)({
|
|
|
5983
6475
|
});
|
|
5984
6476
|
|
|
5985
6477
|
// src/components/table/table.tsx
|
|
5986
|
-
var
|
|
5987
|
-
var
|
|
6478
|
+
var import_react17 = require("react");
|
|
6479
|
+
var import_tailwind_variants14 = require("tailwind-variants");
|
|
5988
6480
|
|
|
5989
6481
|
// src/components/checkbox/checkbox.tsx
|
|
5990
|
-
var
|
|
5991
|
-
var
|
|
5992
|
-
var CheckBox = (0,
|
|
6482
|
+
var import_react12 = require("react");
|
|
6483
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6484
|
+
var CheckBox = (0, import_react12.forwardRef)((originalProps, ref) => {
|
|
5993
6485
|
var _a, _b;
|
|
5994
6486
|
const [props, variantProps] = mapPropsVariants(originalProps, checkboxStyle.variantKeys);
|
|
5995
6487
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
5996
|
-
const slots = (0,
|
|
6488
|
+
const slots = (0, import_react12.useMemo)(() => checkboxStyle({ ...variantProps }), [variantProps]);
|
|
5997
6489
|
const isSelected = (_b = (_a = inputProps.checked) != null ? _a : inputProps.defaultChecked) != null ? _b : false;
|
|
5998
|
-
return /* @__PURE__ */ (0,
|
|
6490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5999
6491
|
"label",
|
|
6000
6492
|
{
|
|
6001
6493
|
className: clsx(
|
|
@@ -6003,8 +6495,8 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6003
6495
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
6004
6496
|
),
|
|
6005
6497
|
children: [
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6007
|
-
/* @__PURE__ */ (0,
|
|
6498
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { ...inputProps, type: "checkbox", ref }) }),
|
|
6499
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6008
6500
|
CheckBoxIcon,
|
|
6009
6501
|
{
|
|
6010
6502
|
size: variantProps.size,
|
|
@@ -6012,7 +6504,7 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6012
6504
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon })
|
|
6013
6505
|
}
|
|
6014
6506
|
) }),
|
|
6015
|
-
children && /* @__PURE__ */ (0,
|
|
6507
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children })
|
|
6016
6508
|
]
|
|
6017
6509
|
}
|
|
6018
6510
|
);
|
|
@@ -6020,7 +6512,7 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6020
6512
|
CheckBox.displayName = "CheckBox";
|
|
6021
6513
|
var checkbox_default = CheckBox;
|
|
6022
6514
|
var CheckBoxIcon = ({ size, isSelected, className }) => {
|
|
6023
|
-
const strokeWidth = (0,
|
|
6515
|
+
const strokeWidth = (0, import_react12.useMemo)(() => {
|
|
6024
6516
|
switch (size) {
|
|
6025
6517
|
case "sm":
|
|
6026
6518
|
return 1;
|
|
@@ -6034,7 +6526,7 @@ var CheckBoxIcon = ({ size, isSelected, className }) => {
|
|
|
6034
6526
|
return 1.25;
|
|
6035
6527
|
}
|
|
6036
6528
|
}, [size]);
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
6529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 13 13", fill: "none", className, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
6038
6530
|
"path",
|
|
6039
6531
|
{
|
|
6040
6532
|
d: "M2.16667 6.90123L5.63334 10.1111L10.8333 2.88889",
|
|
@@ -6194,15 +6686,15 @@ var checkboxStyle = tv({
|
|
|
6194
6686
|
});
|
|
6195
6687
|
|
|
6196
6688
|
// src/components/table/table-head.tsx
|
|
6197
|
-
var
|
|
6689
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6198
6690
|
var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, classNames, onCheckAll }) => {
|
|
6199
6691
|
const handleClickCheckAll = (e) => {
|
|
6200
6692
|
e.preventDefault();
|
|
6201
6693
|
onCheckAll(!isCheckedAll);
|
|
6202
6694
|
};
|
|
6203
|
-
const renderColumnHeaders = () => columns.map((column, index) => /* @__PURE__ */ (0,
|
|
6204
|
-
const renderSelectAllCheckbox = () => selectableRows && /* @__PURE__ */ (0,
|
|
6205
|
-
return /* @__PURE__ */ (0,
|
|
6695
|
+
const renderColumnHeaders = () => columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th }), column), children: column.headerName }, `${column.field}${index}thead`));
|
|
6696
|
+
const renderSelectAllCheckbox = () => selectableRows && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("th", { className: clsx(slots.th({ class: classNames == null ? void 0 : classNames.th })), onClick: handleClickCheckAll, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(checkbox_default, { size, checked: isCheckedAll }) }) });
|
|
6697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: clsx(slots.thead({ class: classNames == null ? void 0 : classNames.thead })), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr })), children: [
|
|
6206
6698
|
renderColumnHeaders(),
|
|
6207
6699
|
renderSelectAllCheckbox()
|
|
6208
6700
|
] }) });
|
|
@@ -6210,9 +6702,9 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
6210
6702
|
var table_head_default = TableHead;
|
|
6211
6703
|
|
|
6212
6704
|
// src/components/table/table-body.tsx
|
|
6213
|
-
var
|
|
6214
|
-
var
|
|
6215
|
-
var
|
|
6705
|
+
var import_react13 = require("react");
|
|
6706
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6707
|
+
var import_react14 = require("react");
|
|
6216
6708
|
var TableBody = ({
|
|
6217
6709
|
slots,
|
|
6218
6710
|
columns,
|
|
@@ -6224,11 +6716,11 @@ var TableBody = ({
|
|
|
6224
6716
|
emptyContent,
|
|
6225
6717
|
classNames
|
|
6226
6718
|
}) => {
|
|
6227
|
-
const generateColumnStyles = (0,
|
|
6719
|
+
const generateColumnStyles = (0, import_react13.useCallback)((column) => {
|
|
6228
6720
|
const alignClass = column.align ? `text-${column.align}` : "text-left";
|
|
6229
6721
|
return clsx(alignClass, column.className);
|
|
6230
6722
|
}, []);
|
|
6231
|
-
const getCellProps = (0,
|
|
6723
|
+
const getCellProps = (0, import_react13.useCallback)(
|
|
6232
6724
|
(column, row) => {
|
|
6233
6725
|
if (!column || !row) {
|
|
6234
6726
|
return {
|
|
@@ -6260,11 +6752,11 @@ var TableBody = ({
|
|
|
6260
6752
|
);
|
|
6261
6753
|
const hasRows = rows.length > 0;
|
|
6262
6754
|
const colSpan = (columns.length || 1) + (selectableRows ? 1 : 0);
|
|
6263
|
-
return /* @__PURE__ */ (0,
|
|
6755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tbody", { className: slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), children: hasRows ? rows.map((row, rowIndex) => {
|
|
6264
6756
|
const isRowChecked = checkedRows.has(rowIndex);
|
|
6265
|
-
return /* @__PURE__ */ (0,
|
|
6266
|
-
columns.map((column) => /* @__PURE__ */ (0,
|
|
6267
|
-
selectableRows && /* @__PURE__ */ (0,
|
|
6757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "aria-checked": isRowChecked, children: [
|
|
6758
|
+
columns.map((column) => /* @__PURE__ */ (0, import_react14.createElement)("td", { ...getCellProps(column, row), key: column.field })),
|
|
6759
|
+
selectableRows && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
6268
6760
|
checkbox_default,
|
|
6269
6761
|
{
|
|
6270
6762
|
size,
|
|
@@ -6273,23 +6765,23 @@ var TableBody = ({
|
|
|
6273
6765
|
}
|
|
6274
6766
|
) }) })
|
|
6275
6767
|
] }, rowIndex);
|
|
6276
|
-
}) : /* @__PURE__ */ (0,
|
|
6768
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: slots.tr({ class: classNames == null ? void 0 : classNames.tr }), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { colSpan, className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: emptyContent || /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-neutral-dark py-4 text-center", children: "No data available" }) }) }) });
|
|
6277
6769
|
};
|
|
6278
6770
|
var table_body_default = TableBody;
|
|
6279
6771
|
|
|
6280
6772
|
// src/components/pagination/pagination.tsx
|
|
6281
|
-
var
|
|
6773
|
+
var import_react16 = require("react");
|
|
6282
6774
|
|
|
6283
6775
|
// src/components/pagination/usePagination.ts
|
|
6284
|
-
var
|
|
6776
|
+
var import_react15 = require("react");
|
|
6285
6777
|
var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) => {
|
|
6286
|
-
const startPage = (0,
|
|
6287
|
-
const endPage = (0,
|
|
6288
|
-
const pageList = (0,
|
|
6778
|
+
const startPage = (0, import_react15.useMemo)(() => Math.floor((currentPage - 1) / groupSize) * groupSize + 1, [currentPage, groupSize]);
|
|
6779
|
+
const endPage = (0, import_react15.useMemo)(() => Math.min(startPage + groupSize - 1, totalPage), [startPage, groupSize, totalPage]);
|
|
6780
|
+
const pageList = (0, import_react15.useMemo)(
|
|
6289
6781
|
() => Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i),
|
|
6290
6782
|
[startPage, endPage]
|
|
6291
6783
|
);
|
|
6292
|
-
const handleClickMovePage = (0,
|
|
6784
|
+
const handleClickMovePage = (0, import_react15.useCallback)(
|
|
6293
6785
|
(page) => (event) => {
|
|
6294
6786
|
event.preventDefault();
|
|
6295
6787
|
handleChangePage == null ? void 0 : handleChangePage(page);
|
|
@@ -6306,8 +6798,8 @@ var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) =>
|
|
|
6306
6798
|
var usePagination_default = usePagination;
|
|
6307
6799
|
|
|
6308
6800
|
// src/components/pagination/pagination.tsx
|
|
6309
|
-
var
|
|
6310
|
-
var Pagination = (0,
|
|
6801
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6802
|
+
var Pagination = (0, import_react16.forwardRef)((originalProps, ref) => {
|
|
6311
6803
|
const [props, variantProps] = mapPropsVariants(originalProps, paginationStyle.variantKeys);
|
|
6312
6804
|
const {
|
|
6313
6805
|
classNames,
|
|
@@ -6321,8 +6813,8 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6321
6813
|
variant,
|
|
6322
6814
|
size
|
|
6323
6815
|
} = { ...props, ...variantProps };
|
|
6324
|
-
const [inputPage, setInputPage] = (0,
|
|
6325
|
-
const slots = (0,
|
|
6816
|
+
const [inputPage, setInputPage] = (0, import_react16.useState)(currentPage);
|
|
6817
|
+
const slots = (0, import_react16.useMemo)(() => paginationStyle(variantProps), [variantProps]);
|
|
6326
6818
|
const { pageList, handleClickMovePage } = usePagination_default({
|
|
6327
6819
|
currentPage,
|
|
6328
6820
|
totalPage,
|
|
@@ -6337,29 +6829,29 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6337
6829
|
}
|
|
6338
6830
|
}
|
|
6339
6831
|
};
|
|
6340
|
-
return /* @__PURE__ */ (0,
|
|
6341
|
-
/* @__PURE__ */ (0,
|
|
6342
|
-
showFirstLastButtons && /* @__PURE__ */ (0,
|
|
6832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), ref, children: [
|
|
6833
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
6834
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6343
6835
|
"div",
|
|
6344
6836
|
{
|
|
6345
6837
|
"aria-label": "firstPage",
|
|
6346
6838
|
"data-is-active": currentPage > 1,
|
|
6347
6839
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6348
6840
|
onClick: currentPage > 1 ? handleClickMovePage(1) : void 0,
|
|
6349
|
-
children: /* @__PURE__ */ (0,
|
|
6841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "left-double-chevron" })
|
|
6350
6842
|
}
|
|
6351
6843
|
),
|
|
6352
|
-
/* @__PURE__ */ (0,
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6353
6845
|
"div",
|
|
6354
6846
|
{
|
|
6355
6847
|
"aria-label": "prevPage",
|
|
6356
6848
|
"data-is-active": currentPage > 1,
|
|
6357
6849
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6358
6850
|
onClick: currentPage > 1 ? handleClickMovePage(currentPage - 1) : void 0,
|
|
6359
|
-
children: /* @__PURE__ */ (0,
|
|
6851
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "left-chevron" })
|
|
6360
6852
|
}
|
|
6361
6853
|
),
|
|
6362
|
-
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0,
|
|
6854
|
+
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6363
6855
|
"div",
|
|
6364
6856
|
{
|
|
6365
6857
|
className: slots.button({ class: classNames == null ? void 0 : classNames.button }),
|
|
@@ -6369,29 +6861,29 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6369
6861
|
},
|
|
6370
6862
|
index
|
|
6371
6863
|
)),
|
|
6372
|
-
/* @__PURE__ */ (0,
|
|
6864
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6373
6865
|
"div",
|
|
6374
6866
|
{
|
|
6375
6867
|
"aria-label": "nextPage",
|
|
6376
6868
|
"data-is-active": currentPage < totalPage,
|
|
6377
6869
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6378
6870
|
onClick: currentPage < totalPage ? handleClickMovePage(currentPage + 1) : void 0,
|
|
6379
|
-
children: /* @__PURE__ */ (0,
|
|
6871
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "right-chevron" })
|
|
6380
6872
|
}
|
|
6381
6873
|
),
|
|
6382
|
-
showFirstLastButtons && /* @__PURE__ */ (0,
|
|
6874
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6383
6875
|
"div",
|
|
6384
6876
|
{
|
|
6385
6877
|
"aria-label": "lastPage",
|
|
6386
6878
|
"data-is-active": currentPage < totalPage,
|
|
6387
6879
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6388
6880
|
onClick: currentPage < totalPage ? handleClickMovePage(totalPage) : void 0,
|
|
6389
|
-
children: /* @__PURE__ */ (0,
|
|
6881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "right-double-chevron" })
|
|
6390
6882
|
}
|
|
6391
6883
|
)
|
|
6392
6884
|
] }),
|
|
6393
|
-
showPageLabel && /* @__PURE__ */ (0,
|
|
6394
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: [
|
|
6886
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6395
6887
|
input_default,
|
|
6396
6888
|
{
|
|
6397
6889
|
value: inputPage || 1,
|
|
@@ -6424,7 +6916,7 @@ var paginationStyle = tv(
|
|
|
6424
6916
|
"items-center",
|
|
6425
6917
|
"justify-center",
|
|
6426
6918
|
"cursor-pointer",
|
|
6427
|
-
"
|
|
6919
|
+
"text-neutral-main",
|
|
6428
6920
|
"data-[is-active=false]:stroke-neutral-light",
|
|
6429
6921
|
"data-[is-active=false]:cursor-default"
|
|
6430
6922
|
],
|
|
@@ -6487,7 +6979,7 @@ var paginationStyle = tv(
|
|
|
6487
6979
|
"data-[selected=true]:text-primary-main",
|
|
6488
6980
|
"data-[selected=true]:bg-primary-soft"
|
|
6489
6981
|
],
|
|
6490
|
-
icon: ["hover:
|
|
6982
|
+
icon: ["hover:text-primary-main"]
|
|
6491
6983
|
}
|
|
6492
6984
|
},
|
|
6493
6985
|
{
|
|
@@ -6499,7 +6991,7 @@ var paginationStyle = tv(
|
|
|
6499
6991
|
"data-[selected=true]:text-secondary-main",
|
|
6500
6992
|
"data-[selected=true]:bg-secondary-soft"
|
|
6501
6993
|
],
|
|
6502
|
-
icon: ["hover:
|
|
6994
|
+
icon: ["hover:text-secondary-main"]
|
|
6503
6995
|
}
|
|
6504
6996
|
},
|
|
6505
6997
|
{
|
|
@@ -6511,7 +7003,7 @@ var paginationStyle = tv(
|
|
|
6511
7003
|
"data-[selected=true]:text-neutral-dark",
|
|
6512
7004
|
"data-[selected=true]:bg-neutral-soft"
|
|
6513
7005
|
],
|
|
6514
|
-
icon: ["hover:
|
|
7006
|
+
icon: ["hover:text-neutral-dark"]
|
|
6515
7007
|
}
|
|
6516
7008
|
},
|
|
6517
7009
|
{
|
|
@@ -6523,7 +7015,7 @@ var paginationStyle = tv(
|
|
|
6523
7015
|
"data-[selected=true]:text-primary-main",
|
|
6524
7016
|
"data-[selected=true]:border-b-primary-main"
|
|
6525
7017
|
],
|
|
6526
|
-
icon: ["hover:
|
|
7018
|
+
icon: ["hover:text-primary-main"]
|
|
6527
7019
|
}
|
|
6528
7020
|
},
|
|
6529
7021
|
{
|
|
@@ -6535,7 +7027,7 @@ var paginationStyle = tv(
|
|
|
6535
7027
|
"data-[selected=true]:text-secondary-main",
|
|
6536
7028
|
"data-[selected=true]:border-b-secondary-main"
|
|
6537
7029
|
],
|
|
6538
|
-
icon: ["hover:
|
|
7030
|
+
icon: ["hover:text-secondary-main"]
|
|
6539
7031
|
}
|
|
6540
7032
|
},
|
|
6541
7033
|
{
|
|
@@ -6547,7 +7039,7 @@ var paginationStyle = tv(
|
|
|
6547
7039
|
"data-[selected=true]:text-neutral-dark",
|
|
6548
7040
|
"data-[selected=true]:border-b-neutral-main"
|
|
6549
7041
|
],
|
|
6550
|
-
icon: ["hover:
|
|
7042
|
+
icon: ["hover:text-neutral-dark"]
|
|
6551
7043
|
}
|
|
6552
7044
|
}
|
|
6553
7045
|
],
|
|
@@ -6564,8 +7056,8 @@ var paginationStyle = tv(
|
|
|
6564
7056
|
);
|
|
6565
7057
|
|
|
6566
7058
|
// src/components/table/table.tsx
|
|
6567
|
-
var
|
|
6568
|
-
var Table = (0,
|
|
7059
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
7060
|
+
var Table = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
6569
7061
|
const [props, variantProps] = mapPropsVariants(originalProps, tableStyle.variantKeys);
|
|
6570
7062
|
const {
|
|
6571
7063
|
classNames,
|
|
@@ -6580,15 +7072,15 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6580
7072
|
className,
|
|
6581
7073
|
color
|
|
6582
7074
|
} = { ...props, ...variantProps };
|
|
6583
|
-
const [checkedRows, setCheckedRows] = (0,
|
|
6584
|
-
const divRef = (0,
|
|
7075
|
+
const [checkedRows, setCheckedRows] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
|
|
7076
|
+
const divRef = (0, import_react17.useRef)(null);
|
|
6585
7077
|
const { page, perPage } = pagination || { page: 1, perPage: 10 };
|
|
6586
7078
|
const showPagination = pagination && typeof totalData === "number";
|
|
6587
|
-
(0,
|
|
7079
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
6588
7080
|
checkedRows,
|
|
6589
7081
|
setCheckedRows
|
|
6590
7082
|
}));
|
|
6591
|
-
(0,
|
|
7083
|
+
(0, import_react17.useEffect)(() => {
|
|
6592
7084
|
setCheckedRows(/* @__PURE__ */ new Set());
|
|
6593
7085
|
}, [rows]);
|
|
6594
7086
|
const handleCheckAll = (isChecked) => {
|
|
@@ -6600,10 +7092,10 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6600
7092
|
isChecked ? newChecked.add(rowIndex) : newChecked.delete(rowIndex);
|
|
6601
7093
|
setCheckedRows(newChecked);
|
|
6602
7094
|
};
|
|
6603
|
-
const slots = (0,
|
|
6604
|
-
return /* @__PURE__ */ (0,
|
|
6605
|
-
/* @__PURE__ */ (0,
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
7095
|
+
const slots = (0, import_react17.useMemo)(() => tableStyle(variantProps), [variantProps]);
|
|
7096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: divRef, "data-table": "base", className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
7097
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6607
7099
|
table_head_default,
|
|
6608
7100
|
{
|
|
6609
7101
|
columns,
|
|
@@ -6615,7 +7107,7 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6615
7107
|
slots
|
|
6616
7108
|
}
|
|
6617
7109
|
),
|
|
6618
|
-
/* @__PURE__ */ (0,
|
|
7110
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6619
7111
|
table_body_default,
|
|
6620
7112
|
{
|
|
6621
7113
|
slots,
|
|
@@ -6630,7 +7122,7 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6630
7122
|
}
|
|
6631
7123
|
)
|
|
6632
7124
|
] }),
|
|
6633
|
-
showPagination && /* @__PURE__ */ (0,
|
|
7125
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-4 flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6634
7126
|
pagination_default,
|
|
6635
7127
|
{
|
|
6636
7128
|
color,
|
|
@@ -6644,7 +7136,7 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6644
7136
|
});
|
|
6645
7137
|
Table.displayName = "Table";
|
|
6646
7138
|
var table_default = Table;
|
|
6647
|
-
var tableStyle = (0,
|
|
7139
|
+
var tableStyle = (0, import_tailwind_variants14.tv)({
|
|
6648
7140
|
slots: {
|
|
6649
7141
|
base: ["flex", "flex-col", "relative", "select-none"],
|
|
6650
7142
|
table: ["w-full", "h-auto"],
|
|
@@ -6852,17 +7344,17 @@ var tableStyle = (0, import_tailwind_variants12.tv)({
|
|
|
6852
7344
|
});
|
|
6853
7345
|
|
|
6854
7346
|
// src/components/select/select.tsx
|
|
6855
|
-
var
|
|
7347
|
+
var import_react19 = require("react");
|
|
6856
7348
|
var import_react_dom = require("react-dom");
|
|
6857
7349
|
|
|
6858
7350
|
// src/components/select/useSelect.tsx
|
|
6859
|
-
var
|
|
7351
|
+
var import_react18 = require("react");
|
|
6860
7352
|
var useSelect = ({ options, defaultOption, onChange }) => {
|
|
6861
|
-
const [selectedOption, setSelectedOption] = (0,
|
|
6862
|
-
const [targetRect, setTargetRect] = (0,
|
|
6863
|
-
const [optionWrapperHeight, setOptionWrapperHeight] = (0,
|
|
6864
|
-
const selectWrapperRef = (0,
|
|
6865
|
-
const optionWrapperRef = (0,
|
|
7353
|
+
const [selectedOption, setSelectedOption] = (0, import_react18.useState)(defaultOption);
|
|
7354
|
+
const [targetRect, setTargetRect] = (0, import_react18.useState)(null);
|
|
7355
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react18.useState)(0);
|
|
7356
|
+
const selectWrapperRef = (0, import_react18.useRef)(null);
|
|
7357
|
+
const optionWrapperRef = (0, import_react18.useRef)(null);
|
|
6866
7358
|
const calculatePositionWithScroll = (targetRect2, optionWrapperHeight2) => {
|
|
6867
7359
|
const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
6868
7360
|
const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
@@ -6885,7 +7377,7 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6885
7377
|
setSelectedOption(option);
|
|
6886
7378
|
handleToggleSelect();
|
|
6887
7379
|
};
|
|
6888
|
-
(0,
|
|
7380
|
+
(0, import_react18.useEffect)(() => {
|
|
6889
7381
|
const onClickOutside = (e) => {
|
|
6890
7382
|
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target)) {
|
|
6891
7383
|
setTargetRect(null);
|
|
@@ -6894,7 +7386,7 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6894
7386
|
window.addEventListener("mousedown", onClickOutside);
|
|
6895
7387
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
6896
7388
|
}, []);
|
|
6897
|
-
(0,
|
|
7389
|
+
(0, import_react18.useEffect)(() => {
|
|
6898
7390
|
if (optionWrapperRef.current) {
|
|
6899
7391
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
6900
7392
|
}
|
|
@@ -6912,10 +7404,10 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6912
7404
|
};
|
|
6913
7405
|
|
|
6914
7406
|
// src/components/select/option.tsx
|
|
6915
|
-
var
|
|
7407
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6916
7408
|
var Option = (props) => {
|
|
6917
7409
|
const { base, option, icon } = optionStyle(props);
|
|
6918
|
-
return /* @__PURE__ */ (0,
|
|
7410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6919
7411
|
"div",
|
|
6920
7412
|
{
|
|
6921
7413
|
title: props.option.value,
|
|
@@ -6925,8 +7417,8 @@ var Option = (props) => {
|
|
|
6925
7417
|
props.isSelected && (node == null ? void 0 : node.scrollIntoView());
|
|
6926
7418
|
},
|
|
6927
7419
|
children: [
|
|
6928
|
-
/* @__PURE__ */ (0,
|
|
6929
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
7420
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: option(), children: props.children }),
|
|
7421
|
+
props.isSelected && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: icon(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon_default, { name: "check", size: props.size }) })
|
|
6930
7422
|
]
|
|
6931
7423
|
}
|
|
6932
7424
|
);
|
|
@@ -6977,11 +7469,11 @@ var optionStyle = tv({
|
|
|
6977
7469
|
});
|
|
6978
7470
|
|
|
6979
7471
|
// src/components/select/select.tsx
|
|
6980
|
-
var
|
|
6981
|
-
var Select = (0,
|
|
7472
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
7473
|
+
var Select = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
6982
7474
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
6983
7475
|
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
6984
|
-
const slots = (0,
|
|
7476
|
+
const slots = (0, import_react19.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
6985
7477
|
const {
|
|
6986
7478
|
targetRect,
|
|
6987
7479
|
selectedOption,
|
|
@@ -6997,19 +7489,19 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
6997
7489
|
onChange
|
|
6998
7490
|
});
|
|
6999
7491
|
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
7000
|
-
const getBaseProps = (0,
|
|
7492
|
+
const getBaseProps = (0, import_react19.useCallback)(
|
|
7001
7493
|
() => ({
|
|
7002
7494
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
7003
7495
|
}),
|
|
7004
7496
|
[slots, classNames]
|
|
7005
7497
|
);
|
|
7006
|
-
const getLabelProps = (0,
|
|
7498
|
+
const getLabelProps = (0, import_react19.useCallback)(
|
|
7007
7499
|
() => ({
|
|
7008
7500
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
7009
7501
|
}),
|
|
7010
7502
|
[slots, classNames]
|
|
7011
7503
|
);
|
|
7012
|
-
const getSelectWrapperProps = (0,
|
|
7504
|
+
const getSelectWrapperProps = (0, import_react19.useCallback)(
|
|
7013
7505
|
() => ({
|
|
7014
7506
|
className: slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
7015
7507
|
ref: selectWrapperRef,
|
|
@@ -7017,7 +7509,7 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7017
7509
|
}),
|
|
7018
7510
|
[slots, classNames]
|
|
7019
7511
|
);
|
|
7020
|
-
const getSelectProps = (0,
|
|
7512
|
+
const getSelectProps = (0, import_react19.useCallback)(
|
|
7021
7513
|
() => ({
|
|
7022
7514
|
...inputProps,
|
|
7023
7515
|
ref,
|
|
@@ -7028,30 +7520,30 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7028
7520
|
}),
|
|
7029
7521
|
[slots, classNames, inputProps, selectedOption, ref]
|
|
7030
7522
|
);
|
|
7031
|
-
const getOptionsWrapperProps = (0,
|
|
7523
|
+
const getOptionsWrapperProps = (0, import_react19.useCallback)(
|
|
7032
7524
|
() => ({
|
|
7033
7525
|
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
7034
7526
|
ref: optionWrapperRef
|
|
7035
7527
|
}),
|
|
7036
7528
|
[slots, classNames]
|
|
7037
7529
|
);
|
|
7038
|
-
const getErrorMessageProps = (0,
|
|
7530
|
+
const getErrorMessageProps = (0, import_react19.useCallback)(
|
|
7039
7531
|
() => ({
|
|
7040
7532
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
7041
7533
|
}),
|
|
7042
7534
|
[slots, classNames]
|
|
7043
7535
|
);
|
|
7044
|
-
return /* @__PURE__ */ (0,
|
|
7045
|
-
/* @__PURE__ */ (0,
|
|
7046
|
-
props.label && /* @__PURE__ */ (0,
|
|
7047
|
-
/* @__PURE__ */ (0,
|
|
7048
|
-
/* @__PURE__ */ (0,
|
|
7049
|
-
/* @__PURE__ */ (0,
|
|
7536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7537
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ...getBaseProps(), children: [
|
|
7538
|
+
props.label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
7539
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-expanded": !!targetRect, ...getSelectWrapperProps(), children: [
|
|
7540
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { ...getSelectProps() }),
|
|
7541
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon_default, { name: !!targetRect ? "arrow-triangle-up" : "arrow-triangle-down", size: originalProps.size, fill: true })
|
|
7050
7542
|
] }),
|
|
7051
|
-
props.errorMessage && /* @__PURE__ */ (0,
|
|
7543
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
7052
7544
|
] }),
|
|
7053
|
-
targetRect && /* @__PURE__ */ (0,
|
|
7054
|
-
/* @__PURE__ */ (0,
|
|
7545
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: (0, import_react_dom.createPortal)(
|
|
7546
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7055
7547
|
"div",
|
|
7056
7548
|
{
|
|
7057
7549
|
...getOptionsWrapperProps(),
|
|
@@ -7061,7 +7553,7 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7061
7553
|
left: position == null ? void 0 : position.left,
|
|
7062
7554
|
width: targetRect.width
|
|
7063
7555
|
},
|
|
7064
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
7556
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7065
7557
|
option_default,
|
|
7066
7558
|
{
|
|
7067
7559
|
variant: originalProps.variant,
|
|
@@ -7210,16 +7702,16 @@ var select = tv({
|
|
|
7210
7702
|
});
|
|
7211
7703
|
|
|
7212
7704
|
// src/components/chip/chip.tsx
|
|
7213
|
-
var
|
|
7214
|
-
var
|
|
7215
|
-
var Chip = (0,
|
|
7705
|
+
var import_react20 = require("react");
|
|
7706
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7707
|
+
var Chip = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
7216
7708
|
var _a;
|
|
7217
7709
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
7218
7710
|
const props = { ...rawProps, ...variantProps };
|
|
7219
7711
|
const Component = props.onClick ? "button" : "div";
|
|
7220
|
-
const slots = (0,
|
|
7221
|
-
const renderIcon = (name) => name ? /* @__PURE__ */ (0,
|
|
7222
|
-
return /* @__PURE__ */ (0,
|
|
7712
|
+
const slots = (0, import_react20.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
7713
|
+
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
7714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7223
7715
|
Component,
|
|
7224
7716
|
{
|
|
7225
7717
|
ref,
|
|
@@ -7394,13 +7886,13 @@ var chipStyle = tv({
|
|
|
7394
7886
|
});
|
|
7395
7887
|
|
|
7396
7888
|
// src/components/radio/radio.tsx
|
|
7397
|
-
var
|
|
7398
|
-
var
|
|
7399
|
-
var Radio = (0,
|
|
7889
|
+
var import_react21 = require("react");
|
|
7890
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7891
|
+
var Radio = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
7400
7892
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
7401
7893
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
7402
|
-
const slots = (0,
|
|
7403
|
-
return /* @__PURE__ */ (0,
|
|
7894
|
+
const slots = (0, import_react21.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
7895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
7404
7896
|
"label",
|
|
7405
7897
|
{
|
|
7406
7898
|
className: clsx(
|
|
@@ -7408,9 +7900,9 @@ var Radio = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
|
7408
7900
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
7409
7901
|
),
|
|
7410
7902
|
children: [
|
|
7411
|
-
/* @__PURE__ */ (0,
|
|
7412
|
-
/* @__PURE__ */ (0,
|
|
7413
|
-
/* @__PURE__ */ (0,
|
|
7903
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { ...inputProps, type: "radio", ref }) }),
|
|
7904
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: slots.outerDot({ class: classNames == null ? void 0 : classNames.outerDot }), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: slots.innerDot({ class: classNames == null ? void 0 : classNames.innerDot }) }) }),
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: slots.labelWrapper({ class: classNames == null ? void 0 : classNames.labelWrapper }), children: children && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children }) })
|
|
7414
7906
|
]
|
|
7415
7907
|
}
|
|
7416
7908
|
);
|
|
@@ -7550,21 +8042,21 @@ var radioStyle = tv({
|
|
|
7550
8042
|
});
|
|
7551
8043
|
|
|
7552
8044
|
// src/components/switch/switch.tsx
|
|
7553
|
-
var
|
|
7554
|
-
var
|
|
7555
|
-
var
|
|
7556
|
-
var Switch = (0,
|
|
8045
|
+
var import_react22 = require("react");
|
|
8046
|
+
var import_tailwind_variants19 = require("tailwind-variants");
|
|
8047
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8048
|
+
var Switch = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
7557
8049
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
7558
8050
|
const { size, color, isDisabled, disableAnimation, id, classNames, ...inputProps } = { ...rawProps, ...variantProps };
|
|
7559
|
-
const slots = (0,
|
|
7560
|
-
return /* @__PURE__ */ (0,
|
|
7561
|
-
/* @__PURE__ */ (0,
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
8051
|
+
const slots = (0, import_react22.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
8052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
8053
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { ...inputProps, id, ref, type: "checkbox", disabled: isDisabled, className: "hidden" }),
|
|
8054
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.outerWrapper({ class: classNames == null ? void 0 : classNames.outerWrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: slots.thumb({ class: classNames == null ? void 0 : classNames.thumb }) }) }) })
|
|
7563
8055
|
] });
|
|
7564
8056
|
});
|
|
7565
8057
|
Switch.displayName = "Switch";
|
|
7566
8058
|
var switch_default = Switch;
|
|
7567
|
-
var switchStyle = (0,
|
|
8059
|
+
var switchStyle = (0, import_tailwind_variants19.tv)({
|
|
7568
8060
|
slots: {
|
|
7569
8061
|
base: ["group/switch", "relative", "max-w-fit", "inline-flex", "items-center", "justify-start", "cursor-pointer"],
|
|
7570
8062
|
outerWrapper: [
|
|
@@ -7669,7 +8161,7 @@ var switchStyle = (0, import_tailwind_variants17.tv)({
|
|
|
7669
8161
|
});
|
|
7670
8162
|
|
|
7671
8163
|
// src/components/tooltip/tooltip.tsx
|
|
7672
|
-
var
|
|
8164
|
+
var import_react24 = require("react");
|
|
7673
8165
|
var import_react_dom2 = require("react-dom");
|
|
7674
8166
|
|
|
7675
8167
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -7792,11 +8284,11 @@ var getTailStyles = (placement) => {
|
|
|
7792
8284
|
};
|
|
7793
8285
|
|
|
7794
8286
|
// src/components/tooltip/useTooltip.ts
|
|
7795
|
-
var
|
|
8287
|
+
var import_react23 = require("react");
|
|
7796
8288
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
7797
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
7798
|
-
const tooltipRef = (0,
|
|
7799
|
-
(0,
|
|
8289
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react23.useState)({ x: 0, y: 0 });
|
|
8290
|
+
const tooltipRef = (0, import_react23.useRef)(null);
|
|
8291
|
+
(0, import_react23.useEffect)(() => {
|
|
7800
8292
|
if (targetRect && tooltipRef.current) {
|
|
7801
8293
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
7802
8294
|
const scrollX = window.scrollX;
|
|
@@ -7826,29 +8318,29 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
7826
8318
|
};
|
|
7827
8319
|
|
|
7828
8320
|
// src/components/tooltip/tooltip.tsx
|
|
7829
|
-
var
|
|
7830
|
-
var Tooltip = (0,
|
|
8321
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8322
|
+
var Tooltip = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
7831
8323
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
7832
8324
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames } = props;
|
|
7833
|
-
const slots = (0,
|
|
7834
|
-
const [targetRect, setTargetRect] = (0,
|
|
8325
|
+
const slots = (0, import_react24.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
8326
|
+
const [targetRect, setTargetRect] = (0, import_react24.useState)(null);
|
|
7835
8327
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
7836
8328
|
placement,
|
|
7837
8329
|
offset,
|
|
7838
8330
|
delay,
|
|
7839
8331
|
targetRect
|
|
7840
8332
|
});
|
|
7841
|
-
const childrenRef = (0,
|
|
7842
|
-
const delayTimeoutRef = (0,
|
|
7843
|
-
const getProps = (0,
|
|
8333
|
+
const childrenRef = (0, import_react24.useRef)(null);
|
|
8334
|
+
const delayTimeoutRef = (0, import_react24.useRef)(null);
|
|
8335
|
+
const getProps = (0, import_react24.useCallback)(
|
|
7844
8336
|
(slotKey, classNameKey) => ({
|
|
7845
8337
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
7846
8338
|
}),
|
|
7847
8339
|
[slots, classNames]
|
|
7848
8340
|
);
|
|
7849
|
-
const getBaseProps = (0,
|
|
7850
|
-
const getContentProps = (0,
|
|
7851
|
-
const showTooltip = (0,
|
|
8341
|
+
const getBaseProps = (0, import_react24.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
8342
|
+
const getContentProps = (0, import_react24.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
8343
|
+
const showTooltip = (0, import_react24.useCallback)(() => {
|
|
7852
8344
|
if (childrenRef.current) {
|
|
7853
8345
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
7854
8346
|
setTargetRect({
|
|
@@ -7861,16 +8353,16 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7861
8353
|
});
|
|
7862
8354
|
}
|
|
7863
8355
|
}, []);
|
|
7864
|
-
const hideTooltip = (0,
|
|
8356
|
+
const hideTooltip = (0, import_react24.useCallback)(() => {
|
|
7865
8357
|
if (!persistent) {
|
|
7866
8358
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
7867
8359
|
}
|
|
7868
8360
|
}, [persistent, delay]);
|
|
7869
|
-
(0,
|
|
8361
|
+
(0, import_react24.useEffect)(() => {
|
|
7870
8362
|
if (persistent) showTooltip();
|
|
7871
8363
|
}, [persistent, showTooltip]);
|
|
7872
|
-
return /* @__PURE__ */ (0,
|
|
7873
|
-
/* @__PURE__ */ (0,
|
|
8364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
8365
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7874
8366
|
"div",
|
|
7875
8367
|
{
|
|
7876
8368
|
ref: (node) => {
|
|
@@ -7887,7 +8379,7 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7887
8379
|
}
|
|
7888
8380
|
),
|
|
7889
8381
|
targetRect && (0, import_react_dom2.createPortal)(
|
|
7890
|
-
/* @__PURE__ */ (0,
|
|
8382
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7891
8383
|
"div",
|
|
7892
8384
|
{
|
|
7893
8385
|
ref: tooltipRef,
|
|
@@ -7900,7 +8392,7 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7900
8392
|
},
|
|
7901
8393
|
children: [
|
|
7902
8394
|
props.content,
|
|
7903
|
-
variantProps.tail && /* @__PURE__ */ (0,
|
|
8395
|
+
variantProps.tail && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7904
8396
|
"div",
|
|
7905
8397
|
{
|
|
7906
8398
|
className: `absolute h-2 w-2 rotate-45 bg-inherit ${getTailClassName(placement)}`,
|
|
@@ -7951,10 +8443,10 @@ var tooltipStyle = tv({
|
|
|
7951
8443
|
});
|
|
7952
8444
|
|
|
7953
8445
|
// src/components/modal/modal.tsx
|
|
7954
|
-
var
|
|
8446
|
+
var import_react25 = require("react");
|
|
7955
8447
|
var import_react_dom3 = require("react-dom");
|
|
7956
|
-
var
|
|
7957
|
-
var Modal = (0,
|
|
8448
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8449
|
+
var Modal = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
7958
8450
|
const [props, variantProps] = mapPropsVariants(originalProps, modal.variantKeys);
|
|
7959
8451
|
const {
|
|
7960
8452
|
classNames,
|
|
@@ -7971,8 +8463,8 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
7971
8463
|
onConfirm,
|
|
7972
8464
|
onCancel
|
|
7973
8465
|
} = props;
|
|
7974
|
-
const slots = (0,
|
|
7975
|
-
const getBackdropProps = (0,
|
|
8466
|
+
const slots = (0, import_react25.useMemo)(() => modal({ ...variantProps }), [...Object.values(variantProps)]);
|
|
8467
|
+
const getBackdropProps = (0, import_react25.useCallback)(
|
|
7976
8468
|
() => ({
|
|
7977
8469
|
className: slots.backdrop({ class: classNames == null ? void 0 : classNames.backdrop }),
|
|
7978
8470
|
onClick: (e) => {
|
|
@@ -7983,68 +8475,68 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
7983
8475
|
}),
|
|
7984
8476
|
[slots, classNames == null ? void 0 : classNames.backdrop, isDismissable, onCancel]
|
|
7985
8477
|
);
|
|
7986
|
-
const getModalWrapperProps = (0,
|
|
8478
|
+
const getModalWrapperProps = (0, import_react25.useCallback)(
|
|
7987
8479
|
() => ({
|
|
7988
8480
|
className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }),
|
|
7989
8481
|
"data-icon-visibility": typeof icon !== "undefined"
|
|
7990
8482
|
}),
|
|
7991
8483
|
[slots, classNames == null ? void 0 : classNames.modalWrapper, icon]
|
|
7992
8484
|
);
|
|
7993
|
-
const getIconProps = (0,
|
|
8485
|
+
const getIconProps = (0, import_react25.useCallback)(
|
|
7994
8486
|
() => ({
|
|
7995
8487
|
className: slots.icon({ class: [classNames == null ? void 0 : classNames.icon] })
|
|
7996
8488
|
}),
|
|
7997
8489
|
[slots, classNames == null ? void 0 : classNames.icon]
|
|
7998
8490
|
);
|
|
7999
|
-
const getCloseIconProps = (0,
|
|
8491
|
+
const getCloseIconProps = (0, import_react25.useCallback)(
|
|
8000
8492
|
() => ({
|
|
8001
8493
|
className: slots.closeIcon({ class: [classNames == null ? void 0 : classNames.closeIcon, showCloseButton ? "" : "hidden"] })
|
|
8002
8494
|
}),
|
|
8003
8495
|
[slots, classNames == null ? void 0 : classNames.closeIcon, showCloseButton]
|
|
8004
8496
|
);
|
|
8005
|
-
const getBodyWrapperProps = (0,
|
|
8497
|
+
const getBodyWrapperProps = (0, import_react25.useCallback)(
|
|
8006
8498
|
() => ({
|
|
8007
8499
|
className: slots.bodyWrapper({ class: classNames == null ? void 0 : classNames.bodyWrapper })
|
|
8008
8500
|
}),
|
|
8009
8501
|
[slots, classNames == null ? void 0 : classNames.bodyWrapper]
|
|
8010
8502
|
);
|
|
8011
|
-
const getTitleWrapperProps = (0,
|
|
8503
|
+
const getTitleWrapperProps = (0, import_react25.useCallback)(
|
|
8012
8504
|
() => ({
|
|
8013
8505
|
className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper })
|
|
8014
8506
|
}),
|
|
8015
8507
|
[slots, classNames == null ? void 0 : classNames.titleWrapper]
|
|
8016
8508
|
);
|
|
8017
|
-
const getTitleProps = (0,
|
|
8509
|
+
const getTitleProps = (0, import_react25.useCallback)(
|
|
8018
8510
|
() => ({
|
|
8019
8511
|
className: slots.title({ class: classNames == null ? void 0 : classNames.title })
|
|
8020
8512
|
}),
|
|
8021
8513
|
[slots, classNames == null ? void 0 : classNames.title]
|
|
8022
8514
|
);
|
|
8023
|
-
const getSubTitleProps = (0,
|
|
8515
|
+
const getSubTitleProps = (0, import_react25.useCallback)(
|
|
8024
8516
|
() => ({
|
|
8025
8517
|
className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle })
|
|
8026
8518
|
}),
|
|
8027
8519
|
[slots, classNames == null ? void 0 : classNames.subTitle]
|
|
8028
8520
|
);
|
|
8029
|
-
const getBodyProps = (0,
|
|
8521
|
+
const getBodyProps = (0, import_react25.useCallback)(
|
|
8030
8522
|
() => ({
|
|
8031
8523
|
className: slots.body({ class: classNames == null ? void 0 : classNames.body })
|
|
8032
8524
|
}),
|
|
8033
8525
|
[slots, classNames == null ? void 0 : classNames.body]
|
|
8034
8526
|
);
|
|
8035
|
-
const getContentProps = (0,
|
|
8527
|
+
const getContentProps = (0, import_react25.useCallback)(
|
|
8036
8528
|
() => ({
|
|
8037
8529
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content })
|
|
8038
8530
|
}),
|
|
8039
8531
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
8040
8532
|
);
|
|
8041
|
-
const getFooterWrapperProps = (0,
|
|
8533
|
+
const getFooterWrapperProps = (0, import_react25.useCallback)(
|
|
8042
8534
|
() => ({
|
|
8043
8535
|
className: slots.footerWrapper({ class: classNames == null ? void 0 : classNames.footerWrapper })
|
|
8044
8536
|
}),
|
|
8045
8537
|
[slots, classNames == null ? void 0 : classNames.footerWrapper]
|
|
8046
8538
|
);
|
|
8047
|
-
(0,
|
|
8539
|
+
(0, import_react25.useEffect)(() => {
|
|
8048
8540
|
if (isOpen) {
|
|
8049
8541
|
document.body.classList.add("overflow-hidden");
|
|
8050
8542
|
} else {
|
|
@@ -8062,20 +8554,20 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
8062
8554
|
document.body.classList.remove("overflow-hidden");
|
|
8063
8555
|
};
|
|
8064
8556
|
}, [isOpen, isKeyboardDismissDisabled, onCancel]);
|
|
8065
|
-
return /* @__PURE__ */ (0,
|
|
8066
|
-
/* @__PURE__ */ (0,
|
|
8067
|
-
typeof icon === "string" ? /* @__PURE__ */ (0,
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8069
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
8070
|
-
/* @__PURE__ */ (0,
|
|
8071
|
-
(title || subTitle) && /* @__PURE__ */ (0,
|
|
8072
|
-
title && /* @__PURE__ */ (0,
|
|
8073
|
-
subTitle && /* @__PURE__ */ (0,
|
|
8557
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: isOpen && (0, import_react_dom3.createPortal)(
|
|
8558
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getBackdropProps(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref, ...getModalWrapperProps(), children: [
|
|
8559
|
+
typeof icon === "string" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getIconProps(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon_default, { name: icon, className: "h-[80px] w-[80px]" }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getIconProps(), children: icon }),
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getBodyWrapperProps(), children: [
|
|
8561
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon_default, { name: "close", ...getCloseIconProps(), onClick: onCancel }),
|
|
8562
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getBodyProps(), children: [
|
|
8563
|
+
(title || subTitle) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getTitleWrapperProps(), children: [
|
|
8564
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getTitleProps(), children: title }),
|
|
8565
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getSubTitleProps(), children: subTitle })
|
|
8074
8566
|
] }),
|
|
8075
|
-
content && typeof content === "string" ? /* @__PURE__ */ (0,
|
|
8076
|
-
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0,
|
|
8077
|
-
cancelButtonText && /* @__PURE__ */ (0,
|
|
8078
|
-
confirmButtonText && /* @__PURE__ */ (0,
|
|
8567
|
+
content && typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getContentProps(), children: content }) : content,
|
|
8568
|
+
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getFooterWrapperProps(), children: [
|
|
8569
|
+
cancelButtonText && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(button_default, { variant: "outline", color: originalProps.color, fullWidth: true, onClick: onCancel, children: cancelButtonText }),
|
|
8570
|
+
confirmButtonText && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(button_default, { size: "md", color: originalProps.color, fullWidth: true, onClick: onConfirm, children: confirmButtonText })
|
|
8079
8571
|
] })
|
|
8080
8572
|
] })
|
|
8081
8573
|
] })
|
|
@@ -8146,15 +8638,15 @@ var modal = tv({
|
|
|
8146
8638
|
});
|
|
8147
8639
|
|
|
8148
8640
|
// src/components/list/list.tsx
|
|
8149
|
-
var
|
|
8150
|
-
var
|
|
8151
|
-
var List = (0,
|
|
8641
|
+
var import_react26 = require("react");
|
|
8642
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8643
|
+
var List = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
8152
8644
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
8153
8645
|
const { children, classNames } = props;
|
|
8154
|
-
const slots = (0,
|
|
8155
|
-
return /* @__PURE__ */ (0,
|
|
8156
|
-
if (!(0,
|
|
8157
|
-
return (0,
|
|
8646
|
+
const slots = (0, import_react26.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
8647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: import_react26.Children.map(children, (child) => {
|
|
8648
|
+
if (!(0, import_react26.isValidElement)(child)) return child;
|
|
8649
|
+
return (0, import_react26.cloneElement)(child, {
|
|
8158
8650
|
...variantProps,
|
|
8159
8651
|
...child.props
|
|
8160
8652
|
});
|
|
@@ -8191,9 +8683,9 @@ var listStyle = tv({
|
|
|
8191
8683
|
});
|
|
8192
8684
|
|
|
8193
8685
|
// src/components/list/listItem.tsx
|
|
8194
|
-
var
|
|
8195
|
-
var
|
|
8196
|
-
var ListItem = (0,
|
|
8686
|
+
var import_react27 = require("react");
|
|
8687
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8688
|
+
var ListItem = (0, import_react27.forwardRef)((props, ref) => {
|
|
8197
8689
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
8198
8690
|
const {
|
|
8199
8691
|
title,
|
|
@@ -8205,19 +8697,19 @@ var ListItem = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
8205
8697
|
classNames,
|
|
8206
8698
|
onClick
|
|
8207
8699
|
} = { ...rawProps, ...variantProps };
|
|
8208
|
-
const slots = (0,
|
|
8700
|
+
const slots = (0, import_react27.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
8209
8701
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
8210
8702
|
const avatarSize = iconSize;
|
|
8211
|
-
return /* @__PURE__ */ (0,
|
|
8212
|
-
/* @__PURE__ */ (0,
|
|
8213
|
-
avatar && /* @__PURE__ */ (0,
|
|
8214
|
-
startIconName && /* @__PURE__ */ (0,
|
|
8215
|
-
/* @__PURE__ */ (0,
|
|
8216
|
-
/* @__PURE__ */ (0,
|
|
8217
|
-
subTitle && /* @__PURE__ */ (0,
|
|
8703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
8704
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
8705
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(avatar_default, { ...avatar, variant: "round", size: avatarSize }),
|
|
8706
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: startIconName, fill: true, size, className: slots.startIcon({ class: classNames == null ? void 0 : classNames.startIcon }) }),
|
|
8707
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper }), children: [
|
|
8708
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
8709
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle }), children: subTitle })
|
|
8218
8710
|
] })
|
|
8219
8711
|
] }),
|
|
8220
|
-
/* @__PURE__ */ (0,
|
|
8712
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: "right-chevron", size: iconSize, className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) })
|
|
8221
8713
|
] });
|
|
8222
8714
|
});
|
|
8223
8715
|
ListItem.displayName = "ListItem";
|
|
@@ -8385,14 +8877,14 @@ var listItemStyle = tv({
|
|
|
8385
8877
|
});
|
|
8386
8878
|
|
|
8387
8879
|
// src/components/toast/toast.tsx
|
|
8388
|
-
var
|
|
8389
|
-
var
|
|
8390
|
-
var Toast = (0,
|
|
8880
|
+
var import_react28 = require("react");
|
|
8881
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8882
|
+
var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
8391
8883
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
8392
8884
|
const { width = 300, placement, classNames, showIcon = true, showCloseButton = true, onClose, ...toastProps } = props;
|
|
8393
|
-
const slots = (0,
|
|
8394
|
-
const toastRef = (0,
|
|
8395
|
-
(0,
|
|
8885
|
+
const slots = (0, import_react28.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
8886
|
+
const toastRef = (0, import_react28.useRef)(null);
|
|
8887
|
+
(0, import_react28.useImperativeHandle)(
|
|
8396
8888
|
ref,
|
|
8397
8889
|
() => ({
|
|
8398
8890
|
getWidth: () => {
|
|
@@ -8403,7 +8895,7 @@ var Toast = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
|
8403
8895
|
}),
|
|
8404
8896
|
[]
|
|
8405
8897
|
);
|
|
8406
|
-
const getBaseProps = (0,
|
|
8898
|
+
const getBaseProps = (0, import_react28.useCallback)(
|
|
8407
8899
|
() => ({
|
|
8408
8900
|
className: slots.base({
|
|
8409
8901
|
class: [
|
|
@@ -8415,10 +8907,10 @@ var Toast = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
|
8415
8907
|
}),
|
|
8416
8908
|
[slots, classNames == null ? void 0 : classNames.base]
|
|
8417
8909
|
);
|
|
8418
|
-
return /* @__PURE__ */ (0,
|
|
8419
|
-
showIcon && /* @__PURE__ */ (0,
|
|
8420
|
-
/* @__PURE__ */ (0,
|
|
8421
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
8910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { ref: toastRef, ...getBaseProps(), children: [
|
|
8911
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
|
|
8912
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1 select-none", children: props.content }),
|
|
8913
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "close", className: "cursor-pointer mt-[2px]", onClick: onClose })
|
|
8422
8914
|
] });
|
|
8423
8915
|
});
|
|
8424
8916
|
Toast.displayName = "Toast";
|
|
@@ -8488,7 +8980,7 @@ var toast = tv({
|
|
|
8488
8980
|
});
|
|
8489
8981
|
|
|
8490
8982
|
// src/components/toast/use-toast.tsx
|
|
8491
|
-
var
|
|
8983
|
+
var import_react29 = require("react");
|
|
8492
8984
|
|
|
8493
8985
|
// src/components/toast/toast-utils.ts
|
|
8494
8986
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -8527,10 +9019,10 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
8527
9019
|
};
|
|
8528
9020
|
|
|
8529
9021
|
// src/components/toast/use-toast.tsx
|
|
8530
|
-
var
|
|
8531
|
-
var ToastContext = (0,
|
|
9022
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
9023
|
+
var ToastContext = (0, import_react29.createContext)(null);
|
|
8532
9024
|
var useToast = () => {
|
|
8533
|
-
const context = (0,
|
|
9025
|
+
const context = (0, import_react29.useContext)(ToastContext);
|
|
8534
9026
|
if (!context) {
|
|
8535
9027
|
throw new Error("useToast must be used within a ToastProvider");
|
|
8536
9028
|
}
|
|
@@ -8540,10 +9032,10 @@ var ToastProvider = ({
|
|
|
8540
9032
|
globalOptions,
|
|
8541
9033
|
children
|
|
8542
9034
|
}) => {
|
|
8543
|
-
const [toasts, setToasts] = (0,
|
|
8544
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
8545
|
-
const toastRef = (0,
|
|
8546
|
-
const addToast = (0,
|
|
9035
|
+
const [toasts, setToasts] = (0, import_react29.useState)([]);
|
|
9036
|
+
const [containerStyle, setContainerStyle] = (0, import_react29.useState)({});
|
|
9037
|
+
const toastRef = (0, import_react29.useRef)(null);
|
|
9038
|
+
const addToast = (0, import_react29.useCallback)((content, options) => {
|
|
8547
9039
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
8548
9040
|
const newToast = {
|
|
8549
9041
|
id,
|
|
@@ -8555,7 +9047,7 @@ var ToastProvider = ({
|
|
|
8555
9047
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8556
9048
|
}, options.duration || 3e3);
|
|
8557
9049
|
}, []);
|
|
8558
|
-
const removeToast = (0,
|
|
9050
|
+
const removeToast = (0, import_react29.useCallback)((id) => {
|
|
8559
9051
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8560
9052
|
}, []);
|
|
8561
9053
|
const value = {
|
|
@@ -8571,7 +9063,7 @@ var ToastProvider = ({
|
|
|
8571
9063
|
}),
|
|
8572
9064
|
error: (content, options) => addToast(content, { type: "error", icon: "exclamation-circle", color: "danger", ...globalOptions, ...options })
|
|
8573
9065
|
};
|
|
8574
|
-
(0,
|
|
9066
|
+
(0, import_react29.useEffect)(() => {
|
|
8575
9067
|
var _a;
|
|
8576
9068
|
const width = (globalOptions == null ? void 0 : globalOptions.width) ? globalOptions == null ? void 0 : globalOptions.width : typeof ((_a = toastRef.current) == null ? void 0 : _a.getWidth) === "function" ? toastRef.current.getWidth() : 300;
|
|
8577
9069
|
const offset = 20;
|
|
@@ -8590,18 +9082,18 @@ var ToastProvider = ({
|
|
|
8590
9082
|
window.addEventListener("resize", calculatePosition);
|
|
8591
9083
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
8592
9084
|
}, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
|
|
8593
|
-
return /* @__PURE__ */ (0,
|
|
9085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ToastContext.Provider, { value, children: [
|
|
8594
9086
|
children,
|
|
8595
|
-
/* @__PURE__ */ (0,
|
|
9087
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { id: "deepnoid-toast-container", className: "flex flex-col gap-[10px]", style: containerStyle, children: toasts.map((toast2) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(toast_default, { ref: toastRef, onClose: () => removeToast(toast2.id), ...toast2 }, toast2.id)) })
|
|
8596
9088
|
] });
|
|
8597
9089
|
};
|
|
8598
9090
|
|
|
8599
9091
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8600
|
-
var
|
|
9092
|
+
var import_react33 = __toESM(require("react"));
|
|
8601
9093
|
var import_react_dom4 = require("react-dom");
|
|
8602
9094
|
|
|
8603
9095
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8604
|
-
var
|
|
9096
|
+
var import_react30 = require("react");
|
|
8605
9097
|
|
|
8606
9098
|
// src/components/dateTimePicker/util.ts
|
|
8607
9099
|
var formatDateToString = (date) => {
|
|
@@ -8617,17 +9109,17 @@ var formatStringToDate = (date) => {
|
|
|
8617
9109
|
|
|
8618
9110
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8619
9111
|
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
8620
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
9112
|
+
const [selectedDate, setSelectedDate] = (0, import_react30.useState)(
|
|
8621
9113
|
initialDate ? formatDateToString(initialDate) : ""
|
|
8622
9114
|
);
|
|
8623
|
-
const [selectedTime, setSelectedTime] = (0,
|
|
8624
|
-
const [targetRect, setTargetRect] = (0,
|
|
8625
|
-
const [popupWidth, setPopupWidth] = (0,
|
|
8626
|
-
const [popupHeight, setPopupHeight] = (0,
|
|
8627
|
-
const [isFocusInput, setIsFocusInput] = (0,
|
|
8628
|
-
const dateInputRef = (0,
|
|
8629
|
-
const datePickerWrapperRef = (0,
|
|
8630
|
-
const datePickerRef = (0,
|
|
9115
|
+
const [selectedTime, setSelectedTime] = (0, import_react30.useState)(initialTime ? initialTime : "");
|
|
9116
|
+
const [targetRect, setTargetRect] = (0, import_react30.useState)(null);
|
|
9117
|
+
const [popupWidth, setPopupWidth] = (0, import_react30.useState)(0);
|
|
9118
|
+
const [popupHeight, setPopupHeight] = (0, import_react30.useState)(0);
|
|
9119
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react30.useState)(false);
|
|
9120
|
+
const dateInputRef = (0, import_react30.useRef)(null);
|
|
9121
|
+
const datePickerWrapperRef = (0, import_react30.useRef)(null);
|
|
9122
|
+
const datePickerRef = (0, import_react30.useRef)(null);
|
|
8631
9123
|
const DATE_PICKER_GAP = 4;
|
|
8632
9124
|
const calculatePositionWithScroll = (targetRect2) => {
|
|
8633
9125
|
if (targetRect2 && popupWidth && popupHeight) {
|
|
@@ -8660,7 +9152,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8660
9152
|
const handleBlueInput = () => {
|
|
8661
9153
|
setIsFocusInput(false);
|
|
8662
9154
|
};
|
|
8663
|
-
(0,
|
|
9155
|
+
(0, import_react30.useEffect)(() => {
|
|
8664
9156
|
const onClickOutside = (e) => {
|
|
8665
9157
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
8666
9158
|
setTargetRect(null);
|
|
@@ -8669,7 +9161,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8669
9161
|
window.addEventListener("mousedown", onClickOutside);
|
|
8670
9162
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
8671
9163
|
}, []);
|
|
8672
|
-
(0,
|
|
9164
|
+
(0, import_react30.useEffect)(() => {
|
|
8673
9165
|
if (datePickerWrapperRef.current) {
|
|
8674
9166
|
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
8675
9167
|
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
@@ -8694,19 +9186,19 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8694
9186
|
};
|
|
8695
9187
|
|
|
8696
9188
|
// src/components/dateTimePicker/calendar.tsx
|
|
8697
|
-
var
|
|
8698
|
-
var
|
|
8699
|
-
var Calendar = (0,
|
|
9189
|
+
var import_react31 = __toESM(require("react"));
|
|
9190
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
9191
|
+
var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
8700
9192
|
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
8701
9193
|
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
8702
|
-
const [currentDate, setCurrentDate] = (0,
|
|
9194
|
+
const [currentDate, setCurrentDate] = (0, import_react31.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
8703
9195
|
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
8704
|
-
(0,
|
|
9196
|
+
(0, import_react31.useEffect)(() => {
|
|
8705
9197
|
if (selectedDate) {
|
|
8706
9198
|
setCurrentDate(new Date(selectedDate));
|
|
8707
9199
|
}
|
|
8708
9200
|
}, [selectedDate]);
|
|
8709
|
-
const getCalendarDates = (0,
|
|
9201
|
+
const getCalendarDates = (0, import_react31.useCallback)(() => {
|
|
8710
9202
|
const year = currentDate.getFullYear();
|
|
8711
9203
|
const month = currentDate.getMonth();
|
|
8712
9204
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -8752,17 +9244,17 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8752
9244
|
onChangeDate(formatted);
|
|
8753
9245
|
}
|
|
8754
9246
|
};
|
|
8755
|
-
(0,
|
|
9247
|
+
(0, import_react31.useImperativeHandle)(ref, () => ({
|
|
8756
9248
|
getSelectedDate: () => selectedDate
|
|
8757
9249
|
}));
|
|
8758
|
-
const slots = (0,
|
|
8759
|
-
const getBaseProps = (0,
|
|
9250
|
+
const slots = (0, import_react31.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
9251
|
+
const getBaseProps = (0, import_react31.useCallback)(
|
|
8760
9252
|
() => ({
|
|
8761
9253
|
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
8762
9254
|
}),
|
|
8763
9255
|
[slots, classNames]
|
|
8764
9256
|
);
|
|
8765
|
-
const getDateTitleProps = (0,
|
|
9257
|
+
const getDateTitleProps = (0, import_react31.useCallback)(
|
|
8766
9258
|
(index) => {
|
|
8767
9259
|
return {
|
|
8768
9260
|
className: `${slots.dateTitle({
|
|
@@ -8774,7 +9266,7 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8774
9266
|
},
|
|
8775
9267
|
[slots, classNames, highlightWeekend]
|
|
8776
9268
|
);
|
|
8777
|
-
const getDateProps = (0,
|
|
9269
|
+
const getDateProps = (0, import_react31.useCallback)(
|
|
8778
9270
|
(dateObj) => {
|
|
8779
9271
|
const today = /* @__PURE__ */ new Date();
|
|
8780
9272
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -8796,18 +9288,18 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8796
9288
|
[slots, classNames, selectedDate, currentDate, highlightWeekend]
|
|
8797
9289
|
);
|
|
8798
9290
|
const calendarDates = getCalendarDates();
|
|
8799
|
-
return /* @__PURE__ */ (0,
|
|
8800
|
-
/* @__PURE__ */ (0,
|
|
8801
|
-
/* @__PURE__ */ (0,
|
|
8802
|
-
/* @__PURE__ */ (0,
|
|
8803
|
-
/* @__PURE__ */ (0,
|
|
9291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ...getBaseProps(), children: [
|
|
9292
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "calendar-header flex justify-between items-center mb-4", children: [
|
|
9293
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "brace-left", size: "md", className: "cursor-pointer", onClick: handlePrevMonth }),
|
|
9294
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-h6 font-semibold", children: currentDate.toLocaleString("default", { year: "numeric", month: "2-digit" }) }),
|
|
9295
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "brace-right", size: "md", className: "cursor-pointer", onClick: handleNextMonth })
|
|
8804
9296
|
] }),
|
|
8805
|
-
/* @__PURE__ */ (0,
|
|
8806
|
-
/* @__PURE__ */ (0,
|
|
9297
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-7 gap-2 text-center", children: daysOfWeek.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...getDateTitleProps(index), children: day }, `${day}-${index}`)) }),
|
|
9298
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
8807
9299
|
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
8808
9300
|
if (!hasCurrentMonthDates) return null;
|
|
8809
|
-
return /* @__PURE__ */ (0,
|
|
8810
|
-
return /* @__PURE__ */ (0,
|
|
9301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react31.default.Fragment, { children: week.map((dateObj, index) => {
|
|
9302
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
8811
9303
|
}) }, weekIndex);
|
|
8812
9304
|
}) })
|
|
8813
9305
|
] }) });
|
|
@@ -8878,22 +9370,22 @@ var calendarStyle = tv({
|
|
|
8878
9370
|
});
|
|
8879
9371
|
|
|
8880
9372
|
// src/components/dateTimePicker/timePicker.tsx
|
|
8881
|
-
var
|
|
8882
|
-
var
|
|
9373
|
+
var import_react32 = require("react");
|
|
9374
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
8883
9375
|
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
8884
9376
|
const TOTAL_HOURS = 12;
|
|
8885
9377
|
const TOTAL_MINUTES = 60;
|
|
8886
9378
|
const ITEM_HEIGHT = 30;
|
|
8887
9379
|
const PERIODS = ["AM", "PM"];
|
|
8888
|
-
const [selectedHour, setSelectedHour] = (0,
|
|
8889
|
-
const [selectedMinute, setSelectedMinute] = (0,
|
|
8890
|
-
const [selectedPeriod, setSelectedPeriod] = (0,
|
|
8891
|
-
const hourRef = (0,
|
|
8892
|
-
const minuteRef = (0,
|
|
8893
|
-
const periodRef = (0,
|
|
9380
|
+
const [selectedHour, setSelectedHour] = (0, import_react32.useState)("01");
|
|
9381
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react32.useState)("00");
|
|
9382
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react32.useState)("AM");
|
|
9383
|
+
const hourRef = (0, import_react32.useRef)(null);
|
|
9384
|
+
const minuteRef = (0, import_react32.useRef)(null);
|
|
9385
|
+
const periodRef = (0, import_react32.useRef)(null);
|
|
8894
9386
|
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
8895
9387
|
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
8896
|
-
(0,
|
|
9388
|
+
(0, import_react32.useEffect)(() => {
|
|
8897
9389
|
if (selectedTime) {
|
|
8898
9390
|
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
8899
9391
|
setSelectedHour(formattedHour);
|
|
@@ -8904,7 +9396,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8904
9396
|
scrollToSelectedTime();
|
|
8905
9397
|
}
|
|
8906
9398
|
}, [selectedTime, isFocusInput]);
|
|
8907
|
-
(0,
|
|
9399
|
+
(0, import_react32.useEffect)(() => {
|
|
8908
9400
|
scrollToSelectedTime();
|
|
8909
9401
|
}, []);
|
|
8910
9402
|
const parseAndFormatTime = (time) => {
|
|
@@ -8941,8 +9433,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8941
9433
|
onChangeTime(formattedTime);
|
|
8942
9434
|
}
|
|
8943
9435
|
};
|
|
8944
|
-
return /* @__PURE__ */ (0,
|
|
8945
|
-
/* @__PURE__ */ (0,
|
|
9436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex h-[200px] p-[10px] gap-[5px] border border-neutral-main rounded-md bg-background shadow-lg", children: [
|
|
9437
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(list_default, { ref: periodRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: PERIODS.map((period, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8946
9438
|
listItem_default,
|
|
8947
9439
|
{
|
|
8948
9440
|
color,
|
|
@@ -8956,7 +9448,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8956
9448
|
},
|
|
8957
9449
|
`${period}-${index}`
|
|
8958
9450
|
)) }),
|
|
8959
|
-
/* @__PURE__ */ (0,
|
|
9451
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(list_default, { ref: hourRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: hoursArray.map((hour, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8960
9452
|
listItem_default,
|
|
8961
9453
|
{
|
|
8962
9454
|
color,
|
|
@@ -8970,7 +9462,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8970
9462
|
},
|
|
8971
9463
|
`${hour}-${index}`
|
|
8972
9464
|
)) }),
|
|
8973
|
-
/* @__PURE__ */ (0,
|
|
9465
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(list_default, { ref: minuteRef, classNames: { base: "overflow-y-auto scrollbar-hide" }, children: minutesArray.map((minute, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
8974
9466
|
listItem_default,
|
|
8975
9467
|
{
|
|
8976
9468
|
color,
|
|
@@ -8989,8 +9481,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8989
9481
|
var timePicker_default = TimePicker;
|
|
8990
9482
|
|
|
8991
9483
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8992
|
-
var
|
|
8993
|
-
var DatePicker = (0,
|
|
9484
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9485
|
+
var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
8994
9486
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
8995
9487
|
const {
|
|
8996
9488
|
classNames,
|
|
@@ -9004,7 +9496,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9004
9496
|
onChangeTime,
|
|
9005
9497
|
...inputProps
|
|
9006
9498
|
} = props;
|
|
9007
|
-
const slots = (0,
|
|
9499
|
+
const slots = (0, import_react33.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
9008
9500
|
const {
|
|
9009
9501
|
selectedDate,
|
|
9010
9502
|
selectedTime,
|
|
@@ -9025,32 +9517,32 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9025
9517
|
initialTime: typeof value === "string" ? value : void 0
|
|
9026
9518
|
});
|
|
9027
9519
|
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
9028
|
-
const getBaseProps = (0,
|
|
9520
|
+
const getBaseProps = (0, import_react33.useCallback)(
|
|
9029
9521
|
() => ({
|
|
9030
9522
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
9031
9523
|
}),
|
|
9032
9524
|
[slots, classNames]
|
|
9033
9525
|
);
|
|
9034
|
-
const getLabelProps = (0,
|
|
9526
|
+
const getLabelProps = (0, import_react33.useCallback)(
|
|
9035
9527
|
() => ({
|
|
9036
9528
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
9037
9529
|
}),
|
|
9038
9530
|
[slots, classNames]
|
|
9039
9531
|
);
|
|
9040
|
-
const getInnerWrapperProps = (0,
|
|
9532
|
+
const getInnerWrapperProps = (0, import_react33.useCallback)(
|
|
9041
9533
|
() => ({
|
|
9042
9534
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
9043
9535
|
}),
|
|
9044
9536
|
[slots, classNames]
|
|
9045
9537
|
);
|
|
9046
|
-
const getInputWrapperProps = (0,
|
|
9538
|
+
const getInputWrapperProps = (0, import_react33.useCallback)(
|
|
9047
9539
|
() => ({
|
|
9048
9540
|
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
9049
9541
|
ref: datePickerRef
|
|
9050
9542
|
}),
|
|
9051
9543
|
[slots, classNames]
|
|
9052
9544
|
);
|
|
9053
|
-
const getInputProps = (0,
|
|
9545
|
+
const getInputProps = (0, import_react33.useCallback)(
|
|
9054
9546
|
() => ({
|
|
9055
9547
|
...inputProps,
|
|
9056
9548
|
ref: ref || dateInputRef,
|
|
@@ -9081,33 +9573,33 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9081
9573
|
}),
|
|
9082
9574
|
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
9083
9575
|
);
|
|
9084
|
-
const getContentProps = (0,
|
|
9576
|
+
const getContentProps = (0, import_react33.useCallback)(
|
|
9085
9577
|
() => ({
|
|
9086
9578
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
9087
9579
|
size: originalProps.size
|
|
9088
9580
|
}),
|
|
9089
9581
|
[slots, classNames, originalProps.size]
|
|
9090
9582
|
);
|
|
9091
|
-
const getErrorMessageProps = (0,
|
|
9583
|
+
const getErrorMessageProps = (0, import_react33.useCallback)(
|
|
9092
9584
|
() => ({
|
|
9093
9585
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
9094
9586
|
}),
|
|
9095
9587
|
[slots, classNames]
|
|
9096
9588
|
);
|
|
9097
9589
|
const renderStartContent = () => {
|
|
9098
|
-
if (
|
|
9590
|
+
if (import_react33.default.isValidElement(startContent)) {
|
|
9099
9591
|
const existingProps = startContent.props;
|
|
9100
9592
|
const mergedProps = {
|
|
9101
9593
|
...getContentProps(),
|
|
9102
9594
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9103
9595
|
};
|
|
9104
|
-
return
|
|
9596
|
+
return import_react33.default.cloneElement(startContent, mergedProps);
|
|
9105
9597
|
} else {
|
|
9106
9598
|
const contentProps = getContentProps();
|
|
9107
|
-
return /* @__PURE__ */ (0,
|
|
9599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...contentProps, children: startContent });
|
|
9108
9600
|
}
|
|
9109
9601
|
};
|
|
9110
|
-
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0,
|
|
9602
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9111
9603
|
Icon_default,
|
|
9112
9604
|
{
|
|
9113
9605
|
name: type === "time" ? "clock" : "calendar",
|
|
@@ -9117,18 +9609,18 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9117
9609
|
}
|
|
9118
9610
|
) });
|
|
9119
9611
|
const renderContentWithIcon = () => {
|
|
9120
|
-
if (
|
|
9612
|
+
if (import_react33.default.isValidElement(endContent)) {
|
|
9121
9613
|
const existingProps = endContent.props;
|
|
9122
9614
|
const mergedProps = {
|
|
9123
9615
|
...getContentProps(),
|
|
9124
9616
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9125
9617
|
};
|
|
9126
|
-
return
|
|
9618
|
+
return import_react33.default.cloneElement(endContent, mergedProps);
|
|
9127
9619
|
} else if (errorMessage) {
|
|
9128
9620
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
9129
|
-
return /* @__PURE__ */ (0,
|
|
9621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...iconProps, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon_default, { name: "exclamation-circle", fill: true, size: originalProps.size }) });
|
|
9130
9622
|
} else {
|
|
9131
|
-
return /* @__PURE__ */ (0,
|
|
9623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, {});
|
|
9132
9624
|
}
|
|
9133
9625
|
};
|
|
9134
9626
|
const renderEndContent = () => {
|
|
@@ -9143,20 +9635,20 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9143
9635
|
return renderContentWithIcon();
|
|
9144
9636
|
}
|
|
9145
9637
|
};
|
|
9146
|
-
return /* @__PURE__ */ (0,
|
|
9147
|
-
/* @__PURE__ */ (0,
|
|
9148
|
-
label && /* @__PURE__ */ (0,
|
|
9149
|
-
/* @__PURE__ */ (0,
|
|
9150
|
-
/* @__PURE__ */ (0,
|
|
9638
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
9639
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getBaseProps(), children: [
|
|
9640
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { ...getLabelProps(), children: label }),
|
|
9641
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
9642
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getInputWrapperProps(), children: [
|
|
9151
9643
|
startContent && renderStartContent(),
|
|
9152
|
-
/* @__PURE__ */ (0,
|
|
9644
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", { ...getInputProps() }),
|
|
9153
9645
|
renderEndContent()
|
|
9154
9646
|
] }),
|
|
9155
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
9647
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { ...getErrorMessageProps(), children: errorMessage })
|
|
9156
9648
|
] })
|
|
9157
9649
|
] }),
|
|
9158
|
-
targetRect && /* @__PURE__ */ (0,
|
|
9159
|
-
/* @__PURE__ */ (0,
|
|
9650
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: (0, import_react_dom4.createPortal)(
|
|
9651
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
9160
9652
|
"div",
|
|
9161
9653
|
{
|
|
9162
9654
|
ref: datePickerWrapperRef,
|
|
@@ -9167,7 +9659,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9167
9659
|
zIndex: 1e3
|
|
9168
9660
|
},
|
|
9169
9661
|
children: [
|
|
9170
|
-
type === "date" && /* @__PURE__ */ (0,
|
|
9662
|
+
type === "date" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9171
9663
|
calendar_default,
|
|
9172
9664
|
{
|
|
9173
9665
|
color: originalProps.color,
|
|
@@ -9179,7 +9671,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9179
9671
|
}
|
|
9180
9672
|
}
|
|
9181
9673
|
),
|
|
9182
|
-
type === "time" && /* @__PURE__ */ (0,
|
|
9674
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9183
9675
|
timePicker_default,
|
|
9184
9676
|
{
|
|
9185
9677
|
color: originalProps.color,
|
|
@@ -9338,6 +9830,7 @@ var dateTimePickerStyle = tv({
|
|
|
9338
9830
|
Chip,
|
|
9339
9831
|
DateTimePicker,
|
|
9340
9832
|
Icon,
|
|
9833
|
+
IconButton,
|
|
9341
9834
|
Input,
|
|
9342
9835
|
List,
|
|
9343
9836
|
ListItem,
|
|
@@ -9348,6 +9841,7 @@ var dateTimePickerStyle = tv({
|
|
|
9348
9841
|
Switch,
|
|
9349
9842
|
Table,
|
|
9350
9843
|
Tabs,
|
|
9844
|
+
TextButton,
|
|
9351
9845
|
Textarea,
|
|
9352
9846
|
Toast,
|
|
9353
9847
|
ToastProvider,
|