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/Textarea.js CHANGED
@@ -34,6 +34,8 @@ __export(Textarea_exports, {
34
34
  module.exports = __toCommonJS(Textarea_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
  function cx(...a) {
38
40
  return a.filter(Boolean).join(" ");
39
41
  }
@@ -55,23 +57,46 @@ const Textarea = import_react.default.forwardRef(
55
57
  );
56
58
  }
57
59
  const readOnly = !onChange;
58
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
- "textarea",
60
- {
61
- ref,
62
- value,
63
- onChange,
64
- readOnly,
65
- "aria-invalid": error ? true : void 0,
66
- className: cx(
67
- baseControl,
68
- (error || tone === "danger") && errorControl,
69
- className
70
- ),
71
- rows,
72
- ...props
73
- }
74
- );
60
+ const [focused, setFocused] = import_react.default.useState(false);
61
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ "textarea",
64
+ {
65
+ ref,
66
+ value,
67
+ onChange,
68
+ readOnly,
69
+ onFocus: (e) => {
70
+ var _a;
71
+ setFocused(true);
72
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, e);
73
+ },
74
+ onBlur: (e) => {
75
+ var _a;
76
+ setFocused(false);
77
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, e);
78
+ },
79
+ "aria-invalid": error ? true : void 0,
80
+ className: cx(
81
+ baseControl,
82
+ (error || tone === "danger") && errorControl,
83
+ className
84
+ ),
85
+ rows,
86
+ ...props
87
+ }
88
+ ),
89
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
90
+ import_framer_motion.motion.span,
91
+ {
92
+ "aria-hidden": true,
93
+ className: "pointer-events-none absolute inset-0 rounded-2xl",
94
+ initial: false,
95
+ animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
96
+ transition: import_animations.microTransition
97
+ }
98
+ )
99
+ ] });
75
100
  }
76
101
  );
77
102
  Textarea.displayName = "Textarea";
package/dist/Textarea.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
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
  function cx(...a) {
5
7
  return a.filter(Boolean).join(" ");
6
8
  }
@@ -22,23 +24,46 @@ const Textarea = React.forwardRef(
22
24
  );
23
25
  }
24
26
  const readOnly = !onChange;
25
- return /* @__PURE__ */ jsx(
26
- "textarea",
27
- {
28
- ref,
29
- value,
30
- onChange,
31
- readOnly,
32
- "aria-invalid": error ? true : void 0,
33
- className: cx(
34
- baseControl,
35
- (error || tone === "danger") && errorControl,
36
- className
37
- ),
38
- rows,
39
- ...props
40
- }
41
- );
27
+ const [focused, setFocused] = React.useState(false);
28
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
29
+ /* @__PURE__ */ jsx(
30
+ "textarea",
31
+ {
32
+ ref,
33
+ value,
34
+ onChange,
35
+ readOnly,
36
+ onFocus: (e) => {
37
+ var _a;
38
+ setFocused(true);
39
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, e);
40
+ },
41
+ onBlur: (e) => {
42
+ var _a;
43
+ setFocused(false);
44
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, e);
45
+ },
46
+ "aria-invalid": error ? true : void 0,
47
+ className: cx(
48
+ baseControl,
49
+ (error || tone === "danger") && errorControl,
50
+ className
51
+ ),
52
+ rows,
53
+ ...props
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsx(
57
+ motion.span,
58
+ {
59
+ "aria-hidden": true,
60
+ className: "pointer-events-none absolute inset-0 rounded-2xl",
61
+ initial: false,
62
+ animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
63
+ transition: microTransition
64
+ }
65
+ )
66
+ ] });
42
67
  }
43
68
  );
44
69
  Textarea.displayName = "Textarea";
