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/Checkbox.js CHANGED
@@ -34,10 +34,11 @@ __export(Checkbox_exports, {
34
34
  module.exports = __toCommonJS(Checkbox_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = __toESM(require("react"));
37
+ var import_framer_motion = require("framer-motion");
37
38
  function cx(...a) {
38
39
  return a.filter(Boolean).join(" ");
39
40
  }
40
- const baseInput = "rounded border border-slate-300 text-blue-600 shadow-sm outline-none focus:ring-4 focus:ring-blue-300/40 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10";
41
+ const baseInput = "appearance-none grid place-items-center rounded border border-slate-300 bg-white shadow-sm outline-none focus:ring-4 focus:ring-blue-300/40 checked:bg-blue-600 checked:border-blue-600 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:checked:bg-blue-500 dark:checked:border-blue-500";
41
42
  const sizeMap = {
42
43
  sm: "h-4 w-4",
43
44
  md: "h-5 w-5",
@@ -59,6 +60,11 @@ const Checkbox = import_react.default.forwardRef(
59
60
  }, ref) => {
60
61
  const internalId = (0, import_react.useId)();
61
62
  const inputRef = (0, import_react.useRef)(null);
63
+ const [animChecked, setAnimChecked] = import_react.default.useState(() => {
64
+ var _a, _b;
65
+ const p = props;
66
+ return Boolean((_b = (_a = p.checked) != null ? _a : p.defaultChecked) != null ? _b : false);
67
+ });
62
68
  (0, import_react.useEffect)(() => {
63
69
  if (!ref) return;
64
70
  if (typeof ref === "function") ref(inputRef.current);
@@ -67,28 +73,55 @@ const Checkbox = import_react.default.forwardRef(
67
73
  (0, import_react.useEffect)(() => {
68
74
  if (inputRef.current) inputRef.current.indeterminate = !!indeterminate;
69
75
  }, [indeterminate]);
76
+ (0, import_react.useEffect)(() => {
77
+ var _a;
78
+ setAnimChecked(Boolean((_a = inputRef.current) == null ? void 0 : _a.checked));
79
+ }, []);
80
+ (0, import_react.useEffect)(() => {
81
+ if (Object.prototype.hasOwnProperty.call(props, "checked")) {
82
+ setAnimChecked(Boolean(props.checked));
83
+ }
84
+ }, [props.checked]);
70
85
  if (unstyled) {
71
86
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { ref: inputRef, id, type: "checkbox", ...props });
72
87
  }
73
88
  const descId = description ? `${id != null ? id : internalId}-desc` : void 0;
74
89
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: cx("inline-flex select-none items-start gap-2", className), children: [
75
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
- "input",
77
- {
78
- ref: inputRef,
79
- id: id != null ? id : internalId,
80
- type: "checkbox",
81
- "aria-invalid": error ? true : void 0,
82
- "aria-describedby": descId,
83
- className: cx(
84
- baseInput,
85
- sizeMap[size],
86
- (error || tone === "danger") && "border-blue-400 focus:ring-blue-500/30",
87
- inputClassName
88
- ),
89
- ...props
90
- }
91
- ),
90
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "relative inline-grid place-items-center", children: [
91
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
92
+ "input",
93
+ {
94
+ ref: inputRef,
95
+ id: id != null ? id : internalId,
96
+ type: "checkbox",
97
+ "aria-invalid": error ? true : void 0,
98
+ "aria-describedby": descId,
99
+ className: cx(
100
+ baseInput,
101
+ sizeMap[size],
102
+ (error || tone === "danger") && "border-blue-400 focus:ring-blue-500/30",
103
+ inputClassName
104
+ ),
105
+ onChange: (e) => {
106
+ var _a;
107
+ setAnimChecked(e.currentTarget.checked || !!indeterminate);
108
+ (_a = props.onChange) == null ? void 0 : _a.call(props, e);
109
+ },
110
+ ...props
111
+ }
112
+ ),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
+ import_framer_motion.motion.svg,
115
+ {
116
+ viewBox: "0 0 24 24",
117
+ className: cx("pointer-events-none absolute", size === "sm" ? "h-4 w-4" : size === "lg" ? "h-6 w-6" : "h-5 w-5"),
118
+ initial: { pathLength: 0, opacity: 0 },
119
+ animate: { pathLength: animChecked || !!indeterminate ? 1 : 0, opacity: animChecked || !!indeterminate ? 1 : 0 },
120
+ transition: { duration: 0.18, ease: "easeOut" },
121
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.path, { d: "M5 12l4 4L19 7", stroke: "white", strokeWidth: 2.5, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" })
122
+ }
123
+ )
124
+ ] }),
92
125
  (label || description) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "leading-tight", children: [
93
126
  label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-sm text-slate-700 dark:text-slate-200", children: label }),
94
127
  description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: descId, className: "text-[12px] text-slate-500 dark:text-slate-400", children: description })
package/dist/Checkbox.mjs CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import React, { useEffect, useId, useRef } from "react";
4
+ import { motion } from "framer-motion";
4
5
  function cx(...a) {
5
6
  return a.filter(Boolean).join(" ");
6
7
  }
7
- const baseInput = "rounded border border-slate-300 text-blue-600 shadow-sm outline-none focus:ring-4 focus:ring-blue-300/40 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10";
8
+ const baseInput = "appearance-none grid place-items-center rounded border border-slate-300 bg-white shadow-sm outline-none focus:ring-4 focus:ring-blue-300/40 checked:bg-blue-600 checked:border-blue-600 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:checked:bg-blue-500 dark:checked:border-blue-500";
8
9
  const sizeMap = {
9
10
  sm: "h-4 w-4",
10
11
  md: "h-5 w-5",
@@ -26,6 +27,11 @@ const Checkbox = React.forwardRef(
26
27
  }, ref) => {
27
28
  const internalId = useId();
28
29
  const inputRef = useRef(null);
30
+ const [animChecked, setAnimChecked] = React.useState(() => {
31
+ var _a, _b;
32
+ const p = props;
33
+ return Boolean((_b = (_a = p.checked) != null ? _a : p.defaultChecked) != null ? _b : false);
34
+ });
29
35
  useEffect(() => {
30
36
  if (!ref) return;
31
37
  if (typeof ref === "function") ref(inputRef.current);
@@ -34,28 +40,55 @@ const Checkbox = React.forwardRef(
34
40
  useEffect(() => {
35
41
  if (inputRef.current) inputRef.current.indeterminate = !!indeterminate;
36
42
  }, [indeterminate]);
43
+ useEffect(() => {
44
+ var _a;
45
+ setAnimChecked(Boolean((_a = inputRef.current) == null ? void 0 : _a.checked));
46
+ }, []);
47
+ useEffect(() => {
48
+ if (Object.prototype.hasOwnProperty.call(props, "checked")) {
49
+ setAnimChecked(Boolean(props.checked));
50
+ }
51
+ }, [props.checked]);
37
52
  if (unstyled) {
38
53
  return /* @__PURE__ */ jsx("input", { ref: inputRef, id, type: "checkbox", ...props });
39
54
  }
40
55
  const descId = description ? `${id != null ? id : internalId}-desc` : void 0;
41
56
  return /* @__PURE__ */ jsxs("label", { className: cx("inline-flex select-none items-start gap-2", className), children: [
42
- /* @__PURE__ */ jsx(
43
- "input",
44
- {
45
- ref: inputRef,
46
- id: id != null ? id : internalId,
47
- type: "checkbox",
48
- "aria-invalid": error ? true : void 0,
49
- "aria-describedby": descId,
50
- className: cx(
51
- baseInput,
52
- sizeMap[size],
53
- (error || tone === "danger") && "border-blue-400 focus:ring-blue-500/30",
54
- inputClassName
55
- ),
56
- ...props
57
- }
58
- ),
57
+ /* @__PURE__ */ jsxs("span", { className: "relative inline-grid place-items-center", children: [
58
+ /* @__PURE__ */ jsx(
59
+ "input",
60
+ {
61
+ ref: inputRef,
62
+ id: id != null ? id : internalId,
63
+ type: "checkbox",
64
+ "aria-invalid": error ? true : void 0,
65
+ "aria-describedby": descId,
66
+ className: cx(
67
+ baseInput,
68
+ sizeMap[size],
69
+ (error || tone === "danger") && "border-blue-400 focus:ring-blue-500/30",
70
+ inputClassName
71
+ ),
72
+ onChange: (e) => {
73
+ var _a;
74
+ setAnimChecked(e.currentTarget.checked || !!indeterminate);
75
+ (_a = props.onChange) == null ? void 0 : _a.call(props, e);
76
+ },
77
+ ...props
78
+ }
79
+ ),
80
+ /* @__PURE__ */ jsx(
81
+ motion.svg,
82
+ {
83
+ viewBox: "0 0 24 24",
84
+ className: cx("pointer-events-none absolute", size === "sm" ? "h-4 w-4" : size === "lg" ? "h-6 w-6" : "h-5 w-5"),
85
+ initial: { pathLength: 0, opacity: 0 },
86
+ animate: { pathLength: animChecked || !!indeterminate ? 1 : 0, opacity: animChecked || !!indeterminate ? 1 : 0 },
87
+ transition: { duration: 0.18, ease: "easeOut" },
88
+ children: /* @__PURE__ */ jsx(motion.path, { d: "M5 12l4 4L19 7", stroke: "white", strokeWidth: 2.5, fill: "none", strokeLinecap: "round", strokeLinejoin: "round" })
89
+ }
90
+ )
91
+ ] }),
59
92
  (label || description) && /* @__PURE__ */ jsxs("span", { className: "leading-tight", children: [
60
93
  label && /* @__PURE__ */ jsx("span", { className: "text-sm text-slate-700 dark:text-slate-200", children: label }),
61
94
  description && /* @__PURE__ */ jsx("div", { id: descId, className: "text-[12px] text-slate-500 dark:text-slate-400", children: description })
@@ -37,6 +37,8 @@ var import_react = __toESM(require("react"));
37
37
  var import_Input = __toESM(require("./Input"));
38
38
  var import_Button = __toESM(require("./Button"));
39
39
  var import_Dialog = __toESM(require("./Dialog"));
40
+ var import_framer_motion = require("framer-motion");
41
+ var import_animations = require("./animations");
40
42
  function clamp(v, min = 0, max = 255) {
41
43
  return Math.max(min, Math.min(max, v));
42
44
  }
@@ -127,13 +129,16 @@ function ColorPicker({ value, onChange, presets = DEFAULTS, className, label })
127
129
  };
128
130
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className, children: [
129
131
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
- "button",
132
+ import_framer_motion.motion.button,
131
133
  {
132
134
  type: "button",
133
135
  onClick: () => setOpen(true),
134
136
  title: hex,
135
- className: "h-9 w-9 rounded-xl border border-slate-300 shadow-sm outline-none ring-0 transition hover:scale-105 active:scale-95 dark:border-white/10",
136
- style: { backgroundColor: hex }
137
+ className: "h-9 w-9 rounded-xl border border-slate-300 shadow-sm outline-none ring-0 transition dark:border-white/10",
138
+ style: { backgroundColor: hex },
139
+ whileHover: { scale: 1.05 },
140
+ whileTap: { scale: 0.96 },
141
+ transition: import_animations.microTransition
137
142
  }
138
143
  ),
139
144
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Dialog.default, { open, onClose: () => setOpen(false), size: "md", children: [
@@ -146,7 +151,7 @@ function ColorPicker({ value, onChange, presets = DEFAULTS, className, label })
146
151
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Input.default, { placeholder: "r, g, b", value: rgb, onChange: (e) => setRgb(e.target.value), onBlur: () => commitRgb(rgb) })
147
152
  ] })
148
153
  ] }),
149
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 grid grid-cols-9 gap-1", children: presets.map((c) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", title: c, className: "h-7 w-7 rounded-lg border border-slate-300 shadow-sm transition hover:scale-105 active:scale-95 dark:border-white/10", style: { backgroundColor: c }, onClick: () => setHex(c) }, c)) })
154
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 grid grid-cols-9 gap-1", children: presets.map((c) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.button, { type: "button", title: c, className: "h-7 w-7 rounded-lg border border-slate-300 shadow-sm dark:border-white/10", style: { backgroundColor: c }, onClick: () => setHex(c), whileHover: { scale: 1.07 }, whileTap: { scale: 0.96 }, transition: import_animations.microTransition }, c)) })
150
155
  ] }),
