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