@itilite/lumina-ui 1.1.7 → 1.1.9

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.
@@ -0,0 +1,618 @@
1
+ import {
2
+ Chevron
3
+ } from "./chunk-ZTRM4HZJ.mjs";
4
+ import {
5
+ Select_default
6
+ } from "./chunk-IQHBVGA4.mjs";
7
+
8
+ // src/atom/RangePicker/RangePicker.tsx
9
+ import { memo, useEffect, useRef, useState } from "react";
10
+ import clsx from "clsx";
11
+ import dayjs from "dayjs";
12
+
13
+ // src/atom/RangePicker/RangePicker.module.scss
14
+ var RangePicker_module_default = { "range_start": "RangePicker-module__range_start___hGQp-", "range_end": "RangePicker-module__range_end___JJNib" };
15
+
16
+ // src/atom/RangePicker/RangePicker.tsx
17
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
+ function CustomRangePicker(props) {
19
+ var _a, _b;
20
+ const {
21
+ id = "",
22
+ footer,
23
+ onChange = () => {
24
+ },
25
+ dateRange = ["", ""],
26
+ showNightCount = false,
27
+ isRange = true,
28
+ showYearDropdown = false,
29
+ showSingleCalendar = false,
30
+ disablePastDates = false,
31
+ // New prop to control past date restriction
32
+ minDate = null,
33
+ // New prop for minimum allowed date
34
+ maxDate = null,
35
+ // New prop for maximum allowed date
36
+ minYear = 1900,
37
+ // Minimum year for dropdown
38
+ maxYear = (/* @__PURE__ */ new Date()).getFullYear() + 10,
39
+ // Maximum year for dropdown
40
+ experience = "business",
41
+ showToastError = () => {
42
+ }
43
+ } = props;
44
+ const onChangeRef = useRef(onChange);
45
+ useEffect(() => {
46
+ onChangeRef.current = onChange;
47
+ }, [onChange]);
48
+ const getInitialDate = () => {
49
+ if (dateRange[0]) {
50
+ return new Date(dateRange[0]);
51
+ }
52
+ if (!minDate && !maxDate && !minYear && !maxYear) {
53
+ return /* @__PURE__ */ new Date();
54
+ }
55
+ if (maxYear && maxYear !== (/* @__PURE__ */ new Date()).getFullYear()) {
56
+ let targetDate = new Date(maxYear, 7, 1);
57
+ if (maxDate) {
58
+ const maxDateTime = new Date(maxDate);
59
+ if (targetDate > maxDateTime) {
60
+ targetDate = new Date(
61
+ maxDateTime.getFullYear(),
62
+ maxDateTime.getMonth(),
63
+ 1
64
+ );
65
+ }
66
+ }
67
+ return targetDate;
68
+ }
69
+ if (minDate) {
70
+ const minDateTime = new Date(minDate);
71
+ minDateTime.setHours(0, 0, 0, 0);
72
+ return minDateTime;
73
+ }
74
+ return /* @__PURE__ */ new Date();
75
+ };
76
+ const [currentDate, setCurrentDate] = useState(() => getInitialDate());
77
+ const [startDate, setStartDate] = useState(
78
+ dateRange[0] ? new Date(dateRange[0]) : null
79
+ );
80
+ const [endDate, setEndDate] = useState(
81
+ dateRange[0] && dateRange[1] ? new Date(dateRange[1]) : null
82
+ );
83
+ const [hoverDate, setHoverDate] = useState(null);
84
+ const [isSelectingEnd, setIsSelectingEnd] = useState(
85
+ dateRange[0] && !dateRange[1] ? true : false
86
+ );
87
+ const [selectedDate, setSelectedDate] = useState(
88
+ !isRange && dateRange[0] ? new Date(dateRange[0]) : null
89
+ );
90
+ const getDaysBetween = (start, end) => {
91
+ if (!start || !end) return 0;
92
+ const startDay = dayjs(start).startOf("day");
93
+ const endDay = dayjs(end).startOf("day");
94
+ return endDay.diff(startDay, "day");
95
+ };
96
+ const nightCount = Math.abs(getDaysBetween(startDate || endDate, hoverDate));
97
+ const nightCountText = nightCount > 1 ? `${nightCount} nights` : "1 night";
98
+ const today = /* @__PURE__ */ new Date();
99
+ today.setHours(0, 0, 0, 0);
100
+ const firstMonth = new Date(
101
+ currentDate.getFullYear(),
102
+ currentDate.getMonth(),
103
+ 1
104
+ );
105
+ const secondMonth = new Date(
106
+ currentDate.getFullYear(),
107
+ currentDate.getMonth() + 1,
108
+ 1
109
+ );
110
+ const monthNames = [
111
+ "January",
112
+ "February",
113
+ "March",
114
+ "April",
115
+ "May",
116
+ "June",
117
+ "July",
118
+ "August",
119
+ "September",
120
+ "October",
121
+ "November",
122
+ "December"
123
+ ];
124
+ const dayNames = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
125
+ const generateYearOptions = () => {
126
+ const years = [];
127
+ for (let i = minYear; i <= maxYear; i++) {
128
+ const isYearDisabled = isYearCompletelyDisabled(i);
129
+ years.push({
130
+ label: i.toString(),
131
+ value: i,
132
+ disabled: isYearDisabled
133
+ });
134
+ }
135
+ return years;
136
+ };
137
+ const isYearCompletelyDisabled = (year) => {
138
+ const firstDayOfYear = new Date(year, 0, 1);
139
+ const lastDayOfYear = new Date(year, 11, 31);
140
+ if (minDate) {
141
+ const minDateTime = new Date(minDate);
142
+ minDateTime.setHours(0, 0, 0, 0);
143
+ if (minDateTime > lastDayOfYear) {
144
+ return true;
145
+ }
146
+ }
147
+ if (maxDate) {
148
+ const maxDateTime = new Date(maxDate);
149
+ maxDateTime.setHours(0, 0, 0, 0);
150
+ if (maxDateTime < firstDayOfYear) {
151
+ return true;
152
+ }
153
+ }
154
+ if (disablePastDates) {
155
+ const today2 = /* @__PURE__ */ new Date();
156
+ today2.setHours(0, 0, 0, 0);
157
+ if (lastDayOfYear < today2) {
158
+ return true;
159
+ }
160
+ }
161
+ return false;
162
+ };
163
+ const yearOptions = generateYearOptions();
164
+ const generateCalendarDays = (monthDate) => {
165
+ const year = monthDate.getFullYear();
166
+ const month = monthDate.getMonth();
167
+ const firstDay = new Date(year, month, 1);
168
+ const lastDay = new Date(year, month + 1, 0);
169
+ const daysInMonth = lastDay.getDate();
170
+ const startingDayOfWeek = firstDay.getDay();
171
+ const days = [];
172
+ for (let i = 0; i < startingDayOfWeek; i++) {
173
+ days.push(null);
174
+ }
175
+ for (let day = 1; day <= daysInMonth; day++) {
176
+ days.push(new Date(year, month, day));
177
+ }
178
+ return days;
179
+ };
180
+ const formatDateKey = (date) => {
181
+ if (!date) return "";
182
+ return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
183
+ };
184
+ const isSameDate = (date1, date2) => {
185
+ if (!date1 || !date2) return false;
186
+ return formatDateKey(date1) === formatDateKey(date2);
187
+ };
188
+ const isDateDisabled = (date) => {
189
+ if (!date) return false;
190
+ const checkDate = new Date(date);
191
+ checkDate.setHours(0, 0, 0, 0);
192
+ if (disablePastDates && checkDate < today) {
193
+ return true;
194
+ }
195
+ if (minDate) {
196
+ const minDateTime = new Date(minDate);
197
+ minDateTime.setHours(0, 0, 0, 0);
198
+ if (checkDate < minDateTime) {
199
+ return true;
200
+ }
201
+ }
202
+ if (maxDate) {
203
+ const maxDateTime = new Date(maxDate);
204
+ maxDateTime.setHours(0, 0, 0, 0);
205
+ if (checkDate > maxDateTime) {
206
+ return true;
207
+ }
208
+ }
209
+ return false;
210
+ };
211
+ const isDateInRange = (date) => {
212
+ if (!isRange || !startDate || !date) return false;
213
+ const compareDate = endDate || hoverDate;
214
+ if (!compareDate) return false;
215
+ const start = startDate < compareDate ? startDate : compareDate;
216
+ const end = startDate < compareDate ? compareDate : startDate;
217
+ return date >= start && date <= end;
218
+ };
219
+ const isDateBetweenRange = (date) => {
220
+ if (!isRange || !startDate || !date) return false;
221
+ const compareDate = endDate || hoverDate;
222
+ if (!compareDate) return false;
223
+ const start = startDate < compareDate ? startDate : compareDate;
224
+ const end = startDate < compareDate ? compareDate : startDate;
225
+ return date > start && date < end;
226
+ };
227
+ const handleDateClick = (date) => {
228
+ if (isDateDisabled(date)) return;
229
+ if (!isRange) {
230
+ setSelectedDate(date);
231
+ return;
232
+ }
233
+ const isCheckinCheckoutSame = dayjs(date).format("D MMM, YYYY") === dayjs(startDate).format("D MMM, YYYY");
234
+ if (showNightCount && isCheckinCheckoutSame) {
235
+ setStartDate(null);
236
+ setEndDate(null);
237
+ setIsSelectingEnd(false);
238
+ setHoverDate(null);
239
+ showToastError("Check-in and check-out dates cannot be the same.");
240
+ return;
241
+ }
242
+ if (!startDate || startDate && endDate) {
243
+ setStartDate(date);
244
+ setEndDate(null);
245
+ setIsSelectingEnd(true);
246
+ setHoverDate(null);
247
+ } else if (startDate && !endDate) {
248
+ if (date < startDate) {
249
+ setEndDate(startDate);
250
+ setStartDate(date);
251
+ } else {
252
+ setEndDate(date);
253
+ }
254
+ setIsSelectingEnd(false);
255
+ setHoverDate(null);
256
+ }
257
+ };
258
+ useEffect(() => {
259
+ if (isRange) {
260
+ sessionStorage.removeItem("rangePickerStartDate");
261
+ onChangeRef.current(null, [
262
+ startDate ? dayjs(startDate).format("D MMM, YYYY") : "",
263
+ endDate ? dayjs(endDate).format("D MMM, YYYY") : ""
264
+ ]);
265
+ }
266
+ if (isRange && startDate && !endDate) {
267
+ sessionStorage.setItem(
268
+ "rangePickerStartDate",
269
+ dayjs(startDate).format("D MMM, YYYY")
270
+ );
271
+ }
272
+ }, [startDate, endDate, isRange]);
273
+ useEffect(() => {
274
+ if (!isRange && selectedDate) {
275
+ onChangeRef.current(null, dayjs(selectedDate).format("D MMM, YYYY"));
276
+ }
277
+ }, [selectedDate, isRange]);
278
+ const handleDateHover = (date) => {
279
+ if (isDateDisabled(date) || !isRange) return;
280
+ if (isSelectingEnd && startDate && !endDate) {
281
+ setHoverDate(date);
282
+ }
283
+ };
284
+ const navigateMonth = (direction) => {
285
+ const newDate = new Date(currentDate);
286
+ newDate.setMonth(currentDate.getMonth() + direction);
287
+ setCurrentDate(newDate);
288
+ };
289
+ const isPreviousMonthDisabled = () => {
290
+ const previousMonth = new Date(currentDate);
291
+ previousMonth.setMonth(currentDate.getMonth() - 1);
292
+ const lastDayOfPreviousMonth = new Date(
293
+ previousMonth.getFullYear(),
294
+ previousMonth.getMonth() + 1,
295
+ 0
296
+ );
297
+ return isDateDisabled(lastDayOfPreviousMonth);
298
+ };
299
+ const isNextMonthDisabled = () => {
300
+ const nextMonth = new Date(currentDate);
301
+ nextMonth.setMonth(currentDate.getMonth() + 1);
302
+ const firstDayOfNextMonth = new Date(
303
+ nextMonth.getFullYear(),
304
+ nextMonth.getMonth(),
305
+ 1
306
+ );
307
+ return isDateDisabled(firstDayOfNextMonth);
308
+ };
309
+ const handleYearChange = (selectedYear) => {
310
+ const newDate = new Date(currentDate);
311
+ newDate.setFullYear(selectedYear);
312
+ const targetMonth = newDate.getMonth();
313
+ if (!isMonthDisabled(selectedYear, targetMonth)) {
314
+ setCurrentDate(newDate);
315
+ } else {
316
+ const firstAvailableMonth = findFirstAvailableMonth(selectedYear);
317
+ if (firstAvailableMonth !== -1) {
318
+ newDate.setMonth(firstAvailableMonth);
319
+ setCurrentDate(newDate);
320
+ }
321
+ }
322
+ };
323
+ const isMonthDisabled = (year, month) => {
324
+ const lastDayOfMonth = new Date(year, month + 1, 0);
325
+ const firstDayOfMonth = new Date(year, month, 1);
326
+ return isDateDisabled(lastDayOfMonth) && isDateDisabled(firstDayOfMonth);
327
+ };
328
+ const findFirstAvailableMonth = (year) => {
329
+ for (let month = 0; month < 12; month++) {
330
+ if (!isMonthDisabled(year, month)) {
331
+ return month;
332
+ }
333
+ }
334
+ return -1;
335
+ };
336
+ const isSameDay = ((_a = dayjs(startDate)) == null ? void 0 : _a.format("D MMM, YYYY")) === ((_b = dayjs(endDate)) == null ? void 0 : _b.format("D MMM, YYYY"));
337
+ const NightCountTooltip = () => {
338
+ const TooltipArrow = memo(() => {
339
+ return /* @__PURE__ */ 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__ */ jsx(
340
+ "div",
341
+ {
342
+ style: {
343
+ borderTop: "5px solid transparent",
344
+ borderBottom: "5px solid transparent",
345
+ borderLeft: "8px solid black"
346
+ }
347
+ }
348
+ ) });
349
+ });
350
+ return /* @__PURE__ */ 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: [
351
+ nightCountText,
352
+ /* @__PURE__ */ jsx("div", { className: "tw-absolute tw-right-[42%] tw-bottom-[-7px]", children: /* @__PURE__ */ jsx(TooltipArrow, {}) })
353
+ ] });
354
+ };
355
+ const renderCalendar = (monthDate, isSecondCalendar = false) => {
356
+ const days = generateCalendarDays(monthDate);
357
+ const monthName = monthNames[monthDate.getMonth()];
358
+ const year = monthDate.getFullYear();
359
+ return /* @__PURE__ */ jsxs(
360
+ "div",
361
+ {
362
+ className: clsx("tw-flex-1 tw-max-w-[83vw] tw-mb-2", {
363
+ "tw-h-[320px]": showYearDropdown || days.length > 35,
364
+ "tw-h-[290px]": !showYearDropdown || days.length <= 35
365
+ }),
366
+ children: [
367
+ /* @__PURE__ */ jsx("div", { className: "tw-text-center tw-mb-4 sm:tw-mt-0", children: /* @__PURE__ */ jsxs("div", { className: " tw-flex tw-justify-center tw-items-center tw-gap-4 ", children: [
368
+ /* @__PURE__ */ jsxs("h3", { className: "tw-typography-footNoteBold tw-text-color-text-default tw-m-0", children: [
369
+ monthName,
370
+ " ",
371
+ !showYearDropdown && ` ${year}`
372
+ ] }),
373
+ showYearDropdown && /* @__PURE__ */ jsx(
374
+ Select_default,
375
+ {
376
+ options: yearOptions,
377
+ value: currentDate.getFullYear(),
378
+ valueSelected: currentDate.getFullYear(),
379
+ onChange: (selectedYear) => {
380
+ if (typeof selectedYear === "number") {
381
+ handleYearChange(selectedYear);
382
+ }
383
+ },
384
+ className: "tw-min-w-fit tw-bg-transparent tw-typography-footNoteBold tw-text-color-text-default",
385
+ size: "small",
386
+ variant: "filled",
387
+ style: { width: "80px" },
388
+ id: `${id}-year-select`,
389
+ allowClear: false,
390
+ enableSearch: false,
391
+ experience
392
+ }
393
+ )
394
+ ] }) }),
395
+ /* @__PURE__ */ jsx("div", { className: "tw-grid tw-grid-cols-7 tw-mb-2", children: dayNames.map((day) => /* @__PURE__ */ jsx(
396
+ "div",
397
+ {
398
+ className: "tw-py-2 tw-px-0 tw-text-center tw-typography-caption2 tw-text-[#6B7280]",
399
+ children: day
400
+ },
401
+ day
402
+ )) }),
403
+ /* @__PURE__ */ jsx("div", { className: "tw-grid tw-grid-cols-7", children: days.map((date, index) => {
404
+ if (!date) {
405
+ return /* @__PURE__ */ jsx("div", { className: "tw-h-10" }, index);
406
+ }
407
+ const isStart = isRange ? isSameDate(date, startDate) : false;
408
+ const isEnd = isRange ? isSameDate(date, endDate) : false;
409
+ const isSelected = !isRange ? isSameDate(date, selectedDate) : false;
410
+ const isInRange = isRange ? isDateBetweenRange(date) : false;
411
+ const isHovering = isRange && isSelectingEnd && hoverDate && isDateInRange(date) && !isStart && !isEnd;
412
+ const isDisabled = isDateDisabled(date);
413
+ let className = "tw-relative tw-z-20 tw-h-10 tw-w-10 tw-flex tw-items-center tw-justify-center tw-typography-caption1Bold ";
414
+ const isFirstInRow = index % 7 === 0;
415
+ const isLastInRow = index % 7 === 6;
416
+ let pseudoClass = "";
417
+ if (isDisabled) {
418
+ className += "tw-text-gray-300 tw-cursor-not-allowed ";
419
+ } else {
420
+ className += "tw-cursor-pointer ";
421
+ if (isStart || isEnd || isSelected) {
422
+ className += "tw-bg-black tw-z-[21] tw-text-white tw-font-medium tw-rounded-full ";
423
+ } else if (isInRange) {
424
+ className += "tw-text-gray-900";
425
+ if (window.innerWidth < 640) {
426
+ className = className.replace(
427
+ "tw-w-10",
428
+ "tw-pr-2 tw-w-[50px] sm:tw-w-10 sm:tw-pr-0"
429
+ );
430
+ }
431
+ pseudoClass = clsx(RangePicker_module_default.range_start, RangePicker_module_default.range_end);
432
+ } else {
433
+ className += "tw-text-gray-700 hover:tw-border-2 hover:tw-border-black tw-rounded-full hover:tw-border-solid ";
434
+ }
435
+ if (isHovering) {
436
+ className += "tw-border-2 tw-border-gray-400 tw-bg-white tw-z-[22]";
437
+ }
438
+ }
439
+ const titleDate = dayjs(date).format("YYYY-MM-DD");
440
+ const hoverDateFormatted = dayjs(hoverDate || null).format(
441
+ "YYYY-MM-DD"
442
+ );
443
+ const isHoveringDate = dayjs(hoverDateFormatted).isSame(
444
+ dayjs(date),
445
+ "day"
446
+ );
447
+ const isHoverDateGreater = dayjs(hoverDate).isAfter(
448
+ dayjs(startDate),
449
+ "day"
450
+ );
451
+ const isHoverDateLess = dayjs(hoverDate).isBefore(
452
+ dayjs(startDate),
453
+ "day"
454
+ );
455
+ return /* @__PURE__ */ jsxs("div", { className: "tw-relative", children: [
456
+ (isStart || isEnd) && startDate && endDate && !isSameDay && isRange && /* @__PURE__ */ jsx(
457
+ "div",
458
+ {
459
+ className: clsx(
460
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
461
+ {
462
+ "tw-left-5": isStart,
463
+ "tw-right-5": isEnd,
464
+ "tw-invisible": isFirstInRow && isEnd || isLastInRow && isStart
465
+ }
466
+ )
467
+ }
468
+ ),
469
+ isHoveringDate && isHovering && /* @__PURE__ */ jsxs(Fragment, { children: [
470
+ /* @__PURE__ */ jsx(
471
+ "div",
472
+ {
473
+ className: clsx(
474
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
475
+ {
476
+ "tw-right-5": isHoverDateGreater,
477
+ "tw-left-5": isHoverDateLess,
478
+ "tw-invisible": isFirstInRow && isHoverDateGreater || isLastInRow && isHoverDateLess
479
+ }
480
+ )
481
+ }
482
+ ),
483
+ /* @__PURE__ */ jsx(
484
+ "div",
485
+ {
486
+ className: clsx(
487
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
488
+ {
489
+ "tw-left-5": isHoverDateLess,
490
+ "tw-right-5 tw-rotate-180": isHoverDateGreater
491
+ }
492
+ )
493
+ }
494
+ )
495
+ ] }),
496
+ isStart && /* @__PURE__ */ jsxs(Fragment, { children: [
497
+ /* @__PURE__ */ jsx(
498
+ "div",
499
+ {
500
+ className: clsx(
501
+ "tw-w-9 tw-h-8 tw-bg-[#F2EFEC] tw-rotate-90 tw-absolute tw-z-10 tw-top-1",
502
+ {
503
+ "tw-right-5": isHoverDateLess,
504
+ "tw-left-5": isHoverDateGreater,
505
+ "tw-invisible": isLastInRow
506
+ }
507
+ )
508
+ }
509
+ ),
510
+ /* @__PURE__ */ jsx(
511
+ "div",
512
+ {
513
+ className: clsx(
514
+ "tw-w-[18px] tw-h-[40px] tw-bg-white tw-rounded-r-full tw-absolute tw-z-20",
515
+ {
516
+ "tw-left-5": isHoverDateGreater,
517
+ "tw-right-5 tw-rotate-180": isHoverDateLess
518
+ }
519
+ )
520
+ }
521
+ )
522
+ ] }),
523
+ /* @__PURE__ */ jsxs(
524
+ "div",
525
+ {
526
+ className: clsx(className, pseudoClass, "tw-group", {
527
+ "tw-border-2 !tw-border-black tw-rounded-full tw-border-solid": dayjs(date).isSame(dayjs(hoverDate), "day")
528
+ }),
529
+ onClick: () => handleDateClick(date),
530
+ onMouseEnter: () => handleDateHover(date),
531
+ "data-date": titleDate,
532
+ children: [
533
+ showNightCount && isRange && isHovering && /* @__PURE__ */ jsx(NightCountTooltip, {}),
534
+ date.getDate()
535
+ ]
536
+ }
537
+ )
538
+ ] }, formatDateKey(date));
539
+ }) })
540
+ ]
541
+ }
542
+ );
543
+ };
544
+ 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";
545
+ return /* @__PURE__ */ jsxs(
546
+ "div",
547
+ {
548
+ className: clsx(
549
+ "custom-range-picker tw-relative tw-bg-white tw-rounded-xl tw-pt-1 tw-px-0 tw-max-w-4xl tw-mx-auto tw-border tw-border-gray-200 tw-border-solid tw-w-full tw-max-h-[90vh] tw-overflow-y-auto",
550
+ {
551
+ "sm:tw-w-[640px]": !showSingleCalendar,
552
+ "sm:tw-w-[330px]": showSingleCalendar
553
+ }
554
+ ),
555
+ children: [
556
+ /* @__PURE__ */ 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: [
557
+ !isPreviousMonthDisabled() && /* @__PURE__ */ jsx(
558
+ "div",
559
+ {
560
+ className: clsx(arrowClasses, "tw-left-1"),
561
+ onClick: () => navigateMonth(-1),
562
+ id: "calendar-previous-month-button",
563
+ children: /* @__PURE__ */ jsx(
564
+ Chevron,
565
+ {
566
+ size: "medium",
567
+ className: "tw-relative -tw-top-0.5 tw-right-0.5"
568
+ }
569
+ )
570
+ }
571
+ ),
572
+ isPreviousMonthDisabled() && /* @__PURE__ */ jsx("div", { className: "tw-w-10 tw-h-10" }),
573
+ !isNextMonthDisabled() && /* @__PURE__ */ jsx(
574
+ "div",
575
+ {
576
+ className: clsx(arrowClasses, "tw-mt-[1px] tw-right-1"),
577
+ onClick: () => navigateMonth(1),
578
+ id: "calendar-next-month-button",
579
+ children: /* @__PURE__ */ jsx(
580
+ Chevron,
581
+ {
582
+ size: "medium",
583
+ onClick: () => navigateMonth(1),
584
+ className: "tw-rotate-180 tw-relative tw-top-0.5 tw-left-0.5"
585
+ }
586
+ )
587
+ }
588
+ ),
589
+ isNextMonthDisabled() && /* @__PURE__ */ jsx("div", { className: "tw-w-10 tw-h-10" })
590
+ ] }),
591
+ /* @__PURE__ */ 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__ */ jsxs(
592
+ "div",
593
+ {
594
+ className: clsx("tw-flex tw-w-full", {
595
+ "tw-flex-col sm:tw-space-x-8 sm:tw-flex-row": isRange || !showSingleCalendar,
596
+ "tw-justify-center": !isRange || showSingleCalendar,
597
+ "tw-pt-4": showYearDropdown,
598
+ // More space when year dropdown is visible
599
+ "tw-pt-6": !showYearDropdown
600
+ }),
601
+ children: [
602
+ renderCalendar(firstMonth),
603
+ !showSingleCalendar && renderCalendar(secondMonth, true)
604
+ ]
605
+ }
606
+ ) }),
607
+ footer
608
+ ]
609
+ }
610
+ );
611
+ }
612
+ CustomRangePicker.displayName = "RangePicker";
613
+ var RangePicker_default = CustomRangePicker;
614
+
615
+ export {
616
+ CustomRangePicker,
617
+ RangePicker_default
618
+ };
package/dist/index.mjs CHANGED
@@ -1,6 +1,3 @@
1
- import {
2
- RangePicker_default
3
- } from "./chunk-B63IXC6M.mjs";
4
1
  import {
5
2
  Slider_default
6
3
  } from "./chunk-D3N7VFER.mjs";
