@burdenoff/microfe-files 2026.1110.2 → 2026.1111.2

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.
Files changed (69) hide show
  1. package/dist/files/components/ActionMenu.d.ts +6 -0
  2. package/dist/files/components/ActionMenu.js +2 -1
  3. package/dist/files/components/ActionMenu.js.map +1 -1
  4. package/dist/files/components/ContextMenu.d.ts +6 -0
  5. package/dist/files/components/ContextMenu.js +2 -0
  6. package/dist/files/components/ContextMenu.js.map +1 -1
  7. package/dist/files/components/FileBrowser.d.ts +8 -2
  8. package/dist/files/components/FileBrowser.js +275 -238
  9. package/dist/files/components/FileBrowser.js.map +1 -1
  10. package/dist/files/components/FileCard.d.ts +5 -0
  11. package/dist/files/components/FileCard.js +98 -94
  12. package/dist/files/components/FileCard.js.map +1 -1
  13. package/dist/files/components/FileListItem.d.ts +5 -0
  14. package/dist/files/components/FileListItem.js +88 -87
  15. package/dist/files/components/FileListItem.js.map +1 -1
  16. package/dist/files/components/FilePreviewModal.d.ts +6 -1
  17. package/dist/files/components/FilePreviewModal.js +30 -29
  18. package/dist/files/components/FilePreviewModal.js.map +1 -1
  19. package/dist/files/components/FolderCard.d.ts +5 -0
  20. package/dist/files/components/FolderCard.js +108 -104
  21. package/dist/files/components/FolderCard.js.map +1 -1
  22. package/dist/files/components/ShareDialog.d.ts +12 -5
  23. package/dist/files/components/ShareDialog.js +348 -188
  24. package/dist/files/components/ShareDialog.js.map +1 -1
  25. package/dist/files/components/UploadQueue.js +1 -1
  26. package/dist/files/components/contextMenuItems.d.ts +32 -0
  27. package/dist/files/components/contextMenuItems.js +6 -2
  28. package/dist/files/components/contextMenuItems.js.map +1 -1
  29. package/dist/files/hooks/useBrowsePage.d.ts +10 -0
  30. package/dist/files/hooks/useCopyFile.d.ts +3 -0
  31. package/dist/files/hooks/useCreateFolder.d.ts +2 -0
  32. package/dist/files/hooks/useFoldersQuery.d.ts +1 -1
  33. package/dist/files/hooks/useKeyboardNavigation.js +57 -56
  34. package/dist/files/hooks/useKeyboardNavigation.js.map +1 -1
  35. package/dist/files/hooks/useMoveFile.d.ts +3 -0
  36. package/dist/files/hooks/useMoveFolder.d.ts +2 -0
  37. package/dist/files/hooks/useRenameFile.d.ts +3 -0
  38. package/dist/files/hooks/useRenameFolder.d.ts +2 -0
  39. package/dist/files/hooks/useRestoreFile.d.ts +3 -0
  40. package/dist/files/hooks/useRestoreFolder.d.ts +2 -0
  41. package/dist/files/hooks/useShareDialogPermission.d.ts +45 -0
  42. package/dist/files/hooks/useShareDialogPermission.js +31 -0
  43. package/dist/files/hooks/useShareDialogPermission.js.map +1 -0
  44. package/dist/files/hooks/useSharePermissions.d.ts +30 -0
  45. package/dist/files/hooks/useSharePermissions.js +81 -0
  46. package/dist/files/hooks/useSharePermissions.js.map +1 -0
  47. package/dist/files/hooks/useToggleStar.d.ts +5 -0
  48. package/dist/files/hooks/useUploadFile.d.ts +3 -0
  49. package/dist/files/pages/BrowserPage.js +353 -348
  50. package/dist/files/pages/BrowserPage.js.map +1 -1
  51. package/dist/files/types.d.ts +10 -2
  52. package/dist/files/utils/fileViewModel.js +7 -2
  53. package/dist/files/utils/fileViewModel.js.map +1 -1
  54. package/dist/files/utils/itemCapabilities.d.ts +84 -0
  55. package/dist/files/utils/itemCapabilities.js +54 -0
  56. package/dist/files/utils/itemCapabilities.js.map +1 -0
  57. package/dist/files/utils/sharePermission.d.ts +144 -0
  58. package/dist/files/utils/sharePermission.js +77 -0
  59. package/dist/files/utils/sharePermission.js.map +1 -0
  60. package/dist/generated/global-types.d.ts +6615 -870
  61. package/dist/generated/wspace-operations.d.ts +104 -0
  62. package/dist/generated/wspace-operations.js +1418 -39
  63. package/dist/generated/wspace-operations.js.map +1 -1
  64. package/dist/generated/wspace-types.d.ts +94395 -11225
  65. package/dist/generated/wspace-types.js.map +1 -1
  66. package/dist/translations/en.d.ts +16 -0
  67. package/dist/translations/en.js +16 -0
  68. package/dist/translations/en.js.map +1 -1
  69. package/package.json +2 -1
