@sparkstudio/common-ui 1.0.17 → 1.0.19
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/index.cjs +121 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +26 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +35 -4
- package/dist/index.d.ts +35 -4
- package/dist/index.js +118 -55
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -20,6 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
AppTile: () => AppTile,
|
|
24
|
+
AppsView: () => AppsView,
|
|
23
25
|
Body: () => Body,
|
|
24
26
|
Button: () => Button,
|
|
25
27
|
ContentContainer: () => ContentContainer,
|
|
@@ -27,6 +29,7 @@ __export(index_exports, {
|
|
|
27
29
|
Footer: () => Footer,
|
|
28
30
|
Header: () => Header,
|
|
29
31
|
HeaderText: () => HeaderText,
|
|
32
|
+
ImageCard: () => ImageCard,
|
|
30
33
|
LayoutWrapper: () => LayoutWrapper,
|
|
31
34
|
Modal: () => Modal,
|
|
32
35
|
ModalProvider: () => ModalProvider,
|
|
@@ -40,19 +43,46 @@ __export(index_exports, {
|
|
|
40
43
|
});
|
|
41
44
|
module.exports = __toCommonJS(index_exports);
|
|
42
45
|
|
|
43
|
-
// src/components/
|
|
46
|
+
// src/components/AppTile.tsx
|
|
44
47
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
var AppTile = ({ app, onClick }) => {
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "col-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
50
|
+
"button",
|
|
51
|
+
{
|
|
52
|
+
type: "button",
|
|
53
|
+
className: "btn p-2 d-flex flex-column align-items-center border-0 bg-transparent app-icon-btn",
|
|
54
|
+
onClick: () => onClick?.(app),
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "app-icon-tile d-flex align-items-center justify-content-center mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { style: { fontSize: "32px" }, children: app.icon }) }),
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "w-100 small text-truncate", children: [
|
|
58
|
+
app.name,
|
|
59
|
+
app.version && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { className: "text-muted ms-1", children: [
|
|
60
|
+
"v",
|
|
61
|
+
app.version
|
|
62
|
+
] })
|
|
63
|
+
] })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
) });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/components/Body.tsx
|
|
70
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
71
|
+
function Body({ icon, title, description, children }) {
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("main", { className: "col p-4", children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("h2", { children: [
|
|
74
|
+
icon,
|
|
75
|
+
" ",
|
|
76
|
+
title
|
|
77
|
+
] }),
|
|
78
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: description }),
|
|
49
79
|
children
|
|
50
80
|
] });
|
|
51
81
|
}
|
|
52
82
|
|
|
53
83
|
// src/components/Button.tsx
|
|
54
84
|
var import_react = require("react");
|
|
55
|
-
var
|
|
85
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
56
86
|
function Button({
|
|
57
87
|
buttonClassName = "btn btn-primary btn-lg",
|
|
58
88
|
type = "button",
|
|
@@ -86,15 +116,15 @@ function Button({
|
|
|
86
116
|
onFinally?.();
|
|
87
117
|
}
|
|
88
118
|
};
|
|
89
|
-
return /* @__PURE__ */ (0,
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
90
120
|
"button",
|
|
91
121
|
{
|
|
92
122
|
type,
|
|
93
123
|
className: `${buttonClassName} ${loading ? "async-btn--loading" : ""}`,
|
|
94
124
|
onClick: handleClick,
|
|
95
125
|
disabled: disabled || loading,
|
|
96
|
-
children: loading ? renderLoading?.() ?? loadingChildren ?? /* @__PURE__ */ (0,
|
|
97
|
-
showSpinner && /* @__PURE__ */ (0,
|
|
126
|
+
children: loading ? renderLoading?.() ?? loadingChildren ?? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
|
|
127
|
+
showSpinner && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
98
128
|
"span",
|
|
99
129
|
{
|
|
100
130
|
className: "spinner-border spinner-border-sm me-2 async-btn__spinner",
|
|
@@ -109,58 +139,82 @@ function Button({
|
|
|
109
139
|
}
|
|
110
140
|
|
|
111
141
|
// src/components/Footer.tsx
|
|
112
|
-
var
|
|
142
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
113
143
|
function Footer({ children }) {
|
|
114
|
-
return /* @__PURE__ */ (0,
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("footer", { className: "bg-dark text-white text-center py-2 mt-auto", children: children ?? "\xA9 2025 Your Site \u2014 All rights reserved" });
|
|
115
145
|
}
|
|
116
146
|
|
|
117
147
|
// src/components/Header.tsx
|
|
118
|
-
var
|
|
148
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
119
149
|
function Header({ children }) {
|
|
120
|
-
return /* @__PURE__ */ (0,
|
|
150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "navbar navbar-dark bg-dark px-3 sticky-top", children: children ?? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "navbar-brand mb-0 h4", children: "My Website" }) });
|
|
121
151
|
}
|
|
122
152
|
|
|
123
153
|
// src/components/HeaderText.tsx
|
|
124
|
-
var
|
|
154
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
125
155
|
function HeaderText({ children }) {
|
|
126
|
-
return /* @__PURE__ */ (0,
|
|
156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "navbar-brand mb-0 h4", children });
|
|
127
157
|
}
|
|
128
158
|
|
|
159
|
+
// src/components/Icon.tsx
|
|
160
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
161
|
+
var ImageCard = ({
|
|
162
|
+
src,
|
|
163
|
+
alt
|
|
164
|
+
}) => {
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
166
|
+
"img",
|
|
167
|
+
{
|
|
168
|
+
src,
|
|
169
|
+
alt,
|
|
170
|
+
className: "w-100",
|
|
171
|
+
style: {
|
|
172
|
+
display: "block",
|
|
173
|
+
objectFit: "cover"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
|
|
129
179
|
// src/components/NpmBadge.tsx
|
|
130
|
-
var
|
|
180
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
131
181
|
function NpmBadge({ packageName, packageLabel, packageUrl, color = "black", height = 22 }) {
|
|
132
182
|
const encodedLabel = encodeURIComponent(packageLabel);
|
|
133
183
|
const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;
|
|
134
184
|
const npmUrl = packageUrl;
|
|
135
|
-
return /* @__PURE__ */ (0,
|
|
185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("a", { href: npmUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: badgeUrl, alt: `${packageName} version`, style: { height } }) });
|
|
136
186
|
}
|
|
137
187
|
|
|
138
188
|
// src/components/navigation/Navigation.tsx
|
|
139
|
-
var
|
|
189
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
140
190
|
function Navigation({ title = "Navigation", children }) {
|
|
141
|
-
return /* @__PURE__ */ (0,
|
|
142
|
-
/* @__PURE__ */ (0,
|
|
143
|
-
/* @__PURE__ */ (0,
|
|
191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("nav", { className: "col-auto p-3 h-100 d-flex flex-column", children: [
|
|
192
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h6", { className: "text-muted text-uppercase", children: title }),
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "nav nav-pills flex-column gap-2 mt-3", children })
|
|
144
194
|
] });
|
|
145
195
|
}
|
|
146
196
|
|
|
147
197
|
// src/components/navigation/NavigationItem.tsx
|
|
148
|
-
var
|
|
149
|
-
function NavigationItem({ title, type, active, onClick }) {
|
|
150
|
-
return /* @__PURE__ */ (0,
|
|
198
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
199
|
+
function NavigationItem({ icon, title, type, active, onClick }) {
|
|
200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { className: "nav-item", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
151
201
|
"button",
|
|
152
202
|
{
|
|
153
203
|
type: "button",
|
|
154
204
|
className: `nav-link text-start w-100 ${active ? "active" : ""}`,
|
|
155
205
|
onClick: () => onClick?.(type),
|
|
156
|
-
children:
|
|
206
|
+
children: [
|
|
207
|
+
icon,
|
|
208
|
+
" ",
|
|
209
|
+
title
|
|
210
|
+
]
|
|
157
211
|
}
|
|
158
212
|
) });
|
|
159
213
|
}
|
|
160
214
|
|
|
161
215
|
// src/components/notifications/Notifications.tsx
|
|
162
216
|
var import_react2 = require("react");
|
|
163
|
-
var
|
|
217
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
164
218
|
function Notifications({ notifications, onClose }) {
|
|
165
219
|
(0, import_react2.useEffect)(() => {
|
|
166
220
|
notifications.forEach((n) => {
|
|
@@ -169,19 +223,19 @@ function Notifications({ notifications, onClose }) {
|
|
|
169
223
|
return () => clearTimeout(timer);
|
|
170
224
|
});
|
|
171
225
|
}, [notifications, onClose]);
|
|
172
|
-
return /* @__PURE__ */ (0,
|
|
226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
173
227
|
"div",
|
|
174
228
|
{
|
|
175
229
|
className: "position-fixed top-0 end-0",
|
|
176
230
|
style: { zIndex: 1080, width: 340 },
|
|
177
|
-
children: notifications.map((n) => /* @__PURE__ */ (0,
|
|
231
|
+
children: notifications.map((n) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
178
232
|
"div",
|
|
179
233
|
{
|
|
180
234
|
className: `alert alert-${n.type ?? "info"} alert-dismissible fade show shadow-sm mb-2`,
|
|
181
235
|
role: "alert",
|
|
182
236
|
children: [
|
|
183
237
|
n.message,
|
|
184
|
-
/* @__PURE__ */ (0,
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
185
239
|
"button",
|
|
186
240
|
{
|
|
187
241
|
type: "button",
|
|
@@ -200,7 +254,7 @@ function Notifications({ notifications, onClose }) {
|
|
|
200
254
|
|
|
201
255
|
// src/components/notifications/NotificationsProvider.tsx
|
|
202
256
|
var import_react3 = require("react");
|
|
203
|
-
var
|
|
257
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
204
258
|
var NotificationsContext = (0, import_react3.createContext)(
|
|
205
259
|
void 0
|
|
206
260
|
);
|
|
@@ -232,20 +286,20 @@ function NotificationsProvider({ children }) {
|
|
|
232
286
|
timers.forEach((t) => t && clearTimeout(t));
|
|
233
287
|
};
|
|
234
288
|
}, [notifications, close]);
|
|
235
|
-
return /* @__PURE__ */ (0,
|
|
236
|
-
/* @__PURE__ */ (0,
|
|
289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(NotificationsContext.Provider, { value: { push }, children: [
|
|
290
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
237
291
|
"div",
|
|
238
292
|
{
|
|
239
293
|
className: "position-fixed top-0 end-0 p-3",
|
|
240
294
|
style: { zIndex: 1080, width: 340 },
|
|
241
|
-
children: notifications.map((n) => /* @__PURE__ */ (0,
|
|
295
|
+
children: notifications.map((n) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
242
296
|
"div",
|
|
243
297
|
{
|
|
244
298
|
className: `alert alert-${n.type ?? "info"} alert-dismissible fade show shadow-sm mb-2`,
|
|
245
299
|
role: "alert",
|
|
246
300
|
children: [
|
|
247
301
|
n.message,
|
|
248
|
-
/* @__PURE__ */ (0,
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
249
303
|
"button",
|
|
250
304
|
{
|
|
251
305
|
type: "button",
|
|
@@ -271,26 +325,35 @@ function UseNotifications() {
|
|
|
271
325
|
return ctx;
|
|
272
326
|
}
|
|
273
327
|
|
|
328
|
+
// src/components/views/AppsView.tsx
|
|
329
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
330
|
+
var AppsView = ({ apps, title, onAppClick }) => {
|
|
331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
332
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h5", { className: "mb-3", children: title }),
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "row", children: apps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AppTile, { app, onClick: onAppClick }, app.id)) })
|
|
334
|
+
] });
|
|
335
|
+
};
|
|
336
|
+
|
|
274
337
|
// src/components/wrappers/ContentContainer.tsx
|
|
275
|
-
var
|
|
338
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
276
339
|
function ContentContainer({ children }) {
|
|
277
|
-
return /* @__PURE__ */ (0,
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "container-fluid flex-grow-1", children });
|
|
278
341
|
}
|
|
279
342
|
|
|
280
343
|
// src/components/wrappers/ContentRow.tsx
|
|
281
|
-
var
|
|
344
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
282
345
|
function ContentRow({ children }) {
|
|
283
|
-
return /* @__PURE__ */ (0,
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "row h-100 flex-nowrap", children });
|
|
284
347
|
}
|
|
285
348
|
|
|
286
349
|
// src/components/wrappers/LayoutWrapper.tsx
|
|
287
|
-
var
|
|
350
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
288
351
|
function LayoutWrapper({ children }) {
|
|
289
|
-
return /* @__PURE__ */ (0,
|
|
352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "d-flex flex-column min-vh-100", children });
|
|
290
353
|
}
|
|
291
354
|
|
|
292
355
|
// src/modal/Modal.tsx
|
|
293
|
-
var
|
|
356
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
294
357
|
var Modal = ({
|
|
295
358
|
title,
|
|
296
359
|
isOpen,
|
|
@@ -312,8 +375,8 @@ var Modal = ({
|
|
|
312
375
|
const handleContentClick = (e) => {
|
|
313
376
|
e.stopPropagation();
|
|
314
377
|
};
|
|
315
|
-
return /* @__PURE__ */ (0,
|
|
316
|
-
/* @__PURE__ */ (0,
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
317
380
|
"div",
|
|
318
381
|
{
|
|
319
382
|
className: "modal-backdrop fade show",
|
|
@@ -321,7 +384,7 @@ var Modal = ({
|
|
|
321
384
|
onClick: handleBackdropClick
|
|
322
385
|
}
|
|
323
386
|
),
|
|
324
|
-
/* @__PURE__ */ (0,
|
|
387
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
325
388
|
"div",
|
|
326
389
|
{
|
|
327
390
|
className: "modal fade show d-block",
|
|
@@ -329,10 +392,10 @@ var Modal = ({
|
|
|
329
392
|
role: "dialog",
|
|
330
393
|
style: { zIndex: 1050 },
|
|
331
394
|
onClick: handleBackdropClick,
|
|
332
|
-
children: /* @__PURE__ */ (0,
|
|
333
|
-
/* @__PURE__ */ (0,
|
|
334
|
-
title && /* @__PURE__ */ (0,
|
|
335
|
-
showHeaderClose && /* @__PURE__ */ (0,
|
|
395
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "modal-dialog modal-dialog-centered", role: "document", onClick: handleContentClick, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "modal-content shadow", children: [
|
|
396
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "modal-header", children: [
|
|
397
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h5", { className: "modal-title", children: title }),
|
|
398
|
+
showHeaderClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
336
399
|
"button",
|
|
337
400
|
{
|
|
338
401
|
type: "button",
|
|
@@ -343,9 +406,9 @@ var Modal = ({
|
|
|
343
406
|
}
|
|
344
407
|
)
|
|
345
408
|
] }),
|
|
346
|
-
/* @__PURE__ */ (0,
|
|
347
|
-
/* @__PURE__ */ (0,
|
|
348
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
409
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "modal-body", children }),
|
|
410
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "modal-footer", children: [
|
|
411
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
349
412
|
"button",
|
|
350
413
|
{
|
|
351
414
|
type: "button",
|
|
@@ -355,7 +418,7 @@ var Modal = ({
|
|
|
355
418
|
children: "Close"
|
|
356
419
|
}
|
|
357
420
|
),
|
|
358
|
-
onConfirm && showConfirmButton && /* @__PURE__ */ (0,
|
|
421
|
+
onConfirm && showConfirmButton && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
359
422
|
"button",
|
|
360
423
|
{
|
|
361
424
|
type: "button",
|
|
@@ -374,7 +437,7 @@ var Modal = ({
|
|
|
374
437
|
|
|
375
438
|
// src/modal/ModalProvider.tsx
|
|
376
439
|
var import_react4 = require("react");
|
|
377
|
-
var
|
|
440
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
378
441
|
var ModalContext = (0, import_react4.createContext)(void 0);
|
|
379
442
|
function ModalProvider({ children }) {
|
|
380
443
|
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
@@ -388,9 +451,9 @@ function ModalProvider({ children }) {
|
|
|
388
451
|
const closeModal = (0, import_react4.useCallback)(() => {
|
|
389
452
|
setIsOpen(false);
|
|
390
453
|
}, []);
|
|
391
|
-
return /* @__PURE__ */ (0,
|
|
454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ModalContext.Provider, { value: { openModal, closeModal }, children: [
|
|
392
455
|
children,
|
|
393
|
-
/* @__PURE__ */ (0,
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
394
457
|
Modal,
|
|
395
458
|
{
|
|
396
459
|
isOpen,
|
|
@@ -415,6 +478,8 @@ function UseModal() {
|
|
|
415
478
|
}
|
|
416
479
|
// Annotate the CommonJS export names for ESM import in node:
|
|
417
480
|
0 && (module.exports = {
|
|
481
|
+
AppTile,
|
|
482
|
+
AppsView,
|
|
418
483
|
Body,
|
|
419
484
|
Button,
|
|
420
485
|
ContentContainer,
|
|
@@ -422,6 +487,7 @@ function UseModal() {
|
|
|
422
487
|
Footer,
|
|
423
488
|
Header,
|
|
424
489
|
HeaderText,
|
|
490
|
+
ImageCard,
|
|
425
491
|
LayoutWrapper,
|
|
426
492
|
Modal,
|
|
427
493
|
ModalProvider,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/components/Body.tsx","../src/components/Button.tsx","../src/components/Footer.tsx","../src/components/Header.tsx","../src/components/HeaderText.tsx","../src/components/NpmBadge.tsx","../src/components/navigation/Navigation.tsx","../src/components/navigation/NavigationItem.tsx","../src/components/notifications/Notifications.tsx","../src/components/notifications/NotificationsProvider.tsx","../src/components/wrappers/ContentContainer.tsx","../src/components/wrappers/ContentRow.tsx","../src/components/wrappers/LayoutWrapper.tsx","../src/modal/Modal.tsx","../src/modal/ModalProvider.tsx"],"sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/Body\";\nexport * from \"./components/Button\";\nexport * from \"./components/Footer\";\nexport * from \"./components/Header\";\nexport * from \"./components/HeaderText\";\nexport * from \"./components/NpmBadge\";\nexport * from \"./components/navigation/Navigation\";\nexport * from \"./components/navigation/NavigationItem\";\nexport * from \"./components/notifications/Notifications\";\nexport * from \"./components/notifications/NotificationsProvider\";\nexport * from \"./components/wrappers/ContentContainer\";\nexport * from \"./components/wrappers/ContentRow\";\nexport * from \"./components/wrappers/LayoutWrapper\";\nexport * from \"./modal/Modal\";\nexport * from \"./modal/ModalProvider\";\n","import type { ReactNode } from \"react\";\r\n\r\ninterface BodyProps {\r\n title: ReactNode;\r\n description?: ReactNode;\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Body({ title, description, children }: BodyProps) {\r\n return (\r\n\r\n <main className=\"col p-4\">\r\n <h2>{title}</h2>\r\n\r\n {description && <p>{description}</p>}\r\n {children}\r\n </main>\r\n );\r\n}\r\n","import { useState, type ReactNode, type MouseEvent } from \"react\";\r\n\r\nexport interface ButtonProps {\r\n buttonClassName?: string;\r\n type?: \"button\" | \"submit\" | \"reset\";\r\n disabled?: boolean;\r\n\r\n onAction?: () => Promise<unknown>;\r\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\r\n onDone?: (result: unknown) => void;\r\n onError?: (error: unknown) => void;\r\n onFinally?: () => void;\r\n\r\n children?: ReactNode;\r\n loadingChildren?: ReactNode;\r\n\r\n renderContent?: () => ReactNode;\r\n renderLoading?: () => ReactNode;\r\n\r\n loadingText?: string;\r\n showSpinner?: boolean;\r\n}\r\n\r\nexport function Button({\r\n buttonClassName = \"btn btn-primary btn-lg\",\r\n type = \"button\",\r\n disabled = false,\r\n\r\n onAction,\r\n onClick,\r\n onDone,\r\n onError,\r\n onFinally,\r\n\r\n children = \"Click me\",\r\n\r\n loadingChildren,\r\n renderContent,\r\n renderLoading,\r\n\r\n loadingText = \"Loading...\",\r\n showSpinner = true,\r\n}: ButtonProps) {\r\n const [loading, setLoading] = useState(false);\r\n\r\n const handleClick = async (event: MouseEvent<HTMLButtonElement>) => {\r\n if (loading) return;\r\n\r\n onClick?.(event);\r\n if (event.defaultPrevented) return;\r\n if (!onAction) return;\r\n\r\n try {\r\n setLoading(true);\r\n const result = await onAction();\r\n onDone?.(result);\r\n } catch (error) {\r\n onError?.(error);\r\n } finally {\r\n setLoading(false);\r\n onFinally?.();\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n type={type}\r\n className={`${buttonClassName} ${loading ? \"async-btn--loading\" : \"\"}`}\r\n onClick={handleClick}\r\n disabled={disabled || loading}\r\n >\r\n {loading ? (\r\n renderLoading?.() ??\r\n loadingChildren ?? (\r\n <>\r\n {showSpinner && (\r\n <span\r\n className=\"spinner-border spinner-border-sm me-2 async-btn__spinner\"\r\n role=\"status\"\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n {loadingText}\r\n </>\r\n )\r\n ) : (\r\n renderContent?.() ?? children\r\n )}\r\n </button>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface FooterProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Footer({ children }: FooterProps) {\r\n return (\r\n <footer className=\"bg-dark text-white text-center py-2 mt-auto\">\r\n {children ?? \"© 2025 Your Site — All rights reserved\"}\r\n </footer>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Header({ children }: HeaderProps) {\r\n return (\r\n <nav className=\"navbar navbar-dark bg-dark px-3 sticky-top\">\r\n {children ?? (\r\n <span className=\"navbar-brand mb-0 h4\">My Website</span>\r\n )}\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderBrandProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function HeaderText({ children }: HeaderBrandProps) {\r\n return (\r\n <span className=\"navbar-brand mb-0 h4\">\r\n {children}\r\n </span>\r\n );\r\n}\r\n","// components/NpmBadge.tsx\r\ninterface NpmBadgeProps {\r\n packageLabel: string;\r\n packageName: string;\r\n packageUrl: string; // e.g. \"@sparkstudio/authentication-ui\"\r\n color?: string; // optional (default black)\r\n height?: number; // optional (default 22)\r\n}\r\n\r\nexport function NpmBadge({ packageName, packageLabel, packageUrl, color = \"black\", height = 22 }: NpmBadgeProps) {\r\n const encodedLabel = encodeURIComponent(packageLabel);\r\n const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;\r\n const npmUrl = packageUrl;\r\n\r\n return (\r\n <a href={npmUrl} target=\"_blank\" rel=\"noopener noreferrer\">\r\n <img src={badgeUrl} alt={`${packageName} version`} style={{ height }} />\r\n </a>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationProps {\r\n title?: ReactNode;\r\n children: ReactNode;\r\n}\r\n\r\nexport function Navigation({ title = \"Navigation\", children }: NavigationProps) {\r\n return (\r\n <nav className=\"col-auto p-3 h-100 d-flex flex-column\">\r\n <h6 className=\"text-muted text-uppercase\">{title}</h6>\r\n\r\n <ul className=\"nav nav-pills flex-column gap-2 mt-3\">\r\n {children}\r\n </ul>\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationItemProps {\r\n title: ReactNode;\r\n type: string;\r\n active?: boolean;\r\n onClick?: (type: string) => void;\r\n}\r\n\r\nexport function NavigationItem({ title, type, active, onClick }: NavigationItemProps) {\r\n return (\r\n <li className=\"nav-item\">\r\n <button\r\n type=\"button\"\r\n className={`nav-link text-start w-100 ${active ? \"active\" : \"\"}`}\r\n onClick={() => onClick?.(type)}\r\n >\r\n {title}\r\n </button>\r\n </li>\r\n );\r\n}\r\n","import { useEffect } from \"react\";\r\n\r\nexport type NotificationType = \"success\" | \"info\" | \"warning\" | \"danger\";\r\n\r\nexport interface Notification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsProps {\r\n notifications: Notification[];\r\n onClose: (id: string) => void;\r\n}\r\n\r\nexport function Notifications({ notifications, onClose }: NotificationsProps) {\r\n useEffect(() => {\r\n notifications.forEach((n) => {\r\n if (!n.autoCloseMs) return;\r\n\r\n const timer = setTimeout(() => onClose(n.id), n.autoCloseMs);\r\n return () => clearTimeout(timer);\r\n });\r\n }, [notifications, onClose]);\r\n\r\n return (\r\n <div\r\n className=\"position-fixed top-0 end-0\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => onClose(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n}\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport type { NotificationType } from \"./Notifications\";\r\n\r\n// Rename to avoid conflict with browser Notification type\r\nexport interface AppNotification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsContextValue {\r\n push: (message: string, type?: NotificationType, autoCloseMs?: number) => void;\r\n}\r\n\r\nconst NotificationsContext = createContext<NotificationsContextValue | undefined>(\r\n undefined\r\n);\r\n\r\ninterface NotificationsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function NotificationsProvider({ children }: NotificationsProviderProps) {\r\n const [notifications, setNotifications] = useState<AppNotification[]>([]);\r\n\r\n const push = useCallback(\r\n (message: string, type: NotificationType = \"info\", autoCloseMs = 4000) => {\r\n setNotifications((prev) => [\r\n ...prev,\r\n {\r\n id: crypto.randomUUID(),\r\n message,\r\n type,\r\n autoCloseMs,\r\n },\r\n ]);\r\n },\r\n []\r\n );\r\n\r\n const close = useCallback((id: string) => {\r\n setNotifications((list) => list.filter((n) => n.id !== id));\r\n }, []);\r\n\r\n // Handle auto close timers\r\n useEffect(() => {\r\n const timers = notifications.map((n) => {\r\n if (!n.autoCloseMs) return null;\r\n return setTimeout(() => close(n.id), n.autoCloseMs);\r\n });\r\n\r\n return () => {\r\n timers.forEach((t) => t && clearTimeout(t));\r\n };\r\n }, [notifications, close]);\r\n\r\n return (\r\n <NotificationsContext.Provider value={{ push }}>\r\n {/* overlay renderer */}\r\n <div\r\n className=\"position-fixed top-0 end-0 p-3\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => close(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n\r\n {children}\r\n </NotificationsContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseNotifications(): NotificationsContextValue {\r\n const ctx = useContext(NotificationsContext);\r\n if (!ctx) {\r\n throw new Error(\"useNotifications must be used within a NotificationsProvider\");\r\n }\r\n return ctx;\r\n}\r\n","export function ContentContainer({ children }: React.PropsWithChildren) {\r\n return <div className=\"container-fluid flex-grow-1\">{children}</div>;\r\n}\r\n","export function ContentRow({ children }: React.PropsWithChildren) {\r\n return <div className=\"row h-100 flex-nowrap\">{children}</div>;\r\n}\r\n","\r\nexport function LayoutWrapper({ children }: React.PropsWithChildren) {\r\n return (\r\n\r\n <div className=\"d-flex flex-column min-vh-100\">{children}</div>\r\n );\r\n}\r\n","// components/Modal.tsx\r\nimport React from \"react\";\r\n\r\nexport interface ModalProps {\r\n title?: string;\r\n isOpen: boolean;\r\n onClose: () => void;\r\n onConfirm?: () => void;\r\n confirmText?: string;\r\n\r\n disableBackdropClose?: boolean;\r\n disableAllButtons?: boolean;\r\n\r\n /** NEW: toggle visibility */\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport const Modal: React.FC<ModalProps> = ({\r\n title,\r\n isOpen,\r\n onClose,\r\n onConfirm,\r\n confirmText = \"OK\",\r\n\r\n disableBackdropClose = false,\r\n disableAllButtons = false,\r\n\r\n showHeaderClose = true,\r\n showCloseButton = true,\r\n showConfirmButton = true,\r\n\r\n children,\r\n}) => {\r\n if (!isOpen) return null;\r\n\r\n const handleBackdropClick = () => {\r\n if (disableBackdropClose || disableAllButtons) return;\r\n onClose();\r\n };\r\n\r\n const handleContentClick: React.MouseEventHandler<HTMLDivElement> = (e) => {\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className=\"modal-backdrop fade show\"\r\n style={{ zIndex: 1040 }}\r\n onClick={handleBackdropClick}\r\n />\r\n\r\n <div\r\n className=\"modal fade show d-block\"\r\n tabIndex={-1}\r\n role=\"dialog\"\r\n style={{ zIndex: 1050 }}\r\n onClick={handleBackdropClick}\r\n >\r\n <div className=\"modal-dialog modal-dialog-centered\" role=\"document\" onClick={handleContentClick}>\r\n <div className=\"modal-content shadow\">\r\n {/* Header */}\r\n <div className=\"modal-header\">\r\n {title && <h5 className=\"modal-title\">{title}</h5>}\r\n\r\n {showHeaderClose && (\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n />\r\n )}\r\n </div>\r\n\r\n {/* Body */}\r\n <div className=\"modal-body\">{children}</div>\r\n\r\n {/* Footer */}\r\n <div className=\"modal-footer\">\r\n {showCloseButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-secondary\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n >\r\n Close\r\n </button>\r\n )}\r\n\r\n {onConfirm && showConfirmButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-primary\"\r\n onClick={onConfirm}\r\n disabled={disableAllButtons}\r\n >\r\n {confirmText}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { Modal } from \"./Modal\";\r\n\r\nexport interface ModalOptions {\r\n title?: string;\r\n confirmText?: string;\r\n disableBackdropClose?: boolean;\r\n onConfirm?: () => void;\r\n\r\n /** extra control flags matching Modal.tsx */\r\n disableAllButtons?: boolean;\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n}\r\n\r\ninterface ModalContextValue {\r\n openModal: (content: ReactNode, options?: ModalOptions) => void;\r\n closeModal: () => void;\r\n}\r\n\r\nconst ModalContext = createContext<ModalContextValue | undefined>(undefined);\r\n\r\nexport function ModalProvider({ children }: { children: ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [content, setContent] = useState<ReactNode>(null);\r\n const [options, setOptions] = useState<ModalOptions>({});\r\n\r\n const openModal = useCallback((content: ReactNode, options?: ModalOptions) => {\r\n setContent(content);\r\n setOptions(options ?? {});\r\n setIsOpen(true);\r\n }, []);\r\n\r\n const closeModal = useCallback(() => {\r\n setIsOpen(false);\r\n }, []);\r\n\r\n return (\r\n <ModalContext.Provider value={{ openModal, closeModal }}>\r\n {children}\r\n\r\n <Modal\r\n isOpen={isOpen}\r\n title={options.title}\r\n confirmText={options.confirmText}\r\n disableBackdropClose={options.disableBackdropClose}\r\n disableAllButtons={options.disableAllButtons}\r\n showHeaderClose={options.showHeaderClose}\r\n showCloseButton={options.showCloseButton}\r\n showConfirmButton={options.showConfirmButton}\r\n onClose={closeModal}\r\n onConfirm={options.onConfirm}\r\n >\r\n {content}\r\n </Modal>\r\n </ModalContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseModal() {\r\n const ctx = useContext(ModalContext);\r\n if (!ctx) throw new Error(\"UseModal must be used within ModalProvider\");\r\n return ctx;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACWM;AAHC,SAAS,KAAK,EAAE,OAAO,aAAa,SAAS,GAAc;AAChE,SAEI,6CAAC,UAAK,WAAU,WACd;AAAA,gDAAC,QAAI,iBAAM;AAAA,IAEV,eAAe,4CAAC,OAAG,uBAAY;AAAA,IAC/B;AAAA,KACH;AAEN;;;AClBA,mBAA0D;AA0EhD,IAAAA,sBAAA;AAnDH,SAAS,OAAO;AAAA,EACrB,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,WAAW;AAAA,EAEX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,WAAW;AAAA,EAEX;AAAA,EACA;AAAA,EACA;AAAA,EAEA,cAAc;AAAA,EACd,cA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SAAS,cAAc,EAAE,SAAS,GAA4B;AACnE,QAAM,CAAC,QAAQ,SAAS,QAAI,wBAAS,KAAK;AAC1C,QAAM,CAAC,SAAS,UAAU,QAAI,wBAAoB,IAAI;AACtD,QAAM,CAAC,SAAS,UAAU,QAAI,wBAAuB,CAAC,CAAC;AAEvD,QAAM,gBAAY,2BAAY,CAACC,UAAoBC,aAA2B;AAC5E,eAAWD,QAAO;AAClB,eAAWC,YAAW,CAAC,CAAC;AACxB,cAAU,IAAI;AAAA,EAChB,GAAG,CAAC,CAAC;AAEL,QAAM,iBAAa,2BAAY,MAAM;AACnC,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SACE,+CAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,WAAW,WAAW,GACnD;AAAA;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,QAAQ;AAAA,QACf,aAAa,QAAQ;AAAA,QACrB,sBAAsB,QAAQ;AAAA,QAC9B,mBAAmB,QAAQ;AAAA,QAC3B,iBAAiB,QAAQ;AAAA,QACzB,iBAAiB,QAAQ;AAAA,QACzB,mBAAmB,QAAQ;AAAA,QAC3B,SAAS;AAAA,QACT,WAAW,QAAQ;AAAA,QAElB;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEO,SAAS,WAAW;AACzB,QAAM,UAAM,0BAAW,YAAY;AACnC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","content","options"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/AppTile.tsx","../src/components/Body.tsx","../src/components/Button.tsx","../src/components/Footer.tsx","../src/components/Header.tsx","../src/components/HeaderText.tsx","../src/components/Icon.tsx","../src/components/NpmBadge.tsx","../src/components/navigation/Navigation.tsx","../src/components/navigation/NavigationItem.tsx","../src/components/notifications/Notifications.tsx","../src/components/notifications/NotificationsProvider.tsx","../src/components/views/AppsView.tsx","../src/components/wrappers/ContentContainer.tsx","../src/components/wrappers/ContentRow.tsx","../src/components/wrappers/LayoutWrapper.tsx","../src/modal/Modal.tsx","../src/modal/ModalProvider.tsx"],"sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/AppTile\";\nexport * from \"./components/Body\";\nexport * from \"./components/Button\";\nexport * from \"./components/Footer\";\nexport * from \"./components/Header\";\nexport * from \"./components/HeaderText\";\nexport * from \"./components/Icon\";\nexport * from \"./components/NpmBadge\";\nexport * from \"./components/navigation/Navigation\";\nexport * from \"./components/navigation/NavigationItem\";\nexport * from \"./components/notifications/Notifications\";\nexport * from \"./components/notifications/NotificationsProvider\";\nexport * from \"./components/views/AppsView\";\nexport * from \"./components/wrappers/ContentContainer\";\nexport * from \"./components/wrappers/ContentRow\";\nexport * from \"./components/wrappers/LayoutWrapper\";\nexport * from \"./modal/Modal\";\nexport * from \"./modal/ModalProvider\";\nexport * from \"./models/AppItem\";\n","import React from \"react\";\r\nimport type { AppItem } from \"../models/AppItem\";\r\n\r\ninterface AppTileProps {\r\n app: AppItem;\r\n onClick?: (app: AppItem) => void;\r\n}\r\n\r\nexport const AppTile: React.FC<AppTileProps> = ({ app, onClick }) => {\r\n return (\r\n <div className=\"col-auto\">\r\n <button\r\n type=\"button\"\r\n className=\"btn p-2 d-flex flex-column align-items-center border-0 bg-transparent app-icon-btn\"\r\n onClick={() => onClick?.(app)}\r\n >\r\n <div className=\"app-icon-tile d-flex align-items-center justify-content-center mb-1\">\r\n <span style={{fontSize:\"32px\"}}>{app.icon}</span>\r\n </div>\r\n\r\n <span className=\"w-100 small text-truncate\">\r\n {app.name}\r\n {app.version && <small className=\"text-muted ms-1\">v{app.version}</small>}\r\n </span>\r\n </button>\r\n </div>\r\n );\r\n};\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface BodyProps {\r\n icon: ReactNode;\r\n title: ReactNode;\r\n description?: ReactNode;\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Body({ icon, title, description, children }: BodyProps) {\r\n return (\r\n\r\n <main className=\"col p-4\">\r\n <h2>{icon} {title}</h2>\r\n\r\n {description && <p>{description}</p>}\r\n {children}\r\n </main>\r\n );\r\n}\r\n","import { useState, type ReactNode, type MouseEvent } from \"react\";\r\n\r\nexport interface ButtonProps {\r\n buttonClassName?: string;\r\n type?: \"button\" | \"submit\" | \"reset\";\r\n disabled?: boolean;\r\n\r\n onAction?: () => Promise<unknown>;\r\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\r\n onDone?: (result: unknown) => void;\r\n onError?: (error: unknown) => void;\r\n onFinally?: () => void;\r\n\r\n children?: ReactNode;\r\n loadingChildren?: ReactNode;\r\n\r\n renderContent?: () => ReactNode;\r\n renderLoading?: () => ReactNode;\r\n\r\n loadingText?: string;\r\n showSpinner?: boolean;\r\n}\r\n\r\nexport function Button({\r\n buttonClassName = \"btn btn-primary btn-lg\",\r\n type = \"button\",\r\n disabled = false,\r\n\r\n onAction,\r\n onClick,\r\n onDone,\r\n onError,\r\n onFinally,\r\n\r\n children = \"Click me\",\r\n\r\n loadingChildren,\r\n renderContent,\r\n renderLoading,\r\n\r\n loadingText = \"Loading...\",\r\n showSpinner = true,\r\n}: ButtonProps) {\r\n const [loading, setLoading] = useState(false);\r\n\r\n const handleClick = async (event: MouseEvent<HTMLButtonElement>) => {\r\n if (loading) return;\r\n\r\n onClick?.(event);\r\n if (event.defaultPrevented) return;\r\n if (!onAction) return;\r\n\r\n try {\r\n setLoading(true);\r\n const result = await onAction();\r\n onDone?.(result);\r\n } catch (error) {\r\n onError?.(error);\r\n } finally {\r\n setLoading(false);\r\n onFinally?.();\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n type={type}\r\n className={`${buttonClassName} ${loading ? \"async-btn--loading\" : \"\"}`}\r\n onClick={handleClick}\r\n disabled={disabled || loading}\r\n >\r\n {loading ? (\r\n renderLoading?.() ??\r\n loadingChildren ?? (\r\n <>\r\n {showSpinner && (\r\n <span\r\n className=\"spinner-border spinner-border-sm me-2 async-btn__spinner\"\r\n role=\"status\"\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n {loadingText}\r\n </>\r\n )\r\n ) : (\r\n renderContent?.() ?? children\r\n )}\r\n </button>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface FooterProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Footer({ children }: FooterProps) {\r\n return (\r\n <footer className=\"bg-dark text-white text-center py-2 mt-auto\">\r\n {children ?? \"© 2025 Your Site — All rights reserved\"}\r\n </footer>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Header({ children }: HeaderProps) {\r\n return (\r\n <nav className=\"navbar navbar-dark bg-dark px-3 sticky-top\">\r\n {children ?? (\r\n <span className=\"navbar-brand mb-0 h4\">My Website</span>\r\n )}\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderBrandProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function HeaderText({ children }: HeaderBrandProps) {\r\n return (\r\n <span className=\"navbar-brand mb-0 h4\">\r\n {children}\r\n </span>\r\n );\r\n}\r\n","// ImageCard.tsx\r\nimport React from \"react\";\r\n\r\ninterface ImageCardProps {\r\n src: string;\r\n alt: string;\r\n width?: string | number;\r\n height?: string | number;\r\n}\r\n\r\nexport const ImageCard: React.FC<ImageCardProps> = ({\r\n src,\r\n alt,\r\n}) => {\r\n return (\r\n <img\r\n src={src}\r\n alt={alt}\r\n className={\"w-100\"}\r\n style={{\r\n display: \"block\",\r\n objectFit: \"cover\",\r\n }}\r\n />\r\n );\r\n};\r\n","// components/NpmBadge.tsx\r\ninterface NpmBadgeProps {\r\n packageLabel: string;\r\n packageName: string;\r\n packageUrl: string; // e.g. \"@sparkstudio/authentication-ui\"\r\n color?: string; // optional (default black)\r\n height?: number; // optional (default 22)\r\n}\r\n\r\nexport function NpmBadge({ packageName, packageLabel, packageUrl, color = \"black\", height = 22 }: NpmBadgeProps) {\r\n const encodedLabel = encodeURIComponent(packageLabel);\r\n const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;\r\n const npmUrl = packageUrl;\r\n\r\n return (\r\n <a href={npmUrl} target=\"_blank\" rel=\"noopener noreferrer\">\r\n <img src={badgeUrl} alt={`${packageName} version`} style={{ height }} />\r\n </a>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationProps {\r\n title?: ReactNode;\r\n children: ReactNode;\r\n}\r\n\r\nexport function Navigation({ title = \"Navigation\", children }: NavigationProps) {\r\n return (\r\n <nav className=\"col-auto p-3 h-100 d-flex flex-column\">\r\n <h6 className=\"text-muted text-uppercase\">{title}</h6>\r\n\r\n <ul className=\"nav nav-pills flex-column gap-2 mt-3\">\r\n {children}\r\n </ul>\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationItemProps {\r\n icon: ReactNode;\r\n title: ReactNode;\r\n type: string;\r\n active?: boolean;\r\n onClick?: (type: string) => void;\r\n}\r\n\r\nexport function NavigationItem({icon, title, type, active, onClick }: NavigationItemProps) {\r\n return (\r\n <li className=\"nav-item\">\r\n <button\r\n type=\"button\"\r\n className={`nav-link text-start w-100 ${active ? \"active\" : \"\"}`}\r\n onClick={() => onClick?.(type)}\r\n >\r\n {icon} {title}\r\n </button>\r\n </li>\r\n );\r\n}\r\n","import { useEffect } from \"react\";\r\n\r\nexport type NotificationType = \"success\" | \"info\" | \"warning\" | \"danger\";\r\n\r\nexport interface Notification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsProps {\r\n notifications: Notification[];\r\n onClose: (id: string) => void;\r\n}\r\n\r\nexport function Notifications({ notifications, onClose }: NotificationsProps) {\r\n useEffect(() => {\r\n notifications.forEach((n) => {\r\n if (!n.autoCloseMs) return;\r\n\r\n const timer = setTimeout(() => onClose(n.id), n.autoCloseMs);\r\n return () => clearTimeout(timer);\r\n });\r\n }, [notifications, onClose]);\r\n\r\n return (\r\n <div\r\n className=\"position-fixed top-0 end-0\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => onClose(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n}\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport type { NotificationType } from \"./Notifications\";\r\n\r\n// Rename to avoid conflict with browser Notification type\r\nexport interface AppNotification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsContextValue {\r\n push: (message: string, type?: NotificationType, autoCloseMs?: number) => void;\r\n}\r\n\r\nconst NotificationsContext = createContext<NotificationsContextValue | undefined>(\r\n undefined\r\n);\r\n\r\ninterface NotificationsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function NotificationsProvider({ children }: NotificationsProviderProps) {\r\n const [notifications, setNotifications] = useState<AppNotification[]>([]);\r\n\r\n const push = useCallback(\r\n (message: string, type: NotificationType = \"info\", autoCloseMs = 4000) => {\r\n setNotifications((prev) => [\r\n ...prev,\r\n {\r\n id: crypto.randomUUID(),\r\n message,\r\n type,\r\n autoCloseMs,\r\n },\r\n ]);\r\n },\r\n []\r\n );\r\n\r\n const close = useCallback((id: string) => {\r\n setNotifications((list) => list.filter((n) => n.id !== id));\r\n }, []);\r\n\r\n // Handle auto close timers\r\n useEffect(() => {\r\n const timers = notifications.map((n) => {\r\n if (!n.autoCloseMs) return null;\r\n return setTimeout(() => close(n.id), n.autoCloseMs);\r\n });\r\n\r\n return () => {\r\n timers.forEach((t) => t && clearTimeout(t));\r\n };\r\n }, [notifications, close]);\r\n\r\n return (\r\n <NotificationsContext.Provider value={{ push }}>\r\n {/* overlay renderer */}\r\n <div\r\n className=\"position-fixed top-0 end-0 p-3\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => close(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n\r\n {children}\r\n </NotificationsContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseNotifications(): NotificationsContextValue {\r\n const ctx = useContext(NotificationsContext);\r\n if (!ctx) {\r\n throw new Error(\"useNotifications must be used within a NotificationsProvider\");\r\n }\r\n return ctx;\r\n}\r\n","// ./views/AppsView.tsx (or ./components/AppsView.tsx)\r\nimport React from \"react\";\r\nimport type { AppItem } from \"../../models/AppItem\";\r\nimport { AppTile } from \"../AppTile\";\r\n\r\ninterface AppsViewProps {\r\n apps: AppItem[];\r\n title?: string;\r\n onAppClick?: (app: AppItem) => void;\r\n}\r\n\r\nexport const AppsView: React.FC<AppsViewProps> = ({ apps, title, onAppClick }) => {\r\n return (\r\n <>\r\n {title && <h5 className=\"mb-3\">{title}</h5>}\r\n\r\n <div className=\"row\">\r\n {apps.map((app) => (\r\n <AppTile key={app.id} app={app} onClick={onAppClick} />\r\n ))}\r\n </div>\r\n </>\r\n );\r\n};\r\n","export function ContentContainer({ children }: React.PropsWithChildren) {\r\n return <div className=\"container-fluid flex-grow-1\">{children}</div>;\r\n}\r\n","export function ContentRow({ children }: React.PropsWithChildren) {\r\n return <div className=\"row h-100 flex-nowrap\">{children}</div>;\r\n}\r\n","\r\nexport function LayoutWrapper({ children }: React.PropsWithChildren) {\r\n return (\r\n\r\n <div className=\"d-flex flex-column min-vh-100\">{children}</div>\r\n );\r\n}\r\n","// components/Modal.tsx\r\nimport React from \"react\";\r\n\r\nexport interface ModalProps {\r\n title?: string;\r\n isOpen: boolean;\r\n onClose: () => void;\r\n onConfirm?: () => void;\r\n confirmText?: string;\r\n\r\n disableBackdropClose?: boolean;\r\n disableAllButtons?: boolean;\r\n\r\n /** NEW: toggle visibility */\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport const Modal: React.FC<ModalProps> = ({\r\n title,\r\n isOpen,\r\n onClose,\r\n onConfirm,\r\n confirmText = \"OK\",\r\n\r\n disableBackdropClose = false,\r\n disableAllButtons = false,\r\n\r\n showHeaderClose = true,\r\n showCloseButton = true,\r\n showConfirmButton = true,\r\n\r\n children,\r\n}) => {\r\n if (!isOpen) return null;\r\n\r\n const handleBackdropClick = () => {\r\n if (disableBackdropClose || disableAllButtons) return;\r\n onClose();\r\n };\r\n\r\n const handleContentClick: React.MouseEventHandler<HTMLDivElement> = (e) => {\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className=\"modal-backdrop fade show\"\r\n style={{ zIndex: 1040 }}\r\n onClick={handleBackdropClick}\r\n />\r\n\r\n <div\r\n className=\"modal fade show d-block\"\r\n tabIndex={-1}\r\n role=\"dialog\"\r\n style={{ zIndex: 1050 }}\r\n onClick={handleBackdropClick}\r\n >\r\n <div className=\"modal-dialog modal-dialog-centered\" role=\"document\" onClick={handleContentClick}>\r\n <div className=\"modal-content shadow\">\r\n {/* Header */}\r\n <div className=\"modal-header\">\r\n {title && <h5 className=\"modal-title\">{title}</h5>}\r\n\r\n {showHeaderClose && (\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n />\r\n )}\r\n </div>\r\n\r\n {/* Body */}\r\n <div className=\"modal-body\">{children}</div>\r\n\r\n {/* Footer */}\r\n <div className=\"modal-footer\">\r\n {showCloseButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-secondary\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n >\r\n Close\r\n </button>\r\n )}\r\n\r\n {onConfirm && showConfirmButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-primary\"\r\n onClick={onConfirm}\r\n disabled={disableAllButtons}\r\n >\r\n {confirmText}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { Modal } from \"./Modal\";\r\n\r\nexport interface ModalOptions {\r\n title?: string;\r\n confirmText?: string;\r\n disableBackdropClose?: boolean;\r\n onConfirm?: () => void;\r\n\r\n /** extra control flags matching Modal.tsx */\r\n disableAllButtons?: boolean;\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n}\r\n\r\ninterface ModalContextValue {\r\n openModal: (content: ReactNode, options?: ModalOptions) => void;\r\n closeModal: () => void;\r\n}\r\n\r\nconst ModalContext = createContext<ModalContextValue | undefined>(undefined);\r\n\r\nexport function ModalProvider({ children }: { children: ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [content, setContent] = useState<ReactNode>(null);\r\n const [options, setOptions] = useState<ModalOptions>({});\r\n\r\n const openModal = useCallback((content: ReactNode, options?: ModalOptions) => {\r\n setContent(content);\r\n setOptions(options ?? {});\r\n setIsOpen(true);\r\n }, []);\r\n\r\n const closeModal = useCallback(() => {\r\n setIsOpen(false);\r\n }, []);\r\n\r\n return (\r\n <ModalContext.Provider value={{ openModal, closeModal }}>\r\n {children}\r\n\r\n <Modal\r\n isOpen={isOpen}\r\n title={options.title}\r\n confirmText={options.confirmText}\r\n disableBackdropClose={options.disableBackdropClose}\r\n disableAllButtons={options.disableAllButtons}\r\n showHeaderClose={options.showHeaderClose}\r\n showCloseButton={options.showCloseButton}\r\n showConfirmButton={options.showConfirmButton}\r\n onClose={closeModal}\r\n onConfirm={options.onConfirm}\r\n >\r\n {content}\r\n </Modal>\r\n </ModalContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseModal() {\r\n const ctx = useContext(ModalContext);\r\n if (!ctx) throw new Error(\"UseModal must be used within ModalProvider\");\r\n return ctx;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBU;AATH,IAAM,UAAkC,CAAC,EAAE,KAAK,QAAQ,MAAM;AACnE,SACE,4CAAC,SAAI,WAAU,YACb;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAAS,MAAM,UAAU,GAAG;AAAA,MAE5B;AAAA,oDAAC,SAAI,WAAU,uEACb,sDAAC,UAAK,OAAO,EAAC,UAAS,OAAM,GAAI,cAAI,MAAK,GAC5C;AAAA,QAEA,6CAAC,UAAK,WAAU,6BACb;AAAA,cAAI;AAAA,UACJ,IAAI,WAAW,6CAAC,WAAM,WAAU,mBAAkB;AAAA;AAAA,YAAE,IAAI;AAAA,aAAQ;AAAA,WACnE;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;;;ACdQ,IAAAA,sBAAA;AAJD,SAAS,KAAK,EAAE,MAAM,OAAO,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B;AAC5E,eAAWD,QAAO;AAClB,eAAWC,YAAW,CAAC,CAAC;AACxB,cAAU,IAAI;AAAA,EAChB,GAAG,CAAC,CAAC;AAEL,QAAM,iBAAa,2BAAY,MAAM;AACnC,cAAU,KAAK;AAAA,EACjB,GAAG,CAAC,CAAC;AAEL,SACE,+CAAC,aAAa,UAAb,EAAsB,OAAO,EAAE,WAAW,WAAW,GACnD;AAAA;AAAA,IAED;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,OAAO,QAAQ;AAAA,QACf,aAAa,QAAQ;AAAA,QACrB,sBAAsB,QAAQ;AAAA,QAC9B,mBAAmB,QAAQ;AAAA,QAC3B,iBAAiB,QAAQ;AAAA,QACzB,iBAAiB,QAAQ;AAAA,QACzB,mBAAmB,QAAQ;AAAA,QAC3B,SAAS;AAAA,QACT,WAAW,QAAQ;AAAA,QAElB;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEO,SAAS,WAAW;AACzB,QAAM,UAAM,0BAAW,YAAY;AACnC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","content","options"]}
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
@import "/node_modules/bootstrap/dist/css/bootstrap.css";
|
|
2
|
+
.apps-view {
|
|
3
|
+
/* Optional: desktop-style background handled by your main layout */
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.app-icon-btn {
|
|
7
|
+
outline: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.app-icon-btn:focus {
|
|
11
|
+
outline: none;
|
|
12
|
+
box-shadow: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.app-icon-tile {
|
|
16
|
+
width: 64px;
|
|
17
|
+
height: 64px;
|
|
18
|
+
border-radius: 0.5rem;
|
|
19
|
+
background-color: rgba(255, 255, 255, 0.12);
|
|
20
|
+
transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.app-icon-btn:hover .app-icon-tile {
|
|
24
|
+
transform: translateY(-2px);
|
|
25
|
+
background-color: rgba(255, 255, 255, 0.18);
|
|
26
|
+
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.4);
|
|
27
|
+
}
|
|
2
28
|
|
|
3
29
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/index.scss"],"names":[],"mappings":"AAAQ","file":"index.css"}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/index.scss"],"names":[],"mappings":"AAAQ;AAGR;AACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAIF;EACE;EACA;EACA","file":"index.css"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
import React$1, { JSX, ReactNode, MouseEvent } from 'react';
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
interface AppItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon: JSX.Element;
|
|
8
|
+
version?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface AppTileProps {
|
|
13
|
+
app: AppItem;
|
|
14
|
+
onClick?: (app: AppItem) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const AppTile: React$1.FC<AppTileProps>;
|
|
3
17
|
|
|
4
18
|
interface BodyProps {
|
|
19
|
+
icon: ReactNode;
|
|
5
20
|
title: ReactNode;
|
|
6
21
|
description?: ReactNode;
|
|
7
22
|
children?: ReactNode;
|
|
8
23
|
}
|
|
9
|
-
declare function Body({ title, description, children }: BodyProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function Body({ icon, title, description, children }: BodyProps): react_jsx_runtime.JSX.Element;
|
|
10
25
|
|
|
11
26
|
interface ButtonProps {
|
|
12
27
|
buttonClassName?: string;
|
|
@@ -41,6 +56,14 @@ interface HeaderBrandProps {
|
|
|
41
56
|
}
|
|
42
57
|
declare function HeaderText({ children }: HeaderBrandProps): react_jsx_runtime.JSX.Element;
|
|
43
58
|
|
|
59
|
+
interface ImageCardProps {
|
|
60
|
+
src: string;
|
|
61
|
+
alt: string;
|
|
62
|
+
width?: string | number;
|
|
63
|
+
height?: string | number;
|
|
64
|
+
}
|
|
65
|
+
declare const ImageCard: React$1.FC<ImageCardProps>;
|
|
66
|
+
|
|
44
67
|
interface NpmBadgeProps {
|
|
45
68
|
packageLabel: string;
|
|
46
69
|
packageName: string;
|
|
@@ -57,12 +80,13 @@ interface NavigationProps {
|
|
|
57
80
|
declare function Navigation({ title, children }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
58
81
|
|
|
59
82
|
interface NavigationItemProps {
|
|
83
|
+
icon: ReactNode;
|
|
60
84
|
title: ReactNode;
|
|
61
85
|
type: string;
|
|
62
86
|
active?: boolean;
|
|
63
87
|
onClick?: (type: string) => void;
|
|
64
88
|
}
|
|
65
|
-
declare function NavigationItem({ title, type, active, onClick }: NavigationItemProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function NavigationItem({ icon, title, type, active, onClick }: NavigationItemProps): react_jsx_runtime.JSX.Element;
|
|
66
90
|
|
|
67
91
|
type NotificationType = "success" | "info" | "warning" | "danger";
|
|
68
92
|
interface Notification {
|
|
@@ -92,6 +116,13 @@ interface NotificationsProviderProps {
|
|
|
92
116
|
declare function NotificationsProvider({ children }: NotificationsProviderProps): react_jsx_runtime.JSX.Element;
|
|
93
117
|
declare function UseNotifications(): NotificationsContextValue;
|
|
94
118
|
|
|
119
|
+
interface AppsViewProps {
|
|
120
|
+
apps: AppItem[];
|
|
121
|
+
title?: string;
|
|
122
|
+
onAppClick?: (app: AppItem) => void;
|
|
123
|
+
}
|
|
124
|
+
declare const AppsView: React$1.FC<AppsViewProps>;
|
|
125
|
+
|
|
95
126
|
declare function ContentContainer({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
96
127
|
|
|
97
128
|
declare function ContentRow({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
@@ -134,4 +165,4 @@ declare function ModalProvider({ children }: {
|
|
|
134
165
|
}): react_jsx_runtime.JSX.Element;
|
|
135
166
|
declare function UseModal(): ModalContextValue;
|
|
136
167
|
|
|
137
|
-
export { type AppNotification, Body, Button, type ButtonProps, ContentContainer, ContentRow, Footer, Header, HeaderText, LayoutWrapper, Modal, type ModalOptions, type ModalProps, ModalProvider, Navigation, NavigationItem, type Notification, type NotificationType, Notifications, NotificationsProvider, NpmBadge, UseModal, UseNotifications };
|
|
168
|
+
export { type AppItem, type AppNotification, AppTile, AppsView, Body, Button, type ButtonProps, ContentContainer, ContentRow, Footer, Header, HeaderText, ImageCard, LayoutWrapper, Modal, type ModalOptions, type ModalProps, ModalProvider, Navigation, NavigationItem, type Notification, type NotificationType, Notifications, NotificationsProvider, NpmBadge, UseModal, UseNotifications };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
import React$1, { JSX, ReactNode, MouseEvent } from 'react';
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
+
|
|
4
|
+
interface AppItem {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
icon: JSX.Element;
|
|
8
|
+
version?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface AppTileProps {
|
|
13
|
+
app: AppItem;
|
|
14
|
+
onClick?: (app: AppItem) => void;
|
|
15
|
+
}
|
|
16
|
+
declare const AppTile: React$1.FC<AppTileProps>;
|
|
3
17
|
|
|
4
18
|
interface BodyProps {
|
|
19
|
+
icon: ReactNode;
|
|
5
20
|
title: ReactNode;
|
|
6
21
|
description?: ReactNode;
|
|
7
22
|
children?: ReactNode;
|
|
8
23
|
}
|
|
9
|
-
declare function Body({ title, description, children }: BodyProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
declare function Body({ icon, title, description, children }: BodyProps): react_jsx_runtime.JSX.Element;
|
|
10
25
|
|
|
11
26
|
interface ButtonProps {
|
|
12
27
|
buttonClassName?: string;
|
|
@@ -41,6 +56,14 @@ interface HeaderBrandProps {
|
|
|
41
56
|
}
|
|
42
57
|
declare function HeaderText({ children }: HeaderBrandProps): react_jsx_runtime.JSX.Element;
|
|
43
58
|
|
|
59
|
+
interface ImageCardProps {
|
|
60
|
+
src: string;
|
|
61
|
+
alt: string;
|
|
62
|
+
width?: string | number;
|
|
63
|
+
height?: string | number;
|
|
64
|
+
}
|
|
65
|
+
declare const ImageCard: React$1.FC<ImageCardProps>;
|
|
66
|
+
|
|
44
67
|
interface NpmBadgeProps {
|
|
45
68
|
packageLabel: string;
|
|
46
69
|
packageName: string;
|
|
@@ -57,12 +80,13 @@ interface NavigationProps {
|
|
|
57
80
|
declare function Navigation({ title, children }: NavigationProps): react_jsx_runtime.JSX.Element;
|
|
58
81
|
|
|
59
82
|
interface NavigationItemProps {
|
|
83
|
+
icon: ReactNode;
|
|
60
84
|
title: ReactNode;
|
|
61
85
|
type: string;
|
|
62
86
|
active?: boolean;
|
|
63
87
|
onClick?: (type: string) => void;
|
|
64
88
|
}
|
|
65
|
-
declare function NavigationItem({ title, type, active, onClick }: NavigationItemProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function NavigationItem({ icon, title, type, active, onClick }: NavigationItemProps): react_jsx_runtime.JSX.Element;
|
|
66
90
|
|
|
67
91
|
type NotificationType = "success" | "info" | "warning" | "danger";
|
|
68
92
|
interface Notification {
|
|
@@ -92,6 +116,13 @@ interface NotificationsProviderProps {
|
|
|
92
116
|
declare function NotificationsProvider({ children }: NotificationsProviderProps): react_jsx_runtime.JSX.Element;
|
|
93
117
|
declare function UseNotifications(): NotificationsContextValue;
|
|
94
118
|
|
|
119
|
+
interface AppsViewProps {
|
|
120
|
+
apps: AppItem[];
|
|
121
|
+
title?: string;
|
|
122
|
+
onAppClick?: (app: AppItem) => void;
|
|
123
|
+
}
|
|
124
|
+
declare const AppsView: React$1.FC<AppsViewProps>;
|
|
125
|
+
|
|
95
126
|
declare function ContentContainer({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
96
127
|
|
|
97
128
|
declare function ContentRow({ children }: React.PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
@@ -134,4 +165,4 @@ declare function ModalProvider({ children }: {
|
|
|
134
165
|
}): react_jsx_runtime.JSX.Element;
|
|
135
166
|
declare function UseModal(): ModalContextValue;
|
|
136
167
|
|
|
137
|
-
export { type AppNotification, Body, Button, type ButtonProps, ContentContainer, ContentRow, Footer, Header, HeaderText, LayoutWrapper, Modal, type ModalOptions, type ModalProps, ModalProvider, Navigation, NavigationItem, type Notification, type NotificationType, Notifications, NotificationsProvider, NpmBadge, UseModal, UseNotifications };
|
|
168
|
+
export { type AppItem, type AppNotification, AppTile, AppsView, Body, Button, type ButtonProps, ContentContainer, ContentRow, Footer, Header, HeaderText, ImageCard, LayoutWrapper, Modal, type ModalOptions, type ModalProps, ModalProvider, Navigation, NavigationItem, type Notification, type NotificationType, Notifications, NotificationsProvider, NpmBadge, UseModal, UseNotifications };
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,43 @@
|
|
|
1
|
-
// src/components/
|
|
1
|
+
// src/components/AppTile.tsx
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
|
|
4
|
-
return /* @__PURE__ */
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var AppTile = ({ app, onClick }) => {
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { className: "col-auto", children: /* @__PURE__ */ jsxs(
|
|
5
|
+
"button",
|
|
6
|
+
{
|
|
7
|
+
type: "button",
|
|
8
|
+
className: "btn p-2 d-flex flex-column align-items-center border-0 bg-transparent app-icon-btn",
|
|
9
|
+
onClick: () => onClick?.(app),
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx("div", { className: "app-icon-tile d-flex align-items-center justify-content-center mb-1", children: /* @__PURE__ */ jsx("span", { style: { fontSize: "32px" }, children: app.icon }) }),
|
|
12
|
+
/* @__PURE__ */ jsxs("span", { className: "w-100 small text-truncate", children: [
|
|
13
|
+
app.name,
|
|
14
|
+
app.version && /* @__PURE__ */ jsxs("small", { className: "text-muted ms-1", children: [
|
|
15
|
+
"v",
|
|
16
|
+
app.version
|
|
17
|
+
] })
|
|
18
|
+
] })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
) });
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/components/Body.tsx
|
|
25
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
26
|
+
function Body({ icon, title, description, children }) {
|
|
27
|
+
return /* @__PURE__ */ jsxs2("main", { className: "col p-4", children: [
|
|
28
|
+
/* @__PURE__ */ jsxs2("h2", { children: [
|
|
29
|
+
icon,
|
|
30
|
+
" ",
|
|
31
|
+
title
|
|
32
|
+
] }),
|
|
33
|
+
description && /* @__PURE__ */ jsx2("p", { children: description }),
|
|
7
34
|
children
|
|
8
35
|
] });
|
|
9
36
|
}
|
|
10
37
|
|
|
11
38
|
// src/components/Button.tsx
|
|
12
39
|
import { useState } from "react";
|
|
13
|
-
import { Fragment, jsx as
|
|
40
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
14
41
|
function Button({
|
|
15
42
|
buttonClassName = "btn btn-primary btn-lg",
|
|
16
43
|
type = "button",
|
|
@@ -44,15 +71,15 @@ function Button({
|
|
|
44
71
|
onFinally?.();
|
|
45
72
|
}
|
|
46
73
|
};
|
|
47
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ jsx3(
|
|
48
75
|
"button",
|
|
49
76
|
{
|
|
50
77
|
type,
|
|
51
78
|
className: `${buttonClassName} ${loading ? "async-btn--loading" : ""}`,
|
|
52
79
|
onClick: handleClick,
|
|
53
80
|
disabled: disabled || loading,
|
|
54
|
-
children: loading ? renderLoading?.() ?? loadingChildren ?? /* @__PURE__ */
|
|
55
|
-
showSpinner && /* @__PURE__ */
|
|
81
|
+
children: loading ? renderLoading?.() ?? loadingChildren ?? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
82
|
+
showSpinner && /* @__PURE__ */ jsx3(
|
|
56
83
|
"span",
|
|
57
84
|
{
|
|
58
85
|
className: "spinner-border spinner-border-sm me-2 async-btn__spinner",
|
|
@@ -67,58 +94,82 @@ function Button({
|
|
|
67
94
|
}
|
|
68
95
|
|
|
69
96
|
// src/components/Footer.tsx
|
|
70
|
-
import { jsx as
|
|
97
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
71
98
|
function Footer({ children }) {
|
|
72
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ jsx4("footer", { className: "bg-dark text-white text-center py-2 mt-auto", children: children ?? "\xA9 2025 Your Site \u2014 All rights reserved" });
|
|
73
100
|
}
|
|
74
101
|
|
|
75
102
|
// src/components/Header.tsx
|
|
76
|
-
import { jsx as
|
|
103
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
77
104
|
function Header({ children }) {
|
|
78
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ jsx5("nav", { className: "navbar navbar-dark bg-dark px-3 sticky-top", children: children ?? /* @__PURE__ */ jsx5("span", { className: "navbar-brand mb-0 h4", children: "My Website" }) });
|
|
79
106
|
}
|
|
80
107
|
|
|
81
108
|
// src/components/HeaderText.tsx
|
|
82
|
-
import { jsx as
|
|
109
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
83
110
|
function HeaderText({ children }) {
|
|
84
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsx6("span", { className: "navbar-brand mb-0 h4", children });
|
|
85
112
|
}
|
|
86
113
|
|
|
114
|
+
// src/components/Icon.tsx
|
|
115
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
116
|
+
var ImageCard = ({
|
|
117
|
+
src,
|
|
118
|
+
alt
|
|
119
|
+
}) => {
|
|
120
|
+
return /* @__PURE__ */ jsx7(
|
|
121
|
+
"img",
|
|
122
|
+
{
|
|
123
|
+
src,
|
|
124
|
+
alt,
|
|
125
|
+
className: "w-100",
|
|
126
|
+
style: {
|
|
127
|
+
display: "block",
|
|
128
|
+
objectFit: "cover"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
87
134
|
// src/components/NpmBadge.tsx
|
|
88
|
-
import { jsx as
|
|
135
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
89
136
|
function NpmBadge({ packageName, packageLabel, packageUrl, color = "black", height = 22 }) {
|
|
90
137
|
const encodedLabel = encodeURIComponent(packageLabel);
|
|
91
138
|
const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;
|
|
92
139
|
const npmUrl = packageUrl;
|
|
93
|
-
return /* @__PURE__ */
|
|
140
|
+
return /* @__PURE__ */ jsx8("a", { href: npmUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx8("img", { src: badgeUrl, alt: `${packageName} version`, style: { height } }) });
|
|
94
141
|
}
|
|
95
142
|
|
|
96
143
|
// src/components/navigation/Navigation.tsx
|
|
97
|
-
import { jsx as
|
|
144
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
98
145
|
function Navigation({ title = "Navigation", children }) {
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
146
|
+
return /* @__PURE__ */ jsxs4("nav", { className: "col-auto p-3 h-100 d-flex flex-column", children: [
|
|
147
|
+
/* @__PURE__ */ jsx9("h6", { className: "text-muted text-uppercase", children: title }),
|
|
148
|
+
/* @__PURE__ */ jsx9("ul", { className: "nav nav-pills flex-column gap-2 mt-3", children })
|
|
102
149
|
] });
|
|
103
150
|
}
|
|
104
151
|
|
|
105
152
|
// src/components/navigation/NavigationItem.tsx
|
|
106
|
-
import { jsx as
|
|
107
|
-
function NavigationItem({ title, type, active, onClick }) {
|
|
108
|
-
return /* @__PURE__ */
|
|
153
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
154
|
+
function NavigationItem({ icon, title, type, active, onClick }) {
|
|
155
|
+
return /* @__PURE__ */ jsx10("li", { className: "nav-item", children: /* @__PURE__ */ jsxs5(
|
|
109
156
|
"button",
|
|
110
157
|
{
|
|
111
158
|
type: "button",
|
|
112
159
|
className: `nav-link text-start w-100 ${active ? "active" : ""}`,
|
|
113
160
|
onClick: () => onClick?.(type),
|
|
114
|
-
children:
|
|
161
|
+
children: [
|
|
162
|
+
icon,
|
|
163
|
+
" ",
|
|
164
|
+
title
|
|
165
|
+
]
|
|
115
166
|
}
|
|
116
167
|
) });
|
|
117
168
|
}
|
|
118
169
|
|
|
119
170
|
// src/components/notifications/Notifications.tsx
|
|
120
171
|
import { useEffect } from "react";
|
|
121
|
-
import { jsx as
|
|
172
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
122
173
|
function Notifications({ notifications, onClose }) {
|
|
123
174
|
useEffect(() => {
|
|
124
175
|
notifications.forEach((n) => {
|
|
@@ -127,19 +178,19 @@ function Notifications({ notifications, onClose }) {
|
|
|
127
178
|
return () => clearTimeout(timer);
|
|
128
179
|
});
|
|
129
180
|
}, [notifications, onClose]);
|
|
130
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ jsx11(
|
|
131
182
|
"div",
|
|
132
183
|
{
|
|
133
184
|
className: "position-fixed top-0 end-0",
|
|
134
185
|
style: { zIndex: 1080, width: 340 },
|
|
135
|
-
children: notifications.map((n) => /* @__PURE__ */
|
|
186
|
+
children: notifications.map((n) => /* @__PURE__ */ jsxs6(
|
|
136
187
|
"div",
|
|
137
188
|
{
|
|
138
189
|
className: `alert alert-${n.type ?? "info"} alert-dismissible fade show shadow-sm mb-2`,
|
|
139
190
|
role: "alert",
|
|
140
191
|
children: [
|
|
141
192
|
n.message,
|
|
142
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ jsx11(
|
|
143
194
|
"button",
|
|
144
195
|
{
|
|
145
196
|
type: "button",
|
|
@@ -164,7 +215,7 @@ import {
|
|
|
164
215
|
useEffect as useEffect2,
|
|
165
216
|
useState as useState2
|
|
166
217
|
} from "react";
|
|
167
|
-
import { jsx as
|
|
218
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
168
219
|
var NotificationsContext = createContext(
|
|
169
220
|
void 0
|
|
170
221
|
);
|
|
@@ -196,20 +247,20 @@ function NotificationsProvider({ children }) {
|
|
|
196
247
|
timers.forEach((t) => t && clearTimeout(t));
|
|
197
248
|
};
|
|
198
249
|
}, [notifications, close]);
|
|
199
|
-
return /* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ jsxs7(NotificationsContext.Provider, { value: { push }, children: [
|
|
251
|
+
/* @__PURE__ */ jsx12(
|
|
201
252
|
"div",
|
|
202
253
|
{
|
|
203
254
|
className: "position-fixed top-0 end-0 p-3",
|
|
204
255
|
style: { zIndex: 1080, width: 340 },
|
|
205
|
-
children: notifications.map((n) => /* @__PURE__ */
|
|
256
|
+
children: notifications.map((n) => /* @__PURE__ */ jsxs7(
|
|
206
257
|
"div",
|
|
207
258
|
{
|
|
208
259
|
className: `alert alert-${n.type ?? "info"} alert-dismissible fade show shadow-sm mb-2`,
|
|
209
260
|
role: "alert",
|
|
210
261
|
children: [
|
|
211
262
|
n.message,
|
|
212
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ jsx12(
|
|
213
264
|
"button",
|
|
214
265
|
{
|
|
215
266
|
type: "button",
|
|
@@ -235,26 +286,35 @@ function UseNotifications() {
|
|
|
235
286
|
return ctx;
|
|
236
287
|
}
|
|
237
288
|
|
|
289
|
+
// src/components/views/AppsView.tsx
|
|
290
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
291
|
+
var AppsView = ({ apps, title, onAppClick }) => {
|
|
292
|
+
return /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
293
|
+
title && /* @__PURE__ */ jsx13("h5", { className: "mb-3", children: title }),
|
|
294
|
+
/* @__PURE__ */ jsx13("div", { className: "row", children: apps.map((app) => /* @__PURE__ */ jsx13(AppTile, { app, onClick: onAppClick }, app.id)) })
|
|
295
|
+
] });
|
|
296
|
+
};
|
|
297
|
+
|
|
238
298
|
// src/components/wrappers/ContentContainer.tsx
|
|
239
|
-
import { jsx as
|
|
299
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
240
300
|
function ContentContainer({ children }) {
|
|
241
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ jsx14("div", { className: "container-fluid flex-grow-1", children });
|
|
242
302
|
}
|
|
243
303
|
|
|
244
304
|
// src/components/wrappers/ContentRow.tsx
|
|
245
|
-
import { jsx as
|
|
305
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
246
306
|
function ContentRow({ children }) {
|
|
247
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ jsx15("div", { className: "row h-100 flex-nowrap", children });
|
|
248
308
|
}
|
|
249
309
|
|
|
250
310
|
// src/components/wrappers/LayoutWrapper.tsx
|
|
251
|
-
import { jsx as
|
|
311
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
252
312
|
function LayoutWrapper({ children }) {
|
|
253
|
-
return /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ jsx16("div", { className: "d-flex flex-column min-vh-100", children });
|
|
254
314
|
}
|
|
255
315
|
|
|
256
316
|
// src/modal/Modal.tsx
|
|
257
|
-
import { Fragment as
|
|
317
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
258
318
|
var Modal = ({
|
|
259
319
|
title,
|
|
260
320
|
isOpen,
|
|
@@ -276,8 +336,8 @@ var Modal = ({
|
|
|
276
336
|
const handleContentClick = (e) => {
|
|
277
337
|
e.stopPropagation();
|
|
278
338
|
};
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
340
|
+
/* @__PURE__ */ jsx17(
|
|
281
341
|
"div",
|
|
282
342
|
{
|
|
283
343
|
className: "modal-backdrop fade show",
|
|
@@ -285,7 +345,7 @@ var Modal = ({
|
|
|
285
345
|
onClick: handleBackdropClick
|
|
286
346
|
}
|
|
287
347
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ jsx17(
|
|
289
349
|
"div",
|
|
290
350
|
{
|
|
291
351
|
className: "modal fade show d-block",
|
|
@@ -293,10 +353,10 @@ var Modal = ({
|
|
|
293
353
|
role: "dialog",
|
|
294
354
|
style: { zIndex: 1050 },
|
|
295
355
|
onClick: handleBackdropClick,
|
|
296
|
-
children: /* @__PURE__ */
|
|
297
|
-
/* @__PURE__ */
|
|
298
|
-
title && /* @__PURE__ */
|
|
299
|
-
showHeaderClose && /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ jsx17("div", { className: "modal-dialog modal-dialog-centered", role: "document", onClick: handleContentClick, children: /* @__PURE__ */ jsxs9("div", { className: "modal-content shadow", children: [
|
|
357
|
+
/* @__PURE__ */ jsxs9("div", { className: "modal-header", children: [
|
|
358
|
+
title && /* @__PURE__ */ jsx17("h5", { className: "modal-title", children: title }),
|
|
359
|
+
showHeaderClose && /* @__PURE__ */ jsx17(
|
|
300
360
|
"button",
|
|
301
361
|
{
|
|
302
362
|
type: "button",
|
|
@@ -307,9 +367,9 @@ var Modal = ({
|
|
|
307
367
|
}
|
|
308
368
|
)
|
|
309
369
|
] }),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
showCloseButton && /* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ jsx17("div", { className: "modal-body", children }),
|
|
371
|
+
/* @__PURE__ */ jsxs9("div", { className: "modal-footer", children: [
|
|
372
|
+
showCloseButton && /* @__PURE__ */ jsx17(
|
|
313
373
|
"button",
|
|
314
374
|
{
|
|
315
375
|
type: "button",
|
|
@@ -319,7 +379,7 @@ var Modal = ({
|
|
|
319
379
|
children: "Close"
|
|
320
380
|
}
|
|
321
381
|
),
|
|
322
|
-
onConfirm && showConfirmButton && /* @__PURE__ */
|
|
382
|
+
onConfirm && showConfirmButton && /* @__PURE__ */ jsx17(
|
|
323
383
|
"button",
|
|
324
384
|
{
|
|
325
385
|
type: "button",
|
|
@@ -343,7 +403,7 @@ import {
|
|
|
343
403
|
useContext as useContext2,
|
|
344
404
|
useState as useState3
|
|
345
405
|
} from "react";
|
|
346
|
-
import { jsx as
|
|
406
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
347
407
|
var ModalContext = createContext2(void 0);
|
|
348
408
|
function ModalProvider({ children }) {
|
|
349
409
|
const [isOpen, setIsOpen] = useState3(false);
|
|
@@ -357,9 +417,9 @@ function ModalProvider({ children }) {
|
|
|
357
417
|
const closeModal = useCallback2(() => {
|
|
358
418
|
setIsOpen(false);
|
|
359
419
|
}, []);
|
|
360
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ jsxs10(ModalContext.Provider, { value: { openModal, closeModal }, children: [
|
|
361
421
|
children,
|
|
362
|
-
/* @__PURE__ */
|
|
422
|
+
/* @__PURE__ */ jsx18(
|
|
363
423
|
Modal,
|
|
364
424
|
{
|
|
365
425
|
isOpen,
|
|
@@ -383,6 +443,8 @@ function UseModal() {
|
|
|
383
443
|
return ctx;
|
|
384
444
|
}
|
|
385
445
|
export {
|
|
446
|
+
AppTile,
|
|
447
|
+
AppsView,
|
|
386
448
|
Body,
|
|
387
449
|
Button,
|
|
388
450
|
ContentContainer,
|
|
@@ -390,6 +452,7 @@ export {
|
|
|
390
452
|
Footer,
|
|
391
453
|
Header,
|
|
392
454
|
HeaderText,
|
|
455
|
+
ImageCard,
|
|
393
456
|
LayoutWrapper,
|
|
394
457
|
Modal,
|
|
395
458
|
ModalProvider,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Body.tsx","../src/components/Button.tsx","../src/components/Footer.tsx","../src/components/Header.tsx","../src/components/HeaderText.tsx","../src/components/NpmBadge.tsx","../src/components/navigation/Navigation.tsx","../src/components/navigation/NavigationItem.tsx","../src/components/notifications/Notifications.tsx","../src/components/notifications/NotificationsProvider.tsx","../src/components/wrappers/ContentContainer.tsx","../src/components/wrappers/ContentRow.tsx","../src/components/wrappers/LayoutWrapper.tsx","../src/modal/Modal.tsx","../src/modal/ModalProvider.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\r\n\r\ninterface BodyProps {\r\n title: ReactNode;\r\n description?: ReactNode;\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Body({ title, description, children }: BodyProps) {\r\n return (\r\n\r\n <main className=\"col p-4\">\r\n <h2>{title}</h2>\r\n\r\n {description && <p>{description}</p>}\r\n {children}\r\n </main>\r\n );\r\n}\r\n","import { useState, type ReactNode, type MouseEvent } from \"react\";\r\n\r\nexport interface ButtonProps {\r\n buttonClassName?: string;\r\n type?: \"button\" | \"submit\" | \"reset\";\r\n disabled?: boolean;\r\n\r\n onAction?: () => Promise<unknown>;\r\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\r\n onDone?: (result: unknown) => void;\r\n onError?: (error: unknown) => void;\r\n onFinally?: () => void;\r\n\r\n children?: ReactNode;\r\n loadingChildren?: ReactNode;\r\n\r\n renderContent?: () => ReactNode;\r\n renderLoading?: () => ReactNode;\r\n\r\n loadingText?: string;\r\n showSpinner?: boolean;\r\n}\r\n\r\nexport function Button({\r\n buttonClassName = \"btn btn-primary btn-lg\",\r\n type = \"button\",\r\n disabled = false,\r\n\r\n onAction,\r\n onClick,\r\n onDone,\r\n onError,\r\n onFinally,\r\n\r\n children = \"Click me\",\r\n\r\n loadingChildren,\r\n renderContent,\r\n renderLoading,\r\n\r\n loadingText = \"Loading...\",\r\n showSpinner = true,\r\n}: ButtonProps) {\r\n const [loading, setLoading] = useState(false);\r\n\r\n const handleClick = async (event: MouseEvent<HTMLButtonElement>) => {\r\n if (loading) return;\r\n\r\n onClick?.(event);\r\n if (event.defaultPrevented) return;\r\n if (!onAction) return;\r\n\r\n try {\r\n setLoading(true);\r\n const result = await onAction();\r\n onDone?.(result);\r\n } catch (error) {\r\n onError?.(error);\r\n } finally {\r\n setLoading(false);\r\n onFinally?.();\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n type={type}\r\n className={`${buttonClassName} ${loading ? \"async-btn--loading\" : \"\"}`}\r\n onClick={handleClick}\r\n disabled={disabled || loading}\r\n >\r\n {loading ? (\r\n renderLoading?.() ??\r\n loadingChildren ?? (\r\n <>\r\n {showSpinner && (\r\n <span\r\n className=\"spinner-border spinner-border-sm me-2 async-btn__spinner\"\r\n role=\"status\"\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n {loadingText}\r\n </>\r\n )\r\n ) : (\r\n renderContent?.() ?? children\r\n )}\r\n </button>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface FooterProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Footer({ children }: FooterProps) {\r\n return (\r\n <footer className=\"bg-dark text-white text-center py-2 mt-auto\">\r\n {children ?? \"© 2025 Your Site — All rights reserved\"}\r\n </footer>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Header({ children }: HeaderProps) {\r\n return (\r\n <nav className=\"navbar navbar-dark bg-dark px-3 sticky-top\">\r\n {children ?? (\r\n <span className=\"navbar-brand mb-0 h4\">My Website</span>\r\n )}\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderBrandProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function HeaderText({ children }: HeaderBrandProps) {\r\n return (\r\n <span className=\"navbar-brand mb-0 h4\">\r\n {children}\r\n </span>\r\n );\r\n}\r\n","// components/NpmBadge.tsx\r\ninterface NpmBadgeProps {\r\n packageLabel: string;\r\n packageName: string;\r\n packageUrl: string; // e.g. \"@sparkstudio/authentication-ui\"\r\n color?: string; // optional (default black)\r\n height?: number; // optional (default 22)\r\n}\r\n\r\nexport function NpmBadge({ packageName, packageLabel, packageUrl, color = \"black\", height = 22 }: NpmBadgeProps) {\r\n const encodedLabel = encodeURIComponent(packageLabel);\r\n const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;\r\n const npmUrl = packageUrl;\r\n\r\n return (\r\n <a href={npmUrl} target=\"_blank\" rel=\"noopener noreferrer\">\r\n <img src={badgeUrl} alt={`${packageName} version`} style={{ height }} />\r\n </a>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationProps {\r\n title?: ReactNode;\r\n children: ReactNode;\r\n}\r\n\r\nexport function Navigation({ title = \"Navigation\", children }: NavigationProps) {\r\n return (\r\n <nav className=\"col-auto p-3 h-100 d-flex flex-column\">\r\n <h6 className=\"text-muted text-uppercase\">{title}</h6>\r\n\r\n <ul className=\"nav nav-pills flex-column gap-2 mt-3\">\r\n {children}\r\n </ul>\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationItemProps {\r\n title: ReactNode;\r\n type: string;\r\n active?: boolean;\r\n onClick?: (type: string) => void;\r\n}\r\n\r\nexport function NavigationItem({ title, type, active, onClick }: NavigationItemProps) {\r\n return (\r\n <li className=\"nav-item\">\r\n <button\r\n type=\"button\"\r\n className={`nav-link text-start w-100 ${active ? \"active\" : \"\"}`}\r\n onClick={() => onClick?.(type)}\r\n >\r\n {title}\r\n </button>\r\n </li>\r\n );\r\n}\r\n","import { useEffect } from \"react\";\r\n\r\nexport type NotificationType = \"success\" | \"info\" | \"warning\" | \"danger\";\r\n\r\nexport interface Notification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsProps {\r\n notifications: Notification[];\r\n onClose: (id: string) => void;\r\n}\r\n\r\nexport function Notifications({ notifications, onClose }: NotificationsProps) {\r\n useEffect(() => {\r\n notifications.forEach((n) => {\r\n if (!n.autoCloseMs) return;\r\n\r\n const timer = setTimeout(() => onClose(n.id), n.autoCloseMs);\r\n return () => clearTimeout(timer);\r\n });\r\n }, [notifications, onClose]);\r\n\r\n return (\r\n <div\r\n className=\"position-fixed top-0 end-0\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => onClose(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n}\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport type { NotificationType } from \"./Notifications\";\r\n\r\n// Rename to avoid conflict with browser Notification type\r\nexport interface AppNotification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsContextValue {\r\n push: (message: string, type?: NotificationType, autoCloseMs?: number) => void;\r\n}\r\n\r\nconst NotificationsContext = createContext<NotificationsContextValue | undefined>(\r\n undefined\r\n);\r\n\r\ninterface NotificationsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function NotificationsProvider({ children }: NotificationsProviderProps) {\r\n const [notifications, setNotifications] = useState<AppNotification[]>([]);\r\n\r\n const push = useCallback(\r\n (message: string, type: NotificationType = \"info\", autoCloseMs = 4000) => {\r\n setNotifications((prev) => [\r\n ...prev,\r\n {\r\n id: crypto.randomUUID(),\r\n message,\r\n type,\r\n autoCloseMs,\r\n },\r\n ]);\r\n },\r\n []\r\n );\r\n\r\n const close = useCallback((id: string) => {\r\n setNotifications((list) => list.filter((n) => n.id !== id));\r\n }, []);\r\n\r\n // Handle auto close timers\r\n useEffect(() => {\r\n const timers = notifications.map((n) => {\r\n if (!n.autoCloseMs) return null;\r\n return setTimeout(() => close(n.id), n.autoCloseMs);\r\n });\r\n\r\n return () => {\r\n timers.forEach((t) => t && clearTimeout(t));\r\n };\r\n }, [notifications, close]);\r\n\r\n return (\r\n <NotificationsContext.Provider value={{ push }}>\r\n {/* overlay renderer */}\r\n <div\r\n className=\"position-fixed top-0 end-0 p-3\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => close(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n\r\n {children}\r\n </NotificationsContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseNotifications(): NotificationsContextValue {\r\n const ctx = useContext(NotificationsContext);\r\n if (!ctx) {\r\n throw new Error(\"useNotifications must be used within a NotificationsProvider\");\r\n }\r\n return ctx;\r\n}\r\n","export function ContentContainer({ children }: React.PropsWithChildren) {\r\n return <div className=\"container-fluid flex-grow-1\">{children}</div>;\r\n}\r\n","export function ContentRow({ children }: React.PropsWithChildren) {\r\n return <div className=\"row h-100 flex-nowrap\">{children}</div>;\r\n}\r\n","\r\nexport function LayoutWrapper({ children }: React.PropsWithChildren) {\r\n return (\r\n\r\n <div className=\"d-flex flex-column min-vh-100\">{children}</div>\r\n );\r\n}\r\n","// components/Modal.tsx\r\nimport React from \"react\";\r\n\r\nexport interface ModalProps {\r\n title?: string;\r\n isOpen: boolean;\r\n onClose: () => void;\r\n onConfirm?: () => void;\r\n confirmText?: string;\r\n\r\n disableBackdropClose?: boolean;\r\n disableAllButtons?: boolean;\r\n\r\n /** NEW: toggle visibility */\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport const Modal: React.FC<ModalProps> = ({\r\n title,\r\n isOpen,\r\n onClose,\r\n onConfirm,\r\n confirmText = \"OK\",\r\n\r\n disableBackdropClose = false,\r\n disableAllButtons = false,\r\n\r\n showHeaderClose = true,\r\n showCloseButton = true,\r\n showConfirmButton = true,\r\n\r\n children,\r\n}) => {\r\n if (!isOpen) return null;\r\n\r\n const handleBackdropClick = () => {\r\n if (disableBackdropClose || disableAllButtons) return;\r\n onClose();\r\n };\r\n\r\n const handleContentClick: React.MouseEventHandler<HTMLDivElement> = (e) => {\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className=\"modal-backdrop fade show\"\r\n style={{ zIndex: 1040 }}\r\n onClick={handleBackdropClick}\r\n />\r\n\r\n <div\r\n className=\"modal fade show d-block\"\r\n tabIndex={-1}\r\n role=\"dialog\"\r\n style={{ zIndex: 1050 }}\r\n onClick={handleBackdropClick}\r\n >\r\n <div className=\"modal-dialog modal-dialog-centered\" role=\"document\" onClick={handleContentClick}>\r\n <div className=\"modal-content shadow\">\r\n {/* Header */}\r\n <div className=\"modal-header\">\r\n {title && <h5 className=\"modal-title\">{title}</h5>}\r\n\r\n {showHeaderClose && (\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n />\r\n )}\r\n </div>\r\n\r\n {/* Body */}\r\n <div className=\"modal-body\">{children}</div>\r\n\r\n {/* Footer */}\r\n <div className=\"modal-footer\">\r\n {showCloseButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-secondary\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n >\r\n Close\r\n </button>\r\n )}\r\n\r\n {onConfirm && showConfirmButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-primary\"\r\n onClick={onConfirm}\r\n disabled={disableAllButtons}\r\n >\r\n {confirmText}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { Modal } from \"./Modal\";\r\n\r\nexport interface ModalOptions {\r\n title?: string;\r\n confirmText?: string;\r\n disableBackdropClose?: boolean;\r\n onConfirm?: () => void;\r\n\r\n /** extra control flags matching Modal.tsx */\r\n disableAllButtons?: boolean;\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n}\r\n\r\ninterface ModalContextValue {\r\n openModal: (content: ReactNode, options?: ModalOptions) => void;\r\n closeModal: () => void;\r\n}\r\n\r\nconst ModalContext = createContext<ModalContextValue | undefined>(undefined);\r\n\r\nexport function ModalProvider({ children }: { children: ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [content, setContent] = useState<ReactNode>(null);\r\n const [options, setOptions] = useState<ModalOptions>({});\r\n\r\n const openModal = useCallback((content: ReactNode, options?: ModalOptions) => {\r\n setContent(content);\r\n setOptions(options ?? {});\r\n setIsOpen(true);\r\n }, []);\r\n\r\n const closeModal = useCallback(() => {\r\n setIsOpen(false);\r\n }, []);\r\n\r\n return (\r\n <ModalContext.Provider value={{ openModal, closeModal }}>\r\n {children}\r\n\r\n <Modal\r\n isOpen={isOpen}\r\n title={options.title}\r\n confirmText={options.confirmText}\r\n disableBackdropClose={options.disableBackdropClose}\r\n disableAllButtons={options.disableAllButtons}\r\n showHeaderClose={options.showHeaderClose}\r\n showCloseButton={options.showCloseButton}\r\n showConfirmButton={options.showConfirmButton}\r\n onClose={closeModal}\r\n onConfirm={options.onConfirm}\r\n >\r\n {content}\r\n </Modal>\r\n </ModalContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseModal() {\r\n const ctx = useContext(ModalContext);\r\n if (!ctx) throw new Error(\"UseModal must be used within ModalProvider\");\r\n return ctx;\r\n}\r\n"],"mappings":";AAWM,SACE,KADF;AAHC,SAAS,KAAK,EAAE,OAAO,aAAa,SAAS,GAAc;AAChE,SAEI,qBAAC,UAAK,WAAU,WACd;AAAA,wBAAC,QAAI,iBAAM;AAAA,IAEV,eAAe,oBAAC,OAAG,uBAAY;AAAA,IAC/B;AAAA,KACH;AAEN;;;AClBA,SAAS,gBAAiD;AA0EhD,mBAEI,OAAAA,MAFJ,QAAAC,aAAA;AAnDH,SAAS,OAAO;AAAA,EACrB,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,WAAW;AAAA,EAEX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,WAAW;AAAA,EAEX;AAAA,EACA;AAAA,EACA;AAAA,EAEA,cAAc;AAAA,EACd,cAAc;AAChB,GAAgB;AACd,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAE5C,QAAM,cAAc,OAAO,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A;AAAA,IACH;AAAA,KACF;AAEJ;AAEO,SAAS,WAAW;AACzB,QAAM,MAAMO,YAAW,YAAY;AACnC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;","names":["jsx","jsxs","jsx","jsx","jsx","jsx","jsx","jsxs","jsx","jsx","jsxs","useEffect","useState","jsx","jsxs","jsx","jsx","jsx","Fragment","jsx","jsxs","createContext","useCallback","useContext","useState","jsx","jsxs","createContext","useState","useCallback","content","options","useContext"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/AppTile.tsx","../src/components/Body.tsx","../src/components/Button.tsx","../src/components/Footer.tsx","../src/components/Header.tsx","../src/components/HeaderText.tsx","../src/components/Icon.tsx","../src/components/NpmBadge.tsx","../src/components/navigation/Navigation.tsx","../src/components/navigation/NavigationItem.tsx","../src/components/notifications/Notifications.tsx","../src/components/notifications/NotificationsProvider.tsx","../src/components/views/AppsView.tsx","../src/components/wrappers/ContentContainer.tsx","../src/components/wrappers/ContentRow.tsx","../src/components/wrappers/LayoutWrapper.tsx","../src/modal/Modal.tsx","../src/modal/ModalProvider.tsx"],"sourcesContent":["import React from \"react\";\r\nimport type { AppItem } from \"../models/AppItem\";\r\n\r\ninterface AppTileProps {\r\n app: AppItem;\r\n onClick?: (app: AppItem) => void;\r\n}\r\n\r\nexport const AppTile: React.FC<AppTileProps> = ({ app, onClick }) => {\r\n return (\r\n <div className=\"col-auto\">\r\n <button\r\n type=\"button\"\r\n className=\"btn p-2 d-flex flex-column align-items-center border-0 bg-transparent app-icon-btn\"\r\n onClick={() => onClick?.(app)}\r\n >\r\n <div className=\"app-icon-tile d-flex align-items-center justify-content-center mb-1\">\r\n <span style={{fontSize:\"32px\"}}>{app.icon}</span>\r\n </div>\r\n\r\n <span className=\"w-100 small text-truncate\">\r\n {app.name}\r\n {app.version && <small className=\"text-muted ms-1\">v{app.version}</small>}\r\n </span>\r\n </button>\r\n </div>\r\n );\r\n};\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface BodyProps {\r\n icon: ReactNode;\r\n title: ReactNode;\r\n description?: ReactNode;\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Body({ icon, title, description, children }: BodyProps) {\r\n return (\r\n\r\n <main className=\"col p-4\">\r\n <h2>{icon} {title}</h2>\r\n\r\n {description && <p>{description}</p>}\r\n {children}\r\n </main>\r\n );\r\n}\r\n","import { useState, type ReactNode, type MouseEvent } from \"react\";\r\n\r\nexport interface ButtonProps {\r\n buttonClassName?: string;\r\n type?: \"button\" | \"submit\" | \"reset\";\r\n disabled?: boolean;\r\n\r\n onAction?: () => Promise<unknown>;\r\n onClick?: (event: MouseEvent<HTMLButtonElement>) => void;\r\n onDone?: (result: unknown) => void;\r\n onError?: (error: unknown) => void;\r\n onFinally?: () => void;\r\n\r\n children?: ReactNode;\r\n loadingChildren?: ReactNode;\r\n\r\n renderContent?: () => ReactNode;\r\n renderLoading?: () => ReactNode;\r\n\r\n loadingText?: string;\r\n showSpinner?: boolean;\r\n}\r\n\r\nexport function Button({\r\n buttonClassName = \"btn btn-primary btn-lg\",\r\n type = \"button\",\r\n disabled = false,\r\n\r\n onAction,\r\n onClick,\r\n onDone,\r\n onError,\r\n onFinally,\r\n\r\n children = \"Click me\",\r\n\r\n loadingChildren,\r\n renderContent,\r\n renderLoading,\r\n\r\n loadingText = \"Loading...\",\r\n showSpinner = true,\r\n}: ButtonProps) {\r\n const [loading, setLoading] = useState(false);\r\n\r\n const handleClick = async (event: MouseEvent<HTMLButtonElement>) => {\r\n if (loading) return;\r\n\r\n onClick?.(event);\r\n if (event.defaultPrevented) return;\r\n if (!onAction) return;\r\n\r\n try {\r\n setLoading(true);\r\n const result = await onAction();\r\n onDone?.(result);\r\n } catch (error) {\r\n onError?.(error);\r\n } finally {\r\n setLoading(false);\r\n onFinally?.();\r\n }\r\n };\r\n\r\n return (\r\n <button\r\n type={type}\r\n className={`${buttonClassName} ${loading ? \"async-btn--loading\" : \"\"}`}\r\n onClick={handleClick}\r\n disabled={disabled || loading}\r\n >\r\n {loading ? (\r\n renderLoading?.() ??\r\n loadingChildren ?? (\r\n <>\r\n {showSpinner && (\r\n <span\r\n className=\"spinner-border spinner-border-sm me-2 async-btn__spinner\"\r\n role=\"status\"\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n {loadingText}\r\n </>\r\n )\r\n ) : (\r\n renderContent?.() ?? children\r\n )}\r\n </button>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface FooterProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Footer({ children }: FooterProps) {\r\n return (\r\n <footer className=\"bg-dark text-white text-center py-2 mt-auto\">\r\n {children ?? \"© 2025 Your Site — All rights reserved\"}\r\n </footer>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport function Header({ children }: HeaderProps) {\r\n return (\r\n <nav className=\"navbar navbar-dark bg-dark px-3 sticky-top\">\r\n {children ?? (\r\n <span className=\"navbar-brand mb-0 h4\">My Website</span>\r\n )}\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface HeaderBrandProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function HeaderText({ children }: HeaderBrandProps) {\r\n return (\r\n <span className=\"navbar-brand mb-0 h4\">\r\n {children}\r\n </span>\r\n );\r\n}\r\n","// ImageCard.tsx\r\nimport React from \"react\";\r\n\r\ninterface ImageCardProps {\r\n src: string;\r\n alt: string;\r\n width?: string | number;\r\n height?: string | number;\r\n}\r\n\r\nexport const ImageCard: React.FC<ImageCardProps> = ({\r\n src,\r\n alt,\r\n}) => {\r\n return (\r\n <img\r\n src={src}\r\n alt={alt}\r\n className={\"w-100\"}\r\n style={{\r\n display: \"block\",\r\n objectFit: \"cover\",\r\n }}\r\n />\r\n );\r\n};\r\n","// components/NpmBadge.tsx\r\ninterface NpmBadgeProps {\r\n packageLabel: string;\r\n packageName: string;\r\n packageUrl: string; // e.g. \"@sparkstudio/authentication-ui\"\r\n color?: string; // optional (default black)\r\n height?: number; // optional (default 22)\r\n}\r\n\r\nexport function NpmBadge({ packageName, packageLabel, packageUrl, color = \"black\", height = 22 }: NpmBadgeProps) {\r\n const encodedLabel = encodeURIComponent(packageLabel);\r\n const badgeUrl = `https://img.shields.io/npm/v/${packageName}?logo=npm&label=${encodedLabel}&color=${color}`;\r\n const npmUrl = packageUrl;\r\n\r\n return (\r\n <a href={npmUrl} target=\"_blank\" rel=\"noopener noreferrer\">\r\n <img src={badgeUrl} alt={`${packageName} version`} style={{ height }} />\r\n </a>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationProps {\r\n title?: ReactNode;\r\n children: ReactNode;\r\n}\r\n\r\nexport function Navigation({ title = \"Navigation\", children }: NavigationProps) {\r\n return (\r\n <nav className=\"col-auto p-3 h-100 d-flex flex-column\">\r\n <h6 className=\"text-muted text-uppercase\">{title}</h6>\r\n\r\n <ul className=\"nav nav-pills flex-column gap-2 mt-3\">\r\n {children}\r\n </ul>\r\n </nav>\r\n );\r\n}\r\n","import type { ReactNode } from \"react\";\r\n\r\ninterface NavigationItemProps {\r\n icon: ReactNode;\r\n title: ReactNode;\r\n type: string;\r\n active?: boolean;\r\n onClick?: (type: string) => void;\r\n}\r\n\r\nexport function NavigationItem({icon, title, type, active, onClick }: NavigationItemProps) {\r\n return (\r\n <li className=\"nav-item\">\r\n <button\r\n type=\"button\"\r\n className={`nav-link text-start w-100 ${active ? \"active\" : \"\"}`}\r\n onClick={() => onClick?.(type)}\r\n >\r\n {icon} {title}\r\n </button>\r\n </li>\r\n );\r\n}\r\n","import { useEffect } from \"react\";\r\n\r\nexport type NotificationType = \"success\" | \"info\" | \"warning\" | \"danger\";\r\n\r\nexport interface Notification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsProps {\r\n notifications: Notification[];\r\n onClose: (id: string) => void;\r\n}\r\n\r\nexport function Notifications({ notifications, onClose }: NotificationsProps) {\r\n useEffect(() => {\r\n notifications.forEach((n) => {\r\n if (!n.autoCloseMs) return;\r\n\r\n const timer = setTimeout(() => onClose(n.id), n.autoCloseMs);\r\n return () => clearTimeout(timer);\r\n });\r\n }, [notifications, onClose]);\r\n\r\n return (\r\n <div\r\n className=\"position-fixed top-0 end-0\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => onClose(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n}\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport type { NotificationType } from \"./Notifications\";\r\n\r\n// Rename to avoid conflict with browser Notification type\r\nexport interface AppNotification {\r\n id: string;\r\n message: string;\r\n type?: NotificationType;\r\n autoCloseMs?: number;\r\n}\r\n\r\ninterface NotificationsContextValue {\r\n push: (message: string, type?: NotificationType, autoCloseMs?: number) => void;\r\n}\r\n\r\nconst NotificationsContext = createContext<NotificationsContextValue | undefined>(\r\n undefined\r\n);\r\n\r\ninterface NotificationsProviderProps {\r\n children: ReactNode;\r\n}\r\n\r\nexport function NotificationsProvider({ children }: NotificationsProviderProps) {\r\n const [notifications, setNotifications] = useState<AppNotification[]>([]);\r\n\r\n const push = useCallback(\r\n (message: string, type: NotificationType = \"info\", autoCloseMs = 4000) => {\r\n setNotifications((prev) => [\r\n ...prev,\r\n {\r\n id: crypto.randomUUID(),\r\n message,\r\n type,\r\n autoCloseMs,\r\n },\r\n ]);\r\n },\r\n []\r\n );\r\n\r\n const close = useCallback((id: string) => {\r\n setNotifications((list) => list.filter((n) => n.id !== id));\r\n }, []);\r\n\r\n // Handle auto close timers\r\n useEffect(() => {\r\n const timers = notifications.map((n) => {\r\n if (!n.autoCloseMs) return null;\r\n return setTimeout(() => close(n.id), n.autoCloseMs);\r\n });\r\n\r\n return () => {\r\n timers.forEach((t) => t && clearTimeout(t));\r\n };\r\n }, [notifications, close]);\r\n\r\n return (\r\n <NotificationsContext.Provider value={{ push }}>\r\n {/* overlay renderer */}\r\n <div\r\n className=\"position-fixed top-0 end-0 p-3\"\r\n style={{ zIndex: 1080, width: 340 }}\r\n >\r\n {notifications.map((n) => (\r\n <div\r\n key={n.id}\r\n className={`alert alert-${n.type ?? \"info\"} alert-dismissible fade show shadow-sm mb-2`}\r\n role=\"alert\"\r\n >\r\n {n.message}\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={() => close(n.id)}\r\n />\r\n </div>\r\n ))}\r\n </div>\r\n\r\n {children}\r\n </NotificationsContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseNotifications(): NotificationsContextValue {\r\n const ctx = useContext(NotificationsContext);\r\n if (!ctx) {\r\n throw new Error(\"useNotifications must be used within a NotificationsProvider\");\r\n }\r\n return ctx;\r\n}\r\n","// ./views/AppsView.tsx (or ./components/AppsView.tsx)\r\nimport React from \"react\";\r\nimport type { AppItem } from \"../../models/AppItem\";\r\nimport { AppTile } from \"../AppTile\";\r\n\r\ninterface AppsViewProps {\r\n apps: AppItem[];\r\n title?: string;\r\n onAppClick?: (app: AppItem) => void;\r\n}\r\n\r\nexport const AppsView: React.FC<AppsViewProps> = ({ apps, title, onAppClick }) => {\r\n return (\r\n <>\r\n {title && <h5 className=\"mb-3\">{title}</h5>}\r\n\r\n <div className=\"row\">\r\n {apps.map((app) => (\r\n <AppTile key={app.id} app={app} onClick={onAppClick} />\r\n ))}\r\n </div>\r\n </>\r\n );\r\n};\r\n","export function ContentContainer({ children }: React.PropsWithChildren) {\r\n return <div className=\"container-fluid flex-grow-1\">{children}</div>;\r\n}\r\n","export function ContentRow({ children }: React.PropsWithChildren) {\r\n return <div className=\"row h-100 flex-nowrap\">{children}</div>;\r\n}\r\n","\r\nexport function LayoutWrapper({ children }: React.PropsWithChildren) {\r\n return (\r\n\r\n <div className=\"d-flex flex-column min-vh-100\">{children}</div>\r\n );\r\n}\r\n","// components/Modal.tsx\r\nimport React from \"react\";\r\n\r\nexport interface ModalProps {\r\n title?: string;\r\n isOpen: boolean;\r\n onClose: () => void;\r\n onConfirm?: () => void;\r\n confirmText?: string;\r\n\r\n disableBackdropClose?: boolean;\r\n disableAllButtons?: boolean;\r\n\r\n /** NEW: toggle visibility */\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport const Modal: React.FC<ModalProps> = ({\r\n title,\r\n isOpen,\r\n onClose,\r\n onConfirm,\r\n confirmText = \"OK\",\r\n\r\n disableBackdropClose = false,\r\n disableAllButtons = false,\r\n\r\n showHeaderClose = true,\r\n showCloseButton = true,\r\n showConfirmButton = true,\r\n\r\n children,\r\n}) => {\r\n if (!isOpen) return null;\r\n\r\n const handleBackdropClick = () => {\r\n if (disableBackdropClose || disableAllButtons) return;\r\n onClose();\r\n };\r\n\r\n const handleContentClick: React.MouseEventHandler<HTMLDivElement> = (e) => {\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <>\r\n <div\r\n className=\"modal-backdrop fade show\"\r\n style={{ zIndex: 1040 }}\r\n onClick={handleBackdropClick}\r\n />\r\n\r\n <div\r\n className=\"modal fade show d-block\"\r\n tabIndex={-1}\r\n role=\"dialog\"\r\n style={{ zIndex: 1050 }}\r\n onClick={handleBackdropClick}\r\n >\r\n <div className=\"modal-dialog modal-dialog-centered\" role=\"document\" onClick={handleContentClick}>\r\n <div className=\"modal-content shadow\">\r\n {/* Header */}\r\n <div className=\"modal-header\">\r\n {title && <h5 className=\"modal-title\">{title}</h5>}\r\n\r\n {showHeaderClose && (\r\n <button\r\n type=\"button\"\r\n className=\"btn-close\"\r\n aria-label=\"Close\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n />\r\n )}\r\n </div>\r\n\r\n {/* Body */}\r\n <div className=\"modal-body\">{children}</div>\r\n\r\n {/* Footer */}\r\n <div className=\"modal-footer\">\r\n {showCloseButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-secondary\"\r\n onClick={onClose}\r\n disabled={disableAllButtons}\r\n >\r\n Close\r\n </button>\r\n )}\r\n\r\n {onConfirm && showConfirmButton && (\r\n <button\r\n type=\"button\"\r\n className=\"btn btn-primary\"\r\n onClick={onConfirm}\r\n disabled={disableAllButtons}\r\n >\r\n {confirmText}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n","import {\r\n createContext,\r\n useCallback,\r\n useContext,\r\n useState,\r\n type ReactNode,\r\n} from \"react\";\r\nimport { Modal } from \"./Modal\";\r\n\r\nexport interface ModalOptions {\r\n title?: string;\r\n confirmText?: string;\r\n disableBackdropClose?: boolean;\r\n onConfirm?: () => void;\r\n\r\n /** extra control flags matching Modal.tsx */\r\n disableAllButtons?: boolean;\r\n showHeaderClose?: boolean;\r\n showCloseButton?: boolean;\r\n showConfirmButton?: boolean;\r\n}\r\n\r\ninterface ModalContextValue {\r\n openModal: (content: ReactNode, options?: ModalOptions) => void;\r\n closeModal: () => void;\r\n}\r\n\r\nconst ModalContext = createContext<ModalContextValue | undefined>(undefined);\r\n\r\nexport function ModalProvider({ children }: { children: ReactNode }) {\r\n const [isOpen, setIsOpen] = useState(false);\r\n const [content, setContent] = useState<ReactNode>(null);\r\n const [options, setOptions] = useState<ModalOptions>({});\r\n\r\n const openModal = useCallback((content: ReactNode, options?: ModalOptions) => {\r\n setContent(content);\r\n setOptions(options ?? {});\r\n setIsOpen(true);\r\n }, []);\r\n\r\n const closeModal = useCallback(() => {\r\n setIsOpen(false);\r\n }, []);\r\n\r\n return (\r\n <ModalContext.Provider value={{ openModal, closeModal }}>\r\n {children}\r\n\r\n <Modal\r\n isOpen={isOpen}\r\n title={options.title}\r\n confirmText={options.confirmText}\r\n disableBackdropClose={options.disableBackdropClose}\r\n disableAllButtons={options.disableAllButtons}\r\n showHeaderClose={options.showHeaderClose}\r\n showCloseButton={options.showCloseButton}\r\n showConfirmButton={options.showConfirmButton}\r\n onClose={closeModal}\r\n onConfirm={options.onConfirm}\r\n >\r\n {content}\r\n </Modal>\r\n </ModalContext.Provider>\r\n );\r\n}\r\n\r\nexport function UseModal() {\r\n const ctx = useContext(ModalContext);\r\n if (!ctx) throw new Error(\"UseModal must be used within ModalProvider\");\r\n return ctx;\r\n}\r\n"],"mappings":";AAiBU,cAKgB,YALhB;AATH,IAAM,UAAkC,CAAC,EAAE,KAAK,QAAQ,MAAM;AACnE,SACE,oBAAC,SAAI,WAAU,YACb;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,WAAU;AAAA,MACV,SAAS,MAAM,UAAU,GAAG;AAAA,MAE5B;AAAA,4BAAC,SAAI,WAAU,uEACb,8BAAC,UAAK,OAAO,EAAC,UAAS,OAAM,GAAI,cAAI,MAAK,GAC5C;AAAA,QAEA,qBAAC,UAAK,WAAU,6BACb;AAAA,cAAI;AAAA,UACJ,IAAI,WAAW,qBAAC,WAAM,WAAU,mBAAkB;AAAA;AAAA,YAAE,IAAI;AAAA,aAAQ;AAAA,WACnE;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;;;ACdQ,SAEgB,OAAAA,MAFhB,QAAAC,aAAA;AAJD,SAAS,KAAK,EAAE,MAAM,OAAO,aAAa,SAAS,GAAc;AACtE,SAEI,gBAAAA,MAAC,UAAK,WAAU,WACd;AAAA,oBAAAA,MAAC,QAAI;AAAA;AAAA,MAAK;AAAA,MAAE;AAAA,OAAM;AAAA,IAEjB,eAAe,gBAAAD,KAAC,OAAG,uBAAY;AAAA,IAC/B;AAAA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","jsx","jsxs","jsx","jsxs","useEffect","useState","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsx","jsx","Fragment","jsx","jsxs","createContext","useCallback","useContext","useState","jsx","jsxs","createContext","useState","useCallback","content","options","useContext"]}
|