@rendra-ui/web 2.7.0 → 2.9.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 +16 -16
- package/dist/base.css +1 -1
- package/dist/{button-DlzWwpZk.js → button-BcCBrlnt.js} +6 -6
- package/dist/{button-DlzWwpZk.js.map → button-BcCBrlnt.js.map} +1 -1
- package/dist/chart.js +7 -7
- 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-B0N3Pek0.js → cn-CpdCvlkP.js} +2 -2
- package/dist/{cn-B0N3Pek0.js.map → cn-CpdCvlkP.js.map} +1 -1
- package/dist/{components-CpQPMGfT.js → components-Bus_Jh2R.js} +9 -6
- package/dist/components-Bus_Jh2R.js.map +1 -0
- package/dist/components.css +85 -26
- package/dist/document-viewer.js +4 -4
- package/dist/{dropdown-menu-M8vs0byD.js → dropdown-menu-B3L1XSDf.js} +5 -5
- package/dist/{dropdown-menu-M8vs0byD.js.map → dropdown-menu-B3L1XSDf.js.map} +1 -1
- package/dist/{brand-feedback-icon-BYNcqBel.js → empty-state-Bcx4M0Me.js} +64 -4
- package/dist/empty-state-Bcx4M0Me.js.map +1 -0
- package/dist/{features-max-ScxV8gb3.js → features-max-CoyJ_kuK.js} +1 -1
- package/dist/flow.js +2818 -868
- package/dist/flow.js.map +1 -1
- package/dist/index.js +875 -681
- package/dist/index.js.map +1 -1
- package/dist/{motion-context-BUMPf0e9.js → motion-context-DWFl2xRr.js} +4 -4
- package/dist/{motion-context-BUMPf0e9.js.map → motion-context-DWFl2xRr.js.map} +1 -1
- package/dist/{motion-on-CNN6y8g-.js → motion-on-zwsBqYZL.js} +2 -2
- package/dist/{motion-on-CNN6y8g-.js.map → motion-on-zwsBqYZL.js.map} +1 -1
- package/dist/motion.js +2 -2
- package/dist/{rendra-provider-DEURIIL3.js → rendra-provider-DuIhBatD.js} +3 -3
- package/dist/{rendra-provider-DEURIIL3.js.map → rendra-provider-DuIhBatD.js.map} +1 -1
- package/dist/rich-text-editor.js +4 -4
- package/dist/router-bridge.js +2 -2
- package/dist/{timeline-BOh7gUdA.js → toast-C7qYslCp.js} +464 -80
- package/dist/toast-C7qYslCp.js.map +1 -0
- package/dist/tokens.css +9 -1
- package/dist/{tooltip-Ym9S4h9_.js → tooltip-BSPO-bH4.js} +5 -5
- package/dist/{tooltip-Ym9S4h9_.js.map → tooltip-BSPO-bH4.js.map} +1 -1
- package/dist/types/components/ui/data-toolbar.d.ts +6 -1
- package/dist/types/components/ui/flow-config-panels.d.ts +10 -0
- package/dist/types/components/ui/flow-editor.d.ts +5 -0
- package/dist/types/components/ui/flow-sidebar.d.ts +21 -0
- package/dist/types/components/ui/flow-simulation-panel.d.ts +20 -0
- package/dist/types/components/ui/flow-viewer.d.ts +27 -10
- package/dist/types/components/ui/kanban.d.ts +75 -6
- package/dist/types/flow.d.ts +1 -1
- package/dist/types/lib/flow-blocks.d.ts +122 -0
- package/dist/types/lib/flow-edit.d.ts +88 -0
- package/dist/types/lib/flow-layout.d.ts +3 -0
- package/dist/types/lib/flow-sim.d.ts +24 -0
- package/dist/types/lib/flow.d.ts +30 -80
- package/dist/{use-breakpoint-En17oXKY.js → use-breakpoint-BGmY3ir-.js} +2 -2
- package/dist/{use-breakpoint-En17oXKY.js.map → use-breakpoint-BGmY3ir-.js.map} +1 -1
- package/dist/{use-motion-presets-D3ww1oJX.js → use-motion-presets-CmMLBQLI.js} +3 -3
- package/dist/{use-motion-presets-D3ww1oJX.js.map → use-motion-presets-CmMLBQLI.js.map} +1 -1
- package/dist/widget-grid.js +2 -2
- package/package.json +3 -1
- package/dist/brand-feedback-icon-BYNcqBel.js.map +0 -1
- package/dist/components-CpQPMGfT.js.map +0 -1
- package/dist/empty-state-a47Kd_Ci.js +0 -67
- package/dist/empty-state-a47Kd_Ci.js.map +0 -1
- package/dist/timeline-BOh7gUdA.js.map +0 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
/*! Rendra Design System v2.
|
|
2
|
-
import { t as cn } from "./cn-
|
|
3
|
-
import { i as useMotionLib, n as useLayoutReady, o as useMotionOn } from "./motion-context-
|
|
4
|
-
import { t as useMotionPresets } from "./use-motion-presets-
|
|
5
|
-
import { p as resolveCatalogCode } from "./components-
|
|
6
|
-
import { r as Spinner, t as Button } from "./button-
|
|
7
|
-
import { a as DropdownMenuItem, p as DropdownMenuTrigger, r as DropdownMenuContent, t as DropdownMenu$1 } from "./dropdown-menu-
|
|
8
|
-
import {
|
|
9
|
-
import { n as useBreakpoint } from "./use-breakpoint-
|
|
10
|
-
import { Check, CheckCircle2, ChevronDown, Eye, EyeOff, Info, MoreHorizontal, Plus, Search, SkipForward, X, XCircle } from "lucide-react";
|
|
11
|
-
import { Dialog, Label, Popover } from "radix-ui";
|
|
1
|
+
/*! Rendra Design System v2.9.0 | MIT | © 2026 Bruno Magalhaes | brunomagalhaes.me */
|
|
2
|
+
import { t as cn } from "./cn-CpdCvlkP.js";
|
|
3
|
+
import { i as useMotionLib, n as useLayoutReady, o as useMotionOn } from "./motion-context-DWFl2xRr.js";
|
|
4
|
+
import { t as useMotionPresets } from "./use-motion-presets-CmMLBQLI.js";
|
|
5
|
+
import { p as resolveCatalogCode } from "./components-Bus_Jh2R.js";
|
|
6
|
+
import { r as Spinner, t as Button } from "./button-BcCBrlnt.js";
|
|
7
|
+
import { a as DropdownMenuItem, p as DropdownMenuTrigger, r as DropdownMenuContent, t as DropdownMenu$1 } from "./dropdown-menu-B3L1XSDf.js";
|
|
8
|
+
import { i as useBrand, n as BrandFeedbackIcon } from "./empty-state-Bcx4M0Me.js";
|
|
9
|
+
import { n as useBreakpoint } from "./use-breakpoint-BGmY3ir-.js";
|
|
10
|
+
import { Check, CheckCircle2, ChevronDown, Eye, EyeOff, Info, Minus, MoreHorizontal, Plus, Search, SkipForward, X, XCircle } from "lucide-react";
|
|
11
|
+
import { Checkbox, Dialog, Label, Popover, RadioGroup, Tabs } from "radix-ui";
|
|
12
12
|
import { cloneElement, createContext, forwardRef, isValidElement, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { createPortal } from "react-dom";
|
|
15
15
|
import { cva } from "class-variance-authority";
|
|
16
16
|
import IMask from "imask";
|
|
17
17
|
import { Command } from "cmdk";
|
|
18
|
+
import { Toaster, toast } from "sonner";
|
|
18
19
|
//#region src/components/app-shell/shell-context.ts
|
|
19
20
|
var ShellContext = createContext(null);
|
|
20
21
|
function useShell() {
|
|
@@ -329,73 +330,6 @@ function InfoHint({ title, children, className }) {
|
|
|
329
330
|
});
|
|
330
331
|
}
|
|
331
332
|
//#endregion
|
|
332
|
-
//#region src/components/ui/card.tsx
|
|
333
|
-
function Card({ className, "data-rendra": dataRendra, ...props }) {
|
|
334
|
-
return /* @__PURE__ */ jsx("div", {
|
|
335
|
-
"data-slot": "card",
|
|
336
|
-
"data-rendra": dataRendra ?? "CARD-001",
|
|
337
|
-
className: cn("flex min-w-0 flex-col rounded-surface border bg-card text-card-foreground", className),
|
|
338
|
-
...props
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
function CardHeader({ className, actions, children, ...props }) {
|
|
342
|
-
if (!actions) return /* @__PURE__ */ jsx("div", {
|
|
343
|
-
"data-slot": "card-header",
|
|
344
|
-
className: cn("flex flex-col gap-1 p-4 md:p-6", className),
|
|
345
|
-
...props,
|
|
346
|
-
children
|
|
347
|
-
});
|
|
348
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
349
|
-
"data-slot": "card-header",
|
|
350
|
-
className: cn("flex flex-wrap items-start justify-between gap-x-4 gap-y-3 p-4 md:p-6", className),
|
|
351
|
-
...props,
|
|
352
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
353
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
354
|
-
children
|
|
355
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
356
|
-
className: "flex shrink-0 items-center gap-2",
|
|
357
|
-
children: actions
|
|
358
|
-
})]
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
function CardTitle({ className, children, help, ...props }) {
|
|
362
|
-
const heading = /* @__PURE__ */ jsx("h3", {
|
|
363
|
-
"data-slot": "card-title",
|
|
364
|
-
className: cn("text-lg font-semibold", className),
|
|
365
|
-
...props,
|
|
366
|
-
children
|
|
367
|
-
});
|
|
368
|
-
if (!help) return heading;
|
|
369
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
370
|
-
className: "flex min-w-0 items-center gap-1",
|
|
371
|
-
children: [heading, /* @__PURE__ */ jsx(InfoHint, {
|
|
372
|
-
title: typeof children === "string" ? children : "Sobre esta seção",
|
|
373
|
-
children: help
|
|
374
|
-
})]
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
function CardDescription({ className, ...props }) {
|
|
378
|
-
return /* @__PURE__ */ jsx("p", {
|
|
379
|
-
"data-slot": "card-description",
|
|
380
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
381
|
-
...props
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
function CardContent({ className, ...props }) {
|
|
385
|
-
return /* @__PURE__ */ jsx("div", {
|
|
386
|
-
"data-slot": "card-content",
|
|
387
|
-
className: cn("p-4 md:p-6 [[data-slot=card-header]+&]:pt-0", className),
|
|
388
|
-
...props
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
function CardFooter({ className, ...props }) {
|
|
392
|
-
return /* @__PURE__ */ jsx("div", {
|
|
393
|
-
"data-slot": "card-footer",
|
|
394
|
-
className: cn("flex items-center gap-3 border-t px-4 py-3 md:px-6", className),
|
|
395
|
-
...props
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
//#endregion
|
|
399
333
|
//#region src/lib/lookup.ts
|
|
400
334
|
var digits = (v) => v.replace(/\D/g, "");
|
|
401
335
|
/** Endereço do CEP (8 dígitos). null se não existir; lança erro se a busca falhar. */
|
|
@@ -965,6 +899,124 @@ var Input = forwardRef(function Input({ size, mask, icon, suffix, clearable, inv
|
|
|
965
899
|
});
|
|
966
900
|
});
|
|
967
901
|
//#endregion
|
|
902
|
+
//#region src/components/ui/checkbox.tsx
|
|
903
|
+
/**
|
|
904
|
+
* Checkbox único, com estado indeterminado (checked="indeterminate").
|
|
905
|
+
* Com label, a linha inteira é área de toque de 44px no mobile.
|
|
906
|
+
*/
|
|
907
|
+
function Checkbox$1({ checked, defaultChecked, onCheckedChange, label, description, disabled, invalid, id, name, className, ...aria }) {
|
|
908
|
+
const auto = useId();
|
|
909
|
+
const cid = id ?? `cb${auto}`;
|
|
910
|
+
const lib = useMotionLib();
|
|
911
|
+
const on = lib !== null;
|
|
912
|
+
const presets = useMotionPresets();
|
|
913
|
+
const [inner, setInner] = useState(defaultChecked ?? false);
|
|
914
|
+
const state = checked ?? inner;
|
|
915
|
+
const mark = checked === "indeterminate" ? /* @__PURE__ */ jsx(Minus, {
|
|
916
|
+
className: "size-3",
|
|
917
|
+
strokeWidth: 3,
|
|
918
|
+
"aria-hidden": true
|
|
919
|
+
}) : /* @__PURE__ */ jsx(Check, {
|
|
920
|
+
className: "size-3",
|
|
921
|
+
strokeWidth: 3,
|
|
922
|
+
"aria-hidden": true
|
|
923
|
+
});
|
|
924
|
+
const rootProps = {
|
|
925
|
+
id: cid,
|
|
926
|
+
name,
|
|
927
|
+
checked: on ? state : checked,
|
|
928
|
+
defaultChecked: on ? void 0 : defaultChecked,
|
|
929
|
+
onCheckedChange: (v) => {
|
|
930
|
+
if (on) setInner(v);
|
|
931
|
+
onCheckedChange?.(v === true);
|
|
932
|
+
},
|
|
933
|
+
disabled,
|
|
934
|
+
"aria-invalid": invalid || void 0,
|
|
935
|
+
"aria-label": aria["aria-label"],
|
|
936
|
+
"data-touch": label ? void 0 : "expanded",
|
|
937
|
+
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")
|
|
938
|
+
};
|
|
939
|
+
const box = on ? /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
940
|
+
asChild: true,
|
|
941
|
+
...rootProps,
|
|
942
|
+
children: /* @__PURE__ */ jsx(lib.m.button, {
|
|
943
|
+
type: "button",
|
|
944
|
+
whileTap: presets.press.whileTap,
|
|
945
|
+
transition: presets.press.transition,
|
|
946
|
+
children: /* @__PURE__ */ jsx(lib.AnimatePresence, {
|
|
947
|
+
initial: false,
|
|
948
|
+
children: state !== false && /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
949
|
+
forceMount: true,
|
|
950
|
+
asChild: true,
|
|
951
|
+
children: /* @__PURE__ */ jsx(lib.m.span, {
|
|
952
|
+
className: "flex items-center justify-center",
|
|
953
|
+
...presets.indicator,
|
|
954
|
+
children: mark
|
|
955
|
+
})
|
|
956
|
+
})
|
|
957
|
+
})
|
|
958
|
+
})
|
|
959
|
+
}) : /* @__PURE__ */ jsx(Checkbox.Root, {
|
|
960
|
+
...rootProps,
|
|
961
|
+
children: /* @__PURE__ */ jsx(Checkbox.Indicator, {
|
|
962
|
+
className: "flex items-center justify-center data-[state=checked]:animate-in data-[state=checked]:duration-(--rendra-duration-fast) data-[state=checked]:zoom-in-90",
|
|
963
|
+
children: mark
|
|
964
|
+
})
|
|
965
|
+
});
|
|
966
|
+
if (!label) return /* @__PURE__ */ jsx("span", {
|
|
967
|
+
"data-rendra": "CHK-001",
|
|
968
|
+
className: cn("inline-flex", className),
|
|
969
|
+
children: box
|
|
970
|
+
});
|
|
971
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
972
|
+
htmlFor: cid,
|
|
973
|
+
"data-rendra": "CHK-001",
|
|
974
|
+
className: cn("flex min-h-touch cursor-pointer items-start gap-3 py-3 md:min-h-0 md:py-1", disabled && "cursor-not-allowed opacity-60", className),
|
|
975
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
976
|
+
className: "flex pt-px",
|
|
977
|
+
children: box
|
|
978
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
979
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
980
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
981
|
+
className: "text-sm font-medium",
|
|
982
|
+
children: label
|
|
983
|
+
}), description && /* @__PURE__ */ jsx("span", {
|
|
984
|
+
className: "text-sm text-muted-foreground",
|
|
985
|
+
children: description
|
|
986
|
+
})]
|
|
987
|
+
})]
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
function CheckboxGroup({ options, value = [], onChange, selectAll, orientation = "vertical", invalid, id, label, ...aria }) {
|
|
991
|
+
const enabled = options.filter((o) => !o.disabled);
|
|
992
|
+
const all = enabled.length > 0 && enabled.every((o) => value.includes(o.value));
|
|
993
|
+
const some = value.length > 0 && !all;
|
|
994
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
995
|
+
id,
|
|
996
|
+
role: "group",
|
|
997
|
+
"aria-label": label,
|
|
998
|
+
"aria-describedby": aria["aria-describedby"],
|
|
999
|
+
"data-rendra": "CHK-002",
|
|
1000
|
+
className: "flex flex-col",
|
|
1001
|
+
children: [selectAll && /* @__PURE__ */ jsx(Checkbox$1, {
|
|
1002
|
+
label: "Selecionar todos",
|
|
1003
|
+
checked: all ? true : some ? "indeterminate" : false,
|
|
1004
|
+
onCheckedChange: () => onChange?.(all ? [] : enabled.map((o) => o.value)),
|
|
1005
|
+
className: "border-b"
|
|
1006
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1007
|
+
className: cn("flex", orientation === "vertical" ? "flex-col" : "flex-col sm:flex-row sm:flex-wrap sm:gap-x-6"),
|
|
1008
|
+
children: options.map((o) => /* @__PURE__ */ jsx(Checkbox$1, {
|
|
1009
|
+
label: o.label,
|
|
1010
|
+
description: o.description,
|
|
1011
|
+
disabled: o.disabled,
|
|
1012
|
+
invalid,
|
|
1013
|
+
checked: value.includes(o.value),
|
|
1014
|
+
onCheckedChange: (c) => onChange?.(c ? [...value, o.value] : value.filter((v) => v !== o.value))
|
|
1015
|
+
}, o.value))
|
|
1016
|
+
})]
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
1019
|
+
//#endregion
|
|
968
1020
|
//#region src/components/ui/picker-panel.tsx
|
|
969
1021
|
/** A folha fecha se o arraste passou de 40% da altura ou se foi um arremesso (> 0,11 px/ms). */
|
|
970
1022
|
var DISMISS_FRACTION = .4;
|
|
@@ -1682,6 +1734,139 @@ var Select = forwardRef(function Select(props, ref) {
|
|
|
1682
1734
|
});
|
|
1683
1735
|
});
|
|
1684
1736
|
//#endregion
|
|
1737
|
+
//#region src/components/ui/tabs.tsx
|
|
1738
|
+
/** Contador de instâncias, só para o `layoutId` do indicador (ver `indicatorId`). */
|
|
1739
|
+
var tabsCreated = 0;
|
|
1740
|
+
/**
|
|
1741
|
+
* Tabs único. Se as abas não couberem na largura, a mesma lista vira um Select
|
|
1742
|
+
* (nunca rolagem lateral). A troca é medida no próprio contêiner, não na tela.
|
|
1743
|
+
*/
|
|
1744
|
+
function Tabs$1({ items, value, defaultValue, onChange, variant = "line", className, ...aria }) {
|
|
1745
|
+
const [inner, setInner] = useState(defaultValue ?? items[0]?.value ?? "");
|
|
1746
|
+
const current = value ?? inner;
|
|
1747
|
+
const set = (v) => {
|
|
1748
|
+
setInner(v);
|
|
1749
|
+
onChange?.(v);
|
|
1750
|
+
};
|
|
1751
|
+
const boxRef = useRef(null);
|
|
1752
|
+
const measureRef = useRef(null);
|
|
1753
|
+
const [overflow, setOverflow] = useState(false);
|
|
1754
|
+
useLayoutEffect(() => {
|
|
1755
|
+
const box = boxRef.current;
|
|
1756
|
+
const measure = measureRef.current;
|
|
1757
|
+
if (!box || !measure) return;
|
|
1758
|
+
const check = () => setOverflow(measure.scrollWidth > box.clientWidth + 1);
|
|
1759
|
+
check();
|
|
1760
|
+
const ro = new ResizeObserver(check);
|
|
1761
|
+
ro.observe(box);
|
|
1762
|
+
return () => ro.disconnect();
|
|
1763
|
+
}, [items, variant]);
|
|
1764
|
+
const presets = useMotionPresets();
|
|
1765
|
+
const on = useLayoutReady();
|
|
1766
|
+
const lib = useMotionLib();
|
|
1767
|
+
const listRef = useRef(null);
|
|
1768
|
+
const [clip, setClip] = useState({
|
|
1769
|
+
l: 0,
|
|
1770
|
+
r: 0
|
|
1771
|
+
});
|
|
1772
|
+
useLayoutEffect(() => {
|
|
1773
|
+
const list = listRef.current;
|
|
1774
|
+
if (!on || !list) return;
|
|
1775
|
+
const measure = () => {
|
|
1776
|
+
const active = list.querySelector("[role=\"tab\"][data-state=\"active\"]");
|
|
1777
|
+
if (!active) return;
|
|
1778
|
+
const l = active.offsetLeft;
|
|
1779
|
+
const r = list.offsetWidth - l - active.offsetWidth;
|
|
1780
|
+
setClip((prev) => prev.l === l && prev.r === r ? prev : {
|
|
1781
|
+
l,
|
|
1782
|
+
r
|
|
1783
|
+
});
|
|
1784
|
+
};
|
|
1785
|
+
measure();
|
|
1786
|
+
const ro = new ResizeObserver(measure);
|
|
1787
|
+
ro.observe(list);
|
|
1788
|
+
return () => ro.disconnect();
|
|
1789
|
+
}, [
|
|
1790
|
+
on,
|
|
1791
|
+
current,
|
|
1792
|
+
items,
|
|
1793
|
+
variant,
|
|
1794
|
+
overflow
|
|
1795
|
+
]);
|
|
1796
|
+
const [indicatorId] = useState(() => `rendra-tabs-${++tabsCreated}`);
|
|
1797
|
+
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");
|
|
1798
|
+
const indicator = lib && /* @__PURE__ */ jsx(lib.m.span, {
|
|
1799
|
+
layoutId: indicatorId,
|
|
1800
|
+
"data-indicator": "tabs",
|
|
1801
|
+
"aria-hidden": true,
|
|
1802
|
+
transition: presets.move,
|
|
1803
|
+
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"
|
|
1804
|
+
});
|
|
1805
|
+
const list = cn("flex", variant === "line" ? "gap-2 border-b" : "gap-1 rounded-control bg-muted p-1");
|
|
1806
|
+
const label = (it) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1807
|
+
it.icon,
|
|
1808
|
+
it.label,
|
|
1809
|
+
it.count !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
1810
|
+
className: "rounded-full bg-muted px-2 text-xs text-muted-foreground tabular-nums",
|
|
1811
|
+
children: it.count
|
|
1812
|
+
})
|
|
1813
|
+
] });
|
|
1814
|
+
return /* @__PURE__ */ jsxs(Tabs.Root, {
|
|
1815
|
+
value: current,
|
|
1816
|
+
onValueChange: set,
|
|
1817
|
+
"data-rendra": resolveCatalogCode("Tabs", { variant }),
|
|
1818
|
+
className: cn("flex min-w-0 flex-col gap-6", className),
|
|
1819
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1820
|
+
ref: boxRef,
|
|
1821
|
+
className: "relative min-w-0",
|
|
1822
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
1823
|
+
ref: measureRef,
|
|
1824
|
+
"aria-hidden": true,
|
|
1825
|
+
className: cn(list, "invisible absolute w-max"),
|
|
1826
|
+
children: items.map((it) => /* @__PURE__ */ jsx("span", {
|
|
1827
|
+
className: trigger,
|
|
1828
|
+
children: label(it)
|
|
1829
|
+
}, it.value))
|
|
1830
|
+
}), overflow ? /* @__PURE__ */ jsx(Select, {
|
|
1831
|
+
label: aria["aria-label"] ?? "Seção",
|
|
1832
|
+
value: current,
|
|
1833
|
+
onChange: (v) => v && set(v),
|
|
1834
|
+
options: items.map((it) => ({
|
|
1835
|
+
value: it.value,
|
|
1836
|
+
label: it.count !== void 0 ? `${it.label} (${it.count})` : it.label,
|
|
1837
|
+
disabled: it.disabled
|
|
1838
|
+
}))
|
|
1839
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Tabs.List, {
|
|
1840
|
+
ref: listRef,
|
|
1841
|
+
"aria-label": aria["aria-label"],
|
|
1842
|
+
className: list,
|
|
1843
|
+
children: items.map((it) => /* @__PURE__ */ jsxs(Tabs.Trigger, {
|
|
1844
|
+
value: it.value,
|
|
1845
|
+
disabled: it.disabled,
|
|
1846
|
+
className: trigger,
|
|
1847
|
+
children: [on && current === it.value && indicator, label(it)]
|
|
1848
|
+
}, it.value))
|
|
1849
|
+
}), on && /* @__PURE__ */ jsx("div", {
|
|
1850
|
+
"data-tabs-copy": true,
|
|
1851
|
+
"aria-hidden": true,
|
|
1852
|
+
className: cn(list, "pointer-events-none absolute inset-0 border-transparent bg-transparent text-foreground tabs-clip"),
|
|
1853
|
+
style: {
|
|
1854
|
+
"--tabs-l": `${clip.l}px`,
|
|
1855
|
+
"--tabs-r": `${clip.r}px`
|
|
1856
|
+
},
|
|
1857
|
+
children: items.map((it) => /* @__PURE__ */ jsx("span", {
|
|
1858
|
+
className: cn(trigger, "text-foreground"),
|
|
1859
|
+
children: label(it)
|
|
1860
|
+
}, it.value))
|
|
1861
|
+
})] })]
|
|
1862
|
+
}), items.map((it) => /* @__PURE__ */ jsx(Tabs.Content, {
|
|
1863
|
+
value: it.value,
|
|
1864
|
+
className: "min-w-0 outline-none",
|
|
1865
|
+
children: it.content
|
|
1866
|
+
}, it.value))]
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
//#endregion
|
|
1685
1870
|
//#region src/hooks/use-fill-height.ts
|
|
1686
1871
|
/**
|
|
1687
1872
|
* Mede o espaço que sobra na área de conteúdo (o <main>) abaixo do elemento e grava em
|
|
@@ -1709,6 +1894,136 @@ function useFillHeight() {
|
|
|
1709
1894
|
return ref;
|
|
1710
1895
|
}
|
|
1711
1896
|
//#endregion
|
|
1897
|
+
//#region src/components/ui/radio-group.tsx
|
|
1898
|
+
var cols = {
|
|
1899
|
+
1: "",
|
|
1900
|
+
2: "md:grid-cols-2",
|
|
1901
|
+
3: "md:grid-cols-3"
|
|
1902
|
+
};
|
|
1903
|
+
/**
|
|
1904
|
+
* O item do Radix. Em `on` ele é um `m.button` (asChild) que responde ao toque (whileTap 0,97,
|
|
1905
|
+
* em `press`); em `off` é o `R.Item` de sempre, sem nó novo.
|
|
1906
|
+
*/
|
|
1907
|
+
function Item({ children, ...props }) {
|
|
1908
|
+
const presets = useMotionPresets();
|
|
1909
|
+
const lib = useMotionLib();
|
|
1910
|
+
if (!lib) return /* @__PURE__ */ jsx(RadioGroup.Item, {
|
|
1911
|
+
...props,
|
|
1912
|
+
children
|
|
1913
|
+
});
|
|
1914
|
+
return /* @__PURE__ */ jsx(RadioGroup.Item, {
|
|
1915
|
+
asChild: true,
|
|
1916
|
+
...props,
|
|
1917
|
+
children: /* @__PURE__ */ jsx(lib.m.button, {
|
|
1918
|
+
type: "button",
|
|
1919
|
+
whileTap: presets.press.whileTap,
|
|
1920
|
+
transition: presets.press.transition,
|
|
1921
|
+
children
|
|
1922
|
+
})
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
/** Radio único: em lista ou em cards, por prop. */
|
|
1926
|
+
function RadioGroup$1({ options, value, defaultValue, onChange, variant = "list", columns = 2, orientation = "vertical", invalid, disabled, id, name, ...aria }) {
|
|
1927
|
+
const lib = useMotionLib();
|
|
1928
|
+
const on = lib !== null;
|
|
1929
|
+
const presets = useMotionPresets();
|
|
1930
|
+
const [inner, setInner] = useState(defaultValue);
|
|
1931
|
+
const current = value ?? inner;
|
|
1932
|
+
const dotFor = (optionValue) => /* @__PURE__ */ jsx("span", {
|
|
1933
|
+
"aria-hidden": true,
|
|
1934
|
+
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"),
|
|
1935
|
+
children: on ? /* @__PURE__ */ jsx(lib.m.span, {
|
|
1936
|
+
className: "size-2 rounded-full bg-primary",
|
|
1937
|
+
initial: false,
|
|
1938
|
+
animate: current === optionValue ? presets.indicator.animate : presets.indicator.initial,
|
|
1939
|
+
transition: presets.indicator.transition
|
|
1940
|
+
}) : /* @__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" })
|
|
1941
|
+
});
|
|
1942
|
+
return /* @__PURE__ */ jsx(RadioGroup.Root, {
|
|
1943
|
+
id,
|
|
1944
|
+
name,
|
|
1945
|
+
value: on ? current : value,
|
|
1946
|
+
defaultValue: on ? void 0 : defaultValue,
|
|
1947
|
+
onValueChange: (v) => {
|
|
1948
|
+
if (on) setInner(v);
|
|
1949
|
+
onChange?.(v);
|
|
1950
|
+
},
|
|
1951
|
+
disabled,
|
|
1952
|
+
"aria-invalid": invalid || void 0,
|
|
1953
|
+
"aria-describedby": aria["aria-describedby"],
|
|
1954
|
+
"aria-label": aria["aria-label"],
|
|
1955
|
+
"data-rendra": resolveCatalogCode("RadioGroup", { variant }),
|
|
1956
|
+
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"),
|
|
1957
|
+
children: options.map((o) => variant === "cards" ? /* @__PURE__ */ jsxs(Item, {
|
|
1958
|
+
value: o.value,
|
|
1959
|
+
disabled: o.disabled,
|
|
1960
|
+
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"),
|
|
1961
|
+
children: [
|
|
1962
|
+
o.icon && /* @__PURE__ */ jsx("span", {
|
|
1963
|
+
className: "flex size-control-sm shrink-0 items-center justify-center rounded-control bg-muted text-foreground transition-colors group-data-[state=checked]:bg-primary group-data-[state=checked]:text-primary-foreground md:size-control-md [&_svg]:size-icon-md",
|
|
1964
|
+
children: o.icon
|
|
1965
|
+
}),
|
|
1966
|
+
/* @__PURE__ */ jsxs("span", {
|
|
1967
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
1968
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1969
|
+
className: "text-sm font-semibold",
|
|
1970
|
+
children: o.label
|
|
1971
|
+
}), o.description && /* @__PURE__ */ jsx("span", {
|
|
1972
|
+
className: "text-sm text-muted-foreground",
|
|
1973
|
+
children: o.description
|
|
1974
|
+
})]
|
|
1975
|
+
}),
|
|
1976
|
+
dotFor(o.value)
|
|
1977
|
+
]
|
|
1978
|
+
}, o.value) : /* @__PURE__ */ jsxs("label", {
|
|
1979
|
+
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"),
|
|
1980
|
+
children: [/* @__PURE__ */ jsx(Item, {
|
|
1981
|
+
value: o.value,
|
|
1982
|
+
disabled: o.disabled,
|
|
1983
|
+
className: "group flex pt-px outline-none focus-visible:[&>span]:focus-ring",
|
|
1984
|
+
children: dotFor(o.value)
|
|
1985
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
1986
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
1987
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1988
|
+
className: "text-sm font-medium",
|
|
1989
|
+
children: o.label
|
|
1990
|
+
}), o.description && /* @__PURE__ */ jsx("span", {
|
|
1991
|
+
className: "text-sm text-muted-foreground",
|
|
1992
|
+
children: o.description
|
|
1993
|
+
})]
|
|
1994
|
+
})]
|
|
1995
|
+
}, o.value))
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
//#endregion
|
|
1999
|
+
//#region src/components/ui/textarea.tsx
|
|
2000
|
+
/** Textarea único, com contador opcional. Cresce com o conteúdo até a altura máxima e depois rola por dentro. */
|
|
2001
|
+
var Textarea = forwardRef(function Textarea({ invalid, counter, value, defaultValue, onChange, maxLength, rows = 4, className, ...props }, ref) {
|
|
2002
|
+
const [inner, setInner] = useState(String(value ?? defaultValue ?? ""));
|
|
2003
|
+
const current = value ?? inner;
|
|
2004
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
2005
|
+
className: cn("flex min-w-0 flex-col gap-1", className),
|
|
2006
|
+
children: [/* @__PURE__ */ jsx("textarea", {
|
|
2007
|
+
ref,
|
|
2008
|
+
rows,
|
|
2009
|
+
maxLength,
|
|
2010
|
+
value: current,
|
|
2011
|
+
"data-rendra": "TXT-001",
|
|
2012
|
+
"aria-invalid": invalid || void 0,
|
|
2013
|
+
onChange: (e) => {
|
|
2014
|
+
setInner(e.target.value);
|
|
2015
|
+
onChange?.(e.target.value);
|
|
2016
|
+
},
|
|
2017
|
+
className: cn("field-sizing-content max-h-chart-md min-h-24 w-full resize-y rounded-control border border-input bg-field px-3 py-2 text-base transition-[border-color,box-shadow] outline-none placeholder:text-muted-foreground hover:border-foreground/40 focus:border-ring focus:bg-card focus:ring-2 focus:ring-ring/25 disabled:cursor-not-allowed disabled:opacity-60 md:text-sm", invalid && "border-destructive focus:border-destructive focus:ring-destructive/25"),
|
|
2018
|
+
...props
|
|
2019
|
+
}), counter && /* @__PURE__ */ jsxs("span", {
|
|
2020
|
+
"aria-live": "polite",
|
|
2021
|
+
className: cn("self-end text-xs text-muted-foreground tabular-nums", maxLength && current.length >= maxLength && "font-medium text-destructive"),
|
|
2022
|
+
children: [current.length, maxLength ? `/${maxLength}` : ""]
|
|
2023
|
+
})]
|
|
2024
|
+
});
|
|
2025
|
+
});
|
|
2026
|
+
//#endregion
|
|
1712
2027
|
//#region src/components/ui/timeline.tsx
|
|
1713
2028
|
var dot = {
|
|
1714
2029
|
neutral: "bg-muted text-muted-foreground",
|
|
@@ -1798,6 +2113,75 @@ function Timeline({ events, className }) {
|
|
|
1798
2113
|
});
|
|
1799
2114
|
}
|
|
1800
2115
|
//#endregion
|
|
1801
|
-
|
|
2116
|
+
//#region src/components/ui/toast.tsx
|
|
2117
|
+
var tone = {
|
|
2118
|
+
success: "border-success/25",
|
|
2119
|
+
error: "border-destructive/25",
|
|
2120
|
+
warning: "border-warning/25",
|
|
2121
|
+
info: "border-info/25"
|
|
2122
|
+
};
|
|
2123
|
+
function show(type, title, opts = {}) {
|
|
2124
|
+
return toast.custom((id) => /* @__PURE__ */ jsxs("div", {
|
|
2125
|
+
role: type === "error" ? "alert" : "status",
|
|
2126
|
+
"data-rendra": "TST-001",
|
|
2127
|
+
className: cn("flex w-full items-start gap-3 rounded-control border bg-popover p-4 text-popover-foreground shadow-lg", tone[type]),
|
|
2128
|
+
children: [
|
|
2129
|
+
/* @__PURE__ */ jsx(BrandFeedbackIcon, {
|
|
2130
|
+
type,
|
|
2131
|
+
size: "lg",
|
|
2132
|
+
animated: true,
|
|
2133
|
+
className: "mt-px"
|
|
2134
|
+
}),
|
|
2135
|
+
/* @__PURE__ */ jsxs("div", {
|
|
2136
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2137
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
2138
|
+
className: "text-sm font-semibold wrap-break-word",
|
|
2139
|
+
children: title
|
|
2140
|
+
}), opts.description && /* @__PURE__ */ jsx("p", {
|
|
2141
|
+
className: "text-sm wrap-break-word text-muted-foreground",
|
|
2142
|
+
children: opts.description
|
|
2143
|
+
})]
|
|
2144
|
+
}),
|
|
2145
|
+
opts.action && /* @__PURE__ */ jsx("button", {
|
|
2146
|
+
type: "button",
|
|
2147
|
+
onClick: () => {
|
|
2148
|
+
opts.action?.onClick();
|
|
2149
|
+
toast.dismiss(id);
|
|
2150
|
+
},
|
|
2151
|
+
className: "-my-1 flex min-h-touch shrink-0 cursor-pointer items-center rounded-item px-2 text-sm font-semibold text-primary-text hover:bg-accent md:min-h-0 md:py-1",
|
|
2152
|
+
children: opts.action.label
|
|
2153
|
+
})
|
|
2154
|
+
]
|
|
2155
|
+
}), { duration: opts.duration ?? (type === "error" ? 8e3 : 4e3) });
|
|
2156
|
+
}
|
|
2157
|
+
var toast$1 = {
|
|
2158
|
+
success: (title, opts) => show("success", title, opts),
|
|
2159
|
+
error: (title, opts) => show("error", title, opts),
|
|
2160
|
+
warning: (title, opts) => show("warning", title, opts),
|
|
2161
|
+
info: (title, opts) => show("info", title, opts),
|
|
2162
|
+
dismiss: toast.dismiss
|
|
2163
|
+
};
|
|
2164
|
+
/** Posição: embaixo no centro no mobile (perto do polegar), canto inferior direito no desktop. */
|
|
2165
|
+
function Toaster$1() {
|
|
2166
|
+
const { isMobile } = useBreakpoint();
|
|
2167
|
+
const { resolvedMode } = useBrand();
|
|
2168
|
+
return /* @__PURE__ */ jsx(Toaster, {
|
|
2169
|
+
position: isMobile ? "bottom-center" : "bottom-right",
|
|
2170
|
+
theme: resolvedMode,
|
|
2171
|
+
offset: 16,
|
|
2172
|
+
mobileOffset: {
|
|
2173
|
+
bottom: 88,
|
|
2174
|
+
left: 16,
|
|
2175
|
+
right: 16
|
|
2176
|
+
},
|
|
2177
|
+
visibleToasts: 3,
|
|
2178
|
+
toastOptions: {
|
|
2179
|
+
unstyled: true,
|
|
2180
|
+
className: "w-full"
|
|
2181
|
+
}
|
|
2182
|
+
});
|
|
2183
|
+
}
|
|
2184
|
+
//#endregion
|
|
2185
|
+
export { toE164 as A, Alert as B, formatCurrency as C, percentMask as D, parseLocaleNumber as E, useLookup as F, ShellContext as H, lookupCep as I, lookupCnpj as L, controlAdornmentSpace as M, controlFrame as N, phoneCountries as O, controlInput as P, InfoHint as R, formatCents as S, masks as T, useShell as U, ActionBar as V, PickerPanel as _, RadioGroup$1 as a, Input as b, Select as c, useFieldControl as d, alignClass as f, Drawer as g, justifyClass as h, Textarea as i, controlAdornmentButton as j, toCents as k, Field as l, gapClass as m, toast$1 as n, useFillHeight as o, fieldGridClass as p, Timeline as r, Tabs$1 as s, Toaster$1 as t, Label$1 as u, Checkbox$1 as v, internationalPhoneMask as w, DEFAULT_DDI as x, CheckboxGroup as y, Modal as z };
|
|
1802
2186
|
|
|
1803
|
-
//# sourceMappingURL=
|
|
2187
|
+
//# sourceMappingURL=toast-C7qYslCp.js.map
|