@rendra-ui/web 2.5.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.
Files changed (54) hide show
  1. package/README.md +11 -2
  2. package/dist/base.css +1 -1
  3. package/dist/{button-BzJgR2gH.js → button-B6-644xP.js} +7 -7
  4. package/dist/button-B6-644xP.js.map +1 -0
  5. package/dist/chart.js +15 -13
  6. package/dist/chart.js.map +1 -1
  7. package/dist/cli/auditar.js +1 -1
  8. package/dist/cli/codigos.js +2 -2
  9. package/dist/cli/executar-auditar.js +1 -1
  10. package/dist/cli/help.js +1 -1
  11. package/dist/cli/trocar.js +2 -2
  12. package/dist/cli/typescript-loader.js +1 -1
  13. package/dist/{cn-Cw7M5kEP.js → cn-TBlI6-gS.js} +2 -2
  14. package/dist/{cn-Cw7M5kEP.js.map → cn-TBlI6-gS.js.map} +1 -1
  15. package/dist/{components-DkpspH9h.js → components-Btk1cUg2.js} +2 -2
  16. package/dist/{components-DkpspH9h.js.map → components-Btk1cUg2.js.map} +1 -1
  17. package/dist/components.css +1 -1
  18. package/dist/document-viewer.js +4 -4
  19. package/dist/{empty-state-Cdb1vkMT.js → empty-state-DrQjqxvp.js} +11 -11
  20. package/dist/{empty-state-Cdb1vkMT.js.map → empty-state-DrQjqxvp.js.map} +1 -1
  21. package/dist/{features-max--5VEt6M7.js → features-max-CC6CorTg.js} +1 -1
  22. package/dist/index.js +90 -77
  23. package/dist/index.js.map +1 -1
  24. package/dist/motion-context-BL545cb6.js +222 -0
  25. package/dist/motion-context-BL545cb6.js.map +1 -0
  26. package/dist/motion-on-DMoTsWrG.js +29 -0
  27. package/dist/motion-on-DMoTsWrG.js.map +1 -0
  28. package/dist/motion.js +3 -0
  29. package/dist/{rendra-provider-CRe0XdOU.js → rendra-provider-CeCkPafT.js} +3 -3
  30. package/dist/rendra-provider-CeCkPafT.js.map +1 -0
  31. package/dist/rich-text-editor.js +3 -3
  32. package/dist/router-bridge.js +2 -2
  33. package/dist/router-bridge.js.map +1 -1
  34. package/dist/tokens.css +1 -1
  35. package/dist/{tooltip-BAMSaGbS.js → tooltip-kgsorOg6.js} +15 -15
  36. package/dist/tooltip-kgsorOg6.js.map +1 -0
  37. package/dist/types/components/rendra-provider.d.ts +7 -2
  38. package/dist/types/components/rendra-router-bridge.d.ts +2 -1
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/lib/motion/index.d.ts +1 -1
  41. package/dist/types/lib/motion/motion-context.d.ts +21 -6
  42. package/dist/types/lib/motion/motion-on.d.ts +12 -0
  43. package/dist/types/motion.d.ts +1 -0
  44. package/dist/{use-breakpoint-O9eqFmsF.js → use-breakpoint-CNxDwEpc.js} +2 -2
  45. package/dist/{use-breakpoint-O9eqFmsF.js.map → use-breakpoint-CNxDwEpc.js.map} +1 -1
  46. package/dist/{use-motion-presets-BrkgL8lG.js → use-motion-presets-DCJPBfNJ.js} +3 -3
  47. package/dist/{use-motion-presets-BrkgL8lG.js.map → use-motion-presets-DCJPBfNJ.js.map} +1 -1
  48. package/dist/widget-grid.js +2 -2
  49. package/package.json +8 -1
  50. package/dist/button-BzJgR2gH.js.map +0 -1
  51. package/dist/motion-context-5BRIQAJm.js +0 -107
  52. package/dist/motion-context-5BRIQAJm.js.map +0 -1
  53. package/dist/rendra-provider-CRe0XdOU.js.map +0 -1
  54. package/dist/tooltip-BAMSaGbS.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,15 +1,14 @@
