@dmsi/wedgekit-react 0.0.230 → 0.0.232

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.
Files changed (57) hide show
  1. package/dist/{chunk-2RUQFWER.js → chunk-2VRZB2A4.js} +1 -1
  2. package/dist/{chunk-A76MF7ZO.js → chunk-3M23BFB4.js} +2 -2
  3. package/dist/{chunk-7W4I2NK3.js → chunk-5JVMULVC.js} +12 -2
  4. package/dist/{chunk-2WRRRPEB.js → chunk-7BBXPM5C.js} +1 -1
  5. package/dist/{chunk-XOUEHNCC.js → chunk-Q7ETEWBW.js} +1 -1
  6. package/dist/chunk-SQJ7MWY7.js +493 -0
  7. package/dist/chunk-VZVPD3XK.js +1182 -0
  8. package/dist/components/CalendarRange.cjs +4066 -224
  9. package/dist/components/CalendarRange.css +4831 -0
  10. package/dist/components/CalendarRange.js +23 -1
  11. package/dist/components/DataGridCell.cjs +12 -2
  12. package/dist/components/DataGridCell.js +3 -3
  13. package/dist/components/DateInput.cjs +3682 -329
  14. package/dist/components/DateInput.css +4831 -0
  15. package/dist/components/DateInput.js +23 -5
  16. package/dist/components/DateRangeInput.cjs +3682 -329
  17. package/dist/components/DateRangeInput.css +4831 -0
  18. package/dist/components/DateRangeInput.js +23 -5
  19. package/dist/components/FilterGroup.cjs +12 -2
  20. package/dist/components/FilterGroup.js +7 -7
  21. package/dist/components/Input.cjs +12 -2
  22. package/dist/components/Input.js +1 -1
  23. package/dist/components/MobileDataGrid.js +3 -3
  24. package/dist/components/Modal.js +4 -4
  25. package/dist/components/ModalButtons.js +2 -2
  26. package/dist/components/ModalHeader.js +2 -2
  27. package/dist/components/NavigationTab.js +2 -2
  28. package/dist/components/NavigationTabs.js +2 -2
  29. package/dist/components/Notification.js +3 -3
  30. package/dist/components/OptionPill.js +2 -2
  31. package/dist/components/PDFViewer.js +6 -6
  32. package/dist/components/Password.cjs +12 -2
  33. package/dist/components/Password.js +1 -1
  34. package/dist/components/Search.cjs +12 -2
  35. package/dist/components/Search.js +2 -2
  36. package/dist/components/Select.cjs +12 -2
  37. package/dist/components/Select.js +2 -2
  38. package/dist/components/Stepper.cjs +12 -2
  39. package/dist/components/Stepper.js +4 -4
  40. package/dist/components/Time.cjs +12 -2
  41. package/dist/components/Time.js +1 -1
  42. package/dist/components/Toast.js +3 -3
  43. package/dist/components/Upload.js +3 -3
  44. package/dist/components/index.cjs +12 -2
  45. package/dist/components/index.css +3 -0
  46. package/dist/components/index.js +12 -1142
  47. package/dist/index.css +3 -0
  48. package/package.json +1 -1
  49. package/src/components/CalendarRange.tsx +316 -165
  50. package/src/components/DateInput.tsx +1 -0
  51. package/src/components/DateRangeInput.tsx +1 -0
  52. package/src/components/Input.tsx +19 -5
  53. package/dist/chunk-SE5DM2IJ.js +0 -350
  54. package/dist/{chunk-ED7FXZRX.js → chunk-BW2MWMVM.js} +3 -3
  55. package/dist/{chunk-FYW64H7N.js → chunk-JFPRYMID.js} +3 -3
  56. package/dist/{chunk-A5ROZWIH.js → chunk-R4H6D4SZ.js} +3 -3
  57. package/dist/{chunk-47KTDBGA.js → chunk-T7UCZWWK.js} +3 -3
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InputBase
3
- } from "./chunk-7W4I2NK3.js";
3
+ } from "./chunk-5JVMULVC.js";
4
4
  import {
5
5
  Icon
6
6
  } from "./chunk-UAPWR2KE.js";
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-4RJKB7LC.js";
4
4
  import {
5
5
  ModalButtons
6
- } from "./chunk-47KTDBGA.js";
6
+ } from "./chunk-T7UCZWWK.js";
7
7
  import {
8
8
  ModalContent
9
9
  } from "./chunk-SYEJVSE4.js";
