@pibit.ai/cure-design-system 0.6.4 → 0.6.5

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 (32) hide show
  1. package/dist/applications/date-picker/calendar.d.ts +1 -1
  2. package/dist/applications/date-picker/calendar.d.ts.map +1 -1
  3. package/dist/applications/date-picker/calendar.js +162 -157
  4. package/dist/applications/date-picker/cell.d.ts.map +1 -1
  5. package/dist/applications/date-picker/cell.js +58 -51
  6. package/dist/applications/date-picker/date-input.d.ts +2 -2
  7. package/dist/applications/date-picker/date-input.d.ts.map +1 -1
  8. package/dist/applications/date-picker/date-input.js +21 -17
  9. package/dist/applications/date-picker/date-picker.d.ts +4 -1
  10. package/dist/applications/date-picker/date-picker.d.ts.map +1 -1
  11. package/dist/applications/date-picker/date-picker.js +136 -116
  12. package/dist/applications/date-picker/date-range-picker.d.ts +4 -0
  13. package/dist/applications/date-picker/date-range-picker.d.ts.map +1 -1
  14. package/dist/applications/date-picker/date-range-picker.js +245 -197
  15. package/dist/applications/date-picker/date-time-calendar.d.ts +1 -1
  16. package/dist/applications/date-picker/date-time-calendar.d.ts.map +1 -1
  17. package/dist/applications/date-picker/date-time-calendar.js +70 -60
  18. package/dist/applications/date-picker/range-calendar.d.ts +1 -1
  19. package/dist/applications/date-picker/range-calendar.d.ts.map +1 -1
  20. package/dist/applications/date-picker/range-calendar.js +99 -90
  21. package/dist/applications/date-picker/range-preset.d.ts +4 -1
  22. package/dist/applications/date-picker/range-preset.d.ts.map +1 -1
  23. package/dist/applications/date-picker/range-preset.js +23 -17
  24. package/dist/applications/date-picker/sizes.d.ts +12 -0
  25. package/dist/applications/date-picker/sizes.d.ts.map +1 -0
  26. package/dist/applications/date-picker/sizes.js +22 -0
  27. package/dist/applications/date-picker/styles.js +1 -1
  28. package/dist/applications/date-picker/time-field.js +21 -21
  29. package/dist/primitives/select/multi-select.d.ts.map +1 -1
  30. package/dist/primitives/select/multi-select.js +419 -422
  31. package/dist/styles/components.css +1 -1
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-range-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,SAAS,EACV,MAAM,uBAAuB,CAAC;AA0C/B,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB,CAAC,SAAS,CAAC;IAC/E,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kDAAkD;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,GAAI,wSAyB7B,oBAAoB,4CAqatB,CAAC"}
1
+ {"version":3,"file":"date-range-picker.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-range-picker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,SAAS,EACV,MAAM,uBAAuB,CAAC;AAyE/B,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB,CAAC,SAAS,CAAC;IAC/E,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,kDAAkD;IAClD,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,GAAI,wSAyB7B,oBAAoB,4CA+btB,CAAC"}
@@ -1,174 +1,202 @@
1
- import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
- import { useState as y, useRef as mt, useEffect as E, useMemo as U } from "react";
3
- import { today as nt, getLocalTimeZone as w } from "@internationalized/date";
4
- import { Calendar as ft } from "@untitledui/icons";
5
- import { useDateFormatter as pt } from "react-aria";
6
- import { useLocale as xt, DateRangePicker as ut, Group as yt, Popover as bt, Dialog as Nt } from "react-aria-components";
7
- import { Select as b } from "../../primitives/select/select.js";
8
- import { cx as I } from "../../utils/cn.js";
9
- import { getDateRangePresets as St, PRESET_LABELS as B, detectDateRangePresetKey as ht, getDateRangeFromPresetKey as X } from "./date-range-presets.js";
10
- import { DateInput as A } from "./date-input.js";
11
- import { RangeCalendar as vt } from "./range-calendar.js";
12
- import { RangePresetButton as Dt } from "./range-preset.js";
13
- import { Button as L } from "../../primitives/button/button.js";
14
- function N(d) {
15
- if (!d || typeof d.year != "number")
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { useState as S, useRef as ft, useEffect as j, useMemo as V } from "react";
3
+ import { today as pt, getLocalTimeZone as O } from "@internationalized/date";
4
+ import { Calendar as ut } from "@untitledui/icons";
5
+ import { useDateFormatter as xt } from "react-aria";
6
+ import { useLocale as bt, DateRangePicker as yt, Group as Nt, Popover as St, Dialog as vt } from "react-aria-components";
7
+ import { Select as v } from "../../primitives/select/select.js";
8
+ import { cx as c } from "../../utils/cn.js";
9
+ import { getDateRangePresets as ht, PRESET_LABELS as G, detectDateRangePresetKey as Dt, getDateRangeFromPresetKey as T } from "./date-range-presets.js";
10
+ import { DateInput as C } from "./date-input.js";
11
+ import { RangeCalendar as _t } from "./range-calendar.js";
12
+ import { RangePresetButton as zt } from "./range-preset.js";
13
+ import { Button as w } from "../../primitives/button/button.js";
14
+ const gt = {
15
+ xs: {
16
+ text: "text-xs",
17
+ presetColumn: "w-28",
18
+ select: "sm",
19
+ // Select has no xs size, so its trigger is brought down to 28px here.
20
+ timeSelect: "w-24 [&_button>span]:h-7 [&_button>span]:py-1 [&_svg]:size-3.5",
21
+ button: "xs",
22
+ buttonClassName: "py-[5px]"
23
+ },
24
+ sm: {
25
+ text: "text-sm",
26
+ presetColumn: "w-32",
27
+ select: "sm",
28
+ timeSelect: "w-[115px]",
29
+ button: "sm",
30
+ buttonClassName: "py-1.5"
31
+ },
32
+ md: {
33
+ text: "text-sm",
34
+ presetColumn: "w-36",
35
+ select: "md",
36
+ timeSelect: "w-[120px] [&_button>span]:h-10",
37
+ button: "md",
38
+ buttonClassName: void 0
39
+ }
40
+ };
41
+ function h(n) {
42
+ if (!n || typeof n.year != "number")
16
43
  return !1;
17
- const _ = d, { year: l, month: p, day: i } = _;
18
- return l >= 1e3 && l <= 9999 && p >= 1 && p <= 12 && i >= 1 && i <= 31;
44
+ const K = n, { year: o, month: x, day: d } = K;
45
+ return o >= 1e3 && o <= 9999 && x >= 1 && x <= 12 && d >= 1 && d <= 31;
19
46
  }
20
- const Mt = ({
21
- value: d,
22
- defaultValue: _,
23
- onChange: l,
24
- onApply: p,
25
- onCancel: i,
26
- onReset: M,
27
- headerLabel: V = "Selected date range for",
28
- rangeFieldOptions: O = [
47
+ const Wt = ({
48
+ value: n,
49
+ defaultValue: K,
50
+ onChange: o,
51
+ onApply: x,
52
+ onCancel: d,
53
+ onReset: W,
54
+ headerLabel: tt = "Selected date range for",
55
+ rangeFieldOptions: Y = [
29
56
  { label: "Created date", value: "created_date" },
30
57
  { label: "Proposed Effective date", value: "proposed_effective_date" }
31
58
  ],
32
- selectedRangeField: T,
33
- onRangeFieldChange: j,
59
+ selectedRangeField: et,
60
+ onRangeFieldChange: R,
34
61
  timezoneLabel: Pt = "(GMT-8:00) Pacific Time",
35
- enableTimeSelection: G = !0,
36
- timeOptions: D,
62
+ enableTimeSelection: q = !0,
63
+ timeOptions: g,
37
64
  startTime: P,
38
- endTime: g,
39
- onTimeChange: c,
40
- showFieldDropdown: C = !0,
41
- size: tt = "xs",
42
- buttonClassName: et,
43
- iconClassName: rt,
44
- ...st
65
+ endTime: k,
66
+ onTimeChange: m,
67
+ showFieldDropdown: st = !0,
68
+ size: $ = "xs",
69
+ buttonClassName: rt,
70
+ iconClassName: at,
71
+ ...lt
45
72
  }) => {
46
- var H, J;
47
- const { locale: S } = xt(), at = [nt(w())], W = pt({
73
+ var U, X;
74
+ const { locale: D } = bt(), b = $ === "lg" ? "md" : $, l = gt[b], ot = [pt(O())], Z = xt({
48
75
  month: "2-digit",
49
76
  day: "2-digit",
50
77
  year: "numeric"
51
- }), [r, x] = y(d ?? _ ?? null), [lt, h] = y(null), [Y, u] = y("Select date"), k = mt(!1), [K, ot] = y(!1);
52
- E(() => {
53
- d !== void 0 && x(d);
54
- }, [d]);
55
- const q = U(
56
- () => (O || []).map((e) => ({
78
+ }), [s, y] = S(n ?? K ?? null), [ct, _] = S(null), [F, N] = S("Select date"), E = ft(!1), [I, it] = S(!1);
79
+ j(() => {
80
+ n !== void 0 && y(n);
81
+ }, [n]);
82
+ const H = V(
83
+ () => (Y || []).map((e) => ({
57
84
  id: e.value,
58
85
  label: e.label
59
86
  })),
60
- [O]
61
- ), m = U(() => {
62
- if (D && D.length > 0)
63
- return D.map((t) => ({ id: t.value, label: t.label }));
87
+ [Y]
88
+ ), f = V(() => {
89
+ if (g && g.length > 0)
90
+ return g.map((t) => ({ id: t.value, label: t.label }));
64
91
  const e = [];
65
92
  for (let t = 0; t < 24; t++)
66
- for (let s of [0, 30]) {
67
- const n = (t + 11) % 12 + 1, v = t < 12 ? "am" : "pm", f = `${n}:${s === 0 ? "00" : "30"} ${v}`;
68
- e.push({ id: f, label: f });
93
+ for (let r of [0, 30]) {
94
+ const p = (t + 11) % 12 + 1, z = t < 12 ? "am" : "pm", u = `${p}:${r === 0 ? "00" : "30"} ${z}`;
95
+ e.push({ id: u, label: u });
69
96
  }
70
97
  return e.push({ id: "11:59 pm", label: "11:59 pm" }), e;
71
- }, [D]), [Z, R] = y(
72
- P ?? ((H = m == null ? void 0 : m[0]) == null ? void 0 : H.id) ?? "12:00 am"
73
- ), [F, $] = y(
74
- g ?? ((J = m == null ? void 0 : m[0]) == null ? void 0 : J.id) ?? "12:00 am"
98
+ }, [g]), [J, B] = S(
99
+ P ?? ((U = f == null ? void 0 : f[0]) == null ? void 0 : U.id) ?? "12:00 am"
100
+ ), [Q, M] = S(
101
+ k ?? ((X = f == null ? void 0 : f[0]) == null ? void 0 : X.id) ?? "12:00 am"
75
102
  );
76
- E(() => {
77
- P !== void 0 && R(P);
78
- }, [P]), E(() => {
79
- g !== void 0 && $(g);
80
- }, [g]);
81
- const it = (e, t) => {
82
- R(e), $(t), c == null || c({ startTime: e, endTime: t });
83
- }, ct = r != null && r.start && N(r.start) ? W.format(r.start.toDate(w())) : "Select date", dt = r != null && r.end && N(r.end) ? W.format(r.end.toDate(w())) : "Select date", z = (() => {
84
- const e = St(S);
103
+ j(() => {
104
+ P !== void 0 && B(P);
105
+ }, [P]), j(() => {
106
+ k !== void 0 && M(k);
107
+ }, [k]);
108
+ const dt = (e, t) => {
109
+ B(e), M(t), m == null || m({ startTime: e, endTime: t });
110
+ }, mt = s != null && s.start && h(s.start) ? Z.format(s.start.toDate(O())) : "Select date", nt = s != null && s.end && h(s.end) ? Z.format(s.end.toDate(O())) : "Select date", L = (() => {
111
+ const e = ht(D);
85
112
  return Object.fromEntries(
86
- Object.entries(B).map(
87
- ([t, s]) => [t, { label: s, value: e[t] }]
113
+ Object.entries(G).map(
114
+ ([t, r]) => [t, { label: r, value: e[t] }]
88
115
  )
89
116
  );
90
117
  })();
91
- return E(() => {
92
- if (!(r != null && r.start) || !(r != null && r.end)) {
93
- u("Select date");
118
+ return j(() => {
119
+ if (!(s != null && s.start) || !(s != null && s.end)) {
120
+ N("Select date");
94
121
  return;
95
122
  }
96
- const e = ht(r, S);
97
- u(e ? B[e] : "");
98
- }, [r, S]), /* @__PURE__ */ o(
99
- ut,
123
+ const e = Dt(s, D);
124
+ N(e ? G[e] : "");
125
+ }, [s, D]), /* @__PURE__ */ i(
126
+ yt,
100
127
  {
101
128
  "aria-label": "Date range picker",
102
129
  shouldCloseOnSelect: !1,
103
- ...st,
104
- value: r,
130
+ ...lt,
131
+ value: s,
105
132
  onOpenChange: (e) => {
106
- if (ot(e), !e && !k.current && (i == null || i()), e) {
107
- k.current = !1;
108
- const t = r == null ? void 0 : r.preset;
133
+ if (it(e), !e && !E.current && (d == null || d()), e) {
134
+ E.current = !1;
135
+ const t = s == null ? void 0 : s.preset;
109
136
  if (t) {
110
- const n = X(t, S);
111
- x(n), l == null || l(n);
137
+ const p = T(t, D);
138
+ y(p), o == null || o(p);
112
139
  }
113
- const s = t ? X(t, S).start : r == null ? void 0 : r.start;
114
- s && h(s);
140
+ const r = t ? T(t, D).start : s == null ? void 0 : s.start;
141
+ r && _(r);
115
142
  }
116
143
  },
117
144
  onChange: (e) => {
118
145
  if (!(e != null && e.start) || !(e != null && e.end)) {
119
- x(e), u(""), l == null || l(e);
146
+ y(e), N(""), o == null || o(e);
120
147
  return;
121
148
  }
122
- const { start: t, end: s } = e, n = !(r != null && r.start) || t.compare(r.start) !== 0, v = !(r != null && r.end) || s.compare(r.end) !== 0;
123
- if (v && N(s) ? h(s) : n && N(t) && h(t), !N(t) || !N(s)) {
124
- x(e), u(""), l == null || l(e);
149
+ const { start: t, end: r } = e, p = !(s != null && s.start) || t.compare(s.start) !== 0, z = !(s != null && s.end) || r.compare(s.end) !== 0;
150
+ if (z && h(r) ? _(r) : p && h(t) && _(t), !h(t) || !h(r)) {
151
+ y(e), N(""), o == null || o(e);
125
152
  return;
126
153
  }
127
- const Q = t.compare(s);
128
- let f = { start: t, end: s };
129
- Q > 0 && (n && !v ? f = { start: t, end: t } : v && !n ? f = { start: s, end: s } : f = { start: t, end: t }), x(f), u(""), l == null || l(f);
154
+ const A = t.compare(r);
155
+ let u = { start: t, end: r };
156
+ A > 0 && (p && !z ? u = { start: t, end: t } : z && !p ? u = { start: r, end: r } : u = { start: t, end: t }), y(u), N(""), o == null || o(u);
130
157
  },
131
158
  children: [
132
- /* @__PURE__ */ a(yt, { "data-popover-open": K, children: /* @__PURE__ */ a(
133
- L,
159
+ /* @__PURE__ */ a(Nt, { "data-popover-open": I, children: /* @__PURE__ */ a(
160
+ w,
134
161
  {
135
- size: tt,
162
+ size: $,
136
163
  color: "secondary",
137
- iconLeading: /* @__PURE__ */ a(ft, { className: I("size-4", rt) }),
138
- className: I(
139
- !K && et,
140
- K && "shadow-[0_0_0_4px_rgba(102,112,133,0.14)]"
164
+ iconLeading: /* @__PURE__ */ a(ut, { className: c("size-3.5", at) }),
165
+ className: c(
166
+ !I && rt,
167
+ I && "shadow-[0_0_0_4px_rgba(102,112,133,0.14)]"
141
168
  ),
142
- children: Y || (r ? `${ct} – ${dt}` : /* @__PURE__ */ a("span", { className: "text-placeholder", children: "Select dates" }))
169
+ children: F || (s ? `${mt} – ${nt}` : /* @__PURE__ */ a("span", { className: "text-placeholder", children: "Select dates" }))
143
170
  }
144
171
  ) }),
145
172
  /* @__PURE__ */ a(
146
- bt,
173
+ St,
147
174
  {
148
175
  placement: "bottom right",
149
176
  offset: 8,
150
- className: ({ isEntering: e, isExiting: t }) => I(
151
- "origin-(--trigger-anchor-point) will-change-transform",
177
+ containerPadding: 8,
178
+ className: ({ isEntering: e, isExiting: t }) => c(
179
+ "origin-(--trigger-anchor-point) will-change-transform overflow-y-auto rounded-2xl border border-secondary bg-primary shadow-[0_0_24px_rgba(10,13,18,0.12)]",
152
180
  e && "duration-150 ease-out animate-in fade-in placement-right:slide-in-from-left-0.5 placement-top:slide-in-from-bottom-0.5 placement-bottom:slide-in-from-top-0.5",
153
181
  t && "duration-100 ease-in animate-out fade-out placement-right:slide-out-to-left-0.5 placement-top:slide-out-to-bottom-0.5 placement-bottom:slide-out-to-top-0.5"
154
182
  ),
155
183
  style: { marginLeft: "80px" },
156
- children: /* @__PURE__ */ a(Nt, { className: "flex w-full rounded-2xl bg-primary ring ring-secondary focus:outline-hidden max-h-[60vh] overflow-y-auto", children: ({ close: e }) => /* @__PURE__ */ o("div", { className: "flex w-full flex-col", children: [
157
- C && /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-3 border-b border-secondary", children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
158
- /* @__PURE__ */ a("span", { className: "text-sm text-text-secondary", children: V }),
159
- q.length > 0 && /* @__PURE__ */ a(
160
- b,
184
+ children: /* @__PURE__ */ a(vt, { className: "flex w-full rounded-2xl focus:outline-hidden", children: ({ close: e }) => /* @__PURE__ */ i("div", { className: "flex w-full flex-col", children: [
185
+ st && /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-2 border-b border-secondary", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3", children: [
186
+ /* @__PURE__ */ a("span", { className: c(l.text, "text-text-secondary"), children: tt }),
187
+ H.length > 0 && /* @__PURE__ */ a(
188
+ v,
161
189
  {
162
- size: "sm",
190
+ size: l.select,
163
191
  className: "w-64",
164
- selectedKey: T,
165
- onSelectionChange: (t) => j == null ? void 0 : j(String(t)),
166
- items: q,
167
- textStyles: "text-primary text-sm font-normal",
192
+ selectedKey: et,
193
+ onSelectionChange: (t) => R == null ? void 0 : R(String(t)),
194
+ items: H,
195
+ textStyles: c("text-primary font-normal", l.text),
168
196
  children: (t) => /* @__PURE__ */ a(
169
- b.Item,
197
+ v.Item,
170
198
  {
171
- textStyles: "text-primary text-sm",
199
+ textStyles: c("text-primary", l.text),
172
200
  id: t.id,
173
201
  children: t.label
174
202
  }
@@ -176,68 +204,79 @@ const Mt = ({
176
204
  }
177
205
  )
178
206
  ] }) }),
179
- /* @__PURE__ */ o("div", { className: "flex", children: [
180
- /* @__PURE__ */ a("div", { className: "hidden w-38 flex-col gap-0.5 border-r border-solid border-secondary p-3 lg:flex", children: Object.keys(B).map(
181
- (t) => {
182
- const s = z[t];
183
- return /* @__PURE__ */ a(
184
- Dt,
185
- {
186
- value: s.value,
187
- onClick: () => {
188
- x(s.value), l == null || l(s.value), u(s.label), h(s.value.start), t === "today" && it("12:00 am", "11:59 pm");
189
- },
190
- children: s.label
191
- },
192
- t
193
- );
207
+ /* @__PURE__ */ i("div", { className: "flex", children: [
208
+ /* @__PURE__ */ a(
209
+ "div",
210
+ {
211
+ className: c(
212
+ "hidden shrink-0 flex-col gap-0.5 border-r border-solid border-secondary p-2 lg:flex",
213
+ l.presetColumn
214
+ ),
215
+ children: Object.keys(G).map(
216
+ (t) => {
217
+ const r = L[t];
218
+ return /* @__PURE__ */ a(
219
+ zt,
220
+ {
221
+ size: b,
222
+ value: r.value,
223
+ onClick: () => {
224
+ y(r.value), o == null || o(r.value), N(r.label), _(r.value.start), t === "today" && dt("12:00 am", "11:59 pm");
225
+ },
226
+ children: r.label
227
+ },
228
+ t
229
+ );
230
+ }
231
+ )
194
232
  }
195
- ) }),
196
- /* @__PURE__ */ o("div", { className: "flex flex-col", children: [
233
+ ),
234
+ /* @__PURE__ */ i("div", { className: "flex flex-1 flex-col", children: [
197
235
  /* @__PURE__ */ a(
198
- vt,
236
+ _t,
199
237
  {
200
- focusedValue: lt,
201
- onFocusChange: h,
202
- highlightedDates: at,
238
+ size: b,
239
+ focusedValue: ct,
240
+ onFocusChange: _,
241
+ highlightedDates: ot,
203
242
  presets: {
204
- lastWeek: z.lastWeek,
205
- lastMonth: z.lastMonth,
206
- lastYear: z.lastYear
243
+ lastWeek: L.lastWeek,
244
+ lastMonth: L.lastMonth,
245
+ lastYear: L.lastYear
207
246
  },
208
247
  containerClassName: "justify-around"
209
248
  }
210
249
  ),
211
- /* @__PURE__ */ o("div", { className: "flex justify-between gap-3 border-t border-secondary p-2", children: [
212
- /* @__PURE__ */ o("div", { className: "hidden items-center gap-3 md:flex", children: [
213
- /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
214
- /* @__PURE__ */ a(
215
- A,
250
+ /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 border-t border-secondary p-2", children: [
251
+ /* @__PURE__ */ i("div", { className: "hidden items-center gap-2 md:flex", children: [
252
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
253
+ /* @__PURE__ */ a(C, { slot: "start", size: b }),
254
+ q && /* @__PURE__ */ a(
255
+ v,
216
256
  {
217
- slot: "start",
218
- className: "min-w-[117px] text-sm"
219
- }
220
- ),
221
- G && /* @__PURE__ */ a(
222
- b,
223
- {
224
- size: "sm",
225
- className: "w-[115px]",
257
+ size: l.select,
258
+ className: l.timeSelect,
226
259
  popoverClassName: "w-auto min-w-max",
227
- selectedKey: Z || void 0,
260
+ selectedKey: J || void 0,
228
261
  onSelectionChange: (t) => {
229
- const s = String(t);
230
- R(s), c == null || c({
231
- startTime: s,
232
- endTime: F || ""
262
+ const r = String(t);
263
+ B(r), m == null || m({
264
+ startTime: r,
265
+ endTime: Q || ""
233
266
  });
234
267
  },
235
- items: m,
236
- textStyles: "text-primary py-0.5 text-sm font-body font-normal",
268
+ items: f,
269
+ textStyles: c(
270
+ "text-primary py-0.5 font-body font-normal",
271
+ l.text
272
+ ),
237
273
  children: (t) => /* @__PURE__ */ a(
238
- b.Item,
274
+ v.Item,
239
275
  {
240
- textStyles: "text-primary text-sm font-body font-normal",
276
+ textStyles: c(
277
+ "text-primary font-body font-normal",
278
+ l.text
279
+ ),
241
280
  id: t.id,
242
281
  children: t.label
243
282
  }
@@ -245,36 +284,45 @@ const Mt = ({
245
284
  }
246
285
  )
247
286
  ] }),
248
- /* @__PURE__ */ a("div", { className: "text-md text-quaternary", children: "–" }),
249
- /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
250
- /* @__PURE__ */ a(
251
- A,
252
- {
253
- slot: "end",
254
- className: "min-w-[117px] text-sm"
255
- }
256
- ),
257
- G && /* @__PURE__ */ a(
258
- b,
287
+ /* @__PURE__ */ a(
288
+ "div",
289
+ {
290
+ className: c(
291
+ "text-quaternary",
292
+ b === "xs" ? "text-xs" : "text-md"
293
+ ),
294
+ children: "–"
295
+ }
296
+ ),
297
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
298
+ /* @__PURE__ */ a(C, { slot: "end", size: b }),
299
+ q && /* @__PURE__ */ a(
300
+ v,
259
301
  {
260
- size: "sm",
261
- className: "w-[115px]",
302
+ size: l.select,
303
+ className: l.timeSelect,
262
304
  popoverClassName: "w-auto min-w-max",
263
- selectedKey: F || void 0,
305
+ selectedKey: Q || void 0,
264
306
  onSelectionChange: (t) => {
265
- const s = String(t);
266
- $(s), c == null || c({
267
- startTime: Z || "",
268
- endTime: s
307
+ const r = String(t);
308
+ M(r), m == null || m({
309
+ startTime: J || "",
310
+ endTime: r
269
311
  });
270
312
  },
271
- items: m,
272
- textStyles: "text-primary py-0.5 text-sm font-body font-normal",
313
+ items: f,
314
+ textStyles: c(
315
+ "text-primary py-0.5 font-body font-normal",
316
+ l.text
317
+ ),
273
318
  children: (t) => /* @__PURE__ */ a(
274
- b.Item,
319
+ v.Item,
275
320
  {
276
321
  id: t.id,
277
- textStyles: "text-primary text-sm font-body font-normal",
322
+ textStyles: c(
323
+ "text-primary font-body font-normal",
324
+ l.text
325
+ ),
278
326
  children: t.label
279
327
  }
280
328
  )
@@ -282,39 +330,39 @@ const Mt = ({
282
330
  )
283
331
  ] })
284
332
  ] }),
285
- /* @__PURE__ */ o("div", { className: "grid w-full grid-cols-2 gap-3 md:flex md:w-auto", children: [
286
- M && /* @__PURE__ */ a(
287
- L,
333
+ /* @__PURE__ */ i("div", { className: "grid w-full grid-cols-2 gap-2 md:flex md:w-auto", children: [
334
+ W && /* @__PURE__ */ a(
335
+ w,
288
336
  {
289
- size: "xs",
337
+ size: l.button,
290
338
  color: "secondary",
291
- className: "p-2",
339
+ className: l.buttonClassName,
292
340
  onClick: () => {
293
- k.current = !0, M(), e();
341
+ E.current = !0, W(), e();
294
342
  },
295
343
  children: "Reset"
296
344
  }
297
345
  ),
298
346
  /* @__PURE__ */ a(
299
- L,
347
+ w,
300
348
  {
301
- size: "xs",
349
+ size: l.button,
302
350
  color: "secondary",
303
- className: "p-2",
351
+ className: l.buttonClassName,
304
352
  onClick: () => {
305
- i == null || i(), e();
353
+ d == null || d(), e();
306
354
  },
307
355
  children: "Cancel"
308
356
  }
309
357
  ),
310
358
  /* @__PURE__ */ a(
311
- L,
359
+ w,
312
360
  {
313
- size: "xs",
361
+ size: l.button,
314
362
  color: "primary",
315
- className: "p-2",
363
+ className: l.buttonClassName,
316
364
  onClick: () => {
317
- k.current = !0, p == null || p(), e();
365
+ E.current = !0, x == null || x(), e();
318
366
  },
319
367
  children: "Apply"
320
368
  }
@@ -331,5 +379,5 @@ const Mt = ({
331
379
  );
332
380
  };
333
381
  export {
334
- Mt as DateRangePicker
382
+ Wt as DateRangePicker
335
383
  };
@@ -19,7 +19,7 @@ export interface DateTimeCalendarProps extends Omit<AriaCalendarProps<DateValue>
19
19
  timeGranularity?: TimeGranularity;
20
20
  /** The time a date gets when it is picked before any time is. Defaults to midnight. */
21
21
  defaultTime?: TimeValue;
22
- /** Visual size: "xs" (compact) or "sm" (default). */
22
+ /** Visual size: "xs" (compact, default) or "sm". */
23
23
  size?: CalendarSize;
24
24
  }
25
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"date-time-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-time-calendar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,EACT,SAAS,EACV,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAKpB,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAK3D,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,SAAS,EAAE,MAAM,SAAS,KAAG,SAU3D,CAAC;AAqCF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,iBAAiB,CAAC,SAAS,CAAC,EAC5B,OAAO,GAAG,cAAc,GAAG,UAAU,CACtC;IACC,wFAAwF;IACxF,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uFAAuF;IACvF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,qDAAqD;IACrD,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,qHAW9B,qBAAqB,4CAsGvB,CAAC"}
1
+ {"version":3,"file":"date-time-calendar.d.ts","sourceRoot":"","sources":["../../../src/applications/date-picker/date-time-calendar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,EACT,SAAS,EACV,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAMpB,kDAAkD;AAClD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAK3D,sFAAsF;AACtF,eAAO,MAAM,QAAQ,GAAI,MAAM,SAAS,EAAE,MAAM,SAAS,KAAG,SAU3D,CAAC;AA2CF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,iBAAiB,CAAC,SAAS,CAAC,EAC5B,OAAO,GAAG,cAAc,GAAG,UAAU,CACtC;IACC,wFAAwF;IACxF,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,SAAS,EAAE,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,uFAAuF;IACvF,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oDAAoD;IACpD,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,qHAW9B,qBAAqB,4CAsGvB,CAAC"}