@sbkbs/ui 1.0.0 → 1.0.2

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,262 +1,438 @@
1
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
- import { useState as y, useEffect as C, useContext as k, createContext as E } from "react";
3
- const M = ({
4
- variant: a = "primary",
5
- size: t = "md",
1
+ import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
+ import { useState as z, useEffect as b, useContext as $, createContext as P } from "react";
3
+ const W = ({
4
+ variant: t = "primary",
5
+ size: a = "md",
6
+ compact: r = !1,
6
7
  fullWidth: n = !1,
7
- isLoading: s = !1,
8
- leftIcon: r,
9
- rightIcon: l,
10
- children: o,
11
- className: d = "",
12
- disabled: h,
13
- palette: p,
14
- ...i
8
+ isLoading: o = !1,
9
+ leftIcon: s,
10
+ rightIcon: i,
11
+ children: d,
12
+ className: h = "",
13
+ disabled: c,
14
+ palette: l,
15
+ style: f,
16
+ ...m
15
17
  }) => {
16
- const c = `btn--${a}`, b = `btn--${t}`, f = n ? "btn--full-width" : "", g = s ? "btn--loading" : "", $ = p && a === "primary" ? `btn--palette-${p}` : "", v = `btn ${c} ${b} ${f} ${g} ${$} ${d}`.trim();
17
- return /* @__PURE__ */ m(
18
+ const x = "relative inline-flex select-none items-center justify-center overflow-hidden whitespace-nowrap rounded-[var(--border-radius-md)] border border-transparent font-semibold leading-none tracking-[0.01em] transition-[all_var(--transition-base)]", p = "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--md-primary)]", N = "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60", u = n ? "w-full" : "", g = "", M = l === "off-white" && t === "primary" ? "border-[var(--border-color)]" : "", _ = {
19
+ xs: r ? "min-h-[1.75rem] min-w-[1.75rem] gap-1 px-2 py-1 text-[var(--font-size-xs)]" : "min-h-8 min-w-8 gap-1.5 px-3 py-1.5 text-[var(--font-size-xs)]",
20
+ sm: r ? "min-h-8 min-w-8 gap-[0.3125rem] px-2.5 py-1.5 text-[var(--font-size-sm)]" : "min-h-9 min-w-9 gap-[0.4375rem] px-3.5 py-2 text-[var(--font-size-sm)]",
21
+ md: r ? "min-h-[2.375rem] min-w-[2.375rem] gap-1.5 px-3 py-2 text-[var(--font-size-base)]" : "min-h-11 min-w-11 gap-2 px-4 py-2.5 text-[var(--font-size-base)]",
22
+ lg: r ? "min-h-[2.625rem] min-w-[2.625rem] gap-[0.4375rem] px-3.5 py-[0.5625rem] text-[var(--font-size-lg)]" : "min-h-12 min-w-12 gap-[0.5625rem] px-6 py-4 text-[var(--font-size-lg)]",
23
+ xl: r ? "min-h-12 min-w-12 gap-2 px-4 py-3 text-[var(--font-size-xl)]" : "min-h-14 min-w-14 gap-2.5 px-8 py-6 text-[var(--font-size-xl)]"
24
+ }, E = {
25
+ primary: "bg-[var(--md-primary)] text-[var(--md-on-primary)] shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--primary-color-hover)] hover:shadow-[var(--shadow-md)]",
26
+ secondary: "bg-[var(--md-secondary)] text-[var(--md-on-secondary)] shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--secondary-color-light)] hover:shadow-[var(--shadow-md)]",
27
+ success: "bg-[var(--success-color)] text-white shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--success-color-light)] hover:shadow-[var(--shadow-md)]",
28
+ error: "bg-[var(--md-error)] text-[var(--md-on-error)] shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--error-color-light)] hover:shadow-[var(--shadow-md)]",
29
+ warning: "bg-[var(--warning-color)] text-white shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--warning-color-light)] hover:shadow-[var(--shadow-md)]",
30
+ info: "bg-[var(--info-color)] text-white shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--info-color-light)] hover:shadow-[var(--shadow-md)]",
31
+ neutral: "bg-[var(--neutral-color)] text-white shadow-[var(--shadow-sm)] hover:translate-y-[-0.125rem] hover:bg-[var(--neutral-color-light)] hover:shadow-[var(--shadow-md)]",
32
+ ghost: "border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--md-on-surface)] shadow-[var(--shadow-xs)] hover:bg-[var(--bg-hover)] hover:text-[var(--md-primary)] hover:border-[var(--border-color-hover)]"
33
+ }, C = {
34
+ xs: r ? "h-3 w-3" : "h-3.5 w-3.5",
35
+ sm: r ? "h-3.5 w-3.5" : "h-4 w-4",
36
+ md: "h-[1.125rem] w-[1.125rem]",
37
+ lg: "h-5 w-5",
38
+ xl: "h-5 w-5"
39
+ }, w = {
40
+ "verde-vibrante": {
41
+ primary: "var(--brand-verde-vibrante)",
42
+ hover: "var(--brand-verde-profundo)"
43
+ },
44
+ "verde-profundo": {
45
+ primary: "var(--brand-verde-profundo)",
46
+ hover: "var(--brand-grafite-azulado)"
47
+ },
48
+ "grafite-azulado": {
49
+ primary: "var(--brand-grafite-azulado)",
50
+ hover: "var(--brand-cinza-escuro)"
51
+ },
52
+ "azul-acinzentado": {
53
+ primary: "var(--brand-azul-acinzentado)",
54
+ hover: "var(--brand-grafite-azulado)"
55
+ },
56
+ "cinza-medio": {
57
+ primary: "var(--brand-cinza-medio)",
58
+ hover: "var(--brand-cinza-escuro)"
59
+ },
60
+ "cinza-escuro": {
61
+ primary: "var(--brand-cinza-escuro)",
62
+ hover: "var(--brand-preto)"
63
+ },
64
+ "off-white": {
65
+ primary: "var(--brand-off-white)",
66
+ hover: "var(--brand-branco)",
67
+ onPrimary: "var(--brand-grafite-azulado)"
68
+ }
69
+ }, y = {};
70
+ l && t === "primary" && (y["--md-primary"] = w[l].primary, y["--primary-color-hover"] = w[l].hover, w[l].onPrimary && (y["--md-on-primary"] = w[l].onPrimary));
71
+ const B = [
72
+ x,
73
+ p,
74
+ N,
75
+ _[a],
76
+ E[t],
77
+ M,
78
+ u,
79
+ g,
80
+ h
81
+ ].filter(Boolean).join(" ");
82
+ return /* @__PURE__ */ v(
18
83
  "button",
19
84
  {
20
- className: v,
21
- disabled: h || s,
22
- ...i,
85
+ className: B,
86
+ disabled: c || o,
87
+ style: { ...y, ...f },
88
+ ...m,
23
89
  children: [
24
- s && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "btn__spinner", children: /* @__PURE__ */ m(
25
- "svg",
90
+ o && /* @__PURE__ */ e(
91
+ "span",
26
92
  {
27
- fill: "none",
28
- stroke: "currentColor",
29
- strokeWidth: "2",
30
- viewBox: "0 0 24 24",
31
- children: [
93
+ "aria-hidden": "true",
94
+ className: "absolute inline-flex h-[1em] w-[1em] animate-spin items-center justify-center",
95
+ children: /* @__PURE__ */ v("svg", { fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: [
32
96
  /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10", strokeOpacity: "0.25" }),
33
97
  /* @__PURE__ */ e("path", { d: "M12 2 A10 10 0 0 1 22 12", strokeLinecap: "round" })
34
- ]
98
+ ] })
35
99
  }
36
- ) }),
37
- !s && r && /* @__PURE__ */ e("span", { className: "btn__icon btn__icon--left", children: r }),
38
- /* @__PURE__ */ e("span", { className: "btn__content", children: o }),
39
- !s && l && /* @__PURE__ */ e("span", { className: "btn__icon btn__icon--right", children: l })
100
+ ),
101
+ !o && s && /* @__PURE__ */ e(
102
+ "span",
103
+ {
104
+ className: `mr-1 inline-flex shrink-0 items-center justify-center leading-none ${C[a]}`,
105
+ children: s
106
+ }
107
+ ),
108
+ !o && /* @__PURE__ */ e("span", { className: "btn__content inline-flex items-center justify-center", children: d }),
109
+ !o && i && /* @__PURE__ */ e(
110
+ "span",
111
+ {
112
+ className: `ml-1 inline-flex shrink-0 items-center justify-center leading-none ${C[a]}`,
113
+ children: i
114
+ }
115
+ )
40
116
  ]
41
117
  }
42
118
  );
43
- }, S = ({
44
- variant: a = "default",
45
- padding: t = "md",
46
- hoverable: n = !1,
47
- children: s,
48
- className: r = "",
49
- ...l
119
+ }, F = ({
120
+ variant: t = "default",
121
+ padding: a = "md",
122
+ hoverable: r = !1,
123
+ children: n,
124
+ className: o = "",
125
+ ...s
50
126
  }) => {
51
- const o = "card", d = `card--${a}`, h = `card--padding-${t}`, i = `${o} ${d} ${h} ${n ? "card--hoverable" : ""} ${r}`.trim();
52
- return /* @__PURE__ */ e("div", { className: i, ...l, children: s });
53
- }, T = ({
54
- poweredByText: a = "Powered by",
55
- logoSrc: t,
56
- logoAlt: n = "Logo",
57
- logoFallbackText: s,
58
- className: r = ""
59
- }) => /* @__PURE__ */ e("footer", { className: `app-footer ${r}`.trim(), children: /* @__PURE__ */ m("div", { className: "app-footer-powered", children: [
60
- a && /* @__PURE__ */ e("span", { className: "app-footer-powered-text", children: a }),
61
- (t || s) && /* @__PURE__ */ m("div", { className: "app-footer-logo-wrap", children: [
62
- t && /* @__PURE__ */ e(
63
- "img",
64
- {
65
- alt: n,
66
- className: "app-footer-logo",
67
- onError: (l) => {
68
- l.target.style.display = "none";
69
- const o = l.target.nextElementSibling;
70
- o && (o.style.display = "flex");
71
- },
72
- src: t
73
- }
74
- ),
75
- s && /* @__PURE__ */ e(
76
- "span",
77
- {
78
- className: "app-footer-logo-fallback",
79
- style: { display: t ? "none" : "flex" },
80
- children: s
81
- }
82
- )
83
- ] })
84
- ] }) }), N = () => typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light", P = ({
127
+ const i = "relative overflow-hidden rounded-[var(--border-radius-lg)] transition-[var(--transition-all)]", d = {
128
+ default: "bg-[var(--md-surface)] border border-[var(--md-outline-variant)] shadow-[var(--shadow-sm)]",
129
+ elevated: "bg-[var(--md-surface)] border border-[var(--md-outline-variant)] shadow-[var(--shadow-lg)]",
130
+ outlined: "bg-transparent border border-[var(--md-outline-variant)] shadow-none",
131
+ flat: "bg-[var(--md-surface)] border-0 shadow-none"
132
+ }, h = {
133
+ none: "p-0",
134
+ sm: "p-[var(--spacing-md)]",
135
+ md: "p-[var(--spacing-lg)]",
136
+ lg: "p-[var(--spacing-xl)]",
137
+ xl: "p-[var(--spacing-2xl)]"
138
+ }, c = r ? "hover:shadow-[var(--shadow-md)]" : "", l = [
139
+ i,
140
+ d[t],
141
+ h[a],
142
+ c,
143
+ o
144
+ ].filter(Boolean).join(" ");
145
+ return /* @__PURE__ */ e("div", { className: l, ...s, children: n });
146
+ }, A = ({
147
+ poweredByText: t = "Powered by",
85
148
  logoSrc: a,
86
- logoDarkSrc: t,
87
- logoAlt: n = "Logo",
88
- title: s,
89
- subtitle: r,
90
- theme: l,
91
- onLogoClick: o,
149
+ logoAlt: r = "Logo",
150
+ logoFallbackText: n,
151
+ className: o = ""
152
+ }) => {
153
+ const [s, i] = z(!0);
154
+ return /* @__PURE__ */ e(
155
+ "footer",
156
+ {
157
+ className: [
158
+ "relative z-[1] flex w-full shrink-0 items-center justify-center border-t border-[var(--border-color)] bg-[var(--bg-secondary)] px-[var(--spacing-2xl)] py-[var(--spacing-lg)]",
159
+ o
160
+ ].filter(Boolean).join(" "),
161
+ children: /* @__PURE__ */ v("div", { className: "flex items-center gap-[var(--spacing-md)]", children: [
162
+ t && /* @__PURE__ */ e("span", { className: "text-[0.95rem] font-normal text-[var(--text-secondary)]", children: t }),
163
+ (a || n) && /* @__PURE__ */ v("div", { className: "flex items-center", children: [
164
+ a && s && /* @__PURE__ */ e(
165
+ "img",
166
+ {
167
+ alt: r,
168
+ className: "h-6 w-auto object-contain",
169
+ onError: (d) => {
170
+ i(!1);
171
+ },
172
+ src: a,
173
+ style: {
174
+ filter: "brightness(0)"
175
+ }
176
+ }
177
+ ),
178
+ n && /* @__PURE__ */ e(
179
+ "span",
180
+ {
181
+ className: "flex items-center text-base font-bold tracking-[0.1em] text-[var(--md-primary)]",
182
+ style: {
183
+ display: a && s ? "none" : "flex",
184
+ fontFamily: '"Orbitron", sans-serif'
185
+ },
186
+ children: n
187
+ }
188
+ )
189
+ ] })
190
+ ] })
191
+ }
192
+ );
193
+ }, k = () => typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light", V = ({
194
+ logoSrc: t,
195
+ logoDarkSrc: a,
196
+ logoAlt: r = "Logo",
197
+ title: n,
198
+ subtitle: o,
199
+ theme: s,
200
+ onLogoClick: i,
92
201
  rightContent: d,
93
202
  className: h = ""
94
203
  }) => {
95
- const [p, i] = y(!1), [u, c] = y(
96
- () => l ?? N()
97
- ), b = u === "dark" && t ? t : a;
98
- C(() => {
99
- const $ = () => i(window.scrollY > 10);
100
- return window.addEventListener("scroll", $, { passive: !0 }), () => window.removeEventListener("scroll", $);
101
- }, []), C(() => {
102
- if (l) {
103
- c(l);
204
+ const [c, l] = z(!1), [f, m] = z(
205
+ () => s ?? k()
206
+ ), x = f === "dark" && a ? a : t;
207
+ b(() => {
208
+ const u = () => l(window.scrollY > 10);
209
+ return window.addEventListener("scroll", u, { passive: !0 }), () => window.removeEventListener("scroll", u);
210
+ }, []), b(() => {
211
+ if (s) {
212
+ m(s);
104
213
  return;
105
214
  }
106
- const $ = () => c(N());
107
- if ($(), typeof MutationObserver > "u")
215
+ const u = () => m(k());
216
+ if (u(), typeof MutationObserver > "u")
108
217
  return;
109
- const v = new MutationObserver($);
110
- return v.observe(document.documentElement, {
218
+ const g = new MutationObserver(u);
219
+ return g.observe(document.documentElement, {
111
220
  attributes: !0,
112
221
  attributeFilter: ["data-theme"]
113
- }), () => v.disconnect();
114
- }, [l]);
115
- const f = () => o?.(), g = ($) => {
116
- $.key === "Enter" && o?.();
222
+ }), () => g.disconnect();
223
+ }, [s]);
224
+ const p = () => i?.(), N = (u) => {
225
+ u.key === "Enter" && i?.();
117
226
  };
118
- return /* @__PURE__ */ m(
227
+ return /* @__PURE__ */ v(
119
228
  "header",
120
229
  {
121
- className: `app-header ${p ? "scrolled" : ""} ${h}`.trim(),
230
+ className: [
231
+ "fixed inset-x-0 top-0 z-[1000] w-full backdrop-blur-[12px]",
232
+ h
233
+ ].filter(Boolean).join(" "),
122
234
  children: [
123
- /* @__PURE__ */ e("div", { className: "app-header-top-bar" }),
124
- /* @__PURE__ */ m("div", { className: "app-header-content", children: [
125
- /* @__PURE__ */ m(
126
- "div",
127
- {
128
- className: "app-header-left",
129
- onClick: o ? f : void 0,
130
- onKeyDown: o ? g : void 0,
131
- role: o ? "button" : void 0,
132
- tabIndex: o ? 0 : void 0,
133
- children: [
134
- b && /* @__PURE__ */ m("div", { className: "app-header-logo", children: [
135
- /* @__PURE__ */ e(
136
- "img",
137
- {
138
- alt: n,
139
- onError: ($) => {
140
- $.target.style.display = "none";
141
- const v = $.target.nextElementSibling;
142
- v && (v.style.display = "block");
143
- },
144
- src: b
145
- }
146
- ),
147
- /* @__PURE__ */ m(
148
- "svg",
149
- {
150
- className: "logo-icon-fallback",
151
- fill: "none",
152
- stroke: "currentColor",
153
- strokeWidth: "2",
154
- viewBox: "0 0 24 24",
155
- children: [
156
- /* @__PURE__ */ e("path", { d: "M12 2L2 7l10 5 10-5-10-5z" }),
157
- /* @__PURE__ */ e("path", { d: "M2 17l10 5 10-5M2 12l10 5 10-5" })
158
- ]
159
- }
160
- )
161
- ] }),
162
- (s || r) && /* @__PURE__ */ m("div", { className: "app-header-title", children: [
163
- s && /* @__PURE__ */ e("h1", { children: s }),
164
- r && /* @__PURE__ */ e("p", { children: r })
165
- ] })
166
- ]
167
- }
168
- ),
169
- d && /* @__PURE__ */ e("div", { className: "app-header-right", children: d })
170
- ] })
235
+ /* @__PURE__ */ e("div", { className: "h-0.5 w-full bg-[var(--md-primary)]" }),
236
+ /* @__PURE__ */ v(
237
+ "div",
238
+ {
239
+ className: "flex items-center justify-between px-6 py-2 shadow-[var(--shadow-sm)] max-md:flex-col max-md:gap-3 max-md:px-4 max-md:py-3",
240
+ style: {
241
+ color: "var(--md-on-surface)",
242
+ background: `color-mix(in srgb, var(--md-surface) ${c ? "14%" : "18%"}, transparent)`,
243
+ borderBottom: `1px solid color-mix(in srgb, var(--md-outline-variant) ${c ? "22%" : "30%"}, transparent)`
244
+ },
245
+ children: [
246
+ /* @__PURE__ */ v(
247
+ "div",
248
+ {
249
+ className: "flex cursor-pointer items-center gap-3 transition-opacity duration-200 ease-in-out hover:opacity-80",
250
+ onClick: i ? p : void 0,
251
+ onKeyDown: i ? N : void 0,
252
+ role: i ? "button" : void 0,
253
+ tabIndex: i ? 0 : void 0,
254
+ children: [
255
+ x && /* @__PURE__ */ v("div", { className: "flex h-16 w-16 shrink-0 items-center justify-center", children: [
256
+ /* @__PURE__ */ e(
257
+ "img",
258
+ {
259
+ alt: r,
260
+ className: "h-full w-full object-contain",
261
+ onError: (u) => {
262
+ u.target.style.display = "none";
263
+ const g = u.target.nextElementSibling;
264
+ g && (g.style.display = "block");
265
+ },
266
+ src: x
267
+ }
268
+ ),
269
+ /* @__PURE__ */ v(
270
+ "svg",
271
+ {
272
+ className: "hidden h-full w-full",
273
+ fill: "none",
274
+ stroke: "currentColor",
275
+ strokeWidth: "2",
276
+ viewBox: "0 0 24 24",
277
+ children: [
278
+ /* @__PURE__ */ e("path", { d: "M12 2L2 7l10 5 10-5-10-5z" }),
279
+ /* @__PURE__ */ e("path", { d: "M2 17l10 5 10-5M2 12l10 5 10-5" })
280
+ ]
281
+ }
282
+ )
283
+ ] }),
284
+ (n || o) && /* @__PURE__ */ v("div", { className: "flex flex-col gap-1", children: [
285
+ n && /* @__PURE__ */ e(
286
+ "h1",
287
+ {
288
+ className: "m-0 inline-flex items-baseline text-[1.375rem] font-bold leading-[1.2] tracking-[0.05em] text-[var(--md-on-surface)] max-md:text-xl",
289
+ style: { fontFamily: '"Orbitron", sans-serif' },
290
+ children: n
291
+ }
292
+ ),
293
+ o && /* @__PURE__ */ e("p", { className: "m-0 text-[0.8125rem] font-normal text-[var(--md-on-surface-variant)] max-md:text-xs", children: o })
294
+ ] })
295
+ ]
296
+ }
297
+ ),
298
+ d && /* @__PURE__ */ e("div", { className: "flex shrink-0 items-center gap-3 max-md:w-full max-md:flex-wrap max-md:justify-between", children: d })
299
+ ]
300
+ }
301
+ )
171
302
  ]
172
303
  }
173
304
  );
174
- }, W = ({
175
- label: a,
176
- error: t,
177
- helperText: n,
178
- leftIcon: s,
179
- rightIcon: r,
180
- fullWidth: l = !1,
181
- size: o = "md",
305
+ }, K = ({
306
+ label: t,
307
+ error: a,
308
+ helperText: r,
309
+ leftIcon: n,
310
+ rightIcon: o,
311
+ fullWidth: s = !1,
312
+ size: i = "md",
182
313
  className: d = "",
183
314
  id: h,
184
- ...p
315
+ ...c
185
316
  }) => {
186
- const i = h || `input-${Math.random().toString(36).substring(2, 9)}`, u = !!t, c = "input", b = `input--${o}`, x = `${c} ${b} ${u ? "input--error" : ""} ${l ? "input--full-width" : ""} ${s ? "input--has-left-icon" : ""} ${r ? "input--has-right-icon" : ""} ${d}`.trim();
187
- return /* @__PURE__ */ m(
188
- "div",
317
+ const l = h || `input-${Math.random().toString(36).substring(2, 9)}`, f = !!a, x = [
318
+ "w-full rounded-[var(--border-radius-md)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] font-inherit text-[var(--md-on-surface)] outline-none transition-[var(--transition-all)] placeholder:text-[var(--md-on-surface-variant)] placeholder:opacity-70 hover:not-disabled:not-focus:border-[var(--border-color-hover)] focus:border-[var(--border-color-focus)] focus:[box-shadow:0_0_0_0.1875rem_rgba(47,93,140,0.15)] disabled:cursor-not-allowed disabled:bg-[var(--md-surface-container-high)] disabled:opacity-60",
319
+ f ? "border-[var(--md-error)] focus:border-[var(--md-error)] focus:[box-shadow:0_0_0_0.1875rem_rgba(186,26,26,0.2)]" : "",
320
+ n ? "pl-10" : "",
321
+ o ? "pr-10" : "",
189
322
  {
190
- className: `input-wrapper ${l ? "input-wrapper--full-width" : ""}`,
191
- children: [
192
- a && /* @__PURE__ */ e("label", { className: "input-label", htmlFor: i, children: a }),
193
- /* @__PURE__ */ m("div", { className: "input-container", children: [
194
- s && /* @__PURE__ */ e("span", { className: "input-icon input-icon--left", children: s }),
195
- /* @__PURE__ */ e(
196
- "input",
197
- {
198
- "aria-describedby": t ? `${i}-error` : n ? `${i}-helper` : void 0,
199
- "aria-invalid": u ? !0 : void 0,
200
- className: x,
201
- id: i,
202
- ...p
203
- }
204
- ),
205
- r && /* @__PURE__ */ e("span", { className: "input-icon input-icon--right", children: r })
206
- ] }),
207
- t && /* @__PURE__ */ e("span", { className: "input-error", id: `${i}-error`, role: "alert", children: t }),
208
- n && !t && /* @__PURE__ */ e("span", { className: "input-helper", id: `${i}-helper`, children: n })
209
- ]
210
- }
211
- );
212
- }, I = ({
213
- isOpen: a,
214
- onClose: t,
215
- title: n,
216
- subtitle: s,
217
- children: r,
218
- size: l = "md",
219
- showCloseButton: o = !0,
323
+ sm: "min-h-8 px-[var(--spacing-md)] py-[var(--spacing-sm)] text-[var(--font-size-sm)]",
324
+ md: "min-h-10 px-[var(--spacing-lg)] py-[var(--spacing-md)] text-[var(--font-size-base)]",
325
+ lg: "min-h-12 px-[var(--spacing-xl)] py-[var(--spacing-lg)] text-[var(--font-size-lg)]"
326
+ }[i],
327
+ d
328
+ ].filter(Boolean).join(" ");
329
+ return /* @__PURE__ */ v("div", { className: `flex flex-col gap-[var(--spacing-xs)] ${s ? "w-full" : ""}`, children: [
330
+ t && /* @__PURE__ */ e(
331
+ "label",
332
+ {
333
+ className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
334
+ htmlFor: l,
335
+ children: t
336
+ }
337
+ ),
338
+ /* @__PURE__ */ v("div", { className: "group relative flex w-full items-center", children: [
339
+ n && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute left-[var(--spacing-md)] z-[1] flex items-center justify-center text-[var(--md-on-surface-variant)] group-focus-within:text-[var(--md-primary)] [&_svg]:h-[1.125rem] [&_svg]:w-[1.125rem]", children: n }),
340
+ /* @__PURE__ */ e(
341
+ "input",
342
+ {
343
+ "aria-describedby": a ? `${l}-error` : r ? `${l}-helper` : void 0,
344
+ "aria-invalid": f ? !0 : void 0,
345
+ className: x,
346
+ id: l,
347
+ ...c
348
+ }
349
+ ),
350
+ o && /* @__PURE__ */ e("span", { className: "pointer-events-none absolute right-[var(--spacing-md)] z-[1] flex items-center justify-center text-[var(--md-on-surface-variant)] group-focus-within:text-[var(--md-primary)] [&_svg]:h-[1.125rem] [&_svg]:w-[1.125rem]", children: o })
351
+ ] }),
352
+ a && /* @__PURE__ */ e(
353
+ "span",
354
+ {
355
+ className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-error)]",
356
+ id: `${l}-error`,
357
+ role: "alert",
358
+ children: a
359
+ }
360
+ ),
361
+ r && !a && /* @__PURE__ */ e(
362
+ "span",
363
+ {
364
+ className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-on-surface-variant)]",
365
+ id: `${l}-helper`,
366
+ children: r
367
+ }
368
+ )
369
+ ] });
370
+ }, R = ({
371
+ isOpen: t,
372
+ onClose: a,
373
+ title: r,
374
+ subtitle: n,
375
+ children: o,
376
+ size: s = "md",
377
+ showCloseButton: i = !0,
220
378
  closeOnOverlayClick: d = !0,
221
379
  className: h = ""
222
380
  }) => {
223
- if (C(() => (a ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
381
+ if (b(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
224
382
  document.body.style.overflow = "";
225
- }), [a]), C(() => {
226
- const c = (b) => {
227
- b.key === "Escape" && a && t();
383
+ }), [t]), b(() => {
384
+ const m = (x) => {
385
+ x.key === "Escape" && t && a();
228
386
  };
229
- return a && document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
230
- }, [a, t]), !a)
387
+ return t && document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
388
+ }, [t, a]), !t)
231
389
  return null;
