framepexls-ui-lib 0.2.9 → 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 (81) 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/Breadcrumb.js +46 -2
  8. package/dist/Breadcrumb.mjs +46 -2
  9. package/dist/Button.js +8 -2
  10. package/dist/Button.mjs +8 -2
  11. package/dist/CalendarPanel.js +45 -26
  12. package/dist/CalendarPanel.mjs +45 -26
  13. package/dist/Card.js +7 -2
  14. package/dist/Card.mjs +7 -2
  15. package/dist/Checkbox.js +51 -18
  16. package/dist/Checkbox.mjs +51 -18
  17. package/dist/ColorPicker.js +9 -4
  18. package/dist/ColorPicker.mjs +9 -4
  19. package/dist/ComboSelect.js +10 -3
  20. package/dist/ComboSelect.mjs +10 -3
  21. package/dist/DateTimeField.js +7 -1
  22. package/dist/DateTimeField.mjs +7 -1
  23. package/dist/Dropdown.js +13 -9
  24. package/dist/Dropdown.mjs +13 -9
  25. package/dist/Input.js +23 -0
  26. package/dist/Input.mjs +23 -0
  27. package/dist/KpiCard.js +26 -2
  28. package/dist/KpiCard.mjs +26 -2
  29. package/dist/Link.js +16 -2
  30. package/dist/Link.mjs +16 -2
  31. package/dist/MediaCard.js +18 -11
  32. package/dist/MediaCard.mjs +18 -11
  33. package/dist/MediaSelector.js +9 -8
  34. package/dist/MediaSelector.mjs +9 -8
  35. package/dist/MotionProvider.d.mts +9 -0
  36. package/dist/MotionProvider.d.ts +9 -0
  37. package/dist/MotionProvider.js +29 -0
  38. package/dist/MotionProvider.mjs +9 -0
  39. package/dist/MultiComboSelect.js +6 -4
  40. package/dist/MultiComboSelect.mjs +6 -4
  41. package/dist/Pagination.js +65 -29
  42. package/dist/Pagination.mjs +65 -29
  43. package/dist/ReviewHistory.js +8 -6
  44. package/dist/ReviewHistory.mjs +8 -6
  45. package/dist/SearchInput.js +16 -2
  46. package/dist/SearchInput.mjs +16 -2
  47. package/dist/Select.js +10 -3
  48. package/dist/Select.mjs +10 -3
  49. package/dist/Sidebar.js +20 -2
  50. package/dist/Sidebar.mjs +20 -2
  51. package/dist/StatCard.js +17 -1
  52. package/dist/StatCard.mjs +19 -3
  53. package/dist/Steps.js +51 -37
  54. package/dist/Steps.mjs +51 -37
  55. package/dist/StorageUsage.js +6 -2
  56. package/dist/StorageUsage.mjs +6 -2
  57. package/dist/Table.d.mts +5 -1
  58. package/dist/Table.d.ts +5 -1
  59. package/dist/Table.js +31 -4
  60. package/dist/Table.mjs +30 -4
  61. package/dist/Textarea.js +42 -17
  62. package/dist/Textarea.mjs +43 -18
  63. package/dist/TimePopover.js +115 -82
  64. package/dist/TimePopover.mjs +115 -82
  65. package/dist/Toast.js +0 -4
  66. package/dist/Toast.mjs +0 -4
  67. package/dist/Tooltip.js +28 -19
  68. package/dist/Tooltip.mjs +28 -19
  69. package/dist/UploadCard.js +34 -21
  70. package/dist/UploadCard.mjs +34 -21
  71. package/dist/animations-CHrNeawW.d.mts +28 -0
  72. package/dist/animations-CHrNeawW.d.ts +28 -0
  73. package/dist/animations.d.mts +2 -0
  74. package/dist/animations.d.ts +2 -0
  75. package/dist/animations.js +75 -0
  76. package/dist/animations.mjs +42 -0
  77. package/dist/index.d.mts +4 -1
  78. package/dist/index.d.ts +4 -1
  79. package/dist/index.js +8 -0
  80. package/dist/index.mjs +18 -13
  81. package/package.json +1 -1
