@situaction/traq-ui-ste 1.0.18 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,27 @@
1
- import { jsx as v } from "react/jsx-runtime";
2
- import { createContext as F, useState as g, useEffect as P, useContext as S } from "react";
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { createContext as k, useState as h, useContext as w } from "react";
3
3
  import { baseTheme as r } from "./createTheme.js";
4
- import '../../styles/ThemeContext.css';const f = F(void 0), M = ({ children: y, theme: e, mode: h }) => {
5
- const [o] = g(e ?? r), [t, $] = g(h ?? "light"), x = () => {
6
- $((a) => a === "light" ? "dark" : "light");
7
- }, b = (a) => [950, 900, 800, 700, 600, 500, 400, 300, 200, 100, 50].reduce((l, i) => (l[`--primary-color-${i}`] = `var(--color-${a}-${i})`, l), {});
8
- return P(() => {
9
- var c, l, i, s, p, d, m, n;
10
- const a = {
11
- "--font-family": ((c = o == null ? void 0 : o.typography) == null ? void 0 : c.fontFamily) ?? r.typography.fontFamily,
12
- "--font-family-secondary": ((l = o == null ? void 0 : o.typography) == null ? void 0 : l.fontFamilySecondary) ?? r.typography.fontFamilySecondary,
13
- ...b(((i = o == null ? void 0 : o.color) == null ? void 0 : i.primary) ?? r.color.primary),
14
- "--primary-dark-color-disabled": e === void 0 ? "var(--color-blue-grey-800)" : "var(--color-dark-10)",
15
- "--primary-color": t === "light" ? `var(--color-${((s = o == null ? void 0 : o.color) == null ? void 0 : s.primary) ?? r.color.primary}-900)` : `var(--color-${((p = o == null ? void 0 : o.color) == null ? void 0 : p.primary) ?? r.color.primary}-200)`,
16
- "--secondary-color": t === "light" ? `var(--color-${((d = o == null ? void 0 : o.color) == null ? void 0 : d.primary) ?? r.color.primary}-200)` : `var(--color-${((m = o == null ? void 0 : o.color) == null ? void 0 : m.primary) ?? r.color.primary}-900)`,
17
- "--color-text": t === "light" ? `var(--color-${((n = o == null ? void 0 : o.color) == null ? void 0 : n.primary) ?? r.color.primary}-900)` : "var(--color-light-100)"
18
- };
19
- Object.entries(a).forEach(([C, E]) => {
20
- document.documentElement.style.setProperty(C, E);
21
- });
22
- }, [o, t]), /* @__PURE__ */ v(f.Provider, { value: { theme: o, mode: t, toggleMode: x }, children: /* @__PURE__ */ v("div", { style: { height: "100%" }, children: y }) });
23
- }, j = () => {
24
- const y = S(f);
25
- if (y === void 0)
4
+ import '../../styles/ThemeContext.css';const $ = k(void 0), V = ({ children: a, theme: t, mode: x }) => {
5
+ var y, c, p, s, d, m, e, n;
6
+ const [o] = h(t ?? r), [l, b] = h(x ?? "light"), C = () => {
7
+ b((i) => i === "light" ? "dark" : "light");
8
+ }, F = (i) => [950, 900, 800, 700, 600, 500, 400, 300, 200, 100, 50].reduce((v, g) => (v[`--primary-color-${g}`] = `var(--color-${i}-${g})`, v), {}), S = {
9
+ "--font-family": ((y = o == null ? void 0 : o.typography) == null ? void 0 : y.fontFamily) ?? r.typography.fontFamily,
10
+ "--font-family-secondary": ((c = o == null ? void 0 : o.typography) == null ? void 0 : c.fontFamilySecondary) ?? r.typography.fontFamilySecondary,
11
+ ...F(((p = o == null ? void 0 : o.color) == null ? void 0 : p.primary) ?? r.color.primary),
12
+ "--primary-dark-color-disabled": t === void 0 ? "var(--color-blue-grey-800)" : "var(--color-dark-10)",
13
+ "--primary-color": l === "light" ? `var(--color-${((s = o == null ? void 0 : o.color) == null ? void 0 : s.primary) ?? r.color.primary}-900)` : `var(--color-${((d = o == null ? void 0 : o.color) == null ? void 0 : d.primary) ?? r.color.primary}-200)`,
14
+ "--secondary-color": l === "light" ? `var(--color-${((m = o == null ? void 0 : o.color) == null ? void 0 : m.primary) ?? r.color.primary}-200)` : `var(--color-${((e = o == null ? void 0 : o.color) == null ? void 0 : e.primary) ?? r.color.primary}-900)`,
15
+ "--color-text": l === "light" ? `var(--color-${((n = o == null ? void 0 : o.color) == null ? void 0 : n.primary) ?? r.color.primary}-900)` : "var(--color-light-100)"
16
+ };
17
+ return /* @__PURE__ */ f($.Provider, { value: { theme: o, mode: l, toggleMode: C }, children: /* @__PURE__ */ f("div", { style: { ...S, height: "100%" }, children: a }) });
18
+ }, q = () => {
19
+ const a = w($);
20
+ if (a === void 0)
26
21
  throw new Error("useTheme must be used within a ThemeProvider");
27
- return y;
22
+ return a;
28
23
  };
29
24
  export {
30
- M as ThemeProvider,
31
- j as useTheme
25
+ V as ThemeProvider,
26
+ q as useTheme
32
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",