mainstack-design-system 1.14.0 → 1.14.1

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 p=require("react/jsx-runtime"),m=require("./index-C8aODXfJ.cjs"),E=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system597.cjs"),y=require("./mainstack-design-system598.cjs"),b=o.forwardRef(({isDisabled:x,isError:C,isMultiSelect:c=!1,isSuccess:d,children:h,value:i,defaultValue:n,inputReadOnly:j,isCreatableSelect:q,options:l=[],isOptionOpen:P,onOptionOpenChange:v,onValueChange:u,onOptionSelect:R},t)=>{const a=o.useRef(null),[s,A]=o.useState(y.parseSelectOptions(l)),[r,_]=m.useControllableState({prop:i,defaultProp:y.mapDefaultValuesToSelectedOption({isMultiSelect:c,defaultValue:n,options:l}),onChange:u}),[T,S]=o.useState(()=>typeof i=="string"?s.map.get(i)?.label||"":typeof n=="string"&&s.map.get(n)?.label||""),[O,f]=m.useControllableState({prop:P,defaultProp:!1,onChange:v}),[D,g]=o.useState("idle");return p.jsx(I.SelectContext.Provider,{value:{defaultValue:n,options:s,selectedOption:r,isOptionOpen:O,isDisabled:x,isError:C,isMultiSelect:c,isSuccess:d,inputValue:T,inputReadOnly:j,previousAction:D,isCreatableSelect:q,rootElementRef:a,setOptions:A,setPreviousAction:g,setInputValue:S,setSelectedOption:_,onOptionOpenChange:f,onValueChange:u,onOptionSelect:R},children:p.jsx(E.Popover,{open:O,onOpenChange:e=>{f(e),r&&!Array.isArray(r)&&!e&&(S(s.map.get(r)?.label||""),g("selection"))},children:p.jsx("div",{ref:e=>{a.current=e,typeof t=="function"?t(e):typeof t=="object"&&t?.current&&(t.current=e)},"data-slot":"select-root",children:h})})})});b.displayName="SelectRoot";exports.SelectRoot=b;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("./index-C8aODXfJ.cjs"),D=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system597.cjs"),m=require("./mainstack-design-system598.cjs"),b=o.forwardRef(({isDisabled:x,isError:C,isMultiSelect:r=!1,isSuccess:d,children:h,value:e,defaultValue:s,inputReadOnly:j,isCreatableSelect:q,options:u=[],isOptionOpen:A,onOptionOpenChange:P,onValueChange:a,onOptionSelect:R},n)=>{const f=o.useRef(null),[i,_]=o.useState(m.parseSelectOptions(u)),[p,v]=y.useControllableState({prop:e,defaultProp:m.mapDefaultValuesToSelectedOption({isMultiSelect:r,defaultValue:s,options:u}),onChange:a}),[E,c]=o.useState(()=>typeof e=="string"?i.map.get(e)?.label||"":typeof s=="string"&&i.map.get(s)?.label||""),[O,S]=y.useControllableState({prop:A,defaultProp:!1,onChange:P}),[T,g]=o.useState("idle");return o.useEffect(()=>{r||Array.isArray(e)||c(e||"")},[r,e]),l.jsx(I.SelectContext.Provider,{value:{defaultValue:s,options:i,selectedOption:p,isOptionOpen:O,isDisabled:x,isError:C,isMultiSelect:r,isSuccess:d,inputValue:E,inputReadOnly:j,previousAction:T,isCreatableSelect:q,rootElementRef:f,setOptions:_,setPreviousAction:g,setInputValue:c,setSelectedOption:v,onOptionOpenChange:S,onValueChange:a,onOptionSelect:R},children:l.jsx(D.Popover,{open:O,onOpenChange:t=>{S(t),p&&!Array.isArray(p)&&!t&&(c(i.map.get(p)?.label||""),g("selection"))},children:l.jsx("div",{ref:t=>{f.current=t,typeof n=="function"?n(t):typeof n=="object"&&n?.current&&(n.current=t)},"data-slot":"select-root",children:h})})})});b.displayName="SelectRoot";exports.SelectRoot=b;
@@ -1,79 +1,81 @@
1
1
  'use client';
2
- import { jsx as i } from "react/jsx-runtime";
2
+ import { jsx as c } from "react/jsx-runtime";
3
3
  import { u as y } from "./index-437EL2iq.js";
4
4
  import { P as I } from "./index-RoCFhqzC.js";