@@ -23,8 +20,8 @@ import {
23
20
  Checkbox_default
24
21
  } from "./chunk-UQZNUEZE.mjs";
25
22
  import {
26
- Radio_default
27
- } from "./chunk-2EBPXGRY.mjs";
23
+ RangePicker_default
24
+ } from "./chunk-B63IXC6M.mjs";
28
25
  import {
29
26
  Select_default
30
27
  } from "./chunk-IQHBVGA4.mjs";
@@ -35,6 +32,9 @@ import {
35
32
  LoadingSpinner_default
36
33
  } from "./chunk-QKTMWS4J.mjs";
37
34
  import "./chunk-ZTRM4HZJ.mjs";
35
+ import {
36
+ Radio_default
37
+ } from "./chunk-2EBPXGRY.mjs";
38
38
  import "./chunk-FWCSY2DS.mjs";
39
39
  export {
40
40
  Avatar_default as Avatar,
package/dist/styles.css CHANGED
@@ -144,9 +144,6 @@
144
144
  .tw-grid {
145
145
  display: grid
146
146
  }
147
- .tw-h-0 {
148
- height: 0px
149
- }
150
147
  .tw-h-10 {
151
148
  height: 2.5rem
152
149
  }
@@ -381,10 +378,6 @@
381
378
  --tw-bg-opacity: 1;
382
379
  background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1))
