@gtcx/templates 0.1.0
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/components/audit-trail.d.ts +19 -0
- package/dist/components/audit-trail.d.ts.map +1 -0
- package/dist/components/bulk-actions.d.ts +16 -0
- package/dist/components/bulk-actions.d.ts.map +1 -0
- package/dist/components/kpi-card.d.ts +15 -0
- package/dist/components/kpi-card.d.ts.map +1 -0
- package/dist/components/page-header.d.ts +9 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/section-card.d.ts +10 -0
- package/dist/components/section-card.d.ts.map +1 -0
- package/dist/index.cjs +757 -0
- package/dist/index.d.cts +282 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1433 -0
- package/dist/index.mjs +1386 -0
- package/dist/template-frame.d.ts +19 -0
- package/dist/template-frame.d.ts.map +1 -0
- package/dist/templates/activity.d.ts +24 -0
- package/dist/templates/activity.d.ts.map +1 -0
- package/dist/templates/auth-shell.d.ts +11 -0
- package/dist/templates/auth-shell.d.ts.map +1 -0
- package/dist/templates/billing.d.ts +35 -0
- package/dist/templates/billing.d.ts.map +1 -0
- package/dist/templates/dashboard.d.ts +37 -0
- package/dist/templates/dashboard.d.ts.map +1 -0
- package/dist/templates/detail.d.ts +33 -0
- package/dist/templates/detail.d.ts.map +1 -0
- package/dist/templates/error.d.ts +12 -0
- package/dist/templates/error.d.ts.map +1 -0
- package/dist/templates/invite.d.ts +22 -0
- package/dist/templates/invite.d.ts.map +1 -0
- package/dist/templates/list.d.ts +48 -0
- package/dist/templates/list.d.ts.map +1 -0
- package/dist/templates/members.d.ts +28 -0
- package/dist/templates/members.d.ts.map +1 -0
- package/dist/templates/notifications.d.ts +24 -0
- package/dist/templates/notifications.d.ts.map +1 -0
- package/dist/templates/profile.d.ts +31 -0
- package/dist/templates/profile.d.ts.map +1 -0
- package/dist/templates/projects.d.ts +27 -0
- package/dist/templates/projects.d.ts.map +1 -0
- package/dist/templates/security.d.ts +34 -0
- package/dist/templates/security.d.ts.map +1 -0
- package/dist/templates/settings.d.ts +19 -0
- package/dist/templates/settings.d.ts.map +1 -0
- package/dist/templates/wizard.d.ts +22 -0
- package/dist/templates/wizard.d.ts.map +1 -0
- package/dist/types.d.ts +52 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +44 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
AuditTrail: () => AuditTrail,
|
|
24
|
+
AuthShell: () => AuthShell,
|
|
25
|
+
BulkActionsBar: () => BulkActionsBar,
|
|
26
|
+
DashboardTemplate: () => DashboardTemplate,
|
|
27
|
+
DetailTemplate: () => DetailTemplate,
|
|
28
|
+
ErrorPageTemplate: () => ErrorPageTemplate,
|
|
29
|
+
KpiCard: () => KpiCard,
|
|
30
|
+
ListTemplate: () => ListTemplate,
|
|
31
|
+
SectionCard: () => SectionCard,
|
|
32
|
+
SettingsTemplate: () => SettingsTemplate,
|
|
33
|
+
TemplateFrame: () => TemplateFrame,
|
|
34
|
+
WizardTemplate: () => WizardTemplate,
|
|
35
|
+
templateActionsToPageHeaderActions: () => templateActionsToPageHeaderActions
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(index_exports);
|
|
38
|
+
|
|
39
|
+
// src/api/types.ts
|
|
40
|
+
function templateActionsToPageHeaderActions(actions) {
|
|
41
|
+
return actions.map((action) => ({
|
|
42
|
+
key: action.key,
|
|
43
|
+
label: action.label,
|
|
44
|
+
onClick: action.onAction,
|
|
45
|
+
kind: action.kind,
|
|
46
|
+
disabled: action.disabled,
|
|
47
|
+
ariaLabel: action.ariaLabel,
|
|
48
|
+
icon: action.icon
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// src/frame/TemplateFrame.tsx
|
|
53
|
+
var import_antd = require("antd");
|
|
54
|
+
var import_ui = require("@gtcx/ui");
|
|
55
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
|
+
var { Text } = import_antd.Typography;
|
|
57
|
+
function TemplateFrame({
|
|
58
|
+
title,
|
|
59
|
+
subtitle,
|
|
60
|
+
breadcrumbs,
|
|
61
|
+
data: _data,
|
|
62
|
+
actions,
|
|
63
|
+
filters,
|
|
64
|
+
audit,
|
|
65
|
+
layout,
|
|
66
|
+
children
|
|
67
|
+
}) {
|
|
68
|
+
const { token } = import_antd.theme.useToken();
|
|
69
|
+
const showBreadcrumbs = layout?.showBreadcrumbs ?? true;
|
|
70
|
+
const contentPadding = layout?.contentPadding ?? void 0;
|
|
71
|
+
const pageHeaderActions = actions ? templateActionsToPageHeaderActions(actions) : void 0;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { padding: contentPadding }, children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
import_ui.PageHeader,
|
|
75
|
+
{
|
|
76
|
+
title,
|
|
77
|
+
subtitle,
|
|
78
|
+
breadcrumbs: showBreadcrumbs ? breadcrumbs : void 0,
|
|
79
|
+
actions: pageHeaderActions
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
filters?.content && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { marginBottom: token.marginLG }, children: filters.content }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children }),
|
|
84
|
+
audit && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
|
+
import_antd.Card,
|
|
86
|
+
{
|
|
87
|
+
size: "small",
|
|
88
|
+
style: { marginTop: token.marginXL },
|
|
89
|
+
styles: { body: { padding: token.paddingSM } },
|
|
90
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { direction: "vertical", size: 4, children: [
|
|
91
|
+
audit.summary && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { type: "secondary", children: audit.summary }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Space, { size: "large", wrap: true, children: [
|
|
93
|
+
audit.lastUpdatedAt && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: [
|
|
94
|
+
"Updated: ",
|
|
95
|
+
audit.lastUpdatedAt
|
|
96
|
+
] }),
|
|
97
|
+
audit.lastUpdatedBy && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: [
|
|
98
|
+
"By: ",
|
|
99
|
+
audit.lastUpdatedBy
|
|
100
|
+
] }),
|
|
101
|
+
audit.sourceSystem && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: [
|
|
102
|
+
"Source: ",
|
|
103
|
+
audit.sourceSystem
|
|
104
|
+
] }),
|
|
105
|
+
audit.evidenceUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
"a",
|
|
107
|
+
{
|
|
108
|
+
href: audit.evidenceUrl,
|
|
109
|
+
target: "_blank",
|
|
110
|
+
rel: "noopener noreferrer",
|
|
111
|
+
style: { fontSize: token.fontSizeSM },
|
|
112
|
+
children: "View Evidence"
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
] })
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// src/components/KpiCard.tsx
|
|
123
|
+
var import_antd2 = require("antd");
|
|
124
|
+
var import_icons = require("@ant-design/icons");
|
|
125
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
126
|
+
var { Text: Text2, Title } = import_antd2.Typography;
|
|
127
|
+
function KpiCard({
|
|
128
|
+
label,
|
|
129
|
+
value,
|
|
130
|
+
delta,
|
|
131
|
+
trend,
|
|
132
|
+
helpText,
|
|
133
|
+
icon,
|
|
134
|
+
onClick
|
|
135
|
+
}) {
|
|
136
|
+
const { token } = import_antd2.theme.useToken();
|
|
137
|
+
const trendColor = trend === "up" ? token.colorSuccessTextActive ?? token.colorSuccessText ?? token.colorSuccess : trend === "down" ? token.colorErrorTextActive ?? token.colorErrorText ?? token.colorError : token.colorTextSecondary;
|
|
138
|
+
const TrendIcon = trend === "up" ? import_icons.ArrowUpOutlined : trend === "down" ? import_icons.ArrowDownOutlined : import_icons.MinusOutlined;
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
140
|
+
import_antd2.Card,
|
|
141
|
+
{
|
|
142
|
+
size: "small",
|
|
143
|
+
hoverable: !!onClick,
|
|
144
|
+
onClick,
|
|
145
|
+
styles: { body: { padding: token.paddingMD } },
|
|
146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd2.Space, { direction: "vertical", size: 4, style: { width: "100%" }, children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd2.Space, { size: "small", children: [
|
|
148
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { color: token.colorTextSecondary }, children: icon }),
|
|
149
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text2, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: label })
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Title, { level: 3, style: { margin: 0 }, children: value }),
|
|
152
|
+
(delta || helpText) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd2.Space, { size: "small", children: [
|
|
153
|
+
delta && trend && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text2, { style: { color: trendColor, fontSize: token.fontSizeSM }, children: [
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TrendIcon, { style: { marginRight: 4 } }),
|
|
155
|
+
delta
|
|
156
|
+
] }),
|
|
157
|
+
helpText && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text2, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: helpText })
|
|
158
|
+
] })
|
|
159
|
+
] })
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// src/components/SectionCard.tsx
|
|
165
|
+
var import_antd3 = require("antd");
|
|
166
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
167
|
+
var { Title: Title2 } = import_antd3.Typography;
|
|
168
|
+
function SectionCard({
|
|
169
|
+
title,
|
|
170
|
+
subtitle,
|
|
171
|
+
extra,
|
|
172
|
+
children,
|
|
173
|
+
noPadding
|
|
174
|
+
}) {
|
|
175
|
+
const { token } = import_antd3.theme.useToken();
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
177
|
+
import_antd3.Card,
|
|
178
|
+
{
|
|
179
|
+
styles: {
|
|
180
|
+
body: noPadding ? { padding: 0 } : void 0
|
|
181
|
+
},
|
|
182
|
+
children: [
|
|
183
|
+
(title || extra) && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
184
|
+
"div",
|
|
185
|
+
{
|
|
186
|
+
style: {
|
|
187
|
+
display: "flex",
|
|
188
|
+
justifyContent: "space-between",
|
|
189
|
+
alignItems: "flex-start",
|
|
190
|
+
marginBottom: token.marginMD
|
|
191
|
+
},
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
|
|
194
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Title2, { level: 4, style: { margin: 0 }, children: title }),
|
|
195
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { style: { color: token.colorTextSecondary, fontSize: token.fontSizeSM }, children: subtitle })
|
|
196
|
+
] }),
|
|
197
|
+
extra && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: extra })
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
children
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// src/components/BulkActionsBar.tsx
|
|
208
|
+
var import_antd4 = require("antd");
|
|
209
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
210
|
+
var { Text: Text3 } = import_antd4.Typography;
|
|
211
|
+
function BulkActionsBar({
|
|
212
|
+
selectedCount,
|
|
213
|
+
selectedRowKeys,
|
|
214
|
+
actions,
|
|
215
|
+
onClear
|
|
216
|
+
}) {
|
|
217
|
+
const { token } = import_antd4.theme.useToken();
|
|
218
|
+
if (selectedCount === 0) return null;
|
|
219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
style: {
|
|
223
|
+
display: "flex",
|
|
224
|
+
alignItems: "center",
|
|
225
|
+
justifyContent: "space-between",
|
|
226
|
+
padding: `${token.paddingSM}px ${token.paddingMD}px`,
|
|
227
|
+
background: token.colorBgContainer,
|
|
228
|
+
border: `1px solid ${token.colorPrimaryBorder}`,
|
|
229
|
+
borderRadius: token.borderRadius,
|
|
230
|
+
marginBottom: token.marginMD
|
|
231
|
+
},
|
|
232
|
+
children: [
|
|
233
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_antd4.Space, { children: [
|
|
234
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Text3, { strong: true, children: [
|
|
235
|
+
selectedCount,
|
|
236
|
+
" selected"
|
|
237
|
+
] }),
|
|
238
|
+
onClear && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_antd4.Button, { type: "text", size: "small", onClick: onClear, children: "Clear" })
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_antd4.Space, { children: actions.map((action) => {
|
|
241
|
+
const isDanger = action.kind === "danger";
|
|
242
|
+
const dangerFill = "#7f1d1d";
|
|
243
|
+
const dangerStyle = isDanger ? {
|
|
244
|
+
background: dangerFill,
|
|
245
|
+
borderColor: dangerFill,
|
|
246
|
+
color: token.colorTextLightSolid ?? token.colorWhite ?? "#fff"
|
|
247
|
+
} : void 0;
|
|
248
|
+
const dangerLabelStyle = isDanger ? { color: token.colorTextLightSolid ?? token.colorWhite ?? "#fff" } : void 0;
|
|
249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
250
|
+
import_antd4.Button,
|
|
251
|
+
{
|
|
252
|
+
type: isDanger ? "default" : action.kind === "primary" ? "primary" : action.kind === "link" ? "link" : "default",
|
|
253
|
+
danger: false,
|
|
254
|
+
size: "small",
|
|
255
|
+
disabled: action.disabled,
|
|
256
|
+
onClick: () => action.onAction(selectedRowKeys),
|
|
257
|
+
style: dangerStyle,
|
|
258
|
+
children: isDanger ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { style: dangerLabelStyle, children: action.label }) : action.label
|
|
259
|
+
},
|
|
260
|
+
action.key
|
|
261
|
+
);
|
|
262
|
+
}) })
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/components/AuditTrail.tsx
|
|
269
|
+
var import_antd5 = require("antd");
|
|
270
|
+
var import_icons2 = require("@ant-design/icons");
|
|
271
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
272
|
+
var { Text: Text4, Title: Title3 } = import_antd5.Typography;
|
|
273
|
+
function AuditTrail({
|
|
274
|
+
title = "Audit Trail",
|
|
275
|
+
events,
|
|
276
|
+
loading,
|
|
277
|
+
onLoadMore
|
|
278
|
+
}) {
|
|
279
|
+
const { token } = import_antd5.theme.useToken();
|
|
280
|
+
const timelineItems = events.map((event) => ({
|
|
281
|
+
key: event.key,
|
|
282
|
+
dot: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons2.ClockCircleOutlined, { style: { fontSize: 14 } }),
|
|
283
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_antd5.Space, { direction: "vertical", size: 2, children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_antd5.Space, { size: "small", wrap: true, children: [
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Text4, { strong: true, children: event.action }),
|
|
286
|
+
event.by && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text4, { type: "secondary", children: [
|
|
287
|
+
"by ",
|
|
288
|
+
event.by
|
|
289
|
+
] })
|
|
290
|
+
] }),
|
|
291
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Text4, { type: "secondary", style: { fontSize: token.fontSizeSM }, children: [
|
|
292
|
+
event.at,
|
|
293
|
+
event.sourceSystem && ` \xB7 ${event.sourceSystem}`
|
|
294
|
+
] }),
|
|
295
|
+
event.description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { children: event.description }),
|
|
296
|
+
event.evidenceUrl && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
297
|
+
"a",
|
|
298
|
+
{
|
|
299
|
+
href: event.evidenceUrl,
|
|
300
|
+
target: "_blank",
|
|
301
|
+
rel: "noopener noreferrer",
|
|
302
|
+
style: { fontSize: token.fontSizeSM },
|
|
303
|
+
children: "View Evidence"
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] })
|
|
307
|
+
}));
|
|
308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_antd5.Card, { children: [
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Title3, { level: 5, style: { marginBottom: token.marginMD }, children: title }),
|
|
310
|
+
loading && events.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { textAlign: "center", padding: token.paddingLG }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd5.Spin, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
311
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd5.Timeline, { items: timelineItems }),
|
|
312
|
+
onLoadMore && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd5.Button, { type: "link", onClick: onLoadMore, loading, children: "Load more" }) })
|
|
313
|
+
] })
|
|
314
|
+
] });
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// src/templates/DashboardTemplate/DashboardTemplate.tsx
|
|
318
|
+
var import_antd6 = require("antd");
|
|
319
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
320
|
+
function DashboardTemplate({
|
|
321
|
+
title,
|
|
322
|
+
subtitle,
|
|
323
|
+
breadcrumbs,
|
|
324
|
+
data,
|
|
325
|
+
actions,
|
|
326
|
+
filters,
|
|
327
|
+
audit,
|
|
328
|
+
layout
|
|
329
|
+
}) {
|
|
330
|
+
const { token } = import_antd6.theme.useToken();
|
|
331
|
+
const kpis = data?.kpis ?? [];
|
|
332
|
+
const panels = data?.panels ?? [];
|
|
333
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
334
|
+
TemplateFrame,
|
|
335
|
+
{
|
|
336
|
+
title,
|
|
337
|
+
subtitle,
|
|
338
|
+
breadcrumbs,
|
|
339
|
+
data,
|
|
340
|
+
actions,
|
|
341
|
+
filters,
|
|
342
|
+
audit,
|
|
343
|
+
layout,
|
|
344
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_antd6.Space, { direction: "vertical", size: "large", style: { width: "100%" }, children: [
|
|
345
|
+
kpis.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd6.Row, { gutter: [token.marginMD, token.marginMD], children: kpis.map((kpi) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd6.Col, { xs: 24, sm: 12, lg: 6, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
346
|
+
KpiCard,
|
|
347
|
+
{
|
|
348
|
+
label: kpi.label,
|
|
349
|
+
value: kpi.value,
|
|
350
|
+
delta: kpi.delta,
|
|
351
|
+
trend: kpi.trend,
|
|
352
|
+
helpText: kpi.helpText,
|
|
353
|
+
icon: kpi.icon,
|
|
354
|
+
onClick: kpi.onClick
|
|
355
|
+
}
|
|
356
|
+
) }, kpi.key)) }),
|
|
357
|
+
panels.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd6.Row, { gutter: [token.marginMD, token.marginMD], children: panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd6.Col, { xs: 24, lg: panel.span ?? 12, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
358
|
+
SectionCard,
|
|
359
|
+
{
|
|
360
|
+
title: panel.title,
|
|
361
|
+
subtitle: panel.subtitle,
|
|
362
|
+
extra: panel.extra,
|
|
363
|
+
children: panel.content
|
|
364
|
+
}
|
|
365
|
+
) }, panel.key)) })
|
|
366
|
+
] })
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// src/templates/ListTemplate/ListTemplate.tsx
|
|
372
|
+
var import_antd7 = require("antd");
|
|
373
|
+
var import_icons3 = require("@ant-design/icons");
|
|
374
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
375
|
+
function ListTemplate({
|
|
376
|
+
title,
|
|
377
|
+
subtitle,
|
|
378
|
+
breadcrumbs,
|
|
379
|
+
data,
|
|
380
|
+
actions,
|
|
381
|
+
filters,
|
|
382
|
+
audit,
|
|
383
|
+
layout,
|
|
384
|
+
table,
|
|
385
|
+
selection,
|
|
386
|
+
exports: exports2,
|
|
387
|
+
tools
|
|
388
|
+
}) {
|
|
389
|
+
const { token } = import_antd7.theme.useToken();
|
|
390
|
+
const items = data?.items ?? [];
|
|
391
|
+
const loading = data?.loading ?? false;
|
|
392
|
+
const selectedRowKeys = selection?.selectedRowKeys;
|
|
393
|
+
const selectedCount = selectedRowKeys?.length ?? 0;
|
|
394
|
+
const bulkActions = selection?.bulkActions?.map((action) => ({
|
|
395
|
+
key: action.key,
|
|
396
|
+
label: action.label,
|
|
397
|
+
kind: action.kind,
|
|
398
|
+
disabled: action.disabled,
|
|
399
|
+
onAction: (keys) => action.onAction(keys)
|
|
400
|
+
})) ?? [];
|
|
401
|
+
const rowSelection = selection?.enabled ? {
|
|
402
|
+
...selectedRowKeys !== void 0 ? { selectedRowKeys } : {},
|
|
403
|
+
onChange: (keys) => selection.onSelectionChange?.(keys),
|
|
404
|
+
getCheckboxProps: (record, index) => {
|
|
405
|
+
const fallback = record?.name ?? record?.title ?? record?.key ?? "row";
|
|
406
|
+
return {
|
|
407
|
+
name: String(fallback),
|
|
408
|
+
"aria-label": selection.getAriaLabel?.(record, index) ?? `Select ${fallback}`
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
} : void 0;
|
|
412
|
+
const hasToolbar = exports2 && exports2.length > 0 || tools;
|
|
413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
414
|
+
TemplateFrame,
|
|
415
|
+
{
|
|
416
|
+
title,
|
|
417
|
+
subtitle,
|
|
418
|
+
breadcrumbs,
|
|
419
|
+
data,
|
|
420
|
+
actions,
|
|
421
|
+
filters,
|
|
422
|
+
audit,
|
|
423
|
+
layout,
|
|
424
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_antd7.Space, { direction: "vertical", size: "middle", style: { width: "100%" }, children: [
|
|
425
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
426
|
+
"div",
|
|
427
|
+
{
|
|
428
|
+
style: {
|
|
429
|
+
display: "flex",
|
|
430
|
+
justifyContent: "flex-end",
|
|
431
|
+
gap: token.marginSM,
|
|
432
|
+
flexWrap: "wrap"
|
|
433
|
+
},
|
|
434
|
+
children: [
|
|
435
|
+
exports2?.map((exp) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
436
|
+
import_antd7.Button,
|
|
437
|
+
{
|
|
438
|
+
icon: exp.icon ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons3.DownloadOutlined, {}),
|
|
439
|
+
onClick: exp.onExport,
|
|
440
|
+
disabled: exp.disabled,
|
|
441
|
+
children: exp.label
|
|
442
|
+
},
|
|
443
|
+
exp.key
|
|
444
|
+
)),
|
|
445
|
+
tools
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
selection?.enabled && selectedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
450
|
+
BulkActionsBar,
|
|
451
|
+
{
|
|
452
|
+
selectedCount,
|
|
453
|
+
selectedRowKeys: selectedRowKeys ?? [],
|
|
454
|
+
actions: bulkActions,
|
|
455
|
+
onClear: () => selection.onSelectionChange?.([])
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_antd7.Card, { styles: { body: { padding: 0 } }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
459
|
+
import_antd7.Table,
|
|
460
|
+
{
|
|
461
|
+
...table,
|
|
462
|
+
dataSource: items,
|
|
463
|
+
loading,
|
|
464
|
+
rowSelection
|
|
465
|
+
}
|
|
466
|
+
) })
|
|
467
|
+
] })
|
|
468
|
+
}
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// src/templates/DetailTemplate/DetailTemplate.tsx
|
|
473
|
+
var import_antd8 = require("antd");
|
|
474
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
475
|
+
function DetailTemplate({
|
|
476
|
+
title,
|
|
477
|
+
subtitle,
|
|
478
|
+
breadcrumbs,
|
|
479
|
+
data,
|
|
480
|
+
actions,
|
|
481
|
+
audit,
|
|
482
|
+
layout
|
|
483
|
+
}) {
|
|
484
|
+
const { token } = import_antd8.theme.useToken();
|
|
485
|
+
const summary = data?.summary;
|
|
486
|
+
const sections = data?.sections ?? [];
|
|
487
|
+
const auditTrail = data?.auditTrail;
|
|
488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
489
|
+
TemplateFrame,
|
|
490
|
+
{
|
|
491
|
+
title,
|
|
492
|
+
subtitle,
|
|
493
|
+
breadcrumbs,
|
|
494
|
+
data,
|
|
495
|
+
actions,
|
|
496
|
+
audit,
|
|
497
|
+
layout,
|
|
498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_antd8.Space, { direction: "vertical", size: "large", style: { width: "100%" }, children: [
|
|
499
|
+
summary && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SectionCard, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
500
|
+
import_antd8.Descriptions,
|
|
501
|
+
{
|
|
502
|
+
items: summary.items,
|
|
503
|
+
column: summary.columns ?? { xs: 1, sm: 2, lg: 3 },
|
|
504
|
+
size: "small",
|
|
505
|
+
bordered: true
|
|
506
|
+
}
|
|
507
|
+
) }),
|
|
508
|
+
sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
509
|
+
SectionCard,
|
|
510
|
+
{
|
|
511
|
+
title: section.title,
|
|
512
|
+
extra: section.extra,
|
|
513
|
+
children: section.content
|
|
514
|
+
},
|
|
515
|
+
section.key
|
|
516
|
+
)),
|
|
517
|
+
auditTrail && auditTrail.events.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
518
|
+
AuditTrail,
|
|
519
|
+
{
|
|
520
|
+
title: auditTrail.title,
|
|
521
|
+
events: auditTrail.events,
|
|
522
|
+
loading: auditTrail.loading,
|
|
523
|
+
onLoadMore: auditTrail.onLoadMore
|
|
524
|
+
}
|
|
525
|
+
)
|
|
526
|
+
] })
|
|
527
|
+
}
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// src/templates/Auth/AuthShell.tsx
|
|
532
|
+
var import_antd9 = require("antd");
|
|
533
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
534
|
+
var { Title: Title4, Text: Text5 } = import_antd9.Typography;
|
|
535
|
+
function AuthShell({
|
|
536
|
+
brand,
|
|
537
|
+
title,
|
|
538
|
+
subtitle,
|
|
539
|
+
footer,
|
|
540
|
+
children,
|
|
541
|
+
maxWidth = 420
|
|
542
|
+
}) {
|
|
543
|
+
const { token } = import_antd9.theme.useToken();
|
|
544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
545
|
+
"div",
|
|
546
|
+
{
|
|
547
|
+
style: {
|
|
548
|
+
minHeight: "100vh",
|
|
549
|
+
display: "flex",
|
|
550
|
+
flexDirection: "column",
|
|
551
|
+
alignItems: "center",
|
|
552
|
+
justifyContent: "center",
|
|
553
|
+
padding: token.paddingLG,
|
|
554
|
+
background: token.colorBgLayout
|
|
555
|
+
},
|
|
556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { width: "100%", maxWidth }, children: [
|
|
557
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: { textAlign: "center", marginBottom: token.marginLG }, children: brand }),
|
|
558
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
559
|
+
import_antd9.Card,
|
|
560
|
+
{
|
|
561
|
+
styles: {
|
|
562
|
+
body: { padding: token.paddingXL }
|
|
563
|
+
},
|
|
564
|
+
children: [
|
|
565
|
+
(title || subtitle) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { textAlign: "center", marginBottom: token.marginLG }, children: [
|
|
566
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Title4, { level: 3, style: { margin: 0 }, children: title }),
|
|
567
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text5, { type: "secondary", style: { marginTop: token.marginXS, display: "block" }, children: subtitle })
|
|
568
|
+
] }),
|
|
569
|
+
children
|
|
570
|
+
]
|
|
571
|
+
}
|
|
572
|
+
),
|
|
573
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
574
|
+
"div",
|
|
575
|
+
{
|
|
576
|
+
style: {
|
|
577
|
+
textAlign: "center",
|
|
578
|
+
marginTop: token.marginLG,
|
|
579
|
+
color: token.colorTextSecondary,
|
|
580
|
+
fontSize: token.fontSizeSM
|
|
581
|
+
},
|
|
582
|
+
children: footer
|
|
583
|
+
}
|
|
584
|
+
)
|
|
585
|
+
] })
|
|
586
|
+
}
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// src/templates/Auth/ErrorPageTemplate.tsx
|
|
591
|
+
var import_antd10 = require("antd");
|
|
592
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
593
|
+
var defaultTitles = {
|
|
594
|
+
401: "Unauthorized",
|
|
595
|
+
403: "Access Denied",
|
|
596
|
+
404: "Page Not Found",
|
|
597
|
+
500: "Server Error"
|
|
598
|
+
};
|
|
599
|
+
var defaultMessages = {
|
|
600
|
+
401: "You need to sign in to access this page.",
|
|
601
|
+
403: "You don't have permission to access this resource.",
|
|
602
|
+
404: "The page you're looking for doesn't exist or has been moved.",
|
|
603
|
+
500: "Something went wrong on our end. Please try again later."
|
|
604
|
+
};
|
|
605
|
+
var statusToResultStatus = {
|
|
606
|
+
401: "warning",
|
|
607
|
+
403: "error",
|
|
608
|
+
404: "404",
|
|
609
|
+
500: "500"
|
|
610
|
+
};
|
|
611
|
+
function ErrorPageTemplate({
|
|
612
|
+
status,
|
|
613
|
+
title,
|
|
614
|
+
message,
|
|
615
|
+
actions,
|
|
616
|
+
extra
|
|
617
|
+
}) {
|
|
618
|
+
const { token } = import_antd10.theme.useToken();
|
|
619
|
+
const resolvedTitle = title ?? defaultTitles[status];
|
|
620
|
+
const resolvedMessage = message ?? defaultMessages[status];
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
622
|
+
"div",
|
|
623
|
+
{
|
|
624
|
+
style: {
|
|
625
|
+
minHeight: "100vh",
|
|
626
|
+
display: "flex",
|
|
627
|
+
alignItems: "center",
|
|
628
|
+
justifyContent: "center",
|
|
629
|
+
padding: token.paddingLG,
|
|
630
|
+
background: token.colorBgLayout
|
|
631
|
+
},
|
|
632
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
633
|
+
import_antd10.Result,
|
|
634
|
+
{
|
|
635
|
+
status: statusToResultStatus[status],
|
|
636
|
+
title: resolvedTitle,
|
|
637
|
+
subTitle: resolvedMessage,
|
|
638
|
+
extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_antd10.Space, { direction: "vertical", size: "middle", align: "center", children: [
|
|
639
|
+
actions && actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd10.Space, { children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
640
|
+
import_antd10.Button,
|
|
641
|
+
{
|
|
642
|
+
type: action.kind === "primary" ? "primary" : action.kind === "link" ? "link" : "default",
|
|
643
|
+
danger: action.kind === "danger",
|
|
644
|
+
disabled: action.disabled,
|
|
645
|
+
icon: action.icon,
|
|
646
|
+
onClick: action.onAction,
|
|
647
|
+
"aria-label": action.ariaLabel,
|
|
648
|
+
children: action.label
|
|
649
|
+
},
|
|
650
|
+
action.key
|
|
651
|
+
)) }),
|
|
652
|
+
extra
|
|
653
|
+
] })
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// src/templates/WizardTemplate/WizardTemplate.tsx
|
|
661
|
+
var import_antd11 = require("antd");
|
|
662
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
663
|
+
function WizardTemplate({
|
|
664
|
+
title,
|
|
665
|
+
subtitle,
|
|
666
|
+
breadcrumbs,
|
|
667
|
+
actions,
|
|
668
|
+
data,
|
|
669
|
+
filters,
|
|
670
|
+
audit,
|
|
671
|
+
layout
|
|
672
|
+
}) {
|
|
673
|
+
const steps = data?.steps ?? [];
|
|
674
|
+
const currentStep = data?.currentStep ?? 0;
|
|
675
|
+
const activeStep = steps[currentStep];
|
|
676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
677
|
+
TemplateFrame,
|
|
678
|
+
{
|
|
679
|
+
title,
|
|
680
|
+
subtitle,
|
|
681
|
+
breadcrumbs,
|
|
682
|
+
actions,
|
|
683
|
+
data,
|
|
684
|
+
filters,
|
|
685
|
+
audit,
|
|
686
|
+
layout,
|
|
687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_antd11.Space, { direction: "vertical", size: "large", style: { width: "100%" }, children: [
|
|
688
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
689
|
+
import_antd11.Steps,
|
|
690
|
+
{
|
|
691
|
+
current: currentStep,
|
|
692
|
+
items: steps.map((step) => ({
|
|
693
|
+
key: step.key,
|
|
694
|
+
title: step.title,
|
|
695
|
+
description: step.description
|
|
696
|
+
}))
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
activeStep && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionCard, { title: activeStep.title, subtitle: activeStep.description, children: activeStep.content })
|
|
700
|
+
] })
|
|
701
|
+
}
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
// src/templates/SettingsTemplate/SettingsTemplate.tsx
|
|
706
|
+
var import_antd12 = require("antd");
|
|
707
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
708
|
+
function SettingsTemplate({
|
|
709
|
+
title,
|
|
710
|
+
subtitle,
|
|
711
|
+
breadcrumbs,
|
|
712
|
+
actions,
|
|
713
|
+
data,
|
|
714
|
+
filters,
|
|
715
|
+
audit,
|
|
716
|
+
layout
|
|
717
|
+
}) {
|
|
718
|
+
const sections = data?.sections ?? [];
|
|
719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
720
|
+
TemplateFrame,
|
|
721
|
+
{
|
|
722
|
+
title,
|
|
723
|
+
subtitle,
|
|
724
|
+
breadcrumbs,
|
|
725
|
+
actions,
|
|
726
|
+
data,
|
|
727
|
+
filters,
|
|
728
|
+
audit,
|
|
729
|
+
layout,
|
|
730
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd12.Space, { direction: "vertical", size: "large", style: { width: "100%" }, children: sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
731
|
+
SectionCard,
|
|
732
|
+
{
|
|
733
|
+
title: section.title,
|
|
734
|
+
subtitle: section.subtitle,
|
|
735
|
+
children: section.content
|
|
736
|
+
},
|
|
737
|
+
section.key
|
|
738
|
+
)) })
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
}
|
|
742
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
743
|
+
0 && (module.exports = {
|
|
744
|
+
AuditTrail,
|
|
745
|
+
AuthShell,
|
|
746
|
+
BulkActionsBar,
|
|
747
|
+
DashboardTemplate,
|
|
748
|
+
DetailTemplate,
|
|
749
|
+
ErrorPageTemplate,
|
|
750
|
+
KpiCard,
|
|
751
|
+
ListTemplate,
|
|
752
|
+
SectionCard,
|
|
753
|
+
SettingsTemplate,
|
|
754
|
+
TemplateFrame,
|
|
755
|
+
WizardTemplate,
|
|
756
|
+
templateActionsToPageHeaderActions
|
|
757
|
+
});
|