@unicitylabs/sphere-ui 0.1.2 → 0.1.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/index.d.ts +2 -1
- package/dist/index.js +14 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -110,11 +110,12 @@ interface ConfirmDialogProps {
|
|
|
110
110
|
title: string;
|
|
111
111
|
message: string;
|
|
112
112
|
confirmLabel?: string;
|
|
113
|
+
confirmPending?: boolean;
|
|
113
114
|
variant?: 'danger' | 'default';
|
|
114
115
|
onConfirm: () => void;
|
|
115
116
|
onCancel: () => void;
|
|
116
117
|
}
|
|
117
|
-
declare function ConfirmDialog({ isOpen, title, message, confirmLabel, variant, onConfirm, onCancel, }: ConfirmDialogProps): react.ReactPortal | null;
|
|
118
|
+
declare function ConfirmDialog({ isOpen, title, message, confirmLabel, confirmPending, variant, onConfirm, onCancel, }: ConfirmDialogProps): react.ReactPortal | null;
|
|
118
119
|
|
|
119
120
|
interface StatusBadgeProps {
|
|
120
121
|
status: string;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Menu } from "lucide-react";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
function DashboardLayout({ logo, nav, footer, children }) {
|
|
6
6
|
const [mobileOpen, setMobileOpen] = useState(false);
|
|
7
|
-
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen flex", style: { background: "var(--bg-root)" }, children: [
|
|
7
|
+
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen flex sphere-dashboard", style: { background: "var(--bg-root)" }, children: [
|
|
8
8
|
mobileOpen && /* @__PURE__ */ jsx(
|
|
9
9
|
"div",
|
|
10
10
|
{
|
|
@@ -15,7 +15,7 @@ function DashboardLayout({ logo, nav, footer, children }) {
|
|
|
15
15
|
/* @__PURE__ */ jsxs(
|
|
16
16
|
"aside",
|
|
17
17
|
{
|
|
18
|
-
className: `fixed lg:static inset-y-0 left-0 z-50 w-56 shrink-0 flex flex-col
|
|
18
|
+
className: `fixed lg:static inset-y-0 left-0 z-50 w-56 shrink-0 flex flex-col transition-transform lg:translate-x-0 ${mobileOpen ? "translate-x-0" : "-translate-x-full"}`,
|
|
19
19
|
style: {
|
|
20
20
|
background: "linear-gradient(180deg, rgba(255,111,0,0.03) 0%, var(--bg-root) 40%)",
|
|
21
21
|
borderRight: "1px solid var(--border)"
|
|
@@ -327,6 +327,7 @@ function ConfirmDialog({
|
|
|
327
327
|
title,
|
|
328
328
|
message,
|
|
329
329
|
confirmLabel = "Confirm",
|
|
330
|
+
confirmPending,
|
|
330
331
|
variant = "default",
|
|
331
332
|
onConfirm,
|
|
332
333
|
onCancel
|
|
@@ -345,13 +346,20 @@ function ConfirmDialog({
|
|
|
345
346
|
/* @__PURE__ */ jsx7("h3", { className: "font-semibold text-white mb-2", children: title }),
|
|
346
347
|
/* @__PURE__ */ jsx7("p", { className: "text-sm mb-5", style: { color: "var(--text-muted)" }, children: message }),
|
|
347
348
|
/* @__PURE__ */ jsxs7("div", { className: "flex gap-3", children: [
|
|
348
|
-
/* @__PURE__ */ jsx7("button", { onClick: onCancel, className: "btn-secondary flex-1", children: "Cancel" }),
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ jsx7("button", { onClick: onCancel, disabled: confirmPending, className: "btn-secondary flex-1", children: "Cancel" }),
|
|
350
|
+
/* @__PURE__ */ jsxs7(
|
|
350
351
|
"button",
|
|
351
352
|
{
|
|
352
353
|
onClick: onConfirm,
|
|
353
|
-
|
|
354
|
-
|
|
354
|
+
disabled: confirmPending,
|
|
355
|
+
className: `flex-1 inline-flex items-center justify-center gap-2 ${variant === "danger" ? "btn-danger" : "btn-primary"}`,
|
|
356
|
+
children: [
|
|
357
|
+
confirmPending && /* @__PURE__ */ jsxs7("svg", { className: "w-4 h-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
|
|
358
|
+
/* @__PURE__ */ jsx7("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
359
|
+
/* @__PURE__ */ jsx7("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
360
|
+
] }),
|
|
361
|
+
confirmLabel
|
|
362
|
+
]
|
|
355
363
|
}
|
|
356
364
|
)
|
|
357
365
|
] })
|