@@ -1,199 +1,359 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { useEffect as t, useState as n } from "react";
3
- import { Calendar as r, Check as i, Copy as a, Download as o, Link as s, Loader2 as c, Lock as l, Mail as u } from "lucide-react";
4
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
- import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
- import { Button as h, OptionalFields as g, ResponsiveDialog as _, ResponsiveDialogContent as v, ResponsiveDialogFooter as y, ResponsiveDialogHeader as b, ResponsiveDialogTitle as x } from "@burdenoff/fe-libs/ui";
2
+ import { useShareDialogPermission as t } from "../hooks/useShareDialogPermission.js";
3
+ import { classifyShareRefusal as n, shareDenialCopy as r, sharePermissionMessages as i } from "../utils/sharePermission.js";
4
+ import { useEffect as a, useState as o } from "react";
5
+ import { Calendar as s, Check as c, Copy as l, Download as u, Link as d, Loader2 as f, Lock as p, Mail as m, ShieldAlert as h } from "lucide-react";
6
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
7
+ import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { Button as b, OptionalFields as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as E } from "@burdenoff/fe-libs/ui";
7
9
  // src/files/components/ShareDialog.tsx
8
- function S({ item: S, itemType: C, onClose: w, onCreateShare: T, isLoading: E }) {
9
- let { t: D } = m(), [O, k] = n(null), [A, j] = n(null), [M, N] = n(!1), [P, F] = n(7), [I, L] = n(0), [R, z] = n(!1), [B, V] = n(""), [H, U] = n(""), [W, G] = n(null);
10
- return t(() => {
11
- if (M) {
12
- let e = setTimeout(() => N(!1), 2e3);
13
- return () => clearTimeout(e);
14
- }
15
- }, [M]), /* @__PURE__ */ f(_, {
10
+ function D({ item: n, itemType: r, onClose: i, onCreateShare: a, isLoading: s, knownPermission: c }) {
11
+ let { t: l } = y(), [u, d] = o(null), { permission: f, denialCause: p, recordRefusal: m } = t({
12
+ item: n,
13
+ itemType: r,
14
+ knownPermission: c
15
+ }), h = e(l, r === "folder" ? "files.shareDialog.itemType.folder" : "files.shareDialog.itemType.file", r === "folder" ? "folder" : "file");
16
+ return /* @__PURE__ */ _(S, {
16
17
  open: !0,
17
18
  onOpenChange: (e) => {
18
- e || w();
19
+ e || i();
19
20
  },
20
- children: /* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f(b, { children: /* @__PURE__ */ f(x, { children: e(D, "files.shareDialog.title", "Share {{itemType}} \"{{name}}\"", {
21
- itemType: e(D, C === "folder" ? "files.shareDialog.itemType.folder" : "files.shareDialog.itemType.file", C === "folder" ? "folder" : "file"),
22
- name: S.name
23
- }) }) }), A === null ? /* @__PURE__ */ p(d, { children: [
24
- W && /* @__PURE__ */ f("div", {
25
- className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
26
- children: W
27
- }),
28
- /* @__PURE__ */ p("div", {
29
- className: "space-y-4",
30
- children: [
31
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
32
- htmlFor: "share-dialog-expiry-select",
33
- className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
34
- children: [/* @__PURE__ */ f(r, { className: "size-4" }), e(D, "files.shareDialog.expiry.label", "Link expires in")]
35
- }), /* @__PURE__ */ p("select", {
36
- id: "share-dialog-expiry-select",
37
- "aria-label": e(D, "files.shareDialog.expiry.label", "Link expires in"),
38
- value: P,
39
- onChange: (e) => F(Number(e.target.value)),
40
- className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg bg-bg-surface text-text-primary scheme-normal dark:scheme-dark focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
41
- children: [
42
- /* @__PURE__ */ f("option", {
43
- value: 0,
44
- children: e(D, "files.shareDialog.expiry.options.never", "Never")
45
- }),
46
- /* @__PURE__ */ f("option", {
47
- value: 1,
48
- children: e(D, "files.shareDialog.expiry.options.oneDay", "1 day")
49
- }),
50
- /* @__PURE__ */ f("option", {
51
- value: 7,
52
- children: e(D, "files.shareDialog.expiry.options.sevenDays", "7 days")
53
- }),
54
- /* @__PURE__ */ f("option", {
55
- value: 30,
56
- children: e(D, "files.shareDialog.expiry.options.thirtyDays", "30 days")
57
- }),
58
- /* @__PURE__ */ f("option", {
59
- value: 90,
60
- children: e(D, "files.shareDialog.expiry.options.ninetyDays", "90 days")
61
- })
62
- ]
63
- })] }),
64
- /* @__PURE__ */ p("div", { children: [
65
- /* @__PURE__ */ p("label", {
66
- className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
67
- children: [/* @__PURE__ */ f(u, { className: "size-4" }), e(D, "files.shareDialog.invite.label", "Invite specific person (optional)")]
68
- }),
69
- /* @__PURE__ */ f("input", {
70
- type: "email",
71
- value: H,
72
- onChange: (e) => U(e.target.value),
73
- "aria-label": e(D, "files.shareDialog.invite.label", "Invite specific person (optional)"),
74
- placeholder: "user@example.com",
75
- className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
76
- }),
77
- /* @__PURE__ */ f("p", {
78
- className: "mt-1 text-xs text-text-secondary",
79
- children: e(D, "files.shareDialog.invite.help", "Leave empty for public link")
80
- })
81
- ] }),
82
- /* @__PURE__ */ f(g, {
83
- title: e(D, "files.shareDialog.advanced.title", "Advanced"),
84
- description: e(D, "files.shareDialog.advanced.description", "Download limits and password protection"),
85
- children: /* @__PURE__ */ p("div", {
86
- className: "space-y-4",
87
- children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("label", {
88
- className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
89
- children: [/* @__PURE__ */ f(o, { className: "size-4" }), e(D, "files.shareDialog.downloads.label", "Maximum downloads")]
90
- }), /* @__PURE__ */ f("input", {
91
- type: "number",
92
- min: "0",
93
- value: I,
94
- onChange: (e) => L(Number(e.target.value)),
95
- "aria-label": e(D, "files.shareDialog.downloads.label", "Maximum downloads"),
96
- placeholder: e(D, "files.shareDialog.downloads.placeholder", "Unlimited"),
97
- className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
98
- })] }), /* @__PURE__ */ p("div", { children: [
99
- /* @__PURE__ */ p("label", {
100
- className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
101
- children: [/* @__PURE__ */ f(l, { className: "size-4" }), e(D, "files.shareDialog.password.label", "Password protection")]
102
- }),
103
- /* @__PURE__ */ p("div", {
104
- className: "flex items-center gap-2",
105
- children: [/* @__PURE__ */ f("input", {
106
- type: "checkbox",
107
- checked: R,
108
- onChange: (e) => z(e.target.checked),
109
- "aria-label": e(D, "files.shareDialog.password.require", "Require password"),
110
- className: "rounded transition-colors duration-200"
111
- }), /* @__PURE__ */ f("span", {
112
- className: "text-sm text-text-secondary",
113
- children: e(D, "files.shareDialog.password.require", "Require password")
114
- })]
115
- }),
116
- R && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("input", {
117
- type: "password",
118
- value: B,
119
- onChange: (e) => V(e.target.value),
120
- "aria-label": e(D, "files.shareDialog.password.label", "Password protection"),
121
- placeholder: e(D, "files.shareDialog.password.placeholder", "Enter password"),
122
- className: "w-full min-h-11 mt-2 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
123
- }), /* @__PURE__ */ f("p", {
124
- className: "mt-1 text-xs text-text-tertiary",
125
- children: e(D, "files.shareDialog.password.help", "Password must be at least 8 characters and contain uppercase, lowercase, and number")
126
- })] })
127
- ] })]
128
- })
129
- })
130
- ]
131
- }),
132
- /* @__PURE__ */ p(y, { children: [/* @__PURE__ */ f(h, {
133
- type: "button",
134
- variant: "outline",
135
- onClick: w,
136
- children: e(D, "files.common.actions.cancel", "Cancel")
137
- }), /* @__PURE__ */ f(h, {
138
- type: "button",
139
- onClick: async () => {
140
- try {
141
- G(null);
142
- let e = P > 0 ? new Date(Date.now() + P * 24 * 60 * 60 * 1e3).toISOString() : void 0, t = H ? "EMAIL_INVITE" : "PUBLIC_LINK", n = await T({
143
- ...C === "file" ? { fileId: S.id } : { folderId: S.id },
144
- shareType: t,
145
- accessLevel: "DOWNLOAD",
146
- expiresAt: e,
147
- maxDownloads: I > 0 ? I : void 0,
148
- password: R && B ? B : void 0,
149
- invitedEmail: H || void 0
150
- });
151
- j(t), k(n.publicUrl || "");
152
- } catch (e) {
153
- G(e instanceof Error ? e.message : "Failed to create share");
21
+ children: /* @__PURE__ */ v(C, { children: [/* @__PURE__ */ _(T, { children: /* @__PURE__ */ _(E, { children: e(l, "files.shareDialog.title", "Share {{itemType}} \"{{name}}\"", {
22
+ itemType: h,
23
+ name: n.name
24
+ }) }) }), /* @__PURE__ */ _(O, {
25
+ item: n,
26
+ itemType: r,
27
+ itemTypeLabel: h,
28
+ permission: f,
29
+ denialCause: p,
30
+ created: u,
31
+ isLoading: s,
32
+ onClose: i,
33
+ onCreateShare: a,
34
+ onCreated: d,
35
+ onRefused: m
36
+ })] })
37
+ });
38
+ }
39
+ function O({ item: e, itemType: t, itemTypeLabel: n, permission: r, denialCause: i, created: a, isLoading: o, onClose: s, onCreateShare: c, onCreated: l, onRefused: u }) {
40
+ return i === null ? r === "checking" ? /* @__PURE__ */ _(A, { onClose: s }) : a === null ? /* @__PURE__ */ _(P, {
41
+ item: e,
42
+ itemType: t,
43
+ isLoading: o,
44
+ onClose: s,
45
+ onCreateShare: c,
46
+ onCreated: l,
47
+ onRefused: u
48
+ }) : /* @__PURE__ */ _(V, {
49
+ created: a,
50
+ onClose: s
51
+ }) : /* @__PURE__ */ _(k, {
52
+ cause: i,
53
+ itemTypeLabel: n,
54
+ onClose: s
55
+ });
56
+ }
57
+ function k({ cause: t, itemTypeLabel: n, onClose: i }) {
58
+ let { t: a } = y(), o = r(a, t, n);
59
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
60
+ role: "alert",
61
+ className: "flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle px-4 py-3",
62
+ children: [/* @__PURE__ */ _(h, { className: "mt-0.5 size-5 flex-shrink-0 text-status-warning-text" }), /* @__PURE__ */ v("div", {
63
+ className: "space-y-1",
64
+ children: [/* @__PURE__ */ _("p", {
65
+ className: "text-sm font-medium text-text-primary",
66
+ children: o.title
67
+ }), /* @__PURE__ */ _("p", {
68
+ className: "text-sm text-text-secondary",
69
+ children: o.description
70
+ })]
71
+ })]
72
+ }), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
73
+ type: "button",
74
+ onClick: i,
75
+ children: e(a, "files.common.actions.close", "Close")
76
+ }) })] });
77
+ }
78
+ function A({ onClose: t }) {
79
+ let { t: n } = y();
80
+ return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
81
+ role: "status",
82
+ "aria-live": "polite",
83
+ className: "flex items-center gap-3 py-6 text-sm text-text-secondary",
84
+ children: [/* @__PURE__ */ _(f, { className: "size-4 animate-spin" }), i(n).checking]
85
+ }), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
86
+ type: "button",
87
+ variant: "outline",
88
+ onClick: t,
89
+ children: e(n, "files.common.actions.cancel", "Cancel")
90
+ }) })] });
91
+ }
92
+ var j = 864e5;
93
+ function M(e, t, n) {
94
+ let r = n.expiryDays > 0 ? new Date(Date.now() + n.expiryDays * j).toISOString() : void 0;
95
+ return {
96
+ ...t === "file" ? { fileId: e } : { folderId: e },
97
+ shareType: n.invitedEmail ? "EMAIL_INVITE" : "PUBLIC_LINK",
98
+ accessLevel: "DOWNLOAD",
99
+ expiresAt: r,
100
+ maxDownloads: n.maxDownloads > 0 ? n.maxDownloads : void 0,
101
+ password: n.hasPassword && n.password ? n.password : void 0,
102
+ invitedEmail: n.invitedEmail || void 0
103
+ };
104
+ }
105
+ function N(t, n) {
106
+ return n instanceof Error ? n.message : e(t, "files.shareDialog.errors.createFailed", "Failed to create share");
107
+ }
108
+ function P({ item: t, itemType: r, isLoading: i, onClose: a, onCreateShare: s, onCreated: c, onRefused: l }) {
109
+ let { t: u } = y(), [d, f] = o({
110
+ expiryDays: 7,
111
+ maxDownloads: 0,
112
+ hasPassword: !1,
113
+ password: "",
114
+ invitedEmail: ""
115
+ }), [p, m] = o(null), h = (e) => f((t) => ({
116
+ ...t,
117
+ ...e
118
+ }));
119
+ return /* @__PURE__ */ v(g, { children: [
120
+ p && /* @__PURE__ */ _("div", {
121
+ className: "mb-4 rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
122
+ children: p
123
+ }),
124
+ /* @__PURE__ */ v("div", {
125
+ className: "space-y-4",
126
+ children: [
127
+ /* @__PURE__ */ _(L, {
128
+ value: d.expiryDays,
129
+ onChange: (e) => h({ expiryDays: e })
130
+ }),
131
+ /* @__PURE__ */ _(R, {
132
+ value: d.invitedEmail,
133
+ onChange: (e) => h({ invitedEmail: e })
134
+ }),
135
+ /* @__PURE__ */ _(z, {
136
+ values: d,
137
+ onChange: h
138
+ })
139
+ ]
140
+ }),
141
+ /* @__PURE__ */ v(w, { children: [/* @__PURE__ */ _(b, {
142
+ type: "button",
143
+ variant: "outline",
144
+ onClick: a,
145
+ children: e(u, "files.common.actions.cancel", "Cancel")
146
+ }), /* @__PURE__ */ _(b, {
147
+ type: "button",
148
+ onClick: async () => {
149
+ m(null);
150
+ let e = M(t.id, r, d);
151
+ try {
152
+ let t = await s(e);
153
+ c({
154
+ shareType: e.shareType,
155
+ shareUrl: t.publicUrl || "",
156
+ invitedEmail: d.invitedEmail
157
+ });
158
+ } catch (e) {
159
+ let t = n(e);
160
+ if (t !== null) {
161
+ l(t);
162
+ return;
154
163
  }
155
- },
156
- disabled: E || R && !B,
157
- children: E ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(c, { className: "size-4 animate-spin" }), e(D, "files.shareDialog.actions.creating", "Creating...")] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, { className: "size-4" }), e(D, "files.shareDialog.actions.createLink", "Create share link")] })
158
- })] })
159
- ] }) : /* @__PURE__ */ f(d, { children: /* @__PURE__ */ p("div", {
164
+ m(N(u, e));
165
+ }
166
+ },
167
+ disabled: i || d.hasPassword && !d.password,
168
+ children: /* @__PURE__ */ _(F, { isLoading: i })
169
+ })] })
170
+ ] });
171
+ }
172
+ function F({ isLoading: t }) {
173
+ let { t: n } = y();
174
+ return t ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(f, { className: "size-4 animate-spin" }), e(n, "files.shareDialog.actions.creating", "Creating...")] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(d, { className: "size-4" }), e(n, "files.shareDialog.actions.createLink", "Create share link")] });
175
+ }
176
+ var I = [
177
+ {
178
+ days: 0,
179
+ key: "files.shareDialog.expiry.options.never",
180
+ fallback: "Never"
181
+ },
182
+ {
183
+ days: 1,
184
+ key: "files.shareDialog.expiry.options.oneDay",
185
+ fallback: "1 day"
186
+ },
187
+ {
188
+ days: 7,
189
+ key: "files.shareDialog.expiry.options.sevenDays",
190
+ fallback: "7 days"
191
+ },
192
+ {
193
+ days: 30,
194
+ key: "files.shareDialog.expiry.options.thirtyDays",
195
+ fallback: "30 days"
196
+ },
197
+ {
198
+ days: 90,
199
+ key: "files.shareDialog.expiry.options.ninetyDays",
200
+ fallback: "90 days"
201
+ }
202
+ ];
203
+ function L({ value: t, onChange: n }) {
204
+ let { t: r } = y(), i = e(r, "files.shareDialog.expiry.label", "Link expires in");
205
+ return /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
206
+ htmlFor: "share-dialog-expiry-select",
207
+ className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
208
+ children: [/* @__PURE__ */ _(s, { className: "size-4" }), i]
209
+ }), /* @__PURE__ */ _("select", {
210
+ id: "share-dialog-expiry-select",
211
+ "aria-label": i,
212
+ value: t,
213
+ onChange: (e) => n(Number(e.target.value)),
214
+ className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg bg-bg-surface text-text-primary scheme-normal dark:scheme-dark focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200 [&_option]:bg-bg-surface [&_option]:text-text-primary",
215
+ children: I.map((t) => /* @__PURE__ */ _("option", {
216
+ value: t.days,
217
+ children: e(r, t.key, t.fallback)
218
+ }, t.days))
219
+ })] });
220
+ }
221
+ function R({ value: t, onChange: n }) {
222
+ let { t: r } = y(), i = e(r, "files.shareDialog.invite.label", "Invite specific person (optional)");
223
+ return /* @__PURE__ */ v("div", { children: [
224
+ /* @__PURE__ */ v("label", {
225
+ htmlFor: "share-dialog-invite-email",
226
+ className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
227
+ children: [/* @__PURE__ */ _(m, { className: "size-4" }), i]
228
+ }),
229
+ /* @__PURE__ */ _("input", {
230
+ id: "share-dialog-invite-email",
231
+ type: "email",
232
+ value: t,
233
+ onChange: (e) => n(e.target.value),
234
+ "aria-label": i,
235
+ placeholder: "user@example.com",
236
+ className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
237
+ }),
238
+ /* @__PURE__ */ _("p", {
239
+ className: "mt-1 text-xs text-text-secondary",
240
+ children: e(r, "files.shareDialog.invite.help", "Leave empty for public link")
241
+ })
242
+ ] });
243
+ }
244
+ function z({ values: t, onChange: n }) {
245
+ let { t: r } = y(), i = e(r, "files.shareDialog.downloads.label", "Maximum downloads");
246
+ return /* @__PURE__ */ _(x, {
247
+ title: e(r, "files.shareDialog.advanced.title", "Advanced"),
248
+ description: e(r, "files.shareDialog.advanced.description", "Download limits and password protection"),
249
+ children: /* @__PURE__ */ v("div", {
160
250
  className: "space-y-4",
161
- children: [/* @__PURE__ */ f("div", {
162
- className: "bg-status-success-bg-subtle border border-status-success-border rounded-lg p-4",
163
- children: A === "EMAIL_INVITE" ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("p", {
164
- className: "text-sm font-medium text-status-success-text mb-2",
165
- children: e(D, "files.shareDialog.success.invitationSent", "Invitation sent successfully!")
166
- }), /* @__PURE__ */ f("p", {
167
- className: "text-sm text-text-secondary",
168
- children: e(D, "files.shareDialog.success.invitationSentTo", "An invitation has been sent to {{email}}", { email: H })
169
- })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("p", {
170
- className: "text-sm font-medium text-status-success-text mb-2",
171
- children: e(D, "files.shareDialog.success.linkCreated", "Share link created successfully!")
172
- }), /* @__PURE__ */ p("div", {
173
- className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
174
- children: [/* @__PURE__ */ f("input", {
175
- type: "text",
176
- value: O || "",
177
- readOnly: !0,
178
- "aria-label": e(D, "files.shareDialog.success.linkCreated", "Share link"),
179
- className: "flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm"
180
- }), /* @__PURE__ */ f(h, {
181
- type: "button",
182
- onClick: async () => {
183
- O && (await navigator.clipboard.writeText(O), N(!0));
184
- },
185
- children: M ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(i, { className: "size-4" }), e(D, "files.shareDialog.actions.copied", "Copied!")] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a, { className: "size-4" }), e(D, "files.common.actions.copy", "Copy")] })
186
- })]
187
- })] })
188
- }), /* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(h, {
189
- type: "button",
190
- onClick: w,
191
- className: "w-full",
192
- children: e(D, "files.common.actions.done", "Done")
193
- }) })]
194
- }) })] })
251
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
252
+ htmlFor: "share-dialog-max-downloads",
253
+ className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
254
+ children: [/* @__PURE__ */ _(u, { className: "size-4" }), i]
255
+ }), /* @__PURE__ */ _("input", {
256
+ id: "share-dialog-max-downloads",
257
+ type: "number",
258
+ min: "0",
259
+ value: t.maxDownloads,
260
+ onChange: (e) => {
261
+ let { valueAsNumber: t } = e.target;
262
+ n({ maxDownloads: Number.isNaN(t) ? 0 : t });
263
+ },
264
+ "aria-label": i,
265
+ placeholder: e(r, "files.shareDialog.downloads.placeholder", "Unlimited"),
266
+ className: "w-full min-h-11 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
267
+ })] }), /* @__PURE__ */ _(B, {
268
+ values: t,
269
+ onChange: n
270
+ })]
271
+ })
195
272
  });
