@cognite/aura 0.3.1 → 0.3.2

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 (34) hide show
  1. package/DESIGN.md +1517 -2
  2. package/README.md +21 -0
  3. package/dist/components/index.d.ts +2 -2
  4. package/dist/components/index.js +37 -35
  5. package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +64 -75
  6. package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +1 -2
  7. package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +38 -49
  8. package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +64 -75
  9. package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +1 -2
  10. package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +51 -64
  11. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +146 -161
  12. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +1 -2
  13. package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +124 -137
  14. package/dist/components/ui/core/date-time-pickers/index.d.ts +2 -0
  15. package/dist/components/ui/core/date-time-pickers/index.js +6 -4
  16. package/dist/components/ui/core/date-time-pickers/shared/calendar/calendar.js +8 -8
  17. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +1 -1
  18. package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +1 -1
  19. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +0 -2
  20. package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +18 -34
  21. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -0
  22. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +19 -0
  23. package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +41 -0
  24. package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -0
  25. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +16 -0
  26. package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +100 -0
  27. package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +23 -0
  28. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +3 -0
  29. package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +64 -0
  30. package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +17 -15
  31. package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +83 -85
  32. package/dist/lib/use-controllable-state.js +17 -17
  33. package/dist/styles.css +1 -1
  34. package/package.json +1 -1
@@ -1,99 +1,88 @@
1
1
  import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
- import { cn as N } from "../../../../../lib/utils.js";
3
- import { Popover as w, PopoverTrigger as Y, PopoverContent as T } from "../../popover/popover.js";
4
- import { Calendar as j } from "../shared/calendar/calendar.js";
5
- import { DateTimeInput as y } from "../shared/date-time-input/date-time-input.js";
6
- import { ShortcutsPanel as H } from "../shared/shortcuts-panel/shortcuts-panel.js";
7
- import { useDateRangePicker as O } from "./use-date-range-picker.js";
8
- const F = ({
9
- value: t,
2
+ import { cn as S } from "../../../../../lib/utils.js";
3
+ import { Popover as M, PopoverTrigger as N, PopoverContent as w } from "../../popover/popover.js";
4
+ import { Calendar as Y } from "../shared/calendar/calendar.js";
5
+ import { DateTimeInput as O } from "../shared/date-time-input/date-time-input.js";
6
+ import { ShortcutsPanel as j } from "../shared/shortcuts-panel/shortcuts-panel.js";
7
+ import { useDateRangePicker as y } from "./use-date-range-picker.js";
8
+ const z = ({
9
+ value: n,
10
10
  onChange: d,
11
11
  format: p = "DD/MM/YYYY",
12
12
  placeholder: c,
13
13
  displayWeekNumber: h = !1,
14
- shortcuts: n,
14
+ shortcuts: t,
15
15
  defaultDate: m,
16
16
  className: s
17
17
  }) => {
18
18
  const {
19
19
  isOpen: a,
20
- step: o,
20
+ step: r,
21
21
  displayedMonth: v,
22
- tempStart: r,
22
+ tempStart: o,
23
23
  tempEnd: l,
24
24
  hoverDate: f,
25
- handleTogglePopover: g,
26
- handleCancel: C,
25
+ handleOpenChange: g,
27
26
  handleDateClick: D,
28
27
  handleMonthChange: u,
29
- handleDateHover: k,
30
- handleSetStep: P,
31
- handleApplyShortcut: R,
32
- inputRef: x,
33
- popoverRef: S
34
- } = O({ value: t, onChange: d, defaultDate: m });
28
+ handleDateHover: C,
29
+ handleSetStep: k,
30
+ handleApplyShortcut: P,
31
+ inputRef: R,
32
+ popoverRef: x
33
+ } = y({ value: n, onChange: d, defaultDate: m });
35
34
  return /* @__PURE__ */ e(
36
35
  "div",
37
36
  {
38
37
  "data-slot": "date-range-picker",
39
- className: N("relative w-full", s),
40
- children: /* @__PURE__ */ i(
41
- w,
42
- {
43
- open: a,
44
- onOpenChange: (M) => {
45
- M || C();
46
- },
47
- children: [
48
- /* @__PURE__ */ e(Y, { render: /* @__PURE__ */ e("div", { ref: x, className: "w-full" }), children: /* @__PURE__ */ e(
49
- y,
50
- {
51
- value: a ? [r, l] : t,
52
- format: p,
53
- placeholder: c,
54
- onClick: g,
55
- isOpen: a,
56
- variant: "date",
57
- activeRangePart: a ? o : void 0,
58
- onRangePartClick: a ? P : void 0
59
- }
60
- ) }),
61
- /* @__PURE__ */ e(
62
- T,
63
- {
64
- ref: S,
65
- className: "rounded-xl w-auto p-0",
66
- side: "bottom",
67
- align: "start",
68
- children: /* @__PURE__ */ i("div", { "data-slot": "date-range-picker-content", className: "flex flex-row", children: [
69
- n && n.length > 0 && /* @__PURE__ */ e(
70
- H,
71
- {
72
- shortcuts: n,
73
- onShortcutClick: R
74
- }
75
- ),
76
- /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(
77
- j,
78
- {
79
- displayedMonth: v,
80
- selectedRange: [r, l],
81
- hoverDate: o === "end" ? f : null,
82
- displayWeekNumber: h,
83
- onDateClick: D,
84
- onMonthChange: u,
85
- onDateHover: k
86
- }
87
- ) })
88
- ] })
89
- }
90
- )
91
- ]
92
- }
93
- )
38
+ className: S("relative w-full", s),
39
+ children: /* @__PURE__ */ i(M, { open: a, onOpenChange: g, children: [
40
+ /* @__PURE__ */ e(N, { render: /* @__PURE__ */ e("div", { ref: R, className: "w-full" }), children: /* @__PURE__ */ e(
41
+ O,
42
+ {
43
+ value: a ? [o, l] : n,
44
+ format: p,
45
+ placeholder: c,
46
+ isOpen: a,
47
+ variant: "date",
48
+ activeRangePart: a ? r : void 0,
49
+ onRangePartClick: a ? k : void 0
50
+ }
51
+ ) }),
52
+ /* @__PURE__ */ e(
53
+ w,
54
+ {
55
+ ref: x,
56
+ className: "rounded-xl w-auto p-0",
57
+ side: "bottom",
58
+ align: "start",
59
+ children: /* @__PURE__ */ i("div", { "data-slot": "date-range-picker-content", className: "flex flex-row", children: [
60
+ t && t.length > 0 && /* @__PURE__ */ e(
61
+ j,
62
+ {
63
+ shortcuts: t,
64
+ onShortcutClick: P
65
+ }
66
+ ),
67
+ /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(
68
+ Y,
69
+ {
70
+ displayedMonth: v,
71
+ selectedRange: [o, l],
72
+ hoverDate: r === "end" ? f : null,
73
+ displayWeekNumber: h,
74
+ onDateClick: D,
75
+ onMonthChange: u,
76
+ onDateHover: C
77
+ }
78
+ ) })
79
+ ] })
80
+ }
81
+ )
82
+ ] })
94
83
  }
