mainstack-design-system 1.6.0 → 1.8.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.
@@ -1,27 +1,28 @@
1
1
  'use client';
2
- import { jsx as d, jsxs as o } from "react/jsx-runtime";
3
- import { D as a, a as t } from "./index-DDHQjaCF.js";
4
- import { forwardRef as l } from "react";
5
- import { c as r } from "./utils-Cs1D8Nxl.js";
6
- import { V as n } from "./index-DJT9m8v7.js";
7
- const i = l(
8
- ({ children: m, className: s, ...e }) => /* @__PURE__ */ d("div", { className: "mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:md:items-center ", children: /* @__PURE__ */ o(
9
- a,
2
+ import { jsx as d, jsxs as a } from "react/jsx-runtime";
3
+ import { D as t, a as l } from "./index-DDHQjaCF.js";
4
+ import { forwardRef as r } from "react";
5
+ import { c as n } from "./utils-Cs1D8Nxl.js";
6
+ import { V as i } from "./index-DJT9m8v7.js";
7
+ const f = r(
8
+ ({ children: m, className: s, ...e }, o) => /* @__PURE__ */ d("div", { className: "mds:fixed mds:w-full mds:h-full mds:flex mds:justify-center mds:top-0 mds:left-0 mds:items-end mds:z-100 mds:md:items-center ", children: /* @__PURE__ */ a(
9
+ t,
10
10
  {
11
+ ref: o,
11
12
  "data-slot": "modal-body",
12
- className: r(
13
+ className: n(
13
14
  "mds:group/Modal-body mds:flex-1 mds:flex mds:will-change-transform mds:max-h-[90dvh] mds:max-w-980 mds:shadow-600 mds:rounded-t-20 mds:overflow-hidden mds:bg-surface-neutral-l1 mds:animate-content-scale-out mds:data-[state=open]:animate-content-scale-in mds:md:rounded-20 mds:md:mx-20 ",
14
15
  s
15
16
  ),
16
17
  ...e,
17
18
  children: [
18
19
  m,
19
- /* @__PURE__ */ d(n, { children: /* @__PURE__ */ d(t, {}) })
20
+ /* @__PURE__ */ d(i, { children: /* @__PURE__ */ d(l, {}) })
20
21
  ]
21
22
  }
22
23
  ) })
23
24
  );
24
- i.displayName = "ModalBody";
25
+ f.displayName = "ModalBody";
25
26
  export {
26
- i as ModalBody
27
+ f as ModalBody
27
28
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./index-HSoR75mY.cjs"),r=require("react"),a=r.forwardRef(({...t})=>e.jsx(o.DialogPortal,{"data-slot":"modal-portal",...t}));exports.ModalPortal=a;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("./index-HSoR75mY.cjs"),r=({...t})=>o.jsx(e.DialogPortal,{"data-slot":"modal-portal",...t});exports.ModalPortal=r;
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as r } from "react/jsx-runtime";
3
3
  import { g as t } from "./index-DDHQjaCF.js";
4
- import { forwardRef as a } from "react";
5
- const p = a(({ ...o }) => /* @__PURE__ */ r(t, { "data-slot": "modal-portal", ...o }));
4
+ const m = ({ ...o }) => /* @__PURE__ */ r(t, { "data-slot": "modal-portal", ...o });
6
5
  export {
7
- p as ModalPortal
6
+ m as ModalPortal
8
7
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),o=require("./utils-scPUmbSO.cjs"),e=a.forwardRef(({className:s,...l})=>t.jsx("div",{className:o.cn("mds:hidden mds:flex-1 mds:md:flex ",s),"data-slot":"responsive-modal-drawer-visual-slot",...l}));e.displayName="ModalVisualSlot";exports.ModalVisualSlot=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),d=require("./utils-scPUmbSO.cjs"),e=o.forwardRef(({className:s,...l},t)=>a.jsx("div",{ref:t,className:d.cn("mds:hidden mds:flex-1 mds:md:flex ",s),"data-slot":"responsive-modal-drawer-visual-slot",...l}));e.displayName="ModalVisualSlot";exports.ModalVisualSlot=e;
@@ -1,17 +1,18 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import { c as l } from "./utils-Cs1D8Nxl.js";
4
- const r = d(
5
- ({ className: o, ...s }) => /* @__PURE__ */ a(
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { forwardRef as l } from "react";
3
+ import { c as r } from "./utils-Cs1D8Nxl.js";
4
+ const m = l(
5
+ ({ className: o, ...s }, a) => /* @__PURE__ */ d(
6
6
  "div",
7
7
  {
8
- className: l("mds:hidden mds:flex-1 mds:md:flex ", o),
8
+ ref: a,
9
+ className: r("mds:hidden mds:flex-1 mds:md:flex ", o),
9
10
  "data-slot": "responsive-modal-drawer-visual-slot",
10
11
  ...s
11
12
  }
12
13
  )
13
14
  );
14
- r.displayName = "ModalVisualSlot";
15
+ m.displayName = "ModalVisualSlot";
15
16
  export {
16
- r as ModalVisualSlot
17
+ m as ModalVisualSlot
17
18
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("./index-C8aODXfJ.cjs"),T=require("./index-4R9KShCu.cjs"),o=require("react"),D=require("./mainstack-design-system584.cjs"),m=require("./mainstack-design-system598.cjs"),x=o.forwardRef(({isDisabled:y,isError:C,isMultiSelect:c=!1,isSuccess:b,children:v,value:d,defaultValue:n,inputReadOnly:h,options:l=[],isOptionOpen:j,onOptionOpenChange:q,onValueChange:p},t)=>{const u=o.useRef(null),[r,P]=o.useState(m.parseSelectOptions(l)),[s,R]=g.useControllableState({prop:d,defaultProp:m.mapDefaultValuesToSelectedOption({isMultiSelect:c,defaultValue:n,options:l}),onChange:p}),[A,a]=o.useState(()=>typeof n=="string"&&r.map.get(n)?.label||""),[S,O]=g.useControllableState({prop:j,defaultProp:!1,onChange:q}),[_,f]=o.useState("idle");return i.jsx(D.SelectContext.Provider,{value:{defaultValue:n,options:r,selectedOption:s,isOptionOpen:S,isDisabled:y,isError:C,isMultiSelect:c,isSuccess:b,inputValue:A,inputReadOnly:h,previousAction:_,rootElementRef:u,setOptions:P,setPreviousAction:f,setInputValue:a,setSelectedOption:R,onOptionOpenChange:O,onValueChange:p},children:i.jsx(T.Popover,{open:S,onOpenChange:e=>{O(e),s&&!Array.isArray(s)&&!e&&(a(r.map.get(s)?.label||""),f("selection"))},children:i.jsx("div",{ref:e=>{u.current=e,typeof t=="function"?t(e):typeof t=="object"&&t?.current&&(t.current=e)},"data-slot":"select-root",children:v})})})});x.displayName="SelectRoot";exports.SelectRoot=x;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),g=require("./index-C8aODXfJ.cjs"),E=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system584.cjs"),m=require("./mainstack-design-system598.cjs"),x=o.forwardRef(({isDisabled:y,isError:C,isMultiSelect:c=!1,isSuccess:b,children:v,value:d,defaultValue:n,inputReadOnly:h,isCreatableSelect:j,options:l=[],isOptionOpen:q,onOptionOpenChange:P,onValueChange:p,onOptionSelect:R},t)=>{const u=o.useRef(null),[r,A]=o.useState(m.parseSelectOptions(l)),[s,_]=g.useControllableState({prop:d,defaultProp:m.mapDefaultValuesToSelectedOption({isMultiSelect:c,defaultValue:n,options:l}),onChange:p}),[T,a]=o.useState(()=>typeof n=="string"&&r.map.get(n)?.label||""),[S,O]=g.useControllableState({prop:q,defaultProp:!1,onChange:P}),[D,f]=o.useState("idle");return i.jsx(I.SelectContext.Provider,{value:{defaultValue:n,options:r,selectedOption:s,isOptionOpen:S,isDisabled:y,isError:C,isMultiSelect:c,isSuccess:b,inputValue:T,inputReadOnly:h,previousAction:D,isCreatableSelect:j,rootElementRef:u,setOptions:A,setPreviousAction:f,setInputValue:a,setSelectedOption:_,onOptionOpenChange:O,onValueChange:p,onOptionSelect:R},children:i.jsx(E.Popover,{open:S,onOpenChange:e=>{O(e),s&&!Array.isArray(s)&&!e&&(a(r.map.get(s)?.label||""),f("selection"))},children:i.jsx("div",{ref:e=>{u.current=e,typeof t=="function"?t(e):typeof t=="object"&&t?.current&&(t.current=e)},"data-slot":"select-root",children:v})})})});x.displayName="SelectRoot";exports.SelectRoot=x;
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import { jsx as r } from "react/jsx-runtime";
3
3
  import { u as g } from "./index-437EL2iq.js";
4
- import { P as D } from "./index-RoCFhqzC.js";
5
- import { forwardRef as E, useRef as I, useState as i } from "react";
6
- import { SelectContext as N } from "./mainstack-design-system584.js";
7
- import { parseSelectOptions as T, mapDefaultValuesToSelectedOption as k } from "./mainstack-design-system598.js";
8
- const q = E(
4
+ import { P as I } from "./index-RoCFhqzC.js";
5
+ import { forwardRef as N, useRef as T, useState as i } from "react";
6
+ import { SelectContext as k } from "./mainstack-design-system584.js";
7
+ import { parseSelectOptions as q, mapDefaultValuesToSelectedOption as z } from "./mainstack-design-system598.js";
8
+ const B = N(
9
9
  ({
10
10
  isDisabled: S,
11
11
  isError: h,
@@ -15,28 +15,30 @@ const q = E(
15
15
  value: C,
16
16
  defaultValue: e,
17
17
  inputReadOnly: P,
18
+ isCreatableSelect: b,
18
19
  options: l = [],
19
- isOptionOpen: b,
20
- onOptionOpenChange: A,
21
- onValueChange: c
20
+ isOptionOpen: A,
21
+ onOptionOpenChange: x,
22
+ onValueChange: c,
23
+ onOptionSelect: d
22
24
  }, t) => {
23
- const a = I(null), [p, x] = i(
24
- T(l)
25
- ), [n, d] = g({
25
+ const a = T(null), [p, j] = i(
26
+ q(l)
27
+ ), [n, R] = g({
26
28
  prop: C,
27
- defaultProp: k({
29
+ defaultProp: z({
28
30
  isMultiSelect: s,
29
31
  defaultValue: e,
30
32
  options: l
31
33
  }),
32
34
  onChange: c
33
- }), [j, m] = i(() => typeof e == "string" && p.map.get(e)?.label || ""), [u, f] = g({
34
- prop: b,
35
+ }), [D, m] = i(() => typeof e == "string" && p.map.get(e)?.label || ""), [u, f] = g({
36
+ prop: A,
35
37
  defaultProp: !1,
36
- onChange: A
37
- }), [R, O] = i("idle");
38
+ onChange: x
39
+ }), [E, O] = i("idle");
38
40
  return /* @__PURE__ */ r(
39
- N.Provider,
41
+ k.Provider,
40
42
  {
41
43
  value: {
42
44
  defaultValue: e,
@@ -47,19 +49,21 @@ const q = E(
47
49
  isError: h,
48
50
  isMultiSelect: s,
49
51
  isSuccess: v,
50
- inputValue: j,
52
+ inputValue: D,
51
53
  inputReadOnly: P,
52
- previousAction: R,
54
+ previousAction: E,
55
+ isCreatableSelect: b,
53
56
  rootElementRef: a,
54
- setOptions: x,
57
+ setOptions: j,
55
58
  setPreviousAction: O,
56
59
  setInputValue: m,
57
- setSelectedOption: d,
60
+ setSelectedOption: R,
58
61
  onOptionOpenChange: f,
59
- onValueChange: c
62
+ onValueChange: c,
63
+ onOptionSelect: d
60
64
  },
61
65
  children: /* @__PURE__ */ r(
62
- D,
66
+ I,
63
67
  {
64
68
  open: u,
65
69
  onOpenChange: (o) => {
@@ -81,7 +85,7 @@ const q = E(
81
85
  );
82
86
  }
83
87
  );
84
- q.displayName = "SelectRoot";
88
+ B.displayName = "SelectRoot";
85
89
  export {
86
- q as SelectRoot
90
+ B as SelectRoot
87
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",