@unicitylabs/sphere-ui 0.1.2 → 0.1.4

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 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
@@ -1,10 +1,10 @@
1
1
  // src/components/DashboardLayout.tsx
2
2
  import { useState } from "react";
3
- import { Menu } from "lucide-react";
3
+ import { Menu, X } 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,9 +15,9 @@ 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 relative transition-transform lg:translate-x-0 ${mobileOpen ? "translate-x-0" : "-translate-x-full"}`,
18
+ className: `fixed lg:static inset-y-0 left-0 z-50 w-56 shrink-0 flex flex-col transition-transform duration-300 ease-out lg:translate-x-0 ${mobileOpen ? "translate-x-0" : "-translate-x-full"}`,
19
19
  style: {
20
- background: "linear-gradient(180deg, rgba(255,111,0,0.03) 0%, var(--bg-root) 40%)",
20
+ background: "var(--bg-root)",
21
21
  borderRight: "1px solid var(--border)"
22
22
  },
23
23
  children: [
@@ -28,7 +28,27 @@ function DashboardLayout({ logo, nav, footer, children }) {
28
28
  style: { background: "linear-gradient(90deg, transparent, var(--accent), transparent)" }
29
29
  }
30
30
  ),
31
- /* @__PURE__ */ jsx("div", { className: "px-5 py-5", style: { borderBottom: "1px solid var(--border)" }, children: logo }),
31
+ /* @__PURE__ */ jsx(
32
+ "div",
33
+ {
34
+ className: "absolute inset-0 pointer-events-none",
35
+ style: { background: "linear-gradient(180deg, rgba(255,111,0,0.03) 0%, transparent 40%)" }
36
+ }
37
+ ),
38
+ /* @__PURE__ */ jsxs("div", { className: "px-5 py-5 relative", style: { borderBottom: "1px solid var(--border)" }, children: [
39
+ /* @__PURE__ */ jsx(
40
+ "button",
41
+ {
42
+ className: "lg:hidden absolute top-4 right-4 p-1 rounded-md transition-colors",
43
+ style: { color: "var(--text-muted)" },
44
+ onClick: () => setMobileOpen(false),
45
+ onMouseEnter: (e) => e.currentTarget.style.color = "var(--text-primary)",
46
+ onMouseLeave: (e) => e.currentTarget.style.color = "var(--text-muted)",
47
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
48
+ }
49
+ ),
50
+ logo
51
+ ] }),
32
52
  /* @__PURE__ */ jsx("nav", { className: "flex-1 px-3 py-3 flex flex-col overflow-y-auto", children: nav }),
33
53
  footer && /* @__PURE__ */ jsx("div", { className: "px-3 py-4", style: { borderTop: "1px solid var(--border)" }, children: footer })
34
54
  ]
@@ -327,6 +347,7 @@ function ConfirmDialog({
327
347
  title,
328
348
  message,
329
349
  confirmLabel = "Confirm",
350
+ confirmPending,
330
351
  variant = "default",
331
352
  onConfirm,
332
353
  onCancel
@@ -345,13 +366,20 @@ function ConfirmDialog({
345
366
  /* @__PURE__ */ jsx7("h3", { className: "font-semibold text-white mb-2", children: title }),
346
367
  /* @__PURE__ */ jsx7("p", { className: "text-sm mb-5", style: { color: "var(--text-muted)" }, children: message }),
347
368
  /* @__PURE__ */ jsxs7("div", { className: "flex gap-3", children: [
348
- /* @__PURE__ */ jsx7("button", { onClick: onCancel, className: "btn-secondary flex-1", children: "Cancel" }),
349
- /* @__PURE__ */ jsx7(
369
+ /* @__PURE__ */ jsx7("button", { onClick: onCancel, disabled: confirmPending, className: "btn-secondary flex-1", children: "Cancel" }),
370
+ /* @__PURE__ */ jsxs7(
350
371
  "button",
351
372
  {
352
373
  onClick: onConfirm,
353
- className: `flex-1 ${variant === "danger" ? "btn-danger" : "btn-primary"}`,
354
- children: confirmLabel
374
+ disabled: confirmPending,
375
+ className: `flex-1 inline-flex items-center justify-center gap-2 ${variant === "danger" ? "btn-danger" : "btn-primary"}`,
376
+ children: [
377
+ confirmPending && /* @__PURE__ */ jsxs7("svg", { className: "w-4 h-4 animate-spin", viewBox: "0 0 24 24", fill: "none", children: [
378
+ /* @__PURE__ */ jsx7("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
379
+ /* @__PURE__ */ jsx7("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
380
+ ] }),
381
+ confirmLabel
382
+ ]
355
383
  }
356
384
  )
357
385
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unicitylabs/sphere-ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",