@doneisbetter/gds-core 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NBCULITN.mjs → chunk-6FX7WZZO.mjs} +856 -155
- package/dist/{chunk-P7ICTEEB.mjs → chunk-YP7RL2MC.mjs} +784 -364
- package/dist/client.d.mts +259 -8
- package/dist/client.d.ts +259 -8
- package/dist/client.js +1720 -562
- package/dist/client.mjs +74 -4
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1720 -562
- package/dist/index.mjs +74 -4
- package/dist/{server-woziKWie.d.mts → server-DCXU_K9q.d.mts} +144 -4
- package/dist/{server-woziKWie.d.ts → server-DCXU_K9q.d.ts} +144 -4
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +831 -395
- package/dist/server.mjs +29 -1
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -24,14 +24,22 @@ __export(client_exports, {
|
|
|
24
24
|
AccessRecoveryPanel: () => AccessRecoveryPanel,
|
|
25
25
|
AccessSummary: () => AccessSummary,
|
|
26
26
|
ActionBar: () => ActionBar,
|
|
27
|
+
ActiveFilterChips: () => ActiveFilterChips,
|
|
28
|
+
AdvancedDataTable: () => AdvancedDataTable,
|
|
27
29
|
ArticleShell: () => ArticleShell,
|
|
30
|
+
AsyncSurface: () => AsyncSurface,
|
|
28
31
|
AuthShell: () => AuthShell,
|
|
32
|
+
BannerNotice: () => BannerNotice,
|
|
29
33
|
BrowseSurface: () => BrowseSurface,
|
|
34
|
+
BulkActionsBar: () => BulkActionsBar,
|
|
30
35
|
ChartTokenPanel: () => ChartTokenPanel,
|
|
31
36
|
ChoiceChip: () => ChoiceChip,
|
|
37
|
+
CommandPalette: () => CommandPalette,
|
|
38
|
+
CommandRegistryProvider: () => CommandRegistryProvider,
|
|
32
39
|
ConfirmDialog: () => ConfirmDialog,
|
|
33
40
|
ConsumerDashboardGrid: () => ConsumerDashboardGrid,
|
|
34
41
|
ConsumerSection: () => ConsumerSection,
|
|
42
|
+
CountBadge: () => CountBadge,
|
|
35
43
|
CtaButtonGroup: () => CtaButtonGroup,
|
|
36
44
|
DataToolbar: () => DataToolbar,
|
|
37
45
|
DetailProfileShell: () => DetailProfileShell,
|
|
@@ -46,15 +54,26 @@ __export(client_exports, {
|
|
|
46
54
|
FeatureBand: () => FeatureBand,
|
|
47
55
|
FilterDrawer: () => FilterDrawer,
|
|
48
56
|
FoodMenuSection: () => FoodMenuSection,
|
|
57
|
+
FormErrorSummary: () => FormErrorSummary,
|
|
49
58
|
FormField: () => FormField,
|
|
50
59
|
GameBoardTile: () => GameBoardTile,
|
|
60
|
+
GdsChart: () => GdsChart,
|
|
61
|
+
GdsFormProvider: () => GdsFormProvider,
|
|
51
62
|
GdsIcons: () => GdsIcons,
|
|
63
|
+
GdsNotificationProvider: () => GdsNotificationProvider,
|
|
64
|
+
GdsTelemetryProvider: () => GdsTelemetryProvider,
|
|
52
65
|
GdsVocabulary: () => GdsVocabulary,
|
|
66
|
+
InlineAlert: () => InlineAlert,
|
|
67
|
+
LabelTag: () => LabelTag,
|
|
53
68
|
ListingCard: () => ListingCard,
|
|
69
|
+
ListingProvider: () => ListingProvider,
|
|
54
70
|
MapPanel: () => MapPanel,
|
|
55
71
|
MediaCard: () => MediaCard,
|
|
56
72
|
MediaField: () => MediaField,
|
|
57
73
|
MetricCard: () => MetricCard,
|
|
74
|
+
NotificationCenter: () => NotificationCenter,
|
|
75
|
+
NotificationCenterView: () => NotificationCenterView,
|
|
76
|
+
OverlayManagerProvider: () => OverlayManagerProvider,
|
|
58
77
|
PROVIDER_IDENTITY_REGISTRY: () => PROVIDER_IDENTITY_REGISTRY,
|
|
59
78
|
PageHeader: () => PageHeader,
|
|
60
79
|
PeriodSelector: () => PeriodSelector,
|
|
@@ -76,6 +95,7 @@ __export(client_exports, {
|
|
|
76
95
|
ReferenceSection: () => ReferenceSection,
|
|
77
96
|
ReferenceThemeExplorer: () => ReferenceThemeExplorer,
|
|
78
97
|
ReportingSection: () => ReportingSection,
|
|
98
|
+
ResultSummary: () => ResultSummary,
|
|
79
99
|
SectionPanel: () => SectionPanel,
|
|
80
100
|
SemanticButton: () => SemanticButton,
|
|
81
101
|
ShareButtonGroup: () => ShareButtonGroup,
|
|
@@ -84,17 +104,22 @@ __export(client_exports, {
|
|
|
84
104
|
SidebarNavSection: () => SidebarNavSection,
|
|
85
105
|
SimpleDataTable: () => SimpleDataTable,
|
|
86
106
|
SocialAuthButtons: () => SocialAuthButtons,
|
|
107
|
+
SortMenu: () => SortMenu,
|
|
87
108
|
StateBlock: () => StateBlock,
|
|
88
109
|
StatsSection: () => StatsSection,
|
|
89
110
|
StatusBadge: () => StatusBadge,
|
|
90
111
|
ThemeToggle: () => ThemeToggle,
|
|
91
112
|
UploadDropzone: () => UploadDropzone,
|
|
113
|
+
ValidatedFieldMessage: () => ValidatedFieldMessage,
|
|
92
114
|
ar: () => ar,
|
|
93
115
|
createGdsVocabularyPack: () => createGdsVocabularyPack,
|
|
94
116
|
de: () => de,
|
|
95
117
|
en: () => en,
|
|
96
118
|
es: () => es,
|
|
97
119
|
fr: () => fr,
|
|
120
|
+
gdsCardSizePaddingMap: () => gdsCardSizePaddingMap,
|
|
121
|
+
gdsCardTitleOrderMap: () => gdsCardTitleOrderMap,
|
|
122
|
+
gdsFormReducer: () => gdsFormReducer,
|
|
98
123
|
gdsLocales: () => gdsLocales,
|
|
99
124
|
getGdsMessages: () => getGdsMessages,
|
|
100
125
|
getProviderIdentityLabel: () => getProviderIdentityLabel,
|
|
@@ -106,11 +131,21 @@ __export(client_exports, {
|
|
|
106
131
|
hu: () => hu,
|
|
107
132
|
isPresentationMode: () => isPresentationMode,
|
|
108
133
|
it: () => it,
|
|
134
|
+
listingQueryReducer: () => listingQueryReducer,
|
|
109
135
|
mergeGdsVocabularyPacks: () => mergeGdsVocabularyPacks,
|
|
136
|
+
renderGdsLayout: () => renderGdsLayout,
|
|
110
137
|
resolveAccentPanelStyles: () => resolveAccentPanelStyles,
|
|
111
138
|
resolveSemanticActionConfig: () => resolveSemanticActionConfig,
|
|
112
139
|
resolveSurfacePresentationStyles: () => resolveSurfacePresentationStyles,
|
|
113
|
-
ru: () => ru
|
|
140
|
+
ru: () => ru,
|
|
141
|
+
useCommandLauncher: () => useCommandLauncher,
|
|
142
|
+
useDiscoveryShellState: () => useDiscoveryShellState,
|
|
143
|
+
useGdsForm: () => useGdsForm,
|
|
144
|
+
useGdsFormSnapshot: () => useGdsFormSnapshot,
|
|
145
|
+
useGdsNotifications: () => useGdsNotifications,
|
|
146
|
+
useGdsTelemetry: () => useGdsTelemetry,
|
|
147
|
+
useListingState: () => useListingState,
|
|
148
|
+
useOverlayManager: () => useOverlayManager
|
|
114
149
|
});
|
|
115
150
|
module.exports = __toCommonJS(client_exports);
|
|
116
151
|
|
|
@@ -124,9 +159,24 @@ var statusColorMap = {
|
|
|
124
159
|
info: "blue",
|
|
125
160
|
neutral: "gray"
|
|
126
161
|
};
|
|
162
|
+
var labelTagColorMap = {
|
|
163
|
+
neutral: "gray",
|
|
164
|
+
info: "blue",
|
|
165
|
+
warning: "yellow",
|
|
166
|
+
success: "green"
|
|
167
|
+
};
|
|
127
168
|
function StatusBadge({ status, children, ...props }) {
|
|
128
169
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Badge, { color: statusColorMap[status], variant: "light", ...props, children });
|
|
129
170
|
}
|
|
171
|
+
function LabelTag({ tone = "neutral", label, ...props }) {
|
|
172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Badge, { color: labelTagColorMap[tone], variant: "outline", ...props, children: label });
|
|
173
|
+
}
|
|
174
|
+
function CountBadge({ value, cap = 99, srLabel, ...props }) {
|
|
175
|
+
const normalizedValue = Number.isFinite(value) ? Math.max(0, Math.floor(value)) : 0;
|
|
176
|
+
const normalizedCap = Math.max(1, Math.floor(cap));
|
|
177
|
+
const displayValue = normalizedValue > normalizedCap ? `${normalizedCap}+` : String(normalizedValue);
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Badge, { color: "violet", variant: "filled", "aria-label": srLabel, ...props, children: displayValue });
|
|
179
|
+
}
|
|
130
180
|
|
|
131
181
|
// src/EmptyState.tsx
|
|
132
182
|
var import_core2 = require("@mantine/core");
|
|
@@ -469,12 +519,14 @@ function ConfirmDialog({
|
|
|
469
519
|
var import_core5 = require("@mantine/core");
|
|
470
520
|
var import_gds_theme2 = require("@doneisbetter/gds-theme");
|
|
471
521
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
472
|
-
function ThemeToggle({ size = "md" }) {
|
|
522
|
+
function ThemeToggle({ size = "md", onColorSchemeChange }) {
|
|
473
523
|
const { setColorScheme } = (0, import_core5.useMantineColorScheme)();
|
|
474
524
|
const computedColorScheme = (0, import_core5.useComputedColorScheme)("light", { getInitialValueInEffect: true });
|
|
475
525
|
const { t } = (0, import_gds_theme2.useGdsTranslation)();
|
|
476
526
|
const toggleColorScheme = () => {
|
|
477
|
-
|
|
527
|
+
const nextScheme = computedColorScheme === "dark" ? "light" : "dark";
|
|
528
|
+
setColorScheme(nextScheme);
|
|
529
|
+
onColorSchemeChange?.(nextScheme);
|
|
478
530
|
};
|
|
479
531
|
const isDark = computedColorScheme === "dark";
|
|
480
532
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
@@ -779,6 +831,24 @@ function FormField({ label, description, error, children }) {
|
|
|
779
831
|
|
|
780
832
|
// src/ListingCard.tsx
|
|
781
833
|
var import_core12 = require("@mantine/core");
|
|
834
|
+
|
|
835
|
+
// src/CardContracts.ts
|
|
836
|
+
var gdsCardSizePaddingMap = {
|
|
837
|
+
xs: "xs",
|
|
838
|
+
sm: "sm",
|
|
839
|
+
md: "md",
|
|
840
|
+
lg: "lg",
|
|
841
|
+
xl: "xl"
|
|
842
|
+
};
|
|
843
|
+
var gdsCardTitleOrderMap = {
|
|
844
|
+
xs: 6,
|
|
845
|
+
sm: 5,
|
|
846
|
+
md: 4,
|
|
847
|
+
lg: 4,
|
|
848
|
+
xl: 3
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
// src/ListingCard.tsx
|
|
782
852
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
783
853
|
var ratioMap = {
|
|
784
854
|
"1:1": 1,
|
|
@@ -847,17 +917,27 @@ function ListingCard({
|
|
|
847
917
|
primaryAction,
|
|
848
918
|
saveAction,
|
|
849
919
|
shareAction,
|
|
850
|
-
compact = false
|
|
920
|
+
compact = false,
|
|
921
|
+
size = "md",
|
|
922
|
+
interactiveMode = "none",
|
|
923
|
+
revealContent,
|
|
924
|
+
onSurfaceActivate,
|
|
925
|
+
defaultFlipped = false
|
|
851
926
|
}) {
|
|
927
|
+
const cardPadding = compact ? "md" : gdsCardSizePaddingMap[size];
|
|
852
928
|
const titleContent = href && typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { component: "a", href, inherit: true, td: "none", children: title }) : title;
|
|
853
|
-
|
|
929
|
+
const interactiveProps = interactiveMode === "surface-link" && href ? { component: "a", href } : interactiveMode === "surface-button" ? { component: "button", type: "button", onClick: onSurfaceActivate } : {};
|
|
930
|
+
if (interactiveMode === "flip" && defaultFlipped && revealContent) {
|
|
931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Card, { withBorder: true, radius: "lg", padding: cardPadding, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Stack, { gap: "sm", children: revealContent }) });
|
|
932
|
+
}
|
|
933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Card, { withBorder: true, radius: "lg", padding: cardPadding, ...interactiveProps, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Stack, { gap: compact ? "sm" : "md", children: [
|
|
854
934
|
image ?? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ListingImageFallback, { mediaRatio }),
|
|
855
935
|
featured || sponsoredDisclosure ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Group, { justify: "space-between", gap: "sm", wrap: "wrap", children: [
|
|
856
936
|
featured ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Badge, { variant: "light", color: "violet", children: "Featured" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}),
|
|
857
937
|
sponsoredDisclosure ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { size: "xs", c: "dimmed", children: sponsoredDisclosure }) : null
|
|
858
938
|
] }) : null,
|
|
859
939
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Stack, { gap: 4, children: [
|
|
860
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Title, { order: compact ? 5 :
|
|
940
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Title, { order: compact ? 5 : gdsCardTitleOrderMap[size], lineClamp: 2, children: titleContent }),
|
|
861
941
|
description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { size: "sm", c: "dimmed", lineClamp: compact ? 2 : 3, children: description }) : null
|
|
862
942
|
] }),
|
|
863
943
|
metadata.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Stack, { gap: "xs", children: metadata.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Group, { justify: "space-between", align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
@@ -872,7 +952,8 @@ function ListingCard({
|
|
|
872
952
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_core12.Group, { gap: "xs", wrap: "nowrap", justify: "flex-end", style: { marginInlineStart: "auto" }, children: [
|
|
873
953
|
saveAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ListingAffordance, { affordance: saveAction }) : null,
|
|
874
954
|
shareAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ListingAffordance, { affordance: shareAction }) : null,
|
|
875
|
-
primaryAction
|
|
955
|
+
primaryAction,
|
|
956
|
+
interactiveMode === "flip" && revealContent ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core12.Text, { size: "xs", c: "dimmed", children: "Flip mode supports reveal surfaces." }) : null
|
|
876
957
|
] })
|
|
877
958
|
] })
|
|
878
959
|
] }) });
|
|
@@ -938,53 +1019,25 @@ function StateBlock({
|
|
|
938
1019
|
var import_gds_theme3 = require("@doneisbetter/gds-theme");
|
|
939
1020
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
940
1021
|
function resolvePreviewColorScheme(presetId, requestedScheme) {
|
|
941
|
-
if (presetId === "dark-public") {
|
|
1022
|
+
if (presetId === "dark-public" || presetId === "neon-night") {
|
|
942
1023
|
return "dark";
|
|
943
1024
|
}
|
|
944
1025
|
return requestedScheme;
|
|
945
1026
|
}
|
|
946
|
-
var
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
supportedUse: "Products with a deliberate dark visual baseline, low-light UX, or premium media-first surfaces.",
|
|
961
|
-
avoidFor: "Avoid when mixed mode and editorial readability are core requirements."
|
|
962
|
-
},
|
|
963
|
-
"flat-surface": {
|
|
964
|
-
label: "Flat surface theme",
|
|
965
|
-
bestFor: "Operational products that prefer quieter elevation and flatter surface contrast.",
|
|
966
|
-
summary: "Removes some visual weight without creating a second token authority.",
|
|
967
|
-
themeKey: "gdsFlatSurfaceTheme",
|
|
968
|
-
supportedUse: "Dashboards, admin surfaces, and dense content where elevation becomes distracting.",
|
|
969
|
-
avoidFor: "Avoid for brand-first storytelling or high-expressiveness hero-first pages."
|
|
970
|
-
},
|
|
971
|
-
editorial: {
|
|
972
|
-
label: "Editorial serif theme",
|
|
973
|
-
bestFor: "Documentation, editorial, and content-led experiences.",
|
|
974
|
-
summary: "Adds a more expressive public reading tone while staying inside GDS contracts.",
|
|
975
|
-
themeKey: "gdsEditorialPublicTheme",
|
|
976
|
-
supportedUse: "Guides, docs, and catalog content where reading comfort matters more than impact.",
|
|
977
|
-
avoidFor: "Avoid for dense transactional or data-first workflows with strict minimal contrast."
|
|
978
|
-
},
|
|
979
|
-
brand: {
|
|
980
|
-
label: "Brand theme generator",
|
|
981
|
-
bestFor: "Consumer teams that need controlled brand expression without forking the system.",
|
|
982
|
-
summary: "Composes the shipped helpers into a governed product-authored theme lane.",
|
|
983
|
-
themeKey: "createPublicBrandTheme(...)",
|
|
984
|
-
supportedUse: "Whitelisted public branding programs with narrow product-authored intent and policy guardrails.",
|
|
985
|
-
avoidFor: "Avoid for local style experiments or temporary visual fixes without compliance approval."
|
|
986
|
-
}
|
|
987
|
-
};
|
|
1027
|
+
var presetCatalog = (0, import_gds_theme3.getGdsThemePresets)();
|
|
1028
|
+
var themePresetCatalog = Object.fromEntries(
|
|
1029
|
+
presetCatalog.map((preset) => [
|
|
1030
|
+
preset.id,
|
|
1031
|
+
{
|
|
1032
|
+
label: preset.label,
|
|
1033
|
+
bestFor: `Apps aligned with ${preset.label.toLowerCase()}.`,
|
|
1034
|
+
summary: preset.description,
|
|
1035
|
+
themeKey: preset.runtimeLane,
|
|
1036
|
+
supportedUse: `General product adoption with ${preset.label}.`,
|
|
1037
|
+
avoidFor: "Avoid creating a local non-canonical theme authority."
|
|
1038
|
+
}
|
|
1039
|
+
])
|
|
1040
|
+
);
|
|
988
1041
|
var colorSchemeProof = [
|
|
989
1042
|
{
|
|
990
1043
|
id: "light",
|
|
@@ -1065,40 +1118,50 @@ function ThemePreviewSurface({
|
|
|
1065
1118
|
] })
|
|
1066
1119
|
] }) });
|
|
1067
1120
|
}
|
|
1068
|
-
function ReferenceThemeExplorer(
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
const [
|
|
1073
|
-
const [
|
|
1121
|
+
function ReferenceThemeExplorer({
|
|
1122
|
+
initialSelection,
|
|
1123
|
+
onSelectionChange
|
|
1124
|
+
}) {
|
|
1125
|
+
const [preset, setPreset] = (0, import_react2.useState)(initialSelection?.preset ?? "default");
|
|
1126
|
+
const [colorScheme, setColorScheme] = (0, import_react2.useState)(initialSelection?.colorScheme ?? "light");
|
|
1127
|
+
const [brandPrimary, setBrandPrimary] = (0, import_react2.useState)(initialSelection?.brandPrimary ?? "blue");
|
|
1128
|
+
const [brandFlatSurfaces, setBrandFlatSurfaces] = (0, import_react2.useState)(initialSelection?.brandFlatSurfaces ?? true);
|
|
1129
|
+
const [brandEditorialSerif, setBrandEditorialSerif] = (0, import_react2.useState)(initialSelection?.brandEditorialSerif ?? false);
|
|
1130
|
+
const [fontLane, setFontLane] = (0, import_react2.useState)(initialSelection?.fontLane ?? "inter");
|
|
1074
1131
|
const [comparisonEnabled, setComparisonEnabled] = (0, import_react2.useState)(false);
|
|
1075
1132
|
const [comparisonPreset, setComparisonPreset] = (0, import_react2.useState)("editorial");
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
case "editorial":
|
|
1083
|
-
return import_gds_theme3.gdsEditorialPublicTheme;
|
|
1084
|
-
case "brand":
|
|
1085
|
-
return (0, import_gds_theme3.createPublicBrandTheme)({
|
|
1086
|
-
flatSurfaces: brandFlatSurfaces,
|
|
1087
|
-
editorialSerif: brandEditorialSerif,
|
|
1088
|
-
overrides: { primaryColor: brandPrimary }
|
|
1089
|
-
});
|
|
1090
|
-
default:
|
|
1091
|
-
return import_gds_theme3.gdsTheme;
|
|
1092
|
-
}
|
|
1093
|
-
};
|
|
1133
|
+
const availableComparisonPresets = presetCatalog.filter((item) => item.id !== preset).map((item) => item.id);
|
|
1134
|
+
const resolveTheme = (presetId) => (0, import_gds_theme3.applyGdsFontLane)((0, import_gds_theme3.resolveGdsThemePreset)(presetId, {
|
|
1135
|
+
brandPrimary,
|
|
1136
|
+
brandFlatSurfaces,
|
|
1137
|
+
brandEditorialSerif
|
|
1138
|
+
}), fontLane);
|
|
1094
1139
|
const selectionSummary = themePresetCatalog[preset];
|
|
1095
1140
|
const comparisonSummary = themePresetCatalog[comparisonPreset];
|
|
1096
|
-
const selectedTheme = (0, import_react2.useMemo)(() => resolveTheme(preset), [preset, brandPrimary, brandFlatSurfaces, brandEditorialSerif]);
|
|
1097
|
-
const comparedTheme = (0, import_react2.useMemo)(() => resolveTheme(comparisonPreset), [comparisonPreset, brandPrimary, brandFlatSurfaces, brandEditorialSerif]);
|
|
1141
|
+
const selectedTheme = (0, import_react2.useMemo)(() => resolveTheme(preset), [preset, brandPrimary, brandFlatSurfaces, brandEditorialSerif, fontLane]);
|
|
1142
|
+
const comparedTheme = (0, import_react2.useMemo)(() => resolveTheme(comparisonPreset), [comparisonPreset, brandPrimary, brandFlatSurfaces, brandEditorialSerif, fontLane]);
|
|
1098
1143
|
const effectiveColorScheme = resolvePreviewColorScheme(preset, colorScheme);
|
|
1099
1144
|
const effectiveComparisonScheme = resolvePreviewColorScheme(comparisonPreset, colorScheme);
|
|
1100
|
-
const previewKey = `${preset}-${effectiveColorScheme}-${brandPrimary}-${brandFlatSurfaces}-${brandEditorialSerif}`;
|
|
1101
|
-
const comparisonPreviewKey = `${comparisonPreset}-${effectiveComparisonScheme}-${brandPrimary}-${brandFlatSurfaces}-${brandEditorialSerif}`;
|
|
1145
|
+
const previewKey = `${preset}-${effectiveColorScheme}-${brandPrimary}-${brandFlatSurfaces}-${brandEditorialSerif}-${fontLane}`;
|
|
1146
|
+
const comparisonPreviewKey = `${comparisonPreset}-${effectiveComparisonScheme}-${brandPrimary}-${brandFlatSurfaces}-${brandEditorialSerif}-${fontLane}`;
|
|
1147
|
+
(0, import_react2.useEffect)(() => {
|
|
1148
|
+
onSelectionChange?.({
|
|
1149
|
+
preset,
|
|
1150
|
+
colorScheme: effectiveColorScheme,
|
|
1151
|
+
theme: selectedTheme,
|
|
1152
|
+
fontLane,
|
|
1153
|
+
runtimeKey: previewKey,
|
|
1154
|
+
brandPrimary,
|
|
1155
|
+
brandFlatSurfaces,
|
|
1156
|
+
brandEditorialSerif
|
|
1157
|
+
});
|
|
1158
|
+
}, [onSelectionChange, preset, effectiveColorScheme, selectedTheme, fontLane, previewKey, brandPrimary, brandFlatSurfaces, brandEditorialSerif]);
|
|
1159
|
+
(0, import_react2.useEffect)(() => {
|
|
1160
|
+
if (comparisonPreset !== preset) {
|
|
1161
|
+
return;
|
|
1162
|
+
}
|
|
1163
|
+
setComparisonPreset(availableComparisonPresets[0] ?? "editorial");
|
|
1164
|
+
}, [comparisonPreset, preset, availableComparisonPresets]);
|
|
1102
1165
|
const reset = () => {
|
|
1103
1166
|
setPreset("default");
|
|
1104
1167
|
setColorScheme("light");
|
|
@@ -1107,6 +1170,7 @@ function ReferenceThemeExplorer() {
|
|
|
1107
1170
|
setBrandEditorialSerif(false);
|
|
1108
1171
|
setComparisonEnabled(false);
|
|
1109
1172
|
setComparisonPreset("editorial");
|
|
1173
|
+
setFontLane("inter");
|
|
1110
1174
|
};
|
|
1111
1175
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Stack, { gap: "xl", children: [
|
|
1112
1176
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
@@ -1139,8 +1203,17 @@ function ReferenceThemeExplorer() {
|
|
|
1139
1203
|
]
|
|
1140
1204
|
}
|
|
1141
1205
|
) }),
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FormField, { label: "Webfont lane", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1207
|
+
import_core14.NativeSelect,
|
|
1208
|
+
{
|
|
1209
|
+
"aria-label": "Webfont lane",
|
|
1210
|
+
value: fontLane,
|
|
1211
|
+
onChange: (event) => setFontLane(event.currentTarget.value || "inter"),
|
|
1212
|
+
data: (0, import_gds_theme3.getGdsFontLanes)().map((lane) => ({ value: lane.id, label: lane.label }))
|
|
1213
|
+
}
|
|
1214
|
+
) }),
|
|
1142
1215
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Button, { variant: "default", size: "sm", onClick: reset, children: "Reset theme lab" }),
|
|
1143
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", children: "
|
|
1216
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", children: "Theme changes apply to the official site shell so visitors can validate real whole-page runtime behavior." })
|
|
1144
1217
|
] }) }),
|
|
1145
1218
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_core14.Stack, { gap: "md", children: [
|
|
1146
1219
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Title, { order: 4, children: "Brand builder options" }),
|
|
@@ -1194,7 +1267,7 @@ function ReferenceThemeExplorer() {
|
|
|
1194
1267
|
" ",
|
|
1195
1268
|
colorScheme
|
|
1196
1269
|
] }),
|
|
1197
|
-
preset === "dark-public" && colorScheme !== effectiveColorScheme ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", children: "
|
|
1270
|
+
(preset === "dark-public" || preset === "neon-night") && colorScheme !== effectiveColorScheme ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_core14.Text, { size: "sm", c: "dimmed", children: "This dark-forward preset always renders in dark mode inside the live preview." }) : null
|
|
1198
1271
|
] }),
|
|
1199
1272
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1200
1273
|
import_core14.Checkbox,
|
|
@@ -1212,7 +1285,7 @@ function ReferenceThemeExplorer() {
|
|
|
1212
1285
|
value: comparisonPreset,
|
|
1213
1286
|
onChange: (event) => setComparisonPreset(event.currentTarget.value || "editorial"),
|
|
1214
1287
|
disabled: !comparisonEnabled,
|
|
1215
|
-
data:
|
|
1288
|
+
data: availableComparisonPresets.map((value) => ({ value, label: themePresetCatalog[value].label }))
|
|
1216
1289
|
}
|
|
1217
1290
|
) })
|
|
1218
1291
|
] }) })
|
|
@@ -1600,16 +1673,17 @@ function ProductCard({
|
|
|
1600
1673
|
metadata = [],
|
|
1601
1674
|
primaryAction,
|
|
1602
1675
|
secondaryActions = [],
|
|
1603
|
-
footer
|
|
1676
|
+
footer,
|
|
1677
|
+
size = "md"
|
|
1604
1678
|
}) {
|
|
1605
1679
|
const MoreIcon = GdsIcons.Menu;
|
|
1606
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.Card, { withBorder: true, radius: "lg", padding:
|
|
1680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.Card, { withBorder: true, radius: "lg", padding: gdsCardSizePaddingMap[size], children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core21.Stack, { gap: "md", children: [
|
|
1607
1681
|
media,
|
|
1608
1682
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core21.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", children: [
|
|
1609
1683
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core21.Group, { align: "flex-start", gap: "sm", wrap: "nowrap", children: [
|
|
1610
1684
|
icon ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.ThemeIcon, { variant: "light", size: "xl", radius: "xl", "aria-hidden": true, children: icon }) : null,
|
|
1611
1685
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_core21.Stack, { gap: 4, children: [
|
|
1612
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.Title, { order:
|
|
1686
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.Title, { order: gdsCardTitleOrderMap[size], children: title }),
|
|
1613
1687
|
description ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_core21.Text, { size: "sm", c: "dimmed", lineClamp: 3, children: description }) : null
|
|
1614
1688
|
] })
|
|
1615
1689
|
] }),
|
|
@@ -1693,8 +1767,11 @@ function PublicProductCard({
|
|
|
1693
1767
|
secondaryAction,
|
|
1694
1768
|
metadata = [],
|
|
1695
1769
|
compact = false,
|
|
1770
|
+
size = "md",
|
|
1696
1771
|
loading = false,
|
|
1697
|
-
disabled = false
|
|
1772
|
+
disabled = false,
|
|
1773
|
+
interactiveMode = "none",
|
|
1774
|
+
onSurfaceActivate
|
|
1698
1775
|
}) {
|
|
1699
1776
|
if (loading) {
|
|
1700
1777
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LoadingCard, { compact });
|
|
@@ -1710,11 +1787,12 @@ function PublicProductCard({
|
|
|
1710
1787
|
const pickupHelper = helperKind === "pickup" ? helperText : pickupNote;
|
|
1711
1788
|
const inventoryHelper = helperKind === "inventory" ? helperText : inventoryNote;
|
|
1712
1789
|
const hasSupportingRegion = Boolean(price || supportingHelper || pickupHelper || inventoryHelper);
|
|
1713
|
-
|
|
1790
|
+
const interactiveProps = interactiveMode === "surface-button" ? { component: "button", type: "button", onClick: onSurfaceActivate } : {};
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core22.Card, { withBorder: true, radius: "lg", padding: compact ? "md" : gdsCardSizePaddingMap[size], ...interactiveProps, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core22.Stack, { gap: compact ? "sm" : "md", children: [
|
|
1714
1792
|
image ?? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ImageFallback, { compact }),
|
|
1715
1793
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core22.Group, { justify: "space-between", align: "flex-start", wrap: "nowrap", gap: "sm", children: [
|
|
1716
1794
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_core22.Stack, { gap: 4, style: { minWidth: 0, flex: 1 }, children: [
|
|
1717
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core22.Title, { order: compact ? 5 :
|
|
1795
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core22.Title, { order: compact ? 5 : gdsCardTitleOrderMap[size], lineClamp: 2, children: title }),
|
|
1718
1796
|
description ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core22.Text, { size: "sm", c: "dimmed", lineClamp: compact ? 2 : 3, children: description }) : null
|
|
1719
1797
|
] }),
|
|
1720
1798
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_core22.Badge, { variant: "light", color: stateBadge.color, children: stateBadge.label })
|
|
@@ -2088,20 +2166,277 @@ function DetailProfileShell({
|
|
|
2088
2166
|
] }) });
|
|
2089
2167
|
}
|
|
2090
2168
|
|
|
2169
|
+
// src/AsyncSurface.tsx
|
|
2170
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2171
|
+
function getRetryAction(onRetry) {
|
|
2172
|
+
if (!onRetry) {
|
|
2173
|
+
return void 0;
|
|
2174
|
+
}
|
|
2175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { type: "button", onClick: onRetry, children: "Retry" });
|
|
2176
|
+
}
|
|
2177
|
+
function renderStateBlock({
|
|
2178
|
+
variant,
|
|
2179
|
+
title,
|
|
2180
|
+
description,
|
|
2181
|
+
compact,
|
|
2182
|
+
presentation,
|
|
2183
|
+
minHeight,
|
|
2184
|
+
contentAlign,
|
|
2185
|
+
contentJustify,
|
|
2186
|
+
action
|
|
2187
|
+
}) {
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2189
|
+
StateBlock,
|
|
2190
|
+
{
|
|
2191
|
+
variant,
|
|
2192
|
+
title,
|
|
2193
|
+
description,
|
|
2194
|
+
action,
|
|
2195
|
+
compact,
|
|
2196
|
+
presentation,
|
|
2197
|
+
minHeight,
|
|
2198
|
+
contentAlign,
|
|
2199
|
+
contentJustify
|
|
2200
|
+
}
|
|
2201
|
+
);
|
|
2202
|
+
}
|
|
2203
|
+
function AsyncSurface({
|
|
2204
|
+
state,
|
|
2205
|
+
successContent,
|
|
2206
|
+
idleContent,
|
|
2207
|
+
loadingTitle = "Loading",
|
|
2208
|
+
loadingDescription = "This surface is still synchronizing.",
|
|
2209
|
+
emptyTitle = "No results",
|
|
2210
|
+
emptyDescription = "No data is available for this surface yet.",
|
|
2211
|
+
errorTitle = "Unable to load",
|
|
2212
|
+
errorDescription = "Something went wrong while preparing this surface.",
|
|
2213
|
+
refreshingTitle = "Refreshing",
|
|
2214
|
+
refreshingDescription = "The latest data is being fetched.",
|
|
2215
|
+
onRetry,
|
|
2216
|
+
retryAction,
|
|
2217
|
+
compact = false,
|
|
2218
|
+
presentation = "inline",
|
|
2219
|
+
minHeight,
|
|
2220
|
+
contentAlign,
|
|
2221
|
+
contentJustify
|
|
2222
|
+
}) {
|
|
2223
|
+
const fallbackRetryAction = retryAction ?? getRetryAction(onRetry);
|
|
2224
|
+
if (state === "success") {
|
|
2225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: successContent });
|
|
2226
|
+
}
|
|
2227
|
+
if (state === "idle") {
|
|
2228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_jsx_runtime30.Fragment, { children: idleContent ?? successContent ?? null });
|
|
2229
|
+
}
|
|
2230
|
+
if (state === "loading") {
|
|
2231
|
+
return renderStateBlock({
|
|
2232
|
+
variant: "loading",
|
|
2233
|
+
title: loadingTitle,
|
|
2234
|
+
description: loadingDescription,
|
|
2235
|
+
compact,
|
|
2236
|
+
presentation,
|
|
2237
|
+
minHeight,
|
|
2238
|
+
contentAlign,
|
|
2239
|
+
contentJustify
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
if (state === "empty") {
|
|
2243
|
+
return renderStateBlock({
|
|
2244
|
+
variant: "empty",
|
|
2245
|
+
title: emptyTitle,
|
|
2246
|
+
description: emptyDescription,
|
|
2247
|
+
compact,
|
|
2248
|
+
presentation,
|
|
2249
|
+
minHeight,
|
|
2250
|
+
contentAlign,
|
|
2251
|
+
contentJustify,
|
|
2252
|
+
action: fallbackRetryAction
|
|
2253
|
+
});
|
|
2254
|
+
}
|
|
2255
|
+
if (state === "error") {
|
|
2256
|
+
return renderStateBlock({
|
|
2257
|
+
variant: "error",
|
|
2258
|
+
title: errorTitle,
|
|
2259
|
+
description: errorDescription,
|
|
2260
|
+
compact,
|
|
2261
|
+
presentation,
|
|
2262
|
+
minHeight,
|
|
2263
|
+
contentAlign,
|
|
2264
|
+
contentJustify,
|
|
2265
|
+
action: fallbackRetryAction
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
return renderStateBlock({
|
|
2269
|
+
variant: "info",
|
|
2270
|
+
title: refreshingTitle,
|
|
2271
|
+
description: refreshingDescription,
|
|
2272
|
+
compact,
|
|
2273
|
+
presentation,
|
|
2274
|
+
minHeight,
|
|
2275
|
+
contentAlign,
|
|
2276
|
+
contentJustify
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
|
|
2280
|
+
// src/ListingPrimitives.tsx
|
|
2281
|
+
var import_core28 = require("@mantine/core");
|
|
2282
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2283
|
+
function ActiveFilterChips({
|
|
2284
|
+
filters,
|
|
2285
|
+
emptyLabel = "No active filters."
|
|
2286
|
+
}) {
|
|
2287
|
+
if (!filters.length) {
|
|
2288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core28.Text, { size: "sm", c: "dimmed", children: emptyLabel });
|
|
2289
|
+
}
|
|
2290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core28.Group, { gap: "xs", children: filters.map((filter) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2291
|
+
import_core28.Badge,
|
|
2292
|
+
{
|
|
2293
|
+
variant: "light",
|
|
2294
|
+
rightSection: filter.onRemove ? "\xD7" : void 0,
|
|
2295
|
+
style: filter.onRemove ? { cursor: "pointer" } : void 0,
|
|
2296
|
+
onClick: filter.onRemove,
|
|
2297
|
+
children: filter.label
|
|
2298
|
+
},
|
|
2299
|
+
filter.id
|
|
2300
|
+
)) });
|
|
2301
|
+
}
|
|
2302
|
+
function ResultSummary({
|
|
2303
|
+
resultCount,
|
|
2304
|
+
noun = "results",
|
|
2305
|
+
description
|
|
2306
|
+
}) {
|
|
2307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core28.Stack, { gap: 2, children: [
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core28.Text, { size: "sm", fw: 600, children: [
|
|
2309
|
+
resultCount,
|
|
2310
|
+
" ",
|
|
2311
|
+
noun
|
|
2312
|
+
] }),
|
|
2313
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core28.Text, { size: "xs", c: "dimmed", children: description }) : null
|
|
2314
|
+
] });
|
|
2315
|
+
}
|
|
2316
|
+
function SortMenu({
|
|
2317
|
+
value,
|
|
2318
|
+
options,
|
|
2319
|
+
onChange,
|
|
2320
|
+
label = "Sort"
|
|
2321
|
+
}) {
|
|
2322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2323
|
+
import_core28.Select,
|
|
2324
|
+
{
|
|
2325
|
+
"aria-label": label,
|
|
2326
|
+
label,
|
|
2327
|
+
value,
|
|
2328
|
+
data: options,
|
|
2329
|
+
onChange: (next) => {
|
|
2330
|
+
if (next) {
|
|
2331
|
+
onChange?.(next);
|
|
2332
|
+
}
|
|
2333
|
+
},
|
|
2334
|
+
w: 220
|
|
2335
|
+
}
|
|
2336
|
+
);
|
|
2337
|
+
}
|
|
2338
|
+
function BulkActionsBar({
|
|
2339
|
+
selectedCount,
|
|
2340
|
+
actions,
|
|
2341
|
+
clearAction
|
|
2342
|
+
}) {
|
|
2343
|
+
if (selectedCount <= 0) {
|
|
2344
|
+
return null;
|
|
2345
|
+
}
|
|
2346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core28.Group, { justify: "space-between", align: "center", children: [
|
|
2347
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core28.Text, { size: "sm", fw: 600, children: [
|
|
2348
|
+
selectedCount,
|
|
2349
|
+
" selected"
|
|
2350
|
+
] }),
|
|
2351
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_core28.Group, { gap: "xs", children: [
|
|
2352
|
+
actions,
|
|
2353
|
+
clearAction ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_core28.Button, { variant: "subtle", size: "xs", children: "Clear selection" })
|
|
2354
|
+
] })
|
|
2355
|
+
] });
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
// src/ListingState.client.tsx
|
|
2359
|
+
var import_react5 = require("react");
|
|
2360
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2361
|
+
function createInitialState(config = {}) {
|
|
2362
|
+
return {
|
|
2363
|
+
search: "",
|
|
2364
|
+
sort: config.defaultSort ?? "newest",
|
|
2365
|
+
filters: [],
|
|
2366
|
+
page: 1,
|
|
2367
|
+
pageSize: config.defaultPageSize ?? 25,
|
|
2368
|
+
selection: []
|
|
2369
|
+
};
|
|
2370
|
+
}
|
|
2371
|
+
function listingQueryReducer(state, action) {
|
|
2372
|
+
if (action.type === "set-search") {
|
|
2373
|
+
return { ...state, search: action.value, page: 1, selection: [] };
|
|
2374
|
+
}
|
|
2375
|
+
if (action.type === "set-sort") {
|
|
2376
|
+
return { ...state, sort: action.value, page: 1, selection: [] };
|
|
2377
|
+
}
|
|
2378
|
+
if (action.type === "toggle-filter") {
|
|
2379
|
+
const exists = state.filters.includes(action.value);
|
|
2380
|
+
return {
|
|
2381
|
+
...state,
|
|
2382
|
+
filters: exists ? state.filters.filter((item) => item !== action.value) : [...state.filters, action.value],
|
|
2383
|
+
page: 1,
|
|
2384
|
+
selection: []
|
|
2385
|
+
};
|
|
2386
|
+
}
|
|
2387
|
+
if (action.type === "clear-filters") {
|
|
2388
|
+
return { ...state, filters: [], page: 1, selection: [] };
|
|
2389
|
+
}
|
|
2390
|
+
if (action.type === "set-page") {
|
|
2391
|
+
return { ...state, page: Math.max(1, Math.floor(action.value)) };
|
|
2392
|
+
}
|
|
2393
|
+
if (action.type === "set-page-size") {
|
|
2394
|
+
const nextPageSize = Math.max(1, Math.floor(action.value));
|
|
2395
|
+
return { ...state, pageSize: nextPageSize, page: 1, selection: [] };
|
|
2396
|
+
}
|
|
2397
|
+
if (action.type === "toggle-selection") {
|
|
2398
|
+
const exists = state.selection.includes(action.value);
|
|
2399
|
+
return {
|
|
2400
|
+
...state,
|
|
2401
|
+
selection: exists ? state.selection.filter((item) => item !== action.value) : [...state.selection, action.value]
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
if (action.type === "clear-selection") {
|
|
2405
|
+
return { ...state, selection: [] };
|
|
2406
|
+
}
|
|
2407
|
+
return createInitialState({ defaultSort: state.sort, defaultPageSize: state.pageSize });
|
|
2408
|
+
}
|
|
2409
|
+
var ListingStateContext = (0, import_react5.createContext)(null);
|
|
2410
|
+
function ListingProvider({
|
|
2411
|
+
children,
|
|
2412
|
+
config
|
|
2413
|
+
}) {
|
|
2414
|
+
const [state, dispatch] = (0, import_react5.useReducer)(listingQueryReducer, config, createInitialState);
|
|
2415
|
+
const value = (0, import_react5.useMemo)(() => ({ state, dispatch }), [state]);
|
|
2416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ListingStateContext.Provider, { value, children });
|
|
2417
|
+
}
|
|
2418
|
+
function useListingState() {
|
|
2419
|
+
const context = (0, import_react5.useContext)(ListingStateContext);
|
|
2420
|
+
if (!context) {
|
|
2421
|
+
throw new Error("useListingState must be used within ListingProvider.");
|
|
2422
|
+
}
|
|
2423
|
+
return context;
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2091
2426
|
// src/PublicShell.tsx
|
|
2092
|
-
var
|
|
2427
|
+
var import_core30 = require("@mantine/core");
|
|
2093
2428
|
|
|
2094
2429
|
// src/PublicNav.tsx
|
|
2095
|
-
var
|
|
2096
|
-
var
|
|
2430
|
+
var import_core29 = require("@mantine/core");
|
|
2431
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2097
2432
|
function PublicNav({ items, activeId, renderLink }) {
|
|
2098
|
-
return /* @__PURE__ */ (0,
|
|
2433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_core29.Group, { component: "nav", "aria-label": "Primary", gap: "lg", wrap: "nowrap", children: items.map((item) => {
|
|
2099
2434
|
const active = item.id === activeId;
|
|
2100
2435
|
if (renderLink) {
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: renderLink(item, active) }, item.id);
|
|
2102
2437
|
}
|
|
2103
|
-
return /* @__PURE__ */ (0,
|
|
2104
|
-
|
|
2438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2439
|
+
import_core29.Anchor,
|
|
2105
2440
|
{
|
|
2106
2441
|
href: item.href,
|
|
2107
2442
|
"aria-current": active ? "page" : void 0,
|
|
@@ -2118,15 +2453,15 @@ function PublicNav({ items, activeId, renderLink }) {
|
|
|
2118
2453
|
}
|
|
2119
2454
|
|
|
2120
2455
|
// src/PublicShell.tsx
|
|
2121
|
-
var
|
|
2456
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2122
2457
|
function InlineMobileNavigation({
|
|
2123
2458
|
mobileNavigation,
|
|
2124
2459
|
className,
|
|
2125
2460
|
mode
|
|
2126
2461
|
}) {
|
|
2127
|
-
return /* @__PURE__ */ (0,
|
|
2128
|
-
/* @__PURE__ */ (0,
|
|
2129
|
-
|
|
2462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core30.Box, { component: "details", hiddenFrom: "sm", className, children: [
|
|
2463
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2464
|
+
import_core30.Box,
|
|
2130
2465
|
{
|
|
2131
2466
|
component: "summary",
|
|
2132
2467
|
"aria-label": mode === "drawer" ? "Open site navigation drawer" : "Open site navigation",
|
|
@@ -2138,13 +2473,13 @@ function InlineMobileNavigation({
|
|
|
2138
2473
|
gap: "0.5rem"
|
|
2139
2474
|
},
|
|
2140
2475
|
children: [
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Burger, { opened: false, "aria-hidden": true }),
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Text, { size: "sm", fw: 600, children: "Menu" })
|
|
2143
2478
|
]
|
|
2144
2479
|
}
|
|
2145
2480
|
),
|
|
2146
|
-
/* @__PURE__ */ (0,
|
|
2147
|
-
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2482
|
+
import_core30.Box,
|
|
2148
2483
|
{
|
|
2149
2484
|
mt: "sm",
|
|
2150
2485
|
p: "sm",
|
|
@@ -2153,7 +2488,7 @@ function InlineMobileNavigation({
|
|
|
2153
2488
|
border: "1px solid var(--mantine-color-default-border)",
|
|
2154
2489
|
background: mode === "drawer" ? "light-dark(var(--mantine-color-white), color-mix(in srgb, var(--mantine-color-dark-7) 92%, black))" : "var(--mantine-color-body)"
|
|
2155
2490
|
},
|
|
2156
|
-
children: /* @__PURE__ */ (0,
|
|
2491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Stack, { gap: "sm", children: mobileNavigation })
|
|
2157
2492
|
}
|
|
2158
2493
|
)
|
|
2159
2494
|
] });
|
|
@@ -2174,30 +2509,30 @@ function PublicShell({
|
|
|
2174
2509
|
mobileNavigationMode = "sheet",
|
|
2175
2510
|
classNames
|
|
2176
2511
|
}) {
|
|
2177
|
-
const resolvedNavigation = navigation ?? (navItems ? /* @__PURE__ */ (0,
|
|
2512
|
+
const resolvedNavigation = navigation ?? (navItems ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PublicNav, { items: navItems, activeId: activeNavId }) : null);
|
|
2178
2513
|
const containerSize = maxContentWidth ?? (compact ? "md" : "lg");
|
|
2179
2514
|
const headerHeight = headerVariant === "compact" ? 64 : headerVariant === "branded-quiet" ? 88 : 72;
|
|
2180
2515
|
const mainPadding = headerVariant === "compact" ? "lg" : "xl";
|
|
2181
2516
|
const usesInlineMobileNavigation = Boolean(mobileNavigation) && mobileNavigationMode !== "sheet";
|
|
2182
2517
|
const usesSheetMobileNavigation = Boolean(mobileNavigation) && mobileNavigationMode === "sheet";
|
|
2183
|
-
return /* @__PURE__ */ (0,
|
|
2184
|
-
|
|
2518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2519
|
+
import_core30.AppShell,
|
|
2185
2520
|
{
|
|
2186
2521
|
className: classNames?.root,
|
|
2187
2522
|
header: { height: headerHeight },
|
|
2188
2523
|
footer: usesSheetMobileNavigation ? { height: 68 } : void 0,
|
|
2189
2524
|
padding: 0,
|
|
2190
2525
|
children: [
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2192
|
-
|
|
2526
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.AppShell.Header, { withBorder: headerBordered, className: classNames?.header, "data-header-variant": headerVariant, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Container, { size: containerSize, h: "100%", py: headerVariant === "branded-quiet" ? "sm" : 0, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2527
|
+
import_core30.Group,
|
|
2193
2528
|
{
|
|
2194
2529
|
h: "100%",
|
|
2195
2530
|
justify: "space-between",
|
|
2196
2531
|
wrap: "nowrap",
|
|
2197
2532
|
gap: headerVariant === "compact" ? "sm" : "lg",
|
|
2198
2533
|
children: [
|
|
2199
|
-
/* @__PURE__ */ (0,
|
|
2200
|
-
usesInlineMobileNavigation ? /* @__PURE__ */ (0,
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core30.Group, { wrap: "nowrap", gap: headerVariant === "compact" ? "xs" : "sm", className: classNames?.brand, children: [
|
|
2535
|
+
usesInlineMobileNavigation ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2201
2536
|
InlineMobileNavigation,
|
|
2202
2537
|
{
|
|
2203
2538
|
mobileNavigation,
|
|
@@ -2205,17 +2540,17 @@ function PublicShell({
|
|
|
2205
2540
|
mode: mobileNavigationMode
|
|
2206
2541
|
}
|
|
2207
2542
|
) : null,
|
|
2208
|
-
/* @__PURE__ */ (0,
|
|
2543
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Box, { children: brand })
|
|
2209
2544
|
] }),
|
|
2210
|
-
/* @__PURE__ */ (0,
|
|
2211
|
-
/* @__PURE__ */ (0,
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Group, { visibleFrom: "sm", gap: headerVariant === "compact" ? "md" : "lg", className: classNames?.navigation, children: resolvedNavigation }),
|
|
2546
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Group, { gap: "sm", className: classNames?.actions, children: actions })
|
|
2212
2547
|
]
|
|
2213
2548
|
}
|
|
2214
2549
|
) }) }),
|
|
2215
|
-
usesSheetMobileNavigation ? /* @__PURE__ */ (0,
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2217
|
-
/* @__PURE__ */ (0,
|
|
2218
|
-
footer ? /* @__PURE__ */ (0,
|
|
2550
|
+
usesSheetMobileNavigation ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.AppShell.Footer, { withBorder: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Container, { size: containerSize, h: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Group, { h: "100%", justify: "space-around", wrap: "nowrap", children: mobileNavigation }) }) }) : null,
|
|
2551
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_core30.AppShell.Main, { children: [
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Container, { size: containerSize, py: mainPadding, className: classNames?.content, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Stack, { gap: "xl", children }) }),
|
|
2553
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Box, { component: typeof footer === "string" ? "footer" : "div", py: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Container, { size: containerSize, children: typeof footer === "string" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_core30.Text, { size: "sm", c: "dimmed", children: footer }) : footer }) }) : null
|
|
2219
2554
|
] })
|
|
2220
2555
|
]
|
|
2221
2556
|
}
|
|
@@ -2223,9 +2558,49 @@ function PublicShell({
|
|
|
2223
2558
|
}
|
|
2224
2559
|
|
|
2225
2560
|
// src/DiscoveryShell.tsx
|
|
2226
|
-
var
|
|
2561
|
+
var import_react6 = require("react");
|
|
2562
|
+
var import_core31 = require("@mantine/core");
|
|
2227
2563
|
var import_hooks2 = require("@mantine/hooks");
|
|
2228
|
-
var
|
|
2564
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2565
|
+
function useDiscoveryShellState({
|
|
2566
|
+
defaultSidebarOpen = false,
|
|
2567
|
+
sidebarStorageKey,
|
|
2568
|
+
onSidebarOpenedChange
|
|
2569
|
+
} = {}) {
|
|
2570
|
+
const [opened, setOpenedState] = (0, import_react6.useState)(defaultSidebarOpen);
|
|
2571
|
+
(0, import_react6.useEffect)(() => {
|
|
2572
|
+
if (!sidebarStorageKey || typeof window === "undefined") {
|
|
2573
|
+
return;
|
|
2574
|
+
}
|
|
2575
|
+
const stored = window.localStorage.getItem(sidebarStorageKey);
|
|
2576
|
+
if (stored === "open") {
|
|
2577
|
+
setOpenedState(true);
|
|
2578
|
+
}
|
|
2579
|
+
if (stored === "closed") {
|
|
2580
|
+
setOpenedState(false);
|
|
2581
|
+
}
|
|
2582
|
+
}, [sidebarStorageKey]);
|
|
2583
|
+
const persistAndNotify = (next) => {
|
|
2584
|
+
if (sidebarStorageKey && typeof window !== "undefined") {
|
|
2585
|
+
window.localStorage.setItem(sidebarStorageKey, next ? "open" : "closed");
|
|
2586
|
+
}
|
|
2587
|
+
onSidebarOpenedChange?.(next);
|
|
2588
|
+
};
|
|
2589
|
+
const setOpened = (next) => {
|
|
2590
|
+
setOpenedState(next);
|
|
2591
|
+
persistAndNotify(next);
|
|
2592
|
+
};
|
|
2593
|
+
const open = () => setOpened(true);
|
|
2594
|
+
const close = () => setOpened(false);
|
|
2595
|
+
const toggle = () => {
|
|
2596
|
+
setOpenedState((current) => {
|
|
2597
|
+
const next = !current;
|
|
2598
|
+
persistAndNotify(next);
|
|
2599
|
+
return next;
|
|
2600
|
+
});
|
|
2601
|
+
};
|
|
2602
|
+
return { opened, open, close, toggle, setOpened };
|
|
2603
|
+
}
|
|
2229
2604
|
function DiscoveryShell({
|
|
2230
2605
|
header,
|
|
2231
2606
|
sidebar,
|
|
@@ -2233,28 +2608,47 @@ function DiscoveryShell({
|
|
|
2233
2608
|
children,
|
|
2234
2609
|
mobileNavigationLabel = "Toggle navigation",
|
|
2235
2610
|
defaultSidebarOpen = false,
|
|
2611
|
+
sidebarStorageKey,
|
|
2612
|
+
sidebarOpened,
|
|
2613
|
+
onSidebarOpenedChange,
|
|
2236
2614
|
stickySidebar = true,
|
|
2615
|
+
desktopCollapsible = false,
|
|
2616
|
+
desktopNavigationLabel = "Toggle sidebar",
|
|
2237
2617
|
sidebarWidth = 280,
|
|
2238
2618
|
headerHeight = 60,
|
|
2239
2619
|
shellPadding = "md",
|
|
2240
2620
|
collapseBreakpoint = "sm"
|
|
2241
2621
|
}) {
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
|
|
2622
|
+
const breakpointByAlias = {
|
|
2623
|
+
xs: "36em",
|
|
2624
|
+
sm: "48em",
|
|
2625
|
+
md: "62em",
|
|
2626
|
+
lg: "75em",
|
|
2627
|
+
xl: "88em"
|
|
2628
|
+
};
|
|
2629
|
+
const isMobile = (0, import_hooks2.useMediaQuery)(`(max-width: ${breakpointByAlias[collapseBreakpoint]})`);
|
|
2630
|
+
const shellState = useDiscoveryShellState({ defaultSidebarOpen, sidebarStorageKey, onSidebarOpenedChange });
|
|
2631
|
+
const opened = sidebarOpened ?? shellState.opened;
|
|
2632
|
+
const close = onSidebarOpenedChange ? () => onSidebarOpenedChange(false) : shellState.close;
|
|
2633
|
+
const toggle = onSidebarOpenedChange ? () => onSidebarOpenedChange(!opened) : shellState.toggle;
|
|
2634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2635
|
+
import_core31.AppShell,
|
|
2245
2636
|
{
|
|
2246
2637
|
header: { height: headerHeight },
|
|
2247
2638
|
footer: footer ? { height: 68 } : void 0,
|
|
2248
2639
|
navbar: {
|
|
2249
2640
|
width: sidebarWidth,
|
|
2250
2641
|
breakpoint: collapseBreakpoint,
|
|
2251
|
-
collapsed: {
|
|
2642
|
+
collapsed: {
|
|
2643
|
+
mobile: !opened,
|
|
2644
|
+
desktop: desktopCollapsible ? !opened : false
|
|
2645
|
+
}
|
|
2252
2646
|
},
|
|
2253
2647
|
padding: shellPadding,
|
|
2254
2648
|
children: [
|
|
2255
|
-
/* @__PURE__ */ (0,
|
|
2256
|
-
/* @__PURE__ */ (0,
|
|
2257
|
-
|
|
2649
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.AppShell.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_core31.Group, { h: "100%", px: "md", gap: "sm", wrap: "nowrap", children: [
|
|
2650
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2651
|
+
import_core31.Burger,
|
|
2258
2652
|
{
|
|
2259
2653
|
opened,
|
|
2260
2654
|
onClick: toggle,
|
|
@@ -2263,10 +2657,20 @@ function DiscoveryShell({
|
|
|
2263
2657
|
"aria-label": mobileNavigationLabel
|
|
2264
2658
|
}
|
|
2265
2659
|
),
|
|
2266
|
-
/* @__PURE__ */ (0,
|
|
2660
|
+
desktopCollapsible ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2661
|
+
import_core31.Burger,
|
|
2662
|
+
{
|
|
2663
|
+
opened,
|
|
2664
|
+
onClick: toggle,
|
|
2665
|
+
visibleFrom: collapseBreakpoint,
|
|
2666
|
+
size: "sm",
|
|
2667
|
+
"aria-label": desktopNavigationLabel
|
|
2668
|
+
}
|
|
2669
|
+
) : null,
|
|
2670
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.Box, { style: { flex: 1, minWidth: 0 }, children: header })
|
|
2267
2671
|
] }) }),
|
|
2268
|
-
/* @__PURE__ */ (0,
|
|
2269
|
-
|
|
2672
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.AppShell.Navbar, { p: "md", "data-sticky-sidebar": stickySidebar || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.ScrollArea, { h: "100%", type: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2673
|
+
import_core31.Box,
|
|
2270
2674
|
{
|
|
2271
2675
|
h: "100%",
|
|
2272
2676
|
style: stickySidebar ? {
|
|
@@ -2276,27 +2680,37 @@ function DiscoveryShell({
|
|
|
2276
2680
|
children: sidebar
|
|
2277
2681
|
}
|
|
2278
2682
|
) }) }),
|
|
2279
|
-
footer ? /* @__PURE__ */ (0,
|
|
2280
|
-
/* @__PURE__ */ (0,
|
|
2683
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.AppShell.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_core31.Group, { h: "100%", px: "md", justify: "space-around", wrap: "nowrap", children: footer }) }) : null,
|
|
2684
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2685
|
+
import_core31.AppShell.Main,
|
|
2686
|
+
{
|
|
2687
|
+
onClick: () => {
|
|
2688
|
+
if (isMobile) {
|
|
2689
|
+
close();
|
|
2690
|
+
}
|
|
2691
|
+
},
|
|
2692
|
+
children
|
|
2693
|
+
}
|
|
2694
|
+
)
|
|
2281
2695
|
]
|
|
2282
2696
|
}
|
|
2283
2697
|
);
|
|
2284
2698
|
}
|
|
2285
2699
|
|
|
2286
2700
|
// src/DocsShell.tsx
|
|
2287
|
-
var
|
|
2288
|
-
var
|
|
2289
|
-
var
|
|
2701
|
+
var import_react7 = require("react");
|
|
2702
|
+
var import_core32 = require("@mantine/core");
|
|
2703
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2290
2704
|
function DocsShellSidebar({ primaryNavigation, secondaryNavigation }) {
|
|
2291
|
-
return /* @__PURE__ */ (0,
|
|
2292
|
-
primaryNavigation ? /* @__PURE__ */ (0,
|
|
2293
|
-
/* @__PURE__ */ (0,
|
|
2705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core32.Stack, { gap: "md", h: "100%", children: [
|
|
2706
|
+
primaryNavigation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core32.Stack, { gap: "xs", children: [
|
|
2707
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Text, { size: "xs", fw: 700, c: "dimmed", children: "Primary" }),
|
|
2294
2708
|
primaryNavigation
|
|
2295
2709
|
] }) : null,
|
|
2296
|
-
secondaryNavigation ? /* @__PURE__ */ (0,
|
|
2297
|
-
/* @__PURE__ */ (0,
|
|
2298
|
-
/* @__PURE__ */ (0,
|
|
2299
|
-
/* @__PURE__ */ (0,
|
|
2710
|
+
secondaryNavigation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2711
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Divider, {}),
|
|
2712
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core32.Stack, { gap: "xs", children: [
|
|
2713
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Text, { size: "xs", fw: 700, c: "dimmed", children: "More" }),
|
|
2300
2714
|
secondaryNavigation
|
|
2301
2715
|
] })
|
|
2302
2716
|
] }) : null
|
|
@@ -2320,15 +2734,15 @@ function DocsShell({
|
|
|
2320
2734
|
children,
|
|
2321
2735
|
contentWidth = "full"
|
|
2322
2736
|
}) {
|
|
2323
|
-
const [mobileNavOpen, setMobileNavOpen] = (0,
|
|
2324
|
-
return /* @__PURE__ */ (0,
|
|
2737
|
+
const [mobileNavOpen, setMobileNavOpen] = (0, import_react7.useState)(false);
|
|
2738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2325
2739
|
DiscoveryShell,
|
|
2326
2740
|
{
|
|
2327
|
-
header: /* @__PURE__ */ (0,
|
|
2328
|
-
/* @__PURE__ */ (0,
|
|
2329
|
-
mobileNavigationMode === "inline-collapse" && mobileNavigation ? /* @__PURE__ */ (0,
|
|
2330
|
-
/* @__PURE__ */ (0,
|
|
2331
|
-
|
|
2741
|
+
header: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core32.Group, { h: "100%", justify: "space-between", align: "center", wrap: "nowrap", gap: "md", children: [
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_core32.Group, { gap: "sm", align: "center", wrap: "nowrap", style: { minWidth: 0 }, children: [
|
|
2743
|
+
mobileNavigationMode === "inline-collapse" && mobileNavigation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2744
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2745
|
+
import_core32.Burger,
|
|
2332
2746
|
{
|
|
2333
2747
|
opened: mobileNavOpen,
|
|
2334
2748
|
onClick: () => setMobileNavOpen((value) => !value),
|
|
@@ -2337,14 +2751,14 @@ function DocsShell({
|
|
|
2337
2751
|
"aria-label": "Toggle docs navigation"
|
|
2338
2752
|
}
|
|
2339
2753
|
),
|
|
2340
|
-
/* @__PURE__ */ (0,
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Transition, { mounted: mobileNavOpen, transition: "pop", duration: 120, children: (styles) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Box, { style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Box, { mt: "xs", p: "sm", style: { borderRadius: 8, border: "1px solid var(--mantine-color-default-border)" }, children: mobileNavigation }) }) })
|
|
2341
2755
|
] }) : null,
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2343
|
-
headerContext ? /* @__PURE__ */ (0,
|
|
2756
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Box, { style: { minWidth: 0 }, children: brand }),
|
|
2757
|
+
headerContext ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Text, { size: "sm", c: "dimmed", lineClamp: 1, children: headerContext }) : null
|
|
2344
2758
|
] }),
|
|
2345
|
-
/* @__PURE__ */ (0,
|
|
2759
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Group, { gap: "sm", wrap: "nowrap", style: { minWidth: 0 }, children: actions })
|
|
2346
2760
|
] }),
|
|
2347
|
-
sidebar: /* @__PURE__ */ (0,
|
|
2761
|
+
sidebar: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2348
2762
|
DocsShellSidebar,
|
|
2349
2763
|
{
|
|
2350
2764
|
primaryNavigation,
|
|
@@ -2354,26 +2768,26 @@ function DocsShell({
|
|
|
2354
2768
|
footer,
|
|
2355
2769
|
mobileNavigationLabel: "Open docs navigation",
|
|
2356
2770
|
headerHeight: 72,
|
|
2357
|
-
children: /* @__PURE__ */ (0,
|
|
2771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_core32.Container, { size: resolveContentContainerSize(contentWidth), px: "md", py: "lg", w: "100%", children })
|
|
2358
2772
|
}
|
|
2359
2773
|
);
|
|
2360
2774
|
}
|
|
2361
2775
|
|
|
2362
2776
|
// src/SidebarNav.tsx
|
|
2363
|
-
var
|
|
2364
|
-
var
|
|
2777
|
+
var import_react8 = require("react");
|
|
2778
|
+
var import_core33 = require("@mantine/core");
|
|
2365
2779
|
var import_gds_theme4 = require("@doneisbetter/gds-theme");
|
|
2366
|
-
var
|
|
2780
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2367
2781
|
function SidebarNav({ children, ariaLabel = "Primary navigation", gap = "md" }) {
|
|
2368
|
-
return /* @__PURE__ */ (0,
|
|
2782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core33.Stack, { component: "nav", "aria-label": ariaLabel, gap, h: "100%", children });
|
|
2369
2783
|
}
|
|
2370
2784
|
function SidebarNavSection({ label, children, pushToBottom = false }) {
|
|
2371
|
-
return /* @__PURE__ */ (0,
|
|
2372
|
-
label ? /* @__PURE__ */ (0,
|
|
2373
|
-
/* @__PURE__ */ (0,
|
|
2785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_core33.Stack, { gap: "xs", mt: pushToBottom ? "auto" : void 0, children: [
|
|
2786
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core33.Text, { size: "xs", fw: 700, c: "dimmed", children: label }) : null,
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core33.Stack, { gap: 4, children })
|
|
2374
2788
|
] });
|
|
2375
2789
|
}
|
|
2376
|
-
var _SidebarNavItem = (0,
|
|
2790
|
+
var _SidebarNavItem = (0, import_react8.forwardRef)(
|
|
2377
2791
|
({
|
|
2378
2792
|
action,
|
|
2379
2793
|
label,
|
|
@@ -2389,14 +2803,14 @@ var _SidebarNavItem = (0, import_react6.forwardRef)(
|
|
|
2389
2803
|
const config = action ? resolveSemanticActionConfig(action, vocabularyPacks) : null;
|
|
2390
2804
|
const Icon = config?.icon;
|
|
2391
2805
|
const resolvedLabel = label ?? (action ? getSemanticActionLabel(action, t, vocabularyPacks) : void 0);
|
|
2392
|
-
return /* @__PURE__ */ (0,
|
|
2393
|
-
|
|
2806
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2807
|
+
import_core33.NavLink,
|
|
2394
2808
|
{
|
|
2395
2809
|
ref,
|
|
2396
2810
|
label: resolvedLabel,
|
|
2397
2811
|
description,
|
|
2398
|
-
leftSection: icon ?? (Icon ? /* @__PURE__ */ (0,
|
|
2399
|
-
rightSection: badge ? /* @__PURE__ */ (0,
|
|
2812
|
+
leftSection: icon ?? (Icon ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Icon, { size: "1rem", stroke: 1.5 }) : void 0),
|
|
2813
|
+
rightSection: badge ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_core33.Box, { children: badge }) : props.rightSection,
|
|
2400
2814
|
"aria-label": ariaLabel ?? (typeof resolvedLabel === "string" ? resolvedLabel : void 0),
|
|
2401
2815
|
"aria-current": props.active ? "page" : ariaCurrent,
|
|
2402
2816
|
...props
|
|
@@ -2404,21 +2818,21 @@ var _SidebarNavItem = (0, import_react6.forwardRef)(
|
|
|
2404
2818
|
);
|
|
2405
2819
|
}
|
|
2406
2820
|
);
|
|
2407
|
-
var SidebarNavItem = (0,
|
|
2821
|
+
var SidebarNavItem = (0, import_core33.createPolymorphicComponent)(_SidebarNavItem);
|
|
2408
2822
|
|
|
2409
2823
|
// src/PublicSiteFooter.tsx
|
|
2410
|
-
var
|
|
2411
|
-
var
|
|
2824
|
+
var import_core34 = require("@mantine/core");
|
|
2825
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2412
2826
|
function PublicSiteFooter({ children, meta }) {
|
|
2413
|
-
return /* @__PURE__ */ (0,
|
|
2414
|
-
children ? /* @__PURE__ */ (0,
|
|
2415
|
-
meta ? /* @__PURE__ */ (0,
|
|
2827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_core34.Stack, { component: "footer", gap: "xs", children: [
|
|
2828
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core34.Text, { size: "sm", children }) : null,
|
|
2829
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core34.Group, { gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_core34.Text, { size: "xs", c: "dimmed", children: meta }) }) : null
|
|
2416
2830
|
] });
|
|
2417
2831
|
}
|
|
2418
2832
|
|
|
2419
2833
|
// src/PublicBrandFooter.tsx
|
|
2420
|
-
var
|
|
2421
|
-
var
|
|
2834
|
+
var import_core35 = require("@mantine/core");
|
|
2835
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2422
2836
|
function PublicBrandFooter({
|
|
2423
2837
|
media,
|
|
2424
2838
|
brandTitle,
|
|
@@ -2433,8 +2847,8 @@ function PublicBrandFooter({
|
|
|
2433
2847
|
const mediaSpan = layoutVariant === "immersive-media" ? 5 : 4;
|
|
2434
2848
|
const primarySpan = media ? layoutVariant === "balanced-quote" ? 4 : 4 : secondary ? 6 : 12;
|
|
2435
2849
|
const secondarySpan = media ? Math.max(3, 12 - mediaSpan - primarySpan) : Math.max(4, 12 - primarySpan);
|
|
2436
|
-
return /* @__PURE__ */ (0,
|
|
2437
|
-
|
|
2850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2851
|
+
import_core35.Paper,
|
|
2438
2852
|
{
|
|
2439
2853
|
component: "footer",
|
|
2440
2854
|
withBorder: true,
|
|
@@ -2442,19 +2856,19 @@ function PublicBrandFooter({
|
|
|
2442
2856
|
p: compact ? "lg" : "xl",
|
|
2443
2857
|
className: classNames?.root,
|
|
2444
2858
|
"data-layout-variant": layoutVariant,
|
|
2445
|
-
children: /* @__PURE__ */ (0,
|
|
2446
|
-
/* @__PURE__ */ (0,
|
|
2447
|
-
media ? /* @__PURE__ */ (0,
|
|
2448
|
-
/* @__PURE__ */ (0,
|
|
2449
|
-
brandTitle ? /* @__PURE__ */ (0,
|
|
2450
|
-
description ? /* @__PURE__ */ (0,
|
|
2451
|
-
actions ? /* @__PURE__ */ (0,
|
|
2859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core35.Stack, { gap: "lg", children: [
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core35.Grid, { gutter: compact ? "lg" : "xl", align: "flex-start", children: [
|
|
2861
|
+
media ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Grid.Col, { span: { base: 12, md: mediaSpan }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Box, { className: classNames?.media, children: media }) }) : null,
|
|
2862
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Grid.Col, { span: { base: 12, md: primarySpan }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_core35.Stack, { gap: compact ? "xs" : "sm", className: classNames?.primary, children: [
|
|
2863
|
+
brandTitle ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Title, { order: 4, children: brandTitle }) : null,
|
|
2864
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Text, { c: "dimmed", children: description }) : null,
|
|
2865
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Box, { children: actions }) : null
|
|
2452
2866
|
] }) }),
|
|
2453
|
-
secondary ? /* @__PURE__ */ (0,
|
|
2867
|
+
secondary ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Grid.Col, { span: { base: 12, md: secondarySpan }, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Stack, { gap: compact ? "xs" : "sm", className: classNames?.secondary, children: secondary }) }) : null
|
|
2454
2868
|
] }),
|
|
2455
|
-
legal ? /* @__PURE__ */ (0,
|
|
2456
|
-
/* @__PURE__ */ (0,
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2869
|
+
legal ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Divider, {}),
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Group, { justify: "space-between", gap: "sm", wrap: "wrap", className: classNames?.legal, children: typeof legal === "string" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_core35.Text, { size: "sm", c: "dimmed", children: legal }) : legal })
|
|
2458
2872
|
] }) : null
|
|
2459
2873
|
] })
|
|
2460
2874
|
}
|
|
@@ -2462,8 +2876,8 @@ function PublicBrandFooter({
|
|
|
2462
2876
|
}
|
|
2463
2877
|
|
|
2464
2878
|
// src/AuthShell.tsx
|
|
2465
|
-
var
|
|
2466
|
-
var
|
|
2879
|
+
var import_core36 = require("@mantine/core");
|
|
2880
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2467
2881
|
function AuthShell({
|
|
2468
2882
|
title,
|
|
2469
2883
|
description,
|
|
@@ -2479,37 +2893,37 @@ function AuthShell({
|
|
|
2479
2893
|
dividerLabel = "Or continue with your account",
|
|
2480
2894
|
children
|
|
2481
2895
|
}) {
|
|
2482
|
-
return /* @__PURE__ */ (0,
|
|
2483
|
-
brand || headerActions ? /* @__PURE__ */ (0,
|
|
2484
|
-
brand ? /* @__PURE__ */ (0,
|
|
2485
|
-
headerActions ? /* @__PURE__ */ (0,
|
|
2896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Box, { py: { base: "xl", md: "4rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Container, { size: "xs", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core36.Stack, { gap: "xl", children: [
|
|
2897
|
+
brand || headerActions ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core36.Group, { justify: brand && headerActions ? "space-between" : "center", align: "center", children: [
|
|
2898
|
+
brand ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Box, { children: brand }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Box, {}),
|
|
2899
|
+
headerActions ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Group, { gap: "sm", children: headerActions }) : null
|
|
2486
2900
|
] }) : null,
|
|
2487
|
-
/* @__PURE__ */ (0,
|
|
2488
|
-
/* @__PURE__ */ (0,
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
/* @__PURE__ */ (0,
|
|
2491
|
-
description ? /* @__PURE__ */ (0,
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Card, { withBorder: true, radius: "lg", padding: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core36.Stack, { gap: "lg", children: [
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core36.Stack, { gap: "xs", ta: "center", children: [
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Group, { justify: "center", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Badge, { variant: "light", color: intent === "account-linking" ? "blue" : intent === "guest-entry" ? "gray" : "teal", children: intent.replace("-", " ") }) }),
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Title, { order: 2, children: title }),
|
|
2905
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Text, { c: "dimmed", size: "sm", children: description }) : null
|
|
2492
2906
|
] }),
|
|
2493
|
-
error ? /* @__PURE__ */ (0,
|
|
2494
|
-
socialAuth ? /* @__PURE__ */ (0,
|
|
2495
|
-
socialAuth ? /* @__PURE__ */ (0,
|
|
2907
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Alert, { color: "red", variant: "light", role: "alert", children: error }) : null,
|
|
2908
|
+
socialAuth ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Box, { children: socialAuth }) : null,
|
|
2909
|
+
socialAuth ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Divider, { label: dividerLabel, labelPosition: "center" }) : null,
|
|
2496
2910
|
children,
|
|
2497
|
-
guestAction || supportAction ? /* @__PURE__ */ (0,
|
|
2911
|
+
guestAction || supportAction ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_core36.Group, { justify: "center", gap: "sm", children: [
|
|
2498
2912
|
guestAction,
|
|
2499
2913
|
supportAction
|
|
2500
2914
|
] }) : null,
|
|
2501
|
-
helper ? /* @__PURE__ */ (0,
|
|
2915
|
+
helper ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Text, { size: "sm", c: "dimmed", ta: "center", children: helper }) : null
|
|
2502
2916
|
] }) }),
|
|
2503
|
-
footer ? /* @__PURE__ */ (0,
|
|
2917
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_core36.Text, { size: "sm", c: "dimmed", ta: "center", children: footer }) : null
|
|
2504
2918
|
] }) }) });
|
|
2505
2919
|
}
|
|
2506
2920
|
|
|
2507
2921
|
// src/SocialAuthButtons.tsx
|
|
2508
|
-
var
|
|
2922
|
+
var import_core38 = require("@mantine/core");
|
|
2509
2923
|
|
|
2510
2924
|
// src/ProviderIdentityButtons.tsx
|
|
2511
|
-
var
|
|
2512
|
-
var
|
|
2925
|
+
var import_core37 = require("@mantine/core");
|
|
2926
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2513
2927
|
var PROVIDER_IDENTITY_REGISTRY = {
|
|
2514
2928
|
google: {
|
|
2515
2929
|
providerLabel: "Google",
|
|
@@ -2615,15 +3029,15 @@ function getProviderIdentityPolicy(provider) {
|
|
|
2615
3029
|
}
|
|
2616
3030
|
function ProviderIdentityMark({ provider }) {
|
|
2617
3031
|
const meta = getProviderIdentityMeta(provider);
|
|
2618
|
-
return /* @__PURE__ */ (0,
|
|
2619
|
-
|
|
3032
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3033
|
+
import_core37.ThemeIcon,
|
|
2620
3034
|
{
|
|
2621
3035
|
variant: "light",
|
|
2622
3036
|
color: meta.brandColor,
|
|
2623
3037
|
radius: "xl",
|
|
2624
3038
|
size: "md",
|
|
2625
3039
|
"aria-hidden": "true",
|
|
2626
|
-
children: /* @__PURE__ */ (0,
|
|
3040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { size: "xs", fw: 700, c: "inherit", children: meta.markLabel })
|
|
2627
3041
|
}
|
|
2628
3042
|
);
|
|
2629
3043
|
}
|
|
@@ -2654,8 +3068,8 @@ function ProviderIdentityButton({
|
|
|
2654
3068
|
} : {
|
|
2655
3069
|
onClick
|
|
2656
3070
|
};
|
|
2657
|
-
return /* @__PURE__ */ (0,
|
|
2658
|
-
|
|
3071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3072
|
+
import_core37.Button,
|
|
2659
3073
|
{
|
|
2660
3074
|
variant: mapVariant(variant),
|
|
2661
3075
|
color: variant === "solid" ? meta.brandColor : void 0,
|
|
@@ -2664,17 +3078,17 @@ function ProviderIdentityButton({
|
|
|
2664
3078
|
size,
|
|
2665
3079
|
"aria-label": ariaLabel ?? (typeof buttonLabel === "string" ? buttonLabel : void 0),
|
|
2666
3080
|
"aria-describedby": describedBy,
|
|
2667
|
-
leftSection: /* @__PURE__ */ (0,
|
|
3081
|
+
leftSection: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ProviderIdentityMark, { provider }),
|
|
2668
3082
|
disabled: resolvedDisabled,
|
|
2669
3083
|
loading,
|
|
2670
3084
|
styles: { root: { minHeight: minTouchTargetPx } },
|
|
2671
3085
|
...buttonProps,
|
|
2672
|
-
children: /* @__PURE__ */ (0,
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2674
|
-
description ? /* @__PURE__ */ (0,
|
|
2675
|
-
policyNote ? /* @__PURE__ */ (0,
|
|
2676
|
-
tenantDisabledReason ? /* @__PURE__ */ (0,
|
|
2677
|
-
error ? /* @__PURE__ */ (0,
|
|
3086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_core37.Stack, { gap: 0, align: "flex-start", children: [
|
|
3087
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { inherit: true, children: buttonLabel }),
|
|
3088
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { size: "xs", c: "dimmed", lh: 1.2, children: description }) : null,
|
|
3089
|
+
policyNote ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { size: "xs", c: "dimmed", lh: 1.2, children: policyNote }) : null,
|
|
3090
|
+
tenantDisabledReason ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { size: "xs", c: "orange.7", lh: 1.2, children: tenantDisabledReason }) : null,
|
|
3091
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Text, { size: "xs", c: "red.7", lh: 1.2, role: "alert", children: error }) : null
|
|
2678
3092
|
] })
|
|
2679
3093
|
}
|
|
2680
3094
|
);
|
|
@@ -2685,16 +3099,16 @@ function ProviderIdentityButtonGroup({ providers, layout = "stack" }) {
|
|
|
2685
3099
|
}
|
|
2686
3100
|
const content = providers.map((entry, index) => {
|
|
2687
3101
|
const key = `${normalizeProviderId(String(entry.provider)) || "provider"}-${index}`;
|
|
2688
|
-
return /* @__PURE__ */ (0,
|
|
3102
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ProviderIdentityButton, { ...entry }, key);
|
|
2689
3103
|
});
|
|
2690
3104
|
if (layout === "grid") {
|
|
2691
|
-
return /* @__PURE__ */ (0,
|
|
3105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: content });
|
|
2692
3106
|
}
|
|
2693
|
-
return /* @__PURE__ */ (0,
|
|
3107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_core37.Stack, { gap: "sm", children: content });
|
|
2694
3108
|
}
|
|
2695
3109
|
|
|
2696
3110
|
// src/SocialAuthButtons.tsx
|
|
2697
|
-
var
|
|
3111
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2698
3112
|
function SocialAuthButtons({
|
|
2699
3113
|
providers,
|
|
2700
3114
|
title = "Continue with a trusted provider",
|
|
@@ -2719,43 +3133,43 @@ function SocialAuthButtons({
|
|
|
2719
3133
|
size: provider.size ?? (compact ? "sm" : "md"),
|
|
2720
3134
|
variant: provider.variant
|
|
2721
3135
|
}));
|
|
2722
|
-
return /* @__PURE__ */ (0,
|
|
2723
|
-
/* @__PURE__ */ (0,
|
|
2724
|
-
/* @__PURE__ */ (0,
|
|
2725
|
-
/* @__PURE__ */ (0,
|
|
2726
|
-
/* @__PURE__ */ (0,
|
|
3136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_core38.Stack, { gap: "md", children: [
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_core38.Stack, { gap: 4, ta: "center", children: [
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_core38.Group, { justify: "center", gap: "xs", children: [
|
|
3139
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(GdsIcons.Login, { size: "1rem" }),
|
|
3140
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core38.Text, { fw: 600, children: title })
|
|
2727
3141
|
] }),
|
|
2728
|
-
description ? /* @__PURE__ */ (0,
|
|
3142
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core38.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
2729
3143
|
] }),
|
|
2730
|
-
/* @__PURE__ */ (0,
|
|
2731
|
-
/* @__PURE__ */ (0,
|
|
3144
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_core38.Divider, {}),
|
|
3145
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ProviderIdentityButtonGroup, { providers: buttons, layout })
|
|
2732
3146
|
] });
|
|
2733
3147
|
}
|
|
2734
3148
|
|
|
2735
3149
|
// src/ArticleShell.tsx
|
|
2736
|
-
var
|
|
2737
|
-
var
|
|
3150
|
+
var import_core39 = require("@mantine/core");
|
|
3151
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2738
3152
|
function ArticleShell({ eyebrow, title, lead, meta, sideRail, children }) {
|
|
2739
|
-
return /* @__PURE__ */ (0,
|
|
2740
|
-
/* @__PURE__ */ (0,
|
|
2741
|
-
/* @__PURE__ */ (0,
|
|
2742
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
2743
|
-
/* @__PURE__ */ (0,
|
|
2744
|
-
lead ? /* @__PURE__ */ (0,
|
|
2745
|
-
meta ? /* @__PURE__ */ (0,
|
|
3153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Container, { size: "lg", py: "xl", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_core39.Group, { align: "flex-start", gap: "xl", wrap: "nowrap", children: [
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_core39.Stack, { gap: "lg", maw: 760, flex: 1, children: [
|
|
3155
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_core39.Stack, { gap: "sm", children: [
|
|
3156
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Text, { size: "sm", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Title, { order: 1, children: title }),
|
|
3158
|
+
lead ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Text, { size: "lg", c: "dimmed", children: lead }) : null,
|
|
3159
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Group, { gap: "md", children: meta }) : null
|
|
2746
3160
|
] }),
|
|
2747
|
-
/* @__PURE__ */ (0,
|
|
3161
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Stack, { gap: "md", children })
|
|
2748
3162
|
] }),
|
|
2749
|
-
sideRail ? /* @__PURE__ */ (0,
|
|
3163
|
+
sideRail ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_core39.Stack, { visibleFrom: "lg", gap: "md", w: 240, children: sideRail }) : null
|
|
2750
3164
|
] }) });
|
|
2751
3165
|
}
|
|
2752
3166
|
|
|
2753
3167
|
// src/DocsCodeBlock.tsx
|
|
2754
|
-
var
|
|
2755
|
-
var
|
|
2756
|
-
var
|
|
3168
|
+
var import_react9 = require("react");
|
|
3169
|
+
var import_core40 = require("@mantine/core");
|
|
3170
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2757
3171
|
function DocsCodeBlock({ code, language, title, withCopy = true }) {
|
|
2758
|
-
const [copied, setCopied] = (0,
|
|
3172
|
+
const [copied, setCopied] = (0, import_react9.useState)(false);
|
|
2759
3173
|
const handleCopy = async () => {
|
|
2760
3174
|
if (!navigator?.clipboard) {
|
|
2761
3175
|
return;
|
|
@@ -2764,44 +3178,44 @@ function DocsCodeBlock({ code, language, title, withCopy = true }) {
|
|
|
2764
3178
|
setCopied(true);
|
|
2765
3179
|
window.setTimeout(() => setCopied(false), 1200);
|
|
2766
3180
|
};
|
|
2767
|
-
return /* @__PURE__ */ (0,
|
|
2768
|
-
title || withCopy ? /* @__PURE__ */ (0,
|
|
2769
|
-
/* @__PURE__ */ (0,
|
|
2770
|
-
title ? /* @__PURE__ */ (0,
|
|
2771
|
-
language ? /* @__PURE__ */ (0,
|
|
3181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core40.Paper, { withBorder: true, radius: "lg", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_core40.Stack, { gap: "sm", children: [
|
|
3182
|
+
title || withCopy ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_core40.Group, { justify: "space-between", align: "center", children: [
|
|
3183
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_core40.Stack, { gap: 0, children: [
|
|
3184
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core40.Text, { fw: 600, children: title }) : null,
|
|
3185
|
+
language ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core40.Text, { size: "xs", c: "dimmed", children: language }) : null
|
|
2772
3186
|
] }),
|
|
2773
|
-
withCopy ? /* @__PURE__ */ (0,
|
|
2774
|
-
|
|
3187
|
+
withCopy ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3188
|
+
import_core40.ActionIcon,
|
|
2775
3189
|
{
|
|
2776
3190
|
variant: "subtle",
|
|
2777
3191
|
"aria-label": copied ? "Copied code block" : "Copy code block",
|
|
2778
3192
|
onClick: () => {
|
|
2779
3193
|
void handleCopy();
|
|
2780
3194
|
},
|
|
2781
|
-
children: /* @__PURE__ */ (0,
|
|
3195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(GdsIcons.Copy, { size: "1rem" })
|
|
2782
3196
|
}
|
|
2783
3197
|
) : null
|
|
2784
3198
|
] }) : null,
|
|
2785
|
-
/* @__PURE__ */ (0,
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_core40.Code, { block: true, children: code })
|
|
2786
3200
|
] }) });
|
|
2787
3201
|
}
|
|
2788
3202
|
|
|
2789
3203
|
// src/CtaButtonGroup.tsx
|
|
2790
|
-
var
|
|
2791
|
-
var
|
|
3204
|
+
var import_core41 = require("@mantine/core");
|
|
3205
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2792
3206
|
function CtaButtonGroup({ primary, secondary, tertiary }) {
|
|
2793
|
-
return /* @__PURE__ */ (0,
|
|
2794
|
-
/* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2796
|
-
secondary ? /* @__PURE__ */ (0,
|
|
3207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core41.Stack, { gap: "sm", children: [
|
|
3208
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_core41.Group, { gap: "sm", align: "stretch", children: [
|
|
3209
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: primary }),
|
|
3210
|
+
secondary ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: secondary }) : null
|
|
2797
3211
|
] }),
|
|
2798
|
-
tertiary ? /* @__PURE__ */ (0,
|
|
3212
|
+
tertiary ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { children: tertiary }) : null
|
|
2799
3213
|
] });
|
|
2800
3214
|
}
|
|
2801
3215
|
|
|
2802
3216
|
// src/DocsPageShell.tsx
|
|
2803
|
-
var
|
|
2804
|
-
var
|
|
3217
|
+
var import_core42 = require("@mantine/core");
|
|
3218
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2805
3219
|
function DocsPageShell({
|
|
2806
3220
|
breadcrumbs = [],
|
|
2807
3221
|
title,
|
|
@@ -2812,27 +3226,27 @@ function DocsPageShell({
|
|
|
2812
3226
|
footerNext,
|
|
2813
3227
|
children
|
|
2814
3228
|
}) {
|
|
2815
|
-
return /* @__PURE__ */ (0,
|
|
2816
|
-
/* @__PURE__ */ (0,
|
|
2817
|
-
breadcrumbs.length ? /* @__PURE__ */ (0,
|
|
2818
|
-
(crumb) => crumb.href ? /* @__PURE__ */ (0,
|
|
3229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Container, { fluid: true, py: "xl", px: { base: "md", md: "lg", lg: "xl" }, w: "100%", maw: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core42.Group, { align: "flex-start", gap: "xl", wrap: "nowrap", children: [
|
|
3230
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core42.Stack, { component: "article", gap: "lg", flex: 1, miw: 0, children: [
|
|
3231
|
+
breadcrumbs.length ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Breadcrumbs, { children: breadcrumbs.map(
|
|
3232
|
+
(crumb) => crumb.href ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Anchor, { href: crumb.href, children: crumb.label }, `${crumb.label}-${crumb.href}`) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Text, { children: crumb.label }, crumb.label)
|
|
2819
3233
|
) }) : null,
|
|
2820
|
-
/* @__PURE__ */ (0,
|
|
2821
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
2823
|
-
lead ? /* @__PURE__ */ (0,
|
|
2824
|
-
meta ? /* @__PURE__ */ (0,
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_core42.Stack, { gap: "sm", children: [
|
|
3235
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Text, { size: "sm", fw: 700, c: "dimmed", children: eyebrow }) : null,
|
|
3236
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Title, { order: 1, children: title }),
|
|
3237
|
+
lead ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Text, { size: "lg", c: "dimmed", children: lead }) : null,
|
|
3238
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Group, { gap: "md", children: meta }) : null
|
|
2825
3239
|
] }),
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2827
|
-
footerNext ? /* @__PURE__ */ (0,
|
|
3240
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Stack, { gap: "md", children }),
|
|
3241
|
+
footerNext ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Anchor, { href: footerNext.href, fw: 600, children: footerNext.label }) : null
|
|
2828
3242
|
] }),
|
|
2829
|
-
sideRail ? /* @__PURE__ */ (0,
|
|
3243
|
+
sideRail ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_core42.Stack, { visibleFrom: "lg", gap: "md", w: 240, children: sideRail }) : null
|
|
2830
3244
|
] }) });
|
|
2831
3245
|
}
|
|
2832
3246
|
|
|
2833
3247
|
// src/EditorialHero.tsx
|
|
2834
|
-
var
|
|
2835
|
-
var
|
|
3248
|
+
var import_core43 = require("@mantine/core");
|
|
3249
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2836
3250
|
function resolveActionVariant(action, index, seenPrimary) {
|
|
2837
3251
|
const requested = action.variant ?? (index === 0 ? "primary" : "secondary");
|
|
2838
3252
|
if (requested === "primary" && !seenPrimary) {
|
|
@@ -2844,8 +3258,8 @@ function resolveActionVariant(action, index, seenPrimary) {
|
|
|
2844
3258
|
return { variant: "default", seenPrimary };
|
|
2845
3259
|
}
|
|
2846
3260
|
function HeroAction({ action, variant }) {
|
|
2847
|
-
const content = /* @__PURE__ */ (0,
|
|
2848
|
-
|
|
3261
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3262
|
+
import_core43.Anchor,
|
|
2849
3263
|
{
|
|
2850
3264
|
href: action.href,
|
|
2851
3265
|
onClick: action.onClick,
|
|
@@ -2869,8 +3283,8 @@ function HeroAction({ action, variant }) {
|
|
|
2869
3283
|
}
|
|
2870
3284
|
);
|
|
2871
3285
|
if (!action.href) {
|
|
2872
|
-
return /* @__PURE__ */ (0,
|
|
2873
|
-
|
|
3286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3287
|
+
import_core43.Box,
|
|
2874
3288
|
{
|
|
2875
3289
|
component: "button",
|
|
2876
3290
|
type: "button",
|
|
@@ -2897,30 +3311,30 @@ function HeroAction({ action, variant }) {
|
|
|
2897
3311
|
return content;
|
|
2898
3312
|
}
|
|
2899
3313
|
function LoadingHero({ compact }) {
|
|
2900
|
-
return /* @__PURE__ */ (0,
|
|
2901
|
-
/* @__PURE__ */ (0,
|
|
2902
|
-
/* @__PURE__ */ (0,
|
|
2903
|
-
/* @__PURE__ */ (0,
|
|
2904
|
-
/* @__PURE__ */ (0,
|
|
2905
|
-
/* @__PURE__ */ (0,
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
2907
|
-
/* @__PURE__ */ (0,
|
|
2908
|
-
/* @__PURE__ */ (0,
|
|
3314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Paper, { withBorder: true, radius: "xl", p: compact ? "lg" : "xl", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Grid, { gutter: compact ? "lg" : "xl", align: "center", children: [
|
|
3315
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Stack, { gap: "md", children: [
|
|
3316
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 16, width: 96, radius: "xl" }),
|
|
3317
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 48, width: "90%", radius: "md" }),
|
|
3318
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 18, width: "100%", radius: "md" }),
|
|
3319
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 18, width: "82%", radius: "md" }),
|
|
3320
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Group, { children: [
|
|
3321
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 40, width: 140, radius: "md" }),
|
|
3322
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { height: 40, width: 140, radius: "md" })
|
|
2909
3323
|
] })
|
|
2910
3324
|
] }) }),
|
|
2911
|
-
/* @__PURE__ */ (0,
|
|
3325
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Grid.Col, { span: { base: 12, md: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.AspectRatio, { ratio: 16 / 11, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Skeleton, { radius: "lg" }) }) })
|
|
2912
3326
|
] }) });
|
|
2913
3327
|
}
|
|
2914
3328
|
function MediaFallback() {
|
|
2915
|
-
return /* @__PURE__ */ (0,
|
|
2916
|
-
|
|
3329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.AspectRatio, { ratio: 16 / 11, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3330
|
+
import_core43.ThemeIcon,
|
|
2917
3331
|
{
|
|
2918
3332
|
size: "100%",
|
|
2919
3333
|
radius: "lg",
|
|
2920
3334
|
color: "gray",
|
|
2921
3335
|
variant: "light",
|
|
2922
3336
|
"aria-label": "Hero media is unavailable",
|
|
2923
|
-
children: /* @__PURE__ */ (0,
|
|
3337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(GdsIcons.Gallery, { size: "2.5rem" })
|
|
2924
3338
|
}
|
|
2925
3339
|
) });
|
|
2926
3340
|
}
|
|
@@ -2940,8 +3354,8 @@ function MediaFrame({
|
|
|
2940
3354
|
} else if (mediaFade === "soft-start") {
|
|
2941
3355
|
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%)";
|
|
2942
3356
|
}
|
|
2943
|
-
return /* @__PURE__ */ (0,
|
|
2944
|
-
|
|
3357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3358
|
+
import_core43.Box,
|
|
2945
3359
|
{
|
|
2946
3360
|
component: "figure",
|
|
2947
3361
|
m: 0,
|
|
@@ -2954,9 +3368,9 @@ function MediaFrame({
|
|
|
2954
3368
|
},
|
|
2955
3369
|
"aria-label": mediaAlt,
|
|
2956
3370
|
children: [
|
|
2957
|
-
media ?? /* @__PURE__ */ (0,
|
|
2958
|
-
media && overlayBackground ? /* @__PURE__ */ (0,
|
|
2959
|
-
|
|
3371
|
+
media ?? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MediaFallback, {}),
|
|
3372
|
+
media && overlayBackground ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3373
|
+
import_core43.Box,
|
|
2960
3374
|
{
|
|
2961
3375
|
"aria-hidden": true,
|
|
2962
3376
|
style: {
|
|
@@ -2989,7 +3403,7 @@ function EditorialHero({
|
|
|
2989
3403
|
classNames
|
|
2990
3404
|
}) {
|
|
2991
3405
|
if (loading) {
|
|
2992
|
-
return /* @__PURE__ */ (0,
|
|
3406
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(LoadingHero, { compact });
|
|
2993
3407
|
}
|
|
2994
3408
|
const stackAlign = align === "center" ? "center" : "flex-start";
|
|
2995
3409
|
const textAlign = align === "center" ? "center" : "left";
|
|
@@ -2997,15 +3411,15 @@ function EditorialHero({
|
|
|
2997
3411
|
const renderedActions = actions.slice(0, 3).map((action, index) => {
|
|
2998
3412
|
const resolved = resolveActionVariant(action, index, seenPrimary);
|
|
2999
3413
|
seenPrimary = resolved.seenPrimary;
|
|
3000
|
-
return /* @__PURE__ */ (0,
|
|
3414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(HeroAction, { action, variant: resolved.variant }, `${action.label}-${index}`);
|
|
3001
3415
|
});
|
|
3002
|
-
const textSlot = /* @__PURE__ */ (0,
|
|
3003
|
-
/* @__PURE__ */ (0,
|
|
3004
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3006
|
-
description ? /* @__PURE__ */ (0,
|
|
3416
|
+
const textSlot = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Stack, { gap: compact ? "md" : "lg", justify: "center", h: "100%", className: classNames?.content, children: [
|
|
3417
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Stack, { gap: "sm", align: stackAlign, children: [
|
|
3418
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Text, { size: "sm", fw: 700, c: "dimmed", ta: textAlign, children: eyebrow }) : null,
|
|
3419
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Title, { order: 1, maw: 760, ta: textAlign, children: title }),
|
|
3420
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Text, { size: compact ? "md" : "lg", c: "dimmed", maw: 720, ta: textAlign, children: description }) : null
|
|
3007
3421
|
] }),
|
|
3008
|
-
renderedActions.length ? /* @__PURE__ */ (0,
|
|
3422
|
+
renderedActions.length ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Box, { className: classNames?.actions, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3009
3423
|
CtaButtonGroup,
|
|
3010
3424
|
{
|
|
3011
3425
|
primary: renderedActions[0],
|
|
@@ -3013,8 +3427,8 @@ function EditorialHero({
|
|
|
3013
3427
|
tertiary: renderedActions[2]
|
|
3014
3428
|
}
|
|
3015
3429
|
) }) : null,
|
|
3016
|
-
meta.length ? /* @__PURE__ */ (0,
|
|
3017
|
-
|
|
3430
|
+
meta.length ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Group, { gap: "sm", wrap: "wrap", "aria-label": "Supporting details", className: classNames?.meta, children: meta.map((item) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
3431
|
+
import_core43.Group,
|
|
3018
3432
|
{
|
|
3019
3433
|
gap: 6,
|
|
3020
3434
|
px: "sm",
|
|
@@ -3025,17 +3439,17 @@ function EditorialHero({
|
|
|
3025
3439
|
},
|
|
3026
3440
|
children: [
|
|
3027
3441
|
item.icon,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Text, { size: "sm", c: "dimmed", children: item.label })
|
|
3029
3443
|
]
|
|
3030
3444
|
},
|
|
3031
3445
|
item.id
|
|
3032
3446
|
)) }) : null
|
|
3033
3447
|
] });
|
|
3034
|
-
const mediaSlot = error ? /* @__PURE__ */ (0,
|
|
3035
|
-
const textCol = /* @__PURE__ */ (0,
|
|
3036
|
-
const mediaCol = /* @__PURE__ */ (0,
|
|
3037
|
-
return /* @__PURE__ */ (0,
|
|
3038
|
-
|
|
3448
|
+
const mediaSlot = error ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AccentPanel, { tone: "red", variant: "soft-outline", title: "Media unavailable", children: error }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MediaFrame, { media, mediaAlt, mediaFade, className: classNames?.media });
|
|
3449
|
+
const textCol = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Grid.Col, { span: { base: 12, md: 6 }, order: { base: 1, md: mediaPosition === "left" ? 2 : 1 }, children: textSlot });
|
|
3450
|
+
const mediaCol = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_core43.Grid.Col, { span: { base: 12, md: 6 }, order: { base: 2, md: mediaPosition === "left" ? 1 : 2 }, children: mediaSlot });
|
|
3451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3452
|
+
import_core43.Paper,
|
|
3039
3453
|
{
|
|
3040
3454
|
component: "section",
|
|
3041
3455
|
withBorder: true,
|
|
@@ -3043,7 +3457,7 @@ function EditorialHero({
|
|
|
3043
3457
|
p: compact ? "lg" : "xl",
|
|
3044
3458
|
className: classNames?.root,
|
|
3045
3459
|
style: surfaceVariant === "flat-public" ? { boxShadow: "none" } : void 0,
|
|
3046
|
-
children: /* @__PURE__ */ (0,
|
|
3460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_core43.Grid, { gutter: compact ? "lg" : "xl", align: "center", children: [
|
|
3047
3461
|
textCol,
|
|
3048
3462
|
mediaCol
|
|
3049
3463
|
] })
|
|
@@ -3052,19 +3466,19 @@ function EditorialHero({
|
|
|
3052
3466
|
}
|
|
3053
3467
|
|
|
3054
3468
|
// src/FeatureBand.tsx
|
|
3055
|
-
var
|
|
3056
|
-
var
|
|
3469
|
+
var import_core44 = require("@mantine/core");
|
|
3470
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3057
3471
|
function FeatureBandSkeleton({
|
|
3058
3472
|
columns = 3,
|
|
3059
3473
|
bordered = true,
|
|
3060
3474
|
variant = "default"
|
|
3061
3475
|
}) {
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3063
|
-
/* @__PURE__ */ (0,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
/* @__PURE__ */ (0,
|
|
3067
|
-
/* @__PURE__ */ (0,
|
|
3476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Paper, { withBorder: bordered, radius: "lg", p: variant === "compact" ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_core44.Stack, { gap: "md", children: [
|
|
3477
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Skeleton, { height: variant === "process" ? 28 : 42, width: variant === "process" ? 72 : 42, radius: "xl" }),
|
|
3478
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_core44.Stack, { gap: "xs", children: [
|
|
3479
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Skeleton, { height: 20, width: "75%", radius: "md" }),
|
|
3480
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Skeleton, { height: 14, width: "100%", radius: "md" }),
|
|
3481
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Skeleton, { height: 14, width: "82%", radius: "md" })
|
|
3068
3482
|
] })
|
|
3069
3483
|
] }) }, index)) });
|
|
3070
3484
|
}
|
|
@@ -3077,10 +3491,10 @@ function FeatureBand({
|
|
|
3077
3491
|
variant = "default"
|
|
3078
3492
|
}) {
|
|
3079
3493
|
if (loading) {
|
|
3080
|
-
return /* @__PURE__ */ (0,
|
|
3494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FeatureBandSkeleton, { columns, bordered, variant });
|
|
3081
3495
|
}
|
|
3082
3496
|
if (!items.length) {
|
|
3083
|
-
return emptyState ? /* @__PURE__ */ (0,
|
|
3497
|
+
return emptyState ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, { children: emptyState }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3084
3498
|
EmptyState,
|
|
3085
3499
|
{
|
|
3086
3500
|
title: "No supporting details available",
|
|
@@ -3088,9 +3502,9 @@ function FeatureBand({
|
|
|
3088
3502
|
}
|
|
3089
3503
|
);
|
|
3090
3504
|
}
|
|
3091
|
-
return /* @__PURE__ */ (0,
|
|
3092
|
-
variant === "process" ? /* @__PURE__ */ (0,
|
|
3093
|
-
|
|
3505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Box, { component: "section", "aria-label": "Supporting features", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.SimpleGrid, { cols: { base: 1, sm: Math.min(columns, 2), lg: columns }, spacing: "lg", children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Paper, { withBorder: bordered, radius: "lg", p: variant === "compact" ? "md" : "lg", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_core44.Stack, { gap: "md", children: [
|
|
3506
|
+
variant === "process" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3507
|
+
import_core44.Text,
|
|
3094
3508
|
{
|
|
3095
3509
|
fw: 800,
|
|
3096
3510
|
size: "sm",
|
|
@@ -3102,18 +3516,18 @@ function FeatureBand({
|
|
|
3102
3516
|
},
|
|
3103
3517
|
children: item.stepLabel ?? `Step ${index + 1}`
|
|
3104
3518
|
}
|
|
3105
|
-
) }) : item.media ? item.media : item.icon ? /* @__PURE__ */ (0,
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3107
|
-
/* @__PURE__ */ (0,
|
|
3108
|
-
item.description ? /* @__PURE__ */ (0,
|
|
3109
|
-
item.meta ? /* @__PURE__ */ (0,
|
|
3519
|
+
) }) : item.media ? item.media : item.icon ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.ThemeIcon, { size: "xl", radius: "xl", variant: "light", color: "violet", children: item.icon }) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.ThemeIcon, { size: "xl", radius: "xl", variant: "light", color: "gray", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GdsIcons.Info, { size: "1.25rem" }) }) }),
|
|
3520
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_core44.Stack, { gap: "xs", children: [
|
|
3521
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Title, { order: 4, children: item.title }),
|
|
3522
|
+
item.description ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Text, { c: "dimmed", children: item.description }) : null,
|
|
3523
|
+
item.meta ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_core44.Text, { size: "sm", c: "dimmed", children: item.meta }) : null
|
|
3110
3524
|
] })
|
|
3111
3525
|
] }) }, item.id)) }) });
|
|
3112
3526
|
}
|
|
3113
3527
|
|
|
3114
3528
|
// src/MapPanel.tsx
|
|
3115
|
-
var
|
|
3116
|
-
var
|
|
3529
|
+
var import_core45 = require("@mantine/core");
|
|
3530
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3117
3531
|
function MapPanel({
|
|
3118
3532
|
title,
|
|
3119
3533
|
description,
|
|
@@ -3129,7 +3543,7 @@ function MapPanel({
|
|
|
3129
3543
|
}) {
|
|
3130
3544
|
let body;
|
|
3131
3545
|
if (loading) {
|
|
3132
|
-
body = /* @__PURE__ */ (0,
|
|
3546
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3133
3547
|
StateBlock,
|
|
3134
3548
|
{
|
|
3135
3549
|
variant: "loading",
|
|
@@ -3139,9 +3553,9 @@ function MapPanel({
|
|
|
3139
3553
|
}
|
|
3140
3554
|
);
|
|
3141
3555
|
} else if (error) {
|
|
3142
|
-
body = /* @__PURE__ */ (0,
|
|
3556
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(StateBlock, { variant: "error", title: "Map unavailable", description: error, compact: true });
|
|
3143
3557
|
} else if (!iframeSrc && !renderMap) {
|
|
3144
|
-
body = /* @__PURE__ */ (0,
|
|
3558
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3145
3559
|
StateBlock,
|
|
3146
3560
|
{
|
|
3147
3561
|
variant: "empty",
|
|
@@ -3151,9 +3565,9 @@ function MapPanel({
|
|
|
3151
3565
|
}
|
|
3152
3566
|
);
|
|
3153
3567
|
} else if (renderMap) {
|
|
3154
|
-
body = /* @__PURE__ */ (0,
|
|
3568
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core45.Box, { style: { minHeight }, children: renderMap() });
|
|
3155
3569
|
} else {
|
|
3156
|
-
body = /* @__PURE__ */ (0,
|
|
3570
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core45.AspectRatio, { ratio: 16 / 9, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3157
3571
|
"iframe",
|
|
3158
3572
|
{
|
|
3159
3573
|
src: iframeSrc,
|
|
@@ -3165,21 +3579,21 @@ function MapPanel({
|
|
|
3165
3579
|
}
|
|
3166
3580
|
) });
|
|
3167
3581
|
}
|
|
3168
|
-
return /* @__PURE__ */ (0,
|
|
3169
|
-
/* @__PURE__ */ (0,
|
|
3170
|
-
/* @__PURE__ */ (0,
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3172
|
-
description ? /* @__PURE__ */ (0,
|
|
3582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core45.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_core45.Stack, { gap: "md", children: [
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_core45.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
3584
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_core45.Stack, { gap: 4, children: [
|
|
3585
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core45.Title, { order: 3, children: title }),
|
|
3586
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_core45.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
3173
3587
|
] }),
|
|
3174
|
-
actions ? /* @__PURE__ */ (0,
|
|
3588
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ActionBar, { ...actions }) : null
|
|
3175
3589
|
] }),
|
|
3176
3590
|
body
|
|
3177
3591
|
] }) });
|
|
3178
3592
|
}
|
|
3179
3593
|
|
|
3180
3594
|
// src/PublicFlowShell.tsx
|
|
3181
|
-
var
|
|
3182
|
-
var
|
|
3595
|
+
var import_core46 = require("@mantine/core");
|
|
3596
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3183
3597
|
var stageTone = {
|
|
3184
3598
|
idle: { label: "Idle", color: "gray" },
|
|
3185
3599
|
loading: { label: "Loading", color: "blue" },
|
|
@@ -3231,7 +3645,7 @@ function PublicFlowShell({
|
|
|
3231
3645
|
const actionBar = toActionBar(stage.actions);
|
|
3232
3646
|
let body = stage.body;
|
|
3233
3647
|
if (stage.status === "loading") {
|
|
3234
|
-
body = /* @__PURE__ */ (0,
|
|
3648
|
+
body = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3235
3649
|
StateBlock,
|
|
3236
3650
|
{
|
|
3237
3651
|
variant: "loading",
|
|
@@ -3240,7 +3654,7 @@ function PublicFlowShell({
|
|
|
3240
3654
|
}
|
|
3241
3655
|
);
|
|
3242
3656
|
} else if (stage.status === "error") {
|
|
3243
|
-
body = errorState ?? /* @__PURE__ */ (0,
|
|
3657
|
+
body = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3244
3658
|
StateBlock,
|
|
3245
3659
|
{
|
|
3246
3660
|
variant: "error",
|
|
@@ -3249,7 +3663,7 @@ function PublicFlowShell({
|
|
|
3249
3663
|
}
|
|
3250
3664
|
);
|
|
3251
3665
|
} else if (!stage.body && !hardwareSurface) {
|
|
3252
|
-
body = emptyState ?? /* @__PURE__ */ (0,
|
|
3666
|
+
body = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
3253
3667
|
EmptyState,
|
|
3254
3668
|
{
|
|
3255
3669
|
title: "No stage content available",
|
|
@@ -3257,29 +3671,29 @@ function PublicFlowShell({
|
|
|
3257
3671
|
}
|
|
3258
3672
|
);
|
|
3259
3673
|
}
|
|
3260
|
-
return /* @__PURE__ */ (0,
|
|
3261
|
-
/* @__PURE__ */ (0,
|
|
3262
|
-
/* @__PURE__ */ (0,
|
|
3263
|
-
eyebrow ? /* @__PURE__ */ (0,
|
|
3264
|
-
/* @__PURE__ */ (0,
|
|
3265
|
-
/* @__PURE__ */ (0,
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core46.Stack, { gap: "lg", children: [
|
|
3675
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core46.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core46.Stack, { gap: 4, children: [
|
|
3677
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Text, { size: "xs", fw: 700, c: "dimmed", tt: "uppercase", children: eyebrow }) : null,
|
|
3678
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_core46.Group, { gap: "sm", wrap: "wrap", children: [
|
|
3679
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Title, { order: 2, children: stage.title }),
|
|
3680
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Badge, { variant: "light", color: tone.color, children: tone.label })
|
|
3267
3681
|
] }),
|
|
3268
|
-
stage.description ? /* @__PURE__ */ (0,
|
|
3682
|
+
stage.description ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Text, { size: "sm", c: "dimmed", children: stage.description }) : null
|
|
3269
3683
|
] }),
|
|
3270
3684
|
exitAction
|
|
3271
3685
|
] }),
|
|
3272
|
-
stage.notice ? /* @__PURE__ */ (0,
|
|
3686
|
+
stage.notice ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_core46.Text, { size: "sm", c: "dimmed", children: stage.notice }) : null,
|
|
3273
3687
|
body,
|
|
3274
3688
|
hardwareSurface,
|
|
3275
3689
|
stage.aside,
|
|
3276
|
-
actionBar ? /* @__PURE__ */ (0,
|
|
3690
|
+
actionBar ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ActionBar, { ...actionBar }) : null
|
|
3277
3691
|
] }) });
|
|
3278
3692
|
}
|
|
3279
3693
|
|
|
3280
3694
|
// src/PlaybackSurface.tsx
|
|
3281
|
-
var
|
|
3282
|
-
var
|
|
3695
|
+
var import_core47 = require("@mantine/core");
|
|
3696
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3283
3697
|
var stateTone = {
|
|
3284
3698
|
loading: { label: "Loading", color: "blue" },
|
|
3285
3699
|
ready: { label: "Ready", color: "teal" },
|
|
@@ -3302,7 +3716,7 @@ function PlaybackSurface({
|
|
|
3302
3716
|
const tone = stateTone[state];
|
|
3303
3717
|
let content;
|
|
3304
3718
|
if (state === "loading") {
|
|
3305
|
-
content = /* @__PURE__ */ (0,
|
|
3719
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3306
3720
|
StateBlock,
|
|
3307
3721
|
{
|
|
3308
3722
|
variant: "loading",
|
|
@@ -3311,7 +3725,7 @@ function PlaybackSurface({
|
|
|
3311
3725
|
}
|
|
3312
3726
|
);
|
|
3313
3727
|
} else if (state === "empty") {
|
|
3314
|
-
content = emptyState ?? /* @__PURE__ */ (0,
|
|
3728
|
+
content = emptyState ?? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3315
3729
|
EmptyState,
|
|
3316
3730
|
{
|
|
3317
3731
|
title: "No playback content available",
|
|
@@ -3319,7 +3733,7 @@ function PlaybackSurface({
|
|
|
3319
3733
|
}
|
|
3320
3734
|
);
|
|
3321
3735
|
} else if (state === "error") {
|
|
3322
|
-
content = errorState ?? /* @__PURE__ */ (0,
|
|
3736
|
+
content = errorState ?? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3323
3737
|
StateBlock,
|
|
3324
3738
|
{
|
|
3325
3739
|
variant: "error",
|
|
@@ -3328,23 +3742,23 @@ function PlaybackSurface({
|
|
|
3328
3742
|
}
|
|
3329
3743
|
);
|
|
3330
3744
|
} else {
|
|
3331
|
-
content = /* @__PURE__ */ (0,
|
|
3745
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core47.Stack, { gap: "md", children: [
|
|
3332
3746
|
media,
|
|
3333
3747
|
overlays
|
|
3334
3748
|
] });
|
|
3335
3749
|
}
|
|
3336
|
-
return /* @__PURE__ */ (0,
|
|
3337
|
-
title || statusMessage || controls ? /* @__PURE__ */ (0,
|
|
3338
|
-
/* @__PURE__ */ (0,
|
|
3339
|
-
title ? /* @__PURE__ */ (0,
|
|
3340
|
-
statusMessage ? /* @__PURE__ */ (0,
|
|
3750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core47.Paper, { withBorder: true, radius: "xl", p: "lg", "data-playback-mode": mode, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core47.Stack, { gap: "md", children: [
|
|
3751
|
+
title || statusMessage || controls ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core47.Group, { justify: "space-between", align: "flex-start", gap: "md", wrap: "wrap", children: [
|
|
3752
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core47.Stack, { gap: 4, children: [
|
|
3753
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core47.Title, { order: 3, children: title }) : null,
|
|
3754
|
+
statusMessage ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core47.Text, { size: "sm", c: "dimmed", children: statusMessage }) : null
|
|
3341
3755
|
] }),
|
|
3342
|
-
/* @__PURE__ */ (0,
|
|
3343
|
-
/* @__PURE__ */ (0,
|
|
3756
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_core47.Group, { gap: "sm", align: "center", wrap: "wrap", children: [
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_core47.Badge, { variant: "light", color: tone.color, children: tone.label }),
|
|
3344
3758
|
controls
|
|
3345
3759
|
] })
|
|
3346
3760
|
] }) : null,
|
|
3347
|
-
state === "degraded" ? /* @__PURE__ */ (0,
|
|
3761
|
+
state === "degraded" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3348
3762
|
StateBlock,
|
|
3349
3763
|
{
|
|
3350
3764
|
variant: "info",
|
|
@@ -3358,9 +3772,9 @@ function PlaybackSurface({
|
|
|
3358
3772
|
}
|
|
3359
3773
|
|
|
3360
3774
|
// src/ShareButtonGroup.tsx
|
|
3361
|
-
var
|
|
3362
|
-
var
|
|
3363
|
-
var
|
|
3775
|
+
var import_react10 = require("react");
|
|
3776
|
+
var import_core48 = require("@mantine/core");
|
|
3777
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3364
3778
|
var channelLabels = {
|
|
3365
3779
|
native: "Share",
|
|
3366
3780
|
copy: "Copy link",
|
|
@@ -3395,9 +3809,9 @@ function ShareAction({
|
|
|
3395
3809
|
const label = channelLabels[channel];
|
|
3396
3810
|
const Icon = channel === "copy" ? GdsIcons.Copy : channel === "mail" ? GdsIcons.Mail : channel === "message" ? GdsIcons.Message : GdsIcons.Refer;
|
|
3397
3811
|
if (compact) {
|
|
3398
|
-
return href ? /* @__PURE__ */ (0,
|
|
3812
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.ActionIcon, { component: "a", href, target: "_blank", rel: "noreferrer", variant: "subtle", size: "lg", "aria-label": label, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { size: "1rem", stroke: 1.75 }) }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.ActionIcon, { variant: "subtle", size: "lg", "aria-label": label, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { size: "1rem", stroke: 1.75 }) });
|
|
3399
3813
|
}
|
|
3400
|
-
return href ? /* @__PURE__ */ (0,
|
|
3814
|
+
return href ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Button, { component: "a", href, target: "_blank", rel: "noreferrer", variant: "default", leftSection: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { size: "1rem", stroke: 1.75 }), children: label }) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Button, { variant: "default", leftSection: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(Icon, { size: "1rem", stroke: 1.75 }), onClick, children: label });
|
|
3401
3815
|
}
|
|
3402
3816
|
function ShareButtonGroup({
|
|
3403
3817
|
url,
|
|
@@ -3408,8 +3822,8 @@ function ShareButtonGroup({
|
|
|
3408
3822
|
label = "Share this",
|
|
3409
3823
|
description
|
|
3410
3824
|
}) {
|
|
3411
|
-
const [copied, setCopied] = (0,
|
|
3412
|
-
const [shared, setShared] = (0,
|
|
3825
|
+
const [copied, setCopied] = (0, import_react10.useState)(false);
|
|
3826
|
+
const [shared, setShared] = (0, import_react10.useState)(false);
|
|
3413
3827
|
const hrefs = encodeShare(url, title, text);
|
|
3414
3828
|
async function handleCopy() {
|
|
3415
3829
|
await navigator.clipboard?.writeText?.(url);
|
|
@@ -3425,29 +3839,29 @@ function ShareButtonGroup({
|
|
|
3425
3839
|
}
|
|
3426
3840
|
await handleCopy();
|
|
3427
3841
|
}
|
|
3428
|
-
return /* @__PURE__ */ (0,
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3430
|
-
/* @__PURE__ */ (0,
|
|
3431
|
-
description ? /* @__PURE__ */ (0,
|
|
3842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_core48.Stack, { gap: "sm", children: [
|
|
3843
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_core48.Stack, { gap: 2, children: [
|
|
3844
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Text, { fw: 600, children: label }),
|
|
3845
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
3432
3846
|
] }),
|
|
3433
|
-
/* @__PURE__ */ (0,
|
|
3847
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Group, { gap: "sm", wrap: "wrap", children: channels.map((channel) => {
|
|
3434
3848
|
if (channel === "copy") {
|
|
3435
|
-
return /* @__PURE__ */ (0,
|
|
3849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ShareAction, { channel, compact, onClick: () => void handleCopy() }, channel);
|
|
3436
3850
|
}
|
|
3437
3851
|
if (channel === "native") {
|
|
3438
|
-
return /* @__PURE__ */ (0,
|
|
3852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ShareAction, { channel, compact, onClick: () => void handleNativeShare() }, channel);
|
|
3439
3853
|
}
|
|
3440
|
-
return /* @__PURE__ */ (0,
|
|
3854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(ShareAction, { channel, compact, href: hrefs[channel] }, channel);
|
|
3441
3855
|
}) }),
|
|
3442
|
-
copied ? /* @__PURE__ */ (0,
|
|
3443
|
-
shared ? /* @__PURE__ */ (0,
|
|
3856
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Text, { size: "sm", c: "teal", children: "Link copied." }) : null,
|
|
3857
|
+
shared ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_core48.Text, { size: "sm", c: "teal", children: "Share sheet opened." }) : null
|
|
3444
3858
|
] });
|
|
3445
3859
|
}
|
|
3446
3860
|
|
|
3447
3861
|
// src/UploadDropzone.tsx
|
|
3448
|
-
var
|
|
3449
|
-
var
|
|
3450
|
-
var
|
|
3862
|
+
var import_react11 = require("react");
|
|
3863
|
+
var import_core49 = require("@mantine/core");
|
|
3864
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3451
3865
|
function UploadDropzone({
|
|
3452
3866
|
title,
|
|
3453
3867
|
description,
|
|
@@ -3466,8 +3880,8 @@ function UploadDropzone({
|
|
|
3466
3880
|
removeAction,
|
|
3467
3881
|
readonly = false
|
|
3468
3882
|
}) {
|
|
3469
|
-
const inputRef = (0,
|
|
3470
|
-
const [dragging, setDragging] = (0,
|
|
3883
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
3884
|
+
const [dragging, setDragging] = (0, import_react11.useState)(false);
|
|
3471
3885
|
const UploadIcon = GdsIcons.Upload;
|
|
3472
3886
|
const effectiveState = readonly ? "readonly" : dragging ? "drag-active" : state;
|
|
3473
3887
|
const isDisabled = readonly || effectiveState === "upload-pending";
|
|
@@ -3478,8 +3892,8 @@ function UploadDropzone({
|
|
|
3478
3892
|
}
|
|
3479
3893
|
onFilesSelected(Array.from(files));
|
|
3480
3894
|
};
|
|
3481
|
-
return /* @__PURE__ */ (0,
|
|
3482
|
-
|
|
3895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
3896
|
+
import_core49.Box,
|
|
3483
3897
|
{
|
|
3484
3898
|
onDragOver: (event) => {
|
|
3485
3899
|
event.preventDefault();
|
|
@@ -3502,7 +3916,7 @@ function UploadDropzone({
|
|
|
3502
3916
|
},
|
|
3503
3917
|
"aria-invalid": isError || void 0,
|
|
3504
3918
|
children: [
|
|
3505
|
-
/* @__PURE__ */ (0,
|
|
3919
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3506
3920
|
"input",
|
|
3507
3921
|
{
|
|
3508
3922
|
ref: inputRef,
|
|
@@ -3514,23 +3928,23 @@ function UploadDropzone({
|
|
|
3514
3928
|
onChange: (event) => forwardFiles(event.currentTarget.files)
|
|
3515
3929
|
}
|
|
3516
3930
|
),
|
|
3517
|
-
/* @__PURE__ */ (0,
|
|
3518
|
-
/* @__PURE__ */ (0,
|
|
3519
|
-
/* @__PURE__ */ (0,
|
|
3520
|
-
/* @__PURE__ */ (0,
|
|
3521
|
-
description ? /* @__PURE__ */ (0,
|
|
3522
|
-
acceptedTypesLabel || maxSizeLabel ? /* @__PURE__ */ (0,
|
|
3523
|
-
acceptedTypesLabel ? /* @__PURE__ */ (0,
|
|
3524
|
-
maxSizeLabel ? /* @__PURE__ */ (0,
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_core49.Stack, { align: mode === "inline" ? "flex-start" : "center", ta: mode === "inline" ? "left" : "center", gap: "sm", children: [
|
|
3932
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UploadIcon, { size: "1.5rem" }),
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Badge, { variant: "light", color: isError ? "red" : effectiveState === "selected" ? "blue" : effectiveState === "upload-pending" ? "violet" : "gray", children: effectiveState.replace("-", " ") }),
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Text, { fw: 600, children: title }),
|
|
3935
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
3936
|
+
acceptedTypesLabel || maxSizeLabel ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_core49.Group, { gap: "xs", justify: mode === "inline" ? "flex-start" : "center", children: [
|
|
3937
|
+
acceptedTypesLabel ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Badge, { variant: "outline", color: "gray", children: acceptedTypesLabel }) : null,
|
|
3938
|
+
maxSizeLabel ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Badge, { variant: "outline", color: "gray", children: maxSizeLabel }) : null
|
|
3525
3939
|
] }) : null,
|
|
3526
|
-
selectedFiles.length ? /* @__PURE__ */ (0,
|
|
3940
|
+
selectedFiles.length ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_core49.Text, { size: "sm", children: [
|
|
3527
3941
|
"Selected: ",
|
|
3528
3942
|
selectedFiles.join(", ")
|
|
3529
3943
|
] }) : null,
|
|
3530
|
-
policyText ? /* @__PURE__ */ (0,
|
|
3531
|
-
error ? /* @__PURE__ */ (0,
|
|
3532
|
-
/* @__PURE__ */ (0,
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
3944
|
+
policyText ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Text, { size: "sm", c: isError ? "red.7" : "dimmed", children: policyText }) : null,
|
|
3945
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Text, { size: "sm", c: "red.7", role: "alert", children: error }) : null,
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_core49.Group, { children: [
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_core49.Button, { variant: "light", onClick: () => inputRef.current?.click(), disabled: isDisabled, children: actionLabel }),
|
|
3534
3948
|
retryAction,
|
|
3535
3949
|
removeAction
|
|
3536
3950
|
] })
|
|
@@ -3541,8 +3955,8 @@ function UploadDropzone({
|
|
|
3541
3955
|
}
|
|
3542
3956
|
|
|
3543
3957
|
// src/MediaField.tsx
|
|
3544
|
-
var
|
|
3545
|
-
var
|
|
3958
|
+
var import_core50 = require("@mantine/core");
|
|
3959
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3546
3960
|
var stateLabels = {
|
|
3547
3961
|
empty: { label: "Empty", color: "gray" },
|
|
3548
3962
|
"drag-active": { label: "Drop to select", color: "violet" },
|
|
@@ -3583,44 +3997,44 @@ function MediaField({
|
|
|
3583
3997
|
}) {
|
|
3584
3998
|
const resolvedState = readonly ? "readonly" : state;
|
|
3585
3999
|
const stateBadge = stateLabels[resolvedState];
|
|
3586
|
-
const resolvedRemoveAction = removeAction ?? (!readonly && onRemove ? /* @__PURE__ */ (0,
|
|
3587
|
-
const resolvedResetAction = resetAction ?? (!readonly && onReset ? /* @__PURE__ */ (0,
|
|
4000
|
+
const resolvedRemoveAction = removeAction ?? (!readonly && onRemove ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Button, { type: "button", variant: "light", color: "red", onClick: onRemove, children: "Remove" }) : null);
|
|
4001
|
+
const resolvedResetAction = resetAction ?? (!readonly && onReset ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Button, { type: "button", variant: "default", onClick: onReset, children: "Reset" }) : null);
|
|
3588
4002
|
const boundedProgress = typeof progress === "number" ? Math.max(0, Math.min(100, progress)) : void 0;
|
|
3589
|
-
return /* @__PURE__ */ (0,
|
|
4003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3590
4004
|
FormField,
|
|
3591
4005
|
{
|
|
3592
4006
|
label,
|
|
3593
4007
|
description,
|
|
3594
4008
|
error,
|
|
3595
|
-
children: /* @__PURE__ */ (0,
|
|
3596
|
-
/* @__PURE__ */ (0,
|
|
3597
|
-
/* @__PURE__ */ (0,
|
|
4009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Stack, { gap: "md", children: [
|
|
4010
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Group, { justify: "flex-end", align: "center", gap: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Group, { gap: "xs", justify: "flex-end", children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Badge, { variant: "light", color: stateBadge.color, children: stateBadge.label }),
|
|
3598
4012
|
statusAction
|
|
3599
4013
|
] }) }),
|
|
3600
4014
|
preview ? preview : null,
|
|
3601
|
-
typeof boundedProgress === "number" ? /* @__PURE__ */ (0,
|
|
3602
|
-
/* @__PURE__ */ (0,
|
|
3603
|
-
/* @__PURE__ */ (0,
|
|
4015
|
+
typeof boundedProgress === "number" ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Stack, { gap: 4, children: [
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Progress, { value: boundedProgress, "aria-label": "Upload progress" }),
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Text, { size: "xs", c: "dimmed", children: [
|
|
3604
4018
|
boundedProgress,
|
|
3605
4019
|
"% complete"
|
|
3606
4020
|
] })
|
|
3607
4021
|
] }) : null,
|
|
3608
|
-
(uploadControl || urlInput) && !readonly ? /* @__PURE__ */ (0,
|
|
3609
|
-
/* @__PURE__ */ (0,
|
|
3610
|
-
/* @__PURE__ */ (0,
|
|
4022
|
+
(uploadControl || urlInput) && !readonly ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Divider, {}),
|
|
4024
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Stack, { gap: "sm", style: mode === "split" ? { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))" } : void 0, children: [
|
|
3611
4025
|
uploadControl,
|
|
3612
4026
|
urlInput
|
|
3613
4027
|
] })
|
|
3614
4028
|
] }) : null,
|
|
3615
|
-
value ? /* @__PURE__ */ (0,
|
|
3616
|
-
helpText ? /* @__PURE__ */ (0,
|
|
3617
|
-
acceptedTypes || maxSize ? /* @__PURE__ */ (0,
|
|
3618
|
-
acceptedTypes ? /* @__PURE__ */ (0,
|
|
3619
|
-
maxSize ? /* @__PURE__ */ (0,
|
|
4029
|
+
value ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Text, { size: "sm", c: "dimmed", style: { wordBreak: "break-all" }, children: value }) : null,
|
|
4030
|
+
helpText ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Text, { size: "sm", c: "dimmed", children: helpText }) : null,
|
|
4031
|
+
acceptedTypes || maxSize ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Group, { gap: "xs", wrap: "wrap", children: [
|
|
4032
|
+
acceptedTypes ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Badge, { variant: "outline", color: "gray", children: acceptedTypes }) : null,
|
|
4033
|
+
maxSize ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Badge, { variant: "outline", color: "gray", children: maxSize }) : null
|
|
3620
4034
|
] }) : null,
|
|
3621
|
-
policyText ? /* @__PURE__ */ (0,
|
|
4035
|
+
policyText ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_core50.Text, { size: "sm", c: error ? "red.7" : "dimmed", children: policyText }) : null,
|
|
3622
4036
|
typeof error !== "string" && error ? error : null,
|
|
3623
|
-
replaceAction || resolvedRemoveAction || resolvedResetAction || retryAction ? /* @__PURE__ */ (0,
|
|
4037
|
+
replaceAction || resolvedRemoveAction || resolvedResetAction || retryAction ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_core50.Group, { gap: "sm", children: [
|
|
3624
4038
|
replaceAction,
|
|
3625
4039
|
resolvedResetAction,
|
|
3626
4040
|
retryAction,
|
|
@@ -3632,31 +4046,31 @@ function MediaField({
|
|
|
3632
4046
|
}
|
|
3633
4047
|
|
|
3634
4048
|
// src/MediaCard.tsx
|
|
3635
|
-
var
|
|
3636
|
-
var
|
|
4049
|
+
var import_core51 = require("@mantine/core");
|
|
4050
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3637
4051
|
function MediaCard({ title, image, description, status, overlay, actions = [] }) {
|
|
3638
4052
|
const EyeIcon = GdsIcons.Eye;
|
|
3639
|
-
return /* @__PURE__ */ (0,
|
|
3640
|
-
/* @__PURE__ */ (0,
|
|
4053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_core51.Card, { withBorder: true, radius: "lg", padding: "md", children: [
|
|
4054
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_core51.Card.Section, { pos: "relative", children: [
|
|
3641
4055
|
image,
|
|
3642
|
-
overlay ? /* @__PURE__ */ (0,
|
|
4056
|
+
overlay ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { style: { position: "absolute", inset: 12, display: "flex", justifyContent: "flex-end", alignItems: "flex-start" }, children: overlay }) : null
|
|
3643
4057
|
] }),
|
|
3644
|
-
/* @__PURE__ */ (0,
|
|
3645
|
-
/* @__PURE__ */ (0,
|
|
3646
|
-
/* @__PURE__ */ (0,
|
|
3647
|
-
/* @__PURE__ */ (0,
|
|
3648
|
-
description ? /* @__PURE__ */ (0,
|
|
4058
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_core51.Stack, { gap: "sm", mt: "md", children: [
|
|
4059
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_core51.Group, { justify: "space-between", align: "flex-start", children: [
|
|
4060
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_core51.Stack, { gap: 4, children: [
|
|
4061
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_core51.Title, { order: 4, children: title }),
|
|
4062
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_core51.Text, { size: "sm", c: "dimmed", lineClamp: 2, children: description }) : null
|
|
3649
4063
|
] }),
|
|
3650
|
-
status ? /* @__PURE__ */ (0,
|
|
4064
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_core51.Badge, { variant: "light", children: status }) : null
|
|
3651
4065
|
] }),
|
|
3652
|
-
actions.length ? /* @__PURE__ */ (0,
|
|
4066
|
+
actions.length ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_core51.Group, { justify: "flex-end", gap: "xs", children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_core51.ActionIcon, { variant: "light", "aria-label": action.label, onClick: action.onClick, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(EyeIcon, { size: "1rem" }) }, action.label)) }) : null
|
|
3653
4067
|
] })
|
|
3654
4068
|
] });
|
|
3655
4069
|
}
|
|
3656
4070
|
|
|
3657
4071
|
// src/AccessSummary.tsx
|
|
3658
|
-
var
|
|
3659
|
-
var
|
|
4072
|
+
var import_core52 = require("@mantine/core");
|
|
4073
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3660
4074
|
var accessStateMeta = {
|
|
3661
4075
|
allowed: { label: "Allowed", color: "teal" },
|
|
3662
4076
|
blocked: { label: "Blocked", color: "red" },
|
|
@@ -3667,29 +4081,29 @@ var accessStateMeta = {
|
|
|
3667
4081
|
function AccessSummary({ title, roles, scope, blocked = false, state, owner, recoveryHint, description }) {
|
|
3668
4082
|
const resolvedState = state ?? (blocked ? "blocked" : "allowed");
|
|
3669
4083
|
const meta = accessStateMeta[resolvedState];
|
|
3670
|
-
return /* @__PURE__ */ (0,
|
|
3671
|
-
/* @__PURE__ */ (0,
|
|
3672
|
-
/* @__PURE__ */ (0,
|
|
3673
|
-
/* @__PURE__ */ (0,
|
|
4084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Card, { withBorder: true, radius: "lg", padding: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_core52.Stack, { gap: "sm", children: [
|
|
4085
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_core52.Group, { justify: "space-between", align: "center", children: [
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Title, { order: 4, children: title }),
|
|
4087
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Badge, { color: meta.color, variant: "light", children: meta.label })
|
|
3674
4088
|
] }),
|
|
3675
|
-
/* @__PURE__ */ (0,
|
|
3676
|
-
scope ? /* @__PURE__ */ (0,
|
|
4089
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Group, { gap: "xs", children: roles.map((role) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Badge, { variant: "outline", children: role }, role)) }),
|
|
4090
|
+
scope ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_core52.Text, { size: "sm", c: "dimmed", children: [
|
|
3677
4091
|
"Scope: ",
|
|
3678
4092
|
scope
|
|
3679
4093
|
] }) : null,
|
|
3680
|
-
owner ? /* @__PURE__ */ (0,
|
|
4094
|
+
owner ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_core52.Text, { size: "sm", c: "dimmed", children: [
|
|
3681
4095
|
"Owner: ",
|
|
3682
4096
|
owner
|
|
3683
4097
|
] }) : null,
|
|
3684
|
-
recoveryHint ? /* @__PURE__ */ (0,
|
|
3685
|
-
description ? /* @__PURE__ */ (0,
|
|
4098
|
+
recoveryHint ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Text, { size: "sm", c: resolvedState === "allowed" ? "dimmed" : "red.7", children: recoveryHint }) : null,
|
|
4099
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_core52.Text, { size: "sm", children: description }) : null
|
|
3686
4100
|
] }) });
|
|
3687
4101
|
}
|
|
3688
4102
|
|
|
3689
4103
|
// src/AccessRecoveryPanel.tsx
|
|
3690
|
-
var
|
|
4104
|
+
var import_core53 = require("@mantine/core");
|
|
3691
4105
|
var import_gds_theme5 = require("@doneisbetter/gds-theme");
|
|
3692
|
-
var
|
|
4106
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3693
4107
|
var stateBlockVariantByState = {
|
|
3694
4108
|
unauthenticated: "permission",
|
|
3695
4109
|
"expired-session": "info",
|
|
@@ -3769,7 +4183,7 @@ function ActionGroup({
|
|
|
3769
4183
|
if (actions.length === 0) {
|
|
3770
4184
|
return null;
|
|
3771
4185
|
}
|
|
3772
|
-
return /* @__PURE__ */ (0,
|
|
4186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_core53.Group, { gap: "sm", justify: "center", wrap: "wrap", children: actions.map((actionConfig, index) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3773
4187
|
SemanticButton,
|
|
3774
4188
|
{
|
|
3775
4189
|
action: actionConfig.action,
|
|
@@ -3803,14 +4217,14 @@ function AccessRecoveryPanel({
|
|
|
3803
4217
|
onBack,
|
|
3804
4218
|
supportAction
|
|
3805
4219
|
});
|
|
3806
|
-
return /* @__PURE__ */ (0,
|
|
4220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3807
4221
|
StateBlock,
|
|
3808
4222
|
{
|
|
3809
4223
|
variant: stateBlockVariantByState[state],
|
|
3810
4224
|
compact,
|
|
3811
4225
|
title: title ?? t(`gds.accessRecovery.${state}.title`, defaultCopy.title),
|
|
3812
4226
|
description: description ?? t(`gds.accessRecovery.${state}.description`, defaultCopy.description),
|
|
3813
|
-
action: /* @__PURE__ */ (0,
|
|
4227
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
3814
4228
|
ActionGroup,
|
|
3815
4229
|
{
|
|
3816
4230
|
primaryAction: primaryAction ?? defaults.primary,
|
|
@@ -3822,9 +4236,141 @@ function AccessRecoveryPanel({
|
|
|
3822
4236
|
);
|
|
3823
4237
|
}
|
|
3824
4238
|
|
|
4239
|
+
// src/GdsForm.client.tsx
|
|
4240
|
+
var import_react12 = require("react");
|
|
4241
|
+
var import_core54 = require("@mantine/core");
|
|
4242
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4243
|
+
function createFieldState(value) {
|
|
4244
|
+
return { value, touched: false, dirty: false };
|
|
4245
|
+
}
|
|
4246
|
+
function createSnapshot(values) {
|
|
4247
|
+
const fields = Object.entries(values).reduce((acc, [field, value]) => {
|
|
4248
|
+
acc[field] = createFieldState(value);
|
|
4249
|
+
return acc;
|
|
4250
|
+
}, {});
|
|
4251
|
+
return { fields, issues: [], submitState: "idle" };
|
|
4252
|
+
}
|
|
4253
|
+
function gdsFormReducer(state, action) {
|
|
4254
|
+
switch (action.type) {
|
|
4255
|
+
case "set-field": {
|
|
4256
|
+
const current = state.fields[action.field] ?? createFieldState("");
|
|
4257
|
+
return {
|
|
4258
|
+
...state,
|
|
4259
|
+
fields: {
|
|
4260
|
+
...state.fields,
|
|
4261
|
+
[action.field]: {
|
|
4262
|
+
value: action.value,
|
|
4263
|
+
touched: current.touched,
|
|
4264
|
+
dirty: true
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
};
|
|
4268
|
+
}
|
|
4269
|
+
case "touch-field": {
|
|
4270
|
+
const current = state.fields[action.field] ?? createFieldState("");
|
|
4271
|
+
return {
|
|
4272
|
+
...state,
|
|
4273
|
+
fields: {
|
|
4274
|
+
...state.fields,
|
|
4275
|
+
[action.field]: { ...current, touched: true }
|
|
4276
|
+
}
|
|
4277
|
+
};
|
|
4278
|
+
}
|
|
4279
|
+
case "set-issues":
|
|
4280
|
+
return { ...state, issues: [...action.issues] };
|
|
4281
|
+
case "set-submit-state":
|
|
4282
|
+
return { ...state, submitState: action.submitState, submitError: action.submitError };
|
|
4283
|
+
case "reset":
|
|
4284
|
+
return createSnapshot(action.values ?? {});
|
|
4285
|
+
default:
|
|
4286
|
+
return state;
|
|
4287
|
+
}
|
|
4288
|
+
}
|
|
4289
|
+
function sortIssues(issues) {
|
|
4290
|
+
const weight = { blocking: 0, warning: 1, info: 2 };
|
|
4291
|
+
return [...issues].sort((a, b) => weight[a.severity] - weight[b.severity]);
|
|
4292
|
+
}
|
|
4293
|
+
function useGdsForm({
|
|
4294
|
+
initialValues,
|
|
4295
|
+
validate,
|
|
4296
|
+
validateAsync,
|
|
4297
|
+
onSubmit
|
|
4298
|
+
}) {
|
|
4299
|
+
const [snapshot, dispatch] = (0, import_react12.useReducer)(gdsFormReducer, initialValues, createSnapshot);
|
|
4300
|
+
const submit = async () => {
|
|
4301
|
+
dispatch({ type: "set-submit-state", submitState: "validating" });
|
|
4302
|
+
const syncIssues = sortIssues(validate ? validate(snapshot) : []);
|
|
4303
|
+
let mergedIssues = syncIssues;
|
|
4304
|
+
if (syncIssues.filter((issue) => issue.severity === "blocking").length === 0 && validateAsync) {
|
|
4305
|
+
const asyncIssues = sortIssues(await validateAsync(snapshot));
|
|
4306
|
+
mergedIssues = sortIssues([...syncIssues, ...asyncIssues]);
|
|
4307
|
+
}
|
|
4308
|
+
dispatch({ type: "set-issues", issues: mergedIssues });
|
|
4309
|
+
if (mergedIssues.some((issue) => issue.severity === "blocking")) {
|
|
4310
|
+
dispatch({ type: "set-submit-state", submitState: "error", submitError: "Please resolve blocking validation issues." });
|
|
4311
|
+
return false;
|
|
4312
|
+
}
|
|
4313
|
+
dispatch({ type: "set-submit-state", submitState: "submitting" });
|
|
4314
|
+
try {
|
|
4315
|
+
await onSubmit(
|
|
4316
|
+
Object.entries(snapshot.fields).reduce((acc, [field, state]) => {
|
|
4317
|
+
acc[field] = state.value;
|
|
4318
|
+
return acc;
|
|
4319
|
+
}, {})
|
|
4320
|
+
);
|
|
4321
|
+
dispatch({ type: "set-submit-state", submitState: "success" });
|
|
4322
|
+
return true;
|
|
4323
|
+
} catch (error) {
|
|
4324
|
+
dispatch({
|
|
4325
|
+
type: "set-submit-state",
|
|
4326
|
+
submitState: "error",
|
|
4327
|
+
submitError: error instanceof Error ? error.message : "Submission failed."
|
|
4328
|
+
});
|
|
4329
|
+
return false;
|
|
4330
|
+
}
|
|
4331
|
+
};
|
|
4332
|
+
return (0, import_react12.useMemo)(
|
|
4333
|
+
() => ({
|
|
4334
|
+
snapshot,
|
|
4335
|
+
setFieldValue: (field, value) => dispatch({ type: "set-field", field, value }),
|
|
4336
|
+
touchField: (field) => dispatch({ type: "touch-field", field }),
|
|
4337
|
+
submit,
|
|
4338
|
+
retrySubmit: submit
|
|
4339
|
+
}),
|
|
4340
|
+
[snapshot]
|
|
4341
|
+
);
|
|
4342
|
+
}
|
|
4343
|
+
var GdsFormContext = (0, import_react12.createContext)(null);
|
|
4344
|
+
function GdsFormProvider({ snapshot, children }) {
|
|
4345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(GdsFormContext.Provider, { value: { snapshot }, children });
|
|
4346
|
+
}
|
|
4347
|
+
function useGdsFormSnapshot() {
|
|
4348
|
+
const context = (0, import_react12.useContext)(GdsFormContext);
|
|
4349
|
+
if (!context) {
|
|
4350
|
+
throw new Error("useGdsFormSnapshot must be used within GdsFormProvider.");
|
|
4351
|
+
}
|
|
4352
|
+
return context.snapshot;
|
|
4353
|
+
}
|
|
4354
|
+
function FormErrorSummary({ title = "Please review the following issues." }) {
|
|
4355
|
+
const snapshot = useGdsFormSnapshot();
|
|
4356
|
+
const blocking = snapshot.issues.filter((issue) => issue.severity === "blocking");
|
|
4357
|
+
if (blocking.length === 0) {
|
|
4358
|
+
return null;
|
|
4359
|
+
}
|
|
4360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_core54.Alert, { color: "red", title, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_core54.Stack, { gap: 4, children: blocking.map((issue) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_core54.Anchor, { href: `#${issue.field}`, children: issue.message }, `${issue.field}-${issue.message}`)) }) });
|
|
4361
|
+
}
|
|
4362
|
+
function ValidatedFieldMessage({ field }) {
|
|
4363
|
+
const snapshot = useGdsFormSnapshot();
|
|
4364
|
+
const issue = snapshot.issues.find((item) => item.field === field && item.severity === "blocking");
|
|
4365
|
+
if (!issue) {
|
|
4366
|
+
return null;
|
|
4367
|
+
}
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_core54.Text, { size: "xs", c: "red.7", id: `${field}-error`, children: issue.message });
|
|
4369
|
+
}
|
|
4370
|
+
|
|
3825
4371
|
// src/PageHeader.tsx
|
|
3826
|
-
var
|
|
3827
|
-
var
|
|
4372
|
+
var import_core55 = require("@mantine/core");
|
|
4373
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3828
4374
|
function PageHeader({
|
|
3829
4375
|
title,
|
|
3830
4376
|
description,
|
|
@@ -3835,19 +4381,19 @@ function PageHeader({
|
|
|
3835
4381
|
}) {
|
|
3836
4382
|
const resolvedDescription = description ?? subtitle;
|
|
3837
4383
|
const eyebrowProps = eyebrowVariant === "ornamental" ? { tt: "uppercase", style: { letterSpacing: "0.12em" } } : {};
|
|
3838
|
-
return /* @__PURE__ */ (0,
|
|
3839
|
-
/* @__PURE__ */ (0,
|
|
3840
|
-
eyebrow && /* @__PURE__ */ (0,
|
|
3841
|
-
/* @__PURE__ */ (0,
|
|
3842
|
-
resolvedDescription && /* @__PURE__ */ (0,
|
|
4384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_core55.Group, { justify: "space-between", align: "flex-start", gap: "lg", wrap: "wrap", children: [
|
|
4385
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_core55.Stack, { gap: "xs", children: [
|
|
4386
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_core55.Text, { size: "xs", fw: 700, c: "dimmed", ...eyebrowProps, children: eyebrow }),
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_core55.Title, { order: 1, children: title }),
|
|
4388
|
+
resolvedDescription && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_core55.Text, { c: "dimmed", maw: 720, children: resolvedDescription })
|
|
3843
4389
|
] }),
|
|
3844
|
-
actions ? /* @__PURE__ */ (0,
|
|
4390
|
+
actions ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_core55.Box, { children: actions }) : null
|
|
3845
4391
|
] });
|
|
3846
4392
|
}
|
|
3847
4393
|
|
|
3848
4394
|
// src/FilterDrawer.tsx
|
|
3849
|
-
var
|
|
3850
|
-
var
|
|
4395
|
+
var import_core56 = require("@mantine/core");
|
|
4396
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3851
4397
|
function FilterDrawer({
|
|
3852
4398
|
opened,
|
|
3853
4399
|
onClose,
|
|
@@ -3863,8 +4409,8 @@ function FilterDrawer({
|
|
|
3863
4409
|
}) {
|
|
3864
4410
|
const resolvedPrimaryAction = applyAction ?? primaryAction;
|
|
3865
4411
|
const resolvedSecondaryAction = resetAction ?? secondaryAction;
|
|
3866
|
-
return /* @__PURE__ */ (0,
|
|
3867
|
-
|
|
4412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
4413
|
+
import_core56.Drawer,
|
|
3868
4414
|
{
|
|
3869
4415
|
opened,
|
|
3870
4416
|
onClose,
|
|
@@ -3872,11 +4418,11 @@ function FilterDrawer({
|
|
|
3872
4418
|
position: mode === "bottom-sheet" ? "bottom" : "right",
|
|
3873
4419
|
size: mode === "bottom-sheet" ? "auto" : "md",
|
|
3874
4420
|
radius: mode === "bottom-sheet" ? "xl" : void 0,
|
|
3875
|
-
children: /* @__PURE__ */ (0,
|
|
3876
|
-
description ? /* @__PURE__ */ (0,
|
|
4421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_core56.Stack, { gap: "md", children: [
|
|
4422
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_core56.Text, { size: "sm", c: "dimmed", children: description }) : null,
|
|
3877
4423
|
children,
|
|
3878
|
-
resolvedPrimaryAction || resolvedSecondaryAction || closeAction ? /* @__PURE__ */ (0,
|
|
3879
|
-
/* @__PURE__ */ (0,
|
|
4424
|
+
resolvedPrimaryAction || resolvedSecondaryAction || closeAction ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_core56.Group, { justify: "space-between", mt: "md", children: [
|
|
4425
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_core56.Group, { gap: "sm", children: [
|
|
3880
4426
|
closeAction,
|
|
3881
4427
|
resolvedSecondaryAction
|
|
3882
4428
|
] }),
|
|
@@ -3888,8 +4434,8 @@ function FilterDrawer({
|
|
|
3888
4434
|
}
|
|
3889
4435
|
|
|
3890
4436
|
// src/PlaceholderPanel.tsx
|
|
3891
|
-
var
|
|
3892
|
-
var
|
|
4437
|
+
var import_core57 = require("@mantine/core");
|
|
4438
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3893
4439
|
function PlaceholderPanel({
|
|
3894
4440
|
title,
|
|
3895
4441
|
description,
|
|
@@ -3899,16 +4445,16 @@ function PlaceholderPanel({
|
|
|
3899
4445
|
mode
|
|
3900
4446
|
}) {
|
|
3901
4447
|
if (mode === "live" && children) {
|
|
3902
|
-
return /* @__PURE__ */ (0,
|
|
4448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_jsx_runtime61.Fragment, { children });
|
|
3903
4449
|
}
|
|
3904
|
-
return /* @__PURE__ */ (0,
|
|
3905
|
-
badge ? /* @__PURE__ */ (0,
|
|
3906
|
-
/* @__PURE__ */ (0,
|
|
3907
|
-
/* @__PURE__ */ (0,
|
|
3908
|
-
/* @__PURE__ */ (0,
|
|
4450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_core57.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_core57.Stack, { gap: "md", children: [
|
|
4451
|
+
badge ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_core57.Badge, { variant: "light", color: "blue", w: "fit-content", children: badge }) : null,
|
|
4452
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_core57.Stack, { gap: "xs", children: [
|
|
4453
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_core57.Title, { order: 4, children: title }),
|
|
4454
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_core57.Text, { c: "dimmed", children: description })
|
|
3909
4455
|
] }),
|
|
3910
|
-
footer ? /* @__PURE__ */ (0,
|
|
3911
|
-
/* @__PURE__ */ (0,
|
|
4456
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_core57.Text, { size: "sm", children: footer }) : null,
|
|
4457
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
3912
4458
|
StateBlock,
|
|
3913
4459
|
{
|
|
3914
4460
|
variant: "not-enough-data",
|
|
@@ -3921,8 +4467,8 @@ function PlaceholderPanel({
|
|
|
3921
4467
|
}
|
|
3922
4468
|
|
|
3923
4469
|
// src/SimpleDataTable.tsx
|
|
3924
|
-
var
|
|
3925
|
-
var
|
|
4470
|
+
var import_core58 = require("@mantine/core");
|
|
4471
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3926
4472
|
function SimpleDataTable({
|
|
3927
4473
|
columns,
|
|
3928
4474
|
rows,
|
|
@@ -3933,23 +4479,331 @@ function SimpleDataTable({
|
|
|
3933
4479
|
getRowKey
|
|
3934
4480
|
}) {
|
|
3935
4481
|
if (error) {
|
|
3936
|
-
return /* @__PURE__ */ (0,
|
|
4482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(StateBlock, { variant: "error", title: "Unable to load data", description: error, compact: true });
|
|
3937
4483
|
}
|
|
3938
4484
|
if (loading) {
|
|
3939
|
-
return /* @__PURE__ */ (0,
|
|
4485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(StateBlock, { variant: "loading", title: "Loading data", description: "Please wait while the shared dataset is prepared.", compact: true });
|
|
3940
4486
|
}
|
|
3941
4487
|
if (!rows.length) {
|
|
3942
|
-
return /* @__PURE__ */ (0,
|
|
4488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(StateBlock, { variant: "empty", title: emptyTitle, description: emptyDescription, compact: true });
|
|
4489
|
+
}
|
|
4490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.ScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_core58.Table, { striped: true, highlightOnHover: true, withTableBorder: true, withColumnBorders: true, children: [
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Tr, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Th, { children: column.header }, String(column.key))) }) }),
|
|
4492
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Tbody, { children: rows.map((row, index) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Tr, { children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_core58.Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, String(column.key))) }, getRowKey ? getRowKey(row, index) : index)) })
|
|
4493
|
+
] }) });
|
|
4494
|
+
}
|
|
4495
|
+
|
|
4496
|
+
// src/AdvancedDataTable.client.tsx
|
|
4497
|
+
var import_react13 = require("react");
|
|
4498
|
+
var import_core59 = require("@mantine/core");
|
|
4499
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
4500
|
+
function compareValues(a, b) {
|
|
4501
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
4502
|
+
return a - b;
|
|
4503
|
+
}
|
|
4504
|
+
return String(a).localeCompare(String(b), void 0, { numeric: true, sensitivity: "base" });
|
|
4505
|
+
}
|
|
4506
|
+
function AdvancedDataTable({
|
|
4507
|
+
rows,
|
|
4508
|
+
columns,
|
|
4509
|
+
rowId,
|
|
4510
|
+
loading = false,
|
|
4511
|
+
error = null,
|
|
4512
|
+
density: densityProp,
|
|
4513
|
+
stickyHeader = true,
|
|
4514
|
+
stickyHeaderOffset = 0,
|
|
4515
|
+
selectedRowIds,
|
|
4516
|
+
onSelectedRowIdsChange,
|
|
4517
|
+
sortBy: sortByProp,
|
|
4518
|
+
sortDirection: sortDirectionProp,
|
|
4519
|
+
onSortChange,
|
|
4520
|
+
responsiveFallback = "stacked-cards"
|
|
4521
|
+
}) {
|
|
4522
|
+
const [densityState, setDensityState] = (0, import_react13.useState)(densityProp ?? "comfortable");
|
|
4523
|
+
const [sortState, setSortState] = (0, import_react13.useState)({ key: sortByProp ?? null, direction: sortDirectionProp ?? "asc" });
|
|
4524
|
+
const [selectionState, setSelectionState] = (0, import_react13.useState)([]);
|
|
4525
|
+
const density = densityProp ?? densityState;
|
|
4526
|
+
const sortBy = sortByProp ?? sortState.key;
|
|
4527
|
+
const sortDirection = sortDirectionProp ?? sortState.direction;
|
|
4528
|
+
const selection = selectedRowIds ?? selectionState;
|
|
4529
|
+
const sortedRows = (0, import_react13.useMemo)(() => {
|
|
4530
|
+
if (!sortBy) {
|
|
4531
|
+
return rows;
|
|
4532
|
+
}
|
|
4533
|
+
const column = columns.find((item) => item.key === sortBy);
|
|
4534
|
+
if (!column) {
|
|
4535
|
+
return rows;
|
|
4536
|
+
}
|
|
4537
|
+
const next = [...rows].sort((left, right) => {
|
|
4538
|
+
const leftValue = column.sortAccessor ? column.sortAccessor(left) : String(left[column.key] ?? "");
|
|
4539
|
+
const rightValue = column.sortAccessor ? column.sortAccessor(right) : String(right[column.key] ?? "");
|
|
4540
|
+
const result = compareValues(leftValue, rightValue);
|
|
4541
|
+
return sortDirection === "asc" ? result : -result;
|
|
4542
|
+
});
|
|
4543
|
+
return next;
|
|
4544
|
+
}, [rows, columns, sortBy, sortDirection]);
|
|
4545
|
+
const allIds = (0, import_react13.useMemo)(() => sortedRows.map((row, index) => rowId(row, index)), [sortedRows, rowId]);
|
|
4546
|
+
const allSelected = allIds.length > 0 && allIds.every((id) => selection.includes(id));
|
|
4547
|
+
if (error) {
|
|
4548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(StateBlock, { variant: "error", title: "Unable to load table", description: error, compact: true });
|
|
4549
|
+
}
|
|
4550
|
+
if (loading) {
|
|
4551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(StateBlock, { variant: "loading", title: "Loading table", description: "Preparing enterprise data grid.", compact: true });
|
|
4552
|
+
}
|
|
4553
|
+
if (!rows.length) {
|
|
4554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4555
|
+
StateBlock,
|
|
4556
|
+
{
|
|
4557
|
+
variant: "empty",
|
|
4558
|
+
title: "No rows available",
|
|
4559
|
+
description: "Adjust filters or broaden scope to populate this table.",
|
|
4560
|
+
compact: true
|
|
4561
|
+
}
|
|
4562
|
+
);
|
|
4563
|
+
}
|
|
4564
|
+
const horizontalSpacing = density === "compact" ? "xs" : "md";
|
|
4565
|
+
const verticalSpacing = density === "compact" ? 6 : 10;
|
|
4566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_core59.Stack, { gap: "sm", children: [
|
|
4567
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_core59.Group, { justify: "space-between", align: "center", children: [
|
|
4568
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_core59.Text, { size: "sm", fw: 600, children: [
|
|
4569
|
+
rows.length,
|
|
4570
|
+
" rows"
|
|
4571
|
+
] }),
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4573
|
+
import_core59.SegmentedControl,
|
|
4574
|
+
{
|
|
4575
|
+
size: "xs",
|
|
4576
|
+
value: density,
|
|
4577
|
+
onChange: (value) => setDensityState(value),
|
|
4578
|
+
data: [
|
|
4579
|
+
{ label: "Compact", value: "compact" },
|
|
4580
|
+
{ label: "Comfortable", value: "comfortable" }
|
|
4581
|
+
]
|
|
4582
|
+
}
|
|
4583
|
+
)
|
|
4584
|
+
] }),
|
|
4585
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.ScrollArea, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
4586
|
+
import_core59.Table,
|
|
4587
|
+
{
|
|
4588
|
+
stickyHeader,
|
|
4589
|
+
stickyHeaderOffset,
|
|
4590
|
+
withTableBorder: true,
|
|
4591
|
+
highlightOnHover: true,
|
|
4592
|
+
striped: true,
|
|
4593
|
+
horizontalSpacing,
|
|
4594
|
+
verticalSpacing,
|
|
4595
|
+
children: [
|
|
4596
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_core59.Table.Tr, { children: [
|
|
4597
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Th, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4598
|
+
import_core59.Checkbox,
|
|
4599
|
+
{
|
|
4600
|
+
"aria-label": "Select all rows",
|
|
4601
|
+
checked: allSelected,
|
|
4602
|
+
indeterminate: !allSelected && selection.length > 0,
|
|
4603
|
+
onChange: (event) => {
|
|
4604
|
+
const next = event.currentTarget.checked ? allIds : [];
|
|
4605
|
+
if (onSelectedRowIdsChange) {
|
|
4606
|
+
onSelectedRowIdsChange(next);
|
|
4607
|
+
} else {
|
|
4608
|
+
setSelectionState(next);
|
|
4609
|
+
}
|
|
4610
|
+
}
|
|
4611
|
+
}
|
|
4612
|
+
) }),
|
|
4613
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Th, { style: column.width ? { width: column.width } : void 0, children: column.sortable ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4614
|
+
"button",
|
|
4615
|
+
{
|
|
4616
|
+
type: "button",
|
|
4617
|
+
"aria-label": `Sort by ${column.label}`,
|
|
4618
|
+
onClick: () => {
|
|
4619
|
+
const nextDirection = sortBy === column.key && sortDirection === "asc" ? "desc" : "asc";
|
|
4620
|
+
if (onSortChange) {
|
|
4621
|
+
onSortChange(column.key, nextDirection);
|
|
4622
|
+
} else {
|
|
4623
|
+
setSortState({ key: column.key, direction: nextDirection });
|
|
4624
|
+
}
|
|
4625
|
+
},
|
|
4626
|
+
children: column.label
|
|
4627
|
+
}
|
|
4628
|
+
) : column.label }, column.key))
|
|
4629
|
+
] }) }),
|
|
4630
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Tbody, { children: sortedRows.map((row, index) => {
|
|
4631
|
+
const id = rowId(row, index);
|
|
4632
|
+
const checked = selection.includes(id);
|
|
4633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_core59.Table.Tr, { children: [
|
|
4634
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Td, { children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4635
|
+
import_core59.Checkbox,
|
|
4636
|
+
{
|
|
4637
|
+
"aria-label": `Select row ${id}`,
|
|
4638
|
+
checked,
|
|
4639
|
+
onChange: () => {
|
|
4640
|
+
const next = checked ? selection.filter((item) => item !== id) : [...selection, id];
|
|
4641
|
+
if (onSelectedRowIdsChange) {
|
|
4642
|
+
onSelectedRowIdsChange(next);
|
|
4643
|
+
} else {
|
|
4644
|
+
setSelectionState(next);
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
}
|
|
4648
|
+
) }),
|
|
4649
|
+
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Table.Td, { children: column.render ? column.render(row) : String(row[column.key] ?? "") }, column.key))
|
|
4650
|
+
] }, id);
|
|
4651
|
+
}) })
|
|
4652
|
+
]
|
|
4653
|
+
}
|
|
4654
|
+
) }),
|
|
4655
|
+
responsiveFallback === "stacked-cards" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_core59.Stack, { gap: "xs", children: sortedRows.slice(0, 3).map((row, index) => {
|
|
4656
|
+
const id = rowId(row, index);
|
|
4657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
4658
|
+
StateBlock,
|
|
4659
|
+
{
|
|
4660
|
+
variant: "info",
|
|
4661
|
+
compact: true,
|
|
4662
|
+
title: String(row[columns[0]?.key] ?? id),
|
|
4663
|
+
description: columns.slice(1, 3).map((column) => `${column.label}: ${String(row[column.key] ?? "")}`).join(" | ")
|
|
4664
|
+
},
|
|
4665
|
+
`card-${id}`
|
|
4666
|
+
);
|
|
4667
|
+
}) }) : null
|
|
4668
|
+
] });
|
|
4669
|
+
}
|
|
4670
|
+
|
|
4671
|
+
// src/OverlayManager.client.tsx
|
|
4672
|
+
var import_react14 = require("react");
|
|
4673
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
4674
|
+
var OverlayManagerContext = (0, import_react14.createContext)(null);
|
|
4675
|
+
function OverlayManagerProvider({ children }) {
|
|
4676
|
+
const [stack, setStack] = (0, import_react14.useState)([]);
|
|
4677
|
+
const value = (0, import_react14.useMemo)(() => ({
|
|
4678
|
+
stack,
|
|
4679
|
+
registerOverlay: (overlay) => {
|
|
4680
|
+
setStack((current) => {
|
|
4681
|
+
const without = current.filter((item) => item.id !== overlay.id);
|
|
4682
|
+
return [...without, overlay];
|
|
4683
|
+
});
|
|
4684
|
+
},
|
|
4685
|
+
unregisterOverlay: (id) => {
|
|
4686
|
+
setStack((current) => current.filter((item) => item.id !== id));
|
|
4687
|
+
},
|
|
4688
|
+
isTopMost: (id) => stack.length > 0 && stack[stack.length - 1]?.id === id,
|
|
4689
|
+
requestClose: (id, reason) => {
|
|
4690
|
+
if (stack.length === 0 || stack[stack.length - 1]?.id !== id) {
|
|
4691
|
+
return null;
|
|
4692
|
+
}
|
|
4693
|
+
return reason;
|
|
4694
|
+
}
|
|
4695
|
+
}), [stack]);
|
|
4696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(OverlayManagerContext.Provider, { value, children });
|
|
4697
|
+
}
|
|
4698
|
+
function useOverlayManager() {
|
|
4699
|
+
const context = (0, import_react14.useContext)(OverlayManagerContext);
|
|
4700
|
+
if (!context) {
|
|
4701
|
+
throw new Error("useOverlayManager must be used within OverlayManagerProvider.");
|
|
4702
|
+
}
|
|
4703
|
+
return context;
|
|
4704
|
+
}
|
|
4705
|
+
|
|
4706
|
+
// src/CommandPalette.client.tsx
|
|
4707
|
+
var import_react15 = require("react");
|
|
4708
|
+
var import_core60 = require("@mantine/core");
|
|
4709
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4710
|
+
var CommandPaletteContext = (0, import_react15.createContext)(null);
|
|
4711
|
+
function normalize(text) {
|
|
4712
|
+
return text.trim().toLowerCase();
|
|
4713
|
+
}
|
|
4714
|
+
function scoreCommand(command, query, recentUse) {
|
|
4715
|
+
const q = normalize(query);
|
|
4716
|
+
if (!q) {
|
|
4717
|
+
return 0;
|
|
4718
|
+
}
|
|
4719
|
+
const label = normalize(command.label);
|
|
4720
|
+
const keywords = command.keywords?.map(normalize) ?? [];
|
|
4721
|
+
const prefix = label.startsWith(q) ? 1 : 0;
|
|
4722
|
+
const keyword = keywords.some((item) => item.includes(q)) ? 1 : 0;
|
|
4723
|
+
const recent = recentUse[command.id] ? 1 : 0;
|
|
4724
|
+
return 0.6 * prefix + 0.3 * keyword + 0.1 * recent;
|
|
4725
|
+
}
|
|
4726
|
+
function CommandRegistryProvider({ children }) {
|
|
4727
|
+
const [commands, setCommands] = (0, import_react15.useState)([]);
|
|
4728
|
+
const [opened, setOpened] = (0, import_react15.useState)(false);
|
|
4729
|
+
const value = (0, import_react15.useMemo)(() => ({
|
|
4730
|
+
commands,
|
|
4731
|
+
registerCommands: (next) => setCommands(next),
|
|
4732
|
+
open: () => setOpened(true),
|
|
4733
|
+
close: () => setOpened(false)
|
|
4734
|
+
}), [commands]);
|
|
4735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(CommandPaletteContext.Provider, { value, children: [
|
|
4736
|
+
children,
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CommandPalette, { opened, onClose: () => setOpened(false) })
|
|
4738
|
+
] });
|
|
4739
|
+
}
|
|
4740
|
+
function useCommandLauncher() {
|
|
4741
|
+
const context = (0, import_react15.useContext)(CommandPaletteContext);
|
|
4742
|
+
if (!context) {
|
|
4743
|
+
throw new Error("useCommandLauncher must be used within CommandRegistryProvider.");
|
|
4744
|
+
}
|
|
4745
|
+
return {
|
|
4746
|
+
open: context.open,
|
|
4747
|
+
close: context.close,
|
|
4748
|
+
registerCommands: context.registerCommands
|
|
4749
|
+
};
|
|
4750
|
+
}
|
|
4751
|
+
function CommandPalette({ opened, onClose }) {
|
|
4752
|
+
const contextValue = (0, import_react15.useContext)(CommandPaletteContext);
|
|
4753
|
+
if (!contextValue) {
|
|
4754
|
+
throw new Error("CommandPalette must be used within CommandRegistryProvider.");
|
|
3943
4755
|
}
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
4756
|
+
const registry = contextValue;
|
|
4757
|
+
const [query, setQuery] = (0, import_react15.useState)("");
|
|
4758
|
+
const [recentUse, setRecentUse] = (0, import_react15.useState)({});
|
|
4759
|
+
const enabledCommands = registry.commands.filter((command) => command.enabledWhen ? command.enabledWhen() : true);
|
|
4760
|
+
const filteredCommands = [...enabledCommands].map((command) => ({ command, score: scoreCommand(command, query, recentUse) })).filter(({ command, score }) => normalize(query) === "" || score > 0 || normalize(command.label).includes(normalize(query))).sort((a, b) => b.score - a.score).map((item) => item.command);
|
|
4761
|
+
(0, import_react15.useEffect)(() => {
|
|
4762
|
+
function onKeyDown(event) {
|
|
4763
|
+
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
|
4764
|
+
event.preventDefault();
|
|
4765
|
+
registry.open();
|
|
4766
|
+
}
|
|
4767
|
+
if (event.key === "Escape" && opened) {
|
|
4768
|
+
onClose();
|
|
4769
|
+
}
|
|
4770
|
+
}
|
|
4771
|
+
window.addEventListener("keydown", onKeyDown);
|
|
4772
|
+
return () => window.removeEventListener("keydown", onKeyDown);
|
|
4773
|
+
}, [registry, opened, onClose]);
|
|
4774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core60.Modal, { opened, onClose, title: "Quick actions", centered: true, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_core60.Stack, { gap: "sm", children: [
|
|
4775
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4776
|
+
import_core60.TextInput,
|
|
4777
|
+
{
|
|
4778
|
+
"aria-label": "Command search",
|
|
4779
|
+
placeholder: "Search commands",
|
|
4780
|
+
value: query,
|
|
4781
|
+
onChange: (event) => setQuery(event.currentTarget.value)
|
|
4782
|
+
}
|
|
4783
|
+
),
|
|
4784
|
+
filteredCommands.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core60.Text, { size: "sm", c: "dimmed", children: "No matching commands." }) : filteredCommands.map((command) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_core60.Group, { justify: "space-between", wrap: "nowrap", children: [
|
|
4785
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
4786
|
+
"button",
|
|
4787
|
+
{
|
|
4788
|
+
type: "button",
|
|
4789
|
+
onClick: async () => {
|
|
4790
|
+
await command.run();
|
|
4791
|
+
setRecentUse((current) => ({ ...current, [command.id]: Date.now() }));
|
|
4792
|
+
onClose();
|
|
4793
|
+
},
|
|
4794
|
+
"aria-label": command.label,
|
|
4795
|
+
children: command.label
|
|
4796
|
+
}
|
|
4797
|
+
),
|
|
4798
|
+
command.shortcut ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core60.Text, { size: "xs", c: "dimmed", children: command.shortcut }) : null
|
|
4799
|
+
] }, command.id)),
|
|
4800
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core60.Group, { justify: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_core60.ActionIcon, { variant: "subtle", "aria-label": "Close command palette", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(GdsIcons.Close, { size: "1rem" }) }) })
|
|
3947
4801
|
] }) });
|
|
3948
4802
|
}
|
|
3949
4803
|
|
|
3950
4804
|
// src/StatsSection.tsx
|
|
3951
|
-
var
|
|
3952
|
-
var
|
|
4805
|
+
var import_core61 = require("@mantine/core");
|
|
4806
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3953
4807
|
function StatsSection({
|
|
3954
4808
|
title,
|
|
3955
4809
|
loading = false,
|
|
@@ -3961,11 +4815,11 @@ function StatsSection({
|
|
|
3961
4815
|
}) {
|
|
3962
4816
|
let content = children;
|
|
3963
4817
|
if (error) {
|
|
3964
|
-
content = /* @__PURE__ */ (0,
|
|
4818
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(StateBlock, { variant: "error", title: "Unable to load statistics", description: error, compact: true });
|
|
3965
4819
|
} else if (loading) {
|
|
3966
|
-
content = /* @__PURE__ */ (0,
|
|
4820
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(StateBlock, { variant: "loading", title: "Loading statistics", description: "This shared data surface is still synchronizing.", compact: true });
|
|
3967
4821
|
} else if (belowThreshold) {
|
|
3968
|
-
content = /* @__PURE__ */ (0,
|
|
4822
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3969
4823
|
StateBlock,
|
|
3970
4824
|
{
|
|
3971
4825
|
variant: "not-enough-data",
|
|
@@ -3975,17 +4829,17 @@ function StatsSection({
|
|
|
3975
4829
|
}
|
|
3976
4830
|
);
|
|
3977
4831
|
} else if (placeholder) {
|
|
3978
|
-
content = /* @__PURE__ */ (0,
|
|
4832
|
+
content = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PlaceholderPanel, { ...placeholder, mode: "placeholder" });
|
|
3979
4833
|
}
|
|
3980
|
-
return /* @__PURE__ */ (0,
|
|
3981
|
-
/* @__PURE__ */ (0,
|
|
4834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_core61.Stack, { gap: "md", children: [
|
|
4835
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_core61.Title, { order: 3, children: title }),
|
|
3982
4836
|
content
|
|
3983
4837
|
] });
|
|
3984
4838
|
}
|
|
3985
4839
|
|
|
3986
4840
|
// src/PeriodSelector.tsx
|
|
3987
|
-
var
|
|
3988
|
-
var
|
|
4841
|
+
var import_core62 = require("@mantine/core");
|
|
4842
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3989
4843
|
function PeriodSelector({
|
|
3990
4844
|
label,
|
|
3991
4845
|
description,
|
|
@@ -4001,34 +4855,34 @@ function PeriodSelector({
|
|
|
4001
4855
|
disabled = false
|
|
4002
4856
|
}) {
|
|
4003
4857
|
const selectedOption = options.find((option) => option.value === value);
|
|
4004
|
-
return /* @__PURE__ */ (0,
|
|
4005
|
-
/* @__PURE__ */ (0,
|
|
4858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(FormField, { label, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_core62.Stack, { gap: "sm", children: [
|
|
4859
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
4006
4860
|
"select",
|
|
4007
4861
|
{
|
|
4008
4862
|
"aria-label": typeof label === "string" ? label : "Reporting period",
|
|
4009
4863
|
value,
|
|
4010
4864
|
disabled,
|
|
4011
4865
|
onChange: (event) => onChange?.(event.currentTarget.value),
|
|
4012
|
-
children: options.map((option) => /* @__PURE__ */ (0,
|
|
4866
|
+
children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("option", { value: option.value, children: option.label }, option.value))
|
|
4013
4867
|
}
|
|
4014
4868
|
),
|
|
4015
|
-
/* @__PURE__ */ (0,
|
|
4016
|
-
timezone ? /* @__PURE__ */ (0,
|
|
4869
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_core62.Group, { gap: "xs", wrap: "wrap", children: [
|
|
4870
|
+
timezone ? /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_core62.Badge, { variant: "outline", color: "gray", children: [
|
|
4017
4871
|
"Timezone: ",
|
|
4018
4872
|
timezone
|
|
4019
4873
|
] }) : null,
|
|
4020
|
-
filtered ? /* @__PURE__ */ (0,
|
|
4021
|
-
stale ? /* @__PURE__ */ (0,
|
|
4022
|
-
scope ? /* @__PURE__ */ (0,
|
|
4874
|
+
filtered ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_core62.Badge, { variant: "light", color: "blue", children: "Filtered" }) : null,
|
|
4875
|
+
stale ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_core62.Badge, { variant: "light", color: "orange", children: "Stale data" }) : null,
|
|
4876
|
+
scope ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_core62.Badge, { variant: "outline", color: "gray", children: scope }) : null
|
|
4023
4877
|
] }),
|
|
4024
|
-
selectedOption?.description ? /* @__PURE__ */ (0,
|
|
4025
|
-
helperText ? /* @__PURE__ */ (0,
|
|
4878
|
+
selectedOption?.description ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_core62.Text, { size: "sm", c: "dimmed", children: selectedOption.description }) : null,
|
|
4879
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_core62.Text, { size: "sm", c: "dimmed", children: helperText }) : null
|
|
4026
4880
|
] }) });
|
|
4027
4881
|
}
|
|
4028
4882
|
|
|
4029
4883
|
// src/EvidencePanel.tsx
|
|
4030
|
-
var
|
|
4031
|
-
var
|
|
4884
|
+
var import_core63 = require("@mantine/core");
|
|
4885
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4032
4886
|
var stateTone2 = {
|
|
4033
4887
|
current: { label: "Current", color: "teal" },
|
|
4034
4888
|
stale: { label: "Stale", color: "orange" },
|
|
@@ -4053,33 +4907,33 @@ function EvidencePanel({
|
|
|
4053
4907
|
}) {
|
|
4054
4908
|
const tone = stateTone2[state];
|
|
4055
4909
|
const isProblem = state === "error" || state === "permission-limited" || state === "stale" || state === "partial";
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
4057
|
-
/* @__PURE__ */ (0,
|
|
4058
|
-
/* @__PURE__ */ (0,
|
|
4059
|
-
/* @__PURE__ */ (0,
|
|
4060
|
-
description ? /* @__PURE__ */ (0,
|
|
4910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_core63.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Stack, { gap: "md", children: [
|
|
4911
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
4912
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Stack, { gap: 4, children: [
|
|
4913
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_core63.Title, { order: 4, children: title }),
|
|
4914
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_core63.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
4061
4915
|
] }),
|
|
4062
|
-
/* @__PURE__ */ (0,
|
|
4916
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_core63.Badge, { variant: "light", color: tone.color, children: tone.label })
|
|
4063
4917
|
] }),
|
|
4064
|
-
/* @__PURE__ */ (0,
|
|
4065
|
-
source ? /* @__PURE__ */ (0,
|
|
4918
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Group, { gap: "xs", wrap: "wrap", children: [
|
|
4919
|
+
source ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Badge, { variant: "outline", color: "gray", children: [
|
|
4066
4920
|
"Source: ",
|
|
4067
4921
|
source
|
|
4068
4922
|
] }) : null,
|
|
4069
|
-
freshness ? /* @__PURE__ */ (0,
|
|
4923
|
+
freshness ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Badge, { variant: "outline", color: "gray", children: [
|
|
4070
4924
|
"Freshness: ",
|
|
4071
4925
|
freshness
|
|
4072
4926
|
] }) : null,
|
|
4073
|
-
confidence ? /* @__PURE__ */ (0,
|
|
4927
|
+
confidence ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Badge, { variant: "outline", color: "gray", children: [
|
|
4074
4928
|
"Confidence: ",
|
|
4075
4929
|
confidence
|
|
4076
4930
|
] }) : null,
|
|
4077
|
-
typeof evidenceCount === "number" ? /* @__PURE__ */ (0,
|
|
4931
|
+
typeof evidenceCount === "number" ? /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_core63.Badge, { variant: "outline", color: "gray", children: [
|
|
4078
4932
|
"Evidence: ",
|
|
4079
4933
|
evidenceCount
|
|
4080
4934
|
] }) : null
|
|
4081
4935
|
] }),
|
|
4082
|
-
permissionNote ? /* @__PURE__ */ (0,
|
|
4936
|
+
permissionNote ? /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_core63.Alert, { color: isProblem ? tone.color : "gray", variant: "light", children: permissionNote }) : null,
|
|
4083
4937
|
details,
|
|
4084
4938
|
children,
|
|
4085
4939
|
retryAction
|
|
@@ -4087,8 +4941,8 @@ function EvidencePanel({
|
|
|
4087
4941
|
}
|
|
4088
4942
|
|
|
4089
4943
|
// src/ChartTokenPanel.tsx
|
|
4090
|
-
var
|
|
4091
|
-
var
|
|
4944
|
+
var import_core64 = require("@mantine/core");
|
|
4945
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
4092
4946
|
function ChartTokenPanel({
|
|
4093
4947
|
title,
|
|
4094
4948
|
description,
|
|
@@ -4100,42 +4954,127 @@ function ChartTokenPanel({
|
|
|
4100
4954
|
retryAction
|
|
4101
4955
|
}) {
|
|
4102
4956
|
if (state === "loading") {
|
|
4103
|
-
return /* @__PURE__ */ (0,
|
|
4957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StateBlock, { variant: "loading", title: "Loading chart", description: summary, compact: true, action: retryAction });
|
|
4104
4958
|
}
|
|
4105
4959
|
if (state === "empty") {
|
|
4106
|
-
return /* @__PURE__ */ (0,
|
|
4960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StateBlock, { variant: "empty", title: "No chart data", description: summary, compact: true, action: retryAction });
|
|
4107
4961
|
}
|
|
4108
4962
|
if (state === "below-threshold") {
|
|
4109
|
-
return /* @__PURE__ */ (0,
|
|
4963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StateBlock, { variant: "not-enough-data", title: "Not enough data for chart", description: summary, compact: true, action: retryAction });
|
|
4110
4964
|
}
|
|
4111
4965
|
if (state === "error") {
|
|
4112
|
-
return /* @__PURE__ */ (0,
|
|
4966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(StateBlock, { variant: "error", title: "Unable to load chart", description: summary, compact: true, action: retryAction });
|
|
4113
4967
|
}
|
|
4114
|
-
return /* @__PURE__ */ (0,
|
|
4115
|
-
/* @__PURE__ */ (0,
|
|
4116
|
-
/* @__PURE__ */ (0,
|
|
4117
|
-
/* @__PURE__ */ (0,
|
|
4118
|
-
description ? /* @__PURE__ */ (0,
|
|
4968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_core64.Stack, { gap: "md", children: [
|
|
4969
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_core64.Group, { justify: "space-between", align: "flex-start", gap: "sm", children: [
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_core64.Stack, { gap: 4, children: [
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Title, { order: 4, children: title }),
|
|
4972
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
4119
4973
|
] }),
|
|
4120
|
-
state !== "ready" ? /* @__PURE__ */ (0,
|
|
4974
|
+
state !== "ready" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Badge, { variant: "light", color: state === "permission-limited" ? "grape" : "yellow", children: state.replace("-", " ") }) : null
|
|
4121
4975
|
] }),
|
|
4122
|
-
/* @__PURE__ */ (0,
|
|
4123
|
-
legend.length ? /* @__PURE__ */ (0,
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Text, { size: "sm", children: summary }),
|
|
4977
|
+
legend.length ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Group, { gap: "xs", wrap: "wrap", "aria-label": "Chart legend", children: legend.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_core64.Badge, { variant: "outline", color: "gray", title: typeof item.description === "string" ? item.description : void 0, children: [
|
|
4124
4978
|
item.label,
|
|
4125
4979
|
": ",
|
|
4126
4980
|
item.token
|
|
4127
4981
|
] }, `${String(item.label)}-${index}`)) }) : null,
|
|
4128
4982
|
children,
|
|
4129
|
-
tableFallback ? /* @__PURE__ */ (0,
|
|
4130
|
-
/* @__PURE__ */ (0,
|
|
4983
|
+
tableFallback ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_core64.Stack, { gap: "xs", children: [
|
|
4984
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_core64.Text, { size: "sm", fw: 600, children: "Accessible data fallback" }),
|
|
4131
4985
|
tableFallback
|
|
4132
4986
|
] }) : null
|
|
4133
4987
|
] }) });
|
|
4134
4988
|
}
|
|
4135
4989
|
|
|
4990
|
+
// src/GdsChart.tsx
|
|
4991
|
+
var import_core65 = require("@mantine/core");
|
|
4992
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
4993
|
+
function GdsChart({ type, title, summary, data, state = "ready", retryAction }) {
|
|
4994
|
+
const tableRows = data.map((item) => ({ label: item.label, value: String(item.value), group: item.group ?? "-" }));
|
|
4995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
4996
|
+
ChartTokenPanel,
|
|
4997
|
+
{
|
|
4998
|
+
title,
|
|
4999
|
+
summary,
|
|
5000
|
+
state,
|
|
5001
|
+
retryAction,
|
|
5002
|
+
legend: [
|
|
5003
|
+
{ label: "Primary", token: "var(--mantine-color-blue-6)" },
|
|
5004
|
+
{ label: "Secondary", token: "var(--mantine-color-teal-6)" }
|
|
5005
|
+
],
|
|
5006
|
+
tableFallback: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5007
|
+
SimpleDataTable,
|
|
5008
|
+
{
|
|
5009
|
+
columns: [
|
|
5010
|
+
{ key: "label", header: "Label" },
|
|
5011
|
+
{ key: "value", header: "Value" },
|
|
5012
|
+
{ key: "group", header: "Group" }
|
|
5013
|
+
],
|
|
5014
|
+
rows: tableRows
|
|
5015
|
+
}
|
|
5016
|
+
),
|
|
5017
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_core65.Paper, { withBorder: true, radius: "md", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_core65.Stack, { gap: "sm", children: [
|
|
5018
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_core65.Group, { justify: "space-between", children: [
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_core65.Text, { fw: 700, children: title }),
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_core65.Badge, { variant: "light", children: type })
|
|
5021
|
+
] }),
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_core65.Text, { size: "sm", c: "dimmed", children: summary }),
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_core65.Text, { size: "xs", c: "dimmed", children: [
|
|
5024
|
+
"Type lane: ",
|
|
5025
|
+
type
|
|
5026
|
+
] })
|
|
5027
|
+
] }) })
|
|
5028
|
+
}
|
|
5029
|
+
);
|
|
5030
|
+
}
|
|
5031
|
+
|
|
5032
|
+
// src/LayoutBlocks.tsx
|
|
5033
|
+
var import_core66 = require("@mantine/core");
|
|
5034
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5035
|
+
function renderBlock(block) {
|
|
5036
|
+
switch (block.type) {
|
|
5037
|
+
case "hero":
|
|
5038
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SectionPanel, { title: String(block.props.title ?? "Hero"), description: String(block.props.description ?? "Hero block"), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Text, { children: String(block.props.body ?? "Composable hero content") }) });
|
|
5039
|
+
case "stats":
|
|
5040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.SimpleGrid, { cols: { base: 1, md: 3 }, children: block.props.items?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Card, { withBorder: true, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(import_core66.Stack, { gap: 2, children: [
|
|
5041
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Text, { size: "sm", c: "dimmed", children: item.label }),
|
|
5042
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Title, { order: 4, children: item.value })
|
|
5043
|
+
] }) }, `${block.id}-${item.label}`)) ?? null });
|
|
5044
|
+
case "cards-grid":
|
|
5045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.SimpleGrid, { cols: { base: 1, md: 2 }, children: block.props.items?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ListingCard, { title: item.title, description: item.description, size: "sm" }, `${block.id}-${item.title}`)) ?? null });
|
|
5046
|
+
case "chart":
|
|
5047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5048
|
+
GdsChart,
|
|
5049
|
+
{
|
|
5050
|
+
type: block.props.chartType ?? "bar",
|
|
5051
|
+
title: String(block.props.title ?? "Chart block"),
|
|
5052
|
+
summary: String(block.props.summary ?? "Block-composed chart summary"),
|
|
5053
|
+
data: block.props.data ?? [{ label: "A", value: 10 }]
|
|
5054
|
+
}
|
|
5055
|
+
);
|
|
5056
|
+
case "cta":
|
|
5057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5058
|
+
ActionBar,
|
|
5059
|
+
{
|
|
5060
|
+
primary: { action: "save" },
|
|
5061
|
+
secondary: [{ action: "cancel" }],
|
|
5062
|
+
tertiary: [{ action: "preview" }]
|
|
5063
|
+
}
|
|
5064
|
+
);
|
|
5065
|
+
case "footer":
|
|
5066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Text, { size: "sm", c: "dimmed", children: String(block.props.text ?? "Footer block") });
|
|
5067
|
+
default:
|
|
5068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Alert, { color: "red", children: "Unsupported block type." });
|
|
5069
|
+
}
|
|
5070
|
+
}
|
|
5071
|
+
function renderGdsLayout(schema) {
|
|
5072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_core66.Stack, { gap: "lg", children: schema.blocks.map((block) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { children: renderBlock(block) }, block.id)) });
|
|
5073
|
+
}
|
|
5074
|
+
|
|
4136
5075
|
// src/ReportingSection.tsx
|
|
4137
|
-
var
|
|
4138
|
-
var
|
|
5076
|
+
var import_core67 = require("@mantine/core");
|
|
5077
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
4139
5078
|
function ReportingSection({
|
|
4140
5079
|
title,
|
|
4141
5080
|
description,
|
|
@@ -4151,26 +5090,26 @@ function ReportingSection({
|
|
|
4151
5090
|
}) {
|
|
4152
5091
|
let stateBlock = null;
|
|
4153
5092
|
if (state === "loading") {
|
|
4154
|
-
stateBlock = /* @__PURE__ */ (0,
|
|
5093
|
+
stateBlock = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "loading", title: "Loading report", description: stateMessage ?? "The reporting surface is synchronizing.", compact: true });
|
|
4155
5094
|
} else if (state === "empty") {
|
|
4156
|
-
stateBlock = /* @__PURE__ */ (0,
|
|
5095
|
+
stateBlock = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "empty", title: "No report data", description: stateMessage ?? "No records match this reporting scope yet.", compact: true });
|
|
4157
5096
|
} else if (state === "error") {
|
|
4158
|
-
stateBlock = /* @__PURE__ */ (0,
|
|
5097
|
+
stateBlock = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "error", title: "Unable to load report", description: stateMessage ?? "The report could not be prepared.", compact: true, action: retryAction });
|
|
4159
5098
|
} else if (state === "below-threshold") {
|
|
4160
|
-
stateBlock = /* @__PURE__ */ (0,
|
|
5099
|
+
stateBlock = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "not-enough-data", title: "Not enough data", description: stateMessage ?? "This report is hidden until the threshold is met.", compact: true });
|
|
4161
5100
|
} else if (state === "permission-limited") {
|
|
4162
|
-
stateBlock = /* @__PURE__ */ (0,
|
|
5101
|
+
stateBlock = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "permission", title: "Permission-limited report", description: stateMessage ?? "Some evidence is hidden by access rules.", compact: true, action: retryAction });
|
|
4163
5102
|
}
|
|
4164
|
-
return /* @__PURE__ */ (0,
|
|
4165
|
-
/* @__PURE__ */ (0,
|
|
4166
|
-
/* @__PURE__ */ (0,
|
|
4167
|
-
/* @__PURE__ */ (0,
|
|
4168
|
-
description ? /* @__PURE__ */ (0,
|
|
5103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_core67.Paper, { withBorder: true, radius: "xl", p: "lg", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_core67.Stack, { gap: "lg", children: [
|
|
5104
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_core67.Group, { justify: "space-between", align: "flex-start", gap: "md", children: [
|
|
5105
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(import_core67.Stack, { gap: 4, children: [
|
|
5106
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_core67.Title, { order: 3, children: title }),
|
|
5107
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_core67.Text, { size: "sm", c: "dimmed", children: description }) : null
|
|
4169
5108
|
] }),
|
|
4170
5109
|
action
|
|
4171
5110
|
] }),
|
|
4172
5111
|
periodControl,
|
|
4173
|
-
(state === "partial" || state === "stale" || state === "filtered") && stateMessage ? /* @__PURE__ */ (0,
|
|
5112
|
+
(state === "partial" || state === "stale" || state === "filtered") && stateMessage ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(StateBlock, { variant: "info", title: state === "partial" ? "Partial report" : state === "stale" ? "Stale report" : "Filtered report", description: stateMessage, compact: true }) : null,
|
|
4174
5113
|
stateBlock,
|
|
4175
5114
|
metrics,
|
|
4176
5115
|
chart,
|
|
@@ -4179,6 +5118,190 @@ function ReportingSection({
|
|
|
4179
5118
|
] }) });
|
|
4180
5119
|
}
|
|
4181
5120
|
|
|
5121
|
+
// src/Notifications.tsx
|
|
5122
|
+
var import_core68 = require("@mantine/core");
|
|
5123
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5124
|
+
var notificationColorMap = {
|
|
5125
|
+
success: "teal",
|
|
5126
|
+
error: "red",
|
|
5127
|
+
warning: "yellow",
|
|
5128
|
+
info: "blue",
|
|
5129
|
+
neutral: "gray"
|
|
5130
|
+
};
|
|
5131
|
+
function severityToStateVariant(severity) {
|
|
5132
|
+
if (severity === "success") return "success";
|
|
5133
|
+
if (severity === "error") return "error";
|
|
5134
|
+
if (severity === "warning") return "not-enough-data";
|
|
5135
|
+
if (severity === "neutral") return "disabled";
|
|
5136
|
+
return "info";
|
|
5137
|
+
}
|
|
5138
|
+
function InlineAlert({
|
|
5139
|
+
title,
|
|
5140
|
+
message,
|
|
5141
|
+
severity = "info",
|
|
5142
|
+
action
|
|
5143
|
+
}) {
|
|
5144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5145
|
+
import_core68.Alert,
|
|
5146
|
+
{
|
|
5147
|
+
variant: "light",
|
|
5148
|
+
color: notificationColorMap[severity],
|
|
5149
|
+
title,
|
|
5150
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(GdsIcons.Info, { size: "1rem" }),
|
|
5151
|
+
role: severity === "error" ? "alert" : "status",
|
|
5152
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Stack, { gap: "xs", children: [
|
|
5153
|
+
message ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Text, { size: "sm", children: message }) : null,
|
|
5154
|
+
action
|
|
5155
|
+
] })
|
|
5156
|
+
}
|
|
5157
|
+
);
|
|
5158
|
+
}
|
|
5159
|
+
function BannerNotice({
|
|
5160
|
+
eyebrow,
|
|
5161
|
+
title,
|
|
5162
|
+
message,
|
|
5163
|
+
severity = "info",
|
|
5164
|
+
action
|
|
5165
|
+
}) {
|
|
5166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Paper, { withBorder: true, radius: "lg", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Stack, { gap: "xs", children: [
|
|
5167
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Group, { justify: "space-between", align: "center", children: [
|
|
5168
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Group, { gap: "xs", children: [
|
|
5169
|
+
eyebrow ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Badge, { variant: "light", children: eyebrow }) : null,
|
|
5170
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Badge, { variant: "light", color: notificationColorMap[severity], children: severityToStateVariant(severity).replace("-", " ") })
|
|
5171
|
+
] }),
|
|
5172
|
+
action
|
|
5173
|
+
] }),
|
|
5174
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Title, { order: 4, children: title }),
|
|
5175
|
+
message ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Text, { size: "sm", c: "dimmed", children: message }) : null
|
|
5176
|
+
] }) });
|
|
5177
|
+
}
|
|
5178
|
+
function NotificationCenterView({
|
|
5179
|
+
notifications,
|
|
5180
|
+
onDismiss,
|
|
5181
|
+
onClear,
|
|
5182
|
+
title = "Notifications",
|
|
5183
|
+
emptyMessage = "No active notifications."
|
|
5184
|
+
}) {
|
|
5185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Paper, { withBorder: true, radius: "lg", p: "md", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Stack, { gap: "md", children: [
|
|
5186
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Group, { justify: "space-between", align: "center", children: [
|
|
5187
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Title, { order: 4, children: title }),
|
|
5188
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Button, { size: "xs", variant: "subtle", onClick: onClear, disabled: notifications.length === 0 || !onClear, children: "Clear all" })
|
|
5189
|
+
] }),
|
|
5190
|
+
notifications.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Text, { size: "sm", c: "dimmed", children: emptyMessage }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Stack, { gap: "sm", children: notifications.map((item) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5191
|
+
InlineAlert,
|
|
5192
|
+
{
|
|
5193
|
+
severity: item.severity,
|
|
5194
|
+
title: item.title,
|
|
5195
|
+
message: item.message,
|
|
5196
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_core68.Group, { gap: "xs", children: [
|
|
5197
|
+
item.actions?.map((action) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Button, { size: "xs", variant: "default", onClick: action.onClick, children: action.label }, action.id)),
|
|
5198
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_core68.Button, { size: "xs", variant: "subtle", onClick: () => onDismiss?.(item.id), disabled: !onDismiss, children: "Dismiss" })
|
|
5199
|
+
] })
|
|
5200
|
+
},
|
|
5201
|
+
item.id
|
|
5202
|
+
)) })
|
|
5203
|
+
] }) });
|
|
5204
|
+
}
|
|
5205
|
+
|
|
5206
|
+
// src/Notifications.client.tsx
|
|
5207
|
+
var import_react16 = require("react");
|
|
5208
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5209
|
+
var GdsNotificationContext = (0, import_react16.createContext)(null);
|
|
5210
|
+
function GdsNotificationProvider({ children }) {
|
|
5211
|
+
const [notifications, setNotifications] = (0, import_react16.useState)([]);
|
|
5212
|
+
const value = (0, import_react16.useMemo)(() => ({
|
|
5213
|
+
notifications,
|
|
5214
|
+
notify: (message) => {
|
|
5215
|
+
setNotifications((current) => {
|
|
5216
|
+
const rest = current.filter((item) => item.id !== message.id);
|
|
5217
|
+
return [...rest, message];
|
|
5218
|
+
});
|
|
5219
|
+
if (typeof message.autoCloseMs === "number" && message.autoCloseMs > 0) {
|
|
5220
|
+
window.setTimeout(() => {
|
|
5221
|
+
setNotifications((current) => current.filter((item) => item.id !== message.id));
|
|
5222
|
+
}, message.autoCloseMs);
|
|
5223
|
+
}
|
|
5224
|
+
},
|
|
5225
|
+
dismiss: (id) => {
|
|
5226
|
+
setNotifications((current) => current.filter((item) => item.id !== id));
|
|
5227
|
+
},
|
|
5228
|
+
clear: () => {
|
|
5229
|
+
setNotifications([]);
|
|
5230
|
+
}
|
|
5231
|
+
}), [notifications]);
|
|
5232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(GdsNotificationContext.Provider, { value, children });
|
|
5233
|
+
}
|
|
5234
|
+
function useGdsNotifications() {
|
|
5235
|
+
const context = (0, import_react16.useContext)(GdsNotificationContext);
|
|
5236
|
+
if (!context) {
|
|
5237
|
+
throw new Error("useGdsNotifications must be used within GdsNotificationProvider.");
|
|
5238
|
+
}
|
|
5239
|
+
return context;
|
|
5240
|
+
}
|
|
5241
|
+
function NotificationCenter({
|
|
5242
|
+
title = "Notifications",
|
|
5243
|
+
emptyMessage = "No active notifications."
|
|
5244
|
+
}) {
|
|
5245
|
+
const { notifications, dismiss, clear } = useGdsNotifications();
|
|
5246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5247
|
+
NotificationCenterView,
|
|
5248
|
+
{
|
|
5249
|
+
title,
|
|
5250
|
+
emptyMessage,
|
|
5251
|
+
notifications,
|
|
5252
|
+
onDismiss: dismiss,
|
|
5253
|
+
onClear: clear
|
|
5254
|
+
}
|
|
5255
|
+
);
|
|
5256
|
+
}
|
|
5257
|
+
|
|
5258
|
+
// src/Telemetry.client.tsx
|
|
5259
|
+
var import_react17 = require("react");
|
|
5260
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5261
|
+
var GdsTelemetryContext = (0, import_react17.createContext)(null);
|
|
5262
|
+
function hashToUnit(value) {
|
|
5263
|
+
let hash = 0;
|
|
5264
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
5265
|
+
hash = (hash << 5) - hash + value.charCodeAt(index);
|
|
5266
|
+
hash |= 0;
|
|
5267
|
+
}
|
|
5268
|
+
return Math.abs(hash % 1e3) / 1e3;
|
|
5269
|
+
}
|
|
5270
|
+
function redactContext(context) {
|
|
5271
|
+
if (!context) {
|
|
5272
|
+
return context;
|
|
5273
|
+
}
|
|
5274
|
+
return Object.entries(context).reduce((acc, [key, value]) => {
|
|
5275
|
+
if (key.toLowerCase().includes("email") || key.toLowerCase().includes("name") || key.toLowerCase().includes("phone")) {
|
|
5276
|
+
return acc;
|
|
5277
|
+
}
|
|
5278
|
+
acc[key] = value;
|
|
5279
|
+
return acc;
|
|
5280
|
+
}, {});
|
|
5281
|
+
}
|
|
5282
|
+
function GdsTelemetryProvider({ children, sink, sampleRate = 1 }) {
|
|
5283
|
+
const value = (0, import_react17.useMemo)(() => ({
|
|
5284
|
+
emit: (event) => {
|
|
5285
|
+
if (hashToUnit(event.correlationId) > sampleRate) {
|
|
5286
|
+
return;
|
|
5287
|
+
}
|
|
5288
|
+
sink?.({
|
|
5289
|
+
...event,
|
|
5290
|
+
context: redactContext(event.context),
|
|
5291
|
+
ts: Date.now()
|
|
5292
|
+
});
|
|
5293
|
+
}
|
|
5294
|
+
}), [sampleRate, sink]);
|
|
5295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(GdsTelemetryContext.Provider, { value, children });
|
|
5296
|
+
}
|
|
5297
|
+
function useGdsTelemetry() {
|
|
5298
|
+
const context = (0, import_react17.useContext)(GdsTelemetryContext);
|
|
5299
|
+
if (!context) {
|
|
5300
|
+
throw new Error("useGdsTelemetry must be used within GdsTelemetryProvider.");
|
|
5301
|
+
}
|
|
5302
|
+
return context;
|
|
5303
|
+
}
|
|
5304
|
+
|
|
4182
5305
|
// src/locales/ar.ts
|
|
4183
5306
|
var ar = {
|
|
4184
5307
|
"gds.action.settings": "\u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A",
|
|
@@ -5487,14 +6610,22 @@ function getGdsMessages(locale) {
|
|
|
5487
6610
|
AccessRecoveryPanel,
|
|
5488
6611
|
AccessSummary,
|
|
5489
6612
|
ActionBar,
|
|
6613
|
+
ActiveFilterChips,
|
|
6614
|
+
AdvancedDataTable,
|
|
5490
6615
|
ArticleShell,
|
|
6616
|
+
AsyncSurface,
|
|
5491
6617
|
AuthShell,
|
|
6618
|
+
BannerNotice,
|
|
5492
6619
|
BrowseSurface,
|
|
6620
|
+
BulkActionsBar,
|
|
5493
6621
|
ChartTokenPanel,
|
|
5494
6622
|
ChoiceChip,
|
|
6623
|
+
CommandPalette,
|
|
6624
|
+
CommandRegistryProvider,
|
|
5495
6625
|
ConfirmDialog,
|
|
5496
6626
|
ConsumerDashboardGrid,
|
|
5497
6627
|
ConsumerSection,
|
|
6628
|
+
CountBadge,
|
|
5498
6629
|
CtaButtonGroup,
|
|
5499
6630
|
DataToolbar,
|
|
5500
6631
|
DetailProfileShell,
|
|
@@ -5509,15 +6640,26 @@ function getGdsMessages(locale) {
|
|
|
5509
6640
|
FeatureBand,
|
|
5510
6641
|
FilterDrawer,
|
|
5511
6642
|
FoodMenuSection,
|
|
6643
|
+
FormErrorSummary,
|
|
5512
6644
|
FormField,
|
|
5513
6645
|
GameBoardTile,
|
|
6646
|
+
GdsChart,
|
|
6647
|
+
GdsFormProvider,
|
|
5514
6648
|
GdsIcons,
|
|
6649
|
+
GdsNotificationProvider,
|
|
6650
|
+
GdsTelemetryProvider,
|
|
5515
6651
|
GdsVocabulary,
|
|
6652
|
+
InlineAlert,
|
|
6653
|
+
LabelTag,
|
|
5516
6654
|
ListingCard,
|
|
6655
|
+
ListingProvider,
|
|
5517
6656
|
MapPanel,
|
|
5518
6657
|
MediaCard,
|
|
5519
6658
|
MediaField,
|
|
5520
6659
|
MetricCard,
|
|
6660
|
+
NotificationCenter,
|
|
6661
|
+
NotificationCenterView,
|
|
6662
|
+
OverlayManagerProvider,
|
|
5521
6663
|
PROVIDER_IDENTITY_REGISTRY,
|
|
5522
6664
|
PageHeader,
|
|
5523
6665
|
PeriodSelector,
|
|
@@ -5539,6 +6681,7 @@ function getGdsMessages(locale) {
|
|
|
5539
6681
|
ReferenceSection,
|
|
5540
6682
|
ReferenceThemeExplorer,
|
|
5541
6683
|
ReportingSection,
|
|
6684
|
+
ResultSummary,
|
|
5542
6685
|
SectionPanel,
|
|
5543
6686
|
SemanticButton,
|
|
5544
6687
|
ShareButtonGroup,
|
|
@@ -5547,17 +6690,22 @@ function getGdsMessages(locale) {
|
|
|
5547
6690
|
SidebarNavSection,
|
|
5548
6691
|
SimpleDataTable,
|
|
5549
6692
|
SocialAuthButtons,
|
|
6693
|
+
SortMenu,
|
|
5550
6694
|
StateBlock,
|
|
5551
6695
|
StatsSection,
|
|
5552
6696
|
StatusBadge,
|
|
5553
6697
|
ThemeToggle,
|
|
5554
6698
|
UploadDropzone,
|
|
6699
|
+
ValidatedFieldMessage,
|
|
5555
6700
|
ar,
|
|
5556
6701
|
createGdsVocabularyPack,
|
|
5557
6702
|
de,
|
|
5558
6703
|
en,
|
|
5559
6704
|
es,
|
|
5560
6705
|
fr,
|
|
6706
|
+
gdsCardSizePaddingMap,
|
|
6707
|
+
gdsCardTitleOrderMap,
|
|
6708
|
+
gdsFormReducer,
|
|
5561
6709
|
gdsLocales,
|
|
5562
6710
|
getGdsMessages,
|
|
5563
6711
|
getProviderIdentityLabel,
|
|
@@ -5569,9 +6717,19 @@ function getGdsMessages(locale) {
|
|
|
5569
6717
|
hu,
|
|
5570
6718
|
isPresentationMode,
|
|
5571
6719
|
it,
|
|
6720
|
+
listingQueryReducer,
|
|
5572
6721
|
mergeGdsVocabularyPacks,
|
|
6722
|
+
renderGdsLayout,
|
|
5573
6723
|
resolveAccentPanelStyles,
|
|
5574
6724
|
resolveSemanticActionConfig,
|
|
5575
6725
|
resolveSurfacePresentationStyles,
|
|
5576
|
-
ru
|
|
6726
|
+
ru,
|
|
6727
|
+
useCommandLauncher,
|
|
6728
|
+
useDiscoveryShellState,
|
|
6729
|
+
useGdsForm,
|
|
6730
|
+
useGdsFormSnapshot,
|
|
6731
|
+
useGdsNotifications,
|
|
6732
|
+
useGdsTelemetry,
|
|
6733
|
+
useListingState,
|
|
6734
|
+
useOverlayManager
|
|
5577
6735
|
});
|