151
156
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Dialog.default.Footer, { align: "end", children: [
152
157
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.default, { variant: "secondary", onClick: () => setOpen(false), children: "Cancelar" }),
@@ -4,6 +4,8 @@ import React from "react";
4
4
  import Input from "./Input";
5
5
  import Button from "./Button";
6
6
  import Dialog from "./Dialog";
7
+ import { motion } from "framer-motion";
8
+ import { microTransition } from "./animations";
7
9
  function clamp(v, min = 0, max = 255) {
8
10
  return Math.max(min, Math.min(max, v));
9
11
  }
@@ -94,13 +96,16 @@ function ColorPicker({ value, onChange, presets = DEFAULTS, className, label })
94
96
  };
95
97
  return /* @__PURE__ */ jsxs("div", { className, children: [
96
98
  /* @__PURE__ */ jsx(
97
- "button",
99
+ motion.button,
98
100
  {
99
101
  type: "button",
100
102
  onClick: () => setOpen(true),
101
103
  title: hex,
102
- className: "h-9 w-9 rounded-xl border border-slate-300 shadow-sm outline-none ring-0 transition hover:scale-105 active:scale-95 dark:border-white/10",
103
- style: { backgroundColor: hex }
104
+ className: "h-9 w-9 rounded-xl border border-slate-300 shadow-sm outline-none ring-0 transition dark:border-white/10",
105
+ style: { backgroundColor: hex },
106
+ whileHover: { scale: 1.05 },
107
+ whileTap: { scale: 0.96 },
108
+ transition: microTransition
104
109
  }
105
110
  ),
106
111
  /* @__PURE__ */ jsxs(Dialog, { open, onClose: () => setOpen(false), size: "md", children: [
@@ -113,7 +118,7 @@ function ColorPicker({ value, onChange, presets = DEFAULTS, className, label })
113
118
  /* @__PURE__ */ jsx(Input, { placeholder: "r, g, b", value: rgb, onChange: (e) => setRgb(e.target.value), onBlur: () => commitRgb(rgb) })
114
119
  ] })
115
120
  ] }),
