UNPKG

@cgi-learning-hub/ui

Version:

@cgi-learning-hub/ui is an open-source React component library that implements UI for HUB's features

92 lines (91 loc) 3.1 kB
import "react"; import { jsx as l } from "react/jsx-runtime"; import { P as e } from "./index-Sy88PpwE.js"; import { d as f } from "./DefaultPropsProvider-DqazQPtr.js"; import { T as i } from "./identifier-PWESmBq6.js"; import { u as c } from "./useTheme--i9fxE_A.js"; import { Global as m } from "@emotion/react"; import { e as y } from "./extendSxProp-CesAxox9.js"; function b(o) { return o == null || Object.keys(o).length === 0; } function p(o) { const { styles: t, defaultTheme: n = {} } = o; return /* @__PURE__ */ l(m, { styles: typeof t == "function" ? (s) => t(b(s) ? n : s) : t }); } process.env.NODE_ENV !== "production" && (p.propTypes = { defaultTheme: e.object, styles: e.oneOfType([e.array, e.string, e.object, e.func]) }); function u({ styles: o, themeId: t, defaultTheme: n = {} }) { const r = c(n), s = typeof o == "function" ? o(t && r[t] || r) : o; return /* @__PURE__ */ l(p, { styles: s }); } process.env.NODE_ENV !== "production" && (u.propTypes = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * @ignore */ defaultTheme: e.object, /** * @ignore */ styles: e.oneOfType([e.array, e.func, e.number, e.object, e.string, e.bool]), /** * @ignore */ themeId: e.string }); function a(o) { return /* @__PURE__ */ l(u, { ...o, defaultTheme: f, themeId: i }); } process.env.NODE_ENV !== "production" && (a.propTypes = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * The styles you want to apply globally. */ styles: e.oneOfType([e.array, e.func, e.number, e.object, e.string, e.bool]) }); function x(o) { return function(n) { return ( // Pigment CSS `globalCss` support callback with theme inside an object but `GlobalStyles` support theme as a callback value. /* @__PURE__ */ l(a, { styles: typeof o == "function" ? (r) => o({ theme: r, ...n }) : o }) ); }; } function G() { return y; } export { a as G, p as a, x as g, G as i };