package/dist/TimePanel.js CHANGED
@@ -93,7 +93,7 @@ function TimePopover({
93
93
  ref: popRef,
94
94
  style: stylePop,
95
95
  "data-dtf-pop": true,
96
- className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]",
96
+ className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
97
97
  children: [
98
98
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-2 text-sm font-medium text-slate-600 dark:text-slate-300", children: "Selecciona hora" }),
99
99
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [
@@ -60,7 +60,7 @@ function TimePopover({
60
60
  ref: popRef,
61
61
  style: stylePop,
62
62
  "data-dtf-pop": true,
63
- className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]",
63
+ className: "overflow-hidden rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
64
64
  children: [
65
65
  /* @__PURE__ */ jsx("div", { className: "mb-2 text-sm font-medium text-slate-600 dark:text-slate-300", children: "Selecciona hora" }),
66
66
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
@@ -37,6 +37,8 @@ module.exports = __toCommonJS(TimePopover_exports);
37
37
  var import_jsx_runtime = require("react/jsx-runtime");
38
38
  var React = __toESM(require("react"));
39
39
  var import_react_dom = require("react-dom");
40
+ var import_framer_motion = require("framer-motion");
41
+ var import_animations = require("./animations");
40
42
  var import_Button = __toESM(require("./Button"));
41
43
  var import_Input = __toESM(require("./Input"));
42
44
  const pad2 = (n) => n < 10 ? `0${n}` : String(n);
@@ -126,8 +128,13 @@ function TimePopover({
126
128
  return md === "AM" ? h12 : h12 + 12;
127
129
  };
128
130
  const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
129
- "div",
131
+ import_framer_motion.motion.div,
130
132
  {
133
+ variants: import_animations.popOver,
134
+ initial: "initial",
135
+ animate: "animate",
136
+ exit: "exit",
137
+ transition: import_animations.menuTransition,
131
138
  ref: popRef,
132
139
  role: "dialog",
133
140
  "aria-label": "Selector de hora",
@@ -136,7 +143,7 @@ function TimePopover({
136
143
  onPointerDownCapture: (e) => e.stopPropagation(),
137
144
  onKeyDown,
138
145
  style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
139
- className: "w-64 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]",
146
+ className: "w-64 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
140
147
  children: [
141
148
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-2 text-sm font-medium text-slate-700 dark:text-slate-200", children: "Selecciona hora" }),
142
149
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 text-xs text-slate-500 dark:text-slate-300", children: [
@@ -350,48 +357,61 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
350
357
  }
351
358
  const selFrom = (_a = value == null ? void 0 : value.from) != null ? _a : null;
352
359
  const selTo = (_b = value == null ? void 0 : value.to) != null ? _b : null;
353
- const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]", children: [
354
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
355
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
356
- import_Button.default,
357
- {
358
- unstyled: true,
359
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
360
- onClick: () => onCursorChange(new Date(year, month - 1, 1)),
361
- children: "\u25C0"
362
- }
363
- ),
364
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
365
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
366
- import_Button.default,
367
- {
368
- unstyled: true,
369
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
370
- onClick: () => onCursorChange(new Date(year, month + 1, 1)),
371
- children: "\u25B6"
372
- }
373
- )
374
- ] }),
375
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
376
- const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
377
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
378
- import_Button.default,
379
- {
380
- unstyled: true,
381
- className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
382
- onClick: () => onPick(w.from, w.to),
383
- children: [
384
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
385
- "Semana ",
386
- idx + 1
387
- ] }),
388
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs opacity-80", children: formatWeekLabel(w.from, w.to) })
389
- ]
390
- },
391
- `${w.from.toISOString()}-${w.to.toISOString()}`
392
- );
393
- }) })
394
- ] });
360
+ const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
361
+ import_framer_motion.motion.div,
362
+ {
363
+ ref: popRef,
364
+ style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
365
+ variants: import_animations.popOver,
366
+ initial: "initial",
367
+ animate: "animate",
368
+ exit: "exit",
369
+ transition: import_animations.menuTransition,
370
+ className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
371
+ children: [
372
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
373
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
374
+ import_Button.default,
375
+ {
376
+ unstyled: true,
377
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
378
+ onClick: () => onCursorChange(new Date(year, month - 1, 1)),
379
+ children: "\u25C0"
380
+ }
381
+ ),
382
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
383
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
384
+ import_Button.default,
385
+ {
386
+ unstyled: true,
387
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
388
+ onClick: () => onCursorChange(new Date(year, month + 1, 1)),
389
+ children: "\u25B6"
390
+ }
391
+ )
392
+ ] }),
393
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
394
+ const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
395
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
396
+ import_Button.default,
397
+ {
398
+ unstyled: true,
399
+ className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
400
+ onClick: () => onPick(w.from, w.to),
401
+ children: [
402
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
403
+ "Semana ",
404
+ idx + 1
405
+ ] }),
406
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs opacity-80", children: formatWeekLabel(w.from, w.to) })
407
+ ]
408
+ },
409
+ `${w.from.toISOString()}-${w.to.toISOString()}`
410
+ );
411
+ }) })
412
+ ]
413
+ }
414
+ );
395
415
  return (0, import_react_dom.createPortal)(body, document.body);