5
- import { forwardRef as N, useRef as T, useState as s } from "react";
6
- import { SelectContext as k } from "./mainstack-design-system597.js";
7
- import { parseSelectOptions as q, mapDefaultValuesToSelectedOption as z } from "./mainstack-design-system598.js";
8
- const B = N(
5
+ import { forwardRef as N, useRef as T, useState as f, useEffect as k } from "react";
6
+ import { SelectContext as q } from "./mainstack-design-system597.js";
7
+ import { parseSelectOptions as z, mapDefaultValuesToSelectedOption as B } from "./mainstack-design-system598.js";
8
+ const F = N(
9
9
  ({
10
- isDisabled: S,
11
- isError: h,
12
- isMultiSelect: l = !1,
10
+ isDisabled: h,
11
+ isError: A,
12
+ isMultiSelect: n = !1,
13
13
  isSuccess: C,
14
14
  children: P,
15
- value: r,
16
- defaultValue: e,
15
+ value: o,
16
+ defaultValue: r,
17
17
  inputReadOnly: b,
18
- isCreatableSelect: v,
19
- options: c = [],
20
- isOptionOpen: A,
21
- onOptionOpenChange: x,
18
+ isCreatableSelect: S,
19
+ options: l = [],
20
+ isOptionOpen: x,
21
+ onOptionOpenChange: d,
22
22
  onValueChange: a,
23
- onOptionSelect: d
24
- }, o) => {
25
- const m = T(null), [n, j] = s(
26
- q(c)
27
- ), [p, R] = y({
28
- prop: r,
29
- defaultProp: z({
30
- isMultiSelect: l,
31
- defaultValue: e,
32
- options: c
23
+ onOptionSelect: j
24
+ }, e) => {
25
+ const m = T(null), [p, E] = f(
26
+ z(l)
27
+ ), [i, R] = y({
28
+ prop: o,
29
+ defaultProp: B({
30
+ isMultiSelect: n,
31
+ defaultValue: r,
32
+ options: l
33
33
  }),
34
34
  onChange: a
35
- }), [D, f] = s(() => typeof r == "string" ? n.map.get(r)?.label || "" : typeof e == "string" && n.map.get(e)?.label || ""), [u, O] = y({
36
- prop: A,
35
+ }), [v, s] = f(() => typeof o == "string" ? p.map.get(o)?.label || "" : typeof r == "string" && p.map.get(r)?.label || ""), [O, u] = y({
36
+ prop: x,
37
37
  defaultProp: !1,
38
- onChange: x
39
- }), [E, g] = s("idle");
40
- return /* @__PURE__ */ i(
41
- k.Provider,
38
+ onChange: d
39
+ }), [D, g] = f("idle");
40
+ return k(() => {
41
+ n || Array.isArray(o) || s(o || "");
42
+ }, [n, o]), /* @__PURE__ */ c(
43
+ q.Provider,
42
44
  {
43
45
  value: {
44
- defaultValue: e,
45
- options: n,
46
- selectedOption: p,
47
- isOptionOpen: u,
48
- isDisabled: S,
49
- isError: h,
50
- isMultiSelect: l,
46
+ defaultValue: r,
47
+ options: p,
48
+ selectedOption: i,
49
+ isOptionOpen: O,
50
+ isDisabled: h,
51
+ isError: A,
52
+ isMultiSelect: n,
51
53
  isSuccess: C,
52
- inputValue: D,
54
+ inputValue: v,
53
55
  inputReadOnly: b,
54
- previousAction: E,
55
- isCreatableSelect: v,
56
+ previousAction: D,
57
+ isCreatableSelect: S,
56
58
  rootElementRef: m,
57
- setOptions: j,
59
+ setOptions: E,
58
60
  setPreviousAction: g,
59
- setInputValue: f,
61
+ setInputValue: s,
60
62
  setSelectedOption: R,
61
- onOptionOpenChange: O,
63
+ onOptionOpenChange: u,
62
64
  onValueChange: a,
63
- onOptionSelect: d
65
+ onOptionSelect: j
64
66
  },
65
- children: /* @__PURE__ */ i(
67
+ children: /* @__PURE__ */ c(
66
68
  I,
67
69
  {
68
- open: u,
70
+ open: O,
69
71
  onOpenChange: (t) => {
70
- O(t), p && !Array.isArray(p) && !t && (f(n.map.get(p)?.label || ""), g("selection"));
72
+ u(t), i && !Array.isArray(i) && !t && (s(p.map.get(i)?.label || ""), g("selection"));
71
73
  },
72
- children: /* @__PURE__ */ i(
74
+ children: /* @__PURE__ */ c(
73
75
  "div",
74
76
  {
75
77
  ref: (t) => {
76
- m.current = t, typeof o == "function" ? o(t) : typeof o == "object" && o?.current && (o.current = t);
78
+ m.current = t, typeof e == "function" ? e(t) : typeof e == "object" && e?.current && (e.current = t);
77
79
  },
78
80
  "data-slot": "select-root",
79
81
  children: P
@@ -85,7 +87,7 @@ const B = N(
85
87
  );
86
88
  }
87
89
  );
88
- B.displayName = "SelectRoot";
90
+ F.displayName = "SelectRoot";
89
91
  export {
90
- B as SelectRoot
92
+ F as SelectRoot
91
93
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),j=require("./mainstack-design-system440.cjs"),O=require("./mainstack-design-system441.cjs");require("./mainstack-design-system439.cjs");require("./mainstack-design-system357.cjs");const v=require("./mainstack-design-system93.cjs"),N=require("./mainstack-design-system197.cjs");require("./player-BBiZ5mNK.cjs");const o=require("./utils-Bdd5vx6a.cjs"),R=require("./mainstack-design-system597.cjs"),A=require("./index-4R9KShCu.cjs"),d=g.forwardRef(({onClick:r,children:u,className:p,onChange:i,...a},m)=>{const{isOptionOpen:s,inputValue:x,inputReadOnly:c,isDisabled:f,isError:I,isSuccess:h,selectedOption:l,isMultiSelect:n,setSelectedOption:q,setPreviousAction:_,setInputValue:b,onOptionOpenChange:y}=R.useSelectContext();return e.jsx(A.PopoverAnchor,{role:"combobox","aria-haspopup":"listbox","aria-expanded":s,"aria-controls":"select-portal","aria-owns":"select-portal",children:e.jsxs(j.InputRoot,{className:o.cn(n&&"mds:h-auto mds:py-10 ",p),children:[e.jsxs("div",{className:o.cn("mds:flex mds:flex-1 mds:h-auto mds:min-h-auto mds:items-center mds:flex-wrap mds:gap-6"),children:[u,e.jsx(O.InputField,{...a,readOnly:c,"data-slot":"select-input-field","data-select-options-opened":s,tabIndex:3,value:x,isError:I,isSuccess:h,disabled:f,className:o.cn(n&&"mds:h-auto mds:min-h-auto"),onChange:t=>{i&&i(t),_("typing"),b(t.currentTarget.value)},onClick:t=>{r&&r(t);const S=t.currentTarget;y(!0),c||S.focus()},ref:m,...a})]}),e.jsxs("div",{className:"mds:flex mds:items-center mds:gap-6",children:[n&&Array.isArray(l)&&l.length>0&&e.jsx(v,{role:"button",variant:"filled",className:"mds:size-20 mds:cursor-pointer mds:text-secondary",onClick:()=>{q([])}}),e.jsx(N,{"data-select-options-opened":s,className:"mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"})]})]})})});d.displayName="SelectInputField";exports.SelectInputField=d;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),j=require("./mainstack-design-system440.cjs"),O=require("./mainstack-design-system441.cjs");require("./mainstack-design-system439.cjs");require("./mainstack-design-system357.cjs");const v=require("./mainstack-design-system93.cjs"),N=require("./mainstack-design-system196.cjs");require("./player-BBiZ5mNK.cjs");const o=require("./utils-Bdd5vx6a.cjs"),R=require("./mainstack-design-system597.cjs"),w=require("./index-4R9KShCu.cjs"),d=g.forwardRef(({onClick:r,children:u,className:p,onChange:i,...a},m)=>{const{isOptionOpen:s,inputValue:x,inputReadOnly:c,isDisabled:f,isError:I,isSuccess:h,selectedOption:l,isMultiSelect:n,setSelectedOption:q,setPreviousAction:_,setInputValue:b,onOptionOpenChange:y}=R.useSelectContext();return e.jsx(w.PopoverAnchor,{role:"combobox","aria-haspopup":"listbox","aria-expanded":s,"aria-controls":"select-portal","aria-owns":"select-portal",children:e.jsxs(j.InputRoot,{className:o.cn(n&&"mds:h-auto mds:py-10 ",p),children:[e.jsxs("div",{className:o.cn("mds:flex mds:flex-1 mds:h-auto mds:min-h-auto mds:items-center mds:flex-wrap mds:gap-6"),children:[u,e.jsx(O.InputField,{...a,readOnly:c,"data-slot":"select-input-field","data-select-options-opened":s,tabIndex:3,value:x,isError:I,isSuccess:h,disabled:f,className:o.cn(n&&"mds:h-auto mds:min-h-auto"),onChange:t=>{i&&i(t),_("typing"),b(t.currentTarget.value)},onClick:t=>{r&&r(t);const S=t.currentTarget;y(!0),c||S.focus()},ref:m,...a})]}),e.jsxs("div",{className:"mds:flex mds:items-center mds:gap-6",children:[n&&Array.isArray(l)&&l.length>0&&e.jsx(v,{role:"button",variant:"filled",className:"mds:size-20 mds:cursor-pointer mds:text-secondary",onClick:()=>{q([])}}),e.jsx(N,{"data-select-options-opened":s,className:"mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"})]})]})})});d.displayName="SelectInputField";exports.SelectInputField=d;
@@ -2,11 +2,11 @@
2
2
  import { jsx as t, jsxs as r } from "react/jsx-runtime";
3
3
  import { forwardRef as N } from "react";
4
4
  import { InputRoot as S } from "./mainstack-design-system440.js";
5
- import { InputField as A } from "./mainstack-design-system441.js";
5
+ import { InputField as w } from "./mainstack-design-system441.js";
6
6
  import "./mainstack-design-system439.js";
7
7
  import "./mainstack-design-system357.js";
8
- import w from "./mainstack-design-system93.js";
9
- import C from "./mainstack-design-system197.js";
8
+ import A from "./mainstack-design-system93.js";
9
+ import C from "./mainstack-design-system196.js";
10
10
  import "./player-Cs7wtvrg.js";
11
11
  import { c as i } from "./utils-D85wpvmd.js";
12
12
  import { useSelectContext as F } from "./mainstack-design-system597.js";
@@ -14,14 +14,14 @@ import { d as R } from "./index-RoCFhqzC.js";
14
14
  const j = N(
15
15
  ({ onClick: a, children: p, className: c, onChange: n, ...d }, u) => {
16
16
  const {
17
- isOptionOpen: s,
17
+ isOptionOpen: o,
18
18
  inputValue: f,
19
19
  inputReadOnly: m,
20
20
  isDisabled: h,
21
21
  isError: x,
22
22
  isSuccess: y,
23
23
  selectedOption: l,
24
- isMultiSelect: o,
24
+ isMultiSelect: s,
25
25
  setSelectedOption: b,
26
26
  setPreviousAction: I,
27
27
  setInputValue: O,
@@ -32,13 +32,13 @@ const j = N(
32
32
  {
33
33
  role: "combobox",
34
34
  "aria-haspopup": "listbox",
35
- "aria-expanded": s,
35
+ "aria-expanded": o,
36
36
  "aria-controls": "select-portal",
37
37
  "aria-owns": "select-portal",
38
38
  children: /* @__PURE__ */ r(
39
39
  S,
40
40
  {
41
- className: i(o && "mds:h-auto mds:py-10 ", c),
41
+ className: i(s && "mds:h-auto mds:py-10 ", c),
42
42
  children: [
43
43
  /* @__PURE__ */ r(
44
44
  "div",
@@ -49,18 +49,18 @@ const j = N(
49
49
  children: [
50
50
  p,
51
51
  /* @__PURE__ */ t(
52
- A,
52
+ w,
53
53
  {
54
54
  ...d,
55
55
  readOnly: m,
56
56
  "data-slot": "select-input-field",
57
- "data-select-options-opened": s,
57
+ "data-select-options-opened": o,
58
58
  tabIndex: 3,
59
59
  value: f,
60
60
  isError: x,
61
61
  isSuccess: y,
62
62
  disabled: h,
63
- className: i(o && "mds:h-auto mds:min-h-auto"),
63
+ className: i(s && "mds:h-auto mds:min-h-auto"),
64
64
  onChange: (e) => {
65
65
  n && n(e), I("typing"), O(e.currentTarget.value);
66
66
  },
@@ -77,8 +77,8 @@ const j = N(
77
77
  }
78
78
  ),
79
79
  /* @__PURE__ */ r("div", { className: "mds:flex mds:items-center mds:gap-6", children: [
80
- o && Array.isArray(l) && l.length > 0 && /* @__PURE__ */ t(
81
- w,
80
+ s && Array.isArray(l) && l.length > 0 && /* @__PURE__ */ t(
81
+ A,
82
82
  {
83
83
  role: "button",
84
84
  variant: "filled",
@@ -91,7 +91,7 @@ const j = N(
91
91
  /* @__PURE__ */ t(
92
92
  C,
93
93
  {
94
- "data-select-options-opened": s,
94
+ "data-select-options-opened": o,
95
95
  className: "mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"
96
96
  }
97
97
  )
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),S=require("react"),N=require("./utils-Bdd5vx6a.cjs"),P=require("./mainstack-design-system597.cjs"),x=S.forwardRef(({value:e="",className:A,isGroupLabel:g,isDisabled:d,isCreatableOption:h,onClick:l,..._},I)=>{const{isOptionOpen:q,isMultiSelect:r,selectedOption:s,rootElementRef:p,isCreatableSelect:w,options:m,setOptions:C,setPreviousAction:j,setInputValue:f,onValueChange:n,onOptionSelect:o,onOptionOpenChange:R,setSelectedOption:u}=P.useSelectContext(),y=S.useMemo(()=>r&&Array.isArray(s)?s?.some(c=>e===c):!r&&!Array.isArray(s)?s===e:!1,[r,s,e]);return O.jsx("div",{"aria-disabled":d,className:" mds:aria-disabled:cursor-not-allowed",children:O.jsx("div",{role:"button","data-slot":"select-option-item",tabIndex:0,className:N.cn("mds:body-extrasmall-medium","mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",A),"aria-selected":y,"data-select-options-opened":q,ref:I,"aria-disabled":d||g,onClick:c=>{if(l&&l(c),!e)return;j("selection");let i=m;if(h&&w&&!i.map.has(e)){i={...m};const t={value:e,label:e};i.array.push(t),i.map.set(t.value,t),C(i)}if(r){let t=s;if(Array.isArray(s))if(t=[...s],y){const a=t.findIndex(M=>M===e);a>-1&&t.splice(a,1)}else t.push(e);else t=[e];if(u(t),f(""),Array.isArray(t)&&n&&n(t),Array.isArray(t)&&o&&o(t.map(a=>i.map.get(a))),!p.current)return null;const b=p.current.querySelector('[data-slot="select-input-field"]');b&&b.focus()}else n&&e&&n(e),o&&e&&o(i.map.get(e)),f(i.map.get(e)?.label||""),u(e),R(!1)},..._})})});x.displayName="SelectOptionItem";exports.SelectOptionItem=x;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),S=require("react"),N=require("./utils-Bdd5vx6a.cjs"),P=require("./mainstack-design-system597.cjs"),x=S.forwardRef(({value:e="",className:A,isGroupLabel:g,isDisabled:d,isCreatableOption:h,onClick:l,..._},I)=>{const{isOptionOpen:q,isMultiSelect:r,selectedOption:s,rootElementRef:p,isCreatableSelect:w,options:m,setOptions:C,setPreviousAction:j,setInputValue:f,onValueChange:n,onOptionSelect:o,onOptionOpenChange:R,setSelectedOption:u}=P.useSelectContext(),y=S.useMemo(()=>r&&Array.isArray(s)?s?.some(c=>e===c):!r&&!Array.isArray(s)?s===e:!1,[r,s,e]);return O.jsx("div",{"aria-disabled":d,className:" mds:aria-disabled:cursor-not-allowed",children:O.jsx("div",{role:"button","data-slot":"select-option-item",tabIndex:0,className:N.cn("mds:body-extrasmall-medium","mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-selected:bg-interactive-secondary-hover mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",A),"aria-selected":y,"data-select-options-opened":q,ref:I,"aria-disabled":d||g,onClick:c=>{if(l&&l(c),!e)return;j("selection");let i=m;if(h&&w&&!i.map.has(e)){i={...m};const t={value:e,label:e};i.array.push(t),i.map.set(t.value,t),C(i)}if(r){let t=s;if(Array.isArray(s))if(t=[...s],y){const a=t.findIndex(M=>M===e);a>-1&&t.splice(a,1)}else t.push(e);else t=[e];if(u(t),f(""),Array.isArray(t)&&n&&n(t),Array.isArray(t)&&o&&o(t.map(a=>i.map.get(a))),!p.current)return null;const b=p.current.querySelector('[data-slot="select-input-field"]');b&&b.focus()}else n&&e&&n(e),o&&e&&o(i.map.get(e)),f(i.map.get(e)?.label||""),u(e),R(!1)},..._})})});x.displayName="SelectOptionItem";exports.SelectOptionItem=x;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as b } from "react/jsx-runtime";
2
+ import { jsx as O } from "react/jsx-runtime";
3
3
  import { forwardRef as R, useMemo as V } from "react";
4
4
  import { c as j } from "./utils-D85wpvmd.js";
5
5
  import { useSelectContext as q } from "./mainstack-design-system597.js";
@@ -7,17 +7,17 @@ const E = R(
7
7
  ({
8
8
  value: e = "",
9
9
  className: A,
10
- isGroupLabel: x,
10
+ isGroupLabel: h,
11
11
  isDisabled: p,
12
- isCreatableOption: h,
13
- onClick: l,
12
+ isCreatableOption: x,
13
+ onClick: c,
14
14
  ...S
15
15
  }, g) => {
16
16
  const {
17
17
  isOptionOpen: w,
18
18
  isMultiSelect: s,
19
- selectedOption: i,
20
- rootElementRef: c,
19
+ selectedOption: r,
20
+ rootElementRef: l,
21
21
  isCreatableSelect: I,
22
22
  options: m,
23
23
  setOptions: C,
@@ -27,13 +27,13 @@ const E = R(
27
27
  onOptionSelect: n,
28
28
  onOptionOpenChange: N,
29
29
  setSelectedOption: y
30
- } = q(), u = V(() => s && Array.isArray(i) ? i?.some((d) => e === d) : !s && !Array.isArray(i) ? i === e : !1, [s, i, e]);
31
- return /* @__PURE__ */ b(
30
+ } = q(), u = V(() => s && Array.isArray(r) ? r?.some((d) => e === d) : !s && !Array.isArray(r) ? r === e : !1, [s, r, e]);
31
+ return /* @__PURE__ */ O(
32
32
  "div",
33
33
  {
34
34
  "aria-disabled": p,
35
35
  className: " mds:aria-disabled:cursor-not-allowed",
36
- children: /* @__PURE__ */ b(
36
+ children: /* @__PURE__ */ O(
37
37
  "div",
38
38
  {
39
39
  role: "button",
@@ -41,30 +41,30 @@ const E = R(
41
41
  tabIndex: 0,
42
42
  className: j(
43
43
  "mds:body-extrasmall-medium",
44
- "mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",
44
+ "mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-selected:bg-interactive-secondary-hover mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",
45
45
  A
46
46
  ),
47
47
  "aria-selected": u,
48
48
  "data-select-options-opened": w,
49
49
  ref: g,
50
- "aria-disabled": p || x,
50
+ "aria-disabled": p || h,
51
51
  onClick: (d) => {
52
- if (l && l(d), !e)
52
+ if (c && c(d), !e)
53
53
  return;
54
54
  _("selection");
55
- let r = m;
56
- if (h && I && !r.map.has(e)) {
57
- r = { ...m };
55
+ let i = m;
56
+ if (x && I && !i.map.has(e)) {
57
+ i = { ...m };
58
58
  const t = {
59
59
  value: e,
60
60
  label: e
61
61
  };
62
- r.array.push(t), r.map.set(t.value, t), C(r);
62
+ i.array.push(t), i.map.set(t.value, t), C(i);
63
63
  }
64
64
  if (s) {
65
- let t = i;
66
- if (Array.isArray(i))
67
- if (t = [...i], u) {
65
+ let t = r;
66
+ if (Array.isArray(r))
67
+ if (t = [...r], u) {
68
68
  const a = t.findIndex((M) => M === e);
69
69
  a > -1 && t.splice(a, 1);
70
70
  } else
@@ -72,14 +72,14 @@ const E = R(
72
72
  else
73
73
  t = [e];
74
74
  if (y(t), f(""), Array.isArray(t) && o && o(t), Array.isArray(t) && n && n(
75
- t.map((a) => r.map.get(a))
76
- ), !c.current) return null;
77
- const O = c.current.querySelector(
75
+ t.map((a) => i.map.get(a))
76
+ ), !l.current) return null;
77
+ const b = l.current.querySelector(
78
78
  '[data-slot="select-input-field"]'
79
79
  );
80
- O && O.focus();
80
+ b && b.focus();
81
81
  } else
82
- o && e && o(e), n && e && n(r.map.get(e)), f(r.map.get(e)?.label || ""), y(e), N(!1);
82
+ o && e && o(e), n && e && n(i.map.get(e)), f(i.map.get(e)?.label || ""), y(e), N(!1);
83
83
  },
84
84
  ...S
85
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",