UNPKG

@hakit/components

Version:
129 lines (128 loc) 4 kB
import * as m from "react/jsx-runtime"; import * as u from "react"; import { forwardRef as $, useContext as b } from "react"; import C from "@emotion/cache"; import { getRegisteredStyles as D, registerStyles as M, insertStyles as z } from "@emotion/utils"; import { serializeStyles as W } from "@emotion/serialize"; import { u as q } from "./emotion-use-insertion-effect-with-fallbacks.browser.esm-o5bKZLsy.js"; import H from "react-is"; var T, h; function L() { if (h) return T; h = 1; var a = H, r = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, t = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, e = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, i = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, c = {}; c[a.ForwardRef] = e, c[a.Memo] = i; function s(o) { return a.isMemo(o) ? i : c[o.$$typeof] || r; } var g = Object.defineProperty, f = Object.getOwnPropertyNames, n = Object.getOwnPropertySymbols, I = Object.getOwnPropertyDescriptor, _ = Object.getPrototypeOf, E = Object.prototype; function N(o, l, S) { if (typeof l != "string") { if (E) { var p = _(l); p && p !== E && N(o, p, S); } var d = f(l); n && (d = d.concat(n(l))); for (var j = s(o), x = s(l), P = 0; P < d.length; ++P) { var v = d[P]; if (!t[v] && !(S && S[v]) && !(x && x[v]) && !(j && j[v])) { var A = I(l, v); try { g(o, v, A); } catch { } } } } return o; } return T = N, T; } L(); var w = /* @__PURE__ */ u.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ C({ key: "css" }) : null ); w.Provider; var Y = function(r) { return /* @__PURE__ */ $(function(t, e) { var i = b(w); return r(t, i, e); }); }, J = /* @__PURE__ */ u.createContext({}), y = {}.hasOwnProperty, O = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", R = function(r, t) { var e = {}; for (var i in t) y.call(t, i) && (e[i] = t[i]); return e[O] = r, e; }, K = function(r) { var t = r.cache, e = r.serialized, i = r.isStringTag; return M(t, e, i), q(function() { return z(t, e, i); }), null; }, U = /* @__PURE__ */ Y(function(a, r, t) { var e = a.css; typeof e == "string" && r.registered[e] !== void 0 && (e = r.registered[e]); var i = a[O], c = [e], s = ""; typeof a.className == "string" ? s = D(r.registered, c, a.className) : a.className != null && (s = a.className + " "); var g = W(c, void 0, u.useContext(J)); s += r.key + "-" + g.name; var f = {}; for (var n in a) y.call(a, n) && n !== "css" && n !== O && (f[n] = a[n]); return f.className = s, t && (f.ref = t), /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(K, { cache: r, serialized: g, isStringTag: typeof i == "string" }), /* @__PURE__ */ u.createElement(i, f)); }), F = U, ee = m.Fragment, re = function(r, t, e) { return y.call(t, "css") ? m.jsx(F, R(r, t), e) : m.jsx(r, t, e); }, te = function(r, t, e) { return y.call(t, "css") ? m.jsxs(F, R(r, t), e) : m.jsxs(r, t, e); }; export { ee as F, te as a, re as j }; //# sourceMappingURL=emotion-react-jsx-runtime.browser.esm-Tq_btErF.js.map