package/dist/KpiCard.js CHANGED
@@ -23,13 +23,37 @@ __export(KpiCard_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(KpiCard_exports);
25
25
  var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_react = require("react");
27
+ var import_framer_motion = require("framer-motion");
28
+ function MotionNumber({ value, format }) {
29
+ const mv = (0, import_framer_motion.useMotionValue)(value);
30
+ const [display, setDisplay] = (0, import_react.useState)(value);
31
+ (0, import_react.useEffect)(() => {
32
+ const controls = (0, import_framer_motion.animate)(mv, value, { duration: 0.5, ease: "easeOut" });
33
+ const unsub = mv.on("change", (v) => setDisplay(v));
34
+ return () => {
35
+ controls.stop();
36
+ unsub();
37
+ };
38
+ }, [value]);
39
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: format ? format(display) : Math.round(display).toLocaleString() });
40
+ }
26
41
  function KpiCard({ label, value, delta, help }) {
27
42
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "rounded-2xl border border-white/50 bg-white/75 p-4 text-slate-900/90 backdrop-blur-sm dark:border-white/10 dark:bg-white/10 dark:text-white", children: [
28
43
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between", children: [
29
44
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-slate-600 dark:text-white/80", children: label }),
30
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "rounded-full bg-blue-600/10 px-2 py-0.5 text-[12px] font-semibold text-blue-700 dark:bg-blue-500/15 dark:text-blue-200", children: delta })
45
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
46
+ import_framer_motion.motion.span,
47
+ {
48
+ initial: { opacity: 0, y: -4 },
49
+ animate: { opacity: 1, y: 0 },
50
+ transition: { duration: 0.2 },
51
+ className: "rounded-full bg-blue-600/10 px-2 py-0.5 text-[12px] font-semibold text-blue-700 dark:bg-blue-500/15 dark:text-blue-200",
52
+ children: delta
53
+ }
54
+ )
31
55
  ] }),
32
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-xl font-extrabold", children: value }),
56
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-xl font-extrabold", children: typeof value === "number" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MotionNumber, { value }) : value }),
33
57
  help && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-white/70", children: help })
34
58
  ] });
35
59
  }
package/dist/KpiCard.mjs CHANGED
@@ -1,12 +1,36 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { animate, useMotionValue, motion } from "framer-motion";
5
+ function MotionNumber({ value, format }) {
6
+ const mv = useMotionValue(value);
7
+ const [display, setDisplay] = useState(value);
8
+ useEffect(() => {
9
+ const controls = animate(mv, value, { duration: 0.5, ease: "easeOut" });
10
+ const unsub = mv.on("change", (v) => setDisplay(v));
11
+ return () => {
12
+ controls.stop();
13
+ unsub();
14
+ };
15
+ }, [value]);
16
+ return /* @__PURE__ */ jsx("span", { children: format ? format(display) : Math.round(display).toLocaleString() });
17
+ }
3
18
  function KpiCard({ label, value, delta, help }) {
4
19
  return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-white/50 bg-white/75 p-4 text-slate-900/90 backdrop-blur-sm dark:border-white/10 dark:bg-white/10 dark:text-white", children: [
5
20
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
6
21
  /* @__PURE__ */ jsx("span", { className: "text-slate-600 dark:text-white/80", children: label }),
7
- /* @__PURE__ */ jsx("span", { className: "rounded-full bg-blue-600/10 px-2 py-0.5 text-[12px] font-semibold text-blue-700 dark:bg-blue-500/15 dark:text-blue-200", children: delta })
22
+ /* @__PURE__ */ jsx(
23
+ motion.span,
24
+ {
25
+ initial: { opacity: 0, y: -4 },
26
+ animate: { opacity: 1, y: 0 },
27
+ transition: { duration: 0.2 },
28
+ className: "rounded-full bg-blue-600/10 px-2 py-0.5 text-[12px] font-semibold text-blue-700 dark:bg-blue-500/15 dark:text-blue-200",
29
+ children: delta
30
+ }
31
+ )
8
32
  ] }),
9
- /* @__PURE__ */ jsx("div", { className: "mt-1 text-xl font-extrabold", children: value }),
33
+ /* @__PURE__ */ jsx("div", { className: "mt-1 text-xl font-extrabold", children: typeof value === "number" ? /* @__PURE__ */ jsx(MotionNumber, { value }) : value }),
10
34
  help && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-white/70", children: help })
11
35
  ] });
12
36
  }
