@spesia/ui 1.10.3 → 1.10.4

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 (33) hide show
  1. package/dist/_virtual/index.js +5 -2
  2. package/dist/_virtual/index2.js +4 -0
  3. package/dist/components/chip-list/ChipList.js +1 -2
  4. package/dist/components/date-picker/DatePicker/DatePicker.js +13 -14
  5. package/dist/components/date-picker/PeriodPicker/PeriodPicker.js +1 -2
  6. package/dist/components/date-picker/utils.js +16 -16
  7. package/dist/components/filters/FilterList.js +12 -13
  8. package/dist/components/trending-chip/TrendingChip.js +7 -8
  9. package/dist/helpers/suitCx.js +1 -1
  10. package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js +33 -33
  11. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js +68 -0
  12. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js +1 -2
  13. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js +2 -3
  14. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js +0 -1
  15. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js +3 -4
  16. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js +4 -5
  17. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js +0 -1
  18. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js +5 -6
  19. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js +0 -1
  20. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js +0 -1
  21. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js +8 -9
  22. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js +5 -6
  23. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js +6 -7
  24. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js +4 -5
  25. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js +8 -9
  26. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js +4 -5
  27. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js +2 -3
  28. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js +5 -6
  29. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js +7 -8
  30. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js +4 -5
  31. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js +0 -1
  32. package/dist/node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js +3 -4
  33. package/package.json +5 -5
@@ -1,4 +1,7 @@
1
- var s = { exports: {} };
1
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
2
+ import { __require as s } from "../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
3
+ var e = s();
4
+ const t = /* @__PURE__ */ r(e);
2
5
  export {
3
- s as __module
6
+ t as default
4
7
  };
