@situaction/traq-ui-ste 1.0.26 → 1.0.27

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,4 +1,4 @@
1
- import { ReactNode, FC } from 'react';
1
+ import { ReactNode, FC, Dispatch, SetStateAction } from 'react';
2
2
 
3
3
  type Mode = 'light' | 'dark';
4
4
  interface Theme {
@@ -15,6 +15,7 @@ interface ThemeContextType {
15
15
  theme: Theme;
16
16
  mode: Mode;
17
17
  toggleMode: () => void;
18
+ setMode: Dispatch<SetStateAction<Mode>>;
18
19
  }
19
20
  interface ThemeProviderProps {
20
21
  children: ReactNode;
@@ -1,22 +1,22 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import { createContext as k, useState as h, useContext as w } from "react";
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import { createContext as S, useState as $, useContext as k } from "react";
3
3
  import { baseTheme as r } from "./createTheme.js";
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,
4
+ import '../../styles/ThemeContext.css';const x = S(void 0), V = ({ children: a, theme: t, mode: b }) => {
5
+ var c, s, p, d, e, m, n, v;
6
+ const [o] = $(t ?? r), [l, y] = $(b ?? "light"), C = () => {
7
+ y((i) => i === "light" ? "dark" : "light");
8
+ }, F = (i) => [950, 900, 800, 700, 600, 500, 400, 300, 200, 100, 50].reduce((g, f) => (g[`--primary-color-${f}`] = `var(--color-${i}-${f})`, g), {}), M = {
9
+ "--font-family": ((c = o == null ? void 0 : o.typography) == null ? void 0 : c.fontFamily) ?? r.typography.fontFamily,
10
+ "--font-family-secondary": ((s = o == null ? void 0 : o.typography) == null ? void 0 : s.fontFamilySecondary) ?? r.typography.fontFamilySecondary,
11
11
  ...F(((p = o == null ? void 0 : o.color) == null ? void 0 : p.primary) ?? r.color.primary),
12
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)"
13
+ "--primary-color": l === "light" ? `var(--color-${((d = o == null ? void 0 : o.color) == null ? void 0 : d.primary) ?? r.color.primary}-900)` : `var(--color-${((e = o == null ? void 0 : o.color) == null ? void 0 : e.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-${((n = o == null ? void 0 : o.color) == null ? void 0 : n.primary) ?? r.color.primary}-900)`,
15
+ "--color-text": l === "light" ? `var(--color-${((v = o == null ? void 0 : o.color) == null ? void 0 : v.primary) ?? r.color.primary}-900)` : "var(--color-light-100)"
16
16
  };
17
- return /* @__PURE__ */ f($.Provider, { value: { theme: o, mode: l, toggleMode: C }, children: /* @__PURE__ */ f("div", { style: { ...S, height: "100%" }, children: a }) });
17
+ return /* @__PURE__ */ h(x.Provider, { value: { theme: o, mode: l, toggleMode: C, setMode: y }, children: /* @__PURE__ */ h("div", { style: { ...M, height: "100%" }, children: a }) });
18
18
  }, q = () => {
19
- const a = w($);
19
+ const a = k(x);
20
20
  if (a === void 0)
21
21
  throw new Error("useTheme must be used within a ThemeProvider");
22
22
  return a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@situaction/traq-ui-ste",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "library react component Situaction",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",