mainstack-design-system 1.16.6 → 1.17.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/dist/index.d.ts CHANGED
@@ -1099,6 +1099,10 @@ declare type DatePickerContextType = {
1099
1099
  isDisabled?: boolean;
1100
1100
  isError?: boolean;
1101
1101
  isSuccess?: boolean;
1102
+ dateRange?: {
1103
+ from: Date;
1104
+ to?: Date | undefined;
1105
+ };
1102
1106
  onValueChange: (value: Date | undefined) => void;
1103
1107
  onOpenChange: Dispatch<SetStateAction<boolean>>;
1104
1108
  };
@@ -5,7 +5,7 @@
5
5
  mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover mds:outline-2 mds:outline-neutral-500
6
6
 
7
7
  mds:active:bg-content-special mds:active:shadow-special-button-pressed mds:active:ring-2 mds:ring-offset-2 mds:ring-border-surface-spread-neutral
8
- mds:disabled:bg-none mds:disabled:border-none mds:disabled:shadow-none mds:disabled:bg-interactive-primary-disabled mds:disabled:text-on-primary-disabled`},{status:"default",variant:"primary",class:`mds:bg-primary mds:text-on-primary
8
+ mds:disabled:bg-none mds:disabled:border-none mds:disabled:shadow-none mds:disabled:outline-none mds:disabled:bg-interactive-primary-disabled mds:disabled:text-on-primary-disabled`},{status:"default",variant:"primary",class:`mds:bg-primary mds:text-on-primary
9
9
  mds:hover:bg-interactive-primary-hover
10
10
 
11
11
  mds:active:bg-interactive-primary-pressed mds:active:ring-3 mds:active:ring-border-surface-spread-neutral
@@ -41,7 +41,7 @@ const r = e(
41
41
  mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover mds:outline-2 mds:outline-neutral-500
42
42
 
43
43
  mds:active:bg-content-special mds:active:shadow-special-button-pressed mds:active:ring-2 mds:ring-offset-2 mds:ring-border-surface-spread-neutral
44
- mds:disabled:bg-none mds:disabled:border-none mds:disabled:shadow-none mds:disabled:bg-interactive-primary-disabled mds:disabled:text-on-primary-disabled`
44
+ mds:disabled:bg-none mds:disabled:border-none mds:disabled:shadow-none mds:disabled:outline-none mds:disabled:bg-interactive-primary-disabled mds:disabled:text-on-primary-disabled`
45
45
  },
46
46
  {
47
47
  status: "default",
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),k=require("./utils-s-0cOrOT.cjs"),m=require("./mainstack-design-system614.cjs"),p=require("./DayPickerExtended-BI8ETMuv.cjs"),n=require("./isValid-914h5Kof.cjs"),i=u.forwardRef(({className:r,...s},o)=>{const{value:e,isDisabled:c,onValueChange:a,onOpenChange:d}=m.useDatePickerContext();return t.jsx("div",{"data-slot":"date-picker-calendar",className:k.cn("@container",r),ref:o,children:t.jsx(p.DayPickerExtended,{animate:!0,mode:"single",captionLayout:"dropdown",numberOfMonths:1,navLayout:"around",disabled:c,defaultMonth:n.isValid(e)?e:void 0,className:"ms-single-date-picker",selected:n.isValid(e)?e:void 0,onSelect:(l=>{a&&a(l),d(!1)}),...s})})});i.displayName="DatePickerCalendar";exports.DatePickerCalendar=i;
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;
@@ -1,42 +1,42 @@
1
1
  'use client';