package/dist/Link.js CHANGED
@@ -33,6 +33,8 @@ __export(Link_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Link_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_link = __toESM(require("next/link"));
37
39
  function Link({
38
40
  href,
@@ -75,10 +77,22 @@ function Link({
75
77
  const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
76
78
  "span",
77
79
  {
78
- className: [base, sizeCls, COLORS[color], deco, className != null ? className : ""].join(" "),
80
+ className: [base, sizeCls, COLORS[color], className != null ? className : "", "relative group"].join(" "),
79
81
  ...rest,
80
82
  children: [
81
- children,
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: deco ? "" : "", children }),
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
85
+ import_framer_motion.motion.span,
86
+ {
87
+ layoutId: "link-underline",
88
+ className: `absolute left-0 right-0 -bottom-0.5 h-[2px] origin-left rounded-full ${underline === "none" ? "hidden" : ""} ${underline === "always" ? "opacity-100" : "opacity-0 group-hover:opacity-100"}`,
89
+ style: { backgroundColor: "currentColor" },
90
+ initial: { scaleX: underline === "always" ? 1 : 0 },
91
+ animate: { scaleX: underline === "always" ? 1 : 0 },
92
+ whileHover: underline === "hover" ? { scaleX: 1 } : void 0,
93
+ transition: import_animations.microTransition
94
+ }
95
+ ),
82
96
  showAnchorIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-[15px] w-[15px] opacity-80", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: [
83
97
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14 3h7v7" }),
84
98
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 14L21 3" }),
package/dist/Link.mjs CHANGED
@@ -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 { microTransition } from "./animations";
3
5
  import NextLink from "next/link";
4
6
  function Link({
5
7
  href,
@@ -42,10 +44,22 @@ function Link({
42
44
  const content = /* @__PURE__ */ jsxs(
43
45
  "span",
44
46
  {
45
- className: [base, sizeCls, COLORS[color], deco, className != null ? className : ""].join(" "),
47
+ className: [base, sizeCls, COLORS[color], className != null ? className : "", "relative group"].join(" "),
46
48
  ...rest,
47
49
  children: [
48
- children,
50
+ /* @__PURE__ */ jsx("span", { className: deco ? "" : "", children }),
51
+ /* @__PURE__ */ jsx(
52
+ motion.span,
53
+ {
54
+ layoutId: "link-underline",
55
+ className: `absolute left-0 right-0 -bottom-0.5 h-[2px] origin-left rounded-full ${underline === "none" ? "hidden" : ""} ${underline === "always" ? "opacity-100" : "opacity-0 group-hover:opacity-100"}`,
56
+ style: { backgroundColor: "currentColor" },
57
+ initial: { scaleX: underline === "always" ? 1 : 0 },
58
+ animate: { scaleX: underline === "always" ? 1 : 0 },
59
+ whileHover: underline === "hover" ? { scaleX: 1 } : void 0,
60
+ transition: microTransition
61
+ }
62
+ ),
49
63
  showAnchorIcon && /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-[15px] w-[15px] opacity-80", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": true, children: [
50
64
  /* @__PURE__ */ jsx("path", { d: "M14 3h7v7" }),
51
65
  /* @__PURE__ */ jsx("path", { d: "M10 14L21 3" }),
package/dist/MediaCard.js CHANGED
@@ -36,6 +36,8 @@ var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = require("react");
37
37
  var import_image = __toESM(require("next/image"));
38
38
  var import_ActionIconButton = __toESM(require("./ActionIconButton"));
39
+ var import_framer_motion = require("framer-motion");
40
+ var import_animations = require("./animations");
39
41
  function MediaCard({
40
42
  imageUrl,
41
43
  title,
@@ -57,23 +59,28 @@ function MediaCard({
57
59
  }
58
60
  };
59
61
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
60
- "div",
62
+ import_framer_motion.motion.div,
61
63
  {
64
+ whileHover: { y: -2 },
65
+ transition: import_animations.microTransition,
62
66
  className: [
63
67
  "group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5",
64
68
  className != null ? className : ""
65
69
  ].join(" "),
66
70
  children: [
67
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full bg-slate-100 relative", children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
68
- import_image.default,
69
- {
70
- src: imageUrl,
71
- alt: title,
72
- fill: true,
73
- sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
74
- className: "object-cover"
75
- }
76
- ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }) }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "aspect-square w-full bg-slate-100 relative", children: [
72
+ imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
73
+ import_image.default,
74
+ {
75
+ src: imageUrl,
76
+ alt: title,
77
+ fill: true,
78
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
79
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
80
+ }
81
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full w-full" }),
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
83
+ ] }),
77
84
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-2 p-2", children: [
78
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
79
86
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-sm font-medium", children: title }),
@@ -3,6 +3,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import Image from "next/image";
5
5
  import ActionIconButton from "./ActionIconButton";
6
+ import { motion } from "framer-motion";
7
+ import { microTransition } from "./animations";
6
8
  function MediaCard({
7
9
  imageUrl,
8
10
  title,
@@ -24,23 +26,28 @@ function MediaCard({
24
26
  }
25
27
  };
26
28
  return /* @__PURE__ */ jsxs(
27
- "div",
29
+ motion.div,
28
30
  {
31
+ whileHover: { y: -2 },
32
+ transition: microTransition,
29
33
  className: [
30
34
  "group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 shadow-sm ring-1 ring-black/5 backdrop-blur dark:border-white/10 dark:bg-white/5",
31
35
  className != null ? className : ""
32
36
  ].join(" "),
33
37
  children: [
34
- /* @__PURE__ */ jsx("div", { className: "aspect-square w-full bg-slate-100 relative", children: imageUrl ? /* @__PURE__ */ jsx(
35
- Image,
36
- {
37
- src: imageUrl,
38
- alt: title,
39
- fill: true,
40
- sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
41
- className: "object-cover"
42
- }
43
- ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }) }),
38
+ /* @__PURE__ */ jsxs("div", { className: "aspect-square w-full bg-slate-100 relative", children: [
39
+ imageUrl ? /* @__PURE__ */ jsx(
40
+ Image,
41
+ {
42
+ src: imageUrl,
43
+ alt: title,
44
+ fill: true,
45
+ sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
46
+ className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
47
+ }
48
+ ) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
49
+ /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/30 to-transparent opacity-0 transition-opacity duration-200 group-hover:opacity-100" })
50
+ ] }),
44
51
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-2", children: [
45
52
  /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
46
53
  /* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: title }),
@@ -39,6 +39,8 @@ var import_Button = __toESM(require("./Button"));
39
39
  var import_Input = __toESM(require("./Input"));
40
40
  var import_Dialog = __toESM(require("./Dialog"));
41
41
  var import_Pagination = __toESM(require("./Pagination"));
42
+ var import_framer_motion = require("framer-motion");
43
+ var import_animations = require("./animations");
42
44
  function MediaSelector({
43
45
  value,
44
46
  onChange,
@@ -126,7 +128,7 @@ function MediaSelector({
126
128
  progress,
127
129
  "%"
128
130
  ] }),
129
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-full bg-gradient-to-r from-emerald-500/70 to-emerald-500/20", style: { width: `${progress}%` } }) })
131
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { className: "h-full bg-gradient-to-r from-emerald-500/70 to-emerald-500/20", initial: { width: 0 }, animate: { width: `${progress}%` }, transition: import_animations.springSm }) })
130
132
  ] })
131
133
  ]
132
134
  }
@@ -193,9 +195,9 @@ function MediaSelector({
193
195
  ] }),
194
196
  lastPage > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Pagination.default, { page, totalPages: lastPage, onPageChange: setPage })
195
197
  ] }),
196
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4", children: items.map((m) => {
198
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { initial: false, children: items.map((m) => {
197
199
  var _a;
198
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
200
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { layout: true, initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 8 }, transition: import_animations.springSm, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
199
201
  import_Button.default,
200
202
  {
201
203
  unstyled: true,
@@ -207,13 +209,12 @@ function MediaSelector({
207
209
  onClose == null ? void 0 : onClose();
208
210
  },
209
211
  children: [
210
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full overflow-hidden rounded-xl bg-slate-100", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: (_a = m.url) != null ? _a : "", alt: m.nombre, className: "h-full w-full object-cover transition group-hover:scale-[1.01]" }) }),
212
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "aspect-square w-full overflow-hidden rounded-xl bg-slate-100", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", { src: (_a = m.url) != null ? _a : "", alt: m.nombre, className: "h-full w-full object-cover transition group-hover:scale-105" }) }),
211
213
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate p-1 text-xs", children: m.nombre })
212
214
  ]
213
- },
214
- m.id
215
- );
216
- }) })
215
+ }
216
+ ) }, m.id);
217
+ }) }) })
217
218
  ] })
218
219
  ] }) }),
219
220
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dialog.default.Footer, { align: "end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, { variant: "secondary", onClick: () => {
@@ -6,6 +6,8 @@ import Button from "./Button";
6
6
  import Input from "./Input";
7
7
  import Dialog from "./Dialog";
8
8
  import Pagination from "./Pagination";
9
+ import { AnimatePresence, motion } from "framer-motion";
10
+ import { springSm } from "./animations";
9
11
  function MediaSelector({
10
12
  value,
11
13
  onChange,
@@ -93,7 +95,7 @@ function MediaSelector({
93
95
  progress,
94
96
  "%"
95
97
  ] }),
96
- /* @__PURE__ */ jsx("div", { className: "h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ jsx("div", { className: "h-full bg-gradient-to-r from-emerald-500/70 to-emerald-500/20", style: { width: `${progress}%` } }) })
98
+ /* @__PURE__ */ jsx("div", { className: "h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ jsx(motion.div, { className: "h-full bg-gradient-to-r from-emerald-500/70 to-emerald-500/20", initial: { width: 0 }, animate: { width: `${progress}%` }, transition: springSm }) })
97
99
  ] })
98
100
  ]
99
101
  }
@@ -160,9 +162,9 @@ function MediaSelector({
160
162
  ] }),
161
163
  lastPage > 1 && /* @__PURE__ */ jsx(Pagination, { page, totalPages: lastPage, onPageChange: setPage })
162
164
  ] }),
163
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4", children: items.map((m) => {
165
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4", children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: items.map((m) => {
164
166
  var _a;
165
- return /* @__PURE__ */ jsxs(
167
+ return /* @__PURE__ */ jsx(motion.div, { layout: true, initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 8 }, transition: springSm, children: /* @__PURE__ */ jsxs(
166
168
  Button,
167
169
  {
168
170
  unstyled: true,
@@ -174,13 +176,12 @@ function MediaSelector({
174
176
  onClose == null ? void 0 : onClose();
175
177
  },
176
178
  children: [
177
- /* @__PURE__ */ jsx("div", { className: "aspect-square w-full overflow-hidden rounded-xl bg-slate-100", children: /* @__PURE__ */ jsx("img", { src: (_a = m.url) != null ? _a : "", alt: m.nombre, className: "h-full w-full object-cover transition group-hover:scale-[1.01]" }) }),
179
+ /* @__PURE__ */ jsx("div", { className: "aspect-square w-full overflow-hidden rounded-xl bg-slate-100", children: /* @__PURE__ */ jsx("img", { src: (_a = m.url) != null ? _a : "", alt: m.nombre, className: "h-full w-full object-cover transition group-hover:scale-105" }) }),
178
180
  /* @__PURE__ */ jsx("div", { className: "truncate p-1 text-xs", children: m.nombre })
179
181
  ]
180
- },
181
- m.id
182
- );
183
- }) })
182
+ }
183
+ ) }, m.id);
184
+ }) }) })
184
185
  ] })
