framepexls-ui-lib 0.3.1 → 0.3.3
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/AvatarGroup.js +1 -1
- package/dist/AvatarGroup.mjs +1 -1
- package/dist/Badge.js +12 -12
- package/dist/Badge.mjs +12 -12
- package/dist/BadgeCluster.js +1 -1
- package/dist/BadgeCluster.mjs +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/Card.mjs +1 -1
- package/dist/ChartCard.js +1 -1
- package/dist/ChartCard.mjs +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.mjs +1 -1
- package/dist/CheckboxPillsGroup.js +3 -3
- package/dist/CheckboxPillsGroup.mjs +3 -3
- package/dist/ComboSelect.js +2 -2
- package/dist/ComboSelect.mjs +2 -2
- package/dist/DateTimeField.js +7 -4
- package/dist/DateTimeField.mjs +7 -4
- package/dist/EmptyState.js +1 -1
- package/dist/EmptyState.mjs +1 -1
- package/dist/FiltersMultiSelect.js +3 -3
- package/dist/FiltersMultiSelect.mjs +3 -3
- package/dist/Input.js +4 -4
- package/dist/Input.mjs +4 -4
- package/dist/KpiCard.js +1 -1
- package/dist/KpiCard.mjs +1 -1
- package/dist/MediaCard.js +1 -1
- package/dist/MediaCard.mjs +1 -1
- package/dist/MediaSelector.js +235 -135
- package/dist/MediaSelector.mjs +235 -135
- package/dist/MediaTile.d.mts +18 -0
- package/dist/MediaTile.d.ts +18 -0
- package/dist/MediaTile.js +146 -0
- package/dist/MediaTile.mjs +116 -0
- package/dist/MultiComboSelect.js +2 -2
- package/dist/MultiComboSelect.mjs +2 -2
- package/dist/Pagination.js +8 -6
- package/dist/Pagination.mjs +8 -6
- package/dist/Sidebar.js +9 -9
- package/dist/Sidebar.mjs +9 -9
- package/dist/Skeleton.d.mts +34 -0
- package/dist/Skeleton.d.ts +34 -0
- package/dist/Skeleton.js +92 -0
- package/dist/Skeleton.mjs +64 -0
- package/dist/StatCard.js +1 -1
- package/dist/StatCard.mjs +1 -1
- package/dist/Steps.js +2 -2
- package/dist/Steps.mjs +2 -2
- package/dist/Table.js +5 -5
- package/dist/Table.mjs +5 -5
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.mjs +1 -1
- package/dist/TimePanel.js +4 -4
- package/dist/TimePanel.mjs +4 -4
- package/dist/TimePopover.js +2 -2
- package/dist/TimePopover.mjs +2 -2
- package/dist/TimeRangeField.js +7 -4
- package/dist/TimeRangeField.mjs +7 -4
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.mjs +1 -1
- package/dist/UploadCard.js +7 -7
- package/dist/UploadCard.mjs +7 -7
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.mjs +68 -64
- package/dist/theme/ThemeToggle.js +2 -1
- package/dist/theme/ThemeToggle.mjs +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import Image from "next/image";
|
|
5
|
+
import { motion } from "framer-motion";
|
|
6
|
+
import { microTransition } from "./animations";
|
|
7
|
+
import Dropdown from "./Dropdown";
|
|
8
|
+
function MediaTile({
|
|
9
|
+
imageUrl,
|
|
10
|
+
title,
|
|
11
|
+
subtitle,
|
|
12
|
+
copyUrl,
|
|
13
|
+
onPreview,
|
|
14
|
+
onRename,
|
|
15
|
+
onReplace,
|
|
16
|
+
onDelete,
|
|
17
|
+
loading,
|
|
18
|
+
menuSize = "md",
|
|
19
|
+
className
|
|
20
|
+
}) {
|
|
21
|
+
const [copied, setCopied] = useState(false);
|
|
22
|
+
const copy = async () => {
|
|
23
|
+
if (!copyUrl) return;
|
|
24
|
+
try {
|
|
25
|
+
await navigator.clipboard.writeText(copyUrl);
|
|
26
|
+
setCopied(true);
|
|
27
|
+
setTimeout(() => setCopied(false), 1200);
|
|
28
|
+
} catch {
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const btnSize = menuSize === "lg" ? "h-11 w-11" : menuSize === "sm" ? "h-8 w-8" : "h-9 w-9";
|
|
32
|
+
const iconSize = menuSize === "lg" ? "h-7 w-7" : menuSize === "sm" ? "h-5 w-5" : "h-6 w-6";
|
|
33
|
+
const ImgWrap = onPreview ? (props) => /* @__PURE__ */ jsx("button", { type: "button", onClick: onPreview, ...props }) : (props) => /* @__PURE__ */ jsx("div", { ...props });
|
|
34
|
+
if (loading) {
|
|
35
|
+
return /* @__PURE__ */ jsxs(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: [
|
|
39
|
+
"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-[var(--fx-surface)]",
|
|
40
|
+
className != null ? className : ""
|
|
41
|
+
].join(" "),
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx("div", { className: "aspect-square w-full", children: /* @__PURE__ */ jsx("div", { className: "h-full w-full animate-pulse bg-slate-200 dark:bg-white/10" }) }),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "p-2 space-y-2", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-3/4 animate-pulse rounded bg-slate-200 dark:bg-white/10" }),
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "h-2 w-1/3 animate-pulse rounded bg-slate-200 dark:bg-white/10" })
|
|
47
|
+
] })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
53
|
+
motion.div,
|
|
54
|
+
{
|
|
55
|
+
whileHover: { y: -2 },
|
|
56
|
+
transition: microTransition,
|
|
57
|
+
className: [
|
|
58
|
+
"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-[var(--fx-surface)]",
|
|
59
|
+
className != null ? className : ""
|
|
60
|
+
].join(" "),
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsxs(ImgWrap, { className: "aspect-square w-full bg-slate-100 relative text-left", children: [
|
|
63
|
+
imageUrl ? /* @__PURE__ */ jsx(
|
|
64
|
+
Image,
|
|
65
|
+
{
|
|
66
|
+
src: imageUrl,
|
|
67
|
+
alt: title,
|
|
68
|
+
fill: true,
|
|
69
|
+
sizes: "(min-width:1024px) 20vw, (min-width:768px) 25vw, (min-width:640px) 33vw, 50vw",
|
|
70
|
+
className: "object-cover transition-transform duration-200 will-change-transform group-hover:scale-105"
|
|
71
|
+
}
|
|
72
|
+
) : /* @__PURE__ */ jsx("div", { className: "h-full w-full" }),
|
|
73
|
+
/* @__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" })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-2", children: [
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-medium", children: title }),
|
|
78
|
+
subtitle && /* @__PURE__ */ jsx("div", { className: "text-xs text-slate-500 dark:text-slate-400", children: subtitle })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
81
|
+
/* @__PURE__ */ jsx(Dropdown.Trigger, { "aria-label": "Acciones", className: [btnSize, "p-0 !gap-0"].join(" "), children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: iconSize, fill: "currentColor", children: [
|
|
82
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "5", r: "2" }),
|
|
83
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "2" }),
|
|
84
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "19", r: "2" })
|
|
85
|
+
] }) }),
|
|
86
|
+
/* @__PURE__ */ jsxs(Dropdown.Content, { children: [
|
|
87
|
+
onPreview && /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onPreview, icon: /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("path", { d: "M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z" }),
|
|
89
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
90
|
+
] }) }), children: "Ver" }),
|
|
91
|
+
copyUrl && /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: copy, icon: /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
92
|
+
/* @__PURE__ */ jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
|
|
93
|
+
/* @__PURE__ */ jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
94
|
+
] }) }), children: copied ? "Copiado" : "Copiar URL" }),
|
|
95
|
+
(onRename || onReplace) && /* @__PURE__ */ jsx(Dropdown.Separator, {}),
|
|
96
|
+
onRename && /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onRename, icon: /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
97
|
+
/* @__PURE__ */ jsx("path", { d: "M3 21v-4l12-12 4 4-12 12z" }),
|
|
98
|
+
/* @__PURE__ */ jsx("path", { d: "M14 7l4 4" })
|
|
99
|
+
] }) }), children: "Renombrar" }),
|
|
100
|
+
onReplace && /* @__PURE__ */ jsx(Dropdown.Item, { onSelect: onReplace, icon: /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M12 5v14M5 12h14" }) }) }), children: "Reemplazar" }),
|
|
101
|
+
onDelete && /* @__PURE__ */ jsx(Dropdown.Item, { danger: true, onSelect: onDelete, icon: /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
102
|
+
/* @__PURE__ */ jsx("path", { d: "M3 6h18" }),
|
|
103
|
+
/* @__PURE__ */ jsx("path", { d: "M8 6v14a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V6" }),
|
|
104
|
+
/* @__PURE__ */ jsx("path", { d: "M10 11v6M14 11v6" }),
|
|
105
|
+
/* @__PURE__ */ jsx("path", { d: "M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2" })
|
|
106
|
+
] }) }), children: "Eliminar" })
|
|
107
|
+
] })
|
|
108
|
+
] }) })
|
|
109
|
+
] })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
MediaTile as default
|
|
116
|
+
};
|
package/dist/MultiComboSelect.js
CHANGED
|
@@ -106,7 +106,7 @@ function MultiComboSelect({
|
|
|
106
106
|
{
|
|
107
107
|
unstyled: true,
|
|
108
108
|
type: "button",
|
|
109
|
-
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
109
|
+
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200",
|
|
110
110
|
onClick: () => setDialogOpen(true),
|
|
111
111
|
title: "Ver todas",
|
|
112
112
|
children: [
|
|
@@ -135,7 +135,7 @@ function MultiComboSelect({
|
|
|
135
135
|
{
|
|
136
136
|
unstyled: true,
|
|
137
137
|
type: "button",
|
|
138
|
-
className: "inline-flex h-8 items-center justify-center rounded-lg border border-slate-300/80 bg-white px-2 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
138
|
+
className: "inline-flex h-8 items-center justify-center rounded-lg border border-slate-300/80 bg-white px-2 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200 dark:hover:bg-white/10",
|
|
139
139
|
onClick: () => toggle(v),
|
|
140
140
|
children: "Quitar"
|
|
141
141
|
}
|
|
@@ -73,7 +73,7 @@ function MultiComboSelect({
|
|
|
73
73
|
{
|
|
74
74
|
unstyled: true,
|
|
75
75
|
type: "button",
|
|
76
|
-
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
76
|
+
className: "inline-flex items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200",
|
|
77
77
|
onClick: () => setDialogOpen(true),
|
|
78
78
|
title: "Ver todas",
|
|
79
79
|
children: [
|
|
@@ -102,7 +102,7 @@ function MultiComboSelect({
|
|
|
102
102
|
{
|
|
103
103
|
unstyled: true,
|
|
104
104
|
type: "button",
|
|
105
|
-
className: "inline-flex h-8 items-center justify-center rounded-lg border border-slate-300/80 bg-white px-2 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
105
|
+
className: "inline-flex h-8 items-center justify-center rounded-lg border border-slate-300/80 bg-white px-2 text-xs text-slate-700 hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200 dark:hover:bg-white/10",
|
|
106
106
|
onClick: () => toggle(v),
|
|
107
107
|
children: "Quitar"
|
|
108
108
|
}
|
package/dist/Pagination.js
CHANGED
|
@@ -108,25 +108,27 @@ function Pagination({
|
|
|
108
108
|
children,
|
|
109
109
|
active,
|
|
110
110
|
disabled,
|
|
111
|
-
onClick
|
|
111
|
+
onClick,
|
|
112
|
+
ariaLabel
|
|
112
113
|
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
113
114
|
import_Button.default,
|
|
114
115
|
{
|
|
115
116
|
unstyled: true,
|
|
116
117
|
disabled,
|
|
117
118
|
onClick,
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
"aria-label": ariaLabel,
|
|
120
|
+
className: `relative h-10 min-w-10 px-3 inline-flex items-center justify-center text-[15px] font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-200 dark:focus:ring-white/10
|
|
121
|
+
${active ? `${PILL_BG[color]} ${ACTIVE_TEXT[color]} rounded-2xl shadow-sm` : "text-slate-700 dark:text-slate-200 hover:bg-white/60 dark:hover:bg-white/10"}
|
|
120
122
|
${disabled ? "opacity-40 cursor-not-allowed" : ""}`,
|
|
121
123
|
"aria-current": active ? "page" : void 0,
|
|
122
124
|
children
|
|
123
125
|
}
|
|
124
126
|
);
|
|
125
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-
|
|
126
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === 1, onClick: () => onPageChange(page - 1), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 18l-6-6 6-6" }) }) }),
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === 1, onClick: () => onPageChange(page - 1), ariaLabel: "P\xE1gina anterior", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 18l-6-6 6-6" }) }) }),
|
|
127
129
|
range.map(
|
|
128
130
|
(it, idx) => it === "..." ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "h-10 min-w-10 px-3 inline-flex items-center justify-center text-slate-500 dark:text-slate-400", children: "\u2026" }, `dots-${idx}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { active: it === page, onClick: () => onPageChange(it), children: it }, it)
|
|
129
131
|
),
|
|
130
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === totalPages, onClick: () => onPageChange(page + 1), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 6l6 6-6 6" }) }) })
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Btn, { disabled: page === totalPages, onClick: () => onPageChange(page + 1), ariaLabel: "P\xE1gina siguiente", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 6l6 6-6 6" }) }) })
|
|
131
133
|
] }) });
|
|
132
134
|
}
|
package/dist/Pagination.mjs
CHANGED
|
@@ -75,26 +75,28 @@ function Pagination({
|
|
|
75
75
|
children,
|
|
76
76
|
active,
|
|
77
77
|
disabled,
|
|
78
|
-
onClick
|
|
78
|
+
onClick,
|
|
79
|
+
ariaLabel
|
|
79
80
|
}) => /* @__PURE__ */ jsx(
|
|
80
81
|
Button,
|
|
81
82
|
{
|
|
82
83
|
unstyled: true,
|
|
83
84
|
disabled,
|
|
84
85
|
onClick,
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
"aria-label": ariaLabel,
|
|
87
|
+
className: `relative h-10 min-w-10 px-3 inline-flex items-center justify-center text-[15px] font-medium transition focus:outline-none focus:ring-2 focus:ring-blue-200 dark:focus:ring-white/10
|
|
88
|
+
${active ? `${PILL_BG[color]} ${ACTIVE_TEXT[color]} rounded-2xl shadow-sm` : "text-slate-700 dark:text-slate-200 hover:bg-white/60 dark:hover:bg-white/10"}
|
|
87
89
|
${disabled ? "opacity-40 cursor-not-allowed" : ""}`,
|
|
88
90
|
"aria-current": active ? "page" : void 0,
|
|
89
91
|
children
|
|
90
92
|
}
|
|
91
93
|
);
|
|
92
|
-
return /* @__PURE__ */ jsx("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ jsxs("div", { className: "relative inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-
|
|
93
|
-
/* @__PURE__ */ jsx(Btn, { disabled: page === 1, onClick: () => onPageChange(page - 1), children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M15 18l-6-6 6-6" }) }) }),
|
|
94
|
+
return /* @__PURE__ */ jsx("nav", { className: className || "w-full md:w-auto", children: /* @__PURE__ */ jsxs("div", { className: "relative inline-flex overflow-hidden rounded-2xl border border-slate-200 bg-slate-100/60 shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
|
|
95
|
+
/* @__PURE__ */ jsx(Btn, { disabled: page === 1, onClick: () => onPageChange(page - 1), ariaLabel: "P\xE1gina anterior", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M15 18l-6-6 6-6" }) }) }),
|
|
94
96
|
range.map(
|
|
95
97
|
(it, idx) => it === "..." ? /* @__PURE__ */ jsx("span", { className: "h-10 min-w-10 px-3 inline-flex items-center justify-center text-slate-500 dark:text-slate-400", children: "\u2026" }, `dots-${idx}`) : /* @__PURE__ */ jsx(Btn, { active: it === page, onClick: () => onPageChange(it), children: it }, it)
|
|
96
98
|
),
|
|
97
|
-
/* @__PURE__ */ jsx(Btn, { disabled: page === totalPages, onClick: () => onPageChange(page + 1), children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M9 6l6 6-6 6" }) }) })
|
|
99
|
+
/* @__PURE__ */ jsx(Btn, { disabled: page === totalPages, onClick: () => onPageChange(page + 1), ariaLabel: "P\xE1gina siguiente", children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-5 w-5", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx("path", { d: "M9 6l6 6-6 6" }) }) })
|
|
98
100
|
] }) });
|
|
99
101
|
}
|
|
100
102
|
export {
|
package/dist/Sidebar.js
CHANGED
|
@@ -210,7 +210,7 @@ function Sidebar({
|
|
|
210
210
|
variant: "ghost",
|
|
211
211
|
size: "sm",
|
|
212
212
|
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.MenuIcon, {}),
|
|
213
|
-
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
213
|
+
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200 dark:hover:bg-white/10"
|
|
214
214
|
}
|
|
215
215
|
),
|
|
216
216
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Button.default, { unstyled: true, type: "button", onClick: onBrandClick, className: "flex items-center gap-2", children: [
|
|
@@ -283,7 +283,7 @@ function Sidebar({
|
|
|
283
283
|
variant: "ghost",
|
|
284
284
|
size: "sm",
|
|
285
285
|
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.CloseIcon, {}),
|
|
286
|
-
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 dark:border-white/10 dark:bg-
|
|
286
|
+
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200"
|
|
287
287
|
}
|
|
288
288
|
),
|
|
289
289
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-slate-500 dark:text-slate-400", children: "Men\xFA" })
|
|
@@ -353,13 +353,13 @@ function SidebarInner({
|
|
|
353
353
|
variant: "ghost",
|
|
354
354
|
size: "sm",
|
|
355
355
|
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_iconos.ChevronLeftRightIcon, { collapsed: collapsed != null ? collapsed : false }),
|
|
356
|
-
className: "hidden xl:inline-flex h-8 w-8 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-[0.98] dark:border-white/10 dark:bg-
|
|
356
|
+
className: "hidden xl:inline-flex h-8 w-8 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-[0.98] dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200",
|
|
357
357
|
title: collapsed ? "Expandir" : "Contraer"
|
|
358
358
|
}
|
|
359
359
|
)
|
|
360
360
|
] }),
|
|
361
361
|
collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-4 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AvatarSquare.default, { size: 48, src: (_a = user == null ? void 0 : user.avatarUrl) != null ? _a : void 0, radiusClass: "rounded-2xl", color }) }),
|
|
362
|
-
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 flex items-center gap-3 rounded-2xl border border-slate-200 bg-white p-2 pr-3 shadow-sm dark:border-white/10 dark:bg-
|
|
362
|
+
!collapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-4 flex items-center gap-3 rounded-2xl border border-slate-200 bg-white p-2 pr-3 shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
|
|
363
363
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_AvatarSquare.default, { size: 48, src: (_b = user == null ? void 0 : user.avatarUrl) != null ? _b : void 0, radiusClass: "rounded-2xl", color }),
|
|
364
364
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
365
365
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "truncate text-sm font-semibold", children: (_c = user == null ? void 0 : user.name) != null ? _c : "Usuario" }),
|
|
@@ -425,7 +425,7 @@ function RenderItem({
|
|
|
425
425
|
{
|
|
426
426
|
className: [
|
|
427
427
|
"grid h-9 w-9 place-items-center rounded-xl border transition",
|
|
428
|
-
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
428
|
+
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
429
429
|
].join(" "),
|
|
430
430
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5" })
|
|
431
431
|
}
|
|
@@ -461,7 +461,7 @@ function RenderItem({
|
|
|
461
461
|
{
|
|
462
462
|
className: [
|
|
463
463
|
"grid h-9 w-9 place-items-center rounded-xl border transition",
|
|
464
|
-
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
464
|
+
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
465
465
|
].join(" "),
|
|
466
466
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5" })
|
|
467
467
|
}
|
|
@@ -484,7 +484,7 @@ function RenderItem({
|
|
|
484
484
|
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { open }),
|
|
485
485
|
className: [
|
|
486
486
|
"h-8 w-8 shrink-0 rounded-lg p-0 !gap-0 border",
|
|
487
|
-
isActive ? `${TOGGLE_BORDER_ACTIVE[color]} bg-white/80 dark:bg-white/15` : "border-slate-200 bg-white dark:border-white/10 dark:bg-
|
|
487
|
+
isActive ? `${TOGGLE_BORDER_ACTIVE[color]} bg-white/80 dark:bg-white/15` : "border-slate-200 bg-white dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
488
488
|
].join(" ")
|
|
489
489
|
}
|
|
490
490
|
)
|
|
@@ -500,7 +500,7 @@ function RenderItem({
|
|
|
500
500
|
transition: { type: "tween", duration: 0.18 },
|
|
501
501
|
className: "mt-1 overflow-hidden",
|
|
502
502
|
style: { willChange: "height, opacity, transform" },
|
|
503
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-xl border border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-
|
|
503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-xl border border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: children.map((ch) => {
|
|
504
504
|
const active2 = ch.key === activeKey;
|
|
505
505
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
506
506
|
import_Button.default,
|
|
@@ -552,7 +552,7 @@ function RenderItem({
|
|
|
552
552
|
{
|
|
553
553
|
className: [
|
|
554
554
|
"grid h-9 w-9 place-items-center rounded-xl border text-slate-700 transition group-hover:scale-105 dark:text-slate-200",
|
|
555
|
-
active ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
555
|
+
active ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
556
556
|
].join(" "),
|
|
557
557
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { className: "h-5 w-5" })
|
|
558
558
|
}
|
package/dist/Sidebar.mjs
CHANGED
|
@@ -177,7 +177,7 @@ function Sidebar({
|
|
|
177
177
|
variant: "ghost",
|
|
178
178
|
size: "sm",
|
|
179
179
|
leftIcon: /* @__PURE__ */ jsx(MenuIcon, {}),
|
|
180
|
-
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-
|
|
180
|
+
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-95 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200 dark:hover:bg-white/10"
|
|
181
181
|
}
|
|
182
182
|
),
|
|
183
183
|
/* @__PURE__ */ jsxs(Button, { unstyled: true, type: "button", onClick: onBrandClick, className: "flex items-center gap-2", children: [
|
|
@@ -250,7 +250,7 @@ function Sidebar({
|
|
|
250
250
|
variant: "ghost",
|
|
251
251
|
size: "sm",
|
|
252
252
|
leftIcon: /* @__PURE__ */ jsx(CloseIcon, {}),
|
|
253
|
-
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 dark:border-white/10 dark:bg-
|
|
253
|
+
className: "h-9 w-9 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200"
|
|
254
254
|
}
|
|
255
255
|
),
|
|
256
256
|
/* @__PURE__ */ jsx("div", { className: "text-sm text-slate-500 dark:text-slate-400", children: "Men\xFA" })
|
|
@@ -320,13 +320,13 @@ function SidebarInner({
|
|
|
320
320
|
variant: "ghost",
|
|
321
321
|
size: "sm",
|
|
322
322
|
leftIcon: /* @__PURE__ */ jsx(ChevronLeftRightIcon, { collapsed: collapsed != null ? collapsed : false }),
|
|
323
|
-
className: "hidden xl:inline-flex h-8 w-8 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-[0.98] dark:border-white/10 dark:bg-
|
|
323
|
+
className: "hidden xl:inline-flex h-8 w-8 p-0 !gap-0 rounded-xl border border-slate-200 bg-white text-slate-700 shadow-sm hover:bg-slate-50 active:scale-[0.98] dark:border-white/10 dark:bg-[var(--fx-surface)] dark:text-slate-200",
|
|
324
324
|
title: collapsed ? "Expandir" : "Contraer"
|
|
325
325
|
}
|
|
326
326
|
)
|
|
327
327
|
] }),
|
|
328
328
|
collapsed && /* @__PURE__ */ jsx("div", { className: "mt-4 flex items-center justify-center", children: /* @__PURE__ */ jsx(AvatarSquare, { size: 48, src: (_a = user == null ? void 0 : user.avatarUrl) != null ? _a : void 0, radiusClass: "rounded-2xl", color }) }),
|
|
329
|
-
!collapsed && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center gap-3 rounded-2xl border border-slate-200 bg-white p-2 pr-3 shadow-sm dark:border-white/10 dark:bg-
|
|
329
|
+
!collapsed && /* @__PURE__ */ jsxs("div", { className: "mt-4 flex items-center gap-3 rounded-2xl border border-slate-200 bg-white p-2 pr-3 shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
|
|
330
330
|
/* @__PURE__ */ jsx(AvatarSquare, { size: 48, src: (_b = user == null ? void 0 : user.avatarUrl) != null ? _b : void 0, radiusClass: "rounded-2xl", color }),
|
|
331
331
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
332
332
|
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-semibold", children: (_c = user == null ? void 0 : user.name) != null ? _c : "Usuario" }),
|
|
@@ -392,7 +392,7 @@ function RenderItem({
|
|
|
392
392
|
{
|
|
393
393
|
className: [
|
|
394
394
|
"grid h-9 w-9 place-items-center rounded-xl border transition",
|
|
395
|
-
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
395
|
+
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
396
396
|
].join(" "),
|
|
397
397
|
children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
|
|
398
398
|
}
|
|
@@ -428,7 +428,7 @@ function RenderItem({
|
|
|
428
428
|
{
|
|
429
429
|
className: [
|
|
430
430
|
"grid h-9 w-9 place-items-center rounded-xl border transition",
|
|
431
|
-
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
431
|
+
isActive ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
432
432
|
].join(" "),
|
|
433
433
|
children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
|
|
434
434
|
}
|
|
@@ -451,7 +451,7 @@ function RenderItem({
|
|
|
451
451
|
leftIcon: /* @__PURE__ */ jsx(ChevronDown, { open }),
|
|
452
452
|
className: [
|
|
453
453
|
"h-8 w-8 shrink-0 rounded-lg p-0 !gap-0 border",
|
|
454
|
-
isActive ? `${TOGGLE_BORDER_ACTIVE[color]} bg-white/80 dark:bg-white/15` : "border-slate-200 bg-white dark:border-white/10 dark:bg-
|
|
454
|
+
isActive ? `${TOGGLE_BORDER_ACTIVE[color]} bg-white/80 dark:bg-white/15` : "border-slate-200 bg-white dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
455
455
|
].join(" ")
|
|
456
456
|
}
|
|
457
457
|
)
|
|
@@ -467,7 +467,7 @@ function RenderItem({
|
|
|
467
467
|
transition: { type: "tween", duration: 0.18 },
|
|
468
468
|
className: "mt-1 overflow-hidden",
|
|
469
469
|
style: { willChange: "height, opacity, transform" },
|
|
470
|
-
children: /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-
|
|
470
|
+
children: /* @__PURE__ */ jsx("div", { className: "rounded-xl border border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]", children: children.map((ch) => {
|
|
471
471
|
const active2 = ch.key === activeKey;
|
|
472
472
|
return /* @__PURE__ */ jsx(
|
|
473
473
|
Button,
|
|
@@ -519,7 +519,7 @@ function RenderItem({
|
|
|
519
519
|
{
|
|
520
520
|
className: [
|
|
521
521
|
"grid h-9 w-9 place-items-center rounded-xl border text-slate-700 transition group-hover:scale-105 dark:text-slate-200",
|
|
522
|
-
active ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-
|
|
522
|
+
active ? `${ICON_BORDER_ACTIVE[color]} bg-white shadow-sm dark:bg-[var(--fx-surface)]` : "border-slate-200 bg-white shadow-sm dark:border-white/10 dark:bg-[var(--fx-surface)]"
|
|
523
523
|
].join(" "),
|
|
524
524
|
children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" })
|
|
525
525
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type SkeletonBaseProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React__default.CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
declare function Skeleton({ className, style }: SkeletonBaseProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function SkeletonCircle({ size, className }: {
|
|
10
|
+
size?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function SkeletonLine({ width, height, className }: {
|
|
14
|
+
width?: number | string;
|
|
15
|
+
height?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function SkeletonText({ lines, widths }: {
|
|
19
|
+
lines?: number;
|
|
20
|
+
widths?: Array<number | string>;
|
|
21
|
+
}): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function SkeletonContainer({ loading, skeleton, children }: {
|
|
23
|
+
loading: boolean;
|
|
24
|
+
skeleton: React__default.ReactNode;
|
|
25
|
+
children: React__default.ReactNode;
|
|
26
|
+
}): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const SkeletonCompound: typeof Skeleton & {
|
|
28
|
+
Circle: typeof SkeletonCircle;
|
|
29
|
+
Line: typeof SkeletonLine;
|
|
30
|
+
Text: typeof SkeletonText;
|
|
31
|
+
Container: typeof SkeletonContainer;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Skeleton, type SkeletonBaseProps, SkeletonCircle, SkeletonContainer, SkeletonLine, SkeletonText, SkeletonCompound as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type SkeletonBaseProps = {
|
|
5
|
+
className?: string;
|
|
6
|
+
style?: React__default.CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
declare function Skeleton({ className, style }: SkeletonBaseProps): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare function SkeletonCircle({ size, className }: {
|
|
10
|
+
size?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare function SkeletonLine({ width, height, className }: {
|
|
14
|
+
width?: number | string;
|
|
15
|
+
height?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare function SkeletonText({ lines, widths }: {
|
|
19
|
+
lines?: number;
|
|
20
|
+
widths?: Array<number | string>;
|
|
21
|
+
}): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function SkeletonContainer({ loading, skeleton, children }: {
|
|
23
|
+
loading: boolean;
|
|
24
|
+
skeleton: React__default.ReactNode;
|
|
25
|
+
children: React__default.ReactNode;
|
|
26
|
+
}): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare const SkeletonCompound: typeof Skeleton & {
|
|
28
|
+
Circle: typeof SkeletonCircle;
|
|
29
|
+
Line: typeof SkeletonLine;
|
|
30
|
+
Text: typeof SkeletonText;
|
|
31
|
+
Container: typeof SkeletonContainer;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { Skeleton, type SkeletonBaseProps, SkeletonCircle, SkeletonContainer, SkeletonLine, SkeletonText, SkeletonCompound as default };
|
package/dist/Skeleton.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
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 Skeleton_exports = {};
|
|
21
|
+
__export(Skeleton_exports, {
|
|
22
|
+
Skeleton: () => Skeleton,
|
|
23
|
+
SkeletonCircle: () => SkeletonCircle,
|
|
24
|
+
SkeletonContainer: () => SkeletonContainer,
|
|
25
|
+
SkeletonLine: () => SkeletonLine,
|
|
26
|
+
SkeletonText: () => SkeletonText,
|
|
27
|
+
default: () => Skeleton_default
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(Skeleton_exports);
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
function Skeleton({ className, style }) {
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: [
|
|
36
|
+
"animate-pulse rounded bg-slate-200 dark:bg-white/10",
|
|
37
|
+
className != null ? className : ""
|
|
38
|
+
].join(" "),
|
|
39
|
+
style
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function SkeletonCircle({ size = 40, className }) {
|
|
44
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
45
|
+
Skeleton,
|
|
46
|
+
{
|
|
47
|
+
className: ["rounded-full", className != null ? className : ""].join(" "),
|
|
48
|
+
style: { width: size, height: size }
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function SkeletonLine({ width = "100%", height = 12, className }) {
|
|
53
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
Skeleton,
|
|
55
|
+
{
|
|
56
|
+
className: ["", className != null ? className : ""].join(" "),
|
|
57
|
+
style: { width, height, borderRadius: 6 }
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function SkeletonText({ lines = 3, widths }) {
|
|
62
|
+
const arr = Array.from({ length: Math.max(1, lines) });
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", children: arr.map((_, i) => {
|
|
64
|
+
var _a;
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
SkeletonLine,
|
|
67
|
+
{
|
|
68
|
+
height: 12,
|
|
69
|
+
width: (_a = widths == null ? void 0 : widths[i]) != null ? _a : i === arr.length - 1 ? "70%" : "100%"
|
|
70
|
+
},
|
|
71
|
+
i
|
|
72
|
+
);
|
|
73
|
+
}) });
|
|
74
|
+
}
|
|
75
|
+
function SkeletonContainer({ loading, skeleton, children }) {
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: loading ? skeleton : children });
|
|
77
|
+
}
|
|
78
|
+
const SkeletonCompound = Object.assign(Skeleton, {
|
|
79
|
+
Circle: SkeletonCircle,
|
|
80
|
+
Line: SkeletonLine,
|
|
81
|
+
Text: SkeletonText,
|
|
82
|
+
Container: SkeletonContainer
|
|
83
|
+
});
|
|
84
|
+
var Skeleton_default = SkeletonCompound;
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
Skeleton,
|
|
88
|
+
SkeletonCircle,
|
|
89
|
+
SkeletonContainer,
|
|
90
|
+
SkeletonLine,
|
|
91
|
+
SkeletonText
|
|
92
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
function Skeleton({ className, style }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
className: [
|
|
8
|
+
"animate-pulse rounded bg-slate-200 dark:bg-white/10",
|
|
9
|
+
className != null ? className : ""
|
|
10
|
+
].join(" "),
|
|
11
|
+
style
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
function SkeletonCircle({ size = 40, className }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
Skeleton,
|
|
18
|
+
{
|
|
19
|
+
className: ["rounded-full", className != null ? className : ""].join(" "),
|
|
20
|
+
style: { width: size, height: size }
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function SkeletonLine({ width = "100%", height = 12, className }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Skeleton,
|
|
27
|
+
{
|
|
28
|
+
className: ["", className != null ? className : ""].join(" "),
|
|
29
|
+
style: { width, height, borderRadius: 6 }
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function SkeletonText({ lines = 3, widths }) {
|
|
34
|
+
const arr = Array.from({ length: Math.max(1, lines) });
|
|
35
|
+
return /* @__PURE__ */ jsx("div", { className: "space-y-2", children: arr.map((_, i) => {
|
|
36
|
+
var _a;
|
|
37
|
+
return /* @__PURE__ */ jsx(
|
|
38
|
+
SkeletonLine,
|
|
39
|
+
{
|
|
40
|
+
height: 12,
|
|
41
|
+
width: (_a = widths == null ? void 0 : widths[i]) != null ? _a : i === arr.length - 1 ? "70%" : "100%"
|
|
42
|
+
},
|
|
43
|
+
i
|
|
44
|
+
);
|
|
45
|
+
}) });
|
|
46
|
+
}
|
|
47
|
+
function SkeletonContainer({ loading, skeleton, children }) {
|
|
48
|
+
return /* @__PURE__ */ jsx(Fragment, { children: loading ? skeleton : children });
|
|
49
|
+
}
|
|
50
|
+
const SkeletonCompound = Object.assign(Skeleton, {
|
|
51
|
+
Circle: SkeletonCircle,
|
|
52
|
+
Line: SkeletonLine,
|
|
53
|
+
Text: SkeletonText,
|
|
54
|
+
Container: SkeletonContainer
|
|
55
|
+
});
|
|
56
|
+
var Skeleton_default = SkeletonCompound;
|
|
57
|
+
export {
|
|
58
|
+
Skeleton,
|
|
59
|
+
SkeletonCircle,
|
|
60
|
+
SkeletonContainer,
|
|
61
|
+
SkeletonLine,
|
|
62
|
+
SkeletonText,
|
|
63
|
+
Skeleton_default as default
|
|
64
|
+
};
|
package/dist/StatCard.js
CHANGED
|
@@ -46,7 +46,7 @@ function StatCard({ title, value, hint, spark }) {
|
|
|
46
46
|
const gid = (0, import_react.useId)();
|
|
47
47
|
const color = (_a = spark == null ? void 0 : spark.color) != null ? _a : "#10b981";
|
|
48
48
|
const isNumber = typeof value === "number";
|
|
49
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "h-full group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 p-4 shadow-sm ring-1 ring-black/5 backdrop-blur transition hover:shadow-md dark:border-white/10 dark:bg-
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.motion.div, { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "h-full group relative overflow-hidden rounded-2xl border border-slate-200 bg-white/80 p-4 shadow-sm ring-1 ring-black/5 backdrop-blur transition hover:shadow-md dark:border-white/10 dark:bg-[var(--fx-surface)]", children: [
|
|
50
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "relative z-10", children: [
|
|
51
51
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: title }),
|
|
52
52
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-1 text-2xl font-semibold tracking-tight", children: isNumber ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MotionNumber, { value }) : value }),
|