2
- import { jsx as o } from "react/jsx-runtime";
3
- import { forwardRef as m } from "react";
4
- import { c } from "./utils-Z5JtG_Bc.js";
5
- import { useDatePickerContext as p } from "./mainstack-design-system614.js";
6
- import { D as f } from "./DayPickerExtended-B8-AnC-D.js";
7
- import { i as r } from "./isValid-nnPUOITD.js";
8
- const u = m(
9
- ({ className: t, ...i }, n) => {
10
- const { value: e, isDisabled: d, onValueChange: a, onOpenChange: s } = p();
11
- return /* @__PURE__ */ o(
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { forwardRef as f } from "react";
4
+ import { c as p } from "./utils-Z5JtG_Bc.js";
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(
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(
12
12
  "div",
13
13
  {
14
14
  "data-slot": "date-picker-calendar",
15
- className: c("@container", t),
16
- ref: n,
17
- children: /* @__PURE__ */ o(
18
- f,
15
+ className: p("@container", n),
16
+ ref: s,
17
+ children: /* @__PURE__ */ r(
18
+ D,
19
19
  {
20
20
  animate: !0,
21
21
  mode: "single",
22
22
  captionLayout: "dropdown",
23
23
  numberOfMonths: 1,
24
24
  navLayout: "around",
25
- disabled: d,
26
- defaultMonth: r(e) ? e : void 0,
25
+ defaultMonth: i(e) ? e : void 0,
27
26
  className: "ms-single-date-picker",
28
- selected: r(e) ? e : void 0,
29
- onSelect: ((l) => {
30
- a && a(l), s(!1);
27
+ selected: i(e) ? e : void 0,
28
+ onSelect: ((m) => {
29
+ t && t(m), c(!1);
31
30
  }),
32
- ...i
31
+ disabled: l,
32
+ ...d
33
33
  }
34
34
  )
35
35
  }
36
36
  );
37
37
  }
38
38
  );
39
- u.displayName = "DatePickerCalendar";
39
+ h.displayName = "DatePickerCalendar";
40
40
  export {
41
- u as DatePickerCalendar
41
+ h as DatePickerCalendar
42
42
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),k=require("react"),v=require("./mainstack-design-system614.cjs"),f=require("./index-4R9KShCu.cjs"),r=require("./index-C8aODXfJ.cjs"),a=k.forwardRef(({open:i,onOpenChange:c,value:s,onValueChange:l,isDisabled:u=!1,defaultValue:o,isError:p,isSuccess:d,children:P,...C},g)=>{const[t,n]=r.useControllableState({prop:i,defaultProp:!1,onChange:c}),[h,x]=r.useControllableState({prop:s,defaultProp:o,onChange:l});return e.jsx(v.DatePickerContext.Provider,{value:{open:t,isDisabled:u,isError:p,isSuccess:d,defaultValue:o,value:h,onValueChange:x,onOpenChange:n},children:e.jsx(f.Popover,{open:t,onOpenChange:n,children:e.jsx("div",{"data-slot":"date-picker-root",ref:g,...C,children:P})})})});a.displayName="DatePickerRoot";exports.DatePickerRoot=a;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),f=require("./mainstack-design-system614.cjs"),R=require("./index-4R9KShCu.cjs"),r=require("./index-C8aODXfJ.cjs"),a=v.forwardRef(({open:i,onOpenChange:c,value:s,onValueChange:l,isDisabled:u=!1,defaultValue:o,dateRange:p,isError:d,isSuccess:P,children:C,...g},h)=>{const[t,n]=r.useControllableState({prop:i,defaultProp:!1,onChange:c}),[x,k]=r.useControllableState({prop:s,defaultProp:o,onChange:l});return e.jsx(f.DatePickerContext.Provider,{value:{open:t,isDisabled:u,isError:d,isSuccess:P,defaultValue:o,value:x,dateRange:p,onValueChange:k,onOpenChange:n},children:e.jsx(R.Popover,{open:t,onOpenChange:n,children:e.jsx("div",{"data-slot":"date-picker-root",ref:h,...g,children:C})})})});a.displayName="DatePickerRoot";exports.DatePickerRoot=a;
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as o } from "react/jsx-runtime";
3
- import { forwardRef as P } from "react";
4
- import { DatePickerContext as g } from "./mainstack-design-system614.js";
5
- import { P as v } from "./index-RoCFhqzC.js";
3
+ import { forwardRef as g } from "react";
4
+ import { DatePickerContext as v } from "./mainstack-design-system614.js";
5
+ import { P as k } from "./index-RoCFhqzC.js";
6
6
  import { u as t } from "./index-437EL2iq.js";
7
- const k = P(
7
+ const x = g(
8
8
  ({
9
9
  open: n,
10
10
  onOpenChange: p,
@@ -12,39 +12,41 @@ const k = P(
12
12
  onValueChange: l,
13
13
  isDisabled: m = !1,
14
14
  defaultValue: e,
15
- isError: s,
16
- isSuccess: f,
17
- children: c,
18
- ...d
19
- }, h) => {
15
+ dateRange: s,
16
+ isError: f,
17
+ isSuccess: c,
18
+ children: d,
19
+ ...h
20
+ }, u) => {
20
21
  const [r, a] = t({
21
22
  prop: n,
22
23
  defaultProp: !1,
23
24
  onChange: p
24
- }), [u, C] = t({
25
+ }), [C, P] = t({
25
26
  prop: i,
26
27
  defaultProp: e,
27
28
  onChange: l
28
29
  });
29
30
  return /* @__PURE__ */ o(
30
- g.Provider,
31
+ v.Provider,
31
32
  {
32
33
  value: {
33
34
  open: r,
34
35
  isDisabled: m,
35
- isError: s,
36
- isSuccess: f,
36
+ isError: f,
37
+ isSuccess: c,
37
38
  defaultValue: e,
38
- value: u,
39
- onValueChange: C,
39
+ value: C,
40
+ dateRange: s,
41
+ onValueChange: P,
40
42
  onOpenChange: a
41
43
  },
42
- children: /* @__PURE__ */ o(v, { open: r, onOpenChange: a, children: /* @__PURE__ */ o("div", { "data-slot": "date-picker-root", ref: h, ...d, children: c }) })
44
+ children: /* @__PURE__ */ o(k, { open: r, onOpenChange: a, children: /* @__PURE__ */ o("div", { "data-slot": "date-picker-root", ref: u, ...h, children: d }) })
43
45
  }
44
46
  );
45
47
  }
46
48
  );
47
- k.displayName = "DatePickerRoot";
49
+ x.displayName = "DatePickerRoot";
48
50
  export {
49
- k as DatePickerRoot
51
+ x as DatePickerRoot
50
52
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.16.6",
3
+ "version": "1.17.0",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",