185
186
  ] }) }),
186
187
  /* @__PURE__ */ jsx(Dialog.Footer, { align: "end", children: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => {
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ declare function MotionProvider({ children, reducedMotion }: {
5
+ children: React__default.ReactNode;
6
+ reducedMotion?: "user" | "always" | "never";
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { MotionProvider as default };
@@ -0,0 +1,9 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+
4
+ declare function MotionProvider({ children, reducedMotion }: {
5
+ children: React__default.ReactNode;
6
+ reducedMotion?: "user" | "always" | "never";
7
+ }): react_jsx_runtime.JSX.Element;
8
+
9
+ export { MotionProvider as default };
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ "use client";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var MotionProvider_exports = {};
21
+ __export(MotionProvider_exports, {
22
+ default: () => MotionProvider
23
+ });
24
+ module.exports = __toCommonJS(MotionProvider_exports);
25
+ var import_jsx_runtime = require("react/jsx-runtime");
26
+ var import_framer_motion = require("framer-motion");
27
+ function MotionProvider({ children, reducedMotion = "user" }) {
28
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.MotionConfig, { reducedMotion, children });
29
+ }
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { MotionConfig } from "framer-motion";
4
+ function MotionProvider({ children, reducedMotion = "user" }) {
5
+ return /* @__PURE__ */ jsx(MotionConfig, { reducedMotion, children });
6
+ }
7
+ export {
8
+ MotionProvider as default
9
+ };
@@ -38,6 +38,8 @@ var import_ComboSelect = __toESM(require("./ComboSelect"));
38
38
  var import_Dialog = __toESM(require("./Dialog"));
39
39
  var import_Button = __toESM(require("./Button"));
40
40
  var import_Badge = __toESM(require("./Badge"));
41
+ var import_framer_motion = require("framer-motion");
42
+ var import_animations = require("./animations");
41
43
  function MultiComboSelect({
42
44
  options,
43
45
  value,
@@ -93,12 +95,12 @@ function MultiComboSelect({
93
95
  }
94
96
  }
95
97
  ),
96
- value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
97
- value.slice(0, Math.max(0, maxVisibleTags)).map((v) => {
98
+ value.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_framer_motion.motion.div, { className: "mt-2 flex flex-wrap gap-1.5", layout: true, children: [
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { initial: false, children: value.slice(0, Math.max(0, maxVisibleTags)).map((v) => {
98
100
  const opt = options.find((o) => o.value === v);
99
101
  if (!opt) return null;
100
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.default, { tone: "slate", size: "sm", onClick: () => toggle(v), title: "Quitar", children: opt.label }, v);
101
- }),
102
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { layout: true, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: import_animations.springSm, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.default, { tone: "slate", size: "sm", onClick: () => toggle(v), title: "Quitar", children: opt.label }) }, v);
103
+ }) }),
102
104
  enableDialog && value.length > maxVisibleTags && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
103
105
  import_Button.default,
104
106
  {
@@ -5,6 +5,8 @@ import ComboSelect from "./ComboSelect";
5
5
  import Dialog from "./Dialog";
6
6
  import Button from "./Button";
7
7
  import Badge from "./Badge";
8
+ import { AnimatePresence, motion } from "framer-motion";
9
+ import { springSm } from "./animations";
8
10
  function MultiComboSelect({
9
11
  options,
10
12
  value,
@@ -60,12 +62,12 @@ function MultiComboSelect({
60
62
  }
61
63
  }
62
64
  ),
63
- value.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
64
- value.slice(0, Math.max(0, maxVisibleTags)).map((v) => {
65
+ value.length > 0 && /* @__PURE__ */ jsxs(motion.div, { className: "mt-2 flex flex-wrap gap-1.5", layout: true, children: [
66
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: value.slice(0, Math.max(0, maxVisibleTags)).map((v) => {
65
67
  const opt = options.find((o) => o.value === v);
66
68
  if (!opt) return null;
67
- return /* @__PURE__ */ jsx(Badge, { tone: "slate", size: "sm", onClick: () => toggle(v), title: "Quitar", children: opt.label }, v);
68
- }),
69
+ return /* @__PURE__ */ jsx(motion.div, { layout: true, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: springSm, children: /* @__PURE__ */ jsx(Badge, { tone: "slate", size: "sm", onClick: () => toggle(v), title: "Quitar", children: opt.label }) }, v);
70
+ }) }),
69
71
  enableDialog && value.length > maxVisibleTags && /* @__PURE__ */ jsxs(
70
72
  Button,
71
73
  {
@@ -33,6 +33,8 @@ __export(Pagination_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Pagination_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_Button = __toESM(require("./Button"));
37
39
  function Pagination({
38
40
  page,
@@ -56,53 +58,87 @@ function Pagination({
56
58
  return range2;
57
59
  };
58
60
  const range = getRange();
59
- const ACTIVE = {
60
- slate: "bg-slate-600 text-white",
61
- gray: "bg-gray-600 text-white",
62
- zinc: "bg-zinc-600 text-white",
63
- neutral: "bg-neutral-600 text-white",
64
- stone: "bg-stone-600 text-white",
65
- red: "bg-red-600 text-white",
66
- orange: "bg-orange-600 text-white",
67
- amber: "bg-amber-600 text-white",
68
- yellow: "bg-yellow-500 text-slate-900",
69
- lime: "bg-lime-600 text-white",
70
- green: "bg-green-600 text-white",
71
- emerald: "bg-emerald-600 text-white",
72
- teal: "bg-teal-600 text-white",
73
- cyan: "bg-cyan-600 text-white",
74
- sky: "bg-sky-600 text-white",
75
- blue: "bg-blue-600 text-white",
76
- indigo: "bg-indigo-600 text-white",
77
- violet: "bg-violet-600 text-white",
78
- purple: "bg-purple-600 text-white",
79
- fuchsia: "bg-fuchsia-600 text-white",
80
- pink: "bg-pink-600 text-white",
81
- rose: "bg-rose-600 text-white"
61
+ const PILL_BG = {
62
+ slate: "bg-slate-600",
63
+ gray: "bg-gray-600",
64
+ zinc: "bg-zinc-600",
65
+ neutral: "bg-neutral-600",
66
+ stone: "bg-stone-600",
67
+ red: "bg-red-600",
68
+ orange: "bg-orange-600",
69
+ amber: "bg-amber-600",
70
+ yellow: "bg-yellow-500",
71
+ lime: "bg-lime-600",
72
+ green: "bg-green-600",
73
+ emerald: "bg-emerald-600",
74
+ teal: "bg-teal-600",
75
+ cyan: "bg-cyan-600",
76
+ sky: "bg-sky-600",
77
+ blue: "bg-blue-600",
78
+ indigo: "bg-indigo-600",
79
+ violet: "bg-violet-600",
80
+ purple: "bg-purple-600",
81
+ fuchsia: "bg-fuchsia-600",
82
+ pink: "bg-pink-600",
83
+ rose: "bg-rose-600"
84
+ };
85
+ const ACTIVE_TEXT = {
86
+ slate: "text-white",
87
+ gray: "text-white",
88
+ zinc: "text-white",
89
+ neutral: "text-white",
90
+ stone: "text-white",
91
+ red: "text-white",
92
+ orange: "text-white",
93
+ amber: "text-white",
94
+ yellow: "text-slate-900",
95
+ lime: "text-white",
96
+ green: "text-white",
97
+ emerald: "text-white",
98
+ teal: "text-white",
99
+ cyan: "text-white",
100
+ sky: "text-white",
101
+ blue: "text-white",
102
+ indigo: "text-white",
103
+ violet: "text-white",
104
+ purple: "text-white",
105
+ fuchsia: "text-white",
106
+ pink: "text-white",
107
+ rose: "text-white"
82
108
  };
83
109
  const Btn = ({
84
110
  children,
85
111
  active,
86
112
  disabled,
87
113
  onClick
88
- }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
89
115
  import_Button.default,
90
116
  {
91
117
  unstyled: true,
92
118
  disabled,
93
119
  onClick,
94
- className: `h-10 min-w-10 px-3 inline-flex items-center justify-center text-[15px] font-medium transition
95
- ${active ? `${ACTIVE[color]} rounded-2xl shadow-sm` : "rounded-none text-slate-900 hover:bg-white/60"}
120
+ className: `relative h-10 min-w-10 px-3 inline-flex items-center justify-center text-[15px] font-medium transition
121
+ ${active ? `${ACTIVE_TEXT[color]}` : "text-slate-900 hover:bg-white/60"}
96
122
  ${disabled ? "opacity-40 cursor-not-allowed" : ""}`,
97
123
  "aria-current": active ? "page" : void 0,
98
- children
124
+ children: [
125
+ active && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
126
+ import_framer_motion.motion.span,
127
+ {
128
+ layoutId: "pagination-pill",
129
+ transition: import_animations.springSm,
130
+ className: `absolute inset-0 rounded-2xl ${PILL_BG[color]} shadow-sm`
131
+ }
132
+ ),
133
+ children
134
+ ]
99
135
  }
100
136
  );
101
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-white/5", children: [
137
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.LayoutGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-white/5", children: [
102
138
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === 1, onClick: () => onPageChange(page - 1), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 18l-6-6 6-6" }) }) }),
103
139
  range.map(
104
140
  (it, idx) => it === "..." ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "h-10 min-w-10 px-3 inline-flex items-center justify-center text-slate-500 dark:text-slate-400", children: "\u2026" }, `dots-${idx}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { active: it === page, onClick: () => onPageChange(it), children: it }, it)
105
141
  ),
106
142
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === totalPages, onClick: () => onPageChange(page + 1), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 6l6 6-6 6" }) }) })
107
- ] }) });
143
+ ] }) }) });
108
144
  }