@trsys-tech/matrix-library 0.6.0-alpha.0 → 0.6.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.
package/README.md CHANGED
@@ -15,6 +15,8 @@ MatrixUI Library is a comprehensive UI component library built with React and Ty
15
15
 
16
16
  To install the MatrixUI Library, use npm or yarn:
17
17
 
18
+ This package supports React 18 and React 19. Your application must provide matching `react` and `react-dom` peer dependencies.
19
+
18
20
  ```sh
19
21
  npm install @trsys-tech/matrix-library
20
22
  ```
@@ -48,6 +50,21 @@ MatrixUI Library includes a variety of components, such as:
48
50
 
49
51
  For a full list of components and their usage, please refer to the [Storybook](https://trsys-tech.github.io/matrix-library/) documentation.
50
52
 
53
+ ### React Version Support
54
+
55
+ This library supports both React 18 (`^18.3.1`) and React 19 (`^19.2.4`) as peer dependencies. The library is built as ESM with React externalized, meaning it does not bundle React and relies on the consumer's installed React version.
56
+
57
+ **Known Limitation:** During development and testing, we use React 18 type definitions even when testing against React 19 runtime. This is due to a transitive dependency type incompatibility in the Storybook ecosystem:
58
+
59
+ ```
60
+ @storybook/addon-essentials
61
+ → @storybook/addon-docs
62
+ → @mdx-js/mdx
63
+ → @types/mdx (does not support React 19 types)
64
+ ```
65
+
66
+ Since Storybook is dev-only, this limitation does not affect the shipped library. Runtime compatibility with React 19 is fully validated during the build process.
67
+
51
68
  ## Development
52
69
 
53
70
  To set up the development environment, clone the repository and install the dependencies:
@@ -1,4 +1,4 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
3
  import { Slot as c } from "@radix-ui/react-slot";
4
4
  import { cn as t } from "./utils.es.js";
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,eAAe,EAAE,SAAS,EAAE,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAKpH,QAAA,MAAM,IAAI,iMA6DiH,GAAG,CAAC,OAAO,AA7D7G,CAAC;AAQ1B,QAAA,MAAM,SAAS,GAAI,YAAY,SAAS,WAAW,gBAAgB,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,0CAErG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAC;AA+BF,QAAA,MAAM,QAAQ,6GAQZ,CAAC;AAGH,QAAA,MAAM,SAAS,8KAIb,CAAC;AAGH,QAAA,MAAM,WAAW,8JAaf,CAAC;AAGH,QAAA,MAAM,eAAe,yHAInB,CAAC;AAGH,QAAA,MAAM,WAAW,yHAaf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/components/form/Form.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAc,eAAe,EAAE,SAAS,EAAE,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAKpH,QAAA,MAAM,IAAI,iMA6DyH,GAAE,CACrI,OACE,AA/DuB,CAAC;AAQ1B,QAAA,MAAM,SAAS,GAAI,YAAY,SAAS,WAAW,gBAAgB,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,0CAErG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMtC,CAAC;AA+BF,QAAA,MAAM,QAAQ,6GAQZ,CAAC;AAGH,QAAA,MAAM,SAAS,8KAIb,CAAC;AAGH,QAAA,MAAM,WAAW,8JAaf,CAAC;AAGH,QAAA,MAAM,eAAe,yHAInB,CAAC;AAGH,QAAA,MAAM,WAAW,yHAaf,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/TextField.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIrD,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgBrB,CAAC;AAEH,UAAU,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,OAAO,iBAAiB,CAAC;IAC3G,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,QAAA,MAAM,SAAS,yFAuCd,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/text-field/TextField.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAM,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIrD,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAgBrB,CAAC;AAEH,UAAU,cAAe,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,OAAO,iBAAiB,CAAC;IAC3G,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,EAAE;QACV,UAAU,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;KAC1D,CAAC;CACH;AAED,QAAA,MAAM,SAAS,yFA8Dd,CAAC;AAGF,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,CAAC"}
@@ -3,7 +3,6 @@ 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
  };
9
8
  //# sourceMappingURL=constructfrom.es.js.map
@@ -2,7 +2,7 @@ import { jsx as o, jsxs as z } from "react/jsx-runtime";
2
2
  import e, { forwardRef as H, useMemo as N } from "react";
