@konstructio/ui 0.1.6 → 0.1.8

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 (70) hide show
  1. package/dist/check-Bekes_eB.js +14 -0
  2. package/dist/components/CopyButton/CopyButton.js +12 -12
  3. package/dist/components/DateRangePicker/DateRangePicker.js +58 -57
  4. package/dist/components/DateRangePicker/DateRangePicker.variants.js +1 -0
  5. package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +55 -54
  6. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +17 -17
  7. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +15 -14
  8. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  9. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +74 -55
  10. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  11. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  12. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  13. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
  14. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +38 -38
  15. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  16. package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -56
  17. package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +21 -14
  18. package/dist/components/DateRangePicker/components/RightPanel/RightPanel.js +41 -25
  19. package/dist/components/DateRangePicker/contexts/date-range-picker/date-range-picker.provider.js +15 -14
  20. package/dist/components/Filter/Filter.variants.js +12 -7
  21. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.js +39 -0
  22. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.js +17 -14
  23. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.js +48 -27
  24. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Trigger/Trigger.js +13 -12
  25. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Wrapper/Wrapper.js +53 -17
  26. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.provider.js +87 -78
  27. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +44 -20
  28. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +58 -50
  29. package/dist/components/Filter/hooks/index.js +5 -2
  30. package/dist/components/Filter/hooks/useFilterSheet.js +6 -0
  31. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +18 -18
  32. package/dist/components/Sheet/Sheet.js +143 -139
  33. package/dist/components/Sheet/components/SheetStep/SheetStep.js +57 -55
  34. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
  35. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +42 -42
  36. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +25 -2
  37. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +1 -1
  38. package/dist/components/Tabs/Tabs.variants.js +4 -7
  39. package/dist/components/Tabs/components/Trigger.js +5 -5
  40. package/dist/components/Tooltip/Tooltip.js +17 -17
  41. package/dist/components/VirtualizedTable/components/Filter/Filter.js +40 -39
  42. package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
  43. package/dist/components/VirtualizedTable/constants/index.js +6 -5
  44. package/dist/components/VirtualizedTable/constants/responsive.js +2 -1
  45. package/dist/{constants-YCGllWdf.js → constants-Cw00eFTQ.js} +13 -13
  46. package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +6 -0
  47. package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.types.d.ts +2 -0
  48. package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.types.d.ts +2 -0
  49. package/dist/lib/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.d.ts +1 -1
  50. package/dist/lib/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.d.ts +3 -1
  51. package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.context.d.ts +2 -0
  52. package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.types.d.ts +1 -0
  53. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.d.ts +3 -0
  54. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.types.d.ts +3 -0
  55. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.d.ts +2 -1
  56. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.types.d.ts +4 -0
  57. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.d.ts +2 -1
  58. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.types.d.ts +4 -0
  59. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.types.d.ts +2 -0
  60. package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +8 -0
  61. package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
  62. package/dist/lib/components/Filter/hooks/useFilterSheet.d.ts +2 -0
  63. package/dist/lib/components/Sheet/Sheet.types.d.ts +12 -0
  64. package/dist/lib/components/Sheet/components/SheetStep/SheetStep.d.ts +21 -3
  65. package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +1 -0
  66. package/dist/package.json +18 -18
  67. package/dist/styles.css +1 -1
  68. package/dist/ui/utilities.css +23 -0
  69. package/package.json +18 -18
  70. package/dist/StepIndicatorContent-C6MILk4c.js +0 -36
