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