@motor-hero/ui-kit 0.45.0 → 0.46.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/dist/components/app-shell.d.ts +9 -1
- package/dist/components/app-shell.d.ts.map +1 -1
- package/dist/components/base-dialog.d.ts +8 -2
- package/dist/components/base-dialog.d.ts.map +1 -1
- package/dist/components/update-banner.d.ts +16 -0
- package/dist/components/update-banner.d.ts.map +1 -0
- package/dist/hooks/use-version-check.d.ts +24 -0
- package/dist/hooks/use-version-check.d.ts.map +1 -0
- package/dist/index.cjs +115 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +112 -18
- package/dist/index.js.map +1 -1
- package/dist/vite.cjs +53 -0
- package/dist/vite.cjs.map +1 -0
- package/dist/vite.d.ts +15 -0
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +28 -0
- package/dist/vite.js.map +1 -0
- package/package.json +7 -2
- package/src/components/app-shell.tsx +16 -0
- package/src/components/base-dialog.tsx +10 -4
- package/src/components/combobox.tsx +2 -2
- package/src/components/date-picker.tsx +1 -1
- package/src/components/filter-toolbar.tsx +1 -1
- package/src/components/multi-combobox.tsx +2 -2
- package/src/components/update-banner.tsx +53 -0
- package/src/hooks/use-version-check.ts +72 -0
- package/src/index.ts +4 -0
- package/src/vite.ts +35 -0
package/dist/index.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export { TableSkeleton } from "./components/table-skeleton";
|
|
|
44
44
|
export type { Theme, ThemeProviderProps, ThemeProviderState, } from "./components/theme-provider";
|
|
45
45
|
export { ThemeProvider, useTheme } from "./components/theme-provider";
|
|
46
46
|
export { Toaster } from "./components/toaster";
|
|
47
|
+
export type { UpdateBannerProps } from "./components/update-banner";
|
|
48
|
+
export { UpdateBanner } from "./components/update-banner";
|
|
47
49
|
export type { RenderLink, RenderLinkProps } from "./components/types";
|
|
48
50
|
export { defaultRenderLink } from "./components/types";
|
|
49
51
|
export type { AppUser, UserMenuItem, UserMenuProps, } from "./components/user-menu";
|
|
@@ -52,6 +54,8 @@ export type { UseCompanySubdomainOptions, UseCompanySubdomainResult, } from "./h
|
|
|
52
54
|
export { getSubdomain, useCompanySubdomain, } from "./hooks/use-company-subdomain";
|
|
53
55
|
export { useDisclosure } from "./hooks/use-disclosure";
|
|
54
56
|
export { useIsDesktop } from "./hooks/use-is-desktop";
|
|
57
|
+
export type { UseVersionCheckOptions, VersionCheckState } from "./hooks/use-version-check";
|
|
58
|
+
export { useVersionCheck } from "./hooks/use-version-check";
|
|
55
59
|
export { toast, useCustomToast } from "./hooks/use-toast";
|
|
56
60
|
export { extractApiError } from "./lib/api-error";
|
|
57
61
|
export type { CompanyTheme, CompanyThemeTokens } from "./lib/company-theme";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE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,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -259,6 +259,8 @@ function AppShell({
|
|
|
259
259
|
headerActions,
|
|
260
260
|
collapsible = true,
|
|
261
261
|
defaultCollapsed = false,
|
|
262
|
+
sidebarFooter,
|
|
263
|
+
banner,
|
|
262
264
|
children
|
|
263
265
|
}) {
|
|
264
266
|
const [collapsed, setCollapsed] = useState3(defaultCollapsed);
|
|
@@ -286,6 +288,7 @@ function AppShell({
|
|
|
286
288
|
children: [
|
|
287
289
|
/* @__PURE__ */ jsx4("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
288
290
|
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
291
|
+
sidebarFooter && /* @__PURE__ */ jsx4("div", { className: "border-t px-3 py-2", "data-slot": "sidebar-footer", children: typeof sidebarFooter === "function" ? sidebarFooter(collapsed) : sidebarFooter }),
|
|
289
292
|
collapsible && /* @__PURE__ */ jsx4("div", { className: "border-t p-2", children: /* @__PURE__ */ jsx4(
|
|
290
293
|
"button",
|
|
291
294
|
{
|
|
@@ -327,6 +330,7 @@ function AppShell({
|
|
|
327
330
|
}
|
|
328
331
|
),
|
|
329
332
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
333
|
+
banner,
|
|
330
334
|
/* @__PURE__ */ jsxs3("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", children: [
|
|
331
335
|
/* @__PURE__ */ jsx4(
|
|
332
336
|
"button",
|
|
@@ -454,9 +458,9 @@ function BaseDialog({
|
|
|
454
458
|
document.body.style.pointerEvents = "";
|
|
455
459
|
},
|
|
456
460
|
className: cn(
|
|
457
|
-
"fixed z-50 flex max-h-[
|
|
461
|
+
"fixed z-50 flex max-h-[92dvh] flex-col bg-background shadow-lg outline-none",
|
|
458
462
|
"inset-x-0 bottom-0 rounded-t-2xl",
|
|
459
|
-
"sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[
|
|
463
|
+
"sm:inset-x-auto sm:bottom-auto sm:left-1/2 sm:top-1/2 sm:max-h-[92dvh] sm:w-full sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-lg",
|
|
460
464
|
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
461
465
|
sizeClasses[size],
|
|
462
466
|
className
|
|
@@ -800,7 +804,7 @@ function Combobox({
|
|
|
800
804
|
CommandPrimitive.List,
|
|
801
805
|
{
|
|
802
806
|
ref: listRef,
|
|
803
|
-
className: "max-h-[
|
|
807
|
+
className: "max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
|
|
804
808
|
children: [
|
|
805
809
|
!isServer && !showCreate && /* @__PURE__ */ jsx9(CommandPrimitive.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
806
810
|
showCreate && /* @__PURE__ */ jsxs7(
|
|
@@ -868,7 +872,7 @@ function Combobox({
|
|
|
868
872
|
/* @__PURE__ */ jsx9(DrawerPrimitive2.Trigger, { asChild: true, children: trigger }),
|
|
869
873
|
/* @__PURE__ */ jsxs7(DrawerPrimitive2.Portal, { children: [
|
|
870
874
|
/* @__PURE__ */ jsx9(DrawerPrimitive2.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
871
|
-
/* @__PURE__ */ jsxs7(DrawerPrimitive2.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[
|
|
875
|
+
/* @__PURE__ */ jsxs7(DrawerPrimitive2.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
|
|
872
876
|
/* @__PURE__ */ jsx9(DrawerPrimitive2.Title, { className: "sr-only", children: placeholder }),
|
|
873
877
|
/* @__PURE__ */ jsx9("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
874
878
|
command
|
|
@@ -1250,7 +1254,7 @@ function DatePickerImpl({
|
|
|
1250
1254
|
onInteractOutside: (event) => {
|
|
1251
1255
|
if (triggerRef.current?.contains(event.target)) event.preventDefault();
|
|
1252
1256
|
},
|
|
1253
|
-
className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[
|
|
1257
|
+
className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none",
|
|
1254
1258
|
children: [
|
|
1255
1259
|
/* @__PURE__ */ jsx12(DrawerPrimitive3.Title, { className: "sr-only", children: withTime ? "Selecione a data e o hor\xE1rio" : "Selecione a data" }),
|
|
1256
1260
|
/* @__PURE__ */ jsx12("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
@@ -1375,7 +1379,7 @@ function FilterPopover({
|
|
|
1375
1379
|
/* @__PURE__ */ jsx14(DrawerPrimitive4.Trigger, { asChild: true, children: trigger }),
|
|
1376
1380
|
/* @__PURE__ */ jsxs12(DrawerPrimitive4.Portal, { children: [
|
|
1377
1381
|
/* @__PURE__ */ jsx14(DrawerPrimitive4.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1378
|
-
/* @__PURE__ */ jsxs12(DrawerPrimitive4.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[
|
|
1382
|
+
/* @__PURE__ */ jsxs12(DrawerPrimitive4.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
|
|
1379
1383
|
/* @__PURE__ */ jsx14(DrawerPrimitive4.Title, { className: "sr-only", children: title ?? label }),
|
|
1380
1384
|
/* @__PURE__ */ jsx14("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1381
1385
|
/* @__PURE__ */ jsx14("div", { className: "overflow-y-auto p-2", children: content })
|
|
@@ -1874,7 +1878,7 @@ function MultiCombobox({
|
|
|
1874
1878
|
CommandPrimitive2.List,
|
|
1875
1879
|
{
|
|
1876
1880
|
ref: listRef,
|
|
1877
|
-
className: "max-h-[
|
|
1881
|
+
className: "max-h-[50dvh] overflow-y-auto overflow-x-hidden p-1 sm:max-h-60",
|
|
1878
1882
|
children: [
|
|
1879
1883
|
!isServer && /* @__PURE__ */ jsx21(CommandPrimitive2.Empty, { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }),
|
|
1880
1884
|
options.map((option) => /* @__PURE__ */ jsxs17(
|
|
@@ -1927,7 +1931,7 @@ function MultiCombobox({
|
|
|
1927
1931
|
/* @__PURE__ */ jsx21(DrawerPrimitive5.Trigger, { asChild: true, disabled, children: trigger }),
|
|
1928
1932
|
/* @__PURE__ */ jsxs17(DrawerPrimitive5.Portal, { children: [
|
|
1929
1933
|
/* @__PURE__ */ jsx21(DrawerPrimitive5.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
|
|
1930
|
-
/* @__PURE__ */ jsxs17(DrawerPrimitive5.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[
|
|
1934
|
+
/* @__PURE__ */ jsxs17(DrawerPrimitive5.Content, { className: "fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[85dvh] flex-col rounded-t-2xl border bg-popover text-popover-foreground outline-none", children: [
|
|
1931
1935
|
/* @__PURE__ */ jsx21(DrawerPrimitive5.Title, { className: "sr-only", children: placeholder }),
|
|
1932
1936
|
/* @__PURE__ */ jsx21("div", { className: "mx-auto my-3 h-1.5 w-12 shrink-0 rounded-full bg-muted" }),
|
|
1933
1937
|
command
|
|
@@ -2486,8 +2490,96 @@ function Toaster(props) {
|
|
|
2486
2490
|
);
|
|
2487
2491
|
}
|
|
2488
2492
|
|
|
2493
|
+
// src/components/update-banner.tsx
|
|
2494
|
+
import { RefreshCw } from "lucide-react";
|
|
2495
|
+
|
|
2496
|
+
// src/hooks/use-version-check.ts
|
|
2497
|
+
import { useCallback as useCallback3, useEffect as useEffect7, useState as useState13 } from "react";
|
|
2498
|
+
function useVersionCheck({
|
|
2499
|
+
currentBuild,
|
|
2500
|
+
url = "/version.json",
|
|
2501
|
+
intervalMs = 6e4
|
|
2502
|
+
}) {
|
|
2503
|
+
const [latestBuild, setLatestBuild] = useState13(null);
|
|
2504
|
+
const [staleChecks, setStaleChecks] = useState13(0);
|
|
2505
|
+
useEffect7(() => {
|
|
2506
|
+
if (!currentBuild) return;
|
|
2507
|
+
let cancelled = false;
|
|
2508
|
+
const check = async () => {
|
|
2509
|
+
if (document.visibilityState === "hidden") return;
|
|
2510
|
+
try {
|
|
2511
|
+
const res = await fetch(url, { cache: "no-store" });
|
|
2512
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
2513
|
+
if (!res.ok || !contentType.includes("application/json")) return;
|
|
2514
|
+
const data = await res.json();
|
|
2515
|
+
if (cancelled || typeof data.buildTime !== "string") return;
|
|
2516
|
+
if (data.buildTime !== currentBuild) {
|
|
2517
|
+
setLatestBuild(data.buildTime);
|
|
2518
|
+
setStaleChecks((n) => n + 1);
|
|
2519
|
+
}
|
|
2520
|
+
} catch (error) {
|
|
2521
|
+
console.error("Version check failed", error);
|
|
2522
|
+
}
|
|
2523
|
+
};
|
|
2524
|
+
check();
|
|
2525
|
+
const interval = setInterval(check, intervalMs);
|
|
2526
|
+
const onVisible = () => {
|
|
2527
|
+
if (document.visibilityState === "visible") check();
|
|
2528
|
+
};
|
|
2529
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
2530
|
+
return () => {
|
|
2531
|
+
cancelled = true;
|
|
2532
|
+
clearInterval(interval);
|
|
2533
|
+
document.removeEventListener("visibilitychange", onVisible);
|
|
2534
|
+
};
|
|
2535
|
+
}, [currentBuild, url, intervalMs]);
|
|
2536
|
+
const reload = useCallback3(() => window.location.reload(), []);
|
|
2537
|
+
return { updateAvailable: latestBuild !== null, staleChecks, latestBuild, reload };
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
// src/components/update-banner.tsx
|
|
2541
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2542
|
+
function UpdateBanner({
|
|
2543
|
+
title = "Nova vers\xE3o dispon\xEDvel",
|
|
2544
|
+
description = "Atualize para continuar na vers\xE3o mais recente.",
|
|
2545
|
+
actionLabel = "Atualizar",
|
|
2546
|
+
className,
|
|
2547
|
+
...options
|
|
2548
|
+
}) {
|
|
2549
|
+
const { updateAvailable, reload } = useVersionCheck(options);
|
|
2550
|
+
if (!updateAvailable) return null;
|
|
2551
|
+
return /* @__PURE__ */ jsxs28(
|
|
2552
|
+
"div",
|
|
2553
|
+
{
|
|
2554
|
+
role: "status",
|
|
2555
|
+
"aria-live": "polite",
|
|
2556
|
+
"data-slot": "update-banner",
|
|
2557
|
+
className: cn(
|
|
2558
|
+
"flex flex-wrap items-center justify-between gap-3 border-b border-primary/30 bg-primary px-4 py-2 text-sm text-primary-foreground",
|
|
2559
|
+
className
|
|
2560
|
+
),
|
|
2561
|
+
children: [
|
|
2562
|
+
/* @__PURE__ */ jsxs28("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
2563
|
+
/* @__PURE__ */ jsx34(RefreshCw, { className: "h-4 w-4 shrink-0 animate-spin [animation-duration:3s]", "aria-hidden": true }),
|
|
2564
|
+
/* @__PURE__ */ jsx34("span", { className: "font-medium", children: title }),
|
|
2565
|
+
/* @__PURE__ */ jsx34("span", { className: "hidden truncate opacity-80 sm:inline", children: description })
|
|
2566
|
+
] }),
|
|
2567
|
+
/* @__PURE__ */ jsx34(
|
|
2568
|
+
"button",
|
|
2569
|
+
{
|
|
2570
|
+
type: "button",
|
|
2571
|
+
onClick: reload,
|
|
2572
|
+
className: "shrink-0 rounded-md bg-background px-3 py-1 text-xs font-medium text-foreground transition-colors hover:bg-background/90",
|
|
2573
|
+
children: actionLabel
|
|
2574
|
+
}
|
|
2575
|
+
)
|
|
2576
|
+
]
|
|
2577
|
+
}
|
|
2578
|
+
);
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2489
2581
|
// src/hooks/use-company-subdomain.ts
|
|
2490
|
-
import { useState as
|
|
2582
|
+
import { useState as useState14 } from "react";
|
|
2491
2583
|
var ALWAYS_RESERVED = ["www", "localhost"];
|
|
2492
2584
|
function getSubdomain(hostname, reservedSubdomains = []) {
|
|
2493
2585
|
const labels = hostname.split(".");
|
|
@@ -2520,7 +2612,7 @@ function useCompanySubdomain(opts = {}) {
|
|
|
2520
2612
|
overrideStorageKey = "company-subdomain",
|
|
2521
2613
|
reservedSubdomains = []
|
|
2522
2614
|
} = opts;
|
|
2523
|
-
const [subdomain] =
|
|
2615
|
+
const [subdomain] = useState14(() => {
|
|
2524
2616
|
if (enableOverride) {
|
|
2525
2617
|
const override = resolveOverride(overrideStorageKey);
|
|
2526
2618
|
if (override) return override;
|
|
@@ -2532,20 +2624,20 @@ function useCompanySubdomain(opts = {}) {
|
|
|
2532
2624
|
}
|
|
2533
2625
|
|
|
2534
2626
|
// src/hooks/use-disclosure.ts
|
|
2535
|
-
import { useCallback as
|
|
2627
|
+
import { useCallback as useCallback4, useState as useState15 } from "react";
|
|
2536
2628
|
function useDisclosure(initial = false) {
|
|
2537
|
-
const [open, setOpen] =
|
|
2538
|
-
const onOpen =
|
|
2539
|
-
const onClose =
|
|
2540
|
-
const onToggle =
|
|
2629
|
+
const [open, setOpen] = useState15(initial);
|
|
2630
|
+
const onOpen = useCallback4(() => setOpen(true), []);
|
|
2631
|
+
const onClose = useCallback4(() => setOpen(false), []);
|
|
2632
|
+
const onToggle = useCallback4(() => setOpen((v) => !v), []);
|
|
2541
2633
|
return { open, onOpen, onClose, onToggle, setOpen };
|
|
2542
2634
|
}
|
|
2543
2635
|
|
|
2544
2636
|
// src/hooks/use-toast.ts
|
|
2545
2637
|
import { toast } from "sonner";
|
|
2546
|
-
import { useCallback as
|
|
2638
|
+
import { useCallback as useCallback5 } from "react";
|
|
2547
2639
|
function useCustomToast() {
|
|
2548
|
-
const showToast =
|
|
2640
|
+
const showToast = useCallback5(
|
|
2549
2641
|
(title, description, status = "success") => {
|
|
2550
2642
|
switch (status) {
|
|
2551
2643
|
case "success":
|
|
@@ -2611,6 +2703,7 @@ export {
|
|
|
2611
2703
|
TableSkeleton,
|
|
2612
2704
|
ThemeProvider,
|
|
2613
2705
|
Toaster,
|
|
2706
|
+
UpdateBanner,
|
|
2614
2707
|
UserMenu,
|
|
2615
2708
|
applyCompanyTheme,
|
|
2616
2709
|
cn,
|
|
@@ -2622,6 +2715,7 @@ export {
|
|
|
2622
2715
|
useCustomToast,
|
|
2623
2716
|
useDisclosure,
|
|
2624
2717
|
useIsDesktop,
|
|
2625
|
-
useTheme
|
|
2718
|
+
useTheme,
|
|
2719
|
+
useVersionCheck
|
|
2626
2720
|
};
|
|
2627
2721
|
//# sourceMappingURL=index.js.map
|