@@ -1,56 +1,74 @@
1
- import { t as n } from "../../../../../../utils-DnIJruo0.js";
2
- import { calendarGridContainerVariants as P, calendarPanelVariants as W } from "../../CalendarPanel.variants.js";
3
- import { useTogetherCarousel as z } from "../../hooks/useTogetherCarousel.js";
4
- import { CalendarDivider as L } from "../CalendarDivider/CalendarDivider.js";
5
- import { CalendarMonth as R } from "../CalendarMonth/CalendarMonth.js";
6
- import { NavigationButton as d } from "../NavigationButton/NavigationButton.js";
7
- import { jsx as e, jsxs as S } from "react/jsx-runtime";
8
- import { motion as V } from "motion/react";
9
- var A = ({ className: m, calendarWidth: h = 550, ariaLabelCalendar: s = "Date range picker calendar", ariaLabelPrevMonth: c = "Previous month", ariaLabelNextMonth: f = "Next month", classNames: a, range: u, onRangeSelect: p, disabled: i, disabledMatcher: v, showOutsideDays: g, hideDisabledNavigation: o, canNavigatePrev: C, canNavigateNext: T, carouselProps: r }) => {
10
- const { carouselRef: b, isAnimating: l, enableTransition: k, animateTransform: x, calendarHeight: D, carouselTotalWidth: y, monthsToRender: M, handlePrevMonth: N, handleNextMonth: B, getTransform: w } = z(r), $ = (t) => {
11
- t && p({
12
- from: t.from,
13
- to: t.to
1
+ import { t as a } from "../../../../../../utils-DnIJruo0.js";
2
+ import { calendarGridContainerVariants as O, calendarPanelVariants as P } from "../../CalendarPanel.variants.js";
3
+ import "../../../../../../constants-Cw00eFTQ.js";
4
+ import { useTogetherCarousel as E } from "../../hooks/useTogetherCarousel.js";
5
+ import { CalendarDivider as G } from "../CalendarDivider/CalendarDivider.js";
6
+ import { CalendarMonth as I } from "../CalendarMonth/CalendarMonth.js";
7
+ import { NavigationButton as v } from "../NavigationButton/NavigationButton.js";
8
+ import { useLayoutEffect as V, useRef as _, useState as A } from "react";
9
+ import { jsx as n, jsxs as F } from "react/jsx-runtime";
10
+ import { motion as Y } from "motion/react";
11
+ var q = ({ className: p, calendarWidth: g = 550, fluid: r = !1, ariaLabelCalendar: b = "Date range picker calendar", ariaLabelPrevMonth: C = "Previous month", ariaLabelNextMonth: T = "Next month", classNames: t, range: y, onRangeSelect: D, disabled: i, disabledMatcher: M, showOutsideDays: N, hideDisabledNavigation: s, canNavigatePrev: W, canNavigateNext: k, carouselProps: l }) => {
12
+ const d = _(null), [m, c] = A(null);
13
+ V(() => {
14
+ const e = d.current;
15
+ if (!r || !e) {
16
+ c(null);
17
+ return;
18
+ }
19
+ const o = () => c(e.clientWidth);
20
+ if (o(), typeof ResizeObserver > "u") return;
21
+ const f = new ResizeObserver(o);
22
+ return f.observe(e), () => f.disconnect();
23
+ }, [r]);
24
+ const h = r && m ? m : 259, { carouselRef: x, isAnimating: u, enableTransition: w, animateTransform: R, calendarHeight: B, carouselTotalWidth: z, monthsToRender: L, handlePrevMonth: S, handleNextMonth: $, getTransform: j } = E({
25
+ ...l,
26
+ monthWidth: h
27
+ }), H = (e) => {
28
+ e && D({
29
+ from: e.from,
30
+ to: e.to
14
31
  });
15
32
  };
16
- return /* @__PURE__ */ e("div", {
17
- className: n(W({ className: m }), a?.root),
18
- children: /* @__PURE__ */ S("div", {
19
- className: n(P(), "overflow-hidden relative justify-start!", a?.gridContainer),
20
- style: { width: h },
33
+ return /* @__PURE__ */ n("div", {
34
+ className: a(P({ className: p }), t?.root),
35
+ children: /* @__PURE__ */ F("div", {
36
+ ref: d,
37
+ className: a(O(), "overflow-hidden relative justify-start!", r && "w-full", t?.gridContainer),
38
+ style: { width: r ? void 0 : g },
21
39
  children: [
22
- /* @__PURE__ */ e(d, {
40
+ /* @__PURE__ */ n(v, {
23
41
  direction: "prev",
24
- onClick: N,
42
+ onClick: S,
25
43
  disabled: i,
26
- isAnimating: l,
27
- canNavigate: C,
28
- hideWhenDisabled: o,
29
- className: n("absolute left-0 top-3 z-10", a?.navButton),
30
- disabledClassName: a?.navButtonDisabled,
31
- ariaLabel: c
44
+ isAnimating: u,
45
+ canNavigate: W,
46
+ hideWhenDisabled: s,
47
+ className: a("absolute left-0 top-3 z-10", t?.navButton),
48
+ disabledClassName: t?.navButtonDisabled,
49
+ ariaLabel: C
32
50
  }),
33
- /* @__PURE__ */ e(d, {
51
+ /* @__PURE__ */ n(v, {
34
52
  direction: "next",
35
- onClick: B,
53
+ onClick: $,
36
54
  disabled: i,
37
- isAnimating: l,
38
- canNavigate: T,
39
- hideWhenDisabled: o,
40
- className: n("absolute right-0 top-3 z-10", a?.navButton),
41
- disabledClassName: a?.navButtonDisabled,
42
- ariaLabel: f
55
+ isAnimating: u,
56
+ canNavigate: k,
57
+ hideWhenDisabled: s,
58
+ className: a("absolute right-0 top-3 z-10", t?.navButton),
59
+ disabledClassName: t?.navButtonDisabled,
60
+ ariaLabel: T
43
61
  }),
44
- /* @__PURE__ */ e(L, { className: a?.divider }),
45
- /* @__PURE__ */ e(V.div, {
46
- ref: b,
47
- className: n("flex gap-8", k && x && "konstruct-drp-carousel-transition"),
62
+ /* @__PURE__ */ n(G, { className: t?.divider }),
63
+ /* @__PURE__ */ n(Y.div, {
64
+ ref: x,
65
+ className: a("flex gap-8", w && R && "konstruct-drp-carousel-transition"),
48
66
  role: "application",
49
- "aria-label": s,
67
+ "aria-label": b,
50
68
  initial: !1,
51
- animate: { height: D },
69
+ animate: { height: B },
52
70
  transition: {
53
- duration: r.animationDuration / 1e3,
71
+ duration: l.animationDuration / 1e3,
54
72
  ease: [
55
73
  0.25,
56
74
  0.1,
@@ -59,29 +77,30 @@ var A = ({ className: m, calendarWidth: h = 550, ariaLabelCalendar: s = "Date ra
59
77
  ]
60
78
  },
61
79
  style: {
62
- "--konstruct-drp-animation-duration": `${r.animationDuration}ms`,
63
- width: y,
64
- transform: w(),
80
+ "--konstruct-drp-animation-duration": `${l.animationDuration}ms`,
81
+ width: z,
82
+ transform: j(),
65
83
  willChange: "transform"
66
84
  },
67
- children: M.map((t, j) => /* @__PURE__ */ e(R, {
68
- month: t,
69
- range: u,
70
- onRangeSelect: $,
85
+ children: L.map((e, o) => /* @__PURE__ */ n(I, {
86
+ month: e,
87
+ monthWidth: h,
88
+ range: y,
89
+ onRangeSelect: H,
71
90
  disabled: i,
72
- disabledMatcher: v,
73
- showOutsideDays: g,
91
+ disabledMatcher: M,
92
+ showOutsideDays: N,
74
93
  classNames: {
75
- monthTitle: a?.monthTitle,
76
- dayPicker: a?.dayPicker
94
+ monthTitle: t?.monthTitle,
95
+ dayPicker: t?.dayPicker
77
96
  }
78
- }, `${t.getFullYear()}-${t.getMonth()}-${j}`))
97
+ }, `${e.getFullYear()}-${e.getMonth()}-${o}`))
79
98
  })
80
99
  ]
81
100
  })
82
101
  });
83
102
  };
84
- A.displayName = "TogetherModeCalendar";
103
+ q.displayName = "TogetherModeCalendar";
85
104
  export {
86
- A as TogetherModeCalendar
105
+ q as TogetherModeCalendar
87
106
  };
@@ -1,4 +1,4 @@
1
- import { s as e } from "../../../../../constants-YCGllWdf.js";
1
+ import { s as e } from "../../../../../constants-Cw00eFTQ.js";
2
2
  export {
3
3
  e as createDayPickerClassNames
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { getMonthName as E } from "../../../utils/validation/validation.js";
2
- import { a as s, i as _, n as r, o as T, r as e, s as o, t } from "../../../../../constants-YCGllWdf.js";
2
+ import { a as s, i as _, n as r, o as T, r as e, s as o, t } from "../../../../../constants-Cw00eFTQ.js";
3
3
  export {
4
4
  t as GAP_WIDTH,
5
5
  r as MONTH_HEADER_HEIGHT,
@@ -1,5 +1,5 @@
1
1
  import { getMonthName as t } from "../../../utils/validation/validation.js";
2
- import { a as o, i as r, n as s, o as H, r as E, s as m, t as _ } from "../../../../../constants-YCGllWdf.js";
2
+ import { a as o, i as r, n as s, o as H, r as E, s as m, t as _ } from "../../../../../constants-Cw00eFTQ.js";
3
3
  import { calculateCalendarHeight as T, getNextMonth as i, getPrevMonth as I, getWeeksInMonth as M } from "../utils/index.js";
4
4
  import { useTogetherCarousel as N } from "./useTogetherCarousel.js";
5
5
  import { useIndependentCarousel as h } from "./useIndependentCarousel.js";
@@ -1,4 +1,4 @@
1
- import { r as W } from "../../../../../constants-YCGllWdf.js";
1
+ import { r as W } from "../../../../../constants-Cw00eFTQ.js";
2
2
  import { calculateCalendarHeight as j, getNextMonth as m, getPrevMonth as h, getWeeksInMonth as k } from "../utils/index.js";
3
3
  import { useEffect as g, useMemo as p, useRef as L, useState as i } from "react";
4
4
  var Q = ({ displayedMonths: u, animationDuration: F, navigationMode: I }) => {
@@ -1,32 +1,32 @@
1
- import { r as L } from "../../../../../constants-YCGllWdf.js";
2
- import { calculateCalendarHeight as X, getNextMonth as T, getPrevMonth as g, getWeeksInMonth as $ } from "../utils/index.js";
3
- import { useEffect as H, useMemo as j, useRef as E, useState as a } from "react";
4
- var Z = ({ displayedMonths: l, animationDuration: I, disabled: N, canNavigatePrev: S, canNavigateNext: b, navigationMode: W, numberOfMonths: F = 2, navigatePrevMonth: p, navigateNextMonth: v }) => {
5
- const [n, c] = a(null), [e, u] = a(!1), [o, i] = a(!1), [C, P] = a(!0), [s, R] = a(l), f = E(null), _ = E(!0), q = 291, k = g(g(s[0])), M = g(s[0]), h = s[0], m = s[1], d = T(s[1]), G = T(T(s[1])), O = j(() => {
1
+ import { r as X } from "../../../../../constants-Cw00eFTQ.js";
2
+ import { calculateCalendarHeight as $, getNextMonth as T, getPrevMonth as g, getWeeksInMonth as j } from "../utils/index.js";
3
+ import { useEffect as I, useMemo as z, useRef as S, useState as a } from "react";
4
+ var y = ({ displayedMonths: l, animationDuration: N, disabled: F, canNavigatePrev: b, canNavigateNext: p, navigationMode: P, numberOfMonths: R = 2, monthWidth: W = 259, navigatePrevMonth: v, navigateNextMonth: C }) => {
5
+ const [n, c] = a(null), [e, u] = a(!1), [o, i] = a(!1), [k, _] = a(!0), [s, q] = a(l), f = S(null), D = S(!0), M = W + 32, G = g(g(s[0])), x = g(s[0]), m = s[0], h = s[1], d = T(s[1]), O = T(T(s[1])), w = z(() => {
6
6
  let t;
7
- e && n === "left" ? t = [m, d] : e && n === "right" ? t = [M, h] : t = [h, m];
8
- const r = t.slice(0, F), A = Math.max(...r.map($));
9
- return X(A);
7
+ e && n === "left" ? t = [h, d] : e && n === "right" ? t = [x, m] : t = [m, h];
8
+ const r = t.slice(0, R), H = Math.max(...r.map(j));
9
+ return $(H);
10
10
  }, [
11
11
  e,
12
12
  n,
13
- h,
14
13
  m,
14
+ h,
15
15
  d,
16
- M,
17
- F
18
- ]), w = 6 * 259 + 160, x = -2 * 291;
19
- return H(() => {
20
- if (W !== "independent") {
21
- if (_.current) {
22
- _.current = !1;
16
+ x,
17
+ R
18
+ ]), L = 6 * W + 160, A = -2 * M;
19
+ return I(() => {
20
+ if (P !== "independent") {
21
+ if (D.current) {
22
+ D.current = !1;
23
23
  return;
24
24
  }
25
25
  if (!e) {
26
26
  const t = s[0].getTime(), r = l[0].getTime();
27
27
  if (t !== r) {
28
- const A = r - t, D = Math.round(A / L);
29
- Math.abs(D) === 1 ? (c(D > 0 ? "left" : "right"), u(!0), i(!1)) : R(l);
28
+ const H = r - t, E = Math.round(H / X);
29
+ Math.abs(E) === 1 ? (c(E > 0 ? "left" : "right"), u(!0), i(!1)) : q(l);
30
30
  }
31
31
  }
32
32
  }
@@ -34,8 +34,8 @@ var Z = ({ displayedMonths: l, animationDuration: I, disabled: N, canNavigatePre
34
34
  l,
35
35
  s,
36
36
  e,
37
- W
38
- ]), H(() => {
37
+ P
38
+ ]), I(() => {
39
39
  e && !o && n && (f.current && f.current.offsetHeight, requestAnimationFrame(() => {
40
40
  i(!0);
41
41
  }));
@@ -43,51 +43,51 @@ var Z = ({ displayedMonths: l, animationDuration: I, disabled: N, canNavigatePre
43
43
  e,
44
44
  o,
45
45
  n
46
- ]), H(() => {
46
+ ]), I(() => {
47
47
  if (e && o) {
48
48
  const t = setTimeout(() => {
49
- P(!1), requestAnimationFrame(() => {
50
- f.current && f.current.offsetHeight, R((r) => n === "left" ? [r[1], T(r[1])] : [g(r[0]), r[0]]), u(!1), c(null), i(!1), requestAnimationFrame(() => {
49
+ _(!1), requestAnimationFrame(() => {
50
+ f.current && f.current.offsetHeight, q((r) => n === "left" ? [r[1], T(r[1])] : [g(r[0]), r[0]]), u(!1), c(null), i(!1), requestAnimationFrame(() => {
51
51
  requestAnimationFrame(() => {
52
- P(!0);
52
+ _(!0);
53
53
  });
54
54
  });
55
55
  });
56
- }, I);
56
+ }, N);
57
57
  return () => clearTimeout(t);
58
58
  }
59
59
  }, [
60
60
  e,
61
61
  o,
62
- I,
62
+ N,
63
63
  n
64
64
  ]), {
65
65
  carouselRef: f,
66
66
  isAnimating: e,
67
- enableTransition: C,
67
+ enableTransition: k,
68
68
  animateTransform: o,
69
- calendarHeight: O,
70
- carouselTotalWidth: w,
69
+ calendarHeight: w,
70
+ carouselTotalWidth: L,
71
71
  monthsToRender: [
72
- k,
73
- M,
74
- h,
72
+ G,
73
+ x,
75
74
  m,
75
+ h,
76
76
  d,
77
- G
77
+ O
78
78
  ],
79
79
  handlePrevMonth: () => {
80
- e || N || !S || (c("right"), u(!0), i(!1), p());
80
+ e || F || !b || (c("right"), u(!0), i(!1), v());
81
81
  },
82
82
  handleNextMonth: () => {
83
- e || N || !b || (c("left"), u(!0), i(!1), v());
83
+ e || F || !p || (c("left"), u(!0), i(!1), C());
84
84
  },
85
85
  getTransform: () => {
86
- let t = x;
87
- return e && o && (n === "left" ? t = x - q : n === "right" && (t = x + q)), `translateX(${t}px)`;
86
+ let t = A;
87
+ return e && o && (n === "left" ? t = A - M : n === "right" && (t = A + M)), `translateX(${t}px)`;
88
88
  }
89
89
  };
90
90
  };
91
91
  export {
92
- Z as useTogetherCarousel
92
+ y as useTogetherCarousel
93
93
  };
@@ -1,4 +1,4 @@
1
- import "../../../../../constants-YCGllWdf.js";
1
+ import "../../../../../constants-Cw00eFTQ.js";
2
2
  var E = (t) => {
3
3
  const e = t.getFullYear(), a = t.getMonth(), n = new Date(e, a, 1), r = new Date(e, a + 1, 0), o = n.getDay() + r.getDate();
4
4
  return Math.ceil(o / 7);
@@ -1,70 +1,74 @@
1
- import { t as w } from "../../../../utils-DnIJruo0.js";
2
- import { useDateRangePicker as H } from "../../contexts/date-range-picker/date-range-picker.hook.js";
3
- import { EndInputFields as P } from "./components/EndInputFields/EndInputFields.js";
4
- import { StartInputFields as R } from "./components/StartInputFields/StartInputFields.js";
5
- import { dateTimeInputsVariants as $ } from "./DateTimeInputs.variants.js";
6
- import { useDateTimeInputs as q } from "./hooks/useDateTimeInputs.js";
7
- import { Fragment as M, jsx as e, jsxs as u } from "react/jsx-runtime";
8
- var O = ({ autoComplete: r, className: s, labelStartDate: D = "Start date", labelEndDate: h = "End date", labelTime: d = "Time", requiredDates: i = !1, ariaLabelStartDate: p = "Start date", ariaLabelEndDate: c = "End date", errorInvalidDate: g = "Invalid date", errorDateNotAvailable: T = "Date is not available", classNames: a }) => {
9
- const { numberOfMonths: f } = H(), { timeFormat: o, showTime: t, name: n, disabled: l, time: m, startDateValue: E, startDateError: V, handleStartDateFocus: F, handleStartDateChange: C, handleStartDateBlur: I, handleStartTimeChange: S, endDateValue: b, endDateError: v, handleEndDateFocus: y, handleEndDateChange: B, handleEndDateBlur: L, handleEndTimeChange: k, startHiddenValue: x, endHiddenValue: j } = q({
10
- errorInvalidDate: g,
11
- errorDateNotAvailable: T
12
- });
13
- return /* @__PURE__ */ u("div", {
14
- className: w($({
15
- layout: f === 2 ? "row" : t ? "stacked" : "compact",
16
- className: s
17
- }), a?.root),
1
+ import { t as n } from "../../../../utils-DnIJruo0.js";
2
+ import { useDateRangePicker as W } from "../../contexts/date-range-picker/date-range-picker.hook.js";
3
+ import { EndInputFields as $ } from "./components/EndInputFields/EndInputFields.js";
4
+ import { StartInputFields as q } from "./components/StartInputFields/StartInputFields.js";
5
+ import { dateTimeInputsVariants as M } from "./DateTimeInputs.variants.js";
6
+ import { useDateTimeInputs as N } from "./hooks/useDateTimeInputs.js";
7
+ import { Fragment as O, jsx as a, jsxs as D } from "react/jsx-runtime";
8
+ var z = ({ autoComplete: d, className: h, labelStartDate: c = "Start date", labelEndDate: f = "End date", labelTime: i = "Time", requiredDates: o = !1, ariaLabelStartDate: g = "Start date", ariaLabelEndDate: T = "End date", errorInvalidDate: E = "Invalid date", errorDateNotAvailable: V = "Date is not available", classNames: e }) => {
9
+ const { fluid: l, numberOfMonths: C } = W(), { timeFormat: u, showTime: t, name: r, disabled: m, time: s, startDateValue: F, startDateError: I, handleStartDateFocus: S, handleStartDateChange: b, handleStartDateBlur: v, handleStartTimeChange: w, endDateValue: y, endDateError: x, handleEndDateFocus: B, handleEndDateChange: k, handleEndDateBlur: L, handleEndTimeChange: j, startHiddenValue: H, endHiddenValue: P } = N({
10
+ errorInvalidDate: E,
11
+ errorDateNotAvailable: V
12
+ }), R = () => C === 2 ? "row" : t ? "stacked" : "compact", p = l ? {
13
+ ...e,
14
+ group: n("w-full", e?.group),
15
+ dateWrapper: n("w-auto flex-1", e?.dateWrapper)
16
+ } : e;
17
+ return /* @__PURE__ */ D("div", {
18
+ className: n(M({
19
+ layout: R(),
20
+ className: h
21
+ }), l && "w-full", e?.root),
18
22
  children: [
19
- /* @__PURE__ */ e(R, {
20
- autoComplete: r,
21
- dateValue: E,
22
- timeValue: m.startTime,
23
- error: V,
24
- disabled: l,
23
+ /* @__PURE__ */ a(q, {
24
+ autoComplete: d,
25
+ dateValue: F,
26
+ timeValue: s.startTime,
27
+ error: I,
28
+ disabled: m,
25
29
  showTime: t,
26
- timeFormat: o,
27
- labelDate: D,
28
- labelTime: d,
29
- required: i,
30
- ariaLabelDate: p,
31
- onDateChange: C,
32
- onDateFocus: F,
33
- onDateBlur: I,
34
- onTimeChange: S,
35
- classNames: a
30
+ timeFormat: u,
31
+ labelDate: c,
32
+ labelTime: i,
33
+ required: o,
34
+ ariaLabelDate: g,
35
+ onDateChange: b,
36
+ onDateFocus: S,
37
+ onDateBlur: v,
38
+ onTimeChange: w,
39
+ classNames: p
36
40
  }),
37
- /* @__PURE__ */ e(P, {
38
- autoComplete: r,
39
- dateValue: b,
40
- timeValue: m.endTime,
41
- error: v,
42
- disabled: l,
41
+ /* @__PURE__ */ a($, {
42
+ autoComplete: d,
43
+ dateValue: y,
44
+ timeValue: s.endTime,
45
+ error: x,
46
+ disabled: m,
43
47
  showTime: t,
44
- timeFormat: o,
45
- labelDate: h,
46
- labelTime: d,
47
- required: i,
48
- ariaLabelDate: c,
49
- onDateChange: B,
50
- onDateFocus: y,
48
+ timeFormat: u,
49
+ labelDate: f,
50
+ labelTime: i,
51
+ required: o,
52
+ ariaLabelDate: T,
53
+ onDateChange: k,
54
+ onDateFocus: B,
51
55
  onDateBlur: L,
52
- onTimeChange: k,
53
- classNames: a
56
+ onTimeChange: j,
57
+ classNames: p
54
58
  }),
55
- n && /* @__PURE__ */ u(M, { children: [/* @__PURE__ */ e("input", {
59
+ r && /* @__PURE__ */ D(O, { children: [/* @__PURE__ */ a("input", {
56
60
  type: "hidden",
57
- name: `${n}-start`,
58
- value: x
59
- }), /* @__PURE__ */ e("input", {
61
+ name: `${r}-start`,
62
+ value: H
63
+ }), /* @__PURE__ */ a("input", {
60
64
  type: "hidden",
61
- name: `${n}-end`,
62
- value: j
65
+ name: `${r}-end`,
66
+ value: P
63
67
  })] })
64
68
  ]
65
69
  });
66
70
  };
67
- O.displayName = "DateRangePickerDateTimeInputs";
71
+ z.displayName = "DateRangePickerDateTimeInputs";
68
72
  export {
69
- O as DateTimeInputs
73
+ z as DateTimeInputs
70
74
  };
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "../../../../dist-B9GE4SXf.js";
2
- var t = e([
2
+ var r = e([
3
3
  "flex",
4
4
  "flex-col",
5
5
  "gap-2.5",
@@ -8,14 +8,17 @@ var t = e([
8
8
  "px-2.5",
9
9
  "border-r",
10
10
  "transition-colors",
11
- "w-[206px]"
11
+ "w-[206px]",
12
+ "max-lg:w-full",
13
+ "max-lg:border-r-0",
14
+ "max-lg:border-b"
12
15
  ], {
13
16
  variants: { divided: {
14
17
  true: ["border-slate-200", "dark:border-metal-700"],
15
18
  false: ["border-transparent"]
16
19
  } },
17
20
  defaultVariants: { divided: !0 }
18
- }), r = e([
21
+ }), t = e([
19
22
  "px-3.5",
20
23
  "text-xs",
21
24
  "font-medium",
@@ -24,7 +27,7 @@ var t = e([
24
27
  "dark:text-metal-300",
25
28
  "tracking-[0.25px]",
26
29
  "leading-4"
27
- ]), s = e([
30
+ ]), l = e([
28
31
  "group",
29
32
  "relative",
30
33
  "flex",
@@ -49,13 +52,17 @@ var t = e([
49
52
  disabled: !1,
50
53
  active: !1
51
54
  }
52
- }), l = e([
55
+ }), s = e([
53
56
  "shrink-0",
54
57
  "transition-transform",
55
58
  "duration-300"
56
59
  ], {
57
60
  variants: { expanded: {
58
- true: ["rotate-180", "text-aurora-500"],
61
+ true: [
62
+ "rotate-180",
63
+ "max-lg:rotate-90",
64
+ "text-aurora-500"
65
+ ],
59
66
  false: [
60
67
  "text-slate-400",
61
68
  "dark:text-metal-400",
@@ -63,13 +70,13 @@ var t = e([
63
70
  ]
64
71
  } },
65
72
  defaultVariants: { expanded: !1 }
66
- }), i = e([
73
+ }), o = e([
67
74
  "flex",
68
75
  "w-full",
69
76
  "items-center",
70
77
  "justify-between",
71
78
  "gap-2"
72
- ]), o = e([
79
+ ]), i = e([
73
80
  "mt-4",
74
81
  "before:content-['']",
75
82
  "before:absolute",
@@ -81,10 +88,10 @@ var t = e([
81
88
  "dark:before:bg-metal-700"
82
89
  ]);
83
90
  export {
84
- l as presetChevronVariants,
85
- i as presetOptionLabelVariants,
86
- s as presetOptionVariants,
87
- t as presetPanelVariants,
88
- o as presetSeparatorVariants,
89
- r as presetTitleVariants
91
+ s as presetChevronVariants,
92
+ o as presetOptionLabelVariants,
93
+ l as presetOptionVariants,
94
+ r as presetPanelVariants,
95
+ i as presetSeparatorVariants,
96
+ t as presetTitleVariants
90
97
  };
@@ -1,37 +1,53 @@
1
- import { t as d } from "../../../../utils-DnIJruo0.js";
2
- import { useDateRangePicker as l } from "../../contexts/date-range-picker/date-range-picker.hook.js";
3
- import { hidesRightPanel as h } from "../../utils/right-panel/right-panel.js";
4
- import { jsx as e } from "react/jsx-runtime";
5
- import { AnimatePresence as p, motion as c } from "motion/react";
6
- var i = {
7
- width: 0,
8
- height: 0,
9
- opacity: 0
10
- }, g = {
1
+ import { t as c } from "../../../../utils-DnIJruo0.js";
2
+ import { useDateRangePicker as R } from "../../contexts/date-range-picker/date-range-picker.hook.js";
3
+ import { hidesRightPanel as x } from "../../utils/right-panel/right-panel.js";
4
+ import { useLayoutEffect as v, useRef as a } from "react";
5
+ import { Fragment as w, jsx as t, jsxs as P } from "react/jsx-runtime";
6
+ import { AnimatePresence as C, motion as D } from "motion/react";
7
+ var N = {
11
8
  width: "auto",
12
9
  height: "auto",
13
10
  opacity: 1
14
- }, u = ({ children: a, className: t }) => {
15
- const { animationDuration: n, preset: r, presets: o, revealCalendarOnCustom: s } = l(), m = h(r, o, s);
16
- return /* @__PURE__ */ e(p, {
11
+ }, j = ({ children: d, className: m }) => {
12
+ const { animationDuration: p, fluid: r, preset: u, presets: f, revealCalendarOnCustom: h } = R(), o = a(null), s = a(null), n = a(0), g = x(u, f, h);
13
+ v(() => {
14
+ const i = o.current?.parentElement, e = s.current;
15
+ if (!i || getComputedStyle(i).flexDirection !== "column") {
16
+ n.current = 0;
17
+ return;
18
+ }
19
+ const y = e?.style.display ?? "";
20
+ e && (e.style.display = "none"), n.current = i.getBoundingClientRect().width, e && (e.style.display = y);
21
+ });
22
+ const l = {
23
+ width: n.current,
24
+ height: 0,
25
+ opacity: 0
26
+ };
27
+ return /* @__PURE__ */ P(w, { children: [/* @__PURE__ */ t("span", {
28
+ ref: o,
29
+ "aria-hidden": "true",
30
+ className: "hidden"
31
+ }), /* @__PURE__ */ t(C, {
17
32
  initial: !1,
18
- children: !m && /* @__PURE__ */ e(c.div, {
19
- className: "overflow-hidden",
20
- initial: i,
21
- animate: g,
22
- exit: i,
33
+ children: !g && /* @__PURE__ */ t(D.div, {
34
+ ref: s,
35
+ className: c("overflow-hidden", r && "flex-1"),
36
+ initial: l,
37
+ animate: N,
38
+ exit: l,
23
39
  transition: {
24
- duration: n / 1e3,
40
+ duration: p / 1e3,
25
41
  ease: "easeInOut"
26
42
  },
27
- children: /* @__PURE__ */ e("div", {
28
- className: d(t, "w-max"),
29
- children: a
43
+ children: /* @__PURE__ */ t("div", {
44
+ className: c(m, r ? "w-full" : "w-max"),
45
+ children: d
30
46
  })
31
47
  }, "right-panel")
32
- });
48
+ })] });
33
49
  };
34
- u.displayName = "DateRangePickerRightPanel";
50
+ j.displayName = "DateRangePickerRightPanel";
35
51
  export {
36
- u as RightPanel
52
+ j as RightPanel
37
53
  };