@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.
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +0 -1
- package/dist/components/Footer/Footer.d.ts +0 -1
- package/dist/components/Header/Header.d.ts +0 -1
- package/dist/components/Input/Input.d.ts +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -1
- package/dist/components/Paragraph/Paragraph.d.ts +1 -1
- package/dist/components/Subtitle/Subtitle.d.ts +1 -1
- package/dist/components/Title/Title.d.ts +1 -1
- package/dist/oficios-ui.css +1 -1
- package/dist/oficios-ui.js +516 -266
- package/dist/oficios-ui.js.map +1 -1
- package/dist/oficios-ui.umd.cjs +1 -1
- package/dist/oficios-ui.umd.cjs.map +1 -1
- package/dist/theme.css +1 -0
- package/package.json +1 -1
package/dist/oficios-ui.js
CHANGED
|
@@ -1,262 +1,438 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
4
|
-
variant:
|
|
5
|
-
size:
|
|
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:
|
|
8
|
-
leftIcon:
|
|
9
|
-
rightIcon:
|
|
10
|
-
children:
|
|
11
|
-
className:
|
|
12
|
-
disabled:
|
|
13
|
-
palette:
|
|
14
|
-
|
|
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
|
|
17
|
-
|
|
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:
|
|
21
|
-
disabled:
|
|
22
|
-
...
|
|
85
|
+
className: B,
|
|
86
|
+
disabled: c || o,
|
|
87
|
+
style: { ...y, ...f },
|
|
88
|
+
...m,
|
|
23
89
|
children: [
|
|
24
|
-
|
|
25
|
-
"
|
|
90
|
+
o && /* @__PURE__ */ e(
|
|
91
|
+
"span",
|
|
26
92
|
{
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
!
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
},
|
|
44
|
-
variant:
|
|
45
|
-
padding:
|
|
46
|
-
hoverable:
|
|
47
|
-
children:
|
|
48
|
-
className:
|
|
49
|
-
...
|
|
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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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 [
|
|
96
|
-
() =>
|
|
97
|
-
),
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
return window.addEventListener("scroll",
|
|
101
|
-
}, []),
|
|
102
|
-
if (
|
|
103
|
-
|
|
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
|
|
107
|
-
if (
|
|
215
|
+
const u = () => m(k());
|
|
216
|
+
if (u(), typeof MutationObserver > "u")
|
|
108
217
|
return;
|
|
109
|
-
const
|
|
110
|
-
return
|
|
218
|
+
const g = new MutationObserver(u);
|
|
219
|
+
return g.observe(document.documentElement, {
|
|
111
220
|
attributes: !0,
|
|
112
221
|
attributeFilter: ["data-theme"]
|
|
113
|
-
}), () =>
|
|
114
|
-
}, [
|
|
115
|
-
const
|
|
116
|
-
|
|
222
|
+
}), () => g.disconnect();
|
|
223
|
+
}, [s]);
|
|
224
|
+
const p = () => i?.(), N = (u) => {
|
|
225
|
+
u.key === "Enter" && i?.();
|
|
117
226
|
};
|
|
118
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ v(
|
|
119
228
|
"header",
|
|
120
229
|
{
|
|
121
|
-
className:
|
|
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: "
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
},
|
|
175
|
-
label:
|
|
176
|
-
error:
|
|
177
|
-
helperText:
|
|
178
|
-
leftIcon:
|
|
179
|
-
rightIcon:
|
|
180
|
-
fullWidth:
|
|
181
|
-
size:
|
|
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
|
-
...
|
|
315
|
+
...c
|
|
185
316
|
}) => {
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
"
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
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 (
|
|
381
|
+
if (b(() => (t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
224
382
|
document.body.style.overflow = "";
|
|
225
|
-
}), [
|
|
226
|
-
const
|
|
227
|
-
|
|
383
|
+
}), [t]), b(() => {
|
|
384
|
+
const m = (x) => {
|
|
385
|
+
x.key === "Escape" && t && a();
|
|
228
386
|
};
|
|
229
|
-
return
|
|
230
|
-
}, [
|
|
387
|
+
return t && document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
388
|
+
}, [t, a]), !t)
|
|
231
389
|
return null;
|
|
232
|
-
const
|
|
233
|
-
d &&
|
|
234
|
-
},
|
|
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":
|
|
406
|
+
"aria-labelledby": r ? "modal-title" : void 0,
|
|
239
407
|
"aria-modal": "true",
|
|
240
|
-
className: "modal-
|
|
241
|
-
onClick:
|
|
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__ */
|
|
244
|
-
(
|
|
245
|
-
(
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
424
|
+
i && /* @__PURE__ */ e(
|
|
250
425
|
"button",
|
|
251
426
|
{
|
|
252
427
|
"aria-label": "Fechar modal",
|
|
253
|
-
className: "
|
|
254
|
-
onClick:
|
|
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__ */
|
|
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: "
|
|
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
|
-
},
|
|
277
|
-
as:
|
|
278
|
-
size:
|
|
279
|
-
weight:
|
|
280
|
-
align:
|
|
281
|
-
muted:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
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
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
|
317
|
-
},
|
|
318
|
-
children:
|
|
319
|
-
defaultTheme:
|
|
566
|
+
return t;
|
|
567
|
+
}, q = ({
|
|
568
|
+
children: t,
|
|
569
|
+
defaultTheme: a = "light"
|
|
320
570
|
}) => {
|
|
321
|
-
const [
|
|
322
|
-
|
|
323
|
-
typeof window > "u" || (window.localStorage.setItem("theme",
|
|
324
|
-
}, [
|
|
325
|
-
const
|
|
326
|
-
|
|
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(
|
|
578
|
+
return /* @__PURE__ */ e(j.Provider, { value: { theme: r, toggleTheme: o }, children: t });
|
|
329
579
|
};
|
|
330
580
|
export {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|