383
380
  }
384
- .tw-bg-color-surface-dark {
385
- --tw-bg-opacity: 1;
386
- background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1))
387
- }
388
381
  .tw-bg-gray-200 {
389
382
  --tw-bg-opacity: 1;
390
383
  background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1))
@@ -697,6 +690,16 @@
697
690
 
698
691
 
699
692
  /* CSS Modules */
693
+ /* src/atom/LoadingSpinner/LoadingSpinner.module.scss */
694
+ .LoadingSpinner-module__spinnerContainer___DiPLf {
695
+ display: flex;
696
+ justify-content: center;
697
+ align-items: center;
698
+ height: 100%;
699
+ margin-top: 2rem;
700
+ margin-bottom: 2rem;
701
+ }
702
+
700
703
  /* src/atom/Checkbox/Checkbox.module.scss */
701
704
  .Checkbox-module__checkbox___xxg5L {
702
705
  display: flex;
@@ -795,6 +798,37 @@
795
798
  background: white;
796
799
  }
797
800
 
801
+ /* src/atom/Switch/Switch.module.scss */
802
+ .Switch-module__switch___fUHZL.ant-switch.ant-switch-small {
803
+ height: 0.75rem;
804
+ min-width: 1.5rem
805
+ }
806
+ .Switch-module__switch___fUHZL.ant-switch.ant-switch-small .ant-switch-handle {
807
+ height: 0.5rem;
808
+ width: 0.5rem
809
+ }
810
+ .Switch-module__switch___fUHZL.ant-switch.ant-switch-checked {
811
+ --tw-bg-opacity: 1;
812
+ background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1))
813
+ }
814
+ .Switch-module__switch___fUHZL.ant-switch.ant-switch-checked:hover {
815
+ --tw-bg-opacity: 1;
816
+ background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1))
817
+ }
818
+
819
+ /* src/atom/Tooltip/Tooltip.module.scss */
820
+ .Tooltip-module__light___H5oCc .ant-tooltip-content .ant-tooltip-inner {
821
+ background-color: white !important;
822
+ color: #111827;
823
+ border-radius: 0.5rem;
824
+ padding: 0.625rem;
825
+ --tw-text-opacity: 1;
826
+ color: rgb(33 40 55 / var(--tw-text-opacity, 1));
827
+ }
828
+ .Tooltip-module__light___H5oCc .ant-tooltip-arrow:before {
829
+ background-color: white !important;
830
+ }
831
+
798
832
  /* src/atom/Slider/Slider.module.scss */