1
- /*! Rendra Design System v2.5.0 | MIT | © 2026 Bruno Magalhaes | brunomagalhaes.me */
2
- import { t as cn } from "./cn-Cw7M5kEP.js";
3
- import { a as getReducedMotion, n as useLayoutReady, o as subscribeReducedMotion, r as useMotionMode, s as usePrefersReducedMotion } from "./motion-context-5BRIQAJm.js";
4
- import { t as useMotionPresets } from "./use-motion-presets-BrkgL8lG.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-DkpspH9h.js";
6
- import { n as buttonVariants, r as Spinner, t as Button } from "./button-BzJgR2gH.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-BAMSaGbS.js";
8
- import { a as BrandContext, i as useBrand, n as BrandFeedbackIcon, r as feedbackLabels, t as EmptyState } from "./empty-state-Cdb1vkMT.js";
9
- import { a as useRendraNavigate, i as useRendraLink, n as useCurrentPath, r as useRendraBreadcrumbs, t as RendraProvider } from "./rendra-provider-CRe0XdOU.js";
10
- import { n as useBreakpoint, t as breakpoints } from "./use-breakpoint-O9eqFmsF.js";
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";
11
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";
12
- import { AnimatePresence, animate, m, useDragControls, useMotionValue, useTransform } from "motion/react";
13
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";
14
13
  import { Fragment, cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
15
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -74,10 +73,10 @@ function formatLike(parsed, n) {
74
73
  //#region src/components/ui/accordion.tsx
75
74
  /** Accordion único, com animação de altura e área de toque de 44px no mobile. */
76
75
  function Accordion({ items, multiple, defaultValue, className }) {
77
- const motion = useMotionMode();
76
+ const lib = useMotionLib();
78
77
  const presets = useMotionPresets();
79
78
  const [open, setOpen] = useState(multiple ? defaultValue ?? [] : defaultValue?.[0] ? [defaultValue[0]] : []);
80
- if (motion === "on") {
79
+ if (lib) {
81
80
  const rootProps = multiple ? {
82
81
  type: "multiple",
83
82
  value: open,
@@ -100,19 +99,19 @@ function Accordion({ items, multiple, defaultValue, className }) {
100
99
  className: "border-b last:border-b-0",
101
100
  children: [/* @__PURE__ */ jsx(Accordion$1.Header, { children: /* @__PURE__ */ jsxs(Accordion$1.Trigger, {
102
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",
103
- children: [it.title, /* @__PURE__ */ jsx(m.span, {
102
+ children: [it.title, /* @__PURE__ */ jsx(lib.m.span, {
104
103
  "aria-hidden": true,
105
104
  className: "flex shrink-0",
106
105
  animate: { rotate: isOpen ? 180 : 0 },
107
106
  transition: presets.fade.transition,
108
107
  children: /* @__PURE__ */ jsx(ChevronDown, { className: "size-icon-sm text-muted-foreground" })
109
108
  })]
110
- }) }), /* @__PURE__ */ jsx(AnimatePresence, {
109
+ }) }), /* @__PURE__ */ jsx(lib.AnimatePresence, {
111
110
  initial: false,
112
111
  children: isOpen && /* @__PURE__ */ jsx(Accordion$1.Content, {
113
112
  forceMount: true,
114
113
  asChild: true,
115
- children: /* @__PURE__ */ jsx(m.div, {
114
+ children: /* @__PURE__ */ jsx(lib.m.div, {
116
115
  className: "overflow-hidden text-sm wrap-break-word text-muted-foreground",
117
116
  initial: {
118
117
  height: 0,
@@ -698,7 +697,7 @@ function Modal({ open, onOpenChange, title, description, type = "confirm", size
698
697
  }
699
698
  };
700
699
  const isForm = type === "form";
701
- const motion = useMotionMode();
700
+ const lib = useMotionLib();
702
701
  const presets = useMotionPresets();
703
702
  const { isMobile } = useBreakpoint();
704
703
  const code = resolveCatalogCode("Modal", { type: type === "destructive" ? "confirm" : type });
@@ -746,15 +745,15 @@ function Modal({ open, onOpenChange, title, description, type = "confirm", size
746
745
  children
747
746
  })]
748
747
  });
749
- if (motion === "on") return /* @__PURE__ */ jsx(Dialog.Root, {
748
+ if (lib) return /* @__PURE__ */ jsx(Dialog.Root, {
750
749
  open,
751
750
  onOpenChange,
752
- children: /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
751
+ children: /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
753
752
  forceMount: true,
754
753
  children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
755
754
  forceMount: true,
756
755
  asChild: true,
757
- children: /* @__PURE__ */ jsx(m.div, {
756
+ children: /* @__PURE__ */ jsx(lib.m.div, {
758
757
  className: overlayCls$1,
759
758
  ...presets.fade
760
759
  })
@@ -763,7 +762,7 @@ function Modal({ open, onOpenChange, title, description, type = "confirm", size
763
762
  asChild: true,
764
763
  "data-rendra": code,
765
764
  className: cn(contentCls, sizeCls),
766
- children: /* @__PURE__ */ jsx(m.div, {
765
+ children: /* @__PURE__ */ jsx(lib.m.div, {
767
766
  ...presets.open(isMobile ? { y: 8 } : void 0),
768
767
  children: shell
769
768
  })
@@ -1908,10 +1907,10 @@ var PopoverClose = Popover$1.Close;
1908
1907
  var PopoverAnchor = Popover$1.Anchor;
1909
1908
  function PopoverContent({ className, align = "center", sideOffset = 8, width = "md", children, asChild, ...props }) {
1910
1909
  const open = useContext(PopoverOpenContext);
1911
- const motion = useMotionMode();
1910
+ const lib = useMotionLib();
1912
1911
  const presets = useMotionPresets();
1913
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");
1914
- if (motion === "on" && open !== null && !asChild) return /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
1913
+ if (lib && open !== null && !asChild) return /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
1915
1914
  forceMount: true,
1916
1915
  children: /* @__PURE__ */ jsx(Popover$1.Content, {
1917
1916
  forceMount: true,
@@ -1922,7 +1921,7 @@ function PopoverContent({ className, align = "center", sideOffset = 8, width = "
1922
1921
  "data-rendra": "POP-001",
1923
1922
  className: cn(base, className),
1924
1923
  ...props,
1925
- children: /* @__PURE__ */ jsx(m.div, {
1924
+ children: /* @__PURE__ */ jsx(lib.m.div, {
1926
1925
  ...presets.open(),
1927
1926
  children
1928
1927
  })
@@ -3029,7 +3028,8 @@ function QuickReplyList({ items, onPick }) {
3029
3028
  function Checkbox({ checked, defaultChecked, onCheckedChange, label, description, disabled, invalid, id, name, className, ...aria }) {
3030
3029
  const auto = useId();
3031
3030
  const cid = id ?? `cb${auto}`;
3032
- const on = useMotionMode() === "on";
3031
+ const lib = useMotionLib();
3032
+ const on = lib !== null;
3033
3033
  const presets = useMotionPresets();
3034
3034
  const [inner, setInner] = useState(defaultChecked ?? false);
3035
3035
  const state = checked ?? inner;
@@ -3060,16 +3060,16 @@ function Checkbox({ checked, defaultChecked, onCheckedChange, label, description
3060
3060
  const box = on ? /* @__PURE__ */ jsx(Checkbox$1.Root, {
3061
3061
  asChild: true,
3062
3062
  ...rootProps,
3063
- children: /* @__PURE__ */ jsx(m.button, {
3063
+ children: /* @__PURE__ */ jsx(lib.m.button, {
3064
3064
  type: "button",
3065
3065
  whileTap: presets.press.whileTap,
3066
3066
  transition: presets.press.transition,
3067
- children: /* @__PURE__ */ jsx(AnimatePresence, {
3067
+ children: /* @__PURE__ */ jsx(lib.AnimatePresence, {
3068
3068
  initial: false,
3069
3069
  children: state !== false && /* @__PURE__ */ jsx(Checkbox$1.Indicator, {
3070
3070
  forceMount: true,
3071
3071
  asChild: true,
3072
- children: /* @__PURE__ */ jsx(m.span, {
3072
+ children: /* @__PURE__ */ jsx(lib.m.span, {
3073
3073
  className: "flex items-center justify-center",
3074
3074
  ...presets.indicator,
3075
3075
  children: mark
@@ -3495,6 +3495,7 @@ var DISMISS_VELOCITY = 110;
3495
3495
  * fundo é gravado direto no elemento (sem render por quadro).
3496
3496
  */
3497
3497
  function MobileSheet({ open, onOpenChange, trigger, adornment, head, rest }) {
3498
+ const { AnimatePresence, animate, m, useDragControls } = useMotionOn();
3498
3499
  const presets = useMotionPresets();
3499
3500
  const ready = useLayoutReady();
3500
3501
  const controls = useDragControls();
@@ -3575,9 +3576,9 @@ function Anchor({ adornment, children }) {
3575
3576
  }
3576
3577
  function PickerPanel({ open, onOpenChange, trigger, title, header, children, footer, width = "trigger", adornment, align = "start" }) {
3577
3578
  const { isMobile } = useBreakpoint();
3578
- const motion = useMotionMode();
3579
+ const lib = useMotionLib();
3579
3580
  const presets = useMotionPresets();
3580
- const on = motion === "on";
3581
+ const on = lib !== null;
3581
3582
  const sheetHead = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
3582
3583
  className: "flex shrink-0 flex-col items-center pt-2",
3583
3584
  children: /* @__PURE__ */ jsx("span", {
@@ -3645,7 +3646,7 @@ function PickerPanel({ open, onOpenChange, trigger, title, header, children, foo
3645
3646
  asChild: true,
3646
3647
  children: trigger
3647
3648
  })
3648
- }), /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
3649
+ }), /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsx(Popover$1.Portal, {
3649
3650
  forceMount: true,
3650
3651
  children: /* @__PURE__ */ jsx(Popover$1.Content, {
3651
3652
  forceMount: true,
@@ -3654,7 +3655,7 @@ function PickerPanel({ open, onOpenChange, trigger, title, header, children, foo
3654
3655
  sideOffset: 6,
3655
3656
  collisionPadding: 16,
3656
3657
  className: panelCls,
3657
- children: /* @__PURE__ */ jsx(m.div, {
3658
+ children: /* @__PURE__ */ jsx(lib.m.div, {
3658
3659
  ...presets.open(),
3659
3660
  children: panelBody
3660
3661
  })
@@ -3806,7 +3807,7 @@ var panelCls = "fixed inset-y-0 right-0 z-50 flex h-dvh w-full flex-col bg-card
3806
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." }) {
3807
3808
  const [confirming, setConfirming] = useState(false);
3808
3809
  const requestClose = () => dirty ? setConfirming(true) : onOpenChange(false);
3809
- const motion = useMotionMode();
3810
+ const lib = useMotionLib();
3810
3811
  const presets = useMotionPresets();
3811
3812
  const keepOpenIfDirty = (e) => {
3812
3813
  if (dirty) {
@@ -3825,12 +3826,12 @@ function Drawer({ open, onOpenChange, title, description, icon, size = "30", chi
3825
3826
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Dialog.Root, {
3826
3827
  open,
3827
3828
  onOpenChange: (o) => o ? onOpenChange(true) : requestClose(),
3828
- children: motion === "on" ? /* @__PURE__ */ jsx(AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
3829
+ children: lib ? /* @__PURE__ */ jsx(lib.AnimatePresence, { children: open && /* @__PURE__ */ jsxs(Dialog.Portal, {
3829
3830
  forceMount: true,
3830
3831
  children: [/* @__PURE__ */ jsx(Dialog.Overlay, {
3831
3832
  forceMount: true,
3832
3833
  asChild: true,
3833
- children: /* @__PURE__ */ jsx(m.div, {
3834
+ children: /* @__PURE__ */ jsx(lib.m.div, {
3834
3835
  className: overlayCls,
3835
3836
  ...presets.fade
3836
3837
  })
@@ -3841,7 +3842,7 @@ function Drawer({ open, onOpenChange, title, description, icon, size = "30", chi
3841
3842
  onPointerDownOutside: keepOpenIfDirty,
3842
3843
  "data-rendra": "GAV-001",
3843
3844
  className: cn(panelCls, sizes[size]),
3844
- children: /* @__PURE__ */ jsx(m.div, {
3845
+ children: /* @__PURE__ */ jsx(lib.m.div, {
3845
3846
  ...presets.sheet("right"),
3846
3847
  children: shell
3847
3848
  })
@@ -3870,12 +3871,12 @@ function Drawer({ open, onOpenChange, title, description, icon, size = "30", chi
3870
3871
  function Switch({ checked, defaultChecked, onCheckedChange, label, description, disabled, id, name, className, ...aria }) {
3871
3872
  const auto = useId();
3872
3873
  const sid = id ?? `sw${auto}`;
3873
- const motion = useMotionMode();
3874
+ const lib = useMotionLib();
3874
3875
  const presets = useMotionPresets();
3875
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";
3876
- 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", motion === "on" ? "transition-[translate]" : "transition-transform");
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");
3877
3878
  const tap = presets.tap;
3878
- const control = motion === "on" ? /* @__PURE__ */ jsx(Switch$1.Root, {
3879
+ const control = lib ? /* @__PURE__ */ jsx(Switch$1.Root, {
3879
3880
  asChild: true,
3880
3881
  id: sid,
3881
3882
  name,
@@ -3886,7 +3887,7 @@ function Switch({ checked, defaultChecked, onCheckedChange, label, description,
3886
3887
  "aria-label": aria["aria-label"],
3887
3888
  "data-touch": "expanded",
3888
3889
  "data-rendra": "SWT-001",
3889
- children: /* @__PURE__ */ jsx(m.button, {
3890
+ children: /* @__PURE__ */ jsx(lib.m.button, {
3890
3891
  type: "button",
3891
3892
  className: rootCls,
3892
3893
  initial: "rest",
@@ -3894,7 +3895,7 @@ function Switch({ checked, defaultChecked, onCheckedChange, label, description,
3894
3895
  whileTap: tap ? "tap" : void 0,
3895
3896
  children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
3896
3897
  asChild: true,
3897
- children: /* @__PURE__ */ jsx(m.span, {
3898
+ children: /* @__PURE__ */ jsx(lib.m.span, {
3898
3899
  className: thumbCls,
3899
3900
  variants: {
3900
3901
  rest: { scale: 1 },
@@ -4924,6 +4925,7 @@ function Tabs({ items, value, defaultValue, onChange, variant = "line", classNam
4924
4925
  }, [items, variant]);
4925
4926
  const presets = useMotionPresets();
4926
4927
  const on = useLayoutReady();
4928
+ const lib = useMotionLib();
4927
4929
  const listRef = useRef(null);
4928
4930
  const [clip, setClip] = useState({
4929
4931
  l: 0,
@@ -4955,7 +4957,7 @@ function Tabs({ items, value, defaultValue, onChange, variant = "line", classNam
4955
4957
  ]);
4956
4958
  const [indicatorId] = useState(() => `rendra-tabs-${++tabsCreated}`);
4957
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");
4958
- const indicator = /* @__PURE__ */ jsx(m.span, {
4960
+ const indicator = lib && /* @__PURE__ */ jsx(lib.m.span, {
4959
4961
  layoutId: indicatorId,
4960
4962
  "data-indicator": "tabs",
4961
4963
  "aria-hidden": true,
@@ -5630,6 +5632,7 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
5630
5632
  const code = resolveCatalogCode("Kanban", { hasDropTargets: Boolean(dropTargets?.length) });
5631
5633
  const { isMobile } = useBreakpoint();
5632
5634
  const motion = useMotionMode();
5635
+ const lib = useMotionLib();
5633
5636
  const ready = useLayoutReady();
5634
5637
  const presets = useMotionPresets();
5635
5638
  const [boardId] = useState(() => `rendra-kanban-${++boardsCreated}`);
@@ -5846,13 +5849,13 @@ function Kanban({ columns, cards, onCardMove, onCardClick, onAddCard, renderCard
5846
5849
  children: moveMenu(card)
5847
5850
  })
5848
5851
  ] });
5849
- if (motion === "on") {
5852
+ if (lib) {
5850
5853
  const layout = layoutEnabled({
5851
5854
  mode: motion,
5852
5855
  ready,
5853
5856
  dragging: touchDrag !== null
5854
5857
  });
5855
- return /* @__PURE__ */ jsx(m.li, {
5858
+ return /* @__PURE__ */ jsx(lib.m.li, {
5856
5859
  ref: (el) => {
5857
5860
  if (!el) return;
5858
5861
  const onStart = (e) => dragStart(e.dataTransfer);
@@ -6080,9 +6083,10 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
6080
6083
  });
6081
6084
  const sortableEnabled = Boolean(onReorder);
6082
6085
  const motion = useMotionMode();
6086
+ const lib = useMotionLib();
6083
6087
  const ready = useLayoutReady();
6084
6088
  const presets = useMotionPresets();
6085
- const Item = motion === "on" ? m.li : "li";
6089
+ const Item = lib ? lib.m.li : "li";
6086
6090
  const itemMotion = motion === "on" ? {
6087
6091
  layout: layoutEnabled({
6088
6092
  mode: motion,
@@ -6163,9 +6167,10 @@ function List({ items, divided = true, empty, className, onReorder, itemLabel =
6163
6167
  */
6164
6168
  function OtpInput({ length = 6, value, onChange, onComplete, invalid, disabled, id, ...aria }) {
6165
6169
  const refs = useRef([]);
6166
- const on = useMotionMode() === "on";
6170
+ const lib = useMotionLib();
6171
+ const on = lib !== null;
6167
6172
  const presets = useMotionPresets();
6168
- const Cell = on ? m.input : "input";
6173
+ const Cell = on ? lib.m.input : "input";
6169
6174
  const digits = Array.from({ length }, (_, i) => value[i] ?? "");
6170
6175
  const set = (next) => {
6171
6176
  const clean = next.replace(/\D/g, "").slice(0, length);
@@ -7220,16 +7225,17 @@ var cols = {
7220
7225
  * O item do Radix. Em `on` ele é um `m.button` (asChild) que responde ao toque (whileTap 0,97,
7221
7226
  * em `press`); em `off` é o `R.Item` de sempre, sem nó novo.
7222
7227
  */
7223
- function Item({ on, children, ...props }) {
7228
+ function Item({ children, ...props }) {
7224
7229
  const presets = useMotionPresets();
7225
- if (!on) return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
7230
+ const lib = useMotionLib();
7231
+ if (!lib) return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
7226
7232
  ...props,
7227
7233
  children
7228
7234
  });
7229
7235
  return /* @__PURE__ */ jsx(RadioGroup$1.Item, {
7230
7236
  asChild: true,
7231
7237
  ...props,
7232
- children: /* @__PURE__ */ jsx(m.button, {
7238
+ children: /* @__PURE__ */ jsx(lib.m.button, {
7233
7239
  type: "button",
7234
7240
  whileTap: presets.press.whileTap,
7235
7241
  transition: presets.press.transition,
@@ -7239,14 +7245,15 @@ function Item({ on, children, ...props }) {
7239
7245
  }
7240
7246
  /** Radio único: em lista ou em cards, por prop. */
7241
7247
  function RadioGroup({ options, value, defaultValue, onChange, variant = "list", columns = 2, orientation = "vertical", invalid, disabled, id, name, ...aria }) {
7242
- const on = useMotionMode() === "on";
7248
+ const lib = useMotionLib();
7249
+ const on = lib !== null;
7243
7250
  const presets = useMotionPresets();
7244
7251
  const [inner, setInner] = useState(defaultValue);
7245
7252
  const current = value ?? inner;
7246
7253
  const dotFor = (optionValue) => /* @__PURE__ */ jsx("span", {
7247
7254
  "aria-hidden": true,
7248
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"),
7249
- children: on ? /* @__PURE__ */ jsx(m.span, {
7256
+ children: on ? /* @__PURE__ */ jsx(lib.m.span, {
7250
7257
  className: "size-2 rounded-full bg-primary",
7251
7258
  initial: false,
7252
7259
  animate: current === optionValue ? presets.indicator.animate : presets.indicator.initial,
@@ -7269,7 +7276,6 @@ function RadioGroup({ options, value, defaultValue, onChange, variant = "list",
7269
7276
  "data-rendra": resolveCatalogCode("RadioGroup", { variant }),
7270
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"),
7271
7278
  children: options.map((o) => variant === "cards" ? /* @__PURE__ */ jsxs(Item, {
7272
- on,
7273
7279
  value: o.value,
7274
7280
  disabled: o.disabled,
7275
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"),
@@ -7293,7 +7299,6 @@ function RadioGroup({ options, value, defaultValue, onChange, variant = "list",
7293
7299
  }, o.value) : /* @__PURE__ */ jsxs("label", {
7294
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"),
7295
7301
  children: [/* @__PURE__ */ jsx(Item, {
7296
- on,
7297
7302
  value: o.value,
7298
7303
  disabled: o.disabled,
7299
7304
  className: "group flex pt-px outline-none focus-visible:[&>span]:focus-ring",
@@ -7551,11 +7556,14 @@ function Skeleton({ className, ...props }) {
7551
7556
  //#region src/components/ui/stat-card.tsx
7552
7557
  /** Contagem de 0 até o valor, com o formato do texto original; no fim mostra o `value` exato. */
7553
7558
  function Counter({ parsed, value }) {
7559
+ const { animate, m, useMotionValue, useTransform } = useMotionOn();
7554
7560
  const presets = useMotionPresets();
7555
- const progress = useMotionValue(0);
7561
+ const [skip] = useState(useMotionAdopted());
7562
+ const progress = useMotionValue(skip ? parsed.value : 0);
7556
7563
  const text = useTransform(progress, (n) => formatLike(parsed, n));
7557
- const [done, setDone] = useState(false);
7564
+ const [done, setDone] = useState(skip);
7558
7565
  useEffect(() => {
7566
+ if (skip) return;
7559
7567
  const controls = animate(progress, parsed.value, {
7560
7568
  duration: presets.tokens.reveal.count,
7561
7569
  ease: presets.tokens.ease.out,
@@ -7563,9 +7571,11 @@ function Counter({ parsed, value }) {
7563
7571
  });
7564
7572
  return () => controls.stop();
7565
7573
  }, [
7574
+ animate,
7566
7575
  progress,
7567
7576
  parsed.value,
7568
- presets.tokens
7577
+ presets.tokens,
7578
+ skip
7569
7579
  ]);
7570
7580
  return /* @__PURE__ */ jsx(m.span, {
7571
7581
  ...presets.fade,
@@ -7578,11 +7588,11 @@ function Counter({ parsed, value }) {
7578
7588
  * o valor final aparece direto.
7579
7589
  */
7580
7590
  function StatValue({ value }) {
7581
- const motion = useMotionMode();
7591
+ const lib = useMotionLib();
7582
7592
  const presets = useMotionPresets();
7583
7593
  const parsed = useMemo(() => parseLocaleNumber$1(value), [value]);
7584
- if (motion !== "on") return /* @__PURE__ */ jsx(Fragment$1, { children: value });
7585
- if (!parsed || presets.reduced) return /* @__PURE__ */ jsx(m.span, {
7594
+ if (!lib) return /* @__PURE__ */ jsx(Fragment$1, { children: value });
7595
+ if (!parsed || presets.reduced) return /* @__PURE__ */ jsx(lib.m.span, {
7586
7596
  ...presets.fade,
7587
7597
  children: value
7588
7598
  });
@@ -7783,7 +7793,7 @@ var tableFeatureSet = tableFeatures({
7783
7793
  * conteúdo fechado sai do DOM; em `off` é o Collapsible de sempre, com as animações em CSS.
7784
7794
  */
7785
7795
  function MobileDetails({ children }) {
7786
- const motion = useMotionMode();
7796
+ const lib = useMotionLib();
7787
7797
  const presets = useMotionPresets();
7788
7798
  const [open, setOpen] = useState(false);
7789
7799
  const trigger = /* @__PURE__ */ jsxs(Collapsible.Trigger, {
@@ -7803,15 +7813,15 @@ function MobileDetails({ children }) {
7803
7813
  })
7804
7814
  ]
7805
7815
  });
7806
- if (motion === "on") return /* @__PURE__ */ jsxs(Collapsible.Root, {
7816
+ if (lib) return /* @__PURE__ */ jsxs(Collapsible.Root, {
7807
7817
  open,
7808
7818
  onOpenChange: setOpen,
7809
- children: [trigger, /* @__PURE__ */ jsx(AnimatePresence, {
7819
+ children: [trigger, /* @__PURE__ */ jsx(lib.AnimatePresence, {
7810
7820
  initial: false,
7811
7821
  children: open && /* @__PURE__ */ jsx(Collapsible.Content, {
7812
7822
  forceMount: true,
7813
7823
  asChild: true,
7814
- children: /* @__PURE__ */ jsx(m.div, {
7824
+ children: /* @__PURE__ */ jsx(lib.m.div, {
7815
7825
  className: "overflow-hidden",
7816
7826
  initial: {
7817
7827
  height: 0,
@@ -7838,7 +7848,8 @@ function MobileDetails({ children }) {
7838
7848
  }
7839
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 }) {
7840
7850
  const { isMobile } = useBreakpoint();
7841
- const on = useMotionMode() === "on";
7851
+ const lib = useMotionLib();
7852
+ const on = lib !== null;
7842
7853
  const presets = useMotionPresets();
7843
7854
  const columns = useMemo(() => statusLast ? [...columnsProp.filter((c) => c.kind !== "badge"), ...columnsProp.filter((c) => c.kind === "badge")] : columnsProp, [columnsProp, statusLast]);
7844
7855
  const [sorting, setSorting] = useState([]);
@@ -8259,14 +8270,14 @@ function Table({ data: dataProp, source, queryKey = "", columns: columnsProp, st
8259
8270
  children: expandable(row)
8260
8271
  })
8261
8272
  }),
8262
- expandable && on && /* @__PURE__ */ jsx(AnimatePresence, {
8273
+ expandable && on && /* @__PURE__ */ jsx(lib.AnimatePresence, {
8263
8274
  initial: false,
8264
8275
  children: r.getIsExpanded() && /* @__PURE__ */ jsx("tr", {
8265
8276
  className: "bg-muted/30",
8266
8277
  children: /* @__PURE__ */ jsx("td", {
8267
8278
  colSpan: visibleCols.length + (selectable ? 1 : 0) + 1 + (rowActions ? 1 : 0),
8268
8279
  className: "px-4",
8269
- children: /* @__PURE__ */ jsx(m.div, {
8280
+ children: /* @__PURE__ */ jsx(lib.m.div, {
8270
8281
  className: "overflow-hidden",
8271
8282
  initial: {
8272
8283
  height: 0,
@@ -8416,9 +8427,10 @@ var statusTextTone = {
8416
8427
  };
8417
8428
  /** Linha do tempo única, com eventos em ordem e tom semântico por evento. */
8418
8429
  function Timeline({ events, className }) {
8419
- const on = useMotionMode() === "on";
8430
+ const lib = useMotionLib();
8431
+ const on = lib !== null;
8420
8432
  const presets = useMotionPresets();
8421
- const Item = on ? m.li : "li";
8433
+ const Item = on ? lib.m.li : "li";
8422
8434
  const enter = presets.slide("bottom", "short");
8423
8435
  return /* @__PURE__ */ jsx("ol", {
8424
8436
  "data-rendra": "TLN-001",
@@ -8680,9 +8692,10 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
8680
8692
  }
8681
8693
  });
8682
8694
  const motion = useMotionMode();
8695
+ const lib = useMotionLib();
8683
8696
  const ready = useLayoutReady();
8684
8697
  const presets = useMotionPresets();
8685
- const Item = motion === "on" ? m.li : "li";
8698
+ const Item = lib ? lib.m.li : "li";
8686
8699
  const itemMotion = motion === "on" ? {
8687
8700
  ...presets.fade,
8688
8701
  layout: layoutEnabled({
@@ -8695,7 +8708,7 @@ function Upload({ accept, multiple = true, maxSizeMb = 10, onUpload, onChange, h
8695
8708
  layout: presets.move
8696
8709
  }
8697
8710
  } : {};
8698
- const animated = (nodes) => motion === "on" ? /* @__PURE__ */ jsx(AnimatePresence, {
8711
+ const animated = (nodes) => lib ? /* @__PURE__ */ jsx(lib.AnimatePresence, {
8699
8712
  mode: "popLayout",
8700
8713
  initial: false,
8701
8714
  children: nodes
@@ -8944,7 +8957,7 @@ var statusLabel = {
8944
8957
  */
8945
8958
  function Stepper({ steps, current, errors = [], orientation = "horizontal", onStepClick, className }) {
8946
8959
  const step = steps[current];
8947
- const motion = useMotionMode();
8960
+ const lib = useMotionLib();
8948
8961
  const presets = useMotionPresets();
8949
8962
  return /* @__PURE__ */ jsxs("div", {
8950
8963
  "data-rendra": "WIZ-002",
@@ -8985,7 +8998,7 @@ function Stepper({ steps, current, errors = [], orientation = "horizontal", onSt
8985
8998
  const clickable = onStepClick && st === "complete";
8986
8999
  const circle = /* @__PURE__ */ jsx("span", {
8987
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"),
8988
- children: st === "complete" ? motion === "on" ? /* @__PURE__ */ jsx(m.span, {
9001
+ children: st === "complete" ? lib ? /* @__PURE__ */ jsx(lib.m.span, {
8989
9002
  className: "flex",
8990
9003
  ...presets.pop,
8991
9004
  children: /* @__PURE__ */ jsx(Check, {
@@ -9075,17 +9088,17 @@ function Wizard({ steps, children, onValidateStep, onFinish, onCancel, cancelLab
9075
9088
  setCurrent((c) => c + 1);
9076
9089
  onSkip?.();
9077
9090
  };
9078
- const motion = useMotionMode();
9091
+ const lib = useMotionLib();
9079
9092
  const presets = useMotionPresets();
9080
9093
  const previous = useRef(current);
9081
9094
  const direction = current >= previous.current ? 1 : -1;
9082
9095
  previous.current = current;
9083
- const body = motion === "on" ? /* @__PURE__ */ jsx("div", {
9096
+ const body = lib ? /* @__PURE__ */ jsx("div", {
9084
9097
  className: "relative flex min-w-0 flex-col gap-6",
9085
- children: /* @__PURE__ */ jsx(AnimatePresence, {
9098
+ children: /* @__PURE__ */ jsx(lib.AnimatePresence, {
9086
9099
  mode: "popLayout",
9087
9100
  initial: false,
9088
- children: /* @__PURE__ */ jsx(m.div, {
9101
+ children: /* @__PURE__ */ jsx(lib.m.div, {
9089
9102
  ...presets.swap(direction),
9090
9103
  className: "flex min-w-0 flex-col gap-6",
9091
9104
  children: children[current]