@rendra-ui/web 2.4.0 → 2.6.0
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 +33 -1
- package/dist/base.css +33 -1
- package/dist/{button-C6rjowQi.js → button-B6-644xP.js} +86 -21
- package/dist/button-B6-644xP.js.map +1 -0
- package/dist/chart.js +63 -15
- package/dist/chart.js.map +1 -1
- package/dist/cli/auditar.js +1 -1
- package/dist/cli/codigos.js +2 -2
- package/dist/cli/executar-auditar.js +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/trocar.js +2 -2
- package/dist/cli/typescript-loader.js +1 -1
- package/dist/{cn-DXDpTGsu.js → cn-TBlI6-gS.js} +2 -2
- package/dist/{cn-DXDpTGsu.js.map → cn-TBlI6-gS.js.map} +1 -1
- package/dist/{components-hp7iWioq.js → components-Btk1cUg2.js} +2 -2
- package/dist/{components-hp7iWioq.js.map → components-Btk1cUg2.js.map} +1 -1
- package/dist/components.css +169 -33
- package/dist/document-viewer.js +6 -6
- package/dist/document-viewer.js.map +1 -1
- package/dist/{empty-state-CdaDLcsB.js → empty-state-DrQjqxvp.js} +36 -12
- package/dist/{empty-state-CdaDLcsB.js.map → empty-state-DrQjqxvp.js.map} +1 -1
- package/dist/features-max-CC6CorTg.js +3 -0
- package/dist/index.js +1075 -339
- package/dist/index.js.map +1 -1
- package/dist/motion-context-BL545cb6.js +222 -0
- package/dist/motion-context-BL545cb6.js.map +1 -0
- package/dist/motion-on-DMoTsWrG.js +29 -0
- package/dist/motion-on-DMoTsWrG.js.map +1 -0
- package/dist/motion.js +3 -0
- package/dist/{rendra-provider-7jUgUHzR.js → rendra-provider-CeCkPafT.js} +9 -5
- package/dist/rendra-provider-CeCkPafT.js.map +1 -0
- package/dist/rich-text-editor.js +4 -4
- package/dist/router-bridge.js +5 -4
- package/dist/router-bridge.js.map +1 -1
- package/dist/tokens.css +63 -15
- package/dist/tooltip-kgsorOg6.js +224 -0
- package/dist/tooltip-kgsorOg6.js.map +1 -0
- package/dist/types/components/rendra-provider.d.ts +12 -1
- package/dist/types/components/rendra-router-bridge.d.ts +4 -1
- package/dist/types/components/ui/accordion.d.ts +1 -1
- package/dist/types/components/ui/badge.d.ts +1 -1
- package/dist/types/components/ui/button.d.ts +1 -1
- package/dist/types/components/ui/dropdown-menu.d.ts +5 -5
- package/dist/types/components/ui/picker-panel.d.ts +1 -1
- package/dist/types/components/ui/popover.d.ts +3 -3
- package/dist/types/components/ui/radio-group.d.ts +1 -1
- package/dist/types/components/ui/skeleton.d.ts +5 -1
- package/dist/types/components/ui/stat-card.d.ts +1 -1
- package/dist/types/components/ui/table.d.ts +0 -6
- package/dist/types/components/ui/tooltip.d.ts +1 -1
- package/dist/types/hooks/use-reduced-motion.d.ts +3 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/motion/count.d.ts +17 -0
- package/dist/types/lib/motion/features-max.d.ts +1 -0
- package/dist/types/lib/motion/index.d.ts +5 -0
- package/dist/types/lib/motion/motion-context.d.ts +58 -0
- package/dist/types/lib/motion/motion-on.d.ts +12 -0
- package/dist/types/lib/motion/native-events.d.ts +16 -0
- package/dist/types/lib/motion/presets.d.ts +92 -0
- package/dist/types/lib/motion/reorder.d.ts +7 -0
- package/dist/types/lib/motion/tokens.d.ts +66 -0
- package/dist/types/lib/motion/use-motion-presets.d.ts +8 -0
- package/dist/types/motion.d.ts +1 -0
- package/dist/{use-breakpoint-Dyp-0E_c.js → use-breakpoint-CNxDwEpc.js} +2 -2
- package/dist/{use-breakpoint-Dyp-0E_c.js.map → use-breakpoint-CNxDwEpc.js.map} +1 -1
- package/dist/use-motion-presets-DCJPBfNJ.js +401 -0
- package/dist/use-motion-presets-DCJPBfNJ.js.map +1 -0
- package/dist/widget-grid.js +3 -3
- package/package.json +10 -1
- package/dist/button-C6rjowQi.js.map +0 -1
- package/dist/rendra-provider-7jUgUHzR.js.map +0 -1
- package/dist/tooltip-bdmbX6vC.js +0 -105
- package/dist/tooltip-bdmbX6vC.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
/*! Rendra Design System v2.
|
|
2
|
-
import { t as cn } from "./cn-
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
7
|
-
import { a as
|
|
8
|
-
import { n as
|
|
1
|
+
/*! Rendra Design System v2.6.0 | MIT | © 2026 Bruno Magalhaes | brunomagalhaes.me */
|
|
2
|
+
import { t as cn } from "./cn-TBlI6-gS.js";
|
|
3
|
+
import { a as useMotionMode, c as getReducedMotion, i as useMotionLib, l as subscribeReducedMotion, n as useLayoutReady, o as useMotionOn, r as useMotionAdopted, u as usePrefersReducedMotion } from "./motion-context-BL545cb6.js";
|
|
4
|
+
import { t as useMotionPresets } from "./use-motion-presets-DCJPBfNJ.js";
|
|
5
|
+
import { a as catalogByComponent, c as findComponentsWithoutDefault, d as findPresetCollisions, f as getCatalogEntry, i as assertCatalogIntegrity, l as findDuplicateCodes, n as CATALOG_EXCLUDED_FILES, o as filesMissingCatalogEntry, p as resolveCatalogCode, r as COMPONENT_CODE_PATTERN, s as findComponentsWithMultipleDefaults, t as CATALOG, u as findInvalidFormatCodes } from "./components-Btk1cUg2.js";
|
|
6
|
+
import { n as buttonVariants, r as Spinner, t as Button } from "./button-B6-644xP.js";
|
|
7
|
+
import { a as DropdownMenuContent, c as DropdownMenuLabel, d as DropdownMenuSeparator, f as DropdownMenuSub, h as DropdownMenuTrigger, i as DropdownMenuCheckboxItem, l as DropdownMenuRadioGroup, m as DropdownMenuSubTrigger, n as TooltipProvider, o as DropdownMenuGroup, p as DropdownMenuSubContent, r as DropdownMenu, s as DropdownMenuItem, t as Tooltip, u as DropdownMenuRadioItem } from "./tooltip-kgsorOg6.js";
|
|
8
|
+
import { a as BrandContext, i as useBrand, n as BrandFeedbackIcon, r as feedbackLabels, t as EmptyState } from "./empty-state-DrQjqxvp.js";
|
|
9
|
+
import { a as useRendraNavigate, i as useRendraLink, n as useCurrentPath, r as useRendraBreadcrumbs, t as RendraProvider } from "./rendra-provider-CeCkPafT.js";
|
|
10
|
+
import { n as useBreakpoint, t as breakpoints } from "./use-breakpoint-CNxDwEpc.js";
|
|
9
11
|
import { ArrowDown, ArrowDownRight, ArrowLeft, ArrowRight, ArrowRightLeft, ArrowUp, ArrowUpRight, Bell, Bot, CalendarDays, Check, CheckCheck, CheckCircle2, ChevronDown, ChevronLeft, ChevronRight, ChevronsUpDown, Clock, Columns3, Download, EllipsisVertical, Eye, EyeOff, FileText, Film, Filter, Globe, GripVertical, Home, ImageIcon, ImagePlus, Info, LayoutTemplate, LogOut, Mail, MapPin, Menu, MessageCircle, MessagesSquare, Mic, Minus, Monitor, Moon, MoreHorizontal, Palette, PanelLeft, Paperclip, Pause, Pencil, Phone, Play, Plus, Reply, RotateCw, Search, Send, SkipForward, Smartphone, Smile, Star, Sun, Trash2, TriangleAlert, UploadCloud, User, VideoIcon, X, XCircle, Zap } from "lucide-react";
|
|
10
12
|
import { Accordion as Accordion$1, Avatar as Avatar$1, Checkbox as Checkbox$1, Collapsible, ContextMenu, Dialog, Label as Label$1, NavigationMenu, Popover as Popover$1, Progress as Progress$1, RadioGroup as RadioGroup$1, Slider as Slider$1, Slot, Switch as Switch$1, Tabs as Tabs$1, VisuallyHidden } from "radix-ui";
|
|
11
|
-
import { Fragment,
|
|
12
|
-
import { Fragment as Fragment$1,
|
|
13
|
+
import { Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
14
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
13
15
|
import { createPortal } from "react-dom";
|
|
14
16
|
import { cva } from "class-variance-authority";
|
|
15
17
|
import { addDays, addMonths, addWeeks, differenceInMinutes, endOfMonth, endOfWeek, format, isSameDay, isSameMonth, isToday, isYesterday, startOfDay, startOfMonth, startOfWeek } from "date-fns";
|
|
@@ -22,9 +24,119 @@ import { Command } from "cmdk";
|
|
|
22
24
|
import { columnFilteringFeature, columnVisibilityFeature, createExpandedRowModel, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_includesString, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_basic, tableFeatures, useTable } from "@tanstack/react-table";
|
|
23
25
|
import { Toaster as Toaster$1, toast as toast$1 } from "sonner";
|
|
24
26
|
import { z } from "zod";
|
|
27
|
+
//#region src/lib/motion/reorder.ts
|
|
28
|
+
function layoutEnabled({ mode, ready, dragging }) {
|
|
29
|
+
return mode === "on" && ready && !dragging;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/lib/motion/count.ts
|
|
33
|
+
var PT_BR = /^([^\d-]*)(-?)(\d{1,3}(?:\.\d{3})+|\d+)(?:,(\d+))?([^\d]*)$/;
|
|
34
|
+
function parseLocaleNumber$1(value) {
|
|
35
|
+
if (typeof value === "number") {
|
|
36
|
+
if (!Number.isFinite(value)) return null;
|
|
37
|
+
const text = String(Math.abs(value));
|
|
38
|
+
if (/e/i.test(text)) return null;
|
|
39
|
+
const decimals = text.includes(".") ? text.split(".")[1].length : 0;
|
|
40
|
+
return {
|
|
41
|
+
prefix: value < 0 ? "-" : "",
|
|
42
|
+
suffix: "",
|
|
43
|
+
value: Math.abs(value),
|
|
44
|
+
decimals,
|
|
45
|
+
grouping: false,
|
|
46
|
+
decimalSeparator: "."
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (typeof value !== "string") return null;
|
|
50
|
+
const match = PT_BR.exec(value);
|
|
51
|
+
if (!match) return null;
|
|
52
|
+
const [, prefix = "", sign = "", integer = "", fraction = "", suffix = ""] = match;
|
|
53
|
+
const grouping = integer.includes(".");
|
|
54
|
+
const n = Number(`${integer.replace(/\./g, "")}${fraction ? `.${fraction}` : ""}`);
|
|
55
|
+
if (!Number.isFinite(n)) return null;
|
|
56
|
+
return {
|
|
57
|
+
prefix: `${prefix}${sign}`,
|
|
58
|
+
suffix,
|
|
59
|
+
value: n,
|
|
60
|
+
decimals: fraction.length,
|
|
61
|
+
grouping,
|
|
62
|
+
decimalSeparator: ","
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/** Escreve `n` com o mesmo formato do valor original. */
|
|
66
|
+
function formatLike(parsed, n) {
|
|
67
|
+
const [int = "0", frac = ""] = Math.abs(n).toFixed(parsed.decimals).split(".");
|
|
68
|
+
const grouped = parsed.grouping ? int.replace(/\B(?=(\d{3})+(?!\d))/g, ".") : int;
|
|
69
|
+
const number = frac ? `${grouped}${parsed.decimalSeparator}${frac}` : grouped;
|
|
70
|
+
return `${parsed.prefix}${number}${parsed.suffix}`;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
25
73
|
//#region src/components/ui/accordion.tsx
|
|
26
74
|
/** Accordion único, com animação de altura e área de toque de 44px no mobile. */
|
|
27
75
|
function Accordion({ items, multiple, defaultValue, className }) {
|
|
76
|
+
const lib = useMotionLib();
|
|
77
|
+
const presets = useMotionPresets();
|
|
78
|
+
const [open, setOpen] = useState(multiple ? defaultValue ?? [] : defaultValue?.[0] ? [defaultValue[0]] : []);
|
|
79
|
+
if (lib) {
|
|
80
|
+
const rootProps = multiple ? {
|
|
81
|
+
type: "multiple",
|
|
82
|
+
value: open,
|
|
83
|
+
onValueChange: setOpen
|
|
84
|
+
} : {
|
|
85
|
+
type: "single",
|
|
86
|
+
collapsible: true,
|
|
87
|
+
value: open[0] ?? "",
|
|
88
|
+
onValueChange: (v) => setOpen(v ? [v] : [])
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
91
|
+
...rootProps,
|
|
92
|
+
"data-rendra": "ACRN-001",
|
|
93
|
+
className: cn("flex flex-col", className),
|
|
94
|
+
children: items.map((it) => {
|
|
95
|
+
const isOpen = open.includes(it.value);
|
|
96
|
+
return /* @__PURE__ */ jsxs(Accordion$1.Item, {
|
|
97
|
+
value: it.value,
|
|
98
|
+
disabled: it.disabled,
|
|
99
|
+
className: "border-b last:border-b-0",
|
|
100
|
+
children: [/* @__PURE__ */ jsx(Accordion$1.Header, { children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
|
|
101
|
+
className: "group flex min-h-touch w-full cursor-pointer items-center justify-between gap-4 py-4 text-left text-sm font-medium transition-colors hover:text-primary-text disabled:cursor-not-allowed disabled:opacity-50 md:min-h-0",
|
|
102
|
+
children: [it.title, /* @__PURE__ */ jsx(lib.m.span, {
|
|
103
|
+
"aria-hidden": true,
|
|
104
|
+
className: "flex shrink-0",
|
|
105
|
+
animate: { rotate: isOpen ? 180 : 0 },
|
|
106
|
+
transition: presets.fade.transition,
|
|
107
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-icon-sm text-muted-foreground" })
|
|
108
|
+
})]
|
|
109
|
+
}) }), /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
110
|
+
initial: false,
|
|
111
|
+
children: isOpen && /* @__PURE__ */ jsx(Accordion$1.Content, {
|
|
112
|
+
forceMount: true,
|
|
113
|
+
asChild: true,
|
|
114
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
115
|
+
className: "overflow-hidden text-sm wrap-break-word text-muted-foreground",
|
|
116
|
+
initial: {
|
|
117
|
+
height: 0,
|
|
118
|
+
opacity: 0
|
|
119
|
+
},
|
|
120
|
+
animate: {
|
|
121
|
+
height: "auto",
|
|
122
|
+
opacity: 1
|
|
123
|
+
},
|
|
124
|
+
exit: {
|
|
125
|
+
height: 0,
|
|
126
|
+
opacity: 0
|
|
127
|
+
},
|
|
128
|
+
transition: presets.fade.transition,
|
|
129
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
130
|
+
className: "pb-4",
|
|
131
|
+
children: it.content
|
|
132
|
+
})
|
|
133
|
+
})
|
|
134
|
+
})
|
|
135
|
+
})]
|
|
136
|
+
}, it.value);
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}
|
|
28
140
|
const content = items.map((it) => /* @__PURE__ */ jsxs(Accordion$1.Item, {
|
|
29
141
|
value: it.value,
|
|
30
142
|
disabled: it.disabled,
|
|
@@ -33,10 +145,10 @@ function Accordion({ items, multiple, defaultValue, className }) {
|
|
|
33
145
|
className: "group flex min-h-touch w-full cursor-pointer items-center justify-between gap-4 py-4 text-left text-sm font-medium transition-colors hover:text-primary-text disabled:cursor-not-allowed disabled:opacity-50 md:min-h-0",
|
|
34
146
|
children: [it.title, /* @__PURE__ */ jsx(ChevronDown, {
|
|
35
147
|
"aria-hidden": true,
|
|
36
|
-
className: "size-icon-sm shrink-0 text-muted-foreground transition-transform duration-
|
|
148
|
+
className: "size-icon-sm shrink-0 text-muted-foreground transition-transform duration-(--rendra-duration-base) ease-move group-data-[state=open]:rotate-180"
|
|
37
149
|
})]
|
|
38
150
|
}) }), /* @__PURE__ */ jsx(Accordion$1.Content, {
|
|
39
|
-
className: "overflow-hidden text-sm text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
151
|
+
className: "overflow-hidden text-sm wrap-break-word text-muted-foreground data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
40
152
|
children: /* @__PURE__ */ jsx("div", {
|
|
41
153
|
className: "pb-4",
|
|
42
154
|
children: it.content
|
|
@@ -404,7 +516,7 @@ function Breadcrumb({ items, variant = "responsive", className }) {
|
|
|
404
516
|
const last = i === items.length - 1;
|
|
405
517
|
return /* @__PURE__ */ jsxs("li", {
|
|
406
518
|
className: cn("flex min-w-0 items-center gap-1", !last && "shrink-0 max-sm:max-w-24"),
|
|
407
|
-
children: [item.to && !last ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Link, {
|
|
519
|
+
children: [item.to && !last ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Link, {
|
|
408
520
|
to: item.to,
|
|
409
521
|
className: "hidden truncate rounded-item transition-colors hover:text-primary-text md:inline",
|
|
410
522
|
children: item.label
|
|
@@ -517,7 +629,7 @@ function OverlayShell({ title, description, icon, children, footer, hideHeader,
|
|
|
517
629
|
"aria-hidden": true
|
|
518
630
|
})
|
|
519
631
|
});
|
|
520
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
632
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
521
633
|
hideHeader && /* @__PURE__ */ jsx("div", {
|
|
522
634
|
className: "pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-end px-2 pt-safe md:px-4 md:pt-4",
|
|
523
635
|
children: closeButton
|
|
@@ -533,10 +645,10 @@ function OverlayShell({ title, description, icon, children, footer, hideHeader,
|
|
|
533
645
|
/* @__PURE__ */ jsxs("div", {
|
|
534
646
|
className: "flex min-w-0 flex-1 flex-col gap-1 pt-1",
|
|
535
647
|
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
536
|
-
className: "text-lg font-semibold",
|
|
648
|
+
className: "text-lg font-semibold wrap-break-word",
|
|
537
649
|
children: title
|
|
538
650
|
}), description ? /* @__PURE__ */ jsx(Dialog.Description, {
|
|
539
|
-
className: "text-sm text-muted-foreground",
|
|
651
|
+
className: "text-sm wrap-break-word text-muted-foreground",
|
|
540
652
|
children: description
|
|
541
653
|
}) : /* @__PURE__ */ jsx(Dialog.Description, {
|
|
542
654
|
className: "sr-only",
|
|
@@ -563,6 +675,9 @@ var sizes$1 = {
|
|
|
563
675
|
md: "md:max-w-lg",
|
|
564
676
|
lg: "md:max-w-2xl"
|
|
565
677
|
};
|
|
678
|
+
var overlayCls$1 = "fixed inset-0 z-50 bg-overlay";
|
|
679
|
+
var overlayOffCls = cn(overlayCls$1, "data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0");
|
|
680
|
+
var contentCls = cn("fixed inset-0 z-50 flex h-dvh flex-col bg-card text-card-foreground outline-none", "md:inset-auto md:top-1/2 md:left-1/2 md:h-auto md:max-h-sheet md:w-full md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-surface md:border md:shadow-lg");
|
|
566
681
|
var feedback = {
|
|
567
682
|
confirm: "info",
|
|
568
683
|
destructive: "error",
|
|
@@ -582,55 +697,85 @@ function Modal({ open, onOpenChange, title, description, type = "confirm", size
|
|
|
582
697
|
}
|
|
583
698
|
};
|
|
584
699
|
const isForm = type === "form";
|
|
700
|
+
const lib = useMotionLib();
|
|
701
|
+
const presets = useMotionPresets();
|
|
702
|
+
const { isMobile } = useBreakpoint();
|
|
703
|
+
const code = resolveCatalogCode("Modal", { type: type === "destructive" ? "confirm" : type });
|
|
704
|
+
const sizeCls = sizes$1[size];
|
|
705
|
+
const shell = /* @__PURE__ */ jsxs(OverlayShell, {
|
|
706
|
+
title,
|
|
707
|
+
description: isForm ? description : void 0,
|
|
708
|
+
hideHeader: !isForm,
|
|
709
|
+
onRequestClose: close,
|
|
710
|
+
bodyClassName: cn(!isForm && "flex flex-col items-center justify-center gap-4 text-center"),
|
|
711
|
+
footer: /* @__PURE__ */ jsx(ActionBar, {
|
|
712
|
+
primary: {
|
|
713
|
+
label: confirmLabel,
|
|
714
|
+
destructive: type === "destructive",
|
|
715
|
+
loading: busy || loading,
|
|
716
|
+
loadingLabel: `${confirmLabel}...`,
|
|
717
|
+
type: isForm && formId ? "submit" : "button",
|
|
718
|
+
form: isForm ? formId : void 0,
|
|
719
|
+
onClick: isForm && formId ? void 0 : confirm
|
|
720
|
+
},
|
|
721
|
+
cancel: type === "info" && cancelLabel === void 0 ? void 0 : {
|
|
722
|
+
label: cancelLabel ?? "Cancelar",
|
|
723
|
+
onClick: close
|
|
724
|
+
}
|
|
725
|
+
}),
|
|
726
|
+
children: [!isForm && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
727
|
+
/* @__PURE__ */ jsx(BrandFeedbackIcon, {
|
|
728
|
+
type: feedback[type],
|
|
729
|
+
size: "2xl",
|
|
730
|
+
animated: true
|
|
731
|
+
}),
|
|
732
|
+
/* @__PURE__ */ jsxs("div", {
|
|
733
|
+
className: "flex flex-col gap-2",
|
|
734
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
735
|
+
className: "text-lg font-semibold wrap-anywhere",
|
|
736
|
+
children: title
|
|
737
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
738
|
+
className: "text-sm wrap-anywhere text-muted-foreground",
|
|
739
|
+
children: description
|
|
740
|
+
})]
|
|
741
|
+
}),
|
|
742
|
+
children
|
|
743
|
+
] }), isForm && /* @__PURE__ */ jsx("div", {
|
|
744
|
+
className: "flex flex-col gap-2",
|
|
745
|
+
children
|
|
746
|
+
})]
|
|
747
|
+
});
|
|
748
|
+
if (lib) return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
749
|
+
open,
|
|
750
|
+
onOpenChange,
|
|
751
|
+
children: /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
752
|
+
forceMount: true,
|
|
753
|
+
children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
|
|
754
|
+
forceMount: true,
|
|
755
|
+
asChild: true,
|
|
756
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
757
|
+
className: overlayCls$1,
|
|
758
|
+
...presets.fade
|
|
759
|
+
})
|
|
760
|
+
}), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
761
|
+
forceMount: true,
|
|
762
|
+
asChild: true,
|
|
763
|
+
"data-rendra": code,
|
|
764
|
+
className: cn(contentCls, sizeCls),
|
|
765
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
766
|
+
...presets.open(isMobile ? { y: 8 } : void 0),
|
|
767
|
+
children: shell
|
|
768
|
+
})
|
|
769
|
+
})]
|
|
770
|
+
}, "modal") })
|
|
771
|
+
});
|
|
585
772
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
586
773
|
open,
|
|
587
774
|
onOpenChange,
|
|
588
|
-
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className:
|
|
589
|
-
"data-rendra":
|
|
590
|
-
className: cn(
|
|
591
|
-
children:
|
|
592
|
-
title,
|
|
593
|
-
description: isForm ? description : void 0,
|
|
594
|
-
hideHeader: !isForm,
|
|
595
|
-
onRequestClose: close,
|
|
596
|
-
bodyClassName: cn(!isForm && "flex flex-col items-center justify-center gap-4 text-center"),
|
|
597
|
-
footer: /* @__PURE__ */ jsx(ActionBar, {
|
|
598
|
-
primary: {
|
|
599
|
-
label: confirmLabel,
|
|
600
|
-
destructive: type === "destructive",
|
|
601
|
-
loading: busy || loading,
|
|
602
|
-
loadingLabel: `${confirmLabel}...`,
|
|
603
|
-
type: isForm && formId ? "submit" : "button",
|
|
604
|
-
form: isForm ? formId : void 0,
|
|
605
|
-
onClick: isForm && formId ? void 0 : confirm
|
|
606
|
-
},
|
|
607
|
-
cancel: type === "info" && cancelLabel === void 0 ? void 0 : {
|
|
608
|
-
label: cancelLabel ?? "Cancelar",
|
|
609
|
-
onClick: close
|
|
610
|
-
}
|
|
611
|
-
}),
|
|
612
|
-
children: [!isForm && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
613
|
-
/* @__PURE__ */ jsx(BrandFeedbackIcon, {
|
|
614
|
-
type: feedback[type],
|
|
615
|
-
size: "2xl",
|
|
616
|
-
animated: true
|
|
617
|
-
}),
|
|
618
|
-
/* @__PURE__ */ jsxs("div", {
|
|
619
|
-
className: "flex flex-col gap-2",
|
|
620
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
621
|
-
className: "text-lg font-semibold",
|
|
622
|
-
children: title
|
|
623
|
-
}), description && /* @__PURE__ */ jsx("p", {
|
|
624
|
-
className: "text-sm text-muted-foreground",
|
|
625
|
-
children: description
|
|
626
|
-
})]
|
|
627
|
-
}),
|
|
628
|
-
children
|
|
629
|
-
] }), isForm && /* @__PURE__ */ jsx("div", {
|
|
630
|
-
className: "flex flex-col gap-2",
|
|
631
|
-
children
|
|
632
|
-
})]
|
|
633
|
-
})
|
|
775
|
+
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: overlayOffCls }), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
776
|
+
"data-rendra": code,
|
|
777
|
+
className: cn(contentCls, "data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 md:data-[state=open]:zoom-in-95", sizeCls),
|
|
778
|
+
children: shell
|
|
634
779
|
})] })
|
|
635
780
|
});
|
|
636
781
|
}
|
|
@@ -1105,7 +1250,7 @@ function Calendar({ events, view: viewProp, defaultView = "month", onViewChange,
|
|
|
1105
1250
|
" ",
|
|
1106
1251
|
e.title
|
|
1107
1252
|
]
|
|
1108
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
1253
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
1109
1254
|
className: "truncate font-medium",
|
|
1110
1255
|
children: e.title
|
|
1111
1256
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -1738,18 +1883,59 @@ var Input = forwardRef(function Input({ size, mask, icon, suffix, clearable, inv
|
|
|
1738
1883
|
});
|
|
1739
1884
|
//#endregion
|
|
1740
1885
|
//#region src/components/ui/popover.tsx
|
|
1741
|
-
var
|
|
1886
|
+
var PopoverOpenContext = createContext(null);
|
|
1887
|
+
function AnimatedRoot({ open, defaultOpen, onOpenChange, ...rest }) {
|
|
1888
|
+
const [inner, setInner] = useState(defaultOpen ?? false);
|
|
1889
|
+
const current = open ?? inner;
|
|
1890
|
+
return /* @__PURE__ */ jsx(PopoverOpenContext.Provider, {
|
|
1891
|
+
value: current,
|
|
1892
|
+
children: /* @__PURE__ */ jsx(Popover$1.Root, {
|
|
1893
|
+
...rest,
|
|
1894
|
+
open: current,
|
|
1895
|
+
onOpenChange: (next) => {
|
|
1896
|
+
setInner(next);
|
|
1897
|
+
onOpenChange?.(next);
|
|
1898
|
+
}
|
|
1899
|
+
})
|
|
1900
|
+
});
|
|
1901
|
+
}
|
|
1902
|
+
function Popover(props) {
|
|
1903
|
+
return useMotionMode() === "on" ? /* @__PURE__ */ jsx(AnimatedRoot, { ...props }) : /* @__PURE__ */ jsx(Popover$1.Root, { ...props });
|
|
1904
|
+
}
|
|
1742
1905
|
var PopoverTrigger = Popover$1.Trigger;
|
|
1743
1906
|
var PopoverClose = Popover$1.Close;
|
|
1744
1907
|
var PopoverAnchor = Popover$1.Anchor;
|
|
1745
|
-
function PopoverContent({ className, align = "center", sideOffset = 8, width = "md", ...props }) {
|
|
1908
|
+
function PopoverContent({ className, align = "center", sideOffset = 8, width = "md", children, asChild, ...props }) {
|
|
1909
|
+
const open = useContext(PopoverOpenContext);
|
|
1910
|
+
const lib = useMotionLib();
|
|
1911
|
+
const presets = useMotionPresets();
|
|
1912
|
+
const base = cn("z-50 origin-(--radix-popover-content-transform-origin) rounded-surface border bg-popover text-popover-foreground shadow-md outline-none", width === "sm" ? "w-popover-sm" : "w-popover");
|
|
1913
|
+
if (lib && open !== null && !asChild) return /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
|
|
1914
|
+
forceMount: true,
|
|
1915
|
+
children: /* @__PURE__ */ jsx(Popover$1.Content, {
|
|
1916
|
+
forceMount: true,
|
|
1917
|
+
asChild: true,
|
|
1918
|
+
align,
|
|
1919
|
+
sideOffset,
|
|
1920
|
+
collisionPadding: 16,
|
|
1921
|
+
"data-rendra": "POP-001",
|
|
1922
|
+
className: cn(base, className),
|
|
1923
|
+
...props,
|
|
1924
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
1925
|
+
...presets.open(),
|
|
1926
|
+
children
|
|
1927
|
+
})
|
|
1928
|
+
})
|
|
1929
|
+
}, "popover") });
|
|
1746
1930
|
return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Content, {
|
|
1747
1931
|
align,
|
|
1748
1932
|
sideOffset,
|
|
1749
1933
|
collisionPadding: 16,
|
|
1750
1934
|
"data-rendra": "POP-001",
|
|
1751
|
-
className: cn(
|
|
1752
|
-
|
|
1935
|
+
className: cn(base, "animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className),
|
|
1936
|
+
asChild,
|
|
1937
|
+
...props,
|
|
1938
|
+
children
|
|
1753
1939
|
}) });
|
|
1754
1940
|
}
|
|
1755
1941
|
//#endregion
|
|
@@ -2097,7 +2283,7 @@ function Attachments({ files, mine }) {
|
|
|
2097
2283
|
function MessageActions({ m, mine, onReply, onReact, onEdit, onDelete, kind }) {
|
|
2098
2284
|
const Item = kind === "context" ? ContextMenu.Item : DropdownMenuItem;
|
|
2099
2285
|
const itemClass = kind === "context" ? "flex min-h-touch cursor-pointer items-center gap-2 rounded-item px-3 text-sm outline-none select-none data-[highlighted]:bg-accent md:min-h-0 md:py-2 [&_svg]:size-icon-sm" : void 0;
|
|
2100
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2286
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2101
2287
|
/* @__PURE__ */ jsx("div", {
|
|
2102
2288
|
role: "group",
|
|
2103
2289
|
"aria-label": "Reagir",
|
|
@@ -2114,7 +2300,7 @@ function MessageActions({ m, mine, onReply, onReact, onEdit, onDelete, kind }) {
|
|
|
2114
2300
|
onSelect: () => onReply?.(m),
|
|
2115
2301
|
children: [/* @__PURE__ */ jsx(Reply, { "aria-hidden": true }), " Responder"]
|
|
2116
2302
|
}),
|
|
2117
|
-
mine && !m.deleted && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Item, {
|
|
2303
|
+
mine && !m.deleted && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Item, {
|
|
2118
2304
|
className: itemClass,
|
|
2119
2305
|
onSelect: () => onEdit?.(m),
|
|
2120
2306
|
children: [/* @__PURE__ */ jsx(Pencil, { "aria-hidden": true }), " Editar"]
|
|
@@ -2238,7 +2424,7 @@ function ChatThread({ messages, onReply, onReact, onEdit, onDelete, className })
|
|
|
2238
2424
|
}),
|
|
2239
2425
|
m.replyTo && (() => {
|
|
2240
2426
|
const quoteClass = cn("flex flex-col rounded-block border-l-4 px-2 py-1 text-left text-xs", mine && !m.deleted ? "border-primary-foreground/60 bg-primary-foreground/15" : "border-primary bg-muted");
|
|
2241
|
-
const body = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
2427
|
+
const body = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
2242
2428
|
className: "font-semibold",
|
|
2243
2429
|
children: m.replyTo.author
|
|
2244
2430
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -2561,7 +2747,7 @@ function ChatComposer({ onSend, placeholder = "Escreva uma mensagem", disabled,
|
|
|
2561
2747
|
}, i))
|
|
2562
2748
|
})
|
|
2563
2749
|
]
|
|
2564
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2750
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2565
2751
|
/* @__PURE__ */ jsx(Button, {
|
|
2566
2752
|
variant: "ghost",
|
|
2567
2753
|
iconOnly: true,
|
|
@@ -2641,7 +2827,7 @@ function ChatComposer({ onSend, placeholder = "Escreva uma mensagem", disabled,
|
|
|
2641
2827
|
className: "@max-xl:hidden",
|
|
2642
2828
|
children: /* @__PURE__ */ jsx(Mic, {})
|
|
2643
2829
|
})
|
|
2644
|
-
] }), recording ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
2830
|
+
] }), recording ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
2645
2831
|
variant: "ghost",
|
|
2646
2832
|
iconOnly: true,
|
|
2647
2833
|
"aria-label": "Cancelar gravação",
|
|
@@ -2652,7 +2838,7 @@ function ChatComposer({ onSend, placeholder = "Escreva uma mensagem", disabled,
|
|
|
2652
2838
|
"aria-label": "Enviar áudio",
|
|
2653
2839
|
onClick: () => stopRecording(true),
|
|
2654
2840
|
children: /* @__PURE__ */ jsx(Send, {})
|
|
2655
|
-
})] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
|
|
2841
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button, {
|
|
2656
2842
|
iconOnly: true,
|
|
2657
2843
|
"aria-label": "Enviar",
|
|
2658
2844
|
disabled: disabled || !text.trim() && !files.length,
|
|
@@ -2797,7 +2983,7 @@ function QuickReplyList({ items, onPick }) {
|
|
|
2797
2983
|
const [q, setQ] = useState("");
|
|
2798
2984
|
const term = q.trim().toLowerCase();
|
|
2799
2985
|
const list = term ? items.filter((i) => `${i.title} ${i.text}`.toLowerCase().includes(term)) : items;
|
|
2800
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2986
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2801
2987
|
/* @__PURE__ */ jsx("span", {
|
|
2802
2988
|
className: "px-2 pt-1 text-xs font-semibold",
|
|
2803
2989
|
children: "Mensagens rápidas"
|
|
@@ -2842,29 +3028,61 @@ function QuickReplyList({ items, onPick }) {
|
|
|
2842
3028
|
function Checkbox({ checked, defaultChecked, onCheckedChange, label, description, disabled, invalid, id, name, className, ...aria }) {
|
|
2843
3029
|
const auto = useId();
|
|
2844
3030
|
const cid = id ?? `cb${auto}`;
|
|
2845
|
-
const
|
|
3031
|
+
const lib = useMotionLib();
|
|
3032
|
+
const on = lib !== null;
|
|
3033
|
+
const presets = useMotionPresets();
|
|
3034
|
+
const [inner, setInner] = useState(defaultChecked ?? false);
|
|
3035
|
+
const state = checked ?? inner;
|
|
3036
|
+
const mark = checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, {
|
|
3037
|
+
className: "size-3",
|
|
3038
|
+
strokeWidth: 3,
|
|
3039
|
+
"aria-hidden": true
|
|
3040
|
+
}) : /* @__PURE__ */ jsx(Check, {
|
|
3041
|
+
className: "size-3",
|
|
3042
|
+
strokeWidth: 3,
|
|
3043
|
+
"aria-hidden": true
|
|
3044
|
+
});
|
|
3045
|
+
const rootProps = {
|
|
2846
3046
|
id: cid,
|
|
2847
3047
|
name,
|
|
2848
|
-
checked,
|
|
2849
|
-
defaultChecked,
|
|
2850
|
-
onCheckedChange: (v) =>
|
|
3048
|
+
checked: on ? state : checked,
|
|
3049
|
+
defaultChecked: on ? void 0 : defaultChecked,
|
|
3050
|
+
onCheckedChange: (v) => {
|
|
3051
|
+
if (on) setInner(v);
|
|
3052
|
+
onCheckedChange?.(v === true);
|
|
3053
|
+
},
|
|
2851
3054
|
disabled,
|
|
2852
3055
|
"aria-invalid": invalid || void 0,
|
|
2853
3056
|
"aria-label": aria["aria-label"],
|
|
2854
3057
|
"data-touch": label ? void 0 : "expanded",
|
|
2855
|
-
className: cn("peer relative flex size-icon-md shrink-0 cursor-pointer items-center justify-center rounded-item border border-input bg-card transition-colors", "hover:border-primary data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", "disabled:cursor-not-allowed disabled:opacity-50", invalid && "border-destructive", !label && "before:absolute before:-inset-3 md:before:hidden")
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
3058
|
+
className: cn("peer relative flex size-icon-md shrink-0 cursor-pointer items-center justify-center rounded-item border border-input bg-card transition-colors", "hover:border-primary data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", "disabled:cursor-not-allowed disabled:opacity-50", invalid && "border-destructive", !label && "before:absolute before:-inset-3 md:before:hidden")
|
|
3059
|
+
};
|
|
3060
|
+
const box = on ? /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
3061
|
+
asChild: true,
|
|
3062
|
+
...rootProps,
|
|
3063
|
+
children: /* @__PURE__ */ jsx(lib.m.button, {
|
|
3064
|
+
type: "button",
|
|
3065
|
+
whileTap: presets.press.whileTap,
|
|
3066
|
+
transition: presets.press.transition,
|
|
3067
|
+
children: /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
3068
|
+
initial: false,
|
|
3069
|
+
children: state !== false && /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
3070
|
+
forceMount: true,
|
|
3071
|
+
asChild: true,
|
|
3072
|
+
children: /* @__PURE__ */ jsx(lib.m.span, {
|
|
3073
|
+
className: "flex items-center justify-center",
|
|
3074
|
+
...presets.indicator,
|
|
3075
|
+
children: mark
|
|
3076
|
+
})
|
|
3077
|
+
})
|
|
2866
3078
|
})
|
|
2867
3079
|
})
|
|
3080
|
+
}) : /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
3081
|
+
...rootProps,
|
|
3082
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
|
|
3083
|
+
className: "flex items-center justify-center data-[state=checked]:animate-in data-[state=checked]:duration-(--rendra-duration-fast) data-[state=checked]:zoom-in-90",
|
|
3084
|
+
children: mark
|
|
3085
|
+
})
|
|
2868
3086
|
});
|
|
2869
3087
|
if (!label) return /* @__PURE__ */ jsx("span", {
|
|
2870
3088
|
"data-rendra": "CHK-001",
|
|
@@ -3265,6 +3483,90 @@ function applyPalette(seeds, doc = document) {
|
|
|
3265
3483
|
}
|
|
3266
3484
|
//#endregion
|
|
3267
3485
|
//#region src/components/ui/picker-panel.tsx
|
|
3486
|
+
/** A folha fecha se o arraste passou de 40% da altura ou se foi um arremesso (> 0,11 px/ms). */
|
|
3487
|
+
var DISMISS_FRACTION = .4;
|
|
3488
|
+
var DISMISS_VELOCITY = 110;
|
|
3489
|
+
/**
|
|
3490
|
+
* A folha do celular em `on`: entra de baixo, acompanha o dedo (arraste vertical pela alça, com
|
|
3491
|
+
* fricção ao puxar para cima), fecha por distância ou por arremesso e, se o dedo solta antes
|
|
3492
|
+
* disso, volta à origem com a mola da folha (a velocidade do dedo entra na mola, sem costura). O
|
|
3493
|
+
* fundo escurecido acompanha a distância. Só a alça arrasta: o corpo rola sem disputar o gesto.
|
|
3494
|
+
* Nenhum valor passa por `style`: o Motion guarda a posição do arraste, e o escurecimento do
|
|
3495
|
+
* fundo é gravado direto no elemento (sem render por quadro).
|
|
3496
|
+
*/
|
|
3497
|
+
function MobileSheet({ open, onOpenChange, trigger, adornment, head, rest }) {
|
|
3498
|
+
const { AnimatePresence, animate, m, useDragControls } = useMotionOn();
|
|
3499
|
+
const presets = useMotionPresets();
|
|
3500
|
+
const ready = useLayoutReady();
|
|
3501
|
+
const controls = useDragControls();
|
|
3502
|
+
const sheetRef = useRef(null);
|
|
3503
|
+
const dimRef = useRef(null);
|
|
3504
|
+
const height = useRef(1);
|
|
3505
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, {
|
|
3506
|
+
open,
|
|
3507
|
+
onOpenChange,
|
|
3508
|
+
children: [/* @__PURE__ */ jsx(Anchor, {
|
|
3509
|
+
adornment,
|
|
3510
|
+
children: /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
3511
|
+
asChild: true,
|
|
3512
|
+
children: trigger
|
|
3513
|
+
})
|
|
3514
|
+
}), /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
3515
|
+
forceMount: true,
|
|
3516
|
+
children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
|
|
3517
|
+
forceMount: true,
|
|
3518
|
+
asChild: true,
|
|
3519
|
+
children: /* @__PURE__ */ jsx(m.div, {
|
|
3520
|
+
className: "fixed inset-0 z-40",
|
|
3521
|
+
...presets.fade,
|
|
3522
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
3523
|
+
ref: dimRef,
|
|
3524
|
+
className: "absolute inset-0 bg-overlay"
|
|
3525
|
+
})
|
|
3526
|
+
})
|
|
3527
|
+
}), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
3528
|
+
forceMount: true,
|
|
3529
|
+
asChild: true,
|
|
3530
|
+
"aria-describedby": void 0,
|
|
3531
|
+
className: "fixed inset-x-0 bottom-0 z-50 flex max-h-sheet flex-col rounded-t-surface border-t bg-popover text-popover-foreground shadow-lg outline-none",
|
|
3532
|
+
children: /* @__PURE__ */ jsxs(m.div, {
|
|
3533
|
+
ref: sheetRef,
|
|
3534
|
+
...presets.sheet("bottom"),
|
|
3535
|
+
drag: ready ? "y" : false,
|
|
3536
|
+
dragControls: controls,
|
|
3537
|
+
dragListener: false,
|
|
3538
|
+
dragConstraints: { top: 0 },
|
|
3539
|
+
dragElastic: {
|
|
3540
|
+
top: .2,
|
|
3541
|
+
bottom: 0
|
|
3542
|
+
},
|
|
3543
|
+
dragSnapToOrigin: true,
|
|
3544
|
+
dragTransition: presets.sheetBounce,
|
|
3545
|
+
onDragStart: () => {
|
|
3546
|
+
height.current = sheetRef.current?.offsetHeight || 1;
|
|
3547
|
+
},
|
|
3548
|
+
onDrag: (_, info) => {
|
|
3549
|
+
const dim = dimRef.current;
|
|
3550
|
+
if (dim) dim.style.opacity = String(1 - Math.min(1, Math.max(0, info.offset.y / height.current)));
|
|
3551
|
+
},
|
|
3552
|
+
onDragEnd: (_, info) => {
|
|
3553
|
+
if (info.offset.y > height.current * DISMISS_FRACTION || info.velocity.y > DISMISS_VELOCITY) {
|
|
3554
|
+
onOpenChange(false);
|
|
3555
|
+
return;
|
|
3556
|
+
}
|
|
3557
|
+
if (dimRef.current) animate(dimRef.current, { opacity: 1 }, presets.springSheet);
|
|
3558
|
+
},
|
|
3559
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
3560
|
+
"data-sheet-handle": true,
|
|
3561
|
+
onPointerDown: (e) => controls.start(e),
|
|
3562
|
+
className: "touch-none",
|
|
3563
|
+
children: head
|
|
3564
|
+
}), rest]
|
|
3565
|
+
})
|
|
3566
|
+
})]
|
|
3567
|
+
}, "sheet") })]
|
|
3568
|
+
});
|
|
3569
|
+
}
|
|
3268
3570
|
function Anchor({ adornment, children }) {
|
|
3269
3571
|
if (!adornment) return children;
|
|
3270
3572
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -3274,6 +3576,92 @@ function Anchor({ adornment, children }) {
|
|
|
3274
3576
|
}
|
|
3275
3577
|
function PickerPanel({ open, onOpenChange, trigger, title, header, children, footer, width = "trigger", adornment, align = "start" }) {
|
|
3276
3578
|
const { isMobile } = useBreakpoint();
|
|
3579
|
+
const lib = useMotionLib();
|
|
3580
|
+
const presets = useMotionPresets();
|
|
3581
|
+
const on = lib !== null;
|
|
3582
|
+
const sheetHead = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
3583
|
+
className: "flex shrink-0 flex-col items-center pt-2",
|
|
3584
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
3585
|
+
"aria-hidden": true,
|
|
3586
|
+
className: "h-1 w-12 rounded-full bg-border"
|
|
3587
|
+
})
|
|
3588
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
3589
|
+
className: "flex shrink-0 items-center justify-between gap-2 pr-2 pl-4",
|
|
3590
|
+
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
3591
|
+
className: "truncate text-base font-semibold",
|
|
3592
|
+
children: title
|
|
3593
|
+
}), /* @__PURE__ */ jsx(Dialog.Close, {
|
|
3594
|
+
"aria-label": "Fechar",
|
|
3595
|
+
className: "flex size-touch items-center justify-center rounded-item text-muted-foreground hover:bg-accent",
|
|
3596
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
3597
|
+
className: "size-icon-md",
|
|
3598
|
+
"aria-hidden": true
|
|
3599
|
+
})
|
|
3600
|
+
})]
|
|
3601
|
+
})] });
|
|
3602
|
+
const sheetRest = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3603
|
+
header && /* @__PURE__ */ jsx("div", {
|
|
3604
|
+
className: "shrink-0 border-b px-4 pb-3",
|
|
3605
|
+
children: header
|
|
3606
|
+
}),
|
|
3607
|
+
/* @__PURE__ */ jsx("div", {
|
|
3608
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-2",
|
|
3609
|
+
children
|
|
3610
|
+
}),
|
|
3611
|
+
footer && /* @__PURE__ */ jsx("div", {
|
|
3612
|
+
className: "shrink-0 border-t px-4 pt-3 pb-safe",
|
|
3613
|
+
children: footer
|
|
3614
|
+
})
|
|
3615
|
+
] });
|
|
3616
|
+
const sheetBody = /* @__PURE__ */ jsxs(Fragment$1, { children: [sheetHead, sheetRest] });
|
|
3617
|
+
const panelCls = cn("z-50 flex max-h-command origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-surface border bg-popover text-popover-foreground shadow-md outline-none", width === "trigger" ? "w-trigger max-w-popover" : "w-auto max-w-popover md:max-w-none");
|
|
3618
|
+
const panelBody = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3619
|
+
header && /* @__PURE__ */ jsx("div", {
|
|
3620
|
+
className: "shrink-0 border-b p-2",
|
|
3621
|
+
children: header
|
|
3622
|
+
}),
|
|
3623
|
+
/* @__PURE__ */ jsx("div", {
|
|
3624
|
+
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1",
|
|
3625
|
+
children
|
|
3626
|
+
}),
|
|
3627
|
+
footer && /* @__PURE__ */ jsx("div", {
|
|
3628
|
+
className: "shrink-0 border-t p-2",
|
|
3629
|
+
children: footer
|
|
3630
|
+
})
|
|
3631
|
+
] });
|
|
3632
|
+
if (on && isMobile) return /* @__PURE__ */ jsx(MobileSheet, {
|
|
3633
|
+
open,
|
|
3634
|
+
onOpenChange,
|
|
3635
|
+
trigger,
|
|
3636
|
+
adornment,
|
|
3637
|
+
head: sheetHead,
|
|
3638
|
+
rest: sheetRest
|
|
3639
|
+
});
|
|
3640
|
+
if (on) return /* @__PURE__ */ jsxs(Popover$1.Root, {
|
|
3641
|
+
open,
|
|
3642
|
+
onOpenChange,
|
|
3643
|
+
children: [/* @__PURE__ */ jsx(Anchor, {
|
|
3644
|
+
adornment,
|
|
3645
|
+
children: /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
3646
|
+
asChild: true,
|
|
3647
|
+
children: trigger
|
|
3648
|
+
})
|
|
3649
|
+
}), /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
|
|
3650
|
+
forceMount: true,
|
|
3651
|
+
children: /* @__PURE__ */ jsx(Popover$1.Content, {
|
|
3652
|
+
forceMount: true,
|
|
3653
|
+
asChild: true,
|
|
3654
|
+
align,
|
|
3655
|
+
sideOffset: 6,
|
|
3656
|
+
collisionPadding: 16,
|
|
3657
|
+
className: panelCls,
|
|
3658
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
3659
|
+
...presets.open(),
|
|
3660
|
+
children: panelBody
|
|
3661
|
+
})
|
|
3662
|
+
})
|
|
3663
|
+
}, "panel") })]
|
|
3664
|
+
});
|
|
3277
3665
|
if (isMobile) return /* @__PURE__ */ jsxs(Dialog.Root, {
|
|
3278
3666
|
open,
|
|
3279
3667
|
onOpenChange,
|
|
@@ -3283,44 +3671,10 @@ function PickerPanel({ open, onOpenChange, trigger, title, header, children, foo
|
|
|
3283
3671
|
asChild: true,
|
|
3284
3672
|
children: trigger
|
|
3285
3673
|
})
|
|
3286
|
-
}), /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 z-40 bg-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), /* @__PURE__ */
|
|
3674
|
+
}), /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: "fixed inset-0 z-40 bg-overlay data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0" }), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
3287
3675
|
"aria-describedby": void 0,
|
|
3288
|
-
className: "fixed inset-x-0 bottom-0 z-50 flex max-h-sheet flex-col rounded-t-surface border-t bg-popover text-popover-foreground shadow-lg outline-none data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
3289
|
-
children:
|
|
3290
|
-
/* @__PURE__ */ jsx("div", {
|
|
3291
|
-
className: "flex shrink-0 flex-col items-center pt-2",
|
|
3292
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
3293
|
-
"aria-hidden": true,
|
|
3294
|
-
className: "h-1 w-12 rounded-full bg-border"
|
|
3295
|
-
})
|
|
3296
|
-
}),
|
|
3297
|
-
/* @__PURE__ */ jsxs("div", {
|
|
3298
|
-
className: "flex shrink-0 items-center justify-between gap-2 pr-2 pl-4",
|
|
3299
|
-
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
3300
|
-
className: "truncate text-base font-semibold",
|
|
3301
|
-
children: title
|
|
3302
|
-
}), /* @__PURE__ */ jsx(Dialog.Close, {
|
|
3303
|
-
"aria-label": "Fechar",
|
|
3304
|
-
className: "flex size-touch items-center justify-center rounded-item text-muted-foreground hover:bg-accent",
|
|
3305
|
-
children: /* @__PURE__ */ jsx(X, {
|
|
3306
|
-
className: "size-icon-md",
|
|
3307
|
-
"aria-hidden": true
|
|
3308
|
-
})
|
|
3309
|
-
})]
|
|
3310
|
-
}),
|
|
3311
|
-
header && /* @__PURE__ */ jsx("div", {
|
|
3312
|
-
className: "shrink-0 border-b px-4 pb-3",
|
|
3313
|
-
children: header
|
|
3314
|
-
}),
|
|
3315
|
-
/* @__PURE__ */ jsx("div", {
|
|
3316
|
-
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-2",
|
|
3317
|
-
children
|
|
3318
|
-
}),
|
|
3319
|
-
footer && /* @__PURE__ */ jsx("div", {
|
|
3320
|
-
className: "shrink-0 border-t px-4 pt-3 pb-safe",
|
|
3321
|
-
children: footer
|
|
3322
|
-
})
|
|
3323
|
-
]
|
|
3676
|
+
className: "fixed inset-x-0 bottom-0 z-50 flex max-h-sheet flex-col rounded-t-surface border-t bg-popover text-popover-foreground shadow-lg outline-none data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
3677
|
+
children: sheetBody
|
|
3324
3678
|
})] })]
|
|
3325
3679
|
});
|
|
3326
3680
|
return /* @__PURE__ */ jsxs(Popover$1.Root, {
|
|
@@ -3332,25 +3686,12 @@ function PickerPanel({ open, onOpenChange, trigger, title, header, children, foo
|
|
|
3332
3686
|
asChild: true,
|
|
3333
3687
|
children: trigger
|
|
3334
3688
|
})
|
|
3335
|
-
}), /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */
|
|
3689
|
+
}), /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Content, {
|
|
3336
3690
|
align,
|
|
3337
3691
|
sideOffset: 6,
|
|
3338
3692
|
collisionPadding: 16,
|
|
3339
|
-
className: cn("z-50 flex max-h-command flex-col overflow-hidden rounded-surface border bg-popover text-popover-foreground shadow-md outline-none", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", width === "trigger" ? "w-trigger max-w-popover" : "w-auto max-w-popover md:max-w-none"),
|
|
3340
|
-
children:
|
|
3341
|
-
header && /* @__PURE__ */ jsx("div", {
|
|
3342
|
-
className: "shrink-0 border-b p-2",
|
|
3343
|
-
children: header
|
|
3344
|
-
}),
|
|
3345
|
-
/* @__PURE__ */ jsx("div", {
|
|
3346
|
-
className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1",
|
|
3347
|
-
children
|
|
3348
|
-
}),
|
|
3349
|
-
footer && /* @__PURE__ */ jsx("div", {
|
|
3350
|
-
className: "shrink-0 border-t p-2",
|
|
3351
|
-
children: footer
|
|
3352
|
-
})
|
|
3353
|
-
]
|
|
3693
|
+
className: cn("z-50 flex max-h-command origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-surface border bg-popover text-popover-foreground shadow-md outline-none", "data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", width === "trigger" ? "w-trigger max-w-popover" : "w-auto max-w-popover md:max-w-none"),
|
|
3694
|
+
children: panelBody
|
|
3354
3695
|
}) })]
|
|
3355
3696
|
});
|
|
3356
3697
|
}
|
|
@@ -3461,35 +3802,57 @@ var sizes = {
|
|
|
3461
3802
|
lg: "md:w-sheet-50",
|
|
3462
3803
|
xl: "md:w-sheet-75"
|
|
3463
3804
|
};
|
|
3805
|
+
var overlayCls = "fixed inset-0 z-50 bg-overlay";
|
|
3806
|
+
var panelCls = "fixed inset-y-0 right-0 z-50 flex h-dvh w-full flex-col bg-card text-card-foreground shadow-lg outline-none md:border-l";
|
|
3464
3807
|
function Drawer({ open, onOpenChange, title, description, icon, size = "30", children, footer, dirty, discardTitle = "Descartar alterações?", discardDescription = "As informações preenchidas neste painel serão perdidas." }) {
|
|
3465
3808
|
const [confirming, setConfirming] = useState(false);
|
|
3466
3809
|
const requestClose = () => dirty ? setConfirming(true) : onOpenChange(false);
|
|
3467
|
-
|
|
3810
|
+
const lib = useMotionLib();
|
|
3811
|
+
const presets = useMotionPresets();
|
|
3812
|
+
const keepOpenIfDirty = (e) => {
|
|
3813
|
+
if (dirty) {
|
|
3814
|
+
e.preventDefault();
|
|
3815
|
+
setConfirming(true);
|
|
3816
|
+
}
|
|
3817
|
+
};
|
|
3818
|
+
const shell = /* @__PURE__ */ jsx(OverlayShell, {
|
|
3819
|
+
title,
|
|
3820
|
+
description,
|
|
3821
|
+
icon,
|
|
3822
|
+
footer,
|
|
3823
|
+
onRequestClose: requestClose,
|
|
3824
|
+
children
|
|
3825
|
+
});
|
|
3826
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Dialog.Root, {
|
|
3468
3827
|
open,
|
|
3469
3828
|
onOpenChange: (o) => o ? onOpenChange(true) : requestClose(),
|
|
3470
|
-
children:
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3829
|
+
children: lib ? /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
|
|
3830
|
+
forceMount: true,
|
|
3831
|
+
children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
|
|
3832
|
+
forceMount: true,
|
|
3833
|
+
asChild: true,
|
|
3834
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
3835
|
+
className: overlayCls,
|
|
3836
|
+
...presets.fade
|
|
3837
|
+
})
|
|
3838
|
+
}), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
3839
|
+
forceMount: true,
|
|
3840
|
+
asChild: true,
|
|
3841
|
+
onEscapeKeyDown: keepOpenIfDirty,
|
|
3842
|
+
onPointerDownOutside: keepOpenIfDirty,
|
|
3843
|
+
"data-rendra": "GAV-001",
|
|
3844
|
+
className: cn(panelCls, sizes[size]),
|
|
3845
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
3846
|
+
...presets.sheet("right"),
|
|
3847
|
+
children: shell
|
|
3848
|
+
})
|
|
3849
|
+
})]
|
|
3850
|
+
}, "drawer") }) : /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Overlay, { className: cn(overlayCls, "data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0") }), /* @__PURE__ */ jsx(Dialog.Content, {
|
|
3851
|
+
onEscapeKeyDown: keepOpenIfDirty,
|
|
3852
|
+
onPointerDownOutside: keepOpenIfDirty,
|
|
3483
3853
|
"data-rendra": "GAV-001",
|
|
3484
|
-
className: cn(
|
|
3485
|
-
children:
|
|
3486
|
-
title,
|
|
3487
|
-
description,
|
|
3488
|
-
icon,
|
|
3489
|
-
footer,
|
|
3490
|
-
onRequestClose: requestClose,
|
|
3491
|
-
children
|
|
3492
|
-
})
|
|
3854
|
+
className: cn(panelCls, "data-[state=closed]:animate-out data-[state=closed]:duration-(--rendra-duration-fast) data-[state=closed]:slide-out-to-right data-[state=open]:animate-in data-[state=open]:slide-in-from-right", sizes[size]),
|
|
3855
|
+
children: shell
|
|
3493
3856
|
})] })
|
|
3494
3857
|
}), /* @__PURE__ */ jsx(Modal, {
|
|
3495
3858
|
open: confirming,
|
|
@@ -3508,7 +3871,41 @@ function Drawer({ open, onOpenChange, title, description, icon, size = "30", chi
|
|
|
3508
3871
|
function Switch({ checked, defaultChecked, onCheckedChange, label, description, disabled, id, name, className, ...aria }) {
|
|
3509
3872
|
const auto = useId();
|
|
3510
3873
|
const sid = id ?? `sw${auto}`;
|
|
3511
|
-
const
|
|
3874
|
+
const lib = useMotionLib();
|
|
3875
|
+
const presets = useMotionPresets();
|
|
3876
|
+
const rootCls = "relative inline-flex h-6 w-12 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent bg-input transition-colors disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary max-md:before:absolute max-md:before:-inset-3";
|
|
3877
|
+
const thumbCls = cn("pointer-events-none block size-icon-md rounded-full bg-card shadow-sm duration-(--rendra-duration-base) ease-move data-[state=checked]:translate-x-6", lib ? "transition-[translate]" : "transition-transform");
|
|
3878
|
+
const tap = presets.tap;
|
|
3879
|
+
const control = lib ? /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
3880
|
+
asChild: true,
|
|
3881
|
+
id: sid,
|
|
3882
|
+
name,
|
|
3883
|
+
checked,
|
|
3884
|
+
defaultChecked,
|
|
3885
|
+
onCheckedChange,
|
|
3886
|
+
disabled,
|
|
3887
|
+
"aria-label": aria["aria-label"],
|
|
3888
|
+
"data-touch": "expanded",
|
|
3889
|
+
"data-rendra": "SWT-001",
|
|
3890
|
+
children: /* @__PURE__ */ jsx(lib.m.button, {
|
|
3891
|
+
type: "button",
|
|
3892
|
+
className: rootCls,
|
|
3893
|
+
initial: "rest",
|
|
3894
|
+
animate: "rest",
|
|
3895
|
+
whileTap: tap ? "tap" : void 0,
|
|
3896
|
+
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
3897
|
+
asChild: true,
|
|
3898
|
+
children: /* @__PURE__ */ jsx(lib.m.span, {
|
|
3899
|
+
className: thumbCls,
|
|
3900
|
+
variants: {
|
|
3901
|
+
rest: { scale: 1 },
|
|
3902
|
+
tap: { scale: tap ? 1.15 : 1 }
|
|
3903
|
+
},
|
|
3904
|
+
transition: presets.press.transition
|
|
3905
|
+
})
|
|
3906
|
+
})
|
|
3907
|
+
})
|
|
3908
|
+
}) : /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
3512
3909
|
id: sid,
|
|
3513
3910
|
name,
|
|
3514
3911
|
checked,
|
|
@@ -3518,8 +3915,8 @@ function Switch({ checked, defaultChecked, onCheckedChange, label, description,
|
|
|
3518
3915
|
"aria-label": aria["aria-label"],
|
|
3519
3916
|
"data-touch": "expanded",
|
|
3520
3917
|
"data-rendra": "SWT-001",
|
|
3521
|
-
className:
|
|
3522
|
-
children: /* @__PURE__ */ jsx(Switch$1.Thumb, { className:
|
|
3918
|
+
className: rootCls,
|
|
3919
|
+
children: /* @__PURE__ */ jsx(Switch$1.Thumb, { className: thumbCls })
|
|
3523
3920
|
});
|
|
3524
3921
|
if (!label) return control;
|
|
3525
3922
|
return /* @__PURE__ */ jsxs("label", {
|
|
@@ -3586,7 +3983,7 @@ function DataToolbar({ search, filters, filterCount = 0, onClearFilters, chips =
|
|
|
3586
3983
|
"aria-label": search.placeholder ?? "Buscar",
|
|
3587
3984
|
type: "search",
|
|
3588
3985
|
className: "md:w-3xs lg:w-sm"
|
|
3589
|
-
}), isMobile ? /* @__PURE__ */ jsxs(Fragment, { children: [(hasPanel || primaryAction) && /* @__PURE__ */ jsxs("div", {
|
|
3986
|
+
}), isMobile ? /* @__PURE__ */ jsxs(Fragment$1, { children: [(hasPanel || primaryAction) && /* @__PURE__ */ jsxs("div", {
|
|
3590
3987
|
className: cn("grid gap-3", hasPanel && primaryAction ? "grid-actions-2" : "grid-cols-1"),
|
|
3591
3988
|
children: [hasPanel && filterButton(() => setDrawer(true)), primaryAction]
|
|
3592
3989
|
}), actions && /* @__PURE__ */ jsx("div", {
|
|
@@ -4352,7 +4749,7 @@ var Select = forwardRef(function Select(props, ref) {
|
|
|
4352
4749
|
}),
|
|
4353
4750
|
/* @__PURE__ */ jsx(ChevronDown, {
|
|
4354
4751
|
"aria-hidden": true,
|
|
4355
|
-
className: cn("size-icon-sm shrink-0 text-muted-foreground transition-transform duration-
|
|
4752
|
+
className: cn("size-icon-sm shrink-0 text-muted-foreground transition-transform duration-(--rendra-duration-base) ease-move", open && "rotate-180")
|
|
4356
4753
|
})
|
|
4357
4754
|
]
|
|
4358
4755
|
});
|
|
@@ -4500,6 +4897,8 @@ var Select = forwardRef(function Select(props, ref) {
|
|
|
4500
4897
|
});
|
|
4501
4898
|
//#endregion
|
|
4502
4899
|
//#region src/components/ui/tabs.tsx
|
|
4900
|
+
/** Contador de instâncias, só para o `layoutId` do indicador (ver `indicatorId`). */
|
|
4901
|
+
var tabsCreated = 0;
|
|
4503
4902
|
/**
|
|
4504
4903
|
* Tabs único. Se as abas não couberem na largura, a mesma lista vira um Select
|
|
4505
4904
|
* (nunca rolagem lateral). A troca é medida no próprio contêiner, não na tela.
|
|
@@ -4524,9 +4923,49 @@ function Tabs({ items, value, defaultValue, onChange, variant = "line", classNam
|
|
|
4524
4923
|
ro.observe(box);
|
|
4525
4924
|
return () => ro.disconnect();
|
|
4526
4925
|
}, [items, variant]);
|
|
4527
|
-
const
|
|
4926
|
+
const presets = useMotionPresets();
|
|
4927
|
+
const on = useLayoutReady();
|
|
4928
|
+
const lib = useMotionLib();
|
|
4929
|
+
const listRef = useRef(null);
|
|
4930
|
+
const [clip, setClip] = useState({
|
|
4931
|
+
l: 0,
|
|
4932
|
+
r: 0
|
|
4933
|
+
});
|
|
4934
|
+
useLayoutEffect(() => {
|
|
4935
|
+
const list = listRef.current;
|
|
4936
|
+
if (!on || !list) return;
|
|
4937
|
+
const measure = () => {
|
|
4938
|
+
const active = list.querySelector("[role=\"tab\"][data-state=\"active\"]");
|
|
4939
|
+
if (!active) return;
|
|
4940
|
+
const l = active.offsetLeft;
|
|
4941
|
+
const r = list.offsetWidth - l - active.offsetWidth;
|
|
4942
|
+
setClip((prev) => prev.l === l && prev.r === r ? prev : {
|
|
4943
|
+
l,
|
|
4944
|
+
r
|
|
4945
|
+
});
|
|
4946
|
+
};
|
|
4947
|
+
measure();
|
|
4948
|
+
const ro = new ResizeObserver(measure);
|
|
4949
|
+
ro.observe(list);
|
|
4950
|
+
return () => ro.disconnect();
|
|
4951
|
+
}, [
|
|
4952
|
+
on,
|
|
4953
|
+
current,
|
|
4954
|
+
items,
|
|
4955
|
+
variant,
|
|
4956
|
+
overflow
|
|
4957
|
+
]);
|
|
4958
|
+
const [indicatorId] = useState(() => `rendra-tabs-${++tabsCreated}`);
|
|
4959
|
+
const trigger = cn("inline-flex min-h-touch shrink-0 cursor-pointer items-center justify-center gap-2 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none disabled:cursor-not-allowed disabled:opacity-50 md:min-h-0 [&_svg]:size-icon-sm", variant === "line" ? on ? "relative -mb-px border-b-2 border-transparent py-3 text-muted-foreground hover:text-foreground" : "-mb-px border-b-2 border-transparent py-3 text-muted-foreground hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground" : on ? "relative isolate rounded-item py-2 text-muted-foreground hover:bg-card/60 hover:text-foreground" : "rounded-item py-2 text-muted-foreground hover:bg-card/60 hover:text-foreground data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:shadow-sm");
|
|
4960
|
+
const indicator = lib && /* @__PURE__ */ jsx(lib.m.span, {
|
|
4961
|
+
layoutId: indicatorId,
|
|
4962
|
+
"data-indicator": "tabs",
|
|
4963
|
+
"aria-hidden": true,
|
|
4964
|
+
transition: presets.move,
|
|
4965
|
+
className: variant === "line" ? "absolute inset-x-0 top-full border-b-2 border-primary" : "absolute inset-0 -z-10 rounded-item bg-card shadow-sm"
|
|
4966
|
+
});
|
|
4528
4967
|
const list = cn("flex", variant === "line" ? "gap-2 border-b" : "gap-1 rounded-control bg-muted p-1");
|
|
4529
|
-
const label = (it) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4968
|
+
const label = (it) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4530
4969
|
it.icon,
|
|
4531
4970
|
it.label,
|
|
4532
4971
|
it.count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
@@ -4559,16 +4998,29 @@ function Tabs({ items, value, defaultValue, onChange, variant = "line", classNam
|
|
|
4559
4998
|
label: it.count !== void 0 ? `${it.label} (${it.count})` : it.label,
|
|
4560
4999
|
disabled: it.disabled
|
|
4561
5000
|
}))
|
|
4562
|
-
}) : /* @__PURE__ */ jsx(Tabs$1.List, {
|
|
5001
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Tabs$1.List, {
|
|
5002
|
+
ref: listRef,
|
|
4563
5003
|
"aria-label": aria["aria-label"],
|
|
4564
5004
|
className: list,
|
|
4565
|
-
children: items.map((it) => /* @__PURE__ */
|
|
5005
|
+
children: items.map((it) => /* @__PURE__ */ jsxs(Tabs$1.Trigger, {
|
|
4566
5006
|
value: it.value,
|
|
4567
5007
|
disabled: it.disabled,
|
|
4568
5008
|
className: trigger,
|
|
5009
|
+
children: [on && current === it.value && indicator, label(it)]
|
|
5010
|
+
}, it.value))
|
|
5011
|
+
}), on && /* @__PURE__ */ jsx("div", {
|
|
5012
|
+
"data-tabs-copy": true,
|
|
5013
|
+
"aria-hidden": true,
|
|
5014
|
+
className: cn(list, "pointer-events-none absolute inset-0 border-transparent bg-transparent text-foreground tabs-clip"),
|
|
5015
|
+
style: {
|
|
5016
|
+
"--tabs-l": `${clip.l}px`,
|
|
5017
|
+
"--tabs-r": `${clip.r}px`
|
|
5018
|
+
},
|
|
5019
|
+
children: items.map((it) => /* @__PURE__ */ jsx("span", {
|
|
5020
|
+
className: cn(trigger, "text-foreground"),
|
|
4569
5021
|
children: label(it)
|
|
4570
5022
|
}, it.value))
|
|
4571
|
-
})]
|
|
5023
|
+
})] })]
|
|
4572
5024
|
}), items.map((it) => /* @__PURE__ */ jsx(Tabs$1.Content, {
|
|
4573
5025
|
value: it.value,
|
|
4574
5026
|
className: "min-w-0 outline-none",
|
|
@@ -5055,6 +5507,8 @@ function LoadMore({ onVisible }) {
|
|
|
5055
5507
|
children: "Carregando mais cards..."
|
|
5056
5508
|
});
|
|
5057
5509
|
}
|
|
5510
|
+
/** Contador de quadros, só para o `layoutId` dos cards em `on` (um prefixo por instância). */
|
|
5511
|
+
var boardsCreated = 0;
|
|
5058
5512
|
var dotTone = {
|
|
5059
5513
|
neutral: "bg-muted-foreground",
|
|
5060
5514
|
primary: "bg-primary",
|
|
@@ -5075,7 +5529,7 @@ var targetIconTone = {
|
|
|
5075
5529
|
};
|
|
5076
5530
|
function CardBody({ card, valueFields = [], formatValue, withHandle }) {
|
|
5077
5531
|
const shown = valueFields.slice(0, 2);
|
|
5078
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5532
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5079
5533
|
card.tags && card.tags.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
5080
5534
|
className: "flex flex-wrap gap-1",
|
|
5081
5535
|
children: card.tags.map((t) => /* @__PURE__ */ jsx(Badge, {
|
|
@@ -5177,6 +5631,11 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
|
|
|
5177
5631
|
}), pageSize = 20, visibleColumns = 5, onLoadMore, hasMore, dropTargets, onDropTarget, className, ...aria }) {
|
|
5178
5632
|
const code = resolveCatalogCode("Kanban", { hasDropTargets: Boolean(dropTargets?.length) });
|
|
5179
5633
|
const { isMobile } = useBreakpoint();
|
|
5634
|
+
const motion = useMotionMode();
|
|
5635
|
+
const lib = useMotionLib();
|
|
5636
|
+
const ready = useLayoutReady();
|
|
5637
|
+
const presets = useMotionPresets();
|
|
5638
|
+
const [boardId] = useState(() => `rendra-kanban-${++boardsCreated}`);
|
|
5180
5639
|
const boardRef = useFillHeight();
|
|
5181
5640
|
useEffect(() => {
|
|
5182
5641
|
const el = boardRef.current;
|
|
@@ -5261,7 +5720,7 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
|
|
|
5261
5720
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
5262
5721
|
align: "end",
|
|
5263
5722
|
children: [
|
|
5264
|
-
otherColumns.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Mover para" }), otherColumns.map((c) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5723
|
+
otherColumns.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: "Mover para" }), otherColumns.map((c) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5265
5724
|
onSelect: () => onCardMove?.(card.id, c.id, inColumn(c.id).length),
|
|
5266
5725
|
children: [/* @__PURE__ */ jsx(ArrowRightLeft, {}), c.title]
|
|
5267
5726
|
}, c.id))] }),
|
|
@@ -5323,36 +5782,39 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
|
|
|
5323
5782
|
});
|
|
5324
5783
|
const canTouchDrag = Boolean(onCardMove) || Boolean(dropTargets?.length && onDropTarget);
|
|
5325
5784
|
const showHandle = isMobile && canTouchDrag;
|
|
5326
|
-
const cardItem = (card, index) =>
|
|
5327
|
-
|
|
5328
|
-
draggable: !isMobile && Boolean(onCardMove),
|
|
5329
|
-
onDragStart: (e) => {
|
|
5785
|
+
const cardItem = (card, index) => {
|
|
5786
|
+
const dragStart = (dataTransfer) => {
|
|
5330
5787
|
setDragging(card.id);
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5788
|
+
if (!dataTransfer) return;
|
|
5789
|
+
dataTransfer.effectAllowed = "move";
|
|
5790
|
+
dataTransfer.setData("text/plain", card.id);
|
|
5791
|
+
};
|
|
5792
|
+
const dragEnd = () => {
|
|
5335
5793
|
setDragging(null);
|
|
5336
5794
|
setOver(null);
|
|
5337
|
-
}
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
e
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5795
|
+
};
|
|
5796
|
+
const common = {
|
|
5797
|
+
"data-kanban-card": card.id,
|
|
5798
|
+
draggable: !isMobile && Boolean(onCardMove),
|
|
5799
|
+
onDragOver: (e) => {
|
|
5800
|
+
if (!dragging) return;
|
|
5801
|
+
e.preventDefault();
|
|
5802
|
+
e.stopPropagation();
|
|
5803
|
+
const r = e.currentTarget.getBoundingClientRect();
|
|
5804
|
+
const after = e.clientY > r.top + r.height / 2;
|
|
5805
|
+
setOver({
|
|
5806
|
+
column: card.columnId,
|
|
5807
|
+
index: index + (after ? 1 : 0)
|
|
5808
|
+
});
|
|
5809
|
+
},
|
|
5810
|
+
onDrop: (e) => {
|
|
5811
|
+
e.preventDefault();
|
|
5812
|
+
e.stopPropagation();
|
|
5813
|
+
if (over) drop(over.column, over.index);
|
|
5814
|
+
},
|
|
5815
|
+
className: cn("relative flex rounded-block border bg-card p-3 shadow-sm transition-[box-shadow,opacity]", !isMobile && onCardMove && "cursor-grab active:cursor-grabbing", (dragging === card.id || touchDrag?.cardId === card.id) && "opacity-50", over?.column === card.columnId && over.index === index && dragging !== card.id && "ring-2 ring-ring ring-offset-2 ring-offset-muted")
|
|
5816
|
+
};
|
|
5817
|
+
const body = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5356
5818
|
onCardClick ? /* @__PURE__ */ jsx("button", {
|
|
5357
5819
|
type: "button",
|
|
5358
5820
|
onClick: () => onCardClick(card),
|
|
@@ -5386,8 +5848,38 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
|
|
|
5386
5848
|
className: "absolute top-2 right-2 z-10",
|
|
5387
5849
|
children: moveMenu(card)
|
|
5388
5850
|
})
|
|
5389
|
-
]
|
|
5390
|
-
|
|
5851
|
+
] });
|
|
5852
|
+
if (lib) {
|
|
5853
|
+
const layout = layoutEnabled({
|
|
5854
|
+
mode: motion,
|
|
5855
|
+
ready,
|
|
5856
|
+
dragging: touchDrag !== null
|
|
5857
|
+
});
|
|
5858
|
+
return /* @__PURE__ */ jsx(lib.m.li, {
|
|
5859
|
+
ref: (el) => {
|
|
5860
|
+
if (!el) return;
|
|
5861
|
+
const onStart = (e) => dragStart(e.dataTransfer);
|
|
5862
|
+
el.addEventListener("dragstart", onStart);
|
|
5863
|
+
el.addEventListener("dragend", dragEnd);
|
|
5864
|
+
return () => {
|
|
5865
|
+
el.removeEventListener("dragstart", onStart);
|
|
5866
|
+
el.removeEventListener("dragend", dragEnd);
|
|
5867
|
+
};
|
|
5868
|
+
},
|
|
5869
|
+
layout,
|
|
5870
|
+
layoutId: layout ? `${boardId}-${card.id}` : void 0,
|
|
5871
|
+
transition: presets.settle,
|
|
5872
|
+
...common,
|
|
5873
|
+
children: body
|
|
5874
|
+
}, card.id);
|
|
5875
|
+
}
|
|
5876
|
+
return /* @__PURE__ */ jsx("li", {
|
|
5877
|
+
onDragStart: (e) => dragStart(e.dataTransfer),
|
|
5878
|
+
onDragEnd: dragEnd,
|
|
5879
|
+
...common,
|
|
5880
|
+
children: body
|
|
5881
|
+
}, card.id);
|
|
5882
|
+
};
|
|
5391
5883
|
const totals = (col) => (valueFields ?? []).slice(0, 2).map((f) => ({
|
|
5392
5884
|
...f,
|
|
5393
5885
|
total: inColumn(col.id).reduce((sum, c) => sum + (c.values?.[f.key] ?? 0), 0)
|
|
@@ -5469,7 +5961,7 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
|
|
|
5469
5961
|
else onLoadMore?.(col.id);
|
|
5470
5962
|
} })
|
|
5471
5963
|
]
|
|
5472
|
-
})
|
|
5964
|
+
}, String(ready))
|
|
5473
5965
|
});
|
|
5474
5966
|
};
|
|
5475
5967
|
if (isMobile) return /* @__PURE__ */ jsxs("div", {
|
|
@@ -5590,14 +6082,27 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
|
|
|
5590
6082
|
onReorder: onReorder && ((sorted) => onReorder(sorted.map((s) => s.data)))
|
|
5591
6083
|
});
|
|
5592
6084
|
const sortableEnabled = Boolean(onReorder);
|
|
6085
|
+
const motion = useMotionMode();
|
|
6086
|
+
const lib = useMotionLib();
|
|
6087
|
+
const ready = useLayoutReady();
|
|
6088
|
+
const presets = useMotionPresets();
|
|
6089
|
+
const Item = lib ? lib.m.li : "li";
|
|
6090
|
+
const itemMotion = motion === "on" ? {
|
|
6091
|
+
layout: layoutEnabled({
|
|
6092
|
+
mode: motion,
|
|
6093
|
+
ready,
|
|
6094
|
+
dragging: sortable.draggingId !== null
|
|
6095
|
+
}),
|
|
6096
|
+
transition: presets.move
|
|
6097
|
+
} : {};
|
|
5593
6098
|
const code = resolveCatalogCode("List", { sortable: sortableEnabled });
|
|
5594
|
-
if (items.length === 0 && empty) return /* @__PURE__ */ jsx(Fragment, { children: empty });
|
|
6099
|
+
if (items.length === 0 && empty) return /* @__PURE__ */ jsx(Fragment$1, { children: empty });
|
|
5595
6100
|
return /* @__PURE__ */ jsx("ul", {
|
|
5596
6101
|
"data-rendra": code,
|
|
5597
6102
|
className: cn("flex w-full min-w-0 flex-col", divided && "divide-y", className),
|
|
5598
6103
|
children: items.map((it) => {
|
|
5599
6104
|
const interactive = Boolean(it.to || it.onClick);
|
|
5600
|
-
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6105
|
+
const body = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
5601
6106
|
it.leading && /* @__PURE__ */ jsx("span", {
|
|
5602
6107
|
className: "flex shrink-0",
|
|
5603
6108
|
children: it.leading
|
|
@@ -5633,8 +6138,9 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
|
|
|
5633
6138
|
label: `Reordenar ${label}`,
|
|
5634
6139
|
sortable
|
|
5635
6140
|
});
|
|
5636
|
-
return /* @__PURE__ */ jsxs(
|
|
6141
|
+
return /* @__PURE__ */ jsxs(Item, {
|
|
5637
6142
|
...sortableEnabled ? sortable.itemProps(it.id) : {},
|
|
6143
|
+
...itemMotion,
|
|
5638
6144
|
className: cn("flex min-w-0 items-center gap-1", sortable.draggingId === it.id && "opacity-50"),
|
|
5639
6145
|
children: [handle, it.to ? /* @__PURE__ */ jsx(Link, {
|
|
5640
6146
|
to: it.to,
|
|
@@ -5651,7 +6157,7 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
|
|
|
5651
6157
|
})]
|
|
5652
6158
|
}, it.id);
|
|
5653
6159
|
})
|
|
5654
|
-
});
|
|
6160
|
+
}, String(ready));
|
|
5655
6161
|
}
|
|
5656
6162
|
//#endregion
|
|
5657
6163
|
//#region src/components/ui/otp-input.tsx
|
|
@@ -5661,6 +6167,10 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
|
|
|
5661
6167
|
*/
|
|
5662
6168
|
function OtpInput({ length = 6, value, onChange, onComplete, invalid, disabled, id, ...aria }) {
|
|
5663
6169
|
const refs = useRef([]);
|
|
6170
|
+
const lib = useMotionLib();
|
|
6171
|
+
const on = lib !== null;
|
|
6172
|
+
const presets = useMotionPresets();
|
|
6173
|
+
const Cell = on ? lib.m.input : "input";
|
|
5664
6174
|
const digits = Array.from({ length }, (_, i) => value[i] ?? "");
|
|
5665
6175
|
const set = (next) => {
|
|
5666
6176
|
const clean = next.replace(/\D/g, "").slice(0, length);
|
|
@@ -5686,7 +6196,8 @@ function OtpInput({ length = 6, value, onChange, onComplete, invalid, disabled,
|
|
|
5686
6196
|
"data-rendra": "OTP-001",
|
|
5687
6197
|
className: "grid w-full max-w-sm grid-cols-otp gap-1 sm:gap-2",
|
|
5688
6198
|
style: { "--otp": length },
|
|
5689
|
-
children: digits.map((d, i) => /* @__PURE__ */ jsx(
|
|
6199
|
+
children: digits.map((d, i) => /* @__PURE__ */ jsx(Cell, {
|
|
6200
|
+
...on ? { animate: d ? presets.bump : void 0 } : {},
|
|
5690
6201
|
ref: (el) => {
|
|
5691
6202
|
refs.current[i] = el;
|
|
5692
6203
|
},
|
|
@@ -5851,7 +6362,7 @@ function Pagination({ page, pageSize, total, onPageChange, onPageSizeChange, pag
|
|
|
5851
6362
|
}
|
|
5852
6363
|
//#endregion
|
|
5853
6364
|
//#region src/components/ui/progress.tsx
|
|
5854
|
-
var bar = cva("h-full rounded-full transition-[width] duration-
|
|
6365
|
+
var bar = cva("h-full rounded-full transition-[width] duration-(--rendra-duration-base) ease-linear", {
|
|
5855
6366
|
variants: { tone: {
|
|
5856
6367
|
primary: "bg-primary",
|
|
5857
6368
|
brand: "bg-gradient-accent",
|
|
@@ -5870,6 +6381,7 @@ function Progress({ value, size = "md", tone, showValue, label, className }) {
|
|
|
5870
6381
|
children: [/* @__PURE__ */ jsx(Progress$1.Root, {
|
|
5871
6382
|
value: indeterminate ? null : value,
|
|
5872
6383
|
"aria-label": label,
|
|
6384
|
+
"data-allow-overflow": true,
|
|
5873
6385
|
className: cn("relative w-full overflow-hidden rounded-full bg-muted", size === "sm" ? "h-1" : "h-2"),
|
|
5874
6386
|
children: /* @__PURE__ */ jsx(Progress$1.Indicator, {
|
|
5875
6387
|
className: cn(bar({ tone }), indeterminate ? "absolute inset-y-0 left-0 w-1/3 progress-slide" : "w-progress"),
|
|
@@ -6709,26 +7221,61 @@ var cols = {
|
|
|
6709
7221
|
2: "md:grid-cols-2",
|
|
6710
7222
|
3: "md:grid-cols-3"
|
|
6711
7223
|
};
|
|
7224
|
+
/**
|
|
7225
|
+
* O item do Radix. Em `on` ele é um `m.button` (asChild) que responde ao toque (whileTap 0,97,
|
|
7226
|
+
* em `press`); em `off` é o `R.Item` de sempre, sem nó novo.
|
|
7227
|
+
*/
|
|
7228
|
+
function Item({ children, ...props }) {
|
|
7229
|
+
const presets = useMotionPresets();
|
|
7230
|
+
const lib = useMotionLib();
|
|
7231
|
+
if (!lib) return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
|
|
7232
|
+
...props,
|
|
7233
|
+
children
|
|
7234
|
+
});
|
|
7235
|
+
return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
|
|
7236
|
+
asChild: true,
|
|
7237
|
+
...props,
|
|
7238
|
+
children: /* @__PURE__ */ jsx(lib.m.button, {
|
|
7239
|
+
type: "button",
|
|
7240
|
+
whileTap: presets.press.whileTap,
|
|
7241
|
+
transition: presets.press.transition,
|
|
7242
|
+
children
|
|
7243
|
+
})
|
|
7244
|
+
});
|
|
7245
|
+
}
|
|
6712
7246
|
/** Radio único: em lista ou em cards, por prop. */
|
|
6713
7247
|
function RadioGroup({ options, value, defaultValue, onChange, variant = "list", columns = 2, orientation = "vertical", invalid, disabled, id, name, ...aria }) {
|
|
6714
|
-
const
|
|
7248
|
+
const lib = useMotionLib();
|
|
7249
|
+
const on = lib !== null;
|
|
7250
|
+
const presets = useMotionPresets();
|
|
7251
|
+
const [inner, setInner] = useState(defaultValue);
|
|
7252
|
+
const current = value ?? inner;
|
|
7253
|
+
const dotFor = (optionValue) => /* @__PURE__ */ jsx("span", {
|
|
6715
7254
|
"aria-hidden": true,
|
|
6716
7255
|
className: cn("flex size-icon-md shrink-0 items-center justify-center rounded-full border border-input bg-card transition-colors group-data-[state=checked]:border-primary", invalid && "border-destructive"),
|
|
6717
|
-
children: /* @__PURE__ */ jsx(
|
|
7256
|
+
children: on ? /* @__PURE__ */ jsx(lib.m.span, {
|
|
7257
|
+
className: "size-2 rounded-full bg-primary",
|
|
7258
|
+
initial: false,
|
|
7259
|
+
animate: current === optionValue ? presets.indicator.animate : presets.indicator.initial,
|
|
7260
|
+
transition: presets.indicator.transition
|
|
7261
|
+
}) : /* @__PURE__ */ jsx("span", { className: "size-2 scale-90 rounded-full bg-primary opacity-0 transition-[transform,opacity] duration-(--rendra-duration-fast) ease-out group-data-[state=checked]:scale-100 group-data-[state=checked]:opacity-100" })
|
|
6718
7262
|
});
|
|
6719
7263
|
return /* @__PURE__ */ jsx(RadioGroup$1.Root, {
|
|
6720
7264
|
id,
|
|
6721
7265
|
name,
|
|
6722
|
-
value,
|
|
6723
|
-
defaultValue,
|
|
6724
|
-
onValueChange:
|
|
7266
|
+
value: on ? current : value,
|
|
7267
|
+
defaultValue: on ? void 0 : defaultValue,
|
|
7268
|
+
onValueChange: (v) => {
|
|
7269
|
+
if (on) setInner(v);
|
|
7270
|
+
onChange?.(v);
|
|
7271
|
+
},
|
|
6725
7272
|
disabled,
|
|
6726
7273
|
"aria-invalid": invalid || void 0,
|
|
6727
7274
|
"aria-describedby": aria["aria-describedby"],
|
|
6728
7275
|
"aria-label": aria["aria-label"],
|
|
6729
7276
|
"data-rendra": resolveCatalogCode("RadioGroup", { variant }),
|
|
6730
7277
|
className: cn(variant === "cards" ? cn("grid grid-cols-1 gap-3", cols[columns]) : orientation === "horizontal" ? "flex flex-col sm:flex-row sm:flex-wrap sm:gap-x-6" : "flex flex-col"),
|
|
6731
|
-
children: options.map((o) => variant === "cards" ? /* @__PURE__ */ jsxs(
|
|
7278
|
+
children: options.map((o) => variant === "cards" ? /* @__PURE__ */ jsxs(Item, {
|
|
6732
7279
|
value: o.value,
|
|
6733
7280
|
disabled: o.disabled,
|
|
6734
7281
|
className: cn("group relative flex cursor-pointer items-start gap-3 rounded-control border bg-card p-4 text-left transition-[border-color,box-shadow,background-color]", "hover:border-primary data-[state=checked]:border-primary data-[state=checked]:bg-primary-soft data-[state=checked]:ring-1 data-[state=checked]:ring-primary", "disabled:cursor-not-allowed disabled:opacity-50", invalid && "border-destructive"),
|
|
@@ -6747,15 +7294,15 @@ function RadioGroup({ options, value, defaultValue, onChange, variant = "list",
|
|
|
6747
7294
|
children: o.description
|
|
6748
7295
|
})]
|
|
6749
7296
|
}),
|
|
6750
|
-
|
|
7297
|
+
dotFor(o.value)
|
|
6751
7298
|
]
|
|
6752
7299
|
}, o.value) : /* @__PURE__ */ jsxs("label", {
|
|
6753
7300
|
className: cn("flex min-h-touch cursor-pointer items-start gap-3 py-3 md:min-h-0 md:py-1", o.disabled && "cursor-not-allowed opacity-60"),
|
|
6754
|
-
children: [/* @__PURE__ */ jsx(
|
|
7301
|
+
children: [/* @__PURE__ */ jsx(Item, {
|
|
6755
7302
|
value: o.value,
|
|
6756
7303
|
disabled: o.disabled,
|
|
6757
7304
|
className: "group flex pt-px outline-none focus-visible:[&>span]:focus-ring",
|
|
6758
|
-
children:
|
|
7305
|
+
children: dotFor(o.value)
|
|
6759
7306
|
}), /* @__PURE__ */ jsxs("span", {
|
|
6760
7307
|
className: "flex min-w-0 flex-col gap-1",
|
|
6761
7308
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -6990,18 +7537,70 @@ function Separator({ orientation = "horizontal", label, className }) {
|
|
|
6990
7537
|
}
|
|
6991
7538
|
//#endregion
|
|
6992
7539
|
//#region src/components/ui/skeleton.tsx
|
|
6993
|
-
/**
|
|
7540
|
+
/**
|
|
7541
|
+
* Bloco de carregamento. Monte o skeleton com a mesma estrutura do conteúdo final. Em `off` pulsa
|
|
7542
|
+
* (animate-pulse do Tailwind); em `on` um brilho suave cruza o bloco (skeleton-shimmer, em
|
|
7543
|
+
* globals.css: transform, tempo e curva pelos tokens, parado com "reduzir movimento").
|
|
7544
|
+
*/
|
|
6994
7545
|
function Skeleton({ className, ...props }) {
|
|
7546
|
+
const on = useMotionMode() === "on";
|
|
6995
7547
|
return /* @__PURE__ */ jsx("div", {
|
|
6996
7548
|
"aria-hidden": true,
|
|
6997
7549
|
"data-slot": "skeleton",
|
|
6998
7550
|
"data-rendra": "SKEL-001",
|
|
6999
|
-
className: cn("animate-pulse rounded-block bg-muted", className),
|
|
7551
|
+
className: cn(on ? "skeleton-shimmer" : "animate-pulse", "rounded-block bg-muted", className),
|
|
7000
7552
|
...props
|
|
7001
7553
|
});
|
|
7002
7554
|
}
|
|
7003
7555
|
//#endregion
|
|
7004
7556
|
//#region src/components/ui/stat-card.tsx
|
|
7557
|
+
/** Contagem de 0 até o valor, com o formato do texto original; no fim mostra o `value` exato. */
|
|
7558
|
+
function Counter({ parsed, value }) {
|
|
7559
|
+
const { animate, m, useMotionValue, useTransform } = useMotionOn();
|
|
7560
|
+
const presets = useMotionPresets();
|
|
7561
|
+
const [skip] = useState(useMotionAdopted());
|
|
7562
|
+
const progress = useMotionValue(skip ? parsed.value : 0);
|
|
7563
|
+
const text = useTransform(progress, (n) => formatLike(parsed, n));
|
|
7564
|
+
const [done, setDone] = useState(skip);
|
|
7565
|
+
useEffect(() => {
|
|
7566
|
+
if (skip) return;
|
|
7567
|
+
const controls = animate(progress, parsed.value, {
|
|
7568
|
+
duration: presets.tokens.reveal.count,
|
|
7569
|
+
ease: presets.tokens.ease.out,
|
|
7570
|
+
onComplete: () => setDone(true)
|
|
7571
|
+
});
|
|
7572
|
+
return () => controls.stop();
|
|
7573
|
+
}, [
|
|
7574
|
+
animate,
|
|
7575
|
+
progress,
|
|
7576
|
+
parsed.value,
|
|
7577
|
+
presets.tokens,
|
|
7578
|
+
skip
|
|
7579
|
+
]);
|
|
7580
|
+
return /* @__PURE__ */ jsx(m.span, {
|
|
7581
|
+
...presets.fade,
|
|
7582
|
+
children: done ? value : text
|
|
7583
|
+
});
|
|
7584
|
+
}
|
|
7585
|
+
/**
|
|
7586
|
+
* O valor do card. Em `off`, o valor como sempre veio. Em `on`, número (ou texto pt-BR com
|
|
7587
|
+
* número) conta até o valor; qualquer outra coisa só aparece com fade. Com "reduzir movimento"
|
|
7588
|
+
* o valor final aparece direto.
|
|
7589
|
+
*/
|
|
7590
|
+
function StatValue({ value }) {
|
|
7591
|
+
const lib = useMotionLib();
|
|
7592
|
+
const presets = useMotionPresets();
|
|
7593
|
+
const parsed = useMemo(() => parseLocaleNumber$1(value), [value]);
|
|
7594
|
+
if (!lib) return /* @__PURE__ */ jsx(Fragment$1, { children: value });
|
|
7595
|
+
if (!parsed || presets.reduced) return /* @__PURE__ */ jsx(lib.m.span, {
|
|
7596
|
+
...presets.fade,
|
|
7597
|
+
children: value
|
|
7598
|
+
});
|
|
7599
|
+
return /* @__PURE__ */ jsx(Counter, {
|
|
7600
|
+
parsed,
|
|
7601
|
+
value
|
|
7602
|
+
}, String(value));
|
|
7603
|
+
}
|
|
7005
7604
|
/** Card de indicador. Em grid: 1 coluna no mobile, 2 para cards pequenos. */
|
|
7006
7605
|
function StatCard({ label, value, change, changeLabel, inverse, icon, highlight, loading, footer, className }) {
|
|
7007
7606
|
const up = (change ?? 0) > 0;
|
|
@@ -7023,9 +7622,9 @@ function StatCard({ label, value, change, changeLabel, inverse, icon, highlight,
|
|
|
7023
7622
|
children: icon
|
|
7024
7623
|
})]
|
|
7025
7624
|
}),
|
|
7026
|
-
loading ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
7625
|
+
loading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-8 w-24" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-3 w-16" })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
7027
7626
|
className: "text-2xl font-semibold tracking-tight tabular-nums @xs:text-3xl",
|
|
7028
|
-
children: value
|
|
7627
|
+
children: /* @__PURE__ */ jsx(StatValue, { value })
|
|
7029
7628
|
}), change !== void 0 && /* @__PURE__ */ jsxs("span", {
|
|
7030
7629
|
className: "flex flex-wrap items-center gap-1 text-xs",
|
|
7031
7630
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
@@ -7109,7 +7708,7 @@ function CellContent({ col, row, title }) {
|
|
|
7109
7708
|
className: cn("rounded-item font-medium text-foreground underline-offset-4 transition-colors outline-none hover:text-primary-text hover:underline focus-visible:ring-2 focus-visible:ring-ring", title && "inline-flex min-h-touch items-center md:min-h-0"),
|
|
7110
7709
|
children: main
|
|
7111
7710
|
}) : main;
|
|
7112
|
-
if (!extra.length) return /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
7711
|
+
if (!extra.length) return /* @__PURE__ */ jsx(Fragment$1, { children: value });
|
|
7113
7712
|
return /* @__PURE__ */ jsxs("span", {
|
|
7114
7713
|
className: "flex min-w-0 flex-col",
|
|
7115
7714
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -7189,8 +7788,69 @@ var tableFeatureSet = tableFeatures({
|
|
|
7189
7788
|
* Mobile (< 768px): a mesma tabela vira lista de cards, sem rolagem horizontal.
|
|
7190
7789
|
* Desktop: tabela larga rola na horizontal só dentro do próprio contêiner.
|
|
7191
7790
|
*/
|
|
7791
|
+
/**
|
|
7792
|
+
* Bloco "Ver detalhes" do card no celular. Em `on` a altura abre e fecha pelos presets e o
|
|
7793
|
+
* conteúdo fechado sai do DOM; em `off` é o Collapsible de sempre, com as animações em CSS.
|
|
7794
|
+
*/
|
|
7795
|
+
function MobileDetails({ children }) {
|
|
7796
|
+
const lib = useMotionLib();
|
|
7797
|
+
const presets = useMotionPresets();
|
|
7798
|
+
const [open, setOpen] = useState(false);
|
|
7799
|
+
const trigger = /* @__PURE__ */ jsxs(Collapsible.Trigger, {
|
|
7800
|
+
className: "group flex min-h-touch cursor-pointer items-center gap-1 text-sm font-medium text-primary-text",
|
|
7801
|
+
children: [
|
|
7802
|
+
/* @__PURE__ */ jsx("span", {
|
|
7803
|
+
className: "group-data-[state=open]:hidden",
|
|
7804
|
+
children: "Ver detalhes"
|
|
7805
|
+
}),
|
|
7806
|
+
/* @__PURE__ */ jsx("span", {
|
|
7807
|
+
className: "hidden group-data-[state=open]:inline",
|
|
7808
|
+
children: "Ocultar detalhes"
|
|
7809
|
+
}),
|
|
7810
|
+
/* @__PURE__ */ jsx(ChevronDown, {
|
|
7811
|
+
className: "size-icon-sm transition-transform duration-(--rendra-duration-base) ease-move group-data-[state=open]:rotate-180",
|
|
7812
|
+
"aria-hidden": true
|
|
7813
|
+
})
|
|
7814
|
+
]
|
|
7815
|
+
});
|
|
7816
|
+
if (lib) return /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
7817
|
+
open,
|
|
7818
|
+
onOpenChange: setOpen,
|
|
7819
|
+
children: [trigger, /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
7820
|
+
initial: false,
|
|
7821
|
+
children: open && /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
7822
|
+
forceMount: true,
|
|
7823
|
+
asChild: true,
|
|
7824
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
7825
|
+
className: "overflow-hidden",
|
|
7826
|
+
initial: {
|
|
7827
|
+
height: 0,
|
|
7828
|
+
opacity: 0
|
|
7829
|
+
},
|
|
7830
|
+
animate: {
|
|
7831
|
+
height: "auto",
|
|
7832
|
+
opacity: 1
|
|
7833
|
+
},
|
|
7834
|
+
exit: {
|
|
7835
|
+
height: 0,
|
|
7836
|
+
opacity: 0
|
|
7837
|
+
},
|
|
7838
|
+
transition: presets.fade.transition,
|
|
7839
|
+
children
|
|
7840
|
+
})
|
|
7841
|
+
})
|
|
7842
|
+
})]
|
|
7843
|
+
});
|
|
7844
|
+
return /* @__PURE__ */ jsxs(Collapsible.Root, { children: [trigger, /* @__PURE__ */ jsx(Collapsible.Content, {
|
|
7845
|
+
className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down",
|
|
7846
|
+
children
|
|
7847
|
+
})] });
|
|
7848
|
+
}
|
|
7192
7849
|
function Table({ data: dataProp, source, queryKey = "", columns: columnsProp, statusLast = true, getRowId, selectable, expandable, sortable = true, globalFilter, columnVisibility, bulkActions, bulkMenu, rowActions, density = "default", loading, error, onRetry, empty, pageSize: pageSizeProp = 15, mobilePagination = "pages", toolbar, ...aria }) {
|
|
7193
7850
|
const { isMobile } = useBreakpoint();
|
|
7851
|
+
const lib = useMotionLib();
|
|
7852
|
+
const on = lib !== null;
|
|
7853
|
+
const presets = useMotionPresets();
|
|
7194
7854
|
const columns = useMemo(() => statusLast ? [...columnsProp.filter((c) => c.kind !== "badge"), ...columnsProp.filter((c) => c.kind === "badge")] : columnsProp, [columnsProp, statusLast]);
|
|
7195
7855
|
const [sorting, setSorting] = useState([]);
|
|
7196
7856
|
const [rowSelection, setRowSelection] = useState({});
|
|
@@ -7357,7 +8017,7 @@ function Table({ data: dataProp, source, queryKey = "", columns: columnsProp, st
|
|
|
7357
8017
|
label: `${c.header} (decrescente)`
|
|
7358
8018
|
}])
|
|
7359
8019
|
}) : void 0;
|
|
7360
|
-
const selectionBar = selectable && selectedRows.length > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8020
|
+
const selectionBar = selectable && selectedRows.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
7361
8021
|
/* @__PURE__ */ jsxs("span", {
|
|
7362
8022
|
className: "text-sm font-medium tabular-nums",
|
|
7363
8023
|
children: [
|
|
@@ -7448,43 +8108,24 @@ function Table({ data: dataProp, source, queryKey = "", columns: columnsProp, st
|
|
|
7448
8108
|
}, c.id))]
|
|
7449
8109
|
})]
|
|
7450
8110
|
}),
|
|
7451
|
-
(secondary.length > 0 || expandable) && /* @__PURE__ */ jsxs(
|
|
7452
|
-
className: "
|
|
7453
|
-
children:
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
/* @__PURE__ */ jsx("
|
|
7459
|
-
className: "
|
|
7460
|
-
children:
|
|
7461
|
-
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
children: [/* @__PURE__ */ jsx("dl", {
|
|
7470
|
-
className: "grid grid-cols-1 gap-3 pt-2 sm:grid-cols-2",
|
|
7471
|
-
children: secondary.map((c) => /* @__PURE__ */ jsxs("div", {
|
|
7472
|
-
className: "flex flex-col gap-1",
|
|
7473
|
-
children: [/* @__PURE__ */ jsx("dt", {
|
|
7474
|
-
className: "text-xs text-muted-foreground",
|
|
7475
|
-
children: c.header
|
|
7476
|
-
}), /* @__PURE__ */ jsx("dd", {
|
|
7477
|
-
className: "text-sm",
|
|
7478
|
-
children: /* @__PURE__ */ jsx(CellContent, {
|
|
7479
|
-
col: c,
|
|
7480
|
-
row
|
|
7481
|
-
})
|
|
7482
|
-
})]
|
|
7483
|
-
}, c.id))
|
|
7484
|
-
}), expandable && /* @__PURE__ */ jsx("div", {
|
|
7485
|
-
className: "pt-3",
|
|
7486
|
-
children: expandable(row)
|
|
7487
|
-
})]
|
|
8111
|
+
(secondary.length > 0 || expandable) && /* @__PURE__ */ jsxs(MobileDetails, { children: [/* @__PURE__ */ jsx("dl", {
|
|
8112
|
+
className: "grid grid-cols-1 gap-3 pt-2 sm:grid-cols-2",
|
|
8113
|
+
children: secondary.map((c) => /* @__PURE__ */ jsxs("div", {
|
|
8114
|
+
className: "flex flex-col gap-1",
|
|
8115
|
+
children: [/* @__PURE__ */ jsx("dt", {
|
|
8116
|
+
className: "text-xs text-muted-foreground",
|
|
8117
|
+
children: c.header
|
|
8118
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
8119
|
+
className: "text-sm",
|
|
8120
|
+
children: /* @__PURE__ */ jsx(CellContent, {
|
|
8121
|
+
col: c,
|
|
8122
|
+
row
|
|
8123
|
+
})
|
|
8124
|
+
})]
|
|
8125
|
+
}, c.id))
|
|
8126
|
+
}), expandable && /* @__PURE__ */ jsx("div", {
|
|
8127
|
+
className: "pt-3",
|
|
8128
|
+
children: expandable(row)
|
|
7488
8129
|
})] }),
|
|
7489
8130
|
rowActions && rowActions.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
7490
8131
|
className: "border-t pt-3",
|
|
@@ -7574,59 +8215,92 @@ function Table({ data: dataProp, source, queryKey = "", columns: columnsProp, st
|
|
|
7574
8215
|
})
|
|
7575
8216
|
] }, i)) : rows.map((r) => {
|
|
7576
8217
|
const row = r.original;
|
|
7577
|
-
return /* @__PURE__ */ jsxs(Fragment
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
8218
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8219
|
+
/* @__PURE__ */ jsxs("tr", {
|
|
8220
|
+
"data-state": r.getIsSelected() ? "selected" : void 0,
|
|
8221
|
+
className: "group/row transition-colors hover:bg-muted/40 data-[state=selected]:bg-primary-soft/60",
|
|
8222
|
+
children: [
|
|
8223
|
+
selectable && /* @__PURE__ */ jsx("td", {
|
|
8224
|
+
className: "pr-2 pl-4",
|
|
8225
|
+
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
8226
|
+
"aria-label": "Selecionar linha",
|
|
8227
|
+
checked: r.getIsSelected(),
|
|
8228
|
+
onCheckedChange: (v) => r.toggleSelected(v)
|
|
8229
|
+
})
|
|
8230
|
+
}),
|
|
8231
|
+
expandable && /* @__PURE__ */ jsx("td", {
|
|
8232
|
+
className: "px-2",
|
|
8233
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
8234
|
+
variant: "ghost",
|
|
8235
|
+
size: "sm",
|
|
8236
|
+
iconOnly: true,
|
|
8237
|
+
"aria-label": r.getIsExpanded() ? "Recolher linha" : "Expandir linha",
|
|
8238
|
+
"aria-expanded": r.getIsExpanded(),
|
|
8239
|
+
onClick: () => r.toggleExpanded(),
|
|
8240
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: cn("transition-transform", r.getIsExpanded() && "rotate-180") })
|
|
8241
|
+
})
|
|
8242
|
+
}),
|
|
8243
|
+
visibleCols.map((c) => {
|
|
8244
|
+
const align = alignOf(c);
|
|
8245
|
+
return /* @__PURE__ */ jsx("td", {
|
|
8246
|
+
className: cn("px-4 align-middle", pad, align === "right" ? "text-right tabular-nums" : align === "center" ? "text-center" : "text-left", c.width && minWidth[c.width]),
|
|
8247
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
8248
|
+
className: cn(clamp[c.lines ?? 2], align === "right" && "ml-auto"),
|
|
8249
|
+
children: /* @__PURE__ */ jsx(CellContent, {
|
|
8250
|
+
col: c,
|
|
8251
|
+
row
|
|
8252
|
+
})
|
|
7610
8253
|
})
|
|
8254
|
+
}, c.id);
|
|
8255
|
+
}),
|
|
8256
|
+
rowActions && /* @__PURE__ */ jsx("td", {
|
|
8257
|
+
className: "sticky right-0 w-24 bg-card px-4 group-hover/row:bg-muted group-data-[state=selected]/row:bg-primary-soft",
|
|
8258
|
+
children: /* @__PURE__ */ jsx(RowActions, {
|
|
8259
|
+
row,
|
|
8260
|
+
actions: rowActions
|
|
7611
8261
|
})
|
|
7612
|
-
}, c.id);
|
|
7613
|
-
}),
|
|
7614
|
-
rowActions && /* @__PURE__ */ jsx("td", {
|
|
7615
|
-
className: "sticky right-0 w-24 bg-card px-4 group-hover/row:bg-muted group-data-[state=selected]/row:bg-primary-soft",
|
|
7616
|
-
children: /* @__PURE__ */ jsx(RowActions, {
|
|
7617
|
-
row,
|
|
7618
|
-
actions: rowActions
|
|
7619
8262
|
})
|
|
8263
|
+
]
|
|
8264
|
+
}),
|
|
8265
|
+
expandable && !on && r.getIsExpanded() && /* @__PURE__ */ jsx("tr", {
|
|
8266
|
+
className: "bg-muted/30",
|
|
8267
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
8268
|
+
colSpan: visibleCols.length + (selectable ? 1 : 0) + 1 + (rowActions ? 1 : 0),
|
|
8269
|
+
className: "px-4 py-4",
|
|
8270
|
+
children: expandable(row)
|
|
7620
8271
|
})
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
8272
|
+
}),
|
|
8273
|
+
expandable && on && /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
8274
|
+
initial: false,
|
|
8275
|
+
children: r.getIsExpanded() && /* @__PURE__ */ jsx("tr", {
|
|
8276
|
+
className: "bg-muted/30",
|
|
8277
|
+
children: /* @__PURE__ */ jsx("td", {
|
|
8278
|
+
colSpan: visibleCols.length + (selectable ? 1 : 0) + 1 + (rowActions ? 1 : 0),
|
|
8279
|
+
className: "px-4",
|
|
8280
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
8281
|
+
className: "overflow-hidden",
|
|
8282
|
+
initial: {
|
|
8283
|
+
height: 0,
|
|
8284
|
+
opacity: 0
|
|
8285
|
+
},
|
|
8286
|
+
animate: {
|
|
8287
|
+
height: "auto",
|
|
8288
|
+
opacity: 1
|
|
8289
|
+
},
|
|
8290
|
+
exit: {
|
|
8291
|
+
height: 0,
|
|
8292
|
+
opacity: 0
|
|
8293
|
+
},
|
|
8294
|
+
transition: presets.fade.transition,
|
|
8295
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
8296
|
+
className: "py-4",
|
|
8297
|
+
children: expandable(row)
|
|
8298
|
+
})
|
|
8299
|
+
})
|
|
8300
|
+
})
|
|
8301
|
+
}, "expanded")
|
|
7628
8302
|
})
|
|
7629
|
-
|
|
8303
|
+
] }, r.id);
|
|
7630
8304
|
})
|
|
7631
8305
|
})]
|
|
7632
8306
|
})
|
|
@@ -7753,14 +8427,26 @@ var statusTextTone = {
|
|
|
7753
8427
|
};
|
|
7754
8428
|
/** Linha do tempo única, com eventos em ordem e tom semântico por evento. */
|
|
7755
8429
|
function Timeline({ events, className }) {
|
|
8430
|
+
const lib = useMotionLib();
|
|
8431
|
+
const on = lib !== null;
|
|
8432
|
+
const presets = useMotionPresets();
|
|
8433
|
+
const Item = on ? lib.m.li : "li";
|
|
8434
|
+
const enter = presets.slide("bottom", "short");
|
|
7756
8435
|
return /* @__PURE__ */ jsx("ol", {
|
|
7757
8436
|
"data-rendra": "TLN-001",
|
|
7758
8437
|
className: cn("@container flex flex-col", className),
|
|
7759
8438
|
children: events.map((e, i) => {
|
|
7760
8439
|
const StatusIcon = e.status ? statusIcon[e.status] : null;
|
|
7761
8440
|
const tone = e.tone ?? (e.status ? statusTone[e.status] : "neutral");
|
|
7762
|
-
return /* @__PURE__ */ jsxs(
|
|
8441
|
+
return /* @__PURE__ */ jsxs(Item, {
|
|
7763
8442
|
className: "relative flex gap-3 pb-6 last:pb-0",
|
|
8443
|
+
...on ? {
|
|
8444
|
+
...enter,
|
|
8445
|
+
transition: {
|
|
8446
|
+
...enter.transition,
|
|
8447
|
+
...presets.stagger(i)
|
|
8448
|
+
}
|
|
8449
|
+
} : {},
|
|
7764
8450
|
children: [
|
|
7765
8451
|
i < events.length - 1 && /* @__PURE__ */ jsx("span", {
|
|
7766
8452
|
"aria-hidden": true,
|
|
@@ -7777,7 +8463,7 @@ function Timeline({ events, className }) {
|
|
|
7777
8463
|
/* @__PURE__ */ jsxs("div", {
|
|
7778
8464
|
className: "flex min-w-0 flex-col gap-1 @sm:flex-row @sm:items-baseline @sm:justify-between @sm:gap-3",
|
|
7779
8465
|
children: [/* @__PURE__ */ jsx("span", {
|
|
7780
|
-
className: "text-sm font-medium",
|
|
8466
|
+
className: "text-sm font-medium wrap-break-word",
|
|
7781
8467
|
children: e.title
|
|
7782
8468
|
}), /* @__PURE__ */ jsx("time", {
|
|
7783
8469
|
className: "shrink-0 text-xs text-muted-foreground tabular-nums",
|
|
@@ -7785,7 +8471,7 @@ function Timeline({ events, className }) {
|
|
|
7785
8471
|
})]
|
|
7786
8472
|
}),
|
|
7787
8473
|
e.description && /* @__PURE__ */ jsx("p", {
|
|
7788
|
-
className: "text-sm text-muted-foreground",
|
|
8474
|
+
className: "text-sm wrap-break-word text-muted-foreground",
|
|
7789
8475
|
children: e.description
|
|
7790
8476
|
}),
|
|
7791
8477
|
e.status && StatusIcon && /* @__PURE__ */ jsxs("span", {
|
|
@@ -7822,10 +8508,10 @@ function show(type, title, opts = {}) {
|
|
|
7822
8508
|
/* @__PURE__ */ jsxs("div", {
|
|
7823
8509
|
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
7824
8510
|
children: [/* @__PURE__ */ jsx("p", {
|
|
7825
|
-
className: "text-sm font-semibold",
|
|
8511
|
+
className: "text-sm font-semibold wrap-break-word",
|
|
7826
8512
|
children: title
|
|
7827
8513
|
}), opts.description && /* @__PURE__ */ jsx("p", {
|
|
7828
|
-
className: "text-sm text-muted-foreground",
|
|
8514
|
+
className: "text-sm wrap-break-word text-muted-foreground",
|
|
7829
8515
|
children: opts.description
|
|
7830
8516
|
})]
|
|
7831
8517
|
}),
|
|
@@ -8005,6 +8691,28 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
|
|
|
8005
8691
|
onReorder?.(sorted.map((s) => s.id));
|
|
8006
8692
|
}
|
|
8007
8693
|
});
|
|
8694
|
+
const motion = useMotionMode();
|
|
8695
|
+
const lib = useMotionLib();
|
|
8696
|
+
const ready = useLayoutReady();
|
|
8697
|
+
const presets = useMotionPresets();
|
|
8698
|
+
const Item = lib ? lib.m.li : "li";
|
|
8699
|
+
const itemMotion = motion === "on" ? {
|
|
8700
|
+
...presets.fade,
|
|
8701
|
+
layout: layoutEnabled({
|
|
8702
|
+
mode: motion,
|
|
8703
|
+
ready,
|
|
8704
|
+
dragging: sortable.draggingId !== null
|
|
8705
|
+
}),
|
|
8706
|
+
transition: {
|
|
8707
|
+
...presets.fade.transition,
|
|
8708
|
+
layout: presets.move
|
|
8709
|
+
}
|
|
8710
|
+
} : {};
|
|
8711
|
+
const animated = (nodes) => lib ? /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
8712
|
+
mode: "popLayout",
|
|
8713
|
+
initial: false,
|
|
8714
|
+
children: nodes
|
|
8715
|
+
}) : nodes;
|
|
8008
8716
|
const dropzone = !(maxItems !== void 0 && items.length + pendingCrop.length >= maxItems) && /* @__PURE__ */ jsxs("label", {
|
|
8009
8717
|
htmlFor: inputId,
|
|
8010
8718
|
onDragOver: (e) => {
|
|
@@ -8062,8 +8770,9 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
|
|
|
8062
8770
|
const listView = items.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
8063
8771
|
className: "flex flex-col divide-y rounded-control border bg-card",
|
|
8064
8772
|
"aria-live": "polite",
|
|
8065
|
-
children: items.map((it) => /* @__PURE__ */ jsxs(
|
|
8773
|
+
children: animated(items.map((it) => /* @__PURE__ */ jsxs(Item, {
|
|
8066
8774
|
...onReorder ? sortable.itemProps(it.id) : {},
|
|
8775
|
+
...itemMotion,
|
|
8067
8776
|
className: cn("flex items-center gap-3 p-3", sortable.draggingId === it.id && "opacity-50"),
|
|
8068
8777
|
children: [
|
|
8069
8778
|
handle(it),
|
|
@@ -8131,12 +8840,13 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
|
|
|
8131
8840
|
children: /* @__PURE__ */ jsx(Trash2, {})
|
|
8132
8841
|
})
|
|
8133
8842
|
]
|
|
8134
|
-
}, it.id))
|
|
8135
|
-
});
|
|
8843
|
+
}, it.id)))
|
|
8844
|
+
}, String(ready));
|
|
8136
8845
|
const galleryView = items.length > 0 && /* @__PURE__ */ jsx("ul", {
|
|
8137
8846
|
className: "grid grid-cols-2 gap-3 md:grid-cols-3",
|
|
8138
|
-
children: items.map((it) => /* @__PURE__ */ jsxs(
|
|
8847
|
+
children: animated(items.map((it) => /* @__PURE__ */ jsxs(Item, {
|
|
8139
8848
|
...onReorder ? sortable.itemProps(it.id) : {},
|
|
8849
|
+
...itemMotion,
|
|
8140
8850
|
className: cn("relative flex aspect-square flex-col overflow-hidden rounded-control border bg-card", sortable.draggingId === it.id && "opacity-50"),
|
|
8141
8851
|
children: [
|
|
8142
8852
|
it.previewUrl && it.kind === "image" ? /* @__PURE__ */ jsx("img", {
|
|
@@ -8200,8 +8910,8 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
|
|
|
8200
8910
|
})]
|
|
8201
8911
|
})
|
|
8202
8912
|
]
|
|
8203
|
-
}, it.id))
|
|
8204
|
-
});
|
|
8913
|
+
}, it.id)))
|
|
8914
|
+
}, String(ready));
|
|
8205
8915
|
return /* @__PURE__ */ jsxs("div", {
|
|
8206
8916
|
"data-rendra": code,
|
|
8207
8917
|
className: "flex min-w-0 flex-col gap-3",
|
|
@@ -8247,6 +8957,8 @@ var statusLabel = {
|
|
|
8247
8957
|
*/
|
|
8248
8958
|
function Stepper({ steps, current, errors = [], orientation = "horizontal", onStepClick, className }) {
|
|
8249
8959
|
const step = steps[current];
|
|
8960
|
+
const lib = useMotionLib();
|
|
8961
|
+
const presets = useMotionPresets();
|
|
8250
8962
|
return /* @__PURE__ */ jsxs("div", {
|
|
8251
8963
|
"data-rendra": "WIZ-002",
|
|
8252
8964
|
className: cn("min-w-0", className),
|
|
@@ -8286,7 +8998,15 @@ function Stepper({ steps, current, errors = [], orientation = "horizontal", onSt
|
|
|
8286
8998
|
const clickable = onStepClick && st === "complete";
|
|
8287
8999
|
const circle = /* @__PURE__ */ jsx("span", {
|
|
8288
9000
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold tabular-nums transition-colors", st === "complete" && "border-primary bg-primary text-primary-foreground", st === "current" && "border-primary bg-card text-primary-text", st === "pending" && "border-border bg-card text-muted-foreground", st === "error" && "border-destructive bg-destructive text-destructive-foreground"),
|
|
8289
|
-
children: st === "complete" ? /* @__PURE__ */ jsx(
|
|
9001
|
+
children: st === "complete" ? lib ? /* @__PURE__ */ jsx(lib.m.span, {
|
|
9002
|
+
className: "flex",
|
|
9003
|
+
...presets.pop,
|
|
9004
|
+
children: /* @__PURE__ */ jsx(Check, {
|
|
9005
|
+
className: "size-icon-sm",
|
|
9006
|
+
strokeWidth: 3,
|
|
9007
|
+
"aria-hidden": true
|
|
9008
|
+
})
|
|
9009
|
+
}) : /* @__PURE__ */ jsx(Check, {
|
|
8290
9010
|
className: "size-icon-sm",
|
|
8291
9011
|
strokeWidth: 3,
|
|
8292
9012
|
"aria-hidden": true
|
|
@@ -8368,7 +9088,23 @@ function Wizard({ steps, children, onValidateStep, onFinish, onCancel, cancelLab
|
|
|
8368
9088
|
setCurrent((c) => c + 1);
|
|
8369
9089
|
onSkip?.();
|
|
8370
9090
|
};
|
|
8371
|
-
const
|
|
9091
|
+
const lib = useMotionLib();
|
|
9092
|
+
const presets = useMotionPresets();
|
|
9093
|
+
const previous = useRef(current);
|
|
9094
|
+
const direction = current >= previous.current ? 1 : -1;
|
|
9095
|
+
previous.current = current;
|
|
9096
|
+
const body = lib ? /* @__PURE__ */ jsx("div", {
|
|
9097
|
+
className: "relative flex min-w-0 flex-col gap-6",
|
|
9098
|
+
children: /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
9099
|
+
mode: "popLayout",
|
|
9100
|
+
initial: false,
|
|
9101
|
+
children: /* @__PURE__ */ jsx(lib.m.div, {
|
|
9102
|
+
...presets.swap(direction),
|
|
9103
|
+
className: "flex min-w-0 flex-col gap-6",
|
|
9104
|
+
children: children[current]
|
|
9105
|
+
}, current)
|
|
9106
|
+
})
|
|
9107
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
8372
9108
|
className: "flex min-w-0 flex-col gap-6",
|
|
8373
9109
|
children: children[current]
|
|
8374
9110
|
});
|
|
@@ -8768,7 +9504,7 @@ function MegaItem({ item }) {
|
|
|
8768
9504
|
const Link = useRendraLink();
|
|
8769
9505
|
const Icon = item.icon;
|
|
8770
9506
|
const active = item.to ? isActive(pathname, item.to) : false;
|
|
8771
|
-
const head = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
9507
|
+
const head = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
8772
9508
|
className: cn("flex size-control-md shrink-0 items-center justify-center rounded-control transition-colors", active ? "bg-primary text-primary-foreground" : "bg-primary-soft text-primary-soft-foreground group-hover/item:bg-primary group-hover/item:text-primary-foreground"),
|
|
8773
9509
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
8774
9510
|
className: "size-icon-md",
|
|
@@ -9014,7 +9750,7 @@ function ModeItems() {
|
|
|
9014
9750
|
}
|
|
9015
9751
|
function LayoutItems() {
|
|
9016
9752
|
const { layout, setLayout, resetLayout } = useShell();
|
|
9017
|
-
const radio = (key, title) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: title }), /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
9753
|
+
const radio = (key, title) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuLabel, { children: title }), /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
9018
9754
|
value: layout[key],
|
|
9019
9755
|
onValueChange: (v) => setLayout(key, v),
|
|
9020
9756
|
children: layoutOptions[key].map((o) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
@@ -9023,10 +9759,10 @@ function LayoutItems() {
|
|
|
9023
9759
|
}, o.value))
|
|
9024
9760
|
})] });
|
|
9025
9761
|
const sidebar = layout.navigation === "sidebar";
|
|
9026
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9762
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9027
9763
|
radio("navigation", "Posição do menu"),
|
|
9028
|
-
!sidebar && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), radio("topbarSubmenu", "Submenu")] }),
|
|
9029
|
-
sidebar && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9764
|
+
!sidebar && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), radio("topbarSubmenu", "Submenu")] }),
|
|
9765
|
+
sidebar && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9030
9766
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
9031
9767
|
radio("sidebar", "Sidebar"),
|
|
9032
9768
|
/* @__PURE__ */ jsx(DropdownMenuCheckboxItem, {
|
|
@@ -9085,7 +9821,7 @@ function UserMenu() {
|
|
|
9085
9821
|
children: user.email
|
|
9086
9822
|
})]
|
|
9087
9823
|
}),
|
|
9088
|
-
workspaces && workspaces.items.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9824
|
+
workspaces && workspaces.items.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9089
9825
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
9090
9826
|
/* @__PURE__ */ jsx(DropdownMenuLabel, { children: workspaces.label ?? "Espaço" }),
|
|
9091
9827
|
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
@@ -9097,7 +9833,7 @@ function UserMenu() {
|
|
|
9097
9833
|
}, w.id))
|
|
9098
9834
|
})
|
|
9099
9835
|
] }),
|
|
9100
|
-
userMenuItems.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), userMenuItems.map((item) => {
|
|
9836
|
+
userMenuItems.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), userMenuItems.map((item) => {
|
|
9101
9837
|
const Icon = item.icon;
|
|
9102
9838
|
return item.to ? /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
9103
9839
|
asChild: true,
|
|
@@ -9275,7 +10011,7 @@ function Header() {
|
|
|
9275
10011
|
const topbar = layout.navigation === "topbar";
|
|
9276
10012
|
const hasParent = Boolean(crumbs.length >= 2 && crumbs[crumbs.length - 2]?.to);
|
|
9277
10013
|
const menuInFooter = layout.bottomNav || hasParent;
|
|
9278
|
-
const pageTitle = /* @__PURE__ */ jsxs(Fragment, { children: [headerLogo && /* @__PURE__ */ jsx("span", {
|
|
10014
|
+
const pageTitle = /* @__PURE__ */ jsxs(Fragment$1, { children: [headerLogo && /* @__PURE__ */ jsx("span", {
|
|
9279
10015
|
"aria-hidden": true,
|
|
9280
10016
|
className: "flex min-w-0 flex-1 items-center md:hidden",
|
|
9281
10017
|
children: headerLogo
|
|
@@ -9309,7 +10045,7 @@ function Header() {
|
|
|
9309
10045
|
onClick: () => setMobileNavOpen(true),
|
|
9310
10046
|
children: /* @__PURE__ */ jsx(Menu, { "aria-hidden": true })
|
|
9311
10047
|
}),
|
|
9312
|
-
topbar ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10048
|
+
topbar ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9313
10049
|
/* @__PURE__ */ jsx(Link, {
|
|
9314
10050
|
to: "/",
|
|
9315
10051
|
"aria-label": `${brand.productName}, ir para o painel`,
|
|
@@ -9324,7 +10060,7 @@ function Header() {
|
|
|
9324
10060
|
className: "hidden min-w-0 flex-1 lg:flex lg:justify-center",
|
|
9325
10061
|
children: layout.topbarSubmenu === "mega" ? /* @__PURE__ */ jsx(MegaMenu, {}) : /* @__PURE__ */ jsx(TopNav, {})
|
|
9326
10062
|
})
|
|
9327
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10063
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
9328
10064
|
/* @__PURE__ */ jsx(Tooltip, {
|
|
9329
10065
|
content: collapsed ? "Expandir menu" : "Recolher menu",
|
|
9330
10066
|
side: "bottom",
|
|
@@ -9480,7 +10216,7 @@ function NavEntry({ item, compact, submenu, hoverExpands, panelOpenFor, onToggle
|
|
|
9480
10216
|
className: "size-icon-md shrink-0",
|
|
9481
10217
|
"aria-hidden": true
|
|
9482
10218
|
}),
|
|
9483
|
-
!compact && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
10219
|
+
!compact && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
9484
10220
|
className: "truncate",
|
|
9485
10221
|
children: item.title
|
|
9486
10222
|
}), /* @__PURE__ */ jsx(ChevronRight, {
|
|
@@ -9745,7 +10481,7 @@ function Sidebar() {
|
|
|
9745
10481
|
return Boolean(el && rootRef.current?.contains(el) && el.matches(":focus-visible"));
|
|
9746
10482
|
};
|
|
9747
10483
|
const desktop = layout.navigation === "sidebar";
|
|
9748
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [desktop && /* @__PURE__ */ jsx("aside", {
|
|
10484
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [desktop && /* @__PURE__ */ jsx("aside", {
|
|
9749
10485
|
"aria-label": "Menu lateral",
|
|
9750
10486
|
className: cn("relative hidden shrink-0 transition-[width] duration-200 ease-out md:block", collapsed ? "w-sidebar-collapsed" : "w-sidebar"),
|
|
9751
10487
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -10603,6 +11339,6 @@ function createTheme(input) {
|
|
|
10603
11339
|
};
|
|
10604
11340
|
}
|
|
10605
11341
|
//#endregion
|
|
10606
|
-
export { Accordion, ActionBar, Alert, AppShell, Avatar, AvatarGroup, Badge, BrandFeedbackIcon, BrandLogo, BrandProvider, Breadcrumb, Button, ButtonGroup, CATALOG, CATALOG_EXCLUDED_FILES, COMPONENT_CODE_PATTERN, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChannelBadge, ChatComposer, ChatThread, Checkbox, CheckboxGroup, Checklist, ColorPicker, Container, ConversationList, DEFAULT_DDI, DataToolbar, DatePicker, Drawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorPage, Field, Form, FormField, FormSection, Grid, ImageCropper, ImageViewer, InfoHint, Inline, Input, Kanban, Label, List, Modal, OtpInput, PageHeader, Pagination, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QR_MAX_VERSION, QrCode, QrEncodingError, RENDRA_CREDIT_HREF, RENDRA_CREDIT_TEXT, RadioGroup, Rating, RendraCredit, RendraProvider, RepeatableField, Section, Select, Separator, Skeleton, Slider, Spinner, Stack, StatCard, Stepper, Switch, TABLE_PAGE_SIZE, TOKEN_KEYS, Table, Tabs, Textarea, Timeline, Toaster, Tooltip, TooltipProvider, Upload, Wizard, applyPalette, applyTheme, assertCatalogIntegrity, bindPointerDrag, breakpoints, buildDataCodewords, buttonVariants, catalogByComponent, chatChannels, cn, computeCropGeometry, computeFormatBits, computeMaskPenalty, computeVersionBits, contrast, contrastRatio, controlAdornmentButton, controlAdornmentSpace, controlFrame, controlInput, createPalette, createTheme, defaultShellLayout, encodeQrMatrix, feedbackLabels, filesMissingCatalogEntry, findComponentsWithMultipleDefaults, findComponentsWithoutDefault, findDragTarget, findDuplicateCodes, findInvalidFormatCodes, findPresetCollisions, formatCents, formatCurrency, getCatalogEntry, internationalPhoneMask, isValidCnpj, isValidCpf, isValidDateBR, layoutOptions, lookupCep, lookupCnpj, masks, moveKanbanCard, parseLocaleNumber, percentMask, phoneCountries, qrMatrixToSvgPath, readCodewordsForTest, readVar, reedSolomonComputeDivisor, reedSolomonComputeRemainder, reedSolomonEncode, reedSolomonMultiply, resolveCatalogCode, resolveDropIndex, shapeLabels, toCents, toE164, toast, useBrand, useBreakpoint, useCurrentPath, useDebouncedValue, useFieldControl, useFillHeight, useLookup, usePrefersReducedMotion, useRendraBreadcrumbs, useRendraLink, useRendraNavigate, useSortable, zBR };
|
|
11342
|
+
export { Accordion, ActionBar, Alert, AppShell, Avatar, AvatarGroup, Badge, BrandFeedbackIcon, BrandLogo, BrandProvider, Breadcrumb, Button, ButtonGroup, CATALOG, CATALOG_EXCLUDED_FILES, COMPONENT_CODE_PATTERN, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChannelBadge, ChatComposer, ChatThread, Checkbox, CheckboxGroup, Checklist, ColorPicker, Container, ConversationList, DEFAULT_DDI, DataToolbar, DatePicker, Drawer, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorPage, Field, Form, FormField, FormSection, Grid, ImageCropper, ImageViewer, InfoHint, Inline, Input, Kanban, Label, List, Modal, OtpInput, PageHeader, Pagination, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QR_MAX_VERSION, QrCode, QrEncodingError, RENDRA_CREDIT_HREF, RENDRA_CREDIT_TEXT, RadioGroup, Rating, RendraCredit, RendraProvider, RepeatableField, Section, Select, Separator, Skeleton, Slider, Spinner, Stack, StatCard, Stepper, Switch, TABLE_PAGE_SIZE, TOKEN_KEYS, Table, Tabs, Textarea, Timeline, Toaster, Tooltip, TooltipProvider, Upload, Wizard, applyPalette, applyTheme, assertCatalogIntegrity, bindPointerDrag, breakpoints, buildDataCodewords, buttonVariants, catalogByComponent, chatChannels, cn, computeCropGeometry, computeFormatBits, computeMaskPenalty, computeVersionBits, contrast, contrastRatio, controlAdornmentButton, controlAdornmentSpace, controlFrame, controlInput, createPalette, createTheme, defaultShellLayout, encodeQrMatrix, feedbackLabels, filesMissingCatalogEntry, findComponentsWithMultipleDefaults, findComponentsWithoutDefault, findDragTarget, findDuplicateCodes, findInvalidFormatCodes, findPresetCollisions, formatCents, formatCurrency, getCatalogEntry, getReducedMotion, internationalPhoneMask, isValidCnpj, isValidCpf, isValidDateBR, layoutOptions, lookupCep, lookupCnpj, masks, moveKanbanCard, parseLocaleNumber, percentMask, phoneCountries, qrMatrixToSvgPath, readCodewordsForTest, readVar, reedSolomonComputeDivisor, reedSolomonComputeRemainder, reedSolomonEncode, reedSolomonMultiply, resolveCatalogCode, resolveDropIndex, shapeLabels, subscribeReducedMotion, toCents, toE164, toast, useBrand, useBreakpoint, useCurrentPath, useDebouncedValue, useFieldControl, useFillHeight, useLookup, usePrefersReducedMotion, useRendraBreadcrumbs, useRendraLink, useRendraNavigate, useSortable, zBR };
|
|
10607
11343
|
|
|
10608
11344
|
//# sourceMappingURL=index.js.map
|