@@ -0,0 +1,4 @@
1
+ var s = { exports: {} };
2
+ export {
3
+ s as __module
4
+ };
@@ -92,6 +92,5 @@ const j = ({
92
92
  return /* @__PURE__ */ a("div", { "data-testid": p, className: s(), children: x });
93
93
  };
94
94
  export {
95
- j as ChipList,
96
- j as default
95
+ j as ChipList
97
96
  };
@@ -3,19 +3,19 @@ import { useState as k, useMemo as x } from "react";
3
3
  import { suitCx as v } from "../../../helpers/suitCx.js";
4
4
  import { DatePicker as h } from "@mui/x-date-pickers/DatePicker";
5
5
  const w = ({
6
- label: a = void 0,
6
+ label: s = void 0,
7
7
  disabled: t = !1,
8
- dataTestId: s = "DatePicker",
8
+ dataTestId: a = "DatePicker",
9
9
  className: o,
10
10
  value: i,
11
11
  minDateErrorText: n,
12
12
  maxDateErrorText: c,
13
13
  errorText: e = "Your date is not valid",
14
- size: l,
15
- sx: m,
14
+ size: m,
15
+ sx: l,
16
16
  ...u
17
17
  }) => {
18
- const [r, d] = k(null), f = x(() => {
18
+ const [r, d] = k(null), D = x(() => {
19
19
  switch (r) {
20
20
  case "maxDate":
21
21
  return c ?? e;
@@ -26,7 +26,7 @@ const w = ({
26
26
  default:
27
27
  return null;
28
28
  }
29
- }, [r]), D = v(
29
+ }, [r]), f = v(
30
30
  {
31
31
  name: "DatePicker",
32
32
  modifiers: ["disabled"]
@@ -42,21 +42,20 @@ const w = ({
42
42
  ...u,
43
43
  onError: (p) => d(p),
44
44
  value: i,
45
- label: a,
45
+ label: s,
46
46
  slotProps: {
47
47
  textField: {
48
- helperText: f,
49
- size: l
48
+ helperText: D,
49
+ size: m
50
50
  }
51
51
  },
52
52
  disabled: t,
53
- className: D(),
54
- "data-testid": s,
55
- sx: m
53
+ className: f(),
54
+ "data-testid": a,
55
+ sx: l
56
56
  }
57
57
  );
58
58
  };
59
59
  export {
60
- w as DatePicker,
61
- w as default
60
+ w as DatePicker
62
61
  };
@@ -369,6 +369,5 @@ const De = ({
369
369
  ] });
370
370
  };
371
371
  export {
372
- De as PeriodPicker,
373
- De as default
372
+ De as PeriodPicker
374
373
  };
@@ -1,26 +1,26 @@
1
1
  import { isSameDay as $ } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameDay.js";
2
2
  import { isSameMonth as S } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameMonth.js";
3
- import { isSameYear as f } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js";
4
- import { formatDate as a } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js";
5
- const c = (e, t, n, s) => f(e, t) ? a(new Date(t), s) : a(new Date(t), n), Y = (e, t, n, s, l) => f(e, t) ? `${a(new Date(t), "dd")} - ${a(new Date(n), s)}` : `${a(new Date(t), "dd")} - ${a(new Date(n), l)}`, b = (e, t, n, s, l) => f(e, t) ? `${a(new Date(t), s)} - ${a(new Date(n), s)}` : `${a(new Date(t), s)} - ${a(new Date(n), l)}`, h = (e, t, n) => `${a(new Date(e), n)} - ${a(new Date(t), n)}`, x = (e, t, n, s, l) => {
6
- let u = "";
3
+ import { isSameYear as i } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameYear.js";
4
+ import { format as s } from "../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js";
5
+ const c = (e, t, n, a) => i(e, t) ? s(new Date(t), a) : s(new Date(t), n), Y = (e, t, n, a, l) => i(e, t) ? `${s(new Date(t), "dd")} - ${s(new Date(n), a)}` : `${s(new Date(t), "dd")} - ${s(new Date(n), l)}`, b = (e, t, n, a, l) => i(e, t) ? `${s(new Date(t), a)} - ${s(new Date(n), a)}` : `${s(new Date(t), a)} - ${s(new Date(n), l)}`, h = (e, t, n) => `${s(new Date(e), n)} - ${s(new Date(t), n)}`, x = (e, t, n, a, l) => {
6
+ let w = "";
7
7
  if ((e == null ? void 0 : e.value) === "custom" && t && n) {
8
- const D = new Date(t), w = new Date(n), i = /* @__PURE__ */ new Date();
9
- $(D, w) ? u = c(i, D, s, l) : S(D, w) ? u = Y(
10
- i,
8
+ const u = new Date(t), D = new Date(n), f = /* @__PURE__ */ new Date();
9
+ $(u, D) ? w = c(f, u, a, l) : S(u, D) ? w = Y(
10
+ f,
11
+ u,
11
12
  D,
12
- w,
13
- s,
13
+ a,
14
14
  l
15
- ) : f(D, w) ? u = b(
16
- i,
15
+ ) : i(u, D) ? w = b(
16
+ f,
17
+ u,
17
18
  D,
18
- w,
19
- s,
19
+ a,
20
20
  l
21
- ) : u = h(D, w, l);
22
- } else e != null && e.label && e.value !== "custom" && (u = e.label);
23
- return u;
21
+ ) : w = h(u, D, l);
22
+ } else e != null && e.label && e.value !== "custom" && (w = e.label);
23
+ return w;
24
24
  };
25
25
  export {
26
26
  x as setInitialValue
@@ -19,15 +19,15 @@ const D = ({
19
19
  dataTestId: i = "FilterList",
20
20
  className: m
21
21
  }) => {
22
- const f = n.map((e) => ({
22
+ const p = n.map((e) => ({
23
23
  ...e,
24
24
  label: e.label || e.value,
25
25
  tooltip: e.tooltip
26
- })) ?? [], [a, u] = x(
26
+ })) ?? [], [a, h] = x(
27
27
  new Set(
28
28
  Array.isArray(t) ? t : t ? [t] : []
29
29
  )
30
- ), p = C(
30
+ ), f = C(
31
31
  {
32
32
  name: "FilterList",
33
33
  states: ["disabled"]
@@ -37,7 +37,7 @@ const D = ({
37
37
  },
38
38
  m
39
39
  ), v = (e) => {
40
- u((s) => {
40
+ h((s) => {
41
41
  const r = new Set(s);
42
42
  return r.has(e) ? r.delete(e) : r.add(e), d(Array.from(r)), r;
43
43
  });
@@ -49,14 +49,14 @@ const D = ({
49
49
  Array.isArray(t) ? t : t ? [t] : []
50
50
  );
51
51
  z(e, a) || Promise.resolve().then(() => {
52
- u(e);
52
+ h(e);
53
53
  });
54
54
  }, []);
55
55
  const k = /* @__PURE__ */ o(
56
56
  b,
57
57
  {
58
58
  role: "group",
59
- className: p("filters"),
59
+ className: f("filters"),
60
60
  sx: {
61
61
  display: "flex",
62
62
  flexDirection: "row",
@@ -69,10 +69,10 @@ const D = ({
69
69
  }
70
70
  },
71
71
  "data-testid": i + "_Options",
72
- children: f == null ? void 0 : f.map((e, s) => /* @__PURE__ */ o(
72
+ children: p == null ? void 0 : p.map((e, s) => /* @__PURE__ */ o(
73
73
  "div",
74
74
  {
75
- className: p("filters-item"),
75
+ className: f("filters-item"),
76
76
  "aria-checked": a.has(e.value),
77
77
  children: /* @__PURE__ */ o(w, { arrow: !0, placement: "top", title: e.tooltip ?? "", children: /* @__PURE__ */ o(
78
78
  g,
@@ -87,8 +87,8 @@ const D = ({
87
87
  },
88
88
  opacity: () => a.has(e.value) ? 1 : 0.5,
89
89
  color: (r) => {
90
- var c, h;
91
- return a.has(e.value) ? (c = r.vars) == null ? void 0 : c.palette.primary.dark : (h = r.vars) == null ? void 0 : h.palette.text.primary;
90
+ var c, u;
91
+ return a.has(e.value) ? (c = r.vars) == null ? void 0 : c.palette.primary.dark : (u = r.vars) == null ? void 0 : u.palette.text.primary;
92
92
  },
93
93
  borderRadius: F.borderRadius.full,
94
94
  width: "auto"
@@ -113,9 +113,8 @@ const D = ({
113
113
  ))
114
114
  }
115
115
  );
116
- return /* @__PURE__ */ o("div", { "data-testid": i, className: p(), children: k });
116
+ return /* @__PURE__ */ o("div", { "data-testid": i, className: f(), children: k });
117
117
  };
118
118
  export {
119
- D as FilterList,
120
- D as default
119
+ D as FilterList
121
120
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { suitCx as l } from "../../helpers/suitCx.js";
3
- import { Box as i, Chip as c } from "@mui/material";
2
+ import { suitCx as c } from "../../helpers/suitCx.js";
3
+ import { Box as i, Chip as h } from "@mui/material";
4
4
  import { ArrowDownward as n, ArrowUpward as s } from "@mui/icons-material";
5
- import { formatPercentage as h } from "../../helpers/utils.js";
5
+ import { formatPercentage as l } from "../../helpers/utils.js";
6
6
  import { colors as t } from "../../styles/colors.js";
7
7
  const C = ({
8
8
  value: e,
@@ -10,7 +10,7 @@ const C = ({
10
10
  iconOnly: d,
11
11
  className: p
12
12
  }) => {
13
- const o = l(
13
+ const o = c(
14
14
  {
15
15
  name: "TrendingChip"
16
16
  },
@@ -60,7 +60,7 @@ const C = ({
60
60
  )
61
61
  }
62
62
  ) : /* @__PURE__ */ r(
63
- c,
63
+ h,
64
64
  {
65
65
  className: o(),
66
66
  variant: "outlined",
@@ -83,11 +83,10 @@ const C = ({
83
83
  sx: { width: "18px", height: "18px", rotate: "45deg" }
84
84
  }
85
85
  ),
86
- label: h(e, !1, 1)
86
+ label: l(e, !1, 1)
87
87
  }
88
88
  );
89
89
  };
90
90
  export {
91
- C as TrendingChip,
92
- C as default
91
+ C as TrendingChip
93
92
  };
@@ -1,4 +1,4 @@
1
- import m from "../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js";
1
+ import m from "../_virtual/index.js";
2
2
  const c = (o, i, f = {}) => {
3
3
  let e;
4
4
  typeof o == "string" ? e = { name: o, modifiers: [], states: [] } : e = o;
@@ -1,42 +1,42 @@
1
- import { getDefaultExportFromCjs as p } from "../../../../../_virtual/_commonjsHelpers.js";
2
- import { __module as i } from "../../../../../_virtual/index.js";
1
+ import { __module as s } from "../../../../../_virtual/index2.js";
3
2
  /*!
4
3
  Copyright (c) 2018 Jed Watson.
5
4
  Licensed under the MIT License (MIT), see
6
5
  http://jedwatson.github.io/classnames
7
6
  */
8
- (function(o) {
9
- (function() {
10
- var f = {}.hasOwnProperty;
11
- function e() {
12
- for (var t = "", r = 0; r < arguments.length; r++) {
13
- var n = arguments[r];
14
- n && (t = s(t, u(n)));
7
+ var u;
8
+ function c() {
9
+ return u ? s.exports : (u = 1, (function(i) {
10
+ (function() {
11
+ var f = {}.hasOwnProperty;
12
+ function n() {
13
+ for (var r = "", t = 0; t < arguments.length; t++) {
14
+ var e = arguments[t];
15
+ e && (r = o(r, a(e)));
16
+ }
17
+ return r;
15
18
  }
16
- return t;
17
- }
18
- function u(t) {
19
- if (typeof t == "string" || typeof t == "number")
19
+ function a(r) {
20
+ if (typeof r == "string" || typeof r == "number")
21
+ return r;
22
+ if (typeof r != "object")
23
+ return "";
24
+ if (Array.isArray(r))
25
+ return n.apply(null, r);
26
+ if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
27
+ return r.toString();
28
+ var t = "";
29
+ for (var e in r)
30
+ f.call(r, e) && r[e] && (t = o(t, e));
20
31
  return t;
21
- if (typeof t != "object")
22
- return "";
23
- if (Array.isArray(t))
24
- return e.apply(null, t);
25
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
26
- return t.toString();
27
- var r = "";
28
- for (var n in t)
29
- f.call(t, n) && t[n] && (r = s(r, n));
30
- return r;
31
- }
32
- function s(t, r) {
33
- return r ? t ? t + " " + r : t + r : t;
34
- }
35
- o.exports ? (e.default = e, o.exports = e) : window.classNames = e;
36
- })();
37
- })(i);
38
- var a = i.exports;
39
- const m = /* @__PURE__ */ p(a);
32
+ }
33
+ function o(r, t) {
34
+ return t ? r ? r + " " + t : r + t : r;
35
+ }
36
+ i.exports ? (n.default = n, i.exports = n) : window.classNames = n;
37
+ })();
38
+ })(s), s.exports);
39
+ }
40
40
  export {
41
- m as default
41
+ c as __require
42
42
  };
@@ -17,12 +17,15 @@ const s = {
17
17
  G: function(n, r, e) {
18
18
  const t = n.getFullYear() > 0 ? 1 : 0;
19
19
  switch (r) {
20
+ // AD, BC
20
21
  case "G":
21
22
  case "GG":
22
23
  case "GGG":
23
24
  return e.era(t, { width: "abbreviated" });
25
+ // A, B
24
26
  case "GGGGG":
25
27
  return e.era(t, { width: "narrow" });
28
+ // Anno Domini, Before Christ
26
29
  case "GGGG":
27
30
  default:
28
31
  return e.era(t, { width: "wide" });
@@ -67,22 +70,28 @@ const s = {
67
70
  Q: function(n, r, e) {
68
71
  const t = Math.ceil((n.getMonth() + 1) / 3);
69
72
  switch (r) {
73
+ // 1, 2, 3, 4
70
74
  case "Q":
71
75
  return String(t);
76
+ // 01, 02, 03, 04
72
77
  case "QQ":
73
78
  return i(t, 2);
79
+ // 1st, 2nd, 3rd, 4th
74
80
  case "Qo":
75
81
  return e.ordinalNumber(t, { unit: "quarter" });
82
+ // Q1, Q2, Q3, Q4
76
83
  case "QQQ":
77
84
  return e.quarter(t, {
78
85
  width: "abbreviated",
79
86
  context: "formatting"
80
87
  });
88
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
81
89
  case "QQQQQ":
82
90
  return e.quarter(t, {
83
91
  width: "narrow",
84
92
  context: "formatting"
85
93
  });
94
+ // 1st quarter, 2nd quarter, ...
86
95
  case "QQQQ":
87
96
  default:
88
97
  return e.quarter(t, {
@@ -95,22 +104,28 @@ const s = {
95
104
  q: function(n, r, e) {
96
105
  const t = Math.ceil((n.getMonth() + 1) / 3);
97
106
  switch (r) {
107
+ // 1, 2, 3, 4
98
108
  case "q":
99
109
  return String(t);
110
+ // 01, 02, 03, 04
100
111
  case "qq":
101
112
  return i(t, 2);
113
+ // 1st, 2nd, 3rd, 4th
102
114
  case "qo":
103
115
  return e.ordinalNumber(t, { unit: "quarter" });
116
+ // Q1, Q2, Q3, Q4
104
117
  case "qqq":
105
118
  return e.quarter(t, {
106
119
  width: "abbreviated",
107
120
  context: "standalone"
108
121
  });
122
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
109
123
  case "qqqqq":
110
124
  return e.quarter(t, {
111
125
  width: "narrow",
112
126
  context: "standalone"
113
127
  });
128
+ // 1st quarter, 2nd quarter, ...
114
129
  case "qqqq":
115
130
  default:
116
131
  return e.quarter(t, {
@@ -126,18 +141,22 @@ const s = {
126
141
  case "M":
127
142
  case "MM":
128
143
  return u.M(n, r);
144
+ // 1st, 2nd, ..., 12th
129
145
  case "Mo":
130
146
  return e.ordinalNumber(t + 1, { unit: "month" });
147
+ // Jan, Feb, ..., Dec
131
148
  case "MMM":
132
149
  return e.month(t, {
133
150
  width: "abbreviated",
134
151
  context: "formatting"
135
152
  });
153
+ // J, F, ..., D
136
154
  case "MMMMM":
137
155
  return e.month(t, {
138
156
  width: "narrow",
139
157
  context: "formatting"
140
158
  });
159
+ // January, February, ..., December
141
160
  case "MMMM":
142
161
  default:
143
162
  return e.month(t, { width: "wide", context: "formatting" });
@@ -147,22 +166,28 @@ const s = {
147
166
  L: function(n, r, e) {
148
167
  const t = n.getMonth();
149
168
  switch (r) {
169
+ // 1, 2, ..., 12
150
170
  case "L":
151
171
  return String(t + 1);
172
+ // 01, 02, ..., 12
152
173
  case "LL":
153
174
  return i(t + 1, 2);
175
+ // 1st, 2nd, ..., 12th
154
176
  case "Lo":
155
177
  return e.ordinalNumber(t + 1, { unit: "month" });
178
+ // Jan, Feb, ..., Dec
156
179
  case "LLL":
157
180
  return e.month(t, {
158
181
  width: "abbreviated",
159
182
  context: "standalone"
160
183
  });
184
+ // J, F, ..., D
161
185
  case "LLLLL":
162
186
  return e.month(t, {
163
187
  width: "narrow",
164
188
  context: "standalone"
165
189
  });
190
+ // January, February, ..., December
166
191
  case "LLLL":
167
192
  default:
168
193
  return e.month(t, { width: "wide", context: "standalone" });
@@ -191,6 +216,7 @@ const s = {
191
216
  E: function(n, r, e) {
192
217
  const t = n.getDay();
193
218
  switch (r) {
219
+ // Tue
194
220
  case "E":
195
221
  case "EE":
196
222
  case "EEE":
@@ -198,16 +224,19 @@ const s = {
198
224
  width: "abbreviated",
199
225
  context: "formatting"
200
226
  });
227
+ // T
201
228
  case "EEEEE":
202
229
  return e.day(t, {
203
230
  width: "narrow",
204
231
  context: "formatting"
205
232
  });
233
+ // Tu
206
234
  case "EEEEEE":
207
235
  return e.day(t, {
208
236
  width: "short",
209
237
  context: "formatting"
210
238
  });
239
+ // Tuesday
211
240
  case "EEEE":
212
241
  default:
213
242
  return e.day(t, {
@@ -220,10 +249,13 @@ const s = {
220
249
  e: function(n, r, e, t) {
221
250
  const a = n.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
222
251
  switch (r) {
252
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
223
253
  case "e":
224
254
  return String(o);
255
+ // Padded numerical value
225
256
  case "ee":
226
257
  return i(o, 2);
258
+ // 1st, 2nd, ..., 7th
227
259
  case "eo":
228
260
  return e.ordinalNumber(o, { unit: "day" });
229
261
  case "eee":
@@ -231,16 +263,19 @@ const s = {
231
263
  width: "abbreviated",
232
264
  context: "formatting"
233
265
  });
266
+ // T
234
267
  case "eeeee":
235
268
  return e.day(a, {
236
269
  width: "narrow",
237
270
  context: "formatting"
238
271
  });
272
+ // Tu
239
273
  case "eeeeee":
240
274
  return e.day(a, {
241
275
  width: "short",
242
276
  context: "formatting"
243
277
  });
278
+ // Tuesday
244
279
  case "eeee":
245
280
  default:
246
281
  return e.day(a, {
@@ -253,10 +288,13 @@ const s = {
253
288
  c: function(n, r, e, t) {
254
289
  const a = n.getDay(), o = (a - t.weekStartsOn + 8) % 7 || 7;
255
290
  switch (r) {
291
+ // Numerical value (same as in `e`)
256
292
  case "c":
257
293
  return String(o);
294
+ // Padded numerical value
258
295
  case "cc":
259
296
  return i(o, r.length);
297
+ // 1st, 2nd, ..., 7th
260
298
  case "co":
261
299
  return e.ordinalNumber(o, { unit: "day" });
262
300
  case "ccc":
@@ -264,16 +302,19 @@ const s = {
264
302
  width: "abbreviated",
265
303
  context: "standalone"
266
304
  });
305
+ // T
267
306
  case "ccccc":
268
307
  return e.day(a, {
269
308
  width: "narrow",
270
309
  context: "standalone"
271
310
  });
311
+ // Tu
272
312
  case "cccccc":
273
313
  return e.day(a, {
274
314
  width: "short",
275
315
  context: "standalone"
276
316
  });
317
+ // Tuesday
277
318
  case "cccc":
278
319
  default:
279
320
  return e.day(a, {
@@ -286,27 +327,34 @@ const s = {
286
327
  i: function(n, r, e) {
287
328
  const t = n.getDay(), a = t === 0 ? 7 : t;
288
329
  switch (r) {
330
+ // 2
289
331
  case "i":
290
332
  return String(a);
333
+ // 02
291
334
  case "ii":
292
335
  return i(a, r.length);
336
+ // 2nd
293
337
  case "io":
294
338
  return e.ordinalNumber(a, { unit: "day" });
339
+ // Tue
295
340
  case "iii":
296
341
  return e.day(t, {
297
342
  width: "abbreviated",
298
343
  context: "formatting"
299
344
  });
345
+ // T
300
346
  case "iiiii":
301
347
  return e.day(t, {
302
348
  width: "narrow",
303
349
  context: "formatting"
304
350
  });
351
+ // Tu
305
352
  case "iiiiii":
306
353
  return e.day(t, {
307
354
  width: "short",
308
355
  context: "formatting"
309
356
  });
357
+ // Tuesday
310
358
  case "iiii":
311
359
  default:
312
360
  return e.day(t, {
@@ -437,13 +485,21 @@ const s = {
437
485
  if (t === 0)
438
486
  return "Z";
439
487
  switch (r) {
488
+ // Hours and optional minutes
440
489
  case "X":
441
490
  return f(t);
491
+ // Hours, minutes and optional seconds without `:` delimiter
492
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
493
+ // so this token always has the same output as `XX`
442
494
  case "XXXX":
443
495
  case "XX":
444
496
  return c(t);
497
+ // Hours, minutes and optional seconds with `:` delimiter
498
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
499
+ // so this token always has the same output as `XXX`
445
500
  case "XXXXX":
446
501
  case "XXX":
502
+ // Hours and minutes with `:` delimiter
447
503
  default:
448
504
  return c(t, ":");
449
505
  }
@@ -452,13 +508,21 @@ const s = {
452
508
  x: function(n, r, e) {
453
509
  const t = n.getTimezoneOffset();
454
510
  switch (r) {
511
+ // Hours and optional minutes
455
512
  case "x":
456
513
  return f(t);
514
+ // Hours, minutes and optional seconds without `:` delimiter
515
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
516
+ // so this token always has the same output as `xx`
457
517
  case "xxxx":
458
518
  case "xx":
459
519
  return c(t);
520
+ // Hours, minutes and optional seconds with `:` delimiter
521
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
522
+ // so this token always has the same output as `xxx`
460
523
  case "xxxxx":
461
524
  case "xxx":
525
+ // Hours and minutes with `:` delimiter
462
526
  default:
463
527
  return c(t, ":");
464
528
  }
@@ -467,10 +531,12 @@ const s = {
467
531
  O: function(n, r, e) {
468
532
  const t = n.getTimezoneOffset();
469
533
  switch (r) {
534
+ // Short
470
535
  case "O":
471
536
  case "OO":
472
537
  case "OOO":
473
538
  return "GMT" + d(t, ":");
539
+ // Long
474
540
  case "OOOO":
475
541
  default:
476
542
  return "GMT" + c(t, ":");
@@ -480,10 +546,12 @@ const s = {
480
546
  z: function(n, r, e) {
481
547
  const t = n.getTimezoneOffset();
482
548
  switch (r) {
549
+ // Short
483
550
  case "z":
484
551
  case "zz":
485
552
  case "zzz":
486
553
  return "GMT" + d(t, ":");
554
+ // Long
487
555
  case "zzzz":
488
556
  default:
489
557
  return "GMT" + c(t, ":");
@@ -3,6 +3,5 @@ function c(r, n) {
3
3
  return typeof r == "function" ? r(n) : r && typeof r == "object" && o in r ? r[o](n) : r instanceof Date ? new r.constructor(n) : new Date(n);
4
4
  }
5
5
  export {
6
- c as constructFrom,
7
- c as default
6
+ c as constructFrom
8
7
  };
@@ -2,7 +2,7 @@ import { getTimezoneOffsetInMilliseconds as a } from "./_lib/getTimezoneOffsetIn
2
2
  import { normalizeDates as c } from "./_lib/normalizeDates.js";
3
3
  import { millisecondsInDay as D } from "./constants.js";
4
4
  import { startOfDay as m } from "./startOfDay.js";
5
- function p(n, i, e) {
5
+ function u(n, i, e) {
6
6
  const [f, l] = c(
7
7
  e == null ? void 0 : e.in,
8
8
  n,
@@ -11,6 +11,5 @@ function p(n, i, e) {
11
11
  return Math.round((o - s) / D);
12
12
  }
13
13
  export {
14
- p as default,
15
- p as differenceInCalendarDays
14
+ u as differenceInCalendarDays
16
15
  };
@@ -51,7 +51,6 @@ function W(r) {
51
51
  return o ? o[1].replace(z, "'") : r;
52
52
  }
53
53
  export {
54
- q as default,
55
54
  q as format,
56
55
  q as formatDate,
57
56
  k as formatters,
@@ -1,11 +1,10 @@
1
1
  import { differenceInCalendarDays as e } from "./differenceInCalendarDays.js";
2
2
  import { startOfYear as t } from "./startOfYear.js";
3
3
  import { toDate as d } from "./toDate.js";
4
- function y(f, r) {
5
- const a = d(f, r == null ? void 0 : r.in);
6
- return e(a, t(a)) + 1;
4
+ function y(a, r) {
5
+ const f = d(a, r == null ? void 0 : r.in);
6
+ return e(f, t(f)) + 1;
7
7
  }
8
8
  export {
9
- y as default,
10
9
  y as getDayOfYear
11
10
  };
@@ -1,12 +1,11 @@
1
1
  import { millisecondsInWeek as m } from "./constants.js";
2
- import { startOfISOWeek as a } from "./startOfISOWeek.js";
3
- import { startOfISOWeekYear as o } from "./startOfISOWeekYear.js";
4
- import { toDate as d } from "./toDate.js";
2
+ import { startOfISOWeek as o } from "./startOfISOWeek.js";
3
+ import { startOfISOWeekYear as a } from "./startOfISOWeekYear.js";
4
+ import { toDate as i } from "./toDate.js";
5
5
  function k(t, e) {
6
- const r = d(t, e == null ? void 0 : e.in), f = +a(r) - +o(r);
6
+ const r = i(t, e == null ? void 0 : e.in), f = +o(r) - +a(r);
7
7
  return Math.round(f / m) + 1;
8
8
  }
9
9
  export {
10
- k as default,
11
10
  k as getISOWeek
12
11
  };
@@ -10,6 +10,5 @@ function Y(o, r) {
10
10
  return e.getTime() >= m.getTime() ? t + 1 : e.getTime() >= n.getTime() ? t : t - 1;
11
11
  }
12
12
  export {
13
- Y as default,
14
13
  Y as getISOWeekYear
15
14
  };
@@ -1,12 +1,11 @@
1
1
  import { millisecondsInWeek as m } from "./constants.js";
2
2
  import { startOfWeek as a } from "./startOfWeek.js";
3
- import { startOfWeekYear as d } from "./startOfWeekYear.js";
4
- import { toDate as c } from "./toDate.js";
5
- function l(t, e) {
6
- const r = c(t, e == null ? void 0 : e.in), f = +a(r, e) - +d(r, e);
3
+ import { startOfWeekYear as c } from "./startOfWeekYear.js";
4
+ import { toDate as d } from "./toDate.js";
5
+ function o(t, e) {
6
+ const r = d(t, e == null ? void 0 : e.in), f = +a(r, e) - +c(r, e);
7
7
  return Math.round(f / m) + 1;
8
8
  }
9
9
  export {
10
- l as default,
11
- l as getWeek
10
+ o as getWeek
12
11
  };
@@ -12,6 +12,5 @@ function H(t, e) {
12
12
  return +a >= +O ? r + 1 : +a >= +n ? r : r - 1;
13
13
  }
14
14
  export {
15
- H as default,
16
15
  H as getWeekYear
17
16
  };
@@ -2,6 +2,5 @@ function e(t) {
2
2
  return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
3
3
  }
4
4
  export {
5
- e as default,
6
5
  e as isDate
7
6
  };
@@ -1,14 +1,13 @@
1
- import { normalizeDates as d } from "./_lib/normalizeDates.js";
1
+ import { normalizeDates as i } from "./_lib/normalizeDates.js";
2
2
  import { startOfDay as t } from "./startOfDay.js";
3
- function D(e, r, a) {
4
- const [f, m] = d(
5
- a == null ? void 0 : a.in,
6
- e,
7
- r
3
+ function d(a, e, r) {
4
+ const [m, f] = i(
5
+ r == null ? void 0 : r.in,
6
+ a,
7
+ e
8
8
  );
9
- return +t(f) == +t(m);
9
+ return +t(m) == +t(f);
10
10
  }
11
11
  export {
12
- D as default,
13
- D as isSameDay
12
+ d as isSameDay
14
13
  };
@@ -1,13 +1,12 @@
1
1
  import { normalizeDates as n } from "./_lib/normalizeDates.js";
2
- function g(r, l, e) {
3
- const [t, a] = n(
2
+ function m(a, l, e) {
3
+ const [t, r] = n(
4
4
  e == null ? void 0 : e.in,
5
- r,
5
+ a,
6
6
  l
7
7
  );
8
- return t.getFullYear() === a.getFullYear() && t.getMonth() === a.getMonth();
8
+ return t.getFullYear() === r.getFullYear() && t.getMonth() === r.getMonth();
9
9
  }
10
10
  export {
11
- g as default,
12
- g as isSameMonth
11
+ m as isSameMonth
13
12
  };
@@ -1,13 +1,12 @@
1
- import { normalizeDates as u } from "./_lib/normalizeDates.js";
2
- function f(a, r, e) {
3
- const [l, t] = u(
1
+ import { normalizeDates as m } from "./_lib/normalizeDates.js";
2
+ function D(r, a, e) {
3
+ const [l, t] = m(
4
4
  e == null ? void 0 : e.in,
5
- a,
6
- r
5
+ r,
6
+ a
7
7
  );
8
8
  return l.getFullYear() === t.getFullYear();
9
9
  }
10
10
  export {
11
- f as default,
12
- f as isSameYear
11
+ D as isSameYear
13
12
  };
@@ -1,9 +1,8 @@
1
1
  import { isDate as r } from "./isDate.js";
2
- import { toDate as t } from "./toDate.js";
3
- function f(o) {
4
- return !(!r(o) && typeof o != "number" || isNaN(+t(o)));
2
+ import { toDate as i } from "./toDate.js";
3
+ function e(o) {
4
+ return !(!r(o) && typeof o != "number" || isNaN(+i(o)));
5
5
  }
6
6
  export {
7
- f as default,
8
- f as isValid
7
+ e as isValid
9
8
  };
@@ -1,21 +1,20 @@
1
1
  import { formatDistance as o } from "./en-US/_lib/formatDistance.js";
2
2
  import { formatLong as t } from "./en-US/_lib/formatLong.js";
3
- import { formatRelative as a } from "./en-US/_lib/formatRelative.js";
4
- import { localize as r } from "./en-US/_lib/localize.js";
5
- import { match as e } from "./en-US/_lib/match.js";
6
- const s = {
3
+ import { formatRelative as r } from "./en-US/_lib/formatRelative.js";
4
+ import { localize as m } from "./en-US/_lib/localize.js";
5
+ import { match as a } from "./en-US/_lib/match.js";
6
+ const p = {
7
7
  code: "en-US",
8
8
  formatDistance: o,
9
9
  formatLong: t,
10
- formatRelative: a,
11
- localize: r,
12
- match: e,
10
+ formatRelative: r,
11
+ localize: m,
12
+ match: a,
13
13
  options: {
14
14
  weekStartsOn: 0,
15
15
  firstWeekContainsDate: 1
16
16
  }
17
17
  };
18
18
  export {
19
- s as default,
20
- s as enUS
19
+ p as enUS
21
20
  };
@@ -1,9 +1,8 @@
1
- import { toDate as e } from "./toDate.js";
2
- function u(a, t) {
3
- const r = e(a, t == null ? void 0 : t.in);
4
- return r.setHours(0, 0, 0, 0), r;
1
+ import { toDate as a } from "./toDate.js";
2
+ function u(e, r) {
3
+ const t = a(e, r == null ? void 0 : r.in);
4
+ return t.setHours(0, 0, 0, 0), t;
5
5
  }
6
6
  export {
7
- u as default,
8
7
  u as startOfDay
9
8
  };
@@ -1,8 +1,7 @@
1
1
  import { startOfWeek as r } from "./startOfWeek.js";
2
- function f(t, e) {
2
+ function n(t, e) {
3
3
  return r(t, { ...e, weekStartsOn: 1 });
4
4
  }
5
5
  export {
6
- f as default,
7
- f as startOfISOWeek
6
+ n as startOfISOWeek
8
7
  };
@@ -1,11 +1,10 @@
1
- import { constructFrom as a } from "./constructFrom.js";
2
- import { getISOWeekYear as f } from "./getISOWeekYear.js";
3
- import { startOfISOWeek as s } from "./startOfISOWeek.js";
1
+ import { constructFrom as f } from "./constructFrom.js";
2
+ import { getISOWeekYear as s } from "./getISOWeekYear.js";
3
+ import { startOfISOWeek as a } from "./startOfISOWeek.js";
4
4
  function O(t, e) {
5
- const o = f(t, e), r = a(t, 0);
6
- return r.setFullYear(o, 0, 4), r.setHours(0, 0, 0, 0), s(r);
5
+ const o = s(t, e), r = f(t, 0);
6
+ return r.setFullYear(o, 0, 4), r.setHours(0, 0, 0, 0), a(r);
7
7
  }
8
8
  export {
9
- O as default,
10
9
  O as startOfISOWeekYear
11
10
  };
@@ -1,11 +1,10 @@
1
- import { getDefaultOptions as s } from "./_lib/defaultOptions.js";
2
- import { toDate as w } from "./toDate.js";
3
- function m(u, e) {
4
- var c, O, l, k;
5
- const a = s(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((O = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : O.weekStartsOn) ?? a.weekStartsOn ?? ((k = (l = a.locale) == null ? void 0 : l.options) == null ? void 0 : k.weekStartsOn) ?? 0, t = w(u, e == null ? void 0 : e.in), f = t.getDay(), d = (f < r ? 7 : 0) + f - r;
6
- return t.setDate(t.getDate() - d), t.setHours(0, 0, 0, 0), t;
1
+ import { getDefaultOptions as D } from "./_lib/defaultOptions.js";
2
+ import { toDate as S } from "./toDate.js";
3
+ function n(u, e) {
4
+ var f, O, k, l;
5
+ const a = D(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((O = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : O.weekStartsOn) ?? a.weekStartsOn ?? ((l = (k = a.locale) == null ? void 0 : k.options) == null ? void 0 : l.weekStartsOn) ?? 0, t = S(u, e == null ? void 0 : e.in), c = t.getDay(), w = (c < r ? 7 : 0) + c - r;
6
+ return t.setDate(t.getDate() - w), t.setHours(0, 0, 0, 0), t;
7
7
  }
8
8
  export {
9
- m as default,
10
- m as startOfWeek
9
+ n as startOfWeek
11
10
  };
@@ -1,13 +1,12 @@
1
- import { getDefaultOptions as W } from "./_lib/defaultOptions.js";
1
+ import { getDefaultOptions as l } from "./_lib/defaultOptions.js";
2
2
  import { constructFrom as n } from "./constructFrom.js";
3
3
  import { getWeekYear as u } from "./getWeekYear.js";
4
4
  import { startOfWeek as D } from "./startOfWeek.js";
5
5
  function g(r, e) {
6
- var f, s, c, k;
7
- const a = W(), l = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((s = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : s.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((k = (c = a.locale) == null ? void 0 : c.options) == null ? void 0 : k.firstWeekContainsDate) ?? 1, m = u(r, e), t = n((e == null ? void 0 : e.in) || r, 0);
8
- return t.setFullYear(m, 0, l), t.setHours(0, 0, 0, 0), D(t, e);
6
+ var f, c, s, k;
7
+ const a = l(), m = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (f = e == null ? void 0 : e.locale) == null ? void 0 : f.options) == null ? void 0 : c.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((k = (s = a.locale) == null ? void 0 : s.options) == null ? void 0 : k.firstWeekContainsDate) ?? 1, W = u(r, e), t = n((e == null ? void 0 : e.in) || r, 0);
8
+ return t.setFullYear(W, 0, m), t.setHours(0, 0, 0, 0), D(t, e);
9
9
  }
10
10
  export {
11
- g as default,
12
11
  g as startOfWeekYear
13
12
  };
@@ -4,6 +4,5 @@ function l(t, r) {
4
4
  return e.setFullYear(e.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e;
5
5
  }
6
6
  export {
7
- l as default,
8
7
  l as startOfYear
9
8
  };
@@ -1,8 +1,7 @@
1
1
  import { constructFrom as r } from "./constructFrom.js";
2
- function e(t, o) {
3
- return r(o || t, t);
2
+ function n(o, t) {
3
+ return r(t || o, o);
4
4
  }
5
5
  export {
6
- e as default,
7
- e as toDate
6
+ n as toDate
8
7
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.10.3",
6
+ "version": "1.10.4",
7
7
  "description": "The Spesia UI toolkit for React",
8
8
  "files": [
9
9
  "dist"
@@ -42,9 +42,9 @@
42
42
  "@storybook/test-runner": "^0.24.2",
43
43
  "@types/lodash": "^4.17.16",
44
44
  "@types/react": "^19.0.10",
45
- "@vitest/browser": "^3.0.8",
45
+ "@vitest/browser": "^4.0.0",
46
46
  "@vitest/browser-playwright": "^4.0.17",
47
- "@vitest/coverage-v8": "^3.0.8",
47
+ "@vitest/coverage-v8": "^4.0.0",
48
48
  "eslint": "^9.23.0",
49
49
  "eslint-config-next": "^15.2.2",
50
50
  "eslint-config-prettier": "^9.1.0",
@@ -57,9 +57,9 @@
57
57
  "sass": "^1.85.1",
58
58
  "storybook": "^10.1.11",
59
59
  "typescript": "5.5.3",
60
- "vite": "5.3.3",
60
+ "vite": "^6.0.0",
61
61
  "vite-plugin-dts": "^4.5.3",
62
- "vitest": "^3.0.8"
62
+ "vitest": "^4.0.0"
63
63
  },
64
64
  "dependencies": {
65
65
  "classnames": "^2.5.1",