116
- /* @__PURE__ */ jsx("div", { className: "mt-3 grid grid-cols-9 gap-1", children: presets.map((c) => /* @__PURE__ */ jsx("button", { type: "button", title: c, className: "h-7 w-7 rounded-lg border border-slate-300 shadow-sm transition hover:scale-105 active:scale-95 dark:border-white/10", style: { backgroundColor: c }, onClick: () => setHex(c) }, c)) })
121
+ /* @__PURE__ */ jsx("div", { className: "mt-3 grid grid-cols-9 gap-1", children: presets.map((c) => /* @__PURE__ */ jsx(motion.button, { type: "button", title: c, className: "h-7 w-7 rounded-lg border border-slate-300 shadow-sm dark:border-white/10", style: { backgroundColor: c }, onClick: () => setHex(c), whileHover: { scale: 1.07 }, whileTap: { scale: 0.96 }, transition: microTransition }, c)) })
117
122
  ] }),
118
123
  /* @__PURE__ */ jsxs(Dialog.Footer, { align: "end", children: [
119
124
  /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: () => setOpen(false), children: "Cancelar" }),
@@ -38,6 +38,8 @@ var import_react_dom = require("react-dom");
38
38
  var import_AvatarSquare = __toESM(require("./AvatarSquare"));
39
39
  var import_Input = __toESM(require("./Input"));
40
40
  var import_Button = __toESM(require("./Button"));
41
+ var import_framer_motion = require("framer-motion");
42
+ var import_animations = require("./animations");
41
43
  const cx = (...a) => a.filter(Boolean).join(" ");
42
44
  const controlShell = "relative w-full rounded-2xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 shadow-sm outline-none transition focus-within:ring-4 focus-within:ring-slate-900/5 focus-within:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:text-slate-100 dark:placeholder:text-slate-400 dark:focus-within:ring-white/10";
43
45
  const isFocusableOrInteractive = (el) => {
@@ -278,7 +280,7 @@ function ComboSelect({
278
280
  ]
279
281
  }
280
282
  );
281
- const dropdown = open && dropStyle ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
283
+ const dropdown = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { children: open && dropStyle ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
282
284
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
283
285
  "div",
284
286
  {
@@ -295,12 +297,17 @@ function ComboSelect({
295
297
  }
296
298
  ),
297
299
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
298
- "div",
300
+ import_framer_motion.motion.div,
299
301
  {
300
302
  ref: dropRef,
301
303
  role: "listbox",
302
304
  id: listId,
303
305
  style: dropStyle,
306
+ variants: import_animations.popOver,
307
+ initial: "initial",
308
+ animate: "animate",
309
+ exit: "exit",
310
+ transition: import_animations.menuTransition,
304
311
  className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
305
312
  children: filteredRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-3 py-2 text-sm text-slate-500 dark:text-slate-400", children: noResultsText }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "max-h-[inherit] overflow-auto py-1 text-sm", children: filteredRows.map((row, i) => {
306
313
  if (row.kind === "section") {
@@ -348,7 +355,7 @@ function ComboSelect({
348
355
  }) })
349
356
  }
350
357
  )
351
- ] }) : null;
358
+ ] }) : null });
352
359
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
353
360
  "div",
