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/AppTopbar.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(AppTopbar_exports);
|
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_Button = __toESM(require("./Button"));
|
|
37
37
|
function AppTopbar({ title, subtitle, secondary, primary, actions, color }) {
|
|
38
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sticky top-0 z-30 border-b border-black/5 bg-
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sticky top-0 z-30 border-b border-black/5 bg-[var(--fx-surface)] backdrop-blur-xl dark:bg-[var(--fx-surface)]/60", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "px-4 sm:px-6 xl:px-8 xl:pl-20", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex h-16 items-center justify-between", children: [
|
|
39
39
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
40
40
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
41
41
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: subtitle })
|
package/dist/AppTopbar.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import Button from "./Button";
|
|
4
4
|
function AppTopbar({ title, subtitle, secondary, primary, actions, color }) {
|
|
5
|
-
return /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-30 border-b border-black/5 bg-
|
|
5
|
+
return /* @__PURE__ */ jsx("div", { className: "sticky top-0 z-30 border-b border-black/5 bg-[var(--fx-surface)] backdrop-blur-xl dark:bg-[var(--fx-surface)]/60", children: /* @__PURE__ */ jsx("div", { className: "px-4 sm:px-6 xl:px-8 xl:pl-20", children: /* @__PURE__ */ jsxs("div", { className: "flex h-16 items-center justify-between", children: [
|
|
6
6
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
7
7
|
/* @__PURE__ */ jsx("h1", { className: "text-lg font-semibold tracking-tight", children: title }),
|
|
8
8
|
subtitle && /* @__PURE__ */ jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: subtitle })
|
package/dist/AvatarGroup.js
CHANGED
|
@@ -34,6 +34,8 @@ __export(AvatarGroup_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(AvatarGroup_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_AvatarSquare = __toESM(require("./AvatarSquare"));
|
|
37
|
+
var import_framer_motion = require("framer-motion");
|
|
38
|
+
var import_animations = require("./animations");
|
|
37
39
|
function AvatarGroup({
|
|
38
40
|
sources,
|
|
39
41
|
images,
|
|
@@ -57,10 +59,10 @@ function AvatarGroup({
|
|
|
57
59
|
children: [
|
|
58
60
|
visible.map((src, i) => {
|
|
59
61
|
var _a2;
|
|
60
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { className: i > 0 && overlap ? "-ml-2" : void 0, layout: true, initial: { opacity: 0, scale: 0.9 }, animate: { opacity: 1, scale: 1 }, transition: import_animations.microTransition, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AvatarSquare.default, { src: src != null ? src : void 0, size, radiusClass, alt: (_a2 = labels == null ? void 0 : labels[i]) != null ? _a2 : "", initials: computeInitials(labels == null ? void 0 : labels[i]) }) }, `${src}-${i}`);
|
|
61
63
|
}),
|
|
62
64
|
showCounter && rest > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
-
|
|
65
|
+
import_framer_motion.motion.div,
|
|
64
66
|
{
|
|
65
67
|
className: [
|
|
66
68
|
overlap && visible.length > 0 ? "-ml-2" : "",
|
|
@@ -71,6 +73,9 @@ function AvatarGroup({
|
|
|
71
73
|
style: { width: size, height: size },
|
|
72
74
|
"aria-label": `+${rest}`,
|
|
73
75
|
title: `+${rest}`,
|
|
76
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
77
|
+
animate: { opacity: 1, scale: 1 },
|
|
78
|
+
transition: import_animations.microTransition,
|
|
74
79
|
children: [
|
|
75
80
|
"+",
|
|
76
81
|
rest
|
package/dist/AvatarGroup.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import AvatarSquare from "./AvatarSquare";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { microTransition } from "./animations";
|
|
4
6
|
function AvatarGroup({
|
|
5
7
|
sources,
|
|
6
8
|
images,
|
|
@@ -24,10 +26,10 @@ function AvatarGroup({
|
|
|
24
26
|
children: [
|
|
25
27
|
visible.map((src, i) => {
|
|
26
28
|
var _a2;
|
|
27
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
+
return /* @__PURE__ */ jsx(motion.div, { className: i > 0 && overlap ? "-ml-2" : void 0, layout: true, initial: { opacity: 0, scale: 0.9 }, animate: { opacity: 1, scale: 1 }, transition: microTransition, children: /* @__PURE__ */ jsx(AvatarSquare, { src: src != null ? src : void 0, size, radiusClass, alt: (_a2 = labels == null ? void 0 : labels[i]) != null ? _a2 : "", initials: computeInitials(labels == null ? void 0 : labels[i]) }) }, `${src}-${i}`);
|
|
28
30
|
}),
|
|
29
31
|
showCounter && rest > 0 && /* @__PURE__ */ jsxs(
|
|
30
|
-
|
|
32
|
+
motion.div,
|
|
31
33
|
{
|
|
32
34
|
className: [
|
|
33
35
|
overlap && visible.length > 0 ? "-ml-2" : "",
|
|
@@ -38,6 +40,9 @@ function AvatarGroup({
|
|
|
38
40
|
style: { width: size, height: size },
|
|
39
41
|
"aria-label": `+${rest}`,
|
|
40
42
|
title: `+${rest}`,
|
|
43
|
+
initial: { opacity: 0, scale: 0.9 },
|
|
44
|
+
animate: { opacity: 1, scale: 1 },
|
|
45
|
+
transition: microTransition,
|
|
41
46
|
children: [
|
|
42
47
|
"+",
|
|
43
48
|
rest
|
package/dist/Badge.js
CHANGED
|
@@ -23,6 +23,8 @@ __export(Badge_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(Badge_exports);
|
|
25
25
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
26
|
+
var import_framer_motion = require("framer-motion");
|
|
27
|
+
var import_animations = require("./animations");
|
|
26
28
|
const tones = {
|
|
27
29
|
emerald: "bg-emerald-100 text-emerald-700 ring-1 ring-emerald-200",
|
|
28
30
|
indigo: "bg-indigo-100 text-indigo-700 ring-1 ring-indigo-200",
|
|
@@ -56,7 +58,7 @@ function Badge({
|
|
|
56
58
|
const sz = (_a = sizeClasses[size]) != null ? _a : sizeClasses.md;
|
|
57
59
|
const chosenTone = color != null ? color : tone;
|
|
58
60
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
59
|
-
|
|
61
|
+
import_framer_motion.motion.span,
|
|
60
62
|
{
|
|
61
63
|
title,
|
|
62
64
|
onClick,
|
|
@@ -68,6 +70,9 @@ function Badge({
|
|
|
68
70
|
clickable ? "cursor-pointer hover:opacity-90 active:scale-[0.98]" : "",
|
|
69
71
|
className
|
|
70
72
|
].join(" "),
|
|
73
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
74
|
+
animate: { opacity: 1, scale: 1 },
|
|
75
|
+
transition: import_animations.microTransition,
|
|
71
76
|
children: [
|
|
72
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: ["inline-block rounded-full bg-current opacity-70", sz.dot].join(" ") }),
|
|
73
78
|
children
|
package/dist/Badge.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
|
const tones = {
|
|
4
6
|
emerald: "bg-emerald-100 text-emerald-700 ring-1 ring-emerald-200",
|
|
5
7
|
indigo: "bg-indigo-100 text-indigo-700 ring-1 ring-indigo-200",
|
|
@@ -33,7 +35,7 @@ function Badge({
|
|
|
33
35
|
const sz = (_a = sizeClasses[size]) != null ? _a : sizeClasses.md;
|
|
34
36
|
const chosenTone = color != null ? color : tone;
|
|
35
37
|
return /* @__PURE__ */ jsxs(
|
|
36
|
-
|
|
38
|
+
motion.span,
|
|
37
39
|
{
|
|
38
40
|
title,
|
|
39
41
|
onClick,
|
|
@@ -45,6 +47,9 @@ function Badge({
|
|
|
45
47
|
clickable ? "cursor-pointer hover:opacity-90 active:scale-[0.98]" : "",
|
|
46
48
|
className
|
|
47
49
|
].join(" "),
|
|
50
|
+
initial: { opacity: 0, scale: 0.96 },
|
|
51
|
+
animate: { opacity: 1, scale: 1 },
|
|
52
|
+
transition: microTransition,
|
|
48
53
|
children: [
|
|
49
54
|
/* @__PURE__ */ jsx("span", { className: ["inline-block rounded-full bg-current opacity-70", sz.dot].join(" ") }),
|
|
50
55
|
children
|
package/dist/Breadcrumb.js
CHANGED
|
@@ -34,9 +34,53 @@ __export(Breadcrumb_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Breadcrumb_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 Breadcrumb({ items }) {
|
|
38
40
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: "mb-4 flex items-center text-sm text-slate-500 dark:text-slate-400", "aria-label": "Breadcrumb", children: items.map((it, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
39
|
-
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
40
|
-
|
|
41
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
42
|
+
import_framer_motion.motion.svg,
|
|
43
|
+
{
|
|
44
|
+
viewBox: "0 0 20 20",
|
|
45
|
+
className: "mx-2 h-4 w-4 opacity-50",
|
|
46
|
+
fill: "currentColor",
|
|
47
|
+
initial: { opacity: 0, x: -4 },
|
|
48
|
+
animate: { opacity: 0.5, x: 0 },
|
|
49
|
+
transition: import_animations.microTransition,
|
|
50
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7 4l6 6-6 6" })
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
it.href ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
54
|
+
import_framer_motion.motion.a,
|
|
55
|
+
{
|
|
56
|
+
className: "relative hover:text-slate-700",
|
|
57
|
+
href: it.href,
|
|
58
|
+
initial: { opacity: 0, y: 4 },
|
|
59
|
+
animate: { opacity: 1, y: 0 },
|
|
60
|
+
transition: import_animations.microTransition,
|
|
61
|
+
children: [
|
|
62
|
+
it.label,
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
64
|
+
import_framer_motion.motion.span,
|
|
65
|
+
{
|
|
66
|
+
className: "absolute left-0 right-0 -bottom-0.5 h-[2px] origin-left rounded-full opacity-0",
|
|
67
|
+
style: { backgroundColor: "currentColor" },
|
|
68
|
+
whileHover: { opacity: 1, scaleX: 1 },
|
|
69
|
+
initial: { scaleX: 0 },
|
|
70
|
+
transition: import_animations.microTransition
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_framer_motion.motion.span,
|
|
77
|
+
{
|
|
78
|
+
className: "font-medium text-slate-900 dark:text-slate-100",
|
|
79
|
+
initial: { opacity: 0, y: 4 },
|
|
80
|
+
animate: { opacity: 1, y: 0 },
|
|
81
|
+
transition: import_animations.microTransition,
|
|
82
|
+
children: it.label
|
|
83
|
+
}
|
|
84
|
+
)
|
|
41
85
|
] }, i)) });
|
|
42
86
|
}
|
package/dist/Breadcrumb.mjs
CHANGED
|
@@ -1,10 +1,54 @@
|
|
|
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
|
function Breadcrumb({ items }) {
|
|
5
7
|
return /* @__PURE__ */ jsx("nav", { className: "mb-4 flex items-center text-sm text-slate-500 dark:text-slate-400", "aria-label": "Breadcrumb", children: items.map((it, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
6
|
-
i > 0 && /* @__PURE__ */ jsx(
|
|
7
|
-
|
|
8
|
+
i > 0 && /* @__PURE__ */ jsx(
|
|
9
|
+
motion.svg,
|
|
10
|
+
{
|
|
11
|
+
viewBox: "0 0 20 20",
|
|
12
|
+
className: "mx-2 h-4 w-4 opacity-50",
|
|
13
|
+
fill: "currentColor",
|
|
14
|
+
initial: { opacity: 0, x: -4 },
|
|
15
|
+
animate: { opacity: 0.5, x: 0 },
|
|
16
|
+
transition: microTransition,
|
|
17
|
+
children: /* @__PURE__ */ jsx("path", { d: "M7 4l6 6-6 6" })
|
|
18
|
+
}
|
|
19
|
+
),
|
|
20
|
+
it.href ? /* @__PURE__ */ jsxs(
|
|
21
|
+
motion.a,
|
|
22
|
+
{
|
|
23
|
+
className: "relative hover:text-slate-700",
|
|
24
|
+
href: it.href,
|
|
25
|
+
initial: { opacity: 0, y: 4 },
|
|
26
|
+
animate: { opacity: 1, y: 0 },
|
|
27
|
+
transition: microTransition,
|
|
28
|
+
children: [
|
|
29
|
+
it.label,
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
motion.span,
|
|
32
|
+
{
|
|
33
|
+
className: "absolute left-0 right-0 -bottom-0.5 h-[2px] origin-left rounded-full opacity-0",
|
|
34
|
+
style: { backgroundColor: "currentColor" },
|
|
35
|
+
whileHover: { opacity: 1, scaleX: 1 },
|
|
36
|
+
initial: { scaleX: 0 },
|
|
37
|
+
transition: microTransition
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
) : /* @__PURE__ */ jsx(
|
|
43
|
+
motion.span,
|
|
44
|
+
{
|
|
45
|
+
className: "font-medium text-slate-900 dark:text-slate-100",
|
|
46
|
+
initial: { opacity: 0, y: 4 },
|
|
47
|
+
animate: { opacity: 1, y: 0 },
|
|
48
|
+
transition: microTransition,
|
|
49
|
+
children: it.label
|
|
50
|
+
}
|
|
51
|
+
)
|
|
8
52
|
] }, i)) });
|
|
9
53
|
}
|
|
10
54
|
export {
|
package/dist/Button.js
CHANGED
|
@@ -34,6 +34,8 @@ __export(Button_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Button_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
|
const Button = import_react.default.forwardRef(({
|
|
38
40
|
children,
|
|
39
41
|
variant = "primary",
|
|
@@ -163,8 +165,9 @@ const Button = import_react.default.forwardRef(({
|
|
|
163
165
|
const iconRight = !loading ? rightIcon : void 0;
|
|
164
166
|
const visibleParts = [iconLeft, showText ? true : null, iconRight].filter(Boolean).length;
|
|
165
167
|
const gapClass = visibleParts > 1 ? "gap-2" : "gap-0";
|
|
168
|
+
const { onDrag, onDragStart, onDragEnd, onDragOver, onDragEnter, onDragLeave, ...domRest } = rest;
|
|
166
169
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
167
|
-
|
|
170
|
+
import_framer_motion.motion.button,
|
|
168
171
|
{
|
|
169
172
|
ref,
|
|
170
173
|
type,
|
|
@@ -179,7 +182,10 @@ const Button = import_react.default.forwardRef(({
|
|
|
179
182
|
block ? "w-full" : "",
|
|
180
183
|
className
|
|
181
184
|
].join(" "),
|
|
182
|
-
|
|
185
|
+
whileTap: !disabled && !loading ? { scale: 0.98 } : void 0,
|
|
186
|
+
whileHover: !disabled && !loading ? { y: -0.5 } : void 0,
|
|
187
|
+
transition: import_animations.microTransition,
|
|
188
|
+
...domRest,
|
|
183
189
|
children: [
|
|
184
190
|
loading && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4 animate-spin", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
185
191
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "9", className: "opacity-25" }),
|
package/dist/Button.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
|
const Button = React.forwardRef(({
|
|
5
7
|
children,
|
|
6
8
|
variant = "primary",
|
|
@@ -130,8 +132,9 @@ const Button = React.forwardRef(({
|
|
|
130
132
|
const iconRight = !loading ? rightIcon : void 0;
|
|
131
133
|
const visibleParts = [iconLeft, showText ? true : null, iconRight].filter(Boolean).length;
|
|
132
134
|
const gapClass = visibleParts > 1 ? "gap-2" : "gap-0";
|
|
135
|
+
const { onDrag, onDragStart, onDragEnd, onDragOver, onDragEnter, onDragLeave, ...domRest } = rest;
|
|
133
136
|
return /* @__PURE__ */ jsxs(
|
|
134
|
-
|
|
137
|
+
motion.button,
|
|
135
138
|
{
|
|
136
139
|
ref,
|
|
137
140
|
type,
|
|
@@ -146,7 +149,10 @@ const Button = React.forwardRef(({
|
|
|
146
149
|
block ? "w-full" : "",
|
|
147
150
|
className
|
|
148
151
|
].join(" "),
|
|
149
|
-
|
|
152
|
+
whileTap: !disabled && !loading ? { scale: 0.98 } : void 0,
|
|
153
|
+
whileHover: !disabled && !loading ? { y: -0.5 } : void 0,
|
|
154
|
+
transition: microTransition,
|
|
155
|
+
...domRest,
|
|
150
156
|
children: [
|
|
151
157
|
loading && /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-4 w-4 animate-spin", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
152
158
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "9", className: "opacity-25" }),
|
package/dist/CalendarPanel.js
CHANGED
|
@@ -34,6 +34,8 @@ __export(CalendarPanel_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(CalendarPanel_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_Button = __toESM(require("./Button"));
|
|
37
|
+
var import_react = __toESM(require("react"));
|
|
38
|
+
var import_framer_motion = require("framer-motion");
|
|
37
39
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
38
40
|
const fmtISODate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
39
41
|
const dow = ["D", "L", "M", "M", "J", "V", "S"];
|
|
@@ -59,6 +61,7 @@ function CalendarPanel({
|
|
|
59
61
|
const month = cursor.getMonth();
|
|
60
62
|
const today = /* @__PURE__ */ new Date();
|
|
61
63
|
const grid = buildMonthGrid(year, month);
|
|
64
|
+
const dirRef = import_react.default.useRef(0);
|
|
62
65
|
const withinBounds = (d) => {
|
|
63
66
|
if (!min && !max) return true;
|
|
64
67
|
const t = d.getTime();
|
|
@@ -82,7 +85,10 @@ function CalendarPanel({
|
|
|
82
85
|
unstyled: true,
|
|
83
86
|
type: "button",
|
|
84
87
|
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/15",
|
|
85
|
-
onClick: () =>
|
|
88
|
+
onClick: () => {
|
|
89
|
+
dirRef.current = -1;
|
|
90
|
+
onCursorChange(new Date(year, month - 1, 1));
|
|
91
|
+
},
|
|
86
92
|
children: "\u25C0"
|
|
87
93
|
}
|
|
88
94
|
),
|
|
@@ -92,36 +98,49 @@ function CalendarPanel({
|
|
|
92
98
|
unstyled: true,
|
|
93
99
|
type: "button",
|
|
94
100
|
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/15",
|
|
95
|
-
onClick: () =>
|
|
101
|
+
onClick: () => {
|
|
102
|
+
dirRef.current = 1;
|
|
103
|
+
onCursorChange(new Date(year, month + 1, 1));
|
|
104
|
+
},
|
|
96
105
|
children: "\u25B6"
|
|
97
106
|
}
|
|
98
107
|
)
|
|
99
108
|
] })
|
|
100
109
|
] }),
|
|
101
110
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-1 px-2 pb-2 text-center text-[11px] uppercase tracking-wide text-slate-500 dark:text-slate-400", children: dow.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "py-1", children: d }, i)) }),
|
|
102
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
disabled
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
112
|
+
import_framer_motion.motion.div,
|
|
113
|
+
{
|
|
114
|
+
className: "grid grid-cols-7 gap-1 px-2 pb-2",
|
|
115
|
+
initial: { x: dirRef.current === 0 ? 0 : dirRef.current > 0 ? 32 : -32, opacity: 0 },
|
|
116
|
+
animate: { x: 0, opacity: 1 },
|
|
117
|
+
transition: { type: "spring", stiffness: 260, damping: 24 },
|
|
118
|
+
children: grid.map((d) => {
|
|
119
|
+
const inMonth = d.getMonth() === month;
|
|
120
|
+
const selected = value && fmtISODate(d) === fmtISODate(value);
|
|
121
|
+
const isToday = fmtISODate(d) === fmtISODate(today);
|
|
122
|
+
const disabled = !withinBounds(d);
|
|
123
|
+
const key = d.toISOString().slice(0, 10);
|
|
124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
125
|
+
import_Button.default,
|
|
126
|
+
{
|
|
127
|
+
unstyled: true,
|
|
128
|
+
type: "button",
|
|
129
|
+
disabled,
|
|
130
|
+
onClick: () => !disabled && onPick(d),
|
|
131
|
+
className: [
|
|
132
|
+
"h-9 rounded-xl text-sm flex items-center justify-center leading-none",
|
|
133
|
+
selected ? "bg-slate-900 text-white dark:bg-white dark:text-slate-900" : isToday ? "border border-slate-300/70 dark:border-white/20" : "hover:bg-slate-100 dark:hover:bg-white/15",
|
|
134
|
+
inMonth ? "text-slate-700 dark:text-slate-100" : "text-slate-400 dark:text-white/40",
|
|
135
|
+
disabled && "opacity-40 cursor-not-allowed"
|
|
136
|
+
].filter(Boolean).join(" "),
|
|
137
|
+
children: d.getDate()
|
|
138
|
+
},
|
|
139
|
+
key
|
|
140
|
+
);
|
|
141
|
+
})
|
|
142
|
+
},
|
|
143
|
+
`${year}-${month}`
|
|
144
|
+
)
|
|
126
145
|
] });
|
|
127
146
|
}
|
package/dist/CalendarPanel.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 React from "react";
|
|
5
|
+
import { motion } from "framer-motion";
|
|
4
6
|
const pad2 = (n) => n < 10 ? `0${n}` : String(n);
|
|
5
7
|
const fmtISODate = (d) => `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
|
|
6
8
|
const dow = ["D", "L", "M", "M", "J", "V", "S"];
|
|
@@ -26,6 +28,7 @@ function CalendarPanel({
|
|
|
26
28
|
const month = cursor.getMonth();
|
|
27
29
|
const today = /* @__PURE__ */ new Date();
|
|
28
30
|
const grid = buildMonthGrid(year, month);
|
|
31
|
+
const dirRef = React.useRef(0);
|
|
29
32
|
const withinBounds = (d) => {
|
|
30
33
|
if (!min && !max) return true;
|
|
31
34
|
const t = d.getTime();
|
|
@@ -49,7 +52,10 @@ function CalendarPanel({
|
|
|
49
52
|
unstyled: true,
|
|
50
53
|
type: "button",
|
|
51
54
|
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/15",
|
|
52
|
-
onClick: () =>
|
|
55
|
+
onClick: () => {
|
|
56
|
+
dirRef.current = -1;
|
|
57
|
+
onCursorChange(new Date(year, month - 1, 1));
|
|
58
|
+
},
|
|
53
59
|
children: "\u25C0"
|
|
54
60
|
}
|
|
55
61
|
),
|
|
@@ -59,37 +65,50 @@ function CalendarPanel({
|
|
|
59
65
|
unstyled: true,
|
|
60
66
|
type: "button",
|
|
61
67
|
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/15",
|
|
62
|
-
onClick: () =>
|
|
68
|
+
onClick: () => {
|
|
69
|
+
dirRef.current = 1;
|
|
70
|
+
onCursorChange(new Date(year, month + 1, 1));
|
|
71
|
+
},
|
|
63
72
|
children: "\u25B6"
|
|
64
73
|
}
|
|
65
74
|
)
|
|
66
75
|
] })
|
|
67
76
|
] }),
|
|
68
77
|
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-7 gap-1 px-2 pb-2 text-center text-[11px] uppercase tracking-wide text-slate-500 dark:text-slate-400", children: dow.map((d, i) => /* @__PURE__ */ jsx("div", { className: "py-1", children: d }, i)) }),
|
|
69
|
-
/* @__PURE__ */ jsx(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
disabled
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
motion.div,
|
|
80
|
+
{
|
|
81
|
+
className: "grid grid-cols-7 gap-1 px-2 pb-2",
|
|
82
|
+
initial: { x: dirRef.current === 0 ? 0 : dirRef.current > 0 ? 32 : -32, opacity: 0 },
|
|
83
|
+
animate: { x: 0, opacity: 1 },
|
|
84
|
+
transition: { type: "spring", stiffness: 260, damping: 24 },
|
|
85
|
+
children: grid.map((d) => {
|
|
86
|
+
const inMonth = d.getMonth() === month;
|
|
87
|
+
const selected = value && fmtISODate(d) === fmtISODate(value);
|
|
88
|
+
const isToday = fmtISODate(d) === fmtISODate(today);
|
|
89
|
+
const disabled = !withinBounds(d);
|
|
90
|
+
const key = d.toISOString().slice(0, 10);
|
|
91
|
+
return /* @__PURE__ */ jsx(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
unstyled: true,
|
|
95
|
+
type: "button",
|
|
96
|
+
disabled,
|
|
97
|
+
onClick: () => !disabled && onPick(d),
|
|
98
|
+
className: [
|
|
99
|
+
"h-9 rounded-xl text-sm flex items-center justify-center leading-none",
|
|
100
|
+
selected ? "bg-slate-900 text-white dark:bg-white dark:text-slate-900" : isToday ? "border border-slate-300/70 dark:border-white/20" : "hover:bg-slate-100 dark:hover:bg-white/15",
|
|
101
|
+
inMonth ? "text-slate-700 dark:text-slate-100" : "text-slate-400 dark:text-white/40",
|
|
102
|
+
disabled && "opacity-40 cursor-not-allowed"
|
|
103
|
+
].filter(Boolean).join(" "),
|
|
104
|
+
children: d.getDate()
|
|
105
|
+
},
|
|
106
|
+
key
|
|
107
|
+
);
|
|
108
|
+
})
|
|
109
|
+
},
|
|
110
|
+
`${year}-${month}`
|
|
111
|
+
)
|
|
93
112
|
] });
|
|
94
113
|
}
|
|
95
114
|
export {
|
package/dist/Card.js
CHANGED
|
@@ -34,15 +34,20 @@ __export(Card_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Card_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
|
const base = "rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-white/5";
|
|
38
40
|
const Card = import_react.default.forwardRef(
|
|
39
41
|
({ className, children, ...rest }, ref) => {
|
|
42
|
+
const { onDrag, onDragStart, onDragEnd, onDragOver, onDragEnter, onDragLeave, ...domRest } = rest;
|
|
40
43
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
-
|
|
44
|
+
import_framer_motion.motion.div,
|
|
42
45
|
{
|
|
43
46
|
ref,
|
|
44
47
|
className: [base, className].filter(Boolean).join(" "),
|
|
45
|
-
|
|
48
|
+
whileHover: { y: -2 },
|
|
49
|
+
transition: import_animations.microTransition,
|
|
50
|
+
...domRest,
|
|
46
51
|
children
|
|
47
52
|
}
|
|
48
53
|
);
|
package/dist/Card.mjs
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { motion } from "framer-motion";
|
|
5
|
+
import { microTransition } from "./animations";
|
|
4
6
|
const base = "rounded-2xl border border-slate-200 bg-white p-4 shadow-sm dark:border-white/10 dark:bg-white/5";
|
|
5
7
|
const Card = React.forwardRef(
|
|
6
8
|
({ className, children, ...rest }, ref) => {
|
|
9
|
+
const { onDrag, onDragStart, onDragEnd, onDragOver, onDragEnter, onDragLeave, ...domRest } = rest;
|
|
7
10
|
return /* @__PURE__ */ jsx(
|
|
8
|
-
|
|
11
|
+
motion.div,
|
|
9
12
|
{
|
|
10
13
|
ref,
|
|
11
14
|
className: [base, className].filter(Boolean).join(" "),
|
|
12
|
-
|
|
15
|
+
whileHover: { y: -2 },
|
|
16
|
+
transition: microTransition,
|
|
17
|
+
...domRest,
|
|
13
18
|
children
|
|
14
19
|
}
|
|
15
20
|
);
|