@burdenoff/microfe-files 2026.527.4 → 2026.528.1

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.
@@ -1,87 +1,50 @@
1
- import { useEffect as e, useEffectEvent as t, useId as n, useRef as r } from "react";
2
- import { AlertTriangle as i, Loader2 as a, X as o } from "lucide-react";
3
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
1
+ import { AlertTriangle as e, Loader2 as t } from "lucide-react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { Button as i, ResponsiveDialog as a, ResponsiveDialogContent as o, ResponsiveDialogDescription as s, ResponsiveDialogFooter as c, ResponsiveDialogHeader as l, ResponsiveDialogTitle as u } from "@burdenoff/fe-libs/ui";
4
4
  //#region src/files/components/ConfirmDialog.tsx
5
- function l({ title: l, description: u, confirmLabel: d, cancelLabel: f, variant: p = "default", loading: m = !1, onConfirm: h, onCancel: g }) {
6
- let _ = n(), v = n(), y = r(null), b = t(() => {
7
- m || g();
8
- });
9
- return e(() => {
10
- y.current?.focus();
11
- let e = (e) => {
12
- e.key === "Escape" && b();
13
- };
14
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
15
- }, []), /* @__PURE__ */ s("div", {
16
- className: "fixed inset-0 z-[140] flex items-center justify-center bg-bg-overlay p-4",
17
- role: "presentation",
18
- onMouseDown: (e) => {
19
- e.target === e.currentTarget && !m && g();
5
+ function d({ title: d, description: f, confirmLabel: p, cancelLabel: m, variant: h = "default", loading: g = !1, onConfirm: _, onCancel: v }) {
6
+ return /* @__PURE__ */ n(a, {
7
+ open: !0,
8
+ onOpenChange: (e) => {
9
+ !e && !g && v();
20
10
  },
21
- children: /* @__PURE__ */ c("section", {
22
- role: "alertdialog",
23
- "aria-modal": "true",
24
- "aria-labelledby": _,
25
- "aria-describedby": v,
26
- className: "w-full max-w-md rounded-2xl border border-border-default bg-bg-surface p-5 shadow-elevation-3",
27
- children: [/* @__PURE__ */ c("div", {
28
- className: "flex items-start gap-3",
29
- children: [
30
- /* @__PURE__ */ s("div", {
31
- className: "rounded-full bg-status-warning-bg-subtle p-2 text-status-warning-text",
32
- children: /* @__PURE__ */ s(i, {
33
- className: "size-5",
34
- "aria-hidden": "true"
35
- })
36
- }),
37
- /* @__PURE__ */ c("div", {
38
- className: "min-w-0 flex-1",
39
- children: [/* @__PURE__ */ s("h2", {
40
- id: _,
41
- className: "text-base font-semibold text-text-primary",
42
- children: l
43
- }), /* @__PURE__ */ s("div", {
44
- id: v,
45
- className: "mt-2 text-sm leading-6 text-text-secondary",
46
- children: u
47
- })]
48
- }),
49
- /* @__PURE__ */ s("button", {
50
- type: "button",
51
- onClick: g,
52
- disabled: m,
53
- className: "rounded-lg p-1 text-text-tertiary transition-colors hover:bg-bg-muted hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border disabled:cursor-not-allowed disabled:opacity-50",
54
- "aria-label": f,
55
- children: /* @__PURE__ */ s(o, {
56
- className: "size-4",
57
- "aria-hidden": "true"
58
- })
11
+ children: /* @__PURE__ */ r(o, { children: [/* @__PURE__ */ n(l, { children: /* @__PURE__ */ r("div", {
12
+ className: "flex items-start gap-3",
13
+ children: [/* @__PURE__ */ n("div", {
14
+ className: "rounded-full bg-status-warning-bg-subtle p-2 text-status-warning-text",
15
+ children: /* @__PURE__ */ n(e, {
16
+ className: "size-5",
17
+ "aria-hidden": "true"
18
+ })
19
+ }), /* @__PURE__ */ r("div", {
20
+ className: "min-w-0 flex-1",
21
+ children: [/* @__PURE__ */ n(u, { children: d }), /* @__PURE__ */ n(s, {
22
+ asChild: !0,
23
+ children: /* @__PURE__ */ n("div", {
24
+ className: "mt-2 text-sm leading-6 text-text-secondary",
25
+ children: f
59
26
  })
60
- ]
61
- }), /* @__PURE__ */ c("div", {
62
- className: "mt-6 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end",
63
- children: [/* @__PURE__ */ s("button", {
64
- ref: y,
65
- type: "button",
66
- onClick: g,
67
- disabled: m,
68
- className: "inline-flex items-center justify-center rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border disabled:cursor-not-allowed disabled:opacity-50",
69
- children: f
70
- }), /* @__PURE__ */ c("button", {
71
- type: "button",
72
- onClick: h,
73
- disabled: m,
74
- className: `inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60 ${p === "danger" ? "bg-status-error-bg text-text-inverse hover:bg-status-error-bg focus-visible:ring-status-error-border" : "bg-action-primary-bg text-text-inverse hover:bg-action-primary-bg-hover focus-visible:ring-action-primary-border"}`,
75
- children: [m && /* @__PURE__ */ s(a, {
76
- className: "size-4 animate-spin",
77
- "aria-hidden": "true"
78
- }), d]
79
27
  })]
80
28
  })]
81
- })
29
+ }) }), /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ n(i, {
30
+ type: "button",
31
+ variant: "outline",
32
+ onClick: v,
33
+ disabled: g,
34
+ children: m
35
+ }), /* @__PURE__ */ r(i, {
36
+ type: "button",
37
+ onClick: _,
38
+ disabled: g,
39
+ variant: h === "danger" ? "destructive" : "default",
40
+ children: [g && /* @__PURE__ */ n(t, {
41
+ className: "size-4 animate-spin",
42
+ "aria-hidden": "true"
43
+ }), p]
44
+ })] })] })
82
45
  });
83
46
  }
84
47
  //#endregion
85
- export { l as ConfirmDialog };
48
+ export { d as ConfirmDialog };
86
49
 
87
50
  //# sourceMappingURL=ConfirmDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/files/components/ConfirmDialog.tsx"],"sourcesContent":["import {\n type ReactNode,\n useEffect,\n useEffectEvent,\n useId,\n useRef,\n} from \"react\";\nimport { AlertTriangle, Loader2, X } from \"lucide-react\";\n\ninterface ConfirmDialogProps {\n title: string;\n description: ReactNode;\n confirmLabel: string;\n cancelLabel: string;\n variant?: \"danger\" | \"default\";\n loading?: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport function ConfirmDialog({\n title,\n description,\n confirmLabel,\n cancelLabel,\n variant = \"default\",\n loading = false,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) {\n const titleId = useId();\n const descriptionId = useId();\n const cancelButtonRef = useRef<HTMLButtonElement>(null);\n\n const onEscape = useEffectEvent(() => {\n if (!loading) {\n onCancel();\n }\n });\n\n useEffect(() => {\n cancelButtonRef.current?.focus();\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onEscape();\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, []);\n\n const confirmClassName =\n variant === \"danger\"\n ? \"bg-status-error-bg text-text-inverse hover:bg-status-error-bg focus-visible:ring-status-error-border\"\n : \"bg-action-primary-bg text-text-inverse hover:bg-action-primary-bg-hover focus-visible:ring-action-primary-border\";\n\n return (\n <div\n className=\"fixed inset-0 z-[140] flex items-center justify-center bg-bg-overlay p-4\"\n role=\"presentation\"\n onMouseDown={(event) => {\n if (event.target === event.currentTarget && !loading) {\n onCancel();\n }\n }}\n >\n <section\n role=\"alertdialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className=\"w-full max-w-md rounded-2xl border border-border-default bg-bg-surface p-5 shadow-elevation-3\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"rounded-full bg-status-warning-bg-subtle p-2 text-status-warning-text\">\n <AlertTriangle className=\"size-5\" aria-hidden=\"true\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <h2\n id={titleId}\n className=\"text-base font-semibold text-text-primary\"\n >\n {title}\n </h2>\n <div\n id={descriptionId}\n className=\"mt-2 text-sm leading-6 text-text-secondary\"\n >\n {description}\n </div>\n </div>\n <button\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"rounded-lg p-1 text-text-tertiary transition-colors hover:bg-bg-muted hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border disabled:cursor-not-allowed disabled:opacity-50\"\n aria-label={cancelLabel}\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <div className=\"mt-6 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end\">\n <button\n ref={cancelButtonRef}\n type=\"button\"\n onClick={onCancel}\n disabled={loading}\n className=\"inline-flex items-center justify-center rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {cancelLabel}\n </button>\n <button\n type=\"button\"\n onClick={onConfirm}\n disabled={loading}\n className={`inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-60 ${confirmClassName}`}\n >\n {loading && (\n <Loader2 className=\"size-4 animate-spin\" aria-hidden=\"true\" />\n )}\n {confirmLabel}\n </button>\n </div>\n </section>\n </div>\n );\n}\n"],"mappings":";;;;AAoBA,SAAgB,EAAc,EAC5B,UACA,gBACA,iBACA,gBACA,aAAU,WACV,aAAU,IACV,cACA,eACqB;CACrB,IAAM,IAAU,GAAO,EACjB,IAAgB,GAAO,EACvB,IAAkB,EAA0B,KAAK,EAEjD,IAAW,QAAqB;AACpC,EAAK,KACH,GAAU;GAEZ;AAoBF,QAlBA,QAAgB;AACd,IAAgB,SAAS,OAAO;EAEhC,IAAM,KAAiB,MAAyB;AAC9C,GAAI,EAAM,QAAQ,YAChB,GAAU;;AAKd,SADA,SAAS,iBAAiB,WAAW,EAAc,QACtC,SAAS,oBAAoB,WAAW,EAAc;IAClE,EAAE,CAAC,EAQJ,kBAAC,OAAD;EACE,WAAU;EACV,MAAK;EACL,cAAc,MAAU;AACtB,GAAI,EAAM,WAAW,EAAM,iBAAiB,CAAC,KAC3C,GAAU;;YAId,kBAAC,WAAD;GACE,MAAK;GACL,cAAW;GACX,mBAAiB;GACjB,oBAAkB;GAClB,WAAU;aALZ,CAOE,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAe,WAAU;OAAS,eAAY;OAAS,CAAA;MACnD,CAAA;KACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,MAAD;OACE,IAAI;OACJ,WAAU;iBAET;OACE,CAAA,EACL,kBAAC,OAAD;OACE,IAAI;OACJ,WAAU;iBAET;OACG,CAAA,CACF;;KACN,kBAAC,UAAD;MACE,MAAK;MACL,SAAS;MACT,UAAU;MACV,WAAU;MACV,cAAY;gBAEZ,kBAAC,GAAD;OAAG,WAAU;OAAS,eAAY;OAAS,CAAA;MACpC,CAAA;KACL;OAEN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,UAAD;KACE,KAAK;KACL,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAU;eAET;KACM,CAAA,EACT,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,UAAU;KACV,WAAW,4MAhEnB,MAAY,WACR,yGACA;eA0DE,CAMG,KACC,kBAAC,GAAD;MAAS,WAAU;MAAsB,eAAY;MAAS,CAAA,EAE/D,EACM;OACL;MACE;;EACN,CAAA"}
1
+ {"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/files/components/ConfirmDialog.tsx"],"sourcesContent":["import { type ReactNode } from \"react\";\nimport { AlertTriangle, Loader2 } from \"lucide-react\";\nimport {\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n Button,\n} from \"@burdenoff/fe-libs/ui\";\n\ninterface ConfirmDialogProps {\n title: string;\n description: ReactNode;\n confirmLabel: string;\n cancelLabel: string;\n variant?: \"danger\" | \"default\";\n loading?: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\n/**\n * Confirm/alert dialog. Delegates layout + dismissal to\n * `<ResponsiveDialog>` from `@burdenoff/fe-libs/ui` (bottom-sheet on\n * mobile, centred modal on tablet/desktop). Existing call sites that\n * mount this conditionally (`{open && <ConfirmDialog ... />}`) continue\n * to work because we drive `open={true}` and forward dismissal via\n * `onOpenChange` → `onCancel`.\n */\nexport function ConfirmDialog({\n title,\n description,\n confirmLabel,\n cancelLabel,\n variant = \"default\",\n loading = false,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) {\n return (\n <ResponsiveDialog\n open\n onOpenChange={(next: boolean) => {\n if (!next && !loading) {\n onCancel();\n }\n }}\n >\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <div className=\"flex items-start gap-3\">\n <div className=\"rounded-full bg-status-warning-bg-subtle p-2 text-status-warning-text\">\n <AlertTriangle className=\"size-5\" aria-hidden=\"true\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <ResponsiveDialogTitle>{title}</ResponsiveDialogTitle>\n <ResponsiveDialogDescription asChild>\n <div className=\"mt-2 text-sm leading-6 text-text-secondary\">\n {description}\n </div>\n </ResponsiveDialogDescription>\n </div>\n </div>\n </ResponsiveDialogHeader>\n\n <ResponsiveDialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={onCancel}\n disabled={loading}\n >\n {cancelLabel}\n </Button>\n <Button\n type=\"button\"\n onClick={onConfirm}\n disabled={loading}\n variant={variant === \"danger\" ? \"destructive\" : \"default\"}\n >\n {loading && (\n <Loader2 className=\"size-4 animate-spin\" aria-hidden=\"true\" />\n )}\n {confirmLabel}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;;AA+BA,SAAgB,EAAc,EAC5B,UACA,gBACA,iBACA,gBACA,aAAU,WACV,aAAU,IACV,cACA,eACqB;AACrB,QACE,kBAAC,GAAD;EACE,MAAA;EACA,eAAe,MAAkB;AAC/B,GAAI,CAAC,KAAQ,CAAC,KACZ,GAAU;;YAId,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KAAe,WAAU;KAAS,eAAY;KAAS,CAAA;IACnD,CAAA,EACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,GAAD,EAAA,UAAwB,GAA8B,CAAA,EACtD,kBAAC,GAAD;KAA6B,SAAA;eAC3B,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA;KACsB,CAAA,CAC1B;MACF;MACiB,CAAA,EAEzB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GACE,MAAK;GACL,SAAQ;GACR,SAAS;GACT,UAAU;aAET;GACM,CAAA,EACT,kBAAC,GAAD;GACE,MAAK;GACL,SAAS;GACT,UAAU;GACV,SAAS,MAAY,WAAW,gBAAgB;aAJlD,CAMG,KACC,kBAAC,GAAD;IAAS,WAAU;IAAsB,eAAY;IAAS,CAAA,EAE/D,EACM;KACc,EAAA,CAAA,CACD,EAAA,CAAA;EACT,CAAA"}
@@ -1,68 +1,54 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
2
  import { Clock as t, FolderOpen as n, Star as r, Trash2 as i } from "lucide-react";
3
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
- import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
3
+ import { jsx as a } from "react/jsx-runtime";
4
+ import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
+ import { Button as s, EmptyState as c } from "@burdenoff/fe-libs/ui";
5
6
  //#region src/files/components/EmptyState.tsx
6
- function c({ type: c, onUpload: l, onNewFolder: u }) {
7
- let { t: d } = s(), f = {
7
+ function l({ type: l, onUpload: u, onNewFolder: d }) {
8
+ let { t: f } = o(), p = {
8
9
  all: {
9
- icon: /* @__PURE__ */ a(n, { className: "size-16 text-text-tertiary" }),
10
- title: e(d, "files.empty.all.title", "No files or folders yet"),
11
- description: e(d, "files.empty.all.description", "Upload files or create folders to get started"),
10
+ icon: /* @__PURE__ */ a(n, { className: "size-12 text-text-tertiary" }),
11
+ title: e(f, "files.empty.all.title", "No files or folders yet"),
12
+ description: e(f, "files.empty.all.description", "Upload files or create folders to get started"),
12
13
  showActions: !0
13
14
  },
14
15
  recent: {
15
- icon: /* @__PURE__ */ a(t, { className: "size-16 text-text-tertiary" }),
16
- title: e(d, "files.empty.recent.title", "No recent files"),
17
- description: e(d, "files.empty.recent.description", "Files you recently opened will appear here"),
16
+ icon: /* @__PURE__ */ a(t, { className: "size-12 text-text-tertiary" }),
17
+ title: e(f, "files.empty.recent.title", "No recent files"),
18
+ description: e(f, "files.empty.recent.description", "Files you recently opened will appear here"),
18
19
  showActions: !1
19
20
  },
20
21
  starred: {
21
- icon: /* @__PURE__ */ a(r, { className: "size-16 text-text-tertiary" }),
22
- title: e(d, "files.empty.starred.title", "No starred items"),
23
- description: e(d, "files.empty.starred.description", "Star files and folders to find them easily"),
22
+ icon: /* @__PURE__ */ a(r, { className: "size-12 text-text-tertiary" }),
23
+ title: e(f, "files.empty.starred.title", "No starred items"),
24
+ description: e(f, "files.empty.starred.description", "Star files and folders to find them easily"),
24
25
  showActions: !1
25
26
  },
26
27
  bin: {
27
- icon: /* @__PURE__ */ a(i, { className: "size-16 text-text-tertiary" }),
28
- title: e(d, "files.empty.bin.title", "Bin is empty"),
29
- description: e(d, "files.empty.bin.description", "Deleted files and folders will appear here"),
28
+ icon: /* @__PURE__ */ a(i, { className: "size-12 text-text-tertiary" }),
29
+ title: e(f, "files.empty.bin.title", "Bin is empty"),
30
+ description: e(f, "files.empty.bin.description", "Deleted files and folders will appear here"),
30
31
  showActions: !1
31
32
  }
32
- }[c];
33
- return /* @__PURE__ */ o("div", {
34
- className: "flex flex-col items-center justify-center py-20 px-4 animate-in fade-in duration-500",
35
- children: [
36
- /* @__PURE__ */ a("div", {
37
- className: "mb-4 animate-in zoom-in duration-300 delay-100",
38
- children: f.icon
39
- }),
40
- /* @__PURE__ */ a("h3", {
41
- className: "text-lg font-semibold text-text-primary mb-2",
42
- children: f.title
43
- }),
44
- /* @__PURE__ */ a("p", {
45
- className: "text-sm text-text-secondary mb-6 text-center max-w-md",
46
- children: f.description
47
- }),
48
- f.showActions && /* @__PURE__ */ o("div", {
49
- className: "flex gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300 delay-200",
50
- children: [u && /* @__PURE__ */ a("button", {
51
- type: "button",
52
- onClick: u,
53
- className: "px-4 py-2 text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover transition-all duration-200",
54
- children: e(d, "files.empty.newFolder", "New Folder")
55
- }), l && /* @__PURE__ */ a("button", {
56
- type: "button",
57
- onClick: l,
58
- className: "px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover transition-all duration-200",
59
- children: e(d, "files.empty.uploadFiles", "Upload Files")
60
- })]
61
- })
62
- ]
33
+ }[l], m = p.showActions && u ? /* @__PURE__ */ a(s, {
34
+ type: "button",
35
+ onClick: u,
36
+ children: e(f, "files.empty.uploadFiles", "Upload Files")
37
+ }) : void 0, h = p.showActions && d ? /* @__PURE__ */ a(s, {
38
+ type: "button",
39
+ variant: "outline",
40
+ onClick: d,
41
+ children: e(f, "files.empty.newFolder", "New Folder")
42
+ }) : void 0;
43
+ return /* @__PURE__ */ a(c, {
44
+ icon: p.icon,
45
+ title: p.title,
46
+ description: p.description,
47
+ action: m,
48
+ secondaryAction: h
63
49
  });
64
50
  }
65
51
  //#endregion
66
- export { c as EmptyState };
52
+ export { l as EmptyState };
67
53
 
68
54
  //# sourceMappingURL=EmptyState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/files/components/EmptyState.tsx"],"sourcesContent":["import { FolderOpen, Star, Trash2, Clock } from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ninterface EmptyStateProps {\n type: \"all\" | \"recent\" | \"starred\" | \"bin\";\n onUpload?: () => void;\n onNewFolder?: () => void;\n}\n\nexport function EmptyState({ type, onUpload, onNewFolder }: EmptyStateProps) {\n const { t } = useI18n();\n const configs = {\n all: {\n icon: <FolderOpen className=\"size-16 text-text-tertiary\" />,\n title: tWithFallback(\n t,\n \"files.empty.all.title\",\n \"No files or folders yet\",\n ),\n description: tWithFallback(\n t,\n \"files.empty.all.description\",\n \"Upload files or create folders to get started\",\n ),\n showActions: true,\n },\n recent: {\n icon: <Clock className=\"size-16 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.recent.title\", \"No recent files\"),\n description: tWithFallback(\n t,\n \"files.empty.recent.description\",\n \"Files you recently opened will appear here\",\n ),\n showActions: false,\n },\n starred: {\n icon: <Star className=\"size-16 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.starred.title\", \"No starred items\"),\n description: tWithFallback(\n t,\n \"files.empty.starred.description\",\n \"Star files and folders to find them easily\",\n ),\n showActions: false,\n },\n bin: {\n icon: <Trash2 className=\"size-16 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.bin.title\", \"Bin is empty\"),\n description: tWithFallback(\n t,\n \"files.empty.bin.description\",\n \"Deleted files and folders will appear here\",\n ),\n showActions: false,\n },\n };\n\n const config = configs[type];\n\n return (\n <div className=\"flex flex-col items-center justify-center py-20 px-4 animate-in fade-in duration-500\">\n <div className=\"mb-4 animate-in zoom-in duration-300 delay-100\">\n {config.icon}\n </div>\n <h3 className=\"text-lg font-semibold text-text-primary mb-2\">\n {config.title}\n </h3>\n <p className=\"text-sm text-text-secondary mb-6 text-center max-w-md\">\n {config.description}\n </p>\n\n {config.showActions && (\n <div className=\"flex gap-3 animate-in fade-in slide-in-from-bottom-2 duration-300 delay-200\">\n {onNewFolder && (\n <button\n type=\"button\"\n onClick={onNewFolder}\n className=\"px-4 py-2 text-sm font-medium text-text-primary bg-bg-surface border border-border-default rounded-lg hover:bg-action-ghost-bg-hover transition-all duration-200\"\n >\n {tWithFallback(t, \"files.empty.newFolder\", \"New Folder\")}\n </button>\n )}\n {onUpload && (\n <button\n type=\"button\"\n onClick={onUpload}\n className=\"px-4 py-2 text-sm font-medium text-action-primary-text bg-action-primary-bg rounded-lg hover:bg-action-primary-bg-hover transition-all duration-200\"\n >\n {tWithFallback(t, \"files.empty.uploadFiles\", \"Upload Files\")}\n </button>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAUA,SAAgB,EAAW,EAAE,SAAM,aAAU,kBAAgC;CAC3E,IAAM,EAAE,SAAM,GAAS,EAgDjB,IA/CU;EACd,KAAK;GACH,MAAM,kBAAC,GAAD,EAAY,WAAU,8BAA+B,CAAA;GAC3D,OAAO,EACL,GACA,yBACA,0BACD;GACD,aAAa,EACX,GACA,+BACA,gDACD;GACD,aAAa;GACd;EACD,QAAQ;GACN,MAAM,kBAAC,GAAD,EAAO,WAAU,8BAA+B,CAAA;GACtD,OAAO,EAAc,GAAG,4BAA4B,kBAAkB;GACtE,aAAa,EACX,GACA,kCACA,6CACD;GACD,aAAa;GACd;EACD,SAAS;GACP,MAAM,kBAAC,GAAD,EAAM,WAAU,8BAA+B,CAAA;GACrD,OAAO,EAAc,GAAG,6BAA6B,mBAAmB;GACxE,aAAa,EACX,GACA,mCACA,6CACD;GACD,aAAa;GACd;EACD,KAAK;GACH,MAAM,kBAAC,GAAD,EAAQ,WAAU,8BAA+B,CAAA;GACvD,OAAO,EAAc,GAAG,yBAAyB,eAAe;GAChE,aAAa,EACX,GACA,+BACA,6CACD;GACD,aAAa;GACd;EACF,CAEsB;AAEvB,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAO;IACJ,CAAA;GACN,kBAAC,MAAD;IAAI,WAAU;cACX,EAAO;IACL,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EAAO;IACN,CAAA;GAEH,EAAO,eACN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAc,GAAG,yBAAyB,aAAa;KACjD,CAAA,EAEV,KACC,kBAAC,UAAD;KACE,MAAK;KACL,SAAS;KACT,WAAU;eAET,EAAc,GAAG,2BAA2B,eAAe;KACrD,CAAA,CAEP;;GAEJ"}
1
+ {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/files/components/EmptyState.tsx"],"sourcesContent":["import { FolderOpen, Star, Trash2, Clock } from \"lucide-react\";\nimport { useI18n } from \"@burdenoff/fe-libs/shared/providers/shell/I18nProvider\";\nimport {\n EmptyState as CanonicalEmptyState,\n Button,\n} from \"@burdenoff/fe-libs/ui\";\nimport { tWithFallback } from \"../utils/i18n\";\n\ninterface EmptyStateProps {\n type: \"all\" | \"recent\" | \"starred\" | \"bin\";\n onUpload?: () => void;\n onNewFolder?: () => void;\n}\n\n/**\n * Local wrapper that delegates to the canonical `<EmptyState>` from\n * `@burdenoff/fe-libs/ui`. Keeps the microfe-files-specific `type`-keyed\n * config (icon + i18n keys + per-type action visibility) at the call site.\n */\nexport function EmptyState({ type, onUpload, onNewFolder }: EmptyStateProps) {\n const { t } = useI18n();\n const configs = {\n all: {\n icon: <FolderOpen className=\"size-12 text-text-tertiary\" />,\n title: tWithFallback(\n t,\n \"files.empty.all.title\",\n \"No files or folders yet\",\n ),\n description: tWithFallback(\n t,\n \"files.empty.all.description\",\n \"Upload files or create folders to get started\",\n ),\n showActions: true,\n },\n recent: {\n icon: <Clock className=\"size-12 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.recent.title\", \"No recent files\"),\n description: tWithFallback(\n t,\n \"files.empty.recent.description\",\n \"Files you recently opened will appear here\",\n ),\n showActions: false,\n },\n starred: {\n icon: <Star className=\"size-12 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.starred.title\", \"No starred items\"),\n description: tWithFallback(\n t,\n \"files.empty.starred.description\",\n \"Star files and folders to find them easily\",\n ),\n showActions: false,\n },\n bin: {\n icon: <Trash2 className=\"size-12 text-text-tertiary\" />,\n title: tWithFallback(t, \"files.empty.bin.title\", \"Bin is empty\"),\n description: tWithFallback(\n t,\n \"files.empty.bin.description\",\n \"Deleted files and folders will appear here\",\n ),\n showActions: false,\n },\n };\n\n const config = configs[type];\n\n const action =\n config.showActions && onUpload ? (\n <Button type=\"button\" onClick={onUpload}>\n {tWithFallback(t, \"files.empty.uploadFiles\", \"Upload Files\")}\n </Button>\n ) : undefined;\n\n const secondaryAction =\n config.showActions && onNewFolder ? (\n <Button type=\"button\" variant=\"outline\" onClick={onNewFolder}>\n {tWithFallback(t, \"files.empty.newFolder\", \"New Folder\")}\n </Button>\n ) : undefined;\n\n return (\n <CanonicalEmptyState\n icon={config.icon}\n title={config.title}\n description={config.description}\n action={action}\n secondaryAction={secondaryAction}\n />\n );\n}\n"],"mappings":";;;;;;AAmBA,SAAgB,EAAW,EAAE,SAAM,aAAU,kBAAgC;CAC3E,IAAM,EAAE,SAAM,GAAS,EAgDjB,IA/CU;EACd,KAAK;GACH,MAAM,kBAAC,GAAD,EAAY,WAAU,8BAA+B,CAAA;GAC3D,OAAO,EACL,GACA,yBACA,0BACD;GACD,aAAa,EACX,GACA,+BACA,gDACD;GACD,aAAa;GACd;EACD,QAAQ;GACN,MAAM,kBAAC,GAAD,EAAO,WAAU,8BAA+B,CAAA;GACtD,OAAO,EAAc,GAAG,4BAA4B,kBAAkB;GACtE,aAAa,EACX,GACA,kCACA,6CACD;GACD,aAAa;GACd;EACD,SAAS;GACP,MAAM,kBAAC,GAAD,EAAM,WAAU,8BAA+B,CAAA;GACrD,OAAO,EAAc,GAAG,6BAA6B,mBAAmB;GACxE,aAAa,EACX,GACA,mCACA,6CACD;GACD,aAAa;GACd;EACD,KAAK;GACH,MAAM,kBAAC,GAAD,EAAQ,WAAU,8BAA+B,CAAA;GACvD,OAAO,EAAc,GAAG,yBAAyB,eAAe;GAChE,aAAa,EACX,GACA,+BACA,6CACD;GACD,aAAa;GACd;EACF,CAEsB,IAEjB,IACJ,EAAO,eAAe,IACpB,kBAAC,GAAD;EAAQ,MAAK;EAAS,SAAS;YAC5B,EAAc,GAAG,2BAA2B,eAAe;EACrD,CAAA,GACP,KAAA,GAEA,IACJ,EAAO,eAAe,IACpB,kBAAC,GAAD;EAAQ,MAAK;EAAS,SAAQ;EAAU,SAAS;YAC9C,EAAc,GAAG,yBAAyB,aAAa;EACjD,CAAA,GACP,KAAA;AAEN,QACE,kBAAC,GAAD;EACE,MAAM,EAAO;EACb,OAAO,EAAO;EACd,aAAa,EAAO;EACZ;EACS;EACjB,CAAA"}