@motor-hero/ui-kit 0.5.1
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/README.md +52 -0
- package/dist/components/auth-card.d.ts +10 -0
- package/dist/components/auth-card.d.ts.map +1 -0
- package/dist/components/confirm-dialog.d.ts +15 -0
- package/dist/components/confirm-dialog.d.ts.map +1 -0
- package/dist/components/data-table-wrapper.d.ts +16 -0
- package/dist/components/data-table-wrapper.d.ts.map +1 -0
- package/dist/components/empty-state.d.ts +11 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/form-dialog.d.ts +14 -0
- package/dist/components/form-dialog.d.ts.map +1 -0
- package/dist/components/form-field.d.ts +12 -0
- package/dist/components/form-field.d.ts.map +1 -0
- package/dist/components/mobile-card-list.d.ts +12 -0
- package/dist/components/mobile-card-list.d.ts.map +1 -0
- package/dist/components/mode-toggle.d.ts +2 -0
- package/dist/components/mode-toggle.d.ts.map +1 -0
- package/dist/components/page-header.d.ts +10 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/pagination.d.ts +10 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/responsive-data-view.d.ts +14 -0
- package/dist/components/responsive-data-view.d.ts.map +1 -0
- package/dist/components/search-input.d.ts +7 -0
- package/dist/components/search-input.d.ts.map +1 -0
- package/dist/components/stat-card.d.ts +11 -0
- package/dist/components/stat-card.d.ts.map +1 -0
- package/dist/components/status-dot.d.ts +8 -0
- package/dist/components/status-dot.d.ts.map +1 -0
- package/dist/components/table-skeleton.d.ts +7 -0
- package/dist/components/table-skeleton.d.ts.map +1 -0
- package/dist/components/theme-provider.d.ts +14 -0
- package/dist/components/theme-provider.d.ts.map +1 -0
- package/dist/components/toaster.d.ts +5 -0
- package/dist/components/toaster.d.ts.map +1 -0
- package/dist/hooks/use-disclosure.d.ts +8 -0
- package/dist/hooks/use-disclosure.d.ts.map +1 -0
- package/dist/hooks/use-toast.d.ts +5 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/index.cjs +620 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +561 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-error.d.ts +2 -0
- package/dist/lib/api-error.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/styles.css +45 -0
- package/package.json +80 -0
- package/src/components/auth-card.tsx +25 -0
- package/src/components/confirm-dialog.tsx +58 -0
- package/src/components/data-table-wrapper.tsx +65 -0
- package/src/components/empty-state.tsx +22 -0
- package/src/components/form-dialog.tsx +48 -0
- package/src/components/form-field.tsx +26 -0
- package/src/components/mobile-card-list.tsx +54 -0
- package/src/components/mode-toggle.tsx +47 -0
- package/src/components/page-header.tsx +22 -0
- package/src/components/pagination.tsx +31 -0
- package/src/components/responsive-data-view.tsx +31 -0
- package/src/components/search-input.tsx +36 -0
- package/src/components/stat-card.tsx +35 -0
- package/src/components/status-dot.tsx +16 -0
- package/src/components/table-skeleton.tsx +20 -0
- package/src/components/theme-provider.tsx +69 -0
- package/src/components/toaster.tsx +31 -0
- package/src/hooks/use-disclosure.ts +9 -0
- package/src/hooks/use-toast.ts +30 -0
- package/src/index.ts +29 -0
- package/src/lib/api-error.ts +7 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles.css +45 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
// src/components/theme-provider.tsx
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var initialState = {
|
|
5
|
+
theme: "system",
|
|
6
|
+
setTheme: () => null
|
|
7
|
+
};
|
|
8
|
+
var ThemeProviderContext = createContext(initialState);
|
|
9
|
+
function ThemeProvider({
|
|
10
|
+
children,
|
|
11
|
+
defaultTheme = "system",
|
|
12
|
+
storageKey = "ui-theme",
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const [theme, setTheme] = useState(
|
|
16
|
+
() => localStorage.getItem(storageKey) || defaultTheme
|
|
17
|
+
);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const root = window.document.documentElement;
|
|
20
|
+
root.classList.remove("light", "dark");
|
|
21
|
+
if (theme === "system") {
|
|
22
|
+
const systemTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
23
|
+
root.classList.add(systemTheme);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
root.classList.add(theme);
|
|
27
|
+
}, [theme]);
|
|
28
|
+
const value = {
|
|
29
|
+
theme,
|
|
30
|
+
setTheme: (theme2) => {
|
|
31
|
+
localStorage.setItem(storageKey, theme2);
|
|
32
|
+
setTheme(theme2);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ jsx(ThemeProviderContext.Provider, { ...props, value, children });
|
|
36
|
+
}
|
|
37
|
+
function useTheme() {
|
|
38
|
+
const context = useContext(ThemeProviderContext);
|
|
39
|
+
if (context === void 0) {
|
|
40
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
41
|
+
}
|
|
42
|
+
return context;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/components/mode-toggle.tsx
|
|
46
|
+
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
47
|
+
import { Moon, Sun, Monitor } from "lucide-react";
|
|
48
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
49
|
+
function ModeToggle() {
|
|
50
|
+
const { setTheme } = useTheme();
|
|
51
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.Root, { children: [
|
|
52
|
+
/* @__PURE__ */ jsx2(DropdownMenu.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
57
|
+
"aria-label": "Alternar tema",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx2(Sun, { className: "h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
|
|
60
|
+
/* @__PURE__ */ jsx2(Moon, { className: "absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
) }),
|
|
64
|
+
/* @__PURE__ */ jsx2(DropdownMenu.Portal, { children: /* @__PURE__ */ jsxs(
|
|
65
|
+
DropdownMenu.Content,
|
|
66
|
+
{
|
|
67
|
+
align: "end",
|
|
68
|
+
className: "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ jsxs(
|
|
71
|
+
DropdownMenu.Item,
|
|
72
|
+
{
|
|
73
|
+
className: "flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent",
|
|
74
|
+
onClick: () => setTheme("light"),
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx2(Sun, { className: "h-4 w-4" }),
|
|
77
|
+
" Claro"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsxs(
|
|
82
|
+
DropdownMenu.Item,
|
|
83
|
+
{
|
|
84
|
+
className: "flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent",
|
|
85
|
+
onClick: () => setTheme("dark"),
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsx2(Moon, { className: "h-4 w-4" }),
|
|
88
|
+
" Escuro"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ jsxs(
|
|
93
|
+
DropdownMenu.Item,
|
|
94
|
+
{
|
|
95
|
+
className: "flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent",
|
|
96
|
+
onClick: () => setTheme("system"),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx2(Monitor, { className: "h-4 w-4" }),
|
|
99
|
+
" Sistema"
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
) })
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/components/empty-state.tsx
|
|
110
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
111
|
+
function EmptyState({ icon, title, description, action, className }) {
|
|
112
|
+
return /* @__PURE__ */ jsxs2("div", { className: `flex flex-col items-center justify-center py-16 text-center ${className ?? ""}`, children: [
|
|
113
|
+
icon && /* @__PURE__ */ jsx3("div", { className: "mb-4 text-muted-foreground", children: icon }),
|
|
114
|
+
/* @__PURE__ */ jsx3("h3", { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
115
|
+
description && /* @__PURE__ */ jsx3("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: description }),
|
|
116
|
+
action && /* @__PURE__ */ jsx3("div", { className: "mt-4", children: action })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/components/confirm-dialog.tsx
|
|
121
|
+
import * as AlertDialog from "@radix-ui/react-alert-dialog";
|
|
122
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
123
|
+
function ConfirmDialog({
|
|
124
|
+
open,
|
|
125
|
+
onOpenChange,
|
|
126
|
+
onConfirm,
|
|
127
|
+
title,
|
|
128
|
+
description,
|
|
129
|
+
confirmLabel = "Confirmar",
|
|
130
|
+
cancelLabel = "Cancelar",
|
|
131
|
+
loading = false,
|
|
132
|
+
variant = "default"
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsx4(AlertDialog.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs3(AlertDialog.Portal, { children: [
|
|
135
|
+
/* @__PURE__ */ jsx4(AlertDialog.Overlay, { className: "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
|
|
136
|
+
/* @__PURE__ */ jsxs3(AlertDialog.Content, { className: "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg", children: [
|
|
137
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col space-y-2 text-center sm:text-left", children: [
|
|
138
|
+
/* @__PURE__ */ jsx4(AlertDialog.Title, { className: "text-lg font-semibold", children: title }),
|
|
139
|
+
/* @__PURE__ */ jsx4(AlertDialog.Description, { className: "text-sm text-muted-foreground", children: description })
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
142
|
+
/* @__PURE__ */ jsx4(AlertDialog.Cancel, { className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer", children: cancelLabel }),
|
|
143
|
+
/* @__PURE__ */ jsx4(
|
|
144
|
+
AlertDialog.Action,
|
|
145
|
+
{
|
|
146
|
+
onClick: onConfirm,
|
|
147
|
+
disabled: loading,
|
|
148
|
+
className: `inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${variant === "destructive" ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "bg-primary text-primary-foreground hover:bg-primary/90"}`,
|
|
149
|
+
children: loading ? "Aguarde..." : confirmLabel
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
] })
|
|
153
|
+
] })
|
|
154
|
+
] }) });
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/components/page-header.tsx
|
|
158
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
159
|
+
function PageHeader({ title, description, action, className }) {
|
|
160
|
+
return /* @__PURE__ */ jsxs4("div", { className: `flex items-center justify-between ${className ?? ""}`, children: [
|
|
161
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
162
|
+
/* @__PURE__ */ jsx5("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
163
|
+
description && /* @__PURE__ */ jsx5("p", { className: "text-sm text-muted-foreground", children: description })
|
|
164
|
+
] }),
|
|
165
|
+
action && /* @__PURE__ */ jsx5("div", { children: action })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/components/status-dot.tsx
|
|
170
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
171
|
+
function StatusDot({ active, label, className }) {
|
|
172
|
+
return /* @__PURE__ */ jsxs5("span", { className: `inline-flex items-center gap-2 ${className ?? ""}`, children: [
|
|
173
|
+
/* @__PURE__ */ jsx6(
|
|
174
|
+
"span",
|
|
175
|
+
{
|
|
176
|
+
className: `h-2 w-2 rounded-full ${active ? "bg-green-500" : "bg-red-500"}`
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
label && /* @__PURE__ */ jsx6("span", { children: label })
|
|
180
|
+
] });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// src/components/form-field.tsx
|
|
184
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
185
|
+
function FormField({ label, htmlFor, error, required, children, className }) {
|
|
186
|
+
return /* @__PURE__ */ jsxs6("div", { className: `space-y-2 ${className ?? ""}`, children: [
|
|
187
|
+
/* @__PURE__ */ jsxs6(
|
|
188
|
+
"label",
|
|
189
|
+
{
|
|
190
|
+
htmlFor,
|
|
191
|
+
className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
192
|
+
children: [
|
|
193
|
+
label,
|
|
194
|
+
required && /* @__PURE__ */ jsx7("span", { className: "ml-1 text-destructive", children: "*" })
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
children,
|
|
199
|
+
error && /* @__PURE__ */ jsx7("p", { className: "text-sm text-destructive", children: error })
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// src/components/form-dialog.tsx
|
|
204
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
205
|
+
function FormDialogLayout({
|
|
206
|
+
title,
|
|
207
|
+
children,
|
|
208
|
+
onSubmit,
|
|
209
|
+
submitLabel = "Salvar",
|
|
210
|
+
cancelLabel = "Cancelar",
|
|
211
|
+
onCancel,
|
|
212
|
+
isSubmitting = false,
|
|
213
|
+
isDisabled = false
|
|
214
|
+
}) {
|
|
215
|
+
return /* @__PURE__ */ jsxs7("form", { onSubmit, children: [
|
|
216
|
+
/* @__PURE__ */ jsx8("div", { className: "flex flex-col space-y-1.5 text-center sm:text-left", children: /* @__PURE__ */ jsx8("h2", { className: "text-lg font-semibold leading-none tracking-tight", children: title }) }),
|
|
217
|
+
/* @__PURE__ */ jsx8("div", { className: "space-y-4 py-4", children }),
|
|
218
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
219
|
+
/* @__PURE__ */ jsx8(
|
|
220
|
+
"button",
|
|
221
|
+
{
|
|
222
|
+
type: "button",
|
|
223
|
+
onClick: onCancel,
|
|
224
|
+
className: "inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
225
|
+
children: cancelLabel
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx8(
|
|
229
|
+
"button",
|
|
230
|
+
{
|
|
231
|
+
type: "submit",
|
|
232
|
+
disabled: isSubmitting || isDisabled,
|
|
233
|
+
className: "inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
234
|
+
children: isSubmitting ? "Salvando..." : submitLabel
|
|
235
|
+
}
|
|
236
|
+
)
|
|
237
|
+
] })
|
|
238
|
+
] });
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/components/auth-card.tsx
|
|
242
|
+
import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
243
|
+
function AuthCard({ title, description, children, footer }) {
|
|
244
|
+
return /* @__PURE__ */ jsx9("div", { className: "flex min-h-screen items-center justify-center px-4", children: /* @__PURE__ */ jsxs8("div", { className: "w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
245
|
+
/* @__PURE__ */ jsxs8("div", { className: "mb-6 text-center", children: [
|
|
246
|
+
/* @__PURE__ */ jsx9("h1", { className: "text-2xl font-semibold tracking-tight", children: title }),
|
|
247
|
+
description && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ jsx9("div", { className: "space-y-4", children }),
|
|
250
|
+
footer && /* @__PURE__ */ jsx9("div", { className: "mt-4", children: footer })
|
|
251
|
+
] }) });
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/components/pagination.tsx
|
|
255
|
+
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
256
|
+
function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }) {
|
|
257
|
+
return /* @__PURE__ */ jsxs9("div", { className: `flex items-center justify-end gap-4 ${className ?? ""}`, children: [
|
|
258
|
+
/* @__PURE__ */ jsx10(
|
|
259
|
+
"button",
|
|
260
|
+
{
|
|
261
|
+
type: "button",
|
|
262
|
+
onClick: () => onPageChange(page - 1),
|
|
263
|
+
disabled: !hasPreviousPage,
|
|
264
|
+
className: "inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
265
|
+
children: "Anterior"
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-sm text-muted-foreground", children: [
|
|
269
|
+
"P\xE1gina ",
|
|
270
|
+
page
|
|
271
|
+
] }),
|
|
272
|
+
/* @__PURE__ */ jsx10(
|
|
273
|
+
"button",
|
|
274
|
+
{
|
|
275
|
+
type: "button",
|
|
276
|
+
onClick: () => onPageChange(page + 1),
|
|
277
|
+
disabled: !hasNextPage,
|
|
278
|
+
className: "inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
279
|
+
children: "Pr\xF3ximo"
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
] });
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// src/components/table-skeleton.tsx
|
|
286
|
+
import { Fragment, jsx as jsx11 } from "react/jsx-runtime";
|
|
287
|
+
function TableSkeleton({ rows = 5, columns = 4 }) {
|
|
288
|
+
return /* @__PURE__ */ jsx11(Fragment, { children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsx11("tr", { className: "border-b transition-colors", children: Array.from({ length: columns }).map((_2, j) => /* @__PURE__ */ jsx11("td", { className: "p-4 align-middle", children: /* @__PURE__ */ jsx11("div", { className: "h-5 w-full animate-pulse rounded bg-muted" }) }, j)) }, i)) });
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/components/search-input.tsx
|
|
292
|
+
import * as React from "react";
|
|
293
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
294
|
+
var SearchInput = React.forwardRef(
|
|
295
|
+
({ containerClassName, className, ...props }, ref) => {
|
|
296
|
+
return /* @__PURE__ */ jsxs10("div", { className: `relative flex-1 ${containerClassName ?? ""}`, children: [
|
|
297
|
+
/* @__PURE__ */ jsxs10(
|
|
298
|
+
"svg",
|
|
299
|
+
{
|
|
300
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
301
|
+
width: "16",
|
|
302
|
+
height: "16",
|
|
303
|
+
viewBox: "0 0 24 24",
|
|
304
|
+
fill: "none",
|
|
305
|
+
stroke: "currentColor",
|
|
306
|
+
strokeWidth: "2",
|
|
307
|
+
strokeLinecap: "round",
|
|
308
|
+
strokeLinejoin: "round",
|
|
309
|
+
className: "absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ jsx12("circle", { cx: "11", cy: "11", r: "8" }),
|
|
312
|
+
/* @__PURE__ */ jsx12("path", { d: "m21 21-4.3-4.3" })
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
/* @__PURE__ */ jsx12(
|
|
317
|
+
"input",
|
|
318
|
+
{
|
|
319
|
+
ref,
|
|
320
|
+
type: "text",
|
|
321
|
+
className: `flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 pl-10 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 ${className ?? ""}`,
|
|
322
|
+
...props
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
] });
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
SearchInput.displayName = "SearchInput";
|
|
329
|
+
|
|
330
|
+
// src/components/stat-card.tsx
|
|
331
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
332
|
+
function StatCard({ label, value, detail, icon, isLoading }) {
|
|
333
|
+
if (isLoading) {
|
|
334
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
335
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between pb-2", children: [
|
|
336
|
+
/* @__PURE__ */ jsx13("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
337
|
+
/* @__PURE__ */ jsx13("div", { className: "h-4 w-4 animate-pulse rounded bg-muted" })
|
|
338
|
+
] }),
|
|
339
|
+
/* @__PURE__ */ jsx13("div", { className: "mt-2 h-7 w-16 animate-pulse rounded bg-muted" }),
|
|
340
|
+
/* @__PURE__ */ jsx13("div", { className: "mt-1 h-4 w-20 animate-pulse rounded bg-muted" })
|
|
341
|
+
] });
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ jsxs11("div", { className: "rounded-lg border bg-card p-6 shadow-sm", children: [
|
|
344
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between pb-2", children: [
|
|
345
|
+
/* @__PURE__ */ jsx13("span", { className: "text-sm font-medium text-muted-foreground", children: label }),
|
|
346
|
+
icon && /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: icon })
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsx13("div", { className: "text-2xl font-bold", children: value }),
|
|
349
|
+
detail && /* @__PURE__ */ jsx13("p", { className: "text-xs text-muted-foreground", children: detail })
|
|
350
|
+
] });
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// src/components/data-table-wrapper.tsx
|
|
354
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
355
|
+
function DataTableWrapper({
|
|
356
|
+
children,
|
|
357
|
+
isEmpty,
|
|
358
|
+
isLoading,
|
|
359
|
+
emptyIcon,
|
|
360
|
+
emptyTitle = "Nenhum registro encontrado",
|
|
361
|
+
emptyDescription,
|
|
362
|
+
page,
|
|
363
|
+
onPageChange,
|
|
364
|
+
hasNextPage = false,
|
|
365
|
+
hasPreviousPage = false
|
|
366
|
+
}) {
|
|
367
|
+
return /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
|
|
368
|
+
/* @__PURE__ */ jsx14("div", { className: "overflow-x-auto rounded-md border", children }),
|
|
369
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
370
|
+
emptyIcon && /* @__PURE__ */ jsx14("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
371
|
+
/* @__PURE__ */ jsx14("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
372
|
+
emptyDescription && /* @__PURE__ */ jsx14("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
373
|
+
] }),
|
|
374
|
+
page !== void 0 && onPageChange && /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-end gap-4", children: [
|
|
375
|
+
/* @__PURE__ */ jsx14(
|
|
376
|
+
"button",
|
|
377
|
+
{
|
|
378
|
+
type: "button",
|
|
379
|
+
onClick: () => onPageChange(page - 1),
|
|
380
|
+
disabled: !hasPreviousPage,
|
|
381
|
+
className: "inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
382
|
+
children: "Anterior"
|
|
383
|
+
}
|
|
384
|
+
),
|
|
385
|
+
/* @__PURE__ */ jsxs12("span", { className: "text-sm text-muted-foreground", children: [
|
|
386
|
+
"P\xE1gina ",
|
|
387
|
+
page
|
|
388
|
+
] }),
|
|
389
|
+
/* @__PURE__ */ jsx14(
|
|
390
|
+
"button",
|
|
391
|
+
{
|
|
392
|
+
type: "button",
|
|
393
|
+
onClick: () => onPageChange(page + 1),
|
|
394
|
+
disabled: !hasNextPage,
|
|
395
|
+
className: "inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50",
|
|
396
|
+
children: "Pr\xF3ximo"
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
] })
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// src/components/mobile-card-list.tsx
|
|
404
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
405
|
+
function MobileCardList({
|
|
406
|
+
data,
|
|
407
|
+
renderCard,
|
|
408
|
+
keyExtractor,
|
|
409
|
+
isLoading = false,
|
|
410
|
+
loadingCount = 5,
|
|
411
|
+
className
|
|
412
|
+
}) {
|
|
413
|
+
if (isLoading) {
|
|
414
|
+
return /* @__PURE__ */ jsx15("div", { className: `space-y-3 ${className ?? ""}`, children: Array.from({ length: loadingCount }).map((_, i) => /* @__PURE__ */ jsx15("div", { className: "rounded-xl border p-4", children: /* @__PURE__ */ jsxs13("div", { className: "space-y-3", children: [
|
|
415
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between", children: [
|
|
416
|
+
/* @__PURE__ */ jsx15("div", { className: "h-5 w-32 animate-pulse rounded bg-muted" }),
|
|
417
|
+
/* @__PURE__ */ jsx15("div", { className: "h-5 w-16 animate-pulse rounded bg-muted" })
|
|
418
|
+
] }),
|
|
419
|
+
/* @__PURE__ */ jsx15("div", { className: "h-4 w-48 animate-pulse rounded bg-muted" }),
|
|
420
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex justify-between", children: [
|
|
421
|
+
/* @__PURE__ */ jsx15("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
422
|
+
/* @__PURE__ */ jsx15("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" })
|
|
423
|
+
] })
|
|
424
|
+
] }) }, i)) });
|
|
425
|
+
}
|
|
426
|
+
return /* @__PURE__ */ jsx15("div", { className: `space-y-3 ${className ?? ""}`, children: data.map((item, index) => /* @__PURE__ */ jsx15(
|
|
427
|
+
"div",
|
|
428
|
+
{
|
|
429
|
+
className: "rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]",
|
|
430
|
+
children: renderCard(item, index)
|
|
431
|
+
},
|
|
432
|
+
keyExtractor(item)
|
|
433
|
+
)) });
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// src/components/responsive-data-view.tsx
|
|
437
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
438
|
+
function ResponsiveDataView({
|
|
439
|
+
table,
|
|
440
|
+
cards,
|
|
441
|
+
isEmpty,
|
|
442
|
+
isLoading,
|
|
443
|
+
emptyIcon,
|
|
444
|
+
emptyTitle = "Nenhum registro encontrado",
|
|
445
|
+
emptyDescription,
|
|
446
|
+
pagination
|
|
447
|
+
}) {
|
|
448
|
+
return /* @__PURE__ */ jsxs14("div", { className: "space-y-4", children: [
|
|
449
|
+
/* @__PURE__ */ jsx16("div", { className: "hidden overflow-x-auto rounded-md border md:block", children: table }),
|
|
450
|
+
/* @__PURE__ */ jsx16("div", { className: "md:hidden", children: cards }),
|
|
451
|
+
!isLoading && isEmpty && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col items-center justify-center py-16 text-center", children: [
|
|
452
|
+
emptyIcon && /* @__PURE__ */ jsx16("div", { className: "mb-4 text-muted-foreground", children: emptyIcon }),
|
|
453
|
+
/* @__PURE__ */ jsx16("h3", { className: "text-lg font-semibold tracking-tight", children: emptyTitle }),
|
|
454
|
+
emptyDescription && /* @__PURE__ */ jsx16("p", { className: "mt-1 max-w-sm text-sm text-muted-foreground", children: emptyDescription })
|
|
455
|
+
] }),
|
|
456
|
+
pagination
|
|
457
|
+
] });
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// src/components/toaster.tsx
|
|
461
|
+
import { Toaster as Sonner } from "sonner";
|
|
462
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
463
|
+
function Toaster(props) {
|
|
464
|
+
const { theme = "system" } = useTheme();
|
|
465
|
+
return /* @__PURE__ */ jsx17(
|
|
466
|
+
Sonner,
|
|
467
|
+
{
|
|
468
|
+
theme,
|
|
469
|
+
className: "toaster group",
|
|
470
|
+
toastOptions: {
|
|
471
|
+
classNames: {
|
|
472
|
+
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-md",
|
|
473
|
+
description: "group-[.toast]:text-muted-foreground",
|
|
474
|
+
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
475
|
+
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
476
|
+
success: "group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-success/40",
|
|
477
|
+
error: "group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-destructive/40"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
...props
|
|
481
|
+
}
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// src/lib/utils.ts
|
|
486
|
+
import { clsx } from "clsx";
|
|
487
|
+
import { twMerge } from "tailwind-merge";
|
|
488
|
+
function cn(...inputs) {
|
|
489
|
+
return twMerge(clsx(inputs));
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// src/lib/api-error.ts
|
|
493
|
+
function extractApiError(err, fallbackMessage = "Ocorreu um erro inesperado.") {
|
|
494
|
+
const detail = err?.body?.detail || err?.message;
|
|
495
|
+
if (Array.isArray(detail) && detail.length > 0) {
|
|
496
|
+
return detail[0].msg;
|
|
497
|
+
}
|
|
498
|
+
return detail || fallbackMessage;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
// src/hooks/use-disclosure.ts
|
|
502
|
+
import { useCallback, useState as useState2 } from "react";
|
|
503
|
+
function useDisclosure(initial = false) {
|
|
504
|
+
const [open, setOpen] = useState2(initial);
|
|
505
|
+
const onOpen = useCallback(() => setOpen(true), []);
|
|
506
|
+
const onClose = useCallback(() => setOpen(false), []);
|
|
507
|
+
const onToggle = useCallback(() => setOpen((v) => !v), []);
|
|
508
|
+
return { open, onOpen, onClose, onToggle, setOpen };
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/hooks/use-toast.ts
|
|
512
|
+
import { toast } from "sonner";
|
|
513
|
+
import { useCallback as useCallback2 } from "react";
|
|
514
|
+
function useCustomToast() {
|
|
515
|
+
const showToast = useCallback2(
|
|
516
|
+
(title, description, status = "success") => {
|
|
517
|
+
switch (status) {
|
|
518
|
+
case "success":
|
|
519
|
+
toast.success(title, { description });
|
|
520
|
+
break;
|
|
521
|
+
case "error":
|
|
522
|
+
toast.error(title, { description });
|
|
523
|
+
break;
|
|
524
|
+
case "info":
|
|
525
|
+
toast.info(title, { description });
|
|
526
|
+
break;
|
|
527
|
+
case "warning":
|
|
528
|
+
toast.warning(title, { description });
|
|
529
|
+
break;
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
[]
|
|
533
|
+
);
|
|
534
|
+
return showToast;
|
|
535
|
+
}
|
|
536
|
+
export {
|
|
537
|
+
AuthCard,
|
|
538
|
+
ConfirmDialog,
|
|
539
|
+
DataTableWrapper,
|
|
540
|
+
EmptyState,
|
|
541
|
+
FormDialogLayout,
|
|
542
|
+
FormField,
|
|
543
|
+
MobileCardList,
|
|
544
|
+
ModeToggle,
|
|
545
|
+
PageHeader,
|
|
546
|
+
Pagination,
|
|
547
|
+
ResponsiveDataView,
|
|
548
|
+
SearchInput,
|
|
549
|
+
StatCard,
|
|
550
|
+
StatusDot,
|
|
551
|
+
TableSkeleton,
|
|
552
|
+
ThemeProvider,
|
|
553
|
+
Toaster,
|
|
554
|
+
cn,
|
|
555
|
+
extractApiError,
|
|
556
|
+
toast,
|
|
557
|
+
useCustomToast,
|
|
558
|
+
useDisclosure,
|
|
559
|
+
useTheme
|
|
560
|
+
};
|
|
561
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/theme-provider.tsx","../src/components/mode-toggle.tsx","../src/components/empty-state.tsx","../src/components/confirm-dialog.tsx","../src/components/page-header.tsx","../src/components/status-dot.tsx","../src/components/form-field.tsx","../src/components/form-dialog.tsx","../src/components/auth-card.tsx","../src/components/pagination.tsx","../src/components/table-skeleton.tsx","../src/components/search-input.tsx","../src/components/stat-card.tsx","../src/components/data-table-wrapper.tsx","../src/components/mobile-card-list.tsx","../src/components/responsive-data-view.tsx","../src/components/toaster.tsx","../src/lib/utils.ts","../src/lib/api-error.ts","../src/hooks/use-disclosure.ts","../src/hooks/use-toast.ts"],"sourcesContent":["import { createContext, useContext, useEffect, useState } from \"react\"\n\ntype Theme = \"dark\" | \"light\" | \"system\"\n\ntype ThemeProviderProps = {\n children: React.ReactNode\n defaultTheme?: Theme\n storageKey?: string\n}\n\ntype ThemeProviderState = {\n theme: Theme\n setTheme: (theme: Theme) => void\n}\n\nconst initialState: ThemeProviderState = {\n theme: \"system\",\n setTheme: () => null,\n}\n\nconst ThemeProviderContext = createContext<ThemeProviderState>(initialState)\n\nexport function ThemeProvider({\n children,\n defaultTheme = \"system\",\n storageKey = \"ui-theme\",\n ...props\n}: ThemeProviderProps) {\n const [theme, setTheme] = useState<Theme>(\n () => (localStorage.getItem(storageKey) as Theme) || defaultTheme\n )\n\n useEffect(() => {\n const root = window.document.documentElement\n root.classList.remove(\"light\", \"dark\")\n if (theme === \"system\") {\n const systemTheme = window.matchMedia(\"(prefers-color-scheme: dark)\").matches\n ? \"dark\"\n : \"light\"\n root.classList.add(systemTheme)\n return\n }\n root.classList.add(theme)\n }, [theme])\n\n const value = {\n theme,\n setTheme: (theme: Theme) => {\n localStorage.setItem(storageKey, theme)\n setTheme(theme)\n },\n }\n\n return (\n <ThemeProviderContext.Provider {...props} value={value}>\n {children}\n </ThemeProviderContext.Provider>\n )\n}\n\nexport function useTheme() {\n const context = useContext(ThemeProviderContext)\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\")\n }\n return context\n}\n\nexport type { Theme, ThemeProviderProps, ThemeProviderState }\n","import * as DropdownMenu from \"@radix-ui/react-dropdown-menu\"\nimport { Moon, Sun, Monitor } from \"lucide-react\"\nimport { useTheme } from \"./theme-provider\"\n\nexport function ModeToggle() {\n const { setTheme } = useTheme()\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-9 w-9 items-center justify-center rounded-md border border-input bg-background text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n aria-label=\"Alternar tema\"\n >\n <Sun className=\"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0\" />\n <Moon className=\"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100\" />\n </button>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align=\"end\"\n className=\"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95\"\n >\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"light\")}\n >\n <Sun className=\"h-4 w-4\" /> Claro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"dark\")}\n >\n <Moon className=\"h-4 w-4\" /> Escuro\n </DropdownMenu.Item>\n <DropdownMenu.Item\n className=\"flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent\"\n onClick={() => setTheme(\"system\")}\n >\n <Monitor className=\"h-4 w-4\" /> Sistema\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface EmptyStateProps {\n icon?: ReactNode\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function EmptyState({ icon, title, description, action, className }: EmptyStateProps) {\n return (\n <div className={`flex flex-col items-center justify-center py-16 text-center ${className ?? \"\"}`}>\n {icon && <div className=\"mb-4 text-muted-foreground\">{icon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{title}</h3>\n {description && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{description}</p>\n )}\n {action && <div className=\"mt-4\">{action}</div>}\n </div>\n )\n}\n","import * as AlertDialog from \"@radix-ui/react-alert-dialog\"\nimport type { ReactNode } from \"react\"\n\ninterface ConfirmDialogProps {\n open: boolean\n onOpenChange: (open: boolean) => void\n onConfirm: () => void\n title: string\n description: ReactNode\n confirmLabel?: string\n cancelLabel?: string\n loading?: boolean\n variant?: \"default\" | \"destructive\"\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n onConfirm,\n title,\n description,\n confirmLabel = \"Confirmar\",\n cancelLabel = \"Cancelar\",\n loading = false,\n variant = \"default\",\n}: ConfirmDialogProps) {\n return (\n <AlertDialog.Root open={open} onOpenChange={onOpenChange}>\n <AlertDialog.Portal>\n <AlertDialog.Overlay className=\"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\" />\n <AlertDialog.Content className=\"fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\">\n <div className=\"flex flex-col space-y-2 text-center sm:text-left\">\n <AlertDialog.Title className=\"text-lg font-semibold\">{title}</AlertDialog.Title>\n <AlertDialog.Description className=\"text-sm text-muted-foreground\">\n {description}\n </AlertDialog.Description>\n </div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <AlertDialog.Cancel className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer\">\n {cancelLabel}\n </AlertDialog.Cancel>\n <AlertDialog.Action\n onClick={onConfirm}\n disabled={loading}\n className={`inline-flex h-9 items-center justify-center rounded-md px-4 text-sm font-medium shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${\n variant === \"destructive\"\n ? \"bg-destructive text-destructive-foreground hover:bg-destructive/90\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\"\n }`}\n >\n {loading ? \"Aguarde...\" : confirmLabel}\n </AlertDialog.Action>\n </div>\n </AlertDialog.Content>\n </AlertDialog.Portal>\n </AlertDialog.Root>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface PageHeaderProps {\n title: string\n description?: string\n action?: ReactNode\n className?: string\n}\n\nexport function PageHeader({ title, description, action, className }: PageHeaderProps) {\n return (\n <div className={`flex items-center justify-between ${className ?? \"\"}`}>\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n {action && <div>{action}</div>}\n </div>\n )\n}\n","interface StatusDotProps {\n active: boolean\n label?: string\n className?: string\n}\n\nexport function StatusDot({ active, label, className }: StatusDotProps) {\n return (\n <span className={`inline-flex items-center gap-2 ${className ?? \"\"}`}>\n <span\n className={`h-2 w-2 rounded-full ${active ? \"bg-green-500\" : \"bg-red-500\"}`}\n />\n {label && <span>{label}</span>}\n </span>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormFieldProps {\n label: string\n htmlFor?: string\n error?: string\n required?: boolean\n children: ReactNode\n className?: string\n}\n\nexport function FormField({ label, htmlFor, error, required, children, className }: FormFieldProps) {\n return (\n <div className={`space-y-2 ${className ?? \"\"}`}>\n <label\n htmlFor={htmlFor}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"ml-1 text-destructive\">*</span>}\n </label>\n {children}\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface FormDialogLayoutProps {\n title: string\n children: ReactNode\n onSubmit: (e: React.FormEvent) => void\n submitLabel?: string\n cancelLabel?: string\n onCancel: () => void\n isSubmitting?: boolean\n isDisabled?: boolean\n}\n\nexport function FormDialogLayout({\n title,\n children,\n onSubmit,\n submitLabel = \"Salvar\",\n cancelLabel = \"Cancelar\",\n onCancel,\n isSubmitting = false,\n isDisabled = false,\n}: FormDialogLayoutProps) {\n return (\n <form onSubmit={onSubmit}>\n <div className=\"flex flex-col space-y-1.5 text-center sm:text-left\">\n <h2 className=\"text-lg font-semibold leading-none tracking-tight\">{title}</h2>\n </div>\n <div className=\"space-y-4 py-4\">{children}</div>\n <div className=\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\">\n <button\n type=\"button\"\n onClick={onCancel}\n className=\"inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {cancelLabel}\n </button>\n <button\n type=\"submit\"\n disabled={isSubmitting || isDisabled}\n className=\"inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow transition-colors hover:bg-primary/90 cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n {isSubmitting ? \"Salvando...\" : submitLabel}\n </button>\n </div>\n </form>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface AuthCardProps {\n title: string\n description?: string\n children: ReactNode\n footer?: ReactNode\n}\n\nexport function AuthCard({ title, description, children, footer }: AuthCardProps) {\n return (\n <div className=\"flex min-h-screen items-center justify-center px-4\">\n <div className=\"w-full max-w-sm rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"mb-6 text-center\">\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"mt-1 text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n <div className=\"space-y-4\">{children}</div>\n {footer && <div className=\"mt-4\">{footer}</div>}\n </div>\n </div>\n )\n}\n","interface PaginationProps {\n page: number\n onPageChange: (page: number) => void\n hasNextPage: boolean\n hasPreviousPage: boolean\n className?: string\n}\n\nexport function Pagination({ page, onPageChange, hasNextPage, hasPreviousPage, className }: PaginationProps) {\n return (\n <div className={`flex items-center justify-end gap-4 ${className ?? \"\"}`}>\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )\n}\n","interface TableSkeletonProps {\n rows?: number\n columns?: number\n}\n\nexport function TableSkeleton({ rows = 5, columns = 4 }: TableSkeletonProps) {\n return (\n <>\n {Array.from({ length: rows }).map((_, i) => (\n <tr key={i} className=\"border-b transition-colors\">\n {Array.from({ length: columns }).map((_, j) => (\n <td key={j} className=\"p-4 align-middle\">\n <div className=\"h-5 w-full animate-pulse rounded bg-muted\" />\n </td>\n ))}\n </tr>\n ))}\n </>\n )\n}\n","import * as React from \"react\"\n\ninterface SearchInputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n containerClassName?: string\n}\n\nexport const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(\n ({ containerClassName, className, ...props }, ref) => {\n return (\n <div className={`relative flex-1 ${containerClassName ?? \"\"}`}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d=\"m21 21-4.3-4.3\" />\n </svg>\n <input\n ref={ref}\n type=\"text\"\n className={`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 pl-10 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 ${className ?? \"\"}`}\n {...props}\n />\n </div>\n )\n }\n)\nSearchInput.displayName = \"SearchInput\"\n","import type { ReactNode } from \"react\"\n\ninterface StatCardProps {\n label: string\n value: ReactNode\n detail?: string\n icon?: ReactNode\n isLoading?: boolean\n}\n\nexport function StatCard({ label, value, detail, icon, isLoading }: StatCardProps) {\n if (isLoading) {\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-4 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"mt-2 h-7 w-16 animate-pulse rounded bg-muted\" />\n <div className=\"mt-1 h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n )\n }\n\n return (\n <div className=\"rounded-lg border bg-card p-6 shadow-sm\">\n <div className=\"flex items-center justify-between pb-2\">\n <span className=\"text-sm font-medium text-muted-foreground\">{label}</span>\n {icon && <span className=\"text-muted-foreground\">{icon}</span>}\n </div>\n <div className=\"text-2xl font-bold\">{value}</div>\n {detail && <p className=\"text-xs text-muted-foreground\">{detail}</p>}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface DataTableWrapperProps {\n children: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n page?: number\n onPageChange?: (page: number) => void\n hasNextPage?: boolean\n hasPreviousPage?: boolean\n}\n\nexport function DataTableWrapper({\n children,\n isEmpty,\n isLoading,\n emptyIcon,\n emptyTitle = \"Nenhum registro encontrado\",\n emptyDescription,\n page,\n onPageChange,\n hasNextPage = false,\n hasPreviousPage = false,\n}: DataTableWrapperProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"overflow-x-auto rounded-md border\">{children}</div>\n\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && (\n <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>\n )}\n </div>\n )}\n\n {page !== undefined && onPageChange && (\n <div className=\"flex items-center justify-end gap-4\">\n <button\n type=\"button\"\n onClick={() => onPageChange(page - 1)}\n disabled={!hasPreviousPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Anterior\n </button>\n <span className=\"text-sm text-muted-foreground\">Página {page}</span>\n <button\n type=\"button\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasNextPage}\n className=\"inline-flex h-8 items-center justify-center rounded-md border border-input bg-background px-3 text-xs font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground cursor-pointer disabled:pointer-events-none disabled:opacity-50\"\n >\n Próximo\n </button>\n </div>\n )}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface MobileCardListProps<T> {\n data: T[]\n renderCard: (item: T, index: number) => ReactNode\n keyExtractor: (item: T) => string\n isLoading?: boolean\n loadingCount?: number\n className?: string\n}\n\nexport function MobileCardList<T>({\n data,\n renderCard,\n keyExtractor,\n isLoading = false,\n loadingCount = 5,\n className,\n}: MobileCardListProps<T>) {\n if (isLoading) {\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {Array.from({ length: loadingCount }).map((_, i) => (\n <div key={i} className=\"rounded-xl border p-4\">\n <div className=\"space-y-3\">\n <div className=\"flex justify-between\">\n <div className=\"h-5 w-32 animate-pulse rounded bg-muted\" />\n <div className=\"h-5 w-16 animate-pulse rounded bg-muted\" />\n </div>\n <div className=\"h-4 w-48 animate-pulse rounded bg-muted\" />\n <div className=\"flex justify-between\">\n <div className=\"h-4 w-24 animate-pulse rounded bg-muted\" />\n <div className=\"h-4 w-20 animate-pulse rounded bg-muted\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )\n }\n\n return (\n <div className={`space-y-3 ${className ?? \"\"}`}>\n {data.map((item, index) => (\n <div\n key={keyExtractor(item)}\n className=\"rounded-xl border p-4 transition-all duration-150 hover:border-foreground/20 active:scale-[0.99]\"\n >\n {renderCard(item, index)}\n </div>\n ))}\n </div>\n )\n}\n","import type { ReactNode } from \"react\"\n\ninterface ResponsiveDataViewProps {\n table: ReactNode\n cards: ReactNode\n isEmpty: boolean\n isLoading: boolean\n emptyIcon?: ReactNode\n emptyTitle?: string\n emptyDescription?: string\n pagination?: ReactNode\n}\n\nexport function ResponsiveDataView({\n table, cards, isEmpty, isLoading, emptyIcon, emptyTitle = \"Nenhum registro encontrado\", emptyDescription, pagination,\n}: ResponsiveDataViewProps) {\n return (\n <div className=\"space-y-4\">\n <div className=\"hidden overflow-x-auto rounded-md border md:block\">{table}</div>\n <div className=\"md:hidden\">{cards}</div>\n {!isLoading && isEmpty && (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n {emptyIcon && <div className=\"mb-4 text-muted-foreground\">{emptyIcon}</div>}\n <h3 className=\"text-lg font-semibold tracking-tight\">{emptyTitle}</h3>\n {emptyDescription && <p className=\"mt-1 max-w-sm text-sm text-muted-foreground\">{emptyDescription}</p>}\n </div>\n )}\n {pagination}\n </div>\n )\n}\n","import { useTheme } from \"./theme-provider\"\nimport { Toaster as Sonner } from \"sonner\"\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>\n\nexport function Toaster(props: ToasterProps) {\n const { theme = \"system\" } = useTheme()\n\n return (\n <Sonner\n theme={theme as ToasterProps[\"theme\"]}\n className=\"toaster group\"\n toastOptions={{\n classNames: {\n toast:\n \"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-md\",\n description: \"group-[.toast]:text-muted-foreground\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground\",\n success:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-success/40\",\n error:\n \"group-[.toaster]:!bg-background group-[.toaster]:!text-foreground group-[.toaster]:!border-destructive/40\",\n },\n }}\n {...props}\n />\n )\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","export function extractApiError(err: any, fallbackMessage = \"Ocorreu um erro inesperado.\"): string {\n const detail = err?.body?.detail || err?.message\n if (Array.isArray(detail) && detail.length > 0) {\n return detail[0].msg\n }\n return detail || fallbackMessage\n}\n","import { useCallback, useState } from \"react\"\n\nexport function useDisclosure(initial = false) {\n const [open, setOpen] = useState(initial)\n const onOpen = useCallback(() => setOpen(true), [])\n const onClose = useCallback(() => setOpen(false), [])\n const onToggle = useCallback(() => setOpen((v) => !v), [])\n return { open, onOpen, onClose, onToggle, setOpen }\n}\n","import { toast } from \"sonner\"\nimport { useCallback } from \"react\"\n\ntype ToastStatus = \"success\" | \"error\" | \"info\" | \"warning\"\n\nexport function useCustomToast() {\n const showToast = useCallback(\n (title: string, description?: string, status: ToastStatus = \"success\") => {\n switch (status) {\n case \"success\":\n toast.success(title, { description })\n break\n case \"error\":\n toast.error(title, { description })\n break\n case \"info\":\n toast.info(title, { description })\n break\n case \"warning\":\n toast.warning(title, { description })\n break\n }\n },\n [],\n )\n\n return showToast\n}\n\nexport { toast }\n"],"mappings":";AAAA,SAAS,eAAe,YAAY,WAAW,gBAAgB;AAsD3D;AAvCJ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jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","useState","useCallback"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-error.d.ts","sourceRoot":"","sources":["../../src/lib/api-error.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,SAAgC,GAAG,MAAM,CAMjG"}
|