@doneisbetter/gds-admin 2.6.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/server.js ADDED
@@ -0,0 +1,272 @@
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/server.ts
21
+ var server_exports = {};
22
+ __export(server_exports, {
23
+ ContentOpsActionBar: () => ContentOpsActionBar,
24
+ ContentOpsEditor: () => ContentOpsEditor,
25
+ ContentOpsSection: () => ContentOpsSection,
26
+ FormSection: () => FormSection,
27
+ InfoCard: () => InfoCard,
28
+ PageHeader: () => PageHeader,
29
+ StatsStrip: () => StatsStrip,
30
+ WorkspaceHeader: () => WorkspaceHeader
31
+ });
32
+ module.exports = __toCommonJS(server_exports);
33
+
34
+ // src/FormSection.tsx
35
+ var import_core = require("@mantine/core");
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ function FormSection({ title, description, children, withDivider = true }) {
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Box, { mb: "xl", children: [
39
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_core.Box, { mb: "md", children: [
40
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Title, { order: 4, children: title }),
41
+ description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Text, { c: "dimmed", size: "sm", children: description })
42
+ ] }),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Stack, { gap: "md", children }),
44
+ withDivider && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Divider, { my: "xl" })
45
+ ] });
46
+ }
47
+
48
+ // src/StatsStrip.tsx
49
+ var import_core2 = require("@mantine/core");
50
+ var import_jsx_runtime2 = require("react/jsx-runtime");
51
+ function StatsStrip({ stats }) {
52
+ const items = stats.map((stat, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Paper, { p: "lg", withBorder: true, radius: "md", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { justify: "space-between", align: "flex-end", gap: "xs", children: [
53
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Box, { children: [
54
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { c: "dimmed", tt: "uppercase", fw: 700, size: "xs", children: stat.label }),
55
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Text, { fw: 700, size: "xl", mt: "sm", children: stat.value })
56
+ ] }),
57
+ stat.diff !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Text, { c: stat.diff > 0 ? "teal" : "red", size: "sm", fw: 600, children: [
58
+ stat.diff > 0 ? "+" : "",
59
+ stat.diff,
60
+ "%"
61
+ ] })
62
+ ] }) }, index));
63
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.SimpleGrid, { cols: { base: 1, sm: 2, md: 3 }, spacing: "md", children: items });
64
+ }
65
+
66
+ // src/InfoCard.tsx
67
+ var import_core3 = require("@mantine/core");
68
+ var import_jsx_runtime3 = require("react/jsx-runtime");
69
+ function InfoCard({ title, value, description, icon, color = "blue" }) {
70
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Card, { p: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
71
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Box, { children: [
72
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Text, { tt: "uppercase", fw: 700, c: "dimmed", size: "xs", children: title }),
73
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Text, { fw: 700, size: "xl", mt: "sm", children: value }),
74
+ description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Text, { c: "dimmed", size: "sm", mt: "xs", children: description })
75
+ ] }),
76
+ icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.ThemeIcon, { size: "xl", radius: "md", variant: "light", color, children: icon })
77
+ ] }) });
78
+ }
79
+
80
+ // src/PageHeader.tsx
81
+ var import_core4 = require("@mantine/core");
82
+ var import_gds_core = require("@doneisbetter/gds-core");
83
+ var import_jsx_runtime4 = require("react/jsx-runtime");
84
+ function PageHeader({
85
+ title,
86
+ description,
87
+ subtitle,
88
+ eyebrow,
89
+ breadcrumbs,
90
+ status,
91
+ primaryAction,
92
+ secondaryActions,
93
+ overflowActions = []
94
+ }) {
95
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Stack, { gap: "sm", mb: "xl", children: [
96
+ breadcrumbs?.length ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Breadcrumbs, { children: breadcrumbs }) : null,
97
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
98
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Box, { style: { minWidth: 0, flex: 1 }, children: [
99
+ eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Text, { c: "dimmed", size: "sm", fw: 700, mb: 4, children: eyebrow }) : null,
100
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Title, { order: 1, children: title }),
101
+ subtitle ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Text, { c: "dimmed", mt: "xs", size: "sm", children: subtitle }) : null,
102
+ description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Text, { c: "dimmed", mt: "xs", size: "lg", children: description }),
103
+ status ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Group, { mt: "sm", gap: "sm", children: status }) : null
104
+ ] }),
105
+ (secondaryActions || primaryAction || overflowActions.length) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Group, { wrap: "wrap", justify: "flex-end", children: [
106
+ secondaryActions,
107
+ primaryAction,
108
+ overflowActions.length ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Menu, { shadow: "md", width: 220, withinPortal: true, children: [
109
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Menu.Target, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ActionIcon, { variant: "default", size: "lg", "aria-label": "More actions", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_gds_core.GdsIcons.Menu, { size: "1rem" }) }) }),
110
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Menu.Dropdown, { children: overflowActions.map((action, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
111
+ import_core4.Menu.Item,
112
+ {
113
+ component: action.href ? "a" : "button",
114
+ href: action.href,
115
+ onClick: action.onClick,
116
+ color: action.color,
117
+ disabled: action.disabled,
118
+ children: action.label
119
+ },
120
+ `${String(action.label)}-${index}`
121
+ )) })
122
+ ] }) : null
123
+ ] })
124
+ ] })
125
+ ] });
126
+ }
127
+
128
+ // src/WorkspaceHeader.tsx
129
+ var import_core5 = require("@mantine/core");
130
+ var import_jsx_runtime5 = require("react/jsx-runtime");
131
+ function WorkspaceHeader({
132
+ breadcrumbs,
133
+ eyebrow,
134
+ title,
135
+ description,
136
+ primaryAction,
137
+ secondaryActions
138
+ }) {
139
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core5.Stack, { gap: "sm", mb: "xl", children: [
140
+ breadcrumbs?.length ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.Breadcrumbs, { children: breadcrumbs }) : null,
141
+ eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.Text, { size: "sm", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
142
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core5.Group, { justify: "space-between", align: "flex-start", gap: "md", children: [
143
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core5.Stack, { gap: 6, children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.Title, { order: 1, children: title }),
145
+ description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core5.Text, { c: "dimmed", maw: 640, children: description }) : null
146
+ ] }),
147
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_core5.Group, { gap: "sm", children: [
148
+ secondaryActions,
149
+ primaryAction
150
+ ] })
151
+ ] })
152
+ ] });
153
+ }
154
+
155
+ // src/ContentOpsSection.tsx
156
+ var import_gds_core2 = require("@doneisbetter/gds-core");
157
+ var import_jsx_runtime6 = require("react/jsx-runtime");
158
+ function ContentOpsSection({
159
+ id,
160
+ title,
161
+ description,
162
+ action,
163
+ children,
164
+ tone = "default"
165
+ }) {
166
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_gds_core2.SectionPanel, { id, title, description, action, tone, children });
167
+ }
168
+
169
+ // src/ContentOpsActionBar.tsx
170
+ var import_core6 = require("@mantine/core");
171
+ var import_jsx_runtime7 = require("react/jsx-runtime");
172
+ function ContentOpsActionBar({
173
+ dirty = false,
174
+ saving = false,
175
+ status,
176
+ primaryAction,
177
+ secondaryAction,
178
+ tertiaryAction
179
+ }) {
180
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Paper, { withBorder: true, radius: "xl", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { justify: "space-between", align: "center", gap: "md", wrap: "wrap", children: [
181
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { gap: "sm", wrap: "wrap", children: [
182
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Badge, { color: saving ? "violet" : dirty ? "yellow" : "teal", variant: "light", children: saving ? "Saving" : dirty ? "Unsaved changes" : "Saved" }),
183
+ status ? typeof status === "string" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core6.Text, { size: "sm", c: "dimmed", children: status }) : status : null
184
+ ] }),
185
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core6.Group, { gap: "sm", wrap: "wrap", children: [
186
+ tertiaryAction,
187
+ secondaryAction,
188
+ primaryAction
189
+ ] })
190
+ ] }) });
191
+ }
192
+
193
+ // src/ContentOpsEditor.tsx
194
+ var import_core8 = require("@mantine/core");
195
+
196
+ // src/EditorScaffold.tsx
197
+ var import_core7 = require("@mantine/core");
198
+ var import_jsx_runtime8 = require("react/jsx-runtime");
199
+ function EditorScaffold({
200
+ header,
201
+ context,
202
+ form,
203
+ preview,
204
+ settings,
205
+ footer,
206
+ stickyFooter = false
207
+ }) {
208
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core7.Stack, { gap: "lg", children: [
209
+ header,
210
+ context,
211
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core7.Grid, { gutter: "lg", align: "start", children: [
212
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Grid.Col, { span: { base: 12, md: preview ? 7 : 8 }, children: form }),
213
+ preview || settings ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core7.Grid.Col, { span: { base: 12, md: preview ? 5 : 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core7.Stack, { gap: "lg", children: [
214
+ preview,
215
+ settings
216
+ ] }) }) : null
217
+ ] }),
218
+ footer ? stickyFooter ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
219
+ import_core7.Paper,
220
+ {
221
+ withBorder: true,
222
+ radius: "xl",
223
+ p: "md",
224
+ style: {
225
+ position: "sticky",
226
+ bottom: "1rem",
227
+ zIndex: 10
228
+ },
229
+ children: footer
230
+ }
231
+ ) : footer : null
232
+ ] });
233
+ }
234
+
235
+ // src/ContentOpsEditor.tsx
236
+ var import_jsx_runtime9 = require("react/jsx-runtime");
237
+ function ContentOpsEditor({
238
+ header,
239
+ context,
240
+ status,
241
+ sections,
242
+ actionBar,
243
+ preview,
244
+ settings
245
+ }) {
246
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core8.Stack, { gap: "lg", children: [
247
+ header,
248
+ status,
249
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
250
+ EditorScaffold,
251
+ {
252
+ context,
253
+ form: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core8.Stack, { gap: "lg", children: sections }),
254
+ preview,
255
+ settings,
256
+ footer: actionBar,
257
+ stickyFooter: true
258
+ }
259
+ )
260
+ ] });
261
+ }
262
+ // Annotate the CommonJS export names for ESM import in node:
263
+ 0 && (module.exports = {
264
+ ContentOpsActionBar,
265
+ ContentOpsEditor,
266
+ ContentOpsSection,
267
+ FormSection,
268
+ InfoCard,
269
+ PageHeader,
270
+ StatsStrip,
271
+ WorkspaceHeader
272
+ });
@@ -0,0 +1,20 @@
1
+ import {
2
+ ContentOpsActionBar,
3
+ ContentOpsEditor,
4
+ ContentOpsSection,
5
+ FormSection,
6
+ InfoCard,
7
+ PageHeader,
8
+ StatsStrip,
9
+ WorkspaceHeader
10
+ } from "./chunk-ZUUEDN7I.mjs";
11
+ export {
12
+ ContentOpsActionBar,
13
+ ContentOpsEditor,
14
+ ContentOpsSection,
15
+ FormSection,
16
+ InfoCard,
17
+ PageHeader,
18
+ StatsStrip,
19
+ WorkspaceHeader
20
+ };
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@doneisbetter/gds-admin",
3
+ "version": "2.6.1",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/sovereignsquad/general-design-system.git",
14
+ "directory": "packages/gds-admin"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.mjs",
20
+ "require": "./dist/index.js"
21
+ },
22
+ "./client": {
23
+ "types": "./dist/client.d.ts",
24
+ "import": "./dist/client.mjs",
25
+ "require": "./dist/client.js"
26
+ },
27
+ "./server": {
28
+ "types": "./dist/server.d.ts",
29
+ "import": "./dist/server.mjs",
30
+ "require": "./dist/server.js"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist"
35
+ ],
36
+ "scripts": {
37
+ "build": "tsup",
38
+ "dev": "tsup --watch"
39
+ },
40
+ "peerDependencies": {
41
+ "@doneisbetter/gds-core": "^2.6.1",
42
+ "@doneisbetter/gds-theme": "^2.6.1",
43
+ "@mantine/core": "^7.9.0 || ^8.3.0",
44
+ "@mantine/hooks": "^7.9.0 || ^8.3.0",
45
+ "@tabler/icons-react": "^3.5.0",
46
+ "react": "^18.2.0 || ^19.0.0",
47
+ "react-dom": "^18.2.0 || ^19.0.0"
48
+ },
49
+ "devDependencies": {
50
+ "@doneisbetter/gds-core": "*",
51
+ "@doneisbetter/gds-theme": "*",
52
+ "@mantine/core": "^7.9.0",
53
+ "@mantine/hooks": "^7.9.0",
54
+ "@tabler/icons-react": "^3.5.0",
55
+ "react": "^18.2.0",
56
+ "react-dom": "^18.2.0"
57
+ }
58
+ }