@situaction/traq-ui-ste 1.0.27 → 1.1.0

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,54 +1,67 @@
1
- import { jsxs as z, jsx as n } from "react/jsx-runtime";
2
- import { useState as u, useRef as a, useLayoutEffect as R } from "react";
3
- import { Button as y } from "../button/Button.js";
4
- import { IconButton as H } from "../icon-button/IconButton.js";
5
- import '../../styles/Tabs.css';const C = "_underline_118wv_33", o = {
6
- "tab-container": "_tab-container_118wv_23",
7
- "tab-items": "_tab-items_118wv_28",
8
- underline: C,
9
- "flexHorizontal-center": "_flexHorizontal-center_118wv_41",
10
- "flexHorizontal-left": "_flexHorizontal-left_118wv_47",
11
- "flexHorizontal-right": "_flexHorizontal-right_118wv_53"
12
- }, j = ({ listItems: r, type: d, onTabSelect: _, defaultActiveTab: m = 0, position: b = "left" }) => {
13
- const [l, x] = u(m), [v, h] = u({}), c = a(null), p = a(null), s = a(new Array(r.length).fill(null)), f = (e) => {
14
- x(e), _(r[e]);
15
- }, w = (e) => {
16
- if (c.current && e) {
17
- const t = e.getBoundingClientRect(), i = c.current.getBoundingClientRect();
1
+ import { jsxs as H, jsx as a } from "react/jsx-runtime";
2
+ import { useState as d, useRef as s, useLayoutEffect as C } from "react";
3
+ import { Button as $ } from "../button/Button.js";
4
+ import { IconButton as B } from "../icon-button/IconButton.js";
5
+ import '../../styles/Tabs.css';const N = "_underline_udv7v_50", n = {
6
+ "tab-container": "_tab-container_udv7v_23",
7
+ "tab-container-button": "_tab-container-button_udv7v_27",
8
+ "tab-container-icon": "_tab-container-icon_udv7v_32",
9
+ "tab-container-text": "_tab-container-text_udv7v_32",
10
+ "tab-items": "_tab-items_udv7v_35",
11
+ "tab-items-button": "_tab-items-button_udv7v_39",
12
+ "selected-button": "_selected-button_udv7v_44",
13
+ underline: N,
14
+ "flexHorizontal-center": "_flexHorizontal-center_udv7v_58",
15
+ "flexHorizontal-left": "_flexHorizontal-left_udv7v_64",
16
+ "flexHorizontal-right": "_flexHorizontal-right_udv7v_70"
17
+ }, w = ({ listItems: r, type: o, onTabSelect: _, defaultActiveTab: f = 0, position: v = "left" }) => {
18
+ const [l, m] = d(f), [x, h] = d({}), c = s(null), g = s(null), u = s(new Array(r.length).fill(null)), b = (t) => {
19
+ m(t), _(r[t]);
20
+ }, z = (t) => {
21
+ if (c.current && t) {
22
+ const e = t.getBoundingClientRect(), i = c.current.getBoundingClientRect();
18
23
  h({
19
- left: `${t.left - i.left}px`,
20
- width: `${t.width}px`
24
+ left: `${e.left - i.left}px`,
25
+ width: `${e.width}px`
21
26
  });
22
27
  }
23
- }, g = [
24
- o[`flexHorizontal-${b}`],
25
- o["tab-items"]
28
+ }, R = [
29
+ n[`flexHorizontal-${v}`],
30
+ o === "button" ? n["tab-items-button"] : n["tab-items"]
26
31
  ].filter(Boolean).join(" ");
27
- return R(() => {
28
- const e = s.current[l];
29
- e && w(e);
30
- }, [l]), /* @__PURE__ */ z("div", { className: `tab ${o["tab-container"]}`, ref: c, children: [
31
- /* @__PURE__ */ n("div", { className: g, children: r.map((e, t) => /* @__PURE__ */ n("div", { ref: (i) => s.current[t] = i, children: d === "text" ? /* @__PURE__ */ n(
32
- y,
32
+ return C(() => {
33
+ const t = u.current[l];
34
+ t && z(t);
35
+ }, [l]), /* @__PURE__ */ H("div", { className: `tab ${n["tab-container"]} ${n[`tab-container-${o}`]}`, ref: c, children: [
36
+ /* @__PURE__ */ a("div", { className: R, children: r.map((t, e) => /* @__PURE__ */ a(
37
+ "div",
33
38
  {
34
- label: e,
35
- mode: "text",
36
- selected: t === l,
37
- onClick: () => f(t)
38
- }
39
- ) : /* @__PURE__ */ n(
40
- H,
41
- {
42
- mode: "icon",
43
- size: "s",
44
- selected: t === l,
45
- onClick: () => f(t),
46
- children: e
47
- }
48
- ) }, t)) }),
49
- /* @__PURE__ */ n("div", { ref: p, className: o.underline, style: v })
39
+ ref: (i) => u.current[e] = i,
40
+ className: o === "button" && e === l ? n["selected-button"] : "",
41
+ children: o === "icon" ? /* @__PURE__ */ a(
42
+ B,
43
+ {
44
+ mode: "icon",
45
+ size: "s",
46
+ selected: e === l,
47
+ onClick: () => b(e),
48
+ children: t
49
+ }
50
+ ) : /* @__PURE__ */ a(
51
+ $,
52
+ {
53
+ label: t,
54
+ mode: o === "text" ? "text" : "ghost",
55
+ selected: e === l,
56
+ onClick: () => b(e)
57
+ }
58
+ )
59
+ },
60
+ e
61
+ )) }),
62
+ o !== "button" && /* @__PURE__ */ a("div", { ref: g, className: n.underline, style: x })
50
63
  ] });
51
64
  };
52
65
  export {
53
- j as Tabs
66
+ w as Tabs
54
67
  };
@@ -1,20 +1,17 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { useTheme as u } from "../theme/ThemeContext.js";
3
- import '../../styles/TagCounter.css';const e = {
4
- "tag-counter": "_tag-counter_1wqu5_23",
5
- "dark-mode": "_dark-mode_1wqu5_34",
6
- "tag-counter-size-xl": "_tag-counter-size-xl_1wqu5_38",
7
- "tag-counter-size-l": "_tag-counter-size-l_1wqu5_45",
8
- "tag-counter-size-m": "_tag-counter-size-m_1wqu5_52",
9
- "tag-counter-size-s": "_tag-counter-size-s_1wqu5_59"
10
- }, _ = ({ label: t, size: o = "m" }) => {
11
- const { mode: r } = u(), s = [
12
- e["tag-counter"],
13
- e[`tag-counter-size-${o}`],
14
- r === "dark" && e["dark-mode"]
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import '../../styles/TagCounter.css';const t = {
3
+ "tag-counter": "_tag-counter_56oxp_23",
4
+ "tag-counter-size-xl": "_tag-counter-size-xl_56oxp_34",
5
+ "tag-counter-size-l": "_tag-counter-size-l_56oxp_41",
6
+ "tag-counter-size-m": "_tag-counter-size-m_56oxp_48",
7
+ "tag-counter-size-s": "_tag-counter-size-s_56oxp_55"
8
+ }, a = ({ label: e, size: o = "m" }) => {
9
+ const s = [
10
+ t["tag-counter"],
11
+ t[`tag-counter-size-${o}`]
15
12
  ].join(" ");
16
- return /* @__PURE__ */ a("div", { className: s, children: t });
13
+ return /* @__PURE__ */ n("div", { className: s, children: e });
17
14
  };
18
15
  export {
19
- _ as TagCounter
16
+ a as TagCounter
20
17
  };
@@ -16,11 +16,13 @@ interface ThemeContextType {
16
16
  mode: Mode;
17
17
  toggleMode: () => void;
18
18
  setMode: Dispatch<SetStateAction<Mode>>;
19
+ customVariables: Record<string, string>[] | undefined;
19
20
  }
20
21
  interface ThemeProviderProps {
21
22
  children: ReactNode;
22
23
  theme?: Theme;
23
24
  mode?: Mode;
25
+ customVariables?: Record<string, string>[] | undefined;
24
26
  }
25
27
  export declare const ThemeProvider: FC<ThemeProviderProps>;
26
28
  export declare const useTheme: () => ThemeContextType;
@@ -1,27 +1,32 @@
1
- import { jsx as h } from "react/jsx-runtime";
2
- import { createContext as S, useState as $, useContext as k } from "react";
3
- import { baseTheme as r } from "./createTheme.js";
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
- ...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-${((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)"
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { createContext as b, useState as i, useEffect as w, useContext as E } from "react";
3
+ import { baseTheme as m } from "./createTheme.js";
4
+ import { variables_dark as P } from "./variables_dark.js";
5
+ import { variables_light as p } from "./variables_light.js";
6
+ import { primary as u } from "./primary.js";
7
+ import '../../styles/ThemeContext.css';const c = b(void 0), q = ({ children: o, theme: g, mode: C, customVariables: r }) => {
8
+ var a, h;
9
+ const [t] = i(g ?? m), [n, s] = i(C ?? "light"), [v, x] = i(r ?? [u, p]);
10
+ w(() => {
11
+ x(r ?? [u, n === "light" ? p : P]);
12
+ }, [n]);
13
+ const F = () => {
14
+ s((e) => e === "light" ? "dark" : "light");
15
+ }, M = (e) => e.length ? e.reduce((y, d) => (Object.keys(d).forEach((f) => {
16
+ y[f] = d[f];
17
+ }), y), {}) : e, S = {
18
+ "--font-family": ((a = t == null ? void 0 : t.typography) == null ? void 0 : a.fontFamily) ?? m.typography.fontFamily,
19
+ "--font-family-secondary": ((h = t == null ? void 0 : t.typography) == null ? void 0 : h.fontFamilySecondary) ?? m.typography.fontFamilySecondary,
20
+ ...M(v)
16
21
  };
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
- }, q = () => {
19
- const a = k(x);
20
- if (a === void 0)
22
+ return /* @__PURE__ */ l(c.Provider, { value: { theme: t, mode: n, toggleMode: F, setMode: s, customVariables: r }, children: /* @__PURE__ */ l("div", { style: { ...S, height: "100%" }, children: o }) });
23
+ }, z = () => {
24
+ const o = E(c);
25
+ if (o === void 0)
21
26
  throw new Error("useTheme must be used within a ThemeProvider");
22
- return a;
27
+ return o;
23
28
  };
24
29
  export {
25
- V as ThemeProvider,
26
- q as useTheme
30
+ q as ThemeProvider,
31
+ z as useTheme
27
32
  };
@@ -0,0 +1,229 @@
1
+ export declare const primary: {
2
+ '--color-light-100': string;
3
+ '--color-light-90': string;
4
+ '--color-light-80': string;
5
+ '--color-light-70': string;
6
+ '--color-light-60': string;
7
+ '--color-light-50': string;
8
+ '--color-light-40': string;
9
+ '--color-light-30': string;
10
+ '--color-light-20': string;
11
+ '--color-light-10': string;
12
+ '--color-light-5': string;
13
+ '--color-light-0': string;
14
+ '--color-dark-100': string;
15
+ '--color-dark-90': string;
16
+ '--color-dark-80': string;
17
+ '--color-dark-70': string;
18
+ '--color-dark-60': string;
19
+ '--color-dark-50': string;
20
+ '--color-dark-40': string;
21
+ '--color-dark-30': string;
22
+ '--color-dark-20': string;
23
+ '--color-dark-10': string;
24
+ '--color-dark-5': string;
25
+ '--color-dark-0': string;
26
+ '--color-gray-50': string;
27
+ '--color-gray-100': string;
28
+ '--color-gray-200': string;
29
+ '--color-gray-300': string;
30
+ '--color-gray-400': string;
31
+ '--color-gray-500': string;
32
+ '--color-gray-600': string;
33
+ '--color-gray-700': string;
34
+ '--color-gray-800': string;
35
+ '--color-gray-900': string;
36
+ '--color-gray-950': string;
37
+ '--color-blue-trans-100': string;
38
+ '--color-blue-trans-90': string;
39
+ '--color-blue-trans-80': string;
40
+ '--color-blue-trans-70': string;
41
+ '--color-blue-trans-60': string;
42
+ '--color-blue-trans-50': string;
43
+ '--color-blue-trans-40': string;
44
+ '--color-blue-trans-30': string;
45
+ '--color-blue-trans-20': string;
46
+ '--color-blue-trans-10': string;
47
+ '--color-blue-trans-5': string;
48
+ '--color-blue-trans-0': string;
49
+ '--color-blue-gray-50': string;
50
+ '--color-blue-gray-100': string;
51
+ '--color-blue-gray-200': string;
52
+ '--color-blue-gray-300': string;
53
+ '--color-blue-gray-400': string;
54
+ '--color-blue-gray-500': string;
55
+ '--color-blue-gray-600': string;
56
+ '--color-blue-gray-700': string;
57
+ '--color-blue-gray-800': string;
58
+ '--color-blue-gray-900': string;
59
+ '--color-blue-gray-950': string;
60
+ '--color-blue-sky-50': string;
61
+ '--color-blue-sky-100': string;
62
+ '--color-blue-sky-200': string;
63
+ '--color-blue-sky-300': string;
64
+ '--color-blue-sky-400': string;
65
+ '--color-blue-sky-500': string;
66
+ '--color-blue-sky-600': string;
67
+ '--color-blue-sky-700': string;
68
+ '--color-blue-sky-800': string;
69
+ '--color-blue-sky-900': string;
70
+ '--color-blue-sky-950': string;
71
+ '--color-blue-dark-50': string;
72
+ '--color-blue-dark-100': string;
73
+ '--color-blue-dark-200': string;
74
+ '--color-blue-dark-300': string;
75
+ '--color-blue-dark-400': string;
76
+ '--color-blue-dark-500': string;
77
+ '--color-blue-dark-600': string;
78
+ '--color-blue-dark-700': string;
79
+ '--color-blue-dark-800': string;
80
+ '--color-blue-dark-900': string;
81
+ '--color-blue-dark-950': string;
82
+ '--color-blue-situaction-50': string;
83
+ '--color-blue-situaction-100': string;
84
+ '--color-blue-situaction-secondary-200': string;
85
+ '--color-blue-situaction-300': string;
86
+ '--color-blue-situaction-400': string;
87
+ '--color-blue-situaction-tertiary-500': string;
88
+ '--color-blue-situaction-600': string;
89
+ '--color-blue-situaction-700': string;
90
+ '--color-blue-situaction-800': string;
91
+ '--color-blue-situaction-900': string;
92
+ '--color-blue-situaction-950': string;
93
+ '--color-error-50': string;
94
+ '--color-error-100': string;
95
+ '--color-error-200': string;
96
+ '--color-error-300': string;
97
+ '--color-error-400': string;
98
+ '--color-error-500': string;
99
+ '--color-error-600': string;
100
+ '--color-error-700': string;
101
+ '--color-error-800': string;
102
+ '--color-error-900': string;
103
+ '--color-error-950': string;
104
+ '--color-succes-50': string;
105
+ '--color-succes-100': string;
106
+ '--color-succes-200': string;
107
+ '--color-succes-300': string;
108
+ '--color-succes-400': string;
109
+ '--color-succes-500': string;
110
+ '--color-succes-600': string;
111
+ '--color-succes-700': string;
112
+ '--color-succes-800': string;
113
+ '--color-succes-900': string;
114
+ '--color-succes-950': string;
115
+ '--color-brown-50': string;
116
+ '--color-brown-100': string;
117
+ '--color-brown-200': string;
118
+ '--color-brown-300': string;
119
+ '--color-brown-400': string;
120
+ '--color-brown-500': string;
121
+ '--color-brown-600': string;
122
+ '--color-brown-700': string;
123
+ '--color-brown-800': string;
124
+ '--color-brown-900': string;
125
+ '--color-brown-950': string;
126
+ '--color-emerald-50': string;
127
+ '--color-emerald-100': string;
128
+ '--color-emerald-200': string;
129
+ '--color-emerald-300': string;
130
+ '--color-emerald-400': string;
131
+ '--color-emerald-500': string;
132
+ '--color-emerald-600': string;
133
+ '--color-emerald-700': string;
134
+ '--color-emerald-800': string;
135
+ '--color-emerald-900': string;
136
+ '--color-emerald-950': string;
137
+ '--color-purple-50': string;
138
+ '--color-purple-100': string;
139
+ '--color-purple-200': string;
140
+ '--color-purple-300': string;
141
+ '--color-purple-400': string;
142
+ '--color-purple-500': string;
143
+ '--color-purple-600': string;
144
+ '--color-purple-700': string;
145
+ '--color-purple-800': string;
146
+ '--color-purple-900': string;
147
+ '--color-purple-950': string;
148
+ '--color-pink-50': string;
149
+ '--color-pink-100': string;
150
+ '--color-pink-200': string;
151
+ '--color-pink-300': string;
152
+ '--color-pink-400': string;
153
+ '--color-pink-500': string;
154
+ '--color-pink-600': string;
155
+ '--color-pink-700': string;
156
+ '--color-pink-800': string;
157
+ '--color-pink-900': string;
158
+ '--color-pink-950': string;
159
+ '--color-gold-50': string;
160
+ '--color-gold-100': string;
161
+ '--color-gold-200': string;
162
+ '--color-gold-300': string;
163
+ '--color-gold-400': string;
164
+ '--color-gold-500': string;
165
+ '--color-gold-600': string;
166
+ '--color-gold-700': string;
167
+ '--color-gold-800': string;
168
+ '--color-gold-900': string;
169
+ '--color-gold-950': string;
170
+ '--color-color': string;
171
+ '--color-sable-50': string;
172
+ '--color-sable-100': string;
173
+ '--color-sable-200': string;
174
+ '--color-sable-300': string;
175
+ '--color-sable-400': string;
176
+ '--color-sable-500': string;
177
+ '--color-sable-600': string;
178
+ '--color-sable-700': string;
179
+ '--color-sable-800': string;
180
+ '--color-sable-900': string;
181
+ '--color-sable-950': string;
182
+ '--color-purple-dark-50': string;
183
+ '--color-purple-dark-100': string;
184
+ '--color-purple-dark-200': string;
185
+ '--color-purple-dark-300': string;
186
+ '--color-purple-dark-400': string;
187
+ '--color-purple-dark-500': string;
188
+ '--color-purple-dark-600': string;
189
+ '--color-purple-dark-700': string;
190
+ '--color-purple-dark-800': string;
191
+ '--color-purple-dark-900': string;
192
+ '--color-purple-dark-950': string;
193
+ '--color-sable-trans-100': string;
194
+ '--color-sable-trans-90': string;
195
+ '--color-sable-trans-80': string;
196
+ '--color-sable-trans-70': string;
197
+ '--color-sable-trans-60': string;
198
+ '--color-sable-trans-50': string;
199
+ '--color-sable-trans-40': string;
200
+ '--color-sable-trans-30': string;
201
+ '--color-sable-trans-20': string;
202
+ '--color-sable-trans-10': string;
203
+ '--color-sable-trans-5': string;
204
+ '--color-sable-trans-0': string;
205
+ '--color-gray-trans-100': string;
206
+ '--color-gray-trans-90': string;
207
+ '--color-gray-trans-80': string;
208
+ '--color-gray-trans-70': string;
209
+ '--color-gray-trans-60': string;
210
+ '--color-gray-trans-50': string;
211
+ '--color-gray-trans-40': string;
212
+ '--color-gray-trans-30': string;
213
+ '--color-gray-trans-20': string;
214
+ '--color-gray-trans-10': string;
215
+ '--color-gray-trans-5': string;
216
+ '--color-gray-trans-0': string;
217
+ '--color-purple-trans-100': string;
218
+ '--color-purple-trans-90': string;
219
+ '--color-purple-trans-80': string;
220
+ '--color-purple-trans-70': string;
221
+ '--color-purple-trans-60': string;
222
+ '--color-purple-trans-50': string;
223
+ '--color-purple-trans-40': string;
224
+ '--color-purple-trans-30': string;
225
+ '--color-purple-trans-20': string;
226
+ '--color-purple-trans-10': string;
227
+ '--color-purple-trans-5': string;
228
+ '--color-purple-trans-0': string;
229
+ };