framepexls-ui-lib 0.2.8 → 0.2.10

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 (95) hide show
  1. package/dist/AppTopbar.js +1 -1
  2. package/dist/AppTopbar.mjs +1 -1
  3. package/dist/AvatarGroup.js +7 -2
  4. package/dist/AvatarGroup.mjs +7 -2
  5. package/dist/Badge.js +6 -1
  6. package/dist/Badge.mjs +6 -1
  7. package/dist/BadgeCluster.js +1 -1
  8. package/dist/BadgeCluster.mjs +1 -1
  9. package/dist/Breadcrumb.js +46 -2
  10. package/dist/Breadcrumb.mjs +46 -2
  11. package/dist/Button.js +8 -2
  12. package/dist/Button.mjs +8 -2
  13. package/dist/CalendarPanel.js +45 -26
  14. package/dist/CalendarPanel.mjs +45 -26
  15. package/dist/Card.js +7 -2
  16. package/dist/Card.mjs +7 -2
  17. package/dist/Checkbox.js +51 -18
  18. package/dist/Checkbox.mjs +51 -18
  19. package/dist/ColorPicker.js +9 -4
  20. package/dist/ColorPicker.mjs +9 -4
  21. package/dist/ColumnSelector.js +1 -1
  22. package/dist/ColumnSelector.mjs +1 -1
  23. package/dist/ComboSelect.js +11 -4
  24. package/dist/ComboSelect.mjs +11 -4
  25. package/dist/DateTimeField.js +8 -2
  26. package/dist/DateTimeField.mjs +8 -2
  27. package/dist/Dialog.js +2 -2
  28. package/dist/Dialog.mjs +2 -2
  29. package/dist/Drawer.js +2 -2
  30. package/dist/Drawer.mjs +2 -2
  31. package/dist/Dropdown.js +14 -10
  32. package/dist/Dropdown.mjs +14 -10
  33. package/dist/FiltersMultiSelect.js +1 -1
  34. package/dist/FiltersMultiSelect.mjs +1 -1
  35. package/dist/Input.js +23 -0
  36. package/dist/Input.mjs +23 -0
  37. package/dist/KpiCard.js +26 -2
  38. package/dist/KpiCard.mjs +26 -2
  39. package/dist/Link.js +16 -2
  40. package/dist/Link.mjs +16 -2
  41. package/dist/MediaCard.js +18 -11
  42. package/dist/MediaCard.mjs +18 -11
  43. package/dist/MediaSelector.js +9 -8
  44. package/dist/MediaSelector.mjs +9 -8
  45. package/dist/MotionProvider.d.mts +9 -0
  46. package/dist/MotionProvider.d.ts +9 -0
  47. package/dist/MotionProvider.js +29 -0
  48. package/dist/MotionProvider.mjs +9 -0
  49. package/dist/MultiComboSelect.js +6 -4
  50. package/dist/MultiComboSelect.mjs +6 -4
  51. package/dist/Pagination.js +65 -29
  52. package/dist/Pagination.mjs +65 -29
  53. package/dist/ReviewHistory.js +8 -6
  54. package/dist/ReviewHistory.mjs +8 -6
  55. package/dist/SearchInput.js +16 -2
  56. package/dist/SearchInput.mjs +16 -2
  57. package/dist/Select.js +12 -5
  58. package/dist/Select.mjs +12 -5
  59. package/dist/Sidebar.js +23 -5
  60. package/dist/Sidebar.mjs +23 -5
  61. package/dist/StatCard.js +17 -1
  62. package/dist/StatCard.mjs +19 -3
  63. package/dist/Steps.js +51 -37
  64. package/dist/Steps.mjs +51 -37
  65. package/dist/StorageUsage.js +6 -2
  66. package/dist/StorageUsage.mjs +6 -2
  67. package/dist/Table.d.mts +5 -1
  68. package/dist/Table.d.ts +5 -1
  69. package/dist/Table.js +31 -4
  70. package/dist/Table.mjs +30 -4
  71. package/dist/Textarea.js +42 -17
  72. package/dist/Textarea.mjs +43 -18
  73. package/dist/TimePanel.js +1 -1
  74. package/dist/TimePanel.mjs +1 -1
  75. package/dist/TimePopover.js +116 -83
  76. package/dist/TimePopover.mjs +116 -83
  77. package/dist/TimeRangeField.js +1 -1
  78. package/dist/TimeRangeField.mjs +1 -1
  79. package/dist/Toast.js +1 -5
  80. package/dist/Toast.mjs +1 -5
  81. package/dist/Tooltip.js +28 -19
  82. package/dist/Tooltip.mjs +28 -19
  83. package/dist/UploadCard.js +34 -21
  84. package/dist/UploadCard.mjs +34 -21
  85. package/dist/animations-CHrNeawW.d.mts +28 -0
  86. package/dist/animations-CHrNeawW.d.ts +28 -0
  87. package/dist/animations.d.mts +2 -0
  88. package/dist/animations.d.ts +2 -0
  89. package/dist/animations.js +75 -0
  90. package/dist/animations.mjs +42 -0
  91. package/dist/index.d.mts +4 -1
  92. package/dist/index.d.ts +4 -1
  93. package/dist/index.js +8 -0
  94. package/dist/index.mjs +18 -13
  95. package/package.json +4 -4
