mainstack-design-system 1.16.3 → 1.16.4
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"),
|
|
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
|
|
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(`
|
|
40
|
+
new Error(`File size exceeds the ${r}MB limit.`)
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
return e(new Error("Invalid
|
|
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
|
-
(
|
|
50
|
-
(
|
|
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(
|
|
76
|
+
/* @__PURE__ */ w(F, { variant: "filled" }),
|
|
77
77
|
p
|
|
78
78
|
]
|
|
79
79
|
}
|
|
@@ -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]
|
|
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
|
|
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:
|
|
10
|
+
activeCountry: n,
|
|
11
11
|
countryList: l,
|
|
12
|
-
onSetActiveCountry:
|
|
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 ===
|
|
38
|
+
"aria-selected": s === n,
|
|
41
39
|
onClick: () => {
|
|
42
|
-
|
|
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
|
-
|
|
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(
|
|
98
|
+
/* @__PURE__ */ e(w, { className: "mds:bg-border-interactive-neutral-inverse-hover" })
|
|
101
99
|
]
|
|
102
100
|
}
|
|
103
101
|
);
|