@itilite/lumina-ui 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atom/LoadingSpinner/LoadingSpinner.d.mts +19 -0
- package/dist/atom/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/atom/LoadingSpinner/LoadingSpinner.js +90 -0
- package/dist/atom/LoadingSpinner/LoadingSpinner.mjs +9 -0
- package/dist/atom/RangePicker/RangePicker.js +266 -136
- package/dist/atom/RangePicker/RangePicker.mjs +4 -2
- package/dist/atom/Select/Select.d.mts +6 -3
- package/dist/atom/Select/Select.d.ts +6 -3
- package/dist/atom/Select/Select.js +214 -91
- package/dist/atom/Select/Select.mjs +3 -1
- package/dist/atom/Slider/Slider.d.mts +34 -0
- package/dist/atom/Slider/Slider.d.ts +34 -0
- package/dist/atom/Slider/Slider.js +107 -0
- package/dist/atom/Slider/Slider.mjs +9 -0
- package/dist/chunk-22VF7AVT.mjs +618 -0
- package/dist/chunk-2BNAAOBU.mjs +670 -0
- package/dist/chunk-2IMRLK6M.mjs +44 -0
- package/dist/chunk-2JIINZEK.mjs +618 -0
- package/dist/chunk-2LBFKQDZ.mjs +660 -0
- package/dist/chunk-2ZJBF5C4.mjs +618 -0
- package/dist/chunk-3IMCN4K3.mjs +670 -0
- package/dist/chunk-3KBQQCET.mjs +674 -0
- package/dist/chunk-3KUHXNFH.mjs +678 -0
- package/dist/chunk-3PPNOIXN.mjs +618 -0
- package/dist/chunk-3XFY3TXJ.mjs +611 -0
- package/dist/chunk-3XW7HS5W.mjs +618 -0
- package/dist/chunk-447HZYZ4.mjs +612 -0
- package/dist/chunk-46F3B4U6.mjs +618 -0
- package/dist/chunk-4K5RZHL4.mjs +618 -0
- package/dist/chunk-4QHFP4YD.mjs +666 -0
- package/dist/chunk-4TFX4DHY.mjs +702 -0
- package/dist/chunk-4TWO6JES.mjs +666 -0
- package/dist/chunk-4UQVJ3ZU.mjs +666 -0
- package/dist/chunk-5247J65D.mjs +670 -0
- package/dist/chunk-66H5WSEJ.mjs +618 -0
- package/dist/chunk-6OC6URNL.mjs +73 -0
- package/dist/chunk-6OGEXG5U.mjs +618 -0
- package/dist/chunk-6ROQXYVN.mjs +672 -0
- package/dist/chunk-6WNI6X5Q.mjs +618 -0
- package/dist/chunk-72PPCN6D.mjs +675 -0
- package/dist/chunk-74EGXFNN.mjs +618 -0
- package/dist/chunk-77NCDGJA.mjs +707 -0
- package/dist/chunk-7L3WTWF3.mjs +677 -0
- package/dist/chunk-7NGBIPZT.mjs +618 -0
- package/dist/chunk-7NM4FNMQ.mjs +666 -0
- package/dist/chunk-7YBBSVUA.mjs +672 -0
- package/dist/chunk-7Z52UP7P.mjs +618 -0
- package/dist/chunk-B3LDL3KD.mjs +670 -0
- package/dist/chunk-B63IXC6M.mjs +618 -0
- package/dist/chunk-B65LGQ47.mjs +666 -0
- package/dist/chunk-B6MTRO54.mjs +618 -0
- package/dist/chunk-BJBP5XYB.mjs +618 -0
- package/dist/chunk-BLLSWPCC.mjs +618 -0
- package/dist/chunk-BOYB7REJ.mjs +670 -0
- package/dist/chunk-BP2D64XI.mjs +618 -0
- package/dist/chunk-BRT5IPGQ.mjs +618 -0
- package/dist/chunk-C2J3VBFZ.mjs +670 -0
- package/dist/chunk-CDOR7GQP.mjs +618 -0
- package/dist/chunk-CI2RMA4V.mjs +612 -0
- package/dist/chunk-CNUIZOQJ.mjs +669 -0
- package/dist/chunk-CPBXPEST.mjs +672 -0
- package/dist/chunk-CVOLXLMU.mjs +618 -0
- package/dist/chunk-CWUCNC36.mjs +666 -0
- package/dist/chunk-CZBGN6GS.mjs +612 -0
- package/dist/chunk-D3APB62N.mjs +618 -0
- package/dist/chunk-D3N7VFER.mjs +73 -0
- package/dist/chunk-D7TWXVL2.mjs +674 -0
- package/dist/chunk-DAZ53AD7.mjs +671 -0
- package/dist/chunk-DBY5U6IU.mjs +618 -0
- package/dist/chunk-DXTVU4M5.mjs +618 -0
- package/dist/chunk-DZBTD6QK.mjs +666 -0
- package/dist/chunk-EAK2IMM4.mjs +37 -0
- package/dist/chunk-EQT2Q2LW.mjs +610 -0
- package/dist/chunk-EWMCELQV.mjs +670 -0
- package/dist/chunk-EYKWBEHX.mjs +612 -0
- package/dist/chunk-FHLCFUP6.mjs +666 -0
- package/dist/chunk-FMPFLQZV.mjs +670 -0
- package/dist/chunk-G25YXZ74.mjs +618 -0
- package/dist/chunk-GSG6ZC3R.mjs +37 -0
- package/dist/chunk-H3MQUFTJ.mjs +618 -0
- package/dist/chunk-HKZRLVBX.mjs +618 -0
- package/dist/chunk-HQALJGVT.mjs +618 -0
- package/dist/chunk-I5GBZ3UX.mjs +676 -0
- package/dist/chunk-IQHBVGA4.mjs +677 -0
- package/dist/chunk-IV4V55OA.mjs +672 -0
- package/dist/chunk-J2RAFKAD.mjs +618 -0
- package/dist/chunk-JL34UFI7.mjs +670 -0
- package/dist/chunk-JTKSGGQM.mjs +611 -0
- package/dist/chunk-JZC2RRDH.mjs +618 -0
- package/dist/chunk-K3Y7VKT6.mjs +670 -0
- package/dist/chunk-KEVXNUFG.mjs +672 -0
- package/dist/chunk-KRYAP7NG.mjs +670 -0
- package/dist/chunk-KU655POK.mjs +657 -0
- package/dist/chunk-L55SLVNX.mjs +618 -0
- package/dist/chunk-LCRYOZEV.mjs +618 -0
- package/dist/chunk-LH7PP6V2.mjs +618 -0
- package/dist/chunk-LJMMYKE2.mjs +618 -0
- package/dist/chunk-LK5TROLL.mjs +666 -0
- package/dist/chunk-MDR7DAKM.mjs +618 -0
- package/dist/chunk-MJZLCWZ5.mjs +666 -0
- package/dist/chunk-MKZTEJLS.mjs +612 -0
- package/dist/chunk-MOD7MLCD.mjs +64 -0
- package/dist/chunk-MQCOQHHP.mjs +618 -0
- package/dist/chunk-MSM4KUBM.mjs +618 -0
- package/dist/chunk-MTIUER63.mjs +676 -0
- package/dist/chunk-NBLV3UX5.mjs +618 -0
- package/dist/chunk-NLADSOJS.mjs +618 -0
- package/dist/chunk-NPMTWR3Y.mjs +618 -0
- package/dist/chunk-NQ6GKEO7.mjs +670 -0
- package/dist/chunk-NZSFYNUK.mjs +618 -0
- package/dist/chunk-OANBDTKG.mjs +73 -0
- package/dist/chunk-OCNF4O5U.mjs +612 -0
- package/dist/chunk-OCW5QSWA.mjs +618 -0
- package/dist/chunk-OQF7JZFS.mjs +670 -0
- package/dist/chunk-OT675HGC.mjs +670 -0
- package/dist/chunk-P47TCYKN.mjs +618 -0
- package/dist/chunk-P7TOGXPI.mjs +672 -0
- package/dist/chunk-PCAXXEEQ.mjs +618 -0
- package/dist/chunk-PDHMG7OZ.mjs +672 -0
- package/dist/chunk-PFGVOZGM.mjs +618 -0
- package/dist/chunk-PQSSDK3E.mjs +618 -0
- package/dist/chunk-PST7W3NG.mjs +618 -0
- package/dist/chunk-QGPBZ2YV.mjs +664 -0
- package/dist/chunk-QKTMWS4J.mjs +43 -0
- package/dist/chunk-QOPCJITC.mjs +618 -0
- package/dist/chunk-QSE52CRC.mjs +618 -0
- package/dist/chunk-QTP2QMPL.mjs +669 -0
- package/dist/chunk-R47XX6IW.mjs +611 -0
- package/dist/chunk-RL6AEU6E.mjs +612 -0
- package/dist/chunk-T7T4HCHH.mjs +618 -0
- package/dist/chunk-TED2WCDG.mjs +618 -0
- package/dist/chunk-TJLIMMMB.mjs +612 -0
- package/dist/chunk-TNOJDLON.mjs +611 -0
- package/dist/chunk-TOR67IHH.mjs +672 -0
- package/dist/chunk-TOV7NVKM.mjs +618 -0
- package/dist/chunk-TSYMIRRN.mjs +618 -0
- package/dist/chunk-TTSRI4V7.mjs +708 -0
- package/dist/chunk-UBS3DTE5.mjs +672 -0
- package/dist/chunk-UBW6RYVF.mjs +670 -0
- package/dist/chunk-UJNUFKR5.mjs +43 -0
- package/dist/chunk-VAZZJOSJ.mjs +618 -0
- package/dist/chunk-VCWXOX2B.mjs +618 -0
- package/dist/chunk-VHCLEOHZ.mjs +618 -0
- package/dist/chunk-VTZSCGME.mjs +666 -0
- package/dist/chunk-W33KZ2XR.mjs +618 -0
- package/dist/chunk-WOVMTYDV.mjs +612 -0
- package/dist/chunk-WR3USBWK.mjs +672 -0
- package/dist/chunk-WXYQARQ6.mjs +618 -0
- package/dist/chunk-XSDANHCE.mjs +618 -0
- package/dist/chunk-Y6XKW4NG.mjs +618 -0
- package/dist/chunk-YQSNJFZE.mjs +618 -0
- package/dist/chunk-Z6VG6AG7.mjs +678 -0
- package/dist/chunk-ZAPKQ4C3.mjs +678 -0
- package/dist/chunk-ZCWDQNHL.mjs +618 -0
- package/dist/chunk-ZF5JBNCI.mjs +618 -0
- package/dist/chunk-ZN7BHWOF.mjs +672 -0
- package/dist/chunk-ZUQJKA5J.mjs +666 -0
- package/dist/chunk-ZWHWIGYQ.mjs +618 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +299 -136
- package/dist/index.mjs +21 -13
- package/dist/styles.css +288 -181
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -62,10 +62,12 @@ __export(index_exports, {
|
|
|
62
62
|
Avatar: () => Avatar_default,
|
|
63
63
|
Button: () => Button_default,
|
|
64
64
|
Checkbox: () => Checkbox_default,
|
|
65
|
+
LoadingSpinner: () => LoadingSpinner_default,
|
|
65
66
|
Modal: () => Modal_default,
|
|
66
67
|
Radio: () => Radio_default,
|
|
67
68
|
RangePicker: () => RangePicker_default,
|
|
68
69
|
Select: () => Select_default,
|
|
70
|
+
Slider: () => Slider_default,
|
|
69
71
|
Switch: () => Switch_default,
|
|
70
72
|
Tag: () => Tag_default,
|
|
71
73
|
Tooltip: () => Tooltip_default
|
|
@@ -587,7 +589,7 @@ Tag.displayName = "Tag";
|
|
|
587
589
|
var Tag_default = Tag;
|
|
588
590
|
|
|
589
591
|
// src/atom/RangePicker/RangePicker.tsx
|
|
590
|
-
var
|
|
592
|
+
var import_react3 = require("react");
|
|
591
593
|
var import_clsx9 = __toESM(require("clsx"));
|
|
592
594
|
var import_dayjs = __toESM(require("dayjs"));
|
|
593
595
|
|
|
@@ -639,7 +641,7 @@ var Chevron = React.memo(
|
|
|
639
641
|
var RangePicker_module_default = { "range_start": "RangePicker-module__range_start___hGQp-", "range_end": "RangePicker-module__range_end___JJNib" };
|
|
640
642
|
|
|
641
643
|
// src/atom/Select/Select.tsx
|
|
642
|
-
var
|
|
644
|
+
var import_react2 = require("react");
|
|
643
645
|
var import_clsx8 = __toESM(require("clsx"));
|
|
644
646
|
|
|
645
647
|
// src/icons/Chevron.tsx
|
|
@@ -684,16 +686,13 @@ var CrossV2 = React3.memo(
|
|
|
684
686
|
width: size,
|
|
685
687
|
height: size,
|
|
686
688
|
fill: "none",
|
|
687
|
-
viewBox: "0 0
|
|
688
|
-
className
|
|
689
|
+
viewBox: "0 0 20 20"
|
|
689
690
|
}, rest), {
|
|
690
691
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
691
692
|
"path",
|
|
692
693
|
{
|
|
693
694
|
fill: color,
|
|
694
|
-
|
|
695
|
-
d: "M4.293 4.293a1 1 0 011.414 0L8 6.586l2.293-2.293a1 1 0 111.414 1.414L9.414 8l2.293 2.293a1 1 0 01-1.414 1.414L8 9.414l-2.293 2.293a1 1 0 01-1.414-1.414L6.586 8 4.293 5.707a1 1 0 010-1.414z",
|
|
696
|
-
clipRule: "evenodd"
|
|
695
|
+
d: "M4.411 4.41a.833.833 0 0 1 1.179 0L10 8.822l4.411-4.41a.833.833 0 1 1 1.179 1.178L11.179 10l4.41 4.41a.833.833 0 0 1-1.178 1.18l-4.41-4.411-4.411 4.41a.833.833 0 1 1-1.179-1.178L8.821 10l-4.41-4.41a.833.833 0 0 1 0-1.18"
|
|
697
696
|
}
|
|
698
697
|
)
|
|
699
698
|
})
|
|
@@ -702,8 +701,66 @@ var CrossV2 = React3.memo(
|
|
|
702
701
|
);
|
|
703
702
|
CrossV2.displayName = "CrossV2";
|
|
704
703
|
|
|
705
|
-
// src/
|
|
704
|
+
// src/icons/Lock.tsx
|
|
705
|
+
var import_react = __toESM(require("react"));
|
|
706
706
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
707
|
+
var Lock = import_react.default.memo((_a) => {
|
|
708
|
+
var _b = _a, { size = 16, color = "#000" } = _b, rest = __objRest(_b, ["size", "color"]);
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
710
|
+
"svg",
|
|
711
|
+
__spreadProps(__spreadValues({
|
|
712
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
713
|
+
width: size,
|
|
714
|
+
height: size,
|
|
715
|
+
fill: "none",
|
|
716
|
+
viewBox: "0 0 16 16"
|
|
717
|
+
}, rest), {
|
|
718
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
719
|
+
"path",
|
|
720
|
+
{
|
|
721
|
+
fill: color,
|
|
722
|
+
d: "M9 9a1 1 0 11-2 0 1 1 0 012 0zM5 4h-.5A2.5 2.5 0 002 6.5v5A2.5 2.5 0 004.5 14h7a2.5 2.5 0 002.5-2.5v-5A2.5 2.5 0 0011.5 4H11v-.5a3 3 0 00-6 0V4zm1-.5a2 2 0 114 0V4H6v-.5zM11.5 5A1.5 1.5 0 0113 6.5v5a1.5 1.5 0 01-1.5 1.5h-7A1.5 1.5 0 013 11.5v-5A1.5 1.5 0 014.5 5h7z"
|
|
723
|
+
}
|
|
724
|
+
)
|
|
725
|
+
})
|
|
726
|
+
);
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
// src/atom/LoadingSpinner/LoadingSpinner.tsx
|
|
730
|
+
var import_icons = require("@ant-design/icons");
|
|
731
|
+
var import_antd8 = require("antd");
|
|
732
|
+
|
|
733
|
+
// src/atom/LoadingSpinner/LoadingSpinner.module.scss
|
|
734
|
+
var LoadingSpinner_module_default = { "spinnerContainer": "LoadingSpinner-module__spinnerContainer___DiPLf" };
|
|
735
|
+
|
|
736
|
+
// src/atom/LoadingSpinner/LoadingSpinner.tsx
|
|
737
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
738
|
+
var sizeMapping = {
|
|
739
|
+
xs: 16,
|
|
740
|
+
small: 24,
|
|
741
|
+
medium: 36,
|
|
742
|
+
large: 48
|
|
743
|
+
};
|
|
744
|
+
var LoadingSpinner = (_a) => {
|
|
745
|
+
var _b = _a, { size = "small", color = "#ec5d25" } = _b, rest = __objRest(_b, ["size", "color"]);
|
|
746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", __spreadProps(__spreadValues({ className: LoadingSpinner_module_default.spinnerContainer }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
747
|
+
import_antd8.Spin,
|
|
748
|
+
{
|
|
749
|
+
indicator: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
750
|
+
import_icons.LoadingOutlined,
|
|
751
|
+
{
|
|
752
|
+
style: { fontSize: sizeMapping[size], color },
|
|
753
|
+
spin: true
|
|
754
|
+
}
|
|
755
|
+
)
|
|
756
|
+
}
|
|
757
|
+
) }));
|
|
758
|
+
};
|
|
759
|
+
LoadingSpinner.displayName = "LoadingSpinner";
|
|
760
|
+
var LoadingSpinner_default = LoadingSpinner;
|
|
761
|
+
|
|
762
|
+
// src/atom/Select/Select.tsx
|
|
763
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
707
764
|
var Select = ({
|
|
708
765
|
label,
|
|
709
766
|
mandatory = false,
|
|
@@ -714,6 +771,10 @@ var Select = ({
|
|
|
714
771
|
value: _valueProp,
|
|
715
772
|
// Rename to avoid potential conflicts with native value attribute
|
|
716
773
|
onChange,
|
|
774
|
+
onSearch,
|
|
775
|
+
isLoading = false,
|
|
776
|
+
disabled = false,
|
|
777
|
+
disabledTooltip = "",
|
|
717
778
|
className = "",
|
|
718
779
|
dropdownClassName = "",
|
|
719
780
|
optionClassName = "",
|
|
@@ -722,7 +783,6 @@ var Select = ({
|
|
|
722
783
|
// New prop to show displayValue instead of label
|
|
723
784
|
allowClear = true,
|
|
724
785
|
enableSearch = true,
|
|
725
|
-
// New prop to control search functionality, default true
|
|
726
786
|
doubleCharSearch = false,
|
|
727
787
|
id,
|
|
728
788
|
name,
|
|
@@ -742,45 +802,45 @@ var Select = ({
|
|
|
742
802
|
// Custom height
|
|
743
803
|
experience = "business"
|
|
744
804
|
}) => {
|
|
745
|
-
const normalizeValue = (0,
|
|
805
|
+
const normalizeValue = (0, import_react2.useCallback)(
|
|
746
806
|
(val) => {
|
|
747
807
|
if (val === null || val === void 0) return "";
|
|
748
808
|
return String(val);
|
|
749
809
|
},
|
|
750
810
|
[]
|
|
751
811
|
);
|
|
752
|
-
const validatedOptions = (0,
|
|
812
|
+
const validatedOptions = (0, import_react2.useMemo)(() => {
|
|
753
813
|
if (!Array.isArray(options)) return [];
|
|
754
814
|
return options.filter(
|
|
755
815
|
(opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
|
|
756
816
|
);
|
|
757
817
|
}, [options]);
|
|
758
|
-
const [isOpen, setIsOpen] = (0,
|
|
759
|
-
const [isFocused, setIsFocused] = (0,
|
|
760
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
761
|
-
const [isHovering, setIsHovering] = (0,
|
|
762
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
763
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
818
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
819
|
+
const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
|
|
820
|
+
const [searchTerm, setSearchTerm] = (0, import_react2.useState)("");
|
|
821
|
+
const [isHovering, setIsHovering] = (0, import_react2.useState)(false);
|
|
822
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react2.useState)(-1);
|
|
823
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)(() => {
|
|
764
824
|
const initialValue = valueSelected;
|
|
765
825
|
if (initialValue === null || initialValue === void 0) return "";
|
|
766
826
|
return String(initialValue);
|
|
767
827
|
});
|
|
768
|
-
const inputRef = (0,
|
|
769
|
-
const inputValueRef = (0,
|
|
770
|
-
const dropdownRef = (0,
|
|
771
|
-
const optionRefs = (0,
|
|
772
|
-
const optionListRef = (0,
|
|
773
|
-
const blurTimeoutRef = (0,
|
|
774
|
-
const hoverTimeoutRef = (0,
|
|
828
|
+
const inputRef = (0, import_react2.useRef)(null);
|
|
829
|
+
const inputValueRef = (0, import_react2.useRef)("");
|
|
830
|
+
const dropdownRef = (0, import_react2.useRef)(null);
|
|
831
|
+
const optionRefs = (0, import_react2.useRef)([]);
|
|
832
|
+
const optionListRef = (0, import_react2.useRef)(null);
|
|
833
|
+
const blurTimeoutRef = (0, import_react2.useRef)(null);
|
|
834
|
+
const hoverTimeoutRef = (0, import_react2.useRef)(null);
|
|
775
835
|
const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
|
|
776
|
-
const sizeClasses = (0,
|
|
836
|
+
const sizeClasses = (0, import_react2.useMemo)(() => {
|
|
777
837
|
switch (size) {
|
|
778
838
|
case "small":
|
|
779
839
|
return {
|
|
780
|
-
input: "tw-h-
|
|
781
|
-
padding:
|
|
782
|
-
labelActive: "tw-top-0 tw-typography-
|
|
783
|
-
labelInactive: "tw-top-
|
|
840
|
+
input: "tw-h-6 tw-px-3 tw-typography-caption1Bold !tw-rounded-lg",
|
|
841
|
+
padding: "tw-px-2 tw-py-1",
|
|
842
|
+
labelActive: "tw-top-0.5 tw-typography-caption2",
|
|
843
|
+
labelInactive: "tw-top-1.5 tw-typography-caption3"
|
|
784
844
|
};
|
|
785
845
|
case "medium":
|
|
786
846
|
return {
|
|
@@ -805,7 +865,7 @@ var Select = ({
|
|
|
805
865
|
};
|
|
806
866
|
}
|
|
807
867
|
}, [size, label, height]);
|
|
808
|
-
const variantClasses = (0,
|
|
868
|
+
const variantClasses = (0, import_react2.useMemo)(() => {
|
|
809
869
|
switch (variant) {
|
|
810
870
|
case "filled":
|
|
811
871
|
return "tw-bg-gray-50 tw-border-transparent";
|
|
@@ -815,7 +875,7 @@ var Select = ({
|
|
|
815
875
|
return " tw-border";
|
|
816
876
|
}
|
|
817
877
|
}, [variant]);
|
|
818
|
-
const handleBlur = (0,
|
|
878
|
+
const handleBlur = (0, import_react2.useCallback)(() => {
|
|
819
879
|
blurTimeoutRef.current = setTimeout(() => {
|
|
820
880
|
setIsOpen(false);
|
|
821
881
|
setSearchTerm("");
|
|
@@ -824,24 +884,28 @@ var Select = ({
|
|
|
824
884
|
setIsFocused(false);
|
|
825
885
|
}, 150);
|
|
826
886
|
}, []);
|
|
827
|
-
const handleSearchChange = (0,
|
|
887
|
+
const handleSearchChange = (0, import_react2.useCallback)(
|
|
828
888
|
(e) => {
|
|
829
889
|
var _a;
|
|
890
|
+
const searchValue = doubleCharSearch ? e.target.value.slice(0, 2) || "" : e.target.value;
|
|
830
891
|
if (doubleCharSearch) {
|
|
831
|
-
setSearchTerm(
|
|
892
|
+
setSearchTerm(searchValue);
|
|
832
893
|
} else {
|
|
833
|
-
setSearchTerm(
|
|
894
|
+
setSearchTerm(searchValue);
|
|
834
895
|
}
|
|
835
896
|
setIsOpen(true);
|
|
836
897
|
setHighlightedIndex(-1);
|
|
898
|
+
if (onSearch && typeof onSearch === "function") {
|
|
899
|
+
onSearch(searchValue);
|
|
900
|
+
}
|
|
837
901
|
(_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
|
|
838
902
|
top: 0,
|
|
839
903
|
behavior: "smooth"
|
|
840
904
|
});
|
|
841
905
|
},
|
|
842
|
-
[doubleCharSearch]
|
|
906
|
+
[doubleCharSearch, onSearch]
|
|
843
907
|
);
|
|
844
|
-
const handleOptionSelect = (0,
|
|
908
|
+
const handleOptionSelect = (0, import_react2.useCallback)(
|
|
845
909
|
(option) => {
|
|
846
910
|
var _a;
|
|
847
911
|
if (blurTimeoutRef.current) {
|
|
@@ -862,7 +926,7 @@ var Select = ({
|
|
|
862
926
|
},
|
|
863
927
|
[normalizeValue, onChange, enableSearch]
|
|
864
928
|
);
|
|
865
|
-
const handleClear = (0,
|
|
929
|
+
const handleClear = (0, import_react2.useCallback)(
|
|
866
930
|
(e) => {
|
|
867
931
|
var _a;
|
|
868
932
|
inputValueRef.current = "";
|
|
@@ -882,21 +946,22 @@ var Select = ({
|
|
|
882
946
|
},
|
|
883
947
|
[onChange, enableSearch]
|
|
884
948
|
);
|
|
885
|
-
(0,
|
|
949
|
+
(0, import_react2.useEffect)(() => {
|
|
886
950
|
if (!validatedOptions.length) {
|
|
887
951
|
setSelectedValue("");
|
|
888
952
|
setSearchTerm("");
|
|
889
953
|
inputValueRef.current = "";
|
|
890
954
|
}
|
|
891
955
|
}, [validatedOptions.length]);
|
|
892
|
-
(0,
|
|
893
|
-
const
|
|
956
|
+
(0, import_react2.useEffect)(() => {
|
|
957
|
+
const externalValue = _valueProp !== void 0 ? _valueProp : valueSelected;
|
|
958
|
+
const newValue = normalizeValue(externalValue);
|
|
894
959
|
setSelectedValue((prevValue) => {
|
|
895
960
|
const prevNormalized = normalizeValue(prevValue);
|
|
896
961
|
return prevNormalized !== newValue ? newValue : prevValue;
|
|
897
962
|
});
|
|
898
|
-
}, [valueSelected, normalizeValue]);
|
|
899
|
-
(0,
|
|
963
|
+
}, [valueSelected, _valueProp, normalizeValue]);
|
|
964
|
+
(0, import_react2.useEffect)(() => {
|
|
900
965
|
const handleClickOutside = (event) => {
|
|
901
966
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
902
967
|
if (blurTimeoutRef.current) {
|
|
@@ -920,7 +985,7 @@ var Select = ({
|
|
|
920
985
|
}
|
|
921
986
|
};
|
|
922
987
|
}, []);
|
|
923
|
-
const getDisplayValue = (0,
|
|
988
|
+
const getDisplayValue = (0, import_react2.useCallback)(() => {
|
|
924
989
|
if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
|
|
925
990
|
const selected = validatedOptions.find(
|
|
926
991
|
(opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
|
|
@@ -934,7 +999,7 @@ var Select = ({
|
|
|
934
999
|
}
|
|
935
1000
|
return "";
|
|
936
1001
|
}, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
|
|
937
|
-
const filteredOptions = (0,
|
|
1002
|
+
const filteredOptions = (0, import_react2.useMemo)(() => {
|
|
938
1003
|
var _a;
|
|
939
1004
|
if (!enableSearch) {
|
|
940
1005
|
return validatedOptions;
|
|
@@ -946,7 +1011,7 @@ var Select = ({
|
|
|
946
1011
|
});
|
|
947
1012
|
return updatedFilteredOptions;
|
|
948
1013
|
}, [validatedOptions, searchTerm, enableSearch]);
|
|
949
|
-
const getSelectedOptionIndex = (0,
|
|
1014
|
+
const getSelectedOptionIndex = (0, import_react2.useCallback)(() => {
|
|
950
1015
|
if (!selectedValue || !filteredOptions.length) {
|
|
951
1016
|
return 0;
|
|
952
1017
|
}
|
|
@@ -955,7 +1020,7 @@ var Select = ({
|
|
|
955
1020
|
);
|
|
956
1021
|
return index >= 0 ? index : 0;
|
|
957
1022
|
}, [selectedValue, filteredOptions, normalizeValue]);
|
|
958
|
-
const handleInputInteraction = (0,
|
|
1023
|
+
const handleInputInteraction = (0, import_react2.useCallback)(
|
|
959
1024
|
(_e) => {
|
|
960
1025
|
var _a;
|
|
961
1026
|
if (blurTimeoutRef.current) {
|
|
@@ -979,7 +1044,7 @@ var Select = ({
|
|
|
979
1044
|
},
|
|
980
1045
|
[isOpen, getSelectedOptionIndex]
|
|
981
1046
|
);
|
|
982
|
-
const handleKeyDown = (0,
|
|
1047
|
+
const handleKeyDown = (0, import_react2.useCallback)(
|
|
983
1048
|
(e) => {
|
|
984
1049
|
var _a;
|
|
985
1050
|
if (!isOpen) return;
|
|
@@ -1018,7 +1083,7 @@ var Select = ({
|
|
|
1018
1083
|
},
|
|
1019
1084
|
[isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
|
|
1020
1085
|
);
|
|
1021
|
-
(0,
|
|
1086
|
+
(0, import_react2.useEffect)(() => {
|
|
1022
1087
|
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
|
|
1023
1088
|
optionRefs.current[highlightedIndex].scrollIntoView({
|
|
1024
1089
|
block: "nearest",
|
|
@@ -1026,10 +1091,10 @@ var Select = ({
|
|
|
1026
1091
|
});
|
|
1027
1092
|
}
|
|
1028
1093
|
}, [highlightedIndex]);
|
|
1029
|
-
(0,
|
|
1094
|
+
(0, import_react2.useEffect)(() => {
|
|
1030
1095
|
optionRefs.current = [];
|
|
1031
1096
|
}, [filteredOptions]);
|
|
1032
|
-
const handleMouseEnter = (0,
|
|
1097
|
+
const handleMouseEnter = (0, import_react2.useCallback)(() => {
|
|
1033
1098
|
if (hoverTimeoutRef.current) {
|
|
1034
1099
|
clearTimeout(hoverTimeoutRef.current);
|
|
1035
1100
|
}
|
|
@@ -1037,12 +1102,12 @@ var Select = ({
|
|
|
1037
1102
|
setIsHovering(true);
|
|
1038
1103
|
}
|
|
1039
1104
|
}, [isHovering]);
|
|
1040
|
-
const handleMouseLeave = (0,
|
|
1105
|
+
const handleMouseLeave = (0, import_react2.useCallback)(() => {
|
|
1041
1106
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
1042
1107
|
setIsHovering(false);
|
|
1043
1108
|
}, 50);
|
|
1044
1109
|
}, []);
|
|
1045
|
-
const handleChevronClick = (0,
|
|
1110
|
+
const handleChevronClick = (0, import_react2.useCallback)(
|
|
1046
1111
|
(e) => {
|
|
1047
1112
|
var _a;
|
|
1048
1113
|
e.preventDefault();
|
|
@@ -1065,17 +1130,24 @@ var Select = ({
|
|
|
1065
1130
|
},
|
|
1066
1131
|
[isOpen, handleInputInteraction]
|
|
1067
1132
|
);
|
|
1068
|
-
|
|
1133
|
+
const InputWrapper = ({ children }) => {
|
|
1134
|
+
if (disabled && disabledTooltip)
|
|
1135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tooltip_default, { title: disabledTooltip, children });
|
|
1136
|
+
return children;
|
|
1137
|
+
};
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1069
1139
|
"div",
|
|
1070
1140
|
{
|
|
1071
1141
|
style,
|
|
1072
|
-
className: (0, import_clsx8.default)("tw-relative tw-w-full", wrapperClassName
|
|
1142
|
+
className: (0, import_clsx8.default)("tw-relative tw-w-full", wrapperClassName, {
|
|
1143
|
+
"tw-cursor-not-allowed": disabled
|
|
1144
|
+
}),
|
|
1073
1145
|
ref: dropdownRef,
|
|
1074
1146
|
onMouseEnter: handleMouseEnter,
|
|
1075
1147
|
onMouseLeave: handleMouseLeave,
|
|
1076
1148
|
children: [
|
|
1077
|
-
/* @__PURE__ */ (0,
|
|
1078
|
-
/* @__PURE__ */ (0,
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "tw-relative", children: [
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1079
1151
|
"input",
|
|
1080
1152
|
{
|
|
1081
1153
|
ref: inputRef,
|
|
@@ -1098,7 +1170,8 @@ var Select = ({
|
|
|
1098
1170
|
variantClasses,
|
|
1099
1171
|
{
|
|
1100
1172
|
"tw-bg-white": valueSelected || getDisplayValue() || isFocused,
|
|
1101
|
-
"tw-bg-color-gray-5": !valueSelected || !getDisplayValue()
|
|
1173
|
+
"tw-bg-color-gray-5": !valueSelected || !getDisplayValue(),
|
|
1174
|
+
"!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
|
|
1102
1175
|
},
|
|
1103
1176
|
// Conditional padding based on label presence
|
|
1104
1177
|
!label && "tw-flex tw-items-center",
|
|
@@ -1118,7 +1191,7 @@ var Select = ({
|
|
|
1118
1191
|
readOnly: !isFocused || !enableSearch
|
|
1119
1192
|
}
|
|
1120
1193
|
),
|
|
1121
|
-
label && /* @__PURE__ */ (0,
|
|
1194
|
+
label && size !== "small" && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1122
1195
|
"label",
|
|
1123
1196
|
{
|
|
1124
1197
|
htmlFor: id,
|
|
@@ -1130,47 +1203,59 @@ var Select = ({
|
|
|
1130
1203
|
),
|
|
1131
1204
|
children: [
|
|
1132
1205
|
label,
|
|
1133
|
-
mandatory && /* @__PURE__ */ (0,
|
|
1206
|
+
mandatory && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
|
|
1134
1207
|
]
|
|
1135
1208
|
}
|
|
1136
1209
|
),
|
|
1137
|
-
/* @__PURE__ */ (0,
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1138
1211
|
"div",
|
|
1139
1212
|
{
|
|
1140
1213
|
className: (0, import_clsx8.default)(
|
|
1141
|
-
"tw-absolute tw-right-3 tw
|
|
1214
|
+
"tw-absolute tw-right-3 tw--translate-y-1/2 tw-flex tw-items-center",
|
|
1142
1215
|
{
|
|
1143
|
-
"!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear)
|
|
1216
|
+
"!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear),
|
|
1217
|
+
"tw-top-3.5 !tw-right-2": size === "small",
|
|
1218
|
+
"tw-top-1/2": size !== "small"
|
|
1144
1219
|
}
|
|
1145
1220
|
),
|
|
1146
|
-
children:
|
|
1147
|
-
"div",
|
|
1148
|
-
{
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1221
|
+
children: [
|
|
1222
|
+
disabled && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-absolute tw-right-0 -tw-top-2", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Lock, { size: 16 }) }),
|
|
1223
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LoadingSpinner_default, { size: "xs" }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1224
|
+
"div",
|
|
1225
|
+
{
|
|
1226
|
+
className: (0, import_clsx8.default)(
|
|
1227
|
+
"tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
|
|
1228
|
+
// Only rotate chevron when open and not showing clear icon
|
|
1229
|
+
isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
|
|
1230
|
+
),
|
|
1231
|
+
onMouseDown: (e) => {
|
|
1232
|
+
if (isHovering && selectedValue && allowClear) {
|
|
1233
|
+
handleClear(e);
|
|
1234
|
+
} else {
|
|
1235
|
+
handleChevronClick(e);
|
|
1236
|
+
}
|
|
1237
|
+
},
|
|
1238
|
+
children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1239
|
+
CrossV2,
|
|
1240
|
+
{
|
|
1241
|
+
color: "#111827",
|
|
1242
|
+
className: (0, import_clsx8.default)({ "tw-mr-1": size !== "small" }),
|
|
1243
|
+
size: size === "small" ? 12 : 16
|
|
1244
|
+
}
|
|
1245
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1246
|
+
Chevron2,
|
|
1247
|
+
{
|
|
1248
|
+
className: (0, import_clsx8.default)("tw-text-gray-400"),
|
|
1249
|
+
color: "#6B7280"
|
|
1250
|
+
}
|
|
1251
|
+
)
|
|
1252
|
+
}
|
|
1253
|
+
)
|
|
1254
|
+
]
|
|
1170
1255
|
}
|
|
1171
1256
|
)
|
|
1172
1257
|
] }),
|
|
1173
|
-
isOpen && /* @__PURE__ */ (0,
|
|
1258
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1174
1259
|
"div",
|
|
1175
1260
|
{
|
|
1176
1261
|
className: (0, import_clsx8.default)(
|
|
@@ -1180,7 +1265,7 @@ var Select = ({
|
|
|
1180
1265
|
dropdownClassName
|
|
1181
1266
|
),
|
|
1182
1267
|
ref: optionListRef,
|
|
1183
|
-
children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0,
|
|
1268
|
+
children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1184
1269
|
"div",
|
|
1185
1270
|
{
|
|
1186
1271
|
ref: (el) => optionRefs.current[index] = el,
|
|
@@ -1191,7 +1276,7 @@ var Select = ({
|
|
|
1191
1276
|
// Selected option styling
|
|
1192
1277
|
optionClassName
|
|
1193
1278
|
),
|
|
1194
|
-
children: /* @__PURE__ */ (0,
|
|
1279
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1195
1280
|
"div",
|
|
1196
1281
|
{
|
|
1197
1282
|
className: (0, import_clsx8.default)(
|
|
@@ -1209,12 +1294,12 @@ var Select = ({
|
|
|
1209
1294
|
)
|
|
1210
1295
|
},
|
|
1211
1296
|
doubleCharSearch ? option.label : option.value
|
|
1212
|
-
)) : /* @__PURE__ */ (0,
|
|
1297
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
|
|
1213
1298
|
}
|
|
1214
1299
|
)
|
|
1215
1300
|
]
|
|
1216
1301
|
}
|
|
1217
|
-
);
|
|
1302
|
+
) });
|
|
1218
1303
|
};
|
|
1219
1304
|
var arePropsEqual = (prevProps, nextProps) => {
|
|
1220
1305
|
var _a, _b;
|
|
@@ -1247,10 +1332,10 @@ var arePropsEqual = (prevProps, nextProps) => {
|
|
|
1247
1332
|
return true;
|
|
1248
1333
|
};
|
|
1249
1334
|
Select.displayName = "Select";
|
|
1250
|
-
var Select_default = (0,
|
|
1335
|
+
var Select_default = (0, import_react2.memo)(Select, arePropsEqual);
|
|
1251
1336
|
|
|
1252
1337
|
// src/atom/RangePicker/RangePicker.tsx
|
|
1253
|
-
var
|
|
1338
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1254
1339
|
function CustomRangePicker(props) {
|
|
1255
1340
|
var _a, _b;
|
|
1256
1341
|
const {
|
|
@@ -1277,8 +1362,8 @@ function CustomRangePicker(props) {
|
|
|
1277
1362
|
showToastError = () => {
|
|
1278
1363
|
}
|
|
1279
1364
|
} = props;
|
|
1280
|
-
const onChangeRef = (0,
|
|
1281
|
-
(0,
|
|
1365
|
+
const onChangeRef = (0, import_react3.useRef)(onChange);
|
|
1366
|
+
(0, import_react3.useEffect)(() => {
|
|
1282
1367
|
onChangeRef.current = onChange;
|
|
1283
1368
|
}, [onChange]);
|
|
1284
1369
|
const getInitialDate = () => {
|
|
@@ -1309,18 +1394,18 @@ function CustomRangePicker(props) {
|
|
|
1309
1394
|
}
|
|
1310
1395
|
return /* @__PURE__ */ new Date();
|
|
1311
1396
|
};
|
|
1312
|
-
const [currentDate, setCurrentDate] = (0,
|
|
1313
|
-
const [startDate, setStartDate] = (0,
|
|
1397
|
+
const [currentDate, setCurrentDate] = (0, import_react3.useState)(() => getInitialDate());
|
|
1398
|
+
const [startDate, setStartDate] = (0, import_react3.useState)(
|
|
1314
1399
|
dateRange[0] ? new Date(dateRange[0]) : null
|
|
1315
1400
|
);
|
|
1316
|
-
const [endDate, setEndDate] = (0,
|
|
1401
|
+
const [endDate, setEndDate] = (0, import_react3.useState)(
|
|
1317
1402
|
dateRange[0] && dateRange[1] ? new Date(dateRange[1]) : null
|
|
1318
1403
|
);
|
|
1319
|
-
const [hoverDate, setHoverDate] = (0,
|
|
1320
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
1404
|
+
const [hoverDate, setHoverDate] = (0, import_react3.useState)(null);
|
|
1405
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react3.useState)(
|
|
1321
1406
|
dateRange[0] && !dateRange[1] ? true : false
|
|
1322
1407
|
);
|
|
1323
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
1408
|
+
const [selectedDate, setSelectedDate] = (0, import_react3.useState)(
|
|
1324
1409
|
!isRange && dateRange[0] ? new Date(dateRange[0]) : null
|
|
1325
1410
|
);
|
|
1326
1411
|
const getDaysBetween = (start, end) => {
|
|
@@ -1491,7 +1576,7 @@ function CustomRangePicker(props) {
|
|
|
1491
1576
|
setHoverDate(null);
|
|
1492
1577
|
}
|
|
1493
1578
|
};
|
|
1494
|
-
(0,
|
|
1579
|
+
(0, import_react3.useEffect)(() => {
|
|
1495
1580
|
if (isRange) {
|
|
1496
1581
|
sessionStorage.removeItem("rangePickerStartDate");
|
|
1497
1582
|
onChangeRef.current(null, [
|
|
@@ -1506,7 +1591,7 @@ function CustomRangePicker(props) {
|
|
|
1506
1591
|
);
|
|
1507
1592
|
}
|
|
1508
1593
|
}, [startDate, endDate, isRange]);
|
|
1509
|
-
(0,
|
|
1594
|
+
(0, import_react3.useEffect)(() => {
|
|
1510
1595
|
if (!isRange && selectedDate) {
|
|
1511
1596
|
onChangeRef.current(null, (0, import_dayjs.default)(selectedDate).format("D MMM, YYYY"));
|
|
1512
1597
|
}
|
|
@@ -1571,8 +1656,8 @@ function CustomRangePicker(props) {
|
|
|
1571
1656
|
};
|
|
1572
1657
|
const isSameDay = ((_a = (0, import_dayjs.default)(startDate)) == null ? void 0 : _a.format("D MMM, YYYY")) === ((_b = (0, import_dayjs.default)(endDate)) == null ? void 0 : _b.format("D MMM, YYYY"));
|
|
1573
1658
|
const NightCountTooltip = () => {
|
|
1574
|
-
const TooltipArrow = (0,
|
|
1575
|
-
return /* @__PURE__ */ (0,
|
|
1659
|
+
const TooltipArrow = (0, import_react3.memo)(() => {
|
|
1660
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-3 tw-h-3 tw-flex tw-items-center tw-justify-center tw-rounded tw-bg-transparent tw-rotate-90", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1576
1661
|
"div",
|
|
1577
1662
|
{
|
|
1578
1663
|
style: {
|
|
@@ -1583,16 +1668,16 @@ function CustomRangePicker(props) {
|
|
|
1583
1668
|
}
|
|
1584
1669
|
) });
|
|
1585
1670
|
});
|
|
1586
|
-
return /* @__PURE__ */ (0,
|
|
1671
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-absolute tw-bottom-11 tw-py-2 tw-bg-black tw-text-white tw-px-2 tw-rounded-lg tw-z-50 tw-text-xs tw-whitespace-nowrap tw-opacity-0 tw-pointer-events-none group-hover:tw-opacity-100 tw-transition-opacity tw-duration-200", children: [
|
|
1587
1672
|
nightCountText,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-absolute tw-right-[42%] tw-bottom-[-7px]", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TooltipArrow, {}) })
|
|
1589
1674
|
] });
|
|
1590
1675
|
};
|
|
1591
1676
|
const renderCalendar = (monthDate, isSecondCalendar = false) => {
|
|
1592
1677
|
const days = generateCalendarDays(monthDate);
|
|
1593
1678
|
const monthName = monthNames[monthDate.getMonth()];
|
|
1594
1679
|
const year = monthDate.getFullYear();
|
|
1595
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1596
1681
|
"div",
|
|
1597
1682
|
{
|
|
1598
1683
|
className: (0, import_clsx9.default)("tw-flex-1 tw-max-w-[83vw] tw-mb-2", {
|
|
@@ -1600,13 +1685,13 @@ function CustomRangePicker(props) {
|
|
|
1600
1685
|
"tw-h-[290px]": !showYearDropdown || days.length <= 35
|
|
1601
1686
|
}),
|
|
1602
1687
|
children: [
|
|
1603
|
-
/* @__PURE__ */ (0,
|
|
1604
|
-
/* @__PURE__ */ (0,
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-text-center tw-mb-4 sm:tw-mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: " tw-flex tw-justify-center tw-items-center tw-gap-4 ", children: [
|
|
1689
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("h3", { className: "tw-typography-footNoteBold tw-text-color-text-default tw-m-0", children: [
|
|
1605
1690
|
monthName,
|
|
1606
1691
|
" ",
|
|
1607
1692
|
!showYearDropdown && ` ${year}`
|
|
1608
1693
|
] }),
|
|
1609
|
-
showYearDropdown && /* @__PURE__ */ (0,
|
|
1694
|
+
showYearDropdown && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1610
1695
|
Select_default,
|
|
1611
1696
|
{
|
|
1612
1697
|
options: yearOptions,
|
|
@@ -1628,7 +1713,7 @@ function CustomRangePicker(props) {
|
|
|
1628
1713
|
}
|
|
1629
1714
|
)
|
|
1630
1715
|
] }) }),
|
|
1631
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-grid tw-grid-cols-7 tw-mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1632
1717
|
"div",
|
|
1633
1718
|
{
|
|
1634
1719
|
className: "tw-py-2 tw-px-0 tw-text-center tw-typography-caption2 tw-text-[#6B7280]",
|
|
@@ -1636,9 +1721,9 @@ function CustomRangePicker(props) {
|
|
|
1636
1721
|
},
|
|
1637
1722
|
day
|
|
1638
1723
|
)) }),
|
|
1639
|
-
/* @__PURE__ */ (0,
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-grid tw-grid-cols-7", children: days.map((date, index) => {
|
|
1640
1725
|
if (!date) {
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-h-10" }, index);
|
|
1642
1727
|
}
|
|
1643
1728
|
const isStart = isRange ? isSameDate(date, startDate) : false;
|
|
1644
1729
|
const isEnd = isRange ? isSameDate(date, endDate) : false;
|
|
@@ -1688,8 +1773,8 @@ function CustomRangePicker(props) {
|
|
|
1688
1773
|
(0, import_dayjs.default)(startDate),
|
|
1689
1774
|
"day"
|
|
1690
1775
|
);
|
|
1691
|
-
return /* @__PURE__ */ (0,
|
|
1692
|
-
(isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0,
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-relative", children: [
|
|
1777
|
+
(isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1693
1778
|
"div",
|
|
1694
1779
|
{
|
|
1695
1780
|
className: (0, import_clsx9.default)(
|
|
@@ -1702,8 +1787,8 @@ function CustomRangePicker(props) {
|
|
|
1702
1787
|
)
|
|
1703
1788
|
}
|
|
1704
1789
|
),
|
|
1705
|
-
isHoveringDate && isHovering && /* @__PURE__ */ (0,
|
|
1706
|
-
/* @__PURE__ */ (0,
|
|
1790
|
+
isHoveringDate && isHovering && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1791
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1707
1792
|
"div",
|
|
1708
1793
|
{
|
|
1709
1794
|
className: (0, import_clsx9.default)(
|
|
@@ -1716,7 +1801,7 @@ function CustomRangePicker(props) {
|
|
|
1716
1801
|
)
|
|
1717
1802
|
}
|
|
1718
1803
|
),
|
|
1719
|
-
/* @__PURE__ */ (0,
|
|
1804
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1720
1805
|
"div",
|
|
1721
1806
|
{
|
|
1722
1807
|
className: (0, import_clsx9.default)(
|
|
@@ -1729,8 +1814,8 @@ function CustomRangePicker(props) {
|
|
|
1729
1814
|
}
|
|
1730
1815
|
)
|
|
1731
1816
|
] }),
|
|
1732
|
-
isStart && /* @__PURE__ */ (0,
|
|
1733
|
-
/* @__PURE__ */ (0,
|
|
1817
|
+
isStart && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1734
1819
|
"div",
|
|
1735
1820
|
{
|
|
1736
1821
|
className: (0, import_clsx9.default)(
|
|
@@ -1743,7 +1828,7 @@ function CustomRangePicker(props) {
|
|
|
1743
1828
|
)
|
|
1744
1829
|
}
|
|
1745
1830
|
),
|
|
1746
|
-
/* @__PURE__ */ (0,
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1747
1832
|
"div",
|
|
1748
1833
|
{
|
|
1749
1834
|
className: (0, import_clsx9.default)(
|
|
@@ -1756,7 +1841,7 @@ function CustomRangePicker(props) {
|
|
|
1756
1841
|
}
|
|
1757
1842
|
)
|
|
1758
1843
|
] }),
|
|
1759
|
-
/* @__PURE__ */ (0,
|
|
1844
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1760
1845
|
"div",
|
|
1761
1846
|
{
|
|
1762
1847
|
className: (0, import_clsx9.default)(className, pseudoClass, "tw-group", {
|
|
@@ -1766,7 +1851,7 @@ function CustomRangePicker(props) {
|
|
|
1766
1851
|
onMouseEnter: () => handleDateHover(date),
|
|
1767
1852
|
"data-date": titleDate,
|
|
1768
1853
|
children: [
|
|
1769
|
-
showNightCount && isRange && isHovering && /* @__PURE__ */ (0,
|
|
1854
|
+
showNightCount && isRange && isHovering && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(NightCountTooltip, {}),
|
|
1770
1855
|
date.getDate()
|
|
1771
1856
|
]
|
|
1772
1857
|
}
|
|
@@ -1777,7 +1862,8 @@ function CustomRangePicker(props) {
|
|
|
1777
1862
|
}
|
|
1778
1863
|
);
|
|
1779
1864
|
};
|
|
1780
|
-
|
|
1865
|
+
const arrowClasses = "tw-relative tw-top-3 sm:tw-top-0 tw-cursor-pointer tw-rounded-full tw-w-10 tw-h-10 tw-flex tw-justify-center hover:tw-bg-gray-100 tw-items-center";
|
|
1866
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1781
1867
|
"div",
|
|
1782
1868
|
{
|
|
1783
1869
|
className: (0, import_clsx9.default)(
|
|
@@ -1788,36 +1874,42 @@ function CustomRangePicker(props) {
|
|
|
1788
1874
|
}
|
|
1789
1875
|
),
|
|
1790
1876
|
children: [
|
|
1791
|
-
/* @__PURE__ */ (0,
|
|
1792
|
-
!isPreviousMonthDisabled() && /* @__PURE__ */ (0,
|
|
1877
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tw-flex tw-items-center tw-px-4 tw-justify-between tw-mb-4 tw-absolute tw-right-0 tw-left-0 tw-top-0.5 sm:tw-top-4 tw-w-auto", children: [
|
|
1878
|
+
!isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1793
1879
|
"div",
|
|
1794
1880
|
{
|
|
1795
|
-
className:
|
|
1881
|
+
className: (0, import_clsx9.default)(arrowClasses, "tw-left-1"),
|
|
1796
1882
|
onClick: () => navigateMonth(-1),
|
|
1797
1883
|
id: "calendar-previous-month-button",
|
|
1798
|
-
children: /* @__PURE__ */ (0,
|
|
1884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1885
|
+
Chevron,
|
|
1886
|
+
{
|
|
1887
|
+
size: "medium",
|
|
1888
|
+
className: "tw-relative -tw-top-0.5 tw-right-0.5"
|
|
1889
|
+
}
|
|
1890
|
+
)
|
|
1799
1891
|
}
|
|
1800
1892
|
),
|
|
1801
|
-
isPreviousMonthDisabled() && /* @__PURE__ */ (0,
|
|
1802
|
-
!isNextMonthDisabled() && /* @__PURE__ */ (0,
|
|
1893
|
+
isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-10 tw-h-10" }),
|
|
1894
|
+
!isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1803
1895
|
"div",
|
|
1804
1896
|
{
|
|
1805
|
-
className:
|
|
1897
|
+
className: (0, import_clsx9.default)(arrowClasses, "tw-mt-[1px] tw-right-1"),
|
|
1806
1898
|
onClick: () => navigateMonth(1),
|
|
1807
1899
|
id: "calendar-next-month-button",
|
|
1808
|
-
children: /* @__PURE__ */ (0,
|
|
1900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1809
1901
|
Chevron,
|
|
1810
1902
|
{
|
|
1811
1903
|
size: "medium",
|
|
1812
1904
|
onClick: () => navigateMonth(1),
|
|
1813
|
-
className: "tw-rotate-180"
|
|
1905
|
+
className: "tw-rotate-180 tw-relative tw-top-0.5 tw-left-0.5"
|
|
1814
1906
|
}
|
|
1815
1907
|
)
|
|
1816
1908
|
}
|
|
1817
1909
|
),
|
|
1818
|
-
isNextMonthDisabled() && /* @__PURE__ */ (0,
|
|
1910
|
+
isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-w-10 tw-h-10" })
|
|
1819
1911
|
] }),
|
|
1820
|
-
/* @__PURE__ */ (0,
|
|
1912
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tw-flex tw-items-center tw-justify-between tw-px-6 tw-border-solid tw-border-color-gray-100 tw-border-b tw-border-t-0 tw-border-l-0 tw-border-r-0 tw-w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1821
1913
|
"div",
|
|
1822
1914
|
{
|
|
1823
1915
|
className: (0, import_clsx9.default)("tw-flex tw-w-full", {
|
|
@@ -1840,15 +1932,86 @@ function CustomRangePicker(props) {
|
|
|
1840
1932
|
}
|
|
1841
1933
|
CustomRangePicker.displayName = "RangePicker";
|
|
1842
1934
|
var RangePicker_default = CustomRangePicker;
|
|
1935
|
+
|
|
1936
|
+
// src/atom/Slider/Slider.tsx
|
|
1937
|
+
var import_antd9 = require("antd");
|
|
1938
|
+
var import_clsx10 = __toESM(require("clsx"));
|
|
1939
|
+
|
|
1940
|
+
// src/atom/Slider/Slider.module.scss
|
|
1941
|
+
var Slider_module_default = { "label": "Slider-module__label___9Uea-", "slider": "Slider-module__slider___JCS-c", "disableFill": "Slider-module__disableFill___rjbsy" };
|
|
1942
|
+
|
|
1943
|
+
// src/atom/Slider/Slider.tsx
|
|
1944
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1945
|
+
function Slider(props) {
|
|
1946
|
+
const {
|
|
1947
|
+
label = "",
|
|
1948
|
+
className = "",
|
|
1949
|
+
onChange,
|
|
1950
|
+
onAfterChange,
|
|
1951
|
+
defaultValue = [],
|
|
1952
|
+
value,
|
|
1953
|
+
step = 10,
|
|
1954
|
+
range = true,
|
|
1955
|
+
disabled = false,
|
|
1956
|
+
min,
|
|
1957
|
+
max,
|
|
1958
|
+
marks,
|
|
1959
|
+
dots,
|
|
1960
|
+
included,
|
|
1961
|
+
reverse,
|
|
1962
|
+
vertical,
|
|
1963
|
+
tipFormatter,
|
|
1964
|
+
tooltipVisible,
|
|
1965
|
+
tooltipPlacement,
|
|
1966
|
+
disableFill = false
|
|
1967
|
+
} = props;
|
|
1968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
1969
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: Slider_module_default.label, children: label }),
|
|
1970
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1971
|
+
import_antd9.Slider,
|
|
1972
|
+
{
|
|
1973
|
+
className: (0, import_clsx10.default)(
|
|
1974
|
+
Slider_module_default.slider,
|
|
1975
|
+
className,
|
|
1976
|
+
Slider_module_default[disableFill ? "disableFill" : ""]
|
|
1977
|
+
),
|
|
1978
|
+
"data-testid": "lumina-slider",
|
|
1979
|
+
range,
|
|
1980
|
+
step,
|
|
1981
|
+
defaultValue,
|
|
1982
|
+
value,
|
|
1983
|
+
onChange,
|
|
1984
|
+
onAfterChange,
|
|
1985
|
+
disabled,
|
|
1986
|
+
min,
|
|
1987
|
+
max,
|
|
1988
|
+
marks,
|
|
1989
|
+
dots,
|
|
1990
|
+
included,
|
|
1991
|
+
reverse,
|
|
1992
|
+
vertical,
|
|
1993
|
+
tooltip: {
|
|
1994
|
+
formatter: tipFormatter,
|
|
1995
|
+
open: tooltipVisible,
|
|
1996
|
+
placement: tooltipPlacement
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
)
|
|
2000
|
+
] });
|
|
2001
|
+
}
|
|
2002
|
+
Slider.displayName = "Slider";
|
|
2003
|
+
var Slider_default = Slider;
|
|
1843
2004
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1844
2005
|
0 && (module.exports = {
|
|
1845
2006
|
Avatar,
|
|
1846
2007
|
Button,
|
|
1847
2008
|
Checkbox,
|
|
2009
|
+
LoadingSpinner,
|
|
1848
2010
|
Modal,
|
|
1849
2011
|
Radio,
|
|
1850
2012
|
RangePicker,
|
|
1851
2013
|
Select,
|
|
2014
|
+
Slider,
|
|
1852
2015
|
Switch,
|
|
1853
2016
|
Tag,
|
|
1854
2017
|
Tooltip
|