396
416
  }
397
417
  function sameDay(a, b) {
@@ -456,45 +476,58 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
456
476
  selMonthIdx = ((_a = parts[1]) != null ? _a : 1) - 1;
457
477
  }
458
478
  }
459
- const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]", children: [
460
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
461
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
462
- import_Button.default,
463
- {
464
- unstyled: true,
465
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
466
- onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
467
- children: "\u25C0"
468
- }
469
- ),
470
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: year }),
471
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
472
- import_Button.default,
473
- {
474
- unstyled: true,
475
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
476
- onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
477
- children: "\u25B6"
478
- }
479
- )
480
- ] }),
481
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-3 gap-2", children: months.map((m, idx) => {
482
- const isSel = selYear === year && selMonthIdx === idx;
483
- const base = "rounded-xl border px-2 py-2 text-sm ";
484
- const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
485
- const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
486
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
487
- import_Button.default,
488
- {
489
- unstyled: true,
490
- className: `${base} ${light} ${dark}`,
491
- onClick: () => onPick(new Date(year, idx, 1)),
492
- children: m
493
- },
494
- idx
495
- );
496
- }) })
497
- ] });
479
+ const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
480
+ import_framer_motion.motion.div,
481
+ {
482
+ ref: popRef,
483
+ style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
484
+ variants: import_animations.popOver,
485
+ initial: "initial",
486
+ animate: "animate",
487
+ exit: "exit",
488
+ transition: import_animations.menuTransition,
489
+ className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
490
+ children: [
491
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between", children: [
492
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
493
+ import_Button.default,
494
+ {
495
+ unstyled: true,
496
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
497
+ onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
498
+ children: "\u25C0"
499
+ }
500
+ ),
501
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm font-semibold", children: year }),
502
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
503
+ import_Button.default,
504
+ {
505
+ unstyled: true,
506
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
507
+ onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
508
+ children: "\u25B6"
509
+ }
510
+ )
511
+ ] }),
512
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-3 gap-2", children: months.map((m, idx) => {
513
+ const isSel = selYear === year && selMonthIdx === idx;
514
+ const base = "rounded-xl border px-2 py-2 text-sm ";
515
+ const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
516
+ const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
517
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
518
+ import_Button.default,
519
+ {
520
+ unstyled: true,
521
+ className: `${base} ${light} ${dark}`,
522
+ onClick: () => onPick(new Date(year, idx, 1)),
523
+ children: m
524
+ },
525
+ idx
526
+ );
527
+ }) })
528
+ ]
529
+ }
530
+ );
498
531
  return (0, import_react_dom.createPortal)(body, document.body);
499
532
  }
500
533
  // Annotate the CommonJS export names for ESM import in node:
@@ -2,6 +2,8 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { createPortal } from "react-dom";
5
+ import { motion } from "framer-motion";
6
+ import { popOver, menuTransition } from "./animations";
5
7
  import Button from "./Button";
6
8
  import Input from "./Input";
7
9
  const pad2 = (n) => n < 10 ? `0${n}` : String(n);
