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.
- 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 +10 -3
- package/dist/ComboSelect.mjs +10 -3
- package/dist/DateTimeField.js +7 -1
- package/dist/DateTimeField.mjs +7 -1
- package/dist/Dropdown.js +13 -9
- package/dist/Dropdown.mjs +13 -9
- 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 +10 -3
- package/dist/Select.mjs +10 -3
- 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 +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/TimePopover.js +115 -82
- package/dist/TimePopover.mjs +115 -82
- package/dist/Toast.js +0 -4
- package/dist/Toast.mjs +0 -4
- 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 +1 -1
package/dist/Steps.js
CHANGED
|
@@ -35,6 +35,8 @@ __export(Steps_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(Steps_exports);
|
|
36
36
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
37
|
var import_Button = __toESM(require("./Button"));
|
|
38
|
+
var import_framer_motion = require("framer-motion");
|
|
39
|
+
var import_animations = require("./animations");
|
|
38
40
|
const cx = (...a) => a.filter(Boolean).join(" ");
|
|
39
41
|
function Steps({
|
|
40
42
|
steps,
|
|
@@ -44,7 +46,8 @@ function Steps({
|
|
|
44
46
|
clickable = true,
|
|
45
47
|
compact = false
|
|
46
48
|
}) {
|
|
47
|
-
|
|
49
|
+
const progressPct = steps.length > 1 ? current / (steps.length - 1) * 100 : 0;
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
48
51
|
"nav",
|
|
49
52
|
{
|
|
50
53
|
"aria-label": "Progreso",
|
|
@@ -52,44 +55,55 @@ function Steps({
|
|
|
52
55
|
"w-full rounded-2xl border border-slate-200/80 bg-white/50 p-3 dark:border-white/10 dark:bg-white/[0.04]",
|
|
53
56
|
className
|
|
54
57
|
),
|
|
55
|
-
children:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"aria-current": state === "current" ? "step" : void 0,
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
-
"span",
|
|
75
|
-
{
|
|
76
|
-
className: cx(
|
|
77
|
-
"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
|
|
78
|
-
state === "current" && "bg-blue-600 text-white ring-black/0",
|
|
79
|
-
state === "done" && "bg-emerald-600 text-white ring-black/0",
|
|
80
|
-
state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
|
|
81
|
-
),
|
|
82
|
-
children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
|
|
83
|
-
}
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
|
|
60
|
+
const state = i < current ? "done" : i === current ? "current" : "upcoming";
|
|
61
|
+
const canClick = clickable && i <= current && !s.disabled && onChange;
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
+
import_Button.default,
|
|
64
|
+
{
|
|
65
|
+
unstyled: true,
|
|
66
|
+
type: "button",
|
|
67
|
+
disabled: !canClick,
|
|
68
|
+
onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
|
|
69
|
+
className: cx(
|
|
70
|
+
"group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
|
|
71
|
+
state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
|
|
72
|
+
state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
|
|
73
|
+
state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
|
|
84
74
|
),
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
75
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
+
"span",
|
|
79
|
+
{
|
|
80
|
+
className: cx(
|
|
81
|
+
"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
|
|
82
|
+
state === "current" && "bg-blue-600 text-white ring-black/0",
|
|
83
|
+
state === "done" && "bg-emerald-600 text-white ring-black/0",
|
|
84
|
+
state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
|
|
85
|
+
),
|
|
86
|
+
children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "min-w-0", children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
|
|
91
|
+
!compact && s.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
|
|
92
|
+
] })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
) }, s.key);
|
|
96
|
+
}) }),
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-3 h-1.5 w-full overflow-hidden rounded-full bg-slate-200/70 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
98
|
+
import_framer_motion.motion.div,
|
|
99
|
+
{
|
|
100
|
+
className: "h-full rounded-full bg-blue-600 dark:bg-blue-400",
|
|
101
|
+
initial: { width: 0 },
|
|
102
|
+
animate: { width: `${Math.max(0, Math.min(100, progressPct))}%` },
|
|
103
|
+
transition: import_animations.springSm
|
|
90
104
|
}
|
|
91
|
-
) }
|
|
92
|
-
|
|
105
|
+
) })
|
|
106
|
+
]
|
|
93
107
|
}
|
|
94
108
|
);
|
|
95
109
|
}
|
package/dist/Steps.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Button from "./Button";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { springSm } from "./animations";
|
|
4
6
|
const cx = (...a) => a.filter(Boolean).join(" ");
|
|
5
7
|
function Steps({
|
|
6
8
|
steps,
|
|
@@ -10,7 +12,8 @@ function Steps({
|
|
|
10
12
|
clickable = true,
|
|
11
13
|
compact = false
|
|
12
14
|
}) {
|
|
13
|
-
|
|
15
|
+
const progressPct = steps.length > 1 ? current / (steps.length - 1) * 100 : 0;
|
|
16
|
+
return /* @__PURE__ */ jsxs(
|
|
14
17
|
"nav",
|
|
15
18
|
{
|
|
16
19
|
"aria-label": "Progreso",
|
|
@@ -18,44 +21,55 @@ function Steps({
|
|
|
18
21
|
"w-full rounded-2xl border border-slate-200/80 bg-white/50 p-3 dark:border-white/10 dark:bg-white/[0.04]",
|
|
19
22
|
className
|
|
20
23
|
),
|
|
21
|
-
children:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"aria-current": state === "current" ? "step" : void 0,
|
|
38
|
-
children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
"span",
|
|
41
|
-
{
|
|
42
|
-
className: cx(
|
|
43
|
-
"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
|
|
44
|
-
state === "current" && "bg-blue-600 text-white ring-black/0",
|
|
45
|
-
state === "done" && "bg-emerald-600 text-white ring-black/0",
|
|
46
|
-
state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
|
|
47
|
-
),
|
|
48
|
-
children: state === "done" ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
|
|
49
|
-
}
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx("ol", { className: "grid grid-cols-1 gap-3 sm:grid-cols-4", children: steps.map((s, i) => {
|
|
26
|
+
const state = i < current ? "done" : i === current ? "current" : "upcoming";
|
|
27
|
+
const canClick = clickable && i <= current && !s.disabled && onChange;
|
|
28
|
+
return /* @__PURE__ */ jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs(
|
|
29
|
+
Button,
|
|
30
|
+
{
|
|
31
|
+
unstyled: true,
|
|
32
|
+
type: "button",
|
|
33
|
+
disabled: !canClick,
|
|
34
|
+
onClick: () => canClick && (onChange == null ? void 0 : onChange(i)),
|
|
35
|
+
className: cx(
|
|
36
|
+
"group flex w-full items-center gap-3 rounded-xl border px-3 py-2 text-left transition",
|
|
37
|
+
state === "current" && "border-blue-300/70 bg-blue-50/50 text-blue-900 dark:border-blue-300/20 dark:bg-blue-300/5 dark:text-blue-100",
|
|
38
|
+
state === "done" && "border-emerald-300/50 bg-emerald-50/40 text-emerald-900 hover:bg-emerald-50 dark:border-emerald-300/20 dark:bg-emerald-300/5 dark:text-emerald-100",
|
|
39
|
+
state === "upcoming" && "border-slate-200/80 bg-white hover:bg-slate-50 dark:border-white/10 dark:bg-white/5"
|
|
50
40
|
),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
"aria-current": state === "current" ? "step" : void 0,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
className: cx(
|
|
47
|
+
"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[13px] font-semibold ring-1",
|
|
48
|
+
state === "current" && "bg-blue-600 text-white ring-black/0",
|
|
49
|
+
state === "done" && "bg-emerald-600 text-white ring-black/0",
|
|
50
|
+
state === "upcoming" && "bg-slate-100 text-slate-700 ring-black/5 dark:bg-white/10 dark:text-slate-200"
|
|
51
|
+
),
|
|
52
|
+
children: state === "done" ? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: 3, children: /* @__PURE__ */ jsx("path", { d: "m5 12 4 4L19 6" }) }) : i + 1
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
|
|
56
|
+
/* @__PURE__ */ jsx("span", { className: "block truncate text-[13px] font-semibold", children: s.label }),
|
|
57
|
+
!compact && s.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-[12px] text-slate-500", children: s.description })
|
|
58
|
+
] })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) }, s.key);
|
|
62
|
+
}) }),
|
|
63
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 h-1.5 w-full overflow-hidden rounded-full bg-slate-200/70 dark:bg-white/10", children: /* @__PURE__ */ jsx(
|
|
64
|
+
motion.div,
|
|
65
|
+
{
|
|
66
|
+
className: "h-full rounded-full bg-blue-600 dark:bg-blue-400",
|
|
67
|
+
initial: { width: 0 },
|
|
68
|
+
animate: { width: `${Math.max(0, Math.min(100, progressPct))}%` },
|
|
69
|
+
transition: springSm
|
|
56
70
|
}
|
|
57
|
-
) }
|
|
58
|
-
|
|
71
|
+
) })
|
|
72
|
+
]
|
|
59
73
|
}
|
|
60
74
|
);
|
|
61
75
|
}
|
package/dist/StorageUsage.js
CHANGED
|
@@ -33,6 +33,8 @@ __export(StorageUsage_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(StorageUsage_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_Badge = __toESM(require("./Badge"));
|
|
37
39
|
var import_InfoGrid = __toESM(require("./InfoGrid"));
|
|
38
40
|
function cx(...a) {
|
|
@@ -75,13 +77,15 @@ function StorageUsage({
|
|
|
75
77
|
] })
|
|
76
78
|
] }),
|
|
77
79
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
-
|
|
80
|
+
import_framer_motion.motion.div,
|
|
79
81
|
{
|
|
80
82
|
className: cx(
|
|
81
83
|
"h-full bg-gradient-to-r from-sky-500/70 to-sky-500/20",
|
|
82
84
|
barClassName
|
|
83
85
|
),
|
|
84
|
-
|
|
86
|
+
initial: { width: 0 },
|
|
87
|
+
animate: { width: `${pct}%` },
|
|
88
|
+
transition: import_animations.springSm
|
|
85
89
|
}
|
|
86
90
|
) }),
|
|
87
91
|
showGrid && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
package/dist/StorageUsage.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 { springSm } from "./animations";
|
|
3
5
|
import Badge from "./Badge";
|
|
4
6
|
import InfoGrid from "./InfoGrid";
|
|
5
7
|
function cx(...a) {
|
|
@@ -42,13 +44,15 @@ function StorageUsage({
|
|
|
42
44
|
] })
|
|
43
45
|
] }),
|
|
44
46
|
/* @__PURE__ */ jsx("div", { className: "mt-2 h-2 overflow-hidden rounded-full bg-slate-100 dark:bg-white/10", children: /* @__PURE__ */ jsx(
|
|
45
|
-
|
|
47
|
+
motion.div,
|
|
46
48
|
{
|
|
47
49
|
className: cx(
|
|
48
50
|
"h-full bg-gradient-to-r from-sky-500/70 to-sky-500/20",
|
|
49
51
|
barClassName
|
|
50
52
|
),
|
|
51
|
-
|
|
53
|
+
initial: { width: 0 },
|
|
54
|
+
animate: { width: `${pct}%` },
|
|
55
|
+
transition: springSm
|
|
52
56
|
}
|
|
53
57
|
) }),
|
|
54
58
|
showGrid && /* @__PURE__ */ jsx(
|
package/dist/Table.d.mts
CHANGED
|
@@ -27,5 +27,9 @@ declare function Td({ children, className, align, colSpan, }: {
|
|
|
27
27
|
align?: "left" | "center" | "right";
|
|
28
28
|
colSpan?: number;
|
|
29
29
|
}): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function AnimatedBody({ children, className }: {
|
|
31
|
+
children: React__default.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}): react_jsx_runtime.JSX.Element;
|
|
30
34
|
|
|
31
|
-
export { SortTh, Td, Th };
|
|
35
|
+
export { AnimatedBody, SortTh, Td, Th };
|
package/dist/Table.d.ts
CHANGED
|
@@ -27,5 +27,9 @@ declare function Td({ children, className, align, colSpan, }: {
|
|
|
27
27
|
align?: "left" | "center" | "right";
|
|
28
28
|
colSpan?: number;
|
|
29
29
|
}): react_jsx_runtime.JSX.Element;
|
|
30
|
+
declare function AnimatedBody({ children, className }: {
|
|
31
|
+
children: React__default.ReactNode;
|
|
32
|
+
className?: string;
|
|
33
|
+
}): react_jsx_runtime.JSX.Element;
|
|
30
34
|
|
|
31
|
-
export { SortTh, Td, Th };
|
|
35
|
+
export { AnimatedBody, SortTh, Td, Th };
|
package/dist/Table.js
CHANGED
|
@@ -29,6 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
var Table_exports = {};
|
|
31
31
|
__export(Table_exports, {
|
|
32
|
+
AnimatedBody: () => AnimatedBody,
|
|
32
33
|
SortTh: () => SortTh,
|
|
33
34
|
Td: () => Td,
|
|
34
35
|
Th: () => Th
|
|
@@ -36,6 +37,8 @@ __export(Table_exports, {
|
|
|
36
37
|
module.exports = __toCommonJS(Table_exports);
|
|
37
38
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
38
39
|
var import_react = __toESM(require("react"));
|
|
40
|
+
var import_framer_motion = require("framer-motion");
|
|
41
|
+
var import_animations = require("./animations");
|
|
39
42
|
var import_Button = __toESM(require("./Button"));
|
|
40
43
|
function useMounted() {
|
|
41
44
|
const [mounted, setMounted] = import_react.default.useState(false);
|
|
@@ -97,19 +100,31 @@ function SortTh({
|
|
|
97
100
|
unstyled: true,
|
|
98
101
|
type: "button",
|
|
99
102
|
onClick,
|
|
100
|
-
className: "group inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
|
|
103
|
+
className: "group relative inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
|
|
101
104
|
children: [
|
|
102
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "relative", children: [
|
|
106
|
+
children,
|
|
107
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
108
|
+
import_framer_motion.motion.span,
|
|
109
|
+
{
|
|
110
|
+
layoutId: "sort-underline",
|
|
111
|
+
className: "absolute -bottom-0.5 left-0 right-0 h-0.5 rounded-full bg-current opacity-70",
|
|
112
|
+
transition: import_animations.microTransition
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }),
|
|
103
116
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
-
|
|
117
|
+
import_framer_motion.motion.svg,
|
|
105
118
|
{
|
|
106
119
|
suppressHydrationWarning: true,
|
|
107
120
|
viewBox: "0 0 24 24",
|
|
108
|
-
className: `h-4 w-4
|
|
121
|
+
className: `h-4 w-4 ${active ? "" : "opacity-30"}`,
|
|
109
122
|
fill: "none",
|
|
110
123
|
stroke: "currentColor",
|
|
111
124
|
strokeWidth: "2",
|
|
112
125
|
"aria-hidden": "true",
|
|
126
|
+
animate: { rotate: asc ? 0 : 180, opacity: active ? 0.8 : 0.3 },
|
|
127
|
+
transition: import_animations.microTransition,
|
|
113
128
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7 14l5-5 5 5" })
|
|
114
129
|
}
|
|
115
130
|
)
|
|
@@ -147,8 +162,20 @@ function Td({
|
|
|
147
162
|
}
|
|
148
163
|
);
|
|
149
164
|
}
|
|
165
|
+
function AnimatedBody({ children, className }) {
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
167
|
+
import_framer_motion.motion.tbody,
|
|
168
|
+
{
|
|
169
|
+
className,
|
|
170
|
+
initial: false,
|
|
171
|
+
transition: import_animations.microTransition,
|
|
172
|
+
children
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
}
|
|
150
176
|
// Annotate the CommonJS export names for ESM import in node:
|
|
151
177
|
0 && (module.exports = {
|
|
178
|
+
AnimatedBody,
|
|
152
179
|
SortTh,
|
|
153
180
|
Td,
|
|
154
181
|
Th
|
package/dist/Table.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 useMounted() {
|
|
6
8
|
const [mounted, setMounted] = React.useState(false);
|
|
@@ -62,19 +64,31 @@ function SortTh({
|
|
|
62
64
|
unstyled: true,
|
|
63
65
|
type: "button",
|
|
64
66
|
onClick,
|
|
65
|
-
className: "group inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
|
|
67
|
+
className: "group relative inline-flex items-center gap-1.5 rounded-lg px-2 py-1 transition hover:bg-slate-100/60 focus:outline-none focus:ring-2 focus:ring-blue-200 dark:hover:bg-white/10",
|
|
66
68
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ jsxs("span", { className: "relative", children: [
|
|
70
|
+
children,
|
|
71
|
+
active && /* @__PURE__ */ jsx(
|
|
72
|
+
motion.span,
|
|
73
|
+
{
|
|
74
|
+
layoutId: "sort-underline",
|
|
75
|
+
className: "absolute -bottom-0.5 left-0 right-0 h-0.5 rounded-full bg-current opacity-70",
|
|
76
|
+
transition: microTransition
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] }),
|
|
68
80
|
/* @__PURE__ */ jsx(
|
|
69
|
-
|
|
81
|
+
motion.svg,
|
|
70
82
|
{
|
|
71
83
|
suppressHydrationWarning: true,
|
|
72
84
|
viewBox: "0 0 24 24",
|
|
73
|
-
className: `h-4 w-4
|
|
85
|
+
className: `h-4 w-4 ${active ? "" : "opacity-30"}`,
|
|
74
86
|
fill: "none",
|
|
75
87
|
stroke: "currentColor",
|
|
76
88
|
strokeWidth: "2",
|
|
77
89
|
"aria-hidden": "true",
|
|
90
|
+
animate: { rotate: asc ? 0 : 180, opacity: active ? 0.8 : 0.3 },
|
|
91
|
+
transition: microTransition,
|
|
78
92
|
children: /* @__PURE__ */ jsx("path", { d: "M7 14l5-5 5 5" })
|
|
79
93
|
}
|
|
80
94
|
)
|
|
@@ -112,7 +126,19 @@ function Td({
|
|
|
112
126
|
}
|
|
113
127
|
);
|
|
114
128
|
}
|
|
129
|
+
function AnimatedBody({ children, className }) {
|
|
130
|
+
return /* @__PURE__ */ jsx(
|
|
131
|
+
motion.tbody,
|
|
132
|
+
{
|
|
133
|
+
className,
|
|
134
|
+
initial: false,
|
|
135
|
+
transition: microTransition,
|
|
136
|
+
children
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
115
140
|
export {
|
|
141
|
+
AnimatedBody,
|
|
116
142
|
SortTh,
|
|
117
143
|
Td,
|
|
118
144
|
Th
|
package/dist/Textarea.js
CHANGED
|
@@ -34,6 +34,8 @@ __export(Textarea_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Textarea_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_framer_motion = require("framer-motion");
|
|
38
|
+
var import_animations = require("./animations");
|
|
37
39
|
function cx(...a) {
|
|
38
40
|
return a.filter(Boolean).join(" ");
|
|
39
41
|
}
|
|
@@ -55,23 +57,46 @@ const Textarea = import_react.default.forwardRef(
|
|
|
55
57
|
);
|
|
56
58
|
}
|
|
57
59
|
const readOnly = !onChange;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
60
|
+
const [focused, setFocused] = import_react.default.useState(false);
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative", children: [
|
|
62
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
63
|
+
"textarea",
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
value,
|
|
67
|
+
onChange,
|
|
68
|
+
readOnly,
|
|
69
|
+
onFocus: (e) => {
|
|
70
|
+
var _a;
|
|
71
|
+
setFocused(true);
|
|
72
|
+
(_a = props.onFocus) == null ? void 0 : _a.call(props, e);
|
|
73
|
+
},
|
|
74
|
+
onBlur: (e) => {
|
|
75
|
+
var _a;
|
|
76
|
+
setFocused(false);
|
|
77
|
+
(_a = props.onBlur) == null ? void 0 : _a.call(props, e);
|
|
78
|
+
},
|
|
79
|
+
"aria-invalid": error ? true : void 0,
|
|
80
|
+
className: cx(
|
|
81
|
+
baseControl,
|
|
82
|
+
(error || tone === "danger") && errorControl,
|
|
83
|
+
className
|
|
84
|
+
),
|
|
85
|
+
rows,
|
|
86
|
+
...props
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
90
|
+
import_framer_motion.motion.span,
|
|
91
|
+
{
|
|
92
|
+
"aria-hidden": true,
|
|
93
|
+
className: "pointer-events-none absolute inset-0 rounded-2xl",
|
|
94
|
+
initial: false,
|
|
95
|
+
animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
|
|
96
|
+
transition: import_animations.microTransition
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] });
|
|
75
100
|
}
|
|
76
101
|
);
|
|
77
102
|
Textarea.displayName = "Textarea";
|
package/dist/Textarea.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { microTransition } from "./animations";
|
|
4
6
|
function cx(...a) {
|
|
5
7
|
return a.filter(Boolean).join(" ");
|
|
6
8
|
}
|
|
@@ -22,23 +24,46 @@ const Textarea = React.forwardRef(
|
|
|
22
24
|
);
|
|
23
25
|
}
|
|
24
26
|
const readOnly = !onChange;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
const [focused, setFocused] = React.useState(false);
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"textarea",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
value,
|
|
34
|
+
onChange,
|
|
35
|
+
readOnly,
|
|
36
|
+
onFocus: (e) => {
|
|
37
|
+
var _a;
|
|
38
|
+
setFocused(true);
|
|
39
|
+
(_a = props.onFocus) == null ? void 0 : _a.call(props, e);
|
|
40
|
+
},
|
|
41
|
+
onBlur: (e) => {
|
|
42
|
+
var _a;
|
|
43
|
+
setFocused(false);
|
|
44
|
+
(_a = props.onBlur) == null ? void 0 : _a.call(props, e);
|
|
45
|
+
},
|
|
46
|
+
"aria-invalid": error ? true : void 0,
|
|
47
|
+
className: cx(
|
|
48
|
+
baseControl,
|
|
49
|
+
(error || tone === "danger") && errorControl,
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
rows,
|
|
53
|
+
...props
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
motion.span,
|
|
58
|
+
{
|
|
59
|
+
"aria-hidden": true,
|
|
60
|
+
className: "pointer-events-none absolute inset-0 rounded-2xl",
|
|
61
|
+
initial: false,
|
|
62
|
+
animate: { boxShadow: focused ? "0 0 0 2px rgba(59,130,246,0.18)" : "0 0 0 0 rgba(0,0,0,0)" },
|
|
63
|
+
transition: microTransition
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
42
67
|
}
|
|
43
68
|
);
|
|
44
69
|
Textarea.displayName = "Textarea";
|