mainstack-design-system 1.16.3 → 1.16.5

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),U=require("react"),f=require("./utils-s-0cOrOT.cjs"),w=require("./mainstack-design-system629.cjs"),C=require("./mainstack-design-system35.cjs");require("./mainstack-design-system366.cjs");const D=require("./mainstack-design-system55.cjs");require("./player-CocaNyQC.cjs");const g=({className:b,children:v,...h})=>{const{values:t,onValuesChange:m,accept:_,maxSize:a,maxFiles:o,onError:e,isError:z}=C.useFileUploaderContext(),x=U.useCallback(async(n,i)=>{const y=t.length,u=(o||0)-y;if(n.length>u||i.length>0){if(e){if(n.length>u||i.some(r=>r.errors.some(s=>s.code==="too-many-files")))return e(new Error(`You can only upload a maximum of ${o} images.`));if(i.some(r=>r.errors.some(s=>s.code==="file-too-large"))){const r=a?(a/1048576).toFixed(0):"0";return e(new Error(`Image size exceeds the ${r}MB limit.`))}return e(new Error("Invalid image type or criteria."))}return}try{const r=(await f.getFileMetadata(n)).filter(l=>!t.some(c=>c.fileName===l.fileName&&c.fileSize===l.fileSize&&c.lastModified===l.lastModified)),q=[...t,...r].slice(0,o);m(q)}catch(d){e&&e(d)}},[m,e,t,o,a]);return p.jsxs(w.DropzoneUploadArea,{"data-slot":"file-uploader-dropzone-content",className:f.cn("mds:relative mds:border mds:border-dashed mds:border-border-interactive-neutral mds:rounded-20 mds:bg-surface-neutral-l1 mds:data-[active-preview=true]:overflow-hidden mds:cursor-pointer mds:hover:bg-interactive-secondary mds:data-dragging:border-border-interactive-neutral mds:active:ring-2 mds:active:ring-border-interactive-neutral-pressed mds:p-24 mds:flex mds:flex-col mds:items-center mds:justify-center mds:h-full",z&&"mds:ring-2 mds:bg-surface-error-l1 mds:ring-border-surface-error-l1",b),onDrop:x,accept:_,maxFiles:o,maxSize:a,asChild:!0,...h,children:[p.jsx(D,{variant:"filled"}),v]})};g.displayName="FileUploaderDropzone";exports.FileUploaderDropzone=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),U=require("react"),f=require("./utils-s-0cOrOT.cjs"),w=require("./mainstack-design-system629.cjs"),F=require("./mainstack-design-system35.cjs");require("./mainstack-design-system366.cjs");const C=require("./mainstack-design-system55.cjs");require("./player-CocaNyQC.cjs");const g=({className:b,children:v,...h})=>{const{values:t,onValuesChange:m,accept:_,maxSize:s,maxFiles:o,onError:e,isError:z}=F.useFileUploaderContext(),x=U.useCallback(async(n,i)=>{const y=t.length,u=(o||0)-y;if(n.length>u||i.length>0){if(e){if(n.length>u||i.some(r=>r.errors.some(a=>a.code==="too-many-files")))return e(new Error(`You can only upload a maximum of ${o} images.`));if(i.some(r=>r.errors.some(a=>a.code==="file-too-large"))){const r=s?(s/1048576).toFixed(0):"0";return e(new Error(`File size exceeds the ${r}MB limit.`))}return e(new Error("Invalid file type or criteria."))}return}try{const r=(await f.getFileMetadata(n)).filter(l=>!t.some(c=>c.fileName===l.fileName&&c.fileSize===l.fileSize&&c.lastModified===l.lastModified)),q=[...t,...r].slice(0,o);m(q)}catch(d){e&&e(d)}},[m,e,t,o,s]);return p.jsxs(w.DropzoneUploadArea,{"data-slot":"file-uploader-dropzone-content",className:f.cn("mds:relative mds:border mds:border-dashed mds:border-border-interactive-neutral mds:rounded-20 mds:bg-surface-neutral-l1 mds:data-[active-preview=true]:overflow-hidden mds:cursor-pointer mds:hover:bg-interactive-secondary mds:data-dragging:border-border-interactive-neutral mds:active:ring-2 mds:active:ring-border-interactive-neutral-pressed mds:p-24 mds:flex mds:flex-col mds:items-center mds:justify-center mds:h-full",z&&"mds:ring-2 mds:bg-surface-error-l1 mds:ring-border-surface-error-l1",b),onDrop:x,accept:_,maxFiles:o,maxSize:s,asChild:!0,...h,children:[p.jsx(C,{variant:"filled"}),v]})};g.displayName="FileUploaderDropzone";exports.FileUploaderDropzone=g;
@@ -4,7 +4,7 @@ import { a as E, c as M } from "./utils-Z5JtG_Bc.js";
4
4
  import { DropzoneUploadArea as N } from "./mainstack-design-system629.js";
