@caspeco/casper-ui-library 9.12.0 → 9.13.0

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.
@@ -1,3 +1,3 @@
1
1
  import { DatePickerPropsBase } from './types.js';
2
- export declare function BaseDatePicker({ selectedDate, onDateChange, onMonthChange, markSundayRed, strikeThroughDates, showDaysOutsideMonth, localeString, canSelectPastDates, isExpanded, dots, weekNumbers, selectWeek, shouldDisableDate, selectedMonth: initialMonth, dateRange, isRangeDate, onRangeChange, isDisabled, redDays, disablePastMonths, disableBackwardNavigation, disableForwardNavigation, }: DatePickerPropsBase): import("react/jsx-runtime").JSX.Element;
2
+ export declare function BaseDatePicker({ selectedDate, onDateChange, selectedDates, onDatesChange, isMultiSelect, onMonthChange, markSundayRed, strikeThroughDates, showDaysOutsideMonth, localeString, canSelectPastDates, isExpanded, dots, weekNumbers, selectWeek, shouldDisableDate, selectedMonth: initialMonth, dateRange, isRangeDate, onRangeChange, isDisabled, redDays, disablePastMonths, disableBackwardNavigation, disableForwardNavigation, }: DatePickerPropsBase): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=base-date-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-date-picker.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/base-date-picker.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,mBAAmB,EAAa,MAAM,SAAS,CAAC;AAmB9D,wBAAgB,cAAc,CAAC,EAC9B,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,oBAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAiB,EACjB,IAAI,EACJ,WAAmB,EACnB,UAAkB,EAClB,iBAAiB,EACjB,aAAa,EAAE,YAAY,EAC3B,SAAS,EACT,WAAmB,EACnB,aAAa,EACb,UAAkB,EAClB,OAAY,EACZ,iBAAyB,EACzB,yBAAiC,EACjC,wBAAgC,GAChC,EAAE,mBAAmB,2CAkSrB"}
1
+ {"version":3,"file":"base-date-picker.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/base-date-picker.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,mBAAmB,EAAa,MAAM,SAAS,CAAC;AAmB9D,wBAAgB,cAAc,CAAC,EAC9B,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAqB,EACrB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,oBAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,UAAiB,EACjB,IAAI,EACJ,WAAmB,EACnB,UAAkB,EAClB,iBAAiB,EACjB,aAAa,EAAE,YAAY,EAC3B,SAAS,EACT,WAAmB,EACnB,aAAa,EACb,UAAkB,EAClB,OAAY,EACZ,iBAAyB,EACzB,yBAAiC,EACjC,wBAAgC,GAChC,EAAE,mBAAmB,2CAuTrB"}
@@ -1,248 +1,268 @@
1
- import { jsxs as x, jsx as i, Fragment as $t } from "react/jsx-runtime";
2
- import { GridItem as q, Box as bt, Grid as J } from "@chakra-ui/react";
3
- import Et, { useState as Q, useEffect as Tt, useCallback as Gt } from "react";
4
- import { DatePickerDateCell as X } from "./date-picker-date-cell.js";
5
- import { DatePickerHeader as Lt } from "./date-picker-header.js";
6
- import { DatePickerWeekCell as Pt } from "./date-picker-week-cell.js";
7
- import { hasDotOnDate as p, isDateStrikeThrough as Ut, firstLetterUpperCase as _t, hasDatePassed as zt, getWeekCellVariant as At, getDateCellVariant as Z } from "./helper.js";
8
- import { lv as Ht } from "../../node_modules/date-fns/locale/lv.js";
9
- import { lt as jt } from "../../node_modules/date-fns/locale/lt.js";
10
- import { et as Kt } from "../../node_modules/date-fns/locale/et.js";
11
- import { es as Yt } from "../../node_modules/date-fns/locale/es.js";
12
- import { fi as qt } from "../../node_modules/date-fns/locale/fi.js";
13
- import { nl as Jt } from "../../node_modules/date-fns/locale/nl.js";
14
- import { endOfMonth as N } from "../../node_modules/date-fns/endOfMonth.js";
15
- import { startOfWeek as Qt } from "../../node_modules/date-fns/startOfWeek.js";
16
- import { nlBE as Xt } from "../../node_modules/date-fns/locale/nl-BE.js";
17
- import { fr as R } from "../../node_modules/date-fns/locale/fr.js";
18
- import { sv as Zt } from "../../node_modules/date-fns/locale/sv.js";
19
- import { da as Nt } from "../../node_modules/date-fns/locale/da.js";
20
- import { nb as Rt } from "../../node_modules/date-fns/locale/nb.js";
21
- import { enGB as tr } from "../../node_modules/date-fns/locale/en-GB.js";
22
- import { enUS as rr } from "../../node_modules/date-fns/locale/en-US.js";
23
- import { format as tt } from "../../node_modules/date-fns/format.js";
24
- import { startOfMonth as F } from "../../node_modules/date-fns/startOfMonth.js";
25
- import { addDays as rt } from "../../node_modules/date-fns/addDays.js";
26
- import { isSameMonth as et } from "../../node_modules/date-fns/isSameMonth.js";
27
- import { isSameDay as f } from "../../node_modules/date-fns/isSameDay.js";
28
- import { getISOWeek as ot } from "../../node_modules/date-fns/getISOWeek.js";
29
- import { ThemeColorVariable as at, ThemeSpaceVariable as lt, ThemeFontSizeVariable as er, ThemeFontVariable as or } from "../../theme/theme-types.js";
30
- const ar = {
31
- "en-US": { locale: rr },
32
- "en-GB": { locale: tr },
33
- "nb-NO": { locale: Rt },
34
- "da-DK": { locale: Nt },
35
- "sv-SE": { locale: Zt },
36
- "nl-NL": { locale: Jt },
37
- "fi-FI": { locale: qt },
38
- "es-ES": { locale: Yt },
39
- "et-EE": { locale: Kt },
40
- "lt-LT": { locale: jt },
41
- "lv-LV": { locale: Ht },
42
- "fr-FR": { locale: R },
43
- "fr-BE": { locale: R },
44
- "nl-BE": { locale: Xt }
1
+ import { jsxs as $, jsx as i, Fragment as Tt } from "react/jsx-runtime";
2
+ import { GridItem as Z, Box as Gt, Grid as N } from "@chakra-ui/react";
3
+ import Lt, { useState as R, useEffect as At, useCallback as Pt } from "react";
4
+ import { DatePickerDateCell as tt } from "./date-picker-date-cell.js";
5
+ import { DatePickerHeader as Ut } from "./date-picker-header.js";
6
+ import { DatePickerWeekCell as _t } from "./date-picker-week-cell.js";
7
+ import { hasDotOnDate as y, isDateStrikeThrough as zt, firstLetterUpperCase as Ht, hasDatePassed as jt, getWeekCellVariant as Kt, getDateCellVariant as rt } from "./helper.js";
8
+ import { lv as Yt } from "../../node_modules/date-fns/locale/lv.js";
9
+ import { lt as qt } from "../../node_modules/date-fns/locale/lt.js";
10
+ import { et as Jt } from "../../node_modules/date-fns/locale/et.js";
11
+ import { es as Qt } from "../../node_modules/date-fns/locale/es.js";
12
+ import { fi as Xt } from "../../node_modules/date-fns/locale/fi.js";
13
+ import { nl as Zt } from "../../node_modules/date-fns/locale/nl.js";
14
+ import { endOfMonth as ot } from "../../node_modules/date-fns/endOfMonth.js";
15
+ import { startOfWeek as Nt } from "../../node_modules/date-fns/startOfWeek.js";
16
+ import { nlBE as Rt } from "../../node_modules/date-fns/locale/nl-BE.js";
17
+ import { fr as et } from "../../node_modules/date-fns/locale/fr.js";
18
+ import { sv as tr } from "../../node_modules/date-fns/locale/sv.js";
19
+ import { da as rr } from "../../node_modules/date-fns/locale/da.js";
20
+ import { nb as or } from "../../node_modules/date-fns/locale/nb.js";
21
+ import { enGB as er } from "../../node_modules/date-fns/locale/en-GB.js";
22
+ import { enUS as ar } from "../../node_modules/date-fns/locale/en-US.js";
23
+ import { isSameDay as s } from "../../node_modules/date-fns/isSameDay.js";
24
+ import { format as at } from "../../node_modules/date-fns/format.js";
25
+ import { startOfMonth as b } from "../../node_modules/date-fns/startOfMonth.js";
26
+ import { addDays as lt } from "../../node_modules/date-fns/addDays.js";
27
+ import { isSameMonth as st } from "../../node_modules/date-fns/isSameMonth.js";
28
+ import { getISOWeek as nt } from "../../node_modules/date-fns/getISOWeek.js";
29
+ import { ThemeColorVariable as ft, ThemeSpaceVariable as it, ThemeFontSizeVariable as lr, ThemeFontVariable as sr } from "../../theme/theme-types.js";
30
+ const nr = {
31
+ "en-US": { locale: ar },
32
+ "en-GB": { locale: er },
33
+ "nb-NO": { locale: or },
34
+ "da-DK": { locale: rr },
35
+ "sv-SE": { locale: tr },
36
+ "nl-NL": { locale: Zt },
37
+ "fi-FI": { locale: Xt },
38
+ "es-ES": { locale: Qt },
39
+ "et-EE": { locale: Jt },
40
+ "lt-LT": { locale: qt },
41
+ "lv-LV": { locale: Yt },
42
+ "fr-FR": { locale: et },
43
+ "fr-BE": { locale: et },
44
+ "nl-BE": { locale: Rt }
45
45
  };
46
- function Gr({
46
+ function Pr({
47
47
  selectedDate: l,
48
- onDateChange: S,
49
- onMonthChange: V,
50
- markSundayRed: st,
51
- strikeThroughDates: nt,
52
- showDaysOutsideMonth: it = !1,
53
- localeString: ft,
54
- canSelectPastDates: ct,
55
- isExpanded: C = !0,
56
- dots: c,
48
+ onDateChange: k,
49
+ selectedDates: c,
50
+ onDatesChange: B,
51
+ isMultiSelect: w = !1,
52
+ onMonthChange: E,
53
+ markSundayRed: mt,
54
+ strikeThroughDates: ct,
55
+ showDaysOutsideMonth: Dt = !1,
56
+ localeString: pt,
57
+ canSelectPastDates: ht,
58
+ isExpanded: I = !0,
59
+ dots: D,
57
60
  weekNumbers: a = !1,
58
- selectWeek: m = !1,
59
- shouldDisableDate: W,
60
- selectedMonth: M,
61
+ selectWeek: p = !1,
62
+ shouldDisableDate: T,
63
+ selectedMonth: g,
61
64
  dateRange: e,
62
- isRangeDate: $ = !1,
63
- onRangeChange: s,
64
- isDisabled: mt = !1,
65
- redDays: Dt = [],
66
- disablePastMonths: pt = !1,
67
- disableBackwardNavigation: ht = !1,
68
- disableForwardNavigation: ut = !1
65
+ isRangeDate: G = !1,
66
+ onRangeChange: n,
67
+ isDisabled: ut = !1,
68
+ redDays: yt = [],
69
+ disablePastMonths: St = !1,
70
+ disableBackwardNavigation: dt = !1,
71
+ disableForwardNavigation: Ct = !1
69
72
  }) {
70
- const [n, b] = Q(M || l || /* @__PURE__ */ new Date()), [E, O] = Q(!0), { locale: D } = ar[ft];
71
- Tt(() => {
72
- l && b(M || l || /* @__PURE__ */ new Date());
73
- }, [M, C, l]);
74
- const dt = (o) => {
75
- b(o), V && V(o);
76
- }, h = Gt(
73
+ const [f, L] = R(g || l || /* @__PURE__ */ new Date()), [A, v] = R(!0), { locale: h } = nr[pt];
74
+ At(() => {
75
+ l && L(g || l || /* @__PURE__ */ new Date());
76
+ }, [g, I, l]);
77
+ const Ot = (o) => {
78
+ L(o), E && E(o);
79
+ }, S = Pt(
77
80
  (o) => {
78
- $ ? ((t) => {
79
- if (E)
80
- s && s({ startDate: t, endDate: null }), O(!1);
81
+ const r = (t) => {
82
+ if (A)
83
+ n && n({ startDate: t, endDate: null }), v(!1);
81
84
  else if (e?.startDate && e.startDate > t)
82
- s && s({ startDate: t, endDate: null }), O(!1);
85
+ n && n({ startDate: t, endDate: null }), v(!1);
83
86
  else {
84
- if (e?.startDate && f(t, e.startDate))
87
+ if (e?.startDate && s(t, e.startDate))
85
88
  return;
86
- if (e?.startDate && s) {
87
- const k = { startDate: e.startDate, endDate: t };
88
- s(k);
89
+ if (e?.startDate && n) {
90
+ const u = { startDate: e.startDate, endDate: t };
91
+ n(u);
89
92
  }
90
- O(!0);
93
+ v(!0);
91
94
  }
92
- })(o) : S && S(o);
95
+ };
96
+ if (G)
97
+ r(o);
98
+ else if (w) {
99
+ if (B) {
100
+ const u = c?.some((m) => s(m, o)) ? (c ?? []).filter((m) => !s(m, o)) : [...c ?? [], o];
101
+ B(u);
102
+ }
103
+ } else k && k(o);
93
104
  },
94
- [S, $, E, e?.startDate, s]
105
+ [
106
+ k,
107
+ G,
108
+ A,
109
+ e?.startDate,
110
+ n,
111
+ w,
112
+ B,
113
+ c
114
+ ]
95
115
  );
96
- function yt() {
97
- const o = Qt(/* @__PURE__ */ new Date(), { locale: D });
98
- return Array.from({ length: 7 }, (r, t) => tt(rt(o, t), "eee", { locale: D }));
116
+ function Mt() {
117
+ const o = Nt(/* @__PURE__ */ new Date(), { locale: h });
118
+ return Array.from({ length: 7 }, (r, t) => at(lt(o, t), "eee", { locale: h }));
99
119
  }
100
- const St = tt(F(n), "MMMM yyyy", {
101
- locale: D
102
- }), Ct = N(n).getDate(), Mt = [a ? "v." : void 0, ...yt()], Ot = D.options?.weekStartsOn || 0, T = (F(n).getDay() - Ot + 7) % 7, kt = (7 - N(n).getDay()) % 7, gt = ["auto", "auto", "100%"], Bt = ["auto", "auto", "100%"], It = (o) => !ct && zt(o) ? !0 : W ? W(o) : !1, vt = Array.from({ length: Ct + T + kt }, (o, r) => {
103
- const t = rt(F(n), r - T), k = et(t, n), g = f(t, /* @__PURE__ */ new Date()), u = It(t) || mt, G = p(t, c?.yellowDotDates), L = p(t, c?.greenDotDates), P = p(t, c?.blueDotDates), U = p(t, c?.redDotDates), _ = p(t, c?.greyDotDates), z = Ut(t, nt) && !u;
104
- let B = !1;
105
- l && (B = f(t, l));
106
- const wt = t.getDay() === 0, A = Dt.some((Wt) => f(Wt, t)) || (st ?? !1) && wt, I = ot(t);
107
- let d = !1;
108
- m && l && (d = ot(l) === I);
109
- const H = !et(t, n), j = !!(e?.startDate && e?.endDate && t > e.startDate && t < e.endDate);
110
- let v = !1;
111
- e?.startDate && (v = f(t, e?.startDate));
112
- let w = !1, K = !1;
113
- e?.endDate && (w = f(t, e?.endDate), K = !0);
114
- const xt = Z(
115
- B || d,
116
- g,
117
- H,
118
- j,
119
- v,
120
- w,
121
- K
122
- ), Ft = At(d, g), Vt = Z(
123
- B || d,
124
- g,
125
- H,
126
- j,
127
- v,
128
- w
129
- ), Y = Math.floor(r / 7) + 1, y = r % 7 + 1;
130
- return a ? /* @__PURE__ */ x(Et.Fragment, { children: [
120
+ const kt = at(b(f), "MMMM yyyy", {
121
+ locale: h
122
+ }), Bt = ot(f).getDate(), wt = [a ? "v." : void 0, ...Mt()], It = h.options?.weekStartsOn || 0, P = (b(f).getDay() - It + 7) % 7, gt = (7 - ot(f).getDay()) % 7, vt = ["auto", "auto", "100%"], xt = ["auto", "auto", "100%"], Ft = (o) => !ht && jt(o) ? !0 : T ? T(o) : !1, Vt = Array.from({ length: Bt + P + gt }, (o, r) => {
123
+ const t = lt(b(f), r - P), u = st(t, f), m = s(t, /* @__PURE__ */ new Date()), d = Ft(t) || ut, U = y(t, D?.yellowDotDates), _ = y(t, D?.greenDotDates), z = y(t, D?.blueDotDates), H = y(t, D?.redDotDates), j = y(t, D?.greyDotDates), K = zt(t, ct) && !d;
124
+ let C = !1;
125
+ l && (C = s(t, l)), w && c && (C = c.some((W) => s(W, t)));
126
+ const Wt = t.getDay() === 0, Y = yt.some((W) => s(W, t)) || (mt ?? !1) && Wt, x = nt(t);
127
+ let O = !1;
128
+ p && l && (O = nt(l) === x);
129
+ const q = !st(t, f), J = !!(e?.startDate && e?.endDate && t > e.startDate && t < e.endDate);
130
+ let F = !1;
131
+ e?.startDate && (F = s(t, e?.startDate));
132
+ let V = !1, Q = !1;
133
+ e?.endDate && (V = s(t, e?.endDate), Q = !0);
134
+ const $t = rt(
135
+ C || O,
136
+ m,
137
+ q,
138
+ J,
139
+ F,
140
+ V,
141
+ Q
142
+ ), bt = Kt(O, m), Et = rt(
143
+ C || O,
144
+ m,
145
+ q,
146
+ J,
147
+ F,
148
+ V
149
+ ), X = Math.floor(r / 7) + 1, M = r % 7 + 1;
150
+ return a ? /* @__PURE__ */ $(Lt.Fragment, { children: [
131
151
  a && r % 7 === 0 && /* @__PURE__ */ i(
132
- q,
152
+ Z,
133
153
  {
134
154
  gridColumn: 1,
135
155
  gridRow: "1 / span 7",
136
156
  opacity: "0.24",
137
157
  borderRight: "1px solid",
138
- borderColor: at.OnSurfaceBorder
158
+ borderColor: ft.OnSurfaceBorder
139
159
  },
140
160
  `grid-${r}-${t.toUTCString()}`
141
161
  ),
142
162
  a && r % 7 === 0 && /* @__PURE__ */ i(
143
- Pt,
163
+ _t,
144
164
  {
145
- handleWeekChange: h,
165
+ handleWeekChange: S,
146
166
  date: t,
147
167
  gridIndex: r,
148
- variant: Ft,
149
- selectWeek: m,
150
- isDisabled: u
168
+ variant: bt,
169
+ selectWeek: p,
170
+ isDisabled: d
151
171
  },
152
- `week-${r}-${I}`
172
+ `week-${r}-${x}`
153
173
  ),
154
174
  /* @__PURE__ */ i(
155
- X,
175
+ tt,
156
176
  {
157
- hasBlueDot: P,
158
- hasGreenDot: L,
159
- hasYellowDot: G,
160
- hasRedDot: U,
161
- hasGreyDot: _,
177
+ hasBlueDot: z,
178
+ hasGreenDot: _,
179
+ hasYellowDot: U,
180
+ hasRedDot: H,
181
+ hasGreyDot: j,
162
182
  gridIndex: r,
163
- gridColumn: a ? y + 2 : y,
164
- gridRow: Y,
183
+ gridColumn: a ? M + 2 : M,
184
+ gridRow: X,
165
185
  day: t,
166
- handleDateChange: h,
167
- variant: Vt,
168
- isDisabled: u,
169
- isStrikeThrough: z,
170
- selectWeek: m,
171
- isHoliday: A
186
+ handleDateChange: S,
187
+ variant: Et,
188
+ isDisabled: d,
189
+ isStrikeThrough: K,
190
+ selectWeek: p,
191
+ isHoliday: Y
172
192
  },
173
193
  t.toString() + r
174
194
  )
175
- ] }, `fragment-${r}-${I}`) : k || it ? /* @__PURE__ */ i(
176
- X,
195
+ ] }, `fragment-${r}-${x}`) : u || Dt ? /* @__PURE__ */ i(
196
+ tt,
177
197
  {
178
- hasBlueDot: P,
179
- hasGreenDot: L,
180
- hasYellowDot: G,
181
- hasRedDot: U,
182
- hasGreyDot: _,
198
+ hasBlueDot: z,
199
+ hasGreenDot: _,
200
+ hasYellowDot: U,
201
+ hasRedDot: H,
202
+ hasGreyDot: j,
183
203
  gridIndex: r,
184
- gridColumn: a ? y + 1 : y,
185
- gridRow: Y,
204
+ gridColumn: a ? M + 1 : M,
205
+ gridRow: X,
186
206
  day: t,
187
- handleDateChange: h,
188
- variant: xt,
189
- isDisabled: u,
190
- isStrikeThrough: z,
191
- selectWeek: m,
192
- isHoliday: A
207
+ handleDateChange: S,
208
+ variant: $t,
209
+ isDisabled: d,
210
+ isStrikeThrough: K,
211
+ selectWeek: p,
212
+ isHoliday: Y
193
213
  },
194
214
  `${t.toString()}-${r}`
195
215
  ) : null;
196
216
  });
197
- return /* @__PURE__ */ x(bt, { w: Bt, h: gt, children: [
217
+ return /* @__PURE__ */ $(Gt, { w: xt, h: vt, children: [
198
218
  /* @__PURE__ */ i(
199
- Lt,
219
+ Ut,
200
220
  {
201
221
  selectedDate: l || /* @__PURE__ */ new Date(),
202
- onDateChange: h,
203
- isExpanded: C,
204
- onMonthChange: dt,
205
- selectedMonth: n,
206
- month: St,
207
- locale: D,
208
- selectWeek: m,
209
- disablePastMonths: pt,
210
- disableBackwardNavigation: ht,
211
- disableForwardNavigation: ut,
222
+ onDateChange: S,
223
+ isExpanded: I,
224
+ onMonthChange: Ot,
225
+ selectedMonth: f,
226
+ month: kt,
227
+ locale: h,
228
+ selectWeek: p,
229
+ disablePastMonths: St,
230
+ disableBackwardNavigation: dt,
231
+ disableForwardNavigation: Ct,
212
232
  dateRange: e,
213
- onRangeChange: s
233
+ onRangeChange: n
214
234
  }
215
235
  ),
216
- C && /* @__PURE__ */ x($t, { children: [
217
- /* @__PURE__ */ i(J, { templateColumns: a ? "48px 1px 1fr 1fr 1fr 1fr 1fr 1fr 1fr" : "repeat(7, 1fr)", children: Mt.map((o, r) => {
236
+ I && /* @__PURE__ */ $(Tt, { children: [
237
+ /* @__PURE__ */ i(N, { templateColumns: a ? "48px 1px 1fr 1fr 1fr 1fr 1fr 1fr 1fr" : "repeat(7, 1fr)", children: wt.map((o, r) => {
218
238
  let t;
219
239
  return a && r === 0 ? t = 1 : a ? t = r + 2 : t = r, o ? /* @__PURE__ */ i(
220
- q,
240
+ Z,
221
241
  {
222
242
  textAlign: "center",
223
243
  fontWeight: "500",
224
- fontFamily: or.Body,
225
- fontSize: er.Small,
244
+ fontFamily: sr.Body,
245
+ fontSize: lr.Small,
226
246
  gridColumn: t,
227
- borderRight: a && r === 0 ? `1px solid ${at.OnSurfaceBorder}` : "",
228
- pb: lt.Small,
229
- children: _t(o).slice(0, 2)
247
+ borderRight: a && r === 0 ? `1px solid ${ft.OnSurfaceBorder}` : "",
248
+ pb: it.Small,
249
+ children: Ht(o).slice(0, 2)
230
250
  },
231
251
  o
232
252
  ) : null;
233
253
  }) }),
234
254
  /* @__PURE__ */ i(
235
- J,
255
+ N,
236
256
  {
237
257
  templateColumns: a ? "48px 1px 1fr 1fr 1fr 1fr 1fr 1fr 1fr" : "repeat(7, 1fr)",
238
- rowGap: lt.Small,
258
+ rowGap: it.Small,
239
259
  flexShrink: 1,
240
- children: vt
260
+ children: Vt
241
261
  }
242
262
  )
243
263
  ] })
244
264
  ] });
245
265
  }
246
266
  export {
247
- Gr as BaseDatePicker
267
+ Pr as BaseDatePicker
248
268
  };
@@ -0,0 +1,8 @@
1
+ import { DateMultiPickerProps } from './types.js';
2
+ /**
3
+ * A datepicker that selects multiple specific dates
4
+ *
5
+ * @see Docs https://caspeco.github.io/casper-ui-library/components/date-picker#datemultipicker
6
+ */
7
+ export declare const DateMultiPicker: ({ localeString, canSelectPastDates, dots, isExpanded, markSundayRed, onMonthChange, weekNumbers, showDaysOutsideMonth, selectedMonth, onDatesChange, selectedDates, shouldDisableDate, strikeThroughDates, isDisabled, redDays, disablePastMonths, disableBackwardNavigation, disableForwardNavigation, }: DateMultiPickerProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=date-multi-picker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-multi-picker.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-multi-picker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;GAIG;AAEH,eAAO,MAAM,eAAe,GAAI,2SAmB7B,oBAAoB,4CA8BtB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { BaseDatePicker as R } from "./base-date-picker.js";
3
+ const C = ({
4
+ localeString: e,
5
+ canSelectPastDates: t,
6
+ dots: a,
7
+ isExpanded: i,
8
+ markSundayRed: o,
9
+ onMonthChange: r,
10
+ weekNumbers: n,
11
+ showDaysOutsideMonth: s,
12
+ selectedMonth: l,
13
+ onDatesChange: c,
14
+ selectedDates: d,
15
+ shouldDisableDate: g,
16
+ strikeThroughDates: D,
17
+ isDisabled: f,
18
+ redDays: m,
19
+ disablePastMonths: u,
20
+ disableBackwardNavigation: v,
21
+ disableForwardNavigation: k
22
+ }) => /* @__PURE__ */ p(
23
+ R,
24
+ {
25
+ isMultiSelect: !0,
26
+ localeString: e,
27
+ canSelectPastDates: t,
28
+ dots: a,
29
+ isExpanded: i,
30
+ markSundayRed: o,
31
+ onMonthChange: r,
32
+ weekNumbers: n,
33
+ showDaysOutsideMonth: s,
34
+ selectedMonth: l,
35
+ onDatesChange: c,
36
+ selectedDates: d,
37
+ shouldDisableDate: g,
38
+ strikeThroughDates: D,
39
+ redDays: m,
40
+ isRangeDate: !1,
41
+ selectWeek: !1,
42
+ isDisabled: f,
43
+ selectedDate: void 0,
44
+ onDateChange: void 0,
45
+ dateRange: void 0,
46
+ onRangeChange: void 0,
47
+ disablePastMonths: u,
48
+ disableBackwardNavigation: v,
49
+ disableForwardNavigation: k
50
+ }
51
+ );
52
+ export {
53
+ C as DateMultiPicker
54
+ };
@@ -3,6 +3,9 @@ export declare const BasicDatepicker: ({ date }: {
3
3
  }) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const BasicDateRangePicker: () => import("react/jsx-runtime").JSX.Element;
5
5
  export declare const BasicMinimizedDateRangePicker: () => import("react/jsx-runtime").JSX.Element;
6
+ export declare const BasicMultiDatePicker: ({ date }: {
7
+ date?: Date;
8
+ }) => import("react/jsx-runtime").JSX.Element;
6
9
  export declare const BasicWeekNumberDatePicker: ({ date }: {
7
10
  date?: Date;
8
11
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker.composition.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CAmDxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAqBhC,CAAC;AAEF,eAAO,MAAM,6BAA6B,+CAoBzC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CA8ClE,CAAC"}
1
+ {"version":3,"file":"date-picker.composition.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker.composition.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,eAAe,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CAmDxD,CAAC;AAEF,eAAO,MAAM,oBAAoB,+CAqBhC,CAAC;AAEF,eAAO,MAAM,6BAA6B,+CAoBzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CAqB7D,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,UAAU;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,4CA8ClE,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export { DatePicker } from './date-picker.js';
2
2
  export { DateRangePicker } from './date-range-picker.js';
3
3
  export { DateWeekPicker } from './date-week-picker.js';
4
- export type { DatePickerProps, DateRangePickerProps, DateWeekPickerProps } from './types.js';
4
+ export { DateMultiPicker } from './date-multi-picker.js';
5
+ export type { DatePickerProps, DateRangePickerProps, DateWeekPickerProps, DateMultiPickerProps, } from './types.js';
5
6
  export type { DatePickerPropsBase, DateRange } from './types.js';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE1F,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EACX,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACpB,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -54,6 +54,21 @@ export type DatePickerPropsBase = {
54
54
  selectedDate?: Date;
55
55
  /** A callback function called when the user changes the date. */
56
56
  onDateChange?: (date: Date) => void;
57
+ /**
58
+ * The currently selected specific dates when using multi-select.
59
+ * Each date in the array is highlighted using the active date style.
60
+ */
61
+ selectedDates?: Date[];
62
+ /**
63
+ * A callback function called when the user toggles a date in multi-select mode.
64
+ * It receives the updated array of selected dates.
65
+ */
66
+ onDatesChange?: (dates: Date[]) => void;
67
+ /**
68
+ * When set to true, the date picker allows selecting multiple specific dates.
69
+ * Clicking a date toggles it in or out of the `selectedDates` array.
70
+ */
71
+ isMultiSelect?: boolean;
57
72
  /**
58
73
  * Prop `shouldDisableDate` is a function that determines if specific dates in the DatePicker should be disabled.
59
74
  * Dates for which this function returns true will be unselectable; if it returns false, they remain selectable.
@@ -83,5 +98,6 @@ export type DatePickerPropsBase = {
83
98
  };
84
99
  export type DatePickerProps = Pick<DatePickerPropsBase, "localeString" | "canSelectPastDates" | "dots" | "isExpanded" | "markSundayRed" | "onDateChange" | "onMonthChange" | "selectedDate" | "selectedMonth" | "shouldDisableDate" | "showDaysOutsideMonth" | "strikeThroughDates" | "weekNumbers" | "isDisabled" | "redDays" | "disablePastMonths" | "disableBackwardNavigation" | "disableForwardNavigation">;
85
100
  export type DateRangePickerProps = Pick<DatePickerPropsBase, "localeString" | "canSelectPastDates" | "dateRange" | "dots" | "isExpanded" | "markSundayRed" | "onMonthChange" | "onRangeChange" | "weekNumbers" | "showDaysOutsideMonth" | "selectedMonth" | "isDisabled" | "redDays">;
101
+ export type DateMultiPickerProps = Required<Pick<DatePickerPropsBase, "selectedDates" | "onDatesChange">> & Pick<DatePickerPropsBase, "localeString" | "canSelectPastDates" | "dots" | "isExpanded" | "markSundayRed" | "onMonthChange" | "selectedMonth" | "shouldDisableDate" | "showDaysOutsideMonth" | "strikeThroughDates" | "weekNumbers" | "isDisabled" | "redDays" | "disablePastMonths" | "disableBackwardNavigation" | "disableForwardNavigation">;
86
102
  export type DateWeekPickerProps = Pick<DatePickerPropsBase, "canSelectPastDates" | "localeString" | "dots" | "isExpanded" | "markSundayRed" | "onDateChange" | "selectedDate" | "onMonthChange" | "selectedMonth" | "isDisabled" | "redDays">;
87
103
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAClB,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,C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CAAC,EAAE,OAAO,CAAC;IAErB,sFAAsF;IACtF,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IAEjB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,IAAI,CACjC,mBAAmB,EACjB,cAAc,GACd,oBAAoB,GACpB,MAAM,GACN,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,aAAa,GACb,YAAY,GACZ,SAAS,GACT,mBAAmB,GACnB,2BAA2B,GAC3B,0BAA0B,CAC5B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACtC,mBAAmB,EACjB,cAAc,GACd,oBAAoB,GACpB,WAAW,GACX,MAAM,GACN,YAAY,GACZ,eAAe,GACf,eAAe,GACf,eAAe,GACf,aAAa,GACb,sBAAsB,GACtB,eAAe,GACf,YAAY,GACZ,SAAS,CACX,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,mBAAmB,EACjB,oBAAoB,GACpB,cAAc,GACd,MAAM,GACN,YAAY,GACZ,eAAe,GACf,cAAc,GACd,cAAc,GACd,eAAe,GACf,eAAe,GACf,YAAY,GACZ,SAAS,CACX,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACvB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAClB,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,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