mainstack-design-system 1.20.0 → 1.20.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 +1 @@
|
|
|
1
|
-
"use strict";const s=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime"),t=require("react"),$=require("./utils-DgHSufYV.cjs"),m=t.forwardRef(({children:f,className:p,gradient:e,...i},x)=>{const a=t.useId(),u=`mask-${a}`,o=`gradient-${a}`,n=i.width||"24",r=i.height||"24",k=t.Children.map(f,l=>{if(!t.isValidElement(l))return l;const c=l.props,d=c?.fill,h=c?.stroke,j=d&&d!=="none",w=h&&h!=="none";return t.cloneElement(l,{...c,...e&&j?{fill:`url(#${o})`}:{},...e&&w?{stroke:`url(#${o})`}:{}})});return s.jsxs("svg",{ref:x,xmlns:"http://www.w3.org/2000/svg",width:n,height:r,viewBox:`0 0 ${n} ${r}`,fill:e?`url(#${o})`:"currentColor",stroke:"none",strokeWidth:"1",style:{maskType:"alpha"},className:$.cn("mds:size-20",p),...i,children:[s.jsx("defs",{children:e&&s.jsxs("linearGradient",{id:o,gradientTransform:`rotate(${e.angle??0})`,children:[s.jsx("stop",{offset:"0%",stopColor:e.from}),s.jsx("stop",{offset:"100%",stopColor:e.to})]})}),s.jsx("mask",{id:u,maskUnits:"userSpaceOnUse",x:"0",y:"0",width:n,height:r,children:s.jsx("rect",{width:n,height:r,fill:"white"})}),s.jsx("g",{mask:`url(#${u})`,children:k})]})});m.displayName="Icon";module.exports=m;
|
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
5
|
-
({ children:
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
-
...
|
|
11
|
-
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import l, { useId as I } from "react";
|
|
3
|
+
import { c as C } from "./utils-DLi4dp19.js";
|
|
4
|
+
const g = l.forwardRef(
|
|
5
|
+
({ children: p, className: u, gradient: e, ...i }, k) => {
|
|
6
|
+
const c = I(), m = `mask-${c}`, s = `gradient-${c}`, t = i.width || "24", r = i.height || "24", w = l.Children.map(p, (n) => {
|
|
7
|
+
if (!l.isValidElement(n)) return n;
|
|
8
|
+
const a = n.props, d = a?.fill, f = a?.stroke, $ = d && d !== "none", x = f && f !== "none";
|
|
9
|
+
return l.cloneElement(n, {
|
|
10
|
+
...a,
|
|
11
|
+
...e && $ ? { fill: `url(#${s})` } : {},
|
|
12
|
+
...e && x ? { stroke: `url(#${s})` } : {}
|
|
12
13
|
});
|
|
13
14
|
});
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ h(
|
|
15
16
|
"svg",
|
|
16
17
|
{
|
|
17
|
-
ref:
|
|
18
|
+
ref: k,
|
|
18
19
|
xmlns: "http://www.w3.org/2000/svg",
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
21
|
-
viewBox: `0 0 ${
|
|
22
|
-
fill: e ? `url(#${
|
|
20
|
+
width: t,
|
|
21
|
+
height: r,
|
|
22
|
+
viewBox: `0 0 ${t} ${r}`,
|
|
23
|
+
fill: e ? `url(#${s})` : "currentColor",
|
|
23
24
|
stroke: "none",
|
|
24
25
|
strokeWidth: "1",
|
|
25
26
|
style: { maskType: "alpha" },
|
|
26
|
-
className:
|
|
27
|
-
...
|
|
27
|
+
className: C("mds:size-20", u),
|
|
28
|
+
...i,
|
|
28
29
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ o("defs", { children: e && /* @__PURE__ */ h(
|
|
30
31
|
"linearGradient",
|
|
31
32
|
{
|
|
32
|
-
id:
|
|
33
|
+
id: s,
|
|
33
34
|
gradientTransform: `rotate(${e.angle ?? 0})`,
|
|
34
35
|
children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ o("stop", { offset: "0%", stopColor: e.from }),
|
|
37
|
+
/* @__PURE__ */ o("stop", { offset: "100%", stopColor: e.to })
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
) }),
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ o(
|
|
41
42
|
"mask",
|
|
42
43
|
{
|
|
43
|
-
id:
|
|
44
|
+
id: m,
|
|
44
45
|
maskUnits: "userSpaceOnUse",
|
|
45
46
|
x: "0",
|
|
46
47
|
y: "0",
|
|
47
|
-
width:
|
|
48
|
-
height:
|
|
49
|
-
children: /* @__PURE__ */
|
|
48
|
+
width: t,
|
|
49
|
+
height: r,
|
|
50
|
+
children: /* @__PURE__ */ o("rect", { width: t, height: r, fill: "white" })
|
|
50
51
|
}
|
|
51
52
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ o("g", { mask: `url(#${m})`, children: w })
|
|
53
54
|
]
|
|
54
55
|
}
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
58
|
);
|
|
58
|
-
|
|
59
|
+
g.displayName = "Icon";
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
g as default
|
|
61
62
|
};
|