10
10
  import {
11
11
  ModalHeader
12
- } from "./chunk-A5ROZWIH.js";
12
+ } from "./chunk-R4H6D4SZ.js";
13
13
  import {
14
14
  ModalScrim
15
15
  } from "./chunk-ZFOANBWG.js";
@@ -49,6 +49,7 @@ var InputBase = (_a) => {
49
49
  removeBorder,
50
50
  wrapperClassName,
51
51
  focus,
52
+ secondaryIconColor,
52
53
  fullWidth = true
53
54
  } = _b, props = __objRest(_b, [
54
55
  "id",
@@ -68,6 +69,7 @@ var InputBase = (_a) => {
68
69
  "removeBorder",
69
70
  "wrapperClassName",
70
71
  "focus",
72
+ "secondaryIconColor",
71
73
  "fullWidth"
72
74
  ]);
73
75
  const attributes = {
@@ -133,6 +135,7 @@ var InputBase = (_a) => {
133
135
  Label,
134
136
  {
135
137
  id: id ? `${id}-label` : void 0,
138
+ color: error ? "text-primary-error" : void 0,
136
139
  className: clsx(
137
140
  props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
138
141
  ),
@@ -184,11 +187,18 @@ var InputBase = (_a) => {
184
187
  )
185
188
  })
186
189
  ),
187
- after
190
+ secondaryIconColor ? /* @__PURE__ */ jsx("span", { className: "contents text-text-secondary-normal", children: after }) : after
188
191
  ]
189
192
  }
190
193
  ),
191
- caption && /* @__PURE__ */ jsx("div", { id: id ? `${id}-caption` : void 0, "data-testid": testid ? `${testid}-caption` : void 0, children: caption })
194
+ caption && /* @__PURE__ */ jsx(
195
+ "div",
196
+ {
197
+ id: id ? `${id}-caption` : void 0,
198
+ "data-testid": testid ? `${testid}-caption` : void 0,
199
+ children: caption
200
+ }
201
+ )
192
202
  ]
193
203
  }
194
204
  );
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Input
3
- } from "./chunk-7W4I2NK3.js";
3
+ } from "./chunk-5JVMULVC.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-QHHNFGEX.js";
10
10
  import {
11
11
  Search
12
- } from "./chunk-2WRRRPEB.js";
12
+ } from "./chunk-7BBXPM5C.js";
13
13
  import {
14
14
  CSS
15
15
  } from "./chunk-WVUIIBRR.js";