@@ -91,8 +93,13 @@ function TimePopover({
91
93
  return md === "AM" ? h12 : h12 + 12;
92
94
  };
93
95
  const body = /* @__PURE__ */ jsxs(
94
- "div",
96
+ motion.div,
95
97
  {
98
+ variants: popOver,
99
+ initial: "initial",
100
+ animate: "animate",
101
+ exit: "exit",
102
+ transition: menuTransition,
96
103
  ref: popRef,
97
104
  role: "dialog",
98
105
  "aria-label": "Selector de hora",
@@ -101,7 +108,7 @@ function TimePopover({
101
108
  onPointerDownCapture: (e) => e.stopPropagation(),
102
109
  onKeyDown,
103
110
  style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
104
- className: "w-64 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]",
111
+ className: "w-64 rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
105
112
  children: [
106
113
  /* @__PURE__ */ jsx("div", { className: "mb-2 text-sm font-medium text-slate-700 dark:text-slate-200", children: "Selecciona hora" }),
107
114
  /* @__PURE__ */ jsxs("div", { className: "mb-2 text-xs text-slate-500 dark:text-slate-300", children: [
@@ -315,48 +322,61 @@ function WeekPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
315
322
  }
316
323
  const selFrom = (_a = value == null ? void 0 : value.from) != null ? _a : null;
317
324
  const selTo = (_b = value == null ? void 0 : value.to) != null ? _b : null;
318
- const body = /* @__PURE__ */ jsxs("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]", children: [
319
- /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
320
- /* @__PURE__ */ jsx(
321
- Button,
322
- {
323
- unstyled: true,
324
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
325
- onClick: () => onCursorChange(new Date(year, month - 1, 1)),
326
- children: "\u25C0"
327
- }
328
- ),
329
- /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
330
- /* @__PURE__ */ jsx(
331
- Button,
332
- {
333
- unstyled: true,
334
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
335
- onClick: () => onCursorChange(new Date(year, month + 1, 1)),
336
- children: "\u25B6"
337
- }
338
- )
339
- ] }),
340
- /* @__PURE__ */ jsx("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
341
- const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
342
- return /* @__PURE__ */ jsxs(
343
- Button,
344
- {
345
- unstyled: true,
346
- className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
347
- onClick: () => onPick(w.from, w.to),
348
- children: [
349
- /* @__PURE__ */ jsxs("span", { children: [
350
- "Semana ",
351
- idx + 1
352
- ] }),
353
- /* @__PURE__ */ jsx("span", { className: "text-xs opacity-80", children: formatWeekLabel(w.from, w.to) })
354
- ]
355
- },
356
- `${w.from.toISOString()}-${w.to.toISOString()}`
357
- );
358
- }) })
359
- ] });
325
+ const body = /* @__PURE__ */ jsxs(
326
+ motion.div,
327
+ {
328
+ ref: popRef,
329
+ style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
330
+ variants: popOver,
331
+ initial: "initial",
332
+ animate: "animate",
333
+ exit: "exit",
334
+ transition: menuTransition,
335
+ className: "w-[340px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
336
+ children: [
337
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
338
+ /* @__PURE__ */ jsx(
339
+ Button,
340
+ {
341
+ unstyled: true,
342
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
343
+ onClick: () => onCursorChange(new Date(year, month - 1, 1)),
344
+ children: "\u25C0"
345
+ }
346
+ ),
347
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: cursor.toLocaleDateString("es-MX", { month: "long", year: "numeric" }) }),
348
+ /* @__PURE__ */ jsx(
349
+ Button,
350
+ {
351
+ unstyled: true,
352
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
353
+ onClick: () => onCursorChange(new Date(year, month + 1, 1)),
354
+ children: "\u25B6"
355
+ }
356
+ )
357
+ ] }),
358
+ /* @__PURE__ */ jsx("div", { className: "grid gap-2", children: weeks.map((w, idx) => {
359
+ const isSel = selFrom && selTo && sameDay(selFrom, w.from) && sameDay(selTo, w.to);
360
+ return /* @__PURE__ */ jsxs(
361
+ Button,
362
+ {
363
+ unstyled: true,
364
+ className: `flex items-center justify-between rounded-xl border px-3 py-2 text-sm ${isSel ? "bg-slate-900 text-white border-slate-900 dark:bg-white dark:text-slate-900 dark:border-white" : "border-slate-200 hover:bg-slate-100 dark:border-white/10 dark:hover:bg-white/10"}`,
365
+ onClick: () => onPick(w.from, w.to),
366
+ children: [
367
+ /* @__PURE__ */ jsxs("span", { children: [
368
+ "Semana ",
369
+ idx + 1
370
+ ] }),
371
+ /* @__PURE__ */ jsx("span", { className: "text-xs opacity-80", children: formatWeekLabel(w.from, w.to) })
372
+ ]
373
+ },
374
+ `${w.from.toISOString()}-${w.to.toISOString()}`
375
+ );
376
+ }) })
377
+ ]
378
+ }
379
+ );
360
380
  return createPortal(body, document.body);
