mainstack-design-system 1.19.6 → 1.19.7

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 e=require("react/jsx-runtime"),g=require("react"),j=require("./mainstack-design-system450.cjs"),O=require("./mainstack-design-system451.cjs");require("./mainstack-design-system449.cjs");require("./mainstack-design-system366.cjs");const v=require("./mainstack-design-system93.cjs"),N=require("./mainstack-design-system196.cjs");require("./player-C6X6nrWe.cjs");const o=require("./utils-BJ1u234q.cjs"),R=require("./mainstack-design-system606.cjs"),w=require("./index-4R9KShCu.cjs"),d=g.forwardRef(({onClick:i,children:u,className:p,onChange:r,...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=>{r&&r(t),_("typing"),b(t.currentTarget.value)},onClick:t=>{i&&i(t);const S=t.currentTarget;y(!s),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"),S=require("react"),g=require("./mainstack-design-system450.cjs"),j=require("./mainstack-design-system451.cjs");require("./mainstack-design-system449.cjs");require("./mainstack-design-system366.cjs");const O=require("./mainstack-design-system93.cjs"),v=require("./mainstack-design-system196.cjs");require("./player-C6X6nrWe.cjs");const o=require("./utils-BJ1u234q.cjs"),w=require("./mainstack-design-system606.cjs"),N=require("./index-4R9KShCu.cjs"),d=S.forwardRef(({onClick:r,children:u,className:p,onChange:i,...a},m)=>{const{isOptionOpen:s,inputValue:x,inputReadOnly:c,isDisabled:h,isError:I,isSuccess:f,selectedOption:l,isMultiSelect:n,setSelectedOption:q,setPreviousAction:b,setInputValue:y,onOptionOpenChange:_}=w.useSelectContext();return e.jsx(N.PopoverAnchor,{role:"combobox","aria-haspopup":"listbox","aria-expanded":s,"aria-controls":"select-portal","aria-owns":"select-portal",children:e.jsxs(g.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(j.InputField,{...a,readOnly:c,"data-slot":"select-input-field","data-select-options-opened":s,tabIndex:3,value:x,isError:I,isSuccess:f,disabled:h,className:o.cn(n&&"mds:h-auto mds:min-h-auto"),onChange:t=>{i&&i(t),b("typing"),y(t.currentTarget.value)},onClick:t=>{r&&r(t),_(!s),!c&&!window.matchMedia("(pointer: coarse)").matches&&t.currentTarget.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(O,{role:"button",variant:"filled",className:"mds:size-20 mds:cursor-pointer mds:text-secondary",onClick:()=>{q([])}}),e.jsx(v,{"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;
@@ -1,22 +1,22 @@
1
1
  'use client';
2
2
  import { jsx as o, jsxs as r } from "react/jsx-runtime";
3
- import { forwardRef as N } from "react";
4
- import { InputRoot as S } from "./mainstack-design-system450.js";
5
- import { InputField as w } from "./mainstack-design-system451.js";
3
+ import { forwardRef as v } from "react";
4
+ import { InputRoot as w } from "./mainstack-design-system450.js";
5
+ import { InputField as N } from "./mainstack-design-system451.js";
6
6
  import "./mainstack-design-system449.js";
7
7
  import "./mainstack-design-system366.js";
8
- import A from "./mainstack-design-system93.js";
9
- import C from "./mainstack-design-system196.js";
8
+ import S from "./mainstack-design-system93.js";
9
+ import A from "./mainstack-design-system196.js";
10
10
  import "./player-CgAfbAf_.js";
11
- import { c as i } from "./utils-D4bN6vBC.js";
12
- import { useSelectContext as F } from "./mainstack-design-system606.js";
13
- import { d as R } from "./index-RoCFhqzC.js";
14
- const j = N(
15
- ({ onClick: a, children: p, className: c, onChange: n, ...d }, u) => {
11
+ import { c as a } from "./utils-D4bN6vBC.js";
12
+ import { useSelectContext as C } from "./mainstack-design-system606.js";
13
+ import { d as F } from "./index-RoCFhqzC.js";
14
+ const R = v(
15
+ ({ onClick: i, children: c, className: p, onChange: n, ...m }, u) => {
16
16
  const {
17
17
  isOptionOpen: t,
18
18
  inputValue: f,
19
- inputReadOnly: m,
19
+ inputReadOnly: d,
20
20
  isDisabled: h,
21
21
  isError: x,
22
22
  isSuccess: y,
@@ -26,9 +26,9 @@ const j = N(
26
26
  setPreviousAction: I,
27
27
  setInputValue: O,
28
28
  onOptionOpenChange: g
29
- } = F();
29
+ } = C();
30
30
  return /* @__PURE__ */ o(
31
- R,
31
+ F,
32
32
  {
33
33
  role: "combobox",
34
34
  "aria-haspopup": "listbox",
@@ -36,23 +36,23 @@ const j = N(
36
36
  "aria-controls": "select-portal",
37
37
  "aria-owns": "select-portal",
38
38
  children: /* @__PURE__ */ r(
39
- S,
39
+ w,
40
40
  {
41
- className: i(s && "mds:h-auto mds:py-10 ", c),
41
+ className: a(s && "mds:h-auto mds:py-10 ", p),
42
42
  children: [
43
43
  /* @__PURE__ */ r(
44
44
  "div",
45
45
  {
46
- className: i(
46
+ className: a(
47
47
  "mds:flex mds:flex-1 mds:h-auto mds:min-h-auto mds:items-center mds:flex-wrap mds:gap-6"
48
48
  ),
49
49
  children: [
50
- p,
50
+ c,
51
51
  /* @__PURE__ */ o(
52
- w,
52
+ N,
53
53
  {
54
- ...d,
55
- readOnly: m,
54
+ ...m,
55
+ readOnly: d,
56
56
  "data-slot": "select-input-field",
57
57
  "data-select-options-opened": t,
58
58
  tabIndex: 3,
@@ -60,17 +60,15 @@ const j = N(
60
60
  isError: x,
61
61
  isSuccess: y,
62
62
  disabled: h,
63
- className: i(s && "mds:h-auto mds:min-h-auto"),
63
+ className: a(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
  },
67
67
  onClick: (e) => {
68
- a && a(e);
69
- const v = e.currentTarget;
70
- g(!t), m || v.focus();
68
+ i && i(e), g(!t), !d && !window.matchMedia("(pointer: coarse)").matches && e.currentTarget.focus();
71
69
  },
72
70
  ref: u,
73
- ...d
71
+ ...m
74
72
  }
75
73
  )
76
74
  ]
@@ -78,7 +76,7 @@ const j = N(
78
76
  ),
79
77
  /* @__PURE__ */ r("div", { className: "mds:flex mds:items-center mds:gap-6", children: [
80
78
  s && Array.isArray(l) && l.length > 0 && /* @__PURE__ */ o(
81
- A,
79
+ S,
82
80
  {
83
81
  role: "button",
84
82
  variant: "filled",
@@ -89,7 +87,7 @@ const j = N(
89
87
  }
90
88
  ),
91
89
  /* @__PURE__ */ o(
92
- C,
90
+ A,
93
91
  {
94
92
  "data-select-options-opened": t,
95
93
  className: "mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"
@@ -103,7 +101,7 @@ const j = N(
103
101
  );
104
102
  }
105
103
  );
106
- j.displayName = "SelectInputField";
104
+ R.displayName = "SelectInputField";
107
105
  export {
108
- j as SelectInputField
106
+ R as SelectInputField
109
107
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),r=require("./index-4R9KShCu.cjs"),u=require("react"),m=require("./utils-BJ1u234q.cjs"),f=require("./mainstack-design-system606.cjs"),a=u.forwardRef(({children:i,onWheel:t,onTouchMove:o,className:c,...l},d)=>{const{isOptionOpen:n,onOptionOpenChange:p}=f.useSelectContext();return s.jsx(r.PopoverPortal,{forceMount:!0,children:s.jsx(r.PopoverContent,{"data-slot":"select-portal",role:"listbox",sideOffset:6,"data-select-options-opened":n,className:m.cn(" mds:hidden mds:will-change-transform mds:z-100 mds:data-[state=open]:animate-content-fade-in mds:animate-content-fade-out mds:w-(--radix-popover-trigger-width) ",n&&"mds:block",c),ref:d,onInteractOutside:()=>{p(!1)},onWheel:e=>{e.stopPropagation(),t&&t(e)},onTouchMove:e=>{e.stopPropagation(),o&&o(e)},...l,children:i})})});a.displayName="SelectPortal";exports.SelectPortal=a;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),i=require("./index-4R9KShCu.cjs"),m=require("react"),g=require("./utils-BJ1u234q.cjs"),P=require("./mainstack-design-system606.cjs"),c=m.forwardRef(({children:l,onWheel:t,onTouchMove:o,onPointerDownOutside:n,className:d,...u},p)=>{const{isOptionOpen:r,onOptionOpenChange:f,rootElementRef:s}=P.useSelectContext();return a.jsx(i.PopoverPortal,{forceMount:!0,children:a.jsx(i.PopoverContent,{"data-slot":"select-portal",role:"listbox",sideOffset:6,"data-select-options-opened":r,className:g.cn(" mds:hidden mds:will-change-transform mds:z-100 mds:data-[state=open]:animate-content-fade-in mds:animate-content-fade-out mds:w-(--radix-popover-trigger-width) ",r&&"mds:block",d),ref:p,onPointerDownOutside:e=>{if(s.current?.contains(e.target)){e.preventDefault();return}n&&n(e)},onInteractOutside:e=>{s.current?.contains(e.target)||f(!1)},onWheel:e=>{e.stopPropagation(),t&&t(e)},onTouchMove:e=>{e.stopPropagation(),o&&o(e)},...u,children:l})})});c.displayName="SelectPortal";exports.SelectPortal=c;
@@ -1,41 +1,55 @@
1
1
  'use client';
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { b as m, c as l } from "./index-RoCFhqzC.js";
4
- import { forwardRef as c } from "react";
5
- import { c as f } from "./utils-D4bN6vBC.js";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import { b as f, c as l } from "./index-RoCFhqzC.js";
4
+ import { forwardRef as u } from "react";
5
+ import { c as g } from "./utils-D4bN6vBC.js";
6
6
  import { useSelectContext as P } from "./mainstack-design-system606.js";
7
- const g = c(
8
- ({ children: n, onWheel: o, onTouchMove: e, className: s, ...i }, p) => {
9
- const { isOptionOpen: a, onOptionOpenChange: d } = P();
10
- return /* @__PURE__ */ r(m, { forceMount: !0, children: /* @__PURE__ */ r(
7
+ const O = u(
8
+ ({
9
+ children: i,
10
+ onWheel: e,
11
+ onTouchMove: o,
12
+ onPointerDownOutside: r,
13
+ className: p,
14
+ ...m
15
+ }, c) => {
16
+ const { isOptionOpen: n, onOptionOpenChange: d, rootElementRef: a } = P();
17
+ return /* @__PURE__ */ s(f, { forceMount: !0, children: /* @__PURE__ */ s(
11
18
  l,
12
19
  {
13
20
  "data-slot": "select-portal",
14
21
  role: "listbox",
15
22
  sideOffset: 6,
16
- "data-select-options-opened": a,
17
- className: f(
23
+ "data-select-options-opened": n,
24
+ className: g(
18
25
  " mds:hidden mds:will-change-transform mds:z-100 mds:data-[state=open]:animate-content-fade-in mds:animate-content-fade-out mds:w-(--radix-popover-trigger-width) ",
19
- a && "mds:block",
20
- s
26
+ n && "mds:block",
27
+ p
21
28
  ),
22
- ref: p,
23
- onInteractOutside: () => {
24
- d(!1);
29
+ ref: c,
30
+ onPointerDownOutside: (t) => {
31
+ if (a.current?.contains(t.target)) {
32
+ t.preventDefault();
33
+ return;
34
+ }
35
+ r && r(t);
36
+ },
37
+ onInteractOutside: (t) => {
38
+ a.current?.contains(t.target) || d(!1);
25
39
  },
26
40
  onWheel: (t) => {
27
- t.stopPropagation(), o && o(t);
41
+ t.stopPropagation(), e && e(t);
28
42
  },
29
43
  onTouchMove: (t) => {
30
- t.stopPropagation(), e && e(t);
44
+ t.stopPropagation(), o && o(t);
31
45
  },
32
- ...i,
33
- children: n
46
+ ...m,
47
+ children: i
34
48
  }
35
49
  ) });
36
50
  }
37
51
  );
38
- g.displayName = "SelectPortal";
52
+ O.displayName = "SelectPortal";
39
53
  export {
40
- g as SelectPortal
54
+ O as SelectPortal
41
55
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.19.6",
3
+ "version": "1.19.7",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",