mainstack-design-system 1.17.0 → 1.17.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.
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),k=require("react"),f=require("./utils-s-0cOrOT.cjs"),p=require("./mainstack-design-system614.cjs"),D=require("./DayPickerExtended-BI8ETMuv.cjs"),r=require("./isValid-914h5Kof.cjs"),o=k.forwardRef(({className:s,...d},c)=>{const{dateRange:a,value:e,isDisabled:t,onValueChange:n,onOpenChange:l}=p.useDatePickerContext(),u=t||(a?{before:a?.from||new Date,after:a?.to}:void 0);return i.jsx("div",{"data-slot":"date-picker-calendar",className:f.cn("@container",s),ref:c,children:i.jsx(D.DayPickerExtended,{animate:!0,mode:"single",captionLayout:"dropdown",numberOfMonths:1,navLayout:"around",defaultMonth:r.isValid(e)?e:void 0,className:"ms-single-date-picker",selected:r.isValid(e)?e:void 0,onSelect:(m=>{n&&n(m),l(!1)}),disabled:u,...d})})});o.displayName="DatePickerCalendar";exports.DatePickerCalendar=o;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),f=require("react"),k=require("./utils-s-0cOrOT.cjs"),p=require("./mainstack-design-system614.cjs"),D=require("./DayPickerExtended-BI8ETMuv.cjs"),t=require("./isValid-914h5Kof.cjs"),o=f.forwardRef(({className:s,...d},c)=>{const{dateRange:e,value:a,isDisabled:i,onValueChange:n,onOpenChange:l}=p.useDatePickerContext(),u=i||(e?{before:t.isValid(e?.from)?e?.from:new Date,after:t.isValid(e?.to)?e?.to:void 0}:void 0);return r.jsx("div",{"data-slot":"date-picker-calendar",className:k.cn("@container",s),ref:c,children:r.jsx(D.DayPickerExtended,{animate:!0,mode:"single",captionLayout:"dropdown",numberOfMonths:1,navLayout:"around",defaultMonth:t.isValid(a)?a:void 0,className:"ms-single-date-picker",selected:t.isValid(a)?a:void 0,onSelect:(m=>{n&&n(m),l(!1)}),disabled:u,...d})})});o.displayName="DatePickerCalendar";exports.DatePickerCalendar=o;
@@ -1,34 +1,37 @@
1
1
  'use client';
2
- import { jsx as r } from "react/jsx-runtime";
2
+ import { jsx as i } from "react/jsx-runtime";
3
3
  import { forwardRef as f } from "react";
4
4
  import { c as p } from "./utils-Z5JtG_Bc.js";
5
5
  import { useDatePickerContext as u } from "./mainstack-design-system614.js";
