@caspeco/casper-ui-library 7.7.0 → 7.7.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.
@@ -5,16 +5,16 @@ import { DatePickerDateCell as X } from "./date-picker-date-cell.js";
5
5
  import { DatePickerHeader as Lt } from "./date-picker-header.js";
6
6
  import { DatePickerWeekCell as Pt } from "./date-picker-week-cell.js";
7
7
  import { hasDotOnDate as p, isDateStrikeThrough as Ut, getWeekCellVariant as _t, getDateCellVariant as Z, firstLetterUpperCase as zt, hasDatePassed as At } from "./helper.js";
8
- import { nlBE as Ht } from "../../node_modules/date-fns/locale/nl-BE.js";
9
- import { fr as N } from "../../node_modules/date-fns/locale/fr.js";
10
- import { lv as jt } from "../../node_modules/date-fns/locale/lv.js";
11
- import { lt as Kt } from "../../node_modules/date-fns/locale/lt.js";
12
- import { et as Yt } from "../../node_modules/date-fns/locale/et.js";
13
- import { es as qt } from "../../node_modules/date-fns/locale/es.js";
14
- import { fi as Jt } from "../../node_modules/date-fns/locale/fi.js";
15
- import { nl as Qt } from "../../node_modules/date-fns/locale/nl.js";
16
- import { endOfMonth as R } from "../../node_modules/date-fns/endOfMonth.js";
17
- import { startOfWeek as Xt } from "../../node_modules/date-fns/startOfWeek.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
18
  import { sv as Zt } from "../../node_modules/date-fns/locale/sv.js";
19
19
  import { da as Nt } from "../../node_modules/date-fns/locale/da.js";
20
20
  import { nb as Rt } from "../../node_modules/date-fns/locale/nb.js";
@@ -33,15 +33,15 @@ const ar = {
33
33
  "nb-NO": { locale: Rt },
34
34
  "da-DK": { locale: Nt },
35
35
  "sv-SE": { locale: Zt },
36
- "nl-NL": { locale: Qt },
37
- "fi-FI": { locale: Jt },
38
- "es-ES": { locale: qt },
39
- "et-EE": { locale: Yt },
40
- "lt-LT": { locale: Kt },
41
- "lv-LV": { locale: jt },
42
- "fr-FR": { locale: N },
43
- "fr-BE": { locale: N },
44
- "nl-BE": { locale: Ht }
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 }
45
45
  };