354
361
  {
@@ -5,6 +5,8 @@ import { createPortal } from "react-dom";
5
5
  import AvatarSquare from "./AvatarSquare";
6
6
  import Input from "./Input";
7
7
  import Button from "./Button";
8
+ import { AnimatePresence, motion } from "framer-motion";
9
+ import { popOver, menuTransition } from "./animations";
8
10
  const cx = (...a) => a.filter(Boolean).join(" ");
9
11
  const controlShell = "relative w-full rounded-2xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 shadow-sm outline-none transition focus-within:ring-4 focus-within:ring-slate-900/5 focus-within:border-slate-300 disabled:opacity-60 disabled:cursor-not-allowed dark:border-white/10 dark:bg-white/10 dark:text-slate-100 dark:placeholder:text-slate-400 dark:focus-within:ring-white/10";
10
12
  const isFocusableOrInteractive = (el) => {
@@ -245,7 +247,7 @@ function ComboSelect({
245
247
  ]
246
248
  }
247
249
  );
248
- const dropdown = open && dropStyle ? /* @__PURE__ */ jsxs(Fragment, { children: [
250
+ const dropdown = /* @__PURE__ */ jsx(AnimatePresence, { children: open && dropStyle ? /* @__PURE__ */ jsxs(Fragment, { children: [
249
251
  /* @__PURE__ */ jsx(
250
252
  "div",
251
253
  {
@@ -262,12 +264,17 @@ function ComboSelect({
262
264
  }
263
265
  ),
264
266
  /* @__PURE__ */ jsx(
265
- "div",
267
+ motion.div,
266
268
  {
267
269
  ref: dropRef,
268
270
  role: "listbox",
269
271
  id: listId,
270
272
  style: dropStyle,
273
+ variants: popOver,
274
+ initial: "initial",
275
+ animate: "animate",
276
+ exit: "exit",
277
+ transition: menuTransition,
271
278
  className: "overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
272
279
  children: filteredRows.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-sm text-slate-500 dark:text-slate-400", children: noResultsText }) : /* @__PURE__ */ jsx("ul", { className: "max-h-[inherit] overflow-auto py-1 text-sm", children: filteredRows.map((row, i) => {
273
280
  if (row.kind === "section") {
@@ -315,7 +322,7 @@ function ComboSelect({
315
322
  }) })
316
323
  }
317
324
  )
318
- ] }) : null;
325
+ ] }) : null });
319
326
  return /* @__PURE__ */ jsxs(
320
327
  "div",
321
328
  {
@@ -39,6 +39,8 @@ var import_Input = __toESM(require("./Input"));
39
39
  var import_Button = __toESM(require("./Button"));
40
40
  var import_CalendarPanel = __toESM(require("./CalendarPanel"));
41
41
  var import_TimePopover = __toESM(require("./TimePopover"));
42
+ var import_framer_motion = require("framer-motion");
43
+ var import_animations = require("./animations");
42
44
  const pad2 = (n) => n < 10 ? `0${n}` : String(n);
43
45
  const DATE_ONLY_REGEX = /^\d{4}-\d{2}-\d{2}$/;
44
46
  const fmtISODate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
@@ -245,8 +247,12 @@ function DateTimeField({
245
247
  const timeBtnRef = (0, import_react.useRef)(null);
246
248
  const [showTimePop, setShowTimePop] = (0, import_react.useState)(false);
247
249
  const popover = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
248
- "div",
250
+ import_framer_motion.motion.div,
249
251
  {
252
+ variants: import_animations.popOver,
253
+ initial: "initial",
254
+ animate: "animate",
255
+ transition: import_animations.menuTransition,
250
256
  ref: popRef,
251
257
  style: stylePop,
252
258
  "data-dtf-pop": true,
@@ -6,6 +6,8 @@ import Input from "./Input";
6
6
  import Button from "./Button";
7
7
  import CalendarPanel from "./CalendarPanel";
8
8
  import TimePopover from "./TimePopover";
9
+ import { motion } from "framer-motion";
10
+ import { popOver, menuTransition } from "./animations";
9
11
  const pad2 = (n) => n < 10 ? `0${n}` : String(n);
10
12
  const DATE_ONLY_REGEX = /^\d{4}-\d{2}-\d{2}$/;
11
13
  const fmtISODate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
@@ -212,8 +214,12 @@ function DateTimeField({
212
214
  const timeBtnRef = useRef(null);
213
215
  const [showTimePop, setShowTimePop] = useState(false);
214
216
  const popover = /* @__PURE__ */ jsxs(
215
- "div",
217
+ motion.div,
216
218
  {
219
+ variants: popOver,
220
+ initial: "initial",
221
+ animate: "animate",
222
+ transition: menuTransition,
217
223
  ref: popRef,
218
224
  style: stylePop,
219
225
  "data-dtf-pop": true,
package/dist/Dropdown.js CHANGED
@@ -41,6 +41,8 @@ module.exports = __toCommonJS(Dropdown_exports);
41
41
  var import_jsx_runtime = require("react/jsx-runtime");
42
42
  var import_react = __toESM(require("react"));
43
43
  var import_react_dom = require("react-dom");
44
+ var import_framer_motion = require("framer-motion");
45
+ var import_animations = require("./animations");
44
46
  var import_iconos = require("./iconos/index");
45
47
  var import_Button = __toESM(require("./Button"));
46
48
  const DropdownCtx = (0, import_react.createContext)(null);
@@ -263,16 +265,20 @@ function Content({
263
265
  }
264
266
  return out;
265
267
  }, [children, isAllowed, defaultHideUnauthorized]);
266
- if (!open) return null;
267
- return (0, import_react_dom.createPortal)(
268
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
269
- "div",
268
+ return typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { children: open ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
270
+ import_framer_motion.motion.div,
270
271
  {
271
272
  role: "menu",
272
273
  id: menuId,
273
274
  "aria-labelledby": labelId,
274
275
  ref: menuRef,
275
276
  onKeyDown,
277
+ variants: import_animations.popOver,
278
+ initial: "initial",
279
+ animate: "animate",
280
+ exit: "exit",
281
+ transition: import_animations.menuTransition,
276
282
  style: {
277
283
  position: "fixed",
278
284
  top: pos.top,
@@ -282,18 +288,16 @@ function Content({
282
288
  },
283
289
  className: [
284
290
  "z-[9999] overflow-auto rounded-2xl border border-slate-200/80 bg-white p-1.5 shadow-xl",
285
- "data-[open=false]:pointer-events-none data-[open=false]:opacity-0 data-[open=false]:scale-95",
286
- "data-[open=true]:opacity-100 data-[open=true]:scale-100 transition",
287
291
  pos.origin === "top-right" ? "origin-top-right" : "origin-top-left",
288
292
  "dark:border-white/10 dark:bg-[var(--fx-surface)]",
289
293
  className
290
294
  ].join(" "),
291
- "data-open": "true",
295
+ "data-open": open ? "true" : "false",
292
296
  children: normalizedChildren
293
297
  }
294
- ),
298
+ ) : null }),
295
299
  document.body
296
- );
300
+ ) : null;
297
301
  }
298
302
  function Label({ children }) {
299
303
  const { labelId } = useDropdown();
package/dist/Dropdown.mjs CHANGED
@@ -11,6 +11,8 @@ import React, {
11
11
  useState
12
12
  } from "react";
13
13
  import { createPortal } from "react-dom";
14
+ import { AnimatePresence, motion } from "framer-motion";
15
+ import { popOver, menuTransition } from "./animations";
14
16
  import { MenuPuntosVerticalIcon } from "./iconos/index";
15
17
  import Button from "./Button";
16
18
  const DropdownCtx = createContext(null);
@@ -233,16 +235,20 @@ function Content({
233
235
  }
234
236
  return out;
235
237
  }, [children, isAllowed, defaultHideUnauthorized]);
236
- if (!open) return null;
237
- return createPortal(
238
- /* @__PURE__ */ jsx(
239
- "div",
238
+ return typeof document !== "undefined" ? createPortal(
239
+ /* @__PURE__ */ jsx(AnimatePresence, { children: open ? /* @__PURE__ */ jsx(
240
+ motion.div,
240
241
  {
241
242
  role: "menu",
242
243
  id: menuId,
243
244
  "aria-labelledby": labelId,
244
245
  ref: menuRef,
245
246
  onKeyDown,
247
+ variants: popOver,
248
+ initial: "initial",
249
+ animate: "animate",
250
+ exit: "exit",
251
+ transition: menuTransition,
246
252
  style: {
247
253
  position: "fixed",
248
254
  top: pos.top,
@@ -252,18 +258,16 @@ function Content({
252
258
  },
253
259
  className: [
254
260
  "z-[9999] overflow-auto rounded-2xl border border-slate-200/80 bg-white p-1.5 shadow-xl",
255
- "data-[open=false]:pointer-events-none data-[open=false]:opacity-0 data-[open=false]:scale-95",
256
- "data-[open=true]:opacity-100 data-[open=true]:scale-100 transition",
257
261
  pos.origin === "top-right" ? "origin-top-right" : "origin-top-left",
258
262
  "dark:border-white/10 dark:bg-[var(--fx-surface)]",
259
263
  className
260
264
  ].join(" "),
261
- "data-open": "true",
265
+ "data-open": open ? "true" : "false",
262
266
  children: normalizedChildren
263
267
  }
264
- ),
268
+ ) : null }),
265
269
  document.body
266
- );
270
+ ) : null;
267
271
  }
268
272
  function Label({ children }) {
269
273
  const { labelId } = useDropdown();
package/dist/Input.js CHANGED
@@ -34,6 +34,8 @@ __export(Input_exports, {
34
34
  module.exports = __toCommonJS(Input_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = __toESM(require("react"));
37
+ var import_framer_motion = require("framer-motion");
38
+ var import_animations = require("./animations");
37
39
  var import_Button = __toESM(require("./Button"));
38
40
  function cx(...a) {
39
41
  return a.filter(Boolean).join(" ");
@@ -56,6 +58,7 @@ const Input = import_react.default.forwardRef(
56
58
  }
57
59
  const showClear = clearable && !!value && !props.disabled;
58
60
  const readOnly = !onChange;
61
+ const [focused, setFocused] = import_react.default.useState(false);
59
62
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative content-center", children: [
60
63
  leftSlot && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400", children: leftSlot }),
61
64
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -65,6 +68,16 @@ const Input = import_react.default.forwardRef(
65
68
  value,
66
69
  onChange,
67
70
  readOnly,
71
+ onFocus: (e) => {
72
+ var _a;
73
+ setFocused(true);
74
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, e);
75
+ },
76
+ onBlur: (e) => {
77
+ var _a;
78
+ setFocused(false);
79
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, e);
80
+ },
68
81
  "aria-invalid": error ? true : void 0,
69
82
  className: cx(
70
83
  baseControl,
@@ -94,6 +107,16 @@ const Input = import_react.default.forwardRef(
94
107
  },
95
108
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4.5 w-4.5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) })
96
109
  }
110
+ ),
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
112
+ import_framer_motion.motion.span,
113
+ {
114
+ "aria-hidden": true,
115
+ className: "pointer-events-none absolute inset-0 rounded-2xl",
116
+ initial: false,
117
+ animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
118
+ transition: import_animations.microTransition
119
+ }
97
120
  )
98
121
  ] });
99
122
  }
package/dist/Input.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 cx(...a) {
6
8
  return a.filter(Boolean).join(" ");
@@ -23,6 +25,7 @@ const Input = React.forwardRef(
23
25
  }
24
26
  const showClear = clearable && !!value && !props.disabled;
25
27
  const readOnly = !onChange;
28
+ const [focused, setFocused] = React.useState(false);
26
29
  return /* @__PURE__ */ jsxs("div", { className: "relative content-center", children: [
27
30
  leftSlot && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400", children: leftSlot }),
28
31
  /* @__PURE__ */ jsx(
@@ -32,6 +35,16 @@ const Input = React.forwardRef(
32
35
  value,
33
36
  onChange,
34
37
  readOnly,
38
+ onFocus: (e) => {
39
+ var _a;
40
+ setFocused(true);
41
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, e);
42
+ },
43
+ onBlur: (e) => {
44
+ var _a;
45
+ setFocused(false);
46
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, e);
47
+ },
35
48
  "aria-invalid": error ? true : void 0,
36
49
  className: cx(
37
50
  baseControl,
@@ -61,6 +74,16 @@ const Input = React.forwardRef(
61
74
  },
62
75
  children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4.5 w-4.5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12" }) })
63
76
  }
77
+ ),
78
+ /* @__PURE__ */ jsx(
79
+ motion.span,
80
+ {
81
+ "aria-hidden": true,
82
+ className: "pointer-events-none absolute inset-0 rounded-2xl",
83
+ initial: false,
84
+ animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
85
+ transition: microTransition
86
+ }
64
87
  )
65
88
  ] });
66
89
  }