6
- import { D } from "./DayPickerExtended-B8-AnC-D.js";
7
- import { i } from "./isValid-nnPUOITD.js";
8
- const h = f(
6
+ import { D as v } from "./DayPickerExtended-B8-AnC-D.js";
7
+ import { i as o } from "./isValid-nnPUOITD.js";
8
+ const D = f(
9
9
  ({ className: n, ...d }, s) => {
10
- const { dateRange: a, value: e, isDisabled: o, onValueChange: t, onOpenChange: c } = u(), l = o || (a ? { before: a?.from || /* @__PURE__ */ new Date(), after: a?.to } : void 0);
11
- return /* @__PURE__ */ r(
10
+ const { dateRange: e, value: a, isDisabled: t, onValueChange: r, onOpenChange: m } = u(), c = t || (e ? {
11
+ before: o(e?.from) ? e?.from : /* @__PURE__ */ new Date(),
12
+ after: o(e?.to) ? e?.to : void 0
13
+ } : void 0);
14
+ return /* @__PURE__ */ i(
12
15
  "div",
13
16
  {
14
17
  "data-slot": "date-picker-calendar",
15
18
  className: p("@container", n),
16
19
  ref: s,
17
- children: /* @__PURE__ */ r(
18
- D,
20
+ children: /* @__PURE__ */ i(
21
+ v,
19
22
  {
20
23
  animate: !0,
21
24
  mode: "single",
22
25
  captionLayout: "dropdown",
23
26
  numberOfMonths: 1,
24
27
  navLayout: "around",
25
- defaultMonth: i(e) ? e : void 0,
28
+ defaultMonth: o(a) ? a : void 0,
26
29
  className: "ms-single-date-picker",
27
- selected: i(e) ? e : void 0,
28
- onSelect: ((m) => {
29
- t && t(m), c(!1);
30
+ selected: o(a) ? a : void 0,
31
+ onSelect: ((l) => {
32
+ r && r(l), m(!1);
30
33
  }),
31
- disabled: l,
34
+ disabled: c,
32
35
  ...d
33
36
  }
34
37
  )
@@ -36,7 +39,7 @@ const h = f(
36
39
  );
37
40
  }
38
41
  );
39
- h.displayName = "DatePickerCalendar";
42
+ D.displayName = "DatePickerCalendar";
40
43
  export {
41
- h as DatePickerCalendar
44
+ D as DatePickerCalendar
42
45
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("react"),p=require("./utils-s-0cOrOT.cjs"),R=require("./mainstack-design-system612.cjs"),y=require("./mainstack-design-system399.cjs"),c=require("./DayPickerExtended-BI8ETMuv.cjs"),x=require("./mainstack-design-system400.cjs");function C(a,r,e){return c.addMonths(a,-1,e)}const u=g.forwardRef(({className:a,...r},e)=>{const[d]=x.useMatchMedia("(min-width: 900px)"),{ref:l,matches:m}=y.useContainerMatchMedia({query:{minWidth:660}}),{value:n,closeOnRangeSelect:f,setActiveMenu:h,onValueChange:o,onOpenChange:s}=R.useDateRangeContext();return i.jsx("div",{"data-slot":"date-range-calendar",ref:t=>{l.current=t,typeof e=="function"?e(t):typeof e=="object"&&e!==null&&(e.current=t)},className:p.cn("mds:@container mds:min-w-auto mds:min-[900px]:min-w-670",a),children:i.jsx(c.DayPickerExtended,{...r,animate:!0,mode:"range",captionLayout:"dropdown",numberOfMonths:d||m?2:1,navLayout:"around",className:"ms-date-range",selected:n,defaultMonth:n?.from||C(new Date),onSelect:((t,M)=>{o&&(n?.from&&n.to||!n?.from?o({from:M}):(o(t),f&&s&&s(!1))),h(null)})})})});u.displayName="DateRangeCalendar";exports.DateRangeCalendar=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),R=require("react"),y=require("./utils-s-0cOrOT.cjs"),q=require("./mainstack-design-system612.cjs"),x=require("./mainstack-design-system399.cjs"),c=require("./DayPickerExtended-BI8ETMuv.cjs"),C=require("./mainstack-design-system400.cjs"),i=require("./isValid-914h5Kof.cjs");function D(a,r,t){return c.addMonths(a,-1,t)}const u=R.forwardRef(({className:a,...r},t)=>{const[l]=C.useMatchMedia("(min-width: 900px)"),{ref:m,matches:f}=x.useContainerMatchMedia({query:{minWidth:660}}),{value:e,closeOnRangeSelect:h,setActiveMenu:M,onValueChange:o,onOpenChange:s}=q.useDateRangeContext(),g={from:i.isValid(e?.from)?e?.from:void 0,to:i.isValid(e?.to)?e?.to:void 0};return d.jsx("div",{"data-slot":"date-range-calendar",ref:n=>{m.current=n,typeof t=="function"?t(n):typeof t=="object"&&t!==null&&(t.current=n)},className:y.cn("mds:@container mds:min-w-auto mds:min-[900px]:min-w-670",a),children:d.jsx(c.DayPickerExtended,{...r,animate:!0,mode:"range",captionLayout:"dropdown",numberOfMonths:l||f?2:1,navLayout:"around",className:"ms-date-range",selected:g,defaultMonth:i.isValid(e?.from)?e?.from:D(new Date),onSelect:((n,p)=>{o&&(e?.from&&e.to||!e?.from?o({from:p}):(o(n),h&&s&&s(!1))),M(null)})})})});u.displayName="DateRangeCalendar";exports.DateRangeCalendar=u;
@@ -1,51 +1,55 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as p } from "react";
3
- import { c as h } from "./utils-Z5JtG_Bc.js";
4
- import { useDateRangeContext as M } from "./mainstack-design-system612.js";
5
- import { useContainerMatchMedia as g } from "./mainstack-design-system399.js";
6
- import { a as y, D } from "./DayPickerExtended-B8-AnC-D.js";
7
- import { useMatchMedia as w } from "./mainstack-design-system400.js";
8
- function x(n, r, e) {
9
- return y(n, -1, e);
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as M } from "react";
3
+ import { c as g } from "./utils-Z5JtG_Bc.js";
4
+ import { useDateRangeContext as v } from "./mainstack-design-system612.js";
5
+ import { useContainerMatchMedia as y } from "./mainstack-design-system399.js";
6
+ import { a as D, D as w } from "./DayPickerExtended-B8-AnC-D.js";
7
+ import { useMatchMedia as x } from "./mainstack-design-system400.js";
8
+ import { i as r } from "./isValid-nnPUOITD.js";
9
+ function C(a, m, o) {
10
+ return D(a, -1, o);
10
11
  }
11
- const C = p(
12
- ({ className: n, ...r }, e) => {
13
- const [s] = w("(min-width: 900px)"), { ref: d, matches: c } = g({
12
+ const R = M(
13
+ ({ className: a, ...m }, o) => {
14
+ const [d] = x("(min-width: 900px)"), { ref: f, matches: c } = y({
14
15
  query: { minWidth: 660 }
15
16
  }), {
16
- value: t,
17
- closeOnRangeSelect: f,
17
+ value: e,
18
+ closeOnRangeSelect: l,
18
19
  setActiveMenu: u,
19
- onValueChange: o,
20
- onOpenChange: m
21
- } = M();
22
- return /* @__PURE__ */ i(
20
+ onValueChange: n,
21
+ onOpenChange: i
22
+ } = v(), p = {
23
+ from: r(e?.from) ? e?.from : void 0,
24
+ to: r(e?.to) ? e?.to : void 0
25
+ };
26
+ return /* @__PURE__ */ s(
23
27
  "div",
24
28
  {
25
29
  "data-slot": "date-range-calendar",
26
- ref: (a) => {
27
- d.current = a, typeof e == "function" ? e(a) : typeof e == "object" && e !== null && (e.current = a);
30
+ ref: (t) => {
31
+ f.current = t, typeof o == "function" ? o(t) : typeof o == "object" && o !== null && (o.current = t);
28
32
  },
29
- className: h(
33
+ className: g(
30
34
  "mds:@container mds:min-w-auto mds:min-[900px]:min-w-670",
31
- n
35
+ a
32
36
  ),
33
- children: /* @__PURE__ */ i(
34
- D,
37
+ children: /* @__PURE__ */ s(
38
+ w,
35
39
  {
36
- ...r,
40
+ ...m,
37
41
  animate: !0,
38
42
  mode: "range",
39
43
  captionLayout: "dropdown",
40
- numberOfMonths: s || c ? 2 : 1,
44
+ numberOfMonths: d || c ? 2 : 1,
41
45
  navLayout: "around",
42
46
  className: "ms-date-range",
43
- selected: t,
44
- defaultMonth: t?.from || x(/* @__PURE__ */ new Date()),
45
- onSelect: ((a, l) => {
46
- o && (t?.from && t.to || !t?.from ? o({
47
- from: l
48
- }) : (o(a), f && m && m(!1))), u(null);
47
+ selected: p,
48
+ defaultMonth: r(e?.from) ? e?.from : C(/* @__PURE__ */ new Date()),
49
+ onSelect: ((t, h) => {
50
+ n && (e?.from && e.to || !e?.from ? n({
51
+ from: h
52
+ }) : (n(t), l && i && i(!1))), u(null);
49
53
  })
50
54
  }
51
55
  )
@@ -53,7 +57,7 @@ const C = p(
53
57
  );
54
58
  }
55
59
  );
56
- C.displayName = "DateRangeCalendar";
60
+ R.displayName = "DateRangeCalendar";
57
61
  export {
58
- C as DateRangeCalendar
62
+ R as DateRangeCalendar
59
63
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.17.0",
3
+ "version": "1.17.2",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",