UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

64 lines (63 loc) 2.05 kB
import { jsx as s } from "react/jsx-runtime"; import { NextIntlClientProvider as d } from "next-intl"; import { createContext as b, useContext as p, useLayoutEffect as m, useMemo as n } from "react"; import { m as f } from "./SignInForm-DrnaI4RY.mjs"; const v = { "color-surface": "rgb(250 250 249)", "color-surface-primary": "rgb(255 255 255)", "color-foreground": "rgb(9 4 4)", "color-card": "rgb(255 255 255)", "color-card-foreground": "rgb(9 4 4)", "color-popover": "rgb(255 255 255)", "color-popover-foreground": "rgb(9 4 4)", "color-primary": "rgb(62 176 85)", "color-primary-foreground": "rgb(243 243 243)", "color-secondary": "rgb(242 240 240)", "color-secondary-foreground": "rgb(30 15 15)", "color-muted": "rgb(242 240 240)", "color-muted-foreground": "rgb(159 159 159)", "color-accent": "rgb(242 240 240)", "color-accent-foreground": "rgb(30 15 15)", "color-border": "rgb(232 215 221)", "color-input": "rgb(232 215 221)", "color-destructive": "rgb(222 65 38)", "color-destructive-foreground": "rgb(243 243 243)", "color-success": "rgb(34 197 94)", "color-success-foreground": "rgb(243 243 243)", "color-warning": "rgb(252 211 3)", "color-warning-dark": "rgb(153 101 21)", "color-warning-foreground": "rgb(9 4 4)", "color-ring": "rgb(62 176 85)" }, x = { ...f }, g = b(null), C = () => { const r = p(g); if (!r) throw new Error( "useSpeziContext must be used within SpeziProvider. Make sure to wrap your application with SpeziProvider" ); return r; }, S = ({ children: r, messages: o, theme: e, router: c }) => { m(() => { const u = { ...v, ...e }; Object.entries(u).forEach(([a, t]) => { t && document.documentElement.style.setProperty(`--${a}`, t); }); }, [e]); const l = n( () => ({ ...x, ...o }), [o] ), i = n(() => ({ router: c }), [c]); return /* @__PURE__ */ s(d, { messages: l, locale: "en", children: /* @__PURE__ */ s(g.Provider, { value: i, children: r }) }); }; export { g as S, S as a, v as l, C as u };