799
833
  .Slider-module__label___9Uea- {
800
834
  font-size: 13px;
@@ -803,6 +837,10 @@
803
837
  color: rgb(54 62 79 / var(--tw-text-opacity, 1));
804
838
  }
805
839
 
840
+ .Slider-module__slider___JCS-c.ant-slider {
841
+ margin-left: 0px;
842
+ margin-right: 0px;
843
+ }
806
844
  .Slider-module__slider___JCS-c.ant-slider .ant-slider-handle::after {
807
845
  box-shadow: 0 0 0 2px #ec5d25;
808
846
  transform: scale(1.25);
@@ -819,51 +857,80 @@
819
857
  background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1));
820
858
  height: 2px;
821
859
  }
822
- .Slider-module__slider___JCS-c.Slider-module__disableFill___rjbsy.ant-slider .ant-slider-handle::after {
823
- box-shadow: 0 4px 4px 0 rgba(250, 166, 102, 0.2);
824
- --tw-bg-opacity: 1;
825
- background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1));
826
- width: 12px;
827
- height: 12px;
828
- top: -2px;
829
- }
830
- .Slider-module__slider___JCS-c.Slider-module__disableFill___rjbsy.ant-slider .ant-slider-handle::before {
831
- content: "";
832
- position: absolute;
833
- width: 5px;
834
- height: 5px;
835
- background: white;
836
- border-radius: 50%;
837
- top: 4px;
838
- left: 54%;
839
- transform: translate(-50%, -50%);
840
- z-index: 1;
841
- }
842
860
  .Slider-module__slider___JCS-c.Slider-module__disableFill___rjbsy.ant-slider .ant-slider-track {
843
861
  background-color: transparent;
844
862
  }