package/dist/Sidebar.mjs CHANGED
@@ -167,7 +167,7 @@ function Sidebar({
167
167
  setDrawerOpen(false);
168
168
  };
169
169
  return /* @__PURE__ */ jsxs(Fragment, { children: [
170
- /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-40 flex h-14 items-center gap-2 border-b border-black/5 bg-white/80 px-3 backdrop-blur shadow-sm xl:hidden dark:bg-[#0b0a0a]", children: [
170
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-40 flex h-14 items-center gap-2 border-b border-black/5 bg-white/80 px-3 backdrop-blur shadow-sm xl:hidden dark:bg-[var(--fx-surface)]", children: [
171
171
  /* @__PURE__ */ jsx(
172
172
  Button,
173
173
  {
@@ -192,7 +192,7 @@ function Sidebar({
192
192
  "aside",
193
193
  {
194
194
  className: [
195
- "hidden xl:fixed xl:inset-y-0 xl:flex xl:flex-col xl:border-r xl:border-black/5 bg-white xl:py-6 dark:bg-[#0b0a0a] z-40",
195
+ "hidden xl:fixed xl:inset-y-0 xl:flex xl:flex-col xl:border-r xl:border-black/5 bg-white xl:py-6 dark:bg-[var(--fx-surface)] z-40",
196
196
  "transition-[width] duration-200",
197
197
  collapsed ? "xl:w-28 xl:px-3" : "xl:w-72 xl:px-4"
198
198
  ].join(" "),
@@ -226,7 +226,7 @@ function Sidebar({
226
226
  animate: { x: 0 },
227
227
  exit: { x: -340 },
228
228
  transition: { type: "spring", stiffness: 260, damping: 28 },
229
- className: "relative h-full w-[88%] max-w-80 bg-white px-5 py-6 shadow-2xl dark:bg-[#0b0a0a]",
229
+ className: "relative h-full w-[88%] max-w-80 bg-white px-5 py-6 shadow-2xl dark:bg-[var(--fx-surface)]",
230
230
  children: [
231
231
  /* @__PURE__ */ jsxs("div", { className: "mb-4 flex items-center justify-between", children: [
232
232
  /* @__PURE__ */ jsx(
@@ -382,10 +382,19 @@ function RenderItem({
382
382
  "div",
383
383
  {
384
384
  className: [
385
- "flex w-full min-w-0 items-center rounded-2xl px-3 py-2 text-[15px] transition gap-2",
385
+ "relative flex w-full min-w-0 items-center rounded-2xl px-3 py-2 text-[15px] transition gap-2",
386
386
  isActive ? `${WRAP_ACTIVE[color]} text-slate-900 dark:text-white` : "text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-white/10"
387
387
  ].join(" "),
388
388
  children: [
389
+ isActive && /* @__PURE__ */ jsx(
390
+ motion.span,
391
+ {
392
+ layoutId: "sidebar-active",
393
+ className: `absolute inset-0 rounded-2xl ${WRAP_ACTIVE[color]}`,
394
+ transition: { type: "spring", stiffness: 300, damping: 26 },
395
+ style: { zIndex: 0 }
396
+ }
397
+ ),
389
398
  /* @__PURE__ */ jsxs(Button, { unstyled: true, type: "button", onClick: () => go(item.key), className: "flex min-w-0 flex-1 items-center gap-3", children: [
390
399
  /* @__PURE__ */ jsx(
391
400
  "span",
@@ -460,11 +469,20 @@ function RenderItem({
460
469
  onClick: () => go(item.key),
461
470
  title: collapsed ? item.label : void 0,
462
471
  className: [
463
- "group flex w-full min-w-0 items-center gap-3 rounded-2xl px-3 py-2 text-left text-[15px] transition",
472
+ "group relative flex w-full min-w-0 items-center gap-3 rounded-2xl px-3 py-2 text-left text-[15px] transition",
464
473
  active ? `${WRAP_ACTIVE[color]} text-slate-900 dark:text-white` : "text-slate-700 hover:bg-slate-100 dark:text-slate-200 dark:hover:bg-white/10",
465
474
  collapsed ? "justify-center" : ""
466
475
  ].join(" "),
467
476
  children: [
477
+ active && /* @__PURE__ */ jsx(
478
+ motion.span,
479
+ {
480
+ layoutId: "sidebar-active",
481
+ className: `absolute inset-0 rounded-2xl ${WRAP_ACTIVE[color]}`,
482
+ transition: { type: "spring", stiffness: 300, damping: 26 },
483
+ style: { zIndex: 0 }
484
+ }
485
+ ),
468
486
  /* @__PURE__ */ jsx(
469
487
  "span",
470
488
  {
package/dist/StatCard.js CHANGED
@@ -26,14 +26,30 @@ var import_jsx_runtime = require("react/jsx-runtime");
26
26
  var import_framer_motion = require("framer-motion");
27
27
  var import_react = require("react");
28
28
  var import_recharts = require("recharts");
29
+ function MotionNumber({ value, format }) {
30
+ const mv = (0, import_framer_motion.useMotionValue)(value);
31
+ const [display, setDisplay] = (0, import_react.useState)(value);
32
+ const prevRef = (0, import_react.useRef)(value);
33
+ (0, import_react.useEffect)(() => {
34
+ const controls = (0, import_framer_motion.animate)(mv, value, { duration: 0.5, ease: "easeOut" });
35
+ const unsub = mv.on("change", (v) => setDisplay(v));
36
+ prevRef.current = value;
37
+ return () => {
38
+ controls.stop();
39
+ unsub();
40
+ };
41
+ }, [value]);
42
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: format ? format(display) : Math.round(display).toLocaleString() });
43
+ }
29
44
  function StatCard({ title, value, hint, spark }) {
30
45
  var _a;
31
46
  const gid = (0, import_react.useId)();
32
47
  const color = (_a = spark == null ? void 0 : spark.color) != null ? _a : "#10b981";
48
+ const isNumber = typeof value === "number";
33
49
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "h-full group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 p-4 shadow-sm ring-1 ring-black/5 backdrop-blur transition hover:shadow-md dark:border-white/10 dark:bg-white/5", children: [
34
50
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative z-10", children: [
35
51
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: title }),
36
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-2xl font-semibold tracking-tight", children: value }),
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-2xl font-semibold tracking-tight", children: isNumber ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MotionNumber, { value }) : value }),
37
53
  hint && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-xs text-slate-400", children: hint })
38
54
  ] }),
39
55
  spark && spark.values.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-1/2 opacity-90", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_recharts.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_recharts.AreaChart, { data: spark.values.map((v, i) => ({ i, v })), margin: { top: 8, bottom: 0, left: 0, right: 0 }, children: [
package/dist/StatCard.mjs CHANGED
@@ -1,16 +1,32 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { motion } from "framer-motion";
4
- import { useId } from "react";
3
+ import { animate, motion, useMotionValue } from "framer-motion";
4
+ import { useEffect, useId, useRef, useState } from "react";
5
5
  import { Area, AreaChart, ResponsiveContainer } from "recharts";
6
+ function MotionNumber({ value, format }) {
7
+ const mv = useMotionValue(value);
8
+ const [display, setDisplay] = useState(value);
9
+ const prevRef = useRef(value);
10
+ useEffect(() => {
11
+ const controls = animate(mv, value, { duration: 0.5, ease: "easeOut" });
12
+ const unsub = mv.on("change", (v) => setDisplay(v));
13
+ prevRef.current = value;
14
+ return () => {
15
+ controls.stop();
16
+ unsub();
17
+ };
18
+ }, [value]);
19
+ return /* @__PURE__ */ jsx("span", { children: format ? format(display) : Math.round(display).toLocaleString() });
20
+ }
6
21
  function StatCard({ title, value, hint, spark }) {
7
22
  var _a;
8
23
  const gid = useId();
9
24
  const color = (_a = spark == null ? void 0 : spark.color) != null ? _a : "#10b981";
25
+ const isNumber = typeof value === "number";
10
26
  return /* @__PURE__ */ jsx(motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25 }, children: /* @__PURE__ */ jsxs("div", { className: "h-full group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 p-4 shadow-sm ring-1 ring-black/5 backdrop-blur transition hover:shadow-md dark:border-white/10 dark:bg-white/5", children: [
11
27
  /* @__PURE__ */ jsxs("div", { className: "relative z-10", children: [
12
28
  /* @__PURE__ */ jsx("div", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: title }),
13
- /* @__PURE__ */ jsx("div", { className: "mt-1 text-2xl font-semibold tracking-tight", children: value }),
29
+ /* @__PURE__ */ jsx("div", { className: "mt-1 text-2xl font-semibold tracking-tight", children: isNumber ? /* @__PURE__ */ jsx(MotionNumber, { value }) : value }),
14
30
  hint && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-slate-400", children: hint })
15
31
  ] }),
16
32
  spark && spark.values.length > 1 && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-1/2 opacity-90", children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(AreaChart, { data: spark.values.map((v, i) => ({ i, v })), margin: { top: 8, bottom: 0, left: 0, right: 0 }, children: [
package/dist/Steps.js CHANGED
@@ -35,6 +35,8 @@ __export(Steps_exports, {
35
35
  module.exports = __toCommonJS(Steps_exports);
36
36
  var import_jsx_runtime = require("react/jsx-runtime");
37
37
  var import_Button = __toESM(require("./Button"));
38
+ var import_framer_motion = require("framer-motion");
39
+ var import_animations = require("./animations");
38
40
  const cx = (...a) => a.filter(Boolean).join(" ");
39
41
  function Steps({
40
42
  steps,
@@ -44,7 +46,8 @@ function Steps({
44
46
  clickable = true,
45
47
  compact = false
46
48
  }) {
47
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
49
+ const progressPct = steps.length > 1 ? current / (steps.length - 1) * 100 : 0;
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
48
51
  "nav",
49
52
  {
50
53
  "aria-label": "Progreso",
@@ -52,44 +55,55 @@ function Steps({
52
55
  "w-full rounded-2xl border border-slate-200/80 bg-white/50 p-3 dark:border-white/10 dark:bg-white/[0.04]",
53
56
  className
54
57
  ),
55
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
56
- const state = i < current ? "done" : i === current ? "current" : "upcoming";
57
- const canClick = clickable && i <= current && !s.disabled && onChange;
58
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
59
- import_Button.default,
60
- {
61
- unstyled: true,
62
- type: "button",
63
- disabled: !canClick,
64
- onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
65
- className: cx(
66
- "group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
67
- state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
68
- state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
69
- state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
70
- ),
71
- "aria-current": state === "current" ? "step" : void 0,
72
- children: [
73
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
74
- "span",
75
- {
76
- className: cx(
77
- "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
78
- state === "current" && "bg-blue-600 text-white ring-black/0",
79
- state === "done" && "bg-emerald-600 text-white ring-black/0",
80
- state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
81
- ),
82
- children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
83
- }
58
+ children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
60
+ const state = i < current ? "done" : i === current ? "current" : "upcoming";
61
+ const canClick = clickable && i <= current && !s.disabled && onChange;
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
63
+ import_Button.default,
64
+ {
65
+ unstyled: true,
66
+ type: "button",
67
+ disabled: !canClick,
68
+ onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
69
+ className: cx(
70
+ "group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
71
+ state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
72
+ state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
73
+ state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
84
74
  ),
85
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
86
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
87
- !compact && s.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
88
- ] })
89
- ]
75
+ "aria-current": state === "current" ? "step" : void 0,
76
+ children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ "span",
79
+ {
80
+ className: cx(
81
+ "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
82
+ state === "current" && "bg-blue-600 text-white ring-black/0",
83
+ state === "done" && "bg-emerald-600 text-white ring-black/0",
84
+ state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
85
+ ),
86
+ children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
87
+ }
88
+ ),
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
90
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
91
+ !compact && s.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
92
+ ] })
93
+ ]
94
+ }
95
+ ) }, s.key);
96
+ }) }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 h-1.5 w-full overflow-hidden rounded-full bg-slate-200/70 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
98
+ import_framer_motion.motion.div,
99
+ {
100
+ className: "h-full rounded-full bg-blue-600 dark:bg-blue-400",
101
+ initial: { width: 0 },
102
+ animate: { width: `${Math.max(0, Math.min(100, progressPct))}%` },
103
+ transition: import_animations.springSm
90
104
  }
91
- ) }, s.key);
92
- }) })
105
+ ) })
106
+ ]
93
107
  }
94
108
  );
95
109
  }
package/dist/Steps.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import Button from "./Button";
4
+ import { motion } from "framer-motion";
5
+ import { springSm } from "./animations";
4
6
  const cx = (...a) => a.filter(Boolean).join(" ");
5
7
  function Steps({
6
8
  steps,
@@ -10,7 +12,8 @@ function Steps({
10
12
  clickable = true,
11
13
  compact = false
12
14
  }) {
13
- return /* @__PURE__ */ jsx(
15
+ const progressPct = steps.length > 1 ? current / (steps.length - 1) * 100 : 0;
16
+ return /* @__PURE__ */ jsxs(
14
17
  "nav",
15
18
  {
16
19
  "aria-label": "Progreso",
@@ -18,44 +21,55 @@ function Steps({
18
21
  "w-full rounded-2xl border border-slate-200/80 bg-white/50 p-3 dark:border-white/10 dark:bg-white/[0.04]",
19
22
  className
20
23
  ),
21
- children: /* @__PURE__ */ jsx("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
22
- const state = i < current ? "done" : i === current ? "current" : "upcoming";
23
- const canClick = clickable && i <= current && !s.disabled && onChange;
24
- return /* @__PURE__ */ jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs(
25
- Button,
26
- {
27
- unstyled: true,
28
- type: "button",
29
- disabled: !canClick,
30
- onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
31
- className: cx(
32
- "group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
33
- state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
34
- state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
35
- state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
36
- ),
37
- "aria-current": state === "current" ? "step" : void 0,
38
- children: [
39
- /* @__PURE__ */ jsx(
40
- "span",
41
- {
42
- className: cx(
43
- "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
44
- state === "current" && "bg-blue-600 text-white ring-black/0",
45
- state === "done" && "bg-emerald-600 text-white ring-black/0",
46
- state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
47
- ),
48
- children: state === "done" ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
49
- }
24
+ children: [
25
+ /* @__PURE__ */ jsx("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
26
+ const state = i < current ? "done" : i === current ? "current" : "upcoming";
27
+ const canClick = clickable && i <= current && !s.disabled && onChange;
28
+ return /* @__PURE__ */ jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs(
29
+ Button,
30
+ {
31
+ unstyled: true,
32
+ type: "button",
33
+ disabled: !canClick,
34
+ onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
35
+ className: cx(
36
+ "group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
37
+ state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
38
+ state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
39
+ state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
50
40
  ),
51
- /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
52
- /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
53
- !compact && s.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
54
- ] })
55
- ]
41
+ "aria-current": state === "current" ? "step" : void 0,
42
+ children: [
43
+ /* @__PURE__ */ jsx(
44
+ "span",
45
+ {
46
+ className: cx(
47
+ "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
48
+ state === "current" && "bg-blue-600 text-white ring-black/0",
49
+ state === "done" && "bg-emerald-600 text-white ring-black/0",
50
+ state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
51
+ ),
52
+ children: state === "done" ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
53
+ }
54
+ ),
55
+ /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
56
+ /* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
57
+ !compact && s.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
58
+ ] })
59
+ ]
60
+ }
61
+ ) }, s.key);
62
+ }) }),
63
+ /* @__PURE__ */ jsx("div", { className: "mt-3 h-1.5 w-full overflow-hidden rounded-full bg-slate-200/70 dark:bg-white/10", children: /* @__PURE__ */ jsx(
64
+ motion.div,
65
+ {
66
+ className: "h-full rounded-full bg-blue-600 dark:bg-blue-400",
67
+ initial: { width: 0 },
68
+ animate: { width: `${Math.max(0, Math.min(100, progressPct))}%` },
69
+ transition: springSm
56
70
  }
57
- ) }, s.key);
58
- }) })
71
+ ) })
72
+ ]
59
73
  }
60
74
  );
61
75
  }
@@ -33,6 +33,8 @@ __export(StorageUsage_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(StorageUsage_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
+ var import_framer_motion = require("framer-motion");
37
+ var import_animations = require("./animations");
36
38
  var import_Badge = __toESM(require("./Badge"));
37
39
  var import_InfoGrid = __toESM(require("./InfoGrid"));
38
40
  function cx(...a) {
@@ -75,13 +77,15 @@ function StorageUsage({
75
77
  ] })
76
78
  ] }),
77
79
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
- "div",
80
+ import_framer_motion.motion.div,
79
81
  {
80
82
  className: cx(
81
83
  "h-full bg-gradient-to-r from-sky-500/70 to-sky-500/20",
82
84
  barClassName
83
85
  ),
84
- style: { width: `${pct}%` }
86
+ initial: { width: 0 },
87
+ animate: { width: `${pct}%` },
88
+ transition: import_animations.springSm
85
89
  }
86
90
  ) }),
87
91
  showGrid && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1,5 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { motion } from "framer-motion";
4
+ import { springSm } from "./animations";
3
5
  import Badge from "./Badge";
4
6
  import InfoGrid from "./InfoGrid";
5
7
  function cx(...a) {
@@ -42,13 +44,15 @@ function StorageUsage({
42
44
  ] })
43
45
  ] }),
44
46
  /* @__PURE__ */ jsx("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ jsx(
45
- "div",
47
+ motion.div,
46
48
  {
47
49
  className: cx(
48
50
  "h-full bg-gradient-to-r from-sky-500/70 to-sky-500/20",
49
51
  barClassName
50
52
  ),
51
- style: { width: `${pct}%` }
53
+ initial: { width: 0 },
54
+ animate: { width: `${pct}%` },
55
+ transition: springSm
52
56
  }
53
57
  ) }),
54
58
  showGrid && /* @__PURE__ */ jsx(
package/dist/Table.d.mts CHANGED
@@ -27,5 +27,9 @@ declare function Td({ children, className, align, colSpan, }: {
27
27
  align?: "left" | "center" | "right";
28
28
  colSpan?: number;
29
29
  }): react_jsx_runtime.JSX.Element;
30
+ declare function AnimatedBody({ children, className }: {
31
+ children: React__default.ReactNode;
32
+ className?: string;
33
+ }): react_jsx_runtime.JSX.Element;
30
34
 
31
- export { SortTh, Td, Th };
35
+ export { AnimatedBody, SortTh, Td, Th };
package/dist/Table.d.ts CHANGED
@@ -27,5 +27,9 @@ declare function Td({ children, className, align, colSpan, }: {
27
27
  align?: "left" | "center" | "right";
28
28
  colSpan?: number;
29
29
  }): react_jsx_runtime.JSX.Element;
30
+ declare function AnimatedBody({ children, className }: {
31
+ children: React__default.ReactNode;
32
+ className?: string;
33
+ }): react_jsx_runtime.JSX.Element;
30
34
 
31
- export { SortTh, Td, Th };
35
+ export { AnimatedBody, SortTh, Td, Th };
package/dist/Table.js CHANGED
@@ -29,6 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
30
  var Table_exports = {};
31
31
  __export(Table_exports, {
32
+ AnimatedBody: () => AnimatedBody,
32
33
  SortTh: () => SortTh,
33
34
  Td: () => Td,
34
35
  Th: () => Th
@@ -36,6 +37,8 @@ __export(Table_exports, {
36
37
  module.exports = __toCommonJS(Table_exports);
37
38
  var import_jsx_runtime = require("react/jsx-runtime");
38
39
  var import_react = __toESM(require("react"));
40
+ var import_framer_motion = require("framer-motion");
41
+ var import_animations = require("./animations");
39
42
  var import_Button = __toESM(require("./Button"));
40
43
  function useMounted() {
41
44
  const [mounted, setMounted] = import_react.default.useState(false);
@@ -97,19 +100,31 @@ function SortTh({
97
100
  unstyled: true,
98
101
  type: "button",
99
102
  onClick,
100
- className: "group inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
103
+ className: "group relative inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
101
104
  children: [
102
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children }),
105
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "relative", children: [
106
+ children,
107
+ active && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
+ import_framer_motion.motion.span,
109
+ {
110
+ layoutId: "sort-underline",
111
+ className: "absolute -bottom-0.5 left-0 right-0 h-0.5 rounded-full bg-current opacity-70",
112
+ transition: import_animations.microTransition
113
+ }
114
+ )
115
+ ] }),
103
116
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
104
- "svg",
117
+ import_framer_motion.motion.svg,
105
118
  {
106
119
  suppressHydrationWarning: true,
107
120
  viewBox: "0 0 24 24",
108
- className: `h-4 w-4 transition ${active ? "opacity-80" : "opacity-30"} ${asc ? "" : "rotate-180"}`,
121
+ className: `h-4 w-4 ${active ? "" : "opacity-30"}`,
109
122
  fill: "none",
110
123
  stroke: "currentColor",
111
124
  strokeWidth: "2",
112
125
  "aria-hidden": "true",
126
+ animate: { rotate: asc ? 0 : 180, opacity: active ? 0.8 : 0.3 },
127
+ transition: import_animations.microTransition,
113
128
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7 14l5-5 5 5" })
114
129
  }
115
130
  )
@@ -147,8 +162,20 @@ function Td({
147
162
  }
148
163
  );
149
164
  }
165
+ function AnimatedBody({ children, className }) {
166
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
167
+ import_framer_motion.motion.tbody,
168
+ {
169
+ className,
170
+ initial: false,
171
+ transition: import_animations.microTransition,
172
+ children
173
+ }
174
+ );
175
+ }
150
176
  // Annotate the CommonJS export names for ESM import in node:
151
177
  0 && (module.exports = {
178
+ AnimatedBody,
152
179
  SortTh,
153
180
  Td,
154
181
  Th
package/dist/Table.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
+ import { motion } from "framer-motion";
5
+ import { microTransition } from "./animations";
4
6
  import Button from "./Button";
5
7
  function useMounted() {
6
8
  const [mounted, setMounted] = React.useState(false);
@@ -62,19 +64,31 @@ function SortTh({
62
64
  unstyled: true,
63
65
  type: "button",
64
66
  onClick,
65
- className: "group inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
67
+ className: "group relative inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
66
68
  children: [
67
- /* @__PURE__ */ jsx("span", { children }),
69
+ /* @__PURE__ */ jsxs("span", { className: "relative", children: [
70
+ children,
71
+ active && /* @__PURE__ */ jsx(
72
+ motion.span,
73
+ {
74
+ layoutId: "sort-underline",
75
+ className: "absolute -bottom-0.5 left-0 right-0 h-0.5 rounded-full bg-current opacity-70",
76
+ transition: microTransition
77
+ }
78
+ )
79
+ ] }),
68
80
  /* @__PURE__ */ jsx(
69
- "svg",
81
+ motion.svg,
70
82
  {
71
83
  suppressHydrationWarning: true,
72
84
  viewBox: "0 0 24 24",
73
- className: `h-4 w-4 transition ${active ? "opacity-80" : "opacity-30"} ${asc ? "" : "rotate-180"}`,
85
+ className: `h-4 w-4 ${active ? "" : "opacity-30"}`,
74
86
  fill: "none",
75
87
  stroke: "currentColor",
76
88
  strokeWidth: "2",
77
89
  "aria-hidden": "true",
90
+ animate: { rotate: asc ? 0 : 180, opacity: active ? 0.8 : 0.3 },
91
+ transition: microTransition,
78
92
  children: /* @__PURE__ */ jsx("path", { d: "M7 14l5-5 5 5" })
79
93
  }
80
94
  )
@@ -112,7 +126,19 @@ function Td({
112
126
  }
113
127
  );
114
128
  }
129
+ function AnimatedBody({ children, className }) {
130
+ return /* @__PURE__ */ jsx(
131
+ motion.tbody,
132
+ {
133
+ className,
134
+ initial: false,
135
+ transition: microTransition,
136
+ children
137
+ }
138
+ );
139
+ }
115
140
  export {
141
+ AnimatedBody,
116
142
  SortTh,
117
143
  Td,
118
144
  Th