framepexls-ui-lib 0.2.9 → 0.2.11
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.
- package/dist/AppTopbar.js +1 -1
- package/dist/AppTopbar.mjs +1 -1
- package/dist/AvatarGroup.js +7 -2
- package/dist/AvatarGroup.mjs +7 -2
- package/dist/Badge.js +6 -1
- package/dist/Badge.mjs +6 -1
- package/dist/Breadcrumb.js +46 -2
- package/dist/Breadcrumb.mjs +46 -2
- package/dist/Button.js +8 -2
- package/dist/Button.mjs +8 -2
- package/dist/CalendarPanel.js +45 -26
- package/dist/CalendarPanel.mjs +45 -26
- package/dist/Card.js +7 -2
- package/dist/Card.mjs +7 -2
- package/dist/Checkbox.js +51 -18
- package/dist/Checkbox.mjs +51 -18
- package/dist/ColorPicker.js +9 -4
- package/dist/ColorPicker.mjs +9 -4
- package/dist/ComboSelect.js +11 -4
- package/dist/ComboSelect.mjs +11 -4
- package/dist/DateTimeField.js +8 -2
- package/dist/DateTimeField.mjs +8 -2
- package/dist/Dropdown.js +15 -10
- package/dist/Dropdown.mjs +15 -10
- package/dist/Input.js +23 -0
- package/dist/Input.mjs +23 -0
- package/dist/KpiCard.js +26 -2
- package/dist/KpiCard.mjs +26 -2
- package/dist/Link.js +16 -2
- package/dist/Link.mjs +16 -2
- package/dist/MediaCard.js +18 -11
- package/dist/MediaCard.mjs +18 -11
- package/dist/MediaSelector.js +9 -8
- package/dist/MediaSelector.mjs +9 -8
- package/dist/MotionProvider.d.mts +10 -0
- package/dist/MotionProvider.d.ts +10 -0
- package/dist/MotionProvider.js +30 -0
- package/dist/MotionProvider.mjs +10 -0
- package/dist/MultiComboSelect.js +6 -4
- package/dist/MultiComboSelect.mjs +6 -4
- package/dist/Pagination.js +66 -29
- package/dist/Pagination.mjs +66 -29
- package/dist/ReviewHistory.js +8 -6
- package/dist/ReviewHistory.mjs +8 -6
- package/dist/SearchInput.js +16 -2
- package/dist/SearchInput.mjs +16 -2
- package/dist/Select.js +12 -4
- package/dist/Select.mjs +12 -4
- package/dist/Sidebar.js +20 -2
- package/dist/Sidebar.mjs +20 -2
- package/dist/StatCard.js +17 -1
- package/dist/StatCard.mjs +19 -3
- package/dist/Steps.js +51 -37
- package/dist/Steps.mjs +51 -37
- package/dist/StorageUsage.js +7 -3
- package/dist/StorageUsage.mjs +7 -3
- package/dist/Table.d.mts +5 -1
- package/dist/Table.d.ts +5 -1
- package/dist/Table.js +32 -4
- package/dist/Table.mjs +31 -4
- package/dist/Textarea.js +42 -17
- package/dist/Textarea.mjs +43 -18
- package/dist/TimePopover.js +116 -83
- package/dist/TimePopover.mjs +116 -83
- package/dist/Toast.js +0 -4
- package/dist/Toast.mjs +0 -4
- package/dist/Tooltip.js +29 -19
- package/dist/Tooltip.mjs +29 -19
- package/dist/UploadCard.js +34 -21
- package/dist/UploadCard.mjs +34 -21
- package/dist/animations-CHrNeawW.d.mts +28 -0
- package/dist/animations-CHrNeawW.d.ts +28 -0
- package/dist/animations.d.mts +2 -0
- package/dist/animations.d.ts +2 -0
- package/dist/animations.js +75 -0
- package/dist/animations.mjs +42 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -0
- package/dist/index.mjs +18 -13
- package/package.json +1 -1
package/dist/TimePopover.js
CHANGED
|
@@ -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
|
-
|
|
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",
|
|
@@ -135,7 +142,7 @@ function TimePopover({
|
|
|
135
142
|
"data-dtf-pop": true,
|
|
136
143
|
onPointerDownCapture: (e) => e.stopPropagation(),
|
|
137
144
|
onKeyDown,
|
|
138
|
-
style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
|
|
145
|
+
style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5, willChange: "transform, opacity" },
|
|
139
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" }),
|
|
@@ -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)(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
),
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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, willChange: "transform, opacity" },
|
|
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)(
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
),
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
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, willChange: "transform, opacity" },
|
|
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:
|
package/dist/TimePopover.mjs
CHANGED
|
@@ -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
|
-
|
|
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",
|
|
@@ -100,7 +107,7 @@ function TimePopover({
|
|
|
100
107
|
"data-dtf-pop": true,
|
|
101
108
|
onPointerDownCapture: (e) => e.stopPropagation(),
|
|
102
109
|
onKeyDown,
|
|
103
|
-
style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5 },
|
|
110
|
+
style: { position: "fixed", top: pos.top, left: pos.left, zIndex: 1e5, willChange: "transform, opacity" },
|
|
104
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" }),
|
|
@@ -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(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
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, willChange: "transform, opacity" },
|
|
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(
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
),
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
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, willChange: "transform, opacity" },
|
|
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,34 @@ 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
|
-
|
|
117
|
+
typeof document !== "undefined" ? (0, import_react_dom.createPortal)(
|
|
118
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { initial: false, 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
|
+
willChange: "transform, opacity"
|
|
138
|
+
},
|
|
139
|
+
children: content
|
|
140
|
+
}
|
|
141
|
+
) : null }),
|
|
142
|
+
document.body
|
|
143
|
+
) : null
|
|
134
144
|
] });
|
|
135
145
|
}
|
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,35 @@ 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
|
-
|
|
84
|
+
typeof document !== "undefined" ? createPortal(
|
|
85
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, 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
|
+
willChange: "transform, opacity"
|
|
105
|
+
},
|
|
106
|
+
children: content
|
|
107
|
+
}
|
|
108
|
+
) : null }),
|
|
109
|
+
document.body
|
|
110
|
+
) : null
|
|
101
111
|
] });
|
|
102
112
|
}
|
|
103
113
|
export {
|