196
273
  }
197
- export { S as ShareDialog };
274
+ function B({ values: t, onChange: n }) {
275
+ let { t: r } = y(), i = e(r, "files.shareDialog.password.label", "Password protection"), a = e(r, "files.shareDialog.password.require", "Require password");
276
+ return /* @__PURE__ */ v("div", { children: [
277
+ /* @__PURE__ */ v("label", {
278
+ htmlFor: "share-dialog-password-required",
279
+ className: "flex items-center gap-2 text-sm font-medium text-text-primary mb-2",
280
+ children: [/* @__PURE__ */ _(p, { className: "size-4" }), i]
281
+ }),
282
+ /* @__PURE__ */ v("div", {
283
+ className: "flex items-center gap-2",
284
+ children: [/* @__PURE__ */ _("input", {
285
+ id: "share-dialog-password-required",
286
+ type: "checkbox",
287
+ checked: t.hasPassword,
288
+ onChange: (e) => n({ hasPassword: e.target.checked }),
289
+ "aria-label": a,
290
+ className: "rounded transition-colors duration-200"
291
+ }), /* @__PURE__ */ _("span", {
292
+ className: "text-sm text-text-secondary",
293
+ children: a
294
+ })]
295
+ }),
296
+ t.hasPassword && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("input", {
297
+ type: "password",
298
+ value: t.password,
299
+ onChange: (e) => n({ password: e.target.value }),
300
+ "aria-label": i,
301
+ placeholder: e(r, "files.shareDialog.password.placeholder", "Enter password"),
302
+ className: "w-full min-h-11 mt-2 px-3 py-2 border border-border-default rounded-lg focus:outline-none focus:border-action-primary-border text-sm transition-colors duration-200"
303
+ }), /* @__PURE__ */ _("p", {
304
+ className: "mt-1 text-xs text-text-tertiary",
305
+ children: e(r, "files.shareDialog.password.help", "Password must be at least 8 characters and contain uppercase, lowercase, and number")
306
+ })] })
307
+ ] });
308
+ }
309
+ function V({ created: t, onClose: n }) {
310
+ let { t: r } = y();
311
+ return /* @__PURE__ */ v("div", {
312
+ className: "space-y-4",
313
+ children: [/* @__PURE__ */ _("div", {
314
+ className: "bg-status-success-bg-subtle border border-status-success-border rounded-lg p-4",
315
+ children: t.shareType === "EMAIL_INVITE" ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("p", {
316
+ className: "text-sm font-medium text-status-success-text mb-2",
317
+ children: e(r, "files.shareDialog.success.invitationSent", "Invitation sent successfully!")
318
+ }), /* @__PURE__ */ _("p", {
319
+ className: "text-sm text-text-secondary",
320
+ children: e(r, "files.shareDialog.success.invitationSentTo", "An invitation has been sent to {{email}}", { email: t.invitedEmail })
321
+ })] }) : /* @__PURE__ */ _(H, { shareUrl: t.shareUrl })
322
+ }), /* @__PURE__ */ _(w, { children: /* @__PURE__ */ _(b, {
323
+ type: "button",
324
+ onClick: n,
325
+ className: "w-full",
326
+ children: e(r, "files.common.actions.done", "Done")
327
+ }) })]
328
+ });
329
+ }
330
+ function H({ shareUrl: t }) {
331
+ let { t: n } = y(), [r, i] = o(!1);
332
+ return a(() => {
333
+ if (r) {
334
+ let e = setTimeout(() => i(!1), 2e3);
335
+ return () => clearTimeout(e);
336
+ }
337
+ }, [r]), /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("p", {
338
+ className: "text-sm font-medium text-status-success-text mb-2",
339
+ children: e(n, "files.shareDialog.success.linkCreated", "Share link created successfully!")
340
+ }), /* @__PURE__ */ v("div", {
341
+ className: "flex flex-col sm:flex-row items-stretch sm:items-center gap-2",
342
+ children: [/* @__PURE__ */ _("input", {
343
+ type: "text",
344
+ value: t,
345
+ readOnly: !0,
346
+ "aria-label": e(n, "files.shareDialog.success.linkCreated", "Share link"),
347
+ className: "flex-1 min-h-11 px-3 py-2 bg-bg-surface border border-status-success-border rounded-lg text-sm"
348
+ }), /* @__PURE__ */ _(b, {
349
+ type: "button",
350
+ onClick: async () => {
351
+ t && (await navigator.clipboard.writeText(t), i(!0));
352
+ },
353
+ children: r ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(c, { className: "size-4" }), e(n, "files.shareDialog.actions.copied", "Copied!")] }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(l, { className: "size-4" }), e(n, "files.common.actions.copy", "Copy")] })
354
+ })]
355
+ })] });
356
+ }
357
+ export { D as ShareDialog };
198
358
 
199
359
  //# sourceMappingURL=ShareDialog.js.map