232
- const p = (c) => {
233
- d && c.target === c.currentTarget && t();
234
- }, u = `modal ${`modal--${l}`} ${h}`.trim();
390
+ const c = (m) => {
391
+ d && m.target === m.currentTarget && a();
392
+ }, f = [
393
+ "relative z-[var(--z-index-modal)] m-auto flex w-full max-h-[90vh] max-w-full flex-col overflow-hidden rounded-[var(--border-radius-2xl)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] shadow-[var(--shadow-2xl)]",
394
+ {
395
+ sm: "max-w-[25rem]",
396
+ md: "max-w-[31.25rem]",
397
+ lg: "max-w-[43.75rem]",
398
+ xl: "max-w-[56.25rem]",
399
+ full: "max-h-[90vh] max-w-[90vw]"
400
+ }[s],
401
+ h
402
+ ].filter(Boolean).join(" ");
235
403
  return /* @__PURE__ */ e(
236
404
  "div",
237
405
  {
238
- "aria-labelledby": n ? "modal-title" : void 0,
406
+ "aria-labelledby": r ? "modal-title" : void 0,
239
407
  "aria-modal": "true",
240
- className: "modal-overlay",
241
- onClick: p,
408
+ className: "fixed inset-0 z-[var(--z-index-modal-backdrop)] flex min-h-[100dvh] items-center justify-center overflow-y-auto bg-black/50 p-[var(--spacing-lg)] backdrop-blur-[8px]",
409
+ onClick: c,
242
410
  role: "dialog",
243
- children: /* @__PURE__ */ m("div", { className: u, children: [
244
- (n || s || o) && /* @__PURE__ */ m("div", { className: "modal-header", children: [
245
- (n || s) && /* @__PURE__ */ m("div", { className: "modal-header-content", children: [
246
- n && /* @__PURE__ */ e("h2", { className: "modal-title", id: "modal-title", children: n }),
247
- s && /* @__PURE__ */ e("p", { className: "modal-subtitle", children: s })
411
+ children: /* @__PURE__ */ v("div", { className: f, children: [
412
+ (r || n || i) && /* @__PURE__ */ v("div", { className: "flex shrink-0 items-start justify-between gap-[var(--spacing-lg)] border-b border-[var(--md-outline-variant)] p-[var(--spacing-2xl)]", children: [
413
+ (r || n) && /* @__PURE__ */ v("div", { className: "flex-1", children: [
414
+ r && /* @__PURE__ */ e(
415
+ "h2",
416
+ {
417
+ className: "mb-[var(--spacing-xs)] mt-0 text-[var(--font-size-2xl)] font-[var(--font-weight-semibold)] leading-[var(--line-height-tight)] text-[var(--md-on-surface)]",
418
+ id: "modal-title",
419
+ children: r
420
+ }
421
+ ),
422
+ n && /* @__PURE__ */ e("p", { className: "m-0 text-[var(--font-size-base)] leading-[var(--line-height-normal)] text-[var(--md-on-surface-variant)]", children: n })
248
423
  ] }),
249
- o && /* @__PURE__ */ e(
424
+ i && /* @__PURE__ */ e(
250
425
  "button",
251
426
  {
252
427
  "aria-label": "Fechar modal",
253
- className: "modal-close",
254
- onClick: t,
428
+ className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-[var(--border-radius-md)] border-0 bg-[var(--md-surface-container-high)] text-[var(--md-on-surface)] transition-[var(--transition-all)] hover:bg-[color:color-mix(in_srgb,var(--md-error)_15%,var(--md-surface))] hover:text-[var(--md-error)]",
429
+ onClick: a,
255
430
  type: "button",
256
- children: /* @__PURE__ */ m(
431
+ children: /* @__PURE__ */ v(
257
432
  "svg",
258
433
  {
259
434
  fill: "none",
435
+ className: "h-5 w-5",
260
436
  stroke: "currentColor",
261
437
  strokeWidth: "2",
262
438
  viewBox: "0 0 24 24",
@@ -269,75 +445,149 @@ const M = ({
269
445
  }
270
446
  )
271
447
  ] }),
272
- /* @__PURE__ */ e("div", { className: "modal-content", children: r })
448
+ /* @__PURE__ */ e("div", { className: "flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto p-[var(--spacing-2xl)]", children: o })
273
449
  ] })
274
450
  }
275
451
  );
276
- }, R = ({
277
- as: a = "p",
278
- size: t = "md",
279
- weight: n = "normal",
280
- align: s = "left",
281
- muted: r = !1,
282
- children: l,
283
- className: o = "",
284
- ...d
452
+ }, D = ({
453
+ as: t = "p",
454
+ size: a = "md",
455
+ weight: r = "normal",
456
+ align: n = "left",
457
+ muted: o = !1,
458
+ italic: s = !1,
459
+ children: i,
460
+ className: d = "",
461
+ ...h
285
462
  }) => {
286
- const h = a, p = "paragraph", i = `paragraph--${t}`, u = `paragraph--${n}`, c = `paragraph--align-${s}`, f = `${p} ${i} ${u} ${c} ${r ? "paragraph--muted" : ""} ${o}`.trim();
287
- return /* @__PURE__ */ e(h, { className: f, ...d, children: l });
288
- }, A = ({
289
- as: a = "p",
290
- size: t = "md",
291
- weight: n = "normal",
292
- align: s = "left",
293
- muted: r = !1,
294
- children: l,
295
- className: o = "",
296
- ...d
463
+ const c = t, l = {
464
+ xs: "text-[var(--font-size-xs)] leading-[var(--line-height-normal)]",
465
+ sm: "text-[var(--font-size-sm)] leading-[var(--line-height-normal)]",
466
+ md: "text-[var(--font-size-base)] leading-[var(--line-height-relaxed)]",
467
+ lg: "text-[var(--font-size-lg)] leading-[var(--line-height-loose)]"
468
+ }, f = {
469
+ light: "font-[var(--font-weight-light)]",
470
+ normal: "font-[var(--font-weight-normal)]",
471
+ medium: "font-[var(--font-weight-medium)]"
472
+ }, m = {
473
+ left: "text-left",
474
+ center: "text-center",
475
+ right: "text-right",
476
+ justify: "text-justify"
477
+ }, x = [
478
+ "m-0 text-[var(--text-primary)] transition-[var(--transition-colors)]",
479
+ l[a],
480
+ f[r],
481
+ m[n],
482
+ s ? "italic" : "not-italic",
483
+ o ? "text-[var(--text-muted)]" : "",
484
+ d
485
+ ].filter(Boolean).join(" ");
486
+ return /* @__PURE__ */ e(c, { className: x, ...h, children: i });
487
+ }, H = ({
488
+ as: t = "p",
489
+ size: a = "md",
490
+ weight: r = "normal",
491
+ align: n = "left",
492
+ muted: o = !1,
493
+ italic: s = !1,
494
+ children: i,
495
+ className: d = "",
496
+ ...h
297
497
  }) => {
298
- const h = a, p = "subtitle", i = `subtitle--${t}`, u = `subtitle--${n}`, c = `subtitle--align-${s}`, f = `${p} ${i} ${u} ${c} ${r ? "subtitle--muted" : ""} ${o}`.trim();
299
- return /* @__PURE__ */ e(h, { className: f, ...d, children: l });
300
- }, j = ({
301
- as: a = "h1",
302
- size: t = "2xl",
303
- weight: n = "bold",
304
- align: s = "left",
305
- gradient: r = !1,
306
- children: l,
307
- className: o = "",
308
- ...d
498
+ const c = t, l = {
499
+ xs: "text-[var(--font-size-xs)]",
500
+ sm: "text-[var(--font-size-sm)]",
501
+ md: "text-[var(--font-size-base)]",
502
+ lg: "text-[var(--font-size-lg)]"
503
+ }, f = {
504
+ normal: "font-[var(--font-weight-normal)]",
505
+ medium: "font-[var(--font-weight-medium)]",
506
+ semibold: "font-[var(--font-weight-semibold)]"
507
+ }, m = {
508
+ left: "text-left",
509
+ center: "text-center",
510
+ right: "text-right"
511
+ }, x = [
512
+ "m-0 leading-[var(--line-height-normal)] text-[var(--text-secondary)] transition-[var(--transition-colors)]",
513
+ l[a],
514
+ f[r],
515
+ m[n],
516
+ s ? "italic" : "not-italic",
517
+ o ? "text-[var(--text-muted)] opacity-80" : "",
518
+ d
519
+ ].filter(Boolean).join(" ");
520
+ return /* @__PURE__ */ e(c, { className: x, ...h, children: i });
521
+ }, O = ({
522
+ as: t = "h1",
523
+ size: a = "2xl",
524
+ weight: r = "bold",
525
+ align: n = "left",
526
+ gradient: o = !1,
527
+ italic: s = !1,
528
+ children: i,
529
+ className: d = "",
530
+ ...h
309
531
  }) => {
310
- const h = a, p = "title", i = `title--${t}`, u = `title--${n}`, c = `title--align-${s}`, f = `${p} ${i} ${u} ${c} ${r ? "title--gradient" : ""} ${o}`.trim();
311
- return /* @__PURE__ */ e(h, { className: f, ...d, children: l });
312
- }, w = E(void 0), B = () => {
313
- const a = k(w);
314
- if (!a)
532
+ const c = t, l = {
533
+ xs: "text-[var(--font-size-sm)]",
534
+ sm: "text-[var(--font-size-base)]",
535
+ md: "text-[var(--font-size-lg)]",
536
+ lg: "text-[var(--font-size-xl)]",
537
+ xl: "text-[var(--font-size-2xl)]",
538
+ "2xl": "text-[var(--font-size-3xl)]",
539
+ "3xl": "text-[var(--font-size-4xl)]",
540
+ "4xl": "text-[3rem]"
541
+ }, f = {
542
+ light: "font-[var(--font-weight-light)]",
543
+ normal: "font-[var(--font-weight-normal)]",
544
+ medium: "font-[var(--font-weight-medium)]",
545
+ semibold: "font-[var(--font-weight-semibold)]",
546
+ bold: "font-[var(--font-weight-bold)]",
547
+ extrabold: "font-extrabold"
548
+ }, m = {
549
+ left: "text-left",
550
+ center: "text-center",
551
+ right: "text-right"
552
+ }, x = o ? "bg-[linear-gradient(135deg,var(--text-primary)_0%,var(--primary-color)_50%,var(--secondary-color)_100%)] bg-clip-text text-transparent" : "", p = [
553
+ "m-0 leading-[var(--line-height-tight)] text-[var(--text-primary)] transition-[var(--transition-colors)]",
554
+ l[a],
555
+ f[r],
556
+ m[n],
557
+ s ? "italic" : "not-italic",
558
+ x,
559
+ d
560
+ ].filter(Boolean).join(" ");
561
+ return /* @__PURE__ */ e(c, { className: p, ...h, children: i });
562
+ }, j = P(void 0), Y = () => {
563
+ const t = $(j);
564
+ if (!t)
315
565
  throw new Error("useTheme must be used within a ThemeProvider");
316
- return a;
317
- }, F = ({
318
- children: a,
319
- defaultTheme: t = "light"
566
+ return t;
567
+ }, q = ({
568
+ children: t,
569
+ defaultTheme: a = "light"
320
570
  }) => {
321
- const [n, s] = y(() => typeof window > "u" ? t : window.localStorage.getItem("theme") || t);
322
- C(() => {
323
- typeof window > "u" || (window.localStorage.setItem("theme", n), document.documentElement.setAttribute("data-theme", n));
324
- }, [n]);
325
- const r = () => {
326
- s((l) => l === "dark" ? "light" : "dark");
571
+ const [r, n] = z(() => typeof window > "u" ? a : window.localStorage.getItem("theme") || a);
572
+ b(() => {
573
+ typeof window > "u" || (window.localStorage.setItem("theme", r), document.documentElement.setAttribute("data-theme", r));
574
+ }, [r]);
575
+ const o = () => {
576
+ n((s) => s === "dark" ? "light" : "dark");
327
577
  };
328
- return /* @__PURE__ */ e(w.Provider, { value: { theme: n, toggleTheme: r }, children: a });
578
+ return /* @__PURE__ */ e(j.Provider, { value: { theme: r, toggleTheme: o }, children: t });
329
579
  };
330
580
  export {
331
- M as Button,
332
- S as Card,
333
- T as Footer,
334
- P as Header,
335
- W as Input,
336
- I as Modal,
337
- R as Paragraph,
338
- A as Subtitle,
339
- F as ThemeProvider,
340
- j as Title,
341
- B as useTheme
581
+ W as Button,
582
+ F as Card,
583
+ A as Footer,
584
+ V as Header,
585
+ K as Input,
586
+ R as Modal,
587
+ D as Paragraph,
588
+ H as Subtitle,
589
+ q as ThemeProvider,
590
+ O as Title,
591
+ Y as useTheme
342
592
  };
343
593
  //# sourceMappingURL=oficios-ui.js.map