@sbkbs/ui 1.0.3 → 1.0.4
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/Accordion/Accordion.js +56 -0
- package/dist/components/Accordion/Accordion.js.map +1 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +7 -0
- package/dist/components/Alert/Alert.js +32 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/Alert.stories.d.ts +8 -0
- package/dist/components/Badge/Badge.js +35 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/Badge.stories.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +26 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -0
- package/dist/components/Button/Button.js +122 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Card/Card.js +33 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.stories.d.ts +8 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.js +36 -0
- package/dist/components/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +7 -0
- package/dist/components/Chip/Chip.js +19 -0
- package/dist/components/Chip/Chip.js.map +1 -0
- package/dist/components/Combobox/Combobox.d.ts +17 -0
- package/dist/components/Combobox/Combobox.js +143 -0
- package/dist/components/Combobox/Combobox.js.map +1 -0
- package/dist/components/Combobox/Combobox.stories.d.ts +9 -0
- package/dist/components/Divider/Divider.js +22 -0
- package/dist/components/Divider/Divider.js.map +1 -0
- package/dist/components/EmptyState/EmptyState.js +29 -0
- package/dist/components/EmptyState/EmptyState.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.d.ts +13 -0
- package/dist/components/FileUpload/FileUpload.js +116 -0
- package/dist/components/FileUpload/FileUpload.js.map +1 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts +10 -0
- package/dist/components/Footer/Footer.js +54 -0
- package/dist/components/Footer/Footer.js.map +1 -0
- package/dist/components/Header/Header.js +114 -0
- package/dist/components/Header/Header.js.map +1 -0
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +78 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/Input.stories.d.ts +9 -0
- package/dist/components/Layout/Layout.js +41 -0
- package/dist/components/Layout/Layout.js.map +1 -0
- package/dist/components/Modal/Modal.js +113 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/Modal.stories.d.ts +8 -0
- package/dist/components/Navigation/Navigation.js +26 -0
- package/dist/components/Navigation/Navigation.js.map +1 -0
- package/dist/components/NumberInput/NumberInput.d.ts +12 -0
- package/dist/components/NumberInput/NumberInput.js +135 -0
- package/dist/components/NumberInput/NumberInput.js.map +1 -0
- package/dist/components/NumberInput/NumberInput.stories.d.ts +8 -0
- package/dist/components/PageHeader/PageHeader.js +29 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/Pagination/Pagination.js +50 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +8 -0
- package/dist/components/Paragraph/Paragraph.js +41 -0
- package/dist/components/Paragraph/Paragraph.js.map +1 -0
- package/dist/components/Popover/Popover.js +57 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Radio/Radio.js +36 -0
- package/dist/components/Radio/Radio.js.map +1 -0
- package/dist/components/Radio/Radio.stories.d.ts +7 -0
- package/dist/components/SectionHeader/SectionHeader.js +19 -0
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -0
- package/dist/components/Select/Select.d.ts +2 -2
- package/dist/components/Select/Select.js +45 -0
- package/dist/components/Select/Select.js.map +1 -0
- package/dist/components/Select/Select.stories.d.ts +8 -0
- package/dist/components/Skeleton/Skeleton.js +25 -0
- package/dist/components/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/Stepper/Stepper.d.ts +13 -0
- package/dist/components/Stepper/Stepper.js +97 -0
- package/dist/components/Stepper/Stepper.js.map +1 -0
- package/dist/components/Stepper/Stepper.stories.d.ts +8 -0
- package/dist/components/Subtitle/Subtitle.js +40 -0
- package/dist/components/Subtitle/Subtitle.js.map +1 -0
- package/dist/components/Switch/Switch.d.ts +2 -2
- package/dist/components/Switch/Switch.js +37 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/Switch.stories.d.ts +8 -0
- package/dist/components/Table/Table.js +17 -0
- package/dist/components/Table/Table.js.map +1 -0
- package/dist/components/Tabs/Tabs.js +62 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +8 -0
- package/dist/components/Tag/Tag.js +29 -0
- package/dist/components/Tag/Tag.js.map +1 -0
- package/dist/components/Textarea/Textarea.d.ts +2 -2
- package/dist/components/Textarea/Textarea.js +46 -0
- package/dist/components/Textarea/Textarea.js.map +1 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +7 -0
- package/dist/components/Title/Title.js +47 -0
- package/dist/components/Title/Title.js.map +1 -0
- package/dist/components/Toast/Toast.js +110 -0
- package/dist/components/Toast/Toast.js.map +1 -0
- package/dist/components/Toast/Toast.stories.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.js +36 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +88 -0
- package/dist/index.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2925 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/oficios-ui.umd.cjs +1 -1
- package/dist/oficios-ui.umd.cjs.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +1 -1
- package/dist/theme/ThemeProvider.js +22 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme.css +54 -64
- package/dist/ui.css +1 -0
- package/dist/utils/cn.d.ts +7 -1
- package/dist/utils/cn.js +7 -0
- package/dist/utils/cn.js.map +1 -0
- package/package.json +42 -9
- package/dist/oficios-ui.css +0 -1
- package/dist/oficios-ui.js +0 -1386
- package/dist/oficios-ui.js.map +0 -1
package/dist/oficios-ui.js
DELETED
|
@@ -1,1386 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useState as N, useRef as z, useEffect as w, useId as B, useCallback as S, useMemo as R, useContext as _, createContext as A, isValidElement as K } from "react";
|
|
3
|
-
const f = (...e) => e.filter(Boolean).join(" "), V = ({ items: e, defaultOpenId: r }) => {
|
|
4
|
-
const [a, n] = N(r ?? null), o = z(null);
|
|
5
|
-
return /* @__PURE__ */ t("div", { className: "grid gap-2", ref: o, children: e.map((s) => {
|
|
6
|
-
const d = a === s.id, v = `accordion-trigger-${s.id}`, c = `accordion-panel-${s.id}`;
|
|
7
|
-
return /* @__PURE__ */ m(
|
|
8
|
-
"div",
|
|
9
|
-
{
|
|
10
|
-
className: "overflow-hidden rounded-[var(--border-radius-md)] border border-[var(--border-color)]",
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ m(
|
|
13
|
-
"button",
|
|
14
|
-
{
|
|
15
|
-
"aria-controls": c,
|
|
16
|
-
"aria-expanded": d,
|
|
17
|
-
className: "flex w-full items-center justify-between bg-[var(--bg-secondary)] px-4 py-3 text-left text-sm font-medium text-[var(--text-primary)] hover:bg-[var(--bg-hover)]",
|
|
18
|
-
id: v,
|
|
19
|
-
onKeyDown: (i) => {
|
|
20
|
-
var h, b, g, y;
|
|
21
|
-
if (!o.current)
|
|
22
|
-
return;
|
|
23
|
-
const l = Array.from(
|
|
24
|
-
o.current.querySelectorAll(
|
|
25
|
-
'[id^="accordion-trigger-"]'
|
|
26
|
-
)
|
|
27
|
-
), u = l.findIndex((x) => x.id === v);
|
|
28
|
-
u === -1 || l.length === 0 || (i.key === "ArrowDown" ? (i.preventDefault(), (h = l[(u + 1) % l.length]) == null || h.focus()) : i.key === "ArrowUp" ? (i.preventDefault(), (b = l[(u - 1 + l.length) % l.length]) == null || b.focus()) : i.key === "Home" ? (i.preventDefault(), (g = l[0]) == null || g.focus()) : i.key === "End" && (i.preventDefault(), (y = l[l.length - 1]) == null || y.focus()));
|
|
29
|
-
},
|
|
30
|
-
onClick: () => n((i) => i === s.id ? null : s.id),
|
|
31
|
-
type: "button",
|
|
32
|
-
children: [
|
|
33
|
-
s.title,
|
|
34
|
-
/* @__PURE__ */ t("span", { className: f("transition", d ? "rotate-180" : ""), children: "⌄" })
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
d && /* @__PURE__ */ t(
|
|
39
|
-
"div",
|
|
40
|
-
{
|
|
41
|
-
"aria-labelledby": v,
|
|
42
|
-
className: "bg-[var(--bg-tertiary)] px-4 py-3 text-sm text-[var(--text-secondary)]",
|
|
43
|
-
id: c,
|
|
44
|
-
role: "region",
|
|
45
|
-
children: s.content
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
]
|
|
49
|
-
},
|
|
50
|
-
s.id
|
|
51
|
-
);
|
|
52
|
-
}) });
|
|
53
|
-
}, W = ({
|
|
54
|
-
variant: e = "primary",
|
|
55
|
-
size: r = "md",
|
|
56
|
-
compact: a = !1,
|
|
57
|
-
fullWidth: n = !1,
|
|
58
|
-
isLoading: o = !1,
|
|
59
|
-
leftIcon: s,
|
|
60
|
-
rightIcon: d,
|
|
61
|
-
children: v,
|
|
62
|
-
className: c = "",
|
|
63
|
-
disabled: i,
|
|
64
|
-
palette: l,
|
|
65
|
-
style: u,
|
|
66
|
-
...h
|
|
67
|
-
}) => {
|
|
68
|
-
const b = "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)]", g = "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--md-primary)]", y = "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-60", x = n ? "w-full" : "", p = "", k = l === "off-white" && e === "primary" ? "border-[var(--border-color)]" : "", C = {
|
|
69
|
-
xs: a ? "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)]",
|
|
70
|
-
sm: a ? "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)]",
|
|
71
|
-
md: a ? "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)]",
|
|
72
|
-
lg: a ? "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)]",
|
|
73
|
-
xl: a ? "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)]"
|
|
74
|
-
}, j = {
|
|
75
|
-
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)]",
|
|
76
|
-
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)]",
|
|
77
|
-
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)]",
|
|
78
|
-
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)]",
|
|
79
|
-
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)]",
|
|
80
|
-
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)]",
|
|
81
|
-
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)]",
|
|
82
|
-
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)]"
|
|
83
|
-
}, I = {
|
|
84
|
-
xs: a ? "h-3 w-3" : "h-3.5 w-3.5",
|
|
85
|
-
sm: a ? "h-3.5 w-3.5" : "h-4 w-4",
|
|
86
|
-
md: "h-[1.125rem] w-[1.125rem]",
|
|
87
|
-
lg: "h-5 w-5",
|
|
88
|
-
xl: "h-5 w-5"
|
|
89
|
-
}, M = {
|
|
90
|
-
"verde-vibrante": {
|
|
91
|
-
primary: "var(--brand-verde-vibrante)",
|
|
92
|
-
hover: "var(--brand-verde-profundo)"
|
|
93
|
-
},
|
|
94
|
-
"verde-profundo": {
|
|
95
|
-
primary: "var(--brand-verde-profundo)",
|
|
96
|
-
hover: "var(--brand-grafite-azulado)"
|
|
97
|
-
},
|
|
98
|
-
"grafite-azulado": {
|
|
99
|
-
primary: "var(--brand-grafite-azulado)",
|
|
100
|
-
hover: "var(--brand-cinza-escuro)"
|
|
101
|
-
},
|
|
102
|
-
"azul-acinzentado": {
|
|
103
|
-
primary: "var(--brand-azul-acinzentado)",
|
|
104
|
-
hover: "var(--brand-grafite-azulado)"
|
|
105
|
-
},
|
|
106
|
-
"cinza-medio": {
|
|
107
|
-
primary: "var(--brand-cinza-medio)",
|
|
108
|
-
hover: "var(--brand-cinza-escuro)"
|
|
109
|
-
},
|
|
110
|
-
"cinza-escuro": {
|
|
111
|
-
primary: "var(--brand-cinza-escuro)",
|
|
112
|
-
hover: "var(--brand-preto)"
|
|
113
|
-
},
|
|
114
|
-
"off-white": {
|
|
115
|
-
primary: "var(--brand-off-white)",
|
|
116
|
-
hover: "var(--brand-branco)",
|
|
117
|
-
onPrimary: "var(--brand-grafite-azulado)"
|
|
118
|
-
}
|
|
119
|
-
}, E = {};
|
|
120
|
-
l && e === "primary" && (E["--md-primary"] = M[l].primary, E["--primary-color-hover"] = M[l].hover, M[l].onPrimary && (E["--md-on-primary"] = M[l].onPrimary));
|
|
121
|
-
const F = [
|
|
122
|
-
b,
|
|
123
|
-
g,
|
|
124
|
-
y,
|
|
125
|
-
C[r],
|
|
126
|
-
j[e],
|
|
127
|
-
k,
|
|
128
|
-
x,
|
|
129
|
-
p,
|
|
130
|
-
c
|
|
131
|
-
].filter(Boolean).join(" ");
|
|
132
|
-
return /* @__PURE__ */ m(
|
|
133
|
-
"button",
|
|
134
|
-
{
|
|
135
|
-
className: F,
|
|
136
|
-
disabled: i || o,
|
|
137
|
-
style: { ...E, ...u },
|
|
138
|
-
...h,
|
|
139
|
-
children: [
|
|
140
|
-
o && /* @__PURE__ */ t(
|
|
141
|
-
"span",
|
|
142
|
-
{
|
|
143
|
-
"aria-hidden": "true",
|
|
144
|
-
className: "absolute inline-flex h-[1em] w-[1em] animate-spin items-center justify-center",
|
|
145
|
-
children: /* @__PURE__ */ m("svg", { fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: [
|
|
146
|
-
/* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10", strokeOpacity: "0.25" }),
|
|
147
|
-
/* @__PURE__ */ t("path", { d: "M12 2 A10 10 0 0 1 22 12", strokeLinecap: "round" })
|
|
148
|
-
] })
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
!o && s && /* @__PURE__ */ t(
|
|
152
|
-
"span",
|
|
153
|
-
{
|
|
154
|
-
className: `mr-1 inline-flex shrink-0 items-center justify-center leading-none ${I[r]}`,
|
|
155
|
-
children: s
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
!o && /* @__PURE__ */ t("span", { className: "btn__content inline-flex items-center justify-center", children: v }),
|
|
159
|
-
!o && d && /* @__PURE__ */ t(
|
|
160
|
-
"span",
|
|
161
|
-
{
|
|
162
|
-
className: `ml-1 inline-flex shrink-0 items-center justify-center leading-none ${I[r]}`,
|
|
163
|
-
children: d
|
|
164
|
-
}
|
|
165
|
-
)
|
|
166
|
-
]
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}, G = ({
|
|
170
|
-
title: e,
|
|
171
|
-
tone: r = "info",
|
|
172
|
-
children: a,
|
|
173
|
-
className: n,
|
|
174
|
-
...o
|
|
175
|
-
}) => {
|
|
176
|
-
const s = {
|
|
177
|
-
info: "border-[var(--info-color)]/40 bg-[var(--info-color)]/10 text-[var(--text-primary)]",
|
|
178
|
-
success: "border-[var(--success-color)]/40 bg-[var(--success-color)]/10 text-[var(--text-primary)]",
|
|
179
|
-
warning: "border-[var(--warning-color)]/40 bg-[var(--warning-color)]/10 text-[var(--text-primary)]",
|
|
180
|
-
error: "border-[var(--md-error)]/40 bg-[var(--md-error)]/10 text-[var(--text-primary)]"
|
|
181
|
-
}[r];
|
|
182
|
-
return /* @__PURE__ */ m(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
className: f(
|
|
186
|
-
"rounded-[var(--border-radius-md)] border p-4",
|
|
187
|
-
s,
|
|
188
|
-
n
|
|
189
|
-
),
|
|
190
|
-
role: "alert",
|
|
191
|
-
...o,
|
|
192
|
-
children: [
|
|
193
|
-
e && /* @__PURE__ */ t("p", { className: "mb-1 text-sm font-semibold", children: e }),
|
|
194
|
-
/* @__PURE__ */ t("div", { className: "text-sm leading-relaxed", children: a })
|
|
195
|
-
]
|
|
196
|
-
}
|
|
197
|
-
);
|
|
198
|
-
}, U = ({
|
|
199
|
-
size: e = "md",
|
|
200
|
-
tone: r = "neutral",
|
|
201
|
-
className: a,
|
|
202
|
-
children: n,
|
|
203
|
-
...o
|
|
204
|
-
}) => {
|
|
205
|
-
const s = {
|
|
206
|
-
neutral: "bg-[var(--bg-tertiary)] text-[var(--text-secondary)]",
|
|
207
|
-
primary: "bg-[var(--md-primary)] text-[var(--md-on-primary)]",
|
|
208
|
-
success: "bg-[var(--success-color)] text-white",
|
|
209
|
-
warning: "bg-[var(--warning-color)] text-white",
|
|
210
|
-
error: "bg-[var(--md-error)] text-[var(--md-on-error)]",
|
|
211
|
-
info: "bg-[var(--info-color)] text-white"
|
|
212
|
-
}[r];
|
|
213
|
-
return /* @__PURE__ */ t(
|
|
214
|
-
"span",
|
|
215
|
-
{
|
|
216
|
-
className: f(
|
|
217
|
-
"inline-flex items-center rounded-full font-medium leading-none",
|
|
218
|
-
s,
|
|
219
|
-
e === "sm" ? "px-2 py-0.5 text-[0.6875rem]" : "px-2.5 py-1 text-xs",
|
|
220
|
-
a
|
|
221
|
-
),
|
|
222
|
-
...o,
|
|
223
|
-
children: n
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
}, Y = ({
|
|
227
|
-
variant: e = "default",
|
|
228
|
-
padding: r = "md",
|
|
229
|
-
hoverable: a = !1,
|
|
230
|
-
children: n,
|
|
231
|
-
className: o = "",
|
|
232
|
-
...s
|
|
233
|
-
}) => {
|
|
234
|
-
const d = "relative overflow-hidden rounded-[var(--border-radius-lg)] transition-[var(--transition-all)]", v = {
|
|
235
|
-
default: "bg-[var(--md-surface)] border border-[var(--md-outline-variant)] shadow-[var(--shadow-sm)]",
|
|
236
|
-
elevated: "bg-[var(--md-surface)] border border-[var(--md-outline-variant)] shadow-[var(--shadow-lg)]",
|
|
237
|
-
outlined: "bg-transparent border border-[var(--md-outline-variant)] shadow-none",
|
|
238
|
-
flat: "bg-[var(--md-surface)] border-0 shadow-none"
|
|
239
|
-
}, c = {
|
|
240
|
-
none: "p-0",
|
|
241
|
-
sm: "p-[var(--spacing-md)]",
|
|
242
|
-
md: "p-[var(--spacing-lg)]",
|
|
243
|
-
lg: "p-[var(--spacing-xl)]",
|
|
244
|
-
xl: "p-[var(--spacing-2xl)]"
|
|
245
|
-
}, i = a ? "hover:shadow-[var(--shadow-md)]" : "", l = [
|
|
246
|
-
d,
|
|
247
|
-
v[e],
|
|
248
|
-
c[r],
|
|
249
|
-
i,
|
|
250
|
-
o
|
|
251
|
-
].filter(Boolean).join(" ");
|
|
252
|
-
return /* @__PURE__ */ t("div", { className: l, ...s, children: n });
|
|
253
|
-
}, J = ({
|
|
254
|
-
label: e,
|
|
255
|
-
helperText: r,
|
|
256
|
-
className: a,
|
|
257
|
-
id: n,
|
|
258
|
-
...o
|
|
259
|
-
}) => {
|
|
260
|
-
const s = n || `checkbox-${Math.random().toString(36).slice(2, 9)}`;
|
|
261
|
-
return /* @__PURE__ */ m("label", { className: f("inline-flex cursor-pointer items-start gap-2", a), htmlFor: s, children: [
|
|
262
|
-
/* @__PURE__ */ t(
|
|
263
|
-
"input",
|
|
264
|
-
{
|
|
265
|
-
className: "mt-0.5 h-4 w-4 rounded border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--border-color-focus)]",
|
|
266
|
-
id: s,
|
|
267
|
-
type: "checkbox",
|
|
268
|
-
...o
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ m("span", { className: "grid gap-0.5", children: [
|
|
272
|
-
e && /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-primary)]", children: e }),
|
|
273
|
-
r && /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: r })
|
|
274
|
-
] })
|
|
275
|
-
] });
|
|
276
|
-
}, L = ({
|
|
277
|
-
selected: e = !1,
|
|
278
|
-
className: r,
|
|
279
|
-
children: a,
|
|
280
|
-
...n
|
|
281
|
-
}) => /* @__PURE__ */ t(
|
|
282
|
-
"button",
|
|
283
|
-
{
|
|
284
|
-
className: f(
|
|
285
|
-
"inline-flex items-center rounded-full border px-3 py-1.5 text-sm transition",
|
|
286
|
-
e ? "border-[var(--md-primary)] bg-[color:color-mix(in_srgb,var(--md-primary)_16%,transparent)] text-[var(--md-on-surface)]" : "border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]",
|
|
287
|
-
r
|
|
288
|
-
),
|
|
289
|
-
type: "button",
|
|
290
|
-
...n,
|
|
291
|
-
children: a
|
|
292
|
-
}
|
|
293
|
-
), Q = ({
|
|
294
|
-
orientation: e = "horizontal",
|
|
295
|
-
className: r,
|
|
296
|
-
...a
|
|
297
|
-
}) => /* @__PURE__ */ t(
|
|
298
|
-
"div",
|
|
299
|
-
{
|
|
300
|
-
className: f(
|
|
301
|
-
"bg-[var(--border-color)]",
|
|
302
|
-
e === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
303
|
-
r
|
|
304
|
-
),
|
|
305
|
-
role: "separator",
|
|
306
|
-
...a
|
|
307
|
-
}
|
|
308
|
-
), X = ({
|
|
309
|
-
icon: e,
|
|
310
|
-
title: r,
|
|
311
|
-
description: a,
|
|
312
|
-
action: n,
|
|
313
|
-
className: o,
|
|
314
|
-
...s
|
|
315
|
-
}) => /* @__PURE__ */ m(
|
|
316
|
-
"div",
|
|
317
|
-
{
|
|
318
|
-
className: f(
|
|
319
|
-
"grid justify-items-center gap-3 rounded-[var(--border-radius-lg)] border border-dashed border-[var(--border-color)] bg-[var(--bg-secondary)] p-6 text-center",
|
|
320
|
-
o
|
|
321
|
-
),
|
|
322
|
-
...s,
|
|
323
|
-
children: [
|
|
324
|
-
e && /* @__PURE__ */ t("div", { className: "text-[var(--text-muted)]", children: e }),
|
|
325
|
-
/* @__PURE__ */ t("h3", { className: "m-0 text-lg font-semibold text-[var(--text-primary)]", children: r }),
|
|
326
|
-
a && /* @__PURE__ */ t("p", { className: "m-0 max-w-[30rem] text-sm text-[var(--text-secondary)]", children: a }),
|
|
327
|
-
n && /* @__PURE__ */ t("div", { className: "mt-1", children: n })
|
|
328
|
-
]
|
|
329
|
-
}
|
|
330
|
-
), Z = ({
|
|
331
|
-
poweredByText: e = "Powered by",
|
|
332
|
-
logoSrc: r,
|
|
333
|
-
logoAlt: a = "Logo",
|
|
334
|
-
logoFallbackText: n,
|
|
335
|
-
className: o = ""
|
|
336
|
-
}) => {
|
|
337
|
-
const [s, d] = N(!0);
|
|
338
|
-
return /* @__PURE__ */ t(
|
|
339
|
-
"footer",
|
|
340
|
-
{
|
|
341
|
-
className: [
|
|
342
|
-
"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)]",
|
|
343
|
-
o
|
|
344
|
-
].filter(Boolean).join(" "),
|
|
345
|
-
children: /* @__PURE__ */ m("div", { className: "flex items-center gap-[var(--spacing-md)]", children: [
|
|
346
|
-
e && /* @__PURE__ */ t("span", { className: "text-[0.95rem] font-normal text-[var(--text-secondary)]", children: e }),
|
|
347
|
-
(r || n) && /* @__PURE__ */ m("div", { className: "flex items-center", children: [
|
|
348
|
-
r && s && /* @__PURE__ */ t(
|
|
349
|
-
"img",
|
|
350
|
-
{
|
|
351
|
-
alt: a,
|
|
352
|
-
className: "h-6 w-auto object-contain",
|
|
353
|
-
onError: (v) => {
|
|
354
|
-
d(!1);
|
|
355
|
-
},
|
|
356
|
-
src: r,
|
|
357
|
-
style: {
|
|
358
|
-
filter: "brightness(0)"
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
),
|
|
362
|
-
n && /* @__PURE__ */ t(
|
|
363
|
-
"span",
|
|
364
|
-
{
|
|
365
|
-
className: "flex items-center text-base font-bold tracking-[0.1em] text-[var(--md-primary)]",
|
|
366
|
-
style: {
|
|
367
|
-
display: r && s ? "none" : "flex",
|
|
368
|
-
fontFamily: '"Orbitron", sans-serif'
|
|
369
|
-
},
|
|
370
|
-
children: n
|
|
371
|
-
}
|
|
372
|
-
)
|
|
373
|
-
] })
|
|
374
|
-
] })
|
|
375
|
-
}
|
|
376
|
-
);
|
|
377
|
-
}, $ = () => typeof document > "u" ? "light" : document.documentElement.getAttribute("data-theme") === "dark" ? "dark" : "light", ee = ({
|
|
378
|
-
logoSrc: e,
|
|
379
|
-
logoDarkSrc: r,
|
|
380
|
-
logoAlt: a = "Logo",
|
|
381
|
-
title: n,
|
|
382
|
-
subtitle: o,
|
|
383
|
-
theme: s,
|
|
384
|
-
onLogoClick: d,
|
|
385
|
-
rightContent: v,
|
|
386
|
-
className: c = ""
|
|
387
|
-
}) => {
|
|
388
|
-
const [i, l] = N(!1), [u, h] = N(
|
|
389
|
-
() => s ?? $()
|
|
390
|
-
), b = u === "dark" && r ? r : e;
|
|
391
|
-
w(() => {
|
|
392
|
-
const x = () => l(window.scrollY > 10);
|
|
393
|
-
return window.addEventListener("scroll", x, { passive: !0 }), () => window.removeEventListener("scroll", x);
|
|
394
|
-
}, []), w(() => {
|
|
395
|
-
if (s) {
|
|
396
|
-
h(s);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
const x = () => h($());
|
|
400
|
-
if (x(), typeof MutationObserver > "u")
|
|
401
|
-
return;
|
|
402
|
-
const p = new MutationObserver(x);
|
|
403
|
-
return p.observe(document.documentElement, {
|
|
404
|
-
attributes: !0,
|
|
405
|
-
attributeFilter: ["data-theme"]
|
|
406
|
-
}), () => p.disconnect();
|
|
407
|
-
}, [s]);
|
|
408
|
-
const g = () => d == null ? void 0 : d(), y = (x) => {
|
|
409
|
-
x.key === "Enter" && (d == null || d());
|
|
410
|
-
};
|
|
411
|
-
return /* @__PURE__ */ m(
|
|
412
|
-
"header",
|
|
413
|
-
{
|
|
414
|
-
className: [
|
|
415
|
-
"fixed inset-x-0 top-0 z-[1000] w-full backdrop-blur-[12px]",
|
|
416
|
-
c
|
|
417
|
-
].filter(Boolean).join(" "),
|
|
418
|
-
children: [
|
|
419
|
-
/* @__PURE__ */ t("div", { className: "h-0.5 w-full bg-[var(--md-primary)]" }),
|
|
420
|
-
/* @__PURE__ */ m(
|
|
421
|
-
"div",
|
|
422
|
-
{
|
|
423
|
-
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",
|
|
424
|
-
style: {
|
|
425
|
-
color: "var(--md-on-surface)",
|
|
426
|
-
background: `color-mix(in srgb, var(--md-surface) ${i ? "14%" : "18%"}, transparent)`,
|
|
427
|
-
borderBottom: `1px solid color-mix(in srgb, var(--md-outline-variant) ${i ? "22%" : "30%"}, transparent)`
|
|
428
|
-
},
|
|
429
|
-
children: [
|
|
430
|
-
/* @__PURE__ */ m(
|
|
431
|
-
"div",
|
|
432
|
-
{
|
|
433
|
-
className: "flex cursor-pointer items-center gap-3 transition-opacity duration-200 ease-in-out hover:opacity-80",
|
|
434
|
-
onClick: d ? g : void 0,
|
|
435
|
-
onKeyDown: d ? y : void 0,
|
|
436
|
-
role: d ? "button" : void 0,
|
|
437
|
-
tabIndex: d ? 0 : void 0,
|
|
438
|
-
children: [
|
|
439
|
-
b && /* @__PURE__ */ m("div", { className: "flex h-16 w-16 shrink-0 items-center justify-center", children: [
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
"img",
|
|
442
|
-
{
|
|
443
|
-
alt: a,
|
|
444
|
-
className: "h-full w-full object-contain",
|
|
445
|
-
onError: (x) => {
|
|
446
|
-
x.target.style.display = "none";
|
|
447
|
-
const p = x.target.nextElementSibling;
|
|
448
|
-
p && (p.style.display = "block");
|
|
449
|
-
},
|
|
450
|
-
src: b
|
|
451
|
-
}
|
|
452
|
-
),
|
|
453
|
-
/* @__PURE__ */ m(
|
|
454
|
-
"svg",
|
|
455
|
-
{
|
|
456
|
-
className: "hidden h-full w-full",
|
|
457
|
-
fill: "none",
|
|
458
|
-
stroke: "currentColor",
|
|
459
|
-
strokeWidth: "2",
|
|
460
|
-
viewBox: "0 0 24 24",
|
|
461
|
-
children: [
|
|
462
|
-
/* @__PURE__ */ t("path", { d: "M12 2L2 7l10 5 10-5-10-5z" }),
|
|
463
|
-
/* @__PURE__ */ t("path", { d: "M2 17l10 5 10-5M2 12l10 5 10-5" })
|
|
464
|
-
]
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
] }),
|
|
468
|
-
(n || o) && /* @__PURE__ */ m("div", { className: "flex flex-col gap-1", children: [
|
|
469
|
-
n && /* @__PURE__ */ t(
|
|
470
|
-
"h1",
|
|
471
|
-
{
|
|
472
|
-
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",
|
|
473
|
-
style: { fontFamily: '"Orbitron", sans-serif' },
|
|
474
|
-
children: n
|
|
475
|
-
}
|
|
476
|
-
),
|
|
477
|
-
o && /* @__PURE__ */ t("p", { className: "m-0 text-[0.8125rem] font-normal text-[var(--md-on-surface-variant)] max-md:text-xs", children: o })
|
|
478
|
-
] })
|
|
479
|
-
]
|
|
480
|
-
}
|
|
481
|
-
),
|
|
482
|
-
v && /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-3 max-md:w-full max-md:flex-wrap max-md:justify-between", children: v })
|
|
483
|
-
]
|
|
484
|
-
}
|
|
485
|
-
)
|
|
486
|
-
]
|
|
487
|
-
}
|
|
488
|
-
);
|
|
489
|
-
}, re = ({
|
|
490
|
-
label: e,
|
|
491
|
-
error: r,
|
|
492
|
-
helperText: a,
|
|
493
|
-
leftIcon: n,
|
|
494
|
-
rightIcon: o,
|
|
495
|
-
fullWidth: s = !1,
|
|
496
|
-
size: d = "md",
|
|
497
|
-
className: v = "",
|
|
498
|
-
id: c,
|
|
499
|
-
...i
|
|
500
|
-
}) => {
|
|
501
|
-
const l = c || `input-${Math.random().toString(36).substring(2, 9)}`, u = !!r, b = [
|
|
502
|
-
"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",
|
|
503
|
-
u ? "border-[var(--md-error)] focus:border-[var(--md-error)] focus:[box-shadow:0_0_0_0.1875rem_rgba(186,26,26,0.2)]" : "",
|
|
504
|
-
n ? "pl-10" : "",
|
|
505
|
-
o ? "pr-10" : "",
|
|
506
|
-
{
|
|
507
|
-
sm: "min-h-8 px-[var(--spacing-md)] py-[var(--spacing-sm)] text-[var(--font-size-sm)]",
|
|
508
|
-
md: "min-h-10 px-[var(--spacing-lg)] py-[var(--spacing-md)] text-[var(--font-size-base)]",
|
|
509
|
-
lg: "min-h-12 px-[var(--spacing-xl)] py-[var(--spacing-lg)] text-[var(--font-size-lg)]"
|
|
510
|
-
}[d],
|
|
511
|
-
v
|
|
512
|
-
].filter(Boolean).join(" ");
|
|
513
|
-
return /* @__PURE__ */ m("div", { className: `flex flex-col gap-[var(--spacing-xs)] ${s ? "w-full" : ""}`, children: [
|
|
514
|
-
e && /* @__PURE__ */ t(
|
|
515
|
-
"label",
|
|
516
|
-
{
|
|
517
|
-
className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
|
|
518
|
-
htmlFor: l,
|
|
519
|
-
children: e
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
/* @__PURE__ */ m("div", { className: "group relative flex w-full items-center", children: [
|
|
523
|
-
n && /* @__PURE__ */ t("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 }),
|
|
524
|
-
/* @__PURE__ */ t(
|
|
525
|
-
"input",
|
|
526
|
-
{
|
|
527
|
-
"aria-describedby": r ? `${l}-error` : a ? `${l}-helper` : void 0,
|
|
528
|
-
"aria-invalid": u ? !0 : void 0,
|
|
529
|
-
className: b,
|
|
530
|
-
id: l,
|
|
531
|
-
...i
|
|
532
|
-
}
|
|
533
|
-
),
|
|
534
|
-
o && /* @__PURE__ */ t("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 })
|
|
535
|
-
] }),
|
|
536
|
-
r && /* @__PURE__ */ t(
|
|
537
|
-
"span",
|
|
538
|
-
{
|
|
539
|
-
className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-error)]",
|
|
540
|
-
id: `${l}-error`,
|
|
541
|
-
role: "alert",
|
|
542
|
-
children: r
|
|
543
|
-
}
|
|
544
|
-
),
|
|
545
|
-
a && !r && /* @__PURE__ */ t(
|
|
546
|
-
"span",
|
|
547
|
-
{
|
|
548
|
-
className: "mt-[var(--spacing-xs)] block text-[var(--font-size-xs)] text-[var(--md-on-surface-variant)]",
|
|
549
|
-
id: `${l}-helper`,
|
|
550
|
-
children: a
|
|
551
|
-
}
|
|
552
|
-
)
|
|
553
|
-
] });
|
|
554
|
-
}, ae = ({
|
|
555
|
-
size: e = "lg",
|
|
556
|
-
className: r,
|
|
557
|
-
...a
|
|
558
|
-
}) => {
|
|
559
|
-
const n = {
|
|
560
|
-
sm: "max-w-2xl",
|
|
561
|
-
md: "max-w-4xl",
|
|
562
|
-
lg: "max-w-6xl",
|
|
563
|
-
xl: "max-w-7xl",
|
|
564
|
-
full: "max-w-none"
|
|
565
|
-
}[e];
|
|
566
|
-
return /* @__PURE__ */ t("div", { className: f("mx-auto w-full px-4", n, r), ...a });
|
|
567
|
-
}, te = ({
|
|
568
|
-
gap: e = "md",
|
|
569
|
-
className: r,
|
|
570
|
-
...a
|
|
571
|
-
}) => {
|
|
572
|
-
const n = {
|
|
573
|
-
xs: "gap-1",
|
|
574
|
-
sm: "gap-2",
|
|
575
|
-
md: "gap-3",
|
|
576
|
-
lg: "gap-4",
|
|
577
|
-
xl: "gap-6"
|
|
578
|
-
}[e];
|
|
579
|
-
return /* @__PURE__ */ t("div", { className: f("flex flex-col", n, r), ...a });
|
|
580
|
-
}, oe = ({
|
|
581
|
-
cols: e = 2,
|
|
582
|
-
gap: r = "md",
|
|
583
|
-
className: a,
|
|
584
|
-
...n
|
|
585
|
-
}) => {
|
|
586
|
-
const o = {
|
|
587
|
-
1: "grid-cols-1",
|
|
588
|
-
2: "grid-cols-2",
|
|
589
|
-
3: "grid-cols-3",
|
|
590
|
-
4: "grid-cols-4"
|
|
591
|
-
}[e], s = {
|
|
592
|
-
xs: "gap-1",
|
|
593
|
-
sm: "gap-2",
|
|
594
|
-
md: "gap-3",
|
|
595
|
-
lg: "gap-4",
|
|
596
|
-
xl: "gap-6"
|
|
597
|
-
}[r];
|
|
598
|
-
return /* @__PURE__ */ t("div", { className: f("grid", o, s, a), ...n });
|
|
599
|
-
}, ne = ({
|
|
600
|
-
isOpen: e,
|
|
601
|
-
onClose: r,
|
|
602
|
-
title: a,
|
|
603
|
-
subtitle: n,
|
|
604
|
-
children: o,
|
|
605
|
-
size: s = "md",
|
|
606
|
-
showCloseButton: d = !0,
|
|
607
|
-
closeOnOverlayClick: v = !0,
|
|
608
|
-
className: c = ""
|
|
609
|
-
}) => {
|
|
610
|
-
const i = z(null), l = z(null);
|
|
611
|
-
if (w(() => (e ? (l.current = document.activeElement, document.body.style.overflow = "hidden") : document.body.style.overflow = "", () => {
|
|
612
|
-
document.body.style.overflow = "", l.current && l.current.focus();
|
|
613
|
-
}), [e]), w(() => {
|
|
614
|
-
const g = (x) => {
|
|
615
|
-
x.key === "Escape" && e && r();
|
|
616
|
-
}, y = (x) => {
|
|
617
|
-
if (x.key !== "Tab" || !i.current || !e)
|
|
618
|
-
return;
|
|
619
|
-
const p = i.current.querySelectorAll(
|
|
620
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
621
|
-
);
|
|
622
|
-
if (p.length === 0) {
|
|
623
|
-
x.preventDefault();
|
|
624
|
-
return;
|
|
625
|
-
}
|
|
626
|
-
const k = p[0], C = p[p.length - 1], j = document.activeElement;
|
|
627
|
-
x.shiftKey && j === k ? (x.preventDefault(), C.focus()) : !x.shiftKey && j === C && (x.preventDefault(), k.focus());
|
|
628
|
-
};
|
|
629
|
-
return e && (document.addEventListener("keydown", g), document.addEventListener("keydown", y), requestAnimationFrame(() => {
|
|
630
|
-
var p;
|
|
631
|
-
const x = ((p = i.current) == null ? void 0 : p.querySelector(
|
|
632
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
633
|
-
)) ?? i.current;
|
|
634
|
-
x == null || x.focus();
|
|
635
|
-
})), () => {
|
|
636
|
-
document.removeEventListener("keydown", g), document.removeEventListener("keydown", y);
|
|
637
|
-
};
|
|
638
|
-
}, [e, r]), !e)
|
|
639
|
-
return null;
|
|
640
|
-
const u = (g) => {
|
|
641
|
-
v && g.target === g.currentTarget && r();
|
|
642
|
-
}, b = [
|
|
643
|
-
"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)]",
|
|
644
|
-
{
|
|
645
|
-
sm: "max-w-[25rem]",
|
|
646
|
-
md: "max-w-[31.25rem]",
|
|
647
|
-
lg: "max-w-[43.75rem]",
|
|
648
|
-
xl: "max-w-[56.25rem]",
|
|
649
|
-
full: "max-h-[90vh] max-w-[90vw]"
|
|
650
|
-
}[s],
|
|
651
|
-
c
|
|
652
|
-
].filter(Boolean).join(" ");
|
|
653
|
-
return /* @__PURE__ */ t(
|
|
654
|
-
"div",
|
|
655
|
-
{
|
|
656
|
-
"aria-labelledby": a ? "modal-title" : void 0,
|
|
657
|
-
"aria-modal": "true",
|
|
658
|
-
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]",
|
|
659
|
-
onClick: u,
|
|
660
|
-
role: "dialog",
|
|
661
|
-
children: /* @__PURE__ */ m("div", { className: b, ref: i, tabIndex: -1, children: [
|
|
662
|
-
(a || n || d) && /* @__PURE__ */ m("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: [
|
|
663
|
-
(a || n) && /* @__PURE__ */ m("div", { className: "flex-1", children: [
|
|
664
|
-
a && /* @__PURE__ */ t(
|
|
665
|
-
"h2",
|
|
666
|
-
{
|
|
667
|
-
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)]",
|
|
668
|
-
id: "modal-title",
|
|
669
|
-
children: a
|
|
670
|
-
}
|
|
671
|
-
),
|
|
672
|
-
n && /* @__PURE__ */ t("p", { className: "m-0 text-[var(--font-size-base)] leading-[var(--line-height-normal)] text-[var(--md-on-surface-variant)]", children: n })
|
|
673
|
-
] }),
|
|
674
|
-
d && /* @__PURE__ */ t(
|
|
675
|
-
"button",
|
|
676
|
-
{
|
|
677
|
-
"aria-label": "Fechar modal",
|
|
678
|
-
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)]",
|
|
679
|
-
onClick: r,
|
|
680
|
-
type: "button",
|
|
681
|
-
children: /* @__PURE__ */ m(
|
|
682
|
-
"svg",
|
|
683
|
-
{
|
|
684
|
-
fill: "none",
|
|
685
|
-
className: "h-5 w-5",
|
|
686
|
-
stroke: "currentColor",
|
|
687
|
-
strokeWidth: "2",
|
|
688
|
-
viewBox: "0 0 24 24",
|
|
689
|
-
children: [
|
|
690
|
-
/* @__PURE__ */ t("line", { x1: "18", x2: "6", y1: "6", y2: "18" }),
|
|
691
|
-
/* @__PURE__ */ t("line", { x1: "6", x2: "18", y1: "6", y2: "18" })
|
|
692
|
-
]
|
|
693
|
-
}
|
|
694
|
-
)
|
|
695
|
-
}
|
|
696
|
-
)
|
|
697
|
-
] }),
|
|
698
|
-
/* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col overflow-x-hidden overflow-y-auto p-[var(--spacing-2xl)]", children: o })
|
|
699
|
-
] })
|
|
700
|
-
}
|
|
701
|
-
);
|
|
702
|
-
}, se = ({ className: e, ...r }) => /* @__PURE__ */ t(
|
|
703
|
-
"aside",
|
|
704
|
-
{
|
|
705
|
-
className: f(
|
|
706
|
-
"h-full rounded-[var(--border-radius-lg)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-4",
|
|
707
|
-
e
|
|
708
|
-
),
|
|
709
|
-
...r
|
|
710
|
-
}
|
|
711
|
-
), ie = ({ className: e, ...r }) => /* @__PURE__ */ t(
|
|
712
|
-
"header",
|
|
713
|
-
{
|
|
714
|
-
className: f(
|
|
715
|
-
"flex min-h-14 items-center justify-between border-b border-[var(--border-color)] bg-[var(--bg-secondary)] px-4",
|
|
716
|
-
e
|
|
717
|
-
),
|
|
718
|
-
...r
|
|
719
|
-
}
|
|
720
|
-
), le = ({
|
|
721
|
-
currentPage: e,
|
|
722
|
-
totalPages: r,
|
|
723
|
-
onPageChange: a
|
|
724
|
-
}) => {
|
|
725
|
-
if (r <= 1)
|
|
726
|
-
return null;
|
|
727
|
-
const n = Array.from({ length: r }, (o, s) => s + 1);
|
|
728
|
-
return /* @__PURE__ */ m("nav", { "aria-label": "Paginação", className: "flex flex-wrap items-center gap-1", children: [
|
|
729
|
-
/* @__PURE__ */ t(
|
|
730
|
-
"button",
|
|
731
|
-
{
|
|
732
|
-
className: "rounded-[var(--border-radius-sm)] border border-[var(--border-color)] px-2 py-1 text-sm disabled:opacity-50",
|
|
733
|
-
disabled: e === 1,
|
|
734
|
-
onClick: () => a(Math.max(e - 1, 1)),
|
|
735
|
-
type: "button",
|
|
736
|
-
children: "Anterior"
|
|
737
|
-
}
|
|
738
|
-
),
|
|
739
|
-
n.map((o) => /* @__PURE__ */ t(
|
|
740
|
-
"button",
|
|
741
|
-
{
|
|
742
|
-
className: f(
|
|
743
|
-
"rounded-[var(--border-radius-sm)] border px-2.5 py-1 text-sm",
|
|
744
|
-
o === e ? "border-[var(--md-primary)] bg-[var(--md-primary)] text-[var(--md-on-primary)]" : "border-[var(--border-color)] bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"
|
|
745
|
-
),
|
|
746
|
-
onClick: () => a(o),
|
|
747
|
-
type: "button",
|
|
748
|
-
children: o
|
|
749
|
-
},
|
|
750
|
-
o
|
|
751
|
-
)),
|
|
752
|
-
/* @__PURE__ */ t(
|
|
753
|
-
"button",
|
|
754
|
-
{
|
|
755
|
-
className: "rounded-[var(--border-radius-sm)] border border-[var(--border-color)] px-2 py-1 text-sm disabled:opacity-50",
|
|
756
|
-
disabled: e === r,
|
|
757
|
-
onClick: () => a(Math.min(e + 1, r)),
|
|
758
|
-
type: "button",
|
|
759
|
-
children: "Próxima"
|
|
760
|
-
}
|
|
761
|
-
)
|
|
762
|
-
] });
|
|
763
|
-
}, de = ({
|
|
764
|
-
as: e = "p",
|
|
765
|
-
size: r = "md",
|
|
766
|
-
weight: a = "normal",
|
|
767
|
-
align: n = "left",
|
|
768
|
-
muted: o = !1,
|
|
769
|
-
italic: s = !1,
|
|
770
|
-
children: d,
|
|
771
|
-
className: v = "",
|
|
772
|
-
...c
|
|
773
|
-
}) => {
|
|
774
|
-
const i = e, l = {
|
|
775
|
-
xs: "text-[var(--font-size-xs)] leading-[var(--line-height-normal)]",
|
|
776
|
-
sm: "text-[var(--font-size-sm)] leading-[var(--line-height-normal)]",
|
|
777
|
-
md: "text-[var(--font-size-base)] leading-[var(--line-height-relaxed)]",
|
|
778
|
-
lg: "text-[var(--font-size-lg)] leading-[var(--line-height-loose)]"
|
|
779
|
-
}, u = {
|
|
780
|
-
light: "font-[var(--font-weight-light)]",
|
|
781
|
-
normal: "font-[var(--font-weight-normal)]",
|
|
782
|
-
medium: "font-[var(--font-weight-medium)]"
|
|
783
|
-
}, h = {
|
|
784
|
-
left: "text-left",
|
|
785
|
-
center: "text-center",
|
|
786
|
-
right: "text-right",
|
|
787
|
-
justify: "text-justify"
|
|
788
|
-
}, b = [
|
|
789
|
-
"m-0 text-[var(--text-primary)] transition-[var(--transition-colors)]",
|
|
790
|
-
l[r],
|
|
791
|
-
u[a],
|
|
792
|
-
h[n],
|
|
793
|
-
s ? "italic" : "not-italic",
|
|
794
|
-
o ? "text-[var(--text-muted)]" : "",
|
|
795
|
-
v
|
|
796
|
-
].filter(Boolean).join(" ");
|
|
797
|
-
return /* @__PURE__ */ t(i, { className: b, ...c, children: d });
|
|
798
|
-
}, ce = ({
|
|
799
|
-
title: e,
|
|
800
|
-
subtitle: r,
|
|
801
|
-
actions: a,
|
|
802
|
-
className: n,
|
|
803
|
-
...o
|
|
804
|
-
}) => /* @__PURE__ */ t(
|
|
805
|
-
"header",
|
|
806
|
-
{
|
|
807
|
-
className: f(
|
|
808
|
-
"grid gap-3 rounded-[var(--border-radius-lg)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-5 shadow-[var(--shadow-sm)]",
|
|
809
|
-
n
|
|
810
|
-
),
|
|
811
|
-
...o,
|
|
812
|
-
children: /* @__PURE__ */ m("div", { className: "flex items-start justify-between gap-4", children: [
|
|
813
|
-
/* @__PURE__ */ m("div", { className: "grid gap-1", children: [
|
|
814
|
-
/* @__PURE__ */ t("h1", { className: "m-0 text-2xl font-bold text-[var(--text-primary)]", children: e }),
|
|
815
|
-
r && /* @__PURE__ */ t("p", { className: "m-0 text-sm text-[var(--text-secondary)]", children: r })
|
|
816
|
-
] }),
|
|
817
|
-
a && /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: a })
|
|
818
|
-
] })
|
|
819
|
-
}
|
|
820
|
-
), me = ({
|
|
821
|
-
children: e,
|
|
822
|
-
content: r,
|
|
823
|
-
defaultOpen: a = !1
|
|
824
|
-
}) => {
|
|
825
|
-
const [n, o] = N(a), s = z(null), d = z(null), v = z(null), c = B();
|
|
826
|
-
return w(() => {
|
|
827
|
-
const i = (l) => {
|
|
828
|
-
var u;
|
|
829
|
-
(u = s.current) != null && u.contains(l.target) || o(!1);
|
|
830
|
-
};
|
|
831
|
-
return document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
832
|
-
}, []), w(() => {
|
|
833
|
-
if (!n || !v.current)
|
|
834
|
-
return;
|
|
835
|
-
const i = v.current.querySelector(
|
|
836
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
837
|
-
);
|
|
838
|
-
i == null || i.focus();
|
|
839
|
-
}, [n]), w(() => {
|
|
840
|
-
const i = (l) => {
|
|
841
|
-
var u;
|
|
842
|
-
l.key === "Escape" && (o(!1), (u = d.current) == null || u.focus());
|
|
843
|
-
};
|
|
844
|
-
return n && document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
845
|
-
}, [n]), /* @__PURE__ */ m("div", { className: "relative inline-flex", ref: s, children: [
|
|
846
|
-
/* @__PURE__ */ t(
|
|
847
|
-
"button",
|
|
848
|
-
{
|
|
849
|
-
"aria-controls": n ? c : void 0,
|
|
850
|
-
"aria-expanded": n,
|
|
851
|
-
"aria-haspopup": "dialog",
|
|
852
|
-
className: "inline-flex",
|
|
853
|
-
onClick: () => o((i) => !i),
|
|
854
|
-
ref: d,
|
|
855
|
-
type: "button",
|
|
856
|
-
children: e
|
|
857
|
-
}
|
|
858
|
-
),
|
|
859
|
-
n && /* @__PURE__ */ t(
|
|
860
|
-
"div",
|
|
861
|
-
{
|
|
862
|
-
className: f(
|
|
863
|
-
"absolute left-1/2 top-full z-30 mt-2 w-max -translate-x-1/2 rounded-[var(--border-radius-md)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-3 shadow-[var(--shadow-md)]"
|
|
864
|
-
),
|
|
865
|
-
id: c,
|
|
866
|
-
ref: v,
|
|
867
|
-
role: "dialog",
|
|
868
|
-
tabIndex: -1,
|
|
869
|
-
children: r
|
|
870
|
-
}
|
|
871
|
-
)
|
|
872
|
-
] });
|
|
873
|
-
}, ve = ({
|
|
874
|
-
label: e,
|
|
875
|
-
helperText: r,
|
|
876
|
-
className: a,
|
|
877
|
-
id: n,
|
|
878
|
-
...o
|
|
879
|
-
}) => {
|
|
880
|
-
const s = n || `radio-${Math.random().toString(36).slice(2, 9)}`;
|
|
881
|
-
return /* @__PURE__ */ m("label", { className: f("inline-flex cursor-pointer items-start gap-2", a), htmlFor: s, children: [
|
|
882
|
-
/* @__PURE__ */ t(
|
|
883
|
-
"input",
|
|
884
|
-
{
|
|
885
|
-
className: "mt-0.5 h-4 w-4 border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--border-color-focus)]",
|
|
886
|
-
id: s,
|
|
887
|
-
type: "radio",
|
|
888
|
-
...o
|
|
889
|
-
}
|
|
890
|
-
),
|
|
891
|
-
/* @__PURE__ */ m("span", { className: "grid gap-0.5", children: [
|
|
892
|
-
e && /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-primary)]", children: e }),
|
|
893
|
-
r && /* @__PURE__ */ t("span", { className: "text-xs text-[var(--text-muted)]", children: r })
|
|
894
|
-
] })
|
|
895
|
-
] });
|
|
896
|
-
}, ue = ({
|
|
897
|
-
title: e,
|
|
898
|
-
subtitle: r,
|
|
899
|
-
actions: a,
|
|
900
|
-
className: n,
|
|
901
|
-
...o
|
|
902
|
-
}) => /* @__PURE__ */ m("div", { className: f("flex items-start justify-between gap-4", n), ...o, children: [
|
|
903
|
-
/* @__PURE__ */ m("div", { className: "grid gap-1", children: [
|
|
904
|
-
/* @__PURE__ */ t("h2", { className: "m-0 text-xl font-semibold text-[var(--text-primary)]", children: e }),
|
|
905
|
-
r && /* @__PURE__ */ t("p", { className: "m-0 text-sm text-[var(--text-secondary)]", children: r })
|
|
906
|
-
] }),
|
|
907
|
-
a && /* @__PURE__ */ t("div", { className: "flex shrink-0 items-center gap-2", children: a })
|
|
908
|
-
] }), fe = ({
|
|
909
|
-
label: e,
|
|
910
|
-
helperText: r,
|
|
911
|
-
error: a,
|
|
912
|
-
options: n,
|
|
913
|
-
size: o = "md",
|
|
914
|
-
className: s,
|
|
915
|
-
id: d,
|
|
916
|
-
...v
|
|
917
|
-
}) => {
|
|
918
|
-
const c = d || `select-${Math.random().toString(36).slice(2, 9)}`, i = {
|
|
919
|
-
sm: "min-h-8 px-3 py-1.5 text-sm",
|
|
920
|
-
md: "min-h-10 px-3.5 py-2 text-base",
|
|
921
|
-
lg: "min-h-12 px-4 py-3 text-lg"
|
|
922
|
-
}[o];
|
|
923
|
-
return /* @__PURE__ */ m("div", { className: "grid gap-1", children: [
|
|
924
|
-
e && /* @__PURE__ */ t(
|
|
925
|
-
"label",
|
|
926
|
-
{
|
|
927
|
-
className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
|
|
928
|
-
htmlFor: c,
|
|
929
|
-
children: e
|
|
930
|
-
}
|
|
931
|
-
),
|
|
932
|
-
/* @__PURE__ */ t(
|
|
933
|
-
"select",
|
|
934
|
-
{
|
|
935
|
-
className: f(
|
|
936
|
-
"w-full rounded-[var(--border-radius-md)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] text-[var(--md-on-surface)] outline-none transition focus:border-[var(--border-color-focus)] focus:[box-shadow:0_0_0_0.1875rem_rgba(47,93,140,0.15)]",
|
|
937
|
-
a ? "border-[var(--md-error)]" : "",
|
|
938
|
-
i,
|
|
939
|
-
s
|
|
940
|
-
),
|
|
941
|
-
id: c,
|
|
942
|
-
...v,
|
|
943
|
-
children: n.map((l) => /* @__PURE__ */ t("option", { value: l.value, children: l.label }, l.value))
|
|
944
|
-
}
|
|
945
|
-
),
|
|
946
|
-
a ? /* @__PURE__ */ t("span", { className: "text-xs text-[var(--md-error)]", children: a }) : r && /* @__PURE__ */ t("span", { className: "text-xs text-[var(--md-on-surface-variant)]", children: r })
|
|
947
|
-
] });
|
|
948
|
-
}, xe = ({
|
|
949
|
-
circle: e = !1,
|
|
950
|
-
width: r,
|
|
951
|
-
height: a,
|
|
952
|
-
className: n,
|
|
953
|
-
style: o,
|
|
954
|
-
...s
|
|
955
|
-
}) => /* @__PURE__ */ t(
|
|
956
|
-
"div",
|
|
957
|
-
{
|
|
958
|
-
className: f(
|
|
959
|
-
"animate-pulse bg-[var(--md-surface-container-high)]",
|
|
960
|
-
e ? "rounded-full" : "rounded-[var(--border-radius-sm)]",
|
|
961
|
-
n
|
|
962
|
-
),
|
|
963
|
-
style: { width: r, height: a, ...o },
|
|
964
|
-
...s
|
|
965
|
-
}
|
|
966
|
-
), be = ({
|
|
967
|
-
as: e = "p",
|
|
968
|
-
size: r = "md",
|
|
969
|
-
weight: a = "normal",
|
|
970
|
-
align: n = "left",
|
|
971
|
-
muted: o = !1,
|
|
972
|
-
italic: s = !1,
|
|
973
|
-
children: d,
|
|
974
|
-
className: v = "",
|
|
975
|
-
...c
|
|
976
|
-
}) => {
|
|
977
|
-
const i = e, l = {
|
|
978
|
-
xs: "text-[var(--font-size-xs)]",
|
|
979
|
-
sm: "text-[var(--font-size-sm)]",
|
|
980
|
-
md: "text-[var(--font-size-base)]",
|
|
981
|
-
lg: "text-[var(--font-size-lg)]"
|
|
982
|
-
}, u = {
|
|
983
|
-
normal: "font-[var(--font-weight-normal)]",
|
|
984
|
-
medium: "font-[var(--font-weight-medium)]",
|
|
985
|
-
semibold: "font-[var(--font-weight-semibold)]"
|
|
986
|
-
}, h = {
|
|
987
|
-
left: "text-left",
|
|
988
|
-
center: "text-center",
|
|
989
|
-
right: "text-right"
|
|
990
|
-
}, b = [
|
|
991
|
-
"m-0 leading-[var(--line-height-normal)] text-[var(--text-secondary)] transition-[var(--transition-colors)]",
|
|
992
|
-
l[r],
|
|
993
|
-
u[a],
|
|
994
|
-
h[n],
|
|
995
|
-
s ? "italic" : "not-italic",
|
|
996
|
-
o ? "text-[var(--text-muted)] opacity-80" : "",
|
|
997
|
-
v
|
|
998
|
-
].filter(Boolean).join(" ");
|
|
999
|
-
return /* @__PURE__ */ t(i, { className: b, ...c, children: d });
|
|
1000
|
-
}, he = ({
|
|
1001
|
-
checked: e = !1,
|
|
1002
|
-
onCheckedChange: r,
|
|
1003
|
-
label: a,
|
|
1004
|
-
className: n,
|
|
1005
|
-
...o
|
|
1006
|
-
}) => /* @__PURE__ */ m("div", { className: f("inline-flex items-center gap-2", n), children: [
|
|
1007
|
-
/* @__PURE__ */ t(
|
|
1008
|
-
"button",
|
|
1009
|
-
{
|
|
1010
|
-
"aria-checked": e,
|
|
1011
|
-
className: f(
|
|
1012
|
-
"relative inline-flex h-6 w-11 items-center rounded-full border transition focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--border-color-focus)]",
|
|
1013
|
-
e ? "border-[var(--md-primary)] bg-[var(--md-primary)]" : "border-[var(--md-outline)] bg-[var(--md-surface-container-high)]"
|
|
1014
|
-
),
|
|
1015
|
-
onClick: () => r == null ? void 0 : r(!e),
|
|
1016
|
-
role: "switch",
|
|
1017
|
-
type: "button",
|
|
1018
|
-
...o,
|
|
1019
|
-
children: /* @__PURE__ */ t(
|
|
1020
|
-
"span",
|
|
1021
|
-
{
|
|
1022
|
-
className: f(
|
|
1023
|
-
"inline-block h-5 w-5 rounded-full bg-[var(--md-surface)] shadow transition",
|
|
1024
|
-
e ? "translate-x-5" : "translate-x-0.5"
|
|
1025
|
-
)
|
|
1026
|
-
}
|
|
1027
|
-
)
|
|
1028
|
-
}
|
|
1029
|
-
),
|
|
1030
|
-
a && /* @__PURE__ */ t("span", { className: "text-sm text-[var(--text-primary)]", children: a })
|
|
1031
|
-
] }), pe = ({
|
|
1032
|
-
className: e,
|
|
1033
|
-
children: r,
|
|
1034
|
-
onRemove: a,
|
|
1035
|
-
...n
|
|
1036
|
-
}) => /* @__PURE__ */ m(
|
|
1037
|
-
"span",
|
|
1038
|
-
{
|
|
1039
|
-
className: f(
|
|
1040
|
-
"inline-flex items-center gap-1 rounded-[var(--border-radius-sm)] border border-[var(--border-color)] bg-[var(--bg-secondary)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",
|
|
1041
|
-
e
|
|
1042
|
-
),
|
|
1043
|
-
...n,
|
|
1044
|
-
children: [
|
|
1045
|
-
r,
|
|
1046
|
-
a && /* @__PURE__ */ t(
|
|
1047
|
-
"button",
|
|
1048
|
-
{
|
|
1049
|
-
"aria-label": "Remover tag",
|
|
1050
|
-
className: "inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--text-muted)] transition hover:bg-[var(--bg-hover)] hover:text-[var(--text-primary)]",
|
|
1051
|
-
onClick: a,
|
|
1052
|
-
type: "button",
|
|
1053
|
-
children: "×"
|
|
1054
|
-
}
|
|
1055
|
-
)
|
|
1056
|
-
]
|
|
1057
|
-
}
|
|
1058
|
-
), ge = ({ items: e, defaultTabId: r }) => {
|
|
1059
|
-
var v;
|
|
1060
|
-
const [a, n] = N(r ?? ((v = e[0]) == null ? void 0 : v.id)), o = e.find((c) => c.id === a) ?? e[0], s = Math.max(
|
|
1061
|
-
0,
|
|
1062
|
-
e.findIndex((c) => c.id === (o == null ? void 0 : o.id))
|
|
1063
|
-
), d = (c) => {
|
|
1064
|
-
const i = e[c];
|
|
1065
|
-
if (!i)
|
|
1066
|
-
return;
|
|
1067
|
-
n(i.id);
|
|
1068
|
-
const l = document.getElementById(`tab-${i.id}`);
|
|
1069
|
-
l == null || l.focus();
|
|
1070
|
-
};
|
|
1071
|
-
return /* @__PURE__ */ m("div", { className: "grid gap-3", children: [
|
|
1072
|
-
/* @__PURE__ */ t(
|
|
1073
|
-
"div",
|
|
1074
|
-
{
|
|
1075
|
-
"aria-orientation": "horizontal",
|
|
1076
|
-
className: "inline-flex flex-wrap gap-1 rounded-[var(--border-radius-md)] bg-[var(--bg-tertiary)] p-1",
|
|
1077
|
-
role: "tablist",
|
|
1078
|
-
children: e.map((c, i) => /* @__PURE__ */ t(
|
|
1079
|
-
"button",
|
|
1080
|
-
{
|
|
1081
|
-
"aria-controls": `panel-${c.id}`,
|
|
1082
|
-
"aria-selected": a === c.id,
|
|
1083
|
-
className: f(
|
|
1084
|
-
"rounded-[var(--border-radius-sm)] px-3 py-1.5 text-sm transition",
|
|
1085
|
-
a === c.id ? "bg-[var(--bg-secondary)] text-[var(--text-primary)] shadow-[var(--shadow-xs)]" : "text-[var(--text-secondary)] hover:bg-[var(--bg-hover)]"
|
|
1086
|
-
),
|
|
1087
|
-
id: `tab-${c.id}`,
|
|
1088
|
-
onClick: () => n(c.id),
|
|
1089
|
-
onKeyDown: (l) => {
|
|
1090
|
-
l.key === "ArrowRight" ? (l.preventDefault(), d((i + 1) % e.length)) : l.key === "ArrowLeft" ? (l.preventDefault(), d((i - 1 + e.length) % e.length)) : l.key === "Home" ? (l.preventDefault(), d(0)) : l.key === "End" && (l.preventDefault(), d(e.length - 1));
|
|
1091
|
-
},
|
|
1092
|
-
role: "tab",
|
|
1093
|
-
tabIndex: i === s ? 0 : -1,
|
|
1094
|
-
type: "button",
|
|
1095
|
-
children: c.label
|
|
1096
|
-
},
|
|
1097
|
-
c.id
|
|
1098
|
-
))
|
|
1099
|
-
}
|
|
1100
|
-
),
|
|
1101
|
-
/* @__PURE__ */ t(
|
|
1102
|
-
"div",
|
|
1103
|
-
{
|
|
1104
|
-
"aria-labelledby": `tab-${(o == null ? void 0 : o.id) ?? ""}`,
|
|
1105
|
-
className: "rounded-[var(--border-radius-md)] border border-[var(--border-color)] bg-[var(--bg-secondary)] p-4",
|
|
1106
|
-
id: `panel-${(o == null ? void 0 : o.id) ?? ""}`,
|
|
1107
|
-
role: "tabpanel",
|
|
1108
|
-
children: o == null ? void 0 : o.content
|
|
1109
|
-
}
|
|
1110
|
-
)
|
|
1111
|
-
] });
|
|
1112
|
-
}, ye = ({ className: e, children: r, ...a }) => /* @__PURE__ */ t("div", { className: "overflow-x-auto rounded-[var(--border-radius-md)] border border-[var(--border-color)]", children: /* @__PURE__ */ t(
|
|
1113
|
-
"table",
|
|
1114
|
-
{
|
|
1115
|
-
className: f(
|
|
1116
|
-
"w-full min-w-[36rem] border-collapse bg-[var(--bg-secondary)] text-left",
|
|
1117
|
-
e
|
|
1118
|
-
),
|
|
1119
|
-
...a,
|
|
1120
|
-
children: r
|
|
1121
|
-
}
|
|
1122
|
-
) }), we = ({
|
|
1123
|
-
label: e,
|
|
1124
|
-
helperText: r,
|
|
1125
|
-
error: a,
|
|
1126
|
-
className: n,
|
|
1127
|
-
id: o,
|
|
1128
|
-
...s
|
|
1129
|
-
}) => {
|
|
1130
|
-
const d = o || `textarea-${Math.random().toString(36).slice(2, 9)}`;
|
|
1131
|
-
return /* @__PURE__ */ m("div", { className: "grid gap-1", children: [
|
|
1132
|
-
e && /* @__PURE__ */ t(
|
|
1133
|
-
"label",
|
|
1134
|
-
{
|
|
1135
|
-
className: "text-[var(--font-size-sm)] font-[var(--font-weight-semibold)] text-[var(--md-on-surface)]",
|
|
1136
|
-
htmlFor: d,
|
|
1137
|
-
children: e
|
|
1138
|
-
}
|
|
1139
|
-
),
|
|
1140
|
-
/* @__PURE__ */ t(
|
|
1141
|
-
"textarea",
|
|
1142
|
-
{
|
|
1143
|
-
className: f(
|
|
1144
|
-
"min-h-24 w-full rounded-[var(--border-radius-md)] border border-[var(--md-outline-variant)] bg-[var(--md-surface)] px-3.5 py-2 text-[var(--md-on-surface)] outline-none transition placeholder:text-[var(--md-on-surface-variant)] focus:border-[var(--border-color-focus)] focus:[box-shadow:0_0_0_0.1875rem_rgba(47,93,140,0.15)]",
|
|
1145
|
-
a ? "border-[var(--md-error)] focus:border-[var(--md-error)] focus:[box-shadow:0_0_0_0.1875rem_rgba(186,26,26,0.2)]" : "",
|
|
1146
|
-
n
|
|
1147
|
-
),
|
|
1148
|
-
id: d,
|
|
1149
|
-
...s
|
|
1150
|
-
}
|
|
1151
|
-
),
|
|
1152
|
-
a ? /* @__PURE__ */ t("span", { className: "text-xs text-[var(--md-error)]", children: a }) : r && /* @__PURE__ */ t("span", { className: "text-xs text-[var(--md-on-surface-variant)]", children: r })
|
|
1153
|
-
] });
|
|
1154
|
-
}, P = ({
|
|
1155
|
-
tone: e = "info",
|
|
1156
|
-
title: r,
|
|
1157
|
-
description: a,
|
|
1158
|
-
onDismiss: n,
|
|
1159
|
-
className: o,
|
|
1160
|
-
...s
|
|
1161
|
-
}) => {
|
|
1162
|
-
const d = {
|
|
1163
|
-
info: "border-[var(--info-color)]/40",
|
|
1164
|
-
success: "border-[var(--success-color)]/40",
|
|
1165
|
-
warning: "border-[var(--warning-color)]/40",
|
|
1166
|
-
error: "border-[var(--md-error)]/40"
|
|
1167
|
-
}[e], v = e === "error" || e === "warning" ? "assertive" : "polite", c = e === "error" || e === "warning" ? "alert" : "status";
|
|
1168
|
-
return /* @__PURE__ */ m(
|
|
1169
|
-
"div",
|
|
1170
|
-
{
|
|
1171
|
-
className: f(
|
|
1172
|
-
"w-[22rem] rounded-[var(--border-radius-md)] border bg-[var(--bg-secondary)] p-3 shadow-[var(--shadow-lg)]",
|
|
1173
|
-
d,
|
|
1174
|
-
o
|
|
1175
|
-
),
|
|
1176
|
-
"aria-atomic": "true",
|
|
1177
|
-
"aria-live": v,
|
|
1178
|
-
onKeyDown: (i) => {
|
|
1179
|
-
i.key === "Escape" && (n == null || n());
|
|
1180
|
-
},
|
|
1181
|
-
role: c,
|
|
1182
|
-
tabIndex: 0,
|
|
1183
|
-
...s,
|
|
1184
|
-
children: [
|
|
1185
|
-
/* @__PURE__ */ m("div", { className: "flex items-start justify-between gap-2", children: [
|
|
1186
|
-
/* @__PURE__ */ t("p", { className: "m-0 text-sm font-semibold text-[var(--text-primary)]", children: r }),
|
|
1187
|
-
n && /* @__PURE__ */ t(
|
|
1188
|
-
"button",
|
|
1189
|
-
{
|
|
1190
|
-
"aria-label": "Fechar notificação",
|
|
1191
|
-
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-[var(--border-radius-sm)] text-[var(--text-secondary)] transition hover:bg-[var(--bg-hover)] hover:text-[var(--text-primary)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--border-color-focus)]",
|
|
1192
|
-
onClick: n,
|
|
1193
|
-
type: "button",
|
|
1194
|
-
children: /* @__PURE__ */ t("span", { "aria-hidden": !0, children: "×" })
|
|
1195
|
-
}
|
|
1196
|
-
)
|
|
1197
|
-
] }),
|
|
1198
|
-
a && /* @__PURE__ */ t("p", { className: "mt-1 text-sm text-[var(--text-secondary)]", children: a })
|
|
1199
|
-
]
|
|
1200
|
-
}
|
|
1201
|
-
);
|
|
1202
|
-
}, T = A(void 0), Ne = ({
|
|
1203
|
-
children: e,
|
|
1204
|
-
durationMs: r = 4e3
|
|
1205
|
-
}) => {
|
|
1206
|
-
const [a, n] = N([]), o = z(/* @__PURE__ */ new Map()), s = S((c) => {
|
|
1207
|
-
const i = o.current.get(c);
|
|
1208
|
-
i && (window.clearTimeout(i), o.current.delete(c)), n((l) => l.filter((u) => u.id !== c));
|
|
1209
|
-
}, []), d = S(
|
|
1210
|
-
(c) => {
|
|
1211
|
-
const i = c.id ?? `toast-${Math.random().toString(36).slice(2, 9)}`;
|
|
1212
|
-
n((u) => [...u, { ...c, id: i }]);
|
|
1213
|
-
const l = window.setTimeout(() => s(i), r);
|
|
1214
|
-
o.current.set(i, l);
|
|
1215
|
-
},
|
|
1216
|
-
[s, r]
|
|
1217
|
-
);
|
|
1218
|
-
w(() => () => {
|
|
1219
|
-
o.current.forEach((c) => window.clearTimeout(c)), o.current.clear();
|
|
1220
|
-
}, []);
|
|
1221
|
-
const v = R(
|
|
1222
|
-
() => ({ toasts: a, pushToast: d, dismissToast: s }),
|
|
1223
|
-
[a, d, s]
|
|
1224
|
-
);
|
|
1225
|
-
return /* @__PURE__ */ m(T.Provider, { value: v, children: [
|
|
1226
|
-
e,
|
|
1227
|
-
/* @__PURE__ */ t(q, {})
|
|
1228
|
-
] });
|
|
1229
|
-
}, ze = () => {
|
|
1230
|
-
const e = _(T);
|
|
1231
|
-
if (!e)
|
|
1232
|
-
throw new Error("useToast must be used inside ToastProvider");
|
|
1233
|
-
return e;
|
|
1234
|
-
}, q = () => {
|
|
1235
|
-
const e = _(T);
|
|
1236
|
-
return !e || e.toasts.length === 0 ? null : /* @__PURE__ */ t(
|
|
1237
|
-
"div",
|
|
1238
|
-
{
|
|
1239
|
-
"aria-label": "Notificações",
|
|
1240
|
-
className: "pointer-events-none fixed bottom-4 right-4 z-[1200] grid gap-2",
|
|
1241
|
-
role: "region",
|
|
1242
|
-
children: e.toasts.map((r) => /* @__PURE__ */ t(
|
|
1243
|
-
P,
|
|
1244
|
-
{
|
|
1245
|
-
...r,
|
|
1246
|
-
className: "pointer-events-auto",
|
|
1247
|
-
onDismiss: () => e.dismissToast(r.id)
|
|
1248
|
-
},
|
|
1249
|
-
r.id
|
|
1250
|
-
))
|
|
1251
|
-
}
|
|
1252
|
-
);
|
|
1253
|
-
}, ke = ({
|
|
1254
|
-
as: e = "h1",
|
|
1255
|
-
size: r = "2xl",
|
|
1256
|
-
weight: a = "bold",
|
|
1257
|
-
align: n = "left",
|
|
1258
|
-
gradient: o = !1,
|
|
1259
|
-
italic: s = !1,
|
|
1260
|
-
children: d,
|
|
1261
|
-
className: v = "",
|
|
1262
|
-
...c
|
|
1263
|
-
}) => {
|
|
1264
|
-
const i = e, l = {
|
|
1265
|
-
xs: "text-[var(--font-size-sm)]",
|
|
1266
|
-
sm: "text-[var(--font-size-base)]",
|
|
1267
|
-
md: "text-[var(--font-size-lg)]",
|
|
1268
|
-
lg: "text-[var(--font-size-xl)]",
|
|
1269
|
-
xl: "text-[var(--font-size-2xl)]",
|
|
1270
|
-
"2xl": "text-[var(--font-size-3xl)]",
|
|
1271
|
-
"3xl": "text-[var(--font-size-4xl)]",
|
|
1272
|
-
"4xl": "text-[3rem]"
|
|
1273
|
-
}, u = {
|
|
1274
|
-
light: "font-[var(--font-weight-light)]",
|
|
1275
|
-
normal: "font-[var(--font-weight-normal)]",
|
|
1276
|
-
medium: "font-[var(--font-weight-medium)]",
|
|
1277
|
-
semibold: "font-[var(--font-weight-semibold)]",
|
|
1278
|
-
bold: "font-[var(--font-weight-bold)]",
|
|
1279
|
-
extrabold: "font-extrabold"
|
|
1280
|
-
}, h = {
|
|
1281
|
-
left: "text-left",
|
|
1282
|
-
center: "text-center",
|
|
1283
|
-
right: "text-right"
|
|
1284
|
-
}, b = o ? "bg-[linear-gradient(135deg,var(--text-primary)_0%,var(--primary-color)_50%,var(--secondary-color)_100%)] bg-clip-text text-transparent" : "", g = [
|
|
1285
|
-
"m-0 leading-[var(--line-height-tight)] text-[var(--text-primary)] transition-[var(--transition-colors)]",
|
|
1286
|
-
l[r],
|
|
1287
|
-
u[a],
|
|
1288
|
-
h[n],
|
|
1289
|
-
s ? "italic" : "not-italic",
|
|
1290
|
-
b,
|
|
1291
|
-
v
|
|
1292
|
-
].filter(Boolean).join(" ");
|
|
1293
|
-
return /* @__PURE__ */ t(i, { className: g, ...c, children: d });
|
|
1294
|
-
}, Ce = ({
|
|
1295
|
-
children: e,
|
|
1296
|
-
content: r,
|
|
1297
|
-
side: a = "top"
|
|
1298
|
-
}) => {
|
|
1299
|
-
const [n, o] = N(!1), s = B(), d = a === "top" ? "bottom-full mb-2 left-1/2 -translate-x-1/2" : "top-full mt-2 left-1/2 -translate-x-1/2", v = {
|
|
1300
|
-
"aria-describedby": s,
|
|
1301
|
-
onBlur: () => o(!1),
|
|
1302
|
-
onFocus: () => o(!0),
|
|
1303
|
-
onKeyDown: (i) => {
|
|
1304
|
-
i.key === "Escape" && o(!1);
|
|
1305
|
-
},
|
|
1306
|
-
onMouseEnter: () => o(!0),
|
|
1307
|
-
onMouseLeave: () => o(!1)
|
|
1308
|
-
}, c = K(e) ? /* @__PURE__ */ t("span", { className: "inline-flex", ...v, children: e }) : /* @__PURE__ */ t("span", { className: "inline-flex", tabIndex: 0, ...v, children: e });
|
|
1309
|
-
return /* @__PURE__ */ m("span", { className: "relative inline-flex", children: [
|
|
1310
|
-
c,
|
|
1311
|
-
/* @__PURE__ */ t(
|
|
1312
|
-
"span",
|
|
1313
|
-
{
|
|
1314
|
-
"aria-hidden": !n,
|
|
1315
|
-
className: f(
|
|
1316
|
-
"pointer-events-none absolute z-20 whitespace-nowrap rounded bg-[var(--brand-cinza-escuro)] px-2 py-1 text-xs text-white shadow-[var(--shadow-sm)] transition",
|
|
1317
|
-
n ? "opacity-100" : "opacity-0",
|
|
1318
|
-
d
|
|
1319
|
-
),
|
|
1320
|
-
id: s,
|
|
1321
|
-
role: "tooltip",
|
|
1322
|
-
children: r
|
|
1323
|
-
}
|
|
1324
|
-
)
|
|
1325
|
-
] });
|
|
1326
|
-
}, D = A(void 0), je = () => {
|
|
1327
|
-
const e = _(D);
|
|
1328
|
-
if (!e)
|
|
1329
|
-
throw new Error("useTheme must be used within a ThemeProvider");
|
|
1330
|
-
return e;
|
|
1331
|
-
}, Me = ({
|
|
1332
|
-
children: e,
|
|
1333
|
-
defaultTheme: r = "light"
|
|
1334
|
-
}) => {
|
|
1335
|
-
const [a, n] = N(() => typeof window > "u" ? r : window.localStorage.getItem("theme") || r);
|
|
1336
|
-
w(() => {
|
|
1337
|
-
typeof window > "u" || (window.localStorage.setItem("theme", a), document.documentElement.setAttribute("data-theme", a));
|
|
1338
|
-
}, [a]);
|
|
1339
|
-
const o = () => {
|
|
1340
|
-
n((s) => s === "dark" ? "light" : "dark");
|
|
1341
|
-
};
|
|
1342
|
-
return /* @__PURE__ */ t(D.Provider, { value: { theme: a, toggleTheme: o }, children: e });
|
|
1343
|
-
};
|
|
1344
|
-
export {
|
|
1345
|
-
V as Accordion,
|
|
1346
|
-
G as Alert,
|
|
1347
|
-
U as Badge,
|
|
1348
|
-
W as Button,
|
|
1349
|
-
Y as Card,
|
|
1350
|
-
J as Checkbox,
|
|
1351
|
-
L as Chip,
|
|
1352
|
-
ae as Container,
|
|
1353
|
-
Q as Divider,
|
|
1354
|
-
X as EmptyState,
|
|
1355
|
-
Z as Footer,
|
|
1356
|
-
oe as Grid,
|
|
1357
|
-
ee as Header,
|
|
1358
|
-
re as Input,
|
|
1359
|
-
ne as Modal,
|
|
1360
|
-
ce as PageHeader,
|
|
1361
|
-
le as Pagination,
|
|
1362
|
-
de as Paragraph,
|
|
1363
|
-
me as Popover,
|
|
1364
|
-
ve as Radio,
|
|
1365
|
-
ue as SectionHeader,
|
|
1366
|
-
fe as Select,
|
|
1367
|
-
se as Sidebar,
|
|
1368
|
-
xe as Skeleton,
|
|
1369
|
-
te as Stack,
|
|
1370
|
-
be as Subtitle,
|
|
1371
|
-
he as Switch,
|
|
1372
|
-
ye as Table,
|
|
1373
|
-
ge as Tabs,
|
|
1374
|
-
pe as Tag,
|
|
1375
|
-
we as Textarea,
|
|
1376
|
-
Me as ThemeProvider,
|
|
1377
|
-
ke as Title,
|
|
1378
|
-
P as Toast,
|
|
1379
|
-
Ne as ToastProvider,
|
|
1380
|
-
q as ToastViewport,
|
|
1381
|
-
Ce as Tooltip,
|
|
1382
|
-
ie as Topbar,
|
|
1383
|
-
je as useTheme,
|
|
1384
|
-
ze as useToast
|
|
1385
|
-
};
|
|
1386
|
-
//# sourceMappingURL=oficios-ui.js.map
|