@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
|
@@ -63,7 +63,7 @@ __export(RangePicker_exports, {
|
|
|
63
63
|
default: () => RangePicker_default
|
|
64
64
|
});
|
|
65
65
|
module.exports = __toCommonJS(RangePicker_exports);
|
|
66
|
-
var
|
|
66
|
+
var import_react3 = require("react");
|
|
67
67
|
var import_clsx2 = __toESM(require("clsx"));
|
|
68
68
|
var import_dayjs = __toESM(require("dayjs"));
|
|
69
69
|
|
|
@@ -115,7 +115,7 @@ var Chevron = React.memo(
|
|
|
115
115
|
var RangePicker_module_default = { "range_start": "RangePicker-module__range_start___hGQp-", "range_end": "RangePicker-module__range_end___JJNib" };
|
|
116
116
|
|
|
117
117
|
// src/atom/Select/Select.tsx
|
|
118
|
-
var
|
|
118
|
+
var import_react2 = require("react");
|
|
119
119
|
var import_clsx = __toESM(require("clsx"));
|
|
120
120
|
|
|
121
121
|
// src/icons/Chevron.tsx
|
|
@@ -160,16 +160,13 @@ var CrossV2 = React3.memo(
|
|
|
160
160
|
width: size,
|
|
161
161
|
height: size,
|
|
162
162
|
fill: "none",
|
|
163
|
-
viewBox: "0 0
|
|
164
|
-
className
|
|
163
|
+
viewBox: "0 0 20 20"
|
|
165
164
|
}, rest), {
|
|
166
165
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
167
166
|
"path",
|
|
168
167
|
{
|
|
169
168
|
fill: color,
|
|
170
|
-
|
|
171
|
-
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",
|
|
172
|
-
clipRule: "evenodd"
|
|
169
|
+
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"
|
|
173
170
|
}
|
|
174
171
|
)
|
|
175
172
|
})
|
|
@@ -178,8 +175,106 @@ var CrossV2 = React3.memo(
|
|
|
178
175
|
);
|
|
179
176
|
CrossV2.displayName = "CrossV2";
|
|
180
177
|
|
|
181
|
-
// src/
|
|
178
|
+
// src/icons/Lock.tsx
|
|
179
|
+
var import_react = __toESM(require("react"));
|
|
182
180
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
181
|
+
var Lock = import_react.default.memo((_a) => {
|
|
182
|
+
var _b = _a, { size = 16, color = "#000" } = _b, rest = __objRest(_b, ["size", "color"]);
|
|
183
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
184
|
+
"svg",
|
|
185
|
+
__spreadProps(__spreadValues({
|
|
186
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
187
|
+
width: size,
|
|
188
|
+
height: size,
|
|
189
|
+
fill: "none",
|
|
190
|
+
viewBox: "0 0 16 16"
|
|
191
|
+
}, rest), {
|
|
192
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
193
|
+
"path",
|
|
194
|
+
{
|
|
195
|
+
fill: color,
|
|
196
|
+
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"
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
})
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// src/atom/Tooltip/Tooltip.tsx
|
|
204
|
+
var import_antd = require("antd");
|
|
205
|
+
|
|
206
|
+
// src/atom/Tooltip/Tooltip.module.scss
|
|
207
|
+
var Tooltip_module_default = { "light": "Tooltip-module__light___H5oCc" };
|
|
208
|
+
|
|
209
|
+
// src/atom/Tooltip/Tooltip.tsx
|
|
210
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
211
|
+
var Tooltip = (_a) => {
|
|
212
|
+
var _b = _a, {
|
|
213
|
+
children,
|
|
214
|
+
title = "",
|
|
215
|
+
placement = "top",
|
|
216
|
+
color = "#1F2937",
|
|
217
|
+
className,
|
|
218
|
+
mode = "dark"
|
|
219
|
+
} = _b, rest = __objRest(_b, [
|
|
220
|
+
"children",
|
|
221
|
+
"title",
|
|
222
|
+
"placement",
|
|
223
|
+
"color",
|
|
224
|
+
"className",
|
|
225
|
+
"mode"
|
|
226
|
+
]);
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
228
|
+
import_antd.Tooltip,
|
|
229
|
+
__spreadProps(__spreadValues({
|
|
230
|
+
className,
|
|
231
|
+
color,
|
|
232
|
+
title,
|
|
233
|
+
placement,
|
|
234
|
+
overlayClassName: mode === "light" ? Tooltip_module_default.light : ""
|
|
235
|
+
}, rest), {
|
|
236
|
+
children
|
|
237
|
+
})
|
|
238
|
+
);
|
|
239
|
+
};
|
|
240
|
+
Tooltip.displayName = "Tooltip";
|
|
241
|
+
var Tooltip_default = Tooltip;
|
|
242
|
+
|
|
243
|
+
// src/atom/LoadingSpinner/LoadingSpinner.tsx
|
|
244
|
+
var import_icons = require("@ant-design/icons");
|
|
245
|
+
var import_antd2 = require("antd");
|
|
246
|
+
|
|
247
|
+
// src/atom/LoadingSpinner/LoadingSpinner.module.scss
|
|
248
|
+
var LoadingSpinner_module_default = { "spinnerContainer": "LoadingSpinner-module__spinnerContainer___DiPLf" };
|
|
249
|
+
|
|
250
|
+
// src/atom/LoadingSpinner/LoadingSpinner.tsx
|
|
251
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
252
|
+
var sizeMapping = {
|
|
253
|
+
xs: 16,
|
|
254
|
+
small: 24,
|
|
255
|
+
medium: 36,
|
|
256
|
+
large: 48
|
|
257
|
+
};
|
|
258
|
+
var LoadingSpinner = (_a) => {
|
|
259
|
+
var _b = _a, { size = "small", color = "#ec5d25" } = _b, rest = __objRest(_b, ["size", "color"]);
|
|
260
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", __spreadProps(__spreadValues({ className: LoadingSpinner_module_default.spinnerContainer }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
261
|
+
import_antd2.Spin,
|
|
262
|
+
{
|
|
263
|
+
indicator: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
264
|
+
import_icons.LoadingOutlined,
|
|
265
|
+
{
|
|
266
|
+
style: { fontSize: sizeMapping[size], color },
|
|
267
|
+
spin: true
|
|
268
|
+
}
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
) }));
|
|
272
|
+
};
|
|
273
|
+
LoadingSpinner.displayName = "LoadingSpinner";
|
|
274
|
+
var LoadingSpinner_default = LoadingSpinner;
|
|
275
|
+
|
|
276
|
+
// src/atom/Select/Select.tsx
|
|
277
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
183
278
|
var Select = ({
|
|
184
279
|
label,
|
|
185
280
|
mandatory = false,
|
|
@@ -190,6 +285,10 @@ var Select = ({
|
|
|
190
285
|
value: _valueProp,
|
|
191
286
|
// Rename to avoid potential conflicts with native value attribute
|
|
192
287
|
onChange,
|
|
288
|
+
onSearch,
|
|
289
|
+
isLoading = false,
|
|
290
|
+
disabled = false,
|
|
291
|
+
disabledTooltip = "",
|
|
193
292
|
className = "",
|
|
194
293
|
dropdownClassName = "",
|
|
195
294
|
optionClassName = "",
|
|
@@ -198,7 +297,6 @@ var Select = ({
|
|
|
198
297
|
// New prop to show displayValue instead of label
|
|
199
298
|
allowClear = true,
|
|
200
299
|
enableSearch = true,
|
|
201
|
-
// New prop to control search functionality, default true
|
|
202
300
|
doubleCharSearch = false,
|
|
203
301
|
id,
|
|
204
302
|
name,
|
|
@@ -218,45 +316,45 @@ var Select = ({
|
|
|
218
316
|
// Custom height
|
|
219
317
|
experience = "business"
|
|
220
318
|
}) => {
|
|
221
|
-
const normalizeValue = (0,
|
|
319
|
+
const normalizeValue = (0, import_react2.useCallback)(
|
|
222
320
|
(val) => {
|
|
223
321
|
if (val === null || val === void 0) return "";
|
|
224
322
|
return String(val);
|
|
225
323
|
},
|
|
226
324
|
[]
|
|
227
325
|
);
|
|
228
|
-
const validatedOptions = (0,
|
|
326
|
+
const validatedOptions = (0, import_react2.useMemo)(() => {
|
|
229
327
|
if (!Array.isArray(options)) return [];
|
|
230
328
|
return options.filter(
|
|
231
329
|
(opt) => opt && typeof opt === "object" && opt.value !== void 0 && opt.value !== null && opt.label !== void 0
|
|
232
330
|
);
|
|
233
331
|
}, [options]);
|
|
234
|
-
const [isOpen, setIsOpen] = (0,
|
|
235
|
-
const [isFocused, setIsFocused] = (0,
|
|
236
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
237
|
-
const [isHovering, setIsHovering] = (0,
|
|
238
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
239
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
332
|
+
const [isOpen, setIsOpen] = (0, import_react2.useState)(false);
|
|
333
|
+
const [isFocused, setIsFocused] = (0, import_react2.useState)(false);
|
|
334
|
+
const [searchTerm, setSearchTerm] = (0, import_react2.useState)("");
|
|
335
|
+
const [isHovering, setIsHovering] = (0, import_react2.useState)(false);
|
|
336
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react2.useState)(-1);
|
|
337
|
+
const [selectedValue, setSelectedValue] = (0, import_react2.useState)(() => {
|
|
240
338
|
const initialValue = valueSelected;
|
|
241
339
|
if (initialValue === null || initialValue === void 0) return "";
|
|
242
340
|
return String(initialValue);
|
|
243
341
|
});
|
|
244
|
-
const inputRef = (0,
|
|
245
|
-
const inputValueRef = (0,
|
|
246
|
-
const dropdownRef = (0,
|
|
247
|
-
const optionRefs = (0,
|
|
248
|
-
const optionListRef = (0,
|
|
249
|
-
const blurTimeoutRef = (0,
|
|
250
|
-
const hoverTimeoutRef = (0,
|
|
342
|
+
const inputRef = (0, import_react2.useRef)(null);
|
|
343
|
+
const inputValueRef = (0, import_react2.useRef)("");
|
|
344
|
+
const dropdownRef = (0, import_react2.useRef)(null);
|
|
345
|
+
const optionRefs = (0, import_react2.useRef)([]);
|
|
346
|
+
const optionListRef = (0, import_react2.useRef)(null);
|
|
347
|
+
const blurTimeoutRef = (0, import_react2.useRef)(null);
|
|
348
|
+
const hoverTimeoutRef = (0, import_react2.useRef)(null);
|
|
251
349
|
const isActive = isFocused || Boolean(selectedValue) || Boolean(valueSelected) || Boolean(searchTerm);
|
|
252
|
-
const sizeClasses = (0,
|
|
350
|
+
const sizeClasses = (0, import_react2.useMemo)(() => {
|
|
253
351
|
switch (size) {
|
|
254
352
|
case "small":
|
|
255
353
|
return {
|
|
256
|
-
input: "tw-h-
|
|
257
|
-
padding:
|
|
258
|
-
labelActive: "tw-top-0 tw-typography-
|
|
259
|
-
labelInactive: "tw-top-
|
|
354
|
+
input: "tw-h-6 tw-px-3 tw-typography-caption1Bold !tw-rounded-lg",
|
|
355
|
+
padding: "tw-px-2 tw-py-1",
|
|
356
|
+
labelActive: "tw-top-0.5 tw-typography-caption2",
|
|
357
|
+
labelInactive: "tw-top-1.5 tw-typography-caption3"
|
|
260
358
|
};
|
|
261
359
|
case "medium":
|
|
262
360
|
return {
|
|
@@ -281,7 +379,7 @@ var Select = ({
|
|
|
281
379
|
};
|
|
282
380
|
}
|
|
283
381
|
}, [size, label, height]);
|
|
284
|
-
const variantClasses = (0,
|
|
382
|
+
const variantClasses = (0, import_react2.useMemo)(() => {
|
|
285
383
|
switch (variant) {
|
|
286
384
|
case "filled":
|
|
287
385
|
return "tw-bg-gray-50 tw-border-transparent";
|
|
@@ -291,7 +389,7 @@ var Select = ({
|
|
|
291
389
|
return " tw-border";
|
|
292
390
|
}
|
|
293
391
|
}, [variant]);
|
|
294
|
-
const handleBlur = (0,
|
|
392
|
+
const handleBlur = (0, import_react2.useCallback)(() => {
|
|
295
393
|
blurTimeoutRef.current = setTimeout(() => {
|
|
296
394
|
setIsOpen(false);
|
|
297
395
|
setSearchTerm("");
|
|
@@ -300,24 +398,28 @@ var Select = ({
|
|
|
300
398
|
setIsFocused(false);
|
|
301
399
|
}, 150);
|
|
302
400
|
}, []);
|
|
303
|
-
const handleSearchChange = (0,
|
|
401
|
+
const handleSearchChange = (0, import_react2.useCallback)(
|
|
304
402
|
(e) => {
|
|
305
403
|
var _a;
|
|
404
|
+
const searchValue = doubleCharSearch ? e.target.value.slice(0, 2) || "" : e.target.value;
|
|
306
405
|
if (doubleCharSearch) {
|
|
307
|
-
setSearchTerm(
|
|
406
|
+
setSearchTerm(searchValue);
|
|
308
407
|
} else {
|
|
309
|
-
setSearchTerm(
|
|
408
|
+
setSearchTerm(searchValue);
|
|
310
409
|
}
|
|
311
410
|
setIsOpen(true);
|
|
312
411
|
setHighlightedIndex(-1);
|
|
412
|
+
if (onSearch && typeof onSearch === "function") {
|
|
413
|
+
onSearch(searchValue);
|
|
414
|
+
}
|
|
313
415
|
(_a = optionListRef == null ? void 0 : optionListRef.current) == null ? void 0 : _a.scrollTo({
|
|
314
416
|
top: 0,
|
|
315
417
|
behavior: "smooth"
|
|
316
418
|
});
|
|
317
419
|
},
|
|
318
|
-
[doubleCharSearch]
|
|
420
|
+
[doubleCharSearch, onSearch]
|
|
319
421
|
);
|
|
320
|
-
const handleOptionSelect = (0,
|
|
422
|
+
const handleOptionSelect = (0, import_react2.useCallback)(
|
|
321
423
|
(option) => {
|
|
322
424
|
var _a;
|
|
323
425
|
if (blurTimeoutRef.current) {
|
|
@@ -338,7 +440,7 @@ var Select = ({
|
|
|
338
440
|
},
|
|
339
441
|
[normalizeValue, onChange, enableSearch]
|
|
340
442
|
);
|
|
341
|
-
const handleClear = (0,
|
|
443
|
+
const handleClear = (0, import_react2.useCallback)(
|
|
342
444
|
(e) => {
|
|
343
445
|
var _a;
|
|
344
446
|
inputValueRef.current = "";
|
|
@@ -358,21 +460,22 @@ var Select = ({
|
|
|
358
460
|
},
|
|
359
461
|
[onChange, enableSearch]
|
|
360
462
|
);
|
|
361
|
-
(0,
|
|
463
|
+
(0, import_react2.useEffect)(() => {
|
|
362
464
|
if (!validatedOptions.length) {
|
|
363
465
|
setSelectedValue("");
|
|
364
466
|
setSearchTerm("");
|
|
365
467
|
inputValueRef.current = "";
|
|
366
468
|
}
|
|
367
469
|
}, [validatedOptions.length]);
|
|
368
|
-
(0,
|
|
369
|
-
const
|
|
470
|
+
(0, import_react2.useEffect)(() => {
|
|
471
|
+
const externalValue = _valueProp !== void 0 ? _valueProp : valueSelected;
|
|
472
|
+
const newValue = normalizeValue(externalValue);
|
|
370
473
|
setSelectedValue((prevValue) => {
|
|
371
474
|
const prevNormalized = normalizeValue(prevValue);
|
|
372
475
|
return prevNormalized !== newValue ? newValue : prevValue;
|
|
373
476
|
});
|
|
374
|
-
}, [valueSelected, normalizeValue]);
|
|
375
|
-
(0,
|
|
477
|
+
}, [valueSelected, _valueProp, normalizeValue]);
|
|
478
|
+
(0, import_react2.useEffect)(() => {
|
|
376
479
|
const handleClickOutside = (event) => {
|
|
377
480
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
378
481
|
if (blurTimeoutRef.current) {
|
|
@@ -396,7 +499,7 @@ var Select = ({
|
|
|
396
499
|
}
|
|
397
500
|
};
|
|
398
501
|
}, []);
|
|
399
|
-
const getDisplayValue = (0,
|
|
502
|
+
const getDisplayValue = (0, import_react2.useCallback)(() => {
|
|
400
503
|
if (selectedValue && (validatedOptions == null ? void 0 : validatedOptions.length) > 0) {
|
|
401
504
|
const selected = validatedOptions.find(
|
|
402
505
|
(opt) => normalizeValue(opt.value) === normalizeValue(selectedValue)
|
|
@@ -410,7 +513,7 @@ var Select = ({
|
|
|
410
513
|
}
|
|
411
514
|
return "";
|
|
412
515
|
}, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
|
|
413
|
-
const filteredOptions = (0,
|
|
516
|
+
const filteredOptions = (0, import_react2.useMemo)(() => {
|
|
414
517
|
var _a;
|
|
415
518
|
if (!enableSearch) {
|
|
416
519
|
return validatedOptions;
|
|
@@ -422,7 +525,7 @@ var Select = ({
|
|
|
422
525
|
});
|
|
423
526
|
return updatedFilteredOptions;
|
|
424
527
|
}, [validatedOptions, searchTerm, enableSearch]);
|
|
425
|
-
const getSelectedOptionIndex = (0,
|
|
528
|
+
const getSelectedOptionIndex = (0, import_react2.useCallback)(() => {
|
|
426
529
|
if (!selectedValue || !filteredOptions.length) {
|
|
427
530
|
return 0;
|
|
428
531
|
}
|
|
@@ -431,7 +534,7 @@ var Select = ({
|
|
|
431
534
|
);
|
|
432
535
|
return index >= 0 ? index : 0;
|
|
433
536
|
}, [selectedValue, filteredOptions, normalizeValue]);
|
|
434
|
-
const handleInputInteraction = (0,
|
|
537
|
+
const handleInputInteraction = (0, import_react2.useCallback)(
|
|
435
538
|
(_e) => {
|
|
436
539
|
var _a;
|
|
437
540
|
if (blurTimeoutRef.current) {
|
|
@@ -455,7 +558,7 @@ var Select = ({
|
|
|
455
558
|
},
|
|
456
559
|
[isOpen, getSelectedOptionIndex]
|
|
457
560
|
);
|
|
458
|
-
const handleKeyDown = (0,
|
|
561
|
+
const handleKeyDown = (0, import_react2.useCallback)(
|
|
459
562
|
(e) => {
|
|
460
563
|
var _a;
|
|
461
564
|
if (!isOpen) return;
|
|
@@ -494,7 +597,7 @@ var Select = ({
|
|
|
494
597
|
},
|
|
495
598
|
[isOpen, highlightedIndex, filteredOptions, handleOptionSelect]
|
|
496
599
|
);
|
|
497
|
-
(0,
|
|
600
|
+
(0, import_react2.useEffect)(() => {
|
|
498
601
|
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
|
|
499
602
|
optionRefs.current[highlightedIndex].scrollIntoView({
|
|
500
603
|
block: "nearest",
|
|
@@ -502,10 +605,10 @@ var Select = ({
|
|
|
502
605
|
});
|
|
503
606
|
}
|
|
504
607
|
}, [highlightedIndex]);
|
|
505
|
-
(0,
|
|
608
|
+
(0, import_react2.useEffect)(() => {
|
|
506
609
|
optionRefs.current = [];
|
|
507
610
|
}, [filteredOptions]);
|
|
508
|
-
const handleMouseEnter = (0,
|
|
611
|
+
const handleMouseEnter = (0, import_react2.useCallback)(() => {
|
|
509
612
|
if (hoverTimeoutRef.current) {
|
|
510
613
|
clearTimeout(hoverTimeoutRef.current);
|
|
511
614
|
}
|
|
@@ -513,12 +616,12 @@ var Select = ({
|
|
|
513
616
|
setIsHovering(true);
|
|
514
617
|
}
|
|
515
618
|
}, [isHovering]);
|
|
516
|
-
const handleMouseLeave = (0,
|
|
619
|
+
const handleMouseLeave = (0, import_react2.useCallback)(() => {
|
|
517
620
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
518
621
|
setIsHovering(false);
|
|
519
622
|
}, 50);
|
|
520
623
|
}, []);
|
|
521
|
-
const handleChevronClick = (0,
|
|
624
|
+
const handleChevronClick = (0, import_react2.useCallback)(
|
|
522
625
|
(e) => {
|
|
523
626
|
var _a;
|
|
524
627
|
e.preventDefault();
|
|
@@ -541,17 +644,24 @@ var Select = ({
|
|
|
541
644
|
},
|
|
542
645
|
[isOpen, handleInputInteraction]
|
|
543
646
|
);
|
|
544
|
-
|
|
647
|
+
const InputWrapper = ({ children }) => {
|
|
648
|
+
if (disabled && disabledTooltip)
|
|
649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Tooltip_default, { title: disabledTooltip, children });
|
|
650
|
+
return children;
|
|
651
|
+
};
|
|
652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(InputWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
545
653
|
"div",
|
|
546
654
|
{
|
|
547
655
|
style,
|
|
548
|
-
className: (0, import_clsx.default)("tw-relative tw-w-full", wrapperClassName
|
|
656
|
+
className: (0, import_clsx.default)("tw-relative tw-w-full", wrapperClassName, {
|
|
657
|
+
"tw-cursor-not-allowed": disabled
|
|
658
|
+
}),
|
|
549
659
|
ref: dropdownRef,
|
|
550
660
|
onMouseEnter: handleMouseEnter,
|
|
551
661
|
onMouseLeave: handleMouseLeave,
|
|
552
662
|
children: [
|
|
553
|
-
/* @__PURE__ */ (0,
|
|
554
|
-
/* @__PURE__ */ (0,
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "tw-relative", children: [
|
|
664
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
555
665
|
"input",
|
|
556
666
|
{
|
|
557
667
|
ref: inputRef,
|
|
@@ -574,7 +684,8 @@ var Select = ({
|
|
|
574
684
|
variantClasses,
|
|
575
685
|
{
|
|
576
686
|
"tw-bg-white": valueSelected || getDisplayValue() || isFocused,
|
|
577
|
-
"tw-bg-color-gray-5": !valueSelected || !getDisplayValue()
|
|
687
|
+
"tw-bg-color-gray-5": !valueSelected || !getDisplayValue(),
|
|
688
|
+
"!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
|
|
578
689
|
},
|
|
579
690
|
// Conditional padding based on label presence
|
|
580
691
|
!label && "tw-flex tw-items-center",
|
|
@@ -594,7 +705,7 @@ var Select = ({
|
|
|
594
705
|
readOnly: !isFocused || !enableSearch
|
|
595
706
|
}
|
|
596
707
|
),
|
|
597
|
-
label && /* @__PURE__ */ (0,
|
|
708
|
+
label && size !== "small" && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
598
709
|
"label",
|
|
599
710
|
{
|
|
600
711
|
htmlFor: id,
|
|
@@ -606,47 +717,59 @@ var Select = ({
|
|
|
606
717
|
),
|
|
607
718
|
children: [
|
|
608
719
|
label,
|
|
609
|
-
mandatory && /* @__PURE__ */ (0,
|
|
720
|
+
mandatory && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "tw-text-color-text-critical tw-ml-1", children: "*" })
|
|
610
721
|
]
|
|
611
722
|
}
|
|
612
723
|
),
|
|
613
|
-
/* @__PURE__ */ (0,
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
614
725
|
"div",
|
|
615
726
|
{
|
|
616
727
|
className: (0, import_clsx.default)(
|
|
617
|
-
"tw-absolute tw-right-3 tw
|
|
728
|
+
"tw-absolute tw-right-3 tw--translate-y-1/2 tw-flex tw-items-center",
|
|
618
729
|
{
|
|
619
|
-
"!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear)
|
|
730
|
+
"!tw-right-[5px]": doubleCharSearch && !(isHovering && selectedValue && allowClear),
|
|
731
|
+
"tw-top-3.5 !tw-right-2": size === "small",
|
|
732
|
+
"tw-top-1/2": size !== "small"
|
|
620
733
|
}
|
|
621
734
|
),
|
|
622
|
-
children:
|
|
623
|
-
"div",
|
|
624
|
-
{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
735
|
+
children: [
|
|
736
|
+
disabled && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "tw-absolute tw-right-0 -tw-top-2", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Lock, { size: 16 }) }),
|
|
737
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LoadingSpinner_default, { size: "xs" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
738
|
+
"div",
|
|
739
|
+
{
|
|
740
|
+
className: (0, import_clsx.default)(
|
|
741
|
+
"tw-transition-all tw-duration-200 tw-cursor-pointer tw-flex tw-items-center",
|
|
742
|
+
// Only rotate chevron when open and not showing clear icon
|
|
743
|
+
isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
|
|
744
|
+
),
|
|
745
|
+
onMouseDown: (e) => {
|
|
746
|
+
if (isHovering && selectedValue && allowClear) {
|
|
747
|
+
handleClear(e);
|
|
748
|
+
} else {
|
|
749
|
+
handleChevronClick(e);
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
753
|
+
CrossV2,
|
|
754
|
+
{
|
|
755
|
+
color: "#111827",
|
|
756
|
+
className: (0, import_clsx.default)({ "tw-mr-1": size !== "small" }),
|
|
757
|
+
size: size === "small" ? 12 : 16
|
|
758
|
+
}
|
|
759
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
760
|
+
Chevron2,
|
|
761
|
+
{
|
|
762
|
+
className: (0, import_clsx.default)("tw-text-gray-400"),
|
|
763
|
+
color: "#6B7280"
|
|
764
|
+
}
|
|
765
|
+
)
|
|
766
|
+
}
|
|
767
|
+
)
|
|
768
|
+
]
|
|
646
769
|
}
|
|
647
770
|
)
|
|
648
771
|
] }),
|
|
649
|
-
isOpen && /* @__PURE__ */ (0,
|
|
772
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
650
773
|
"div",
|
|
651
774
|
{
|
|
652
775
|
className: (0, import_clsx.default)(
|
|
@@ -656,7 +779,7 @@ var Select = ({
|
|
|
656
779
|
dropdownClassName
|
|
657
780
|
),
|
|
658
781
|
ref: optionListRef,
|
|
659
|
-
children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0,
|
|
782
|
+
children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
660
783
|
"div",
|
|
661
784
|
{
|
|
662
785
|
ref: (el) => optionRefs.current[index] = el,
|
|
@@ -667,7 +790,7 @@ var Select = ({
|
|
|
667
790
|
// Selected option styling
|
|
668
791
|
optionClassName
|
|
669
792
|
),
|
|
670
|
-
children: /* @__PURE__ */ (0,
|
|
793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
671
794
|
"div",
|
|
672
795
|
{
|
|
673
796
|
className: (0, import_clsx.default)(
|
|
@@ -685,12 +808,12 @@ var Select = ({
|
|
|
685
808
|
)
|
|
686
809
|
},
|
|
687
810
|
doubleCharSearch ? option.label : option.value
|
|
688
|
-
)) : /* @__PURE__ */ (0,
|
|
811
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
|
|
689
812
|
}
|
|
690
813
|
)
|
|
691
814
|
]
|
|
692
815
|
}
|
|
693
|
-
);
|
|
816
|
+
) });
|
|
694
817
|
};
|
|
695
818
|
var arePropsEqual = (prevProps, nextProps) => {
|
|
696
819
|
var _a, _b;
|
|
@@ -723,10 +846,10 @@ var arePropsEqual = (prevProps, nextProps) => {
|
|
|
723
846
|
return true;
|
|
724
847
|
};
|
|
725
848
|
Select.displayName = "Select";
|
|
726
|
-
var Select_default = (0,
|
|
849
|
+
var Select_default = (0, import_react2.memo)(Select, arePropsEqual);
|
|
727
850
|
|
|
728
851
|
// src/atom/RangePicker/RangePicker.tsx
|
|
729
|
-
var
|
|
852
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
730
853
|
function CustomRangePicker(props) {
|
|
731
854
|
var _a, _b;
|
|
732
855
|
const {
|
|
@@ -753,8 +876,8 @@ function CustomRangePicker(props) {
|
|
|
753
876
|
showToastError = () => {
|
|
754
877
|
}
|
|
755
878
|
} = props;
|
|
756
|
-
const onChangeRef = (0,
|
|
757
|
-
(0,
|
|
879
|
+
const onChangeRef = (0, import_react3.useRef)(onChange);
|
|
880
|
+
(0, import_react3.useEffect)(() => {
|
|
758
881
|
onChangeRef.current = onChange;
|
|
759
882
|
}, [onChange]);
|
|
760
883
|
const getInitialDate = () => {
|
|
@@ -785,18 +908,18 @@ function CustomRangePicker(props) {
|
|
|
785
908
|
}
|
|
786
909
|
return /* @__PURE__ */ new Date();
|
|
787
910
|
};
|
|
788
|
-
const [currentDate, setCurrentDate] = (0,
|
|
789
|
-
const [startDate, setStartDate] = (0,
|
|
911
|
+
const [currentDate, setCurrentDate] = (0, import_react3.useState)(() => getInitialDate());
|
|
912
|
+
const [startDate, setStartDate] = (0, import_react3.useState)(
|
|
790
913
|
dateRange[0] ? new Date(dateRange[0]) : null
|
|
791
914
|
);
|
|
792
|
-
const [endDate, setEndDate] = (0,
|
|
915
|
+
const [endDate, setEndDate] = (0, import_react3.useState)(
|
|
793
916
|
dateRange[0] && dateRange[1] ? new Date(dateRange[1]) : null
|
|
794
917
|
);
|
|
795
|
-
const [hoverDate, setHoverDate] = (0,
|
|
796
|
-
const [isSelectingEnd, setIsSelectingEnd] = (0,
|
|
918
|
+
const [hoverDate, setHoverDate] = (0, import_react3.useState)(null);
|
|
919
|
+
const [isSelectingEnd, setIsSelectingEnd] = (0, import_react3.useState)(
|
|
797
920
|
dateRange[0] && !dateRange[1] ? true : false
|
|
798
921
|
);
|
|
799
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
922
|
+
const [selectedDate, setSelectedDate] = (0, import_react3.useState)(
|
|
800
923
|
!isRange && dateRange[0] ? new Date(dateRange[0]) : null
|
|
801
924
|
);
|
|
802
925
|
const getDaysBetween = (start, end) => {
|
|
@@ -967,7 +1090,7 @@ function CustomRangePicker(props) {
|
|
|
967
1090
|
setHoverDate(null);
|
|
968
1091
|
}
|
|
969
1092
|
};
|
|
970
|
-
(0,
|
|
1093
|
+
(0, import_react3.useEffect)(() => {
|
|
971
1094
|
if (isRange) {
|
|
972
1095
|
sessionStorage.removeItem("rangePickerStartDate");
|
|
973
1096
|
onChangeRef.current(null, [
|
|
@@ -982,7 +1105,7 @@ function CustomRangePicker(props) {
|
|
|
982
1105
|
);
|
|
983
1106
|
}
|
|
984
1107
|
}, [startDate, endDate, isRange]);
|
|
985
|
-
(0,
|
|
1108
|
+
(0, import_react3.useEffect)(() => {
|
|
986
1109
|
if (!isRange && selectedDate) {
|
|
987
1110
|
onChangeRef.current(null, (0, import_dayjs.default)(selectedDate).format("D MMM, YYYY"));
|
|
988
1111
|
}
|
|
@@ -1047,8 +1170,8 @@ function CustomRangePicker(props) {
|
|
|
1047
1170
|
};
|
|
1048
1171
|
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"));
|
|
1049
1172
|
const NightCountTooltip = () => {
|
|
1050
|
-
const TooltipArrow = (0,
|
|
1051
|
-
return /* @__PURE__ */ (0,
|
|
1173
|
+
const TooltipArrow = (0, import_react3.memo)(() => {
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(
|
|
1052
1175
|
"div",
|
|
1053
1176
|
{
|
|
1054
1177
|
style: {
|
|
@@ -1059,16 +1182,16 @@ function CustomRangePicker(props) {
|
|
|
1059
1182
|
}
|
|
1060
1183
|
) });
|
|
1061
1184
|
});
|
|
1062
|
-
return /* @__PURE__ */ (0,
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.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: [
|
|
1063
1186
|
nightCountText,
|
|
1064
|
-
/* @__PURE__ */ (0,
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-absolute tw-right-[42%] tw-bottom-[-7px]", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipArrow, {}) })
|
|
1065
1188
|
] });
|
|
1066
1189
|
};
|
|
1067
1190
|
const renderCalendar = (monthDate, isSecondCalendar = false) => {
|
|
1068
1191
|
const days = generateCalendarDays(monthDate);
|
|
1069
1192
|
const monthName = monthNames[monthDate.getMonth()];
|
|
1070
1193
|
const year = monthDate.getFullYear();
|
|
1071
|
-
return /* @__PURE__ */ (0,
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1072
1195
|
"div",
|
|
1073
1196
|
{
|
|
1074
1197
|
className: (0, import_clsx2.default)("tw-flex-1 tw-max-w-[83vw] tw-mb-2", {
|
|
@@ -1076,13 +1199,13 @@ function CustomRangePicker(props) {
|
|
|
1076
1199
|
"tw-h-[290px]": !showYearDropdown || days.length <= 35
|
|
1077
1200
|
}),
|
|
1078
1201
|
children: [
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1080
|
-
/* @__PURE__ */ (0,
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-text-center tw-mb-4 sm:tw-mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: " tw-flex tw-justify-center tw-items-center tw-gap-4 ", children: [
|
|
1203
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h3", { className: "tw-typography-footNoteBold tw-text-color-text-default tw-m-0", children: [
|
|
1081
1204
|
monthName,
|
|
1082
1205
|
" ",
|
|
1083
1206
|
!showYearDropdown && ` ${year}`
|
|
1084
1207
|
] }),
|
|
1085
|
-
showYearDropdown && /* @__PURE__ */ (0,
|
|
1208
|
+
showYearDropdown && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1086
1209
|
Select_default,
|
|
1087
1210
|
{
|
|
1088
1211
|
options: yearOptions,
|
|
@@ -1104,7 +1227,7 @@ function CustomRangePicker(props) {
|
|
|
1104
1227
|
}
|
|
1105
1228
|
)
|
|
1106
1229
|
] }) }),
|
|
1107
|
-
/* @__PURE__ */ (0,
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-grid tw-grid-cols-7 tw-mb-2", children: dayNames.map((day) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1108
1231
|
"div",
|
|
1109
1232
|
{
|
|
1110
1233
|
className: "tw-py-2 tw-px-0 tw-text-center tw-typography-caption2 tw-text-[#6B7280]",
|
|
@@ -1112,9 +1235,9 @@ function CustomRangePicker(props) {
|
|
|
1112
1235
|
},
|
|
1113
1236
|
day
|
|
1114
1237
|
)) }),
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-grid tw-grid-cols-7", children: days.map((date, index) => {
|
|
1116
1239
|
if (!date) {
|
|
1117
|
-
return /* @__PURE__ */ (0,
|
|
1240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-h-10" }, index);
|
|
1118
1241
|
}
|
|
1119
1242
|
const isStart = isRange ? isSameDate(date, startDate) : false;
|
|
1120
1243
|
const isEnd = isRange ? isSameDate(date, endDate) : false;
|
|
@@ -1164,8 +1287,8 @@ function CustomRangePicker(props) {
|
|
|
1164
1287
|
(0, import_dayjs.default)(startDate),
|
|
1165
1288
|
"day"
|
|
1166
1289
|
);
|
|
1167
|
-
return /* @__PURE__ */ (0,
|
|
1168
|
-
(isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0,
|
|
1290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "tw-relative", children: [
|
|
1291
|
+
(isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1169
1292
|
"div",
|
|
1170
1293
|
{
|
|
1171
1294
|
className: (0, import_clsx2.default)(
|
|
@@ -1178,8 +1301,8 @@ function CustomRangePicker(props) {
|
|
|
1178
1301
|
)
|
|
1179
1302
|
}
|
|
1180
1303
|
),
|
|
1181
|
-
isHoveringDate && isHovering && /* @__PURE__ */ (0,
|
|
1182
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
isHoveringDate && isHovering && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1183
1306
|
"div",
|
|
1184
1307
|
{
|
|
1185
1308
|
className: (0, import_clsx2.default)(
|
|
@@ -1192,7 +1315,7 @@ function CustomRangePicker(props) {
|
|
|
1192
1315
|
)
|
|
1193
1316
|
}
|
|
1194
1317
|
),
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1196
1319
|
"div",
|
|
1197
1320
|
{
|
|
1198
1321
|
className: (0, import_clsx2.default)(
|
|
@@ -1205,8 +1328,8 @@ function CustomRangePicker(props) {
|
|
|
1205
1328
|
}
|
|
1206
1329
|
)
|
|
1207
1330
|
] }),
|
|
1208
|
-
isStart && /* @__PURE__ */ (0,
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1331
|
+
isStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1332
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1210
1333
|
"div",
|
|
1211
1334
|
{
|
|
1212
1335
|
className: (0, import_clsx2.default)(
|
|
@@ -1219,7 +1342,7 @@ function CustomRangePicker(props) {
|
|
|
1219
1342
|
)
|
|
1220
1343
|
}
|
|
1221
1344
|
),
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1223
1346
|
"div",
|
|
1224
1347
|
{
|
|
1225
1348
|
className: (0, import_clsx2.default)(
|
|
@@ -1232,7 +1355,7 @@ function CustomRangePicker(props) {
|
|
|
1232
1355
|
}
|
|
1233
1356
|
)
|
|
1234
1357
|
] }),
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1236
1359
|
"div",
|
|
1237
1360
|
{
|
|
1238
1361
|
className: (0, import_clsx2.default)(className, pseudoClass, "tw-group", {
|
|
@@ -1242,7 +1365,7 @@ function CustomRangePicker(props) {
|
|
|
1242
1365
|
onMouseEnter: () => handleDateHover(date),
|
|
1243
1366
|
"data-date": titleDate,
|
|
1244
1367
|
children: [
|
|
1245
|
-
showNightCount && isRange && isHovering && /* @__PURE__ */ (0,
|
|
1368
|
+
showNightCount && isRange && isHovering && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(NightCountTooltip, {}),
|
|
1246
1369
|
date.getDate()
|
|
1247
1370
|
]
|
|
1248
1371
|
}
|
|
@@ -1253,7 +1376,8 @@ function CustomRangePicker(props) {
|
|
|
1253
1376
|
}
|
|
1254
1377
|
);
|
|
1255
1378
|
};
|
|
1256
|
-
|
|
1379
|
+
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";
|
|
1380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1257
1381
|
"div",
|
|
1258
1382
|
{
|
|
1259
1383
|
className: (0, import_clsx2.default)(
|
|
@@ -1264,36 +1388,42 @@ function CustomRangePicker(props) {
|
|
|
1264
1388
|
}
|
|
1265
1389
|
),
|
|
1266
1390
|
children: [
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
1268
|
-
!isPreviousMonthDisabled() && /* @__PURE__ */ (0,
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.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: [
|
|
1392
|
+
!isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1269
1393
|
"div",
|
|
1270
1394
|
{
|
|
1271
|
-
className:
|
|
1395
|
+
className: (0, import_clsx2.default)(arrowClasses, "tw-left-1"),
|
|
1272
1396
|
onClick: () => navigateMonth(-1),
|
|
1273
1397
|
id: "calendar-previous-month-button",
|
|
1274
|
-
children: /* @__PURE__ */ (0,
|
|
1398
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1399
|
+
Chevron,
|
|
1400
|
+
{
|
|
1401
|
+
size: "medium",
|
|
1402
|
+
className: "tw-relative -tw-top-0.5 tw-right-0.5"
|
|
1403
|
+
}
|
|
1404
|
+
)
|
|
1275
1405
|
}
|
|
1276
1406
|
),
|
|
1277
|
-
isPreviousMonthDisabled() && /* @__PURE__ */ (0,
|
|
1278
|
-
!isNextMonthDisabled() && /* @__PURE__ */ (0,
|
|
1407
|
+
isPreviousMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-w-10 tw-h-10" }),
|
|
1408
|
+
!isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1279
1409
|
"div",
|
|
1280
1410
|
{
|
|
1281
|
-
className:
|
|
1411
|
+
className: (0, import_clsx2.default)(arrowClasses, "tw-mt-[1px] tw-right-1"),
|
|
1282
1412
|
onClick: () => navigateMonth(1),
|
|
1283
1413
|
id: "calendar-next-month-button",
|
|
1284
|
-
children: /* @__PURE__ */ (0,
|
|
1414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1285
1415
|
Chevron,
|
|
1286
1416
|
{
|
|
1287
1417
|
size: "medium",
|
|
1288
1418
|
onClick: () => navigateMonth(1),
|
|
1289
|
-
className: "tw-rotate-180"
|
|
1419
|
+
className: "tw-rotate-180 tw-relative tw-top-0.5 tw-left-0.5"
|
|
1290
1420
|
}
|
|
1291
1421
|
)
|
|
1292
1422
|
}
|
|
1293
1423
|
),
|
|
1294
|
-
isNextMonthDisabled() && /* @__PURE__ */ (0,
|
|
1424
|
+
isNextMonthDisabled() && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "tw-w-10 tw-h-10" })
|
|
1295
1425
|
] }),
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1426
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsxs)(
|
|
1297
1427
|
"div",
|
|
1298
1428
|
{
|
|
1299
1429
|
className: (0, import_clsx2.default)("tw-flex tw-w-full", {
|