@solar-icons/react
Version:
Solar Icons for React
51 lines (50 loc) • 1.15 kB
JavaScript
var V = Object.defineProperty;
var u = Object.getOwnPropertySymbols;
var m = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
var n = (o, e, t) => e in o ? V(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, r = (o, e) => {
for (var t in e || (e = {}))
m.call(e, t) && n(o, t, e[t]);
if (u)
for (var t of u(e))
x.call(e, t) && n(o, t, e[t]);
return o;
};
import C, { createContext as f, useState as c, useContext as h } from "react";
const l = {
color: "currentColor",
size: "1em",
weight: "Linear",
mirrored: !1
}, S = f({
value: l,
setValue: () => {
},
setSvgProps: () => {
}
}), E = ({
children: o,
value: e = l,
svgProps: t = {}
}) => {
const [p, v] = c(r(r({}, l), e)), [P, g] = c(t), i = (s) => {
v((a) => r(r({}, a), s));
}, d = (s) => {
g((a) => r(r({}, a), s));
};
return /* @__PURE__ */ C.createElement(
S.Provider,
{
value: {
value: p,
svgProps: P,
setValue: i,
setSvgProps: d
}
},
o
);
}, L = () => h(S);
export {
E as SolarProvider,
L as useSolar
};