UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

59 lines (58 loc) 1.84 kB
import { jsx as s } from "react/jsx-runtime"; import { NextIntlClientProvider as d } from "next-intl"; import { createContext as p, useContext as b, useLayoutEffect as m, useMemo as n } from "react"; import { m as f } from "./SignInForm-4TsWBtIM.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-ring": "rgb(62 176 85)" }, x = { ...f }, l = p(null), S = () => { const r = b(l); if (!r) throw new Error( "useSpeziContext must be used within SpeziProvider. Make sure to wrap your application with SpeziProvider" ); return r; }, P = ({ children: r, messages: o, theme: e, router: t }) => { m(() => { const u = { ...v, ...e }; Object.entries(u).forEach(([a, c]) => { c && document.documentElement.style.setProperty(`--${a}`, c); }); }, [e]); const g = n( () => ({ ...x, ...o }), [o] ), i = n(() => ({ router: t }), [t]); return /* @__PURE__ */ s(d, { messages: g, locale: "en", children: /* @__PURE__ */ s(l.Provider, { value: i, children: r }) }); }; export { l as S, P as a, v as l, S as u };