95
84
  );
96
85
  };
97
86
  export {
98
- F as DateRangePicker
87
+ z as DateRangePicker
99
88
  };
@@ -13,8 +13,7 @@ export interface UseDateRangePickerReturn {
13
13
  tempStart: Dayjs | null;
14
14
  tempEnd: Dayjs | null;
15
15
  hoverDate: Dayjs | null;
16
- handleTogglePopover: () => void;
17
- handleCancel: () => void;
16
+ handleOpenChange: (open: boolean) => void;
18
17
  handleDateClick: (date: Dayjs) => void;
19
18
  handleMonthChange: (month: Dayjs) => void;
20
19
  handleDateHover: (date: Dayjs | null) => void;
@@ -1,82 +1,69 @@
1
- import { useRef as k, useCallback as s, useEffect as g } from "react";
2
- import b from "dayjs";
3
- import { usePopoverState as j } from "../shared/hooks/use-popover-state.js";
4
- import { useRangeDateState as H } from "../shared/hooks/use-range-date-state.js";
5
- import { useRangeStepManager as I } from "../shared/hooks/use-range-step-manager.js";
6
- const U = ({
1
+ import { useRef as E, useCallback as c, useEffect as x } from "react";
2
+ import P from "dayjs";
3
+ import { usePopoverState as b } from "../shared/hooks/use-popover-state.js";
4
+ import { useRangeDateState as j } from "../shared/hooks/use-range-date-state.js";
5
+ import { useRangeStepManager as H } from "../shared/hooks/use-range-step-manager.js";
6
+ const L = ({
7
7
  value: r,
8
8
  onChange: t,
9
- defaultDate: D = b()
9
+ defaultDate: S = P()
10
10
  }) => {
11
- const d = k(() => {
12
- }), f = k(() => {
13
- }), {
14
- isOpen: i,
15
- setIsOpen: a,
16
- popoverRef: R,
17
- inputRef: v,
18
- handleTogglePopover: y
19
- } = j({
20
- onClose: s(() => d.current(), []),
21
- onBackspace: s(() => f.current(), [])
22
- }), A = I(), { step: o, handleBack: c, handleNext: h, resetStep: n } = A, C = H({
11
+ const p = E(() => {
12
+ }), { isOpen: m, setIsOpen: s, popoverRef: u, inputRef: k } = b({
13
+ onBackspace: c(() => p.current(), [])
14
+ }), D = H(), { step: n, handleBack: o, handleNext: d, resetStep: a } = D, R = j({
23
15
  value: r,
24
- defaultDate: D,
25
- onEndDateSelected: s(
26
- (e, p) => {
27
- t([e, p]), a(!1), n();
16
+ defaultDate: S,
17
+ onEndDateSelected: c(
18
+ (e, l) => {
19
+ t([e, l]), s(!1), a();
28
20
  },
29
- [t, a, n]
21
+ [t, s, a]
30
22
  )
31
23
  }), {
32
- tempStart: P,
33
- tempEnd: B,
34
- displayedMonth: M,
35
- hoverDate: E,
36
- handleDateClick: T,
37
- handleDateHover: x,
38
- handleMonthChange: O,
39
- clearActiveSegment: u,
40
- resetDates: S
41
- } = C, l = s(() => {
42
- S(r), n();
43
- }, [S, n, r]), m = s(() => {
44
- const e = u(o);
45
- e === null ? c() : e[0] === null && e[1] === null && t(e);
46
- }, [u, o, c, t]);
47
- return g(() => {
48
- d.current = l;
49
- }, [l]), g(() => {
50
- f.current = m;
51
- }, [m]), {
52
- isOpen: i,
53
- step: o,
54
- displayedMonth: M,
55
- tempStart: P,
56
- tempEnd: B,
57
- hoverDate: E,
58
- handleTogglePopover: () => {
59
- i || l(), y();
60
- },
61
- handleCancel: () => {
62
- l(), a(!1);
24
+ tempStart: y,
25
+ tempEnd: A,
26
+ displayedMonth: B,
27
+ hoverDate: C,
28
+ handleDateClick: M,
29
+ handleDateHover: O,
30
+ handleMonthChange: g,
31
+ clearActiveSegment: i,
32
+ resetDates: h
33
+ } = R, v = c(() => {
34
+ h(r), a();
35
+ }, [h, a, r]), f = c(() => {
36
+ const e = i(n);
37
+ e === null ? o() : e[0] === null && e[1] === null && t(e);
38
+ }, [i, n, o, t]);
39
+ return x(() => {
40
+ p.current = f;
41
+ }, [f]), {
42
+ isOpen: m,
43
+ step: n,
44
+ displayedMonth: B,
45
+ tempStart: y,
46
+ tempEnd: A,
47
+ hoverDate: C,
48
+ handleOpenChange: (e) => {
49
+ v(), s(e);
63
50
  },
64
51
  handleDateClick: (e) => {
65
- T(e, o), o === "start" && h();
52
+ M(e, n), n === "start" && d();
66
53
  },
67
- handleMonthChange: O,
68
- handleDateHover: x,
54
+ handleMonthChange: g,
55
+ handleDateHover: O,
69
56
  handleSetStep: (e) => {
70
- e === "start" ? c() : h();
57
+ e === "start" ? o() : d();
71
58
  },
72
59
  handleApplyShortcut: (e) => {
73
- const p = Array.isArray(e) ? e : [e, e];
74
- t(p), a(!1), n();
60
+ const l = Array.isArray(e) ? e : [e, e];
61
+ t(l), s(!1), a();
75
62
  },
76
- inputRef: v,
77
- popoverRef: R
63
+ inputRef: k,
64
+ popoverRef: u
78
65
  };
79
66
  };
80
67
  export {
81
- U as useDateRangePicker
68
+ L as useDateRangePicker
82
69
  };
@@ -1,190 +1,175 @@
1
- import { jsx as e, jsxs as t, Fragment as te } from "react/jsx-runtime";
2
- import { useMemo as re } from "react";
3
- import { cn as ae } from "../../../../../lib/utils.js";
4
- import { Button as v } from "../../button/button.js";
5
- import { Popover as oe, PopoverTrigger as le, PopoverContent as ie } from "../../popover/popover.js";
6
- import { AmPmScroll as de } from "../shared/am-pm-scroll/am-pm-scroll.js";
7
- import { Calendar as ce } from "../shared/calendar/calendar.js";
8
- import { DateTimeInput as se } from "../shared/date-time-input/date-time-input.js";
9
- import { ShortcutsPanel as he } from "../shared/shortcuts-panel/shortcuts-panel.js";
10
- import { TimePickerScroll as f } from "../shared/time-picker-scroll/time-picker-scroll.js";
11
- import { convert12HourTo24Hour as C } from "../utils/time-utils.js";
12
- import { useDateTimeRangePicker as me } from "./use-date-time-range-picker.js";
13
- const He = ({
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import { useMemo as te } from "react";
3
+ import { cn as ne } from "../../../../../lib/utils.js";
4
+ import { Button as p } from "../../button/button.js";
5
+ import { Popover as re, PopoverTrigger as ae, PopoverContent as oe } from "../../popover/popover.js";
6
+ import { Calendar as le } from "../shared/calendar/calendar.js";
7
+ import { DateTimeInput as ie } from "../shared/date-time-input/date-time-input.js";
8
+ import { ShortcutsPanel as de } from "../shared/shortcuts-panel/shortcuts-panel.js";
9
+ import { TimePickerPanel as k } from "../shared/time-picker-panel/time-picker-panel.js";
10
+ import { convert12HourTo24Hour as b } from "../utils/time-utils.js";
11
+ import { useDateTimeRangePicker as ce } from "./use-date-time-range-picker.js";
12
+ const be = ({
14
13
  value: x,
15
- onChange: P,
16
- format: k = "DD/MM/YYYY HH:mm",
17
- placeholder: b,
18
- displayWeekNumber: N = !1,
14
+ onChange: H,
15
+ format: M = "DD/MM/YYYY HH:mm",
16
+ placeholder: D,
17
+ displayWeekNumber: S = !1,
19
18
  shortcuts: c,
20
- timeFormat: r = "24h",
21
- defaultDate: S,
22
- className: H
19
+ timeFormat: n = "24h",
20
+ defaultDate: A,
21
+ className: N
23
22
  }) => {
24
23
  const {
25
24
  isOpen: l,
26
- step: n,
27
- displayedMonth: M,
28
- tempStart: a,
29
- tempEnd: o,
30
- hoverDate: A,
25
+ step: t,
26
+ displayedMonth: T,
27
+ tempStart: r,
28
+ tempEnd: a,
29
+ hoverDate: y,
31
30
  tempStartHour: i,
32
- tempStartMinute: s,
31
+ tempStartMinute: m,
33
32
  tempEndHour: d,
34
33
  tempEndMinute: h,
35
- startAmPm: m,
36
- endAmPm: p,
37
- handleTogglePopover: D,
38
- handleSetStep: y,
39
- handleDateClick: T,
34
+ startAmPm: s,
35
+ endAmPm: u,
36
+ handleOpenChange: f,
37
+ handleSetStep: R,
38
+ handleDateClick: E,
40
39
  handleMonthChange: w,
41
- handleDateHover: R,
42
- handleStartHourChange: E,
43
- handleStartMinuteChange: Y,
44
- handleEndHourChange: j,
45
- handleEndMinuteChange: B,
46
- handleStartAmPmChange: O,
47
- handleEndAmPmChange: W,
48
- handleNext: I,
49
- handleApply: L,
50
- handleCancel: g,
51
- handleBack: V,
52
- handleApplyShortcut: q,
53
- popoverRef: z,
54
- inputRef: G
55
- } = me({
40
+ handleDateHover: Y,
41
+ handleStartHourChange: j,
42
+ handleStartMinuteChange: B,
43
+ handleEndHourChange: O,
44
+ handleEndMinuteChange: W,
45
+ handleStartAmPmChange: I,
46
+ handleEndAmPmChange: L,
47
+ handleNext: V,
48
+ handleApply: q,
49
+ handleBack: z,
50
+ handleApplyShortcut: G,
51
+ popoverRef: J,
52
+ inputRef: K
53
+ } = ce({
56
54
  value: x,
57
- onChange: P,
58
- timeFormat: r,
59
- defaultDate: S
60
- }), J = n === "start" ? a !== null : o !== null, K = n === "start" ? "Next" : "Apply", Q = n === "start" ? I : L, U = n === "start" ? i : d, X = n === "start" ? s : h, Z = n === "start" ? m : p, _ = n === "start" ? E : j, $ = n === "start" ? Y : B, F = n === "start" ? O : W, ee = re(() => {
61
- const u = a ? a.hour(
62
- r === "12h" ? C(i, m) : i
63
- ).minute(s) : null, ne = o ? o.hour(
64
- r === "12h" ? C(d, p) : d
55
+ onChange: H,
56
+ timeFormat: n,
57
+ defaultDate: A
58
+ }), Q = t === "start" ? r !== null : a !== null, U = t === "start" ? "Next" : "Apply", X = t === "start" ? V : q, g = t === "start" ? i : d, v = t === "start" ? m : h, Z = t === "start" ? s : u, C = t === "start" ? j : O, P = t === "start" ? B : W, _ = t === "start" ? I : L, $ = te(() => {
59
+ const F = r ? r.hour(
60
+ n === "12h" ? b(i, s) : i
61
+ ).minute(m) : null, ee = a ? a.hour(
62
+ n === "12h" ? b(d, u) : d
65
63
  ).minute(h) : null;
66
- return [u, ne];
64
+ return [F, ee];
67
65
  }, [
66
+ r,
68
67
  a,
69
- o,
70
68
  i,
71
- s,
69
+ m,
72
70
  d,
73
71
  h,
74
- m,
75
- p,
76
- r
72
+ s,
73
+ u,
74
+ n
77
75
  ]);
78
76
  return /* @__PURE__ */ e(
79
77
  "div",
80
78
  {
81
79
  "data-slot": "date-time-range-picker",
82
- className: ae("relative w-full", H),
83
- children: /* @__PURE__ */ t(
84
- oe,
85
- {
86
- open: l,
87
- onOpenChange: (u) => {
88
- u || g();
89
- },
90
- children: [
91
- /* @__PURE__ */ e(le, { render: /* @__PURE__ */ e("div", { ref: G, className: "w-full" }), children: /* @__PURE__ */ e(
92
- se,
93
- {
94
- value: ee,
95
- format: k,
96
- placeholder: b,
97
- onClick: D,
98
- isOpen: l,
99
- variant: "datetime",
100
- activeRangePart: l ? n : void 0,
101
- onRangePartClick: l ? y : void 0
102
- }
103
- ) }),
104
- /* @__PURE__ */ e(
105
- ie,
80
+ className: ne("relative w-full", N),
81
+ children: /* @__PURE__ */ o(re, { open: l, onOpenChange: f, children: [
82
+ /* @__PURE__ */ e(ae, { render: /* @__PURE__ */ e("div", { ref: K, className: "w-full" }), children: /* @__PURE__ */ e(
83
+ ie,
84
+ {
85
+ value: $,
86
+ format: M,
87
+ placeholder: D,
88
+ isOpen: l,
89
+ variant: "datetime",
90
+ activeRangePart: l ? t : void 0,
91
+ onRangePartClick: l ? R : void 0
92
+ }
93
+ ) }),
94
+ /* @__PURE__ */ e(
95
+ oe,
96
+ {
97
+ ref: J,
98
+ className: "rounded-xl w-auto p-0",
99
+ side: "bottom",
100
+ align: "start",
101
+ children: /* @__PURE__ */ o(
102
+ "div",
106
103
  {
107
- ref: z,
108
- className: "rounded-xl w-auto p-0",
109
- side: "bottom",
110
- align: "start",
111
- children: /* @__PURE__ */ t(
112
- "div",
113
- {
114
- "data-slot": "date-time-range-picker-content",
115
- className: "flex flex-col",
116
- children: [
117
- /* @__PURE__ */ t("div", { className: "flex flex-row", children: [
118
- c && c.length > 0 && /* @__PURE__ */ e(
119
- he,
120
- {
121
- shortcuts: c,
122
- onShortcutClick: q
123
- }
124
- ),
125
- /* @__PURE__ */ e("div", { className: "p-3 border-r border-border", children: /* @__PURE__ */ e(
126
- ce,
127
- {
128
- displayedMonth: M,
129
- selectedRange: [a, o],
130
- hoverDate: n === "end" ? A : null,
131
- displayWeekNumber: N,
132
- onDateClick: T,
133
- onMonthChange: w,
134
- onDateHover: R
135
- }
136
- ) }),
137
- /* @__PURE__ */ t("div", { className: "flex items-stretch", children: [
138
- /* @__PURE__ */ e("div", { className: "px-3", children: /* @__PURE__ */ e(
139
- f,
140
- {
141
- value: U,
142
- onChange: _,
143
- type: "hour",
144
- timeFormat: r
145
- }
146
- ) }),
147
- /* @__PURE__ */ e("div", { className: "w-px bg-border shrink-0 self-stretch" }),
148
- /* @__PURE__ */ e("div", { className: "px-3", children: /* @__PURE__ */ e(
149
- f,
150
- {
151
- value: X,
152
- onChange: $,
153
- type: "minute"
154
- }
155
- ) }),
156
- r === "12h" && /* @__PURE__ */ t(te, { children: [
157
- /* @__PURE__ */ e("div", { className: "w-px bg-border shrink-0 self-stretch" }),
158
- /* @__PURE__ */ e("div", { className: "px-3", children: /* @__PURE__ */ e(de, { value: Z, onChange: F }) })
159
- ] })
160
- ] })
161
- ] }),
162
- /* @__PURE__ */ t("div", { className: "flex p-2 justify-between items-center self-stretch border-t border-border", children: [
163
- /* @__PURE__ */ e(v, { variant: "ghost", onClick: g, children: "Cancel" }),
164
- /* @__PURE__ */ t("div", { className: "flex gap-2", children: [
165
- n === "end" && /* @__PURE__ */ e(v, { variant: "ghost", onClick: V, children: "Back" }),
166
- /* @__PURE__ */ e(
167
- v,
168
- {
169
- variant: "secondary",
170
- onClick: Q,
171
- disabled: !J,
172
- children: K
173
- }
174
- )
175
- ] })
176
- ] })
177
- ]
178
- }
179
- )
104
+ "data-slot": "date-time-range-picker-content",
105
+ className: "flex flex-col",
106
+ children: [
107
+ /* @__PURE__ */ o("div", { className: "flex flex-row", children: [
108
+ c && c.length > 0 && /* @__PURE__ */ e(
109
+ de,
110
+ {
111
+ shortcuts: c,
112
+ onShortcutClick: G
113
+ }
114
+ ),
115
+ /* @__PURE__ */ e("div", { className: "p-3 border-r border-border", children: /* @__PURE__ */ e(
116
+ le,
117
+ {
118
+ displayedMonth: T,
119
+ selectedRange: [r, a],
120
+ hoverDate: t === "end" ? y : null,
121
+ displayWeekNumber: S,
122
+ onDateClick: E,
123
+ onMonthChange: w,
124
+ onDateHover: Y
125
+ }
126
+ ) }),
127
+ n === "12h" ? /* @__PURE__ */ e(
128
+ k,
129
+ {
130
+ hour: g,
131
+ minute: v,
132
+ amPm: Z,
133
+ timeFormat: "12h",
134
+ onHourChange: C,
135
+ onMinuteChange: P,
136
+ onAmPmChange: _
137
+ }
138
+ ) : /* @__PURE__ */ e(
139
+ k,
140
+ {
141
+ hour: g,
142
+ minute: v,
143
+ timeFormat: "24h",
144
+ onHourChange: C,
145
+ onMinuteChange: P
146
+ }
147
+ )
148
+ ] }),
149
+ /* @__PURE__ */ o("div", { className: "flex p-2 justify-between items-center self-stretch border-t border-border", children: [
150
+ /* @__PURE__ */ e(p, { variant: "ghost", onClick: () => f(!1), children: "Cancel" }),
151
+ /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
152
+ t === "end" && /* @__PURE__ */ e(p, { variant: "ghost", onClick: z, children: "Back" }),
153
+ /* @__PURE__ */ e(
154
+ p,
155
+ {
156
+ variant: "secondary",
157
+ onClick: X,
158
+ disabled: !Q,
159
+ children: U
160
+ }
161
+ )
162
+ ] })
163
+ ] })
164
+ ]
180
165
  }
181
166
  )
182
- ]
183
- }
184
- )
167
+ }
168
+ )
169
+ ] })
185
170
  }
186
171
  );
187
172
  };
188
173
  export {
189
- He as DateTimeRangePicker
174
+ be as DateTimeRangePicker
190
175
  };