361
381
  }
362
382
  function sameDay(a, b) {
@@ -421,45 +441,58 @@ function MonthPopover({ anchorEl, cursor, value, onCursorChange, onPick, onClose
421
441
  selMonthIdx = ((_a = parts[1]) != null ? _a : 1) - 1;
422
442
  }
423
443
  }
424
- const body = /* @__PURE__ */ jsxs("div", { ref: popRef, style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 }, className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[#0b0a0a]", children: [
425
- /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
426
- /* @__PURE__ */ jsx(
427
- Button,
428
- {
429
- unstyled: true,
430
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
431
- onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
432
- children: "\u25C0"
433
- }
434
- ),
435
- /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: year }),
436
- /* @__PURE__ */ jsx(
437
- Button,
438
- {
439
- unstyled: true,
440
- className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
441
- onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
442
- children: "\u25B6"
443
- }
444
- )
445
- ] }),
446
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: months.map((m, idx) => {
447
- const isSel = selYear === year && selMonthIdx === idx;
448
- const base = "rounded-xl border px-2 py-2 text-sm ";
449
- const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
450
- const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
451
- return /* @__PURE__ */ jsx(
452
- Button,
453
- {
454
- unstyled: true,
455
- className: `${base} ${light} ${dark}`,
456
- onClick: () => onPick(new Date(year, idx, 1)),
457
- children: m
458
- },
459
- idx
460
- );
461
- }) })
462
- ] });
444
+ const body = /* @__PURE__ */ jsxs(
445
+ motion.div,
446
+ {
447
+ ref: popRef,
448
+ style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
449
+ variants: popOver,
450
+ initial: "initial",
451
+ animate: "animate",
452
+ exit: "exit",
453
+ transition: menuTransition,
454
+ className: "w-[300px] rounded-2xl border border-slate-200 bg-white p-3 shadow-xl dark:border-white/10 dark:bg-[var(--fx-surface)]",
455
+ children: [
456
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
457
+ /* @__PURE__ */ jsx(
458
+ Button,
459
+ {
460
+ unstyled: true,
461
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
462
+ onClick: () => onCursorChange(new Date(year - 1, 0, 1)),
463
+ children: "\u25C0"
464
+ }
465
+ ),
466
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-semibold", children: year }),
467
+ /* @__PURE__ */ jsx(
468
+ Button,
469
+ {
470
+ unstyled: true,
471
+ className: "rounded-lg border border-slate-200 px-2 py-1 text-sm hover:bg-slate-50 dark:border-white/10 dark:hover:bg-white/10",
472
+ onClick: () => onCursorChange(new Date(year + 1, 0, 1)),
473
+ children: "\u25B6"
474
+ }
475
+ )
476
+ ] }),
477
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: months.map((m, idx) => {
478
+ const isSel = selYear === year && selMonthIdx === idx;
479
+ const base = "rounded-xl border px-2 py-2 text-sm ";
480
+ const light = isSel ? "bg-slate-900 text-white border-slate-900" : "border-slate-200 hover:bg-slate-100";
481
+ const dark = isSel ? "dark:bg-white dark:text-slate-900 dark:border-white" : "dark:border-white/10 dark:hover:bg-white/10";
482
+ return /* @__PURE__ */ jsx(
483
+ Button,
484
+ {
485
+ unstyled: true,
486
+ className: `${base} ${light} ${dark}`,
487
+ onClick: () => onPick(new Date(year, idx, 1)),
488
+ children: m
489
+ },
490
+ idx
491
+ );
492
+ }) })
493
+ ]
494
+ }
495
+ );
463
496
  return createPortal(body, document.body);
464
497
  }
465
498
  export {