@doneisbetter/gds-core 2.6.1 → 2.6.4
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/{chunk-6B42ANK7.mjs → chunk-BAS4ZGKL.mjs} +1180 -409
- package/dist/chunk-EN3TN22M.mjs +585 -0
- package/dist/client.d.mts +73 -10
- package/dist/client.d.ts +73 -10
- package/dist/client.js +1470 -461
- package/dist/client.mjs +42 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1470 -461
- package/dist/index.mjs +42 -2
- package/dist/server-BqFksoV3.d.mts +5540 -0
- package/dist/server-BqFksoV3.d.ts +5540 -0
- package/dist/server.d.mts +5 -5292
- package/dist/server.d.ts +5 -5292
- package/dist/server.js +1214 -428
- package/dist/server.mjs +29 -1
- package/package.json +4 -4
- package/dist/chunk-SI66GK77.mjs +0 -366
package/dist/index.js
CHANGED
|
@@ -23,14 +23,18 @@ __export(index_exports, {
|
|
|
23
23
|
AccentPanel: () => AccentPanel,
|
|
24
24
|
AccessRecoveryPanel: () => AccessRecoveryPanel,
|
|
25
25
|
AccessSummary: () => AccessSummary,
|
|
26
|
+
ActionBar: () => ActionBar,
|
|
26
27
|
ArticleShell: () => ArticleShell,
|
|
27
28
|
AuthShell: () => AuthShell,
|
|
28
29
|
BrowseSurface: () => BrowseSurface,
|
|
30
|
+
ChoiceChip: () => ChoiceChip,
|
|
29
31
|
ConfirmDialog: () => ConfirmDialog,
|
|
30
32
|
ConsumerDashboardGrid: () => ConsumerDashboardGrid,
|
|
31
33
|
ConsumerSection: () => ConsumerSection,
|
|
32
34
|
CtaButtonGroup: () => CtaButtonGroup,
|
|
33
35
|
DataToolbar: () => DataToolbar,
|
|
36
|
+
DetailProfileShell: () => DetailProfileShell,
|
|
37
|
+
DiscoveryShell: () => DiscoveryShell,
|
|
34
38
|
DocsCodeBlock: () => DocsCodeBlock,
|
|
35
39
|
DocsPageShell: () => DocsPageShell,
|
|
36
40
|
EditorialCard: () => EditorialCard,
|
|
@@ -38,41 +42,57 @@ __export(index_exports, {
|
|
|
38
42
|
EmptyState: () => EmptyState,
|
|
39
43
|
FeatureBand: () => FeatureBand,
|
|
40
44
|
FilterDrawer: () => FilterDrawer,
|
|
45
|
+
FoodMenuSection: () => FoodMenuSection,
|
|
41
46
|
FormField: () => FormField,
|
|
42
47
|
GameBoardTile: () => GameBoardTile,
|
|
43
48
|
GdsIcons: () => GdsIcons,
|
|
44
49
|
GdsVocabulary: () => GdsVocabulary,
|
|
50
|
+
ListingCard: () => ListingCard,
|
|
51
|
+
MapPanel: () => MapPanel,
|
|
45
52
|
MediaCard: () => MediaCard,
|
|
46
53
|
MediaField: () => MediaField,
|
|
47
54
|
MetricCard: () => MetricCard,
|
|
48
55
|
PageHeader: () => PageHeader,
|
|
49
56
|
PlaceholderPanel: () => PlaceholderPanel,
|
|
57
|
+
PlaybackSurface: () => PlaybackSurface,
|
|
50
58
|
ProductCard: () => ProductCard,
|
|
51
59
|
ProgressCard: () => ProgressCard,
|
|
52
60
|
PublicBrandFooter: () => PublicBrandFooter,
|
|
61
|
+
PublicFlowShell: () => PublicFlowShell,
|
|
62
|
+
PublicFoodCard: () => PublicFoodCard,
|
|
53
63
|
PublicNav: () => PublicNav,
|
|
54
64
|
PublicProductCard: () => PublicProductCard,
|
|
55
65
|
PublicShell: () => PublicShell,
|
|
56
66
|
PublicSiteFooter: () => PublicSiteFooter,
|
|
57
67
|
SectionPanel: () => SectionPanel,
|
|
58
68
|
SemanticButton: () => SemanticButton,
|
|
69
|
+
ShareButtonGroup: () => ShareButtonGroup,
|
|
70
|
+
SidebarNav: () => SidebarNav,
|
|
71
|
+
SidebarNavItem: () => SidebarNavItem,
|
|
72
|
+
SidebarNavSection: () => SidebarNavSection,
|
|
59
73
|
SimpleDataTable: () => SimpleDataTable,
|
|
74
|
+
SocialAuthButtons: () => SocialAuthButtons,
|
|
60
75
|
StateBlock: () => StateBlock,
|
|
61
76
|
StatsSection: () => StatsSection,
|
|
62
77
|
StatusBadge: () => StatusBadge,
|
|
63
78
|
ThemeToggle: () => ThemeToggle,
|
|
64
79
|
UploadDropzone: () => UploadDropzone,
|
|
65
80
|
ar: () => ar,
|
|
81
|
+
createGdsVocabularyPack: () => createGdsVocabularyPack,
|
|
66
82
|
de: () => de,
|
|
67
83
|
en: () => en,
|
|
68
84
|
es: () => es,
|
|
69
85
|
fr: () => fr,
|
|
70
86
|
gdsLocales: () => gdsLocales,
|
|
71
87
|
getGdsMessages: () => getGdsMessages,
|
|
88
|
+
getSemanticActionConfig: () => getSemanticActionConfig,
|
|
89
|
+
getSemanticActionLabel: () => getSemanticActionLabel,
|
|
72
90
|
he: () => he,
|
|
73
91
|
hu: () => hu,
|
|
74
92
|
it: () => it,
|
|
93
|
+
mergeGdsVocabularyPacks: () => mergeGdsVocabularyPacks,
|
|
75
94
|
resolveAccentPanelStyles: () => resolveAccentPanelStyles,
|
|
95
|
+
resolveSemanticActionConfig: () => resolveSemanticActionConfig,
|
|
76
96
|
ru: () => ru
|
|
77
97
|
});
|
|
78
98
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -222,7 +242,6 @@ var GdsIcons = {
|
|
|
222
242
|
|
|
223
243
|
// src/vocabulary.ts
|
|
224
244
|
var GdsVocabulary = {
|
|
225
|
-
// Base
|
|
226
245
|
settings: { id: "gds.action.settings", defaultMessage: "Settings", icon: GdsIcons.Settings, feedback: { icon: GdsIcons.Settings, color: "teal", messageId: "gds.feedback.saved" } },
|
|
227
246
|
analytics: { id: "gds.action.analytics", defaultMessage: "Analytics", icon: GdsIcons.Analytics, feedback: { icon: GdsIcons.Analytics, color: "teal", messageId: "gds.feedback.loaded" } },
|
|
228
247
|
dashboard: { id: "gds.action.dashboard", defaultMessage: "Dashboard", icon: GdsIcons.Dashboard, feedback: { icon: GdsIcons.Dashboard, color: "teal", messageId: "gds.feedback.loaded" } },
|
|
@@ -238,14 +257,12 @@ var GdsVocabulary = {
|
|
|
238
257
|
close: { id: "gds.action.close", defaultMessage: "Close", icon: GdsIcons.Close, feedback: { icon: GdsIcons.Close, color: "gray", messageId: "gds.feedback.closed" } },
|
|
239
258
|
language: { id: "gds.action.language", defaultMessage: "Language", icon: GdsIcons.Language, feedback: { icon: GdsIcons.Language, color: "teal", messageId: "gds.feedback.changed" } },
|
|
240
259
|
theme: { id: "gds.action.theme", defaultMessage: "Theme", icon: GdsIcons.Theme, feedback: { icon: GdsIcons.Theme, color: "teal", messageId: "gds.feedback.changed" } },
|
|
241
|
-
// Navigation
|
|
242
260
|
home: { id: "gds.action.home", defaultMessage: "Home", icon: GdsIcons.Home, feedback: { icon: GdsIcons.Home, color: "teal", messageId: "gds.feedback.opened" } },
|
|
243
261
|
inbox: { id: "gds.action.inbox", defaultMessage: "Inbox", icon: GdsIcons.Inbox, feedback: { icon: GdsIcons.Inbox, color: "teal", messageId: "gds.feedback.opened" } },
|
|
244
262
|
calendar: { id: "gds.action.calendar", defaultMessage: "Calendar", icon: GdsIcons.Calendar, feedback: { icon: GdsIcons.Calendar, color: "teal", messageId: "gds.feedback.opened" } },
|
|
245
263
|
gallery: { id: "gds.action.gallery", defaultMessage: "Gallery", icon: GdsIcons.Gallery, feedback: { icon: GdsIcons.Gallery, color: "teal", messageId: "gds.feedback.opened" } },
|
|
246
264
|
history: { id: "gds.action.history", defaultMessage: "History", icon: GdsIcons.History, feedback: { icon: GdsIcons.History, color: "teal", messageId: "gds.feedback.opened" } },
|
|
247
265
|
profile: { id: "gds.action.profile", defaultMessage: "Profile", icon: GdsIcons.Profile, feedback: { icon: GdsIcons.Profile, color: "teal", messageId: "gds.feedback.opened" } },
|
|
248
|
-
// Actions
|
|
249
266
|
send: { id: "gds.action.send", defaultMessage: "Send", icon: GdsIcons.Send, feedback: { icon: GdsIcons.Send, color: "blue", messageId: "gds.feedback.sent" } },
|
|
250
267
|
reply: { id: "gds.action.reply", defaultMessage: "Reply", icon: GdsIcons.Reply, feedback: { icon: GdsIcons.Reply, color: "blue", messageId: "gds.feedback.replied" } },
|
|
251
268
|
forward: { id: "gds.action.forward", defaultMessage: "Forward", icon: GdsIcons.Forward, feedback: { icon: GdsIcons.Forward, color: "blue", messageId: "gds.feedback.forwarded" } },
|
|
@@ -259,12 +276,10 @@ var GdsVocabulary = {
|
|
|
259
276
|
uncheck: { id: "gds.action.uncheck", defaultMessage: "Uncheck", icon: GdsIcons.Uncheck, feedback: { icon: GdsIcons.Uncheck, color: "red", messageId: "gds.feedback.unchecked" } },
|
|
260
277
|
complete: { id: "gds.action.complete", defaultMessage: "Complete", icon: GdsIcons.Complete, feedback: { icon: GdsIcons.Complete, color: "teal", messageId: "gds.feedback.completed" } },
|
|
261
278
|
clear: { id: "gds.action.clear", defaultMessage: "Clear", icon: GdsIcons.Clear, feedback: { icon: GdsIcons.Clear, color: "red", messageId: "gds.feedback.cleared" } },
|
|
262
|
-
// Media (camera project)
|
|
263
279
|
capture: { id: "gds.action.capture", defaultMessage: "Capture", icon: GdsIcons.Capture, feedback: { icon: GdsIcons.Capture, color: "teal", messageId: "gds.feedback.captured" } },
|
|
264
280
|
record: { id: "gds.action.record", defaultMessage: "Record", icon: GdsIcons.Record, feedback: { icon: GdsIcons.Record, color: "teal", messageId: "gds.feedback.recorded" } },
|
|
265
281
|
flip: { id: "gds.action.flip", defaultMessage: "Flip", icon: GdsIcons.Flip, feedback: { icon: GdsIcons.Flip, color: "teal", messageId: "gds.feedback.flipped" } },
|
|
266
282
|
flash: { id: "gds.action.flash", defaultMessage: "Flash", icon: GdsIcons.Flash, feedback: { icon: GdsIcons.Flash, color: "teal", messageId: "gds.feedback.flashed" } },
|
|
267
|
-
// Domain specific (amanoba, classscout, kidex, habigoal)
|
|
268
283
|
course: { id: "gds.action.course", defaultMessage: "Course", icon: GdsIcons.Course, feedback: { icon: GdsIcons.Course, color: "teal", messageId: "gds.feedback.done" } },
|
|
269
284
|
lesson: { id: "gds.action.lesson", defaultMessage: "Lesson", icon: GdsIcons.Lesson, feedback: { icon: GdsIcons.Lesson, color: "teal", messageId: "gds.feedback.done" } },
|
|
270
285
|
certificate: { id: "gds.action.certificate", defaultMessage: "Certificate", icon: GdsIcons.Certificate, feedback: { icon: GdsIcons.Certificate, color: "teal", messageId: "gds.feedback.done" } },
|
|
@@ -277,7 +292,6 @@ var GdsVocabulary = {
|
|
|
277
292
|
goal: { id: "gds.action.goal", defaultMessage: "Goal", icon: GdsIcons.Goal, feedback: { icon: GdsIcons.Goal, color: "teal", messageId: "gds.feedback.done" } },
|
|
278
293
|
streak: { id: "gds.action.streak", defaultMessage: "Streak", icon: GdsIcons.Streak, feedback: { icon: GdsIcons.Streak, color: "teal", messageId: "gds.feedback.done" } },
|
|
279
294
|
reward: { id: "gds.action.reward", defaultMessage: "Reward", icon: GdsIcons.Reward, feedback: { icon: GdsIcons.Reward, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
280
|
-
// Codebase analysis additions
|
|
281
295
|
trophy: { id: "gds.action.trophy", defaultMessage: "Trophy", icon: GdsIcons.Trophy, feedback: { icon: GdsIcons.Trophy, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
282
296
|
crown: { id: "gds.action.crown", defaultMessage: "Crown", icon: GdsIcons.Crown, feedback: { icon: GdsIcons.Crown, color: "yellow", messageId: "gds.feedback.rewarded" } },
|
|
283
297
|
pause: { id: "gds.action.pause", defaultMessage: "Pause", icon: GdsIcons.Pause, feedback: { icon: GdsIcons.Pause, color: "teal", messageId: "gds.feedback.paused" } },
|
|
@@ -297,7 +311,6 @@ var GdsVocabulary = {
|
|
|
297
311
|
help: { id: "gds.action.help", defaultMessage: "Help", icon: GdsIcons.Help, feedback: { icon: GdsIcons.Help, color: "teal", messageId: "gds.feedback.done" } },
|
|
298
312
|
filter: { id: "gds.action.filter", defaultMessage: "Filter", icon: GdsIcons.Filter, feedback: { icon: GdsIcons.Filter, color: "teal", messageId: "gds.feedback.filtered" } },
|
|
299
313
|
sort: { id: "gds.action.sort", defaultMessage: "Sort", icon: GdsIcons.Sort, feedback: { icon: GdsIcons.Sort, color: "teal", messageId: "gds.feedback.sorted" } },
|
|
300
|
-
// Audit-driven additions
|
|
301
314
|
export: { id: "gds.action.export", defaultMessage: "Export", icon: GdsIcons.Export, feedback: { icon: GdsIcons.Export, color: "teal", messageId: "gds.feedback.exported" } },
|
|
302
315
|
import: { id: "gds.action.import", defaultMessage: "Import", icon: GdsIcons.Import, feedback: { icon: GdsIcons.Import, color: "teal", messageId: "gds.feedback.imported" } },
|
|
303
316
|
preview: { id: "gds.action.preview", defaultMessage: "Preview", icon: GdsIcons.Preview, feedback: { icon: GdsIcons.Preview, color: "teal", messageId: "gds.feedback.previewed" } },
|
|
@@ -315,13 +328,68 @@ var GdsVocabulary = {
|
|
|
315
328
|
refer: { id: "gds.action.refer", defaultMessage: "Refer", icon: GdsIcons.Refer, feedback: { icon: GdsIcons.Refer, color: "teal", messageId: "gds.feedback.referred" } },
|
|
316
329
|
evidence: { id: "gds.action.evidence", defaultMessage: "Evidence", icon: GdsIcons.Evidence, feedback: { icon: GdsIcons.Evidence, color: "teal", messageId: "gds.feedback.added" } }
|
|
317
330
|
};
|
|
331
|
+
function createGdsVocabularyPack(namespace, actions) {
|
|
332
|
+
return {
|
|
333
|
+
namespace,
|
|
334
|
+
actions: Object.fromEntries(
|
|
335
|
+
Object.entries(actions).map(([key, definition]) => [
|
|
336
|
+
`${namespace}:${key}`,
|
|
337
|
+
{
|
|
338
|
+
...definition,
|
|
339
|
+
id: `gds.action.${namespace}.${key}`
|
|
340
|
+
}
|
|
341
|
+
])
|
|
342
|
+
)
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function mergeGdsVocabularyPacks(packs = []) {
|
|
346
|
+
return packs.reduce((acc, pack) => {
|
|
347
|
+
for (const [key, definition] of Object.entries(pack.actions)) {
|
|
348
|
+
acc[key] = definition;
|
|
349
|
+
}
|
|
350
|
+
return acc;
|
|
351
|
+
}, {});
|
|
352
|
+
}
|
|
353
|
+
function resolveSemanticActionConfig(action, packs = []) {
|
|
354
|
+
const baseConfig = GdsVocabulary[action];
|
|
355
|
+
if (baseConfig) {
|
|
356
|
+
return baseConfig;
|
|
357
|
+
}
|
|
358
|
+
const merged = mergeGdsVocabularyPacks(packs);
|
|
359
|
+
const packConfig = merged[action];
|
|
360
|
+
if (packConfig) {
|
|
361
|
+
return packConfig;
|
|
362
|
+
}
|
|
363
|
+
throw new Error(`Unknown semantic action: ${action}`);
|
|
364
|
+
}
|
|
365
|
+
function getSemanticActionConfig(action, packs = []) {
|
|
366
|
+
return resolveSemanticActionConfig(action, packs);
|
|
367
|
+
}
|
|
368
|
+
function getSemanticActionLabel(action, translate, packs = []) {
|
|
369
|
+
const config = resolveSemanticActionConfig(action, packs);
|
|
370
|
+
return translate ? translate(config.id, config.defaultMessage) : config.defaultMessage;
|
|
371
|
+
}
|
|
318
372
|
|
|
319
373
|
// src/SemanticButton.tsx
|
|
320
374
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
321
|
-
function SemanticButton({
|
|
375
|
+
function SemanticButton({
|
|
376
|
+
action,
|
|
377
|
+
loading,
|
|
378
|
+
feedbackState,
|
|
379
|
+
feedbackText,
|
|
380
|
+
prerenderLabelOnly = true,
|
|
381
|
+
vocabularyPacks = [],
|
|
382
|
+
...props
|
|
383
|
+
}) {
|
|
322
384
|
const { t } = (0, import_gds_theme.useGdsTranslation)();
|
|
323
|
-
const config =
|
|
385
|
+
const config = resolveSemanticActionConfig(action, vocabularyPacks);
|
|
386
|
+
const [mounted, setMounted] = (0, import_react.useState)(!prerenderLabelOnly);
|
|
324
387
|
const [internalFeedback, setInternalFeedback] = (0, import_react.useState)(null);
|
|
388
|
+
(0, import_react.useEffect)(() => {
|
|
389
|
+
if (prerenderLabelOnly) {
|
|
390
|
+
setMounted(true);
|
|
391
|
+
}
|
|
392
|
+
}, [prerenderLabelOnly]);
|
|
325
393
|
(0, import_react.useEffect)(() => {
|
|
326
394
|
if (feedbackState) {
|
|
327
395
|
setInternalFeedback(feedbackState);
|
|
@@ -330,10 +398,14 @@ function SemanticButton({ action, loading, feedbackState, feedbackText, ...props
|
|
|
330
398
|
}
|
|
331
399
|
}, [feedbackState]);
|
|
332
400
|
let Icon = config.icon;
|
|
333
|
-
let label =
|
|
401
|
+
let label = getSemanticActionLabel(action, t, vocabularyPacks);
|
|
334
402
|
let color = props.color;
|
|
403
|
+
if (!mounted) {
|
|
404
|
+
const { leftSection, ...buttonProps } = props;
|
|
405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Button, { loading, color, ...buttonProps, children: getSemanticActionLabel(action, void 0, vocabularyPacks) });
|
|
406
|
+
}
|
|
335
407
|
if (internalFeedback === "success") {
|
|
336
|
-
const defaultFeedback =
|
|
408
|
+
const defaultFeedback = config.feedback ?? { icon: import_icons_react2.IconCheck, color: "teal", messageId: "gds.feedback.saved" };
|
|
337
409
|
Icon = defaultFeedback.icon;
|
|
338
410
|
label = feedbackText || t(defaultFeedback.messageId, "Success");
|
|
339
411
|
color = defaultFeedback.color;
|
|
@@ -400,34 +472,136 @@ function ThemeToggle({ size = "md" }) {
|
|
|
400
472
|
);
|
|
401
473
|
}
|
|
402
474
|
|
|
403
|
-
// src/
|
|
475
|
+
// src/ChoiceChip.tsx
|
|
404
476
|
var import_core6 = require("@mantine/core");
|
|
405
477
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
478
|
+
function ChoiceChip({
|
|
479
|
+
label,
|
|
480
|
+
active = false,
|
|
481
|
+
href,
|
|
482
|
+
onClick,
|
|
483
|
+
component,
|
|
484
|
+
...props
|
|
485
|
+
}) {
|
|
486
|
+
const sharedProps = {
|
|
487
|
+
variant: active ? "filled" : "light",
|
|
488
|
+
size: "sm",
|
|
489
|
+
radius: "xl",
|
|
490
|
+
...props
|
|
491
|
+
};
|
|
492
|
+
if (href) {
|
|
493
|
+
const LinkComponent = component || "a";
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
495
|
+
import_core6.Badge,
|
|
496
|
+
{
|
|
497
|
+
component: LinkComponent,
|
|
498
|
+
href,
|
|
499
|
+
"aria-current": active ? "page" : void 0,
|
|
500
|
+
...sharedProps,
|
|
501
|
+
children: label
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
if (onClick || component) {
|
|
506
|
+
const ButtonComponent = component || "button";
|
|
507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
508
|
+
import_core6.Badge,
|
|
509
|
+
{
|
|
510
|
+
component: ButtonComponent,
|
|
511
|
+
type: component ? void 0 : "button",
|
|
512
|
+
onClick,
|
|
513
|
+
"aria-pressed": onClick ? active : void 0,
|
|
514
|
+
...sharedProps,
|
|
515
|
+
children: label
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core6.Badge, { ...sharedProps, children: label });
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
// src/ActionBar.tsx
|
|
523
|
+
var import_core7 = require("@mantine/core");
|
|
524
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
525
|
+
function renderSemanticAction(action, slot, vocabularyPacks) {
|
|
526
|
+
const { action: actionId, variant, ariaLabel, ...props } = action;
|
|
527
|
+
const fallbackVariant = slot === "primary" ? "filled" : slot === "secondary" ? "default" : "subtle";
|
|
528
|
+
const config = resolveSemanticActionConfig(actionId, vocabularyPacks);
|
|
529
|
+
const Icon = config.icon;
|
|
530
|
+
const label = getSemanticActionLabel(actionId, void 0, vocabularyPacks);
|
|
531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
532
|
+
import_core7.Button,
|
|
533
|
+
{
|
|
534
|
+
leftSection: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "1rem", stroke: 1.75 }),
|
|
535
|
+
"aria-label": ariaLabel ?? label,
|
|
536
|
+
variant: variant ?? fallbackVariant,
|
|
537
|
+
...props,
|
|
538
|
+
children: label
|
|
539
|
+
},
|
|
540
|
+
`${slot}-${actionId}`
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
function ActionBar({
|
|
544
|
+
primary,
|
|
545
|
+
secondary = [],
|
|
546
|
+
tertiary = [],
|
|
547
|
+
iconOnly = [],
|
|
548
|
+
gap = "sm",
|
|
549
|
+
vocabularyPacks = []
|
|
550
|
+
}) {
|
|
551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core7.Stack, { gap, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core7.Group, { justify: "space-between", align: "center", gap, wrap: "wrap", children: [
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core7.Group, { gap, wrap: "wrap", children: [
|
|
553
|
+
secondary.map((action) => renderSemanticAction(action, "secondary", vocabularyPacks)),
|
|
554
|
+
tertiary.map((action) => renderSemanticAction(action, "tertiary", vocabularyPacks))
|
|
555
|
+
] }),
|
|
556
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_core7.Group, { gap, wrap: "wrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
|
|
557
|
+
iconOnly.map(({ action, ariaLabel, ...props }) => {
|
|
558
|
+
const config = resolveSemanticActionConfig(action, vocabularyPacks);
|
|
559
|
+
const Icon = config.icon;
|
|
560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
561
|
+
import_core7.ActionIcon,
|
|
562
|
+
{
|
|
563
|
+
variant: "subtle",
|
|
564
|
+
size: "lg",
|
|
565
|
+
"aria-label": ariaLabel ?? getSemanticActionLabel(action, void 0, vocabularyPacks),
|
|
566
|
+
...props,
|
|
567
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { size: "1rem", stroke: 1.75 })
|
|
568
|
+
},
|
|
569
|
+
`icon-${action}`
|
|
570
|
+
);
|
|
571
|
+
}),
|
|
572
|
+
primary ? renderSemanticAction(primary, "primary", vocabularyPacks) : null
|
|
573
|
+
] })
|
|
574
|
+
] }) });
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
// src/MetricCard.tsx
|
|
578
|
+
var import_core8 = require("@mantine/core");
|
|
579
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
406
580
|
var trendColors = {
|
|
407
581
|
positive: "teal",
|
|
408
582
|
negative: "red",
|
|
409
583
|
neutral: "gray"
|
|
410
584
|
};
|
|
411
585
|
function MetricCard({ label, value, description, trend, icon, footer }) {
|
|
412
|
-
return /* @__PURE__ */ (0,
|
|
413
|
-
/* @__PURE__ */ (0,
|
|
414
|
-
/* @__PURE__ */ (0,
|
|
415
|
-
/* @__PURE__ */ (0,
|
|
416
|
-
/* @__PURE__ */ (0,
|
|
586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core8.Stack, { gap: "md", children: [
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core8.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core8.Stack, { gap: 4, children: [
|
|
589
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Text, { size: "sm", c: "dimmed", fw: 600, children: label }),
|
|
590
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Title, { order: 3, children: value })
|
|
417
591
|
] }),
|
|
418
|
-
icon ? /* @__PURE__ */ (0,
|
|
592
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.ThemeIcon, { variant: "light", size: "xl", radius: "xl", "aria-hidden": true, children: icon }) : null
|
|
419
593
|
] }),
|
|
420
|
-
description || trend ? /* @__PURE__ */ (0,
|
|
421
|
-
description ? /* @__PURE__ */ (0,
|
|
422
|
-
trend ? /* @__PURE__ */ (0,
|
|
594
|
+
description || trend ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core8.Group, { justify: "space-between", align: "center", gap: "sm", children: [
|
|
595
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Text, { size: "sm", c: "dimmed", flex: 1, children: description }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {}),
|
|
596
|
+
trend ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core8.Badge, { color: trendColors[trend.tone ?? "neutral"], variant: "light", children: trend.label }) : null
|
|
423
597
|
] }) : null,
|
|
424
598
|
footer
|
|
425
599
|
] }) });
|
|
426
600
|
}
|
|
427
601
|
|
|
428
602
|
// src/ProgressCard.tsx
|
|
429
|
-
var
|
|
430
|
-
var
|
|
603
|
+
var import_core9 = require("@mantine/core");
|
|
604
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
431
605
|
function ProgressCard({
|
|
432
606
|
label,
|
|
433
607
|
value,
|
|
@@ -436,31 +610,31 @@ function ProgressCard({
|
|
|
436
610
|
description,
|
|
437
611
|
action
|
|
438
612
|
}) {
|
|
439
|
-
return /* @__PURE__ */ (0,
|
|
440
|
-
/* @__PURE__ */ (0,
|
|
441
|
-
/* @__PURE__ */ (0,
|
|
442
|
-
/* @__PURE__ */ (0,
|
|
443
|
-
/* @__PURE__ */ (0,
|
|
613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Stack, { gap: "md", children: [
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Group, { justify: "space-between", align: "flex-start", children: [
|
|
615
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Stack, { gap: 4, children: [
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Text, { size: "sm", c: "dimmed", fw: 600, children: label }),
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Title, { order: 3, children: value })
|
|
444
618
|
] }),
|
|
445
619
|
action
|
|
446
620
|
] }),
|
|
447
|
-
description ? /* @__PURE__ */ (0,
|
|
448
|
-
/* @__PURE__ */ (0,
|
|
449
|
-
/* @__PURE__ */ (0,
|
|
450
|
-
/* @__PURE__ */ (0,
|
|
451
|
-
/* @__PURE__ */ (0,
|
|
621
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
622
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Stack, { gap: 6, children: [
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Group, { justify: "space-between", gap: "sm", children: [
|
|
624
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Text, { size: "sm", fw: 500, children: progressLabel ?? "Progress" }),
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core9.Text, { size: "sm", c: "dimmed", children: [
|
|
452
626
|
Math.round(progress),
|
|
453
627
|
"%"
|
|
454
628
|
] })
|
|
455
629
|
] }),
|
|
456
|
-
/* @__PURE__ */ (0,
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_core9.Progress, { value: progress, radius: "xl", size: "md" })
|
|
457
631
|
] })
|
|
458
632
|
] }) });
|
|
459
633
|
}
|
|
460
634
|
|
|
461
635
|
// src/SectionPanel.tsx
|
|
462
|
-
var
|
|
463
|
-
var
|
|
636
|
+
var import_core10 = require("@mantine/core");
|
|
637
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
464
638
|
var toneBackgrounds = {
|
|
465
639
|
default: "var(--mantine-color-body)",
|
|
466
640
|
supporting: "light-dark(var(--mantine-color-gray-0), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))",
|
|
@@ -476,23 +650,23 @@ function SectionPanel({
|
|
|
476
650
|
id,
|
|
477
651
|
divided = true
|
|
478
652
|
}) {
|
|
479
|
-
return /* @__PURE__ */ (0,
|
|
480
|
-
title || description || action ? /* @__PURE__ */ (0,
|
|
481
|
-
/* @__PURE__ */ (0,
|
|
482
|
-
title || description ? /* @__PURE__ */ (0,
|
|
483
|
-
title ? /* @__PURE__ */ (0,
|
|
484
|
-
description ? /* @__PURE__ */ (0,
|
|
653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Paper, { id, withBorder: true, radius: "xl", p: "lg", style: { background: toneBackgrounds[tone] }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core10.Stack, { gap: "md", children: [
|
|
654
|
+
title || description || action ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
655
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core10.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
656
|
+
title || description ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_core10.Stack, { gap: 4, children: [
|
|
657
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Title, { order: 3, children: title }) : null,
|
|
658
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
485
659
|
] }) : null,
|
|
486
660
|
action
|
|
487
661
|
] }),
|
|
488
|
-
divided ? /* @__PURE__ */ (0,
|
|
662
|
+
divided ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_core10.Divider, {}) : null
|
|
489
663
|
] }) : null,
|
|
490
664
|
children
|
|
491
665
|
] }) });
|
|
492
666
|
}
|
|
493
667
|
|
|
494
668
|
// src/ConsumerSection.tsx
|
|
495
|
-
var
|
|
669
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
496
670
|
function ConsumerSection({
|
|
497
671
|
title,
|
|
498
672
|
description,
|
|
@@ -500,23 +674,23 @@ function ConsumerSection({
|
|
|
500
674
|
children,
|
|
501
675
|
tone = "default"
|
|
502
676
|
}) {
|
|
503
|
-
return /* @__PURE__ */ (0,
|
|
677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionPanel, { title, description, action, tone, children });
|
|
504
678
|
}
|
|
505
679
|
|
|
506
680
|
// src/ConsumerDashboardGrid.tsx
|
|
507
|
-
var
|
|
508
|
-
var
|
|
681
|
+
var import_core11 = require("@mantine/core");
|
|
682
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
509
683
|
function ConsumerDashboardGrid({
|
|
510
684
|
children,
|
|
511
685
|
columns = 3
|
|
512
686
|
}) {
|
|
513
|
-
return /* @__PURE__ */ (0,
|
|
687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_core11.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children });
|
|
514
688
|
}
|
|
515
689
|
|
|
516
690
|
// src/GameBoardTile.tsx
|
|
517
|
-
var
|
|
691
|
+
var import_core12 = require("@mantine/core");
|
|
518
692
|
var import_hooks = require("@mantine/hooks");
|
|
519
|
-
var
|
|
693
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
520
694
|
function GameBoardTile({
|
|
521
695
|
face,
|
|
522
696
|
revealed,
|
|
@@ -525,12 +699,12 @@ function GameBoardTile({
|
|
|
525
699
|
onPress,
|
|
526
700
|
highlightColor
|
|
527
701
|
}) {
|
|
528
|
-
const theme = (0,
|
|
702
|
+
const theme = (0, import_core12.useMantineTheme)();
|
|
529
703
|
const reduceMotion = (0, import_hooks.useMediaQuery)("(prefers-reduced-motion: reduce)");
|
|
530
704
|
const highlighted = revealed && !matched;
|
|
531
705
|
const revealBg = highlightColor ?? (typeof theme.primaryColor === "string" ? `${theme.primaryColor}.5` : "violet.5");
|
|
532
|
-
return /* @__PURE__ */ (0,
|
|
533
|
-
|
|
706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.UnstyledButton, { w: "100%", disabled, onClick: onPress, "aria-pressed": revealed, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
707
|
+
import_core12.Paper,
|
|
534
708
|
{
|
|
535
709
|
withBorder: true,
|
|
536
710
|
radius: "md",
|
|
@@ -545,14 +719,14 @@ function GameBoardTile({
|
|
|
545
719
|
transform: reduceMotion || !highlighted ? "scale(1)" : "scale(1.02)"
|
|
546
720
|
}
|
|
547
721
|
},
|
|
548
|
-
children: /* @__PURE__ */ (0,
|
|
722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Center, { h: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { size: "xl", fw: 700, children: face }) })
|
|
549
723
|
}
|
|
550
724
|
) });
|
|
551
725
|
}
|
|
552
726
|
|
|
553
727
|
// src/EditorialCard.tsx
|
|
554
|
-
var
|
|
555
|
-
var
|
|
728
|
+
var import_core13 = require("@mantine/core");
|
|
729
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
556
730
|
var tonePalette = {
|
|
557
731
|
default: {
|
|
558
732
|
accent: "violet",
|
|
@@ -572,8 +746,8 @@ var tonePalette = {
|
|
|
572
746
|
}
|
|
573
747
|
};
|
|
574
748
|
function EditorialMediaFallback({ compact }) {
|
|
575
|
-
return /* @__PURE__ */ (0,
|
|
576
|
-
|
|
749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.AspectRatio, { ratio: compact ? 16 / 10 : 4 / 3, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
750
|
+
import_core13.Box,
|
|
577
751
|
{
|
|
578
752
|
style: {
|
|
579
753
|
display: "grid",
|
|
@@ -583,7 +757,7 @@ function EditorialMediaFallback({ compact }) {
|
|
|
583
757
|
background: "var(--mantine-color-gray-0)",
|
|
584
758
|
borderRadius: "var(--mantine-radius-md)"
|
|
585
759
|
},
|
|
586
|
-
children: /* @__PURE__ */ (0,
|
|
760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GdsIcons.Gallery, { size: compact ? "1.5rem" : "2rem" })
|
|
587
761
|
}
|
|
588
762
|
) });
|
|
589
763
|
}
|
|
@@ -606,8 +780,8 @@ function EditorialCard({
|
|
|
606
780
|
const featured = variant === "featured";
|
|
607
781
|
const palette = tonePalette[tone];
|
|
608
782
|
const interactiveProps = href ? { component: "a", href } : onClick ? { component: "button", onClick, type: "button" } : {};
|
|
609
|
-
return /* @__PURE__ */ (0,
|
|
610
|
-
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
784
|
+
import_core13.Card,
|
|
611
785
|
{
|
|
612
786
|
className: classNames?.root,
|
|
613
787
|
withBorder: true,
|
|
@@ -621,21 +795,21 @@ function EditorialCard({
|
|
|
621
795
|
cursor: href || onClick ? "pointer" : "default"
|
|
622
796
|
},
|
|
623
797
|
children: [
|
|
624
|
-
/* @__PURE__ */ (0,
|
|
625
|
-
/* @__PURE__ */ (0,
|
|
626
|
-
/* @__PURE__ */ (0,
|
|
627
|
-
/* @__PURE__ */ (0,
|
|
628
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
629
|
-
/* @__PURE__ */ (0,
|
|
798
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Card.Section, { className: classNames?.media, children: media ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(EditorialMediaFallback, { compact }) }),
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core13.Stack, { gap: "md", p: compact ? "md" : "lg", className: classNames?.body, children: [
|
|
800
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core13.Group, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "wrap", children: [
|
|
801
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core13.Stack, { gap: 4, flex: 1, children: [
|
|
802
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Text, { size: "xs", fw: 700, c: "dimmed", children: eyebrow }) : null,
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Title, { order: compact ? 4 : 3, className: classNames?.title, children: title })
|
|
630
804
|
] }),
|
|
631
|
-
badge ? typeof badge === "string" ? /* @__PURE__ */ (0,
|
|
805
|
+
badge ? typeof badge === "string" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Badge, { color: palette.accent, variant: "light", children: badge }) : badge : null
|
|
632
806
|
] }),
|
|
633
|
-
description ? /* @__PURE__ */ (0,
|
|
634
|
-
meta ? /* @__PURE__ */ (0,
|
|
635
|
-
href || onClick || ctaLabel ? /* @__PURE__ */ (0,
|
|
636
|
-
/* @__PURE__ */ (0,
|
|
637
|
-
/* @__PURE__ */ (0,
|
|
638
|
-
|
|
807
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
808
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Text, { size: "sm", c: "dimmed", className: classNames?.meta, children: meta }) : null,
|
|
809
|
+
href || onClick || ctaLabel ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_core13.Group, { gap: 6, c: `${palette.accent}.7`, className: classNames?.action, children: [
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_core13.Text, { fw: 600, size: "sm", children: ctaLabel }),
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
812
|
+
import_core13.Anchor,
|
|
639
813
|
{
|
|
640
814
|
component: "span",
|
|
641
815
|
underline: "never",
|
|
@@ -652,8 +826,8 @@ function EditorialCard({
|
|
|
652
826
|
}
|
|
653
827
|
|
|
654
828
|
// src/ProductCard.tsx
|
|
655
|
-
var
|
|
656
|
-
var
|
|
829
|
+
var import_core14 = require("@mantine/core");
|
|
830
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
657
831
|
function ProductCard({
|
|
658
832
|
title,
|
|
659
833
|
description,
|
|
@@ -666,39 +840,39 @@ function ProductCard({
|
|
|
666
840
|
footer
|
|
667
841
|
}) {
|
|
668
842
|
const MoreIcon = GdsIcons.Menu;
|
|
669
|
-
return /* @__PURE__ */ (0,
|
|
843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Stack, { gap: "md", children: [
|
|
670
844
|
media,
|
|
671
|
-
/* @__PURE__ */ (0,
|
|
672
|
-
/* @__PURE__ */ (0,
|
|
673
|
-
icon ? /* @__PURE__ */ (0,
|
|
674
|
-
/* @__PURE__ */ (0,
|
|
675
|
-
/* @__PURE__ */ (0,
|
|
676
|
-
description ? /* @__PURE__ */ (0,
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Group, { align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
847
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.ThemeIcon, { variant: "light", size: "xl", radius: "xl", "aria-hidden": true, children: icon }) : null,
|
|
848
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Stack, { gap: 4, children: [
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Title, { order: 4, children: title }),
|
|
850
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", lineClamp: 3, children: description }) : null
|
|
677
851
|
] })
|
|
678
852
|
] }),
|
|
679
|
-
/* @__PURE__ */ (0,
|
|
680
|
-
typeof status === "string" ? /* @__PURE__ */ (0,
|
|
681
|
-
secondaryActions.length ? /* @__PURE__ */ (0,
|
|
682
|
-
/* @__PURE__ */ (0,
|
|
683
|
-
/* @__PURE__ */ (0,
|
|
684
|
-
(action) => action.href ? /* @__PURE__ */ (0,
|
|
853
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Group, { gap: "xs", align: "center", wrap: "nowrap", children: [
|
|
854
|
+
typeof status === "string" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Badge, { variant: "light", children: status }) : status,
|
|
855
|
+
secondaryActions.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Menu, { position: "bottom-end", withinPortal: true, children: [
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Menu.Target, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.ActionIcon, { variant: "subtle", "aria-label": "More actions", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MoreIcon, { size: "1rem" }) }) }),
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Menu.Dropdown, { children: secondaryActions.map(
|
|
858
|
+
(action) => action.href ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Menu.Item, { component: "a", href: action.href, color: action.color, children: action.label }, action.label) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Menu.Item, { onClick: action.onClick, color: action.color, children: action.label }, action.label)
|
|
685
859
|
) })
|
|
686
860
|
] }) : null
|
|
687
861
|
] })
|
|
688
862
|
] }),
|
|
689
|
-
metadata.length ? /* @__PURE__ */ (0,
|
|
690
|
-
/* @__PURE__ */ (0,
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
863
|
+
metadata.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Stack, { gap: 6, children: metadata.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Group, { justify: "space-between", gap: "sm", children: [
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", children: item.label }),
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", fw: 500, ta: "right", children: item.value })
|
|
692
866
|
] }, item.label)) }) : null,
|
|
693
|
-
primaryAction ? /* @__PURE__ */ (0,
|
|
867
|
+
primaryAction ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Group, { justify: "space-between", children: primaryAction }) : null,
|
|
694
868
|
footer
|
|
695
869
|
] }) });
|
|
696
870
|
}
|
|
697
871
|
|
|
698
872
|
// src/PublicProductCard.tsx
|
|
699
873
|
var import_react2 = require("react");
|
|
700
|
-
var
|
|
701
|
-
var
|
|
874
|
+
var import_core15 = require("@mantine/core");
|
|
875
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
702
876
|
var stateConfig = {
|
|
703
877
|
available: { label: "Available", color: "teal" },
|
|
704
878
|
limited: { label: "Limited", color: "yellow" },
|
|
@@ -715,29 +889,29 @@ function enhanceAction(action, disabled) {
|
|
|
715
889
|
});
|
|
716
890
|
}
|
|
717
891
|
function ImageFallback({ compact }) {
|
|
718
|
-
return /* @__PURE__ */ (0,
|
|
719
|
-
|
|
892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.AspectRatio, { ratio: compact ? 16 / 9 : 4 / 3, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
893
|
+
import_core15.ThemeIcon,
|
|
720
894
|
{
|
|
721
895
|
size: "100%",
|
|
722
896
|
radius: "md",
|
|
723
897
|
variant: "light",
|
|
724
898
|
color: "gray",
|
|
725
899
|
"aria-label": "No product image available",
|
|
726
|
-
children: /* @__PURE__ */ (0,
|
|
900
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(GdsIcons.Gallery, { size: compact ? "1.5rem" : "2rem" })
|
|
727
901
|
}
|
|
728
902
|
) });
|
|
729
903
|
}
|
|
730
904
|
function LoadingCard({ compact }) {
|
|
731
|
-
return /* @__PURE__ */ (0,
|
|
732
|
-
/* @__PURE__ */ (0,
|
|
733
|
-
/* @__PURE__ */ (0,
|
|
734
|
-
/* @__PURE__ */ (0,
|
|
735
|
-
/* @__PURE__ */ (0,
|
|
736
|
-
/* @__PURE__ */ (0,
|
|
905
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Card, { withBorder: true, radius: "lg", padding: compact ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: "md", children: [
|
|
906
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.AspectRatio, { ratio: compact ? 16 / 9 : 4 / 3, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { radius: "md" }) }),
|
|
907
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: "xs", children: [
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { height: 20, radius: "sm", width: "70%" }),
|
|
909
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { height: 14, radius: "sm", width: "100%" }),
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { height: 14, radius: "sm", width: "85%" })
|
|
737
911
|
] }),
|
|
738
|
-
/* @__PURE__ */ (0,
|
|
739
|
-
/* @__PURE__ */ (0,
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", align: "center", children: [
|
|
913
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { height: 18, radius: "sm", width: 72 }),
|
|
914
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Skeleton, { height: 36, radius: "md", width: 120 })
|
|
741
915
|
] })
|
|
742
916
|
] }) });
|
|
743
917
|
}
|
|
@@ -760,7 +934,7 @@ function PublicProductCard({
|
|
|
760
934
|
disabled = false
|
|
761
935
|
}) {
|
|
762
936
|
if (loading) {
|
|
763
|
-
return /* @__PURE__ */ (0,
|
|
937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LoadingCard, { compact });
|
|
764
938
|
}
|
|
765
939
|
const isActionDisabled = disabled || state === "sold-out";
|
|
766
940
|
const resolvedPrimaryAction = enhanceAction(primaryAction, isActionDisabled);
|
|
@@ -773,46 +947,312 @@ function PublicProductCard({
|
|
|
773
947
|
const pickupHelper = helperKind === "pickup" ? helperText : pickupNote;
|
|
774
948
|
const inventoryHelper = helperKind === "inventory" ? helperText : inventoryNote;
|
|
775
949
|
const hasSupportingRegion = Boolean(price || supportingHelper || pickupHelper || inventoryHelper);
|
|
776
|
-
return /* @__PURE__ */ (0,
|
|
777
|
-
image ?? /* @__PURE__ */ (0,
|
|
778
|
-
/* @__PURE__ */ (0,
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
780
|
-
/* @__PURE__ */ (0,
|
|
781
|
-
description ? /* @__PURE__ */ (0,
|
|
950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Card, { withBorder: true, radius: "lg", padding: compact ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: compact ? "sm" : "md", children: [
|
|
951
|
+
image ?? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ImageFallback, { compact }),
|
|
952
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
953
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: 4, style: { minWidth: 0, flex: 1 }, children: [
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Title, { order: compact ? 5 : 4, lineClamp: 2, children: title }),
|
|
955
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", c: "dimmed", lineClamp: compact ? 2 : 3, children: description }) : null
|
|
782
956
|
] }),
|
|
783
|
-
/* @__PURE__ */ (0,
|
|
957
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Badge, { variant: "light", color: stateBadge.color, children: stateBadge.label })
|
|
784
958
|
] }),
|
|
785
|
-
hasSupportingRegion ? /* @__PURE__ */ (0,
|
|
786
|
-
/* @__PURE__ */ (0,
|
|
787
|
-
price ? /* @__PURE__ */ (0,
|
|
788
|
-
supportingHelper ? /* @__PURE__ */ (0,
|
|
959
|
+
hasSupportingRegion ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", align: "flex-end", gap: "sm", wrap: "nowrap", children: [
|
|
960
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
|
|
961
|
+
price ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { fw: 700, size: compact ? "md" : "lg", children: price }) : null,
|
|
962
|
+
supportingHelper ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "xs", c: "dimmed", children: supportingHelper }) : null
|
|
789
963
|
] }),
|
|
790
964
|
resolvedPrimaryAction
|
|
791
|
-
] }) : resolvedPrimaryAction ? /* @__PURE__ */ (0,
|
|
792
|
-
pickupHelper || inventoryHelper || metadata.length ? /* @__PURE__ */ (0,
|
|
793
|
-
pickupHelper ? /* @__PURE__ */ (0,
|
|
794
|
-
/* @__PURE__ */ (0,
|
|
795
|
-
/* @__PURE__ */ (0,
|
|
965
|
+
] }) : resolvedPrimaryAction ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Group, { justify: "flex-end", children: resolvedPrimaryAction }) : null,
|
|
966
|
+
pickupHelper || inventoryHelper || metadata.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Stack, { gap: 6, children: [
|
|
967
|
+
pickupHelper ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", gap: "sm", children: [
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", c: "dimmed", children: "Pickup" }),
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", fw: 500, ta: "right", children: pickupHelper })
|
|
796
970
|
] }) : null,
|
|
797
|
-
inventoryHelper ? /* @__PURE__ */ (0,
|
|
798
|
-
/* @__PURE__ */ (0,
|
|
799
|
-
/* @__PURE__ */ (0,
|
|
971
|
+
inventoryHelper ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", gap: "sm", children: [
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", c: "dimmed", children: "Availability" }),
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", fw: 500, ta: "right", children: inventoryHelper })
|
|
800
974
|
] }) : null,
|
|
801
|
-
metadata.map((item) => /* @__PURE__ */ (0,
|
|
802
|
-
/* @__PURE__ */ (0,
|
|
803
|
-
/* @__PURE__ */ (0,
|
|
975
|
+
metadata.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_core15.Group, { justify: "space-between", gap: "sm", children: [
|
|
976
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", c: "dimmed", children: item.label }),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Text, { size: "sm", fw: 500, ta: "right", children: item.value })
|
|
804
978
|
] }, item.label))
|
|
805
979
|
] }) : null,
|
|
806
|
-
resolvedSecondaryAction ? /* @__PURE__ */ (0,
|
|
980
|
+
resolvedSecondaryAction ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_core15.Group, { justify: "flex-end", children: resolvedSecondaryAction }) : null
|
|
807
981
|
] }) });
|
|
808
982
|
}
|
|
809
983
|
|
|
810
|
-
// src/
|
|
984
|
+
// src/PublicFoodCard.tsx
|
|
985
|
+
var import_react3 = require("react");
|
|
811
986
|
var import_core16 = require("@mantine/core");
|
|
987
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
988
|
+
var ratioMap = {
|
|
989
|
+
square: 1,
|
|
990
|
+
dish: 4 / 3,
|
|
991
|
+
landscape: 16 / 9
|
|
992
|
+
};
|
|
993
|
+
var stateConfig2 = {
|
|
994
|
+
available: { label: "Available", color: "teal" },
|
|
995
|
+
preorder: { label: "Preorder", color: "violet" },
|
|
996
|
+
limited: { label: "Limited batch", color: "yellow" },
|
|
997
|
+
"sold-out": { label: "Sold out", color: "red" },
|
|
998
|
+
"coming-soon": { label: "Coming soon", color: "gray" }
|
|
999
|
+
};
|
|
1000
|
+
var markerToneMap = {
|
|
1001
|
+
default: "gray",
|
|
1002
|
+
positive: "teal",
|
|
1003
|
+
warning: "orange",
|
|
1004
|
+
muted: "dark"
|
|
1005
|
+
};
|
|
1006
|
+
function enhanceAction2(action, disabled) {
|
|
1007
|
+
if (!(0, import_react3.isValidElement)(action)) {
|
|
1008
|
+
return action;
|
|
1009
|
+
}
|
|
1010
|
+
return (0, import_react3.cloneElement)(action, {
|
|
1011
|
+
disabled: disabled || Boolean(action.props.disabled),
|
|
1012
|
+
"aria-disabled": disabled || void 0
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
function FoodImageFallback({ mediaRatio }) {
|
|
1016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.AspectRatio, { ratio: ratioMap[mediaRatio], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.ThemeIcon, { size: "100%", radius: "md", variant: "light", color: "gray", "aria-label": "No food image available", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(GdsIcons.Gallery, { size: "2rem" }) }) });
|
|
1017
|
+
}
|
|
1018
|
+
function LoadingFoodCard({ mediaRatio }) {
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: "md", children: [
|
|
1020
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.AspectRatio, { ratio: ratioMap[mediaRatio], children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { radius: "md" }) }),
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: "xs", children: [
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { height: 20, radius: "sm", width: "72%" }),
|
|
1023
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { height: 14, radius: "sm", width: "96%" }),
|
|
1024
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { height: 14, radius: "sm", width: "78%" })
|
|
1025
|
+
] }),
|
|
1026
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "center", children: [
|
|
1027
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { height: 18, radius: "sm", width: 96 }),
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Skeleton, { height: 36, radius: "md", width: 112 })
|
|
1029
|
+
] })
|
|
1030
|
+
] }) });
|
|
1031
|
+
}
|
|
1032
|
+
function PublicFoodCard({
|
|
1033
|
+
title,
|
|
1034
|
+
description,
|
|
1035
|
+
image,
|
|
1036
|
+
price,
|
|
1037
|
+
priceNote,
|
|
1038
|
+
state,
|
|
1039
|
+
helperText,
|
|
1040
|
+
pickupNote,
|
|
1041
|
+
freshnessNote,
|
|
1042
|
+
markers = [],
|
|
1043
|
+
metadata = [],
|
|
1044
|
+
primaryAction,
|
|
1045
|
+
secondaryAction,
|
|
1046
|
+
quantityHint,
|
|
1047
|
+
mediaRatio = "dish",
|
|
1048
|
+
loading = false,
|
|
1049
|
+
disabled = false
|
|
1050
|
+
}) {
|
|
1051
|
+
if (loading) {
|
|
1052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoadingFoodCard, { mediaRatio });
|
|
1053
|
+
}
|
|
1054
|
+
const stateBadge = stateConfig2[state];
|
|
1055
|
+
const isActionDisabled = disabled || state === "sold-out" || state === "coming-soon";
|
|
1056
|
+
const resolvedPrimaryAction = enhanceAction2(primaryAction, isActionDisabled);
|
|
1057
|
+
const resolvedSecondaryAction = enhanceAction2(secondaryAction, disabled);
|
|
1058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: "md", children: [
|
|
1059
|
+
image ?? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FoodImageFallback, { mediaRatio }),
|
|
1060
|
+
markers.length > 0 || quantityHint ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "center", wrap: "wrap", gap: "xs", children: [
|
|
1061
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Group, { gap: "xs", wrap: "wrap", children: markers.map((marker) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Badge, { variant: "light", color: markerToneMap[marker.tone ?? "default"], children: marker.label }, marker.id)) }),
|
|
1062
|
+
quantityHint ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "xs", fw: 600, c: "dimmed", children: quantityHint }) : null
|
|
1063
|
+
] }) : null,
|
|
1064
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
1065
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: 4, style: { minWidth: 0, flex: 1 }, children: [
|
|
1066
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Title, { order: 4, lineClamp: 2, children: title }),
|
|
1067
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", c: "dimmed", lineClamp: 3, children: description }) : null
|
|
1068
|
+
] }),
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Badge, { variant: "light", color: stateBadge.color, children: stateBadge.label })
|
|
1070
|
+
] }),
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "flex-end", gap: "sm", wrap: "nowrap", children: [
|
|
1072
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: 2, style: { minWidth: 0, flex: 1 }, children: [
|
|
1073
|
+
price ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { fw: 800, size: "lg", children: price }) : null,
|
|
1074
|
+
priceNote ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "xs", c: "dimmed", children: priceNote }) : null,
|
|
1075
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", c: "dimmed", children: helperText }) : null
|
|
1076
|
+
] }),
|
|
1077
|
+
resolvedPrimaryAction
|
|
1078
|
+
] }),
|
|
1079
|
+
pickupNote || freshnessNote || metadata.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Stack, { gap: 6, children: [
|
|
1080
|
+
pickupNote ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
1081
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", c: "dimmed", children: "Pickup" }),
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", fw: 500, ta: "right", children: pickupNote })
|
|
1083
|
+
] }) : null,
|
|
1084
|
+
freshnessNote ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", c: "dimmed", children: "Freshness" }),
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", fw: 500, ta: "right", children: freshnessNote })
|
|
1087
|
+
] }) : null,
|
|
1088
|
+
metadata.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_core16.Group, { gap: "xs", wrap: "nowrap", children: [
|
|
1089
|
+
item.icon,
|
|
1090
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Text, { size: "sm", c: "dimmed", children: item.label })
|
|
1091
|
+
] }) }, item.id))
|
|
1092
|
+
] }) : null,
|
|
1093
|
+
resolvedSecondaryAction ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_core16.Group, { justify: "flex-end", children: resolvedSecondaryAction }) : null
|
|
1094
|
+
] }) });
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// src/FoodMenuSection.tsx
|
|
1098
|
+
var import_core17 = require("@mantine/core");
|
|
1099
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1100
|
+
function FoodMenuSection({
|
|
1101
|
+
title,
|
|
1102
|
+
description,
|
|
1103
|
+
eyebrow,
|
|
1104
|
+
categories,
|
|
1105
|
+
sectionNote,
|
|
1106
|
+
action,
|
|
1107
|
+
emptyState,
|
|
1108
|
+
columns = 3,
|
|
1109
|
+
showEmptyCategories = false
|
|
1110
|
+
}) {
|
|
1111
|
+
const normalizedCategories = (categories ?? []).filter(Boolean);
|
|
1112
|
+
const visibleCategories = showEmptyCategories ? normalizedCategories : normalizedCategories.filter((category) => category.items.length > 0);
|
|
1113
|
+
if (!visibleCategories.length) {
|
|
1114
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: emptyState }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1115
|
+
EmptyState,
|
|
1116
|
+
{
|
|
1117
|
+
title: "No active menu available",
|
|
1118
|
+
description: "Publish grouped menu categories here when the current weekly or seasonal menu is ready."
|
|
1119
|
+
}
|
|
1120
|
+
);
|
|
1121
|
+
}
|
|
1122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Box, { component: "section", "aria-label": typeof title === "string" ? title : "Food menu section", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Stack, { gap: "xl", children: [
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Stack, { gap: 4, children: [
|
|
1125
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Text, { size: "xs", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
|
|
1126
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Title, { order: 2, children: title }),
|
|
1127
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Text, { size: "sm", c: "dimmed", maw: 760, children: description }) : null,
|
|
1128
|
+
sectionNote ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Text, { size: "sm", c: "dimmed", children: sectionNote }) : null
|
|
1129
|
+
] }),
|
|
1130
|
+
action
|
|
1131
|
+
] }),
|
|
1132
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Stack, { gap: "xl", children: visibleCategories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Stack, { gap: "md", children: [
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_core17.Stack, { gap: 4, children: [
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Title, { order: 3, children: category.title }),
|
|
1135
|
+
category.description ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Text, { size: "sm", c: "dimmed", children: category.description }) : null,
|
|
1136
|
+
category.helperNote ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.Text, { size: "sm", c: "dimmed", children: category.helperNote }) : null
|
|
1137
|
+
] }),
|
|
1138
|
+
category.items.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_core17.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children: category.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PublicFoodCard, { ...item }, item.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1139
|
+
EmptyState,
|
|
1140
|
+
{
|
|
1141
|
+
title: "No items in this category",
|
|
1142
|
+
description: "This category is defined, but it does not currently have any visible dishes or bundles."
|
|
1143
|
+
}
|
|
1144
|
+
)
|
|
1145
|
+
] }, category.id)) })
|
|
1146
|
+
] }) });
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// src/ListingCard.tsx
|
|
1150
|
+
var import_core18 = require("@mantine/core");
|
|
1151
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1152
|
+
var ratioMap2 = {
|
|
1153
|
+
"1:1": 1,
|
|
1154
|
+
"4:3": 4 / 3,
|
|
1155
|
+
"16:9": 16 / 9
|
|
1156
|
+
};
|
|
1157
|
+
var toneColorMap = {
|
|
1158
|
+
default: void 0,
|
|
1159
|
+
positive: "teal",
|
|
1160
|
+
warning: "orange",
|
|
1161
|
+
muted: "gray"
|
|
1162
|
+
};
|
|
1163
|
+
function ListingImageFallback({ mediaRatio }) {
|
|
1164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.AspectRatio, { ratio: ratioMap2[mediaRatio], children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1165
|
+
import_core18.ThemeIcon,
|
|
1166
|
+
{
|
|
1167
|
+
size: "100%",
|
|
1168
|
+
radius: "md",
|
|
1169
|
+
variant: "light",
|
|
1170
|
+
color: "gray",
|
|
1171
|
+
"aria-label": "No listing image available",
|
|
1172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(GdsIcons.Gallery, { size: "2rem" })
|
|
1173
|
+
}
|
|
1174
|
+
) });
|
|
1175
|
+
}
|
|
1176
|
+
function ListingAffordance({ affordance }) {
|
|
1177
|
+
const config = GdsVocabulary[affordance.action];
|
|
1178
|
+
const Icon = config.icon;
|
|
1179
|
+
const label = affordance.ariaLabel ?? getSemanticActionLabel(affordance.action);
|
|
1180
|
+
if (affordance.href) {
|
|
1181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1182
|
+
import_core18.ActionIcon,
|
|
1183
|
+
{
|
|
1184
|
+
component: "a",
|
|
1185
|
+
href: affordance.href,
|
|
1186
|
+
variant: "subtle",
|
|
1187
|
+
size: "lg",
|
|
1188
|
+
"aria-label": label,
|
|
1189
|
+
disabled: affordance.disabled,
|
|
1190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { size: "1rem", stroke: 1.75 })
|
|
1191
|
+
}
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1195
|
+
import_core18.ActionIcon,
|
|
1196
|
+
{
|
|
1197
|
+
variant: "subtle",
|
|
1198
|
+
size: "lg",
|
|
1199
|
+
"aria-label": label,
|
|
1200
|
+
onClick: affordance.onClick,
|
|
1201
|
+
disabled: affordance.disabled,
|
|
1202
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { size: "1rem", stroke: 1.75 })
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
function ListingCard({
|
|
1207
|
+
title,
|
|
1208
|
+
href,
|
|
1209
|
+
description,
|
|
1210
|
+
image,
|
|
1211
|
+
mediaRatio = "4:3",
|
|
1212
|
+
metadata = [],
|
|
1213
|
+
featured = false,
|
|
1214
|
+
sponsoredDisclosure,
|
|
1215
|
+
price,
|
|
1216
|
+
primaryAction,
|
|
1217
|
+
saveAction,
|
|
1218
|
+
shareAction,
|
|
1219
|
+
compact = false
|
|
1220
|
+
}) {
|
|
1221
|
+
const titleContent = href && typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { component: "a", href, inherit: true, td: "none", children: title }) : title;
|
|
1222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Card, { withBorder: true, radius: "lg", padding: compact ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Stack, { gap: compact ? "sm" : "md", children: [
|
|
1223
|
+
image ?? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ListingImageFallback, { mediaRatio }),
|
|
1224
|
+
featured || sponsoredDisclosure ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Group, { justify: "space-between", gap: "sm", wrap: "wrap", children: [
|
|
1225
|
+
featured ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Badge, { variant: "light", color: "violet", children: "Featured" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", {}),
|
|
1226
|
+
sponsoredDisclosure ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { size: "xs", c: "dimmed", children: sponsoredDisclosure }) : null
|
|
1227
|
+
] }) : null,
|
|
1228
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Stack, { gap: 4, children: [
|
|
1229
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Title, { order: compact ? 5 : 4, lineClamp: 2, children: titleContent }),
|
|
1230
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { size: "sm", c: "dimmed", lineClamp: compact ? 2 : 3, children: description }) : null
|
|
1231
|
+
] }),
|
|
1232
|
+
metadata.length ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Stack, { gap: "xs", children: metadata.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Group, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
1233
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Group, { gap: "xs", wrap: "nowrap", style: { minWidth: 0, flex: 1 }, children: [
|
|
1234
|
+
item.icon,
|
|
1235
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { size: "sm", c: item.tone ? toneColorMap[item.tone] : "dimmed", lineClamp: 1, children: item.label })
|
|
1236
|
+
] }),
|
|
1237
|
+
item.value ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { size: "sm", fw: 500, ta: "right", children: item.value }) : null
|
|
1238
|
+
] }, item.id)) }) : null,
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Group, { justify: "space-between", align: "center", gap: "sm", wrap: "wrap", children: [
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Stack, { gap: 2, style: { minWidth: 0, flex: 1 }, children: price ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_core18.Text, { fw: 700, size: compact ? "md" : "lg", children: price }) : null }),
|
|
1241
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_core18.Group, { gap: "xs", wrap: "nowrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
|
|
1242
|
+
saveAction ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ListingAffordance, { affordance: saveAction }) : null,
|
|
1243
|
+
shareAction ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ListingAffordance, { affordance: shareAction }) : null,
|
|
1244
|
+
primaryAction
|
|
1245
|
+
] })
|
|
1246
|
+
] })
|
|
1247
|
+
] }) });
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
// src/BrowseSurface.tsx
|
|
1251
|
+
var import_core21 = require("@mantine/core");
|
|
812
1252
|
|
|
813
1253
|
// src/DataToolbar.tsx
|
|
814
|
-
var
|
|
815
|
-
var
|
|
1254
|
+
var import_core19 = require("@mantine/core");
|
|
1255
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
816
1256
|
function DataToolbar({
|
|
817
1257
|
searchSlot,
|
|
818
1258
|
filterSlot,
|
|
@@ -821,20 +1261,20 @@ function DataToolbar({
|
|
|
821
1261
|
createAction,
|
|
822
1262
|
activeFilters = []
|
|
823
1263
|
}) {
|
|
824
|
-
return /* @__PURE__ */ (0,
|
|
825
|
-
/* @__PURE__ */ (0,
|
|
826
|
-
/* @__PURE__ */ (0,
|
|
1264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core19.Stack, { gap: "sm", children: [
|
|
1265
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core19.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
1266
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core19.Group, { flex: 1, align: "flex-start", gap: "sm", children: [
|
|
827
1267
|
searchSlot,
|
|
828
1268
|
filterSlot,
|
|
829
1269
|
sortSlot
|
|
830
1270
|
] }),
|
|
831
|
-
/* @__PURE__ */ (0,
|
|
1271
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_core19.Group, { gap: "sm", children: [
|
|
832
1272
|
resetAction,
|
|
833
1273
|
createAction
|
|
834
1274
|
] })
|
|
835
1275
|
] }),
|
|
836
|
-
activeFilters.length ? /* @__PURE__ */ (0,
|
|
837
|
-
|
|
1276
|
+
activeFilters.length ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_core19.Group, { gap: "xs", children: activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1277
|
+
import_core19.Badge,
|
|
838
1278
|
{
|
|
839
1279
|
variant: "light",
|
|
840
1280
|
rightSection: filter.onRemove ? "\xD7" : void 0,
|
|
@@ -848,17 +1288,17 @@ function DataToolbar({
|
|
|
848
1288
|
}
|
|
849
1289
|
|
|
850
1290
|
// src/StateBlock.tsx
|
|
851
|
-
var
|
|
852
|
-
var
|
|
1291
|
+
var import_core20 = require("@mantine/core");
|
|
1292
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
853
1293
|
var variantConfig = {
|
|
854
|
-
loading: { color: "violet", icon: /* @__PURE__ */ (0,
|
|
855
|
-
empty: { color: "gray", icon: /* @__PURE__ */ (0,
|
|
856
|
-
error: { color: "red", icon: /* @__PURE__ */ (0,
|
|
857
|
-
permission: { color: "orange", icon: /* @__PURE__ */ (0,
|
|
858
|
-
disabled: { color: "gray", icon: /* @__PURE__ */ (0,
|
|
859
|
-
success: { color: "teal", icon: /* @__PURE__ */ (0,
|
|
860
|
-
info: { color: "blue", icon: /* @__PURE__ */ (0,
|
|
861
|
-
"not-enough-data": { color: "yellow", icon: /* @__PURE__ */ (0,
|
|
1294
|
+
loading: { color: "violet", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Loader, { size: "sm" }) },
|
|
1295
|
+
empty: { color: "gray", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Inbox, { size: "1.1rem" }) },
|
|
1296
|
+
error: { color: "red", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Danger, { size: "1.1rem" }) },
|
|
1297
|
+
permission: { color: "orange", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Verify, { size: "1.1rem" }) },
|
|
1298
|
+
disabled: { color: "gray", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Toggle, { size: "1.1rem" }) },
|
|
1299
|
+
success: { color: "teal", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Success, { size: "1.1rem" }) },
|
|
1300
|
+
info: { color: "blue", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Info, { size: "1.1rem" }) },
|
|
1301
|
+
"not-enough-data": { color: "yellow", icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(GdsIcons.Analytics, { size: "1.1rem" }) }
|
|
862
1302
|
};
|
|
863
1303
|
function StateBlock({
|
|
864
1304
|
variant,
|
|
@@ -869,8 +1309,8 @@ function StateBlock({
|
|
|
869
1309
|
compact = false
|
|
870
1310
|
}) {
|
|
871
1311
|
const config = variantConfig[variant];
|
|
872
|
-
return /* @__PURE__ */ (0,
|
|
873
|
-
|
|
1312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1313
|
+
import_core20.Stack,
|
|
874
1314
|
{
|
|
875
1315
|
align: compact ? "flex-start" : "center",
|
|
876
1316
|
justify: "center",
|
|
@@ -878,10 +1318,10 @@ function StateBlock({
|
|
|
878
1318
|
py: compact ? "md" : "xl",
|
|
879
1319
|
ta: compact ? "left" : "center",
|
|
880
1320
|
children: [
|
|
881
|
-
/* @__PURE__ */ (0,
|
|
882
|
-
/* @__PURE__ */ (0,
|
|
883
|
-
/* @__PURE__ */ (0,
|
|
884
|
-
description ? /* @__PURE__ */ (0,
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.ThemeIcon, { variant: "light", color: config.color, size: compact ? "lg" : "xl", radius: "xl", children: icon ?? config.icon }),
|
|
1322
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_core20.Stack, { gap: 6, align: compact ? "flex-start" : "center", children: [
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Title, { order: compact ? 4 : 3, children: title }),
|
|
1324
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_core20.Text, { c: "dimmed", maw: compact ? void 0 : 480, children: description }) : null
|
|
885
1325
|
] }),
|
|
886
1326
|
action
|
|
887
1327
|
]
|
|
@@ -890,7 +1330,7 @@ function StateBlock({
|
|
|
890
1330
|
}
|
|
891
1331
|
|
|
892
1332
|
// src/BrowseSurface.tsx
|
|
893
|
-
var
|
|
1333
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
894
1334
|
function BrowseSurface({
|
|
895
1335
|
eyebrow,
|
|
896
1336
|
title,
|
|
@@ -924,22 +1364,22 @@ function BrowseSurface({
|
|
|
924
1364
|
}));
|
|
925
1365
|
let body = content;
|
|
926
1366
|
if (loading) {
|
|
927
|
-
body = /* @__PURE__ */ (0,
|
|
1367
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StateBlock, { variant: "loading", title: loadingTitle, description: loadingDescription, compact: true });
|
|
928
1368
|
} else if (error) {
|
|
929
|
-
body = /* @__PURE__ */ (0,
|
|
1369
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StateBlock, { variant: "error", title: errorTitle, description: error, action: errorAction ?? emptyAction, compact: true });
|
|
930
1370
|
} else if (empty) {
|
|
931
|
-
body = /* @__PURE__ */ (0,
|
|
1371
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, action: emptyAction, compact: true });
|
|
932
1372
|
}
|
|
933
|
-
return /* @__PURE__ */ (0,
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
935
|
-
/* @__PURE__ */ (0,
|
|
936
|
-
/* @__PURE__ */ (0,
|
|
937
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
938
|
-
/* @__PURE__ */ (0,
|
|
939
|
-
description ? /* @__PURE__ */ (0,
|
|
1373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "lg", children: [
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Paper, { withBorder: true, radius: "xl", p: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "lg", children: [
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Group, { justify: "space-between", align: "flex-start", gap: "md", children: [
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "xs", maw: 760, children: [
|
|
1377
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "xs", fw: 700, tt: "uppercase", c: "dimmed", style: { letterSpacing: "0.18em" }, children: eyebrow }) : null,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Title, { order: 1, children: title }),
|
|
1379
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "lg", c: "dimmed", children: description }) : null
|
|
940
1380
|
] }),
|
|
941
|
-
/* @__PURE__ */ (0,
|
|
942
|
-
typeof resultCount === "number" ? /* @__PURE__ */ (0,
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { align: "flex-end", gap: "xs", children: [
|
|
1382
|
+
typeof resultCount === "number" ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Badge, { size: "lg", radius: "xl", variant: "light", color: "violet", children: [
|
|
943
1383
|
resultCount,
|
|
944
1384
|
" ",
|
|
945
1385
|
resultLabel
|
|
@@ -947,10 +1387,10 @@ function BrowseSurface({
|
|
|
947
1387
|
primaryControls
|
|
948
1388
|
] })
|
|
949
1389
|
] }),
|
|
950
|
-
scopeOptions.length ? /* @__PURE__ */ (0,
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
952
|
-
/* @__PURE__ */ (0,
|
|
953
|
-
|
|
1390
|
+
scopeOptions.length ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "xs", children: [
|
|
1391
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "sm", fw: 600, c: "dimmed", children: scopeLabel }),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Group, { gap: "xs", wrap: "wrap", children: scopeOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1393
|
+
import_core21.Button,
|
|
954
1394
|
{
|
|
955
1395
|
variant: option.active ? "filled" : "default",
|
|
956
1396
|
color: option.active ? "violet" : "gray",
|
|
@@ -962,30 +1402,30 @@ function BrowseSurface({
|
|
|
962
1402
|
option.id
|
|
963
1403
|
)) })
|
|
964
1404
|
] }) : null,
|
|
965
|
-
locationControls ? /* @__PURE__ */ (0,
|
|
966
|
-
/* @__PURE__ */ (0,
|
|
1405
|
+
locationControls ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "xs", children: [
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "sm", fw: 600, c: "dimmed", children: "Location" }),
|
|
967
1407
|
locationControls
|
|
968
1408
|
] }) : null,
|
|
969
|
-
toolbar || sortControl ? /* @__PURE__ */ (0,
|
|
970
|
-
toolbar ? /* @__PURE__ */ (0,
|
|
1409
|
+
toolbar || sortControl ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.SimpleGrid, { cols: { base: 1, lg: sortControl ? 2 : 1 }, spacing: "md", children: [
|
|
1410
|
+
toolbar ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
971
1411
|
DataToolbar,
|
|
972
1412
|
{
|
|
973
1413
|
...toolbar,
|
|
974
1414
|
activeFilters: toolbarFilters.length ? toolbarFilters : toolbar.fallbackActiveFilters
|
|
975
1415
|
}
|
|
976
|
-
) : /* @__PURE__ */ (0,
|
|
977
|
-
sortControl ? /* @__PURE__ */ (0,
|
|
978
|
-
/* @__PURE__ */ (0,
|
|
1416
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Box, {}),
|
|
1417
|
+
sortControl ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { gap: "xs", align: "stretch", children: [
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "sm", fw: 600, c: "dimmed", children: "Sort" }),
|
|
979
1419
|
sortControl
|
|
980
1420
|
] }) : null
|
|
981
1421
|
] }) : null,
|
|
982
|
-
mobileFilters ? /* @__PURE__ */ (0,
|
|
983
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
mobileFilters ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_core21.Stack, { hiddenFrom: "lg", gap: "xs", children: [
|
|
1423
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Text, { size: "sm", fw: 600, c: "dimmed", children: "Filters" }),
|
|
984
1424
|
mobileFilters
|
|
985
1425
|
] }) : null,
|
|
986
|
-
filterDrawer ? /* @__PURE__ */ (0,
|
|
987
|
-
activeFilters.length ? /* @__PURE__ */ (0,
|
|
988
|
-
|
|
1426
|
+
filterDrawer ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Box, { hiddenFrom: "lg", children: filterDrawer }) : null,
|
|
1427
|
+
activeFilters.length ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_core21.Group, { gap: "xs", wrap: "wrap", children: activeFilters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1428
|
+
import_core21.Badge,
|
|
989
1429
|
{
|
|
990
1430
|
variant: "light",
|
|
991
1431
|
color: "violet",
|
|
@@ -1002,8 +1442,8 @@ function BrowseSurface({
|
|
|
1002
1442
|
}
|
|
1003
1443
|
|
|
1004
1444
|
// src/AccentPanel.tsx
|
|
1005
|
-
var
|
|
1006
|
-
var
|
|
1445
|
+
var import_core22 = require("@mantine/core");
|
|
1446
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1007
1447
|
var toneStyles = {
|
|
1008
1448
|
gray: {
|
|
1009
1449
|
bg: "light-dark(var(--mantine-color-gray-0), color-mix(in srgb, var(--mantine-color-gray-7) 88%, black))",
|
|
@@ -1059,29 +1499,56 @@ function AccentPanel({
|
|
|
1059
1499
|
children
|
|
1060
1500
|
}) {
|
|
1061
1501
|
const styles = resolveAccentPanelStyles(tone, variant);
|
|
1062
|
-
return /* @__PURE__ */ (0,
|
|
1063
|
-
title || badge ? /* @__PURE__ */ (0,
|
|
1064
|
-
title ? /* @__PURE__ */ (0,
|
|
1065
|
-
badge ? typeof badge === "string" ? /* @__PURE__ */ (0,
|
|
1502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Paper, { withBorder: true, radius: "lg", p: "lg", style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core22.Stack, { gap: "sm", children: [
|
|
1503
|
+
title || badge ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core22.Group, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "wrap", children: [
|
|
1504
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Title, { order: 4, c: "inherit", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Box, {}),
|
|
1505
|
+
badge ? typeof badge === "string" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Badge, { color: tone === "amber" ? "yellow" : tone, variant: "filled", children: badge }) : badge : null
|
|
1066
1506
|
] }) : null,
|
|
1067
|
-
typeof children === "string" ? /* @__PURE__ */ (0,
|
|
1507
|
+
typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Text, { c: "inherit", children }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core22.Box, { c: "inherit", children })
|
|
1508
|
+
] }) });
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
// src/DetailProfileShell.tsx
|
|
1512
|
+
var import_core23 = require("@mantine/core");
|
|
1513
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1514
|
+
function DetailProfileShell({
|
|
1515
|
+
mode = "page",
|
|
1516
|
+
hero,
|
|
1517
|
+
actions,
|
|
1518
|
+
sections,
|
|
1519
|
+
related,
|
|
1520
|
+
padding = "lg",
|
|
1521
|
+
showDividers = true
|
|
1522
|
+
}) {
|
|
1523
|
+
const content = sections.filter(Boolean);
|
|
1524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Paper, { withBorder: mode === "drawer", radius: mode === "drawer" ? "xl" : "md", p: padding, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core23.Stack, { gap: "lg", children: [
|
|
1525
|
+
hero,
|
|
1526
|
+
actions,
|
|
1527
|
+
content.map((section, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core23.Stack, { gap: "lg", children: [
|
|
1528
|
+
index > 0 && showDividers ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Divider, {}) : null,
|
|
1529
|
+
section
|
|
1530
|
+
] }, index)),
|
|
1531
|
+
related ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
1532
|
+
content.length && showDividers ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core23.Divider, {}) : null,
|
|
1533
|
+
related
|
|
1534
|
+
] }) : null
|
|
1068
1535
|
] }) });
|
|
1069
1536
|
}
|
|
1070
1537
|
|
|
1071
1538
|
// src/PublicShell.tsx
|
|
1072
|
-
var
|
|
1539
|
+
var import_core25 = require("@mantine/core");
|
|
1073
1540
|
|
|
1074
1541
|
// src/PublicNav.tsx
|
|
1075
|
-
var
|
|
1076
|
-
var
|
|
1542
|
+
var import_core24 = require("@mantine/core");
|
|
1543
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1077
1544
|
function PublicNav({ items, activeId, renderLink }) {
|
|
1078
|
-
return /* @__PURE__ */ (0,
|
|
1545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_core24.Group, { component: "nav", "aria-label": "Primary", gap: "lg", wrap: "nowrap", children: items.map((item) => {
|
|
1079
1546
|
const active = item.id === activeId;
|
|
1080
1547
|
if (renderLink) {
|
|
1081
|
-
return /* @__PURE__ */ (0,
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: renderLink(item, active) }, item.id);
|
|
1082
1549
|
}
|
|
1083
|
-
return /* @__PURE__ */ (0,
|
|
1084
|
-
|
|
1550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1551
|
+
import_core24.Anchor,
|
|
1085
1552
|
{
|
|
1086
1553
|
href: item.href,
|
|
1087
1554
|
"aria-current": active ? "page" : void 0,
|
|
@@ -1098,15 +1565,15 @@ function PublicNav({ items, activeId, renderLink }) {
|
|
|
1098
1565
|
}
|
|
1099
1566
|
|
|
1100
1567
|
// src/PublicShell.tsx
|
|
1101
|
-
var
|
|
1568
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1102
1569
|
function InlineMobileNavigation({
|
|
1103
1570
|
mobileNavigation,
|
|
1104
1571
|
className,
|
|
1105
1572
|
mode
|
|
1106
1573
|
}) {
|
|
1107
|
-
return /* @__PURE__ */ (0,
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1109
|
-
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core25.Box, { component: "details", hiddenFrom: "sm", className, children: [
|
|
1575
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1576
|
+
import_core25.Box,
|
|
1110
1577
|
{
|
|
1111
1578
|
component: "summary",
|
|
1112
1579
|
"aria-label": mode === "drawer" ? "Open site navigation drawer" : "Open site navigation",
|
|
@@ -1118,13 +1585,13 @@ function InlineMobileNavigation({
|
|
|
1118
1585
|
gap: "0.5rem"
|
|
1119
1586
|
},
|
|
1120
1587
|
children: [
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1588
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Burger, { opened: false, "aria-hidden": true }),
|
|
1589
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Text, { size: "sm", fw: 600, children: "Menu" })
|
|
1123
1590
|
]
|
|
1124
1591
|
}
|
|
1125
1592
|
),
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1127
|
-
|
|
1593
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1594
|
+
import_core25.Box,
|
|
1128
1595
|
{
|
|
1129
1596
|
mt: "sm",
|
|
1130
1597
|
p: "sm",
|
|
@@ -1133,7 +1600,7 @@ function InlineMobileNavigation({
|
|
|
1133
1600
|
border: "1px solid var(--mantine-color-default-border)",
|
|
1134
1601
|
background: mode === "drawer" ? "light-dark(var(--mantine-color-white), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))" : "var(--mantine-color-body)"
|
|
1135
1602
|
},
|
|
1136
|
-
children: /* @__PURE__ */ (0,
|
|
1603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Stack, { gap: "sm", children: mobileNavigation })
|
|
1137
1604
|
}
|
|
1138
1605
|
)
|
|
1139
1606
|
] });
|
|
@@ -1154,30 +1621,30 @@ function PublicShell({
|
|
|
1154
1621
|
mobileNavigationMode = "sheet",
|
|
1155
1622
|
classNames
|
|
1156
1623
|
}) {
|
|
1157
|
-
const resolvedNavigation = navigation ?? (navItems ? /* @__PURE__ */ (0,
|
|
1624
|
+
const resolvedNavigation = navigation ?? (navItems ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(PublicNav, { items: navItems, activeId: activeNavId }) : null);
|
|
1158
1625
|
const containerSize = maxContentWidth ?? (compact ? "md" : "lg");
|
|
1159
1626
|
const headerHeight = headerVariant === "compact" ? 64 : headerVariant === "branded-quiet" ? 88 : 72;
|
|
1160
1627
|
const mainPadding = headerVariant === "compact" ? "lg" : "xl";
|
|
1161
1628
|
const usesInlineMobileNavigation = Boolean(mobileNavigation) && mobileNavigationMode !== "sheet";
|
|
1162
1629
|
const usesSheetMobileNavigation = Boolean(mobileNavigation) && mobileNavigationMode === "sheet";
|
|
1163
|
-
return /* @__PURE__ */ (0,
|
|
1164
|
-
|
|
1630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1631
|
+
import_core25.AppShell,
|
|
1165
1632
|
{
|
|
1166
1633
|
className: classNames?.root,
|
|
1167
1634
|
header: { height: headerHeight },
|
|
1168
1635
|
footer: usesSheetMobileNavigation ? { height: 68 } : void 0,
|
|
1169
1636
|
padding: 0,
|
|
1170
1637
|
children: [
|
|
1171
|
-
/* @__PURE__ */ (0,
|
|
1172
|
-
|
|
1638
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.AppShell.Header, { withBorder: headerBordered, className: classNames?.header, "data-header-variant": headerVariant, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Container, { size: containerSize, h: "100%", py: headerVariant === "branded-quiet" ? "sm" : 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1639
|
+
import_core25.Group,
|
|
1173
1640
|
{
|
|
1174
1641
|
h: "100%",
|
|
1175
1642
|
justify: "space-between",
|
|
1176
1643
|
wrap: "nowrap",
|
|
1177
1644
|
gap: headerVariant === "compact" ? "sm" : "lg",
|
|
1178
1645
|
children: [
|
|
1179
|
-
/* @__PURE__ */ (0,
|
|
1180
|
-
usesInlineMobileNavigation ? /* @__PURE__ */ (0,
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core25.Group, { wrap: "nowrap", gap: headerVariant === "compact" ? "xs" : "sm", className: classNames?.brand, children: [
|
|
1647
|
+
usesInlineMobileNavigation ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1181
1648
|
InlineMobileNavigation,
|
|
1182
1649
|
{
|
|
1183
1650
|
mobileNavigation,
|
|
@@ -1185,36 +1652,144 @@ function PublicShell({
|
|
|
1185
1652
|
mode: mobileNavigationMode
|
|
1186
1653
|
}
|
|
1187
1654
|
) : null,
|
|
1188
|
-
/* @__PURE__ */ (0,
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Box, { children: brand })
|
|
1189
1656
|
] }),
|
|
1190
|
-
/* @__PURE__ */ (0,
|
|
1191
|
-
/* @__PURE__ */ (0,
|
|
1657
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Group, { visibleFrom: "sm", gap: headerVariant === "compact" ? "md" : "lg", className: classNames?.navigation, children: resolvedNavigation }),
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Group, { gap: "sm", className: classNames?.actions, children: actions })
|
|
1192
1659
|
]
|
|
1193
1660
|
}
|
|
1194
1661
|
) }) }),
|
|
1195
|
-
usesSheetMobileNavigation ? /* @__PURE__ */ (0,
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1197
|
-
/* @__PURE__ */ (0,
|
|
1198
|
-
footer ? /* @__PURE__ */ (0,
|
|
1662
|
+
usesSheetMobileNavigation ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.AppShell.Footer, { withBorder: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Container, { size: containerSize, h: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Group, { h: "100%", justify: "space-around", wrap: "nowrap", children: mobileNavigation }) }) }) : null,
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_core25.AppShell.Main, { children: [
|
|
1664
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Container, { size: containerSize, py: mainPadding, className: classNames?.content, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Stack, { gap: "xl", children }) }),
|
|
1665
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Box, { component: typeof footer === "string" ? "footer" : "div", py: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Container, { size: containerSize, children: typeof footer === "string" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_core25.Text, { size: "sm", c: "dimmed", children: footer }) : footer }) }) : null
|
|
1199
1666
|
] })
|
|
1200
1667
|
]
|
|
1201
1668
|
}
|
|
1202
1669
|
);
|
|
1203
1670
|
}
|
|
1204
1671
|
|
|
1672
|
+
// src/DiscoveryShell.tsx
|
|
1673
|
+
var import_core26 = require("@mantine/core");
|
|
1674
|
+
var import_hooks2 = require("@mantine/hooks");
|
|
1675
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1676
|
+
function DiscoveryShell({
|
|
1677
|
+
header,
|
|
1678
|
+
sidebar,
|
|
1679
|
+
footer,
|
|
1680
|
+
children,
|
|
1681
|
+
mobileNavigationLabel = "Toggle navigation",
|
|
1682
|
+
defaultSidebarOpen = false,
|
|
1683
|
+
stickySidebar = true,
|
|
1684
|
+
sidebarWidth = 280,
|
|
1685
|
+
headerHeight = 60,
|
|
1686
|
+
shellPadding = "md",
|
|
1687
|
+
collapseBreakpoint = "sm"
|
|
1688
|
+
}) {
|
|
1689
|
+
const [opened, { toggle, close }] = (0, import_hooks2.useDisclosure)(defaultSidebarOpen);
|
|
1690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1691
|
+
import_core26.AppShell,
|
|
1692
|
+
{
|
|
1693
|
+
header: { height: headerHeight },
|
|
1694
|
+
footer: footer ? { height: 68 } : void 0,
|
|
1695
|
+
navbar: {
|
|
1696
|
+
width: sidebarWidth,
|
|
1697
|
+
breakpoint: collapseBreakpoint,
|
|
1698
|
+
collapsed: { mobile: !opened }
|
|
1699
|
+
},
|
|
1700
|
+
padding: shellPadding,
|
|
1701
|
+
children: [
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.AppShell.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_core26.Group, { h: "100%", px: "md", gap: "sm", wrap: "nowrap", children: [
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1704
|
+
import_core26.Burger,
|
|
1705
|
+
{
|
|
1706
|
+
opened,
|
|
1707
|
+
onClick: toggle,
|
|
1708
|
+
hiddenFrom: collapseBreakpoint,
|
|
1709
|
+
size: "sm",
|
|
1710
|
+
"aria-label": mobileNavigationLabel
|
|
1711
|
+
}
|
|
1712
|
+
),
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.Box, { style: { flex: 1, minWidth: 0 }, children: header })
|
|
1714
|
+
] }) }),
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.AppShell.Navbar, { p: "md", "data-sticky-sidebar": stickySidebar || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.ScrollArea, { h: "100%", type: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1716
|
+
import_core26.Box,
|
|
1717
|
+
{
|
|
1718
|
+
h: "100%",
|
|
1719
|
+
style: stickySidebar ? {
|
|
1720
|
+
display: "flex",
|
|
1721
|
+
flexDirection: "column"
|
|
1722
|
+
} : void 0,
|
|
1723
|
+
children: sidebar
|
|
1724
|
+
}
|
|
1725
|
+
) }) }),
|
|
1726
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.AppShell.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.Group, { h: "100%", px: "md", justify: "space-around", wrap: "nowrap", children: footer }) }) : null,
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_core26.AppShell.Main, { onClick: () => close(), children })
|
|
1728
|
+
]
|
|
1729
|
+
}
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// src/SidebarNav.tsx
|
|
1734
|
+
var import_react4 = require("react");
|
|
1735
|
+
var import_core27 = require("@mantine/core");
|
|
1736
|
+
var import_gds_theme3 = require("@doneisbetter/gds-theme");
|
|
1737
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1738
|
+
function SidebarNav({ children, ariaLabel = "Primary navigation", gap = "md" }) {
|
|
1739
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_core27.Stack, { component: "nav", "aria-label": ariaLabel, gap, h: "100%", children });
|
|
1740
|
+
}
|
|
1741
|
+
function SidebarNavSection({ label, children, pushToBottom = false }) {
|
|
1742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_core27.Stack, { gap: "xs", mt: pushToBottom ? "auto" : void 0, children: [
|
|
1743
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_core27.Text, { size: "xs", fw: 700, c: "dimmed", children: label }) : null,
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_core27.Stack, { gap: 4, children })
|
|
1745
|
+
] });
|
|
1746
|
+
}
|
|
1747
|
+
var _SidebarNavItem = (0, import_react4.forwardRef)(
|
|
1748
|
+
({
|
|
1749
|
+
action,
|
|
1750
|
+
label,
|
|
1751
|
+
description,
|
|
1752
|
+
badge,
|
|
1753
|
+
icon,
|
|
1754
|
+
"aria-label": ariaLabel,
|
|
1755
|
+
"aria-current": ariaCurrent,
|
|
1756
|
+
vocabularyPacks = [],
|
|
1757
|
+
...props
|
|
1758
|
+
}, ref) => {
|
|
1759
|
+
const { t } = (0, import_gds_theme3.useGdsTranslation)();
|
|
1760
|
+
const config = action ? resolveSemanticActionConfig(action, vocabularyPacks) : null;
|
|
1761
|
+
const Icon = config?.icon;
|
|
1762
|
+
const resolvedLabel = label ?? (action ? getSemanticActionLabel(action, t, vocabularyPacks) : void 0);
|
|
1763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1764
|
+
import_core27.NavLink,
|
|
1765
|
+
{
|
|
1766
|
+
ref,
|
|
1767
|
+
label: resolvedLabel,
|
|
1768
|
+
description,
|
|
1769
|
+
leftSection: icon ?? (Icon ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { size: "1rem", stroke: 1.5 }) : void 0),
|
|
1770
|
+
rightSection: badge ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_core27.Box, { children: badge }) : props.rightSection,
|
|
1771
|
+
"aria-label": ariaLabel ?? (typeof resolvedLabel === "string" ? resolvedLabel : void 0),
|
|
1772
|
+
"aria-current": props.active ? "page" : ariaCurrent,
|
|
1773
|
+
...props
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
);
|
|
1778
|
+
var SidebarNavItem = (0, import_core27.createPolymorphicComponent)(_SidebarNavItem);
|
|
1779
|
+
|
|
1205
1780
|
// src/PublicSiteFooter.tsx
|
|
1206
|
-
var
|
|
1207
|
-
var
|
|
1781
|
+
var import_core28 = require("@mantine/core");
|
|
1782
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1208
1783
|
function PublicSiteFooter({ children, meta }) {
|
|
1209
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
-
children ? /* @__PURE__ */ (0,
|
|
1211
|
-
meta ? /* @__PURE__ */ (0,
|
|
1784
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_core28.Stack, { component: "footer", gap: "xs", children: [
|
|
1785
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core28.Text, { size: "sm", children }) : null,
|
|
1786
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core28.Group, { gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_core28.Text, { size: "xs", c: "dimmed", children: meta }) }) : null
|
|
1212
1787
|
] });
|
|
1213
1788
|
}
|
|
1214
1789
|
|
|
1215
1790
|
// src/PublicBrandFooter.tsx
|
|
1216
|
-
var
|
|
1217
|
-
var
|
|
1791
|
+
var import_core29 = require("@mantine/core");
|
|
1792
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1218
1793
|
function PublicBrandFooter({
|
|
1219
1794
|
media,
|
|
1220
1795
|
brandTitle,
|
|
@@ -1229,8 +1804,8 @@ function PublicBrandFooter({
|
|
|
1229
1804
|
const mediaSpan = layoutVariant === "immersive-media" ? 5 : 4;
|
|
1230
1805
|
const primarySpan = media ? layoutVariant === "balanced-quote" ? 4 : 4 : secondary ? 6 : 12;
|
|
1231
1806
|
const secondarySpan = media ? Math.max(3, 12 - mediaSpan - primarySpan) : Math.max(4, 12 - primarySpan);
|
|
1232
|
-
return /* @__PURE__ */ (0,
|
|
1233
|
-
|
|
1807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1808
|
+
import_core29.Paper,
|
|
1234
1809
|
{
|
|
1235
1810
|
component: "footer",
|
|
1236
1811
|
withBorder: true,
|
|
@@ -1238,19 +1813,19 @@ function PublicBrandFooter({
|
|
|
1238
1813
|
p: compact ? "lg" : "xl",
|
|
1239
1814
|
className: classNames?.root,
|
|
1240
1815
|
"data-layout-variant": layoutVariant,
|
|
1241
|
-
children: /* @__PURE__ */ (0,
|
|
1242
|
-
/* @__PURE__ */ (0,
|
|
1243
|
-
media ? /* @__PURE__ */ (0,
|
|
1244
|
-
/* @__PURE__ */ (0,
|
|
1245
|
-
brandTitle ? /* @__PURE__ */ (0,
|
|
1246
|
-
description ? /* @__PURE__ */ (0,
|
|
1247
|
-
actions ? /* @__PURE__ */ (0,
|
|
1816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core29.Stack, { gap: "lg", children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core29.Grid, { gutter: compact ? "lg" : "xl", align: "flex-start", children: [
|
|
1818
|
+
media ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Grid.Col, { span: { base: 12, md: mediaSpan }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Box, { className: classNames?.media, children: media }) }) : null,
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Grid.Col, { span: { base: 12, md: primarySpan }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_core29.Stack, { gap: compact ? "xs" : "sm", className: classNames?.primary, children: [
|
|
1820
|
+
brandTitle ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Title, { order: 4, children: brandTitle }) : null,
|
|
1821
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Text, { c: "dimmed", children: description }) : null,
|
|
1822
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Box, { children: actions }) : null
|
|
1248
1823
|
] }) }),
|
|
1249
|
-
secondary ? /* @__PURE__ */ (0,
|
|
1824
|
+
secondary ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Grid.Col, { span: { base: 12, md: secondarySpan }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Stack, { gap: compact ? "xs" : "sm", className: classNames?.secondary, children: secondary }) }) : null
|
|
1250
1825
|
] }),
|
|
1251
|
-
legal ? /* @__PURE__ */ (0,
|
|
1252
|
-
/* @__PURE__ */ (0,
|
|
1253
|
-
/* @__PURE__ */ (0,
|
|
1826
|
+
legal ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
1827
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Divider, {}),
|
|
1828
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Group, { justify: "space-between", gap: "sm", wrap: "wrap", className: classNames?.legal, children: typeof legal === "string" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_core29.Text, { size: "sm", c: "dimmed", children: legal }) : legal })
|
|
1254
1829
|
] }) : null
|
|
1255
1830
|
] })
|
|
1256
1831
|
}
|
|
@@ -1258,47 +1833,126 @@ function PublicBrandFooter({
|
|
|
1258
1833
|
}
|
|
1259
1834
|
|
|
1260
1835
|
// src/AuthShell.tsx
|
|
1261
|
-
var
|
|
1262
|
-
var
|
|
1263
|
-
function AuthShell({
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1836
|
+
var import_core30 = require("@mantine/core");
|
|
1837
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1838
|
+
function AuthShell({
|
|
1839
|
+
title,
|
|
1840
|
+
description,
|
|
1841
|
+
brand,
|
|
1842
|
+
headerActions,
|
|
1843
|
+
footer,
|
|
1844
|
+
helper,
|
|
1845
|
+
socialAuth,
|
|
1846
|
+
dividerLabel = "Or continue with your account",
|
|
1847
|
+
children
|
|
1848
|
+
}) {
|
|
1849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Box, { py: { base: "xl", md: "4rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Container, { size: "xs", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core30.Stack, { gap: "xl", children: [
|
|
1850
|
+
brand || headerActions ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core30.Group, { justify: brand && headerActions ? "space-between" : "center", align: "center", children: [
|
|
1851
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Box, { children: brand }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Box, {}),
|
|
1852
|
+
headerActions ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Group, { gap: "sm", children: headerActions }) : null
|
|
1853
|
+
] }) : null,
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Card, { withBorder: true, radius: "lg", padding: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core30.Stack, { gap: "lg", children: [
|
|
1855
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core30.Stack, { gap: "xs", ta: "center", children: [
|
|
1856
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Title, { order: 2, children: title }),
|
|
1857
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Text, { c: "dimmed", size: "sm", children: description }) : null
|
|
1270
1858
|
] }),
|
|
1859
|
+
socialAuth ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Box, { children: socialAuth }) : null,
|
|
1860
|
+
socialAuth ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Divider, { label: dividerLabel, labelPosition: "center" }) : null,
|
|
1271
1861
|
children,
|
|
1272
|
-
helper ? /* @__PURE__ */ (0,
|
|
1862
|
+
helper ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Text, { size: "sm", c: "dimmed", ta: "center", children: helper }) : null
|
|
1273
1863
|
] }) }),
|
|
1274
|
-
footer ? /* @__PURE__ */ (0,
|
|
1864
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core30.Text, { size: "sm", c: "dimmed", ta: "center", children: footer }) : null
|
|
1275
1865
|
] }) }) });
|
|
1276
1866
|
}
|
|
1277
1867
|
|
|
1868
|
+
// src/SocialAuthButtons.tsx
|
|
1869
|
+
var import_core31 = require("@mantine/core");
|
|
1870
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1871
|
+
var providerConfig = {
|
|
1872
|
+
google: { label: "Google", mark: "G", color: "red" },
|
|
1873
|
+
apple: { label: "Apple", mark: "A", color: "dark" },
|
|
1874
|
+
github: { label: "GitHub", mark: "GH", color: "gray" },
|
|
1875
|
+
facebook: { label: "Facebook", mark: "F", color: "blue" },
|
|
1876
|
+
microsoft: { label: "Microsoft", mark: "M", color: "cyan" },
|
|
1877
|
+
linkedin: { label: "LinkedIn", mark: "in", color: "blue" },
|
|
1878
|
+
discord: { label: "Discord", mark: "D", color: "indigo" },
|
|
1879
|
+
x: { label: "X", mark: "X", color: "dark" },
|
|
1880
|
+
email: { label: "Email", mark: "@", color: "gray" }
|
|
1881
|
+
};
|
|
1882
|
+
function ProviderMark({ id }) {
|
|
1883
|
+
const config = providerConfig[id] ?? { label: id, mark: id.slice(0, 2).toUpperCase(), color: "gray" };
|
|
1884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.ThemeIcon, { variant: "light", color: config.color, radius: "xl", size: "md", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Text, { size: "xs", fw: 700, children: config.mark }) });
|
|
1885
|
+
}
|
|
1886
|
+
function SocialAuthButton({ provider, compact = false }) {
|
|
1887
|
+
const config = providerConfig[provider.id] ?? { label: provider.id, mark: provider.id.slice(0, 2).toUpperCase(), color: "gray" };
|
|
1888
|
+
const label = provider.label ?? `Continue with ${config.label}`;
|
|
1889
|
+
const buttonProps = provider.href ? { component: "a", href: provider.href } : { onClick: provider.onClick };
|
|
1890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1891
|
+
import_core31.Button,
|
|
1892
|
+
{
|
|
1893
|
+
variant: "default",
|
|
1894
|
+
justify: "space-between",
|
|
1895
|
+
fullWidth: true,
|
|
1896
|
+
size: compact ? "sm" : "md",
|
|
1897
|
+
leftSection: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ProviderMark, { id: provider.id }),
|
|
1898
|
+
disabled: provider.disabled,
|
|
1899
|
+
loading: provider.loading,
|
|
1900
|
+
...buttonProps,
|
|
1901
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core31.Stack, { gap: 0, align: "flex-start", children: [
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Text, { inherit: true, children: label }),
|
|
1903
|
+
provider.description ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Text, { size: "xs", c: "dimmed", lh: 1.2, children: provider.description }) : null
|
|
1904
|
+
] })
|
|
1905
|
+
}
|
|
1906
|
+
);
|
|
1907
|
+
}
|
|
1908
|
+
function SocialAuthButtons({
|
|
1909
|
+
providers,
|
|
1910
|
+
title = "Continue with a trusted provider",
|
|
1911
|
+
description,
|
|
1912
|
+
layout = "stack",
|
|
1913
|
+
compact = false
|
|
1914
|
+
}) {
|
|
1915
|
+
if (!providers.length) {
|
|
1916
|
+
return null;
|
|
1917
|
+
}
|
|
1918
|
+
const content = providers.map((provider) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SocialAuthButton, { provider, compact }, provider.id));
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core31.Stack, { gap: "md", children: [
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core31.Stack, { gap: 4, ta: "center", children: [
|
|
1921
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_core31.Group, { justify: "center", gap: "xs", children: [
|
|
1922
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GdsIcons.Login, { size: "1rem" }),
|
|
1923
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Text, { fw: 600, children: title })
|
|
1924
|
+
] }),
|
|
1925
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
1926
|
+
] }),
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Divider, {}),
|
|
1928
|
+
layout === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: content }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_core31.Stack, { gap: "sm", children: content })
|
|
1929
|
+
] });
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1278
1932
|
// src/ArticleShell.tsx
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1933
|
+
var import_core32 = require("@mantine/core");
|
|
1934
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1281
1935
|
function ArticleShell({ eyebrow, title, lead, meta, sideRail, children }) {
|
|
1282
|
-
return /* @__PURE__ */ (0,
|
|
1283
|
-
/* @__PURE__ */ (0,
|
|
1284
|
-
/* @__PURE__ */ (0,
|
|
1285
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
1286
|
-
/* @__PURE__ */ (0,
|
|
1287
|
-
lead ? /* @__PURE__ */ (0,
|
|
1288
|
-
meta ? /* @__PURE__ */ (0,
|
|
1936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Container, { size: "lg", py: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_core32.Group, { align: "flex-start", gap: "xl", wrap: "nowrap", children: [
|
|
1937
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_core32.Stack, { gap: "lg", maw: 760, flex: 1, children: [
|
|
1938
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_core32.Stack, { gap: "sm", children: [
|
|
1939
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Text, { size: "sm", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Title, { order: 1, children: title }),
|
|
1941
|
+
lead ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Text, { size: "lg", c: "dimmed", children: lead }) : null,
|
|
1942
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Group, { gap: "md", children: meta }) : null
|
|
1289
1943
|
] }),
|
|
1290
|
-
/* @__PURE__ */ (0,
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Stack, { gap: "md", children })
|
|
1291
1945
|
] }),
|
|
1292
|
-
sideRail ? /* @__PURE__ */ (0,
|
|
1946
|
+
sideRail ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core32.Stack, { visibleFrom: "lg", gap: "md", w: 240, children: sideRail }) : null
|
|
1293
1947
|
] }) });
|
|
1294
1948
|
}
|
|
1295
1949
|
|
|
1296
1950
|
// src/DocsCodeBlock.tsx
|
|
1297
|
-
var
|
|
1298
|
-
var
|
|
1299
|
-
var
|
|
1951
|
+
var import_react5 = require("react");
|
|
1952
|
+
var import_core33 = require("@mantine/core");
|
|
1953
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1300
1954
|
function DocsCodeBlock({ code, language, title, withCopy = true }) {
|
|
1301
|
-
const [copied, setCopied] = (0,
|
|
1955
|
+
const [copied, setCopied] = (0, import_react5.useState)(false);
|
|
1302
1956
|
const handleCopy = async () => {
|
|
1303
1957
|
if (!navigator?.clipboard) {
|
|
1304
1958
|
return;
|
|
@@ -1307,44 +1961,44 @@ function DocsCodeBlock({ code, language, title, withCopy = true }) {
|
|
|
1307
1961
|
setCopied(true);
|
|
1308
1962
|
window.setTimeout(() => setCopied(false), 1200);
|
|
1309
1963
|
};
|
|
1310
|
-
return /* @__PURE__ */ (0,
|
|
1311
|
-
title || withCopy ? /* @__PURE__ */ (0,
|
|
1312
|
-
/* @__PURE__ */ (0,
|
|
1313
|
-
title ? /* @__PURE__ */ (0,
|
|
1314
|
-
language ? /* @__PURE__ */ (0,
|
|
1964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core33.Paper, { withBorder: true, radius: "lg", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core33.Stack, { gap: "sm", children: [
|
|
1965
|
+
title || withCopy ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core33.Group, { justify: "space-between", align: "center", children: [
|
|
1966
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core33.Stack, { gap: 0, children: [
|
|
1967
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core33.Text, { fw: 600, children: title }) : null,
|
|
1968
|
+
language ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core33.Text, { size: "xs", c: "dimmed", children: language }) : null
|
|
1315
1969
|
] }),
|
|
1316
|
-
withCopy ? /* @__PURE__ */ (0,
|
|
1317
|
-
|
|
1970
|
+
withCopy ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1971
|
+
import_core33.ActionIcon,
|
|
1318
1972
|
{
|
|
1319
1973
|
variant: "subtle",
|
|
1320
1974
|
"aria-label": copied ? "Copied code block" : "Copy code block",
|
|
1321
1975
|
onClick: () => {
|
|
1322
1976
|
void handleCopy();
|
|
1323
1977
|
},
|
|
1324
|
-
children: /* @__PURE__ */ (0,
|
|
1978
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GdsIcons.Copy, { size: "1rem" })
|
|
1325
1979
|
}
|
|
1326
1980
|
) : null
|
|
1327
1981
|
] }) : null,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1982
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core33.Code, { block: true, children: code })
|
|
1329
1983
|
] }) });
|
|
1330
1984
|
}
|
|
1331
1985
|
|
|
1332
1986
|
// src/CtaButtonGroup.tsx
|
|
1333
|
-
var
|
|
1334
|
-
var
|
|
1987
|
+
var import_core34 = require("@mantine/core");
|
|
1988
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1335
1989
|
function CtaButtonGroup({ primary, secondary, tertiary }) {
|
|
1336
|
-
return /* @__PURE__ */ (0,
|
|
1337
|
-
/* @__PURE__ */ (0,
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1339
|
-
secondary ? /* @__PURE__ */ (0,
|
|
1990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_core34.Stack, { gap: "sm", children: [
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_core34.Group, { gap: "sm", align: "stretch", children: [
|
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: primary }),
|
|
1993
|
+
secondary ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: secondary }) : null
|
|
1340
1994
|
] }),
|
|
1341
|
-
tertiary ? /* @__PURE__ */ (0,
|
|
1995
|
+
tertiary ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { children: tertiary }) : null
|
|
1342
1996
|
] });
|
|
1343
1997
|
}
|
|
1344
1998
|
|
|
1345
1999
|
// src/DocsPageShell.tsx
|
|
1346
|
-
var
|
|
1347
|
-
var
|
|
2000
|
+
var import_core35 = require("@mantine/core");
|
|
2001
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1348
2002
|
function DocsPageShell({
|
|
1349
2003
|
breadcrumbs = [],
|
|
1350
2004
|
title,
|
|
@@ -1355,27 +2009,27 @@ function DocsPageShell({
|
|
|
1355
2009
|
footerNext,
|
|
1356
2010
|
children
|
|
1357
2011
|
}) {
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1360
|
-
breadcrumbs.length ? /* @__PURE__ */ (0,
|
|
1361
|
-
(crumb) => crumb.href ? /* @__PURE__ */ (0,
|
|
2012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Container, { size: "lg", py: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core35.Group, { align: "flex-start", gap: "xl", wrap: "nowrap", children: [
|
|
2013
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core35.Stack, { component: "article", gap: "lg", maw: 760, flex: 1, children: [
|
|
2014
|
+
breadcrumbs.length ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Breadcrumbs, { children: breadcrumbs.map(
|
|
2015
|
+
(crumb) => crumb.href ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Anchor, { href: crumb.href, children: crumb.label }, `${crumb.label}-${crumb.href}`) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Text, { children: crumb.label }, crumb.label)
|
|
1362
2016
|
) }) : null,
|
|
1363
|
-
/* @__PURE__ */ (0,
|
|
1364
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1366
|
-
lead ? /* @__PURE__ */ (0,
|
|
1367
|
-
meta ? /* @__PURE__ */ (0,
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core35.Stack, { gap: "sm", children: [
|
|
2018
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Text, { size: "sm", fw: 700, c: "dimmed", children: eyebrow }) : null,
|
|
2019
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Title, { order: 1, children: title }),
|
|
2020
|
+
lead ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Text, { size: "lg", c: "dimmed", children: lead }) : null,
|
|
2021
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Group, { gap: "md", children: meta }) : null
|
|
1368
2022
|
] }),
|
|
1369
|
-
/* @__PURE__ */ (0,
|
|
1370
|
-
footerNext ? /* @__PURE__ */ (0,
|
|
2023
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Stack, { gap: "md", children }),
|
|
2024
|
+
footerNext ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Anchor, { href: footerNext.href, fw: 600, children: footerNext.label }) : null
|
|
1371
2025
|
] }),
|
|
1372
|
-
sideRail ? /* @__PURE__ */ (0,
|
|
2026
|
+
sideRail ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core35.Stack, { visibleFrom: "lg", gap: "md", w: 240, children: sideRail }) : null
|
|
1373
2027
|
] }) });
|
|
1374
2028
|
}
|
|
1375
2029
|
|
|
1376
2030
|
// src/EditorialHero.tsx
|
|
1377
|
-
var
|
|
1378
|
-
var
|
|
2031
|
+
var import_core36 = require("@mantine/core");
|
|
2032
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1379
2033
|
function resolveActionVariant(action, index, seenPrimary) {
|
|
1380
2034
|
const requested = action.variant ?? (index === 0 ? "primary" : "secondary");
|
|
1381
2035
|
if (requested === "primary" && !seenPrimary) {
|
|
@@ -1387,8 +2041,8 @@ function resolveActionVariant(action, index, seenPrimary) {
|
|
|
1387
2041
|
return { variant: "default", seenPrimary };
|
|
1388
2042
|
}
|
|
1389
2043
|
function HeroAction({ action, variant }) {
|
|
1390
|
-
const content = /* @__PURE__ */ (0,
|
|
1391
|
-
|
|
2044
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2045
|
+
import_core36.Anchor,
|
|
1392
2046
|
{
|
|
1393
2047
|
href: action.href,
|
|
1394
2048
|
onClick: action.onClick,
|
|
@@ -1412,8 +2066,8 @@ function HeroAction({ action, variant }) {
|
|
|
1412
2066
|
}
|
|
1413
2067
|
);
|
|
1414
2068
|
if (!action.href) {
|
|
1415
|
-
return /* @__PURE__ */ (0,
|
|
1416
|
-
|
|
2069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2070
|
+
import_core36.Box,
|
|
1417
2071
|
{
|
|
1418
2072
|
component: "button",
|
|
1419
2073
|
type: "button",
|
|
@@ -1440,30 +2094,30 @@ function HeroAction({ action, variant }) {
|
|
|
1440
2094
|
return content;
|
|
1441
2095
|
}
|
|
1442
2096
|
function LoadingHero({ compact }) {
|
|
1443
|
-
return /* @__PURE__ */ (0,
|
|
1444
|
-
/* @__PURE__ */ (0,
|
|
1445
|
-
/* @__PURE__ */ (0,
|
|
1446
|
-
/* @__PURE__ */ (0,
|
|
1447
|
-
/* @__PURE__ */ (0,
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
2097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Paper, { withBorder: true, radius: "xl", p: compact ? "lg" : "xl", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Grid, { gutter: compact ? "lg" : "xl", align: "center", children: [
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Stack, { gap: "md", children: [
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 16, width: 96, radius: "xl" }),
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 48, width: "90%", radius: "md" }),
|
|
2101
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 18, width: "100%", radius: "md" }),
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 18, width: "82%", radius: "md" }),
|
|
2103
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Group, { children: [
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 40, width: 140, radius: "md" }),
|
|
2105
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { height: 40, width: 140, radius: "md" })
|
|
1452
2106
|
] })
|
|
1453
2107
|
] }) }),
|
|
1454
|
-
/* @__PURE__ */ (0,
|
|
2108
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.AspectRatio, { ratio: 16 / 11, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Skeleton, { radius: "lg" }) }) })
|
|
1455
2109
|
] }) });
|
|
1456
2110
|
}
|
|
1457
2111
|
function MediaFallback() {
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1459
|
-
|
|
2112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.AspectRatio, { ratio: 16 / 11, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2113
|
+
import_core36.ThemeIcon,
|
|
1460
2114
|
{
|
|
1461
2115
|
size: "100%",
|
|
1462
2116
|
radius: "lg",
|
|
1463
2117
|
color: "gray",
|
|
1464
2118
|
variant: "light",
|
|
1465
2119
|
"aria-label": "Hero media is unavailable",
|
|
1466
|
-
children: /* @__PURE__ */ (0,
|
|
2120
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(GdsIcons.Gallery, { size: "2.5rem" })
|
|
1467
2121
|
}
|
|
1468
2122
|
) });
|
|
1469
2123
|
}
|
|
@@ -1483,8 +2137,8 @@ function MediaFrame({
|
|
|
1483
2137
|
} else if (mediaFade === "soft-start") {
|
|
1484
2138
|
overlayBackground = "linear-gradient(90deg, light-dark(rgba(255,255,255,0.9), rgba(17,24,39,0.72)) 0%, rgba(255,255,255,0) 28%)";
|
|
1485
2139
|
}
|
|
1486
|
-
return /* @__PURE__ */ (0,
|
|
1487
|
-
|
|
2140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2141
|
+
import_core36.Box,
|
|
1488
2142
|
{
|
|
1489
2143
|
component: "figure",
|
|
1490
2144
|
m: 0,
|
|
@@ -1497,9 +2151,9 @@ function MediaFrame({
|
|
|
1497
2151
|
},
|
|
1498
2152
|
"aria-label": mediaAlt,
|
|
1499
2153
|
children: [
|
|
1500
|
-
media ?? /* @__PURE__ */ (0,
|
|
1501
|
-
media && overlayBackground ? /* @__PURE__ */ (0,
|
|
1502
|
-
|
|
2154
|
+
media ?? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MediaFallback, {}),
|
|
2155
|
+
media && overlayBackground ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2156
|
+
import_core36.Box,
|
|
1503
2157
|
{
|
|
1504
2158
|
"aria-hidden": true,
|
|
1505
2159
|
style: {
|
|
@@ -1532,7 +2186,7 @@ function EditorialHero({
|
|
|
1532
2186
|
classNames
|
|
1533
2187
|
}) {
|
|
1534
2188
|
if (loading) {
|
|
1535
|
-
return /* @__PURE__ */ (0,
|
|
2189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(LoadingHero, { compact });
|
|
1536
2190
|
}
|
|
1537
2191
|
const stackAlign = align === "center" ? "center" : "flex-start";
|
|
1538
2192
|
const textAlign = align === "center" ? "center" : "left";
|
|
@@ -1540,15 +2194,15 @@ function EditorialHero({
|
|
|
1540
2194
|
const renderedActions = actions.slice(0, 3).map((action, index) => {
|
|
1541
2195
|
const resolved = resolveActionVariant(action, index, seenPrimary);
|
|
1542
2196
|
seenPrimary = resolved.seenPrimary;
|
|
1543
|
-
return /* @__PURE__ */ (0,
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(HeroAction, { action, variant: resolved.variant }, `${action.label}-${index}`);
|
|
1544
2198
|
});
|
|
1545
|
-
const textSlot = /* @__PURE__ */ (0,
|
|
1546
|
-
/* @__PURE__ */ (0,
|
|
1547
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1549
|
-
description ? /* @__PURE__ */ (0,
|
|
2199
|
+
const textSlot = /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Stack, { gap: compact ? "md" : "lg", justify: "center", h: "100%", className: classNames?.content, children: [
|
|
2200
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Stack, { gap: "sm", align: stackAlign, children: [
|
|
2201
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Text, { size: "sm", fw: 700, c: "dimmed", ta: textAlign, children: eyebrow }) : null,
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Title, { order: 1, maw: 760, ta: textAlign, children: title }),
|
|
2203
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Text, { size: compact ? "md" : "lg", c: "dimmed", maw: 720, ta: textAlign, children: description }) : null
|
|
1550
2204
|
] }),
|
|
1551
|
-
renderedActions.length ? /* @__PURE__ */ (0,
|
|
2205
|
+
renderedActions.length ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Box, { className: classNames?.actions, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1552
2206
|
CtaButtonGroup,
|
|
1553
2207
|
{
|
|
1554
2208
|
primary: renderedActions[0],
|
|
@@ -1556,8 +2210,8 @@ function EditorialHero({
|
|
|
1556
2210
|
tertiary: renderedActions[2]
|
|
1557
2211
|
}
|
|
1558
2212
|
) }) : null,
|
|
1559
|
-
meta.length ? /* @__PURE__ */ (0,
|
|
1560
|
-
|
|
2213
|
+
meta.length ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Group, { gap: "sm", wrap: "wrap", "aria-label": "Supporting details", className: classNames?.meta, children: meta.map((item) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2214
|
+
import_core36.Group,
|
|
1561
2215
|
{
|
|
1562
2216
|
gap: 6,
|
|
1563
2217
|
px: "sm",
|
|
@@ -1568,17 +2222,17 @@ function EditorialHero({
|
|
|
1568
2222
|
},
|
|
1569
2223
|
children: [
|
|
1570
2224
|
item.icon,
|
|
1571
|
-
/* @__PURE__ */ (0,
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Text, { size: "sm", c: "dimmed", children: item.label })
|
|
1572
2226
|
]
|
|
1573
2227
|
},
|
|
1574
2228
|
item.id
|
|
1575
2229
|
)) }) : null
|
|
1576
2230
|
] });
|
|
1577
|
-
const mediaSlot = error ? /* @__PURE__ */ (0,
|
|
1578
|
-
const textCol = /* @__PURE__ */ (0,
|
|
1579
|
-
const mediaCol = /* @__PURE__ */ (0,
|
|
1580
|
-
return /* @__PURE__ */ (0,
|
|
1581
|
-
|
|
2231
|
+
const mediaSlot = error ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(AccentPanel, { tone: "red", variant: "soft-outline", title: "Media unavailable", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MediaFrame, { media, mediaAlt, mediaFade, className: classNames?.media });
|
|
2232
|
+
const textCol = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Grid.Col, { span: { base: 12, md: 6 }, order: { base: 1, md: mediaPosition === "left" ? 2 : 1 }, children: textSlot });
|
|
2233
|
+
const mediaCol = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core36.Grid.Col, { span: { base: 12, md: 6 }, order: { base: 2, md: mediaPosition === "left" ? 1 : 2 }, children: mediaSlot });
|
|
2234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2235
|
+
import_core36.Paper,
|
|
1582
2236
|
{
|
|
1583
2237
|
component: "section",
|
|
1584
2238
|
withBorder: true,
|
|
@@ -1586,7 +2240,7 @@ function EditorialHero({
|
|
|
1586
2240
|
p: compact ? "lg" : "xl",
|
|
1587
2241
|
className: classNames?.root,
|
|
1588
2242
|
style: surfaceVariant === "flat-public" ? { boxShadow: "none" } : void 0,
|
|
1589
|
-
children: /* @__PURE__ */ (0,
|
|
2243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core36.Grid, { gutter: compact ? "lg" : "xl", align: "center", children: [
|
|
1590
2244
|
textCol,
|
|
1591
2245
|
mediaCol
|
|
1592
2246
|
] })
|
|
@@ -1595,19 +2249,19 @@ function EditorialHero({
|
|
|
1595
2249
|
}
|
|
1596
2250
|
|
|
1597
2251
|
// src/FeatureBand.tsx
|
|
1598
|
-
var
|
|
1599
|
-
var
|
|
2252
|
+
var import_core37 = require("@mantine/core");
|
|
2253
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1600
2254
|
function FeatureBandSkeleton({
|
|
1601
2255
|
columns = 3,
|
|
1602
2256
|
bordered = true,
|
|
1603
2257
|
variant = "default"
|
|
1604
2258
|
}) {
|
|
1605
|
-
return /* @__PURE__ */ (0,
|
|
1606
|
-
/* @__PURE__ */ (0,
|
|
1607
|
-
/* @__PURE__ */ (0,
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
2259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Paper, { withBorder: bordered, radius: "lg", p: variant === "compact" ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core37.Stack, { gap: "md", children: [
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Skeleton, { height: variant === "process" ? 28 : 42, width: variant === "process" ? 72 : 42, radius: "xl" }),
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core37.Stack, { gap: "xs", children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Skeleton, { height: 20, width: "75%", radius: "md" }),
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Skeleton, { height: 14, width: "100%", radius: "md" }),
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Skeleton, { height: 14, width: "82%", radius: "md" })
|
|
1611
2265
|
] })
|
|
1612
2266
|
] }) }, index)) });
|
|
1613
2267
|
}
|
|
@@ -1620,10 +2274,10 @@ function FeatureBand({
|
|
|
1620
2274
|
variant = "default"
|
|
1621
2275
|
}) {
|
|
1622
2276
|
if (loading) {
|
|
1623
|
-
return /* @__PURE__ */ (0,
|
|
2277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FeatureBandSkeleton, { columns, bordered, variant });
|
|
1624
2278
|
}
|
|
1625
2279
|
if (!items.length) {
|
|
1626
|
-
return emptyState ? /* @__PURE__ */ (0,
|
|
2280
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: emptyState }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1627
2281
|
EmptyState,
|
|
1628
2282
|
{
|
|
1629
2283
|
title: "No supporting details available",
|
|
@@ -1631,9 +2285,9 @@ function FeatureBand({
|
|
|
1631
2285
|
}
|
|
1632
2286
|
);
|
|
1633
2287
|
}
|
|
1634
|
-
return /* @__PURE__ */ (0,
|
|
1635
|
-
variant === "process" ? /* @__PURE__ */ (0,
|
|
1636
|
-
|
|
2288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Box, { component: "section", "aria-label": "Supporting features", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Paper, { withBorder: bordered, radius: "lg", p: variant === "compact" ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core37.Stack, { gap: "md", children: [
|
|
2289
|
+
variant === "process" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2290
|
+
import_core37.Text,
|
|
1637
2291
|
{
|
|
1638
2292
|
fw: 800,
|
|
1639
2293
|
size: "sm",
|
|
@@ -1645,19 +2299,352 @@ function FeatureBand({
|
|
|
1645
2299
|
},
|
|
1646
2300
|
children: item.stepLabel ?? `Step ${index + 1}`
|
|
1647
2301
|
}
|
|
1648
|
-
) }) : item.media ? item.media : item.icon ? /* @__PURE__ */ (0,
|
|
1649
|
-
/* @__PURE__ */ (0,
|
|
1650
|
-
/* @__PURE__ */ (0,
|
|
1651
|
-
item.description ? /* @__PURE__ */ (0,
|
|
1652
|
-
item.meta ? /* @__PURE__ */ (0,
|
|
2302
|
+
) }) : item.media ? item.media : item.icon ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.ThemeIcon, { size: "xl", radius: "xl", variant: "light", color: "violet", children: item.icon }) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.ThemeIcon, { size: "xl", radius: "xl", variant: "light", color: "gray", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GdsIcons.Info, { size: "1.25rem" }) }) }),
|
|
2303
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core37.Stack, { gap: "xs", children: [
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Title, { order: 4, children: item.title }),
|
|
2305
|
+
item.description ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Text, { c: "dimmed", children: item.description }) : null,
|
|
2306
|
+
item.meta ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core37.Text, { size: "sm", c: "dimmed", children: item.meta }) : null
|
|
1653
2307
|
] })
|
|
1654
2308
|
] }) }, item.id)) }) });
|
|
1655
2309
|
}
|
|
1656
2310
|
|
|
2311
|
+
// src/MapPanel.tsx
|
|
2312
|
+
var import_core38 = require("@mantine/core");
|
|
2313
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2314
|
+
function MapPanel({
|
|
2315
|
+
title,
|
|
2316
|
+
description,
|
|
2317
|
+
actions,
|
|
2318
|
+
loading = false,
|
|
2319
|
+
empty,
|
|
2320
|
+
error,
|
|
2321
|
+
embedTitle,
|
|
2322
|
+
iframeSrc,
|
|
2323
|
+
iframeSandbox = "allow-scripts allow-same-origin allow-popups",
|
|
2324
|
+
renderMap,
|
|
2325
|
+
minHeight = 320
|
|
2326
|
+
}) {
|
|
2327
|
+
let body;
|
|
2328
|
+
if (loading) {
|
|
2329
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2330
|
+
StateBlock,
|
|
2331
|
+
{
|
|
2332
|
+
variant: "loading",
|
|
2333
|
+
title: "Loading map",
|
|
2334
|
+
description: "The shared map panel is still preparing the embedded surface.",
|
|
2335
|
+
compact: true
|
|
2336
|
+
}
|
|
2337
|
+
);
|
|
2338
|
+
} else if (error) {
|
|
2339
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StateBlock, { variant: "error", title: "Map unavailable", description: error, compact: true });
|
|
2340
|
+
} else if (!iframeSrc && !renderMap) {
|
|
2341
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2342
|
+
StateBlock,
|
|
2343
|
+
{
|
|
2344
|
+
variant: "empty",
|
|
2345
|
+
title: "No map available",
|
|
2346
|
+
description: empty ?? "Add coordinates or a sanctioned embed source to render this panel.",
|
|
2347
|
+
compact: true
|
|
2348
|
+
}
|
|
2349
|
+
);
|
|
2350
|
+
} else if (renderMap) {
|
|
2351
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core38.Box, { style: { minHeight }, children: renderMap() });
|
|
2352
|
+
} else {
|
|
2353
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core38.AspectRatio, { ratio: 16 / 9, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2354
|
+
"iframe",
|
|
2355
|
+
{
|
|
2356
|
+
src: iframeSrc,
|
|
2357
|
+
title: embedTitle ?? "Embedded map",
|
|
2358
|
+
sandbox: iframeSandbox,
|
|
2359
|
+
loading: "lazy",
|
|
2360
|
+
referrerPolicy: "no-referrer-when-downgrade",
|
|
2361
|
+
style: { width: "100%", height: "100%", border: 0, borderRadius: 12 }
|
|
2362
|
+
}
|
|
2363
|
+
) });
|
|
2364
|
+
}
|
|
2365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core38.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core38.Stack, { gap: "md", children: [
|
|
2366
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core38.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
2367
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core38.Stack, { gap: 4, children: [
|
|
2368
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core38.Title, { order: 3, children: title }),
|
|
2369
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core38.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
2370
|
+
] }),
|
|
2371
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ActionBar, { ...actions }) : null
|
|
2372
|
+
] }),
|
|
2373
|
+
body
|
|
2374
|
+
] }) });
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
// src/PublicFlowShell.tsx
|
|
2378
|
+
var import_core39 = require("@mantine/core");
|
|
2379
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2380
|
+
var stageTone = {
|
|
2381
|
+
idle: { label: "Idle", color: "gray" },
|
|
2382
|
+
loading: { label: "Loading", color: "blue" },
|
|
2383
|
+
ready: { label: "Ready", color: "teal" },
|
|
2384
|
+
error: { label: "Error", color: "red" },
|
|
2385
|
+
complete: { label: "Complete", color: "teal" }
|
|
2386
|
+
};
|
|
2387
|
+
function toActionBar(actions = []) {
|
|
2388
|
+
if (!actions.length) {
|
|
2389
|
+
return void 0;
|
|
2390
|
+
}
|
|
2391
|
+
const ordered = [...actions].sort((left, right) => {
|
|
2392
|
+
const rank = { primary: 0, secondary: 1, tertiary: 2 };
|
|
2393
|
+
return rank[left.priority] - rank[right.priority];
|
|
2394
|
+
});
|
|
2395
|
+
const primary = ordered.find((action) => action.priority === "primary");
|
|
2396
|
+
const secondary = ordered.filter((action) => action.priority === "secondary");
|
|
2397
|
+
const tertiary = ordered.filter((action) => action.priority === "tertiary");
|
|
2398
|
+
return {
|
|
2399
|
+
primary: primary ? {
|
|
2400
|
+
action: primary.action,
|
|
2401
|
+
disabled: primary.disabled,
|
|
2402
|
+
loading: primary.loading,
|
|
2403
|
+
onClick: primary.onClick
|
|
2404
|
+
} : void 0,
|
|
2405
|
+
secondary: secondary.map((action) => ({
|
|
2406
|
+
action: action.action,
|
|
2407
|
+
disabled: action.disabled,
|
|
2408
|
+
loading: action.loading,
|
|
2409
|
+
onClick: action.onClick
|
|
2410
|
+
})),
|
|
2411
|
+
tertiary: tertiary.map((action) => ({
|
|
2412
|
+
action: action.action,
|
|
2413
|
+
disabled: action.disabled,
|
|
2414
|
+
loading: action.loading,
|
|
2415
|
+
onClick: action.onClick
|
|
2416
|
+
}))
|
|
2417
|
+
};
|
|
2418
|
+
}
|
|
2419
|
+
function PublicFlowShell({
|
|
2420
|
+
stage,
|
|
2421
|
+
eyebrow,
|
|
2422
|
+
exitAction,
|
|
2423
|
+
hardwareSurface,
|
|
2424
|
+
emptyState,
|
|
2425
|
+
errorState
|
|
2426
|
+
}) {
|
|
2427
|
+
const tone = stageTone[stage.status];
|
|
2428
|
+
const actionBar = toActionBar(stage.actions);
|
|
2429
|
+
let body = stage.body;
|
|
2430
|
+
if (stage.status === "loading") {
|
|
2431
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2432
|
+
StateBlock,
|
|
2433
|
+
{
|
|
2434
|
+
variant: "loading",
|
|
2435
|
+
title: "Preparing flow",
|
|
2436
|
+
description: stage.description ?? "The current public flow stage is still loading."
|
|
2437
|
+
}
|
|
2438
|
+
);
|
|
2439
|
+
} else if (stage.status === "error") {
|
|
2440
|
+
body = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2441
|
+
StateBlock,
|
|
2442
|
+
{
|
|
2443
|
+
variant: "error",
|
|
2444
|
+
title: "Flow unavailable",
|
|
2445
|
+
description: stage.description ?? "This public flow could not continue safely."
|
|
2446
|
+
}
|
|
2447
|
+
);
|
|
2448
|
+
} else if (!stage.body && !hardwareSurface) {
|
|
2449
|
+
body = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2450
|
+
EmptyState,
|
|
2451
|
+
{
|
|
2452
|
+
title: "No stage content available",
|
|
2453
|
+
description: "Add the current flow stage body or a bounded hardware surface to render this contract."
|
|
2454
|
+
}
|
|
2455
|
+
);
|
|
2456
|
+
}
|
|
2457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core39.Stack, { gap: "lg", children: [
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core39.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
2459
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core39.Stack, { gap: 4, children: [
|
|
2460
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Text, { size: "xs", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
|
|
2461
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core39.Group, { gap: "sm", wrap: "wrap", children: [
|
|
2462
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Title, { order: 2, children: stage.title }),
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Badge, { variant: "light", color: tone.color, children: tone.label })
|
|
2464
|
+
] }),
|
|
2465
|
+
stage.description ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Text, { size: "sm", c: "dimmed", children: stage.description }) : null
|
|
2466
|
+
] }),
|
|
2467
|
+
exitAction
|
|
2468
|
+
] }),
|
|
2469
|
+
stage.notice ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core39.Text, { size: "sm", c: "dimmed", children: stage.notice }) : null,
|
|
2470
|
+
body,
|
|
2471
|
+
hardwareSurface,
|
|
2472
|
+
stage.aside,
|
|
2473
|
+
actionBar ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ActionBar, { ...actionBar }) : null
|
|
2474
|
+
] }) });
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
// src/PlaybackSurface.tsx
|
|
2478
|
+
var import_core40 = require("@mantine/core");
|
|
2479
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2480
|
+
var stateTone = {
|
|
2481
|
+
loading: { label: "Loading", color: "blue" },
|
|
2482
|
+
ready: { label: "Ready", color: "teal" },
|
|
2483
|
+
playing: { label: "Playing", color: "teal" },
|
|
2484
|
+
empty: { label: "Empty", color: "gray" },
|
|
2485
|
+
error: { label: "Error", color: "red" },
|
|
2486
|
+
degraded: { label: "Degraded", color: "orange" }
|
|
2487
|
+
};
|
|
2488
|
+
function PlaybackSurface({
|
|
2489
|
+
title,
|
|
2490
|
+
state,
|
|
2491
|
+
media,
|
|
2492
|
+
statusMessage,
|
|
2493
|
+
controls,
|
|
2494
|
+
emptyState,
|
|
2495
|
+
errorState,
|
|
2496
|
+
overlays,
|
|
2497
|
+
mode = "embedded"
|
|
2498
|
+
}) {
|
|
2499
|
+
const tone = stateTone[state];
|
|
2500
|
+
let content;
|
|
2501
|
+
if (state === "loading") {
|
|
2502
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2503
|
+
StateBlock,
|
|
2504
|
+
{
|
|
2505
|
+
variant: "loading",
|
|
2506
|
+
title: "Loading playback",
|
|
2507
|
+
description: "The playback surface is still preparing timed or fullscreen media."
|
|
2508
|
+
}
|
|
2509
|
+
);
|
|
2510
|
+
} else if (state === "empty") {
|
|
2511
|
+
content = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2512
|
+
EmptyState,
|
|
2513
|
+
{
|
|
2514
|
+
title: "No playback content available",
|
|
2515
|
+
description: "Add media assets or a playlist to render this playback surface."
|
|
2516
|
+
}
|
|
2517
|
+
);
|
|
2518
|
+
} else if (state === "error") {
|
|
2519
|
+
content = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2520
|
+
StateBlock,
|
|
2521
|
+
{
|
|
2522
|
+
variant: "error",
|
|
2523
|
+
title: "Playback unavailable",
|
|
2524
|
+
description: "The playback surface could not render the current media safely."
|
|
2525
|
+
}
|
|
2526
|
+
);
|
|
2527
|
+
} else {
|
|
2528
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core40.Stack, { gap: "md", children: [
|
|
2529
|
+
media,
|
|
2530
|
+
overlays
|
|
2531
|
+
] });
|
|
2532
|
+
}
|
|
2533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core40.Paper, { withBorder: true, radius: "xl", p: "lg", "data-playback-mode": mode, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core40.Stack, { gap: "md", children: [
|
|
2534
|
+
title || statusMessage || controls ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core40.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core40.Stack, { gap: 4, children: [
|
|
2536
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core40.Title, { order: 3, children: title }) : null,
|
|
2537
|
+
statusMessage ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core40.Text, { size: "sm", c: "dimmed", children: statusMessage }) : null
|
|
2538
|
+
] }),
|
|
2539
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core40.Group, { gap: "sm", align: "center", wrap: "wrap", children: [
|
|
2540
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core40.Badge, { variant: "light", color: tone.color, children: tone.label }),
|
|
2541
|
+
controls
|
|
2542
|
+
] })
|
|
2543
|
+
] }) : null,
|
|
2544
|
+
state === "degraded" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2545
|
+
StateBlock,
|
|
2546
|
+
{
|
|
2547
|
+
variant: "info",
|
|
2548
|
+
title: "Playback degraded",
|
|
2549
|
+
description: statusMessage ?? "Playback is continuing with reduced fidelity or recoverable media failures.",
|
|
2550
|
+
compact: true
|
|
2551
|
+
}
|
|
2552
|
+
) : null,
|
|
2553
|
+
content
|
|
2554
|
+
] }) });
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
// src/ShareButtonGroup.tsx
|
|
2558
|
+
var import_react6 = require("react");
|
|
2559
|
+
var import_core41 = require("@mantine/core");
|
|
2560
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2561
|
+
var channelLabels = {
|
|
2562
|
+
native: "Share",
|
|
2563
|
+
copy: "Copy link",
|
|
2564
|
+
mail: "Email",
|
|
2565
|
+
message: "Message",
|
|
2566
|
+
x: "Share on X",
|
|
2567
|
+
facebook: "Share on Facebook",
|
|
2568
|
+
linkedin: "Share on LinkedIn",
|
|
2569
|
+
whatsapp: "Share on WhatsApp",
|
|
2570
|
+
telegram: "Share on Telegram"
|
|
2571
|
+
};
|
|
2572
|
+
function encodeShare(url, title, text) {
|
|
2573
|
+
const safeUrl = encodeURIComponent(url);
|
|
2574
|
+
const safeTitle = encodeURIComponent(title ?? "");
|
|
2575
|
+
const safeText = encodeURIComponent(text ?? title ?? "");
|
|
2576
|
+
return {
|
|
2577
|
+
mail: `mailto:?subject=${safeTitle}&body=${safeText ? `${safeText}%0A%0A` : ""}${safeUrl}`,
|
|
2578
|
+
message: `sms:?&body=${safeText ? `${safeText}%20` : ""}${safeUrl}`,
|
|
2579
|
+
x: `https://x.com/intent/tweet?text=${safeText ? `${safeText}%20` : ""}${safeUrl}`,
|
|
2580
|
+
facebook: `https://www.facebook.com/sharer/sharer.php?u=${safeUrl}`,
|
|
2581
|
+
linkedin: `https://www.linkedin.com/sharing/share-offsite/?url=${safeUrl}`,
|
|
2582
|
+
whatsapp: `https://wa.me/?text=${safeText ? `${safeText}%20` : ""}${safeUrl}`,
|
|
2583
|
+
telegram: `https://t.me/share/url?url=${safeUrl}&text=${safeText}`
|
|
2584
|
+
};
|
|
2585
|
+
}
|
|
2586
|
+
function ShareAction({
|
|
2587
|
+
channel,
|
|
2588
|
+
compact,
|
|
2589
|
+
href,
|
|
2590
|
+
onClick
|
|
2591
|
+
}) {
|
|
2592
|
+
const label = channelLabels[channel];
|
|
2593
|
+
const Icon = channel === "copy" ? GdsIcons.Copy : channel === "mail" ? GdsIcons.Mail : channel === "message" ? GdsIcons.Message : GdsIcons.Refer;
|
|
2594
|
+
if (compact) {
|
|
2595
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.ActionIcon, { component: "a", href, target: "_blank", rel: "noreferrer", variant: "subtle", size: "lg", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size: "1rem", stroke: 1.75 }) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.ActionIcon, { variant: "subtle", size: "lg", "aria-label": label, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size: "1rem", stroke: 1.75 }) });
|
|
2596
|
+
}
|
|
2597
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Button, { component: "a", href, target: "_blank", rel: "noreferrer", variant: "default", leftSection: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size: "1rem", stroke: 1.75 }), children: label }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Button, { variant: "default", leftSection: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Icon, { size: "1rem", stroke: 1.75 }), onClick, children: label });
|
|
2598
|
+
}
|
|
2599
|
+
function ShareButtonGroup({
|
|
2600
|
+
url,
|
|
2601
|
+
title,
|
|
2602
|
+
text,
|
|
2603
|
+
channels = ["native", "copy", "mail"],
|
|
2604
|
+
compact = false,
|
|
2605
|
+
label = "Share this",
|
|
2606
|
+
description
|
|
2607
|
+
}) {
|
|
2608
|
+
const [copied, setCopied] = (0, import_react6.useState)(false);
|
|
2609
|
+
const [shared, setShared] = (0, import_react6.useState)(false);
|
|
2610
|
+
const hrefs = encodeShare(url, title, text);
|
|
2611
|
+
async function handleCopy() {
|
|
2612
|
+
await navigator.clipboard?.writeText?.(url);
|
|
2613
|
+
setCopied(true);
|
|
2614
|
+
setTimeout(() => setCopied(false), 1800);
|
|
2615
|
+
}
|
|
2616
|
+
async function handleNativeShare() {
|
|
2617
|
+
if (navigator.share) {
|
|
2618
|
+
await navigator.share({ url, title, text });
|
|
2619
|
+
setShared(true);
|
|
2620
|
+
setTimeout(() => setShared(false), 1800);
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
await handleCopy();
|
|
2624
|
+
}
|
|
2625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_core41.Stack, { gap: "sm", children: [
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_core41.Stack, { gap: 2, children: [
|
|
2627
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Text, { fw: 600, children: label }),
|
|
2628
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
2629
|
+
] }),
|
|
2630
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Group, { gap: "sm", wrap: "wrap", children: channels.map((channel) => {
|
|
2631
|
+
if (channel === "copy") {
|
|
2632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ShareAction, { channel, compact, onClick: () => void handleCopy() }, channel);
|
|
2633
|
+
}
|
|
2634
|
+
if (channel === "native") {
|
|
2635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ShareAction, { channel, compact, onClick: () => void handleNativeShare() }, channel);
|
|
2636
|
+
}
|
|
2637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ShareAction, { channel, compact, href: hrefs[channel] }, channel);
|
|
2638
|
+
}) }),
|
|
2639
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Text, { size: "sm", c: "teal", children: "Link copied." }) : null,
|
|
2640
|
+
shared ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core41.Text, { size: "sm", c: "teal", children: "Share sheet opened." }) : null
|
|
2641
|
+
] });
|
|
2642
|
+
}
|
|
2643
|
+
|
|
1657
2644
|
// src/UploadDropzone.tsx
|
|
1658
|
-
var
|
|
1659
|
-
var
|
|
1660
|
-
var
|
|
2645
|
+
var import_react7 = require("react");
|
|
2646
|
+
var import_core42 = require("@mantine/core");
|
|
2647
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1661
2648
|
function UploadDropzone({
|
|
1662
2649
|
title,
|
|
1663
2650
|
description,
|
|
@@ -1667,8 +2654,8 @@ function UploadDropzone({
|
|
|
1667
2654
|
actionLabel = "Choose files",
|
|
1668
2655
|
mode = "panel"
|
|
1669
2656
|
}) {
|
|
1670
|
-
const inputRef = (0,
|
|
1671
|
-
const [dragging, setDragging] = (0,
|
|
2657
|
+
const inputRef = (0, import_react7.useRef)(null);
|
|
2658
|
+
const [dragging, setDragging] = (0, import_react7.useState)(false);
|
|
1672
2659
|
const UploadIcon = GdsIcons.Upload;
|
|
1673
2660
|
const forwardFiles = (files) => {
|
|
1674
2661
|
if (!files?.length || !onFilesSelected) {
|
|
@@ -1676,8 +2663,8 @@ function UploadDropzone({
|
|
|
1676
2663
|
}
|
|
1677
2664
|
onFilesSelected(Array.from(files));
|
|
1678
2665
|
};
|
|
1679
|
-
return /* @__PURE__ */ (0,
|
|
1680
|
-
|
|
2666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2667
|
+
import_core42.Box,
|
|
1681
2668
|
{
|
|
1682
2669
|
onDragOver: (event) => {
|
|
1683
2670
|
event.preventDefault();
|
|
@@ -1696,7 +2683,7 @@ function UploadDropzone({
|
|
|
1696
2683
|
background: dragging ? "var(--mantine-color-violet-light)" : "transparent"
|
|
1697
2684
|
},
|
|
1698
2685
|
children: [
|
|
1699
|
-
/* @__PURE__ */ (0,
|
|
2686
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1700
2687
|
"input",
|
|
1701
2688
|
{
|
|
1702
2689
|
ref: inputRef,
|
|
@@ -1707,11 +2694,11 @@ function UploadDropzone({
|
|
|
1707
2694
|
onChange: (event) => forwardFiles(event.currentTarget.files)
|
|
1708
2695
|
}
|
|
1709
2696
|
),
|
|
1710
|
-
/* @__PURE__ */ (0,
|
|
1711
|
-
/* @__PURE__ */ (0,
|
|
1712
|
-
/* @__PURE__ */ (0,
|
|
1713
|
-
description ? /* @__PURE__ */ (0,
|
|
1714
|
-
/* @__PURE__ */ (0,
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_core42.Stack, { align: mode === "inline" ? "flex-start" : "center", ta: mode === "inline" ? "left" : "center", gap: "sm", children: [
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(UploadIcon, { size: "1.5rem" }),
|
|
2699
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core42.Text, { fw: 600, children: title }),
|
|
2700
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core42.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core42.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core42.Button, { variant: "light", onClick: () => inputRef.current?.click(), children: actionLabel }) })
|
|
1715
2702
|
] })
|
|
1716
2703
|
]
|
|
1717
2704
|
}
|
|
@@ -1719,22 +2706,22 @@ function UploadDropzone({
|
|
|
1719
2706
|
}
|
|
1720
2707
|
|
|
1721
2708
|
// src/MediaField.tsx
|
|
1722
|
-
var
|
|
2709
|
+
var import_core44 = require("@mantine/core");
|
|
1723
2710
|
|
|
1724
2711
|
// src/FormField.tsx
|
|
1725
|
-
var
|
|
1726
|
-
var
|
|
2712
|
+
var import_core43 = require("@mantine/core");
|
|
2713
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1727
2714
|
function FormField({ label, description, error, children }) {
|
|
1728
|
-
return /* @__PURE__ */ (0,
|
|
1729
|
-
typeof label === "string" ? /* @__PURE__ */ (0,
|
|
1730
|
-
description ? typeof description === "string" ? /* @__PURE__ */ (0,
|
|
2715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core43.Box, { component: "label", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_core43.Stack, { gap: 4, children: [
|
|
2716
|
+
typeof label === "string" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core43.Text, { size: "xs", fw: 600, c: "dimmed", children: label }) : label,
|
|
2717
|
+
description ? typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core43.Text, { size: "xs", c: "dimmed", children: description }) : description : null,
|
|
1731
2718
|
children,
|
|
1732
|
-
error ? typeof error === "string" ? /* @__PURE__ */ (0,
|
|
2719
|
+
error ? typeof error === "string" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core43.Text, { size: "xs", c: "red.7", children: error }) : error : null
|
|
1733
2720
|
] }) });
|
|
1734
2721
|
}
|
|
1735
2722
|
|
|
1736
2723
|
// src/MediaField.tsx
|
|
1737
|
-
var
|
|
2724
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
1738
2725
|
var stateLabels = {
|
|
1739
2726
|
empty: { label: "Empty", color: "gray" },
|
|
1740
2727
|
selected: { label: "Selected", color: "blue" },
|
|
@@ -1762,32 +2749,32 @@ function MediaField({
|
|
|
1762
2749
|
mode = "stacked"
|
|
1763
2750
|
}) {
|
|
1764
2751
|
const stateBadge = stateLabels[state];
|
|
1765
|
-
const resolvedRemoveAction = removeAction ?? (onRemove ? /* @__PURE__ */ (0,
|
|
1766
|
-
const resolvedResetAction = resetAction ?? (onReset ? /* @__PURE__ */ (0,
|
|
1767
|
-
return /* @__PURE__ */ (0,
|
|
2752
|
+
const resolvedRemoveAction = removeAction ?? (onRemove ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Button, { type: "button", variant: "light", color: "red", onClick: onRemove, children: "Remove" }) : null);
|
|
2753
|
+
const resolvedResetAction = resetAction ?? (onReset ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Button, { type: "button", variant: "default", onClick: onReset, children: "Reset" }) : null);
|
|
2754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
1768
2755
|
FormField,
|
|
1769
2756
|
{
|
|
1770
2757
|
label,
|
|
1771
2758
|
description,
|
|
1772
2759
|
error,
|
|
1773
|
-
children: /* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
2760
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core44.Stack, { gap: "md", children: [
|
|
2761
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Group, { justify: "flex-end", align: "center", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core44.Group, { gap: "xs", justify: "flex-end", children: [
|
|
2762
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Badge, { variant: "light", color: stateBadge.color, children: stateBadge.label }),
|
|
1776
2763
|
statusAction
|
|
1777
2764
|
] }) }),
|
|
1778
2765
|
preview ? preview : null,
|
|
1779
|
-
uploadControl || urlInput ? /* @__PURE__ */ (0,
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1781
|
-
/* @__PURE__ */ (0,
|
|
2766
|
+
uploadControl || urlInput ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
2767
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Divider, {}),
|
|
2768
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core44.Stack, { gap: "sm", style: mode === "split" ? { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))" } : void 0, children: [
|
|
1782
2769
|
uploadControl,
|
|
1783
2770
|
urlInput
|
|
1784
2771
|
] })
|
|
1785
2772
|
] }) : null,
|
|
1786
|
-
value ? /* @__PURE__ */ (0,
|
|
1787
|
-
helpText ? /* @__PURE__ */ (0,
|
|
1788
|
-
policyText ? /* @__PURE__ */ (0,
|
|
2773
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Text, { size: "sm", c: "dimmed", style: { wordBreak: "break-all" }, children: value }) : null,
|
|
2774
|
+
helpText ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Text, { size: "sm", c: "dimmed", children: helpText }) : null,
|
|
2775
|
+
policyText ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_core44.Text, { size: "sm", c: error ? "red.7" : "dimmed", children: policyText }) : null,
|
|
1789
2776
|
typeof error !== "string" && error ? error : null,
|
|
1790
|
-
resolvedRemoveAction || resolvedResetAction ? /* @__PURE__ */ (0,
|
|
2777
|
+
resolvedRemoveAction || resolvedResetAction ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core44.Group, { gap: "sm", children: [
|
|
1791
2778
|
resolvedResetAction,
|
|
1792
2779
|
retryAction,
|
|
1793
2780
|
resolvedRemoveAction
|
|
@@ -1798,50 +2785,50 @@ function MediaField({
|
|
|
1798
2785
|
}
|
|
1799
2786
|
|
|
1800
2787
|
// src/MediaCard.tsx
|
|
1801
|
-
var
|
|
1802
|
-
var
|
|
2788
|
+
var import_core45 = require("@mantine/core");
|
|
2789
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
1803
2790
|
function MediaCard({ title, image, description, status, overlay, actions = [] }) {
|
|
1804
2791
|
const EyeIcon = GdsIcons.Eye;
|
|
1805
|
-
return /* @__PURE__ */ (0,
|
|
1806
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core45.Card, { withBorder: true, radius: "lg", padding: "md", children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core45.Card.Section, { pos: "relative", children: [
|
|
1807
2794
|
image,
|
|
1808
|
-
overlay ? /* @__PURE__ */ (0,
|
|
2795
|
+
overlay ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { style: { position: "absolute", inset: 12, display: "flex", justifyContent: "flex-end", alignItems: "flex-start" }, children: overlay }) : null
|
|
1809
2796
|
] }),
|
|
1810
|
-
/* @__PURE__ */ (0,
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1812
|
-
/* @__PURE__ */ (0,
|
|
1813
|
-
/* @__PURE__ */ (0,
|
|
1814
|
-
description ? /* @__PURE__ */ (0,
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core45.Stack, { gap: "sm", mt: "md", children: [
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core45.Group, { justify: "space-between", align: "flex-start", children: [
|
|
2799
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core45.Stack, { gap: 4, children: [
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core45.Title, { order: 4, children: title }),
|
|
2801
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core45.Text, { size: "sm", c: "dimmed", lineClamp: 2, children: description }) : null
|
|
1815
2802
|
] }),
|
|
1816
|
-
status ? /* @__PURE__ */ (0,
|
|
2803
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core45.Badge, { variant: "light", children: status }) : null
|
|
1817
2804
|
] }),
|
|
1818
|
-
actions.length ? /* @__PURE__ */ (0,
|
|
2805
|
+
actions.length ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core45.Group, { justify: "flex-end", gap: "xs", children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core45.ActionIcon, { variant: "light", "aria-label": action.label, onClick: action.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(EyeIcon, { size: "1rem" }) }, action.label)) }) : null
|
|
1819
2806
|
] })
|
|
1820
2807
|
] });
|
|
1821
2808
|
}
|
|
1822
2809
|
|
|
1823
2810
|
// src/AccessSummary.tsx
|
|
1824
|
-
var
|
|
1825
|
-
var
|
|
2811
|
+
var import_core46 = require("@mantine/core");
|
|
2812
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
1826
2813
|
function AccessSummary({ title, roles, scope, blocked = false, description }) {
|
|
1827
|
-
return /* @__PURE__ */ (0,
|
|
1828
|
-
/* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core46.Stack, { gap: "sm", children: [
|
|
2815
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core46.Group, { justify: "space-between", align: "center", children: [
|
|
2816
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Title, { order: 4, children: title }),
|
|
2817
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Badge, { color: blocked ? "red" : "teal", variant: "light", children: blocked ? "Blocked" : "Allowed" })
|
|
1831
2818
|
] }),
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1833
|
-
scope ? /* @__PURE__ */ (0,
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Group, { gap: "xs", children: roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Badge, { variant: "outline", children: role }, role)) }),
|
|
2820
|
+
scope ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core46.Text, { size: "sm", c: "dimmed", children: [
|
|
1834
2821
|
"Scope: ",
|
|
1835
2822
|
scope
|
|
1836
2823
|
] }) : null,
|
|
1837
|
-
description ? /* @__PURE__ */ (0,
|
|
2824
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core46.Text, { size: "sm", children: description }) : null
|
|
1838
2825
|
] }) });
|
|
1839
2826
|
}
|
|
1840
2827
|
|
|
1841
2828
|
// src/AccessRecoveryPanel.tsx
|
|
1842
|
-
var
|
|
1843
|
-
var
|
|
1844
|
-
var
|
|
2829
|
+
var import_core47 = require("@mantine/core");
|
|
2830
|
+
var import_gds_theme4 = require("@doneisbetter/gds-theme");
|
|
2831
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
1845
2832
|
var stateBlockVariantByState = {
|
|
1846
2833
|
unauthenticated: "permission",
|
|
1847
2834
|
"expired-session": "info",
|
|
@@ -1910,7 +2897,7 @@ function ActionGroup({
|
|
|
1910
2897
|
if (actions.length === 0) {
|
|
1911
2898
|
return null;
|
|
1912
2899
|
}
|
|
1913
|
-
return /* @__PURE__ */ (0,
|
|
2900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core47.Group, { gap: "sm", justify: "center", wrap: "wrap", children: actions.map((actionConfig, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1914
2901
|
SemanticButton,
|
|
1915
2902
|
{
|
|
1916
2903
|
action: actionConfig.action,
|
|
@@ -1936,7 +2923,7 @@ function AccessRecoveryPanel({
|
|
|
1936
2923
|
supportAction,
|
|
1937
2924
|
compact = false
|
|
1938
2925
|
}) {
|
|
1939
|
-
const { t } = (0,
|
|
2926
|
+
const { t } = (0, import_gds_theme4.useGdsTranslation)();
|
|
1940
2927
|
const defaultCopy = defaultCopyByState[state];
|
|
1941
2928
|
const defaults = defaultActionsForState(state, {
|
|
1942
2929
|
onRetry,
|
|
@@ -1944,14 +2931,14 @@ function AccessRecoveryPanel({
|
|
|
1944
2931
|
onBack,
|
|
1945
2932
|
supportAction
|
|
1946
2933
|
});
|
|
1947
|
-
return /* @__PURE__ */ (0,
|
|
2934
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1948
2935
|
StateBlock,
|
|
1949
2936
|
{
|
|
1950
2937
|
variant: stateBlockVariantByState[state],
|
|
1951
2938
|
compact,
|
|
1952
2939
|
title: title ?? t(`gds.accessRecovery.${state}.title`, defaultCopy.title),
|
|
1953
2940
|
description: description ?? t(`gds.accessRecovery.${state}.description`, defaultCopy.description),
|
|
1954
|
-
action: /* @__PURE__ */ (0,
|
|
2941
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
1955
2942
|
ActionGroup,
|
|
1956
2943
|
{
|
|
1957
2944
|
primaryAction: primaryAction ?? defaults.primary,
|
|
@@ -1964,29 +2951,31 @@ function AccessRecoveryPanel({
|
|
|
1964
2951
|
}
|
|
1965
2952
|
|
|
1966
2953
|
// src/PageHeader.tsx
|
|
1967
|
-
var
|
|
1968
|
-
var
|
|
2954
|
+
var import_core48 = require("@mantine/core");
|
|
2955
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
1969
2956
|
function PageHeader({
|
|
1970
2957
|
title,
|
|
1971
2958
|
description,
|
|
2959
|
+
subtitle,
|
|
1972
2960
|
eyebrow,
|
|
1973
2961
|
actions,
|
|
1974
2962
|
eyebrowVariant = "neutral"
|
|
1975
2963
|
}) {
|
|
2964
|
+
const resolvedDescription = description ?? subtitle;
|
|
1976
2965
|
const eyebrowProps = eyebrowVariant === "ornamental" ? { tt: "uppercase", style: { letterSpacing: "0.12em" } } : {};
|
|
1977
|
-
return /* @__PURE__ */ (0,
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
1979
|
-
eyebrow && /* @__PURE__ */ (0,
|
|
1980
|
-
/* @__PURE__ */ (0,
|
|
1981
|
-
|
|
2966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_core48.Group, { justify: "space-between", align: "flex-start", gap: "lg", wrap: "wrap", children: [
|
|
2967
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_core48.Stack, { gap: "xs", children: [
|
|
2968
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core48.Text, { size: "xs", fw: 700, c: "dimmed", ...eyebrowProps, children: eyebrow }),
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core48.Title, { order: 1, children: title }),
|
|
2970
|
+
resolvedDescription && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core48.Text, { c: "dimmed", maw: 720, children: resolvedDescription })
|
|
1982
2971
|
] }),
|
|
1983
|
-
actions ? /* @__PURE__ */ (0,
|
|
2972
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core48.Box, { children: actions }) : null
|
|
1984
2973
|
] });
|
|
1985
2974
|
}
|
|
1986
2975
|
|
|
1987
2976
|
// src/FilterDrawer.tsx
|
|
1988
|
-
var
|
|
1989
|
-
var
|
|
2977
|
+
var import_core49 = require("@mantine/core");
|
|
2978
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
1990
2979
|
function FilterDrawer({
|
|
1991
2980
|
opened,
|
|
1992
2981
|
onClose,
|
|
@@ -2002,8 +2991,8 @@ function FilterDrawer({
|
|
|
2002
2991
|
}) {
|
|
2003
2992
|
const resolvedPrimaryAction = applyAction ?? primaryAction;
|
|
2004
2993
|
const resolvedSecondaryAction = resetAction ?? secondaryAction;
|
|
2005
|
-
return /* @__PURE__ */ (0,
|
|
2006
|
-
|
|
2994
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2995
|
+
import_core49.Drawer,
|
|
2007
2996
|
{
|
|
2008
2997
|
opened,
|
|
2009
2998
|
onClose,
|
|
@@ -2011,11 +3000,11 @@ function FilterDrawer({
|
|
|
2011
3000
|
position: mode === "bottom-sheet" ? "bottom" : "right",
|
|
2012
3001
|
size: mode === "bottom-sheet" ? "auto" : "md",
|
|
2013
3002
|
radius: mode === "bottom-sheet" ? "xl" : void 0,
|
|
2014
|
-
children: /* @__PURE__ */ (0,
|
|
2015
|
-
description ? /* @__PURE__ */ (0,
|
|
3003
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core49.Stack, { gap: "md", children: [
|
|
3004
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core49.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
2016
3005
|
children,
|
|
2017
|
-
resolvedPrimaryAction || resolvedSecondaryAction || closeAction ? /* @__PURE__ */ (0,
|
|
2018
|
-
/* @__PURE__ */ (0,
|
|
3006
|
+
resolvedPrimaryAction || resolvedSecondaryAction || closeAction ? /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core49.Group, { justify: "space-between", mt: "md", children: [
|
|
3007
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core49.Group, { gap: "sm", children: [
|
|
2019
3008
|
closeAction,
|
|
2020
3009
|
resolvedSecondaryAction
|
|
2021
3010
|
] }),
|
|
@@ -2027,8 +3016,8 @@ function FilterDrawer({
|
|
|
2027
3016
|
}
|
|
2028
3017
|
|
|
2029
3018
|
// src/PlaceholderPanel.tsx
|
|
2030
|
-
var
|
|
2031
|
-
var
|
|
3019
|
+
var import_core50 = require("@mantine/core");
|
|
3020
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2032
3021
|
function PlaceholderPanel({
|
|
2033
3022
|
title,
|
|
2034
3023
|
description,
|
|
@@ -2038,16 +3027,16 @@ function PlaceholderPanel({
|
|
|
2038
3027
|
mode
|
|
2039
3028
|
}) {
|
|
2040
3029
|
if (mode === "live" && children) {
|
|
2041
|
-
return /* @__PURE__ */ (0,
|
|
3030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
|
|
2042
3031
|
}
|
|
2043
|
-
return /* @__PURE__ */ (0,
|
|
2044
|
-
badge ? /* @__PURE__ */ (0,
|
|
2045
|
-
/* @__PURE__ */ (0,
|
|
2046
|
-
/* @__PURE__ */ (0,
|
|
2047
|
-
/* @__PURE__ */ (0,
|
|
3032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core50.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core50.Stack, { gap: "md", children: [
|
|
3033
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core50.Badge, { variant: "light", color: "blue", w: "fit-content", children: badge }) : null,
|
|
3034
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core50.Stack, { gap: "xs", children: [
|
|
3035
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core50.Title, { order: 4, children: title }),
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core50.Text, { c: "dimmed", children: description })
|
|
2048
3037
|
] }),
|
|
2049
|
-
footer ? /* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
3038
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core50.Text, { size: "sm", children: footer }) : null,
|
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2051
3040
|
StateBlock,
|
|
2052
3041
|
{
|
|
2053
3042
|
variant: "not-enough-data",
|
|
@@ -2060,8 +3049,8 @@ function PlaceholderPanel({
|
|
|
2060
3049
|
}
|
|
2061
3050
|
|
|
2062
3051
|
// src/SimpleDataTable.tsx
|
|
2063
|
-
var
|
|
2064
|
-
var
|
|
3052
|
+
var import_core51 = require("@mantine/core");
|
|
3053
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2065
3054
|
function SimpleDataTable({
|
|
2066
3055
|
columns,
|
|
2067
3056
|
rows,
|
|
@@ -2072,23 +3061,23 @@ function SimpleDataTable({
|
|
|
2072
3061
|
getRowKey
|
|
2073
3062
|
}) {
|
|
2074
3063
|
if (error) {
|
|
2075
|
-
return /* @__PURE__ */ (0,
|
|
3064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StateBlock, { variant: "error", title: "Unable to load data", description: error, compact: true });
|
|
2076
3065
|
}
|
|
2077
3066
|
if (loading) {
|
|
2078
|
-
return /* @__PURE__ */ (0,
|
|
3067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StateBlock, { variant: "loading", title: "Loading data", description: "Please wait while the shared dataset is prepared.", compact: true });
|
|
2079
3068
|
}
|
|
2080
3069
|
if (!rows.length) {
|
|
2081
|
-
return /* @__PURE__ */ (0,
|
|
3070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, compact: true });
|
|
2082
3071
|
}
|
|
2083
|
-
return /* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
3072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.ScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_core51.Table, { striped: true, highlightOnHover: true, withTableBorder: true, withColumnBorders: true, children: [
|
|
3073
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Tr, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Th, { children: column.header }, String(column.key))) }) }),
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Tbody, { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Tr, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core51.Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, String(column.key))) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
2086
3075
|
] }) });
|
|
2087
3076
|
}
|
|
2088
3077
|
|
|
2089
3078
|
// src/StatsSection.tsx
|
|
2090
|
-
var
|
|
2091
|
-
var
|
|
3079
|
+
var import_core52 = require("@mantine/core");
|
|
3080
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2092
3081
|
function StatsSection({
|
|
2093
3082
|
title,
|
|
2094
3083
|
loading = false,
|
|
@@ -2100,11 +3089,11 @@ function StatsSection({
|
|
|
2100
3089
|
}) {
|
|
2101
3090
|
let content = children;
|
|
2102
3091
|
if (error) {
|
|
2103
|
-
content = /* @__PURE__ */ (0,
|
|
3092
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StateBlock, { variant: "error", title: "Unable to load statistics", description: error, compact: true });
|
|
2104
3093
|
} else if (loading) {
|
|
2105
|
-
content = /* @__PURE__ */ (0,
|
|
3094
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StateBlock, { variant: "loading", title: "Loading statistics", description: "This shared data surface is still synchronizing.", compact: true });
|
|
2106
3095
|
} else if (belowThreshold) {
|
|
2107
|
-
content = /* @__PURE__ */ (0,
|
|
3096
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2108
3097
|
StateBlock,
|
|
2109
3098
|
{
|
|
2110
3099
|
variant: "not-enough-data",
|
|
@@ -2114,10 +3103,10 @@ function StatsSection({
|
|
|
2114
3103
|
}
|
|
2115
3104
|
);
|
|
2116
3105
|
} else if (placeholder) {
|
|
2117
|
-
content = /* @__PURE__ */ (0,
|
|
3106
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PlaceholderPanel, { ...placeholder, mode: "placeholder" });
|
|
2118
3107
|
}
|
|
2119
|
-
return /* @__PURE__ */ (0,
|
|
2120
|
-
/* @__PURE__ */ (0,
|
|
3108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_core52.Stack, { gap: "md", children: [
|
|
3109
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core52.Title, { order: 3, children: title }),
|
|
2121
3110
|
content
|
|
2122
3111
|
] });
|
|
2123
3112
|
}
|
|
@@ -3429,14 +4418,18 @@ function getGdsMessages(locale) {
|
|
|
3429
4418
|
AccentPanel,
|
|
3430
4419
|
AccessRecoveryPanel,
|
|
3431
4420
|
AccessSummary,
|
|
4421
|
+
ActionBar,
|
|
3432
4422
|
ArticleShell,
|
|
3433
4423
|
AuthShell,
|
|
3434
4424
|
BrowseSurface,
|
|
4425
|
+
ChoiceChip,
|
|
3435
4426
|
ConfirmDialog,
|
|
3436
4427
|
ConsumerDashboardGrid,
|
|
3437
4428
|
ConsumerSection,
|
|
3438
4429
|
CtaButtonGroup,
|
|
3439
4430
|
DataToolbar,
|
|
4431
|
+
DetailProfileShell,
|
|
4432
|
+
DiscoveryShell,
|
|
3440
4433
|
DocsCodeBlock,
|
|
3441
4434
|
DocsPageShell,
|
|
3442
4435
|
EditorialCard,
|
|
@@ -3444,40 +4437,56 @@ function getGdsMessages(locale) {
|
|
|
3444
4437
|
EmptyState,
|
|
3445
4438
|
FeatureBand,
|
|
3446
4439
|
FilterDrawer,
|
|
4440
|
+
FoodMenuSection,
|
|
3447
4441
|
FormField,
|
|
3448
4442
|
GameBoardTile,
|
|
3449
4443
|
GdsIcons,
|
|
3450
4444
|
GdsVocabulary,
|
|
4445
|
+
ListingCard,
|
|
4446
|
+
MapPanel,
|
|
3451
4447
|
MediaCard,
|
|
3452
4448
|
MediaField,
|
|
3453
4449
|
MetricCard,
|
|
3454
4450
|
PageHeader,
|
|
3455
4451
|
PlaceholderPanel,
|
|
4452
|
+
PlaybackSurface,
|
|
3456
4453
|
ProductCard,
|
|
3457
4454
|
ProgressCard,
|
|
3458
4455
|
PublicBrandFooter,
|
|
4456
|
+
PublicFlowShell,
|
|
4457
|
+
PublicFoodCard,
|
|
3459
4458
|
PublicNav,
|
|
3460
4459
|
PublicProductCard,
|
|
3461
4460
|
PublicShell,
|
|
3462
4461
|
PublicSiteFooter,
|
|
3463
4462
|
SectionPanel,
|
|
3464
4463
|
SemanticButton,
|
|
4464
|
+
ShareButtonGroup,
|
|
4465
|
+
SidebarNav,
|
|
4466
|
+
SidebarNavItem,
|
|
4467
|
+
SidebarNavSection,
|
|
3465
4468
|
SimpleDataTable,
|
|
4469
|
+
SocialAuthButtons,
|
|
3466
4470
|
StateBlock,
|
|
3467
4471
|
StatsSection,
|
|
3468
4472
|
StatusBadge,
|
|
3469
4473
|
ThemeToggle,
|
|
3470
4474
|
UploadDropzone,
|
|
3471
4475
|
ar,
|
|
4476
|
+
createGdsVocabularyPack,
|
|
3472
4477
|
de,
|
|
3473
4478
|
en,
|
|
3474
4479
|
es,
|
|
3475
4480
|
fr,
|
|
3476
4481
|
gdsLocales,
|
|
3477
4482
|
getGdsMessages,
|
|
4483
|
+
getSemanticActionConfig,
|
|
4484
|
+
getSemanticActionLabel,
|
|
3478
4485
|
he,
|
|
3479
4486
|
hu,
|
|
3480
4487
|
it,
|
|
4488
|
+
mergeGdsVocabularyPacks,
|
|
3481
4489
|
resolveAccentPanelStyles,
|
|
4490
|
+
resolveSemanticActionConfig,
|
|
3482
4491
|
ru
|
|
3483
4492
|
});
|