@burdenoff/microfe-export 2026.1107.2 → 2026.1113.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.
- package/dist/dev/main.d.ts +0 -2
- package/dist/export/ExportRoot.d.ts +0 -2
- package/dist/export/ExportRoot.js +50 -42
- package/dist/export/ExportRoot.js.map +1 -1
- package/dist/export/ExportRoutes.d.ts +8 -2
- package/dist/export/ExportRoutes.js +71 -53
- package/dist/export/ExportRoutes.js.map +1 -1
- package/dist/export/components/ConfirmDestructiveDialog.d.ts +21 -0
- package/dist/export/components/ConfirmDestructiveDialog.js +37 -0
- package/dist/export/components/ConfirmDestructiveDialog.js.map +1 -0
- package/dist/export/components/DownloadSections.d.ts +10 -0
- package/dist/export/components/DownloadSections.js +161 -0
- package/dist/export/components/DownloadSections.js.map +1 -0
- package/dist/export/components/DownloadStatus.d.ts +13 -0
- package/dist/export/components/DownloadStatus.js +36 -0
- package/dist/export/components/DownloadStatus.js.map +1 -0
- package/dist/export/components/DownloadsTabs.d.ts +5 -0
- package/dist/export/components/DownloadsTabs.js +25 -0
- package/dist/export/components/DownloadsTabs.js.map +1 -0
- package/dist/export/components/ExportProgressBar.d.ts +1 -2
- package/dist/export/components/ExportProgressBar.js +1 -2
- package/dist/export/components/ExportProgressBar.js.map +1 -1
- package/dist/export/components/ExportStatusBadge.d.ts +1 -3
- package/dist/export/components/ExportStatusBadge.js +7 -8
- package/dist/export/components/ExportStatusBadge.js.map +1 -1
- package/dist/export/components/PageLayout.d.ts +3 -5
- package/dist/export/components/PageLayout.js +1 -2
- package/dist/export/components/PageLayout.js.map +1 -1
- package/dist/export/constants/enums.d.ts +0 -2
- package/dist/export/constants/enums.js +1 -2
- package/dist/export/constants/enums.js.map +1 -1
- package/dist/export/constants/index.d.ts +0 -1
- package/dist/export/hooks/useEntityLabel.d.ts +7 -0
- package/dist/export/hooks/useEntityLabel.js +16 -0
- package/dist/export/hooks/useEntityLabel.js.map +1 -0
- package/dist/export/hooks/useExportQueries.d.ts +17 -32
- package/dist/export/hooks/useExportQueries.js +144 -145
- package/dist/export/hooks/useExportQueries.js.map +1 -1
- package/dist/export/hooks/useTr.d.ts +0 -2
- package/dist/export/hooks/useTr.js +1 -2
- package/dist/export/hooks/useTr.js.map +1 -1
- package/dist/export/index.d.ts +0 -1
- package/dist/export/index.js +5 -4
- package/dist/export/navigation-v2/NavigationV2.d.ts +7 -0
- package/dist/export/navigation-v2/NavigationV2.js +16 -0
- package/dist/export/navigation-v2/NavigationV2.js.map +1 -0
- package/dist/export/pages/CreateExportPage.d.ts +1 -2
- package/dist/export/pages/CreateExportPage.js +126 -125
- package/dist/export/pages/CreateExportPage.js.map +1 -1
- package/dist/export/pages/ExportDashboardPage.d.ts +1 -2
- package/dist/export/pages/ExportDashboardPage.js +17 -18
- package/dist/export/pages/ExportDashboardPage.js.map +1 -1
- package/dist/export/pages/ExportDetailPage.d.ts +1 -2
- package/dist/export/pages/ExportDetailPage.js +133 -127
- package/dist/export/pages/ExportDetailPage.js.map +1 -1
- package/dist/export/pages/ExportHistoryPage.d.ts +1 -2
- package/dist/export/pages/ExportHistoryPage.js +74 -69
- package/dist/export/pages/ExportHistoryPage.js.map +1 -1
- package/dist/export/pages/ExportLandingPage.d.ts +1 -2
- package/dist/export/pages/ExportLandingPage.js +1 -2
- package/dist/export/pages/ExportLandingPage.js.map +1 -1
- package/dist/export/pages/ExportTemplatesPage.d.ts +1 -2
- package/dist/export/pages/ExportTemplatesPage.js +219 -192
- package/dist/export/pages/ExportTemplatesPage.js.map +1 -1
- package/dist/export/pages/TemplateDetailPage.d.ts +1 -2
- package/dist/export/pages/TemplateDetailPage.js +146 -125
- package/dist/export/pages/TemplateDetailPage.js.map +1 -1
- package/dist/export/pages/v2/DownloadDetailPage.d.ts +8 -0
- package/dist/export/pages/v2/DownloadDetailPage.js +176 -0
- package/dist/export/pages/v2/DownloadDetailPage.js.map +1 -0
- package/dist/export/pages/v2/DownloadsPage.d.ts +10 -0
- package/dist/export/pages/v2/DownloadsPage.js +401 -0
- package/dist/export/pages/v2/DownloadsPage.js.map +1 -0
- package/dist/export/pages/v2/NewDownloadPage.d.ts +8 -0
- package/dist/export/pages/v2/NewDownloadPage.js +440 -0
- package/dist/export/pages/v2/NewDownloadPage.js.map +1 -0
- package/dist/export/providers/ExportProvider.d.ts +0 -2
- package/dist/export/providers/ExportProvider.js +12 -16
- package/dist/export/providers/ExportProvider.js.map +1 -1
- package/dist/export/store/exportStore.d.ts +0 -2
- package/dist/export/store/exportStore.js +1 -2
- package/dist/export/store/exportStore.js.map +1 -1
- package/dist/export/types/index.d.ts +7 -1
- package/dist/export/utils/billing.d.ts +6 -0
- package/dist/export/utils/billing.js +7 -0
- package/dist/export/utils/billing.js.map +1 -0
- package/dist/export/utils/cn.d.ts +0 -2
- package/dist/export/utils/cn.js +2 -3
- package/dist/export/utils/cn.js.map +1 -1
- package/dist/export/utils/disabledModules.d.ts +0 -1
- package/dist/export/utils/disabledModules.js +3 -4
- package/dist/export/utils/disabledModules.js.map +1 -1
- package/dist/export/utils/downloadStatus.d.ts +15 -0
- package/dist/export/utils/downloadStatus.js +48 -0
- package/dist/export/utils/downloadStatus.js.map +1 -0
- package/dist/export/utils/entityLabels.d.ts +47 -0
- package/dist/export/utils/entityLabels.js +150 -0
- package/dist/export/utils/entityLabels.js.map +1 -0
- package/dist/export/utils/events.d.ts +0 -2
- package/dist/export/utils/events.js +1 -2
- package/dist/export/utils/events.js.map +1 -1
- package/dist/export/utils/exportAuthority.d.ts +0 -2
- package/dist/export/utils/exportAuthority.js +1 -2
- package/dist/export/utils/exportAuthority.js.map +1 -1
- package/dist/export/utils/formatBytes.d.ts +2 -0
- package/dist/export/utils/formatBytes.js +15 -0
- package/dist/export/utils/formatBytes.js.map +1 -0
- package/dist/export/utils/i18n.d.ts +0 -2
- package/dist/export/utils/i18n.js +1 -2
- package/dist/export/utils/i18n.js.map +1 -1
- package/dist/export/utils/newDownloadForm.d.ts +32 -0
- package/dist/export/utils/newDownloadForm.js +42 -0
- package/dist/export/utils/newDownloadForm.js.map +1 -0
- package/dist/export/utils/paths.d.ts +2 -0
- package/dist/export/utils/paths.js +7 -0
- package/dist/export/utils/paths.js.map +1 -0
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +226 -181
- package/dist/generated/wspace-operations.js +1 -2
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +15 -16
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +0 -1
- package/dist/translations/en.js +1 -2
- package/dist/translations/en.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +63 -47
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/export/ExportRoot.d.ts.map +0 -1
- package/dist/export/ExportRoutes.d.ts.map +0 -1
- package/dist/export/components/ExportProgressBar.d.ts.map +0 -1
- package/dist/export/components/ExportStatusBadge.d.ts.map +0 -1
- package/dist/export/components/PageLayout.d.ts.map +0 -1
- package/dist/export/constants/enums.d.ts.map +0 -1
- package/dist/export/constants/index.d.ts.map +0 -1
- package/dist/export/hooks/useExportQueries.d.ts.map +0 -1
- package/dist/export/hooks/useTr.d.ts.map +0 -1
- package/dist/export/index.d.ts.map +0 -1
- package/dist/export/pages/CreateExportPage.d.ts.map +0 -1
- package/dist/export/pages/ExportDashboardPage.d.ts.map +0 -1
- package/dist/export/pages/ExportDetailPage.d.ts.map +0 -1
- package/dist/export/pages/ExportHistoryPage.d.ts.map +0 -1
- package/dist/export/pages/ExportLandingPage.d.ts.map +0 -1
- package/dist/export/pages/ExportTemplatesPage.d.ts.map +0 -1
- package/dist/export/pages/TemplateDetailPage.d.ts.map +0 -1
- package/dist/export/providers/ExportProvider.d.ts.map +0 -1
- package/dist/export/store/exportStore.d.ts.map +0 -1
- package/dist/export/types/index.d.ts.map +0 -1
- package/dist/export/utils/cn.d.ts.map +0 -1
- package/dist/export/utils/disabledModules.d.ts.map +0 -1
- package/dist/export/utils/events.d.ts.map +0 -1
- package/dist/export/utils/exportAuthority.d.ts.map +0 -1
- package/dist/export/utils/i18n.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
- package/dist/translations/en.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { PageSection as t } from "./PageLayout.js";
|
|
3
|
+
import { ExportProgressBar as n } from "./ExportProgressBar.js";
|
|
4
|
+
import { formatBytes as r } from "../utils/formatBytes.js";
|
|
5
|
+
import { isInProgress as i } from "../utils/downloadStatus.js";
|
|
6
|
+
import { AlertCircle as a, CheckCircle2 as o, Clock as s, Download as c, FileDown as l, HardDrive as u } from "lucide-react";
|
|
7
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
|
+
import { GlassCard as m, ShowTechnicalDetails as h } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
// src/export/components/DownloadSections.tsx
|
|
10
|
+
function g({ job: g, label: _ }) {
|
|
11
|
+
let v = e(), y = i(g.status);
|
|
12
|
+
return /* @__PURE__ */ p(d, { children: [
|
|
13
|
+
y && /* @__PURE__ */ p("div", {
|
|
14
|
+
className: "space-y-2 rounded-xl border border-border-subtle bg-bg-surface p-5",
|
|
15
|
+
role: "status",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ f("p", {
|
|
18
|
+
className: "font-medium text-text-primary",
|
|
19
|
+
children: v("export.detail.progress.preparing", "Preparing your files…")
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ f(n, {
|
|
22
|
+
progress: g.progress,
|
|
23
|
+
size: "md"
|
|
24
|
+
}),
|
|
25
|
+
g.processedEntities != null && g.totalEntities != null && /* @__PURE__ */ f("p", {
|
|
26
|
+
className: "text-sm text-text-secondary",
|
|
27
|
+
children: v("export.detail.progress.items", "{{processed}} of {{total}} items ready", {
|
|
28
|
+
processed: g.processedEntities.toLocaleString(),
|
|
29
|
+
total: g.totalEntities.toLocaleString()
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
g.status === "FAILED" && /* @__PURE__ */ p("div", {
|
|
35
|
+
className: "flex items-start gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-5",
|
|
36
|
+
children: [/* @__PURE__ */ f(a, {
|
|
37
|
+
size: 20,
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
className: "mt-0.5 shrink-0 text-status-error-text"
|
|
40
|
+
}), /* @__PURE__ */ p("div", {
|
|
41
|
+
className: "min-w-0 space-y-2",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ f("p", {
|
|
44
|
+
className: "font-medium text-status-error-text",
|
|
45
|
+
children: v("export.detail.failed.title", "This download didn't finish")
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ f("p", {
|
|
48
|
+
className: "text-sm text-text-secondary",
|
|
49
|
+
children: v("export.detail.failed.description", "Try again. If it stops again, pick less data or a shorter date range.")
|
|
50
|
+
}),
|
|
51
|
+
g.errorMessage ? /* @__PURE__ */ f(h, {
|
|
52
|
+
copyable: !0,
|
|
53
|
+
children: g.errorMessage
|
|
54
|
+
}) : null
|
|
55
|
+
]
|
|
56
|
+
})]
|
|
57
|
+
}),
|
|
58
|
+
g.status === "EXPIRED" && /* @__PURE__ */ f("p", {
|
|
59
|
+
className: "rounded-xl border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary",
|
|
60
|
+
children: v("export.detail.expired.description", "The download link has expired. Try again to make a fresh copy.")
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ f("div", {
|
|
63
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
64
|
+
children: [{
|
|
65
|
+
icon: /* @__PURE__ */ f(u, {
|
|
66
|
+
size: 16,
|
|
67
|
+
"aria-hidden": "true"
|
|
68
|
+
}),
|
|
69
|
+
name: v("export.detail.info.totalSize", "Total Size"),
|
|
70
|
+
value: g.totalSizeBytes == null ? "-" : r(g.totalSizeBytes)
|
|
71
|
+
}, {
|
|
72
|
+
icon: /* @__PURE__ */ f(s, {
|
|
73
|
+
size: 16,
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}),
|
|
76
|
+
name: v("export.detail.info.created", "Created"),
|
|
77
|
+
value: new Date(g.createdAt).toLocaleDateString()
|
|
78
|
+
}].map((e) => /* @__PURE__ */ p(m, {
|
|
79
|
+
treatment: "metric",
|
|
80
|
+
className: "border-border-seam p-4",
|
|
81
|
+
children: [/* @__PURE__ */ p("div", {
|
|
82
|
+
className: "mb-1 flex items-center gap-2 text-text-secondary",
|
|
83
|
+
children: [e.icon, /* @__PURE__ */ f("span", {
|
|
84
|
+
className: "text-xs font-medium",
|
|
85
|
+
children: e.name
|
|
86
|
+
})]
|
|
87
|
+
}), /* @__PURE__ */ f("p", {
|
|
88
|
+
className: "text-lg font-bold tabular-nums",
|
|
89
|
+
children: e.value
|
|
90
|
+
})]
|
|
91
|
+
}, e.name))
|
|
92
|
+
}),
|
|
93
|
+
g.parts.length > 0 && /* @__PURE__ */ f(t, {
|
|
94
|
+
title: v("export.detail.parts.title", "Export Parts"),
|
|
95
|
+
children: /* @__PURE__ */ f("ul", {
|
|
96
|
+
className: "space-y-2",
|
|
97
|
+
children: g.parts.map((e) => /* @__PURE__ */ p("li", {
|
|
98
|
+
className: "flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between",
|
|
99
|
+
children: [/* @__PURE__ */ p("div", {
|
|
100
|
+
className: "flex min-w-0 items-center gap-3",
|
|
101
|
+
children: [/* @__PURE__ */ f(l, {
|
|
102
|
+
size: 20,
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
className: "shrink-0 text-text-secondary"
|
|
105
|
+
}), /* @__PURE__ */ p("div", {
|
|
106
|
+
className: "min-w-0",
|
|
107
|
+
children: [/* @__PURE__ */ f("p", {
|
|
108
|
+
className: "truncate font-medium",
|
|
109
|
+
children: e.fileName
|
|
110
|
+
}), /* @__PURE__ */ p("p", {
|
|
111
|
+
className: "text-sm text-text-secondary",
|
|
112
|
+
children: [
|
|
113
|
+
e.entityTypes.map(_).join(", "),
|
|
114
|
+
" ·",
|
|
115
|
+
" ",
|
|
116
|
+
r(e.sizeBytes),
|
|
117
|
+
e.downloadExpiresAt && ` · ${v("export.detail.parts.availableUntil", "Available until {{date}}", { date: new Date(e.downloadExpiresAt).toLocaleDateString() })}`
|
|
118
|
+
]
|
|
119
|
+
})]
|
|
120
|
+
})]
|
|
121
|
+
}), e.downloadUrl ? /* @__PURE__ */ p("a", {
|
|
122
|
+
href: e.downloadUrl,
|
|
123
|
+
className: "inline-flex shrink-0 items-center gap-2 self-start rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium hover:bg-accent sm:self-auto",
|
|
124
|
+
"aria-label": v("export.detail.parts.downloadAria", "Download {{name}}", { name: e.fileName }),
|
|
125
|
+
children: [/* @__PURE__ */ f(c, {
|
|
126
|
+
size: 14,
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}), v("export.detail.parts.download", "Download")]
|
|
129
|
+
}) : /* @__PURE__ */ p("span", {
|
|
130
|
+
className: "inline-flex items-center gap-1.5 text-sm text-text-secondary",
|
|
131
|
+
children: [/* @__PURE__ */ f(s, {
|
|
132
|
+
size: 14,
|
|
133
|
+
"aria-hidden": "true"
|
|
134
|
+
}), v("export.detail.parts.pending", "Pending")]
|
|
135
|
+
})]
|
|
136
|
+
}, e.id))
|
|
137
|
+
})
|
|
138
|
+
}),
|
|
139
|
+
g.status === "COMPLETED" && g.parts.length === 0 && /* @__PURE__ */ p("div", {
|
|
140
|
+
className: "rounded-xl border border-border-subtle bg-bg-surface p-6 text-center",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ f(o, {
|
|
143
|
+
size: 36,
|
|
144
|
+
"aria-hidden": "true",
|
|
145
|
+
className: "mx-auto mb-2 text-text-secondary"
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ f("p", {
|
|
148
|
+
className: "font-semibold",
|
|
149
|
+
children: v("export.detail.complete.title", "Export Complete")
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ f("p", {
|
|
152
|
+
className: "text-sm text-text-secondary",
|
|
153
|
+
children: v("export.detail.complete.noParts", "Your export has completed but no download parts are available yet.")
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
] });
|
|
158
|
+
}
|
|
159
|
+
export { g as DownloadSections };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=DownloadSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadSections.js","names":["_Fragment","DownloadSections","tr","useTr","inProgress","isInProgress","job","Fragment","ExportProgressBar","AlertCircle","ShowTechnicalDetails","HardDrive","formatBytes","Clock","GlassCard","item","PageSection","FileDown","part","label","Download","CheckCircle2"],"sources":["../../../src/export/components/DownloadSections.tsx"],"sourcesContent":["import {\n AlertCircle,\n CheckCircle2,\n Clock,\n Download,\n FileDown,\n HardDrive,\n} from \"lucide-react\";\nimport { GlassCard, ShowTechnicalDetails } from \"@burdenoff/fe-libs/ui\";\nimport { useTr } from \"../hooks/useTr\";\nimport { PageSection } from \"./PageLayout\";\nimport { ExportProgressBar } from \"./ExportProgressBar\";\nimport { formatBytes } from \"../utils/formatBytes\";\nimport { isInProgress } from \"../utils/downloadStatus\";\nimport type { ExportJob } from \"../types\";\n\n/**\n * The body of a download's page in Navigation v2 (BOFF-11870): progress while\n * it prepares, the failure or expiry note, the size and date cards, the files\n * and the \"complete, files not ready yet\" state.\n */\nexport function DownloadSections({\n job,\n label,\n}: {\n job: ExportJob;\n label: (entityType: string) => string;\n}) {\n const tr = useTr();\n const inProgress = isInProgress(job.status);\n return (\n <>\n {inProgress && (\n <div\n className=\"space-y-2 rounded-xl border border-border-subtle bg-bg-surface p-5\"\n role=\"status\"\n >\n <p className=\"font-medium text-text-primary\">\n {tr(\"export.detail.progress.preparing\", \"Preparing your files…\")}\n </p>\n <ExportProgressBar progress={job.progress} size=\"md\" />\n {job.processedEntities != null && job.totalEntities != null && (\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.progress.items\",\n \"{{processed}} of {{total}} items ready\",\n {\n processed: job.processedEntities.toLocaleString(),\n total: job.totalEntities.toLocaleString(),\n },\n )}\n </p>\n )}\n </div>\n )}\n\n {job.status === \"FAILED\" && (\n <div className=\"flex items-start gap-3 rounded-xl border border-border-default bg-status-error-bg-subtle p-5\">\n <AlertCircle\n size={20}\n aria-hidden=\"true\"\n className=\"mt-0.5 shrink-0 text-status-error-text\"\n />\n <div className=\"min-w-0 space-y-2\">\n <p className=\"font-medium text-status-error-text\">\n {tr(\"export.detail.failed.title\", \"This download didn't finish\")}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.failed.description\",\n \"Try again. If it stops again, pick less data or a shorter date range.\",\n )}\n </p>\n {job.errorMessage ? (\n <ShowTechnicalDetails copyable>\n {job.errorMessage}\n </ShowTechnicalDetails>\n ) : null}\n </div>\n </div>\n )}\n\n {job.status === \"EXPIRED\" && (\n <p className=\"rounded-xl border border-border-subtle bg-bg-surface p-4 text-sm text-text-secondary\">\n {tr(\n \"export.detail.expired.description\",\n \"The download link has expired. Try again to make a fresh copy.\",\n )}\n </p>\n )}\n\n <div className=\"grid grid-cols-1 gap-3 sm:grid-cols-2\">\n {[\n {\n icon: <HardDrive size={16} aria-hidden=\"true\" />,\n name: tr(\"export.detail.info.totalSize\", \"Total Size\"),\n value:\n job.totalSizeBytes != null\n ? formatBytes(job.totalSizeBytes)\n : \"-\",\n },\n {\n icon: <Clock size={16} aria-hidden=\"true\" />,\n name: tr(\"export.detail.info.created\", \"Created\"),\n value: new Date(job.createdAt).toLocaleDateString(),\n },\n ].map((item) => (\n <GlassCard\n key={item.name}\n treatment=\"metric\"\n className=\"border-border-seam p-4\"\n >\n <div className=\"mb-1 flex items-center gap-2 text-text-secondary\">\n {item.icon}\n <span className=\"text-xs font-medium\">{item.name}</span>\n </div>\n <p className=\"text-lg font-bold tabular-nums\">{item.value}</p>\n </GlassCard>\n ))}\n </div>\n\n {job.parts.length > 0 && (\n <PageSection title={tr(\"export.detail.parts.title\", \"Export Parts\")}>\n <ul className=\"space-y-2\">\n {job.parts.map((part) => (\n <li\n key={part.id}\n className=\"flex flex-col gap-3 rounded-xl border border-border-subtle bg-bg-surface p-4 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div className=\"flex min-w-0 items-center gap-3\">\n <FileDown\n size={20}\n aria-hidden=\"true\"\n className=\"shrink-0 text-text-secondary\"\n />\n <div className=\"min-w-0\">\n <p className=\"truncate font-medium\">{part.fileName}</p>\n <p className=\"text-sm text-text-secondary\">\n {part.entityTypes.map(label).join(\", \")} ·{\" \"}\n {formatBytes(part.sizeBytes)}\n {part.downloadExpiresAt &&\n ` · ${tr(\n \"export.detail.parts.availableUntil\",\n \"Available until {{date}}\",\n {\n date: new Date(\n part.downloadExpiresAt,\n ).toLocaleDateString(),\n },\n )}`}\n </p>\n </div>\n </div>\n {part.downloadUrl ? (\n <a\n href={part.downloadUrl}\n className=\"inline-flex shrink-0 items-center gap-2 self-start rounded-lg border border-border-subtle px-3 py-1.5 text-sm font-medium hover:bg-accent sm:self-auto\"\n aria-label={tr(\n \"export.detail.parts.downloadAria\",\n \"Download {{name}}\",\n {\n name: part.fileName,\n },\n )}\n >\n <Download size={14} aria-hidden=\"true\" />\n {tr(\"export.detail.parts.download\", \"Download\")}\n </a>\n ) : (\n <span className=\"inline-flex items-center gap-1.5 text-sm text-text-secondary\">\n <Clock size={14} aria-hidden=\"true\" />\n {tr(\"export.detail.parts.pending\", \"Pending\")}\n </span>\n )}\n </li>\n ))}\n </ul>\n </PageSection>\n )}\n\n {job.status === \"COMPLETED\" && job.parts.length === 0 && (\n <div className=\"rounded-xl border border-border-subtle bg-bg-surface p-6 text-center\">\n <CheckCircle2\n size={36}\n aria-hidden=\"true\"\n className=\"mx-auto mb-2 text-text-secondary\"\n />\n <p className=\"font-semibold\">\n {tr(\"export.detail.complete.title\", \"Export Complete\")}\n </p>\n <p className=\"text-sm text-text-secondary\">\n {tr(\n \"export.detail.complete.noParts\",\n \"Your export has completed but no download parts are available yet.\",\n )}\n </p>\n </div>\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAgBC,EAAiB,EAC/B,QACA,YAIC;CACD,IAAMC,IAAKC,EAAM,GACXC,IAAaC,EAAaC,EAAI,MAAM;CAC1C,OACE,kBAAAN,GAAA,EAAA,UAAA;EACGI,KACC,kBAAC,OAAD;GACE,WAAU;GACV,MAAK;GAFP,UAAA;IAIE,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAF,EAAG,oCAAoC,uBAAuB;IAC9D,CAAA;IACH,kBAACM,GAAD;KAAmB,UAAUF,EAAI;KAAU,MAAK;IAAM,CAAA;IACrDA,EAAI,qBAAqB,QAAQA,EAAI,iBAAiB,QACrD,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAJ,EACC,gCACA,0CACA;MACE,WAAWI,EAAI,kBAAkB,eAAe;MAChD,OAAOA,EAAI,cAAc,eAAe;KAC1C,CACF;IACC,CAAA;GAEF;;EAGNA,EAAI,WAAW,YACd,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAACG,GAAD;IACE,MAAM;IACN,eAAY;IACZ,WAAU;GACX,CAAA,GACD,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,KAAD;MAAG,WAAU;MACV,UAAAP,EAAG,8BAA8B,6BAA6B;KAC9D,CAAA;KACH,kBAAC,KAAD;MAAG,WAAU;MACV,UAAAA,EACC,oCACA,uEACF;KACC,CAAA;KACFI,EAAI,eACH,kBAACI,GAAD;MAAsB,UAAA;MACnB,UAAAJ,EAAI;KACe,CAAA,IACpB;IACD;GACF,CAAA,CAAA;;EAGNA,EAAI,WAAW,aACd,kBAAC,KAAD;GAAG,WAAU;GACV,UAAAJ,EACC,qCACA,gEACF;EACC,CAAA;EAGL,kBAAC,OAAD;GAAK,WAAU;GACZ,UAAA,CACC;IACE,MAAM,kBAACS,GAAD;KAAW,MAAM;KAAI,eAAY;IAAQ,CAAA;IAC/C,MAAMT,EAAG,gCAAgC,YAAY;IACrD,OACEI,EAAI,kBAAkB,OAElB,MADAM,EAAYN,EAAI,cAAc;GAEtC,GACA;IACE,MAAM,kBAACO,GAAD;KAAO,MAAM;KAAI,eAAY;IAAQ,CAAA;IAC3C,MAAMX,EAAG,8BAA8B,SAAS;IAChD,OAAO,IAAI,KAAKI,EAAI,SAAS,CAAC,CAAC,mBAAmB;GACpD,CACF,CAAC,CAAC,KAAK,MACL,kBAACQ,GAAD;IAEE,WAAU;IACV,WAAU;IAHZ,UAAA,CAKE,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACGC,EAAK,MACN,kBAAC,QAAD;MAAM,WAAU;MAAuB,UAAAA,EAAK;KAAW,CAAA,CACpD;IACL,CAAA,GAAA,kBAAC,KAAD;KAAG,WAAU;KAAkC,UAAAA,EAAK;IAAS,CAAA,CACpD;GATJ,GAAAA,EAAK,IASD,CACZ;EACE,CAAA;EAEJT,EAAI,MAAM,SAAS,KAClB,kBAACU,GAAD;GAAa,OAAOd,EAAG,6BAA6B,cAAc;GAChE,UAAA,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAI,EAAI,MAAM,KAAK,MACd,kBAAC,MAAD;KAEE,WAAU;KAFZ,UAAA,CAIE,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,kBAACW,GAAD;OACE,MAAM;OACN,eAAY;OACZ,WAAU;MACX,CAAA,GACD,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACE,kBAAC,KAAD;QAAG,WAAU;QAAwB,UAAAC,EAAK;OAAY,CAAA,GACtD,kBAAC,KAAD;QAAG,WAAU;QAAb,UAAA;SACGA,EAAK,YAAY,IAAIC,CAAK,CAAC,CAAC,KAAK,IAAI;SAAE;SAAG;SAC1CP,EAAYM,EAAK,SAAS;SAC1BA,EAAK,qBACJ,MAAMhB,EACJ,sCACA,4BACA,EACE,MAAM,IAAI,KACRgB,EAAK,iBACP,CAAC,CAAC,mBAAmB,EACvB,CACF;QACD;OACA,CAAA,CAAA;MACF,CAAA,CAAA;KACJ,CAAA,GAAAA,EAAK,cACJ,kBAAC,KAAD;MACE,MAAMA,EAAK;MACX,WAAU;MACV,cAAYhB,EACV,oCACA,qBACA,EACE,MAAMgB,EAAK,SACb,CACF;MATF,UAAA,CAWE,kBAACE,GAAD;OAAU,MAAM;OAAI,eAAY;MAAQ,CAAA,GACvClB,EAAG,gCAAgC,UAAU,CAC7C;KAEH,CAAA,IAAA,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,kBAACW,GAAD;OAAO,MAAM;OAAI,eAAY;MAAQ,CAAA,GACpCX,EAAG,+BAA+B,SAAS,CACxC;KAEN,CAAA,CAAA;IAhDG,GAAAgB,EAAK,EAgDR,CACL;GACC,CAAA;EACO,CAAA;EAGdZ,EAAI,WAAW,eAAeA,EAAI,MAAM,WAAW,KAClD,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACE,kBAACe,GAAD;KACE,MAAM;KACN,eAAY;KACZ,WAAU;IACX,CAAA;IACD,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAnB,EAAG,gCAAgC,iBAAiB;IACpD,CAAA;IACH,kBAAC,KAAD;KAAG,WAAU;KACV,UAAAA,EACC,kCACA,oEACF;IACC,CAAA;GACA;;CAEP,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExportJobStatus } from '../types';
|
|
2
|
+
/** The plain status words, for code that needs the text only. */
|
|
3
|
+
export declare function useDownloadStatusLabel(): (status: ExportJobStatus) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Navigation v2 status: an icon and the plain words, in the text colour. The
|
|
6
|
+
* words carry the meaning, so nothing depends on colour.
|
|
7
|
+
*/
|
|
8
|
+
export declare function DownloadStatus({ status, className, badge, }: {
|
|
9
|
+
status: ExportJobStatus;
|
|
10
|
+
className?: string;
|
|
11
|
+
/** A bordered pill, for a page header. */
|
|
12
|
+
badge?: boolean;
|
|
13
|
+
}): import('react').JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { DOWNLOAD_PHASE_COPY as n, downloadPhase as r } from "../utils/downloadStatus.js";
|
|
4
|
+
import { CheckCircle2 as i, Loader2 as a, RotateCcw as o, XCircle as s } from "lucide-react";
|
|
5
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
// src/export/components/DownloadStatus.tsx
|
|
7
|
+
var u = {
|
|
8
|
+
preparing: a,
|
|
9
|
+
ready: i,
|
|
10
|
+
failed: s,
|
|
11
|
+
cancelled: s,
|
|
12
|
+
expired: o,
|
|
13
|
+
deleted: s
|
|
14
|
+
};
|
|
15
|
+
function d() {
|
|
16
|
+
let t = e();
|
|
17
|
+
return (e) => {
|
|
18
|
+
let i = n[r(e)];
|
|
19
|
+
return t(i.key, i.label);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function f({ status: e, className: n, badge: i = !1 }) {
|
|
23
|
+
let a = d(), o = r(e), s = u[o];
|
|
24
|
+
return /* @__PURE__ */ l("span", {
|
|
25
|
+
"data-phase": o,
|
|
26
|
+
className: t("inline-flex items-center gap-1.5 text-sm text-text-secondary", i && "rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary", n),
|
|
27
|
+
children: [/* @__PURE__ */ c(s, {
|
|
28
|
+
size: 14,
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: t("shrink-0", o === "preparing" && "motion-safe:animate-spin")
|
|
31
|
+
}), a(e)]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export { f as DownloadStatus, d as useDownloadStatusLabel };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=DownloadStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadStatus.js","names":["PHASE_ICON","Loader2","CheckCircle2","XCircle","RotateCcw","useDownloadStatusLabel","tr","useTr","copy","DOWNLOAD_PHASE_COPY","downloadPhase","status","DownloadStatus","label","phase","Icon","cn","badge","className"],"sources":["../../../src/export/components/DownloadStatus.tsx"],"sourcesContent":["import { CheckCircle2, Clock, Loader2, RotateCcw, XCircle } from \"lucide-react\";\nimport { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\nimport {\n DOWNLOAD_PHASE_COPY,\n downloadPhase,\n type DownloadPhase,\n} from \"../utils/downloadStatus\";\nimport type { ExportJobStatus } from \"../types\";\n\nconst PHASE_ICON: Record<DownloadPhase, typeof Clock> = {\n preparing: Loader2,\n ready: CheckCircle2,\n failed: XCircle,\n cancelled: XCircle,\n expired: RotateCcw,\n deleted: XCircle,\n};\n\n/** The plain status words, for code that needs the text only. */\nexport function useDownloadStatusLabel(): (status: ExportJobStatus) => string {\n const tr = useTr();\n return (status) => {\n const copy = DOWNLOAD_PHASE_COPY[downloadPhase(status)];\n return tr(copy.key, copy.label);\n };\n}\n\n/**\n * Navigation v2 status: an icon and the plain words, in the text colour. The\n * words carry the meaning, so nothing depends on colour.\n */\nexport function DownloadStatus({\n status,\n className,\n badge = false,\n}: {\n status: ExportJobStatus;\n className?: string;\n /** A bordered pill, for a page header. */\n badge?: boolean;\n}) {\n const label = useDownloadStatusLabel();\n const phase = downloadPhase(status);\n const Icon = PHASE_ICON[phase];\n return (\n <span\n data-phase={phase}\n className={cn(\n \"inline-flex items-center gap-1.5 text-sm text-text-secondary\",\n badge &&\n \"rounded-full border border-border-subtle bg-bg-surface px-2.5 py-0.5 text-xs font-medium text-text-primary\",\n className,\n )}\n >\n <Icon\n size={14}\n aria-hidden=\"true\"\n className={cn(\n \"shrink-0\",\n phase === \"preparing\" && \"motion-safe:animate-spin\",\n )}\n />\n {label(status)}\n </span>\n );\n}\n"],"mappings":";;;;;;AAUA,IAAMA,IAAkD;CACtD,WAAWC;CACX,OAAOC;CACP,QAAQC;CACR,WAAWA;CACX,SAASC;CACT,SAASD;AACX;AAGA,SAAgBE,IAA8D;CAC5E,IAAMC,IAAKC,EAAM;CACjB,QAAQ,MAAW;EACjB,IAAMC,IAAOC,EAAoBC,EAAcC,CAAM;EACrD,OAAOL,EAAGE,EAAK,KAAKA,EAAK,KAAK;CAChC;AACF;AAMA,SAAgBI,EAAe,EAC7B,WACA,cACA,WAAQ,MAMP;CACD,IAAMC,IAAQR,EAAuB,GAC/BS,IAAQJ,EAAcC,CAAM,GAC5BI,IAAOf,EAAWc;CACxB,OACE,kBAAC,QAAD;EACE,cAAYA;EACZ,WAAWE,EACT,gEACAC,KACE,8GACFC,CACF;EAPF,UAAA,CASE,kBAACH,GAAD;GACE,MAAM;GACN,eAAY;GACZ,WAAWC,EACT,YACAF,MAAU,eAAe,0BAC3B;EACD,CAAA,GACAD,EAAMF,CAAM,CACT;;AAEV"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useExport as e } from "../providers/ExportProvider.js";
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { joinPath as n } from "../utils/paths.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { PageTabs as i } from "@burdenoff/fe-libs/ui";
|
|
6
|
+
// src/export/components/DownloadsTabs.tsx
|
|
7
|
+
function a() {
|
|
8
|
+
let { basePath: a = "/" } = e(), o = t(), s = [{
|
|
9
|
+
id: "downloads",
|
|
10
|
+
label: o("export.downloads.tabs.downloads", "Downloads"),
|
|
11
|
+
href: a
|
|
12
|
+
}, {
|
|
13
|
+
id: "templates",
|
|
14
|
+
label: o("export.downloads.tabs.savedSetups", "Saved setups"),
|
|
15
|
+
href: n(a, "templates")
|
|
16
|
+
}];
|
|
17
|
+
return /* @__PURE__ */ r(i, {
|
|
18
|
+
tabs: s,
|
|
19
|
+
maxVisible: 1,
|
|
20
|
+
ariaLabel: o("export.downloads.tabs.label", "Download your data")
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { a as DownloadsTabs };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=DownloadsTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadsTabs.js","names":["DownloadsTabs","useExport","tr","useTr","tabs","basePath","joinPath","PageTabs"],"sources":["../../../src/export/components/DownloadsTabs.tsx"],"sourcesContent":["import { PageTabs, type PageTabItem } from \"@burdenoff/fe-libs/ui\";\nimport { useExport } from \"../providers/ExportProvider\";\nimport { useTr } from \"../hooks/useTr\";\nimport { joinPath } from \"../utils/paths\";\n\n/**\n * Navigation v2 tab row for \"Download your data\": the list first, \"Saved\n * setups\" one click away under \"More ▾\" (BOFF-11870, page table row 4).\n */\nexport function DownloadsTabs() {\n const { basePath = \"/\" } = useExport();\n const tr = useTr();\n const tabs: PageTabItem[] = [\n {\n id: \"downloads\",\n label: tr(\"export.downloads.tabs.downloads\", \"Downloads\"),\n href: basePath,\n },\n {\n id: \"templates\",\n label: tr(\"export.downloads.tabs.savedSetups\", \"Saved setups\"),\n href: joinPath(basePath, \"templates\"),\n },\n ];\n return (\n <PageTabs\n tabs={tabs}\n maxVisible={1}\n ariaLabel={tr(\"export.downloads.tabs.label\", \"Download your data\")}\n />\n );\n}\n"],"mappings":";;;;;;AASA,SAAgBA,IAAgB;CAC9B,IAAM,EAAE,cAAW,QAAQC,EAAU,GAC/BC,IAAKC,EAAM,GACXC,IAAsB,CAC1B;EACE,IAAI;EACJ,OAAOF,EAAG,mCAAmC,WAAW;EACxD,MAAMG;CACR,GACA;EACE,IAAI;EACJ,OAAOH,EAAG,qCAAqC,cAAc;EAC7D,MAAMI,EAASD,GAAU,WAAW;CACtC,CACF;CACA,OACE,kBAACE,GAAD;EACQ;EACN,YAAY;EACZ,WAAWL,EAAG,+BAA+B,oBAAoB;CAClE,CAAA;AAEL"}
|
|
@@ -7,6 +7,5 @@ interface ExportProgressBarProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* ExportProgressBar - Shows export progress percentage
|
|
9
9
|
*/
|
|
10
|
-
export declare function ExportProgressBar({ progress, className, showLabel, size, }: ExportProgressBarProps): import(
|
|
10
|
+
export declare function ExportProgressBar({ progress, className, showLabel, size, }: ExportProgressBarProps): import('react').JSX.Element;
|
|
11
11
|
export {};
|
|
12
|
-
//# sourceMappingURL=ExportProgressBar.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useTr as e } from "../hooks/useTr.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/export/components/ExportProgressBar.tsx
|
|
5
5
|
var i = {
|
|
6
6
|
sm: "h-1.5",
|
|
7
7
|
md: "h-2.5",
|
|
@@ -29,7 +29,6 @@ function a({ progress: a, className: o, showLabel: s = !0, size: c = "md" }) {
|
|
|
29
29
|
})]
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { a as ExportProgressBar };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=ExportProgressBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportProgressBar.js","names":[],"sources":["../../../src/export/components/ExportProgressBar.tsx"],"sourcesContent":["import { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\n\ninterface ExportProgressBarProps {\n progress: number;\n className?: string;\n showLabel?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst sizeClasses = {\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-4\",\n};\n\n/**\n * ExportProgressBar - Shows export progress percentage\n */\nexport function ExportProgressBar({\n progress,\n className,\n showLabel = true,\n size = \"md\",\n}: ExportProgressBarProps) {\n const tr = useTr();\n const clampedProgress = Math.min(100, Math.max(0, progress));\n\n return (\n <div className={cn(\"w-full\", className)}>\n {showLabel && (\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {tr(\"export.progress.label\", \"Progress\")}\n </span>\n <span className=\"text-xs font-semibold text-text-primary\">\n {Math.round(clampedProgress)}%\n </span>\n </div>\n )}\n <div\n className={cn(\n \"w-full bg-bg-sunken rounded-full overflow-hidden\",\n sizeClasses[size],\n )}\n >\n <div\n className={cn(\n \"h-full rounded-full transition-all duration-500 ease-out\",\n clampedProgress === 100\n ? \"bg-status-success-bg\"\n : \"bg-action-primary-bg bg-gradient-to-r from-primary to-primary/80\",\n )}\n style={{ width: `${clampedProgress}%` }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAUA,
|
|
1
|
+
{"version":3,"file":"ExportProgressBar.js","names":["sizeClasses","ExportProgressBar","tr","useTr","clampedProgress","progress","cn","className","showLabel","size"],"sources":["../../../src/export/components/ExportProgressBar.tsx"],"sourcesContent":["import { useTr } from \"../hooks/useTr\";\nimport { cn } from \"../utils/cn\";\n\ninterface ExportProgressBarProps {\n progress: number;\n className?: string;\n showLabel?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst sizeClasses = {\n sm: \"h-1.5\",\n md: \"h-2.5\",\n lg: \"h-4\",\n};\n\n/**\n * ExportProgressBar - Shows export progress percentage\n */\nexport function ExportProgressBar({\n progress,\n className,\n showLabel = true,\n size = \"md\",\n}: ExportProgressBarProps) {\n const tr = useTr();\n const clampedProgress = Math.min(100, Math.max(0, progress));\n\n return (\n <div className={cn(\"w-full\", className)}>\n {showLabel && (\n <div className=\"flex items-center justify-between mb-1\">\n <span className=\"text-xs font-medium text-text-secondary\">\n {tr(\"export.progress.label\", \"Progress\")}\n </span>\n <span className=\"text-xs font-semibold text-text-primary\">\n {Math.round(clampedProgress)}%\n </span>\n </div>\n )}\n <div\n className={cn(\n \"w-full bg-bg-sunken rounded-full overflow-hidden\",\n sizeClasses[size],\n )}\n >\n <div\n className={cn(\n \"h-full rounded-full transition-all duration-500 ease-out\",\n clampedProgress === 100\n ? \"bg-status-success-bg\"\n : \"bg-action-primary-bg bg-gradient-to-r from-primary to-primary/80\",\n )}\n style={{ width: `${clampedProgress}%` }}\n />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAUA,IAAMA,IAAc;CAClB,IAAI;CACJ,IAAI;CACJ,IAAI;AACN;AAKA,SAAgBC,EAAkB,EAChC,aACA,cACA,eAAY,IACZ,UAAO,QACkB;CACzB,IAAMC,IAAKC,EAAM,GACXC,IAAkB,KAAK,IAAI,KAAK,KAAK,IAAI,GAAGC,CAAQ,CAAC;CAE3D,OACE,kBAAC,OAAD;EAAK,WAAWC,EAAG,UAAUC,CAAS;EAAtC,UAAA,CACGC,KACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IACb,UAAAN,EAAG,yBAAyB,UAAU;GACnC,CAAA,GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACG,KAAK,MAAME,CAAe,GAAE,GACzB;GACH,CAAA,CAAA;EAEP,CAAA,GAAA,kBAAC,OAAD;GACE,WAAWE,EACT,oDACAN,EAAYS,EACd;GAEA,UAAA,kBAAC,OAAD;IACE,WAAWH,EACT,4DACAF,MAAoB,MAChB,yBACA,kEACN;IACA,OAAO,EAAE,OAAO,GAAGA,EAAgB,GAAG;GACvC,CAAA;EACE,CAAA,CACF;;AAET"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExportJobStatus } from '../types';
|
|
2
|
-
|
|
3
2
|
interface ExportStatusBadgeProps {
|
|
4
3
|
status: ExportJobStatus;
|
|
5
4
|
className?: string;
|
|
@@ -7,6 +6,5 @@ interface ExportStatusBadgeProps {
|
|
|
7
6
|
/**
|
|
8
7
|
* ExportStatusBadge - Renders a colored badge for export job status
|
|
9
8
|
*/
|
|
10
|
-
export declare function ExportStatusBadge({ status, className, }: ExportStatusBadgeProps): import(
|
|
9
|
+
export declare function ExportStatusBadge({ status, className, }: ExportStatusBadgeProps): import('react').JSX.Element;
|
|
11
10
|
export {};
|
|
12
|
-
//# sourceMappingURL=ExportStatusBadge.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { getStatusDisplayName as t } from "../constants/enums.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/export/components/ExportStatusBadge.tsx
|
|
6
6
|
var a = {
|
|
7
7
|
CREATED: "bg-status-info-bg-subtle text-status-info-text",
|
|
8
8
|
QUEUED: "bg-status-warning-bg-subtle text-status-warning-text",
|
|
@@ -14,7 +14,7 @@ var a = {
|
|
|
14
14
|
DELETED: "bg-bg-sunken text-text-tertiary"
|
|
15
15
|
};
|
|
16
16
|
function o({ status: o, className: s }) {
|
|
17
|
-
let c =
|
|
17
|
+
let c = n(), l = {
|
|
18
18
|
CREATED: c("export.shared.status.created", "Created"),
|
|
19
19
|
QUEUED: c("export.shared.status.queued", "Queued"),
|
|
20
20
|
RUNNING: c("export.shared.status.running", "Running"),
|
|
@@ -23,16 +23,15 @@ function o({ status: o, className: s }) {
|
|
|
23
23
|
CANCELLED: c("export.shared.status.cancelled", "Cancelled"),
|
|
24
24
|
EXPIRED: c("export.shared.status.expired", "Expired"),
|
|
25
25
|
DELETED: c("export.shared.status.deleted", "Deleted")
|
|
26
|
-
}[o] ??
|
|
26
|
+
}[o] ?? t(o);
|
|
27
27
|
return /* @__PURE__ */ i("span", {
|
|
28
|
-
className:
|
|
28
|
+
className: e("inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium", a[o], s),
|
|
29
29
|
children: [o === "RUNNING" && /* @__PURE__ */ i("span", {
|
|
30
30
|
className: "relative flex size-2",
|
|
31
31
|
children: [/* @__PURE__ */ r("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-blue opacity-75" }), /* @__PURE__ */ r("span", { className: "relative inline-flex rounded-full size-2 bg-accent-blue" })]
|
|
32
32
|
}), l]
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { o as ExportStatusBadge };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=ExportStatusBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExportStatusBadge.js","names":[],"sources":["../../../src/export/components/ExportStatusBadge.tsx"],"sourcesContent":["import { cn } from \"../utils/cn\";\nimport { getStatusDisplayName } from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport type { ExportJobStatus } from \"../types\";\n\ninterface ExportStatusBadgeProps {\n status: ExportJobStatus;\n className?: string;\n}\n\nconst statusStyles: Record<ExportJobStatus, string> = {\n CREATED: \"bg-status-info-bg-subtle text-status-info-text\",\n QUEUED: \"bg-status-warning-bg-subtle text-status-warning-text\",\n RUNNING:\n \"bg-status-info-bg-subtle text-status-info-text motion-safe:animate-vc-glow-pulse\",\n COMPLETED: \"bg-status-success-bg-subtle text-status-success-text\",\n FAILED: \"bg-status-error-bg-subtle text-status-error-text\",\n CANCELLED: \"bg-bg-sunken text-text-secondary\",\n EXPIRED: \"bg-accent-orange-subtle text-accent-orange\",\n DELETED: \"bg-bg-sunken text-text-tertiary\",\n};\n\n/**\n * ExportStatusBadge - Renders a colored badge for export job status\n */\nexport function ExportStatusBadge({\n status,\n className,\n}: ExportStatusBadgeProps) {\n const tr = useTr();\n\n const statusLabel =\n {\n CREATED: tr(\"export.shared.status.created\", \"Created\"),\n QUEUED: tr(\"export.shared.status.queued\", \"Queued\"),\n RUNNING: tr(\"export.shared.status.running\", \"Running\"),\n COMPLETED: tr(\"export.shared.status.completed\", \"Completed\"),\n FAILED: tr(\"export.shared.status.failed\", \"Failed\"),\n CANCELLED: tr(\"export.shared.status.cancelled\", \"Cancelled\"),\n EXPIRED: tr(\"export.shared.status.expired\", \"Expired\"),\n DELETED: tr(\"export.shared.status.deleted\", \"Deleted\"),\n }[status] ?? getStatusDisplayName(status);\n\n return (\n <span\n className={cn(\n \"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium\",\n statusStyles[status],\n className,\n )}\n >\n {status === \"RUNNING\" && (\n <span className=\"relative flex size-2\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-blue opacity-75\" />\n <span className=\"relative inline-flex rounded-full size-2 bg-accent-blue\" />\n </span>\n )}\n {statusLabel}\n </span>\n );\n}\n"],"mappings":";;;;;AAUA,
|
|
1
|
+
{"version":3,"file":"ExportStatusBadge.js","names":["statusStyles","ExportStatusBadge","tr","useTr","statusLabel","status","getStatusDisplayName","cn","className"],"sources":["../../../src/export/components/ExportStatusBadge.tsx"],"sourcesContent":["import { cn } from \"../utils/cn\";\nimport { getStatusDisplayName } from \"../constants/enums\";\nimport { useTr } from \"../hooks/useTr\";\nimport type { ExportJobStatus } from \"../types\";\n\ninterface ExportStatusBadgeProps {\n status: ExportJobStatus;\n className?: string;\n}\n\nconst statusStyles: Record<ExportJobStatus, string> = {\n CREATED: \"bg-status-info-bg-subtle text-status-info-text\",\n QUEUED: \"bg-status-warning-bg-subtle text-status-warning-text\",\n RUNNING:\n \"bg-status-info-bg-subtle text-status-info-text motion-safe:animate-vc-glow-pulse\",\n COMPLETED: \"bg-status-success-bg-subtle text-status-success-text\",\n FAILED: \"bg-status-error-bg-subtle text-status-error-text\",\n CANCELLED: \"bg-bg-sunken text-text-secondary\",\n EXPIRED: \"bg-accent-orange-subtle text-accent-orange\",\n DELETED: \"bg-bg-sunken text-text-tertiary\",\n};\n\n/**\n * ExportStatusBadge - Renders a colored badge for export job status\n */\nexport function ExportStatusBadge({\n status,\n className,\n}: ExportStatusBadgeProps) {\n const tr = useTr();\n\n const statusLabel =\n {\n CREATED: tr(\"export.shared.status.created\", \"Created\"),\n QUEUED: tr(\"export.shared.status.queued\", \"Queued\"),\n RUNNING: tr(\"export.shared.status.running\", \"Running\"),\n COMPLETED: tr(\"export.shared.status.completed\", \"Completed\"),\n FAILED: tr(\"export.shared.status.failed\", \"Failed\"),\n CANCELLED: tr(\"export.shared.status.cancelled\", \"Cancelled\"),\n EXPIRED: tr(\"export.shared.status.expired\", \"Expired\"),\n DELETED: tr(\"export.shared.status.deleted\", \"Deleted\"),\n }[status] ?? getStatusDisplayName(status);\n\n return (\n <span\n className={cn(\n \"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium\",\n statusStyles[status],\n className,\n )}\n >\n {status === \"RUNNING\" && (\n <span className=\"relative flex size-2\">\n <span className=\"animate-ping absolute inline-flex h-full w-full rounded-full bg-accent-blue opacity-75\" />\n <span className=\"relative inline-flex rounded-full size-2 bg-accent-blue\" />\n </span>\n )}\n {statusLabel}\n </span>\n );\n}\n"],"mappings":";;;;;AAUA,IAAMA,IAAgD;CACpD,SAAS;CACT,QAAQ;CACR,SACE;CACF,WAAW;CACX,QAAQ;CACR,WAAW;CACX,SAAS;CACT,SAAS;AACX;AAKA,SAAgBC,EAAkB,EAChC,WACA,gBACyB;CACzB,IAAMC,IAAKC,EAAM,GAEXC,IACJ;EACE,SAASF,EAAG,gCAAgC,SAAS;EACrD,QAAQA,EAAG,+BAA+B,QAAQ;EAClD,SAASA,EAAG,gCAAgC,SAAS;EACrD,WAAWA,EAAG,kCAAkC,WAAW;EAC3D,QAAQA,EAAG,+BAA+B,QAAQ;EAClD,WAAWA,EAAG,kCAAkC,WAAW;EAC3D,SAASA,EAAG,gCAAgC,SAAS;EACrD,SAASA,EAAG,gCAAgC,SAAS;CACvD,EAAEG,MAAWC,EAAqBD,CAAM;CAE1C,OACE,kBAAC,QAAD;EACE,WAAWE,EACT,mFACAP,EAAaK,IACbG,CACF;EALF,UAAA,CAOGH,MAAW,aACV,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,kBAAC,QAAD,EAAM,WAAU,yFAA0F,CAAA,GAC1G,kBAAC,QAAD,EAAM,WAAU,0DAA2D,CAAA,CACvE;EAEP,CAAA,GAAAD,CACG;;AAEV"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
2
|
interface PageLayoutProps {
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
/** Page title */
|
|
@@ -30,7 +29,7 @@ interface PageLayoutProps {
|
|
|
30
29
|
* - Animated entrance
|
|
31
30
|
* - Consistent header styling
|
|
32
31
|
*/
|
|
33
|
-
export declare function PageLayout({ children, title, subtitle, icon, headerActions, headerContent, maxWidth, showHeader, className, contentClassName, }: PageLayoutProps): import(
|
|
32
|
+
export declare function PageLayout({ children, title, subtitle, icon, headerActions, headerContent, maxWidth, showHeader, className, contentClassName, }: PageLayoutProps): import('react').JSX.Element;
|
|
34
33
|
/**
|
|
35
34
|
* PageSection - A section within a page with consistent spacing
|
|
36
35
|
*/
|
|
@@ -40,7 +39,7 @@ export declare function PageSection({ children, title, description, actions, cla
|
|
|
40
39
|
description?: string;
|
|
41
40
|
actions?: ReactNode;
|
|
42
41
|
className?: string;
|
|
43
|
-
} & React.HTMLAttributes<HTMLElement>): import(
|
|
42
|
+
} & React.HTMLAttributes<HTMLElement>): import('react').JSX.Element;
|
|
44
43
|
/**
|
|
45
44
|
* Local wrapper around the canonical `EmptyState` from `@burdenoff/fe-libs/ui`.
|
|
46
45
|
* Keeps the existing microfe-export call sites stable while routing all
|
|
@@ -52,6 +51,5 @@ export declare function EmptyState({ icon, title, description, action, className
|
|
|
52
51
|
description?: string;
|
|
53
52
|
action?: ReactNode;
|
|
54
53
|
className?: string;
|
|
55
|
-
}): import(
|
|
54
|
+
}): import('react').JSX.Element;
|
|
56
55
|
export {};
|
|
57
|
-
//# sourceMappingURL=PageLayout.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import "@burdenoff/fe-libs/ui";
|
|
4
|
-
|
|
4
|
+
// src/export/components/PageLayout.tsx
|
|
5
5
|
var r = {
|
|
6
6
|
sm: "max-w-screen-sm",
|
|
7
7
|
md: "max-w-screen-md",
|
|
@@ -69,7 +69,6 @@ function a({ children: r, title: i, description: a, actions: o, className: s, ..
|
|
|
69
69
|
}), r]
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
//#endregion
|
|
73
72
|
export { i as PageLayout, a as PageSection };
|
|
74
73
|
|
|
75
74
|
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/export/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { EmptyState as CanonicalEmptyState } from \"@burdenoff/fe-libs/ui\";\nimport { cn } from \"../utils/cn\";\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title */\n title?: string;\n /** Page subtitle/description */\n subtitle?: string;\n /** Icon component to display next to title */\n icon?: ReactNode;\n /** Actions to display in header (buttons, etc.) */\n headerActions?: ReactNode;\n /** Additional header content below title */\n headerContent?: ReactNode;\n /** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */\n maxWidth?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"full\";\n /** Whether to show the header section */\n showHeader?: boolean;\n /** Additional CSS classes for the container */\n className?: string;\n /** Additional CSS classes for the content area */\n contentClassName?: string;\n}\n\nconst maxWidthClasses = {\n sm: \"max-w-screen-sm\", // 640px\n md: \"max-w-screen-md\", // 768px\n lg: \"max-w-screen-lg\", // 1024px\n xl: \"max-w-screen-xl\", // 1280px\n \"2xl\": \"max-w-screen-2xl\", // 1536px\n \"3xl\": \"max-w-[1600px]\",\n full: \"max-w-full\",\n};\n\n/**\n * PageLayout - A consistent page wrapper with responsive design\n *\n * Features:\n * - Proper max-width constraints\n * - Responsive padding\n * - Animated entrance\n * - Consistent header styling\n */\nexport function PageLayout({\n children,\n title,\n subtitle,\n icon,\n headerActions,\n headerContent,\n maxWidth = \"xl\",\n showHeader = true,\n className,\n contentClassName,\n}: PageLayoutProps) {\n return (\n <div\n className={cn(\n // Base styles - full width container with padding\n \"min-h-full w-full\",\n // Responsive horizontal padding\n \"px-4 sm:px-6 lg:px-8 xl:px-12\",\n // Responsive vertical padding\n \"py-6 sm:py-8 lg:py-10\",\n // Entrance animation\n \"animate-in fade-in-0 slide-in-from-bottom-4 duration-500\",\n className,\n )}\n >\n {/* Max-width constrained content container */}\n <div\n className={cn(\n \"mx-auto w-full\",\n maxWidthClasses[maxWidth],\n contentClassName,\n )}\n >\n {/* Page Header */}\n {showHeader && (title || headerActions) && (\n <header className=\"mb-6 sm:mb-8\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n {/* Title Section */}\n <div className=\"space-y-1\">\n {(title || icon) && (\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"flex-shrink-0 p-2.5 rounded-xl bg-action-primary-bg/10 text-primary\">\n {icon}\n </div>\n )}\n {title && (\n <h1 className=\"text-2xl sm:text-3xl font-bold tracking-tight text-text-primary\">\n {title}\n </h1>\n )}\n </div>\n )}\n {subtitle && (\n <p className=\"text-sm sm:text-base text-text-secondary max-w-2xl\">\n {subtitle}\n </p>\n )}\n </div>\n\n {/* Header Actions */}\n {headerActions && (\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {headerActions}\n </div>\n )}\n </div>\n\n {/* Additional Header Content */}\n {headerContent && <div className=\"mt-4\">{headerContent}</div>}\n </header>\n )}\n\n {/* Page content — must not use a <main> landmark here because the\n host shell (AppShellLayout) already renders one; nesting <main>\n elements is invalid HTML and an a11y violation. */}\n <div className=\"space-y-6\">{children}</div>\n </div>\n </div>\n );\n}\n\n/**\n * PageSection - A section within a page with consistent spacing\n */\nexport function PageSection({\n children,\n title,\n description,\n actions,\n className,\n ...rest\n}: {\n children: ReactNode;\n title?: string;\n description?: string;\n actions?: ReactNode;\n className?: string;\n} & React.HTMLAttributes<HTMLElement>) {\n return (\n <section className={cn(\"space-y-4\", className)} {...rest}>\n {(title || actions) && (\n <div className=\"flex items-center justify-between\">\n <div>\n {title && (\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {title}\n </h2>\n )}\n {description && (\n <p className=\"text-sm text-text-secondary\">{description}</p>\n )}\n </div>\n {actions && <div className=\"flex items-center gap-2\">{actions}</div>}\n </div>\n )}\n {children}\n </section>\n );\n}\n\n/**\n * Local wrapper around the canonical `EmptyState` from `@burdenoff/fe-libs/ui`.\n * Keeps the existing microfe-export call sites stable while routing all\n * empty-state rendering through the shared primitive.\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n className,\n}: {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}) {\n return (\n <div className={className}>\n <CanonicalEmptyState\n icon={icon}\n title={title}\n description={description}\n action={action}\n />\n </div>\n );\n}\n"],"mappings":";;;;AA0BA,
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":["maxWidthClasses","PageLayout","cn","className","maxWidth","contentClassName","showHeader","title","headerActions","icon","subtitle","headerContent","PageSection","rest","actions","description","children"],"sources":["../../../src/export/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { EmptyState as CanonicalEmptyState } from \"@burdenoff/fe-libs/ui\";\nimport { cn } from \"../utils/cn\";\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title */\n title?: string;\n /** Page subtitle/description */\n subtitle?: string;\n /** Icon component to display next to title */\n icon?: ReactNode;\n /** Actions to display in header (buttons, etc.) */\n headerActions?: ReactNode;\n /** Additional header content below title */\n headerContent?: ReactNode;\n /** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */\n maxWidth?: \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\" | \"3xl\" | \"full\";\n /** Whether to show the header section */\n showHeader?: boolean;\n /** Additional CSS classes for the container */\n className?: string;\n /** Additional CSS classes for the content area */\n contentClassName?: string;\n}\n\nconst maxWidthClasses = {\n sm: \"max-w-screen-sm\", // 640px\n md: \"max-w-screen-md\", // 768px\n lg: \"max-w-screen-lg\", // 1024px\n xl: \"max-w-screen-xl\", // 1280px\n \"2xl\": \"max-w-screen-2xl\", // 1536px\n \"3xl\": \"max-w-[1600px]\",\n full: \"max-w-full\",\n};\n\n/**\n * PageLayout - A consistent page wrapper with responsive design\n *\n * Features:\n * - Proper max-width constraints\n * - Responsive padding\n * - Animated entrance\n * - Consistent header styling\n */\nexport function PageLayout({\n children,\n title,\n subtitle,\n icon,\n headerActions,\n headerContent,\n maxWidth = \"xl\",\n showHeader = true,\n className,\n contentClassName,\n}: PageLayoutProps) {\n return (\n <div\n className={cn(\n // Base styles - full width container with padding\n \"min-h-full w-full\",\n // Responsive horizontal padding\n \"px-4 sm:px-6 lg:px-8 xl:px-12\",\n // Responsive vertical padding\n \"py-6 sm:py-8 lg:py-10\",\n // Entrance animation\n \"animate-in fade-in-0 slide-in-from-bottom-4 duration-500\",\n className,\n )}\n >\n {/* Max-width constrained content container */}\n <div\n className={cn(\n \"mx-auto w-full\",\n maxWidthClasses[maxWidth],\n contentClassName,\n )}\n >\n {/* Page Header */}\n {showHeader && (title || headerActions) && (\n <header className=\"mb-6 sm:mb-8\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n {/* Title Section */}\n <div className=\"space-y-1\">\n {(title || icon) && (\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"flex-shrink-0 p-2.5 rounded-xl bg-action-primary-bg/10 text-primary\">\n {icon}\n </div>\n )}\n {title && (\n <h1 className=\"text-2xl sm:text-3xl font-bold tracking-tight text-text-primary\">\n {title}\n </h1>\n )}\n </div>\n )}\n {subtitle && (\n <p className=\"text-sm sm:text-base text-text-secondary max-w-2xl\">\n {subtitle}\n </p>\n )}\n </div>\n\n {/* Header Actions */}\n {headerActions && (\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n {headerActions}\n </div>\n )}\n </div>\n\n {/* Additional Header Content */}\n {headerContent && <div className=\"mt-4\">{headerContent}</div>}\n </header>\n )}\n\n {/* Page content — must not use a <main> landmark here because the\n host shell (AppShellLayout) already renders one; nesting <main>\n elements is invalid HTML and an a11y violation. */}\n <div className=\"space-y-6\">{children}</div>\n </div>\n </div>\n );\n}\n\n/**\n * PageSection - A section within a page with consistent spacing\n */\nexport function PageSection({\n children,\n title,\n description,\n actions,\n className,\n ...rest\n}: {\n children: ReactNode;\n title?: string;\n description?: string;\n actions?: ReactNode;\n className?: string;\n} & React.HTMLAttributes<HTMLElement>) {\n return (\n <section className={cn(\"space-y-4\", className)} {...rest}>\n {(title || actions) && (\n <div className=\"flex items-center justify-between\">\n <div>\n {title && (\n <h2 className=\"text-lg font-semibold text-text-primary\">\n {title}\n </h2>\n )}\n {description && (\n <p className=\"text-sm text-text-secondary\">{description}</p>\n )}\n </div>\n {actions && <div className=\"flex items-center gap-2\">{actions}</div>}\n </div>\n )}\n {children}\n </section>\n );\n}\n\n/**\n * Local wrapper around the canonical `EmptyState` from `@burdenoff/fe-libs/ui`.\n * Keeps the existing microfe-export call sites stable while routing all\n * empty-state rendering through the shared primitive.\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n className,\n}: {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}) {\n return (\n <div className={className}>\n <CanonicalEmptyState\n icon={icon}\n title={title}\n description={description}\n action={action}\n />\n </div>\n );\n}\n"],"mappings":";;;;AA0BA,IAAMA,IAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;AACR;AAWA,SAAgBC,EAAW,EACzB,aACA,UACA,aACA,SACA,kBACA,kBACA,cAAW,MACX,gBAAa,IACb,cACA,uBACkB;CAClB,OACE,kBAAC,OAAD;EACE,WAAWC,EAET,qBAEA,iCAEA,yBAEA,4DACAC,CACF;EAGA,UAAA,kBAAC,OAAD;GACE,WAAWD,EACT,kBACAF,EAAgBI,IAChBC,CACF;GALF,UAAA,CAQGC,MAAeC,KAASC,MACvB,kBAAC,UAAD;IAAQ,WAAU;IAAlB,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CAEE,kBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,EACID,KAASE,MACT,kBAAC,OAAD;OAAK,WAAU;OAAf,UAAA,CACGA,KACC,kBAAC,OAAD;QAAK,WAAU;QACZ,UAAAA;OACE,CAAA,GAENF,KACC,kBAAC,MAAD;QAAI,WAAU;QACX,UAAAA;OACC,CAAA,CAEH;MAEN,CAAA,GAAAG,KACC,kBAAC,KAAD;OAAG,WAAU;OACV,UAAAA;MACA,CAAA,CAEF;KAGJ,CAAA,GAAAF,KACC,kBAAC,OAAD;MAAK,WAAU;MACZ,UAAAA;KACE,CAAA,CAEJ;IAGJ,CAAA,GAAAG,KAAiB,kBAAC,OAAD;KAAK,WAAU;KAAQ,UAAAA;IAAmB,CAAA,CACtD;GAMV,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAU;IAAa;GAAc,CAAA,CACvC;;CACF,CAAA;AAET;AAKA,SAAgBC,EAAY,EAC1B,aACA,UACA,gBACA,YACA,cACA,GAAGC,KAOkC;CACrC,OACE,kBAAC,WAAD;EAAS,WAAWX,EAAG,aAAaC,CAAS;EAAG,GAAIU;EAApD,UAAA,EACIN,KAASO,MACT,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACGP,KACC,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAA;GACC,CAAA,GAELQ,KACC,kBAAC,KAAD;IAAG,WAAU;IAA+B,UAAAA;GAAe,CAAA,CAE1D,EAAA,CAAA,GACJD,KAAW,kBAAC,OAAD;IAAK,WAAU;IAA2B,UAAAA;GAAa,CAAA,CAChE;EAEN,CAAA,GAAAE,CACM;;AAEb"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExportJobStatus } from '../types';
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* Helper: Get status display name
|
|
5
4
|
*/
|
|
@@ -16,4 +15,3 @@ export declare const getArchiveFormatDisplayName: (format: string) => string;
|
|
|
16
15
|
* Helper: Get all export statuses as array
|
|
17
16
|
*/
|
|
18
17
|
export declare const getAllStatuses: () => ExportJobStatus[];
|
|
19
|
-
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/export/constants/enums.ts
|
|
2
2
|
var e = (e) => ({
|
|
3
3
|
CREATED: "Created",
|
|
4
4
|
QUEUED: "Queued",
|
|
@@ -21,7 +21,6 @@ var e = (e) => ({
|
|
|
21
21
|
"EXPIRED",
|
|
22
22
|
"DELETED"
|
|
23
23
|
];
|
|
24
|
-
//#endregion
|
|
25
24
|
export { r as getAllStatuses, n as getArchiveFormatDisplayName, t as getFormatDisplayName, e as getStatusDisplayName };
|
|
26
25
|
|
|
27
26
|
//# sourceMappingURL=enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","names":[],"sources":["../../../src/export/constants/enums.ts"],"sourcesContent":["/**\n * GraphQL Enum Display Helpers\n *\n * Display-name helpers for export job and format enums.\n * Enum value sets are sourced from the canonical type definitions in `../types`.\n */\n\nimport type { ExportJobStatus } from \"../types\";\n\n/**\n * Helper: Get status display name\n */\nexport const getStatusDisplayName = (status: string): string => {\n const names: Record<string, string> = {\n CREATED: \"Created\",\n QUEUED: \"Queued\",\n RUNNING: \"Running\",\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n CANCELLED: \"Cancelled\",\n EXPIRED: \"Expired\",\n DELETED: \"Deleted\",\n };\n return names[status] || status;\n};\n\n/**\n * Helper: Get format display name\n */\nexport const getFormatDisplayName = (format: string): string => {\n const names: Record<string, string> = {\n CSV: \"CSV\",\n JSON: \"JSON\",\n };\n return names[format] || format;\n};\n\n/**\n * Helper: Get archive format display name\n */\nexport const getArchiveFormatDisplayName = (format: string): string => {\n const names: Record<string, string> = {\n ZIP: \"ZIP\",\n };\n return names[format] || format;\n};\n\n/**\n * Helper: Get all export statuses as array\n */\nexport const getAllStatuses = (): ExportJobStatus[] => [\n \"CREATED\",\n \"QUEUED\",\n \"RUNNING\",\n \"COMPLETED\",\n \"FAILED\",\n \"CANCELLED\",\n \"EXPIRED\",\n \"DELETED\",\n];\n"],"mappings":";AAYA,
|
|
1
|
+
{"version":3,"file":"enums.js","names":["getStatusDisplayName","status","getFormatDisplayName","format","getArchiveFormatDisplayName","getAllStatuses"],"sources":["../../../src/export/constants/enums.ts"],"sourcesContent":["/**\n * GraphQL Enum Display Helpers\n *\n * Display-name helpers for export job and format enums.\n * Enum value sets are sourced from the canonical type definitions in `../types`.\n */\n\nimport type { ExportJobStatus } from \"../types\";\n\n/**\n * Helper: Get status display name\n */\nexport const getStatusDisplayName = (status: string): string => {\n const names: Record<string, string> = {\n CREATED: \"Created\",\n QUEUED: \"Queued\",\n RUNNING: \"Running\",\n COMPLETED: \"Completed\",\n FAILED: \"Failed\",\n CANCELLED: \"Cancelled\",\n EXPIRED: \"Expired\",\n DELETED: \"Deleted\",\n };\n return names[status] || status;\n};\n\n/**\n * Helper: Get format display name\n */\nexport const getFormatDisplayName = (format: string): string => {\n const names: Record<string, string> = {\n CSV: \"CSV\",\n JSON: \"JSON\",\n };\n return names[format] || format;\n};\n\n/**\n * Helper: Get archive format display name\n */\nexport const getArchiveFormatDisplayName = (format: string): string => {\n const names: Record<string, string> = {\n ZIP: \"ZIP\",\n };\n return names[format] || format;\n};\n\n/**\n * Helper: Get all export statuses as array\n */\nexport const getAllStatuses = (): ExportJobStatus[] => [\n \"CREATED\",\n \"QUEUED\",\n \"RUNNING\",\n \"COMPLETED\",\n \"FAILED\",\n \"CANCELLED\",\n \"EXPIRED\",\n \"DELETED\",\n];\n"],"mappings":";AAYA,IAAaA,KAAwB,OAW5B;CATL,SAAS;CACT,QAAQ;CACR,SAAS;CACT,WAAW;CACX,QAAQ;CACR,WAAW;CACX,SAAS;CACT,SAAS;AAEJ,EAAA,CAAMC,MAAWA,GAMbC,KAAwB,OAK5B;CAHL,KAAK;CACL,MAAM;AAED,EAAA,CAAMC,MAAWA,GAMbC,KAA+B,OAInC,EAFL,KAAK,MAEA,EAAA,CAAMD,MAAWA,GAMbE,UAA0C;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `(entityType) => plain name`, backed by the workspace's entity catalog
|
|
3
|
+
* (`useAvailableEntities`). Use it wherever an entity type is shown, so a raw
|
|
4
|
+
* key such as `rbac_role_members` never reaches the page. Pass `false` to
|
|
5
|
+
* keep the raw key and skip the catalog query.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useEntityLabel(enabled?: boolean): (entityType: string) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useAvailableEntities as e } from "./useExportQueries.js";
|
|
2
|
+
import { useTr as t } from "./useTr.js";
|
|
3
|
+
import { entityLabel as n } from "../utils/entityLabels.js";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
// src/export/hooks/useEntityLabel.ts
|
|
6
|
+
function i(i = !0) {
|
|
7
|
+
let a = t(), { data: o } = e(void 0, { skip: !i });
|
|
8
|
+
return r((e) => i ? n(e, a, o) : e, [
|
|
9
|
+
i,
|
|
10
|
+
a,
|
|
11
|
+
o
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
14
|
+
export { i as useEntityLabel };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=useEntityLabel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEntityLabel.js","names":["useEntityLabel","tr","useTr","available","useAvailableEntities","enabled","useCallback","entityLabel","entityType"],"sources":["../../../src/export/hooks/useEntityLabel.ts"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useAvailableEntities } from \"./useExportQueries\";\nimport { useTr } from \"./useTr\";\nimport { entityLabel } from \"../utils/entityLabels\";\n\n/**\n * `(entityType) => plain name`, backed by the workspace's entity catalog\n * (`useAvailableEntities`). Use it wherever an entity type is shown, so a raw\n * key such as `rbac_role_members` never reaches the page. Pass `false` to\n * keep the raw key and skip the catalog query.\n */\nexport function useEntityLabel(enabled = true): (entityType: string) => string {\n const tr = useTr();\n // Off (the legacy pages), the catalog is not fetched and the label is the key.\n const { data: available } = useAvailableEntities(undefined, {\n skip: !enabled,\n });\n return useCallback(\n (entityType: string) =>\n enabled ? entityLabel(entityType, tr, available) : entityType,\n [enabled, tr, available],\n );\n}\n"],"mappings":";;;;;AAWA,SAAgBA,EAAe,IAAU,IAAsC;CAC7E,IAAMC,IAAKC,EAAM,GAEX,EAAE,MAAMC,MAAcC,EAAqB,KAAA,GAAW,EAC1D,MAAM,CAACC,EACT,CAAC;CACD,OAAOC,GACJ,MACCD,IAAUE,EAAYC,GAAYP,GAAIE,CAAS,IAAIK,GACrD;EAACH;EAASJ;EAAIE;CAAS,CACzB;AACF"}
|