845
863
  .Slider-module__slider___JCS-c.Slider-module__disableFill___rjbsy .ant-slider-rail {
846
- height: 0.125rem;
847
864
  --tw-bg-opacity: 1;
848
- background-color: rgb(17 24 39 / var(--tw-bg-opacity, 1));
865
+ background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));
849
866
  }
850
867
 
851
- /* src/atom/Switch/Switch.module.scss */
852
- .Switch-module__switch___fUHZL.ant-switch.ant-switch-small {
853
- height: 0.75rem;
854
- min-width: 1.5rem
868
+ /* src/atom/Radio/Radio.module.scss */
869
+ .Radio-module__radio___1CPAk {
870
+ display: flex;
871
+ align-items: center;
855
872
  }
856
- .Switch-module__switch___fUHZL.ant-switch.ant-switch-small .ant-switch-handle {
857
- height: 0.5rem;
858
- width: 0.5rem
873
+ .Radio-module__radio___1CPAk.Radio-module__size_small___nRXgM .ant-radio .ant-radio-inner {
874
+ height: 16px;
875
+ width: 16px;
859
876
  }
860
- .Switch-module__switch___fUHZL.ant-switch.ant-switch-checked {
861
- --tw-bg-opacity: 1;
862
- background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1))
877
+ .Radio-module__radio___1CPAk.Radio-module__size_medium___uSzPl .ant-radio .ant-radio-inner {
878
+ height: 20px;
879
+ width: 20px;
863
880
  }
864
- .Switch-module__switch___fUHZL.ant-switch.ant-switch-checked:hover {
865
- --tw-bg-opacity: 1;
866
- background-color: rgb(236 93 37 / var(--tw-bg-opacity, 1))
881
+ .Radio-module__radio___1CPAk.Radio-module__size_large___ubpHs .ant-radio .ant-radio-inner {
882
+ height: 24px;
883
+ width: 24px;
884
+ }
885
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked .ant-radio-inner {
886
+ border-color: #EC5D25;
887
+ background-color: #EC5D25;
888
+ }
889
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked:hover .ant-radio-inner {
890
+ border-color: #B94710;
891
+ background-color: #B94710;
892
+ }
893
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked:focus-visible {
894
+ outline: 2px solid #0A65E7;
895
+ }
896
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z {
897
+ cursor: not-allowed;
898
+ }
899
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z .ant-radio-checked .ant-radio-inner {
900
+ border-color: #B6BAC3;
901
+ background-color: #B6BAC3;
902
+ }
903
+ .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z .ant-radio-checked .ant-radio-inner::after {
904
+ transform: scale(0.375);
905
+ background-color: #FFFFFF;
906
+ }
907
+ .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio .ant-radio-inner {
908
+ border-color: #B6BAC3;
909
+ }
910
+ .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio:hover .ant-radio-inner {
911
+ border-color: #6B7280;
912
+ }
913
+ .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio:focus-visible {
914
+ outline: 2px solid #0A65E7;
915
+ }
916
+ .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7.Radio-module__disabled___AF98Z {
917
+ cursor: not-allowed;
918
+ }
919
+ .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7.Radio-module__disabled___AF98Z .ant-radio .ant-radio-inner {
920
+ border-color: #B6BAC3;
921
+ background-color: #F9FAFB;
922
+ }
923
+ .Radio-module__radio___1CPAk.Radio-module__variant_normal___FQkTC {
924
+ color: #363E4F;
925
+ font-weight: 400;
926
+ font-size: 0.875rem;
927
+ line-height: 20px;
928
+ }
929
+ .Radio-module__radio___1CPAk.Radio-module__variant_emphasized___Fgpv6 {
930
+ color: #363E4F;
931
+ font-weight: 500;
932
+ font-size: 0.875rem;
933
+ line-height: 20px;
867
934
  }
868
935
 
869
936
  /* src/atom/Button/Button.module.scss */
@@ -1060,87 +1127,6 @@
1060
1127
  outline: none;
1061
1128
  }
1062
1129
 
1063
- /* src/atom/Tooltip/Tooltip.module.scss */
1064
- .Tooltip-module__light___H5oCc .ant-tooltip-content .ant-tooltip-inner {
1065
- background-color: white !important;
1066
- color: #111827;
1067
- border-radius: 0.5rem;
1068
- padding: 0.625rem;
1069
- --tw-text-opacity: 1;
1070
- color: rgb(33 40 55 / var(--tw-text-opacity, 1));
1071
- }
1072
- .Tooltip-module__light___H5oCc .ant-tooltip-arrow:before {
1073
- background-color: white !important;
1074
- }
1075
-
1076
- /* src/atom/Radio/Radio.module.scss */
1077
- .Radio-module__radio___1CPAk {
1078
- display: flex;
1079
- align-items: center;
1080
- }
1081
- .Radio-module__radio___1CPAk.Radio-module__size_small___nRXgM .ant-radio .ant-radio-inner {
1082
- height: 16px;
1083
- width: 16px;
1084
- }
1085
- .Radio-module__radio___1CPAk.Radio-module__size_medium___uSzPl .ant-radio .ant-radio-inner {
1086
- height: 20px;
1087
- width: 20px;
1088
- }
1089
- .Radio-module__radio___1CPAk.Radio-module__size_large___ubpHs .ant-radio .ant-radio-inner {
1090
- height: 24px;
1091
- width: 24px;
1092
- }
1093
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked .ant-radio-inner {
1094
- border-color: #EC5D25;
1095
- background-color: #EC5D25;
1096
- }
1097
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked:hover .ant-radio-inner {
1098
- border-color: #B94710;
1099
- background-color: #B94710;
1100
- }
1101
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu .ant-radio-checked:focus-visible {
1102
- outline: 2px solid #0A65E7;
1103
- }
1104
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z {
1105
- cursor: not-allowed;
1106
- }
1107
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z .ant-radio-checked .ant-radio-inner {
1108
- border-color: #B6BAC3;
1109
- background-color: #B6BAC3;
1110
- }
1111
- .Radio-module__radio___1CPAk.Radio-module__type_checked___BvPpu.Radio-module__disabled___AF98Z .ant-radio-checked .ant-radio-inner::after {
1112
- transform: scale(0.375);
1113
- background-color: #FFFFFF;
1114
- }
1115
- .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio .ant-radio-inner {
1116
- border-color: #B6BAC3;
1117
- }
1118
- .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio:hover .ant-radio-inner {
1119
- border-color: #6B7280;
1120
- }
1121
- .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7 .ant-radio:focus-visible {
1122
- outline: 2px solid #0A65E7;
1123
- }
1124
- .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7.Radio-module__disabled___AF98Z {
1125
- cursor: not-allowed;
1126
- }
1127
- .Radio-module__radio___1CPAk.Radio-module__type_unchecked___Xrb-7.Radio-module__disabled___AF98Z .ant-radio .ant-radio-inner {
1128
- border-color: #B6BAC3;
1129
- background-color: #F9FAFB;
1130
- }
1131
- .Radio-module__radio___1CPAk.Radio-module__variant_normal___FQkTC {
1132
- color: #363E4F;
1133
- font-weight: 400;
1134
- font-size: 0.875rem;
1135
- line-height: 20px;
1136
- }
1137
- .Radio-module__radio___1CPAk.Radio-module__variant_emphasized___Fgpv6 {
1138
- color: #363E4F;
1139
- font-weight: 500;
1140
- font-size: 0.875rem;
1141
- line-height: 20px;
1142
- }
1143
-
1144
1130
  /* src/atom/Tag/Tag.module.scss */
1145
1131
  .Tag-module__tag___PIkhI {
1146
1132
  border-radius: 0.25rem;
@@ -1309,16 +1295,6 @@
1309
1295
  margin-inline-start: 0.5rem;
1310
1296
  }
1311
1297
 
1312
- /* src/atom/LoadingSpinner/LoadingSpinner.module.scss */
1313
- .LoadingSpinner-module__spinnerContainer___DiPLf {
1314
- display: flex;
1315
- justify-content: center;
1316
- align-items: center;
1317
- height: 100%;
1318
- margin-top: 2rem;
1319
- margin-bottom: 2rem;
1320
- }
1321
-
1322
1298
  /* src/atom/RangePicker/RangePicker.module.scss */
1323
1299
  .RangePicker-module__range_start___hGQp-::after {
1324
1300
  content: "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itilite/lumina-ui",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Itilite Lumina Design System UI Components",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",