@@ -0,0 +1,493 @@
1
+ import {
2
+ Menu
3
+ } from "./chunk-NA3ODQCN.js";
4
+ import {
5
+ MenuOption
6
+ } from "./chunk-QHHNFGEX.js";
7
+ import {
8
+ Icon
9
+ } from "./chunk-UAPWR2KE.js";
10
+ import {
11
+ componentPadding,
12
+ layoutGap,
13
+ layoutPaddding,
14
+ typography
15
+ } from "./chunk-RDLEIAQU.js";
16
+ import {
17
+ __objRest,
18
+ __spreadProps,
19
+ __spreadValues
20
+ } from "./chunk-BBZEL7EG.js";
21
+
22
+ // src/components/CalendarRange.tsx
23
+ import clsx from "clsx";
24
+ import React, { useEffect, useRef, useState } from "react";
25
+ import { Temporal } from "@js-temporal/polyfill";
26
+ import { jsx, jsxs } from "react/jsx-runtime";
27
+ function isWeekend(date) {
28
+ return date.dayOfWeek === 6 || date.dayOfWeek === 7;
29
+ }
30
+ function DateCell(_a) {
31
+ var _b = _a, {
32
+ date,
33
+ isInMonth,
34
+ isToday,
35
+ isSelected,
36
+ inRange,
37
+ isDisabled,
38
+ isRangeStart,
39
+ isRangeEnd,
40
+ onClick,
41
+ onMouseEnter,
42
+ onMouseLeave,
43
+ cellPadding = "",
44
+ isRangeDisabled = false,
45
+ id,
46
+ testid
47
+ } = _b, props = __objRest(_b, [
48
+ "date",
49
+ "isInMonth",
50
+ "isToday",
51
+ "isSelected",
52
+ "inRange",
53
+ "isDisabled",
54
+ "isRangeStart",
55
+ "isRangeEnd",
56
+ "onClick",
57
+ "onMouseEnter",
58
+ "onMouseLeave",
59
+ "cellPadding",
60
+ "isRangeDisabled",
61
+ "id",
62
+ "testid"
63
+ ]);
64
+ return /* @__PURE__ */ jsx(
65
+ "span",
66
+ __spreadProps(__spreadValues({}, props), {
67
+ id,
68
+ "data-testid": testid,
69
+ className: clsx(
70
+ "flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
71
+ typography.caption,
72
+ cellPadding,
73
+ !isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
74
+ !isInMonth && "border-transparent",
75
+ // Today: subtle border ring
76
+ isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
77
+ // Selected: Figma blue, white text, strong shadow
78
+ isSelected && "bg-action-400 text-white border-action-400 z-10",
79
+ !isSelected && !inRange && "rounded-base",
80
+ // When range is disabled OR when only 'from' is selected (no range yet), apply rounded corners
81
+ (isRangeDisabled || !inRange && isSelected) && "rounded-base",
82
+ inRange && isSelected && "hover:border-action-500",
83
+ // In range: Figma light blue background
84
+ inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
85
+ // Disabled: Figma gray, no pointer, no hover
86
+ isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
87
+ "text-text-primary-normal cursor-pointer",
88
+ // Figma hover: blue bg, blue text (or red text if selected)
89
+ isSelected ? "hover:bg-background-action-primary-hover hover:text-white" : "hover:bg-action-100 hover:text-text-action-primary-hover",
90
+ // Figma active: darker blue bg, white text
91
+ "active:bg-action-300 active:text-white",
92
+ // Figma focus: ring
93
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
94
+ ],
95
+ isRangeStart && "rounded-l",
96
+ isRangeEnd && "rounded-r"
97
+ ),
98
+ tabIndex: isDisabled ? -1 : 0,
99
+ "aria-disabled": isDisabled,
100
+ onClick: () => !isDisabled && isInMonth && onClick(),
101
+ onMouseEnter: () => isInMonth && onMouseEnter(),
102
+ onMouseLeave: () => isInMonth && onMouseLeave(),
103
+ children: isInMonth ? date.day : ""
104
+ })
105
+ );
106
+ }
107
+ function CalendarRange({
108
+ from,
109
+ to,
110
+ onChange,
111
+ isDateAvailable,
112
+ mode = "double",
113
+ cardStyle = false,
114
+ disableRange = false,
115
+ id,
116
+ testid
117
+ }) {
118
+ const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
119
+ const parseDate = (d) => {
120
+ if (!d) {
121
+ return void 0;
122
+ }
123
+ try {
124
+ if (typeof d === "number") {
125
+ return Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
126
+ }
127
+ if (typeof d === "string") {
128
+ return Temporal.PlainDate.from(d);
129
+ }
130
+ return void 0;
131
+ } catch (error) {
132
+ console.error("Invalid date format:", d, error);
133
+ return Temporal.Now.plainDateISO();
134
+ }
135
+ };
136
+ const fromDate = parseDate(from);
137
+ const toDate = parseDate(to);
138
+ const today = Temporal.Now.plainDateISO();
139
+ const [baseMonth, setBaseMonth] = useState(
140
+ fromDate != null ? fromDate : today.with({ day: 1 })
141
+ );
142
+ const [selecting, setSelecting] = useState("from");
143
+ const [pendingFrom, setPendingFrom] = useState(void 0);
144
+ const [hoveredDate, setHoveredDate] = useState(void 0);
145
+ useEffect(() => {
146
+ if (fromDate) {
147
+ setBaseMonth(fromDate.with({ day: 1 }));
148
+ } else if (toDate) {
149
+ setBaseMonth(toDate.with({ day: 1 }));
150
+ }
151
+ }, [from, to]);
152
+ useEffect(() => {
153
+ if (fromDate && toDate) {
154
+ setSelecting("from");
155
+ setPendingFrom(void 0);
156
+ setHoveredDate(void 0);
157
+ }
158
+ }, [from, to]);
159
+ function getMonthData(monthOffset) {
160
+ const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
161
+ const days = monthDate.daysInMonth;
162
+ const firstDayOffset = monthDate.dayOfWeek % 7;
163
+ return {
164
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
165
+ year: monthDate.year,
166
+ days,
167
+ firstDayOffset,
168
+ date: monthDate
169
+ };
170
+ }
171
+ function getMonthDataWith(monthOffset) {
172
+ const monthDate = baseMonth.with({ month: monthOffset }).with({ day: 1 });
173
+ const days = monthDate.daysInMonth;
174
+ const firstDayOffset = monthDate.dayOfWeek % 7;
175
+ return {
176
+ name: monthDate.toLocaleString("en-US", { month: "long" }),
177
+ year: monthDate.year,
178
+ days,
179
+ firstDayOffset,
180
+ date: monthDate
181
+ };
182
+ }
183
+ function handleDayClick(date) {
184
+ if (isDateAvailable && !isDateAvailable(date)) return;
185
+ if (mode === "single" && disableRange) {
186
+ if (onChange) {
187
+ onChange(date.toString(), date.toString());
188
+ }
189
+ return;
190
+ }
191
+ if (selecting === "from") {
192
+ setPendingFrom(date);
193
+ setSelecting("to");
194
+ setHoveredDate(void 0);
195
+ } else if (pendingFrom) {
196
+ if (onChange) {
197
+ const [start, end] = Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
198
+ onChange(start.toString(), end.toString());
199
+ }
200
+ setPendingFrom(void 0);
201
+ setSelecting("from");
202
+ setHoveredDate(void 0);
203
+ }
204
+ }
205
+ function isInRange(date) {
206
+ if (mode === "single" && disableRange) {
207
+ return false;
208
+ }
209
+ if (pendingFrom && selecting === "to" && hoveredDate) {
210
+ const [start, end] = Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
211
+ return Temporal.PlainDate.compare(date, start) >= 0 && Temporal.PlainDate.compare(date, end) <= 0;
212
+ }
213
+ if (!pendingFrom && fromDate && toDate) {
214
+ return Temporal.PlainDate.compare(date, fromDate) >= 0 && Temporal.PlainDate.compare(date, toDate) <= 0;
215
+ }
216
+ return false;
217
+ }
218
+ return /* @__PURE__ */ jsx(
219
+ "div",
220
+ {
221
+ id,
222
+ "data-testid": testid,
223
+ className: clsx(
224
+ "relative bg-background-grouped-primary-normal rounded-base w-fit",
225
+ layoutPaddding,
226
+ layoutGap,
227
+ cardStyle && "shadow-4",
228
+ // baseTransition,
229
+ "overflow-hidden"
230
+ ),
231
+ children: /* @__PURE__ */ jsx(
232
+ "div",
233
+ {
234
+ className: clsx(
235
+ "flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
236
+ layoutGap
237
+ ),
238
+ children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
239
+ return /* @__PURE__ */ jsx(
240
+ CalendarPane,
241
+ {
242
+ getMonthData,
243
+ getMonthDataWith,
244
+ offset,
245
+ idx,
246
+ id,
247
+ testid,
248
+ baseMonth,
249
+ setBaseMonth,
250
+ mode,
251
+ pendingFrom,
252
+ weekDays,
253
+ fromDate,
254
+ toDate,
255
+ isDateAvailable,
256
+ disableRange,
257
+ hoveredDate,
258
+ isInRange,
259
+ today,
260
+ setHoveredDate,
261
+ handleDayClick
262
+ },
263
+ idx
264
+ );
265
+ })
266
+ }
267
+ )
268
+ }
269
+ );
270
+ }
271
+ function CalendarPane({
272
+ getMonthData,
273
+ getMonthDataWith,
274
+ offset,
275
+ idx,
276
+ id,
277
+ testid,
278
+ baseMonth,
279
+ setBaseMonth,
280
+ mode,
281
+ pendingFrom,
282
+ weekDays,
283
+ fromDate,
284
+ toDate,
285
+ isDateAvailable,
286
+ disableRange,
287
+ hoveredDate,
288
+ isInRange,
289
+ today,
290
+ setHoveredDate,
291
+ handleDayClick
292
+ }) {
293
+ const months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
294
+ const years = Array.from({ length: 100 }).map(
295
+ (_, i) => baseMonth.year - 50 + i
296
+ );
297
+ const [monthMenuOpen, setMonthMenuOpen] = useState(false);
298
+ const [yearMenuOpen, setYearMenuOpen] = useState(false);
299
+ const monthMenuRef = useRef(null);
300
+ const yearMenuRef = useRef(null);
301
+ const month = getMonthData(offset);
302
+ const totalCells = 42;
303
+ const emptyCells = month.firstDayOffset;
304
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
305
+ /* @__PURE__ */ jsxs(
306
+ "div",
307
+ {
308
+ className: clsx("flex flex-col"),
309
+ children: [
310
+ /* @__PURE__ */ jsxs(
311
+ "div",
312
+ {
313
+ className: clsx(
314
+ "flex flex-row items-center justify-between",
315
+ typography.label,
316
+ "text-text-action-primary-normal"
317
+ ),
318
+ children: [
319
+ idx === 0 ? /* @__PURE__ */ jsx(
320
+ "button",
321
+ {
322
+ id: id ? `${id}-prev-month-button` : void 0,
323
+ "data-testid": testid ? `${testid}-prev-month-button` : void 0,
324
+ type: "button",
325
+ className: clsx(
326
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
327
+ componentPadding
328
+ ),
329
+ "aria-label": "Previous month",
330
+ onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
331
+ children: /* @__PURE__ */ jsx(Icon, { name: "chevron_left", size: 24 })
332
+ }
333
+ ) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "mr-1") }),
334
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-desktop-compact-component-padding", children: [
335
+ /* @__PURE__ */ jsx(
336
+ "button",
337
+ {
338
+ ref: (el) => {
339
+ monthMenuRef.current = el;
340
+ },
341
+ type: "button",
342
+ onClick: () => {
343
+ setMonthMenuOpen(true);
344
+ setYearMenuOpen(false);
345
+ },
346
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
347
+ children: month.name
348
+ }
349
+ ),
350
+ /* @__PURE__ */ jsx(
351
+ Menu,
352
+ {
353
+ show: monthMenuOpen,
354
+ positionTo: monthMenuRef,
355
+ setShow: () => setMonthMenuOpen(false),
356
+ children: months.map((x) => [x, getMonthDataWith(x + 1)]).map(([x, m]) => /* @__PURE__ */ jsx(
357
+ MenuOption,
358
+ {
359
+ selected: baseMonth.month === x + 1,
360
+ onClick: () => {
361
+ setBaseMonth(baseMonth.with({ month: x + 1 }));
362
+ setMonthMenuOpen(false);
363
+ },
364
+ children: m.name
365
+ },
366
+ m.name
367
+ ))
368
+ }
369
+ ),
370
+ /* @__PURE__ */ jsx(
371
+ "button",
372
+ {
373
+ ref: (el) => {
374
+ yearMenuRef.current = el;
375
+ },
376
+ type: "button",
377
+ onClick: () => {
378
+ setYearMenuOpen(true);
379
+ setMonthMenuOpen(false);
380
+ },
381
+ className: "font-semibold text-text-action-primary-normal text-[14px] py-[2px] truncate",
382
+ children: month.year
383
+ }
384
+ ),
385
+ /* @__PURE__ */ jsx(
386
+ Menu,
387
+ {
388
+ show: yearMenuOpen,
389
+ positionTo: yearMenuRef,
390
+ setShow: () => setYearMenuOpen(false),
391
+ children: years.map((y) => /* @__PURE__ */ jsx(
392
+ MenuOption,
393
+ {
394
+ selected: baseMonth.year === y,
395
+ onClick: () => {
396
+ setBaseMonth(baseMonth.with({ year: y }));
397
+ setYearMenuOpen(false);
398
+ },
399
+ children: y
400
+ },
401
+ y
402
+ ))
403
+ }
404
+ )
405
+ ] }),
406
+ (mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ jsx(
407
+ "button",
408
+ {
409
+ id: id ? `${id}-next-month-button` : void 0,
410
+ "data-testid": testid ? `${testid}-next-month-button` : void 0,
411
+ type: "button",
412
+ className: clsx(
413
+ "flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-action-primary-normal",
414
+ componentPadding
415
+ ),
416
+ "aria-label": "Next month",
417
+ onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
418
+ children: /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 24 })
419
+ }
420
+ ) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "ml-1") })
421
+ ]
422
+ }
423
+ ),
424
+ /* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7"), children: weekDays.map((d) => /* @__PURE__ */ jsx(
425
+ "span",
426
+ {
427
+ className: clsx(
428
+ typography.caption,
429
+ "text-text-secondary-normal text-center",
430
+ "w-10"
431
+ ),
432
+ children: d
433
+ },
434
+ d
435
+ )) }),
436
+ /* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
437
+ const day = i - emptyCells + 1;
438
+ const date = month.date.with({ day: 1 }).add({
439
+ days: i - emptyCells
440
+ });
441
+ const isInMonth = day > 0 && day <= month.days;
442
+ const isToday = isInMonth && date.equals(today);
443
+ const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
444
+ const inRange = isInMonth && isInRange(date);
445
+ const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
446
+ const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
447
+ const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
448
+ const isRangeStart = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
449
+ const isRangeEnd = mode === "single" && disableRange ? false : !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
450
+ return /* @__PURE__ */ jsx(
451
+ DateCell,
452
+ {
453
+ id: id ? `${id}-date-${date.toString()}` : void 0,
454
+ testid: testid ? `${testid}-date-${date.toString()}` : void 0,
455
+ date,
456
+ isInMonth: !!isInMonth,
457
+ isToday: !!isToday,
458
+ isSelected: !!isSelected,
459
+ inRange: !!inRange,
460
+ isDisabled: !!isDisabled,
461
+ onClick: () => handleDayClick(date),
462
+ onMouseEnter: () => setHoveredDate(date),
463
+ onMouseLeave: () => setHoveredDate(void 0),
464
+ isRangeStart: !!isRangeStart,
465
+ isRangeEnd: !!isRangeEnd,
466
+ isRangeDisabled: mode === "single" && disableRange,
467
+ cellPadding: componentPadding
468
+ },
469
+ i
470
+ );
471
+ }) })
472
+ ]
473
+ }
474
+ ),
475
+ mode === "double" && idx === 0 && /* @__PURE__ */ jsx(
476
+ "div",
477
+ {
478
+ className: clsx(
479
+ "self-stretch bg-border-primary-normal rounded-base",
480
+ // 1px width, full height, matches Figma divider
481
+ "w-px"
482
+ )
483
+ }
484
+ )
485
+ ] }, month.name + month.year);
486
+ }
487
+ var CalendarRange_default = CalendarRange;
488
+
489
+ export {
490
+ isWeekend,
491
+ CalendarRange,
492
+ CalendarRange_default
493
+ };