5
5
  import { useFileUploaderContext as D } from "./mainstack-design-system35.js";
6
6
  import "./mainstack-design-system366.js";
7
- import I from "./mainstack-design-system55.js";
7
+ import F from "./mainstack-design-system55.js";
8
8
  import "./player-Chgv-hOU.js";
9
9
  const S = ({
10
10
  className: f,
@@ -37,17 +37,17 @@ const S = ({
37
37
  )) {
38
38
  const r = a ? (a / 1048576).toFixed(0) : "0";
39
39
  return e(
40
- new Error(`Image size exceeds the ${r}MB limit.`)
40
+ new Error(`File size exceeds the ${r}MB limit.`)
41
41
  );
42
42
  }
43
- return e(new Error("Invalid image type or criteria."));
43
+ return e(new Error("Invalid file type or criteria."));
44
44
  }
45
45
  return;
46
46
  }
47
47
  try {
48
48
  const r = (await E(i)).filter(
49
- (m) => !t.some(
50
- (l) => l.fileName === m.fileName && l.fileSize === m.fileSize && l.lastModified === m.lastModified
49
+ (l) => !t.some(
50
+ (m) => m.fileName === l.fileName && m.fileSize === l.fileSize && m.lastModified === l.lastModified
51
51
  )
52
52
  ), z = [...t, ...r].slice(0, o);
53
53
  c(z);
@@ -73,7 +73,7 @@ const S = ({
73
73
  asChild: !0,
74
74
  ...g,
75
75
  children: [
76
- /* @__PURE__ */ w(I, { variant: "filled" }),
76
+ /* @__PURE__ */ w(F, { variant: "filled" }),
77
77
  p
78
78
  ]
79
79
  }
@@ -2,9 +2,9 @@
2
2
  mds:active:transition-transform mds:ease-out-cubic mds:duration-150 mds:active:scale-[0.85] mds:focus:transition-background mds:focus:ease-out
3
3
  mds:focus-visible:ring-2 mds:focus-visible:ring-border-interactive-info-light-focused mds:disabled:cursor-not-allowed`,{variants:{status:{default:"",warning:"",success:"",error:"",info:""},variant:{special:"",primary:"",secondary:"",outline:"",ghost:""},size:{tiny:"mds:body-tiny-medium mds:h-30 mds:p-6",xs:"mds:h-36 mds:px-14 mds:py-8",sm:"mds:h-40 mds:p-16",md:"mds:h-48 mds:px-16 mds:py-12",lg:"mds:h-56 mds:p-16"},rounded:{sm:"mds:rounded-full",md:"mds:rounded-10"}},compoundVariants:[{status:"default",variant:"special",class:`mds:bg-content-special mds:text-on-primary mds:shadow-special-button-default
4
4
  mds:border-2 mds:border-neutral-350
5
- mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover
5
+ mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover mds:outline-2 mds:outline-neutral-500
6
6
 
7
- mds:active:bg-content-special mds:active:ring-3 mds:active:shadow-special-button-pressed mds:active:ring-border-surface-spread-neutral
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
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
9
9
  mds:hover:bg-interactive-primary-hover
10
10
 
@@ -38,9 +38,9 @@ const r = e(
38
38
  variant: "special",
39
39
  class: `mds:bg-content-special mds:text-on-primary mds:shadow-special-button-default
40
40
  mds:border-2 mds:border-neutral-350
41
- mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover
41
+ mds:hover:bg-content-special-hover mds:hover:shadow-special-button-hover mds:outline-2 mds:outline-neutral-500
42
42
 
43
- mds:active:bg-content-special mds:active:ring-3 mds:active:shadow-special-button-pressed mds:active:ring-border-surface-spread-neutral
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
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`
45
45
  },
46
46
  {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),r=require("./utils-s-0cOrOT.cjs"),p=require("./mainstack-design-system624.cjs"),l=require("./index-BgzojN8c.cjs"),n=d.forwardRef(({onOptionOpenChange:a,searchCountry:t,activeCountry:i,countryList:o,onSetActiveCountry:c,getCountryMetaInfo:u,className:x,...b},f)=>{const m=d.useMemo(()=>t?o.filter(s=>r.countriesEnglishNames[s].toLowerCase().includes(t.toLowerCase())):o,[t,o]);return e.jsxs(l.ScrollArea,{style:{"--scrollbar-size":"8px"},className:r.cn("mds:flex mds:flex-col mds:max-h-188",x),"data-slot":"phone-number-options-list",ref:f,...b,children:[e.jsx(l.ScrollAreaViewport,{className:"mds:h-full mds:pr-8 mds:w-full",children:e.jsx("div",{"data-slot":"phone-number-options-list-inner",className:r.cn("mds:flex mds:flex-col mds:gap-8"),children:m.length?m.map(s=>e.jsxs("button",{role:"option","aria-selected":s===i,onClick:()=>{c(s),a(!1)},className:"mds:flex mds:cursor-pointer mds:py-8 mds:px-10 mds:rounded-12 mds:items-center mds:justify-between mds:hover:bg-interactive-secondary-hover",children:[e.jsxs("div",{className:"mds:flex mds:items-center mds:gap-8",children:[e.jsx("div",{className:"mds:flex mds:items-center mds:justify-center",children:p.getCountryFlagComp(s)}),e.jsx("p",{className:r.cn("mds:body-extrasmall-medium","mds:text-primary"),children:r.countriesEnglishNames[s]})]}),e.jsx("p",{className:r.cn("mds:body-extrasmall-regular","mds:text-secondary"),children:u(s)})]},s)):e.jsx("p",{className:r.cn("mds:body-extrasmall-regular","mds:text-tertiary mds:text-center"),children:"No option found"})})}),e.jsx(l.ScrollAreaScrollbar,{orientation:"vertical",className:"mds:flex mds:select-none mds:rounded-(--scrollbar-size) mds:touch-none mds:p-2 mds:w-(--scrollbar-size) mds:flex-col mds:transition-all mds:duration-200 mds:ease-out mds:bg-surface-neutral-l1 mds:hover:bg-interactive-secondary mds:hover:w-12",children:e.jsx(l.ScrollAreaThumb,{className:r.cn("mds:rounded-(--scrollbar-size) mds:bg-border-interactive-neutral-inverse-hover mds:relative","mds:before:content-[''] mds:before:absolute mds:before:top-1/2 mds:before:left-1/2 mds:before:-translate-1/2 mds:before:size-full mds:before:min-w-44 mds:before:min-h-44")})}),e.jsx(l.ScrollAreaCorner,{className:"mds:bg-border-interactive-neutral-inverse-hover"})]})});n.displayName="FormCountryOptionsList";exports.FormCountryOptionsList=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),r=require("./utils-s-0cOrOT.cjs"),p=require("./mainstack-design-system624.cjs"),l=require("./index-BgzojN8c.cjs"),n=d.forwardRef(({onOptionOpenChange:a,searchCountry:t,activeCountry:i,countryList:o,onSetActiveCountry:c,getCountryMetaInfo:u,className:x,...b},f)=>{const m=d.useMemo(()=>t?o.filter(s=>(r.countriesEnglishNames[s]||"")?.toLowerCase().includes(t?.toLowerCase())):o,[t,o]);return e.jsxs(l.ScrollArea,{style:{"--scrollbar-size":"8px"},className:r.cn("mds:flex mds:flex-col mds:max-h-188",x),"data-slot":"phone-number-options-list",ref:f,...b,children:[e.jsx(l.ScrollAreaViewport,{className:"mds:h-full mds:pr-8 mds:w-full",children:e.jsx("div",{"data-slot":"phone-number-options-list-inner",className:r.cn("mds:flex mds:flex-col mds:gap-8"),children:m.length?m.map(s=>e.jsxs("button",{role:"option","aria-selected":s===i,onClick:()=>{c(s),a(!1)},className:"mds:flex mds:cursor-pointer mds:py-8 mds:px-10 mds:rounded-12 mds:items-center mds:justify-between mds:hover:bg-interactive-secondary-hover",children:[e.jsxs("div",{className:"mds:flex mds:items-center mds:gap-8",children:[e.jsx("div",{className:"mds:flex mds:items-center mds:justify-center",children:p.getCountryFlagComp(s)}),e.jsx("p",{className:r.cn("mds:body-extrasmall-medium","mds:text-primary"),children:r.countriesEnglishNames[s]})]}),e.jsx("p",{className:r.cn("mds:body-extrasmall-regular","mds:text-secondary"),children:u(s)})]},s)):e.jsx("p",{className:r.cn("mds:body-extrasmall-regular","mds:text-tertiary mds:text-center"),children:"No option found"})})}),e.jsx(l.ScrollAreaScrollbar,{orientation:"vertical",className:"mds:flex mds:select-none mds:rounded-(--scrollbar-size) mds:touch-none mds:p-2 mds:w-(--scrollbar-size) mds:flex-col mds:transition-all mds:duration-200 mds:ease-out mds:bg-surface-neutral-l1 mds:hover:bg-interactive-secondary mds:hover:w-12",children:e.jsx(l.ScrollAreaThumb,{className:r.cn("mds:rounded-(--scrollbar-size) mds:bg-border-interactive-neutral-inverse-hover mds:relative","mds:before:content-[''] mds:before:absolute mds:before:top-1/2 mds:before:left-1/2 mds:before:-translate-1/2 mds:before:size-full mds:before:min-w-44 mds:before:min-h-44")})}),e.jsx(l.ScrollAreaCorner,{className:"mds:bg-border-interactive-neutral-inverse-hover"})]})});n.displayName="FormCountryOptionsList";exports.FormCountryOptionsList=n;
@@ -2,21 +2,19 @@ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as u, useMemo as h } from "react";
3
3
  import { n as a, c as r } from "./utils-Z5JtG_Bc.js";
4
4
  import { getCountryFlagComp as x } from "./mainstack-design-system624.js";
5
- import { S as v, a as N, b as g, c as w, d as y } from "./index-CLUgda6x.js";
5
+ import { S as v, a as N, b as g, c as y, d as w } from "./index-CLUgda6x.js";
6
6
  const S = u(
7
7
  ({
8
8
  onOptionOpenChange: t,
9
9
  searchCountry: m,
10
- activeCountry: i,
10
+ activeCountry: n,
11
11
  countryList: l,
12
- onSetActiveCountry: n,
12
+ onSetActiveCountry: i,
13
13
  getCountryMetaInfo: c,
14
14
  className: f,
15
15
  ...p
16
16
  }, b) => {
17
- const o = h(() => m ? l.filter(
18
- (s) => a[s].toLowerCase().includes(m.toLowerCase())
19
- ) : l, [m, l]);
17
+ const o = h(() => m ? l.filter((s) => (a[s] || "")?.toLowerCase().includes(m?.toLowerCase())) : l, [m, l]);
20
18
  return /* @__PURE__ */ d(
21
19
  v,
22
20
  {
@@ -37,9 +35,9 @@ const S = u(
37
35
  "button",
38
36
  {
39
37
  role: "option",
40
- "aria-selected": s === i,
38
+ "aria-selected": s === n,
41
39
  onClick: () => {
42
- n(s), t(!1);
40
+ i(s), t(!1);
43
41
  },
44
42
  className: "mds:flex mds:cursor-pointer mds:py-8 mds:px-10 mds:rounded-12 mds:items-center mds:justify-between mds:hover:bg-interactive-secondary-hover",
45
43
  children: [
@@ -87,7 +85,7 @@ const S = u(
87
85
  orientation: "vertical",
88
86
  className: "mds:flex mds:select-none mds:rounded-(--scrollbar-size) mds:touch-none mds:p-2 mds:w-(--scrollbar-size) mds:flex-col mds:transition-all mds:duration-200 mds:ease-out mds:bg-surface-neutral-l1 mds:hover:bg-interactive-secondary mds:hover:w-12",
89
87
  children: /* @__PURE__ */ e(
90
- w,
88
+ y,
91
89
  {
92
90
  className: r(
93
91
  "mds:rounded-(--scrollbar-size) mds:bg-border-interactive-neutral-inverse-hover mds:relative",
@@ -97,7 +95,7 @@ const S = u(
97
95
  )
98
96
  }
99
97
  ),
100
- /* @__PURE__ */ e(y, { className: "mds:bg-border-interactive-neutral-inverse-hover" })
98
+ /* @__PURE__ */ e(w, { className: "mds:bg-border-interactive-neutral-inverse-hover" })
101
99
  ]
102
100
  }
103
101
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.16.3",
3
+ "version": "1.16.5",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",