@deepnoid/ui 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +166 -156
- 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-G3LQ3ZX6.mjs → chunk-72JRFZCH.mjs} +4 -4
- 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-M2IRRTFM.mjs → chunk-D7WPZ5C6.mjs} +17 -14
- 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-OHDRKCOC.mjs → chunk-KFBG45BI.mjs} +43 -26
- package/dist/chunk-KSZEUKBY.mjs +143 -0
- 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-QRAHATAM.mjs +380 -0
- package/dist/{chunk-N4F3R6HG.mjs → chunk-WB24YDE2.mjs} +1 -1
- package/dist/{chunk-N4UFXIUC.mjs → chunk-YQGZRSUQ.mjs} +1 -1
- 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 -66
- package/dist/components/breadcrumb/breadcrumb.mjs +13 -3
- package/dist/components/breadcrumb/index.js +257 -66
- 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 +55 -60
- package/dist/components/table/index.mjs +7 -7
- package/dist/components/table/table-body.js +17 -14
- package/dist/components/table/table-body.mjs +1 -1
- package/dist/components/table/table.js +55 -60
- package/dist/components/table/table.mjs +7 -7
- 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 +1115 -619
- package/dist/index.mjs +48 -40
- 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,169 +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, name, 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, 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
|
-
|
|
5394
|
-
|
|
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-auto"]
|
|
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 }) => {
|
|
5661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
5662
|
+
text_button_default,
|
|
5663
|
+
{
|
|
5664
|
+
variant: isCurrent ? "underline" : "non-under",
|
|
5665
|
+
color: isCurrent ? "primary" : "neutral",
|
|
5666
|
+
size,
|
|
5667
|
+
onClick,
|
|
5668
|
+
"aria-label": label,
|
|
5669
|
+
classNames: { base: "font-bold" },
|
|
5670
|
+
children: label
|
|
5671
|
+
}
|
|
5672
|
+
);
|
|
5673
|
+
});
|
|
5674
|
+
var Breadcrumb = (0, import_react8.forwardRef)(({ startIconName, size, menus, classNames }, ref) => {
|
|
5675
|
+
const slots = (0, import_react8.useMemo)(() => breadcrumbStyle({ size }), [size]);
|
|
5676
|
+
const renderMenus = (menus2) => {
|
|
5677
|
+
const flatMenus = [];
|
|
5678
|
+
const flatten = (items) => {
|
|
5679
|
+
var _a;
|
|
5680
|
+
for (const item of items) {
|
|
5681
|
+
flatMenus.push(item);
|
|
5682
|
+
if ((_a = item.children) == null ? void 0 : _a.length) {
|
|
5683
|
+
flatten(item.children);
|
|
5684
|
+
}
|
|
5685
|
+
}
|
|
5686
|
+
};
|
|
5687
|
+
flatten(menus2);
|
|
5688
|
+
return flatMenus.map((menu, index) => {
|
|
5689
|
+
const isLast = index === flatMenus.length - 1;
|
|
5690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
5691
|
+
"li",
|
|
5692
|
+
{
|
|
5693
|
+
className: "flex items-center gap-[5px]",
|
|
5694
|
+
"aria-current": isLast ? "page" : void 0,
|
|
5695
|
+
children: [
|
|
5696
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BreadcrumbMenu, { label: menu.label, onClick: menu.onClick, isCurrent: isLast, size }),
|
|
5697
|
+
!isLast && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: "right", className: slots.separator() })
|
|
5698
|
+
]
|
|
5699
|
+
},
|
|
5700
|
+
`${menu.label}-${index}`
|
|
5701
|
+
);
|
|
5702
|
+
});
|
|
5703
|
+
};
|
|
5704
|
+
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: [
|
|
5705
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Icon_default, { name: startIconName, size, className: `${slots.icon()}` }) }),
|
|
5706
|
+
renderMenus(menus)
|
|
5707
|
+
] }) });
|
|
5708
|
+
});
|
|
5709
|
+
Breadcrumb.displayName = "Breadcrumb";
|
|
5710
|
+
var breadcrumb_default = Breadcrumb;
|
|
5711
|
+
var breadcrumbStyle = tv({
|
|
5712
|
+
slots: {
|
|
5713
|
+
base: ["flex", "items-center"],
|
|
5714
|
+
icon: ["text-primary-main"],
|
|
5715
|
+
separator: ["text-neutral-main"]
|
|
5716
|
+
},
|
|
5717
|
+
variants: {
|
|
5718
|
+
size: {
|
|
5719
|
+
sm: {
|
|
5720
|
+
base: "text-sm",
|
|
5721
|
+
separator: "w-[18px] h-[18px]"
|
|
5722
|
+
},
|
|
5723
|
+
md: {
|
|
5724
|
+
base: "text-md",
|
|
5725
|
+
separator: "w-[21px] h-[21px]"
|
|
5726
|
+
},
|
|
5727
|
+
lg: {
|
|
5728
|
+
base: "text-lg",
|
|
5729
|
+
separator: "w-[24px] h-[24px]"
|
|
5730
|
+
},
|
|
5731
|
+
xl: {
|
|
5732
|
+
base: "text-xl",
|
|
5733
|
+
separator: "w-[27px] h-[27px]"
|
|
5734
|
+
}
|
|
5735
|
+
}
|
|
5736
|
+
},
|
|
5737
|
+
defaultVariants: {
|
|
5738
|
+
size: "md"
|
|
5739
|
+
}
|
|
5740
|
+
});
|
|
5741
|
+
|
|
5742
|
+
// src/components/input/input.tsx
|
|
5743
|
+
var import_react9 = __toESM(require("react"));
|
|
5744
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
5745
|
+
var Input = (0, import_react9.forwardRef)((originalProps, ref) => {
|
|
5746
|
+
const [props, variantProps] = mapPropsVariants(originalProps, inputStyle.variantKeys);
|
|
5747
|
+
const { classNames, label, helperText, errorText, startContent, endContent, ...inputProps } = props;
|
|
5748
|
+
const inputRef = (0, import_react9.useRef)(null);
|
|
5749
|
+
const slots = (0, import_react9.useMemo)(() => inputStyle({ ...variantProps }), [variantProps]);
|
|
5750
|
+
const getContentProps = (0, import_react9.useCallback)(
|
|
5751
|
+
() => ({
|
|
5752
|
+
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
5753
|
+
size: originalProps.size
|
|
5754
|
+
}),
|
|
5755
|
+
[slots, classNames, originalProps.size]
|
|
5756
|
+
);
|
|
5757
|
+
const renderStartContent = () => {
|
|
5758
|
+
if (import_react9.default.isValidElement(startContent)) {
|
|
5759
|
+
const existingProps = startContent.props;
|
|
5760
|
+
const mergedProps = {
|
|
5761
|
+
...getContentProps(),
|
|
5762
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5763
|
+
};
|
|
5764
|
+
return import_react9.default.cloneElement(startContent, mergedProps);
|
|
5765
|
+
} else {
|
|
5766
|
+
const contentProps = getContentProps();
|
|
5767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ...contentProps, children: startContent });
|
|
5768
|
+
}
|
|
5769
|
+
};
|
|
5770
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
5771
|
+
"div",
|
|
5772
|
+
{
|
|
5773
|
+
...getContentProps(),
|
|
5774
|
+
onClick: () => {
|
|
5775
|
+
const target = ref && "current" in ref ? ref.current : inputRef.current;
|
|
5776
|
+
target == null ? void 0 : target.focus();
|
|
5777
|
+
target == null ? void 0 : target.showPicker();
|
|
5778
|
+
},
|
|
5779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon_default, { name: props.type === "time" ? "clock" : "calendar", size: originalProps.size, className: "cursor-pointer" })
|
|
5780
|
+
}
|
|
5781
|
+
);
|
|
5782
|
+
const renderContentWithIcon = () => {
|
|
5783
|
+
if (import_react9.default.isValidElement(endContent)) {
|
|
5784
|
+
const existingProps = endContent.props;
|
|
5785
|
+
const mergedProps = {
|
|
5786
|
+
...getContentProps(),
|
|
5787
|
+
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
5788
|
+
};
|
|
5789
|
+
return import_react9.default.cloneElement(endContent, mergedProps);
|
|
5790
|
+
} else if (errorText) {
|
|
5791
|
+
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
5792
|
+
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 }) });
|
|
5793
|
+
} else {
|
|
5794
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, {});
|
|
5795
|
+
}
|
|
5796
|
+
};
|
|
5797
|
+
const renderEndContent = () => {
|
|
5798
|
+
switch (props.type) {
|
|
5799
|
+
case "date":
|
|
5800
|
+
case "datetime-local":
|
|
5801
|
+
case "month":
|
|
5802
|
+
case "week":
|
|
5803
|
+
case "time":
|
|
5804
|
+
return renderDateTimePickerIcon();
|
|
5805
|
+
default:
|
|
5806
|
+
return renderContentWithIcon();
|
|
5807
|
+
}
|
|
5808
|
+
};
|
|
5809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
5810
|
+
"div",
|
|
5811
|
+
{
|
|
5812
|
+
className: clsx(
|
|
5813
|
+
slots.base({ class: classNames == null ? void 0 : classNames.base }),
|
|
5814
|
+
variantProps.direction === "horizon" ? slots.horizon({ class: classNames == null ? void 0 : classNames.horizon }) : slots.vertical({ class: classNames == null ? void 0 : classNames.vertical })
|
|
5815
|
+
),
|
|
5816
|
+
children: [
|
|
5817
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
|
|
5818
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper }), children: [
|
|
5819
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
5820
|
+
"div",
|
|
5821
|
+
{
|
|
5822
|
+
className: clsx(
|
|
5823
|
+
slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
5824
|
+
inputProps.readOnly ? slots.readonly({ class: classNames == null ? void 0 : classNames.readonly }) : ""
|
|
5825
|
+
),
|
|
5826
|
+
children: [
|
|
5827
|
+
startContent && renderStartContent(),
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("input", { ...inputProps, ref: ref || inputRef, className: slots.input({ class: classNames == null ? void 0 : classNames.input }), size: 0 }),
|
|
5829
|
+
renderEndContent()
|
|
5830
|
+
]
|
|
5831
|
+
}
|
|
5832
|
+
),
|
|
5833
|
+
helperText && !errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: slots.helperText({ class: classNames == null ? void 0 : classNames.helperText }), children: helperText }),
|
|
5834
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: clsx("error", slots.errorText({ class: classNames == null ? void 0 : classNames.errorText })), children: errorText })
|
|
5835
|
+
] })
|
|
5836
|
+
]
|
|
5837
|
+
}
|
|
5838
|
+
);
|
|
5839
|
+
});
|
|
5840
|
+
Input.displayName = "Input";
|
|
5841
|
+
var input_default = Input;
|
|
5842
|
+
var inputStyle = tv(
|
|
5843
|
+
{
|
|
5844
|
+
slots: {
|
|
5845
|
+
base: ["group/input", "flex"],
|
|
5846
|
+
vertical: ["flex-col"],
|
|
5847
|
+
horizon: ["flex-row", "gap-0"],
|
|
5848
|
+
label: ["flex", "items-center", "font-bold", "text-body-foreground", "min-w-[80px]"],
|
|
5849
|
+
innerWrapper: ["flex", "flex-col"],
|
|
5850
|
+
inputWrapper: ["flex", "items-center", "duration-200", "group-has-[p.error]/input:bg-danger-soft"],
|
|
5851
|
+
input: [
|
|
5852
|
+
"w-full",
|
|
5853
|
+
"h-full",
|
|
5854
|
+
"bg-transparent",
|
|
5855
|
+
"text-neutral-main",
|
|
5856
|
+
"placeholder:text-neutral-main",
|
|
5857
|
+
"outline-none",
|
|
5858
|
+
"focus:ring-0",
|
|
5859
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5860
|
+
"group-has-[:hover]/input:placeholder:text-neutral-dark",
|
|
5861
|
+
"group-has-[:focus]/input:text-neutral-dark",
|
|
5862
|
+
"group-has-[:focus]/input:placeholder:text-neutral-dark",
|
|
5863
|
+
"group-has-[p.error]/input:text-danger-main",
|
|
5864
|
+
"group-has-[p.error]/input:placeholder:text-danger-main"
|
|
5865
|
+
],
|
|
5866
|
+
content: [
|
|
5867
|
+
"flex",
|
|
5868
|
+
"items-center",
|
|
5869
|
+
"select-none",
|
|
5870
|
+
"text-neutral-main",
|
|
5871
|
+
"group-has-[:hover]/input:text-neutral-dark",
|
|
5872
|
+
"group-has-[p.error]/input:text-danger-main"
|
|
5873
|
+
],
|
|
5874
|
+
helperText: ["text-neutral-main", "group-has-[:hover]/input:text-neutral-dark"],
|
|
5875
|
+
errorText: ["text-danger-main"],
|
|
5876
|
+
readonly: ["pointer-events-none"]
|
|
5877
|
+
},
|
|
5878
|
+
variants: {
|
|
5879
|
+
variant: {
|
|
5880
|
+
solid: {
|
|
5881
|
+
inputWrapper: ["border-transparent", "bg-trans-soft"],
|
|
5882
|
+
readonly: ["!bg-trans-light"]
|
|
5883
|
+
},
|
|
5884
|
+
outline: {
|
|
5885
|
+
inputWrapper: [
|
|
5395
5886
|
"border-neutral-light",
|
|
5396
5887
|
"group-has-[:hover]/input:bg-trans-soft",
|
|
5397
5888
|
"group-has-[:focus]/input:bg-body-background",
|
|
@@ -5574,24 +6065,24 @@ var inputStyle = tv(
|
|
|
5574
6065
|
);
|
|
5575
6066
|
|
|
5576
6067
|
// src/components/tabs/tabs.tsx
|
|
5577
|
-
var
|
|
5578
|
-
var
|
|
5579
|
-
var Tabs = (0,
|
|
6068
|
+
var import_react10 = require("react");
|
|
6069
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
6070
|
+
var Tabs = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
5580
6071
|
const [props, variantProps] = mapPropsVariants(originalProps, tabs.variantKeys);
|
|
5581
6072
|
const { data, defaultTabIndex, classNames } = props;
|
|
5582
|
-
const [activeTabIndex, setActiveTabIndex] = (0,
|
|
5583
|
-
const slots = (0,
|
|
5584
|
-
const getBaseProps = (0,
|
|
6073
|
+
const [activeTabIndex, setActiveTabIndex] = (0, import_react10.useState)(defaultTabIndex || 0);
|
|
6074
|
+
const slots = (0, import_react10.useMemo)(() => tabs({ ...variantProps }), [...Object.values(variantProps)]);
|
|
6075
|
+
const getBaseProps = (0, import_react10.useCallback)(() => {
|
|
5585
6076
|
return {
|
|
5586
6077
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
5587
6078
|
};
|
|
5588
6079
|
}, [slots, classNames == null ? void 0 : classNames.base]);
|
|
5589
|
-
const getTabsProps = (0,
|
|
6080
|
+
const getTabsProps = (0, import_react10.useCallback)(() => {
|
|
5590
6081
|
return {
|
|
5591
6082
|
className: slots.tabs({ class: classNames == null ? void 0 : classNames.tabs })
|
|
5592
6083
|
};
|
|
5593
6084
|
}, [slots, classNames == null ? void 0 : classNames.tabs]);
|
|
5594
|
-
const getTabProps = (0,
|
|
6085
|
+
const getTabProps = (0, import_react10.useCallback)(
|
|
5595
6086
|
(index, disabled) => {
|
|
5596
6087
|
return {
|
|
5597
6088
|
className: slots.tab({ class: classNames == null ? void 0 : classNames.tab }),
|
|
@@ -5605,20 +6096,20 @@ var Tabs = (0, import_react8.forwardRef)((originalProps, ref) => {
|
|
|
5605
6096
|
},
|
|
5606
6097
|
[slots, classNames == null ? void 0 : classNames.tab, activeTabIndex]
|
|
5607
6098
|
);
|
|
5608
|
-
const getContentWrapperProps = (0,
|
|
6099
|
+
const getContentWrapperProps = (0, import_react10.useCallback)(() => {
|
|
5609
6100
|
return {
|
|
5610
6101
|
className: slots.contentWrapper({ class: classNames == null ? void 0 : classNames.contentWrapper })
|
|
5611
6102
|
};
|
|
5612
6103
|
}, [slots, classNames == null ? void 0 : classNames.contentWrapper]);
|
|
5613
|
-
const getContentProps = (0,
|
|
6104
|
+
const getContentProps = (0, import_react10.useCallback)(() => {
|
|
5614
6105
|
return {
|
|
5615
6106
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content })
|
|
5616
6107
|
};
|
|
5617
6108
|
}, [slots, classNames == null ? void 0 : classNames.content]);
|
|
5618
|
-
return /* @__PURE__ */ (0,
|
|
5619
|
-
/* @__PURE__ */ (0,
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5621
|
-
(tabItem, index) => index === activeTabIndex ? /* @__PURE__ */ (0,
|
|
6109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { ref, ...getBaseProps(), children: [
|
|
6110
|
+
/* @__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}`)) }),
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getContentWrapperProps(), children: data == null ? void 0 : data.map(
|
|
6112
|
+
(tabItem, index) => index === activeTabIndex ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ...getContentProps(), children: tabItem.component }, `tabs-content${tabItem.key}`) : null
|
|
5622
6113
|
) })
|
|
5623
6114
|
] });
|
|
5624
6115
|
});
|
|
@@ -5782,38 +6273,38 @@ var tabs = tv({
|
|
|
5782
6273
|
});
|
|
5783
6274
|
|
|
5784
6275
|
// src/components/textarea/textarea.tsx
|
|
5785
|
-
var
|
|
5786
|
-
var
|
|
5787
|
-
var
|
|
5788
|
-
var Textarea = (0,
|
|
6276
|
+
var import_react11 = require("react");
|
|
6277
|
+
var import_tailwind_variants11 = require("tailwind-variants");
|
|
6278
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
6279
|
+
var Textarea = (0, import_react11.forwardRef)((originalProps, ref) => {
|
|
5789
6280
|
const [props, variantProps] = mapPropsVariants(originalProps, textareaStyle.variantKeys);
|
|
5790
6281
|
const { classNames, label, errorMessage, ...textareaProps } = props;
|
|
5791
|
-
const slots = (0,
|
|
5792
|
-
const getBaseProps = (0,
|
|
6282
|
+
const slots = (0, import_react11.useMemo)(() => textareaStyle({ ...variantProps }), [variantProps]);
|
|
6283
|
+
const getBaseProps = (0, import_react11.useCallback)(
|
|
5793
6284
|
() => ({
|
|
5794
6285
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
5795
6286
|
}),
|
|
5796
6287
|
[slots, classNames]
|
|
5797
6288
|
);
|
|
5798
|
-
const getLabelProps = (0,
|
|
6289
|
+
const getLabelProps = (0, import_react11.useCallback)(
|
|
5799
6290
|
() => ({
|
|
5800
6291
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
5801
6292
|
}),
|
|
5802
6293
|
[slots, classNames]
|
|
5803
6294
|
);
|
|
5804
|
-
const getInnerWrapperProps = (0,
|
|
6295
|
+
const getInnerWrapperProps = (0, import_react11.useCallback)(
|
|
5805
6296
|
() => ({
|
|
5806
6297
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
5807
6298
|
}),
|
|
5808
6299
|
[slots, classNames]
|
|
5809
6300
|
);
|
|
5810
|
-
const getTextareaWrapperProps = (0,
|
|
6301
|
+
const getTextareaWrapperProps = (0, import_react11.useCallback)(
|
|
5811
6302
|
() => ({
|
|
5812
6303
|
className: slots.textareaWrapper({ class: classNames == null ? void 0 : classNames.textareaWrapper })
|
|
5813
6304
|
}),
|
|
5814
6305
|
[slots, classNames]
|
|
5815
6306
|
);
|
|
5816
|
-
const getTextareaProps = (0,
|
|
6307
|
+
const getTextareaProps = (0, import_react11.useCallback)(
|
|
5817
6308
|
() => ({
|
|
5818
6309
|
...textareaProps,
|
|
5819
6310
|
ref,
|
|
@@ -5824,23 +6315,23 @@ var Textarea = (0, import_react9.forwardRef)((originalProps, ref) => {
|
|
|
5824
6315
|
}),
|
|
5825
6316
|
[textareaProps, ref, slots, classNames == null ? void 0 : classNames.textarea, originalProps.isDisabled, originalProps.isRequired]
|
|
5826
6317
|
);
|
|
5827
|
-
const getErrorMessageProps = (0,
|
|
6318
|
+
const getErrorMessageProps = (0, import_react11.useCallback)(
|
|
5828
6319
|
() => ({
|
|
5829
6320
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
5830
6321
|
}),
|
|
5831
6322
|
[slots, classNames]
|
|
5832
6323
|
);
|
|
5833
|
-
return /* @__PURE__ */ (0,
|
|
5834
|
-
props.label && /* @__PURE__ */ (0,
|
|
5835
|
-
/* @__PURE__ */ (0,
|
|
5836
|
-
/* @__PURE__ */ (0,
|
|
5837
|
-
props.errorMessage && /* @__PURE__ */ (0,
|
|
6324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ...getBaseProps(), children: [
|
|
6325
|
+
props.label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
6326
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
6327
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ...getTextareaWrapperProps(), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("textarea", { ...getTextareaProps() }) }),
|
|
6328
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
5838
6329
|
] })
|
|
5839
6330
|
] });
|
|
5840
6331
|
});
|
|
5841
6332
|
Textarea.displayName = "Textarea";
|
|
5842
6333
|
var textarea_default = Textarea;
|
|
5843
|
-
var textareaStyle = (0,
|
|
6334
|
+
var textareaStyle = (0, import_tailwind_variants11.tv)({
|
|
5844
6335
|
slots: {
|
|
5845
6336
|
base: ["group/textarea", "flex", "flex-col", "gap-[10px]", "select-none"],
|
|
5846
6337
|
label: ["flex", "items-center"],
|
|
@@ -5983,19 +6474,19 @@ var textareaStyle = (0, import_tailwind_variants9.tv)({
|
|
|
5983
6474
|
});
|
|
5984
6475
|
|
|
5985
6476
|
// src/components/table/table.tsx
|
|
5986
|
-
var
|
|
5987
|
-
var
|
|
6477
|
+
var import_react17 = require("react");
|
|
6478
|
+
var import_tailwind_variants14 = require("tailwind-variants");
|
|
5988
6479
|
|
|
5989
6480
|
// src/components/checkbox/checkbox.tsx
|
|
5990
|
-
var
|
|
5991
|
-
var
|
|
5992
|
-
var CheckBox = (0,
|
|
6481
|
+
var import_react12 = require("react");
|
|
6482
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
6483
|
+
var CheckBox = (0, import_react12.forwardRef)((originalProps, ref) => {
|
|
5993
6484
|
var _a, _b;
|
|
5994
6485
|
const [props, variantProps] = mapPropsVariants(originalProps, checkboxStyle.variantKeys);
|
|
5995
6486
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
5996
|
-
const slots = (0,
|
|
6487
|
+
const slots = (0, import_react12.useMemo)(() => checkboxStyle({ ...variantProps }), [variantProps]);
|
|
5997
6488
|
const isSelected = (_b = (_a = inputProps.checked) != null ? _a : inputProps.defaultChecked) != null ? _b : false;
|
|
5998
|
-
return /* @__PURE__ */ (0,
|
|
6489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
5999
6490
|
"label",
|
|
6000
6491
|
{
|
|
6001
6492
|
className: clsx(
|
|
@@ -6003,8 +6494,8 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6003
6494
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
6004
6495
|
),
|
|
6005
6496
|
children: [
|
|
6006
|
-
/* @__PURE__ */ (0,
|
|
6007
|
-
/* @__PURE__ */ (0,
|
|
6497
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { ...inputProps, type: "checkbox", ref }) }),
|
|
6498
|
+
/* @__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
6499
|
CheckBoxIcon,
|
|
6009
6500
|
{
|
|
6010
6501
|
size: variantProps.size,
|
|
@@ -6012,7 +6503,7 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6012
6503
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon })
|
|
6013
6504
|
}
|
|
6014
6505
|
) }),
|
|
6015
|
-
children && /* @__PURE__ */ (0,
|
|
6506
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children })
|
|
6016
6507
|
]
|
|
6017
6508
|
}
|
|
6018
6509
|
);
|
|
@@ -6020,7 +6511,7 @@ var CheckBox = (0, import_react10.forwardRef)((originalProps, ref) => {
|
|
|
6020
6511
|
CheckBox.displayName = "CheckBox";
|
|
6021
6512
|
var checkbox_default = CheckBox;
|
|
6022
6513
|
var CheckBoxIcon = ({ size, isSelected, className }) => {
|
|
6023
|
-
const strokeWidth = (0,
|
|
6514
|
+
const strokeWidth = (0, import_react12.useMemo)(() => {
|
|
6024
6515
|
switch (size) {
|
|
6025
6516
|
case "sm":
|
|
6026
6517
|
return 1;
|
|
@@ -6034,7 +6525,7 @@ var CheckBoxIcon = ({ size, isSelected, className }) => {
|
|
|
6034
6525
|
return 1.25;
|
|
6035
6526
|
}
|
|
6036
6527
|
}, [size]);
|
|
6037
|
-
return /* @__PURE__ */ (0,
|
|
6528
|
+
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
6529
|
"path",
|
|
6039
6530
|
{
|
|
6040
6531
|
d: "M2.16667 6.90123L5.63334 10.1111L10.8333 2.88889",
|
|
@@ -6194,15 +6685,15 @@ var checkboxStyle = tv({
|
|
|
6194
6685
|
});
|
|
6195
6686
|
|
|
6196
6687
|
// src/components/table/table-head.tsx
|
|
6197
|
-
var
|
|
6688
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6198
6689
|
var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, classNames, onCheckAll }) => {
|
|
6199
6690
|
const handleClickCheckAll = (e) => {
|
|
6200
6691
|
e.preventDefault();
|
|
6201
6692
|
onCheckAll(!isCheckedAll);
|
|
6202
6693
|
};
|
|
6203
|
-
const renderColumnHeaders = () => columns.map((column, index) => /* @__PURE__ */ (0,
|
|
6204
|
-
const renderSelectAllCheckbox = () => selectableRows && /* @__PURE__ */ (0,
|
|
6205
|
-
return /* @__PURE__ */ (0,
|
|
6694
|
+
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`));
|
|
6695
|
+
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 }) }) });
|
|
6696
|
+
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
6697
|
renderColumnHeaders(),
|
|
6207
6698
|
renderSelectAllCheckbox()
|
|
6208
6699
|
] }) });
|
|
@@ -6210,9 +6701,9 @@ var TableHead = ({ columns, slots, size, selectableRows, isCheckedAll, className
|
|
|
6210
6701
|
var table_head_default = TableHead;
|
|
6211
6702
|
|
|
6212
6703
|
// src/components/table/table-body.tsx
|
|
6213
|
-
var
|
|
6214
|
-
var
|
|
6215
|
-
var
|
|
6704
|
+
var import_react13 = require("react");
|
|
6705
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
6706
|
+
var import_react14 = require("react");
|
|
6216
6707
|
var TableBody = ({
|
|
6217
6708
|
slots,
|
|
6218
6709
|
columns,
|
|
@@ -6224,11 +6715,11 @@ var TableBody = ({
|
|
|
6224
6715
|
emptyContent,
|
|
6225
6716
|
classNames
|
|
6226
6717
|
}) => {
|
|
6227
|
-
const generateColumnStyles = (0,
|
|
6718
|
+
const generateColumnStyles = (0, import_react13.useCallback)((column) => {
|
|
6228
6719
|
const alignClass = column.align ? `text-${column.align}` : "text-left";
|
|
6229
6720
|
return clsx(alignClass, column.className);
|
|
6230
6721
|
}, []);
|
|
6231
|
-
const getCellProps = (0,
|
|
6722
|
+
const getCellProps = (0, import_react13.useCallback)(
|
|
6232
6723
|
(column, row) => {
|
|
6233
6724
|
if (!column || !row) {
|
|
6234
6725
|
return {
|
|
@@ -6260,36 +6751,39 @@ var TableBody = ({
|
|
|
6260
6751
|
);
|
|
6261
6752
|
const hasRows = rows.length > 0;
|
|
6262
6753
|
const colSpan = (columns.length || 1) + (selectableRows ? 1 : 0);
|
|
6263
|
-
return /* @__PURE__ */ (0,
|
|
6264
|
-
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("tbody", { className: slots.tbody({ class: classNames == null ? void 0 : classNames.tbody }), children: [
|
|
6755
|
+
hasRows && rows.map((row, rowIndex) => {
|
|
6756
|
+
const isRowChecked = checkedRows.has(rowIndex);
|
|
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)(
|
|
6760
|
+
checkbox_default,
|
|
6761
|
+
{
|
|
6762
|
+
size,
|
|
6763
|
+
checked: isRowChecked,
|
|
6764
|
+
onChange: (e) => onCheckRow(rowIndex, e.target.checked)
|
|
6765
|
+
}
|
|
6766
|
+
) }) })
|
|
6767
|
+
] }, rowIndex);
|
|
6768
|
+
}),
|
|
6769
|
+
!hasRows && emptyContent && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: clsx(slots.tr({ class: classNames == null ? void 0 : classNames.tr }), "border-none"), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { colSpan, className: slots.td({ class: classNames == null ? void 0 : classNames.td }), children: emptyContent }) })
|
|
6770
|
+
] });
|
|
6277
6771
|
};
|
|
6278
6772
|
var table_body_default = TableBody;
|
|
6279
6773
|
|
|
6280
6774
|
// src/components/pagination/pagination.tsx
|
|
6281
|
-
var
|
|
6775
|
+
var import_react16 = require("react");
|
|
6282
6776
|
|
|
6283
6777
|
// src/components/pagination/usePagination.ts
|
|
6284
|
-
var
|
|
6778
|
+
var import_react15 = require("react");
|
|
6285
6779
|
var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) => {
|
|
6286
|
-
const startPage = (0,
|
|
6287
|
-
const endPage = (0,
|
|
6288
|
-
const pageList = (0,
|
|
6780
|
+
const startPage = (0, import_react15.useMemo)(() => Math.floor((currentPage - 1) / groupSize) * groupSize + 1, [currentPage, groupSize]);
|
|
6781
|
+
const endPage = (0, import_react15.useMemo)(() => Math.min(startPage + groupSize - 1, totalPage), [startPage, groupSize, totalPage]);
|
|
6782
|
+
const pageList = (0, import_react15.useMemo)(
|
|
6289
6783
|
() => Array.from({ length: endPage - startPage + 1 }, (_, i) => startPage + i),
|
|
6290
6784
|
[startPage, endPage]
|
|
6291
6785
|
);
|
|
6292
|
-
const handleClickMovePage = (0,
|
|
6786
|
+
const handleClickMovePage = (0, import_react15.useCallback)(
|
|
6293
6787
|
(page) => (event) => {
|
|
6294
6788
|
event.preventDefault();
|
|
6295
6789
|
handleChangePage == null ? void 0 : handleChangePage(page);
|
|
@@ -6306,8 +6800,8 @@ var usePagination = ({ currentPage, totalPage, groupSize, handleChangePage }) =>
|
|
|
6306
6800
|
var usePagination_default = usePagination;
|
|
6307
6801
|
|
|
6308
6802
|
// src/components/pagination/pagination.tsx
|
|
6309
|
-
var
|
|
6310
|
-
var Pagination = (0,
|
|
6803
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
6804
|
+
var Pagination = (0, import_react16.forwardRef)((originalProps, ref) => {
|
|
6311
6805
|
const [props, variantProps] = mapPropsVariants(originalProps, paginationStyle.variantKeys);
|
|
6312
6806
|
const {
|
|
6313
6807
|
classNames,
|
|
@@ -6321,8 +6815,8 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6321
6815
|
variant,
|
|
6322
6816
|
size
|
|
6323
6817
|
} = { ...props, ...variantProps };
|
|
6324
|
-
const [inputPage, setInputPage] = (0,
|
|
6325
|
-
const slots = (0,
|
|
6818
|
+
const [inputPage, setInputPage] = (0, import_react16.useState)(currentPage);
|
|
6819
|
+
const slots = (0, import_react16.useMemo)(() => paginationStyle(variantProps), [variantProps]);
|
|
6326
6820
|
const { pageList, handleClickMovePage } = usePagination_default({
|
|
6327
6821
|
currentPage,
|
|
6328
6822
|
totalPage,
|
|
@@ -6337,29 +6831,29 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6337
6831
|
}
|
|
6338
6832
|
}
|
|
6339
6833
|
};
|
|
6340
|
-
return /* @__PURE__ */ (0,
|
|
6341
|
-
/* @__PURE__ */ (0,
|
|
6342
|
-
showFirstLastButtons && /* @__PURE__ */ (0,
|
|
6834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), ref, children: [
|
|
6835
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
6836
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6343
6837
|
"div",
|
|
6344
6838
|
{
|
|
6345
6839
|
"aria-label": "firstPage",
|
|
6346
6840
|
"data-is-active": currentPage > 1,
|
|
6347
6841
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6348
6842
|
onClick: currentPage > 1 ? handleClickMovePage(1) : void 0,
|
|
6349
|
-
children: /* @__PURE__ */ (0,
|
|
6843
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "left-double-chevron" })
|
|
6350
6844
|
}
|
|
6351
6845
|
),
|
|
6352
|
-
/* @__PURE__ */ (0,
|
|
6846
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6353
6847
|
"div",
|
|
6354
6848
|
{
|
|
6355
6849
|
"aria-label": "prevPage",
|
|
6356
6850
|
"data-is-active": currentPage > 1,
|
|
6357
6851
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6358
6852
|
onClick: currentPage > 1 ? handleClickMovePage(currentPage - 1) : void 0,
|
|
6359
|
-
children: /* @__PURE__ */ (0,
|
|
6853
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "left-chevron" })
|
|
6360
6854
|
}
|
|
6361
6855
|
),
|
|
6362
|
-
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0,
|
|
6856
|
+
showPageNumber && pageList.map((page, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6363
6857
|
"div",
|
|
6364
6858
|
{
|
|
6365
6859
|
className: slots.button({ class: classNames == null ? void 0 : classNames.button }),
|
|
@@ -6369,29 +6863,29 @@ var Pagination = (0, import_react14.forwardRef)((originalProps, ref) => {
|
|
|
6369
6863
|
},
|
|
6370
6864
|
index
|
|
6371
6865
|
)),
|
|
6372
|
-
/* @__PURE__ */ (0,
|
|
6866
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6373
6867
|
"div",
|
|
6374
6868
|
{
|
|
6375
6869
|
"aria-label": "nextPage",
|
|
6376
6870
|
"data-is-active": currentPage < totalPage,
|
|
6377
6871
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6378
6872
|
onClick: currentPage < totalPage ? handleClickMovePage(currentPage + 1) : void 0,
|
|
6379
|
-
children: /* @__PURE__ */ (0,
|
|
6873
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "right-chevron" })
|
|
6380
6874
|
}
|
|
6381
6875
|
),
|
|
6382
|
-
showFirstLastButtons && /* @__PURE__ */ (0,
|
|
6876
|
+
showFirstLastButtons && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6383
6877
|
"div",
|
|
6384
6878
|
{
|
|
6385
6879
|
"aria-label": "lastPage",
|
|
6386
6880
|
"data-is-active": currentPage < totalPage,
|
|
6387
6881
|
className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }),
|
|
6388
6882
|
onClick: currentPage < totalPage ? handleClickMovePage(totalPage) : void 0,
|
|
6389
|
-
children: /* @__PURE__ */ (0,
|
|
6883
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "right-double-chevron" })
|
|
6390
6884
|
}
|
|
6391
6885
|
)
|
|
6392
6886
|
] }),
|
|
6393
|
-
showPageLabel && /* @__PURE__ */ (0,
|
|
6394
|
-
/* @__PURE__ */ (0,
|
|
6887
|
+
showPageLabel && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: [
|
|
6888
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6395
6889
|
input_default,
|
|
6396
6890
|
{
|
|
6397
6891
|
value: inputPage || 1,
|
|
@@ -6424,7 +6918,7 @@ var paginationStyle = tv(
|
|
|
6424
6918
|
"items-center",
|
|
6425
6919
|
"justify-center",
|
|
6426
6920
|
"cursor-pointer",
|
|
6427
|
-
"
|
|
6921
|
+
"text-neutral-main",
|
|
6428
6922
|
"data-[is-active=false]:stroke-neutral-light",
|
|
6429
6923
|
"data-[is-active=false]:cursor-default"
|
|
6430
6924
|
],
|
|
@@ -6487,7 +6981,7 @@ var paginationStyle = tv(
|
|
|
6487
6981
|
"data-[selected=true]:text-primary-main",
|
|
6488
6982
|
"data-[selected=true]:bg-primary-soft"
|
|
6489
6983
|
],
|
|
6490
|
-
icon: ["hover:
|
|
6984
|
+
icon: ["hover:text-primary-main"]
|
|
6491
6985
|
}
|
|
6492
6986
|
},
|
|
6493
6987
|
{
|
|
@@ -6499,7 +6993,7 @@ var paginationStyle = tv(
|
|
|
6499
6993
|
"data-[selected=true]:text-secondary-main",
|
|
6500
6994
|
"data-[selected=true]:bg-secondary-soft"
|
|
6501
6995
|
],
|
|
6502
|
-
icon: ["hover:
|
|
6996
|
+
icon: ["hover:text-secondary-main"]
|
|
6503
6997
|
}
|
|
6504
6998
|
},
|
|
6505
6999
|
{
|
|
@@ -6511,7 +7005,7 @@ var paginationStyle = tv(
|
|
|
6511
7005
|
"data-[selected=true]:text-neutral-dark",
|
|
6512
7006
|
"data-[selected=true]:bg-neutral-soft"
|
|
6513
7007
|
],
|
|
6514
|
-
icon: ["hover:
|
|
7008
|
+
icon: ["hover:text-neutral-dark"]
|
|
6515
7009
|
}
|
|
6516
7010
|
},
|
|
6517
7011
|
{
|
|
@@ -6523,7 +7017,7 @@ var paginationStyle = tv(
|
|
|
6523
7017
|
"data-[selected=true]:text-primary-main",
|
|
6524
7018
|
"data-[selected=true]:border-b-primary-main"
|
|
6525
7019
|
],
|
|
6526
|
-
icon: ["hover:
|
|
7020
|
+
icon: ["hover:text-primary-main"]
|
|
6527
7021
|
}
|
|
6528
7022
|
},
|
|
6529
7023
|
{
|
|
@@ -6535,7 +7029,7 @@ var paginationStyle = tv(
|
|
|
6535
7029
|
"data-[selected=true]:text-secondary-main",
|
|
6536
7030
|
"data-[selected=true]:border-b-secondary-main"
|
|
6537
7031
|
],
|
|
6538
|
-
icon: ["hover:
|
|
7032
|
+
icon: ["hover:text-secondary-main"]
|
|
6539
7033
|
}
|
|
6540
7034
|
},
|
|
6541
7035
|
{
|
|
@@ -6547,7 +7041,7 @@ var paginationStyle = tv(
|
|
|
6547
7041
|
"data-[selected=true]:text-neutral-dark",
|
|
6548
7042
|
"data-[selected=true]:border-b-neutral-main"
|
|
6549
7043
|
],
|
|
6550
|
-
icon: ["hover:
|
|
7044
|
+
icon: ["hover:text-neutral-dark"]
|
|
6551
7045
|
}
|
|
6552
7046
|
}
|
|
6553
7047
|
],
|
|
@@ -6564,8 +7058,8 @@ var paginationStyle = tv(
|
|
|
6564
7058
|
);
|
|
6565
7059
|
|
|
6566
7060
|
// src/components/table/table.tsx
|
|
6567
|
-
var
|
|
6568
|
-
var Table = (0,
|
|
7061
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
7062
|
+
var Table = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
6569
7063
|
const [props, variantProps] = mapPropsVariants(originalProps, tableStyle.variantKeys);
|
|
6570
7064
|
const {
|
|
6571
7065
|
classNames,
|
|
@@ -6580,15 +7074,15 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6580
7074
|
className,
|
|
6581
7075
|
color
|
|
6582
7076
|
} = { ...props, ...variantProps };
|
|
6583
|
-
const [checkedRows, setCheckedRows] = (0,
|
|
6584
|
-
const divRef = (0,
|
|
7077
|
+
const [checkedRows, setCheckedRows] = (0, import_react17.useState)(/* @__PURE__ */ new Set());
|
|
7078
|
+
const divRef = (0, import_react17.useRef)(null);
|
|
6585
7079
|
const { page, perPage } = pagination || { page: 1, perPage: 10 };
|
|
6586
7080
|
const showPagination = pagination && typeof totalData === "number";
|
|
6587
|
-
(0,
|
|
7081
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
6588
7082
|
checkedRows,
|
|
6589
7083
|
setCheckedRows
|
|
6590
7084
|
}));
|
|
6591
|
-
(0,
|
|
7085
|
+
(0, import_react17.useEffect)(() => {
|
|
6592
7086
|
setCheckedRows(/* @__PURE__ */ new Set());
|
|
6593
7087
|
}, [rows]);
|
|
6594
7088
|
const handleCheckAll = (isChecked) => {
|
|
@@ -6600,10 +7094,10 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6600
7094
|
isChecked ? newChecked.add(rowIndex) : newChecked.delete(rowIndex);
|
|
6601
7095
|
setCheckedRows(newChecked);
|
|
6602
7096
|
};
|
|
6603
|
-
const slots = (0,
|
|
6604
|
-
return /* @__PURE__ */ (0,
|
|
6605
|
-
/* @__PURE__ */ (0,
|
|
6606
|
-
/* @__PURE__ */ (0,
|
|
7097
|
+
const slots = (0, import_react17.useMemo)(() => tableStyle(variantProps), [variantProps]);
|
|
7098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: divRef, "data-table": "base", className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("table", { className: slots.table({ class: classNames == null ? void 0 : classNames.table }), children: [
|
|
7100
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6607
7101
|
table_head_default,
|
|
6608
7102
|
{
|
|
6609
7103
|
columns,
|
|
@@ -6615,7 +7109,7 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6615
7109
|
slots
|
|
6616
7110
|
}
|
|
6617
7111
|
),
|
|
6618
|
-
/* @__PURE__ */ (0,
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6619
7113
|
table_body_default,
|
|
6620
7114
|
{
|
|
6621
7115
|
slots,
|
|
@@ -6630,7 +7124,7 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6630
7124
|
}
|
|
6631
7125
|
)
|
|
6632
7126
|
] }),
|
|
6633
|
-
showPagination && /* @__PURE__ */ (0,
|
|
7127
|
+
showPagination && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6634
7128
|
pagination_default,
|
|
6635
7129
|
{
|
|
6636
7130
|
color,
|
|
@@ -6644,9 +7138,9 @@ var Table = (0, import_react15.forwardRef)((originalProps, ref) => {
|
|
|
6644
7138
|
});
|
|
6645
7139
|
Table.displayName = "Table";
|
|
6646
7140
|
var table_default = Table;
|
|
6647
|
-
var tableStyle = (0,
|
|
7141
|
+
var tableStyle = (0, import_tailwind_variants14.tv)({
|
|
6648
7142
|
slots: {
|
|
6649
|
-
base: ["flex", "flex-col", "relative", "select-none"],
|
|
7143
|
+
base: ["flex", "flex-col", "relative", "select-none", "gap-[20px]"],
|
|
6650
7144
|
table: ["w-full", "h-auto"],
|
|
6651
7145
|
thead: ["w-full"],
|
|
6652
7146
|
tbody: ["w-full"],
|
|
@@ -6852,17 +7346,17 @@ var tableStyle = (0, import_tailwind_variants12.tv)({
|
|
|
6852
7346
|
});
|
|
6853
7347
|
|
|
6854
7348
|
// src/components/select/select.tsx
|
|
6855
|
-
var
|
|
7349
|
+
var import_react19 = require("react");
|
|
6856
7350
|
var import_react_dom = require("react-dom");
|
|
6857
7351
|
|
|
6858
7352
|
// src/components/select/useSelect.tsx
|
|
6859
|
-
var
|
|
7353
|
+
var import_react18 = require("react");
|
|
6860
7354
|
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,
|
|
7355
|
+
const [selectedOption, setSelectedOption] = (0, import_react18.useState)(defaultOption);
|
|
7356
|
+
const [targetRect, setTargetRect] = (0, import_react18.useState)(null);
|
|
7357
|
+
const [optionWrapperHeight, setOptionWrapperHeight] = (0, import_react18.useState)(0);
|
|
7358
|
+
const selectWrapperRef = (0, import_react18.useRef)(null);
|
|
7359
|
+
const optionWrapperRef = (0, import_react18.useRef)(null);
|
|
6866
7360
|
const calculatePositionWithScroll = (targetRect2, optionWrapperHeight2) => {
|
|
6867
7361
|
const scrollTop = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
6868
7362
|
const scrollLeft = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
@@ -6885,7 +7379,7 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6885
7379
|
setSelectedOption(option);
|
|
6886
7380
|
handleToggleSelect();
|
|
6887
7381
|
};
|
|
6888
|
-
(0,
|
|
7382
|
+
(0, import_react18.useEffect)(() => {
|
|
6889
7383
|
const onClickOutside = (e) => {
|
|
6890
7384
|
if (optionWrapperRef.current && !optionWrapperRef.current.contains(e.target)) {
|
|
6891
7385
|
setTargetRect(null);
|
|
@@ -6894,7 +7388,7 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6894
7388
|
window.addEventListener("mousedown", onClickOutside);
|
|
6895
7389
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
6896
7390
|
}, []);
|
|
6897
|
-
(0,
|
|
7391
|
+
(0, import_react18.useEffect)(() => {
|
|
6898
7392
|
if (optionWrapperRef.current) {
|
|
6899
7393
|
setOptionWrapperHeight(optionWrapperRef.current.getBoundingClientRect().height);
|
|
6900
7394
|
}
|
|
@@ -6912,10 +7406,10 @@ var useSelect = ({ options, defaultOption, onChange }) => {
|
|
|
6912
7406
|
};
|
|
6913
7407
|
|
|
6914
7408
|
// src/components/select/option.tsx
|
|
6915
|
-
var
|
|
7409
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6916
7410
|
var Option = (props) => {
|
|
6917
7411
|
const { base, option, icon } = optionStyle(props);
|
|
6918
|
-
return /* @__PURE__ */ (0,
|
|
7412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
6919
7413
|
"div",
|
|
6920
7414
|
{
|
|
6921
7415
|
title: props.option.value,
|
|
@@ -6925,8 +7419,8 @@ var Option = (props) => {
|
|
|
6925
7419
|
props.isSelected && (node == null ? void 0 : node.scrollIntoView());
|
|
6926
7420
|
},
|
|
6927
7421
|
children: [
|
|
6928
|
-
/* @__PURE__ */ (0,
|
|
6929
|
-
props.isSelected && /* @__PURE__ */ (0,
|
|
7422
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: option(), children: props.children }),
|
|
7423
|
+
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
7424
|
]
|
|
6931
7425
|
}
|
|
6932
7426
|
);
|
|
@@ -6977,11 +7471,11 @@ var optionStyle = tv({
|
|
|
6977
7471
|
});
|
|
6978
7472
|
|
|
6979
7473
|
// src/components/select/select.tsx
|
|
6980
|
-
var
|
|
6981
|
-
var Select = (0,
|
|
7474
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
7475
|
+
var Select = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
6982
7476
|
const [props, variantProps] = mapPropsVariants(originalProps, select.variantKeys);
|
|
6983
7477
|
const { classNames, options, defaultOption, onChange, ...inputProps } = props;
|
|
6984
|
-
const slots = (0,
|
|
7478
|
+
const slots = (0, import_react19.useMemo)(() => select({ ...variantProps }), [variantProps]);
|
|
6985
7479
|
const {
|
|
6986
7480
|
targetRect,
|
|
6987
7481
|
selectedOption,
|
|
@@ -6997,19 +7491,19 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
6997
7491
|
onChange
|
|
6998
7492
|
});
|
|
6999
7493
|
const position = targetRect ? calculatePositionWithScroll(targetRect, optionWrapperHeight) : null;
|
|
7000
|
-
const getBaseProps = (0,
|
|
7494
|
+
const getBaseProps = (0, import_react19.useCallback)(
|
|
7001
7495
|
() => ({
|
|
7002
7496
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
7003
7497
|
}),
|
|
7004
7498
|
[slots, classNames]
|
|
7005
7499
|
);
|
|
7006
|
-
const getLabelProps = (0,
|
|
7500
|
+
const getLabelProps = (0, import_react19.useCallback)(
|
|
7007
7501
|
() => ({
|
|
7008
7502
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
7009
7503
|
}),
|
|
7010
7504
|
[slots, classNames]
|
|
7011
7505
|
);
|
|
7012
|
-
const getSelectWrapperProps = (0,
|
|
7506
|
+
const getSelectWrapperProps = (0, import_react19.useCallback)(
|
|
7013
7507
|
() => ({
|
|
7014
7508
|
className: slots.selectWrapper({ class: classNames == null ? void 0 : classNames.selectWrapper }),
|
|
7015
7509
|
ref: selectWrapperRef,
|
|
@@ -7017,7 +7511,7 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7017
7511
|
}),
|
|
7018
7512
|
[slots, classNames]
|
|
7019
7513
|
);
|
|
7020
|
-
const getSelectProps = (0,
|
|
7514
|
+
const getSelectProps = (0, import_react19.useCallback)(
|
|
7021
7515
|
() => ({
|
|
7022
7516
|
...inputProps,
|
|
7023
7517
|
ref,
|
|
@@ -7028,30 +7522,30 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7028
7522
|
}),
|
|
7029
7523
|
[slots, classNames, inputProps, selectedOption, ref]
|
|
7030
7524
|
);
|
|
7031
|
-
const getOptionsWrapperProps = (0,
|
|
7525
|
+
const getOptionsWrapperProps = (0, import_react19.useCallback)(
|
|
7032
7526
|
() => ({
|
|
7033
7527
|
className: slots.optionsWrapper({ class: classNames == null ? void 0 : classNames.optionsWrapper }),
|
|
7034
7528
|
ref: optionWrapperRef
|
|
7035
7529
|
}),
|
|
7036
7530
|
[slots, classNames]
|
|
7037
7531
|
);
|
|
7038
|
-
const getErrorMessageProps = (0,
|
|
7532
|
+
const getErrorMessageProps = (0, import_react19.useCallback)(
|
|
7039
7533
|
() => ({
|
|
7040
7534
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
7041
7535
|
}),
|
|
7042
7536
|
[slots, classNames]
|
|
7043
7537
|
);
|
|
7044
|
-
return /* @__PURE__ */ (0,
|
|
7045
|
-
/* @__PURE__ */ (0,
|
|
7046
|
-
props.label && /* @__PURE__ */ (0,
|
|
7047
|
-
/* @__PURE__ */ (0,
|
|
7048
|
-
/* @__PURE__ */ (0,
|
|
7049
|
-
/* @__PURE__ */ (0,
|
|
7538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
7539
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { ...getBaseProps(), children: [
|
|
7540
|
+
props.label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("label", { ...getLabelProps(), children: props.label }),
|
|
7541
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { "data-expanded": !!targetRect, ...getSelectWrapperProps(), children: [
|
|
7542
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { ...getSelectProps() }),
|
|
7543
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon_default, { name: !!targetRect ? "arrow-triangle-up" : "arrow-triangle-down", size: originalProps.size, fill: true })
|
|
7050
7544
|
] }),
|
|
7051
|
-
props.errorMessage && /* @__PURE__ */ (0,
|
|
7545
|
+
props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
|
|
7052
7546
|
] }),
|
|
7053
|
-
targetRect && /* @__PURE__ */ (0,
|
|
7054
|
-
/* @__PURE__ */ (0,
|
|
7547
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: (0, import_react_dom.createPortal)(
|
|
7548
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7055
7549
|
"div",
|
|
7056
7550
|
{
|
|
7057
7551
|
...getOptionsWrapperProps(),
|
|
@@ -7061,7 +7555,7 @@ var Select = (0, import_react17.forwardRef)((originalProps, ref) => {
|
|
|
7061
7555
|
left: position == null ? void 0 : position.left,
|
|
7062
7556
|
width: targetRect.width
|
|
7063
7557
|
},
|
|
7064
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
7558
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
7065
7559
|
option_default,
|
|
7066
7560
|
{
|
|
7067
7561
|
variant: originalProps.variant,
|
|
@@ -7210,16 +7704,16 @@ var select = tv({
|
|
|
7210
7704
|
});
|
|
7211
7705
|
|
|
7212
7706
|
// src/components/chip/chip.tsx
|
|
7213
|
-
var
|
|
7214
|
-
var
|
|
7215
|
-
var Chip = (0,
|
|
7707
|
+
var import_react20 = require("react");
|
|
7708
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
7709
|
+
var Chip = (0, import_react20.forwardRef)((originalProps, ref) => {
|
|
7216
7710
|
var _a;
|
|
7217
7711
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, chipStyle.variantKeys);
|
|
7218
7712
|
const props = { ...rawProps, ...variantProps };
|
|
7219
7713
|
const Component = props.onClick ? "button" : "div";
|
|
7220
|
-
const slots = (0,
|
|
7221
|
-
const renderIcon = (name) => name ? /* @__PURE__ */ (0,
|
|
7222
|
-
return /* @__PURE__ */ (0,
|
|
7714
|
+
const slots = (0, import_react20.useMemo)(() => chipStyle({ ...variantProps }), [variantProps]);
|
|
7715
|
+
const renderIcon = (name) => name ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon_default, { name, fill: true, size: props.size, className: slots.icon() }) : null;
|
|
7716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
7223
7717
|
Component,
|
|
7224
7718
|
{
|
|
7225
7719
|
ref,
|
|
@@ -7394,13 +7888,13 @@ var chipStyle = tv({
|
|
|
7394
7888
|
});
|
|
7395
7889
|
|
|
7396
7890
|
// src/components/radio/radio.tsx
|
|
7397
|
-
var
|
|
7398
|
-
var
|
|
7399
|
-
var Radio = (0,
|
|
7891
|
+
var import_react21 = require("react");
|
|
7892
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7893
|
+
var Radio = (0, import_react21.forwardRef)((originalProps, ref) => {
|
|
7400
7894
|
const [props, variantProps] = mapPropsVariants(originalProps, radioStyle.variantKeys);
|
|
7401
7895
|
const { children, classNames, labelPosition = "end", ...inputProps } = props;
|
|
7402
|
-
const slots = (0,
|
|
7403
|
-
return /* @__PURE__ */ (0,
|
|
7896
|
+
const slots = (0, import_react21.useMemo)(() => radioStyle({ ...variantProps }), [variantProps]);
|
|
7897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
7404
7898
|
"label",
|
|
7405
7899
|
{
|
|
7406
7900
|
className: clsx(
|
|
@@ -7408,9 +7902,9 @@ var Radio = (0, import_react19.forwardRef)((originalProps, ref) => {
|
|
|
7408
7902
|
labelPosition === "start" && slots.labelReverse({ class: classNames == null ? void 0 : classNames.labelReverse })
|
|
7409
7903
|
),
|
|
7410
7904
|
children: [
|
|
7411
|
-
/* @__PURE__ */ (0,
|
|
7412
|
-
/* @__PURE__ */ (0,
|
|
7413
|
-
/* @__PURE__ */ (0,
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { ...inputProps, type: "radio", ref }) }),
|
|
7906
|
+
/* @__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 }) }) }),
|
|
7907
|
+
/* @__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
7908
|
]
|
|
7415
7909
|
}
|
|
7416
7910
|
);
|
|
@@ -7550,21 +8044,21 @@ var radioStyle = tv({
|
|
|
7550
8044
|
});
|
|
7551
8045
|
|
|
7552
8046
|
// src/components/switch/switch.tsx
|
|
7553
|
-
var
|
|
7554
|
-
var
|
|
7555
|
-
var
|
|
7556
|
-
var Switch = (0,
|
|
8047
|
+
var import_react22 = require("react");
|
|
8048
|
+
var import_tailwind_variants19 = require("tailwind-variants");
|
|
8049
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
8050
|
+
var Switch = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
7557
8051
|
const [rawProps, variantProps] = mapPropsVariants(originalProps, switchStyle.variantKeys);
|
|
7558
8052
|
const { size, color, isDisabled, disableAnimation, id, classNames, ...inputProps } = { ...rawProps, ...variantProps };
|
|
7559
|
-
const slots = (0,
|
|
7560
|
-
return /* @__PURE__ */ (0,
|
|
7561
|
-
/* @__PURE__ */ (0,
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
8053
|
+
const slots = (0, import_react22.useMemo)(() => switchStyle({ ...variantProps }), [variantProps]);
|
|
8054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("label", { className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
|
|
8055
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("input", { ...inputProps, id, ref, type: "checkbox", disabled: isDisabled, className: "hidden" }),
|
|
8056
|
+
/* @__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
8057
|
] });
|
|
7564
8058
|
});
|
|
7565
8059
|
Switch.displayName = "Switch";
|
|
7566
8060
|
var switch_default = Switch;
|
|
7567
|
-
var switchStyle = (0,
|
|
8061
|
+
var switchStyle = (0, import_tailwind_variants19.tv)({
|
|
7568
8062
|
slots: {
|
|
7569
8063
|
base: ["group/switch", "relative", "max-w-fit", "inline-flex", "items-center", "justify-start", "cursor-pointer"],
|
|
7570
8064
|
outerWrapper: [
|
|
@@ -7669,7 +8163,7 @@ var switchStyle = (0, import_tailwind_variants17.tv)({
|
|
|
7669
8163
|
});
|
|
7670
8164
|
|
|
7671
8165
|
// src/components/tooltip/tooltip.tsx
|
|
7672
|
-
var
|
|
8166
|
+
var import_react24 = require("react");
|
|
7673
8167
|
var import_react_dom2 = require("react-dom");
|
|
7674
8168
|
|
|
7675
8169
|
// src/components/tooltip/tooltip-utils.ts
|
|
@@ -7792,11 +8286,11 @@ var getTailStyles = (placement) => {
|
|
|
7792
8286
|
};
|
|
7793
8287
|
|
|
7794
8288
|
// src/components/tooltip/useTooltip.ts
|
|
7795
|
-
var
|
|
8289
|
+
var import_react23 = require("react");
|
|
7796
8290
|
var useTooltip = ({ placement, offset, targetRect }) => {
|
|
7797
|
-
const [tooltipPosition, setTooltipPosition] = (0,
|
|
7798
|
-
const tooltipRef = (0,
|
|
7799
|
-
(0,
|
|
8291
|
+
const [tooltipPosition, setTooltipPosition] = (0, import_react23.useState)({ x: 0, y: 0 });
|
|
8292
|
+
const tooltipRef = (0, import_react23.useRef)(null);
|
|
8293
|
+
(0, import_react23.useEffect)(() => {
|
|
7800
8294
|
if (targetRect && tooltipRef.current) {
|
|
7801
8295
|
const { width, height } = tooltipRef.current.getBoundingClientRect();
|
|
7802
8296
|
const scrollX = window.scrollX;
|
|
@@ -7826,29 +8320,29 @@ var useTooltip = ({ placement, offset, targetRect }) => {
|
|
|
7826
8320
|
};
|
|
7827
8321
|
|
|
7828
8322
|
// src/components/tooltip/tooltip.tsx
|
|
7829
|
-
var
|
|
7830
|
-
var Tooltip = (0,
|
|
8323
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8324
|
+
var Tooltip = (0, import_react24.forwardRef)((originalProps, ref) => {
|
|
7831
8325
|
const [props, variantProps] = mapPropsVariants(originalProps, tooltipStyle.variantKeys);
|
|
7832
8326
|
const { placement = "top", offset = 5, delay = 100, persistent = false, classNames } = props;
|
|
7833
|
-
const slots = (0,
|
|
7834
|
-
const [targetRect, setTargetRect] = (0,
|
|
8327
|
+
const slots = (0, import_react24.useMemo)(() => tooltipStyle({ ...variantProps }), [variantProps]);
|
|
8328
|
+
const [targetRect, setTargetRect] = (0, import_react24.useState)(null);
|
|
7835
8329
|
const { tooltipPosition, tooltipRef } = useTooltip({
|
|
7836
8330
|
placement,
|
|
7837
8331
|
offset,
|
|
7838
8332
|
delay,
|
|
7839
8333
|
targetRect
|
|
7840
8334
|
});
|
|
7841
|
-
const childrenRef = (0,
|
|
7842
|
-
const delayTimeoutRef = (0,
|
|
7843
|
-
const getProps = (0,
|
|
8335
|
+
const childrenRef = (0, import_react24.useRef)(null);
|
|
8336
|
+
const delayTimeoutRef = (0, import_react24.useRef)(null);
|
|
8337
|
+
const getProps = (0, import_react24.useCallback)(
|
|
7844
8338
|
(slotKey, classNameKey) => ({
|
|
7845
8339
|
className: slots[slotKey]({ class: classNames == null ? void 0 : classNames[classNameKey] })
|
|
7846
8340
|
}),
|
|
7847
8341
|
[slots, classNames]
|
|
7848
8342
|
);
|
|
7849
|
-
const getBaseProps = (0,
|
|
7850
|
-
const getContentProps = (0,
|
|
7851
|
-
const showTooltip = (0,
|
|
8343
|
+
const getBaseProps = (0, import_react24.useCallback)(() => getProps("base", "base"), [getProps]);
|
|
8344
|
+
const getContentProps = (0, import_react24.useCallback)(() => getProps("content", "content"), [getProps]);
|
|
8345
|
+
const showTooltip = (0, import_react24.useCallback)(() => {
|
|
7852
8346
|
if (childrenRef.current) {
|
|
7853
8347
|
const rect = childrenRef.current.getBoundingClientRect();
|
|
7854
8348
|
setTargetRect({
|
|
@@ -7861,16 +8355,16 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7861
8355
|
});
|
|
7862
8356
|
}
|
|
7863
8357
|
}, []);
|
|
7864
|
-
const hideTooltip = (0,
|
|
8358
|
+
const hideTooltip = (0, import_react24.useCallback)(() => {
|
|
7865
8359
|
if (!persistent) {
|
|
7866
8360
|
delayTimeoutRef.current = window.setTimeout(() => setTargetRect(null), delay);
|
|
7867
8361
|
}
|
|
7868
8362
|
}, [persistent, delay]);
|
|
7869
|
-
(0,
|
|
8363
|
+
(0, import_react24.useEffect)(() => {
|
|
7870
8364
|
if (persistent) showTooltip();
|
|
7871
8365
|
}, [persistent, showTooltip]);
|
|
7872
|
-
return /* @__PURE__ */ (0,
|
|
7873
|
-
/* @__PURE__ */ (0,
|
|
8366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
8367
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7874
8368
|
"div",
|
|
7875
8369
|
{
|
|
7876
8370
|
ref: (node) => {
|
|
@@ -7887,7 +8381,7 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7887
8381
|
}
|
|
7888
8382
|
),
|
|
7889
8383
|
targetRect && (0, import_react_dom2.createPortal)(
|
|
7890
|
-
/* @__PURE__ */ (0,
|
|
8384
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7891
8385
|
"div",
|
|
7892
8386
|
{
|
|
7893
8387
|
ref: tooltipRef,
|
|
@@ -7900,7 +8394,7 @@ var Tooltip = (0, import_react22.forwardRef)((originalProps, ref) => {
|
|
|
7900
8394
|
},
|
|
7901
8395
|
children: [
|
|
7902
8396
|
props.content,
|
|
7903
|
-
variantProps.tail && /* @__PURE__ */ (0,
|
|
8397
|
+
variantProps.tail && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
7904
8398
|
"div",
|
|
7905
8399
|
{
|
|
7906
8400
|
className: `absolute h-2 w-2 rotate-45 bg-inherit ${getTailClassName(placement)}`,
|
|
@@ -7951,10 +8445,10 @@ var tooltipStyle = tv({
|
|
|
7951
8445
|
});
|
|
7952
8446
|
|
|
7953
8447
|
// src/components/modal/modal.tsx
|
|
7954
|
-
var
|
|
8448
|
+
var import_react25 = require("react");
|
|
7955
8449
|
var import_react_dom3 = require("react-dom");
|
|
7956
|
-
var
|
|
7957
|
-
var Modal = (0,
|
|
8450
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
8451
|
+
var Modal = (0, import_react25.forwardRef)((originalProps, ref) => {
|
|
7958
8452
|
const [props, variantProps] = mapPropsVariants(originalProps, modal.variantKeys);
|
|
7959
8453
|
const {
|
|
7960
8454
|
classNames,
|
|
@@ -7971,8 +8465,8 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
7971
8465
|
onConfirm,
|
|
7972
8466
|
onCancel
|
|
7973
8467
|
} = props;
|
|
7974
|
-
const slots = (0,
|
|
7975
|
-
const getBackdropProps = (0,
|
|
8468
|
+
const slots = (0, import_react25.useMemo)(() => modal({ ...variantProps }), [...Object.values(variantProps)]);
|
|
8469
|
+
const getBackdropProps = (0, import_react25.useCallback)(
|
|
7976
8470
|
() => ({
|
|
7977
8471
|
className: slots.backdrop({ class: classNames == null ? void 0 : classNames.backdrop }),
|
|
7978
8472
|
onClick: (e) => {
|
|
@@ -7983,68 +8477,68 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
7983
8477
|
}),
|
|
7984
8478
|
[slots, classNames == null ? void 0 : classNames.backdrop, isDismissable, onCancel]
|
|
7985
8479
|
);
|
|
7986
|
-
const getModalWrapperProps = (0,
|
|
8480
|
+
const getModalWrapperProps = (0, import_react25.useCallback)(
|
|
7987
8481
|
() => ({
|
|
7988
8482
|
className: slots.modalWrapper({ class: classNames == null ? void 0 : classNames.modalWrapper }),
|
|
7989
8483
|
"data-icon-visibility": typeof icon !== "undefined"
|
|
7990
8484
|
}),
|
|
7991
8485
|
[slots, classNames == null ? void 0 : classNames.modalWrapper, icon]
|
|
7992
8486
|
);
|
|
7993
|
-
const getIconProps = (0,
|
|
8487
|
+
const getIconProps = (0, import_react25.useCallback)(
|
|
7994
8488
|
() => ({
|
|
7995
8489
|
className: slots.icon({ class: [classNames == null ? void 0 : classNames.icon] })
|
|
7996
8490
|
}),
|
|
7997
8491
|
[slots, classNames == null ? void 0 : classNames.icon]
|
|
7998
8492
|
);
|
|
7999
|
-
const getCloseIconProps = (0,
|
|
8493
|
+
const getCloseIconProps = (0, import_react25.useCallback)(
|
|
8000
8494
|
() => ({
|
|
8001
8495
|
className: slots.closeIcon({ class: [classNames == null ? void 0 : classNames.closeIcon, showCloseButton ? "" : "hidden"] })
|
|
8002
8496
|
}),
|
|
8003
8497
|
[slots, classNames == null ? void 0 : classNames.closeIcon, showCloseButton]
|
|
8004
8498
|
);
|
|
8005
|
-
const getBodyWrapperProps = (0,
|
|
8499
|
+
const getBodyWrapperProps = (0, import_react25.useCallback)(
|
|
8006
8500
|
() => ({
|
|
8007
8501
|
className: slots.bodyWrapper({ class: classNames == null ? void 0 : classNames.bodyWrapper })
|
|
8008
8502
|
}),
|
|
8009
8503
|
[slots, classNames == null ? void 0 : classNames.bodyWrapper]
|
|
8010
8504
|
);
|
|
8011
|
-
const getTitleWrapperProps = (0,
|
|
8505
|
+
const getTitleWrapperProps = (0, import_react25.useCallback)(
|
|
8012
8506
|
() => ({
|
|
8013
8507
|
className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper })
|
|
8014
8508
|
}),
|
|
8015
8509
|
[slots, classNames == null ? void 0 : classNames.titleWrapper]
|
|
8016
8510
|
);
|
|
8017
|
-
const getTitleProps = (0,
|
|
8511
|
+
const getTitleProps = (0, import_react25.useCallback)(
|
|
8018
8512
|
() => ({
|
|
8019
8513
|
className: slots.title({ class: classNames == null ? void 0 : classNames.title })
|
|
8020
8514
|
}),
|
|
8021
8515
|
[slots, classNames == null ? void 0 : classNames.title]
|
|
8022
8516
|
);
|
|
8023
|
-
const getSubTitleProps = (0,
|
|
8517
|
+
const getSubTitleProps = (0, import_react25.useCallback)(
|
|
8024
8518
|
() => ({
|
|
8025
8519
|
className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle })
|
|
8026
8520
|
}),
|
|
8027
8521
|
[slots, classNames == null ? void 0 : classNames.subTitle]
|
|
8028
8522
|
);
|
|
8029
|
-
const getBodyProps = (0,
|
|
8523
|
+
const getBodyProps = (0, import_react25.useCallback)(
|
|
8030
8524
|
() => ({
|
|
8031
8525
|
className: slots.body({ class: classNames == null ? void 0 : classNames.body })
|
|
8032
8526
|
}),
|
|
8033
8527
|
[slots, classNames == null ? void 0 : classNames.body]
|
|
8034
8528
|
);
|
|
8035
|
-
const getContentProps = (0,
|
|
8529
|
+
const getContentProps = (0, import_react25.useCallback)(
|
|
8036
8530
|
() => ({
|
|
8037
8531
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content })
|
|
8038
8532
|
}),
|
|
8039
8533
|
[slots, classNames == null ? void 0 : classNames.content]
|
|
8040
8534
|
);
|
|
8041
|
-
const getFooterWrapperProps = (0,
|
|
8535
|
+
const getFooterWrapperProps = (0, import_react25.useCallback)(
|
|
8042
8536
|
() => ({
|
|
8043
8537
|
className: slots.footerWrapper({ class: classNames == null ? void 0 : classNames.footerWrapper })
|
|
8044
8538
|
}),
|
|
8045
8539
|
[slots, classNames == null ? void 0 : classNames.footerWrapper]
|
|
8046
8540
|
);
|
|
8047
|
-
(0,
|
|
8541
|
+
(0, import_react25.useEffect)(() => {
|
|
8048
8542
|
if (isOpen) {
|
|
8049
8543
|
document.body.classList.add("overflow-hidden");
|
|
8050
8544
|
} else {
|
|
@@ -8062,20 +8556,20 @@ var Modal = (0, import_react23.forwardRef)((originalProps, ref) => {
|
|
|
8062
8556
|
document.body.classList.remove("overflow-hidden");
|
|
8063
8557
|
};
|
|
8064
8558
|
}, [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,
|
|
8559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children: isOpen && (0, import_react_dom3.createPortal)(
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getBackdropProps(), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref, ...getModalWrapperProps(), children: [
|
|
8561
|
+
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 }),
|
|
8562
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getBodyWrapperProps(), children: [
|
|
8563
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon_default, { name: "close", ...getCloseIconProps(), onClick: onCancel }),
|
|
8564
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getBodyProps(), children: [
|
|
8565
|
+
(title || subTitle) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getTitleWrapperProps(), children: [
|
|
8566
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getTitleProps(), children: title }),
|
|
8567
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getSubTitleProps(), children: subTitle })
|
|
8074
8568
|
] }),
|
|
8075
|
-
content && typeof content === "string" ? /* @__PURE__ */ (0,
|
|
8076
|
-
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0,
|
|
8077
|
-
cancelButtonText && /* @__PURE__ */ (0,
|
|
8078
|
-
confirmButtonText && /* @__PURE__ */ (0,
|
|
8569
|
+
content && typeof content === "string" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ...getContentProps(), children: content }) : content,
|
|
8570
|
+
(cancelButtonText || confirmButtonText) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ...getFooterWrapperProps(), children: [
|
|
8571
|
+
cancelButtonText && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(button_default, { variant: "outline", color: originalProps.color, fullWidth: true, onClick: onCancel, children: cancelButtonText }),
|
|
8572
|
+
confirmButtonText && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(button_default, { size: "md", color: originalProps.color, fullWidth: true, onClick: onConfirm, children: confirmButtonText })
|
|
8079
8573
|
] })
|
|
8080
8574
|
] })
|
|
8081
8575
|
] })
|
|
@@ -8146,15 +8640,15 @@ var modal = tv({
|
|
|
8146
8640
|
});
|
|
8147
8641
|
|
|
8148
8642
|
// src/components/list/list.tsx
|
|
8149
|
-
var
|
|
8150
|
-
var
|
|
8151
|
-
var List = (0,
|
|
8643
|
+
var import_react26 = require("react");
|
|
8644
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
8645
|
+
var List = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
8152
8646
|
const [props, variantProps] = mapPropsVariants(originalProps, listStyle.variantKeys);
|
|
8153
8647
|
const { children, classNames } = props;
|
|
8154
|
-
const slots = (0,
|
|
8155
|
-
return /* @__PURE__ */ (0,
|
|
8156
|
-
if (!(0,
|
|
8157
|
-
return (0,
|
|
8648
|
+
const slots = (0, import_react26.useMemo)(() => listStyle(variantProps), [variantProps]);
|
|
8649
|
+
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) => {
|
|
8650
|
+
if (!(0, import_react26.isValidElement)(child)) return child;
|
|
8651
|
+
return (0, import_react26.cloneElement)(child, {
|
|
8158
8652
|
...variantProps,
|
|
8159
8653
|
...child.props
|
|
8160
8654
|
});
|
|
@@ -8191,9 +8685,9 @@ var listStyle = tv({
|
|
|
8191
8685
|
});
|
|
8192
8686
|
|
|
8193
8687
|
// src/components/list/listItem.tsx
|
|
8194
|
-
var
|
|
8195
|
-
var
|
|
8196
|
-
var ListItem = (0,
|
|
8688
|
+
var import_react27 = require("react");
|
|
8689
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
8690
|
+
var ListItem = (0, import_react27.forwardRef)((props, ref) => {
|
|
8197
8691
|
const [rawProps, variantProps] = mapPropsVariants(props, listItemStyle.variantKeys);
|
|
8198
8692
|
const {
|
|
8199
8693
|
title,
|
|
@@ -8205,19 +8699,19 @@ var ListItem = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
8205
8699
|
classNames,
|
|
8206
8700
|
onClick
|
|
8207
8701
|
} = { ...rawProps, ...variantProps };
|
|
8208
|
-
const slots = (0,
|
|
8702
|
+
const slots = (0, import_react27.useMemo)(() => listItemStyle(variantProps), [variantProps]);
|
|
8209
8703
|
const iconSize = ["lg", "xl"].includes(size) ? "lg" : "md";
|
|
8210
8704
|
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,
|
|
8705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), "data-selected": selected, onClick, children: [
|
|
8706
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.wrapper({ class: classNames == null ? void 0 : classNames.wrapper }), children: [
|
|
8707
|
+
avatar && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(avatar_default, { ...avatar, variant: "round", size: avatarSize }),
|
|
8708
|
+
startIconName && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: startIconName, fill: true, size, className: slots.startIcon({ class: classNames == null ? void 0 : classNames.startIcon }) }),
|
|
8709
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: slots.titleWrapper({ class: classNames == null ? void 0 : classNames.titleWrapper }), children: [
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: slots.title({ class: classNames == null ? void 0 : classNames.title }), children: title }),
|
|
8711
|
+
subTitle && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: slots.subTitle({ class: classNames == null ? void 0 : classNames.subTitle }), children: subTitle })
|
|
8218
8712
|
] })
|
|
8219
8713
|
] }),
|
|
8220
|
-
/* @__PURE__ */ (0,
|
|
8714
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Icon_default, { name: "right-chevron", size: iconSize, className: slots.icon({ class: classNames == null ? void 0 : classNames.icon }) })
|
|
8221
8715
|
] });
|
|
8222
8716
|
});
|
|
8223
8717
|
ListItem.displayName = "ListItem";
|
|
@@ -8385,14 +8879,14 @@ var listItemStyle = tv({
|
|
|
8385
8879
|
});
|
|
8386
8880
|
|
|
8387
8881
|
// src/components/toast/toast.tsx
|
|
8388
|
-
var
|
|
8389
|
-
var
|
|
8390
|
-
var Toast = (0,
|
|
8882
|
+
var import_react28 = require("react");
|
|
8883
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
8884
|
+
var Toast = (0, import_react28.forwardRef)((originalProps, ref) => {
|
|
8391
8885
|
const [props, variantProps] = mapPropsVariants(originalProps, toast.variantKeys);
|
|
8392
8886
|
const { width = 300, placement, classNames, showIcon = true, showCloseButton = true, onClose, ...toastProps } = props;
|
|
8393
|
-
const slots = (0,
|
|
8394
|
-
const toastRef = (0,
|
|
8395
|
-
(0,
|
|
8887
|
+
const slots = (0, import_react28.useMemo)(() => toast({ ...variantProps }), [variantProps]);
|
|
8888
|
+
const toastRef = (0, import_react28.useRef)(null);
|
|
8889
|
+
(0, import_react28.useImperativeHandle)(
|
|
8396
8890
|
ref,
|
|
8397
8891
|
() => ({
|
|
8398
8892
|
getWidth: () => {
|
|
@@ -8403,7 +8897,7 @@ var Toast = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
|
8403
8897
|
}),
|
|
8404
8898
|
[]
|
|
8405
8899
|
);
|
|
8406
|
-
const getBaseProps = (0,
|
|
8900
|
+
const getBaseProps = (0, import_react28.useCallback)(
|
|
8407
8901
|
() => ({
|
|
8408
8902
|
className: slots.base({
|
|
8409
8903
|
class: [
|
|
@@ -8415,10 +8909,10 @@ var Toast = (0, import_react26.forwardRef)((originalProps, ref) => {
|
|
|
8415
8909
|
}),
|
|
8416
8910
|
[slots, classNames == null ? void 0 : classNames.base]
|
|
8417
8911
|
);
|
|
8418
|
-
return /* @__PURE__ */ (0,
|
|
8419
|
-
showIcon && /* @__PURE__ */ (0,
|
|
8420
|
-
/* @__PURE__ */ (0,
|
|
8421
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
8912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { ref: toastRef, ...getBaseProps(), children: [
|
|
8913
|
+
showIcon && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: originalProps.icon || "info-circle", fill: true, className: "mt-[2px]" }),
|
|
8914
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1 select-none", children: props.content }),
|
|
8915
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon_default, { name: "close", className: "cursor-pointer mt-[2px]", onClick: onClose })
|
|
8422
8916
|
] });
|
|
8423
8917
|
});
|
|
8424
8918
|
Toast.displayName = "Toast";
|
|
@@ -8488,7 +8982,7 @@ var toast = tv({
|
|
|
8488
8982
|
});
|
|
8489
8983
|
|
|
8490
8984
|
// src/components/toast/use-toast.tsx
|
|
8491
|
-
var
|
|
8985
|
+
var import_react29 = require("react");
|
|
8492
8986
|
|
|
8493
8987
|
// src/components/toast/toast-utils.ts
|
|
8494
8988
|
var getToastPosition = (placement, width, offset) => {
|
|
@@ -8527,10 +9021,10 @@ var getToastPosition = (placement, width, offset) => {
|
|
|
8527
9021
|
};
|
|
8528
9022
|
|
|
8529
9023
|
// src/components/toast/use-toast.tsx
|
|
8530
|
-
var
|
|
8531
|
-
var ToastContext = (0,
|
|
9024
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
9025
|
+
var ToastContext = (0, import_react29.createContext)(null);
|
|
8532
9026
|
var useToast = () => {
|
|
8533
|
-
const context = (0,
|
|
9027
|
+
const context = (0, import_react29.useContext)(ToastContext);
|
|
8534
9028
|
if (!context) {
|
|
8535
9029
|
throw new Error("useToast must be used within a ToastProvider");
|
|
8536
9030
|
}
|
|
@@ -8540,10 +9034,10 @@ var ToastProvider = ({
|
|
|
8540
9034
|
globalOptions,
|
|
8541
9035
|
children
|
|
8542
9036
|
}) => {
|
|
8543
|
-
const [toasts, setToasts] = (0,
|
|
8544
|
-
const [containerStyle, setContainerStyle] = (0,
|
|
8545
|
-
const toastRef = (0,
|
|
8546
|
-
const addToast = (0,
|
|
9037
|
+
const [toasts, setToasts] = (0, import_react29.useState)([]);
|
|
9038
|
+
const [containerStyle, setContainerStyle] = (0, import_react29.useState)({});
|
|
9039
|
+
const toastRef = (0, import_react29.useRef)(null);
|
|
9040
|
+
const addToast = (0, import_react29.useCallback)((content, options) => {
|
|
8547
9041
|
const id = Date.now() + Math.floor(Math.random() * 1e5);
|
|
8548
9042
|
const newToast = {
|
|
8549
9043
|
id,
|
|
@@ -8555,7 +9049,7 @@ var ToastProvider = ({
|
|
|
8555
9049
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8556
9050
|
}, options.duration || 3e3);
|
|
8557
9051
|
}, []);
|
|
8558
|
-
const removeToast = (0,
|
|
9052
|
+
const removeToast = (0, import_react29.useCallback)((id) => {
|
|
8559
9053
|
setToasts((prevToasts) => prevToasts.filter((toast2) => toast2.id !== id));
|
|
8560
9054
|
}, []);
|
|
8561
9055
|
const value = {
|
|
@@ -8571,7 +9065,7 @@ var ToastProvider = ({
|
|
|
8571
9065
|
}),
|
|
8572
9066
|
error: (content, options) => addToast(content, { type: "error", icon: "exclamation-circle", color: "danger", ...globalOptions, ...options })
|
|
8573
9067
|
};
|
|
8574
|
-
(0,
|
|
9068
|
+
(0, import_react29.useEffect)(() => {
|
|
8575
9069
|
var _a;
|
|
8576
9070
|
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
9071
|
const offset = 20;
|
|
@@ -8590,18 +9084,18 @@ var ToastProvider = ({
|
|
|
8590
9084
|
window.addEventListener("resize", calculatePosition);
|
|
8591
9085
|
return () => window.removeEventListener("resize", calculatePosition);
|
|
8592
9086
|
}, [globalOptions == null ? void 0 : globalOptions.placement, globalOptions == null ? void 0 : globalOptions.width]);
|
|
8593
|
-
return /* @__PURE__ */ (0,
|
|
9087
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(ToastContext.Provider, { value, children: [
|
|
8594
9088
|
children,
|
|
8595
|
-
/* @__PURE__ */ (0,
|
|
9089
|
+
/* @__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
9090
|
] });
|
|
8597
9091
|
};
|
|
8598
9092
|
|
|
8599
9093
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8600
|
-
var
|
|
9094
|
+
var import_react33 = __toESM(require("react"));
|
|
8601
9095
|
var import_react_dom4 = require("react-dom");
|
|
8602
9096
|
|
|
8603
9097
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8604
|
-
var
|
|
9098
|
+
var import_react30 = require("react");
|
|
8605
9099
|
|
|
8606
9100
|
// src/components/dateTimePicker/util.ts
|
|
8607
9101
|
var formatDateToString = (date) => {
|
|
@@ -8617,17 +9111,17 @@ var formatStringToDate = (date) => {
|
|
|
8617
9111
|
|
|
8618
9112
|
// src/components/dateTimePicker/useDateTimePicker.tsx
|
|
8619
9113
|
var useDatePicker = ({ initialDate, initialTime }) => {
|
|
8620
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
9114
|
+
const [selectedDate, setSelectedDate] = (0, import_react30.useState)(
|
|
8621
9115
|
initialDate ? formatDateToString(initialDate) : ""
|
|
8622
9116
|
);
|
|
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,
|
|
9117
|
+
const [selectedTime, setSelectedTime] = (0, import_react30.useState)(initialTime ? initialTime : "");
|
|
9118
|
+
const [targetRect, setTargetRect] = (0, import_react30.useState)(null);
|
|
9119
|
+
const [popupWidth, setPopupWidth] = (0, import_react30.useState)(0);
|
|
9120
|
+
const [popupHeight, setPopupHeight] = (0, import_react30.useState)(0);
|
|
9121
|
+
const [isFocusInput, setIsFocusInput] = (0, import_react30.useState)(false);
|
|
9122
|
+
const dateInputRef = (0, import_react30.useRef)(null);
|
|
9123
|
+
const datePickerWrapperRef = (0, import_react30.useRef)(null);
|
|
9124
|
+
const datePickerRef = (0, import_react30.useRef)(null);
|
|
8631
9125
|
const DATE_PICKER_GAP = 4;
|
|
8632
9126
|
const calculatePositionWithScroll = (targetRect2) => {
|
|
8633
9127
|
if (targetRect2 && popupWidth && popupHeight) {
|
|
@@ -8660,7 +9154,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8660
9154
|
const handleBlueInput = () => {
|
|
8661
9155
|
setIsFocusInput(false);
|
|
8662
9156
|
};
|
|
8663
|
-
(0,
|
|
9157
|
+
(0, import_react30.useEffect)(() => {
|
|
8664
9158
|
const onClickOutside = (e) => {
|
|
8665
9159
|
if (datePickerRef.current && !datePickerRef.current.contains(e.target) && datePickerWrapperRef.current && !datePickerWrapperRef.current.contains(e.target)) {
|
|
8666
9160
|
setTargetRect(null);
|
|
@@ -8669,7 +9163,7 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8669
9163
|
window.addEventListener("mousedown", onClickOutside);
|
|
8670
9164
|
return () => window.removeEventListener("mousedown", onClickOutside);
|
|
8671
9165
|
}, []);
|
|
8672
|
-
(0,
|
|
9166
|
+
(0, import_react30.useEffect)(() => {
|
|
8673
9167
|
if (datePickerWrapperRef.current) {
|
|
8674
9168
|
setPopupHeight(datePickerWrapperRef.current.getBoundingClientRect().height);
|
|
8675
9169
|
setPopupWidth(datePickerWrapperRef.current.getBoundingClientRect().width);
|
|
@@ -8694,19 +9188,19 @@ var useDatePicker = ({ initialDate, initialTime }) => {
|
|
|
8694
9188
|
};
|
|
8695
9189
|
|
|
8696
9190
|
// src/components/dateTimePicker/calendar.tsx
|
|
8697
|
-
var
|
|
8698
|
-
var
|
|
8699
|
-
var Calendar = (0,
|
|
9191
|
+
var import_react31 = __toESM(require("react"));
|
|
9192
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
9193
|
+
var Calendar = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
8700
9194
|
const [props, variantProps] = mapPropsVariants(originalProps, calendarStyle.variantKeys);
|
|
8701
9195
|
const { selectedDate, classNames, highlightWeekend = true, onChangeDate, ...inputProps } = props;
|
|
8702
|
-
const [currentDate, setCurrentDate] = (0,
|
|
9196
|
+
const [currentDate, setCurrentDate] = (0, import_react31.useState)(selectedDate ? new Date(selectedDate) : /* @__PURE__ */ new Date());
|
|
8703
9197
|
const daysOfWeek = ["S", "M", "T", "W", "T", "F", "S"];
|
|
8704
|
-
(0,
|
|
9198
|
+
(0, import_react31.useEffect)(() => {
|
|
8705
9199
|
if (selectedDate) {
|
|
8706
9200
|
setCurrentDate(new Date(selectedDate));
|
|
8707
9201
|
}
|
|
8708
9202
|
}, [selectedDate]);
|
|
8709
|
-
const getCalendarDates = (0,
|
|
9203
|
+
const getCalendarDates = (0, import_react31.useCallback)(() => {
|
|
8710
9204
|
const year = currentDate.getFullYear();
|
|
8711
9205
|
const month = currentDate.getMonth();
|
|
8712
9206
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
@@ -8752,17 +9246,17 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8752
9246
|
onChangeDate(formatted);
|
|
8753
9247
|
}
|
|
8754
9248
|
};
|
|
8755
|
-
(0,
|
|
9249
|
+
(0, import_react31.useImperativeHandle)(ref, () => ({
|
|
8756
9250
|
getSelectedDate: () => selectedDate
|
|
8757
9251
|
}));
|
|
8758
|
-
const slots = (0,
|
|
8759
|
-
const getBaseProps = (0,
|
|
9252
|
+
const slots = (0, import_react31.useMemo)(() => calendarStyle({ ...variantProps }), [variantProps]);
|
|
9253
|
+
const getBaseProps = (0, import_react31.useCallback)(
|
|
8760
9254
|
() => ({
|
|
8761
9255
|
className: `${slots.base({ class: classNames == null ? void 0 : classNames.base })}`
|
|
8762
9256
|
}),
|
|
8763
9257
|
[slots, classNames]
|
|
8764
9258
|
);
|
|
8765
|
-
const getDateTitleProps = (0,
|
|
9259
|
+
const getDateTitleProps = (0, import_react31.useCallback)(
|
|
8766
9260
|
(index) => {
|
|
8767
9261
|
return {
|
|
8768
9262
|
className: `${slots.dateTitle({
|
|
@@ -8774,7 +9268,7 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8774
9268
|
},
|
|
8775
9269
|
[slots, classNames, highlightWeekend]
|
|
8776
9270
|
);
|
|
8777
|
-
const getDateProps = (0,
|
|
9271
|
+
const getDateProps = (0, import_react31.useCallback)(
|
|
8778
9272
|
(dateObj) => {
|
|
8779
9273
|
const today = /* @__PURE__ */ new Date();
|
|
8780
9274
|
const isToday = today.getDate() === dateObj.date && today.getMonth() === currentDate.getMonth() && today.getFullYear() === currentDate.getFullYear();
|
|
@@ -8796,18 +9290,18 @@ var Calendar = (0, import_react29.forwardRef)((originalProps, ref) => {
|
|
|
8796
9290
|
[slots, classNames, selectedDate, currentDate, highlightWeekend]
|
|
8797
9291
|
);
|
|
8798
9292
|
const calendarDates = getCalendarDates();
|
|
8799
|
-
return /* @__PURE__ */ (0,
|
|
8800
|
-
/* @__PURE__ */ (0,
|
|
8801
|
-
/* @__PURE__ */ (0,
|
|
8802
|
-
/* @__PURE__ */ (0,
|
|
8803
|
-
/* @__PURE__ */ (0,
|
|
9293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ...getBaseProps(), children: [
|
|
9294
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "calendar-header flex justify-between items-center mb-4", children: [
|
|
9295
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "brace-left", size: "md", className: "cursor-pointer", onClick: handlePrevMonth }),
|
|
9296
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-h6 font-semibold", children: currentDate.toLocaleString("default", { year: "numeric", month: "2-digit" }) }),
|
|
9297
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { name: "brace-right", size: "md", className: "cursor-pointer", onClick: handleNextMonth })
|
|
8804
9298
|
] }),
|
|
8805
|
-
/* @__PURE__ */ (0,
|
|
8806
|
-
/* @__PURE__ */ (0,
|
|
9299
|
+
/* @__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}`)) }),
|
|
9300
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grid grid-cols-7 gap-[5px] text-center mt-2", children: calendarDates.map((week, weekIndex) => {
|
|
8807
9301
|
const hasCurrentMonthDates = week.some((dateObj) => dateObj.currentMonth);
|
|
8808
9302
|
if (!hasCurrentMonthDates) return null;
|
|
8809
|
-
return /* @__PURE__ */ (0,
|
|
8810
|
-
return /* @__PURE__ */ (0,
|
|
9303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react31.default.Fragment, { children: week.map((dateObj, index) => {
|
|
9304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ...getDateProps(dateObj), children: dateObj.date }, index);
|
|
8811
9305
|
}) }, weekIndex);
|
|
8812
9306
|
}) })
|
|
8813
9307
|
] }) });
|
|
@@ -8878,22 +9372,22 @@ var calendarStyle = tv({
|
|
|
8878
9372
|
});
|
|
8879
9373
|
|
|
8880
9374
|
// src/components/dateTimePicker/timePicker.tsx
|
|
8881
|
-
var
|
|
8882
|
-
var
|
|
9375
|
+
var import_react32 = require("react");
|
|
9376
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
8883
9377
|
var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime }) => {
|
|
8884
9378
|
const TOTAL_HOURS = 12;
|
|
8885
9379
|
const TOTAL_MINUTES = 60;
|
|
8886
9380
|
const ITEM_HEIGHT = 30;
|
|
8887
9381
|
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,
|
|
9382
|
+
const [selectedHour, setSelectedHour] = (0, import_react32.useState)("01");
|
|
9383
|
+
const [selectedMinute, setSelectedMinute] = (0, import_react32.useState)("00");
|
|
9384
|
+
const [selectedPeriod, setSelectedPeriod] = (0, import_react32.useState)("AM");
|
|
9385
|
+
const hourRef = (0, import_react32.useRef)(null);
|
|
9386
|
+
const minuteRef = (0, import_react32.useRef)(null);
|
|
9387
|
+
const periodRef = (0, import_react32.useRef)(null);
|
|
8894
9388
|
const hoursArray = [...Array(TOTAL_HOURS).keys()].map((i) => (i + 1).toString().padStart(2, "0"));
|
|
8895
9389
|
const minutesArray = [...Array(TOTAL_MINUTES).keys()].map((i) => i.toString().padStart(2, "0"));
|
|
8896
|
-
(0,
|
|
9390
|
+
(0, import_react32.useEffect)(() => {
|
|
8897
9391
|
if (selectedTime) {
|
|
8898
9392
|
const { formattedHour, minute, period } = parseAndFormatTime(selectedTime);
|
|
8899
9393
|
setSelectedHour(formattedHour);
|
|
@@ -8904,7 +9398,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8904
9398
|
scrollToSelectedTime();
|
|
8905
9399
|
}
|
|
8906
9400
|
}, [selectedTime, isFocusInput]);
|
|
8907
|
-
(0,
|
|
9401
|
+
(0, import_react32.useEffect)(() => {
|
|
8908
9402
|
scrollToSelectedTime();
|
|
8909
9403
|
}, []);
|
|
8910
9404
|
const parseAndFormatTime = (time) => {
|
|
@@ -8941,8 +9435,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8941
9435
|
onChangeTime(formattedTime);
|
|
8942
9436
|
}
|
|
8943
9437
|
};
|
|
8944
|
-
return /* @__PURE__ */ (0,
|
|
8945
|
-
/* @__PURE__ */ (0,
|
|
9438
|
+
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: [
|
|
9439
|
+
/* @__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
9440
|
listItem_default,
|
|
8947
9441
|
{
|
|
8948
9442
|
color,
|
|
@@ -8956,7 +9450,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8956
9450
|
},
|
|
8957
9451
|
`${period}-${index}`
|
|
8958
9452
|
)) }),
|
|
8959
|
-
/* @__PURE__ */ (0,
|
|
9453
|
+
/* @__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
9454
|
listItem_default,
|
|
8961
9455
|
{
|
|
8962
9456
|
color,
|
|
@@ -8970,7 +9464,7 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8970
9464
|
},
|
|
8971
9465
|
`${hour}-${index}`
|
|
8972
9466
|
)) }),
|
|
8973
|
-
/* @__PURE__ */ (0,
|
|
9467
|
+
/* @__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
9468
|
listItem_default,
|
|
8975
9469
|
{
|
|
8976
9470
|
color,
|
|
@@ -8989,8 +9483,8 @@ var TimePicker = ({ color = "primary", selectedTime, isFocusInput, onChangeTime
|
|
|
8989
9483
|
var timePicker_default = TimePicker;
|
|
8990
9484
|
|
|
8991
9485
|
// src/components/dateTimePicker/dateTimePicker.tsx
|
|
8992
|
-
var
|
|
8993
|
-
var DatePicker = (0,
|
|
9486
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
9487
|
+
var DatePicker = (0, import_react33.forwardRef)((originalProps, ref) => {
|
|
8994
9488
|
const [props, variantProps] = mapPropsVariants(originalProps, dateTimePickerStyle.variantKeys);
|
|
8995
9489
|
const {
|
|
8996
9490
|
classNames,
|
|
@@ -9004,7 +9498,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9004
9498
|
onChangeTime,
|
|
9005
9499
|
...inputProps
|
|
9006
9500
|
} = props;
|
|
9007
|
-
const slots = (0,
|
|
9501
|
+
const slots = (0, import_react33.useMemo)(() => dateTimePickerStyle({ ...variantProps }), [variantProps]);
|
|
9008
9502
|
const {
|
|
9009
9503
|
selectedDate,
|
|
9010
9504
|
selectedTime,
|
|
@@ -9025,32 +9519,32 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9025
9519
|
initialTime: typeof value === "string" ? value : void 0
|
|
9026
9520
|
});
|
|
9027
9521
|
const position = targetRect ? calculatePositionWithScroll(targetRect) : null;
|
|
9028
|
-
const getBaseProps = (0,
|
|
9522
|
+
const getBaseProps = (0, import_react33.useCallback)(
|
|
9029
9523
|
() => ({
|
|
9030
9524
|
className: slots.base({ class: classNames == null ? void 0 : classNames.base })
|
|
9031
9525
|
}),
|
|
9032
9526
|
[slots, classNames]
|
|
9033
9527
|
);
|
|
9034
|
-
const getLabelProps = (0,
|
|
9528
|
+
const getLabelProps = (0, import_react33.useCallback)(
|
|
9035
9529
|
() => ({
|
|
9036
9530
|
className: slots.label({ class: classNames == null ? void 0 : classNames.label })
|
|
9037
9531
|
}),
|
|
9038
9532
|
[slots, classNames]
|
|
9039
9533
|
);
|
|
9040
|
-
const getInnerWrapperProps = (0,
|
|
9534
|
+
const getInnerWrapperProps = (0, import_react33.useCallback)(
|
|
9041
9535
|
() => ({
|
|
9042
9536
|
className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
|
|
9043
9537
|
}),
|
|
9044
9538
|
[slots, classNames]
|
|
9045
9539
|
);
|
|
9046
|
-
const getInputWrapperProps = (0,
|
|
9540
|
+
const getInputWrapperProps = (0, import_react33.useCallback)(
|
|
9047
9541
|
() => ({
|
|
9048
9542
|
className: slots.inputWrapper({ class: classNames == null ? void 0 : classNames.inputWrapper }),
|
|
9049
9543
|
ref: datePickerRef
|
|
9050
9544
|
}),
|
|
9051
9545
|
[slots, classNames]
|
|
9052
9546
|
);
|
|
9053
|
-
const getInputProps = (0,
|
|
9547
|
+
const getInputProps = (0, import_react33.useCallback)(
|
|
9054
9548
|
() => ({
|
|
9055
9549
|
...inputProps,
|
|
9056
9550
|
ref: ref || dateInputRef,
|
|
@@ -9081,33 +9575,33 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9081
9575
|
}),
|
|
9082
9576
|
[inputProps, ref, dateInputRef, slots, classNames == null ? void 0 : classNames.input, selectedDate, selectedTime, type, value]
|
|
9083
9577
|
);
|
|
9084
|
-
const getContentProps = (0,
|
|
9578
|
+
const getContentProps = (0, import_react33.useCallback)(
|
|
9085
9579
|
() => ({
|
|
9086
9580
|
className: slots.content({ class: classNames == null ? void 0 : classNames.content }),
|
|
9087
9581
|
size: originalProps.size
|
|
9088
9582
|
}),
|
|
9089
9583
|
[slots, classNames, originalProps.size]
|
|
9090
9584
|
);
|
|
9091
|
-
const getErrorMessageProps = (0,
|
|
9585
|
+
const getErrorMessageProps = (0, import_react33.useCallback)(
|
|
9092
9586
|
() => ({
|
|
9093
9587
|
className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
|
|
9094
9588
|
}),
|
|
9095
9589
|
[slots, classNames]
|
|
9096
9590
|
);
|
|
9097
9591
|
const renderStartContent = () => {
|
|
9098
|
-
if (
|
|
9592
|
+
if (import_react33.default.isValidElement(startContent)) {
|
|
9099
9593
|
const existingProps = startContent.props;
|
|
9100
9594
|
const mergedProps = {
|
|
9101
9595
|
...getContentProps(),
|
|
9102
9596
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9103
9597
|
};
|
|
9104
|
-
return
|
|
9598
|
+
return import_react33.default.cloneElement(startContent, mergedProps);
|
|
9105
9599
|
} else {
|
|
9106
9600
|
const contentProps = getContentProps();
|
|
9107
|
-
return /* @__PURE__ */ (0,
|
|
9601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...contentProps, children: startContent });
|
|
9108
9602
|
}
|
|
9109
9603
|
};
|
|
9110
|
-
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0,
|
|
9604
|
+
const renderDateTimePickerIcon = () => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ...getContentProps(), onClick: handleToggleDatePicker, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9111
9605
|
Icon_default,
|
|
9112
9606
|
{
|
|
9113
9607
|
name: type === "time" ? "clock" : "calendar",
|
|
@@ -9117,18 +9611,18 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9117
9611
|
}
|
|
9118
9612
|
) });
|
|
9119
9613
|
const renderContentWithIcon = () => {
|
|
9120
|
-
if (
|
|
9614
|
+
if (import_react33.default.isValidElement(endContent)) {
|
|
9121
9615
|
const existingProps = endContent.props;
|
|
9122
9616
|
const mergedProps = {
|
|
9123
9617
|
...getContentProps(),
|
|
9124
9618
|
className: `${getContentProps().className || ""} ${existingProps.className || ""}`.trim()
|
|
9125
9619
|
};
|
|
9126
|
-
return
|
|
9620
|
+
return import_react33.default.cloneElement(endContent, mergedProps);
|
|
9127
9621
|
} else if (errorMessage) {
|
|
9128
9622
|
const iconProps = { ...getContentProps(), className: getContentProps().className };
|
|
9129
|
-
return /* @__PURE__ */ (0,
|
|
9623
|
+
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
9624
|
} else {
|
|
9131
|
-
return /* @__PURE__ */ (0,
|
|
9625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, {});
|
|
9132
9626
|
}
|
|
9133
9627
|
};
|
|
9134
9628
|
const renderEndContent = () => {
|
|
@@ -9143,20 +9637,20 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9143
9637
|
return renderContentWithIcon();
|
|
9144
9638
|
}
|
|
9145
9639
|
};
|
|
9146
|
-
return /* @__PURE__ */ (0,
|
|
9147
|
-
/* @__PURE__ */ (0,
|
|
9148
|
-
label && /* @__PURE__ */ (0,
|
|
9149
|
-
/* @__PURE__ */ (0,
|
|
9150
|
-
/* @__PURE__ */ (0,
|
|
9640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
9641
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getBaseProps(), children: [
|
|
9642
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("label", { ...getLabelProps(), children: label }),
|
|
9643
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getInnerWrapperProps(), children: [
|
|
9644
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { ...getInputWrapperProps(), children: [
|
|
9151
9645
|
startContent && renderStartContent(),
|
|
9152
|
-
/* @__PURE__ */ (0,
|
|
9646
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("input", { ...getInputProps() }),
|
|
9153
9647
|
renderEndContent()
|
|
9154
9648
|
] }),
|
|
9155
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
9649
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { ...getErrorMessageProps(), children: errorMessage })
|
|
9156
9650
|
] })
|
|
9157
9651
|
] }),
|
|
9158
|
-
targetRect && /* @__PURE__ */ (0,
|
|
9159
|
-
/* @__PURE__ */ (0,
|
|
9652
|
+
targetRect && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: (0, import_react_dom4.createPortal)(
|
|
9653
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
9160
9654
|
"div",
|
|
9161
9655
|
{
|
|
9162
9656
|
ref: datePickerWrapperRef,
|
|
@@ -9167,7 +9661,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9167
9661
|
zIndex: 1e3
|
|
9168
9662
|
},
|
|
9169
9663
|
children: [
|
|
9170
|
-
type === "date" && /* @__PURE__ */ (0,
|
|
9664
|
+
type === "date" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9171
9665
|
calendar_default,
|
|
9172
9666
|
{
|
|
9173
9667
|
color: originalProps.color,
|
|
@@ -9179,7 +9673,7 @@ var DatePicker = (0, import_react31.forwardRef)((originalProps, ref) => {
|
|
|
9179
9673
|
}
|
|
9180
9674
|
}
|
|
9181
9675
|
),
|
|
9182
|
-
type === "time" && /* @__PURE__ */ (0,
|
|
9676
|
+
type === "time" && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
9183
9677
|
timePicker_default,
|
|
9184
9678
|
{
|
|
9185
9679
|
color: originalProps.color,
|
|
@@ -9338,6 +9832,7 @@ var dateTimePickerStyle = tv({
|
|
|
9338
9832
|
Chip,
|
|
9339
9833
|
DateTimePicker,
|
|
9340
9834
|
Icon,
|
|
9835
|
+
IconButton,
|
|
9341
9836
|
Input,
|
|
9342
9837
|
List,
|
|
9343
9838
|
ListItem,
|
|
@@ -9348,6 +9843,7 @@ var dateTimePickerStyle = tv({
|
|
|
9348
9843
|
Switch,
|
|
9349
9844
|
Table,
|
|
9350
9845
|
Tabs,
|
|
9846
|
+
TextButton,
|
|
9351
9847
|
Textarea,
|
|
9352
9848
|
Toast,
|
|
9353
9849
|
ToastProvider,
|