3
3
  import { AgGridReact as L } from "ag-grid-react";
4
4
  import { themeQuartz as M, ModuleRegistry as B, AllCommunityModule as Q } from "ag-grid-community";
5
- import { CircleXmark as O, Magnifier as k, Snowflake as q, Print as $, Refresh as j, ElipsisVertical as _, Trashcan as U } from "@trsys-tech/matrix-icons";
5
+ import { Trashcan as O, ElipsisVertical as q, Snowflake as $, Print as j, Refresh as _, CircleXmark as U, Magnifier as k } from "@trsys-tech/matrix-icons";
6
6
  import { cn as g } from "./utils.es.js";
7
7
  import { printHtml as V } from "./printhtml.es.js";
8
8
  import { TextField as W } from "./textfield.es.js";
@@ -134,7 +134,7 @@ const fe = ({ className: r, ...s }) => {
134
134
  onChange: (R) => c(R.target.value),
135
135
  value: a,
136
136
  startAdornment: /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 h-6 w-6 border-none mx-1", onClick: m, children: /* @__PURE__ */ o(k, { className: "w-5 h-5" }) }),
137
- endAdornment: a && /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: f, children: /* @__PURE__ */ o(O, { className: "w-5 h-5" }) })
137
+ endAdornment: a && /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 w-6 h-6 border-none mx-1", onClick: f, children: /* @__PURE__ */ o(U, { className: "w-5 h-5" }) })
138
138
  }
139
139
  ) : /* @__PURE__ */ o(D, { variant: "toolbar", className: "p-0.5 w-6 h-6 m-1", onClick: p, children: /* @__PURE__ */ o(k, { className: "w-5 h-5" }) }) });
140
140
  }, me = ({ freezeText: r, unFreezeText: s, onClick: i, disabled: n, ...a }) => {
@@ -170,7 +170,7 @@ const fe = ({ className: r, ...s }) => {
170
170
  {
171
171
  variant: "text",
172
172
  onClick: E,
173
- startIcon: /* @__PURE__ */ o(q, { className: "w-4.5 h-4.5" }),
173
+ startIcon: /* @__PURE__ */ o($, { className: "w-4.5 h-4.5" }),
174
174
  disabled: !d && !h || n,
175
175
  ...a,
176
176
  children: d ? s ?? "Unfreeze" : r ?? "Freeze"
@@ -189,7 +189,7 @@ const fe = ({ className: r, ...s }) => {
189
189
  V(l), a?.api?.setGridOption("domLayout", void 0);
190
190
  })), i?.(d);
191
191
  };
192
- return /* @__PURE__ */ o(D, { variant: "toolbar", className: g("p-0.5 w-6 h-6", s), onClick: c, ...n, children: r ?? /* @__PURE__ */ o($, { className: "w-5 h-5" }) });
192
+ return /* @__PURE__ */ o(D, { variant: "toolbar", className: g("p-0.5 w-6 h-6", s), onClick: c, ...n, children: r ?? /* @__PURE__ */ o(j, { className: "w-5 h-5" }) });
193
193
  }, xe = ({ className: r, onRefresh: s, children: i, loading: n, ...a }) => {
194
194
  if (!e.useContext(w))
195
195
  throw new Error("RefreshAction should be used within <DataGrid>");
@@ -204,13 +204,13 @@ const fe = ({ className: r, ...s }) => {
204
204
  onClick: d,
205
205
  disabled: n,
206
206
  ...a,
207
- children: i ?? /* @__PURE__ */ o(j, { className: g("w-4.5 h-4.5", n && "animate-spin") })
207
+ children: i ?? /* @__PURE__ */ o(_, { className: g("w-4.5 h-4.5", n && "animate-spin") })
208
208
  }
209
209
  );
