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
@@ -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",
@@ -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-[var(--fx-surface)]", 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-[var(--fx-surface)]", 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",
@@ -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-[var(--fx-surface)]", 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-[var(--fx-surface)]", 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 {
package/dist/Toast.js CHANGED
@@ -90,10 +90,6 @@ const typeAccent = {
90
90
  progress: "bg-sky-500/60"
91
91
  }
92
92
  };
93
- function useIsomorphicLayoutEffect(effect, deps) {
94
- const useIso = typeof window !== "undefined" ? import_react.default.useLayoutEffect : import_react.default.useEffect;
95
- return useIso(effect, deps);
96
- }
97
93
  function ToastView({ item, onClose, placement }) {
98
94
  var _a;
99
95
  const [hovered, setHovered] = import_react.default.useState(false);
package/dist/Toast.mjs CHANGED
@@ -55,10 +55,6 @@ const typeAccent = {
55
55
  progress: "bg-sky-500/60"
56
56
  }
57
57
  };
58
- function useIsomorphicLayoutEffect(effect, deps) {
59
- const useIso = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
60
- return useIso(effect, deps);
61
- }
62
58
  function ToastView({ item, onClose, placement }) {
63
59
  var _a;
64
60
  const [hovered, setHovered] = React.useState(false);
package/dist/Tooltip.js CHANGED
@@ -35,6 +35,8 @@ module.exports = __toCommonJS(Tooltip_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_react = __toESM(require("react"));
37
37
  var import_react_dom = require("react-dom");
38
+ var import_framer_motion = require("framer-motion");
39
+ var import_animations = require("./animations");
38
40
  function Tooltip({ content, placement = "top", delay = 80, offset = 8, className = "", children }) {
39
41
  const [open, setOpen] = import_react.default.useState(false);
40
42
  const [pos, setPos] = import_react.default.useState(null);
@@ -110,26 +112,33 @@ function Tooltip({ content, placement = "top", delay = 80, offset = 8, className
110
112
  },
111
113
  "aria-describedby": open ? id : void 0
112
114
  };
113
- const body = open && pos && typeof document !== "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
- "div",
115
- {
116
- id,
117
- role: "tooltip",
118
- className: [
119
- "pointer-events-none fixed z-[2000] max-w-xs rounded-xl border border-slate-200/80 bg-slate-900/95 px-2.5 py-1.5 text-[12px] text-white shadow-xl backdrop-blur",
120
- "dark:border-white/10 dark:bg-white/10",
121
- className != null ? className : ""
122
- ].join(" "),
123
- style: {
124
- top: placement === "top" || placement === "bottom" ? pos.top : pos.top,
125
- left: placement === "top" || placement === "bottom" ? pos.left : pos.left,
126
- transform: placement === "top" || placement === "bottom" ? "translate(-50%, -100%)" : placement === "left" ? "translate(-100%, -50%)" : "translate(0, -50%)"
127
- },
128
- children: content
129
- }
130
- ) : null;
131
115
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
132
116
  import_react.default.cloneElement(children, triggerProps),
133
- body ? (0, import_react_dom.createPortal)(body, document.body) : null
117
+ typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
118
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { children: open && pos ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ import_framer_motion.motion.div,
120
+ {
121
+ id,
122
+ role: "tooltip",
123
+ variants: import_animations.tooltipVariant,
124
+ initial: "initial",
125
+ animate: "animate",
126
+ exit: "exit",
127
+ transition: import_animations.menuTransition,
128
+ className: [
129
+ "pointer-events-none fixed z-[2000] max-w-xs rounded-xl border border-slate-200/80 bg-slate-900/95 px-2.5 py-1.5 text-[12px] text-white shadow-xl backdrop-blur",
130
+ "dark:border-white/10 dark:bg-white/10",
131
+ className != null ? className : ""
132
+ ].join(" "),
133
+ style: {
134
+ top: placement === "top" || placement === "bottom" ? pos.top : pos.top,
135
+ left: placement === "top" || placement === "bottom" ? pos.left : pos.left,
136
+ transform: placement === "top" || placement === "bottom" ? "translate(-50%, -100%)" : placement === "left" ? "translate(-100%, -50%)" : "translate(0, -50%)"
137
+ },
138
+ children: content
139
+ }
140
+ ) : null }),
141
+ document.body
142
+ ) : null
134
143
  ] });
135
144
  }
package/dist/Tooltip.mjs CHANGED
@@ -2,6 +2,8 @@
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { createPortal } from "react-dom";
5
+ import { AnimatePresence, motion } from "framer-motion";
6
+ import { tooltipVariant, menuTransition } from "./animations";
5
7
  function Tooltip({ content, placement = "top", delay = 80, offset = 8, className = "", children }) {
6
8
  const [open, setOpen] = React.useState(false);
7
9
  const [pos, setPos] = React.useState(null);
@@ -77,27 +79,34 @@ function Tooltip({ content, placement = "top", delay = 80, offset = 8, className
77
79
  },
78
80
  "aria-describedby": open ? id : void 0
79
81
  };
80
- const body = open && pos && typeof document !== "undefined" ? /* @__PURE__ */ jsx(
81
- "div",
82
- {
83
- id,
84
- role: "tooltip",
85
- className: [
86
- "pointer-events-none fixed z-[2000] max-w-xs rounded-xl border border-slate-200/80 bg-slate-900/95 px-2.5 py-1.5 text-[12px] text-white shadow-xl backdrop-blur",
87
- "dark:border-white/10 dark:bg-white/10",
88
- className != null ? className : ""
89
- ].join(" "),
90
- style: {
91
- top: placement === "top" || placement === "bottom" ? pos.top : pos.top,
92
- left: placement === "top" || placement === "bottom" ? pos.left : pos.left,
93
- transform: placement === "top" || placement === "bottom" ? "translate(-50%, -100%)" : placement === "left" ? "translate(-100%, -50%)" : "translate(0, -50%)"
94
- },
95
- children: content
96
- }
97
- ) : null;
98
82
  return /* @__PURE__ */ jsxs(Fragment, { children: [
99
83
  React.cloneElement(children, triggerProps),
100
- body ? createPortal(body, document.body) : null
84
+ typeof document !== "undefined" ? createPortal(
85
+ /* @__PURE__ */ jsx(AnimatePresence, { children: open && pos ? /* @__PURE__ */ jsx(
86
+ motion.div,
87
+ {
88
+ id,
89
+ role: "tooltip",
90
+ variants: tooltipVariant,
91
+ initial: "initial",
92
+ animate: "animate",
93
+ exit: "exit",
94
+ transition: menuTransition,
95
+ className: [
96
+ "pointer-events-none fixed z-[2000] max-w-xs rounded-xl border border-slate-200/80 bg-slate-900/95 px-2.5 py-1.5 text-[12px] text-white shadow-xl backdrop-blur",
97
+ "dark:border-white/10 dark:bg-white/10",
98
+ className != null ? className : ""
99
+ ].join(" "),
100
+ style: {
101
+ top: placement === "top" || placement === "bottom" ? pos.top : pos.top,
102
+ left: placement === "top" || placement === "bottom" ? pos.left : pos.left,
103
+ transform: placement === "top" || placement === "bottom" ? "translate(-50%, -100%)" : placement === "left" ? "translate(-100%, -50%)" : "translate(0, -50%)"
104
+ },
105
+ children: content
106
+ }
107
+ ) : null }),
108
+ document.body
109
+ ) : null
101
110
  ] });
102
111
  }
103
112
  export {