@konstructio/ui 0.1.7 → 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.
- package/dist/check-Bekes_eB.js +14 -0
- package/dist/components/CopyButton/CopyButton.js +12 -12
- package/dist/components/DateRangePicker/DateRangePicker.js +58 -57
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +1 -0
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +55 -54
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +17 -17
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +15 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +74 -55
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +38 -38
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -56
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +21 -14
- package/dist/components/DateRangePicker/components/RightPanel/RightPanel.js +41 -25
- package/dist/components/DateRangePicker/contexts/date-range-picker/date-range-picker.provider.js +15 -14
- package/dist/components/Filter/Filter.variants.js +12 -7
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.js +39 -0
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.js +17 -14
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.js +48 -27
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Trigger/Trigger.js +13 -12
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Wrapper/Wrapper.js +53 -17
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.provider.js +87 -78
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +44 -20
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +58 -50
- package/dist/components/Filter/hooks/index.js +5 -2
- package/dist/components/Filter/hooks/useFilterSheet.js +6 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +18 -18
- package/dist/components/Sheet/Sheet.js +143 -139
- package/dist/components/Sheet/components/SheetStep/SheetStep.js +57 -55
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +42 -42
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +25 -2
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +1 -1
- package/dist/components/Tooltip/Tooltip.js +17 -17
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +40 -39
- package/dist/components/VirtualizedTable/components/Header/Header.js +1 -1
- package/dist/components/VirtualizedTable/constants/index.js +6 -5
- package/dist/components/VirtualizedTable/constants/responsive.js +2 -1
- package/dist/{constants-YCGllWdf.js → constants-Cw00eFTQ.js} +13 -13
- package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +6 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.types.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.types.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.d.ts +1 -1
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.d.ts +3 -1
- package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.context.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.types.d.ts +1 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.d.ts +3 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.types.d.ts +3 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.d.ts +2 -1
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.types.d.ts +4 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.d.ts +2 -1
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.types.d.ts +4 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.types.d.ts +2 -0
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +8 -0
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterSheet.d.ts +2 -0
- package/dist/lib/components/Sheet/Sheet.types.d.ts +12 -0
- package/dist/lib/components/Sheet/components/SheetStep/SheetStep.d.ts +21 -3
- package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +1 -0
- package/dist/package.json +18 -18
- package/dist/styles.css +1 -1
- package/dist/ui/utilities.css +23 -0
- package/package.json +18 -18
- package/dist/StepIndicatorContent-C6MILk4c.js +0 -36
|
@@ -1,56 +1,74 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { calendarGridContainerVariants as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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__ */
|
|
17
|
-
className:
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
|
|
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__ */
|
|
40
|
+
/* @__PURE__ */ n(v, {
|
|
23
41
|
direction: "prev",
|
|
24
|
-
onClick:
|
|
42
|
+
onClick: S,
|
|
25
43
|
disabled: i,
|
|
26
|
-
isAnimating:
|
|
27
|
-
canNavigate:
|
|
28
|
-
hideWhenDisabled:
|
|
29
|
-
className:
|
|
30
|
-
disabledClassName:
|
|
31
|
-
ariaLabel:
|
|
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__ */
|
|
51
|
+
/* @__PURE__ */ n(v, {
|
|
34
52
|
direction: "next",
|
|
35
|
-
onClick:
|
|
53
|
+
onClick: $,
|
|
36
54
|
disabled: i,
|
|
37
|
-
isAnimating:
|
|
38
|
-
canNavigate:
|
|
39
|
-
hideWhenDisabled:
|
|
40
|
-
className:
|
|
41
|
-
disabledClassName:
|
|
42
|
-
ariaLabel:
|
|
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__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
ref:
|
|
47
|
-
className:
|
|
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":
|
|
67
|
+
"aria-label": b,
|
|
50
68
|
initial: !1,
|
|
51
|
-
animate: { height:
|
|
69
|
+
animate: { height: B },
|
|
52
70
|
transition: {
|
|
53
|
-
duration:
|
|
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": `${
|
|
63
|
-
width:
|
|
64
|
-
transform:
|
|
80
|
+
"--konstruct-drp-animation-duration": `${l.animationDuration}ms`,
|
|
81
|
+
width: z,
|
|
82
|
+
transform: j(),
|
|
65
83
|
willChange: "transform"
|
|
66
84
|
},
|
|
67
|
-
children:
|
|
68
|
-
month:
|
|
69
|
-
|
|
70
|
-
|
|
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:
|
|
73
|
-
showOutsideDays:
|
|
91
|
+
disabledMatcher: M,
|
|
92
|
+
showOutsideDays: N,
|
|
74
93
|
classNames: {
|
|
75
|
-
monthTitle:
|
|
76
|
-
dayPicker:
|
|
94
|
+
monthTitle: t?.monthTitle,
|
|
95
|
+
dayPicker: t?.dayPicker
|
|
77
96
|
}
|
|
78
|
-
}, `${
|
|
97
|
+
}, `${e.getFullYear()}-${e.getMonth()}-${o}`))
|
|
79
98
|
})
|
|
80
99
|
]
|
|
81
100
|
})
|
|
82
101
|
});
|
|
83
102
|
};
|
|
84
|
-
|
|
103
|
+
q.displayName = "TogetherModeCalendar";
|
|
85
104
|
export {
|
|
86
|
-
|
|
105
|
+
q as TogetherModeCalendar
|
|
87
106
|
};
|
|
@@ -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-
|
|
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-
|
|
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";
|
package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as W } from "../../../../../constants-
|
|
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 }) => {
|
package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { r as
|
|
2
|
-
import { calculateCalendarHeight as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
var
|
|
5
|
-
const [n, c] = a(null), [e, u] = a(!1), [o, i] = a(!1), [
|
|
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 = [
|
|
8
|
-
const r = t.slice(0,
|
|
9
|
-
return
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
]),
|
|
19
|
-
return
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
|
|
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
|
|
29
|
-
Math.abs(
|
|
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
|
-
|
|
38
|
-
]),
|
|
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
|
-
]),
|
|
46
|
+
]), I(() => {
|
|
47
47
|
if (e && o) {
|
|
48
48
|
const t = setTimeout(() => {
|
|
49
|
-
|
|
50
|
-
f.current && f.current.offsetHeight,
|
|
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
|
-
|
|
52
|
+
_(!0);
|
|
53
53
|
});
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
|
-
},
|
|
56
|
+
}, N);
|
|
57
57
|
return () => clearTimeout(t);
|
|
58
58
|
}
|
|
59
59
|
}, [
|
|
60
60
|
e,
|
|
61
61
|
o,
|
|
62
|
-
|
|
62
|
+
N,
|
|
63
63
|
n
|
|
64
64
|
]), {
|
|
65
65
|
carouselRef: f,
|
|
66
66
|
isAnimating: e,
|
|
67
|
-
enableTransition:
|
|
67
|
+
enableTransition: k,
|
|
68
68
|
animateTransform: o,
|
|
69
|
-
calendarHeight:
|
|
70
|
-
carouselTotalWidth:
|
|
69
|
+
calendarHeight: w,
|
|
70
|
+
carouselTotalWidth: L,
|
|
71
71
|
monthsToRender: [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
h,
|
|
72
|
+
G,
|
|
73
|
+
x,
|
|
75
74
|
m,
|
|
75
|
+
h,
|
|
76
76
|
d,
|
|
77
|
-
|
|
77
|
+
O
|
|
78
78
|
],
|
|
79
79
|
handlePrevMonth: () => {
|
|
80
|
-
e ||
|
|
80
|
+
e || F || !b || (c("right"), u(!0), i(!1), v());
|
|
81
81
|
},
|
|
82
82
|
handleNextMonth: () => {
|
|
83
|
-
e ||
|
|
83
|
+
e || F || !p || (c("left"), u(!0), i(!1), C());
|
|
84
84
|
},
|
|
85
85
|
getTransform: () => {
|
|
86
|
-
let t =
|
|
87
|
-
return e && o && (n === "left" ? t =
|
|
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
|
-
|
|
92
|
+
y as useTogetherCarousel
|
|
93
93
|
};
|
|
@@ -1,70 +1,74 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { useDateRangePicker as
|
|
3
|
-
import { EndInputFields as
|
|
4
|
-
import { StartInputFields as
|
|
5
|
-
import { dateTimeInputsVariants as
|
|
6
|
-
import { useDateTimeInputs as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
var
|
|
9
|
-
const { numberOfMonths:
|
|
10
|
-
errorInvalidDate:
|
|
11
|
-
errorDateNotAvailable:
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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__ */
|
|
20
|
-
autoComplete:
|
|
21
|
-
dateValue:
|
|
22
|
-
timeValue:
|
|
23
|
-
error:
|
|
24
|
-
disabled:
|
|
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:
|
|
27
|
-
labelDate:
|
|
28
|
-
labelTime:
|
|
29
|
-
required:
|
|
30
|
-
ariaLabelDate:
|
|
31
|
-
onDateChange:
|
|
32
|
-
onDateFocus:
|
|
33
|
-
onDateBlur:
|
|
34
|
-
onTimeChange:
|
|
35
|
-
classNames:
|
|
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__ */
|
|
38
|
-
autoComplete:
|
|
39
|
-
dateValue:
|
|
40
|
-
timeValue:
|
|
41
|
-
error:
|
|
42
|
-
disabled:
|
|
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:
|
|
45
|
-
labelDate:
|
|
46
|
-
labelTime:
|
|
47
|
-
required:
|
|
48
|
-
ariaLabelDate:
|
|
49
|
-
onDateChange:
|
|
50
|
-
onDateFocus:
|
|
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:
|
|
53
|
-
classNames:
|
|
56
|
+
onTimeChange: j,
|
|
57
|
+
classNames: p
|
|
54
58
|
}),
|
|
55
|
-
|
|
59
|
+
r && /* @__PURE__ */ D(O, { children: [/* @__PURE__ */ a("input", {
|
|
56
60
|
type: "hidden",
|
|
57
|
-
name: `${
|
|
58
|
-
value:
|
|
59
|
-
}), /* @__PURE__ */
|
|
61
|
+
name: `${r}-start`,
|
|
62
|
+
value: H
|
|
63
|
+
}), /* @__PURE__ */ a("input", {
|
|
60
64
|
type: "hidden",
|
|
61
|
-
name: `${
|
|
62
|
-
value:
|
|
65
|
+
name: `${r}-end`,
|
|
66
|
+
value: P
|
|
63
67
|
})] })
|
|
64
68
|
]
|
|
65
69
|
});
|
|
66
70
|
};
|
|
67
|
-
|
|
71
|
+
z.displayName = "DateRangePickerDateTimeInputs";
|
|
68
72
|
export {
|
|
69
|
-
|
|
73
|
+
z as DateTimeInputs
|
|
70
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "../../../../dist-B9GE4SXf.js";
|
|
2
|
-
var
|
|
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
|
-
}),
|
|
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
|
-
]),
|
|
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
|
-
}),
|
|
55
|
+
}), s = e([
|
|
53
56
|
"shrink-0",
|
|
54
57
|
"transition-transform",
|
|
55
58
|
"duration-300"
|
|
56
59
|
], {
|
|
57
60
|
variants: { expanded: {
|
|
58
|
-
true: [
|
|
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
|
-
}),
|
|
73
|
+
}), o = e([
|
|
67
74
|
"flex",
|
|
68
75
|
"w-full",
|
|
69
76
|
"items-center",
|
|
70
77
|
"justify-between",
|
|
71
78
|
"gap-2"
|
|
72
|
-
]),
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
2
|
-
import { useDateRangePicker as
|
|
3
|
-
import { hidesRightPanel as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
},
|
|
15
|
-
const { animationDuration:
|
|
16
|
-
|
|
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: !
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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:
|
|
40
|
+
duration: p / 1e3,
|
|
25
41
|
ease: "easeInOut"
|
|
26
42
|
},
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
className:
|
|
29
|
-
children:
|
|
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
|
-
|
|
50
|
+
j.displayName = "DateRangePickerRightPanel";
|
|
35
51
|
export {
|
|
36
|
-
|
|
52
|
+
j as RightPanel
|
|
37
53
|
};
|