210
210
  }, ge = ({ onDelete: r, children: s, ...i }) => /* @__PURE__ */ o(P, { variant: "danger", onClick: () => {
211
211
  r();
212
- }, startIcon: /* @__PURE__ */ o(U, { className: "w-4.5 h-4.5" }), ...i, children: s }), Ce = ({ children: r, slotProps: s, className: i, ...n }) => /* @__PURE__ */ z(X, { ...s?.popoverProps ?? {}, children: [
213
- /* @__PURE__ */ o(J, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ o(_, { className: "w-4.5 h-4.5 text-primary" }) }),
212
+ }, startIcon: /* @__PURE__ */ o(O, { className: "w-4.5 h-4.5" }), ...i, children: s }), Ce = ({ children: r, slotProps: s, className: i, ...n }) => /* @__PURE__ */ z(X, { ...s?.popoverProps ?? {}, children: [
213
+ /* @__PURE__ */ o(J, { ...s?.triggerProps ?? {}, children: /* @__PURE__ */ o(q, { className: "w-4.5 h-4.5 text-primary" }) }),
214
214
  /* @__PURE__ */ o(K, { align: "end", className: g("w-40", i), ...n, children: r })
215
215
  ] });
216
216
  export {
@@ -4,36 +4,36 @@ import { Calendar as x } from "@trsys-tech/matrix-icons";
4
4
  import { cn as w } from "./utils.es.js";
5
5
  import { Calendar as v } from "./calendar.es.js";
6
6
  import { Button as C } from "./button.es.js";
7
- import { Popover as D, PopoverTrigger as k, PopoverContent as M } from "./popover.es.js";
8
- import { formatDate as n } from "./format.es.js";
7
+ import { Popover as k, PopoverTrigger as D, PopoverContent as M } from "./popover.es.js";
8
+ import { format as n } from "./format.es.js";
9
9
  const I = ({
10
10
  formatStr: a,
11
11
  selected: e,
12
- placeholder: s,
13
- className: d,
12
+ placeholder: d,
13
+ className: s,
14
14
  calendarClassName: i,
15
15
  closeOnSelect: l = !0,
16
16
  onDayClick: p,
17
17
  disabled: m,
18
18
  ...c
19
19
  }) => {
20
- const [f, o] = g.useState(!1), u = (y, b, h) => {
20
+ const [u, o] = g.useState(!1), f = (y, b, h) => {
21
21
  p?.(y, b, h), l && o(!1);
22
22
  };
23
- return /* @__PURE__ */ t(D, { open: f, onOpenChange: o, children: [
24
- /* @__PURE__ */ r(k, { asChild: !0, children: /* @__PURE__ */ t(
23
+ return /* @__PURE__ */ t(k, { open: u, onOpenChange: o, children: [
24
+ /* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ t(
25
25
  C,
26
26
  {
27
27
  variant: "text",
28
28
  className: w(
29
29
  "flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300",
30
- d
30
+ s
31
31
  ),
32
32
  "data-placeholder": e ? void 0 : "",
33
33
  "aria-label": e ? `Selected date: ${n(e, a ?? "yyyy/MM/dd")}` : "Pick a date",
34
34
  disabled: m,
35
35
  children: [
36
- e ? n(e, a ?? "yyyy/MM/dd") : /* @__PURE__ */ r("span", { children: s ?? "Pick a date" }),
36
+ e ? n(e, a ?? "yyyy/MM/dd") : /* @__PURE__ */ r("span", { children: d ?? "Pick a date" }),
37
37
  /* @__PURE__ */ r(x, { className: "mr-2 ms-auto" })
38
38
  ]
39
39
  }
@@ -49,7 +49,7 @@ const I = ({
49
49
  selected: e,
50
50
  captionLayout: "dropdown-years",
51
51
  className: i,
52
- onDayClick: u
52
+ onDayClick: f
53
53
  }
54
54
  ) })
55
55
  ] });
@@ -5,13 +5,13 @@ import { cn as i } from "./utils.es.js";
5
5
  import { Calendar as b } from "./calendar.es.js";
6
6
  import { Button as x } from "./button.es.js";
7
7
  import { Popover as w, PopoverTrigger as M, PopoverContent as v } from "./popover.es.js";
8
- import { formatDate as t } from "./format.es.js";
8
+ import { format as t } from "./format.es.js";
9
9
  const R = ({
10
10
  formatStr: e,
11
11
  selected: r,
12
12
  placeholder: n,
13
- className: s,
14
- calendarClassName: d,
13
+ className: d,
14
+ calendarClassName: s,
15
15
  fromText: m,
16
16
  toText: p,
17
17
  disabled: l,
@@ -32,7 +32,7 @@ const R = ({
32
32
  variant: "text",
33
33
  className: i(
34
34
  "flex h-8 w-full items-center justify-between whitespace-nowrap rounded-sm border border-input bg-transparent ps-3 pe-1 py-1.5 text-xs ring-offset-background data-[placeholder]:text-muted-foreground hover:border hover:border-primary hover:bg-transparent focus:border focus:border-primary focus:outline-none focus:ring focus:ring-primary-100 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-text-300 disabled:border-gray-100 [&>span]:line-clamp-1 [&_svg]:disabled:text-text-300",
35
- s
35
+ d
36
36
  ),
37
37
  "data-placeholder": r ? void 0 : "",
38
38
  "aria-label": r ? `Selected date: ${r?.from ? t(r.from, e ?? "yyyy/MM/dd") : ""} - ${r?.to ? t(r.to, e ?? "yyyy/MM/dd") : ""}` : n,
@@ -64,7 +64,7 @@ const R = ({
64
64
  ...f,
65
65
  mode: "range",
66
66
  selected: r,
67
- className: i(d, "md:max-w-full md:w-[36rem]"),
67
+ className: i(s, "md:max-w-full md:w-[36rem]"),
68
68
  numberOfMonths: 2
69
69
  }
70
70
  ) })
package/dist/dialog.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
3
  import * as a from "@radix-ui/react-dialog";
4
4
  import { XMark as m } from "@trsys-tech/matrix-icons";
@@ -2,16 +2,15 @@ import { getTimezoneOffsetInMilliseconds as r } from "./gettimezoneoffsetinmilli
2
2
  import { normalizeDates as c } from "./normalizedates.es.js";
3
3
  import { millisecondsInDay as D } from "./constants.es.js";
4
4
  import { startOfDay as a } from "./startofday.es.js";
5
- function O(o, n, i) {
6
- const [s, m] = c(
5
+ function u(o, n, i) {
6
+ const [m, s] = c(
7
7
  i?.in,
8
8
  o,
9
9
  n
10
- ), t = a(s), e = a(m), f = +t - r(t), l = +e - r(e);
10
+ ), t = a(m), e = a(s), f = +t - r(t), l = +e - r(e);
11
11
  return Math.round((f - l) / D);
12
12
  }
13
13
  export {
14
- O as default,
15
- O as differenceInCalendarDays
14
+ u as differenceInCalendarDays
16
15
  };
17
16
  //# sourceMappingURL=differenceincalendardays.es.js.map
package/dist/en-us.es.js CHANGED
@@ -1,22 +1,21 @@
1
1
  import { formatDistance as o } from "./formatdistance.es.js";
2
2
  import { formatLong as t } from "./formatlong.es.js";
3
- import { formatRelative as a } from "./formatrelative.es.js";
4
- import { localize as r } from "./localize.es.js";
5
- import { match as e } from "./match.es.js";
6
- const s = {
3
+ import { formatRelative as r } from "./formatrelative.es.js";
4
+ import { localize as m } from "./localize.es.js";
5
+ import { match as a } from "./match.es.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
  };
22
21
  //# sourceMappingURL=en-us.es.js.map
package/dist/format.es.js CHANGED
@@ -10,11 +10,11 @@ function j(o, r, f) {
10
10
  const a = k(), n = a.locale ?? E, m = a.firstWeekContainsDate ?? a.locale?.options?.firstWeekContainsDate ?? 1, p = a.weekStartsOn ?? a.locale?.options?.weekStartsOn ?? 0, i = D(o, f?.in);
11
11
  if (!T(i))
12
12
  throw new RangeError("Invalid time value");
13
- let s = r.match(O).map((t) => {
13
+ let c = r.match(O).map((t) => {
14
14
  const e = t[0];
15
15
  if (e === "p" || e === "P") {
16
- const c = g[e];
17
- return c(t, n.formatLong);
16
+ const s = g[e];
17
+ return s(t, n.formatLong);
18
18
  }
19
19
  return t;
20
20
  }).join("").match(v).map((t) => {
@@ -31,18 +31,18 @@ function j(o, r, f) {
31
31
  );
32
32
  return { isToken: !1, value: t };
33
33
  });
34
- n.localize.preprocessor && (s = n.localize.preprocessor(i, s));
34
+ n.localize.preprocessor && (c = n.localize.preprocessor(i, c));
35
35
  const u = {
36
36
  firstWeekContainsDate: m,
37
37
  weekStartsOn: p,
38
38
  locale: n
39
39
  };
40
- return s.map((t) => {
40
+ return c.map((t) => {
41
41
  if (!t.isToken) return t.value;
42
42
  const e = t.value;
43
43
  (h(e) || d(e)) && w(e, r, String(o));
44
- const c = l[e[0]];
45
- return c(i, e, n.localize, u);
44
+ const s = l[e[0]];
45
+ return s(i, e, n.localize, u);
46
46
  }).join("");
47
47
  }
48
48
  function P(o) {
@@ -50,7 +50,6 @@ function P(o) {
50
50
  return r ? r[1].replace(x, "'") : o;
51
51
  }
52
52
  export {
53
- j as default,
54
53
  j as format,
55
54
  j as formatDate,
56
55
  l as formatters,
@@ -1,12 +1,11 @@
1
- import { differenceInCalendarDays as f } from "./differenceincalendardays.es.js";
1
+ import { differenceInCalendarDays as a } from "./differenceincalendardays.es.js";
2
2
  import { startOfYear as e } from "./startofyear.es.js";
3
3
  import { toDate as o } from "./todate.es.js";
4
- function c(t, a) {
5
- const r = o(t, a?.in);
6
- return f(r, e(r)) + 1;
4
+ function s(t, f) {
5
+ const r = o(t, f?.in);
6
+ return a(r, e(r)) + 1;
7
7
  }
8
8
  export {
9
- c as default,
10
- c as getDayOfYear
9
+ s as getDayOfYear
11
10
  };
12
11
  //# sourceMappingURL=getdayofyear.es.js.map
@@ -2,12 +2,11 @@ import { millisecondsInWeek as f } from "./constants.es.js";
2
2
  import { startOfISOWeek as i } from "./startofisoweek.es.js";
3
3
  import { startOfISOWeekYear as m } from "./startofisoweekyear.es.js";
4
4
  import { toDate as n } from "./todate.es.js";
5
- function O(e, o) {
5
+ function c(e, o) {
6
6
  const t = n(e, o?.in), r = +i(t) - +m(t);
7
7
  return Math.round(r / f) + 1;
8
8
  }
9
9
  export {
10
- O as default,
11
- O as getISOWeek
10
+ c as getISOWeek
12
11
  };
13
12
  //# sourceMappingURL=getisoweek.es.js.map
@@ -10,7 +10,6 @@ function Y(f, n) {
10
10
  return e.getTime() >= u.getTime() ? t + 1 : e.getTime() >= i.getTime() ? t : t - 1;
11
11
  }
12
12
  export {
13
- Y as default,
14
13
  Y as getISOWeekYear
15
14
  };
16
15
  //# sourceMappingURL=getisoweekyear.es.js.map
@@ -1,13 +1,12 @@
1
1
  import { millisecondsInWeek as f } from "./constants.es.js";
2
2
  import { startOfWeek as m } from "./startofweek.es.js";
3
- import { startOfWeekYear as a } from "./startofweekyear.es.js";
4
- import { toDate as i } from "./todate.es.js";
5
- function k(r, t) {
6
- const e = i(r, t?.in), o = +m(e, t) - +a(e, t);
3
+ import { startOfWeekYear as i } from "./startofweekyear.es.js";
4
+ import { toDate as n } from "./todate.es.js";
5
+ function s(r, t) {
6
+ const e = n(r, t?.in), o = +m(e, t) - +i(e, t);
7
7
  return Math.round(o / f) + 1;
8
8
  }
9
9
  export {
10
- k as default,
11
- k as getWeek
10
+ s as getWeek
12
11
  };
13
12
  //# sourceMappingURL=getweek.es.js.map
@@ -1,17 +1,16 @@
1
1
  import { getDefaultOptions as k } from "./defaultoptions.es.js";
2
- import { constructFrom as i } from "./constructfrom.es.js";
2
+ import { constructFrom as f } from "./constructfrom.es.js";
3
3
  import { startOfWeek as l } from "./startofweek.es.js";
4
4
  import { toDate as m } from "./todate.es.js";
5
5
  function C(r, e) {
6
- const s = m(r, e?.in), t = s.getFullYear(), o = k(), f = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = i(e?.in || r, 0);
7
- a.setFullYear(t + 1, 0, f), a.setHours(0, 0, 0, 0);
8
- const c = l(a, e), n = i(e?.in || r, 0);
9
- n.setFullYear(t, 0, f), n.setHours(0, 0, 0, 0);
6
+ const s = m(r, e?.in), t = s.getFullYear(), o = k(), i = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = f(e?.in || r, 0);
7
+ a.setFullYear(t + 1, 0, i), a.setHours(0, 0, 0, 0);
8
+ const c = l(a, e), n = f(e?.in || r, 0);
9
+ n.setFullYear(t, 0, i), n.setHours(0, 0, 0, 0);
10
10
  const u = l(n, e);
11
11
  return +s >= +c ? t + 1 : +s >= +u ? t : t - 1;
12
12
  }
13
13
  export {
14
- C as default,
15
14
  C as getWeekYear
16
15
  };
17
16
  //# sourceMappingURL=getweekyear.es.js.map
package/dist/index.es.js CHANGED
@@ -57,11 +57,11 @@ import { Tooltip as st, TooltipContent as Mt, TooltipProvider as Tt, TooltipTrig
57
57
  import { useIsMobile as ht } from "./use-mobile.es.js";
58
58
  import { cn as wt } from "./utils.es.js";
59
59
  import { DesktopDatePicker as It } from "./desktopdatepicker.es.js";
60
- import { MobileDatePicker as Gt } from "./mobiledatepicker.es.js";
61
- import { DesktopDateRangePicker as Rt } from "./desktopdaterangepicker.es.js";
62
- import { MobileDateRangePicker as Ht } from "./mobiledaterangepicker.es.js";
63
- import { MobileTimePicker as Et } from "./mobiletimepicker.es.js";
64
- import { DesktopTimePicker as Vt } from "./desktoptimepicker.es.js";
60
+ import { DesktopDateRangePicker as Gt } from "./desktopdaterangepicker.es.js";
61
+ import { DesktopTimePicker as Rt } from "./desktoptimepicker.es.js";
62
+ import { MobileDatePicker as Ht } from "./mobiledatepicker.es.js";
63
+ import { MobileDateRangePicker as Et } from "./mobiledaterangepicker.es.js";
64
+ import { MobileTimePicker as Vt } from "./mobiletimepicker.es.js";
65
65
  export {
66
66
  t as Accordion,
67
67
  a as AccordionContent,
@@ -124,8 +124,8 @@ export {
124
124
  Re as DateRangePicker,
125
125
  Te as DeleteAction,
126
126
  It as DesktopDatePicker,
127
- Rt as DesktopDateRangePicker,
128
- Vt as DesktopTimePicker,
127
+ Gt as DesktopDateRangePicker,
128
+ Rt as DesktopTimePicker,
129
129
  Ee as Dialog,
130
130
  Oe as DialogClose,
131
131
  Ve as DialogContent,
@@ -163,9 +163,9 @@ export {
163
163
  Pe as FreezeAction,
164
164
  Ur as IconButton,
165
165
  qr as Label,
166
- Gt as MobileDatePicker,
167
- Ht as MobileDateRangePicker,
168
- Et as MobileTimePicker,
166
+ Ht as MobileDatePicker,
167
+ Et as MobileDateRangePicker,
168
+ Vt as MobileTimePicker,
169
169
  Kr as Modal,
170
170
  Nr as ModalFooter,
171
171
  Wr as MultiSelect,
package/dist/isdate.es.js CHANGED
@@ -2,7 +2,6 @@ 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
  };
8
7
  //# sourceMappingURL=isdate.es.js.map
@@ -1,10 +1,9 @@
1
1
  import { isDate as r } from "./isdate.es.js";
2
- import { toDate as t } from "./todate.es.js";
3
- function f(o) {
4
- return !(!r(o) && typeof o != "number" || isNaN(+t(o)));
2
+ import { toDate as i } from "./todate.es.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
  };
10
9
  //# sourceMappingURL=isvalid.es.js.map
@@ -6,7 +6,7 @@ import { cn as m } from "./utils.es.js";
6
6
  import { Calendar as C } from "./calendar.es.js";
7
7
  import { Button as o } from "./button.es.js";
8
8
  import { Dialog as k, DialogContent as j, DialogHeader as P, DialogTitle as F, DialogDescription as O } from "./dialog.es.js";
9
- import { formatDate as s } from "./format.es.js";
9
+ import { format as i } from "./format.es.js";
10
10
  const T = ({
11
11
  formatStr: l,
12
12
  selected: a,
@@ -19,9 +19,9 @@ const T = ({
19
19
  disabled: g,
20
20
  ...y
21
21
  }) => {
22
- const [D, n] = c.useState(!1), [t, i] = c.useState(a), d = () => {
23
- n(!1), i(a);
24
- }, w = () => {
22
+ const [w, n] = c.useState(!1), [t, s] = c.useState(a), d = () => {
23
+ n(!1), s(a);
24
+ }, D = () => {
25
25
  x?.(t), n(!1);
26
26
  };
27
27
  return /* @__PURE__ */ r(v, { children: [
@@ -35,19 +35,19 @@ const T = ({
35
35
  ),
36
36
  "data-placeholder": a ? void 0 : "",
37
37
  onClick: () => n(!0),
38
- "aria-label": a ? `Selected date: ${s(a, l ?? "yyyy/MM/dd")}` : "Pick a date",
38
+ "aria-label": a ? `Selected date: ${i(a, l ?? "yyyy/MM/dd")}` : "Pick a date",
39
39
  disabled: g,
40
40
  children: [
41
- a ? s(a, l ?? "eee, MMM dd") : /* @__PURE__ */ e("span", { children: p ?? "Pick a date" }),
41
+ a ? i(a, l ?? "eee, MMM dd") : /* @__PURE__ */ e("span", { children: p ?? "Pick a date" }),
42
42
  /* @__PURE__ */ e(N, { className: "mr-2 h-5 w-5 ms-auto" })
43
43
  ]
44
44
  }
45
45
  ),
46
- /* @__PURE__ */ e(k, { open: D, onOpenChange: d, children: /* @__PURE__ */ r(j, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
46
+ /* @__PURE__ */ e(k, { open: w, onOpenChange: d, children: /* @__PURE__ */ r(j, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
47
47
  /* @__PURE__ */ r(P, { className: "p-4 border-b border-b-gray-200", children: [
48
48
  /* @__PURE__ */ e(F, { asChild: !0, children: /* @__PURE__ */ r("div", { className: "text-sm font-bold space-y-1 mt-3", children: [
49
49
  /* @__PURE__ */ e("h5", { className: "text-text-300", children: t?.getFullYear() ?? /* @__PURE__ */ e("pre", { children: " " }) }),
50
- /* @__PURE__ */ e("h6", { className: "", children: t ? s(t, l ?? "eee, MMM dd") : /* @__PURE__ */ e("pre", { children: " " }) })
50
+ /* @__PURE__ */ e("h6", { className: "", children: t ? i(t, l ?? "eee, MMM dd") : /* @__PURE__ */ e("pre", { children: " " }) })
51
51
  ] }) }),
52
52
  /* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(O, { children: "Date Picker" }) })
53
53
  ] }),
@@ -61,13 +61,13 @@ const T = ({
61
61
  ...y,
62
62
  mode: "single",
63
63
  selected: t,
64
- onSelect: i,
64
+ onSelect: s,
65
65
  className: m("p-0", f)
66
66
  }
67
67
  ),
68
68
  /* @__PURE__ */ r("div", { className: "flex justify-center items-center gap-4 mt-auto w-full", children: [
69
69
  /* @__PURE__ */ e(o, { variant: "text", className: "flex-1 h-10", onClick: d, children: u ?? "Cancel" }),
70
- /* @__PURE__ */ e(o, { variant: "primary", className: "flex-1 h-10", onClick: w, children: b ?? "Apply" })
70
+ /* @__PURE__ */ e(o, { variant: "primary", className: "flex-1 h-10", onClick: D, children: b ?? "Apply" })
71
71
  ] })
72
72
  ] })
73
73
  ] }) })
@@ -6,7 +6,7 @@ import { cn as p } from "./utils.es.js";
6
6
  import { Calendar as P } from "./calendar.es.js";
7
7
  import { Button as m } from "./button.es.js";
8
8
  import { Dialog as $, DialogContent as A, DialogHeader as H, DialogTitle as B, DialogDescription as I } from "./dialog.es.js";
9
- import { formatDate as l } from "./format.es.js";
9
+ import { format as l } from "./format.es.js";
10
10
  const K = ({
11
11
  formatStr: n,
12
12
  selected: r,
@@ -20,9 +20,9 @@ const K = ({
20
20
  fromText: M,
21
21
  toText: v,
22
22
  disabled: N,
23
- ...D
23
+ ...w
24
24
  }) => {
25
- const [w, s] = f.useState(!1), [e, i] = f.useState(r), C = (a, k, j) => {
25
+ const [C, s] = f.useState(!1), [e, i] = f.useState(r), D = (a, k, j) => {
26
26
  x?.(a, k, j), !e || !e.from ? i({ from: a, to: void 0 }) : a < e.from ? e.to ? i({ from: a, to: e.to }) : i({ from: a, to: e.from }) : e?.from?.getTime() === a?.getTime() && (e?.from?.getTime() === e?.to?.getTime() || !e.to) ? i(void 0) : e?.from?.getTime() !== e?.to?.getTime() && (e.from?.getTime() === a?.getTime() || e?.to?.getTime() === a?.getTime()) ? i({ from: a, to: a }) : i({ ...e, to: a });
27
27
  }, c = () => {
28
28
  s(!1), i(r);
@@ -60,7 +60,7 @@ const K = ({
60
60
  ]
61
61
  }
62
62
  ),
63
- /* @__PURE__ */ o($, { open: w, onOpenChange: c, children: /* @__PURE__ */ t(A, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
63
+ /* @__PURE__ */ o($, { open: C, onOpenChange: c, children: /* @__PURE__ */ t(A, { className: "h-dscreen w-screen p-0 flex flex-col gap-0 data-[state=open]:animate-slide-from-bottom data-[state=closed]:animate-slide-to-bottom overflow-auto max-w-screen-2xl sm:rounded-none", children: [
64
64
  /* @__PURE__ */ t(H, { children: [
65
65
  /* @__PURE__ */ o(B, { asChild: !0, children: /* @__PURE__ */ t("div", { className: "grid grid-cols-2 border-b border-b-gray-200 mt-3", children: [
66
66
  /* @__PURE__ */ t("div", { className: "text-sm font-bold space-y-1 border-e border-e-gray-200 p-4", children: [
@@ -81,10 +81,10 @@ const K = ({
81
81
  defaultMonth: r?.from,
82
82
  startMonth: new Date(2e3, 0, 1),
83
83
  endMonth: new Date((/* @__PURE__ */ new Date()).getFullYear() + 2, 11, 31),
84
- ...D,
84
+ ...w,
85
85
  mode: "range",
86
86
  selected: r,
87
- onDayClick: C,
87
+ onDayClick: D,
88
88
  className: p("p-0", g)
89
89
  }
90
90
  ),
package/dist/sheet.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsx as o, jsxs as n } from "react/jsx-runtime";
1
+ import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import * as e from "@radix-ui/react-dialog";
4
4
  import { tv as c } from "tailwind-variants";
@@ -1,10 +1,9 @@
1
- import { toDate as a } from "./todate.es.js";
2
- function n(o, r) {
3
- const t = a(o, r?.in);
1
+ import { toDate as e } from "./todate.es.js";
2
+ function a(o, r) {
3
+ const t = e(o, r?.in);
4
4
  return t.setHours(0, 0, 0, 0), t;
5
5
  }
6
6
  export {
7
- n as default,
8
- n as startOfDay
7
+ a as startOfDay
9
8
  };
10
9
  //# sourceMappingURL=startofday.es.js.map
@@ -1,9 +1,8 @@
1
1
  import { startOfWeek as r } from "./startofweek.es.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
  };
9
8
  //# sourceMappingURL=startofisoweek.es.js.map
@@ -1,12 +1,11 @@
1
- import { constructFrom as a } from "./constructfrom.es.js";
2
- import { getISOWeekYear as f } from "./getisoweekyear.es.js";
3
- import { startOfISOWeek as s } from "./startofisoweek.es.js";
1
+ import { constructFrom as f } from "./constructfrom.es.js";
2
+ import { getISOWeekYear as s } from "./getisoweekyear.es.js";
3
+ import { startOfISOWeek as a } from "./startofisoweek.es.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
  };
12
11
  //# sourceMappingURL=startofisoweekyear.es.js.map