46
46
  function Gr({
47
47
  selectedDate: l,
@@ -94,12 +94,12 @@ function Gr({
94
94
  [S, $, E, e?.startDate, s]
95
95
  );
96
96
  function yt() {
97
- const o = Xt(/* @__PURE__ */ new Date(), { locale: D });
97
+ const o = Qt(/* @__PURE__ */ new Date(), { locale: D });
98
98
  return Array.from({ length: 7 }, (r, t) => tt(rt(o, t), "eee", { locale: D }));
99
99
  }
100
100
  const St = tt(F(n), "MMMM yyyy", {
101
101
  locale: D
102
- }), Ct = R(n).getDate(), Mt = [a ? "v." : void 0, ...yt()], Ot = D.options?.weekStartsOn || 0, T = (F(n).getDay() - Ot + 7) % 7, kt = (7 - R(n).getDay()) % 7, gt = ["auto", "auto", "100%"], Bt = ["auto", "auto", "100%"], It = (o) => !mt && At(o) ? !0 : W ? W(o) : !1, vt = Array.from({ length: Ct + T + kt }, (o, r) => {
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) => !mt && At(o) ? !0 : W ? W(o) : !1, vt = Array.from({ length: Ct + T + kt }, (o, r) => {
103
103
  const t = rt(F(n), r - T), k = et(t, n), g = f(t, /* @__PURE__ */ new Date()), u = It(t) || ct, G = p(t, m?.yellowDotDates), L = p(t, m?.greenDotDates), P = p(t, m?.blueDotDates), U = p(t, m?.redDotDates), _ = p(t, m?.greyDotDates), z = Ut(t, nt) && !u;
104
104
  let B = !1;
105
105
  l && (B = f(t, l));
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,4CAqGvB,CAAC"}
1
+ {"version":3,"file":"date-picker-date-cell.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-date-cell.tsx"],"names":[],"mappings":"AAIA,KAAK,OAAO,GACT,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,QAAQ,GACR,cAAc,GACd,oBAAoB,GACpB,gBAAgB,GAChB,cAAc,CAAC;AAElB,KAAK,qBAAqB,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,IAAI,CAAC;IACV,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,uLAgBhC,qBAAqB,4CAuGvB,CAAC"}
@@ -1,46 +1,47 @@
1
- import { jsx as e, Fragment as w, jsxs as p } from "react/jsx-runtime";
2
- import { useStyleConfig as x, Button as O, Box as t, Stack as V } from "@chakra-ui/react";
3
- import { formatDate as W } from "../../node_modules/date-fns/format.js";
4
- import { ThemeColorVariable as r, ThemeSpaceVariable as m } from "../../theme/theme-types.js";
5
- const L = ({
6
- gridColumn: u,
7
- gridRow: b,
8
- gridIndex: C,
9
- day: c,
10
- handleDateChange: g,
1
+ import { jsx as e, Fragment as W, jsxs as p } from "react/jsx-runtime";
2
+ import { useStyleConfig as m, Button as O, Box as t, Stack as V } from "@chakra-ui/react";
3
+ import { formatDate as j } from "../../node_modules/date-fns/format.js";
4
+ import { isToday as x } from "../../node_modules/date-fns/isToday.js";
5
+ import { ThemeColorVariable as r, ThemeSpaceVariable as u } from "../../theme/theme-types.js";
6
+ const N = ({
7
+ gridColumn: b,
8
+ gridRow: f,
9
+ gridIndex: g,
10
+ day: n,
11
+ handleDateChange: h,
11
12
  variant: o,
12
13
  isDisabled: d,
13
14
  isStrikeThrough: s,
14
- hasBlueDot: h,
15
+ hasBlueDot: C,
15
16
  hasYellowDot: k,
16
- hasGreenDot: f,
17
- hasGreyDot: D,
18
- hasRedDot: y,
17
+ hasGreenDot: D,
18
+ hasGreyDot: y,
19
+ hasRedDot: S,
19
20
  selectWeek: a,
20
21
  isHoliday: i
21
22
  }) => {
22
- const S = x("DateCell", { variant: o }), R = x("DateCellWeek", { variant: o }), n = (o === "selectedDay" || o === "startDateRange" || o === "endDateRange") && !a, l = {
23
+ const R = m("DateCell", { variant: o }), B = m("DateCellWeek", { variant: o }), c = (o === "selectedDay" || o === "startDateRange" || o === "endDateRange") && !a, l = {
23
24
  borderRadius: "50%",
24
- border: n ? "solid 1.5px white" : "",
25
- width: n ? "7.5px" : "6px",
26
- height: n ? "7.5px" : "6px"
27
- }, B = C % 7 === 6;
28
- return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ p(
25
+ border: c ? "solid 1.5px white" : "",
26
+ width: c ? "7.5px" : "6px",
27
+ height: c ? "7.5px" : "6px"
28
+ }, w = g % 7 === 6;
29
+ return /* @__PURE__ */ e(W, { children: /* @__PURE__ */ p(
29
30
  O,
30
31
  {
31
- __css: a ? R : S,
32
+ __css: a ? B : R,
32
33
  type: "button",
33
- sx: a && o === "selectedDay" && B ? {
34
+ sx: a && o === "selectedDay" && w ? {
34
35
  borderTopRightRadius: "10px",
35
36
  borderBottomRightRadius: "10px"
36
37
  } : {},
37
38
  variant: o,
38
39
  isDisabled: d || s,
39
40
  onClick: () => {
40
- !d && !s && g(c);
41
+ !d && !s && h(n);
41
42
  },
42
- gridColumn: u,
43
- gridRow: b,
43
+ gridColumn: b,
44
+ gridRow: f,
44
45
  display: "flex",
45
46
  "data-testid": "date-picker-date-cell",
46
47
  children: [
@@ -49,7 +50,9 @@ const L = ({
49
50
  {
50
51
  "data-testid": i ? "holiday" : void 0,
51
52
  sx: { color: i ? r.Error : "inherit" },
52
- children: W(c, "d")
53
+ fontWeight: x(n) ? "bold" : "normal",
54
+ textDecoration: x(n) ? "underline" : "none",
55
+ children: j(n, "d")
53
56
  }
54
57
  ),
55
58
  s && /* @__PURE__ */ e("span", {}),
@@ -57,11 +60,11 @@ const L = ({
57
60
  V,
58
61
  {
59
62
  position: "absolute",
60
- bottom: m.XSmall,
63
+ bottom: u.XSmall,
61
64
  direction: "row",
62
- spacing: m.XSmall,
65
+ spacing: u.XSmall,
63
66
  children: [
64
- h && /* @__PURE__ */ e(
67
+ C && /* @__PURE__ */ e(
65
68
  t,
66
69
  {
67
70
  sx: {
@@ -70,7 +73,7 @@ const L = ({
70
73
  }
71
74
  }
72
75
  ),
73
- f && /* @__PURE__ */ e(
76
+ D && /* @__PURE__ */ e(
74
77
  t,
75
78
  {
76
79
  sx: {
@@ -88,7 +91,7 @@ const L = ({
88
91
  }
89
92
  }
90
93
  ),
91
- D && /* @__PURE__ */ e(
94
+ y && /* @__PURE__ */ e(
92
95
  t,
93
96
  {
94
97
  sx: {
@@ -97,7 +100,7 @@ const L = ({
97
100
  }
98
101
  }
99
102
  ),
100
- y && /* @__PURE__ */ e(
103
+ S && /* @__PURE__ */ e(
101
104
  t,
102
105
  {
103
106
  sx: {
@@ -114,5 +117,5 @@ const L = ({
114
117
  ) });
115
118
  };
116
119
  export {
117
- L as DatePickerDateCell
120
+ N as DatePickerDateCell
118
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"AAIA,OAAO,EAaN,KAAK,MAAM,EACX,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,qBAAqB,GAAG;IAC5B,aAAa,EAAE,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wMAc9B,qBAAqB,4CA4GvB,CAAC"}
1
+ {"version":3,"file":"date-picker-header.d.ts","sourceRoot":"","sources":["../../../lib/components/date-picker/date-picker-header.tsx"],"names":[],"mappings":"AAKA,OAAO,EAeN,KAAK,MAAM,EACX,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,qBAAqB,GAAG;IAC5B,aAAa,EAAE,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,IAAI,CAAC;IACnB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,wBAAwB,EAAE,OAAO,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;CAC/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wMAc9B,qBAAqB,4CAiJvB,CAAC"}
@@ -1,107 +1,138 @@
1
- import { jsxs as L, jsx as p } from "react/jsx-runtime";
2
- import { Flex as W, Text as z } from "@chakra-ui/react";
3
- import { firstLetterUpperCase as S } from "./helper.js";
4
- import { startOfMonth as u } from "../../node_modules/date-fns/startOfMonth.js";
5
- import { isBefore as O } from "../../node_modules/date-fns/isBefore.js";
6
- import { isSameMonth as G } from "../../node_modules/date-fns/isSameMonth.js";
7
- import { IconButton as l } from "../icon-button/icon-button.js";
8
- import { Icons as w } from "../icon/types.js";
9
- import { subMonths as Y } from "../../node_modules/date-fns/subMonths.js";
10
- import { subWeeks as q } from "../../node_modules/date-fns/subWeeks.js";
11
- import { subDays as c } from "../../node_modules/date-fns/subDays.js";
12
- import { getISOWeek as A } from "../../node_modules/date-fns/getISOWeek.js";
13
- import { addMonths as C } from "../../node_modules/date-fns/addMonths.js";
14
- import { addWeeks as J } from "../../node_modules/date-fns/addWeeks.js";
15
- import { addDays as D } from "../../node_modules/date-fns/addDays.js";
16
- import { sv as K } from "../../node_modules/date-fns/locale/sv.js";
17
- import { da as N } from "../../node_modules/date-fns/locale/da.js";
18
- import { nb as Q } from "../../node_modules/date-fns/locale/nb.js";
19
- import { enGB as F } from "../../node_modules/date-fns/locale/en-GB.js";
20
- import { enUS as x } from "../../node_modules/date-fns/locale/en-US.js";
21
- import { isSameYear as X } from "../../node_modules/date-fns/isSameYear.js";
22
- import { ThemeSpaceVariable as Z, ThemeFontSizeVariable as _, ThemeFontVariable as E } from "../../theme/theme-types.js";
23
- import { formatDate as b } from "../../node_modules/date-fns/format.js";
24
- const Fr = ({
25
- onMonthChange: k,
26
- selectedMonth: e,
27
- month: d,
1
+ import { jsxs as u, jsx as s } from "react/jsx-runtime";
2
+ import { Flex as p, Text as N } from "@chakra-ui/react";
3
+ import { firstLetterUpperCase as T } from "./helper.js";
4
+ import { startOfMonth as d } from "../../node_modules/date-fns/startOfMonth.js";
5
+ import { isBefore as Q } from "../../node_modules/date-fns/isBefore.js";
6
+ import { isSameMonth as X } from "../../node_modules/date-fns/isSameMonth.js";
7
+ import { startOfDay as Z } from "../../node_modules/date-fns/startOfDay.js";
8
+ import { Button as _ } from "../button/button.js";
9
+ import { IconButton as x } from "../icon-button/icon-button.js";
10
+ import { Icons as B } from "../icon/types.js";
11
+ import { getISOWeek as E } from "../../node_modules/date-fns/getISOWeek.js";
12
+ import { enGB as D } from "../../node_modules/date-fns/locale/en-GB.js";
13
+ import { enUS as k } from "../../node_modules/date-fns/locale/en-US.js";
14
+ import { nlBE as F } from "../../node_modules/date-fns/locale/nl-BE.js";
15
+ import { fr as P } from "../../node_modules/date-fns/locale/fr.js";
16
+ import { sv as V } from "../../node_modules/date-fns/locale/sv.js";
17
+ import { da as v } from "../../node_modules/date-fns/locale/da.js";
18
+ import { nb as j } from "../../node_modules/date-fns/locale/nb.js";
19
+ import { subMonths as R } from "../../node_modules/date-fns/subMonths.js";
20
+ import { subWeeks as rr } from "../../node_modules/date-fns/subWeeks.js";
21
+ import { subDays as l } from "../../node_modules/date-fns/subDays.js";
22
+ import { addMonths as tr } from "../../node_modules/date-fns/addMonths.js";
23
+ import { addWeeks as or } from "../../node_modules/date-fns/addWeeks.js";
24
+ import { addDays as b } from "../../node_modules/date-fns/addDays.js";
25
+ import { isSameYear as er } from "../../node_modules/date-fns/isSameYear.js";
26
+ import { isSameDay as ir } from "../../node_modules/date-fns/isSameDay.js";
27
+ import { ThemeSpaceVariable as H, ThemeFontSizeVariable as ar, ThemeFontVariable as mr } from "../../theme/theme-types.js";
28
+ import { formatDate as S } from "../../node_modules/date-fns/format.js";
29
+ const gr = ({
30
+ onMonthChange: h,
31
+ selectedMonth: a,
32
+ month: w,
28
33
  selectWeek: m,
29
- locale: o,
30
- selectedDate: i,
31
- onDateChange: a,
32
- isExpanded: f,
33
- disablePastMonths: P,
34
- disableBackwardNavigation: B,
35
- disableForwardNavigation: T,
36
- dateRange: t,
37
- onRangeChange: s
34
+ locale: e,
35
+ selectedDate: t,
36
+ onDateChange: i,
37
+ isExpanded: n,
38
+ disablePastMonths: I,
39
+ disableBackwardNavigation: U,
40
+ disableForwardNavigation: $,
41
+ dateRange: o,
42
+ onRangeChange: f
38
43
  }) => {
39
- function V(r) {
44
+ function g(r) {
40
45
  switch (r) {
41
- case x:
42
- case F:
43
- return "Week";
44
- case Q:
46
+ case j:
45
47
  return "Uke";
46
- case N:
48
+ case v:
47
49
  return "Uge";
48
- case K:
49
- default:
50
+ case V:
50
51
  return "Vecka";
52
+ case P:
53
+ return "Semaine";
54
+ case F:
55
+ case k:
56
+ case D:
57
+ default:
58
+ return "Week";
59
+ }
60
+ }
61
+ function z(r) {
62
+ switch (r) {
63
+ case j:
64
+ case v:
65
+ case V:
66
+ return "I dag";
67
+ case P:
68
+ return "Aujourd'hui";
69
+ case F:
70
+ return "Vandaag";
71
+ case k:
72
+ case D:
73
+ default:
74
+ return "Today";
51
75
  }
52
76
  }
53
- function h(r) {
77
+ function L(r) {
54
78
  return !!r?.startDate && !!r?.endDate;
55
79
  }
56
- const n = !m && h(t) && s;
57
- function v(r) {
58
- return X(r.startDate, r.endDate) ? o === F || o === x ? "MMM d" : "d MMM" : "PP";
80
+ const c = !m && L(o) && f;
81
+ function O(r) {
82
+ return er(r.startDate, r.endDate) ? e === D || e === k ? "MMM d" : "d MMM" : "PP";
59
83
  }
60
- const y = () => {
61
- if (f)
62
- return S(d);
84
+ const W = () => {
85
+ if (n)
86
+ return T(w);
63
87
  if (m)
64
- return `${V(o)} ${A(i)}`;
65
- if (n) {
66
- const r = v(t), j = b(t.startDate, r, { locale: o }), I = b(t.endDate, r, { locale: o });
67
- return `${j} - ${I}`.replace(/\./g, "");
88
+ return `${g(e)} ${E(t)}`;
89
+ if (c) {
90
+ const r = O(o), J = S(o.startDate, r, { locale: e }), K = S(o.endDate, r, { locale: e });
91
+ return `${J} - ${K}`.replace(/\./g, "");
68
92
  }
69
- return i ? b(i, "dd MMMM", { locale: o }) : S(d);
70
- }, H = () => {
71
- f ? k(Y(u(e))) : m ? a(q(i)) : n ? s({
72
- startDate: c(t.startDate),
73
- endDate: c(t.endDate)
74
- }) : a(c(i));
75
- }, U = () => {
76
- f ? k(C(u(e), 1)) : m ? a(J(i, 1)) : n ? s({
77
- startDate: D(t.startDate, 1),
78
- endDate: D(t.endDate, 1)
79
- }) : a(D(i, 1));
80
- }, M = u(/* @__PURE__ */ new Date()), $ = B || P && (O(e, M) || G(e, M));
81
- return /* @__PURE__ */ L(W, { justify: "space-between", align: "center", mb: Z.Small, children: [
82
- /* @__PURE__ */ p(
83
- l,
84
- {
85
- icon: w.Back,
86
- "aria-label": "Back",
87
- variant: "ghost",
88
- onClick: H,
89
- isDisabled: $
90
- }
91
- ),
92
- /* @__PURE__ */ p(z, { fontWeight: "500", fontFamily: E.SubHeader, fontSize: _.Large, children: y() }),
93
- /* @__PURE__ */ p(
94
- l,
95
- {
96
- icon: w.Forward,
97
- "aria-label": "Forward",
98
- variant: "ghost",
99
- onClick: U,
100
- isDisabled: T
101
- }
102
- )
93
+ return t ? S(t, "dd MMMM", { locale: e }) : T(w);
94
+ }, A = () => {
95
+ n ? h(R(d(a))) : m ? i(rr(t)) : c ? f({
96
+ startDate: l(o.startDate),
97
+ endDate: l(o.endDate)
98
+ }) : i(l(t));
99
+ }, C = () => {
100
+ n ? h(tr(d(a), 1)) : m ? i(or(t, 1)) : c ? f({
101
+ startDate: b(o.startDate, 1),
102
+ endDate: b(o.endDate, 1)
103
+ }) : i(b(t, 1));
104
+ }, y = d(/* @__PURE__ */ new Date()), G = U || I && (Q(a, y) || X(a, y)), M = Z(/* @__PURE__ */ new Date()), Y = !ir(t, M), q = () => {
105
+ i(M);
106
+ };
107
+ return /* @__PURE__ */ u(p, { justify: "space-between", align: "center", mb: H.Small, children: [
108
+ /* @__PURE__ */ s(N, { fontWeight: "500", fontFamily: mr.SubHeader, fontSize: ar.Large, children: W() }),
109
+ /* @__PURE__ */ u(p, { align: "center", gap: H.Small, children: [
110
+ Y && /* @__PURE__ */ s(_, { variant: "ghost", size: "sm", onClick: q, children: z(e) }),
111
+ /* @__PURE__ */ u(p, { align: "center", children: [
112
+ /* @__PURE__ */ s(
113
+ x,
114
+ {
115
+ icon: B.Back,
116
+ "aria-label": "Back",
117
+ variant: "ghost",
118
+ onClick: A,
119
+ isDisabled: G
120
+ }
121
+ ),
122
+ /* @__PURE__ */ s(
123
+ x,
124
+ {
125
+ icon: B.Forward,
126
+ "aria-label": "Forward",
127
+ variant: "ghost",
128
+ onClick: C,
129
+ isDisabled: $
130
+ }
131
+ )
132
+ ] })
133
+ ] })
103
134
  ] });
104
135
  };
105
136
  export {
106
- Fr as DatePickerHeader
137
+ gr as DatePickerHeader
107
138
  };
@@ -97,7 +97,7 @@ const Y = ({
97
97
  tabIndex: 0,
98
98
  icon: n ? S.TreeViewCollapse : S.TreeViewExpand,
99
99
  "aria-label": n ? `Collapse ${i}` : `Expand ${i}`,
100
- size: "sm"
100
+ size: "xs"
101
101
  }
102
102
  ),
103
103
  /* @__PURE__ */ e(
@@ -1,5 +1,6 @@
1
1
  import { ButtonProps, ResponsiveValue } from '@chakra-ui/react';
2
2
  import { default as React } from 'react';
3
+ import { ButtonSize } from '../button/types.js';
3
4
  import { SegmentedControlItem } from './types.js';
4
5
  type CustomButtonProps = Pick<ButtonProps, "isDisabled" | "isActive" | "key" | "aria-label">;
5
6
  type SegmentedControlButtonProps = CustomButtonProps & {
@@ -14,7 +15,7 @@ type SegmentedControlButtonProps = CustomButtonProps & {
14
15
  /**
15
16
  * Size for component. Defaults to 'md' (medium).
16
17
  */
17
- size: ResponsiveValue<"md" | "sm"> | undefined;
18
+ size: ResponsiveValue<ButtonSize> | undefined;
18
19
  children: React.ReactNode;
19
20
  };
20
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-control-item.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/segmented-control-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC;AAE7F,KAAK,2BAA2B,GAAG,iBAAiB,GAAG;IACtD;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,2BAA2B,2CAW9F"}
1
+ {"version":3,"file":"segmented-control-item.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/segmented-control-item.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,GAAG,UAAU,GAAG,KAAK,GAAG,YAAY,CAAC,CAAC;AAE7F,KAAK,2BAA2B,GAAG,iBAAiB,GAAG;IACtD;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC;IAC3B;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;IAC9C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,2BAA2B,2CAW9F"}
@@ -1,5 +1,6 @@
1
1
  import { MarginProps, PaddingProps } from '../../theme/index.js';
2
2
  import { ResponsiveValue } from '@chakra-ui/react';
3
+ import { ButtonSize } from '../button/types.js';
3
4
  export type SegmentedControlItem = {
4
5
  /**
5
6
  * Required identifier for item.
@@ -38,7 +39,7 @@ type CustomSegmentedControlProps = {
38
39
  /**
39
40
  * Size for component. Defaults to 'md' (medium).
40
41
  */
41
- size?: ResponsiveValue<"md" | "sm"> | undefined;
42
+ size?: ResponsiveValue<ButtonSize> | undefined;
42
43
  };
43
44
  export type SegmentedControlProps = CustomSegmentedControlProps & MarginProps & PaddingProps;
44
45
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAAG;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG,WAAW,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/segmented-control/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,oBAAoB,GAAG;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,2BAA2B,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,oBAAoB,EAAE,CAAC;IAC9B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG,WAAW,GAAG,YAAY,CAAC"}
@@ -109,7 +109,7 @@ const U = ({
109
109
  {
110
110
  icon: H.MoreVertical,
111
111
  variant: "ghost",
112
- size: "sm",
112
+ size: "xs",
113
113
  "aria-label": R.moreActions,
114
114
  borderRadius: "0"
115
115
  }
@@ -120,7 +120,7 @@ const G = ({
120
120
  items: e.items,
121
121
  selectedItems: e.selectedItems,
122
122
  onChange: (s) => k(e.filterId, s),
123
- footerContent: /* @__PURE__ */ l(T, { variant: "link", size: "sm", onClick: () => k(e.filterId, []), children: /* @__PURE__ */ l(A, { children: h.filterBoxReset }) })
123
+ footerContent: /* @__PURE__ */ l(T, { variant: "link", size: "xs", onClick: () => k(e.filterId, []), children: /* @__PURE__ */ l(A, { children: h.filterBoxReset }) })
124
124
  },
125
125
  e.filterId
126
126
  )) }),
@@ -7,18 +7,18 @@ import { Icons as i } from "../icon/types.js";
7
7
  import { ThemeSpaceVariable as f } from "../../theme/theme-types.js";
8
8
  const B = d(
9
9
  ({ row: o, localeString: l, rowIsExpanded: n, hidden: a }) => {
10
- const r = x[l], m = o.getToggleExpandedHandler(), p = (e) => {
11
- e.stopPropagation(), m();
12
- }, s = () => n ? `${r.collapseRow} ${o.index + 1}` : `${r.expandRow} ${o.index + 1}`;
10
+ const r = x[l], p = o.getToggleExpandedHandler(), s = (e) => {
11
+ e.stopPropagation(), p();
12
+ }, m = () => n ? `${r.collapseRow} ${o.index + 1}` : `${r.expandRow} ${o.index + 1}`;
13
13
  return /* @__PURE__ */ t(c, { as: "span", h: "100%", children: /* @__PURE__ */ t(
14
14
  g,
15
15
  {
16
- size: "sm",
16
+ size: "xs",
17
17
  mr: f.XSmall,
18
18
  variant: "ghost",
19
- "aria-label": s(),
19
+ "aria-label": m(),
20
20
  icon: n ? i.TreeViewCollapse : i.TreeViewExpand,
21
- onClick: p,
21
+ onClick: s,
22
22
  onKeyDown: (e) => e.stopPropagation(),
23
23
  visibility: a ? "hidden" : "initial",
24
24
  "aria-hidden": a,
@@ -0,0 +1,8 @@
1
+ import { constructFrom as o } from "./constructFrom.js";
2
+ function n(t) {
3
+ return o(t, Date.now());
4
+ }
5
+ export {
6
+ n as constructNow,
7
+ n as default
8
+ };
@@ -0,0 +1,13 @@
1
+ import { constructFrom as r } from "./constructFrom.js";
2
+ import { constructNow as t } from "./constructNow.js";
3
+ import { isSameDay as m } from "./isSameDay.js";
4
+ function f(o, i) {
5
+ return m(
6
+ r(o, o),
7
+ t(o)
8
+ );
9
+ }
10
+ export {
11
+ f as default,
12
+ f as isToday
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "7.7.0",
3
+ "version": "7.7.2",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,