@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.
- 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/Tabs/Tabs.variants.js +4 -7
- package/dist/components/Tabs/components/Trigger.js +5 -5
- 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 +2 -2
- 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
package/dist/components/DateRangePicker/contexts/date-range-picker/date-range-picker.provider.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { PRESET_OPTIONS as
|
|
1
|
+
import { PRESET_OPTIONS as ot } from "../../constants/presets/presets.js";
|
|
2
2
|
import { calculatePresetRange as w } from "../../utils/presets/presets.js";
|
|
3
3
|
import { canNavigateToNextMonth as q, canNavigateToPrevMonth as z } from "../../utils/disabled-dates/disabled-dates.js";
|
|
4
|
-
import { getDisplayedMonths as
|
|
5
|
-
import { DateRangePickerContext as
|
|
4
|
+
import { getDisplayedMonths as nt } from "../../utils/displayed-months/displayed-months.js";
|
|
5
|
+
import { DateRangePickerContext as at } from "./date-range-picker.context.js";
|
|
6
6
|
import { useCallback as o, useMemo as a, useState as Y } from "react";
|
|
7
|
-
import { jsx as
|
|
8
|
-
var
|
|
9
|
-
const [M, x] = Y(() => l || w(p, g)), [s,
|
|
7
|
+
import { jsx as it } from "react/jsx-runtime";
|
|
8
|
+
var ft = ({ children: A, defaultRange: l, defaultTime: B, defaultPreset: p = "custom", presets: g = ot, timeFormat: G = "24", showTime: H = !0, name: J, disabled: K = !1, animationDuration: O = 500, blockedDays: Q = [], blockedMonths: U = [], minDate: u, maxDate: i, hideDisabledNavigation: W = !1, showOutsideDays: X = !1, navigationMode: Z = "together", numberOfMonths: T = 2, fluid: $ = !1, dateDisplayFormat: C = "long", revealCalendarOnCustom: tt = !1, onRangeChange: c, onDateChange: v, onPresetChange: S }) => {
|
|
9
|
+
const [M, x] = Y(() => l || w(p, g)), [s, et] = Y(() => B ?? {}), [y, D] = Y(p), [r, n] = Y(() => {
|
|
10
10
|
const t = l || w(p, g), e = t?.from ?? t?.to ?? /* @__PURE__ */ new Date();
|
|
11
|
-
return
|
|
11
|
+
return nt(e, i, T);
|
|
12
12
|
}), L = r[T - 1], k = o((t) => {
|
|
13
13
|
x(t), D("custom"), c?.({
|
|
14
14
|
...t,
|
|
@@ -19,7 +19,7 @@ var Mt = ({ children: A, defaultRange: l, defaultTime: B, defaultPreset: p = "cu
|
|
|
19
19
|
c,
|
|
20
20
|
v
|
|
21
21
|
]), d = o((t) => {
|
|
22
|
-
|
|
22
|
+
et(t), c?.({
|
|
23
23
|
...M,
|
|
24
24
|
...t
|
|
25
25
|
});
|
|
@@ -54,7 +54,7 @@ var Mt = ({ children: A, defaultRange: l, defaultTime: B, defaultPreset: p = "cu
|
|
|
54
54
|
P && n(([t, e]) => [t, new Date(e.getFullYear(), e.getMonth() - 1, 1)]);
|
|
55
55
|
}, [P]), b = o(() => {
|
|
56
56
|
F && n(([t, e]) => [t, new Date(e.getFullYear(), e.getMonth() + 1, 1)]);
|
|
57
|
-
}, [F]),
|
|
57
|
+
}, [F]), rt = a(() => ({
|
|
58
58
|
range: M,
|
|
59
59
|
time: s,
|
|
60
60
|
preset: y,
|
|
@@ -96,9 +96,9 @@ var Mt = ({ children: A, defaultRange: l, defaultTime: B, defaultPreset: p = "cu
|
|
|
96
96
|
_,
|
|
97
97
|
b
|
|
98
98
|
]);
|
|
99
|
-
return /* @__PURE__ */ at
|
|
99
|
+
return /* @__PURE__ */ it(at.Provider, {
|
|
100
100
|
value: {
|
|
101
|
-
...
|
|
101
|
+
...rt,
|
|
102
102
|
presets: g,
|
|
103
103
|
timeFormat: G,
|
|
104
104
|
showTime: H,
|
|
@@ -110,15 +110,16 @@ var Mt = ({ children: A, defaultRange: l, defaultTime: B, defaultPreset: p = "cu
|
|
|
110
110
|
minDate: u,
|
|
111
111
|
maxDate: i,
|
|
112
112
|
hideDisabledNavigation: W,
|
|
113
|
-
revealCalendarOnCustom:
|
|
113
|
+
revealCalendarOnCustom: tt,
|
|
114
114
|
showOutsideDays: X,
|
|
115
115
|
navigationMode: Z,
|
|
116
116
|
numberOfMonths: T,
|
|
117
|
-
|
|
117
|
+
fluid: $,
|
|
118
|
+
dateDisplayFormat: C
|
|
118
119
|
},
|
|
119
120
|
children: A
|
|
120
121
|
});
|
|
121
122
|
};
|
|
122
123
|
export {
|
|
123
|
-
|
|
124
|
+
ft as DateRangePickerProvider
|
|
124
125
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t } from "../../dist-B9GE4SXf.js";
|
|
2
|
-
var
|
|
2
|
+
var r = t([
|
|
3
3
|
"flex",
|
|
4
4
|
"gap-8",
|
|
5
5
|
"items-center"
|
|
6
|
-
]),
|
|
6
|
+
]), i = t([
|
|
7
7
|
"flex",
|
|
8
8
|
"items-center",
|
|
9
9
|
"gap-1",
|
|
@@ -11,8 +11,13 @@ var e = t([
|
|
|
11
11
|
"cursor-pointer",
|
|
12
12
|
"text-sm",
|
|
13
13
|
"w-max",
|
|
14
|
-
"dark:text-metal-300"
|
|
15
|
-
|
|
14
|
+
"dark:text-metal-300",
|
|
15
|
+
"rounded-sm",
|
|
16
|
+
"focus-visible:outline-none",
|
|
17
|
+
"focus-visible:ring-1",
|
|
18
|
+
"focus-visible:ring-aurora-500",
|
|
19
|
+
"kubefirst:focus-visible:ring-kubefirst-primary"
|
|
20
|
+
]), a = t([
|
|
16
21
|
"text-slate-400",
|
|
17
22
|
"h-5",
|
|
18
23
|
"w-5",
|
|
@@ -21,7 +26,7 @@ var e = t([
|
|
|
21
26
|
"ease-in-out"
|
|
22
27
|
]);
|
|
23
28
|
export {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
a as filterButtonIconVariants,
|
|
30
|
+
i as filterButtonVariants,
|
|
31
|
+
r as filterVariants
|
|
27
32
|
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as u } from "../../../../../../check-Bekes_eB.js";
|
|
2
|
+
import { t as d } from "../../../../../../chevron-right-D4OkgIIT.js";
|
|
3
|
+
import { t as x } from "../../../../../../utils-DnIJruo0.js";
|
|
4
|
+
import { useCustomDateRangeFilterDropdown as f } from "../../contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.hook.js";
|
|
5
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
6
|
+
var b = "flex min-h-12 w-full items-center justify-between gap-4 px-4 text-left text-base text-slate-700 tap-target active:bg-slate-100 dark:text-metal-50 dark:active:bg-metal-700", N = ({ onCustomRange: l }) => {
|
|
7
|
+
const { presets: n, selectedPreset: o, onApplyPreset: i, onPresetChange: m } = f(), c = /* @__PURE__ */ new Date();
|
|
8
|
+
return /* @__PURE__ */ r("ul", {
|
|
9
|
+
className: "flex flex-col",
|
|
10
|
+
children: n.map((e) => {
|
|
11
|
+
const t = e.resolve(c), a = !t.from && !t.to, s = e.value === o;
|
|
12
|
+
return /* @__PURE__ */ r("li", {
|
|
13
|
+
className: x(a && "mt-2 border-t border-slate-200 pt-2 dark:border-metal-700"),
|
|
14
|
+
children: /* @__PURE__ */ h("button", {
|
|
15
|
+
type: "button",
|
|
16
|
+
"aria-current": s || void 0,
|
|
17
|
+
className: b,
|
|
18
|
+
onClick: () => {
|
|
19
|
+
if (a) {
|
|
20
|
+
m(e.value, t), l();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
i(e.value, t);
|
|
24
|
+
},
|
|
25
|
+
children: [e.label, a ? /* @__PURE__ */ r(d, {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
className: "size-5 shrink-0 text-slate-500 dark:text-metal-400"
|
|
28
|
+
}) : s && /* @__PURE__ */ r(u, {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: "size-5 shrink-0 text-aurora-500"
|
|
31
|
+
})]
|
|
32
|
+
})
|
|
33
|
+
}, e.value);
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
N as MobilePresets
|
|
39
|
+
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Button as l } from "../../../../../Button/Button.js";
|
|
2
|
+
import { t as e } from "../../../../../../utils-DnIJruo0.js";
|
|
3
|
+
import { useCustomDateRangeFilterDropdown as t } from "../../contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.hook.js";
|
|
4
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
var x = ({ isSheet: a = !1 }) => {
|
|
6
|
+
const { hasPendingSelection: o, labelApply: r, labelReset: c, onApply: p, onClear: s } = t();
|
|
6
7
|
return /* @__PURE__ */ i("div", {
|
|
7
|
-
className: "flex w-full justify-end gap-4",
|
|
8
|
-
children: [/* @__PURE__ */
|
|
8
|
+
className: e("flex w-full justify-end", a ? "gap-2" : "gap-4"),
|
|
9
|
+
children: [/* @__PURE__ */ n(l, {
|
|
9
10
|
variant: "secondary",
|
|
10
11
|
appearance: "compact",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
className: e(a && "h-11! flex-1"),
|
|
13
|
+
onClick: s,
|
|
14
|
+
children: c
|
|
15
|
+
}), /* @__PURE__ */ n(l, {
|
|
14
16
|
appearance: "compact",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
className: e(a && "h-11! flex-1"),
|
|
18
|
+
disabled: !o,
|
|
19
|
+
onClick: p,
|
|
20
|
+
children: r
|
|
18
21
|
})]
|
|
19
22
|
});
|
|
20
23
|
};
|
|
21
24
|
export {
|
|
22
|
-
|
|
25
|
+
x as PanelActions
|
|
23
26
|
};
|
package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.js
CHANGED
|
@@ -1,34 +1,55 @@
|
|
|
1
|
-
import { DateRangePicker as
|
|
2
|
-
import { useCustomDateRangeFilterDropdown as
|
|
3
|
-
import { PanelActions as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
6
|
-
const { animationDuration:
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
animationDuration:
|
|
9
|
-
dateDisplayFormat:
|
|
10
|
-
navigationMode:
|
|
11
|
-
numberOfMonths:
|
|
1
|
+
import { DateRangePicker as p } from "../../../../../DateRangePicker/DateRangePicker.js";
|
|
2
|
+
import { useCustomDateRangeFilterDropdown as y } from "../../contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.hook.js";
|
|
3
|
+
import { PanelActions as F } from "../PanelActions/PanelActions.js";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
var j = ({ isSheet: w = !1 }) => {
|
|
6
|
+
const { animationDuration: t, dateDisplayFormat: o, labelEndDate: r, labelStartDate: s, labelTimePeriod: n, maxDate: l, minDate: i, navigationMode: m, numberOfMonths: b, presets: d, requiredDates: u, resetKey: f, revealCalendarOnCustom: c, selectedPreset: C, selectedRange: e, showOutsideDays: h, showPresets: R, showsCalendar: O, showTime: D, timeFormat: P, onPresetChange: v, onRangeChange: g } = y(), x = C ?? ((c ? O : e) ? "custom" : null);
|
|
7
|
+
return w ? /* @__PURE__ */ a(p, {
|
|
8
|
+
animationDuration: t,
|
|
9
|
+
dateDisplayFormat: o,
|
|
10
|
+
navigationMode: m,
|
|
11
|
+
numberOfMonths: 1,
|
|
12
|
+
fluid: !0,
|
|
12
13
|
showOutsideDays: h,
|
|
13
|
-
defaultRange:
|
|
14
|
-
defaultPreset:
|
|
15
|
-
showTime:
|
|
16
|
-
timeFormat:
|
|
17
|
-
showPresets:
|
|
18
|
-
presets:
|
|
19
|
-
|
|
20
|
-
labelTimePeriod: i,
|
|
14
|
+
defaultRange: e,
|
|
15
|
+
defaultPreset: "custom",
|
|
16
|
+
showTime: D,
|
|
17
|
+
timeFormat: P,
|
|
18
|
+
showPresets: !1,
|
|
19
|
+
presets: d,
|
|
20
|
+
labelTimePeriod: n,
|
|
21
21
|
labelStartDate: s,
|
|
22
|
-
labelEndDate:
|
|
23
|
-
requiredDates:
|
|
24
|
-
minDate:
|
|
25
|
-
maxDate:
|
|
26
|
-
onRangeChange:
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
labelEndDate: r,
|
|
23
|
+
requiredDates: u,
|
|
24
|
+
minDate: i,
|
|
25
|
+
maxDate: l,
|
|
26
|
+
onRangeChange: g,
|
|
27
|
+
classNames: { container: "border-0 shadow-none" }
|
|
28
|
+
}, f) : /* @__PURE__ */ a(p, {
|
|
29
|
+
animationDuration: t,
|
|
30
|
+
dateDisplayFormat: o,
|
|
31
|
+
navigationMode: m,
|
|
32
|
+
numberOfMonths: b,
|
|
33
|
+
showOutsideDays: h,
|
|
34
|
+
defaultRange: e,
|
|
35
|
+
defaultPreset: x,
|
|
36
|
+
showTime: D,
|
|
37
|
+
timeFormat: P,
|
|
38
|
+
showPresets: R,
|
|
39
|
+
presets: d,
|
|
40
|
+
revealCalendarOnCustom: c,
|
|
41
|
+
labelTimePeriod: n,
|
|
42
|
+
labelStartDate: s,
|
|
43
|
+
labelEndDate: r,
|
|
44
|
+
requiredDates: u,
|
|
45
|
+
minDate: i,
|
|
46
|
+
maxDate: l,
|
|
47
|
+
onRangeChange: g,
|
|
48
|
+
onPresetChange: v,
|
|
49
|
+
footer: /* @__PURE__ */ a(F, {}),
|
|
29
50
|
classNames: { container: "shadow-none" }
|
|
30
51
|
}, f);
|
|
31
52
|
};
|
|
32
53
|
export {
|
|
33
|
-
|
|
54
|
+
j as Picker
|
|
34
55
|
};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as d } from "../../../../../../chevron-down-BODx0Q7h.js";
|
|
2
2
|
import { Badge as t } from "../../../../../Badge/Badge.js";
|
|
3
|
-
import { filterButtonIconVariants as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { filterButtonIconVariants as c } from "../../../../Filter.variants.js";
|
|
4
|
+
import { useFilterSheet as f } from "../../../../hooks/useFilterSheet.js";
|
|
5
|
+
import { Typography as g } from "../../../../../Typography/Typography.js";
|
|
6
|
+
import { t as u } from "../../../../../../utils-DnIJruo0.js";
|
|
7
|
+
import { useCustomDateRangeFilterDropdown as h } from "../../contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.hook.js";
|
|
8
|
+
import { Fragment as o, jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
9
|
+
var w = () => {
|
|
10
|
+
const { appliedRangeDisplay: l, appliedRangeEnds: r, appliedRangeLabel: n, isOpen: p, label: i, labelRangeSeparator: m } = h(), s = f();
|
|
11
|
+
return /* @__PURE__ */ a(o, { children: [
|
|
11
12
|
i,
|
|
12
|
-
l === "split" && r ? /* @__PURE__ */ o
|
|
13
|
+
l === "split" && r && !s ? /* @__PURE__ */ a(o, { children: [/* @__PURE__ */ e(t, { label: r.from }), r.to && /* @__PURE__ */ a(o, { children: [/* @__PURE__ */ e(g, {
|
|
13
14
|
component: "span",
|
|
14
15
|
className: "text-sm",
|
|
15
16
|
children: m
|
|
16
17
|
}), /* @__PURE__ */ e(t, { label: r.to })] })] }) : n && /* @__PURE__ */ e(t, { label: n }),
|
|
17
|
-
/* @__PURE__ */ e(
|
|
18
|
+
/* @__PURE__ */ e(d, { className: u(c(), { "rotate-180 text-blue-600 dark:text-aurora-500": p }) })
|
|
18
19
|
] });
|
|
19
20
|
};
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
w as Trigger
|
|
22
23
|
};
|
|
@@ -1,22 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Button as A } from "../../../../../Button/Button.js";
|
|
2
|
+
import { filterButtonVariants as j } from "../../../../Filter.variants.js";
|
|
3
|
+
import { useFilterSheet as E } from "../../../../hooks/useFilterSheet.js";
|
|
4
|
+
import { t as M } from "../../../../../../utils-DnIJruo0.js";
|
|
5
|
+
import { FilterDropdown as f } from "../../../FilterDropdown/FilterDropdown.js";
|
|
6
|
+
import { useCustomDateRangeFilterDropdown as _ } from "../../contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.hook.js";
|
|
7
|
+
import { Actions as y } from "../Actions/Actions.js";
|
|
8
|
+
import { MobilePresets as G } from "../MobilePresets/MobilePresets.js";
|
|
9
|
+
import { PanelActions as L } from "../PanelActions/PanelActions.js";
|
|
10
|
+
import { Picker as u } from "../Picker/Picker.js";
|
|
11
|
+
import { Trigger as S } from "../Trigger/Trigger.js";
|
|
12
|
+
import { useState as U } from "react";
|
|
13
|
+
import { Fragment as C, jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
14
|
+
var a = 1, ee = () => {
|
|
15
|
+
const { appliedRangeLabel: i, hasPendingSelection: v, isOpen: o, label: l, labelReset: P, position: w, presets: x, selectedPreset: B, onOpenChange: m, onPresetChange: O, onReset: R } = _(), b = E(), [p, n] = U(0), c = M(j(), { "text-slate-700": o });
|
|
16
|
+
if (!b) return /* @__PURE__ */ s(f, {
|
|
12
17
|
isOpen: o,
|
|
13
|
-
position:
|
|
14
|
-
triggerClassName:
|
|
15
|
-
trigger: /* @__PURE__ */
|
|
16
|
-
onOpenChange:
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
position: w,
|
|
19
|
+
triggerClassName: c,
|
|
20
|
+
trigger: /* @__PURE__ */ e(S, {}),
|
|
21
|
+
onOpenChange: m,
|
|
22
|
+
children: [/* @__PURE__ */ e(u, {}), /* @__PURE__ */ e(y, {})]
|
|
23
|
+
});
|
|
24
|
+
const F = /* @__PURE__ */ new Date(), h = x.find((r) => {
|
|
25
|
+
const g = r.resolve(F);
|
|
26
|
+
return !g.from && !g.to;
|
|
27
|
+
}), t = p === a, N = !!i && B === h?.value, k = !!i || v, D = (r) => {
|
|
28
|
+
n(r && N ? a : 0), m(r);
|
|
29
|
+
}, T = () => {
|
|
30
|
+
O(null, {}), n(0);
|
|
31
|
+
}, d = /* @__PURE__ */ s(C, { children: [/* @__PURE__ */ e(G, { onCustomRange: () => n(a) }), k && /* @__PURE__ */ e("div", {
|
|
32
|
+
className: "px-4 pt-4",
|
|
33
|
+
children: /* @__PURE__ */ e(A, {
|
|
34
|
+
variant: "secondary",
|
|
35
|
+
appearance: "compact",
|
|
36
|
+
className: "h-11! w-full",
|
|
37
|
+
onClick: R,
|
|
38
|
+
children: P
|
|
39
|
+
})
|
|
40
|
+
})] });
|
|
41
|
+
return /* @__PURE__ */ e(f, {
|
|
42
|
+
isOpen: o,
|
|
43
|
+
triggerClassName: c,
|
|
44
|
+
trigger: /* @__PURE__ */ e(S, {}),
|
|
45
|
+
sheetTitle: t ? h?.label ?? l : l,
|
|
46
|
+
sheetStep: p,
|
|
47
|
+
sheetPreviousContent: t ? d : void 0,
|
|
48
|
+
onSheetBack: t ? T : void 0,
|
|
49
|
+
onOpenChange: D,
|
|
50
|
+
children: t ? /* @__PURE__ */ s(C, { children: [/* @__PURE__ */ e(u, { isSheet: !0 }), /* @__PURE__ */ e("div", {
|
|
51
|
+
className: "px-4 pt-4",
|
|
52
|
+
children: /* @__PURE__ */ e(L, { isSheet: !0 })
|
|
53
|
+
})] }) : d
|
|
18
54
|
});
|
|
19
55
|
};
|
|
20
56
|
export {
|
|
21
|
-
|
|
57
|
+
ee as Wrapper
|
|
22
58
|
};
|
|
@@ -1,106 +1,114 @@
|
|
|
1
|
-
import { useFilterContext as
|
|
1
|
+
import { useFilterContext as Ae } from "../../../../contexts/filter.hook.js";
|
|
2
2
|
import { useFilterDropdownSync as Fe } from "../../../../hooks/useFilterDropdownSync.js";
|
|
3
3
|
import { DEFAULT_ROLLING_PRESETS as Oe } from "../../constants/presets/presets.js";
|
|
4
|
-
import { useAppliedDateRange as
|
|
5
|
-
import { useCalendarVisibility as
|
|
6
|
-
import { useDateRangeSelection as
|
|
7
|
-
import { useFilterDropdownOpenState as
|
|
8
|
-
import { useFormattedDateRange as
|
|
9
|
-
import { usePendingDateRange as
|
|
10
|
-
import { usePresetOptions as
|
|
11
|
-
import { useResetKey as
|
|
12
|
-
import { useSelectedPreset as
|
|
13
|
-
import { spanWholeDays as
|
|
14
|
-
import { CustomDateRangeFilterDropdownContext as
|
|
4
|
+
import { useAppliedDateRange as ve } from "../../hooks/useAppliedDateRange/useAppliedDateRange.js";
|
|
5
|
+
import { useCalendarVisibility as be } from "../../hooks/useCalendarVisibility/useCalendarVisibility.js";
|
|
6
|
+
import { useDateRangeSelection as xe } from "../../hooks/useDateRangeSelection/useDateRangeSelection.js";
|
|
7
|
+
import { useFilterDropdownOpenState as Ee } from "../../hooks/useFilterDropdownOpenState/useFilterDropdownOpenState.js";
|
|
8
|
+
import { useFormattedDateRange as Le } from "../../hooks/useFormattedDateRange/useFormattedDateRange.js";
|
|
9
|
+
import { usePendingDateRange as we } from "../../hooks/usePendingDateRange/usePendingDateRange.js";
|
|
10
|
+
import { usePresetOptions as Ke } from "../../hooks/usePresetOptions/usePresetOptions.js";
|
|
11
|
+
import { useResetKey as ke } from "../../hooks/useResetKey/useResetKey.js";
|
|
12
|
+
import { useSelectedPreset as Ie } from "../../hooks/useSelectedPreset/useSelectedPreset.js";
|
|
13
|
+
import { spanWholeDays as Me } from "../../utils/whole-days/whole-days.js";
|
|
14
|
+
import { CustomDateRangeFilterDropdownContext as Ne } from "./custom-date-range-filter-dropdown.context.js";
|
|
15
15
|
import { useCallback as n } from "react";
|
|
16
|
-
import { jsx as
|
|
17
|
-
var
|
|
18
|
-
const { closeOnApply:
|
|
16
|
+
import { jsx as Ue } from "react/jsx-runtime";
|
|
17
|
+
var en = ({ animationDuration: K = 500, appliedRangeDisplay: k = "compact", applyOnPresetSelect: y = !1, children: I, countryCode: M = "US", dateDisplayFormat: N = "long", defaultRange: c, label: U, labelApply: _ = "Apply", labelCustomRange: j = "Custom range", labelEndDate: B = "To", labelRangeSeparator: G = "to", labelReset: T = "Clear", labelStartDate: V = "From", labelTimePeriod: W, maxDate: q, minDate: z, navigationMode: H = "independent", numberOfMonths: J = 2, position: Q = "left", presets: X, requiredDates: Y = !0, revealCalendarOnCustom: Z = !1, rollingPresets: $ = Oe, showCustomRange: S = !0, showOutsideDays: ee = !1, showPresets: ne = !0, showTime: R = !1, timeFormat: oe = "24", onApply: te }) => {
|
|
18
|
+
const { closeOnApply: D } = Ae(), re = Ke({
|
|
19
19
|
labelCustomRange: j,
|
|
20
20
|
presets: X,
|
|
21
21
|
rollingPresets: $,
|
|
22
22
|
showCustomRange: S
|
|
23
|
-
}), { id:
|
|
24
|
-
defaultRange:
|
|
23
|
+
}), { id: se, isOpen: ae, close: t, handleOpenChange: A } = Ee(), { selectedRange: d, selectRange: r, handleRangeChange: F, clearSelectedRange: s } = xe({ defaultRange: c }), { appliedPreset: O, selectedPreset: h, applyPreset: a, clearSelectedPreset: m, markManualSelection: v, revertSelectedPreset: b, selectPreset: C } = Ie({ defaultRange: c }), { appliedRange: i, applyRange: l, clearAppliedRange: f } = ve({
|
|
24
|
+
defaultRange: c,
|
|
25
25
|
onApply: te
|
|
26
|
-
}), { appliedRangeEnds: le, appliedRangeLabel: pe } =
|
|
27
|
-
range:
|
|
26
|
+
}), { appliedRangeEnds: le, appliedRangeLabel: pe } = Le({
|
|
27
|
+
range: i,
|
|
28
28
|
countryCode: M
|
|
29
|
-
}), { canApply: ie, hasPendingSelection: ce } =
|
|
30
|
-
selectedRange:
|
|
31
|
-
appliedRange:
|
|
32
|
-
}), { isCollapsed: de, showsCalendar: me, collapseCalendar: x, hideCalendar: E, restoreCalendar: L, revealCalendarFor: w } =
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
|
|
29
|
+
}), { canApply: ie, hasPendingSelection: ce } = we({
|
|
30
|
+
selectedRange: d,
|
|
31
|
+
appliedRange: i
|
|
32
|
+
}), { isCollapsed: de, showsCalendar: me, collapseCalendar: x, hideCalendar: E, restoreCalendar: L, revealCalendarFor: w } = be({ defaultRange: c }), [Ce, u] = ke(), p = n(() => {
|
|
33
|
+
D && t();
|
|
34
|
+
}, [t, D]), fe = n(() => {
|
|
35
|
+
l(d), a(h), p();
|
|
36
36
|
}, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]),
|
|
43
|
-
|
|
37
|
+
a,
|
|
38
|
+
l,
|
|
39
|
+
p,
|
|
40
|
+
h,
|
|
41
|
+
d
|
|
42
|
+
]), g = n(() => {
|
|
43
|
+
i ? r(i) : s(), b(), L(O === "custom");
|
|
44
44
|
}, [
|
|
45
45
|
O,
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
i,
|
|
47
|
+
s,
|
|
48
48
|
L,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
b,
|
|
50
|
+
r
|
|
51
51
|
]), ue = n((e) => {
|
|
52
|
-
e ||
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
if (
|
|
52
|
+
e || g(), A(e);
|
|
53
|
+
}, [g, A]), ge = n(() => {
|
|
54
|
+
g(), t();
|
|
55
|
+
}, [t, g]), Re = n((e, o) => {
|
|
56
|
+
if (C(e, !!(o.from || o.to)), e === null) {
|
|
57
57
|
x();
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
const
|
|
61
|
-
!
|
|
60
|
+
const De = w(o);
|
|
61
|
+
!y || De || (r(o), l(o), a(e), p());
|
|
62
62
|
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
y,
|
|
64
|
+
a,
|
|
65
|
+
l,
|
|
66
|
+
p,
|
|
67
67
|
x,
|
|
68
68
|
w,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
]), he = n((e) => {
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
C,
|
|
70
|
+
r
|
|
71
|
+
]), he = n((e, o) => {
|
|
72
|
+
C(e, !0), r(o), l(o), a(e), t();
|
|
73
|
+
}, [
|
|
74
|
+
a,
|
|
75
|
+
l,
|
|
76
|
+
t,
|
|
77
|
+
C,
|
|
78
|
+
r
|
|
79
|
+
]), Pe = n((e) => {
|
|
80
|
+
const o = v();
|
|
81
|
+
F(o && !R ? {
|
|
74
82
|
...e,
|
|
75
|
-
...
|
|
83
|
+
...Me(e)
|
|
76
84
|
} : e);
|
|
77
85
|
}, [
|
|
78
86
|
F,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
]),
|
|
82
|
-
|
|
87
|
+
v,
|
|
88
|
+
R
|
|
89
|
+
]), P = n(() => {
|
|
90
|
+
s(), m(), f(), E(), u();
|
|
83
91
|
}, [
|
|
92
|
+
u,
|
|
84
93
|
f,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
t,
|
|
94
|
+
m,
|
|
95
|
+
s,
|
|
88
96
|
E
|
|
89
|
-
]),
|
|
90
|
-
|
|
91
|
-
}, [
|
|
92
|
-
|
|
97
|
+
]), ye = n(() => {
|
|
98
|
+
P(), p();
|
|
99
|
+
}, [P, p]), Se = n(() => {
|
|
100
|
+
s(), m(), f(), u();
|
|
93
101
|
}, [
|
|
102
|
+
u,
|
|
94
103
|
f,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
t
|
|
104
|
+
m,
|
|
105
|
+
s
|
|
98
106
|
]);
|
|
99
107
|
return Fe({
|
|
100
|
-
id:
|
|
108
|
+
id: se,
|
|
101
109
|
onClose: ge,
|
|
102
|
-
onReset:
|
|
103
|
-
}), /* @__PURE__ */ Ne
|
|
110
|
+
onReset: P
|
|
111
|
+
}), /* @__PURE__ */ Ue(Ne.Provider, {
|
|
104
112
|
value: {
|
|
105
113
|
animationDuration: K,
|
|
106
114
|
appliedRangeDisplay: k,
|
|
@@ -110,7 +118,7 @@ var $e = ({ animationDuration: K = 500, appliedRangeDisplay: k = "compact", appl
|
|
|
110
118
|
dateDisplayFormat: N,
|
|
111
119
|
hasPendingSelection: ce,
|
|
112
120
|
isCollapsed: de,
|
|
113
|
-
isOpen:
|
|
121
|
+
isOpen: ae,
|
|
114
122
|
label: U,
|
|
115
123
|
labelApply: _,
|
|
116
124
|
labelEndDate: B,
|
|
@@ -127,23 +135,24 @@ var $e = ({ animationDuration: K = 500, appliedRangeDisplay: k = "compact", appl
|
|
|
127
135
|
requiredDates: Y,
|
|
128
136
|
resetKey: Ce,
|
|
129
137
|
revealCalendarOnCustom: Z || !S,
|
|
130
|
-
selectedPreset:
|
|
131
|
-
selectedRange:
|
|
138
|
+
selectedPreset: h,
|
|
139
|
+
selectedRange: d,
|
|
132
140
|
showOutsideDays: ee,
|
|
133
141
|
showPresets: ne,
|
|
134
142
|
showsCalendar: me,
|
|
135
|
-
showTime:
|
|
143
|
+
showTime: R,
|
|
136
144
|
timeFormat: oe,
|
|
137
145
|
onApply: fe,
|
|
146
|
+
onApplyPreset: he,
|
|
138
147
|
onClear: Se,
|
|
139
148
|
onOpenChange: ue,
|
|
140
149
|
onPresetChange: Re,
|
|
141
|
-
onRangeChange:
|
|
142
|
-
onReset:
|
|
150
|
+
onRangeChange: Pe,
|
|
151
|
+
onReset: ye
|
|
143
152
|
},
|
|
144
153
|
children: I
|
|
145
154
|
});
|
|
146
155
|
};
|
|
147
156
|
export {
|
|
148
|
-
|
|
157
|
+
en as CustomDateRangeFilterDropdownProvider
|
|
149
158
|
};
|